@taiga-ai/mcp-server 0.33.0 → 0.34.0-dev.716
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 +112 -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);
|
|
@@ -23041,6 +23051,7 @@ const FORGE_SUPPORT = {
|
|
|
23041
23051
|
"change_request.merge",
|
|
23042
23052
|
"review.read",
|
|
23043
23053
|
"review.respond",
|
|
23054
|
+
"repository.branches.list",
|
|
23044
23055
|
"repository.branches.read",
|
|
23045
23056
|
"repository.history",
|
|
23046
23057
|
"repository.compare",
|
|
@@ -23249,18 +23260,22 @@ const LINE_STATES = [
|
|
|
23249
23260
|
* The columns a person can drop an initiative into by hand.
|
|
23250
23261
|
*
|
|
23251
23262
|
* `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
|
-
*
|
|
23263
|
+
* station does, not a place you put work. `build` IS one: a drop into Build
|
|
23264
|
+
* from Queue, Todo or Backlog (`START_NOW_DROP_FROM_STATES`) is Start now --
|
|
23265
|
+
* the work is planned against main as it is now and built alongside the
|
|
23266
|
+
* current work. A Queue item starts its existing entry; a Todo or Backlog
|
|
23267
|
+
* item is queued and started in one transaction, so a refusal leaves nothing
|
|
23268
|
+
* queued. Done, Canceled, archived, Plan and Build items are not offered it.
|
|
23269
|
+
* It is not a state-machine edge (`INITIATIVE_TRANSITIONS`), and no path
|
|
23270
|
+
* writes it as a plain state change.
|
|
23271
|
+
* `done` and `canceled` ARE droppable (PRO-1325): finishing work by hand, and
|
|
23272
|
+
* reopening it, are moves on the board like any other.
|
|
23259
23273
|
*/
|
|
23260
23274
|
const USER_DROP_STATES = [
|
|
23261
23275
|
"backlog",
|
|
23262
23276
|
"todo",
|
|
23263
23277
|
"queue",
|
|
23278
|
+
"build",
|
|
23264
23279
|
"done",
|
|
23265
23280
|
"canceled"
|
|
23266
23281
|
];
|
|
@@ -24967,6 +24982,53 @@ function resolveAutoBuild(scopes) {
|
|
|
24967
24982
|
return scopes.initiative ?? scopes.product;
|
|
24968
24983
|
}
|
|
24969
24984
|
//#endregion
|
|
24985
|
+
//#region ../../packages/types/dist/autonomy.js
|
|
24986
|
+
/**
|
|
24987
|
+
* How far Taiga goes, in ascending order -- the order IS the meaning, so a
|
|
24988
|
+
* ceiling is a `min` and nothing else.
|
|
24989
|
+
*
|
|
24990
|
+
* - off: the signal is recorded, nothing is surfaced or raised
|
|
24991
|
+
* - notify: it is surfaced for a person (today: the finding on Maintaining)
|
|
24992
|
+
* - propose: an initiative is raised and planned; the plan waits for a person
|
|
24993
|
+
* - build: planned and built; the pull request waits for a person
|
|
24994
|
+
* - merge: the pull request merges itself, under auto-merge consent
|
|
24995
|
+
*/
|
|
24996
|
+
const AUTONOMY_LEVELS = [
|
|
24997
|
+
"off",
|
|
24998
|
+
"notify",
|
|
24999
|
+
"propose",
|
|
25000
|
+
"build",
|
|
25001
|
+
"merge"
|
|
25002
|
+
];
|
|
25003
|
+
/**
|
|
25004
|
+
* The kinds of signal a level can be set for. Closed: adding one is a code
|
|
25005
|
+
* change, because a kind without a remediation path behind it is a setting that
|
|
25006
|
+
* promises something nothing does.
|
|
25007
|
+
*
|
|
25008
|
+
* Mapped from what the sweep already produces:
|
|
25009
|
+
* - vulnerable_dependency_exploited: a vulnerable dependency in tier `act_now`
|
|
25010
|
+
* or `urgent` that is not malware (KEV-listed, or likely-exploited and high)
|
|
25011
|
+
* - vulnerable_dependency_severe: tier `elevated` at high or critical severity
|
|
25012
|
+
* -- severe, with no evidence it is being exploited
|
|
25013
|
+
* - malware: a malware advisory (OSV `MAL-*`); the fix is removing the package
|
|
25014
|
+
* - policy_violation: the implementation contradicts an organisation policy
|
|
25015
|
+
* - sast, iac_misconfig, secret: the code finding kinds of the same names
|
|
25016
|
+
* - license: a dependency whose licence the allowlist does not satisfy
|
|
25017
|
+
*
|
|
25018
|
+
* Deliberately absent: `outdated_dependency`, and vulnerable dependencies below
|
|
25019
|
+
* high severity with no exploitation evidence. Nothing is raised for them.
|
|
25020
|
+
*/
|
|
25021
|
+
const SIGNAL_KINDS = [
|
|
25022
|
+
"vulnerable_dependency_exploited",
|
|
25023
|
+
"vulnerable_dependency_severe",
|
|
25024
|
+
"malware",
|
|
25025
|
+
"policy_violation",
|
|
25026
|
+
"sast",
|
|
25027
|
+
"iac_misconfig",
|
|
25028
|
+
"secret",
|
|
25029
|
+
"license"
|
|
25030
|
+
];
|
|
25031
|
+
//#endregion
|
|
24970
25032
|
//#region ../../packages/types/dist/build-scope.js
|
|
24971
25033
|
/**
|
|
24972
25034
|
* Upper bound on `deploymentNotes`, enforced by the API's request schema.
|
|
@@ -26404,7 +26466,7 @@ function registerMaintenanceTools(server, client) {
|
|
|
26404
26466
|
}));
|
|
26405
26467
|
server.registerTool("taiga_fix_finding", {
|
|
26406
26468
|
title: "Fix a finding",
|
|
26407
|
-
description: "Raise an initiative that fixes a finding; it ends in a pull request
|
|
26469
|
+
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
26470
|
inputSchema: object({
|
|
26409
26471
|
productId,
|
|
26410
26472
|
findingId,
|
|
@@ -26765,7 +26827,7 @@ const PRODUCT_VIEW_FIELDS = [
|
|
|
26765
26827
|
"createdAt",
|
|
26766
26828
|
"updatedAt"
|
|
26767
26829
|
];
|
|
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.";
|
|
26830
|
+
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
26831
|
/**
|
|
26770
26832
|
* Each product's policy standing beside its row: the counts the standing read opens with. A product still in setup
|
|
26771
26833
|
* has none to read; a read the API refuses or fails says so on its row rather than failing the list.
|
|
@@ -26814,6 +26876,7 @@ function productView(product) {
|
|
|
26814
26876
|
projectType: isImportedProduct(product) ? "brownfield" : "greenfield",
|
|
26815
26877
|
...typeof settings.importStatus === "string" ? { importStatus: settings.importStatus } : {},
|
|
26816
26878
|
linePaused: stoppedAt ? { since: stoppedAt } : false,
|
|
26879
|
+
...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {},
|
|
26817
26880
|
unsetMeans: UNSET_MEANS
|
|
26818
26881
|
};
|
|
26819
26882
|
}
|
|
@@ -27129,8 +27192,9 @@ function registerProductTools(server, client) {
|
|
|
27129
27192
|
"remoteUrl"
|
|
27130
27193
|
]);
|
|
27131
27194
|
if ("refusal" in resolved) return toolError(resolved.refusal.code, resolved.refusal.message);
|
|
27132
|
-
const
|
|
27133
|
-
const
|
|
27195
|
+
const product = resolved.product.effectiveSignalAutonomy ? resolved.product : (await client.getProduct(resolved.product.id)).data;
|
|
27196
|
+
const readiness = await setupReadiness(client, product);
|
|
27197
|
+
const view = productView(product);
|
|
27134
27198
|
return toolResult(readiness ? {
|
|
27135
27199
|
...view,
|
|
27136
27200
|
readiness
|
|
@@ -27813,9 +27877,9 @@ const INITIATIVE_CHECKS = 10;
|
|
|
27813
27877
|
* The run says it itself since PRO-2808 (initiativeClosed: done, canceled,
|
|
27814
27878
|
* archived, deleted, or null while live), for every key that can read it.
|
|
27815
27879
|
* Against an API from before that, each initiative is read: a 404 is
|
|
27816
|
-
* 'deleted', and an initiative past the cap
|
|
27817
|
-
*
|
|
27818
|
-
*
|
|
27880
|
+
* 'deleted', and an initiative past the cap or one whose read failed is
|
|
27881
|
+
* 'unchecked', which withInitiativeState adds to the row's outcome. Every
|
|
27882
|
+
* caller reads runs, so holds backlog:read (PRO-3460).
|
|
27819
27883
|
*/
|
|
27820
27884
|
async function initiativeStates(client, rows) {
|
|
27821
27885
|
const states = /* @__PURE__ */ new Map();
|
|
@@ -27823,7 +27887,7 @@ async function initiativeStates(client, rows) {
|
|
|
27823
27887
|
const told = waiting.filter((row) => "initiativeClosed" in row);
|
|
27824
27888
|
for (const row of told) if (typeof row["backlogItemId"] === "string") states.set(row["backlogItemId"], typeof row["initiativeClosed"] === "string" ? row["initiativeClosed"] : "live");
|
|
27825
27889
|
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 =
|
|
27890
|
+
const ids = all.slice(0, INITIATIVE_CHECKS);
|
|
27827
27891
|
for (const id of all) if (!ids.includes(id)) states.set(id, "unchecked");
|
|
27828
27892
|
await Promise.all(ids.map(async (id) => {
|
|
27829
27893
|
try {
|
|
@@ -27944,10 +28008,11 @@ function summaryHeadline(summary) {
|
|
|
27944
28008
|
* failure of that read leaves the rows unnamed rather than failing the list.
|
|
27945
28009
|
*/
|
|
27946
28010
|
async function activityRows(client, opts) {
|
|
27947
|
-
const
|
|
28011
|
+
const mayListProducts = client.hasCapability("products:read");
|
|
28012
|
+
const [runs, products] = await Promise.all([client.listBuildRunActivity(opts), mayListProducts ? client.listProducts({ limit: NAMED_PRODUCTS }).catch((error) => {
|
|
27948
28013
|
if (error instanceof TaigaApiError || isNetworkFailure(error)) return null;
|
|
27949
28014
|
throw error;
|
|
27950
|
-
})]);
|
|
28015
|
+
}) : null]);
|
|
27951
28016
|
const nameById = /* @__PURE__ */ new Map();
|
|
27952
28017
|
for (const product of products?.data ?? []) nameById.set(product.id, {
|
|
27953
28018
|
name: product.name,
|
|
@@ -27961,7 +28026,7 @@ async function activityRows(client, opts) {
|
|
|
27961
28026
|
product
|
|
27962
28027
|
} : row;
|
|
27963
28028
|
});
|
|
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.";
|
|
28029
|
+
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
28030
|
return {
|
|
27966
28031
|
...page(rows, runs.nextCursor),
|
|
27967
28032
|
...note ? { note } : {}
|
|
@@ -27999,7 +28064,7 @@ async function planRevisionOf(client, initiativeId, planId) {
|
|
|
27999
28064
|
return null;
|
|
28000
28065
|
}
|
|
28001
28066
|
function registerBuildTools(server, client) {
|
|
28002
|
-
if (!client.hasCapability("
|
|
28067
|
+
if (!client.hasCapability("backlog:read")) return;
|
|
28003
28068
|
server.registerTool("taiga_list_runs", {
|
|
28004
28069
|
title: "List runs",
|
|
28005
28070
|
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 +28078,6 @@ function registerBuildTools(server, client) {
|
|
|
28013
28078
|
annotations: READ_ONLY
|
|
28014
28079
|
}, (params) => runTool(async () => {
|
|
28015
28080
|
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
28081
|
const productIdOf = params.productId ?? (params.initiativeId ? (await client.getBacklogItem(params.initiativeId)).data.productId : void 0);
|
|
28018
28082
|
if (productIdOf) {
|
|
28019
28083
|
const result = await client.listBuildRuns(productIdOf, {
|
|
@@ -28713,7 +28777,7 @@ function registerRequest(server, client) {
|
|
|
28713
28777
|
function registerMove(server, client) {
|
|
28714
28778
|
server.registerTool("taiga_move_initiative", {
|
|
28715
28779
|
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.
|
|
28780
|
+
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
28781
|
inputSchema: object({
|
|
28718
28782
|
initiativeId,
|
|
28719
28783
|
state: _enum(USER_DROP_STATES).describe("The column to move into"),
|
|
@@ -28724,6 +28788,7 @@ function registerMove(server, client) {
|
|
|
28724
28788
|
}, (params) => runTool(async () => {
|
|
28725
28789
|
const { initiativeId: id, ...body } = params;
|
|
28726
28790
|
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.");
|
|
28791
|
+
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
28792
|
return outcome((await client.transitionInitiative(id, body)).data);
|
|
28728
28793
|
}));
|
|
28729
28794
|
}
|
|
@@ -28996,7 +29061,7 @@ function waitedUntil(resolvedAt, now) {
|
|
|
28996
29061
|
*/
|
|
28997
29062
|
function readWith(row, backlogRead) {
|
|
28998
29063
|
switch (row["subjectType"]) {
|
|
28999
|
-
case "build_run": return "taiga_get_run (runId: subjectId)";
|
|
29064
|
+
case "build_run": return backlogRead ? "taiga_get_run (runId: subjectId)" : void 0;
|
|
29000
29065
|
case "backlog_item": return backlogRead ? "taiga_get_plan (initiativeId: subjectId)" : void 0;
|
|
29001
29066
|
case "product_document": {
|
|
29002
29067
|
const type = /^[^:]+:([a-z_]+):decision:/.exec(String(row["subjectId"]))?.[1];
|
|
@@ -29148,12 +29213,12 @@ async function staleReviews(client, rows) {
|
|
|
29148
29213
|
const uncheckedIds = new Set([...byId.keys()].slice(STALE_CHECKS));
|
|
29149
29214
|
const out = /* @__PURE__ */ new Map();
|
|
29150
29215
|
await Promise.all(candidates.map(async (row) => {
|
|
29216
|
+
if (!client.hasCapability("backlog:read")) return void uncheckedIds.add(String(row["id"]));
|
|
29151
29217
|
try {
|
|
29152
29218
|
const run = (await client.getBuildRun(String(row["subjectId"]))).data;
|
|
29153
29219
|
if (run["prMerged"] === true) return void out.set(String(row["id"]), "its pull request has merged");
|
|
29154
29220
|
if (run["prState"] === "closed") return void out.set(String(row["id"]), "its pull request was closed");
|
|
29155
29221
|
if (typeof run["backlogItemId"] !== "string") return;
|
|
29156
|
-
if (!client.hasCapability("backlog:read")) return void uncheckedIds.add(String(row["id"]));
|
|
29157
29222
|
const item = (await client.getBacklogItem(run["backlogItemId"])).data;
|
|
29158
29223
|
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
29224
|
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 +29608,7 @@ const PARTS = {
|
|
|
29543
29608
|
policies: "tenant:documents:read",
|
|
29544
29609
|
initiatives: "backlog:read",
|
|
29545
29610
|
repositories: "products:read",
|
|
29546
|
-
runs: "
|
|
29611
|
+
runs: "backlog:read",
|
|
29547
29612
|
actionRequired: "products:read",
|
|
29548
29613
|
maintenance: "products:read",
|
|
29549
29614
|
policyStanding: "products:read"
|
|
@@ -29811,10 +29876,12 @@ async function productContext(client, product, options) {
|
|
|
29811
29876
|
};
|
|
29812
29877
|
const parts = Object.keys(fetchers).filter(granted);
|
|
29813
29878
|
const [settled, readiness] = await Promise.all([Promise.allSettled(parts.map((part) => fetchers[part]())), setupReadiness(client, product, links)]);
|
|
29879
|
+
const signalAutonomy = product.effectiveSignalAutonomy ?? (await client.getProduct(productId)).data.effectiveSignalAutonomy;
|
|
29814
29880
|
const bundle = { product: {
|
|
29815
29881
|
...pickFields([product], PRODUCT_SUMMARY_FIELDS)[0],
|
|
29816
29882
|
projectType: isImportedProduct(product) ? "brownfield" : "greenfield",
|
|
29817
29883
|
defaultOrigin: defaultOriginFor(product),
|
|
29884
|
+
...signalAutonomy ? { signalAutonomy } : {},
|
|
29818
29885
|
...readiness ? { readiness } : {}
|
|
29819
29886
|
} };
|
|
29820
29887
|
const unavailable = {};
|
|
@@ -29878,27 +29945,32 @@ function registerContextTools(server, client) {
|
|
|
29878
29945
|
function registerAutonomyTools(server, client) {
|
|
29879
29946
|
if (client.hasCapability("products:write")) server.registerTool("taiga_set_product_autonomy", {
|
|
29880
29947
|
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),
|
|
29948
|
+
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
29949
|
inputSchema: object({
|
|
29883
29950
|
productId,
|
|
29884
29951
|
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")
|
|
29952
|
+
autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory"),
|
|
29953
|
+
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
29954
|
}),
|
|
29887
29955
|
annotations: OPERATE_SETTING
|
|
29888
29956
|
}, (params) => runTool(async () => {
|
|
29889
|
-
if (params.autoBuild === void 0 && params.autoMerge === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge or
|
|
29957
|
+
if (params.autoBuild === void 0 && params.autoMerge === void 0 && params.signalAutonomy === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge, signalAutonomy or several.");
|
|
29890
29958
|
const autoMerge = params.autoMerge === true ? null : params.autoMerge;
|
|
29891
29959
|
const product = (await client.updateProduct(params.productId, {
|
|
29892
29960
|
...params.autoBuild !== void 0 ? { autoBuild: params.autoBuild } : {},
|
|
29893
|
-
...autoMerge !== void 0 ? { autoMerge } : {}
|
|
29961
|
+
...autoMerge !== void 0 ? { autoMerge } : {},
|
|
29962
|
+
...params.signalAutonomy !== void 0 ? { signalAutonomy: params.signalAutonomy } : {}
|
|
29894
29963
|
})).data;
|
|
29895
|
-
return toolResult(
|
|
29896
|
-
|
|
29897
|
-
|
|
29898
|
-
|
|
29899
|
-
|
|
29900
|
-
|
|
29901
|
-
|
|
29964
|
+
return toolResult({
|
|
29965
|
+
...pickFields([product], [
|
|
29966
|
+
"id",
|
|
29967
|
+
"name",
|
|
29968
|
+
"slug",
|
|
29969
|
+
"autoBuild",
|
|
29970
|
+
"autoMerge"
|
|
29971
|
+
])[0],
|
|
29972
|
+
...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {}
|
|
29973
|
+
});
|
|
29902
29974
|
}));
|
|
29903
29975
|
if (client.hasCapability("backlog:write")) server.registerTool("taiga_set_auto_merge", {
|
|
29904
29976
|
title: "Set whether an initiative's pull request merges on its own",
|
|
@@ -46175,8 +46247,9 @@ const ALL_CONDITIONS = [.../* @__PURE__ */ new Set([...ITEM_CONDITIONS, ...BUILD
|
|
|
46175
46247
|
*/
|
|
46176
46248
|
function registerWaitTools(server, client, options) {
|
|
46177
46249
|
const items = client.hasCapability("backlog:read");
|
|
46178
|
-
const runs =
|
|
46179
|
-
|
|
46250
|
+
const runs = items;
|
|
46251
|
+
const jobs = client.hasCapability("products:read");
|
|
46252
|
+
if (!items && !jobs) return;
|
|
46180
46253
|
const waitInitiative = async (target, until, params, ctx) => {
|
|
46181
46254
|
const gate = { product: void 0 };
|
|
46182
46255
|
const read = async (signal) => {
|
|
@@ -46243,7 +46316,7 @@ function registerWaitTools(server, client, options) {
|
|
|
46243
46316
|
].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
46317
|
if (params.jobId !== void 0) {
|
|
46245
46318
|
if (params.until !== void 0) return toolError("VALIDATION_ERROR", "A job is waited on until it finishes: leave until out.");
|
|
46246
|
-
if (!
|
|
46319
|
+
if (!jobs) return toolError("FORBIDDEN", "Waiting on a job needs products:read, which this key lacks.");
|
|
46247
46320
|
return waitJob(params.jobId, params, ctx);
|
|
46248
46321
|
}
|
|
46249
46322
|
const kind = params.initiativeId !== void 0 ? "initiative" : "run";
|
|
@@ -46253,7 +46326,7 @@ function registerWaitTools(server, client, options) {
|
|
|
46253
46326
|
if (!items) return toolError("FORBIDDEN", "Waiting on an initiative needs backlog:read, which this key lacks.");
|
|
46254
46327
|
return waitInitiative(params.initiativeId, params.until, params, ctx);
|
|
46255
46328
|
}
|
|
46256
|
-
if (!runs) return toolError("FORBIDDEN", "Waiting on a run needs
|
|
46329
|
+
if (!runs) return toolError("FORBIDDEN", "Waiting on a run needs backlog:read, which this key lacks.");
|
|
46257
46330
|
return waitRun(params.runId, params.until, params, ctx);
|
|
46258
46331
|
}));
|
|
46259
46332
|
}
|
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.716",
|
|
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",
|