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

Function newMemoryDecisionsRevertCommand

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

Source from the content-addressed store, hash-verified

744}
745
746func newMemoryDecisionsRevertCommand(deps commandDeps) *cobra.Command {
747 var reason string
748 var dryRun bool
749
750 cmd := &cobra.Command{
751 Use: "revert <id>",
752 Short: "Revert one Memory v2 controller decision",
753 Args: exactOneNonBlankArg(),
754 RunE: func(cmd *cobra.Command, args []string) error {
755 client, err := clientFromDeps(deps)
756 if err != nil {
757 return err
758 }
759 response, err := client.RevertMemoryDecision(
760 cmd.Context(),
761 strings.TrimSpace(args[0]),
762 MemoryDecisionRevertRequest{
763 Reason: strings.TrimSpace(reason),
764 DryRun: dryRun,
765 },
766 )
767 if err != nil {
768 return err
769 }
770 return writeCommandOutput(cmd, memoryDecisionRevertBundle(response))
771 },
772 }
773 cmd.Flags().StringVar(&reason, memoryReasonKey, "", "Operator-visible revert reason")
774 cmd.Flags().BoolVar(&dryRun, "dry-run", false, "Return the revert decision without applying it")
775 return cmd
776}
777
778func newMemoryRecallCommand(deps commandDeps) *cobra.Command {
779 cmd := &cobra.Command{

Callers 1

Calls 5

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
RevertMemoryDecisionMethod · 0.65

Tested by

no test coverage detected