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

Function newAgentSoulHistoryCommand

internal/cli/authored_context.go:239–274  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

237}
238
239func 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
276func newAgentSoulRollbackCommand(deps commandDeps) *cobra.Command {
277 var (

Callers 1

newAgentSoulCommandFunction · 0.85

Calls 7

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
commandWorkspaceFlagFunction · 0.85
writeCommandOutputFunction · 0.85
agentSoulHistoryBundleFunction · 0.85
addWorkspaceFlagFunction · 0.85
ListAgentSoulHistoryMethod · 0.65

Tested by

no test coverage detected