(deps commandDeps)
| 577 | } |
| 578 | |
| 579 | func 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 | |
| 617 | func newMemoryReloadCommand(deps commandDeps) *cobra.Command { |
| 618 | var flags memorySelectorFlags |
no test coverage detected