MCPcopy Create free account
hub / github.com/apache/maka / buildTaskUpdateTool

Function buildTaskUpdateTool

packages/runtime/src/task-ledger-tools.ts:86–222  ·  view source on GitHub ↗
(
  store: TaskLedgerStore,
  name: string,
)

Source from the content-addressed store, hash-verified

84}
85
86function buildTaskUpdateTool(
87 store: TaskLedgerStore,
88 name: string,
89): MakaTool<
90 {
91 id: string;
92 status?: (typeof TASK_STATUSES)[number];
93 subject?: string;
94 blockedReason?: string;
95 failureReason?: string;
96 completionEvidence?: string;
97 explicitReopen?: boolean;
98 },
99 string
100> {
101 return {
102 name,
103 displayName: 'Task Update',
104 description:
105 'Update a task in the session task ledger by id. Mark tasks in_progress when you start them; ' +
106 'blocked, failed, and completed updates require a reason or evidence field. ' +
107 'Reopening completed/cancelled tasks requires explicitReopen=true.',
108 parameters: z
109 .object({
110 id: z
111 .string()
112 .min(1)
113 .max(TASK_ID_MAX_CHARS)
114 .refine(
115 isSafeTaskId,
116 'Task reference must be a UUID or short key from the current ledger.',
117 )
118 .describe('Task UUID or short key.'),
119 status: z.enum(TASK_STATUSES).optional().describe('New task status.'),
120 subject: z
121 .string()
122 .trim()
123 .min(1)
124 .max(TASK_SUBJECT_MAX_CHARS)
125 .optional()
126 .describe(`Revised task description (max ${TASK_SUBJECT_MAX_CHARS} characters).`),
127 blockedReason: z
128 .string()
129 .trim()
130 .min(1)
131 .max(TASK_EVIDENCE_MAX_CHARS)
132 .optional()
133 .describe(
134 'Required when setting status to blocked. Explain the external input, dependency, or permission needed.',
135 ),
136 failureReason: z
137 .string()
138 .trim()
139 .min(1)
140 .max(TASK_EVIDENCE_MAX_CHARS)
141 .optional()
142 .describe(
143 'Required when setting status to failed. Explain why the task cannot be completed.',

Callers 1

buildTaskLedgerToolsFunction · 0.85

Calls 3

renderSafeTaskLedgerTextFunction · 0.90
updateMethod · 0.65
trimMethod · 0.45

Tested by

no test coverage detected