@taiga-ai/mcp-server 0.28.0 → 0.29.0-dev.631
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 +333 -27
- 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.29.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.29.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.29.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.29.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.29.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.29.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.29.0"],
|
|
82
82
|
"env": { "TAIGA_API_KEY": "${input:taiga-api-key}" }
|
|
83
83
|
}
|
|
84
84
|
}
|
package/dist/index.js
CHANGED
|
@@ -22281,6 +22281,22 @@ var TaigaClient = class {
|
|
|
22281
22281
|
const parsed = await response.json();
|
|
22282
22282
|
return options.keepTenant ? parsed : withoutTenant(parsed);
|
|
22283
22283
|
}
|
|
22284
|
+
/** A GET whose answer is plain text, not JSON (the third-party notices, PRO-3054). */
|
|
22285
|
+
async requestText(path) {
|
|
22286
|
+
const response = await fetch(`${this.baseUrl}/v1${path}`, {
|
|
22287
|
+
method: "GET",
|
|
22288
|
+
headers: {
|
|
22289
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
22290
|
+
"User-Agent": `taiga-ai-mcp-server/${SERVER_VERSION}`
|
|
22291
|
+
},
|
|
22292
|
+
redirect: "error"
|
|
22293
|
+
});
|
|
22294
|
+
if (!response.ok) {
|
|
22295
|
+
const text = await response.text().catch(() => "");
|
|
22296
|
+
throw new TaigaApiError("GET", path, response.status, text);
|
|
22297
|
+
}
|
|
22298
|
+
return response.text();
|
|
22299
|
+
}
|
|
22284
22300
|
async introspect() {
|
|
22285
22301
|
const result = await this.request("GET", "/auth/introspect", void 0, { keepTenant: true });
|
|
22286
22302
|
this.introspection = result.data;
|
|
@@ -22468,8 +22484,11 @@ var TaigaClient = class {
|
|
|
22468
22484
|
return this.request("POST", `/builds/${seg(id)}/stop`);
|
|
22469
22485
|
}
|
|
22470
22486
|
/** Ask the coding agent for changes to the run's pull request (PRO-3035). */
|
|
22471
|
-
async requestBuildRunChanges(id, notes) {
|
|
22472
|
-
return this.request("POST", `/builds/${seg(id)}/request-changes`, {
|
|
22487
|
+
async requestBuildRunChanges(id, notes, opts = {}) {
|
|
22488
|
+
return this.request("POST", `/builds/${seg(id)}/request-changes`, {
|
|
22489
|
+
notes,
|
|
22490
|
+
...opts.reviewPlan !== void 0 ? { reviewPlan: opts.reviewPlan } : {}
|
|
22491
|
+
});
|
|
22473
22492
|
}
|
|
22474
22493
|
async listBuildRunSteps(id) {
|
|
22475
22494
|
return this.request("GET", `/builds/${seg(id)}/steps`);
|
|
@@ -22493,10 +22512,30 @@ var TaigaClient = class {
|
|
|
22493
22512
|
async getLicenseSummary(productId) {
|
|
22494
22513
|
return this.request("GET", `/products/${seg(productId)}/maintenance/licenses`);
|
|
22495
22514
|
}
|
|
22496
|
-
/**
|
|
22515
|
+
/** The organization's approved list and every licence in use across its products (PRO-3311). */
|
|
22516
|
+
async getOrganizationLicenses() {
|
|
22517
|
+
return this.request("GET", "/tenants/current/licenses");
|
|
22518
|
+
}
|
|
22519
|
+
/** Where one licence is used across the organization (PRO-3311). */
|
|
22520
|
+
async getOrganizationLicense(license) {
|
|
22521
|
+
return this.request("GET", `/tenants/current/licenses/detail?license=${encodeURIComponent(license)}`);
|
|
22522
|
+
}
|
|
22523
|
+
/** What approving or removing one licence would do to the findings, without doing it (PRO-3312). */
|
|
22524
|
+
async previewLicenseChange(change) {
|
|
22525
|
+
const query = "approve" in change ? `approve=${encodeURIComponent(change.approve)}` : `remove=${encodeURIComponent(change.remove)}`;
|
|
22526
|
+
return this.request("GET", `/tenants/current/license-allowlist/effect?${query}`);
|
|
22527
|
+
}
|
|
22528
|
+
/** Approve or remove licences on the approved list, effective at once (PRO-3312). */
|
|
22529
|
+
async changeLicenseAllowlist(change) {
|
|
22530
|
+
return this.request("PATCH", "/tenants/current/license-allowlist", change);
|
|
22531
|
+
}
|
|
22532
|
+
/** A repository's CycloneDX 1.6 SBOM (PRO-2894), the document itself. */
|
|
22497
22533
|
async getSbom(productId, repositoryId) {
|
|
22498
22534
|
return this.request("GET", `/products/${seg(productId)}/maintenance/repositories/${seg(repositoryId)}/sbom`);
|
|
22499
22535
|
}
|
|
22536
|
+
async getNotices(productId, repositoryId) {
|
|
22537
|
+
return this.requestText(`/products/${seg(productId)}/maintenance/repositories/${seg(repositoryId)}/notices`);
|
|
22538
|
+
}
|
|
22500
22539
|
async updateFinding(id, body) {
|
|
22501
22540
|
return this.request("PATCH", `/maintenance/findings/${seg(id)}`, body);
|
|
22502
22541
|
}
|
|
@@ -23134,13 +23173,27 @@ const TURN_EVENT_TRIGGERS = [
|
|
|
23134
23173
|
"build_stopped",
|
|
23135
23174
|
"pr_merged",
|
|
23136
23175
|
"pr_closed",
|
|
23176
|
+
"pr_reopened",
|
|
23137
23177
|
"edited",
|
|
23138
23178
|
"disposition_changed",
|
|
23139
23179
|
"archived",
|
|
23140
23180
|
"unarchived",
|
|
23141
23181
|
"changes_requested",
|
|
23142
|
-
"changes_answered"
|
|
23182
|
+
"changes_answered",
|
|
23183
|
+
"run_replanned"
|
|
23184
|
+
];
|
|
23185
|
+
/**
|
|
23186
|
+
* The events the feed reads beside the turn log (PRO-3156): a board move, a
|
|
23187
|
+
* stop cleared, and a person's Start now press. They carry no possession (`turn` is null), so they are not
|
|
23188
|
+
* turn triggers; the page decides which of them it shows -- a person's move,
|
|
23189
|
+
* a person's Resume.
|
|
23190
|
+
*/
|
|
23191
|
+
const ACTIVITY_EVENT_TYPES = [
|
|
23192
|
+
"state_changed",
|
|
23193
|
+
"needs_human_cleared",
|
|
23194
|
+
"started_now"
|
|
23143
23195
|
];
|
|
23196
|
+
[...TURN_EVENT_TRIGGERS, ...ACTIVITY_EVENT_TYPES];
|
|
23144
23197
|
/**
|
|
23145
23198
|
* The two blocking states are NOT the same kind of blocker, and collapsing them
|
|
23146
23199
|
* into one list is what caused a bug in each direction (PRO-1028, PRO-1039).
|
|
@@ -23408,6 +23461,7 @@ const BUILD_RUN_STATUSES = [
|
|
|
23408
23461
|
"ci_fixing",
|
|
23409
23462
|
"needs_review",
|
|
23410
23463
|
"reviewing",
|
|
23464
|
+
"replanning",
|
|
23411
23465
|
"completed",
|
|
23412
23466
|
"failed",
|
|
23413
23467
|
"stopped",
|
|
@@ -23429,6 +23483,7 @@ const RUN_DISPOSITION = {
|
|
|
23429
23483
|
ci_fixing: "in_flight",
|
|
23430
23484
|
needs_review: "gated",
|
|
23431
23485
|
reviewing: "in_flight",
|
|
23486
|
+
replanning: "in_flight",
|
|
23432
23487
|
completed: "succeeded",
|
|
23433
23488
|
failed: "failed",
|
|
23434
23489
|
stopped: "stopped",
|
|
@@ -23490,6 +23545,7 @@ const BUILD_RUN_ACTIVE_STATUSES = BUILD_RUN_STATUSES.filter((s) => runDispositio
|
|
|
23490
23545
|
* DIFFERENT, narrower concept: transitions a user command may never leave.
|
|
23491
23546
|
*/
|
|
23492
23547
|
const BUILD_RUN_TERMINAL_STATUSES = BUILD_RUN_STATUSES.filter((s) => runDisposition(s) !== "in_flight");
|
|
23548
|
+
[...BUILD_RUN_TERMINAL_STATUSES];
|
|
23493
23549
|
/**
|
|
23494
23550
|
* Why the agent kept a pull request a draft, as recorded in its description
|
|
23495
23551
|
* (PRO-2298). The API reads these markers; the run's escalation carries them.
|
|
@@ -23499,7 +23555,8 @@ const READY_BLOCKERS = [
|
|
|
23499
23555
|
"tests_failed",
|
|
23500
23556
|
"bar_lowering",
|
|
23501
23557
|
"bar_lowering_unchecked",
|
|
23502
|
-
"criticals_unresolved"
|
|
23558
|
+
"criticals_unresolved",
|
|
23559
|
+
"clean_checkout_failed"
|
|
23503
23560
|
];
|
|
23504
23561
|
/**
|
|
23505
23562
|
* Why the autonomous loop handed a live pull request to a person (PRO-2409).
|
|
@@ -23515,6 +23572,14 @@ const READY_BLOCKERS = [
|
|
|
23515
23572
|
* streak a person's does, so the agent and the bot cannot loop without end.
|
|
23516
23573
|
* - `ci_never_settled`: the pull request's checks did not finish within the
|
|
23517
23574
|
* CI poll's window, so Taiga stopped waiting for them (PRO-2715).
|
|
23575
|
+
* - `review_fix_stalled`: a round on review comments pushed no commit and left
|
|
23576
|
+
* some of them unfixed (PRO-3126). Each thread says what was tried and what
|
|
23577
|
+
* stopped it; with nothing pushed, nothing new arrives to review, so without
|
|
23578
|
+
* this the run sat on "waiting for merge" with the comments unanswered.
|
|
23579
|
+
* - `changes_not_planned`: a person asked for changes at the review gate and
|
|
23580
|
+
* the planner refused or failed to plan them (PRO-3165). The pull request is
|
|
23581
|
+
* unchanged and waits for the person again; auto-merge must not take it
|
|
23582
|
+
* before they decide.
|
|
23518
23583
|
*/
|
|
23519
23584
|
const REVIEW_ESCALATION_REASONS = [
|
|
23520
23585
|
"ci_fix_cap",
|
|
@@ -23523,7 +23588,9 @@ const REVIEW_ESCALATION_REASONS = [
|
|
|
23523
23588
|
"ready_blocked",
|
|
23524
23589
|
"check_weakened",
|
|
23525
23590
|
"review_bot_cap",
|
|
23526
|
-
"ci_never_settled"
|
|
23591
|
+
"ci_never_settled",
|
|
23592
|
+
"review_fix_stalled",
|
|
23593
|
+
"changes_not_planned"
|
|
23527
23594
|
];
|
|
23528
23595
|
/** One failing check as stored: the name is required, and the link survives only as http(s). */
|
|
23529
23596
|
const storedFailingCheck = object({
|
|
@@ -23536,14 +23603,18 @@ object({
|
|
|
23536
23603
|
headSha: lenient(string$2()),
|
|
23537
23604
|
file: lenient(string$2()),
|
|
23538
23605
|
failingChecks: lenient(lenientList(storedFailingCheck)),
|
|
23539
|
-
blockers: lenient(lenientList(_enum(READY_BLOCKERS)))
|
|
23606
|
+
blockers: lenient(lenientList(_enum(READY_BLOCKERS))),
|
|
23607
|
+
detail: lenient(string$2()),
|
|
23608
|
+
roundsPaused: lenient(boolean())
|
|
23540
23609
|
}).transform((e) => ({
|
|
23541
23610
|
reason: e.reason,
|
|
23542
23611
|
...e.rounds === void 0 ? {} : { rounds: e.rounds },
|
|
23543
23612
|
...e.headSha === void 0 ? {} : { headSha: e.headSha },
|
|
23544
23613
|
...e.file === void 0 ? {} : { file: e.file },
|
|
23545
23614
|
...e.failingChecks === void 0 ? {} : { failingChecks: e.failingChecks },
|
|
23546
|
-
...e.blockers === void 0 ? {} : { blockers: e.blockers }
|
|
23615
|
+
...e.blockers === void 0 ? {} : { blockers: e.blockers },
|
|
23616
|
+
...e.detail === void 0 ? {} : { detail: e.detail },
|
|
23617
|
+
...e.roundsPaused === void 0 ? {} : { roundsPaused: e.roundsPaused }
|
|
23547
23618
|
}));
|
|
23548
23619
|
/**
|
|
23549
23620
|
* What a run's hardening came to, coverage included (PRO-2829). `passed`
|
|
@@ -23656,6 +23727,8 @@ const INBOX_TASK_PHASES = [
|
|
|
23656
23727
|
* schema is the source of the callback contract, the stored payload type and
|
|
23657
23728
|
* the list of kinds every reader accepts.
|
|
23658
23729
|
*/
|
|
23730
|
+
/** How long one answer of a `run_summary` may be. */
|
|
23731
|
+
const RUN_SUMMARY_ANSWER_MAX = 1e3;
|
|
23659
23732
|
/** A moment as factory-vm records it: ISO 8601, with its offset. */
|
|
23660
23733
|
const moment = datetime({ offset: true });
|
|
23661
23734
|
const optionalMoment = moment.optional();
|
|
@@ -23708,6 +23781,28 @@ discriminatedUnion("kind", [
|
|
|
23708
23781
|
capability: string$2().min(1).max(2e3),
|
|
23709
23782
|
stepId: optionalUuid
|
|
23710
23783
|
}),
|
|
23784
|
+
object({
|
|
23785
|
+
type: literal("narrative"),
|
|
23786
|
+
kind: literal("ci_result"),
|
|
23787
|
+
headSha: string$2().regex(/^[0-9a-f]{7,40}$/),
|
|
23788
|
+
passed: number$1().int().min(0),
|
|
23789
|
+
failed: array(object({
|
|
23790
|
+
name: string$2().min(1).max(200),
|
|
23791
|
+
url: string$2().max(2e3).nullable()
|
|
23792
|
+
})).max(20),
|
|
23793
|
+
moreFailed: number$1().int().min(0).optional(),
|
|
23794
|
+
observedAt: optionalMoment,
|
|
23795
|
+
stepId: optionalUuid
|
|
23796
|
+
}),
|
|
23797
|
+
object({
|
|
23798
|
+
type: literal("narrative"),
|
|
23799
|
+
kind: literal("run_summary"),
|
|
23800
|
+
changed: string$2().max(RUN_SUMMARY_ANSWER_MAX),
|
|
23801
|
+
checked: string$2().max(RUN_SUMMARY_ANSWER_MAX),
|
|
23802
|
+
decided: string$2().max(RUN_SUMMARY_ANSWER_MAX),
|
|
23803
|
+
unsure: string$2().max(RUN_SUMMARY_ANSWER_MAX),
|
|
23804
|
+
stepId: optionalUuid
|
|
23805
|
+
}),
|
|
23711
23806
|
object({
|
|
23712
23807
|
type: literal("narrative"),
|
|
23713
23808
|
kind: literal("agent_update"),
|
|
@@ -23763,6 +23858,7 @@ discriminatedUnion("kind", [
|
|
|
23763
23858
|
"preparing"
|
|
23764
23859
|
]),
|
|
23765
23860
|
target: string$2().min(1).max(2e3),
|
|
23861
|
+
sentence: boolean().optional(),
|
|
23766
23862
|
stepId: optionalUuid
|
|
23767
23863
|
}),
|
|
23768
23864
|
object({
|
|
@@ -23816,6 +23912,68 @@ discriminatedUnion("kind", [
|
|
|
23816
23912
|
}).optional()
|
|
23817
23913
|
})
|
|
23818
23914
|
]).options.map((option) => option.shape.kind.value);
|
|
23915
|
+
/** The raster types factory-vm serves, read from the bytes. Never SVG, which can carry script. */
|
|
23916
|
+
const BUILD_OVERVIEW_IMAGE_TYPES = [
|
|
23917
|
+
"image/png",
|
|
23918
|
+
"image/jpeg",
|
|
23919
|
+
"image/gif",
|
|
23920
|
+
"image/webp"
|
|
23921
|
+
];
|
|
23922
|
+
/** The largest image, as factory-vm bounds it (5 MiB). */
|
|
23923
|
+
const BUILD_OVERVIEW_IMAGE_MAX_BYTES = 5242880;
|
|
23924
|
+
/** The longest document: factory-vm keeps it at 60,000 characters. */
|
|
23925
|
+
const BUILD_OVERVIEW_DOCUMENT_MAX = 6e4;
|
|
23926
|
+
/** An image's name: letters, digits, `.`, `_` and `-`, starting with a letter or digit. */
|
|
23927
|
+
const BUILD_OVERVIEW_ASSET_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/;
|
|
23928
|
+
/**
|
|
23929
|
+
* - `ready`: the document and every image it shows were collected.
|
|
23930
|
+
* - `unavailable`: there is none to show: factory-vm wrote none, or
|
|
23931
|
+
* collecting it failed. `problems` says why.
|
|
23932
|
+
*/
|
|
23933
|
+
const BUILD_OVERVIEW_STATUSES = ["ready", "unavailable"];
|
|
23934
|
+
const buildOverviewAsset = object({
|
|
23935
|
+
name: string$2().regex(BUILD_OVERVIEW_ASSET_NAME),
|
|
23936
|
+
/** What the image shows; its caption and its alt text. */
|
|
23937
|
+
caption: string$2().trim().min(1).max(1e3),
|
|
23938
|
+
mediaType: _enum(BUILD_OVERVIEW_IMAGE_TYPES),
|
|
23939
|
+
size: number$1().int().min(1).max(BUILD_OVERVIEW_IMAGE_MAX_BYTES),
|
|
23940
|
+
/** Hex SHA-256 of the bytes. */
|
|
23941
|
+
sha256: string$2().regex(/^[0-9a-f]{64}$/)
|
|
23942
|
+
});
|
|
23943
|
+
object({
|
|
23944
|
+
version: literal(1),
|
|
23945
|
+
status: _enum(BUILD_OVERVIEW_STATUSES),
|
|
23946
|
+
/** The Markdown, its images at `asset:<name>`. Only when ready. */
|
|
23947
|
+
document: string$2().trim().min(1).max(BUILD_OVERVIEW_DOCUMENT_MAX).optional(),
|
|
23948
|
+
/** The images, in the order the document first shows them. */
|
|
23949
|
+
assets: array(buildOverviewAsset).max(20).default([]),
|
|
23950
|
+
/** Why there is none, in plain sentences. Only when unavailable. */
|
|
23951
|
+
problems: array(string$2().trim().min(1).max(1e3)).max(20).default([])
|
|
23952
|
+
}).superRefine((body, ctx) => {
|
|
23953
|
+
if (body.status === "ready") {
|
|
23954
|
+
if (!body.document) ctx.addIssue({
|
|
23955
|
+
code: "custom",
|
|
23956
|
+
path: ["document"],
|
|
23957
|
+
message: "A ready overview has a document"
|
|
23958
|
+
});
|
|
23959
|
+
if (new Set(body.assets.map((a) => a.name)).size !== body.assets.length) ctx.addIssue({
|
|
23960
|
+
code: "custom",
|
|
23961
|
+
path: ["assets"],
|
|
23962
|
+
message: "Each image is named once"
|
|
23963
|
+
});
|
|
23964
|
+
} else {
|
|
23965
|
+
if (body.problems.length === 0) ctx.addIssue({
|
|
23966
|
+
code: "custom",
|
|
23967
|
+
path: ["problems"],
|
|
23968
|
+
message: "Say why there is no overview"
|
|
23969
|
+
});
|
|
23970
|
+
if (body.document || body.assets.length > 0) ctx.addIssue({
|
|
23971
|
+
code: "custom",
|
|
23972
|
+
path: ["document"],
|
|
23973
|
+
message: "Only a ready overview carries a document"
|
|
23974
|
+
});
|
|
23975
|
+
}
|
|
23976
|
+
});
|
|
23819
23977
|
[...BUILD_RUN_ACTIVE_STATUSES.filter((s) => s !== "reviewing")];
|
|
23820
23978
|
//#endregion
|
|
23821
23979
|
//#region ../../packages/types/dist/agents.js
|
|
@@ -23858,7 +24016,11 @@ const backlogGenerationEmptyResult = object({
|
|
|
23858
24016
|
coveredByPriority: number$1().refine(Number.isInteger).nullable(),
|
|
23859
24017
|
coveredById: string$2().nullable(),
|
|
23860
24018
|
coveredInitiative: coveringInitiative.nullable(),
|
|
23861
|
-
reason: decisionReason.nullable().optional()
|
|
24019
|
+
reason: decisionReason.nullable().optional(),
|
|
24020
|
+
drafts: array(looseObject({
|
|
24021
|
+
title: string$2().min(1),
|
|
24022
|
+
description: string$2()
|
|
24023
|
+
})).optional()
|
|
23862
24024
|
});
|
|
23863
24025
|
/**
|
|
23864
24026
|
* Narrow an `agent_jobs.result` blob to {@link BacklogGenerationEmptyResult}.
|
|
@@ -24069,7 +24231,10 @@ const citationOutcome = object({
|
|
|
24069
24231
|
section: lenient(string$2()),
|
|
24070
24232
|
outcome: _enum(OUTCOMES),
|
|
24071
24233
|
reason: unknown$1().optional(),
|
|
24072
|
-
resolvedSection: lenient(string$2())
|
|
24234
|
+
resolvedSection: lenient(string$2()),
|
|
24235
|
+
resolvedDocumentType: lenient(string$2()),
|
|
24236
|
+
resolvedVersion: lenient(number$1()),
|
|
24237
|
+
resolvedOrigin: origin
|
|
24073
24238
|
}).transform((o) => ({
|
|
24074
24239
|
markerIndex: o.markerIndex,
|
|
24075
24240
|
documentType: o.documentType,
|
|
@@ -24078,7 +24243,12 @@ const citationOutcome = object({
|
|
|
24078
24243
|
...o.section === void 0 ? {} : { section: o.section },
|
|
24079
24244
|
outcome: o.outcome,
|
|
24080
24245
|
...o.outcome === "unsupported" ? { reason: unsupportedReason(o.reason) } : {},
|
|
24081
|
-
...o.resolvedSection === void 0 ? {} : { resolvedSection: o.resolvedSection }
|
|
24246
|
+
...o.resolvedSection === void 0 ? {} : { resolvedSection: o.resolvedSection },
|
|
24247
|
+
...o.resolvedDocumentType !== void 0 && o.resolvedVersion !== void 0 ? {
|
|
24248
|
+
resolvedDocumentType: o.resolvedDocumentType,
|
|
24249
|
+
resolvedVersion: o.resolvedVersion,
|
|
24250
|
+
...o.resolvedOrigin === void 0 ? {} : { resolvedOrigin: o.resolvedOrigin }
|
|
24251
|
+
} : {}
|
|
24082
24252
|
}));
|
|
24083
24253
|
object({
|
|
24084
24254
|
verified: number$1(),
|
|
@@ -24688,7 +24858,7 @@ const DOCUMENT_INPUTS = Object.freeze({
|
|
|
24688
24858
|
* reads as deleted) and fields they explain would simply be missing. So it
|
|
24689
24859
|
* refuses to start, and says what to do.
|
|
24690
24860
|
*/
|
|
24691
|
-
function apiLevelProblem(introspection, apiUrl, required =
|
|
24861
|
+
function apiLevelProblem(introspection, apiUrl, required = 5, version = SERVER_VERSION) {
|
|
24692
24862
|
const offered = introspection.mcpApiLevel ?? 0;
|
|
24693
24863
|
if (offered >= required) return null;
|
|
24694
24864
|
return `The Taiga API at ${apiUrl} is older than @taiga-ai/mcp-server ${version} needs (API level ${offered}, needs ${required}). Run the version published for it, or wait for that API to be updated; an earlier release of this package works against it.`;
|
|
@@ -24772,7 +24942,10 @@ const TOOLSET_OF = {
|
|
|
24772
24942
|
taiga_get_monitoring: "observe",
|
|
24773
24943
|
taiga_get_delivery_metrics: "observe",
|
|
24774
24944
|
taiga_list_packages: "observe",
|
|
24945
|
+
taiga_list_licenses: "observe",
|
|
24946
|
+
taiga_change_license: "setup",
|
|
24775
24947
|
taiga_get_sbom: "observe",
|
|
24948
|
+
taiga_get_notices: "observe",
|
|
24776
24949
|
taiga_get_factory_document: "documents",
|
|
24777
24950
|
taiga_update_organization_document: "documents",
|
|
24778
24951
|
taiga_publish_organization_document: "documents",
|
|
@@ -25066,6 +25239,7 @@ const BY_ARGUMENT = {
|
|
|
25066
25239
|
const BY_TOOL = {
|
|
25067
25240
|
taiga_resolve_action: () => "taiga_list_action_required lists the items with their IDs.",
|
|
25068
25241
|
taiga_get_sbom: () => "An SBOM exists once a sweep has inventoried that repository, where the licenses feature is enabled; taiga_list_packages (linkId) says whether it has packages, and taiga_list_product_repositories lists the links.",
|
|
25242
|
+
taiga_get_notices: () => "Notices exist once a sweep has inventoried that repository, where the licenses feature is enabled; taiga_list_product_repositories lists the links.",
|
|
25069
25243
|
taiga_get_plan: (said) => /\bplan\b/i.test(said) ? "taiga_get_initiative's situation says whether one is being planned or failed, and names the call that asks for one (taiga_queue_initiative off the line, taiga_plan_again for a failed plan)." : ITEM_ID_HINT
|
|
25070
25244
|
};
|
|
25071
25245
|
/**
|
|
@@ -25528,6 +25702,7 @@ const PACKAGE_ROW_FIELDS = [
|
|
|
25528
25702
|
"introducedBy",
|
|
25529
25703
|
"firstParty",
|
|
25530
25704
|
"otherPlatformsOnly",
|
|
25705
|
+
"licenseSource",
|
|
25531
25706
|
"sourcePath",
|
|
25532
25707
|
"productRepositoryId",
|
|
25533
25708
|
"detectedAt"
|
|
@@ -25553,6 +25728,7 @@ const FINDING_ROW_FIELDS = [
|
|
|
25553
25728
|
"backlogItemId",
|
|
25554
25729
|
"createdAt",
|
|
25555
25730
|
"detectedAt",
|
|
25731
|
+
"resolvedReason",
|
|
25556
25732
|
"ignoreReason",
|
|
25557
25733
|
"ignoreExpiresAt"
|
|
25558
25734
|
];
|
|
@@ -25575,7 +25751,8 @@ function groupKey(row) {
|
|
|
25575
25751
|
const link = String(row["productRepositoryId"] ?? "");
|
|
25576
25752
|
if (row["kind"] === "license_violation") {
|
|
25577
25753
|
const verdict = licenseVerdict(row);
|
|
25578
|
-
|
|
25754
|
+
const reason = String(row["resolvedReason"] ?? "");
|
|
25755
|
+
return verdict ? `license|${status}|${reason}|${link}|${verdict}` : null;
|
|
25579
25756
|
}
|
|
25580
25757
|
const location = row["location"];
|
|
25581
25758
|
const rule = typeof location?.ruleId === "string" ? location.ruleId : null;
|
|
@@ -25654,6 +25831,14 @@ function grouped(rows, fold) {
|
|
|
25654
25831
|
* read off the row; remediableBy stays as the sweep recorded it.
|
|
25655
25832
|
*/
|
|
25656
25833
|
function withFixability(row) {
|
|
25834
|
+
if (row["kind"] === "license_violation" && row["status"] === "resolved") {
|
|
25835
|
+
const reason = row["resolvedReason"];
|
|
25836
|
+
return {
|
|
25837
|
+
...row,
|
|
25838
|
+
fixable: false,
|
|
25839
|
+
fixNote: reason === "not_shipped" ? "No longer applies: the package is only a build for platforms the repository does not deploy to. Nothing to do." : reason === "license_approved" ? "No longer applies: its license is on the organization's approved list. Nothing to do." : "Resolved: the sweep no longer reports it. Nothing to do."
|
|
25840
|
+
};
|
|
25841
|
+
}
|
|
25657
25842
|
if (row["kind"] === "license_violation") return {
|
|
25658
25843
|
...row,
|
|
25659
25844
|
fixable: false,
|
|
@@ -25806,6 +25991,23 @@ async function sweepOverview(client, productId) {
|
|
|
25806
25991
|
};
|
|
25807
25992
|
}
|
|
25808
25993
|
function registerMaintenanceTools(server, client) {
|
|
25994
|
+
if (client.hasCapability("tenant:settings")) server.registerTool("taiga_change_license", {
|
|
25995
|
+
title: "Approve or remove a license",
|
|
25996
|
+
description: "Approve a license on the organization's approved list, or remove one. Takes effect at once: license findings it now raises open on every product, those it now approves resolve, and the change is a new version of the policy. preview: true says what it would do without doing it.",
|
|
25997
|
+
inputSchema: object({
|
|
25998
|
+
license: string$2().trim().min(1).max(100).describe("An SPDX license id, such as MIT or LGPL-3.0-or-later"),
|
|
25999
|
+
action: _enum(["approve", "remove"]),
|
|
26000
|
+
preview: boolean().optional().describe("Say what the change would do, and change nothing")
|
|
26001
|
+
}),
|
|
26002
|
+
annotations: OPERATE_SETTING
|
|
26003
|
+
}, (params) => runTool(async () => {
|
|
26004
|
+
const change = params.action === "approve" ? { approve: params.license } : { remove: params.license };
|
|
26005
|
+
if (params.preview) return toolResult({
|
|
26006
|
+
preview: true,
|
|
26007
|
+
effect: (await client.previewLicenseChange(change)).data
|
|
26008
|
+
});
|
|
26009
|
+
return toolResult((await client.changeLicenseAllowlist(params.action === "approve" ? { approve: [params.license] } : { remove: [params.license] })).data);
|
|
26010
|
+
}));
|
|
25809
26011
|
if (!client.hasCapability("products:read")) return;
|
|
25810
26012
|
server.registerTool("taiga_list_findings", {
|
|
25811
26013
|
title: "List maintenance findings",
|
|
@@ -25873,15 +26075,30 @@ function registerMaintenanceTools(server, client) {
|
|
|
25873
26075
|
...typeof result.totalCount === "number" ? { totalCount: result.totalCount } : {}
|
|
25874
26076
|
});
|
|
25875
26077
|
}));
|
|
26078
|
+
server.registerTool("taiga_list_licenses", {
|
|
26079
|
+
title: "List the organization's licenses",
|
|
26080
|
+
description: "List the organization's approved license list and every license in use across its products, approved or not, with packages, products and repositories. With license, where that one is used: products, repositories and what brings its packages in. NOT_FOUND where the licenses feature is off.",
|
|
26081
|
+
inputSchema: object({ license: string$2().trim().min(1).max(200).optional().describe("An SPDX license id: where it is used, instead of the list") }),
|
|
26082
|
+
annotations: READ_ONLY
|
|
26083
|
+
}, (params) => runTool(async () => toolResult(params.license ? (await client.getOrganizationLicense(params.license)).data : (await client.getOrganizationLicenses()).data)));
|
|
25876
26084
|
server.registerTool("taiga_get_sbom", {
|
|
25877
26085
|
title: "Download a repository SBOM",
|
|
25878
|
-
description: "Download one repository's software bill of materials (CycloneDX 1.
|
|
26086
|
+
description: "Download one repository's software bill of materials (CycloneDX 1.6). Large; taiga_list_packages summarizes. NOT_FOUND where the licenses feature is off, or before a sweep has read the repository.",
|
|
25879
26087
|
inputSchema: object({
|
|
25880
26088
|
productId,
|
|
25881
26089
|
linkId: idInput("repository link", "taiga_list_product_repositories gives it")
|
|
25882
26090
|
}),
|
|
25883
26091
|
annotations: READ_ONLY
|
|
25884
26092
|
}, (params) => runTool(async () => toolResult(await client.getSbom(params.productId, params.linkId))));
|
|
26093
|
+
server.registerTool("taiga_get_notices", {
|
|
26094
|
+
title: "Download a repository's third-party notices",
|
|
26095
|
+
description: "One repository's third-party notices: every package it ships, with its licence and copyright holders, as the text a product carries for attribution. NOT_FOUND where the licenses feature is off, or before a sweep has read the repository.",
|
|
26096
|
+
inputSchema: object({
|
|
26097
|
+
productId,
|
|
26098
|
+
linkId: idInput("repository link", "taiga_list_product_repositories gives it")
|
|
26099
|
+
}),
|
|
26100
|
+
annotations: READ_ONLY
|
|
26101
|
+
}, (params) => runTool(async () => toolResult({ notices: await client.getNotices(params.productId, params.linkId) })));
|
|
25885
26102
|
server.registerTool("taiga_get_finding", {
|
|
25886
26103
|
title: "Get a maintenance finding",
|
|
25887
26104
|
description: "Read one finding: how likely it is to be exploited, the advisory and its fixed version, where it is, which policy controls it breaches, and any fix under way. fixable: false says taiga_fix_finding would refuse it. A secret's value is never stored.",
|
|
@@ -27189,7 +27406,8 @@ const RUNNING = {
|
|
|
27189
27406
|
pushing: "pushing the branch",
|
|
27190
27407
|
ci_checking: "waiting for the pull request's CI",
|
|
27191
27408
|
ci_fixing: "fixing what CI found",
|
|
27192
|
-
reviewing: "answering review comments on the pull request"
|
|
27409
|
+
reviewing: "answering review comments on the pull request",
|
|
27410
|
+
replanning: "revising the steps left to build for a request for changes"
|
|
27193
27411
|
};
|
|
27194
27412
|
/** Why the agent handed a run back, in the web's words (apps/web handback), with the checks it names. */
|
|
27195
27413
|
function handbackSaid(escalation) {
|
|
@@ -27205,6 +27423,8 @@ function handbackSaid(escalation) {
|
|
|
27205
27423
|
case "conflict_cap": return `the branch still conflicts with its base${rounds}`;
|
|
27206
27424
|
case "review_bot_cap": return `review bots still have open comments${rounds}`;
|
|
27207
27425
|
case "ci_never_settled": return "CI did not finish in time";
|
|
27426
|
+
case "review_fix_stalled": return "Taiga could not fix some review comments; its replies say what it tried";
|
|
27427
|
+
case "changes_not_planned": return `the planner did not plan the request for changes${typeof e.detail === "string" && e.detail ? ` (${e.detail})` : ""}, so the pull request is as it was`;
|
|
27208
27428
|
case "ready_blocked": return `CI is green, but Taiga kept the pull request a draft${blockers.length ? `: ${blockers.join("; ")}` : ""}`;
|
|
27209
27429
|
case "check_weakened": return `CI went green only after a fix changed ${typeof e.file === "string" ? e.file : "a CI workflow or a test"}`;
|
|
27210
27430
|
default: return typeof e.reason === "string" ? e.reason : null;
|
|
@@ -27223,7 +27443,8 @@ const READY_BLOCKER_SAID = {
|
|
|
27223
27443
|
tests_failed: "the tests Taiga ran after the build failed",
|
|
27224
27444
|
bar_lowering: "a fix lowered a check instead of fixing the code",
|
|
27225
27445
|
bar_lowering_unchecked: "Taiga could not check whether a fix lowered a check",
|
|
27226
|
-
criticals_unresolved: "Taiga's own review left a critical issue unresolved"
|
|
27446
|
+
criticals_unresolved: "Taiga's own review left a critical issue unresolved",
|
|
27447
|
+
clean_checkout_failed: "the branch does not install or pass its tests from a clean checkout"
|
|
27227
27448
|
};
|
|
27228
27449
|
/** The first sentence of a run's error, short enough for a row. */
|
|
27229
27450
|
function errorSaid(error) {
|
|
@@ -27250,16 +27471,44 @@ function runOutcome(run) {
|
|
|
27250
27471
|
return {
|
|
27251
27472
|
disposition,
|
|
27252
27473
|
outcome: {
|
|
27253
|
-
in_flight: status === "pending" ? "Queued: waiting to start." : `Running: ${RUNNING[status] ?? status}${progress}.`,
|
|
27474
|
+
in_flight: status === "pending" ? "Queued: waiting to start." : status === "replanning" ? steerPaused(run["failedReason"], progress) : `Running: ${RUNNING[status] ?? status}${progress}.`,
|
|
27254
27475
|
gated: handback ? `Handed back to a person: ${handback}. ${pr}${draft ? `${draft},` : ""} waits for them to ${handbackNextStep(run["reviewEscalation"])}.` : `Waiting for a person to review and merge ${pr}${draft}.`,
|
|
27255
27476
|
succeeded: `Merged: ${pr} is in ${typeof run["baseBranch"] === "string" ? run["baseBranch"] : "the base branch"}.`,
|
|
27256
27477
|
unmerged: typeof run["prNumber"] === "number" || run["prUrl"] ? `Settled without merging: ${pr} was left unmerged.` : "Settled without a merged pull request.",
|
|
27257
27478
|
failed: `Failed${why ? `: ${why}` : ""}${progress}.`,
|
|
27258
|
-
stopped: `Stopped before it finished${progress}.`,
|
|
27479
|
+
stopped: replanHandedBack(run["failedReason"], run["error"], progress) ?? `Stopped before it finished${progress}.`,
|
|
27259
27480
|
rejected: `${pr} was closed without merging, so the work did not land.${handback ? ` It had been handed back: ${handback}.` : ""}`
|
|
27260
27481
|
}[disposition] ?? status
|
|
27261
27482
|
};
|
|
27262
27483
|
}
|
|
27484
|
+
/**
|
|
27485
|
+
* A run re-planning for a request for changes (PRO-3161), in one sentence:
|
|
27486
|
+
* the re-plan in flight, or the revised plan waiting for review.
|
|
27487
|
+
*/
|
|
27488
|
+
function steerPaused(reason, progress) {
|
|
27489
|
+
if (reason === "steer_review") return `Paused${progress}: the plan revised for a request for changes waits for a person to review it (taiga_review_plan).`;
|
|
27490
|
+
return `Paused after a step${progress}: its plan is being revised for a request for changes.`;
|
|
27491
|
+
}
|
|
27492
|
+
/**
|
|
27493
|
+
* A run its re-plan handed back (PRO-3165), in one sentence with the
|
|
27494
|
+
* planner's reason. Null for any other stop.
|
|
27495
|
+
*/
|
|
27496
|
+
function replanHandedBack(reason, error, progress) {
|
|
27497
|
+
if (reason !== "replan_refused" && reason !== "replan_failed") return null;
|
|
27498
|
+
const why = plannerReasonSaid(error);
|
|
27499
|
+
if (reason === "replan_refused") return `Stopped${progress}, handed back: the planner would not plan the request for changes${why ? `: ${why}` : "."} Resume continues the original plan.`;
|
|
27500
|
+
return `Stopped${progress}, handed back: ${why ?? "the plan could not be revised."} Resume continues the original plan.`;
|
|
27501
|
+
}
|
|
27502
|
+
/** A hand-back's reason on one line, ending as a sentence, capped for a row. */
|
|
27503
|
+
function plannerReasonSaid(error) {
|
|
27504
|
+
if (typeof error !== "string") return null;
|
|
27505
|
+
const text = error.replace(/\s+/g, " ").trim();
|
|
27506
|
+
if (!text) return null;
|
|
27507
|
+
const capped = text.length > PLANNER_REASON_MAX ? `${text.slice(0, PLANNER_REASON_MAX).replace(/\s+\S*$/, "")}...` : text;
|
|
27508
|
+
return /[.!?]$/.test(capped) ? capped : `${capped}.`;
|
|
27509
|
+
}
|
|
27510
|
+
/** Characters of a planner's reason an outcome carries. */
|
|
27511
|
+
const PLANNER_REASON_MAX = 600;
|
|
27263
27512
|
/** Words a sentence does not end at: "e.g." and the like, and a lone initial. */
|
|
27264
27513
|
const ABBREVIATION = /(?:\b(?:e\.g|i\.e|etc|vs|cf|incl|approx)|(?:^|\s)[A-Za-z])\.$/i;
|
|
27265
27514
|
/** A finding's first sentence, capped: it ends at . ! or ? before white space, but not at an abbreviation. */
|
|
@@ -27604,20 +27853,27 @@ function registerBuildTools(server, client) {
|
|
|
27604
27853
|
});
|
|
27605
27854
|
}));
|
|
27606
27855
|
if (!client.hasCapability("products:write")) return;
|
|
27856
|
+
const steering = client.hasFeature("steerRuns");
|
|
27607
27857
|
if (client.hasFeature("requestChanges")) server.registerTool("taiga_request_changes", {
|
|
27608
|
-
title: "Request changes on a pull request",
|
|
27609
|
-
description: "Tell the coding agent what should change on a run's open pull request, as a person's review would: it splits the request into separate asks, makes the changes on the same pull request, and answers each one there (done, answered, or not done and why). Only for a run whose pull request is waiting for review (the initiative is in review with its pull request open); refused otherwise, and where the organization does not have it yet. taiga_wait follows the run until it is back in review.",
|
|
27858
|
+
title: steering ? "Request changes on a run" : "Request changes on a pull request",
|
|
27859
|
+
description: steering ? "Tell Taiga what should change in a run, while it builds or once its pull request waits for review, a draft included, such as one Taiga handed back with CI failing or its tests red. The run stops after the step it is building (at once when it is not building one), the planner revises the steps still to build on top of the committed work (adding, editing, dropping, or reverting committed steps exactly), and the run continues with the revised steps; never a new initiative. A request while the run hardens, checks CI or is already being re-planned waits and joins the next re-plan. reviewPlan holds the run until a person has looked at the revised plan (taiga_review_plan approves it or comments to revise it again). A request the planner will not plan, a policy conflict, hands the run back with the reason, still on its original plan. The answer says what happened to it (steer). For a plan that waits for its build to be approved, comment on the plan with taiga_review_plan instead." : "Tell the coding agent what should change on a run's open pull request, as a person's review would: it splits the request into separate asks, makes the changes on the same pull request, and answers each one there (done, answered, or not done and why). Only for a run whose pull request is waiting for review (the initiative is in review with its pull request open), a draft included, such as one Taiga handed back with CI failing or its tests red; refused otherwise, and where the organization does not have it yet. taiga_wait follows the run until it is back in review.",
|
|
27610
27860
|
inputSchema: object({
|
|
27611
27861
|
runId,
|
|
27612
|
-
notes: string$2().trim().min(1).max(CHANGE_REQUEST_MAX_CHARS).describe("What should change, in markdown: a list of changes, questions, or both")
|
|
27862
|
+
notes: string$2().trim().min(1).max(CHANGE_REQUEST_MAX_CHARS).describe("What should change, in markdown: a list of changes, questions, or both"),
|
|
27863
|
+
...steering ? { reviewPlan: boolean().optional().describe("Hold the run until a person has reviewed the revised plan (default false)") } : {}
|
|
27613
27864
|
}),
|
|
27614
27865
|
annotations: OPERATE
|
|
27615
27866
|
}, (params) => runTool(async () => {
|
|
27616
|
-
const
|
|
27867
|
+
const reviewPlan = "reviewPlan" in params ? params.reviewPlan : void 0;
|
|
27868
|
+
const result = await client.requestBuildRunChanges(params.runId, params.notes, { reviewPlan });
|
|
27617
27869
|
const row = pickFields([result.data], RUN_OUTCOME_FIELDS)[0];
|
|
27618
27870
|
return toolResult({
|
|
27619
27871
|
...readableRow(row),
|
|
27620
|
-
requestId: result.data.requestId
|
|
27872
|
+
requestId: result.data.requestId,
|
|
27873
|
+
...result.data.steer ? {
|
|
27874
|
+
steer: result.data.steer,
|
|
27875
|
+
situation: steerSituation(result.data.steer)
|
|
27876
|
+
} : {}
|
|
27621
27877
|
});
|
|
27622
27878
|
}));
|
|
27623
27879
|
server.registerTool("taiga_stop_run", {
|
|
@@ -27630,6 +27886,12 @@ function registerBuildTools(server, client) {
|
|
|
27630
27886
|
return toolResult(readableRow(pickFields([result.data], RUN_OUTCOME_FIELDS)[0]));
|
|
27631
27887
|
}));
|
|
27632
27888
|
}
|
|
27889
|
+
/** What happened to a request that steers a run (PRO-3161), in one sentence. */
|
|
27890
|
+
function steerSituation(steer) {
|
|
27891
|
+
if (steer === "replanning") return "The run has paused and its plan is being revised for the request.";
|
|
27892
|
+
if (steer === "after_step") return "The run stops when the step it is building ends, then its plan is revised.";
|
|
27893
|
+
return "The run is hardening, checking CI or already being re-planned; the request joins the next re-plan.";
|
|
27894
|
+
}
|
|
27633
27895
|
//#endregion
|
|
27634
27896
|
//#region src/tools/queue.ts
|
|
27635
27897
|
/** How many entries the read names; past this an entry keeps its initiativeId only. */
|
|
@@ -28046,6 +28308,37 @@ async function planFailureOf(client, initiativeId, itemCause) {
|
|
|
28046
28308
|
by: typeof actor.name === "string" ? actor.name : actor.type ?? null
|
|
28047
28309
|
};
|
|
28048
28310
|
}
|
|
28311
|
+
/**
|
|
28312
|
+
* What a request for changes did to this plan (PRO-3161), when one revised it:
|
|
28313
|
+
* the steps the re-plan added, edited and dropped, and the committed steps it
|
|
28314
|
+
* reverts, from the `run_replanned` event that made this version. Null for a
|
|
28315
|
+
* plan no request revised, or when the history cannot be read.
|
|
28316
|
+
*/
|
|
28317
|
+
async function planRevisionOf(client, initiativeId, planId) {
|
|
28318
|
+
let events;
|
|
28319
|
+
try {
|
|
28320
|
+
events = (await client.listBacklogItemActivity(initiativeId)).data;
|
|
28321
|
+
} catch (error) {
|
|
28322
|
+
if (error instanceof TaigaApiError || isNetworkFailure(error)) return null;
|
|
28323
|
+
throw error;
|
|
28324
|
+
}
|
|
28325
|
+
for (const event of [...events].reverse()) {
|
|
28326
|
+
if (event.kind !== "turn" || event.trigger !== "run_replanned") continue;
|
|
28327
|
+
const data = event.data ?? {};
|
|
28328
|
+
if (data["planId"] !== planId) continue;
|
|
28329
|
+
return {
|
|
28330
|
+
revisedFor: "a request for changes",
|
|
28331
|
+
previousPlanId: data["previousPlanId"] ?? null,
|
|
28332
|
+
added: data["added"] ?? [],
|
|
28333
|
+
edited: data["edited"] ?? [],
|
|
28334
|
+
dropped: data["dropped"] ?? [],
|
|
28335
|
+
reverted: data["reverted"] ?? [],
|
|
28336
|
+
waitsForReview: data["reviewPlan"] === true,
|
|
28337
|
+
at: event.occurredAt ?? null
|
|
28338
|
+
};
|
|
28339
|
+
}
|
|
28340
|
+
return null;
|
|
28341
|
+
}
|
|
28049
28342
|
const planId = idInput("plan", "taiga_get_plan gives the initiative's active plan and its ID");
|
|
28050
28343
|
const initiativeId = idInput("initiative", "taiga_list_initiatives (query finds one by title) gives it");
|
|
28051
28344
|
/** The plan without its steps' prose: enough to approve it or say what a run will do. */
|
|
@@ -28064,7 +28357,9 @@ const PLAN_STEP_SUMMARY_FIELDS = [
|
|
|
28064
28357
|
"dependencies",
|
|
28065
28358
|
"writes",
|
|
28066
28359
|
"reads",
|
|
28067
|
-
"createsResources"
|
|
28360
|
+
"createsResources",
|
|
28361
|
+
"revertsSteps",
|
|
28362
|
+
"changeRequestIds"
|
|
28068
28363
|
];
|
|
28069
28364
|
/** The outcome fields of an initiative, with how many of its criteria are met, and where it stands. */
|
|
28070
28365
|
const outcomeOf = (item) => withSituation(item, {
|
|
@@ -28184,7 +28479,7 @@ function registerBacklogReads(server, client) {
|
|
|
28184
28479
|
}));
|
|
28185
28480
|
server.registerTool("taiga_get_plan", {
|
|
28186
28481
|
title: "Get the active plan",
|
|
28187
|
-
description: "Read an initiative's active plan, step by step: what each builds, the files it writes and reads, and what it depends on. Enough to approve or reject it; full: true adds each step's complete instructions (long). NOT_FOUND when there is no active plan; the initiative's situation says why.",
|
|
28482
|
+
description: "Read an initiative's active plan, step by step: what each builds, the files it writes and reads, and what it depends on. Enough to approve or reject it; full: true adds each step's complete instructions (long). A plan a request for changes revised says so in revision: the steps it added, edited and dropped, and the committed steps it reverts. NOT_FOUND when there is no active plan; the initiative's situation says why.",
|
|
28188
28483
|
inputSchema: object({
|
|
28189
28484
|
initiativeId,
|
|
28190
28485
|
full: boolean().optional().describe("Carry each step's complete instructions (default false: a summary)")
|
|
@@ -28192,10 +28487,16 @@ function registerBacklogReads(server, client) {
|
|
|
28192
28487
|
annotations: READ_ONLY
|
|
28193
28488
|
}, (params) => runTool(async () => {
|
|
28194
28489
|
const plan = (await client.getActivePlan(params.initiativeId)).data;
|
|
28195
|
-
|
|
28490
|
+
const revision = await planRevisionOf(client, params.initiativeId, plan.id);
|
|
28491
|
+
const revised = revision ? { revision } : {};
|
|
28492
|
+
if (params.full) return toolResult({
|
|
28493
|
+
...plan,
|
|
28494
|
+
...revised
|
|
28495
|
+
});
|
|
28196
28496
|
const steps = Array.isArray(plan.steps) ? plan.steps : [];
|
|
28197
28497
|
return toolResult({
|
|
28198
28498
|
...pickFields([plan], PLAN_SUMMARY_FIELDS)[0],
|
|
28499
|
+
...revised,
|
|
28199
28500
|
steps: pickFields(steps, PLAN_STEP_SUMMARY_FIELDS)
|
|
28200
28501
|
});
|
|
28201
28502
|
}));
|
|
@@ -28359,7 +28660,7 @@ function registerResume(server, client) {
|
|
|
28359
28660
|
function registerPlanReview(server, client) {
|
|
28360
28661
|
server.registerTool("taiga_review_plan", {
|
|
28361
28662
|
title: "Approve or reject a plan",
|
|
28362
|
-
description: "Give an initiative's plan its verdict. approve starts the run that builds it; reject sends it back with a comment and the planner
|
|
28663
|
+
description: "Give an initiative's plan its verdict. approve starts the run that builds it; reject sends it back with a comment and the planner revises it from the comment, keeping what the comment does not object to. Read the plan first (taiga_get_plan) and pass its ID; refused if the plan was replaced since, a new one is being written, or a run is already going." + (client.hasFeature("steerRuns") ? " A plan a request for changes revised while its run waits for this review (taiga_request_changes with reviewPlan): approve continues that run on its branch, and reject comments to revise it again." : ""),
|
|
28363
28664
|
inputSchema: object({
|
|
28364
28665
|
planId,
|
|
28365
28666
|
verdict: _enum(["approve", "reject"]).describe("approve builds the plan; reject sends it back"),
|
|
@@ -45384,6 +45685,7 @@ const RUN_REPORT_FIELDS = [
|
|
|
45384
45685
|
];
|
|
45385
45686
|
const runSignature = (run) => JSON.stringify([
|
|
45386
45687
|
run.status,
|
|
45688
|
+
run.failedReason,
|
|
45387
45689
|
run.completedSteps,
|
|
45388
45690
|
run.prUrl,
|
|
45389
45691
|
run.prState,
|
|
@@ -45396,6 +45698,10 @@ function judgeBuild(until) {
|
|
|
45396
45698
|
reached: false,
|
|
45397
45699
|
stoppedBecause: `the run is ${String(run.status)}`
|
|
45398
45700
|
};
|
|
45701
|
+
if (until !== "changed" && run.status === "replanning" && run.failedReason === "steer_review") return {
|
|
45702
|
+
reached: false,
|
|
45703
|
+
stoppedBecause: "the run waits for a person to review its revised plan (taiga_review_plan)"
|
|
45704
|
+
};
|
|
45399
45705
|
return null;
|
|
45400
45706
|
};
|
|
45401
45707
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ai/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0-dev.631",
|
|
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",
|