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

Method handleTasksGet

internal/extension/host_api_tasks.go:46–66  ·  view source on GitHub ↗
(ctx context.Context, raw json.RawMessage)

Source from the content-addressed store, hash-verified

44}
45
46func (h *HostAPIHandler) handleTasksGet(ctx context.Context, raw json.RawMessage) (any, error) {
47 var params hostAPITaskTargetParams
48 if err := decodeHostAPIParams(raw, &params); err != nil {
49 return nil, err
50 }
51 taskID := strings.TrimSpace(params.ID)
52 if taskID == "" {
53 return nil, invalidParamsRPCError(errors.New("id is required"))
54 }
55
56 manager, actor, err := h.taskManagerAndActor(ctx)
57 if err != nil {
58 return nil, err
59 }
60
61 view, err := manager.GetTask(ctx, taskID, actor)
62 if err != nil {
63 return nil, mapTaskRPCError(taskID, err)
64 }
65 return taskDetailPayloadFromView(view), nil
66}
67
68func (h *HostAPIHandler) handleTasksTimeline(ctx context.Context, raw json.RawMessage) (any, error) {
69 var params hostAPITaskTimelineParams

Callers

nothing calls this directly

Calls 6

taskManagerAndActorMethod · 0.95
decodeHostAPIParamsFunction · 0.85
invalidParamsRPCErrorFunction · 0.85
mapTaskRPCErrorFunction · 0.85
GetTaskMethod · 0.65

Tested by

no test coverage detected