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

Function newTaskRunCompleteCommand

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

Source from the content-addressed store, hash-verified

2554}
2555
2556func newTaskRunCompleteCommand(deps commandDeps) *cobra.Command {
2557 var resultRaw string
2558
2559 cmd := &cobra.Command{
2560 Use: "complete <run-id>",
2561 Short: "Complete a running task run",
2562 Args: exactOneNonBlankArg(),
2563 RunE: func(cmd *cobra.Command, args []string) error {
2564 client, err := clientFromDeps(deps)
2565 if err != nil {
2566 return err
2567 }
2568
2569 request := CompleteTaskRunRequest{}
2570 if cmd.Flags().Changed("result") {
2571 request.Result, err = parseJSONFlag("result", resultRaw)
2572 if err != nil {
2573 return err
2574 }
2575 }
2576
2577 run, err := client.CompleteTaskRun(cmd.Context(), args[0], request)
2578 if err != nil {
2579 return err
2580 }
2581 return writeCommandOutput(cmd, taskRunBundle(run))
2582 },
2583 }
2584 cmd.Flags().StringVar(&resultRaw, "result", "", "Optional result JSON")
2585 return cmd
2586}
2587
2588func newTaskRunFailCommand(deps commandDeps) *cobra.Command {
2589 var (

Callers 1

newTaskRunCommandFunction · 0.85

Calls 6

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
parseJSONFlagFunction · 0.85
writeCommandOutputFunction · 0.85
taskRunBundleFunction · 0.85
CompleteTaskRunMethod · 0.65

Tested by

no test coverage detected