@taiga-ai/mcp-server 0.33.0 → 0.34.0-dev.715
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 +7 -7
- package/dist/index.js +111 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ You need an access key, made in Taiga under **Settings > Account > MCP**, where
|
|
|
14
14
|
|
|
15
15
|
Create the key first, and choose when it expires: in 30 days, 90 days, a year, or never. Taiga copies it to your clipboard, shows it once, and keeps it on the page until you say you have saved it, so copying the setup next does not lose it.
|
|
16
16
|
|
|
17
|
-
The same page shows the setup for your client and environment, with the key already filled in where a config file needs it, and a one-click install for Cursor. The examples here pin a release (`@taiga-ai/mcp-server@0.
|
|
17
|
+
The same page shows the setup for your client and environment, with the key already filled in where a config file needs it, and a one-click install for Cursor. The examples here pin a release (`@taiga-ai/mcp-server@0.34.0`), so an install runs the version you chose rather than whatever `latest` is at the next start.
|
|
18
18
|
|
|
19
19
|
## Install
|
|
20
20
|
|
|
@@ -23,21 +23,21 @@ The same page shows the setup for your client and environment, with the key alre
|
|
|
23
23
|
Run the command. When it asks for your access key, paste it once and press Enter. Nothing appears as you paste (PowerShell shows asterisks), and the key stays out of your shell history:
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
printf 'Taiga access key: ' && read -rs TAIGA_API_KEY && echo && claude mcp add taiga --scope user -e TAIGA_API_KEY="$TAIGA_API_KEY" -- npx -y @taiga-ai/mcp-server@0.
|
|
26
|
+
printf 'Taiga access key: ' && read -rs TAIGA_API_KEY && echo && claude mcp add taiga --scope user -e TAIGA_API_KEY="$TAIGA_API_KEY" -- npx -y @taiga-ai/mcp-server@0.34.0
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
```sh
|
|
30
|
-
printf 'Taiga access key: ' && read -rs TAIGA_API_KEY && echo && codex mcp add taiga --env TAIGA_API_KEY="$TAIGA_API_KEY" -- npx -y @taiga-ai/mcp-server@0.
|
|
30
|
+
printf 'Taiga access key: ' && read -rs TAIGA_API_KEY && echo && codex mcp add taiga --env TAIGA_API_KEY="$TAIGA_API_KEY" -- npx -y @taiga-ai/mcp-server@0.34.0
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
On Windows, in PowerShell (Claude Code needs `cmd /c` to start `npx`; the quoted `'--'` survives npm's PowerShell shims):
|
|
34
34
|
|
|
35
35
|
```powershell
|
|
36
|
-
$k = Read-Host 'Taiga access key' -AsSecureString; claude mcp add taiga --scope user -e "TAIGA_API_KEY=$([Net.NetworkCredential]::new('', $k).Password)" '--' cmd /c npx -y @taiga-ai/mcp-server@0.
|
|
36
|
+
$k = Read-Host 'Taiga access key' -AsSecureString; claude mcp add taiga --scope user -e "TAIGA_API_KEY=$([Net.NetworkCredential]::new('', $k).Password)" '--' cmd /c npx -y @taiga-ai/mcp-server@0.34.0
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
```powershell
|
|
40
|
-
$k = Read-Host 'Taiga access key' -AsSecureString; codex mcp add taiga --env "TAIGA_API_KEY=$([Net.NetworkCredential]::new('', $k).Password)" '--' npx -y @taiga-ai/mcp-server@0.
|
|
40
|
+
$k = Read-Host 'Taiga access key' -AsSecureString; codex mcp add taiga --env "TAIGA_API_KEY=$([Net.NetworkCredential]::new('', $k).Password)" '--' npx -y @taiga-ai/mcp-server@0.34.0
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
### Cursor, Windsurf, Claude Desktop and other MCP clients
|
|
@@ -49,7 +49,7 @@ Most clients read the same `mcpServers` block. Add it with your key in place of
|
|
|
49
49
|
"mcpServers": {
|
|
50
50
|
"taiga": {
|
|
51
51
|
"command": "npx",
|
|
52
|
-
"args": ["-y", "@taiga-ai/mcp-server@0.
|
|
52
|
+
"args": ["-y", "@taiga-ai/mcp-server@0.34.0"],
|
|
53
53
|
"env": { "TAIGA_API_KEY": "YOUR_ACCESS_KEY" }
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -78,7 +78,7 @@ In `.vscode/mcp.json`. VS Code reads `servers`, and prompts for the key once and
|
|
|
78
78
|
"taiga": {
|
|
79
79
|
"type": "stdio",
|
|
80
80
|
"command": "npx",
|
|
81
|
-
"args": ["-y", "@taiga-ai/mcp-server@0.
|
|
81
|
+
"args": ["-y", "@taiga-ai/mcp-server@0.34.0"],
|
|
82
82
|
"env": { "TAIGA_API_KEY": "${input:taiga-api-key}" }
|
|
83
83
|
}
|
|
84
84
|
}
|
package/dist/index.js
CHANGED
|
@@ -4420,6 +4420,16 @@ function record(keyType, valueType, params) {
|
|
|
4420
4420
|
...normalizeParams(params)
|
|
4421
4421
|
});
|
|
4422
4422
|
}
|
|
4423
|
+
function partialRecord(keyType, valueType, params) {
|
|
4424
|
+
const k = clone(keyType);
|
|
4425
|
+
k._zod.values = void 0;
|
|
4426
|
+
return new ZodRecord({
|
|
4427
|
+
type: "record",
|
|
4428
|
+
keyType: k,
|
|
4429
|
+
valueType,
|
|
4430
|
+
...normalizeParams(params)
|
|
4431
|
+
});
|
|
4432
|
+
}
|
|
4423
4433
|
const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
4424
4434
|
$ZodEnum.init(inst, def);
|
|
4425
4435
|
ZodType.init(inst, def);
|
|
@@ -23249,18 +23259,22 @@ const LINE_STATES = [
|
|
|
23249
23259
|
* The columns a person can drop an initiative into by hand.
|
|
23250
23260
|
*
|
|
23251
23261
|
* `plan` is NOT one of them any more. Planning is the first thing the Build
|
|
23252
|
-
* station does, not a place you put work
|
|
23253
|
-
*
|
|
23254
|
-
*
|
|
23255
|
-
*
|
|
23256
|
-
*
|
|
23257
|
-
*
|
|
23258
|
-
*
|
|
23262
|
+
* station does, not a place you put work. `build` IS one: a drop into Build
|
|
23263
|
+
* from Queue, Todo or Backlog (`START_NOW_DROP_FROM_STATES`) is Start now --
|
|
23264
|
+
* the work is planned against main as it is now and built alongside the
|
|
23265
|
+
* current work. A Queue item starts its existing entry; a Todo or Backlog
|
|
23266
|
+
* item is queued and started in one transaction, so a refusal leaves nothing
|
|
23267
|
+
* queued. Done, Canceled, archived, Plan and Build items are not offered it.
|
|
23268
|
+
* It is not a state-machine edge (`INITIATIVE_TRANSITIONS`), and no path
|
|
23269
|
+
* writes it as a plain state change.
|
|
23270
|
+
* `done` and `canceled` ARE droppable (PRO-1325): finishing work by hand, and
|
|
23271
|
+
* reopening it, are moves on the board like any other.
|
|
23259
23272
|
*/
|
|
23260
23273
|
const USER_DROP_STATES = [
|
|
23261
23274
|
"backlog",
|
|
23262
23275
|
"todo",
|
|
23263
23276
|
"queue",
|
|
23277
|
+
"build",
|
|
23264
23278
|
"done",
|
|
23265
23279
|
"canceled"
|
|
23266
23280
|
];
|
|
@@ -24967,6 +24981,53 @@ function resolveAutoBuild(scopes) {
|
|
|
24967
24981
|
return scopes.initiative ?? scopes.product;
|
|
24968
24982
|
}
|
|
24969
24983
|
//#endregion
|
|
24984
|
+
//#region ../../packages/types/dist/autonomy.js
|
|
24985
|
+
/**
|
|
24986
|
+
* How far Taiga goes, in ascending order -- the order IS the meaning, so a
|
|
24987
|
+
* ceiling is a `min` and nothing else.
|
|
24988
|
+
*
|
|
24989
|
+
* - off: the signal is recorded, nothing is surfaced or raised
|
|
24990
|
+
* - notify: it is surfaced for a person (today: the finding on Maintaining)
|
|
24991
|
+
* - propose: an initiative is raised and planned; the plan waits for a person
|
|
24992
|
+
* - build: planned and built; the pull request waits for a person
|
|
24993
|
+
* - merge: the pull request merges itself, under auto-merge consent
|
|
24994
|
+
*/
|
|
24995
|
+
const AUTONOMY_LEVELS = [
|
|
24996
|
+
"off",
|
|
24997
|
+
"notify",
|
|
24998
|
+
"propose",
|
|
24999
|
+
"build",
|
|
25000
|
+
"merge"
|
|
25001
|
+
];
|
|
25002
|
+
/**
|
|
25003
|
+
* The kinds of signal a level can be set for. Closed: adding one is a code
|
|
25004
|
+
* change, because a kind without a remediation path behind it is a setting that
|
|
25005
|
+
* promises something nothing does.
|
|
25006
|
+
*
|
|
25007
|
+
* Mapped from what the sweep already produces:
|
|
25008
|
+
* - vulnerable_dependency_exploited: a vulnerable dependency in tier `act_now`
|
|
25009
|
+
* or `urgent` that is not malware (KEV-listed, or likely-exploited and high)
|
|
25010
|
+
* - vulnerable_dependency_severe: tier `elevated` at high or critical severity
|
|
25011
|
+
* -- severe, with no evidence it is being exploited
|
|
25012
|
+
* - malware: a malware advisory (OSV `MAL-*`); the fix is removing the package
|
|
25013
|
+
* - policy_violation: the implementation contradicts an organisation policy
|
|
25014
|
+
* - sast, iac_misconfig, secret: the code finding kinds of the same names
|
|
25015
|
+
* - license: a dependency whose licence the allowlist does not satisfy
|
|
25016
|
+
*
|
|
25017
|
+
* Deliberately absent: `outdated_dependency`, and vulnerable dependencies below
|
|
25018
|
+
* high severity with no exploitation evidence. Nothing is raised for them.
|
|
25019
|
+
*/
|
|
25020
|
+
const SIGNAL_KINDS = [
|
|
25021
|
+
"vulnerable_dependency_exploited",
|
|
25022
|
+
"vulnerable_dependency_severe",
|
|
25023
|
+
"malware",
|
|
25024
|
+
"policy_violation",
|
|
25025
|
+
"sast",
|
|
25026
|
+
"iac_misconfig",
|
|
25027
|
+
"secret",
|
|
25028
|
+
"license"
|
|
25029
|
+
];
|
|
25030
|
+
//#endregion
|
|
24970
25031
|
//#region ../../packages/types/dist/build-scope.js
|
|
24971
25032
|
/**
|
|
24972
25033
|
* Upper bound on `deploymentNotes`, enforced by the API's request schema.
|
|
@@ -26404,7 +26465,7 @@ function registerMaintenanceTools(server, client) {
|
|
|
26404
26465
|
}));
|
|
26405
26466
|
server.registerTool("taiga_fix_finding", {
|
|
26406
26467
|
title: "Fix a finding",
|
|
26407
|
-
description: "Raise an initiative that fixes a finding; it ends in a pull request
|
|
26468
|
+
description: "Raise an initiative that fixes a finding; it ends in a pull request, which merges on its own only where the product's auto-merge allows it. wholeGroup: true fixes, in that repository, every open advisory on that package version in one bump, or every place the rule flagged. Refused when no fixed version is known (fixable: false), the code is in a submodule, or a secret is only in history (rotate it outside Taiga).",
|
|
26408
26469
|
inputSchema: object({
|
|
26409
26470
|
productId,
|
|
26410
26471
|
findingId,
|
|
@@ -26765,7 +26826,7 @@ const PRODUCT_VIEW_FIELDS = [
|
|
|
26765
26826
|
"createdAt",
|
|
26766
26827
|
"updatedAt"
|
|
26767
26828
|
];
|
|
26768
|
-
const UNSET_MEANS = "A null setting is unset: kind reads as application; autoMerge follows the factory, then the organization; ownsInfrastructure and ownsDeployment follow the organization default (yes when it has none); ownsApplication is yes; emitDesignStandards follows how the product started; networkAccess is allowlist.";
|
|
26829
|
+
const UNSET_MEANS = "A null setting is unset: kind reads as application; autoMerge follows the factory, then the organization; ownsInfrastructure and ownsDeployment follow the organization default (yes when it has none); ownsApplication is yes; emitDesignStandards follows how the product started; networkAccess is allowlist. signalAutonomy is what each kind of finding resolves to (off, notify, propose, build, merge) and which scope decided it: the product, a factory or organization ceiling, the kind default or cap, or auto-merge consent.";
|
|
26769
26830
|
/**
|
|
26770
26831
|
* Each product's policy standing beside its row: the counts the standing read opens with. A product still in setup
|
|
26771
26832
|
* has none to read; a read the API refuses or fails says so on its row rather than failing the list.
|
|
@@ -26814,6 +26875,7 @@ function productView(product) {
|
|
|
26814
26875
|
projectType: isImportedProduct(product) ? "brownfield" : "greenfield",
|
|
26815
26876
|
...typeof settings.importStatus === "string" ? { importStatus: settings.importStatus } : {},
|
|
26816
26877
|
linePaused: stoppedAt ? { since: stoppedAt } : false,
|
|
26878
|
+
...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {},
|
|
26817
26879
|
unsetMeans: UNSET_MEANS
|
|
26818
26880
|
};
|
|
26819
26881
|
}
|
|
@@ -27129,8 +27191,9 @@ function registerProductTools(server, client) {
|
|
|
27129
27191
|
"remoteUrl"
|
|
27130
27192
|
]);
|
|
27131
27193
|
if ("refusal" in resolved) return toolError(resolved.refusal.code, resolved.refusal.message);
|
|
27132
|
-
const
|
|
27133
|
-
const
|
|
27194
|
+
const product = resolved.product.effectiveSignalAutonomy ? resolved.product : (await client.getProduct(resolved.product.id)).data;
|
|
27195
|
+
const readiness = await setupReadiness(client, product);
|
|
27196
|
+
const view = productView(product);
|
|
27134
27197
|
return toolResult(readiness ? {
|
|
27135
27198
|
...view,
|
|
27136
27199
|
readiness
|
|
@@ -27813,9 +27876,9 @@ const INITIATIVE_CHECKS = 10;
|
|
|
27813
27876
|
* The run says it itself since PRO-2808 (initiativeClosed: done, canceled,
|
|
27814
27877
|
* archived, deleted, or null while live), for every key that can read it.
|
|
27815
27878
|
* Against an API from before that, each initiative is read: a 404 is
|
|
27816
|
-
* 'deleted', and an initiative past the cap
|
|
27817
|
-
*
|
|
27818
|
-
*
|
|
27879
|
+
* 'deleted', and an initiative past the cap or one whose read failed is
|
|
27880
|
+
* 'unchecked', which withInitiativeState adds to the row's outcome. Every
|
|
27881
|
+
* caller reads runs, so holds backlog:read (PRO-3460).
|
|
27819
27882
|
*/
|
|
27820
27883
|
async function initiativeStates(client, rows) {
|
|
27821
27884
|
const states = /* @__PURE__ */ new Map();
|
|
@@ -27823,7 +27886,7 @@ async function initiativeStates(client, rows) {
|
|
|
27823
27886
|
const told = waiting.filter((row) => "initiativeClosed" in row);
|
|
27824
27887
|
for (const row of told) if (typeof row["backlogItemId"] === "string") states.set(row["backlogItemId"], typeof row["initiativeClosed"] === "string" ? row["initiativeClosed"] : "live");
|
|
27825
27888
|
const all = [...new Set(waiting.filter((row) => !("initiativeClosed" in row)).map((row) => row["backlogItemId"]).filter((id) => typeof id === "string" && !states.has(id)))];
|
|
27826
|
-
const ids =
|
|
27889
|
+
const ids = all.slice(0, INITIATIVE_CHECKS);
|
|
27827
27890
|
for (const id of all) if (!ids.includes(id)) states.set(id, "unchecked");
|
|
27828
27891
|
await Promise.all(ids.map(async (id) => {
|
|
27829
27892
|
try {
|
|
@@ -27944,10 +28007,11 @@ function summaryHeadline(summary) {
|
|
|
27944
28007
|
* failure of that read leaves the rows unnamed rather than failing the list.
|
|
27945
28008
|
*/
|
|
27946
28009
|
async function activityRows(client, opts) {
|
|
27947
|
-
const
|
|
28010
|
+
const mayListProducts = client.hasCapability("products:read");
|
|
28011
|
+
const [runs, products] = await Promise.all([client.listBuildRunActivity(opts), mayListProducts ? client.listProducts({ limit: NAMED_PRODUCTS }).catch((error) => {
|
|
27948
28012
|
if (error instanceof TaigaApiError || isNetworkFailure(error)) return null;
|
|
27949
28013
|
throw error;
|
|
27950
|
-
})]);
|
|
28014
|
+
}) : null]);
|
|
27951
28015
|
const nameById = /* @__PURE__ */ new Map();
|
|
27952
28016
|
for (const product of products?.data ?? []) nameById.set(product.id, {
|
|
27953
28017
|
name: product.name,
|
|
@@ -27961,7 +28025,7 @@ async function activityRows(client, opts) {
|
|
|
27961
28025
|
product
|
|
27962
28026
|
} : row;
|
|
27963
28027
|
});
|
|
27964
|
-
const note = !rows.some((row) => !("product" in row)) ? null : !products ? "The products could not be read, so rows carry productId only; taiga_get_product names one." : products.nextCursor !== null ? `Only the first ${NAMED_PRODUCTS} products could be named; a row without product carries productId only.` : "A row without product belongs to a product the key cannot list (deleted since, or not visible to it); it carries productId only.";
|
|
28028
|
+
const note = !rows.some((row) => !("product" in row)) ? null : !mayListProducts ? "This key cannot read products, so rows carry productId only." : !products ? "The products could not be read, so rows carry productId only; taiga_get_product names one." : products.nextCursor !== null ? `Only the first ${NAMED_PRODUCTS} products could be named; a row without product carries productId only.` : "A row without product belongs to a product the key cannot list (deleted since, or not visible to it); it carries productId only.";
|
|
27965
28029
|
return {
|
|
27966
28030
|
...page(rows, runs.nextCursor),
|
|
27967
28031
|
...note ? { note } : {}
|
|
@@ -27999,7 +28063,7 @@ async function planRevisionOf(client, initiativeId, planId) {
|
|
|
27999
28063
|
return null;
|
|
28000
28064
|
}
|
|
28001
28065
|
function registerBuildTools(server, client) {
|
|
28002
|
-
if (!client.hasCapability("
|
|
28066
|
+
if (!client.hasCapability("backlog:read")) return;
|
|
28003
28067
|
server.registerTool("taiga_list_runs", {
|
|
28004
28068
|
title: "List runs",
|
|
28005
28069
|
description: "List coding agent runs, newest first, each with one sentence on how it stands: running, waiting for a person to merge, merged, failed, stopped, or its pull request closed. One product, one initiative, or every product. status narrows to some statuses ([\"failed\"] for what failed); active: true keeps the ones running now.",
|
|
@@ -28013,7 +28077,6 @@ function registerBuildTools(server, client) {
|
|
|
28013
28077
|
annotations: READ_ONLY
|
|
28014
28078
|
}, (params) => runTool(async () => {
|
|
28015
28079
|
if (params.active && (params.productId || params.initiativeId)) return toolError("VALIDATION_ERROR", "active narrows the org-wide list only: omit productId and initiativeId, or read the product's runs and judge each by its status.");
|
|
28016
|
-
if (!params.productId && params.initiativeId && !client.hasCapability("backlog:read")) return toolError("VALIDATION_ERROR", "This key cannot read initiatives, so it cannot find the initiative's product: pass productId as well.");
|
|
28017
28080
|
const productIdOf = params.productId ?? (params.initiativeId ? (await client.getBacklogItem(params.initiativeId)).data.productId : void 0);
|
|
28018
28081
|
if (productIdOf) {
|
|
28019
28082
|
const result = await client.listBuildRuns(productIdOf, {
|
|
@@ -28713,7 +28776,7 @@ function registerRequest(server, client) {
|
|
|
28713
28776
|
function registerMove(server, client) {
|
|
28714
28777
|
server.registerTool("taiga_move_initiative", {
|
|
28715
28778
|
title: "Move initiative on the board",
|
|
28716
|
-
description: "Move an initiative to another board column, take it off the line, or reorder it. Moving it out of Build stops its plan or run; moving it to backlog, todo or canceled closes the pull request it waits on.
|
|
28779
|
+
description: "Move an initiative to another board column, take it off the line, or reorder it. Moving it out of Build stops its plan or run; moving it to backlog, todo or canceled closes the pull request it waits on. state build is Start now, from queue, todo or backlog: the initiative is planned at once against main as it is now and built alongside the current work; parallel builds in one repository can conflict, so say that when you ask. It is refused, with the API's message, for done, canceled, archived, plan and build initiatives, and when the line is stopped or there is no buildable repository. archived: true archives it in place (never from Build): pass its current column as state, or it moves too.",
|
|
28717
28780
|
inputSchema: object({
|
|
28718
28781
|
initiativeId,
|
|
28719
28782
|
state: _enum(USER_DROP_STATES).describe("The column to move into"),
|
|
@@ -28724,6 +28787,7 @@ function registerMove(server, client) {
|
|
|
28724
28787
|
}, (params) => runTool(async () => {
|
|
28725
28788
|
const { initiativeId: id, ...body } = params;
|
|
28726
28789
|
if (body.state === "queue" && !client.hasCapability("products:write")) return toolError("FORBIDDEN", "A move into queue starts agent work and needs products:write, which this key lacks.");
|
|
28790
|
+
if (body.state === "build" && !client.hasCapability("products:write")) return toolError("FORBIDDEN", "A move into build starts agent work now (Start now) and needs products:write, which this key lacks.");
|
|
28727
28791
|
return outcome((await client.transitionInitiative(id, body)).data);
|
|
28728
28792
|
}));
|
|
28729
28793
|
}
|
|
@@ -28996,7 +29060,7 @@ function waitedUntil(resolvedAt, now) {
|
|
|
28996
29060
|
*/
|
|
28997
29061
|
function readWith(row, backlogRead) {
|
|
28998
29062
|
switch (row["subjectType"]) {
|
|
28999
|
-
case "build_run": return "taiga_get_run (runId: subjectId)";
|
|
29063
|
+
case "build_run": return backlogRead ? "taiga_get_run (runId: subjectId)" : void 0;
|
|
29000
29064
|
case "backlog_item": return backlogRead ? "taiga_get_plan (initiativeId: subjectId)" : void 0;
|
|
29001
29065
|
case "product_document": {
|
|
29002
29066
|
const type = /^[^:]+:([a-z_]+):decision:/.exec(String(row["subjectId"]))?.[1];
|
|
@@ -29148,12 +29212,12 @@ async function staleReviews(client, rows) {
|
|
|
29148
29212
|
const uncheckedIds = new Set([...byId.keys()].slice(STALE_CHECKS));
|
|
29149
29213
|
const out = /* @__PURE__ */ new Map();
|
|
29150
29214
|
await Promise.all(candidates.map(async (row) => {
|
|
29215
|
+
if (!client.hasCapability("backlog:read")) return void uncheckedIds.add(String(row["id"]));
|
|
29151
29216
|
try {
|
|
29152
29217
|
const run = (await client.getBuildRun(String(row["subjectId"]))).data;
|
|
29153
29218
|
if (run["prMerged"] === true) return void out.set(String(row["id"]), "its pull request has merged");
|
|
29154
29219
|
if (run["prState"] === "closed") return void out.set(String(row["id"]), "its pull request was closed");
|
|
29155
29220
|
if (typeof run["backlogItemId"] !== "string") return;
|
|
29156
|
-
if (!client.hasCapability("backlog:read")) return void uncheckedIds.add(String(row["id"]));
|
|
29157
29221
|
const item = (await client.getBacklogItem(run["backlogItemId"])).data;
|
|
29158
29222
|
if (item["state"] === "canceled" || item["status"] === "canceled") out.set(String(row["id"]), "its initiative was canceled; the pull request is still open on the forge");
|
|
29159
29223
|
else if (item["state"] === "done" || item["status"] === "done") out.set(String(row["id"]), "its initiative is done; this run is not the one that landed it");
|
|
@@ -29543,7 +29607,7 @@ const PARTS = {
|
|
|
29543
29607
|
policies: "tenant:documents:read",
|
|
29544
29608
|
initiatives: "backlog:read",
|
|
29545
29609
|
repositories: "products:read",
|
|
29546
|
-
runs: "
|
|
29610
|
+
runs: "backlog:read",
|
|
29547
29611
|
actionRequired: "products:read",
|
|
29548
29612
|
maintenance: "products:read",
|
|
29549
29613
|
policyStanding: "products:read"
|
|
@@ -29811,10 +29875,12 @@ async function productContext(client, product, options) {
|
|
|
29811
29875
|
};
|
|
29812
29876
|
const parts = Object.keys(fetchers).filter(granted);
|
|
29813
29877
|
const [settled, readiness] = await Promise.all([Promise.allSettled(parts.map((part) => fetchers[part]())), setupReadiness(client, product, links)]);
|
|
29878
|
+
const signalAutonomy = product.effectiveSignalAutonomy ?? (await client.getProduct(productId)).data.effectiveSignalAutonomy;
|
|
29814
29879
|
const bundle = { product: {
|
|
29815
29880
|
...pickFields([product], PRODUCT_SUMMARY_FIELDS)[0],
|
|
29816
29881
|
projectType: isImportedProduct(product) ? "brownfield" : "greenfield",
|
|
29817
29882
|
defaultOrigin: defaultOriginFor(product),
|
|
29883
|
+
...signalAutonomy ? { signalAutonomy } : {},
|
|
29818
29884
|
...readiness ? { readiness } : {}
|
|
29819
29885
|
} };
|
|
29820
29886
|
const unavailable = {};
|
|
@@ -29878,27 +29944,32 @@ function registerContextTools(server, client) {
|
|
|
29878
29944
|
function registerAutonomyTools(server, client) {
|
|
29879
29945
|
if (client.hasCapability("products:write")) server.registerTool("taiga_set_product_autonomy", {
|
|
29880
29946
|
title: "Set a product's autonomy defaults",
|
|
29881
|
-
description: "Set a product's defaults: whether plans are built at once or wait for approval (autoBuild),
|
|
29947
|
+
description: "Set a product's defaults: whether plans are built at once or wait for approval (autoBuild), whether pull requests merge themselves (autoMerge), and how far Taiga goes on its own for each kind of finding it notices (signalAutonomy). autoMerge and a merge level only take effect where the organization and factory allow autonomous merge; neither is changed here. The answer says what each kind resolves to and which scope decided it.",
|
|
29882
29948
|
inputSchema: object({
|
|
29883
29949
|
productId,
|
|
29884
29950
|
autoBuild: boolean().optional().describe("Build landed plans without a review by default"),
|
|
29885
|
-
autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory")
|
|
29951
|
+
autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory"),
|
|
29952
|
+
signalAutonomy: partialRecord(_enum(SIGNAL_KINDS), _enum(AUTONOMY_LEVELS).nullable()).optional().describe("Per kind of finding: off (record only), notify (surface it), propose (plan waits for a person), build (pull request waits for a person), merge (merges itself under auto-merge consent); null follows the factory and organization. A level above the kind's cap is refused.")
|
|
29886
29953
|
}),
|
|
29887
29954
|
annotations: OPERATE_SETTING
|
|
29888
29955
|
}, (params) => runTool(async () => {
|
|
29889
|
-
if (params.autoBuild === void 0 && params.autoMerge === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge or
|
|
29956
|
+
if (params.autoBuild === void 0 && params.autoMerge === void 0 && params.signalAutonomy === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge, signalAutonomy or several.");
|
|
29890
29957
|
const autoMerge = params.autoMerge === true ? null : params.autoMerge;
|
|
29891
29958
|
const product = (await client.updateProduct(params.productId, {
|
|
29892
29959
|
...params.autoBuild !== void 0 ? { autoBuild: params.autoBuild } : {},
|
|
29893
|
-
...autoMerge !== void 0 ? { autoMerge } : {}
|
|
29960
|
+
...autoMerge !== void 0 ? { autoMerge } : {},
|
|
29961
|
+
...params.signalAutonomy !== void 0 ? { signalAutonomy: params.signalAutonomy } : {}
|
|
29894
29962
|
})).data;
|
|
29895
|
-
return toolResult(
|
|
29896
|
-
|
|
29897
|
-
|
|
29898
|
-
|
|
29899
|
-
|
|
29900
|
-
|
|
29901
|
-
|
|
29963
|
+
return toolResult({
|
|
29964
|
+
...pickFields([product], [
|
|
29965
|
+
"id",
|
|
29966
|
+
"name",
|
|
29967
|
+
"slug",
|
|
29968
|
+
"autoBuild",
|
|
29969
|
+
"autoMerge"
|
|
29970
|
+
])[0],
|
|
29971
|
+
...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {}
|
|
29972
|
+
});
|
|
29902
29973
|
}));
|
|
29903
29974
|
if (client.hasCapability("backlog:write")) server.registerTool("taiga_set_auto_merge", {
|
|
29904
29975
|
title: "Set whether an initiative's pull request merges on its own",
|
|
@@ -46175,8 +46246,9 @@ const ALL_CONDITIONS = [.../* @__PURE__ */ new Set([...ITEM_CONDITIONS, ...BUILD
|
|
|
46175
46246
|
*/
|
|
46176
46247
|
function registerWaitTools(server, client, options) {
|
|
46177
46248
|
const items = client.hasCapability("backlog:read");
|
|
46178
|
-
const runs =
|
|
46179
|
-
|
|
46249
|
+
const runs = items;
|
|
46250
|
+
const jobs = client.hasCapability("products:read");
|
|
46251
|
+
if (!items && !jobs) return;
|
|
46180
46252
|
const waitInitiative = async (target, until, params, ctx) => {
|
|
46181
46253
|
const gate = { product: void 0 };
|
|
46182
46254
|
const read = async (signal) => {
|
|
@@ -46243,7 +46315,7 @@ function registerWaitTools(server, client, options) {
|
|
|
46243
46315
|
].filter((key) => params[key] !== void 0).length !== 1) return toolError("VALIDATION_ERROR", "Name exactly one of initiativeId, runId or jobId: the thing to wait on.");
|
|
46244
46316
|
if (params.jobId !== void 0) {
|
|
46245
46317
|
if (params.until !== void 0) return toolError("VALIDATION_ERROR", "A job is waited on until it finishes: leave until out.");
|
|
46246
|
-
if (!
|
|
46318
|
+
if (!jobs) return toolError("FORBIDDEN", "Waiting on a job needs products:read, which this key lacks.");
|
|
46247
46319
|
return waitJob(params.jobId, params, ctx);
|
|
46248
46320
|
}
|
|
46249
46321
|
const kind = params.initiativeId !== void 0 ? "initiative" : "run";
|
|
@@ -46253,7 +46325,7 @@ function registerWaitTools(server, client, options) {
|
|
|
46253
46325
|
if (!items) return toolError("FORBIDDEN", "Waiting on an initiative needs backlog:read, which this key lacks.");
|
|
46254
46326
|
return waitInitiative(params.initiativeId, params.until, params, ctx);
|
|
46255
46327
|
}
|
|
46256
|
-
if (!runs) return toolError("FORBIDDEN", "Waiting on a run needs
|
|
46328
|
+
if (!runs) return toolError("FORBIDDEN", "Waiting on a run needs backlog:read, which this key lacks.");
|
|
46257
46329
|
return waitRun(params.runId, params.until, params, ctx);
|
|
46258
46330
|
}));
|
|
46259
46331
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ai/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0-dev.715",
|
|
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",
|