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

Function newAgentSoulDeleteCommand

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

Source from the content-addressed store, hash-verified

201}
202
203func newAgentSoulDeleteCommand(deps commandDeps) *cobra.Command {
204 var expectedDigest string
205 cmd := &cobra.Command{
206 Use: "delete <agent>",
207 Short: "Delete SOUL.md through managed authoring",
208 Example: " agh agent soul delete coder --expected-digest sha256:old --workspace checkout-api --json",
209 Args: exactOneNonBlankArg(),
210 RunE: func(cmd *cobra.Command, args []string) error {
211 client, err := clientFromDeps(deps)
212 if err != nil {
213 return err
214 }
215 workspace, err := commandWorkspaceFlag(cmd)
216 if err != nil {
217 return err
218 }
219 digest, err := changedStringFlag(cmd, "expected-digest", expectedDigest)
220 if err != nil {
221 return err
222 }
223 record, err := client.DeleteAgentSoul(cmd.Context(), args[0], AgentSoulDeleteRequest{
224 WorkspaceID: workspace,
225 AgentName: args[0],
226 ExpectedDigest: digest,
227 })
228 if err != nil {
229 return err
230 }
231 return writeCommandOutput(cmd, agentSoulMutationBundle(&record))
232 },
233 }
234 addWorkspaceFlag(cmd)
235 cmd.Flags().StringVar(&expectedDigest, "expected-digest", "", "Expected current Soul digest for CAS")
236 return cmd
237}
238
239func newAgentSoulHistoryCommand(deps commandDeps) *cobra.Command {
240 var (

Callers 1

newAgentSoulCommandFunction · 0.85

Calls 8

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
commandWorkspaceFlagFunction · 0.85
changedStringFlagFunction · 0.85
writeCommandOutputFunction · 0.85
agentSoulMutationBundleFunction · 0.85
addWorkspaceFlagFunction · 0.85
DeleteAgentSoulMethod · 0.65

Tested by

no test coverage detected