(deps commandDeps)
| 237 | } |
| 238 | |
| 239 | func newAgentSoulHistoryCommand(deps commandDeps) *cobra.Command { |
| 240 | var ( |
| 241 | limit int |
| 242 | cursor string |
| 243 | ) |
| 244 | cmd := &cobra.Command{ |
| 245 | Use: "history <agent>", |
| 246 | Short: "List managed Soul authoring revisions", |
| 247 | Example: " agh agent soul history coder --limit 10 --workspace checkout-api --json", |
| 248 | Args: exactOneNonBlankArg(), |
| 249 | RunE: func(cmd *cobra.Command, args []string) error { |
| 250 | client, err := clientFromDeps(deps) |
| 251 | if err != nil { |
| 252 | return err |
| 253 | } |
| 254 | workspace, err := commandWorkspaceFlag(cmd) |
| 255 | if err != nil { |
| 256 | return err |
| 257 | } |
| 258 | record, err := client.ListAgentSoulHistory(cmd.Context(), args[0], AgentSoulHistoryRequest{ |
| 259 | WorkspaceID: workspace, |
| 260 | AgentName: args[0], |
| 261 | Limit: limit, |
| 262 | Cursor: strings.TrimSpace(cursor), |
| 263 | }) |
| 264 | if err != nil { |
| 265 | return err |
| 266 | } |
| 267 | return writeCommandOutput(cmd, agentSoulHistoryBundle(record)) |
| 268 | }, |
| 269 | } |
| 270 | addWorkspaceFlag(cmd) |
| 271 | cmd.Flags().IntVar(&limit, "limit", 0, "Maximum number of revisions to return") |
| 272 | cmd.Flags().StringVar(&cursor, "cursor", "", "Revision cursor") |
| 273 | return cmd |
| 274 | } |
| 275 | |
| 276 | func newAgentSoulRollbackCommand(deps commandDeps) *cobra.Command { |
| 277 | var ( |
no test coverage detected