(deps commandDeps)
| 120 | } |
| 121 | |
| 122 | func newAgentSoulValidateCommand(deps commandDeps) *cobra.Command { |
| 123 | var input authoredBodyInput |
| 124 | cmd := &cobra.Command{ |
| 125 | Use: "validate <agent>", |
| 126 | Short: "Validate a proposed Soul body or the current SOUL.md", |
| 127 | Example: " agh agent soul validate coder --file SOUL.md --workspace checkout-api --json", |
| 128 | Args: exactOneNonBlankArg(), |
| 129 | RunE: func(cmd *cobra.Command, args []string) error { |
| 130 | client, err := clientFromDeps(deps) |
| 131 | if err != nil { |
| 132 | return err |
| 133 | } |
| 134 | workspace, err := commandWorkspaceFlag(cmd) |
| 135 | if err != nil { |
| 136 | return err |
| 137 | } |
| 138 | body, err := readAuthoredBody(cmd, input, false) |
| 139 | if err != nil { |
| 140 | return err |
| 141 | } |
| 142 | record, err := client.ValidateAgentSoul(cmd.Context(), args[0], AgentSoulValidateRequest{ |
| 143 | WorkspaceID: workspace, |
| 144 | AgentName: args[0], |
| 145 | Body: body, |
| 146 | }) |
| 147 | if err != nil { |
| 148 | return err |
| 149 | } |
| 150 | return writeCommandOutput(cmd, agentSoulBundle(record)) |
| 151 | }, |
| 152 | } |
| 153 | addWorkspaceFlag(cmd) |
| 154 | addAuthoredBodyFlags(cmd, &input) |
| 155 | return cmd |
| 156 | } |
| 157 | |
| 158 | func newAgentSoulWriteCommand(deps commandDeps) *cobra.Command { |
| 159 | var ( |
no test coverage detected