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

Function newTaskUnblockCommand

internal/cli/task.go:1477–1520  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

1475}
1476
1477func newTaskUnblockCommand(deps commandDeps) *cobra.Command {
1478 var blockID string
1479 var note string
1480 var asAgent bool
1481 cmd := &cobra.Command{
1482 Use: "unblock <id>",
1483 Short: "Clear one task block",
1484 Args: exactOneNonBlankArg(),
1485 RunE: func(cmd *cobra.Command, args []string) error {
1486 if strings.TrimSpace(blockID) == "" {
1487 return errors.New("cli: --block is required")
1488 }
1489 client, err := clientFromDeps(deps)
1490 if err != nil {
1491 return err
1492 }
1493 request := ClearTaskBlockRequest{Note: strings.TrimSpace(note)}
1494 var block TaskBlockRecord
1495 if asAgent {
1496 credentials, credErr := requireAgentCommandIdentity(
1497 cmd.Context(),
1498 deps,
1499 client,
1500 agentActionCLI("task.unblock"),
1501 )
1502 if credErr != nil {
1503 return credErr
1504 }
1505 block, err = client.ClearTaskBlockAsAgent(cmd.Context(), args[0], blockID, request, credentials)
1506 } else {
1507 block, err = client.ClearTaskBlock(cmd.Context(), args[0], blockID, request)
1508 }
1509 if err != nil {
1510 return err
1511 }
1512 return writeCommandOutput(cmd, taskBlockBundle(block))
1513 },
1514 }
1515 cmd.Flags().StringVar(&blockID, "block", "", "Task block ID")
1516 cmd.Flags().StringVar(&note, "note", "", "Optional clear note")
1517 cmd.Flags().BoolVar(&asAgent, "as-agent", false, "Clear using the current AGH-managed agent session identity")
1518 mustMarkFlagRequired(cmd, "block")
1519 return cmd
1520}
1521
1522func newTaskBlocksCommand(deps commandDeps) *cobra.Command {
1523 var includeCleared bool

Callers 1

newTaskCommandFunction · 0.85

Calls 9

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
agentActionCLIFunction · 0.85
writeCommandOutputFunction · 0.85
taskBlockBundleFunction · 0.85
mustMarkFlagRequiredFunction · 0.85
ClearTaskBlockAsAgentMethod · 0.65
ClearTaskBlockMethod · 0.65

Tested by

no test coverage detected