MCPcopy Create free account
hub / github.com/compozy/agh / newMemoryExtractorReplayCommand

Function newMemoryExtractorReplayCommand

internal/cli/memory.go:1027–1054  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

1025}
1026
1027func newMemoryExtractorReplayCommand(deps commandDeps) *cobra.Command {
1028 var sessionID string
1029
1030 cmd := &cobra.Command{
1031 Use: "replay --session <id>",
1032 Short: "Replay Memory v2 extractor work",
1033 Args: cobra.NoArgs,
1034 RunE: func(cmd *cobra.Command, _ []string) error {
1035 client, err := clientFromDeps(deps)
1036 if err != nil {
1037 return err
1038 }
1039 if strings.TrimSpace(sessionID) == "" {
1040 return errors.New("memory.extractor.session_required: --session is required")
1041 }
1042 response, err := client.RetryMemoryExtractor(cmd.Context(), MemoryExtractorRetryRequest{
1043 SessionID: strings.TrimSpace(sessionID),
1044 })
1045 if err != nil {
1046 return err
1047 }
1048 return writeCommandOutput(cmd, memoryObjectBundle("Memory Extractor Replay", response))
1049 },
1050 }
1051 cmd.Flags().StringVar(&sessionID, "session", "", "Session whose extractor work should be replayed")
1052 mustMarkFlagRequired(cmd, "session")
1053 return cmd
1054}
1055
1056func newMemoryExtractorDrainCommand(deps commandDeps) *cobra.Command {
1057 var timeoutRaw string

Callers 1

Calls 5

clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
memoryObjectBundleFunction · 0.85
mustMarkFlagRequiredFunction · 0.85
RetryMemoryExtractorMethod · 0.65

Tested by

no test coverage detected