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

Method handleTasks

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

Source from the content-addressed store, hash-verified

16)
17
18func (h *HostAPIHandler) handleTasks(ctx context.Context, raw json.RawMessage) (any, error) {
19 var params hostAPITasksParams
20 if err := decodeHostAPIParams(raw, &params); err != nil {
21 return nil, err
22 }
23
24 manager, actor, err := h.taskManagerAndActor(ctx)
25 if err != nil {
26 return nil, err
27 }
28 query, err := h.taskQueryFromParams(ctx, params)
29 if err != nil {
30 return nil, err
31 }
32 tasks, err := listTasksWithDraftCompensation(
33 ctx,
34 query,
35 params,
36 func(ctx context.Context, query taskpkg.Query) ([]taskpkg.Summary, error) {
37 return manager.ListTasks(ctx, query, actor)
38 },
39 )
40 if err != nil {
41 return nil, mapTaskRPCError("", err)
42 }
43 return taskSummaryPayloadsFromSummaries(tasks), nil
44}
45
46func (h *HostAPIHandler) handleTasksGet(ctx context.Context, raw json.RawMessage) (any, error) {
47 var params hostAPITaskTargetParams

Callers

nothing calls this directly

Calls 7

taskManagerAndActorMethod · 0.95
taskQueryFromParamsMethod · 0.95
decodeHostAPIParamsFunction · 0.85
mapTaskRPCErrorFunction · 0.85
ListTasksMethod · 0.65

Tested by

no test coverage detected