@paca-ai/paca-mcp 0.2.0-rc.2 → 0.2.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 +12 -10
- package/build/api/client.d.ts.map +1 -1
- package/build/api/client.js.map +1 -1
- package/build/api/index.d.ts +0 -1
- package/build/api/index.d.ts.map +1 -1
- package/build/api/index.js +0 -1
- package/build/api/index.js.map +1 -1
- package/build/api/task-extended-client.d.ts +6 -12
- package/build/api/task-extended-client.d.ts.map +1 -1
- package/build/api/task-extended-client.js +31 -42
- package/build/api/task-extended-client.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/package.json +1 -1
- package/build/plugin-loader.d.ts +66 -0
- package/build/plugin-loader.d.ts.map +1 -0
- package/build/plugin-loader.js +362 -0
- package/build/plugin-loader.js.map +1 -0
- package/build/server.d.ts +3 -1
- package/build/server.d.ts.map +1 -1
- package/build/server.js +19 -6
- package/build/server.js.map +1 -1
- package/build/tools/attachment-tools.d.ts +3 -7
- package/build/tools/attachment-tools.d.ts.map +1 -1
- package/build/tools/attachment-tools.js +3 -265
- package/build/tools/attachment-tools.js.map +1 -1
- package/build/tools/doc-github-tools.d.ts +3 -7
- package/build/tools/doc-github-tools.d.ts.map +1 -1
- package/build/tools/doc-github-tools.js +3 -256
- package/build/tools/doc-github-tools.js.map +1 -1
- package/build/tools/document-tools.d.ts.map +1 -1
- package/build/tools/document-tools.js.map +1 -1
- package/build/tools/index.d.ts +1 -2
- package/build/tools/index.d.ts.map +1 -1
- package/build/tools/index.js +12 -32
- package/build/tools/index.js.map +1 -1
- package/build/tools/member-tools.d.ts.map +1 -1
- package/build/tools/member-tools.js.map +1 -1
- package/build/tools/project-tools.d.ts.map +1 -1
- package/build/tools/project-tools.js.map +1 -1
- package/build/tools/sprint-tools.d.ts.map +1 -1
- package/build/tools/sprint-tools.js.map +1 -1
- package/build/tools/task-activity-tools.d.ts +1 -5
- package/build/tools/task-activity-tools.d.ts.map +1 -1
- package/build/tools/task-activity-tools.js +12 -238
- package/build/tools/task-activity-tools.js.map +1 -1
- package/build/tools/task-tools.d.ts +2 -2
- package/build/tools/task-tools.d.ts.map +1 -1
- package/build/tools/task-tools.js +50 -21
- package/build/tools/task-tools.js.map +1 -1
- package/build/tools/task-type-tools.d.ts.map +1 -1
- package/build/tools/task-type-tools.js.map +1 -1
- package/build/types/index.d.ts +2 -27
- package/build/types/index.d.ts.map +1 -1
- package/build/utils/converters.d.ts +4 -1
- package/build/utils/converters.d.ts.map +1 -1
- package/build/utils/converters.js +127 -3
- package/build/utils/converters.js.map +1 -1
- package/build/utils/formatters.d.ts +18 -1
- package/build/utils/formatters.d.ts.map +1 -1
- package/build/utils/formatters.js +126 -0
- package/build/utils/formatters.js.map +1 -1
- package/package.json +1 -1
- package/build/api/github-client.d.ts +0 -21
- package/build/api/github-client.d.ts.map +0 -1
- package/build/api/github-client.js +0 -87
- package/build/api/github-client.js.map +0 -1
|
@@ -14,39 +14,6 @@ const DeleteTaskAttachmentSchema = z.object({
|
|
|
14
14
|
taskId: z.string(),
|
|
15
15
|
attachmentId: z.string(),
|
|
16
16
|
});
|
|
17
|
-
const ListBDDScenariosSchema = z.object({
|
|
18
|
-
projectId: z.string(),
|
|
19
|
-
taskId: z.string(),
|
|
20
|
-
});
|
|
21
|
-
const CreateBDDScenarioSchema = z.object({
|
|
22
|
-
projectId: z.string(),
|
|
23
|
-
taskId: z.string(),
|
|
24
|
-
title: z.string(),
|
|
25
|
-
given: z.string(),
|
|
26
|
-
when: z.string(),
|
|
27
|
-
// biome-ignore lint/suspicious/noThenProperty: BDD scenario uses "then" as domain terminology
|
|
28
|
-
then: z.string(),
|
|
29
|
-
});
|
|
30
|
-
const GetBDDScenarioSchema = z.object({
|
|
31
|
-
projectId: z.string(),
|
|
32
|
-
taskId: z.string(),
|
|
33
|
-
scenarioId: z.string(),
|
|
34
|
-
});
|
|
35
|
-
const UpdateBDDScenarioSchema = z.object({
|
|
36
|
-
projectId: z.string(),
|
|
37
|
-
taskId: z.string(),
|
|
38
|
-
scenarioId: z.string(),
|
|
39
|
-
title: z.string().optional(),
|
|
40
|
-
given: z.string().optional(),
|
|
41
|
-
when: z.string().optional(),
|
|
42
|
-
// biome-ignore lint/suspicious/noThenProperty: BDD scenario uses "then" as domain terminology
|
|
43
|
-
then: z.string().optional(),
|
|
44
|
-
});
|
|
45
|
-
const DeleteBDDScenarioSchema = z.object({
|
|
46
|
-
projectId: z.string(),
|
|
47
|
-
taskId: z.string(),
|
|
48
|
-
scenarioId: z.string(),
|
|
49
|
-
});
|
|
50
17
|
/**
|
|
51
18
|
* Returns all attachment-related MCP tools.
|
|
52
19
|
*/
|
|
@@ -116,149 +83,6 @@ export function getAttachmentTools() {
|
|
|
116
83
|
},
|
|
117
84
|
];
|
|
118
85
|
}
|
|
119
|
-
/**
|
|
120
|
-
* Returns all BDD scenario-related MCP tools.
|
|
121
|
-
*/
|
|
122
|
-
export function getBDDScenarioTools() {
|
|
123
|
-
return [
|
|
124
|
-
{
|
|
125
|
-
name: "list_bdd_scenarios",
|
|
126
|
-
description: "List all BDD scenarios for a task",
|
|
127
|
-
inputSchema: {
|
|
128
|
-
type: "object",
|
|
129
|
-
properties: {
|
|
130
|
-
projectId: {
|
|
131
|
-
type: "string",
|
|
132
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
133
|
-
},
|
|
134
|
-
taskId: {
|
|
135
|
-
type: "string",
|
|
136
|
-
description: "The technical UUID of the task (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_tasks to get the task ID.",
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
required: ["projectId", "taskId"],
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
name: "create_bdd_scenario",
|
|
144
|
-
description: "Create a new BDD scenario for a task",
|
|
145
|
-
inputSchema: {
|
|
146
|
-
type: "object",
|
|
147
|
-
properties: {
|
|
148
|
-
projectId: {
|
|
149
|
-
type: "string",
|
|
150
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
151
|
-
},
|
|
152
|
-
taskId: {
|
|
153
|
-
type: "string",
|
|
154
|
-
description: "The technical UUID of the task (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_tasks to get the task ID.",
|
|
155
|
-
},
|
|
156
|
-
title: {
|
|
157
|
-
type: "string",
|
|
158
|
-
description: "The title of the scenario",
|
|
159
|
-
},
|
|
160
|
-
given: {
|
|
161
|
-
type: "string",
|
|
162
|
-
description: "The Given clause",
|
|
163
|
-
},
|
|
164
|
-
when: {
|
|
165
|
-
type: "string",
|
|
166
|
-
description: "The When clause",
|
|
167
|
-
},
|
|
168
|
-
// biome-ignore lint/suspicious/noThenProperty: BDD scenario uses "then" as domain terminology
|
|
169
|
-
then: {
|
|
170
|
-
type: "string",
|
|
171
|
-
description: "The Then clause",
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
required: ["projectId", "taskId", "title", "given", "when", "then"],
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
name: "get_bdd_scenario",
|
|
179
|
-
description: "Get details of a specific BDD scenario",
|
|
180
|
-
inputSchema: {
|
|
181
|
-
type: "object",
|
|
182
|
-
properties: {
|
|
183
|
-
projectId: {
|
|
184
|
-
type: "string",
|
|
185
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
186
|
-
},
|
|
187
|
-
taskId: {
|
|
188
|
-
type: "string",
|
|
189
|
-
description: "The technical UUID of the task (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_tasks to get the task ID.",
|
|
190
|
-
},
|
|
191
|
-
scenarioId: {
|
|
192
|
-
type: "string",
|
|
193
|
-
description: "The technical UUID of the BDD scenario (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_bdd_scenarios to get the scenario ID.",
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
required: ["projectId", "taskId", "scenarioId"],
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: "update_bdd_scenario",
|
|
201
|
-
description: "Update an existing BDD scenario",
|
|
202
|
-
inputSchema: {
|
|
203
|
-
type: "object",
|
|
204
|
-
properties: {
|
|
205
|
-
projectId: {
|
|
206
|
-
type: "string",
|
|
207
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
208
|
-
},
|
|
209
|
-
taskId: {
|
|
210
|
-
type: "string",
|
|
211
|
-
description: "The technical UUID of the task (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_tasks to get the task ID.",
|
|
212
|
-
},
|
|
213
|
-
scenarioId: {
|
|
214
|
-
type: "string",
|
|
215
|
-
description: "The technical UUID of the BDD scenario (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_bdd_scenarios to get the scenario ID.",
|
|
216
|
-
},
|
|
217
|
-
title: {
|
|
218
|
-
type: "string",
|
|
219
|
-
description: "The new title",
|
|
220
|
-
},
|
|
221
|
-
given: {
|
|
222
|
-
type: "string",
|
|
223
|
-
description: "The new Given clause",
|
|
224
|
-
},
|
|
225
|
-
when: {
|
|
226
|
-
type: "string",
|
|
227
|
-
description: "The new When clause",
|
|
228
|
-
},
|
|
229
|
-
// biome-ignore lint/suspicious/noThenProperty: BDD scenario uses "then" as domain terminology
|
|
230
|
-
then: {
|
|
231
|
-
type: "string",
|
|
232
|
-
description: "The new Then clause",
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
required: ["projectId", "taskId", "scenarioId"],
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
name: "delete_bdd_scenario",
|
|
240
|
-
description: "Delete a BDD scenario",
|
|
241
|
-
inputSchema: {
|
|
242
|
-
type: "object",
|
|
243
|
-
properties: {
|
|
244
|
-
projectId: {
|
|
245
|
-
type: "string",
|
|
246
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
247
|
-
},
|
|
248
|
-
taskId: {
|
|
249
|
-
type: "string",
|
|
250
|
-
description: "The technical UUID of the task (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_tasks to get the task ID.",
|
|
251
|
-
},
|
|
252
|
-
scenarioId: {
|
|
253
|
-
type: "string",
|
|
254
|
-
description: "The technical UUID of the BDD scenario (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_bdd_scenarios to get the scenario ID.",
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
required: ["projectId", "taskId", "scenarioId"],
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
];
|
|
261
|
-
}
|
|
262
86
|
function formatAttachment(attachment) {
|
|
263
87
|
return `Attachment: ${attachment.file?.file_name || "Unknown"}
|
|
264
88
|
ID: ${attachment.id}
|
|
@@ -267,25 +91,10 @@ Type: ${attachment.file?.content_type || "Unknown"}
|
|
|
267
91
|
Uploaded by: ${attachment.created_by || "Unknown"}
|
|
268
92
|
Uploaded at: ${attachment.created_at}`;
|
|
269
93
|
}
|
|
270
|
-
function formatBDDScenario(scenario) {
|
|
271
|
-
return `BDD Scenario: ${scenario.title}
|
|
272
|
-
ID: ${scenario.id}
|
|
273
|
-
|
|
274
|
-
Given:
|
|
275
|
-
${scenario.given || "None"}
|
|
276
|
-
|
|
277
|
-
When:
|
|
278
|
-
${scenario.when || "None"}
|
|
279
|
-
|
|
280
|
-
Then:
|
|
281
|
-
${scenario.then || "None"}
|
|
282
|
-
|
|
283
|
-
Created: ${scenario.created_at}`;
|
|
284
|
-
}
|
|
285
94
|
/**
|
|
286
|
-
* Handles attachment
|
|
95
|
+
* Handles attachment tool calls.
|
|
287
96
|
*/
|
|
288
|
-
export async function handleAttachmentTool(toolName, args, viewsClient
|
|
97
|
+
export async function handleAttachmentTool(toolName, args, viewsClient) {
|
|
289
98
|
switch (toolName) {
|
|
290
99
|
case "list_task_attachments": {
|
|
291
100
|
const { projectId, taskId } = ListTaskAttachmentsSchema.parse(args);
|
|
@@ -324,79 +133,8 @@ export async function handleAttachmentTool(toolName, args, viewsClient, taskClie
|
|
|
324
133
|
],
|
|
325
134
|
};
|
|
326
135
|
}
|
|
327
|
-
case "list_bdd_scenarios": {
|
|
328
|
-
const { projectId, taskId } = ListBDDScenariosSchema.parse(args);
|
|
329
|
-
const scenarios = await taskClient.listBDDScenarios(projectId, taskId);
|
|
330
|
-
const formatted = formatList(scenarios, formatBDDScenario);
|
|
331
|
-
return {
|
|
332
|
-
content: [
|
|
333
|
-
{
|
|
334
|
-
type: "text",
|
|
335
|
-
text: `BDD Scenarios:\n\n${formatted}`,
|
|
336
|
-
},
|
|
337
|
-
],
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
case "create_bdd_scenario": {
|
|
341
|
-
const { projectId, taskId, title, given, when, then } = CreateBDDScenarioSchema.parse(args);
|
|
342
|
-
const scenario = await taskClient.createBDDScenario(projectId, taskId, {
|
|
343
|
-
title,
|
|
344
|
-
given,
|
|
345
|
-
when,
|
|
346
|
-
then,
|
|
347
|
-
});
|
|
348
|
-
return {
|
|
349
|
-
content: [
|
|
350
|
-
{
|
|
351
|
-
type: "text",
|
|
352
|
-
text: `BDD scenario created successfully:\n\n${formatBDDScenario(scenario)}`,
|
|
353
|
-
},
|
|
354
|
-
],
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
case "get_bdd_scenario": {
|
|
358
|
-
const { projectId, taskId, scenarioId } = GetBDDScenarioSchema.parse(args);
|
|
359
|
-
const scenario = await taskClient.getBDDScenario(projectId, taskId, scenarioId);
|
|
360
|
-
return {
|
|
361
|
-
content: [
|
|
362
|
-
{
|
|
363
|
-
type: "text",
|
|
364
|
-
text: formatBDDScenario(scenario),
|
|
365
|
-
},
|
|
366
|
-
],
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
case "update_bdd_scenario": {
|
|
370
|
-
const { projectId, taskId, scenarioId, title, given, when, then } = UpdateBDDScenarioSchema.parse(args);
|
|
371
|
-
const scenario = await taskClient.updateBDDScenario(projectId, taskId, scenarioId, {
|
|
372
|
-
title,
|
|
373
|
-
given,
|
|
374
|
-
when,
|
|
375
|
-
then,
|
|
376
|
-
});
|
|
377
|
-
return {
|
|
378
|
-
content: [
|
|
379
|
-
{
|
|
380
|
-
type: "text",
|
|
381
|
-
text: `BDD scenario updated successfully:\n\n${formatBDDScenario(scenario)}`,
|
|
382
|
-
},
|
|
383
|
-
],
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
case "delete_bdd_scenario": {
|
|
387
|
-
const { projectId, taskId, scenarioId } = DeleteBDDScenarioSchema.parse(args);
|
|
388
|
-
await taskClient.deleteBDDScenario(projectId, taskId, scenarioId);
|
|
389
|
-
return {
|
|
390
|
-
content: [
|
|
391
|
-
{
|
|
392
|
-
type: "text",
|
|
393
|
-
text: `BDD scenario ${scenarioId} deleted successfully`,
|
|
394
|
-
},
|
|
395
|
-
],
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
136
|
default:
|
|
399
|
-
throw new Error(`Unknown attachment
|
|
137
|
+
throw new Error(`Unknown attachment tool: ${toolName}`);
|
|
400
138
|
}
|
|
401
139
|
}
|
|
402
140
|
//# sourceMappingURL=attachment-tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-tools.js","sourceRoot":"","sources":["../../src/tools/attachment-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"attachment-tools.js","sourceRoot":"","sources":["../../src/tools/attachment-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KA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AAW,CAAC,mBAAmB,CACxD,SAAS,EACT,MAAM,CACN,CAAC;YACF,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;YAC5D,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,mBAAmB,SAAS,EAAE;qBACpC;iBACD;aACD,CAAC;QACH,CAAC;QAED,KAAK,6BAA6B,CAAC,CAAC,CAAC;YACpC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,GACxC,8BAA8B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,wBAAwB,CACxD,SAAS,EACT,MAAM,EACN,YAAY,CACZ,CAAC;YACF,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,iBAAiB,MAAM,EAAE;qBAC/B;iBACD;aACD,CAAC;QACH,CAAC;QAED,KAAK,wBAAwB,CAAC,CAAC,CAAC;YAC/B,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,GACxC,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,MAAM,WAAW,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;YACxE,OAAO;gBACN,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,cAAc,YAAY,uBAAuB;qBACvD;iBACD;aACD,CAAC;QACH,CAAC;QAED;YACC,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;AACF,CAAC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import type { PacaAPIDocClient
|
|
2
|
+
import type { PacaAPIDocClient } from "../api/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns all document folder and file related MCP tools.
|
|
5
5
|
*/
|
|
6
6
|
export declare function getDocTools(): Tool[];
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Handles document tool calls.
|
|
9
9
|
*/
|
|
10
|
-
export declare function
|
|
11
|
-
/**
|
|
12
|
-
* Handles document and GitHub tool calls.
|
|
13
|
-
*/
|
|
14
|
-
export declare function handleDocTool(toolName: string, args: any, docClient: PacaAPIDocClient, githubClient: PacaAPIGitHubClient): Promise<any>;
|
|
10
|
+
export declare function handleDocTool(toolName: string, args: any, docClient: PacaAPIDocClient): Promise<any>;
|
|
15
11
|
//# sourceMappingURL=doc-github-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-github-tools.d.ts","sourceRoot":"","sources":["../../src/tools/doc-github-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"doc-github-tools.d.ts","sourceRoot":"","sources":["../../src/tools/doc-github-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAqCxD;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,EAAE,CA0IpC;AAmBD;;GAEG;AACH,wBAAsB,aAAa,CAClC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,GAAG,EACT,SAAS,EAAE,gBAAgB,GACzB,OAAO,CAAC,GAAG,CAAC,CAiGd"}
|
|
@@ -28,31 +28,6 @@ const GetDocSnapshotSchema = z.object({
|
|
|
28
28
|
docId: z.string(),
|
|
29
29
|
snapshotId: z.string(),
|
|
30
30
|
});
|
|
31
|
-
const GetGitHubIntegrationSchema = z.object({
|
|
32
|
-
projectId: z.string(),
|
|
33
|
-
});
|
|
34
|
-
const SetGitHubTokenSchema = z.object({
|
|
35
|
-
projectId: z.string(),
|
|
36
|
-
token: z.string(),
|
|
37
|
-
});
|
|
38
|
-
const DeleteGitHubTokenSchema = z.object({
|
|
39
|
-
projectId: z.string(),
|
|
40
|
-
});
|
|
41
|
-
const ListGitHubRepositoriesSchema = z.object({
|
|
42
|
-
projectId: z.string(),
|
|
43
|
-
});
|
|
44
|
-
const ListLinkedGitHubReposSchema = z.object({
|
|
45
|
-
projectId: z.string(),
|
|
46
|
-
});
|
|
47
|
-
const LinkGitHubRepositorySchema = z.object({
|
|
48
|
-
projectId: z.string(),
|
|
49
|
-
owner: z.string(),
|
|
50
|
-
repo: z.string(),
|
|
51
|
-
});
|
|
52
|
-
const UnlinkGitHubRepositorySchema = z.object({
|
|
53
|
-
projectId: z.string(),
|
|
54
|
-
repoId: z.number(),
|
|
55
|
-
});
|
|
56
31
|
/**
|
|
57
32
|
* Returns all document folder and file related MCP tools.
|
|
58
33
|
*/
|
|
@@ -184,127 +159,6 @@ export function getDocTools() {
|
|
|
184
159
|
},
|
|
185
160
|
];
|
|
186
161
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Returns all GitHub integration related MCP tools.
|
|
189
|
-
*/
|
|
190
|
-
export function getGitHubTools() {
|
|
191
|
-
return [
|
|
192
|
-
{
|
|
193
|
-
name: "get_github_integration",
|
|
194
|
-
description: "Get GitHub integration status for a project",
|
|
195
|
-
inputSchema: {
|
|
196
|
-
type: "object",
|
|
197
|
-
properties: {
|
|
198
|
-
projectId: {
|
|
199
|
-
type: "string",
|
|
200
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
required: ["projectId"],
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
name: "set_github_token",
|
|
208
|
-
description: "Set GitHub token for a project",
|
|
209
|
-
inputSchema: {
|
|
210
|
-
type: "object",
|
|
211
|
-
properties: {
|
|
212
|
-
projectId: {
|
|
213
|
-
type: "string",
|
|
214
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
215
|
-
},
|
|
216
|
-
token: {
|
|
217
|
-
type: "string",
|
|
218
|
-
description: "The GitHub personal access token",
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
required: ["projectId", "token"],
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
name: "delete_github_token",
|
|
226
|
-
description: "Delete GitHub token for a project",
|
|
227
|
-
inputSchema: {
|
|
228
|
-
type: "object",
|
|
229
|
-
properties: {
|
|
230
|
-
projectId: {
|
|
231
|
-
type: "string",
|
|
232
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
required: ["projectId"],
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
name: "list_github_repositories",
|
|
240
|
-
description: "List available GitHub repositories",
|
|
241
|
-
inputSchema: {
|
|
242
|
-
type: "object",
|
|
243
|
-
properties: {
|
|
244
|
-
projectId: {
|
|
245
|
-
type: "string",
|
|
246
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
required: ["projectId"],
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
name: "list_linked_github_repos",
|
|
254
|
-
description: "List linked GitHub repositories",
|
|
255
|
-
inputSchema: {
|
|
256
|
-
type: "object",
|
|
257
|
-
properties: {
|
|
258
|
-
projectId: {
|
|
259
|
-
type: "string",
|
|
260
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
required: ["projectId"],
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: "link_github_repository",
|
|
268
|
-
description: "Link a GitHub repository to a project",
|
|
269
|
-
inputSchema: {
|
|
270
|
-
type: "object",
|
|
271
|
-
properties: {
|
|
272
|
-
projectId: {
|
|
273
|
-
type: "string",
|
|
274
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
275
|
-
},
|
|
276
|
-
owner: {
|
|
277
|
-
type: "string",
|
|
278
|
-
description: "The repository owner (GitHub username)",
|
|
279
|
-
},
|
|
280
|
-
repo: {
|
|
281
|
-
type: "string",
|
|
282
|
-
description: "The repository name",
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
required: ["projectId", "owner", "repo"],
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
name: "unlink_github_repository",
|
|
290
|
-
description: "Unlink a GitHub repository from a project",
|
|
291
|
-
inputSchema: {
|
|
292
|
-
type: "object",
|
|
293
|
-
properties: {
|
|
294
|
-
projectId: {
|
|
295
|
-
type: "string",
|
|
296
|
-
description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
|
|
297
|
-
},
|
|
298
|
-
repoId: {
|
|
299
|
-
type: "number",
|
|
300
|
-
description: "The numeric ID of the linked repository (e.g., 123456789). Use list_linked_github_repos to get the repository ID.",
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
required: ["projectId", "repoId"],
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
];
|
|
307
|
-
}
|
|
308
162
|
function formatDocFolder(folder) {
|
|
309
163
|
return `Folder: ${folder.name}
|
|
310
164
|
ID: ${folder.id}
|
|
@@ -320,28 +174,10 @@ Title: ${snapshot.title}
|
|
|
320
174
|
Created by: ${snapshot.created_by_name}
|
|
321
175
|
Created: ${snapshot.created_at}`;
|
|
322
176
|
}
|
|
323
|
-
function formatGitHubIntegration(integration) {
|
|
324
|
-
return `GitHub Integration:
|
|
325
|
-
ID: ${integration.id}
|
|
326
|
-
Project ID: ${integration.project_id}
|
|
327
|
-
Created: ${integration.created_at}
|
|
328
|
-
Updated: ${integration.updated_at}`;
|
|
329
|
-
}
|
|
330
|
-
function formatGitHubRepo(repo) {
|
|
331
|
-
return `Repository: ${repo.full_name}
|
|
332
|
-
ID: ${repo.id}
|
|
333
|
-
Owner: ${repo.owner}
|
|
334
|
-
Repo Name: ${repo.repo_name}
|
|
335
|
-
Full Name: ${repo.full_name}
|
|
336
|
-
Private: ${repo.private ? "Yes" : "No"}
|
|
337
|
-
Default Branch: ${repo.default_branch}
|
|
338
|
-
Webhook ID: ${repo.webhook_id}
|
|
339
|
-
Created: ${repo.created_at}`;
|
|
340
|
-
}
|
|
341
177
|
/**
|
|
342
|
-
* Handles document
|
|
178
|
+
* Handles document tool calls.
|
|
343
179
|
*/
|
|
344
|
-
export async function handleDocTool(toolName, args, docClient
|
|
180
|
+
export async function handleDocTool(toolName, args, docClient) {
|
|
345
181
|
switch (toolName) {
|
|
346
182
|
case "list_doc_folders": {
|
|
347
183
|
const { projectId } = ListDocFoldersSchema.parse(args);
|
|
@@ -424,97 +260,8 @@ export async function handleDocTool(toolName, args, docClient, githubClient) {
|
|
|
424
260
|
],
|
|
425
261
|
};
|
|
426
262
|
}
|
|
427
|
-
case "get_github_integration": {
|
|
428
|
-
const { projectId } = GetGitHubIntegrationSchema.parse(args);
|
|
429
|
-
const integration = await githubClient.getGitHubIntegration(projectId);
|
|
430
|
-
return {
|
|
431
|
-
content: [
|
|
432
|
-
{
|
|
433
|
-
type: "text",
|
|
434
|
-
text: formatGitHubIntegration(integration),
|
|
435
|
-
},
|
|
436
|
-
],
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
case "set_github_token": {
|
|
440
|
-
const { projectId, token } = SetGitHubTokenSchema.parse(args);
|
|
441
|
-
await githubClient.setGitHubToken(projectId, { token });
|
|
442
|
-
return {
|
|
443
|
-
content: [
|
|
444
|
-
{
|
|
445
|
-
type: "text",
|
|
446
|
-
text: `GitHub token set successfully`,
|
|
447
|
-
},
|
|
448
|
-
],
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
case "delete_github_token": {
|
|
452
|
-
const { projectId } = DeleteGitHubTokenSchema.parse(args);
|
|
453
|
-
await githubClient.deleteGitHubToken(projectId);
|
|
454
|
-
return {
|
|
455
|
-
content: [
|
|
456
|
-
{
|
|
457
|
-
type: "text",
|
|
458
|
-
text: `GitHub token deleted successfully`,
|
|
459
|
-
},
|
|
460
|
-
],
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
case "list_github_repositories": {
|
|
464
|
-
const { projectId } = ListGitHubRepositoriesSchema.parse(args);
|
|
465
|
-
const repos = await githubClient.listRepositories(projectId);
|
|
466
|
-
const formatted = formatList(repos, formatGitHubRepo);
|
|
467
|
-
return {
|
|
468
|
-
content: [
|
|
469
|
-
{
|
|
470
|
-
type: "text",
|
|
471
|
-
text: `GitHub Repositories:\n\n${formatted}`,
|
|
472
|
-
},
|
|
473
|
-
],
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
case "list_linked_github_repos": {
|
|
477
|
-
const { projectId } = ListLinkedGitHubReposSchema.parse(args);
|
|
478
|
-
const repos = await githubClient.listLinkedRepositories(projectId);
|
|
479
|
-
const formatted = formatList(repos, formatGitHubRepo);
|
|
480
|
-
return {
|
|
481
|
-
content: [
|
|
482
|
-
{
|
|
483
|
-
type: "text",
|
|
484
|
-
text: `Linked GitHub Repositories:\n\n${formatted}`,
|
|
485
|
-
},
|
|
486
|
-
],
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
case "link_github_repository": {
|
|
490
|
-
const { projectId, owner, repo } = LinkGitHubRepositorySchema.parse(args);
|
|
491
|
-
const linkedRepo = await githubClient.linkRepository(projectId, {
|
|
492
|
-
owner,
|
|
493
|
-
repo_name: repo,
|
|
494
|
-
});
|
|
495
|
-
return {
|
|
496
|
-
content: [
|
|
497
|
-
{
|
|
498
|
-
type: "text",
|
|
499
|
-
text: `Repository linked successfully:\n\n${formatGitHubRepo(linkedRepo)}`,
|
|
500
|
-
},
|
|
501
|
-
],
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
case "unlink_github_repository": {
|
|
505
|
-
const { projectId, repoId } = UnlinkGitHubRepositorySchema.parse(args);
|
|
506
|
-
await githubClient.unlinkRepository(projectId, String(repoId));
|
|
507
|
-
return {
|
|
508
|
-
content: [
|
|
509
|
-
{
|
|
510
|
-
type: "text",
|
|
511
|
-
text: `Repository ${repoId} unlinked successfully`,
|
|
512
|
-
},
|
|
513
|
-
],
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
263
|
default:
|
|
517
|
-
throw new Error(`Unknown doc
|
|
264
|
+
throw new Error(`Unknown doc tool: ${toolName}`);
|
|
518
265
|
}
|
|
519
266
|
}
|
|
520
267
|
//# sourceMappingURL=doc-github-tools.js.map
|