@taiga-ai/mcp-server 0.37.0-dev.1162 → 0.37.0-dev.1164
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 +143 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23889,6 +23889,10 @@ var TaigaClient = class {
|
|
|
23889
23889
|
async listBuildRunEgressHosts(id) {
|
|
23890
23890
|
return this.request("GET", `/builds/${seg(id)}/hosts`);
|
|
23891
23891
|
}
|
|
23892
|
+
/** The run's report as its page reads it, with its signals (PRO-4756); data is null before one came. */
|
|
23893
|
+
async getBuildRunOverview(id) {
|
|
23894
|
+
return this.request("GET", `/builds/${seg(id)}/overview`);
|
|
23895
|
+
}
|
|
23892
23896
|
async getMaintenanceSummary(productId) {
|
|
23893
23897
|
return this.request("GET", `/products/${seg(productId)}/maintenance/summary`);
|
|
23894
23898
|
}
|
|
@@ -28269,6 +28273,95 @@ const runEvidenceSchema = object({
|
|
|
28269
28273
|
checks: array(string$2())
|
|
28270
28274
|
}))
|
|
28271
28275
|
});
|
|
28276
|
+
//#endregion
|
|
28277
|
+
//#region ../../packages/types/dist/run-signals.js
|
|
28278
|
+
/**
|
|
28279
|
+
* What a person should know before merging a Factory run's change (PRO-4756),
|
|
28280
|
+
* as the run page reads it: the handover's `signals.json` (`run-signals`
|
|
28281
|
+
* 0.1.0), held to its schema when the run files worker reads the ZIP, then
|
|
28282
|
+
* read into this shape. Its vocabularies are open: a kind this reader does not
|
|
28283
|
+
* know is shown from its words, and a light it does not know is `unknown`,
|
|
28284
|
+
* never taken for green.
|
|
28285
|
+
*/
|
|
28286
|
+
/** red blocks the merge, amber needs a person, green is proven, unchecked is a gap that matters. */
|
|
28287
|
+
const RUN_SIGNAL_LIGHTS = [
|
|
28288
|
+
"red",
|
|
28289
|
+
"amber",
|
|
28290
|
+
"green",
|
|
28291
|
+
"unchecked"
|
|
28292
|
+
];
|
|
28293
|
+
/** Whether a signal is about this change or the product as it was before it. */
|
|
28294
|
+
const RUN_SIGNAL_SUBJECTS = ["change", "base"];
|
|
28295
|
+
/** Who set a signal's light: a rule on the run's records, the assessor, the record as written, or policy. */
|
|
28296
|
+
const RUN_SIGNAL_SETTERS = [
|
|
28297
|
+
"rule",
|
|
28298
|
+
"assessor",
|
|
28299
|
+
"record",
|
|
28300
|
+
"policy"
|
|
28301
|
+
];
|
|
28302
|
+
/** How a person answered an amber signal, or made the run's next work an initiative. */
|
|
28303
|
+
const RUN_SIGNAL_ANSWERS = [
|
|
28304
|
+
"looked",
|
|
28305
|
+
"accepted",
|
|
28306
|
+
"confirmed",
|
|
28307
|
+
"changes_requested",
|
|
28308
|
+
"initiative"
|
|
28309
|
+
];
|
|
28310
|
+
/** The answers a person gives an amber signal itself. */
|
|
28311
|
+
const RUN_SIGNAL_REPLIES = [
|
|
28312
|
+
"looked",
|
|
28313
|
+
"accepted",
|
|
28314
|
+
"confirmed",
|
|
28315
|
+
"changes_requested"
|
|
28316
|
+
];
|
|
28317
|
+
/** The id the run's next work is answered under: no signal's, which never starts with `#`. */
|
|
28318
|
+
const RUN_SIGNAL_NEXT_ID = "#next";
|
|
28319
|
+
/** At most `max` code points, as the contract and {@link readRunSignals} count them. */
|
|
28320
|
+
const text$4 = (max) => string$2().refine((value) => Array.from(value).length <= max, { message: `At most ${max} characters` });
|
|
28321
|
+
/** The signals in a run page's answer: what {@link readRunSignals} reads, no more. */
|
|
28322
|
+
const runSignalsSchema = object({
|
|
28323
|
+
signals: array(object({
|
|
28324
|
+
id: text$4(80),
|
|
28325
|
+
kind: text$4(60),
|
|
28326
|
+
light: _enum([...RUN_SIGNAL_LIGHTS, "unknown"]),
|
|
28327
|
+
title: text$4(300),
|
|
28328
|
+
detail: text$4(1e3).nullable(),
|
|
28329
|
+
evidence: array(object({
|
|
28330
|
+
kind: text$4(40),
|
|
28331
|
+
name: text$4(300),
|
|
28332
|
+
detail: text$4(1e3).nullable(),
|
|
28333
|
+
url: text$4(2e3).nullable()
|
|
28334
|
+
})),
|
|
28335
|
+
about: _enum([...RUN_SIGNAL_SUBJECTS, "unknown"]),
|
|
28336
|
+
setBy: _enum([...RUN_SIGNAL_SETTERS, "unknown"]),
|
|
28337
|
+
leads: boolean()
|
|
28338
|
+
})),
|
|
28339
|
+
next: object({
|
|
28340
|
+
title: text$4(200),
|
|
28341
|
+
detail: text$4(2e3).nullable()
|
|
28342
|
+
}).nullable(),
|
|
28343
|
+
reviewMinutes: number$1().int().nullable()
|
|
28344
|
+
});
|
|
28345
|
+
/** A signal's id as a person's answer names it, counted as {@link readRunSignals} counts it. */
|
|
28346
|
+
const runSignalIdSchema = string$2().trim().min(1).refine((value) => Array.from(value).length <= 80, { message: "At most 80 characters" });
|
|
28347
|
+
const runSignalAnswerSchema = object({
|
|
28348
|
+
signalId: text$4(80),
|
|
28349
|
+
answer: _enum(RUN_SIGNAL_ANSWERS),
|
|
28350
|
+
answeredBy: string$2(),
|
|
28351
|
+
answeredByName: string$2().nullable(),
|
|
28352
|
+
answeredAt: string$2(),
|
|
28353
|
+
initiativeId: string$2().nullable()
|
|
28354
|
+
});
|
|
28355
|
+
function runSignalsVerdict(signals, answers) {
|
|
28356
|
+
const answered = new Set(answers.map((answer) => answer.signalId));
|
|
28357
|
+
const blocking = signals.filter((signal) => signal.light === "red").length;
|
|
28358
|
+
const open = signals.filter((signal) => signal.light === "amber" && !answered.has(signal.id)).length;
|
|
28359
|
+
return {
|
|
28360
|
+
state: blocking > 0 ? "not_ready" : open > 0 ? "needs_you" : "ready",
|
|
28361
|
+
blocking,
|
|
28362
|
+
open
|
|
28363
|
+
};
|
|
28364
|
+
}
|
|
28272
28365
|
[...BUILD_RUN_ACTIVE_STATUSES.filter((s) => s !== "reviewing")];
|
|
28273
28366
|
//#endregion
|
|
28274
28367
|
//#region ../../packages/types/dist/agents.js
|
|
@@ -30173,7 +30266,13 @@ object({
|
|
|
30173
30266
|
/** What the run checked, from its handover's `evidence.json` (PRO-4679). */
|
|
30174
30267
|
evidence: runEvidenceSchema.nullable().optional(),
|
|
30175
30268
|
/** The acceptance criteria the run was given, which its evidence judges by number (PRO-4680). */
|
|
30176
|
-
criteria: runGivenCriteriaSchema.nullable().optional()
|
|
30269
|
+
criteria: runGivenCriteriaSchema.nullable().optional(),
|
|
30270
|
+
/** What a person should know before merging, from its handover's `signals.json` (PRO-4756). */
|
|
30271
|
+
signals: runSignalsSchema.nullable().optional(),
|
|
30272
|
+
/** How people answered this report's signals (PRO-4760). */
|
|
30273
|
+
signalAnswers: array(runSignalAnswerSchema).optional(),
|
|
30274
|
+
/** The report's version, which an answer names (PRO-4760). */
|
|
30275
|
+
reportVersion: number$1().int().optional()
|
|
30177
30276
|
}), strictObject({
|
|
30178
30277
|
notes: string$2().trim().min(1).max(CHANGE_REQUEST_MAX_CHARS),
|
|
30179
30278
|
/** Show the revised plan before the run continues (PRO-3164). */
|
|
@@ -30189,7 +30288,12 @@ object({
|
|
|
30189
30288
|
]).optional() }), object({ files: array(object({
|
|
30190
30289
|
id: string$2(),
|
|
30191
30290
|
url: string$2().url()
|
|
30192
|
-
})) }), object({ hosts: array(string$2()).max(500) })
|
|
30291
|
+
})) }), object({ hosts: array(string$2()).max(500) }), strictObject({
|
|
30292
|
+
signalId: runSignalIdSchema,
|
|
30293
|
+
answer: _enum(RUN_SIGNAL_REPLIES),
|
|
30294
|
+
/** The report the person read: an answer never lands on a newer one. */
|
|
30295
|
+
reportVersion: number$1().int().min(1)
|
|
30296
|
+
}), strictObject({ reportVersion: number$1().int().min(1) });
|
|
30193
30297
|
object({ images: array(object({
|
|
30194
30298
|
name: string$2(),
|
|
30195
30299
|
url: string$2().url().nullable()
|
|
@@ -40658,20 +40762,21 @@ function registerBuildTools(server, client) {
|
|
|
40658
40762
|
}));
|
|
40659
40763
|
server.registerTool("taiga_get_run", {
|
|
40660
40764
|
title: "Get run",
|
|
40661
|
-
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). hostsReached lists the public hosts the run reached through the egress gateway, first reached first, with the bytes it sent and received there.",
|
|
40765
|
+
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). hostsReached lists the public hosts the run reached through the egress gateway, first reached first, with the bytes it sent and received there. signals is what a person should know before merging, from the run's report: each with its light (red blocks the merge, amber needs a person, green is proven, unchecked is a gap that matters) and whether a person answered it, the verdict they add up to, and the work the run would do next.",
|
|
40662
40766
|
inputSchema: object({
|
|
40663
40767
|
runId,
|
|
40664
40768
|
full: boolean().optional().describe("Carry each step's complete instructions and report (default false: a summary)")
|
|
40665
40769
|
}),
|
|
40666
40770
|
annotations: READ_ONLY
|
|
40667
40771
|
}, (params) => runTool(async () => {
|
|
40668
|
-
const [run, steps, hosts] = await Promise.all([
|
|
40772
|
+
const [run, steps, hosts, overview] = await Promise.all([
|
|
40669
40773
|
client.getBuildRun(params.runId),
|
|
40670
40774
|
client.listBuildRunSteps(params.runId),
|
|
40671
40775
|
client.listBuildRunEgressHosts(params.runId).catch((error) => {
|
|
40672
40776
|
if (error instanceof TaigaApiError && error.status === 404) return { data: [] };
|
|
40673
40777
|
throw error;
|
|
40674
|
-
})
|
|
40778
|
+
}),
|
|
40779
|
+
client.getBuildRunOverview(params.runId).catch(() => ({ data: null }))
|
|
40675
40780
|
]);
|
|
40676
40781
|
const runRow = run.data;
|
|
40677
40782
|
const rows = steps.data.map((step) => neverStarted(step));
|
|
@@ -40691,7 +40796,8 @@ function registerBuildTools(server, client) {
|
|
|
40691
40796
|
...lastReplan,
|
|
40692
40797
|
waitsForReview
|
|
40693
40798
|
} } : {},
|
|
40694
|
-
...hostsReachedOf(hosts.data)
|
|
40799
|
+
...hostsReachedOf(hosts.data),
|
|
40800
|
+
...signalsOf(overview.data)
|
|
40695
40801
|
};
|
|
40696
40802
|
const note = verificationNote(rows);
|
|
40697
40803
|
const verification = note ? { verificationNote: note } : {};
|
|
@@ -40751,6 +40857,37 @@ function steerSituation(steer) {
|
|
|
40751
40857
|
if (steer === "after_round") return "The run is answering review comments or fixing CI; the request is planned when that round ends, and no further automatic round starts while it is open.";
|
|
40752
40858
|
return "A re-plan is already running; the request joins it.";
|
|
40753
40859
|
}
|
|
40860
|
+
/**
|
|
40861
|
+
* What a person should know before merging (PRO-4756), as the run page shows it: the verdict the
|
|
40862
|
+
* lights add up to, each signal with its light, words and whether a person answered it, and the
|
|
40863
|
+
* work the run would do next. Nothing for a run whose report has no signals.
|
|
40864
|
+
*/
|
|
40865
|
+
function signalsOf(overview) {
|
|
40866
|
+
const signals = overview?.signals;
|
|
40867
|
+
if (!signals) return {};
|
|
40868
|
+
const answers = overview.signalAnswers ?? [];
|
|
40869
|
+
const answered = new Map(answers.map((answer) => [answer.signalId, answer]));
|
|
40870
|
+
const verdict = runSignalsVerdict(signals.signals, answers);
|
|
40871
|
+
return { signals: {
|
|
40872
|
+
verdict: verdict.state === "not_ready" ? `Not ready: ${verdict.blocking} blocking` : verdict.state === "needs_you" ? `Ready once a person looks at ${verdict.open}` : "Ready",
|
|
40873
|
+
...signals.reviewMinutes ? { reviewMinutes: signals.reviewMinutes } : {},
|
|
40874
|
+
items: signals.signals.map((signal) => ({
|
|
40875
|
+
id: signal.id,
|
|
40876
|
+
light: signal.light,
|
|
40877
|
+
kind: signal.kind,
|
|
40878
|
+
title: signal.title,
|
|
40879
|
+
...signal.detail ? { detail: signal.detail } : {},
|
|
40880
|
+
...signal.about === "base" ? { about: "already so before this change" } : {},
|
|
40881
|
+
...signal.evidence.length > 0 ? { evidence: signal.evidence.map((item) => item.name) } : {},
|
|
40882
|
+
...answered.has(signal.id) ? { answered: answered.get(signal.id).answer } : {}
|
|
40883
|
+
})),
|
|
40884
|
+
...signals.next ? { next: {
|
|
40885
|
+
title: signals.next.title,
|
|
40886
|
+
...signals.next.detail ? { detail: signals.next.detail } : {},
|
|
40887
|
+
...answered.get("#next")?.initiativeId ? { initiativeId: answered.get(RUN_SIGNAL_NEXT_ID).initiativeId } : {}
|
|
40888
|
+
} } : {}
|
|
40889
|
+
} };
|
|
40890
|
+
}
|
|
40754
40891
|
/** At most this many hosts in a run's read; the rest are counted. */
|
|
40755
40892
|
const HOSTS_REACHED_SHOWN = 50;
|
|
40756
40893
|
/** Where a run went (PRO-4268): its hosts, first reached first, or nothing for a run that reached none. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ai/mcp-server",
|
|
3
|
-
"version": "0.37.0-dev.
|
|
3
|
+
"version": "0.37.0-dev.1164",
|
|
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",
|