@taiga-ai/mcp-server 0.35.0-rc.744 → 0.35.0-rc.748
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 +66 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23212,6 +23212,9 @@ const PRODUCT_DOCUMENT_DISPLAY_NAMES = {
|
|
|
23212
23212
|
const PRODUCT_DOCUMENT_ORIGINS = ["plan", "reality"];
|
|
23213
23213
|
//#endregion
|
|
23214
23214
|
//#region ../../packages/types/dist/backlog.js
|
|
23215
|
+
/** Dispositions that end an item's pipeline life: settled work neither blocks
|
|
23216
|
+
* dependants nor counts toward completion denominators. */
|
|
23217
|
+
const SETTLED_BACKLOG_STATUSES = ["done", "canceled"];
|
|
23215
23218
|
/**
|
|
23216
23219
|
* The initiative's STORED state on the line board (PRO-1305, phase 1).
|
|
23217
23220
|
*
|
|
@@ -23261,6 +23264,11 @@ const LINE_STATES = [
|
|
|
23261
23264
|
"plan",
|
|
23262
23265
|
"build"
|
|
23263
23266
|
];
|
|
23267
|
+
/** Finished work: settled by a person or a merge, or archived. The one
|
|
23268
|
+
* predicate every "can this still move / plan / build" guard reads. */
|
|
23269
|
+
function isSettledOrArchived(item) {
|
|
23270
|
+
return item.archivedAt != null || SETTLED_BACKLOG_STATUSES.includes(item.status);
|
|
23271
|
+
}
|
|
23264
23272
|
/**
|
|
23265
23273
|
* The columns a person can drop an initiative into by hand.
|
|
23266
23274
|
*
|
|
@@ -25637,10 +25645,11 @@ function inProductWords(value) {
|
|
|
25637
25645
|
const actions = value["actions"];
|
|
25638
25646
|
if (Array.isArray(actions) && actions.some((action) => WEB_ONLY_ACTIONS.has(String(action)))) {
|
|
25639
25647
|
const webOnly = actions.filter((action) => WEB_ONLY_ACTIONS.has(String(action)));
|
|
25648
|
+
const said = value["webOnlyActions"];
|
|
25640
25649
|
value = {
|
|
25641
25650
|
...value,
|
|
25642
25651
|
actions: actions.filter((action) => !WEB_ONLY_ACTIONS.has(String(action))),
|
|
25643
|
-
webOnlyActions: webOnly
|
|
25652
|
+
webOnlyActions: [.../* @__PURE__ */ new Set([...Array.isArray(said) ? said : [], ...webOnly])]
|
|
25644
25653
|
};
|
|
25645
25654
|
}
|
|
25646
25655
|
for (const [key, inner] of Object.entries(value)) Object.defineProperty(out, PRODUCT_WORDS[key] ?? key, {
|
|
@@ -26009,6 +26018,7 @@ const FINDING_ROW_FIELDS = [
|
|
|
26009
26018
|
"tier",
|
|
26010
26019
|
"kevListedAt",
|
|
26011
26020
|
"malicious",
|
|
26021
|
+
"removal",
|
|
26012
26022
|
"status",
|
|
26013
26023
|
"title",
|
|
26014
26024
|
"ecosystem",
|
|
@@ -26149,7 +26159,12 @@ function withFixability(row) {
|
|
|
26149
26159
|
tier: typeof row["tier"] === "string" ? row["tier"] : null,
|
|
26150
26160
|
kevListedAt: typeof row["kevListedAt"] === "string" ? row["kevListedAt"] : null
|
|
26151
26161
|
};
|
|
26152
|
-
if (row["
|
|
26162
|
+
if (row["removal"] === true) return {
|
|
26163
|
+
...row,
|
|
26164
|
+
fixable: true,
|
|
26165
|
+
fixNote: "A malicious package: taiga_fix_finding removes it (or replaces it), with every advisory on that version."
|
|
26166
|
+
};
|
|
26167
|
+
if (row["kind"] === "vulnerable_dependency" && isMaliciousPackageFinding(signals)) return row["removal"] === void 0 && isFixableFinding({
|
|
26153
26168
|
...signals,
|
|
26154
26169
|
status: String(row["status"]),
|
|
26155
26170
|
kind: "vulnerable_dependency",
|
|
@@ -28035,8 +28050,15 @@ function readableRun(run, opts = {}) {
|
|
|
28035
28050
|
const blocking = typeof hardening?.blockingFindings === "number" ? hardening.blockingFindings : 0;
|
|
28036
28051
|
const named = Array.isArray(hardening?.blocking) ? hardening.blocking : [];
|
|
28037
28052
|
const scan = scanSaid(hardening);
|
|
28053
|
+
const actions = Array.isArray(run["actions"]) ? run["actions"] : null;
|
|
28054
|
+
const cannotRetry = actions !== null && run["status"] !== "failed" && run["status"] !== "stopped" && actions.includes("retry_from_failed_step");
|
|
28055
|
+
const existingWebOnly = Array.isArray(run["webOnlyActions"]) ? run["webOnlyActions"] : [];
|
|
28038
28056
|
return {
|
|
28039
28057
|
...rest,
|
|
28058
|
+
...cannotRetry ? {
|
|
28059
|
+
actions: actions.filter((action) => action !== "retry_from_failed_step"),
|
|
28060
|
+
webOnlyActions: [.../* @__PURE__ */ new Set([...existingWebOnly, "retry_from_failed_step"])]
|
|
28061
|
+
} : {},
|
|
28040
28062
|
...origin === void 0 ? {} : { origin: origin === "backlog" ? "initiative" : origin },
|
|
28041
28063
|
...means ? { failedReasonMeans: means } : {},
|
|
28042
28064
|
...scan && scan.gaps + (scan.verdict === "not_scanned" ? 1 : 0) > 0 ? { scanCoverage: scan.said } : {},
|
|
@@ -28153,6 +28175,24 @@ function verificationNote(steps) {
|
|
|
28153
28175
|
const proseSaid = prose ? `, including step ${String(prose["stepOrder"])}, which changed only documentation` : "";
|
|
28154
28176
|
return `Taiga's ${always.join(" and ")} check failed after every checked step (${String(first)} to ${String(last)})${proseSaid}. A check failing from the first step on is usually one the repository or the check environment fails throughout, not one each step broke. ` + (reasons.length > 0 ? `Its reason${reasons.length === 1 ? "" : "s"}: ${reasons.slice(0, 3).join("; ")}.` : "It records no reason; each step's headline says what its own run found.");
|
|
28155
28177
|
}
|
|
28178
|
+
/** What carrying a failed or stopped run on says, from the initiative it belongs to (PRO-1889's resume). */
|
|
28179
|
+
async function carryOnStep(client, run) {
|
|
28180
|
+
const actions = Array.isArray(run["actions"]) ? run["actions"] : [];
|
|
28181
|
+
const initiativeId = run["backlogItemId"];
|
|
28182
|
+
if (run["status"] !== "failed" && run["status"] !== "stopped" || typeof initiativeId !== "string" || !actions.some((action) => action === "resume" || action === "retry_from_failed_step")) return null;
|
|
28183
|
+
try {
|
|
28184
|
+
const item = (await client.getBacklogItem(initiativeId)).data;
|
|
28185
|
+
if (typeof item.status === "string" && isSettledOrArchived({
|
|
28186
|
+
status: item.status,
|
|
28187
|
+
archivedAt: typeof item.archivedAt === "string" ? item.archivedAt : null
|
|
28188
|
+
})) return item.archivedAt != null ? "Its initiative is archived, so there is nothing to resume; unarchive it first." : `Its initiative is ${item.status}, so there is nothing to resume; reopen it first.`;
|
|
28189
|
+
if (typeof item.state === "string" && item.needsHumanCause == null && item.state !== "plan" && item.state !== "build") return `Its initiative is in ${item.state}, not being built, so there is nothing to resume; move it to Queue to have the line build it (taiga_queue_initiative).`;
|
|
28190
|
+
return item.lifecycle?.latestBuild?.id === run["id"] ? `taiga_resume_initiative (initiativeId ${initiativeId}) carries this run on from its first unfinished step, keeping the steps already done (paid work: ask first).` : "A newer run of its initiative supersedes this one; taiga_get_initiative says what applies.";
|
|
28191
|
+
} catch (error) {
|
|
28192
|
+
if (error instanceof TaigaApiError || isNetworkFailure(error)) return null;
|
|
28193
|
+
throw error;
|
|
28194
|
+
}
|
|
28195
|
+
}
|
|
28156
28196
|
/** readableRun for a list row. */
|
|
28157
28197
|
const readableRow = (run) => readableRun(run, { row: true });
|
|
28158
28198
|
/** How many products the org-wide list names; past this a row keeps its productId only. */
|
|
@@ -28289,7 +28329,7 @@ function registerBuildTools(server, client) {
|
|
|
28289
28329
|
}));
|
|
28290
28330
|
server.registerTool("taiga_get_run", {
|
|
28291
28331
|
title: "Get run",
|
|
28292
|
-
description: "Read one coding agent run, and why it failed when it did: its outcome, pull request, security pass (scanCoverage names scanners that did not run) and each step with its commit, files and checks. A failed run says where it stopped (stoppedIn) and the line of the error that says why (cause). full: true adds every step's instructions and report. lastReplan says what a request for changes did to the plan the run builds now: the steps it added, edited and dropped.
|
|
28332
|
+
description: "Read one coding agent run, and why it failed when it did: its outcome, pull request, security pass (scanCoverage names scanners that did not run) and each step with its commit, files and checks. A failed run says where it stopped (stoppedIn) and the line of the error that says why (cause). full: true adds every step's instructions and report. lastReplan says what a request for changes did to the plan the run builds now: the steps it added, edited and dropped. A failed or stopped run's nextStep says how to carry it on (taiga_resume_initiative on its initiative).",
|
|
28293
28333
|
inputSchema: object({
|
|
28294
28334
|
runId,
|
|
28295
28335
|
full: boolean().optional().describe("Carry each step's complete instructions and report (default false: a summary)")
|
|
@@ -28307,8 +28347,10 @@ function registerBuildTools(server, client) {
|
|
|
28307
28347
|
};
|
|
28308
28348
|
const [states, lastReplan] = await Promise.all([initiativeStates(client, [runRow]), runRow.backlogItemId && runRow.planId ? planRevisionOf(client, runRow.backlogItemId, runRow.planId) : Promise.resolve(null)]);
|
|
28309
28349
|
const waitsForReview = runRow.status === "replanning" && runRow.failedReason === "steer_review";
|
|
28350
|
+
const nextStep = await carryOnStep(client, runRow);
|
|
28310
28351
|
const readable = {
|
|
28311
28352
|
...withInitiativeState(readableRun(runRow), states),
|
|
28353
|
+
...nextStep ? { nextStep } : {},
|
|
28312
28354
|
...lastReplan ? { lastReplan: {
|
|
28313
28355
|
...lastReplan,
|
|
28314
28356
|
waitsForReview
|
|
@@ -28661,6 +28703,17 @@ const STAGE = {
|
|
|
28661
28703
|
canceled: "Canceled"
|
|
28662
28704
|
};
|
|
28663
28705
|
/**
|
|
28706
|
+
* Whether a run can be carried on by taiga_resume_initiative (the API's deriveRunActions, which mirrors
|
|
28707
|
+
* applyUserCommand('resume')): failed or stopped, its pull request not merged, and resume or retry_from_failed_step
|
|
28708
|
+
* among its actions. A run absent, or one without actions (an older API), is taken to be carried on, as before.
|
|
28709
|
+
*/
|
|
28710
|
+
function canCarryOn(latestBuild) {
|
|
28711
|
+
if (!latestBuild || typeof latestBuild !== "object") return true;
|
|
28712
|
+
const run = latestBuild;
|
|
28713
|
+
if (!Array.isArray(run.actions)) return true;
|
|
28714
|
+
return (run.status === "failed" || run.status === "stopped") && run.actions.some((action) => action === "resume" || action === "retry_from_failed_step");
|
|
28715
|
+
}
|
|
28716
|
+
/**
|
|
28664
28717
|
* Where an initiative stands and what moves it on, in one sentence (PRO-2800).
|
|
28665
28718
|
* Five fields carried it (status, state, planningStatus, needsHumanCause,
|
|
28666
28719
|
* lifecycle) and a reviewing agent had to read the queue, the initiative and
|
|
@@ -28700,7 +28753,7 @@ function situationOf(item) {
|
|
|
28700
28753
|
}
|
|
28701
28754
|
const turn = life.turn === "you" ? "A person's turn" : life.turn === "agent" ? "The agent's turn" : null;
|
|
28702
28755
|
const handedBack = handbackSaid(build?.reviewEscalation);
|
|
28703
|
-
const move = life.cta === "review_pr" && handedBack ? `a person should ${handbackNextStep(build.reviewEscalation, build.provider)}` : stalled && offTheLine || offTheLineStart && life.stage !== "backlog" ? OFF_THE_LINE_MOVE : typeof life.cta === "string" ? CTA_MOVE[life.cta] : void 0;
|
|
28756
|
+
const move = life.cta === "review_pr" && handedBack ? `a person should ${handbackNextStep(build.reviewEscalation, build.provider)}` : stalled && offTheLine || offTheLineStart && life.stage !== "backlog" ? OFF_THE_LINE_MOVE : typeof life.cta === "string" ? life.cta === "resume_build" && !canCarryOn(build) ? CTA_MOVE["retry_build"] : CTA_MOVE[life.cta] : void 0;
|
|
28704
28757
|
if (requeued) parts.push(`Nothing to do: ${REQUEUED_MOVE}.`);
|
|
28705
28758
|
else if (life.cta === "view_pr") parts.push(`Nothing to do: ${move}.`);
|
|
28706
28759
|
else if (turn && move) parts.push(`${turn}: ${move}.`);
|
|
@@ -29190,10 +29243,17 @@ function registerReviewGate(server, client) {
|
|
|
29190
29243
|
function registerResume(server, client) {
|
|
29191
29244
|
server.registerTool("taiga_resume_initiative", {
|
|
29192
29245
|
title: "Resume initiative",
|
|
29193
|
-
description: "Carry on an initiative
|
|
29246
|
+
description: "Carry on an initiative: a failed plan is planned again; a stopped run, or one that failed for a transient reason (server_orphan, timeout), resumes from its first unfinished step and keeps the steps already done, whether or not the line flagged it. Refused, with the action that applies, when the run cannot be resumed (its pull request closed, or nothing is left to do).",
|
|
29194
29247
|
inputSchema: object({ initiativeId }),
|
|
29195
29248
|
annotations: OPERATE
|
|
29196
|
-
}, (params) => runTool(async () =>
|
|
29249
|
+
}, (params) => runTool(async () => {
|
|
29250
|
+
try {
|
|
29251
|
+
return outcome((await client.resumeInitiative(params.initiativeId)).data);
|
|
29252
|
+
} catch (error) {
|
|
29253
|
+
if (error instanceof TaigaApiError && error.status === 409 && error.details?.["applies"] === "start_over") return toolError("CONFLICT", `${error.apiMessage ?? "This run cannot be resumed."} Starting over is in the web app (the run page); taiga_move_initiative takes the initiative off the line.`, error.details);
|
|
29254
|
+
throw error;
|
|
29255
|
+
}
|
|
29256
|
+
}));
|
|
29197
29257
|
}
|
|
29198
29258
|
/**
|
|
29199
29259
|
* One tool for both verdicts on a plan (PRO-3044): approving and sending back are the same review, and two tools for
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ai/mcp-server",
|
|
3
|
-
"version": "0.35.0-rc.
|
|
3
|
+
"version": "0.35.0-rc.748",
|
|
4
4
|
"description": "Taiga for AI coding assistants: read products, policies, initiatives and runs, and operate the line, over MCP",
|
|
5
5
|
"mcpName": "ga.tai/mcp-server",
|
|
6
6
|
"license": "UNLICENSED",
|