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

Function newMemoryResetCommand

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

Source from the content-addressed store, hash-verified

577}
578
579func newMemoryResetCommand(deps commandDeps) *cobra.Command {
580 var flags memorySelectorFlags
581 var includeDaily bool
582 var dryRun bool
583
584 cmd := &cobra.Command{
585 Use: "reset",
586 Short: "Reset derived Memory v2 state through the daemon",
587 Args: cobra.NoArgs,
588 RunE: func(cmd *cobra.Command, _ []string) error {
589 client, err := clientFromDeps(deps)
590 if err != nil {
591 return err
592 }
593 selector, err := resolveMemorySelectorFlags(deps, flags, memorySelectorOptions{DefaultWorkspace: true})
594 if err != nil {
595 return err
596 }
597 response, err := client.ResetMemory(cmd.Context(), MemoryResetRequest{
598 Scope: selector.Scope,
599 WorkspaceID: selector.WorkspaceID,
600 AgentName: selector.AgentName,
601 AgentTier: selector.AgentTier,
602 DerivedOnly: !includeDaily,
603 Confirm: !dryRun,
604 })
605 if err != nil {
606 return err
607 }
608 return writeCommandOutput(cmd, memoryObjectBundle("Memory Reset", response))
609 },
610 }
611 addMemorySelectorFlags(cmd, &flags)
612 cmd.Flags().BoolVar(&includeDaily, "include-daily", false, "Include daily memory artifacts")
613 cmd.Flags().BoolVar(&dryRun, "dry-run", false, "Show reset work without applying it")
614 return cmd
615}
616
617func newMemoryReloadCommand(deps commandDeps) *cobra.Command {
618 var flags memorySelectorFlags

Callers 1

newMemoryCommandFunction · 0.85

Calls 6

clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
memoryObjectBundleFunction · 0.85
addMemorySelectorFlagsFunction · 0.85
ResetMemoryMethod · 0.65

Tested by

no test coverage detected