@becklabs/beck-mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -0
- package/dist/client.d.ts +151 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +217 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/resources.d.ts +18 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +92 -0
- package/dist/resources.js.map +1 -0
- package/dist/tools/documents.d.ts +30 -0
- package/dist/tools/documents.d.ts.map +1 -0
- package/dist/tools/documents.js +184 -0
- package/dist/tools/documents.js.map +1 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +739 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/tasks.d.ts +70 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +474 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/types.d.ts +281 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
import * as taskTools from "./tasks.js";
|
|
2
|
+
import * as documentTools from "./documents.js";
|
|
3
|
+
/**
|
|
4
|
+
* Define all MCP tools available to Claude Code
|
|
5
|
+
*/
|
|
6
|
+
export const TOOLS = [
|
|
7
|
+
{
|
|
8
|
+
name: "whoami",
|
|
9
|
+
description: "Return the identity behind this API token (name, email, user id). Use to know who comments and progress updates will be attributed to.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {},
|
|
13
|
+
required: [],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "list_workspaces",
|
|
18
|
+
description: "List Beck workspaces this token can see. Tokens are org-scoped — this is not a default workspace. If the human named one, use only that id. If more than one and none named, ask. create_workspace only if they asked for a new one.",
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {},
|
|
22
|
+
required: [],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "create_workspace",
|
|
27
|
+
description: "Create a workspace in the current org or personal account. Default: only when the human asked for a new workspace. If they named an existing one, bind to that instead. An empty bound workspace gets a prd document, not a second workspace. The human's prompt overrides this default.",
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
name: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Workspace name",
|
|
34
|
+
},
|
|
35
|
+
description: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Optional description",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: ["name"],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "list_tasks",
|
|
45
|
+
description: "List tasks in a workspace. Can filter by status, epic, or show icebox items.",
|
|
46
|
+
inputSchema: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
workspaceId: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "The workspace ID to list tasks from",
|
|
52
|
+
},
|
|
53
|
+
status: {
|
|
54
|
+
type: "string",
|
|
55
|
+
enum: ["not_started", "started", "ready_for_review", "completed"],
|
|
56
|
+
description: "Filter by task status",
|
|
57
|
+
},
|
|
58
|
+
epicId: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description: "Filter by epic ID",
|
|
61
|
+
},
|
|
62
|
+
isIcebox: {
|
|
63
|
+
type: "boolean",
|
|
64
|
+
description: "If true, list icebox items instead of backlog",
|
|
65
|
+
},
|
|
66
|
+
assigneeId: {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "Filter by assignee user ID",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
required: ["workspaceId"],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "get_task",
|
|
76
|
+
description: "Get full details of a task including description, acceptance criteria, and comments.",
|
|
77
|
+
inputSchema: {
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: {
|
|
80
|
+
taskId: {
|
|
81
|
+
type: "string",
|
|
82
|
+
description: "The task ID to retrieve",
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
required: ["taskId"],
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "start_task",
|
|
90
|
+
description: "Start working on a task. This assigns the task to you and changes status to 'started'. Use this before beginning implementation work.",
|
|
91
|
+
inputSchema: {
|
|
92
|
+
type: "object",
|
|
93
|
+
properties: {
|
|
94
|
+
taskId: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "The task ID to start",
|
|
97
|
+
},
|
|
98
|
+
comment: {
|
|
99
|
+
type: "string",
|
|
100
|
+
description: "Optional comment to add when starting (e.g., your implementation approach)",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
required: ["taskId"],
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "finish_task",
|
|
108
|
+
description: "Submit a task for review. Changes status to 'ready_for_review'. Use this after completing implementation work. accept_task / reject_task are the next step — default is to leave review to the human unless they asked you to review.",
|
|
109
|
+
inputSchema: {
|
|
110
|
+
type: "object",
|
|
111
|
+
properties: {
|
|
112
|
+
taskId: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "The task ID to finish",
|
|
115
|
+
},
|
|
116
|
+
comment: {
|
|
117
|
+
type: "string",
|
|
118
|
+
description: "Optional completion comment summarizing what was done",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
required: ["taskId"],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "accept_task",
|
|
126
|
+
description: "Accept a ready_for_review task (marks completed). Default: only when the human asked you to review or accept. Do not accept your own work unless they said to. The human's prompt overrides this default.",
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: "object",
|
|
129
|
+
properties: {
|
|
130
|
+
taskId: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description: "The task ID to accept",
|
|
133
|
+
},
|
|
134
|
+
comment: {
|
|
135
|
+
type: "string",
|
|
136
|
+
description: "Optional acceptance comment",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
required: ["taskId"],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "reject_task",
|
|
144
|
+
description: "Reject a ready_for_review task back to started. reason is required and is stored on the activity feed. Default: only when the human asked you to review or reject. The human's prompt overrides this default.",
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
taskId: {
|
|
149
|
+
type: "string",
|
|
150
|
+
description: "The task ID to reject",
|
|
151
|
+
},
|
|
152
|
+
reason: {
|
|
153
|
+
type: "string",
|
|
154
|
+
description: "Why the task is being sent back",
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
required: ["taskId", "reason"],
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "list_comments",
|
|
162
|
+
description: "List all comments on a task.",
|
|
163
|
+
inputSchema: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
taskId: {
|
|
167
|
+
type: "string",
|
|
168
|
+
description: "The task ID",
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
required: ["taskId"],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "add_comment",
|
|
176
|
+
description: "Add a comment to a task. Use this to document progress, ask questions, or provide updates.",
|
|
177
|
+
inputSchema: {
|
|
178
|
+
type: "object",
|
|
179
|
+
properties: {
|
|
180
|
+
taskId: {
|
|
181
|
+
type: "string",
|
|
182
|
+
description: "The task ID to comment on",
|
|
183
|
+
},
|
|
184
|
+
content: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "The comment text (supports markdown)",
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
required: ["taskId", "content"],
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "update_task",
|
|
194
|
+
description: "Update task details (title, type, points, tags, epic, description, blocked status, acceptance criteria, relevant files). Status cannot be set here — use start_task, finish_task, accept_task, or reject_task.",
|
|
195
|
+
inputSchema: {
|
|
196
|
+
type: "object",
|
|
197
|
+
properties: {
|
|
198
|
+
taskId: {
|
|
199
|
+
type: "string",
|
|
200
|
+
description: "The task ID to update",
|
|
201
|
+
},
|
|
202
|
+
title: {
|
|
203
|
+
type: "string",
|
|
204
|
+
description: "New title",
|
|
205
|
+
},
|
|
206
|
+
type: {
|
|
207
|
+
type: "string",
|
|
208
|
+
enum: ["feature", "bug", "chore"],
|
|
209
|
+
description: "Task type",
|
|
210
|
+
},
|
|
211
|
+
points: {
|
|
212
|
+
type: "number",
|
|
213
|
+
description: "Story points (1, 2, 3, 5, or 8)",
|
|
214
|
+
},
|
|
215
|
+
tags: {
|
|
216
|
+
type: "array",
|
|
217
|
+
items: { type: "string" },
|
|
218
|
+
description: "Replacement tag list",
|
|
219
|
+
},
|
|
220
|
+
epicId: {
|
|
221
|
+
type: "string",
|
|
222
|
+
description: "Move the task to this epic",
|
|
223
|
+
},
|
|
224
|
+
description: {
|
|
225
|
+
type: "string",
|
|
226
|
+
description: "New description (markdown)",
|
|
227
|
+
},
|
|
228
|
+
isBlocked: {
|
|
229
|
+
type: "boolean",
|
|
230
|
+
description: "Whether the task is blocked",
|
|
231
|
+
},
|
|
232
|
+
blockedReason: {
|
|
233
|
+
type: "string",
|
|
234
|
+
description: "Reason for being blocked (required if isBlocked is true)",
|
|
235
|
+
},
|
|
236
|
+
acceptanceCriteria: {
|
|
237
|
+
type: "array",
|
|
238
|
+
items: {
|
|
239
|
+
type: "object",
|
|
240
|
+
properties: {
|
|
241
|
+
text: { type: "string" },
|
|
242
|
+
completed: { type: "boolean" },
|
|
243
|
+
},
|
|
244
|
+
required: ["text", "completed"],
|
|
245
|
+
},
|
|
246
|
+
description: "Updated acceptance criteria with completion status",
|
|
247
|
+
},
|
|
248
|
+
relevantFiles: {
|
|
249
|
+
type: "array",
|
|
250
|
+
items: {
|
|
251
|
+
type: "object",
|
|
252
|
+
properties: {
|
|
253
|
+
path: { type: "string", description: "Relative path from project root (e.g., 'src/api/auth.ts')" },
|
|
254
|
+
purpose: { type: "string", description: "Why this file is relevant (e.g., 'main implementation', 'test file')" },
|
|
255
|
+
},
|
|
256
|
+
required: ["path"],
|
|
257
|
+
},
|
|
258
|
+
description: "Files relevant to this task. Paths must be relative to project root.",
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
required: ["taskId"],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: "set_relevant_files",
|
|
266
|
+
description: "Set the relevant files for a task. Use this to record which files are important for the task, so future work sessions know where to look. Paths must be relative to project root.",
|
|
267
|
+
inputSchema: {
|
|
268
|
+
type: "object",
|
|
269
|
+
properties: {
|
|
270
|
+
taskId: {
|
|
271
|
+
type: "string",
|
|
272
|
+
description: "The task ID to update",
|
|
273
|
+
},
|
|
274
|
+
files: {
|
|
275
|
+
type: "array",
|
|
276
|
+
items: {
|
|
277
|
+
type: "object",
|
|
278
|
+
properties: {
|
|
279
|
+
path: { type: "string", description: "Relative path from project root (e.g., 'src/api/auth.ts')" },
|
|
280
|
+
purpose: { type: "string", description: "Why this file is relevant (e.g., 'main implementation', 'test file')" },
|
|
281
|
+
},
|
|
282
|
+
required: ["path"],
|
|
283
|
+
},
|
|
284
|
+
description: "Files relevant to this task",
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
required: ["taskId", "files"],
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: "get_task_context",
|
|
292
|
+
description: "Get rich context for a task including epic spec, related tasks, comments, and activity. Use this when starting work on a task to understand the full context.",
|
|
293
|
+
inputSchema: {
|
|
294
|
+
type: "object",
|
|
295
|
+
properties: {
|
|
296
|
+
taskId: {
|
|
297
|
+
type: "string",
|
|
298
|
+
description: "The task ID to get context for",
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
required: ["taskId"],
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: "log_progress",
|
|
306
|
+
description: "Log a structured progress update for a task. Use this to document what you attempted, what succeeded, what failed, and any blockers or questions.",
|
|
307
|
+
inputSchema: {
|
|
308
|
+
type: "object",
|
|
309
|
+
properties: {
|
|
310
|
+
taskId: {
|
|
311
|
+
type: "string",
|
|
312
|
+
description: "The task ID to log progress for",
|
|
313
|
+
},
|
|
314
|
+
whatAttempted: {
|
|
315
|
+
type: "string",
|
|
316
|
+
description: "What was attempted (required)",
|
|
317
|
+
},
|
|
318
|
+
whatSucceeded: {
|
|
319
|
+
type: "string",
|
|
320
|
+
description: "What worked or was accomplished",
|
|
321
|
+
},
|
|
322
|
+
whatFailed: {
|
|
323
|
+
type: "string",
|
|
324
|
+
description: "What didn't work and why",
|
|
325
|
+
},
|
|
326
|
+
questions: {
|
|
327
|
+
type: "array",
|
|
328
|
+
items: { type: "string" },
|
|
329
|
+
description: "Questions for the team",
|
|
330
|
+
},
|
|
331
|
+
blockers: {
|
|
332
|
+
type: "array",
|
|
333
|
+
items: { type: "string" },
|
|
334
|
+
description: "Issues blocking progress (will mark task as blocked if provided)",
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
required: ["taskId", "whatAttempted"],
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: "list_progress",
|
|
342
|
+
description: "List structured progress updates for a task.",
|
|
343
|
+
inputSchema: {
|
|
344
|
+
type: "object",
|
|
345
|
+
properties: {
|
|
346
|
+
taskId: {
|
|
347
|
+
type: "string",
|
|
348
|
+
description: "The task ID",
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
required: ["taskId"],
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: "recommend_task",
|
|
356
|
+
description: "Get recommendations for what task to work on next. Returns tasks prioritized by: 1) Your in-progress work, 2) Tasks assigned to you, 3) High-priority unassigned tasks.",
|
|
357
|
+
inputSchema: {
|
|
358
|
+
type: "object",
|
|
359
|
+
properties: {
|
|
360
|
+
workspaceId: {
|
|
361
|
+
type: "string",
|
|
362
|
+
description: "The workspace ID to get recommendations for",
|
|
363
|
+
},
|
|
364
|
+
epicId: {
|
|
365
|
+
type: "string",
|
|
366
|
+
description: "Optional: filter recommendations to tasks in a specific epic",
|
|
367
|
+
},
|
|
368
|
+
limit: {
|
|
369
|
+
type: "number",
|
|
370
|
+
description: "Maximum number of recommendations to return (default 5, max 20)",
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
required: ["workspaceId"],
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: "list_documents",
|
|
378
|
+
description: "List planning documents in a workspace. Documents are the living PRD/notes corpus.",
|
|
379
|
+
inputSchema: {
|
|
380
|
+
type: "object",
|
|
381
|
+
properties: {
|
|
382
|
+
workspaceId: { type: "string", description: "Workspace ID" },
|
|
383
|
+
},
|
|
384
|
+
required: ["workspaceId"],
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: "read_document",
|
|
389
|
+
description: "Read a workspace document by path (e.g. prd or research/notes).",
|
|
390
|
+
inputSchema: {
|
|
391
|
+
type: "object",
|
|
392
|
+
properties: {
|
|
393
|
+
workspaceId: { type: "string" },
|
|
394
|
+
path: { type: "string", description: "Document path such as prd" },
|
|
395
|
+
},
|
|
396
|
+
required: ["workspaceId", "path"],
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
name: "create_document",
|
|
401
|
+
description: "Create a markdown document in a workspace.",
|
|
402
|
+
inputSchema: {
|
|
403
|
+
type: "object",
|
|
404
|
+
properties: {
|
|
405
|
+
workspaceId: { type: "string" },
|
|
406
|
+
path: { type: "string" },
|
|
407
|
+
title: { type: "string" },
|
|
408
|
+
body: { type: "string", description: "Markdown body" },
|
|
409
|
+
},
|
|
410
|
+
required: ["workspaceId", "path"],
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: "write_document",
|
|
415
|
+
description: "Update a document. etag is required (If-Match from a prior read_document). Writes without an etag are rejected so concurrent edits cannot silently overwrite.",
|
|
416
|
+
inputSchema: {
|
|
417
|
+
type: "object",
|
|
418
|
+
properties: {
|
|
419
|
+
workspaceId: { type: "string" },
|
|
420
|
+
path: { type: "string" },
|
|
421
|
+
title: { type: "string" },
|
|
422
|
+
body: { type: "string" },
|
|
423
|
+
etag: { type: "string", description: "Required If-Match etag from a prior read" },
|
|
424
|
+
},
|
|
425
|
+
required: ["workspaceId", "path", "etag"],
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: "delete_document",
|
|
430
|
+
description: "Delete a document. etag is required (If-Match from a prior read_document) so concurrent deletes cannot race a newer edit.",
|
|
431
|
+
inputSchema: {
|
|
432
|
+
type: "object",
|
|
433
|
+
properties: {
|
|
434
|
+
workspaceId: { type: "string" },
|
|
435
|
+
path: { type: "string" },
|
|
436
|
+
etag: { type: "string", description: "Required If-Match etag from a prior read" },
|
|
437
|
+
},
|
|
438
|
+
required: ["workspaceId", "path", "etag"],
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
name: "list_document_versions",
|
|
443
|
+
description: "List saved versions of a document (id, time, actor, etag). Use restore_document to roll back.",
|
|
444
|
+
inputSchema: {
|
|
445
|
+
type: "object",
|
|
446
|
+
properties: {
|
|
447
|
+
workspaceId: { type: "string" },
|
|
448
|
+
path: { type: "string" },
|
|
449
|
+
},
|
|
450
|
+
required: ["workspaceId", "path"],
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: "restore_document",
|
|
455
|
+
description: "Restore a document to a previous version. etag is the current document etag (If-Match), not the version's etag.",
|
|
456
|
+
inputSchema: {
|
|
457
|
+
type: "object",
|
|
458
|
+
properties: {
|
|
459
|
+
workspaceId: { type: "string" },
|
|
460
|
+
path: { type: "string" },
|
|
461
|
+
versionId: { type: "string", description: "Version id from list_document_versions" },
|
|
462
|
+
etag: { type: "string", description: "Current document etag from read_document" },
|
|
463
|
+
},
|
|
464
|
+
required: ["workspaceId", "path", "versionId", "etag"],
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
name: "list_epics",
|
|
469
|
+
description: "List epics in a workspace (title, status, task counts, last plan, GitHub).",
|
|
470
|
+
inputSchema: {
|
|
471
|
+
type: "object",
|
|
472
|
+
properties: {
|
|
473
|
+
workspaceId: { type: "string" },
|
|
474
|
+
},
|
|
475
|
+
required: ["workspaceId"],
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
name: "get_epic",
|
|
480
|
+
description: "Get an epic: working spec, last-plan provenance, imported tasks, GitHub link, and latest suggested breakdown. Use after plan_it or when you need the spec without a task id.",
|
|
481
|
+
inputSchema: {
|
|
482
|
+
type: "object",
|
|
483
|
+
properties: {
|
|
484
|
+
epicId: { type: "string", description: "The epic ID" },
|
|
485
|
+
},
|
|
486
|
+
required: ["epicId"],
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
name: "plan_it",
|
|
491
|
+
description: "Snapshot selected documents into one or more epics and run AI task breakdown. Does not import tasks until a human reviews them.",
|
|
492
|
+
inputSchema: {
|
|
493
|
+
type: "object",
|
|
494
|
+
properties: {
|
|
495
|
+
workspaceId: { type: "string" },
|
|
496
|
+
paths: {
|
|
497
|
+
type: "array",
|
|
498
|
+
items: { type: "string" },
|
|
499
|
+
description: "Document paths to snapshot",
|
|
500
|
+
},
|
|
501
|
+
documentIds: { type: "array", items: { type: "string" } },
|
|
502
|
+
epicIds: {
|
|
503
|
+
type: "array",
|
|
504
|
+
items: { type: "string" },
|
|
505
|
+
description: "Existing epics to update. Omit to create a new epic.",
|
|
506
|
+
},
|
|
507
|
+
title: { type: "string", description: "Title for a new epic" },
|
|
508
|
+
runBreakdown: { type: "boolean" },
|
|
509
|
+
},
|
|
510
|
+
required: ["workspaceId"],
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
name: "link_epic_github",
|
|
515
|
+
description: "Link a GitHub branch or PR to an epic. Use this after creating a branch or opening a PR for an epic's work.",
|
|
516
|
+
inputSchema: {
|
|
517
|
+
type: "object",
|
|
518
|
+
properties: {
|
|
519
|
+
epicId: {
|
|
520
|
+
type: "string",
|
|
521
|
+
description: "The epic ID to link",
|
|
522
|
+
},
|
|
523
|
+
branch: {
|
|
524
|
+
type: "string",
|
|
525
|
+
description: "Branch name (e.g., 'feature/user-auth')",
|
|
526
|
+
},
|
|
527
|
+
prUrl: {
|
|
528
|
+
type: "string",
|
|
529
|
+
description: "Full GitHub PR URL (e.g., 'https://github.com/owner/repo/pull/123')",
|
|
530
|
+
},
|
|
531
|
+
},
|
|
532
|
+
required: ["epicId"],
|
|
533
|
+
},
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: "get_epic_github",
|
|
537
|
+
description: "Get the GitHub branch and PR URL linked to an epic.",
|
|
538
|
+
inputSchema: {
|
|
539
|
+
type: "object",
|
|
540
|
+
properties: {
|
|
541
|
+
epicId: {
|
|
542
|
+
type: "string",
|
|
543
|
+
description: "The epic ID",
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
required: ["epicId"],
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
];
|
|
550
|
+
/**
|
|
551
|
+
* Handle a tool call and return the result
|
|
552
|
+
*/
|
|
553
|
+
export async function handleToolCall(client, name,
|
|
554
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
555
|
+
args) {
|
|
556
|
+
try {
|
|
557
|
+
let result;
|
|
558
|
+
switch (name) {
|
|
559
|
+
case "whoami":
|
|
560
|
+
result = await taskTools.whoami(client);
|
|
561
|
+
break;
|
|
562
|
+
case "list_workspaces":
|
|
563
|
+
result = await taskTools.listWorkspaces(client);
|
|
564
|
+
break;
|
|
565
|
+
case "create_workspace":
|
|
566
|
+
result = await taskTools.createWorkspace(client, {
|
|
567
|
+
name: args.name,
|
|
568
|
+
description: args.description,
|
|
569
|
+
});
|
|
570
|
+
break;
|
|
571
|
+
case "list_tasks":
|
|
572
|
+
result = await taskTools.listTasks(client, args.workspaceId, {
|
|
573
|
+
status: args.status,
|
|
574
|
+
epicId: args.epicId,
|
|
575
|
+
isIcebox: args.isIcebox,
|
|
576
|
+
assigneeId: args.assigneeId,
|
|
577
|
+
});
|
|
578
|
+
break;
|
|
579
|
+
case "get_task":
|
|
580
|
+
result = await taskTools.getTask(client, args.taskId);
|
|
581
|
+
break;
|
|
582
|
+
case "start_task":
|
|
583
|
+
result = await taskTools.startTask(client, args.taskId, args.comment);
|
|
584
|
+
break;
|
|
585
|
+
case "finish_task":
|
|
586
|
+
result = await taskTools.finishTask(client, args.taskId, args.comment);
|
|
587
|
+
break;
|
|
588
|
+
case "accept_task":
|
|
589
|
+
result = await taskTools.acceptTask(client, args.taskId, args.comment);
|
|
590
|
+
break;
|
|
591
|
+
case "reject_task":
|
|
592
|
+
if (!args.reason) {
|
|
593
|
+
throw new Error("reason is required to reject a task.");
|
|
594
|
+
}
|
|
595
|
+
result = await taskTools.rejectTask(client, args.taskId, args.reason);
|
|
596
|
+
break;
|
|
597
|
+
case "list_comments":
|
|
598
|
+
result = await taskTools.listComments(client, args.taskId);
|
|
599
|
+
break;
|
|
600
|
+
case "add_comment":
|
|
601
|
+
result = await taskTools.addComment(client, args.taskId, args.content);
|
|
602
|
+
break;
|
|
603
|
+
case "update_task":
|
|
604
|
+
result = await taskTools.updateTask(client, args.taskId, {
|
|
605
|
+
title: args.title,
|
|
606
|
+
description: args.description,
|
|
607
|
+
type: args.type,
|
|
608
|
+
points: args.points,
|
|
609
|
+
tags: args.tags,
|
|
610
|
+
epicId: args.epicId,
|
|
611
|
+
isBlocked: args.isBlocked,
|
|
612
|
+
blockedReason: args.blockedReason,
|
|
613
|
+
acceptanceCriteria: args.acceptanceCriteria,
|
|
614
|
+
relevantFiles: args.relevantFiles,
|
|
615
|
+
});
|
|
616
|
+
break;
|
|
617
|
+
case "set_relevant_files":
|
|
618
|
+
result = await taskTools.setRelevantFiles(client, args.taskId, args.files);
|
|
619
|
+
break;
|
|
620
|
+
case "get_task_context":
|
|
621
|
+
result = await taskTools.getTaskContext(client, args.taskId);
|
|
622
|
+
break;
|
|
623
|
+
case "log_progress":
|
|
624
|
+
result = await taskTools.logProgress(client, args.taskId, {
|
|
625
|
+
whatAttempted: args.whatAttempted,
|
|
626
|
+
whatSucceeded: args.whatSucceeded,
|
|
627
|
+
whatFailed: args.whatFailed,
|
|
628
|
+
questions: args.questions,
|
|
629
|
+
blockers: args.blockers,
|
|
630
|
+
});
|
|
631
|
+
break;
|
|
632
|
+
case "list_progress":
|
|
633
|
+
result = await taskTools.listProgress(client, args.taskId);
|
|
634
|
+
break;
|
|
635
|
+
case "recommend_task":
|
|
636
|
+
result = await taskTools.recommendTask(client, args.workspaceId, {
|
|
637
|
+
epicId: args.epicId,
|
|
638
|
+
limit: args.limit,
|
|
639
|
+
});
|
|
640
|
+
break;
|
|
641
|
+
case "list_documents":
|
|
642
|
+
result = await documentTools.listDocuments(client, args.workspaceId);
|
|
643
|
+
break;
|
|
644
|
+
case "read_document":
|
|
645
|
+
result = await documentTools.readDocument(client, args.workspaceId, args.path);
|
|
646
|
+
break;
|
|
647
|
+
case "create_document":
|
|
648
|
+
result = await documentTools.createDocument(client, args.workspaceId, {
|
|
649
|
+
path: args.path,
|
|
650
|
+
title: args.title,
|
|
651
|
+
body: args.body,
|
|
652
|
+
});
|
|
653
|
+
break;
|
|
654
|
+
case "write_document":
|
|
655
|
+
if (!args.etag) {
|
|
656
|
+
throw new Error("etag is required to write a document. Read the document first and pass its etag.");
|
|
657
|
+
}
|
|
658
|
+
result = await documentTools.writeDocument(client, args.workspaceId, args.path, {
|
|
659
|
+
title: args.title,
|
|
660
|
+
body: args.body,
|
|
661
|
+
etag: args.etag,
|
|
662
|
+
});
|
|
663
|
+
break;
|
|
664
|
+
case "delete_document":
|
|
665
|
+
if (!args.etag) {
|
|
666
|
+
throw new Error("etag is required to delete a document. Read the document first and pass its etag.");
|
|
667
|
+
}
|
|
668
|
+
result = await documentTools.deleteDocument(client, args.workspaceId, args.path, args.etag);
|
|
669
|
+
break;
|
|
670
|
+
case "list_document_versions":
|
|
671
|
+
result = await documentTools.listDocumentVersions(client, args.workspaceId, args.path);
|
|
672
|
+
break;
|
|
673
|
+
case "restore_document":
|
|
674
|
+
if (!args.etag) {
|
|
675
|
+
throw new Error("etag is required to restore a document. Read the document first and pass its etag.");
|
|
676
|
+
}
|
|
677
|
+
result = await documentTools.restoreDocument(client, args.workspaceId, args.path, {
|
|
678
|
+
versionId: args.versionId,
|
|
679
|
+
etag: args.etag,
|
|
680
|
+
});
|
|
681
|
+
break;
|
|
682
|
+
case "list_epics":
|
|
683
|
+
result = await documentTools.listEpics(client, args.workspaceId);
|
|
684
|
+
break;
|
|
685
|
+
case "get_epic":
|
|
686
|
+
result = await documentTools.getEpic(client, args.epicId);
|
|
687
|
+
break;
|
|
688
|
+
case "plan_it":
|
|
689
|
+
result = await documentTools.planIt(client, args.workspaceId, {
|
|
690
|
+
paths: args.paths,
|
|
691
|
+
documentIds: args.documentIds,
|
|
692
|
+
epicIds: args.epicIds,
|
|
693
|
+
title: args.title,
|
|
694
|
+
runBreakdown: args.runBreakdown,
|
|
695
|
+
});
|
|
696
|
+
break;
|
|
697
|
+
case "link_epic_github":
|
|
698
|
+
result = await taskTools.linkEpicGithub(client, args.epicId, {
|
|
699
|
+
branch: args.branch,
|
|
700
|
+
prUrl: args.prUrl,
|
|
701
|
+
});
|
|
702
|
+
break;
|
|
703
|
+
case "get_epic_github":
|
|
704
|
+
result = await taskTools.getEpicGithub(client, args.epicId);
|
|
705
|
+
break;
|
|
706
|
+
default:
|
|
707
|
+
return {
|
|
708
|
+
content: [
|
|
709
|
+
{
|
|
710
|
+
type: "text",
|
|
711
|
+
text: `Unknown tool: ${name}`,
|
|
712
|
+
},
|
|
713
|
+
],
|
|
714
|
+
isError: true,
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
return {
|
|
718
|
+
content: [
|
|
719
|
+
{
|
|
720
|
+
type: "text",
|
|
721
|
+
text: result,
|
|
722
|
+
},
|
|
723
|
+
],
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
catch (error) {
|
|
727
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
728
|
+
return {
|
|
729
|
+
content: [
|
|
730
|
+
{
|
|
731
|
+
type: "text",
|
|
732
|
+
text: `Error: ${message}`,
|
|
733
|
+
},
|
|
734
|
+
],
|
|
735
|
+
isError: true,
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
//# sourceMappingURL=index.js.map
|