@taiga-ai/mcp-server 0.14.0-rc.426 → 0.16.0-dev.433
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/dist/index.js +742 -192
- package/package.json +6 -2
- package/scripts/build.mjs +2 -2
- package/scripts/prepare-publish.cjs +4 -3
- package/src/client.ts +130 -2
- package/src/index.ts +11 -21
- package/src/modern.integration.test.ts +153 -0
- package/src/server.integration.test.ts +612 -44
- package/src/server.ts +18 -0
- package/src/tools/autonomy.ts +5 -5
- package/src/tools/backlogs.ts +20 -20
- package/src/tools/builds.ts +6 -6
- package/src/tools/catalogue.test.ts +5 -3
- package/src/tools/context.ts +3 -4
- package/src/tools/documents.ts +16 -16
- package/src/tools/errors.ts +7 -19
- package/src/tools/inbox.ts +6 -6
- package/src/tools/index.ts +11 -8
- package/src/tools/instructions.ts +8 -0
- package/src/tools/jobs.ts +2 -2
- package/src/tools/knowledge.ts +7 -7
- package/src/tools/maintenance.ts +13 -13
- package/src/tools/observe.ts +12 -8
- package/src/tools/product-documents.ts +8 -8
- package/src/tools/products.ts +12 -12
- package/src/tools/prompts.ts +11 -17
- package/src/tools/queue.ts +4 -4
- package/src/tools/repositories.ts +266 -0
- package/src/tools/resources.ts +9 -5
- package/src/tools/setup.ts +342 -0
- package/src/tools/wait.ts +21 -21
- package/taiga-ai-mcp-server-0.16.0-dev.433.tgz +0 -0
- package/taiga-ai-mcp-server-0.14.0-rc.426.tgz +0 -0
package/src/tools/wait.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
2
2
|
import { BUILD_RUN_TERMINAL_STATUSES, resolveAutoBuild } from '@taiga/types';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { TaigaApiError, type TaigaClient } from '../client.js';
|
|
@@ -49,7 +49,7 @@ type Verdict = { reached: true } | { reached: false; stoppedBecause: string } |
|
|
|
49
49
|
|
|
50
50
|
interface Progress {
|
|
51
51
|
progressToken: string | number | undefined;
|
|
52
|
-
|
|
52
|
+
notify: (notification: {
|
|
53
53
|
method: 'notifications/progress';
|
|
54
54
|
params: { progressToken: string | number; progress: number; total: number; message: string };
|
|
55
55
|
}) => Promise<void>;
|
|
@@ -128,7 +128,7 @@ async function waitFor(
|
|
|
128
128
|
if (attempt > 0 && progress.progressToken !== undefined) {
|
|
129
129
|
// Best effort: a progress line the client cannot take does not end the wait.
|
|
130
130
|
await progress
|
|
131
|
-
.
|
|
131
|
+
.notify({
|
|
132
132
|
method: 'notifications/progress',
|
|
133
133
|
params: {
|
|
134
134
|
progressToken: progress.progressToken,
|
|
@@ -355,14 +355,14 @@ export function registerWaitTools(server: McpServer, client: TaigaClient, option
|
|
|
355
355
|
'call again to keep waiting. Conditions are states, not events: an initiative whose latest run is already ' +
|
|
356
356
|
'settled answers run_settled at once; item is null when not even the first read answered in time. ' +
|
|
357
357
|
'Planning takes minutes and a build up to an hour.',
|
|
358
|
-
inputSchema: {
|
|
358
|
+
inputSchema: z.object({
|
|
359
359
|
itemId: z.string().uuid().describe('Backlog item ID -- get from taiga_list_backlog_items'),
|
|
360
360
|
until: z.enum(ITEM_CONDITIONS).describe('What to wait for'),
|
|
361
361
|
timeoutSeconds,
|
|
362
|
-
},
|
|
362
|
+
}),
|
|
363
363
|
annotations: READ_ONLY,
|
|
364
364
|
},
|
|
365
|
-
(params,
|
|
365
|
+
(params, ctx) =>
|
|
366
366
|
runTool(async () => {
|
|
367
367
|
const gate: GateDefault = { product: undefined };
|
|
368
368
|
const read = async (signal: AbortSignal) => {
|
|
@@ -392,9 +392,9 @@ export function registerWaitTools(server: McpServer, client: TaigaClient, option
|
|
|
392
392
|
(params.timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS) * 1000,
|
|
393
393
|
options,
|
|
394
394
|
{
|
|
395
|
-
progressToken:
|
|
396
|
-
|
|
397
|
-
signal:
|
|
395
|
+
progressToken: ctx.mcpReq._meta?.progressToken,
|
|
396
|
+
notify: ctx.mcpReq.notify,
|
|
397
|
+
signal: ctx.mcpReq.signal,
|
|
398
398
|
}
|
|
399
399
|
);
|
|
400
400
|
const { now, ...outcome } = result;
|
|
@@ -416,14 +416,14 @@ export function registerWaitTools(server: McpServer, client: TaigaClient, option
|
|
|
416
416
|
'changed waits on, since a person resuming the run is a change), or at the timeout with reached: false: ' +
|
|
417
417
|
'call again to keep waiting. Conditions are states: a run already settled answers settled at once; run ' +
|
|
418
418
|
'is null when not even the first read answered in time.',
|
|
419
|
-
inputSchema: {
|
|
419
|
+
inputSchema: z.object({
|
|
420
420
|
buildId: z.string().uuid().describe('Build run ID -- get from taiga_list_builds'),
|
|
421
421
|
until: z.enum(BUILD_CONDITIONS).describe('What to wait for'),
|
|
422
422
|
timeoutSeconds,
|
|
423
|
-
},
|
|
423
|
+
}),
|
|
424
424
|
annotations: READ_ONLY,
|
|
425
425
|
},
|
|
426
|
-
(params,
|
|
426
|
+
(params, ctx) =>
|
|
427
427
|
runTool(async () => {
|
|
428
428
|
const result = await waitFor(
|
|
429
429
|
async (signal) => (await client.getBuildRun(params.buildId, signal)).data as Row,
|
|
@@ -431,9 +431,9 @@ export function registerWaitTools(server: McpServer, client: TaigaClient, option
|
|
|
431
431
|
(params.timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS) * 1000,
|
|
432
432
|
options,
|
|
433
433
|
{
|
|
434
|
-
progressToken:
|
|
435
|
-
|
|
436
|
-
signal:
|
|
434
|
+
progressToken: ctx.mcpReq._meta?.progressToken,
|
|
435
|
+
notify: ctx.mcpReq.notify,
|
|
436
|
+
signal: ctx.mcpReq.signal,
|
|
437
437
|
}
|
|
438
438
|
);
|
|
439
439
|
const { now, ...outcome } = result;
|
|
@@ -456,13 +456,13 @@ export function registerWaitTools(server: McpServer, client: TaigaClient, option
|
|
|
456
456
|
'a refresh. Returns the job as taiga_get_job reads it, with what came of an initiative request, as soon ' +
|
|
457
457
|
'as it settles (reached: true), or at the timeout with reached: false: call again to keep waiting. Most ' +
|
|
458
458
|
'jobs take a few minutes.',
|
|
459
|
-
inputSchema: {
|
|
459
|
+
inputSchema: z.object({
|
|
460
460
|
jobId: z.string().uuid().describe('Agent job ID -- a request tool returns it'),
|
|
461
461
|
timeoutSeconds,
|
|
462
|
-
},
|
|
462
|
+
}),
|
|
463
463
|
annotations: READ_ONLY,
|
|
464
464
|
},
|
|
465
|
-
(params,
|
|
465
|
+
(params, ctx) =>
|
|
466
466
|
runTool(async () => {
|
|
467
467
|
const result = await waitFor(
|
|
468
468
|
async (signal) => (await client.getAgentJob(params.jobId, signal)).data as Row,
|
|
@@ -470,9 +470,9 @@ export function registerWaitTools(server: McpServer, client: TaigaClient, option
|
|
|
470
470
|
(params.timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS) * 1000,
|
|
471
471
|
options,
|
|
472
472
|
{
|
|
473
|
-
progressToken:
|
|
474
|
-
|
|
475
|
-
signal:
|
|
473
|
+
progressToken: ctx.mcpReq._meta?.progressToken,
|
|
474
|
+
notify: ctx.mcpReq.notify,
|
|
475
|
+
signal: ctx.mcpReq.signal,
|
|
476
476
|
}
|
|
477
477
|
);
|
|
478
478
|
const { now, ...outcome } = result;
|
|
Binary file
|
|
Binary file
|