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

Function newTaskRunClaimCommand

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

Source from the content-addressed store, hash-verified

2468}
2469
2470func newTaskRunClaimCommand(deps commandDeps) *cobra.Command {
2471 var idempotencyKey string
2472
2473 cmd := &cobra.Command{
2474 Use: "claim <run-id>",
2475 Short: "Claim a queued task run",
2476 Args: exactOneNonBlankArg(),
2477 RunE: func(cmd *cobra.Command, args []string) error {
2478 client, err := clientFromDeps(deps)
2479 if err != nil {
2480 return err
2481 }
2482
2483 run, err := client.ClaimTaskRun(cmd.Context(), args[0], ClaimTaskRunRequest{
2484 IdempotencyKey: strings.TrimSpace(idempotencyKey),
2485 })
2486 if err != nil {
2487 return err
2488 }
2489 return writeCommandOutput(cmd, taskRunBundle(run))
2490 },
2491 }
2492 cmd.Flags().StringVar(&idempotencyKey, "idempotency-key", "", "Optional idempotency key")
2493 return cmd
2494}
2495
2496func newTaskRunStartCommand(deps commandDeps) *cobra.Command {
2497 var idempotencyKey string

Callers 1

newTaskRunCommandFunction · 0.85

Calls 5

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
taskRunBundleFunction · 0.85
ClaimTaskRunMethod · 0.65

Tested by

no test coverage detected