@taiga-ai/mcp-server 0.38.0-dev.1200 → 0.38.0-dev.1202
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +170 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27036,6 +27036,12 @@ function readExternalReference(value) {
|
|
|
27036
27036
|
}
|
|
27037
27037
|
//#endregion
|
|
27038
27038
|
//#region ../../packages/types/dist/backlog.js
|
|
27039
|
+
const BACKLOG_CATEGORIES = [
|
|
27040
|
+
"feature",
|
|
27041
|
+
"bug",
|
|
27042
|
+
"tech_debt",
|
|
27043
|
+
"improvement"
|
|
27044
|
+
];
|
|
27039
27045
|
/** Dispositions that end an item's pipeline life: settled work neither blocks
|
|
27040
27046
|
* dependants nor counts toward completion denominators. */
|
|
27041
27047
|
const SETTLED_BACKLOG_STATUSES = ["done", "canceled"];
|
|
@@ -30104,6 +30110,34 @@ object({
|
|
|
30104
30110
|
const EXCEL_MAX_COLUMN = 16384;
|
|
30105
30111
|
const EXCEL_MAX_ROW = 1048576;
|
|
30106
30112
|
//#endregion
|
|
30113
|
+
//#region ../../packages/types/dist/trackers.js
|
|
30114
|
+
/**
|
|
30115
|
+
* Ticket trackers (PRO-4954): the systems outside Taiga where an organization
|
|
30116
|
+
* keeps its requests, and what Taiga reads from and writes to them.
|
|
30117
|
+
*
|
|
30118
|
+
* A tracker is reached through one port with an adapter per provider, as a
|
|
30119
|
+
* forge is (`forge.ts`). This file is the part both ends share: the providers,
|
|
30120
|
+
* what each can do, and the one shape a ticket takes whichever tracker it
|
|
30121
|
+
* came from.
|
|
30122
|
+
*/
|
|
30123
|
+
const TRACKER_PROVIDERS = [
|
|
30124
|
+
"jira",
|
|
30125
|
+
"servicenow",
|
|
30126
|
+
"linear"
|
|
30127
|
+
];
|
|
30128
|
+
/** What a connection's last check found. `auth_failed` stops further calls until it is checked again. */
|
|
30129
|
+
const TRACKER_CONNECTION_STATUSES = [
|
|
30130
|
+
"valid",
|
|
30131
|
+
"auth_failed",
|
|
30132
|
+
"unreachable"
|
|
30133
|
+
];
|
|
30134
|
+
/** What kind of place a provider files tickets in, in its own word. */
|
|
30135
|
+
const TRACKER_PLACE_KINDS = [
|
|
30136
|
+
"project",
|
|
30137
|
+
"table",
|
|
30138
|
+
"team"
|
|
30139
|
+
];
|
|
30140
|
+
//#endregion
|
|
30107
30141
|
//#region ../../packages/types/dist/product-network.js
|
|
30108
30142
|
/**
|
|
30109
30143
|
* Where an engineer build's sandbox may connect to (PRO-2793, part of
|
|
@@ -30858,6 +30892,28 @@ const gitlabValidationReport = object({
|
|
|
30858
30892
|
warnings: array(string$2())
|
|
30859
30893
|
});
|
|
30860
30894
|
const azureDevopsToken = string$2().trim().min(20, "That does not look like an Azure DevOps personal access token").max(1024).regex(/^[A-Za-z0-9_.-]+$/, "That does not look like an Azure DevOps personal access token");
|
|
30895
|
+
/** The secret half of a tracker credential: an API token, a client secret or an API key. */
|
|
30896
|
+
const trackerSecret = string$2().trim().min(8, "That does not look like a tracker credential").max(2048).regex(/^[\x21-\x7e]+$/, "That does not look like a tracker credential");
|
|
30897
|
+
/** The account half, where the provider has one: an email address or a client id. */
|
|
30898
|
+
const trackerAccount = string$2().trim().min(1).max(320);
|
|
30899
|
+
object({
|
|
30900
|
+
status: _enum(TRACKER_CONNECTION_STATUSES),
|
|
30901
|
+
detail: string$2().nullable(),
|
|
30902
|
+
lastValidatedAt: string$2()
|
|
30903
|
+
});
|
|
30904
|
+
strictObject({
|
|
30905
|
+
displayName: string$2().trim().min(1).max(255).optional(),
|
|
30906
|
+
account: trackerAccount.optional(),
|
|
30907
|
+
secret: trackerSecret.optional()
|
|
30908
|
+
}), strictObject({ search: string$2().trim().max(100).optional() }), object({
|
|
30909
|
+
places: array(object({
|
|
30910
|
+
id: string$2(),
|
|
30911
|
+
key: string$2().nullable(),
|
|
30912
|
+
name: string$2(),
|
|
30913
|
+
kind: _enum(TRACKER_PLACE_KINDS)
|
|
30914
|
+
})).nullable(),
|
|
30915
|
+
truncated: boolean()
|
|
30916
|
+
});
|
|
30861
30917
|
strictObject({
|
|
30862
30918
|
displayName: string$2().trim().min(1).max(255).optional(),
|
|
30863
30919
|
token: azureDevopsToken.optional(),
|
|
@@ -31174,6 +31230,12 @@ strictObject({
|
|
|
31174
31230
|
baseUrl: string$2().trim().min(1).max(512),
|
|
31175
31231
|
token: azureDevopsToken,
|
|
31176
31232
|
access: _enum(FORGE_ACCESS).optional()
|
|
31233
|
+
}), object({ connectionId: uuid }), strictObject({
|
|
31234
|
+
provider: _enum(TRACKER_PROVIDERS),
|
|
31235
|
+
displayName: string$2().trim().min(1).max(255),
|
|
31236
|
+
baseUrl: string$2().trim().min(1).max(480).optional(),
|
|
31237
|
+
account: trackerAccount.optional(),
|
|
31238
|
+
secret: trackerSecret
|
|
31177
31239
|
}), object({ connectionId: uuid }), strictObject({
|
|
31178
31240
|
displayName: string$2().min(1).max(255),
|
|
31179
31241
|
ecosystem: _enum(REGISTRY_ECOSYSTEMS).optional(),
|
|
@@ -37087,6 +37149,7 @@ const TOOLSET_OF = {
|
|
|
37087
37149
|
taiga_wait: "core",
|
|
37088
37150
|
taiga_queue_initiative: "operate",
|
|
37089
37151
|
taiga_move_initiative: "operate",
|
|
37152
|
+
taiga_update_initiative: "operate",
|
|
37090
37153
|
taiga_review_plan: "operate",
|
|
37091
37154
|
taiga_plan_again: "operate",
|
|
37092
37155
|
taiga_resume_initiative: "operate",
|
|
@@ -37174,6 +37237,7 @@ const DELIVERY_TOOLS = /* @__PURE__ */ new Set([
|
|
|
37174
37237
|
"taiga_get_line",
|
|
37175
37238
|
"taiga_queue_initiative",
|
|
37176
37239
|
"taiga_move_initiative",
|
|
37240
|
+
"taiga_update_initiative",
|
|
37177
37241
|
"taiga_review_plan",
|
|
37178
37242
|
"taiga_plan_again",
|
|
37179
37243
|
"taiga_resume_initiative",
|
|
@@ -41520,8 +41584,8 @@ const outcomeOf = (item) => withSituation(item, {
|
|
|
41520
41584
|
const outcome = (item) => toolResult(outcomeOf(item));
|
|
41521
41585
|
/**
|
|
41522
41586
|
* Each tool is registered under the capability its route requires, so a
|
|
41523
|
-
* key sees exactly what it may call: reads on backlog:read; the board move
|
|
41524
|
-
* backlog:write; queueing on both backlog:write and products:write (the
|
|
41587
|
+
* key sees exactly what it may call: reads on backlog:read; the board move and
|
|
41588
|
+
* the edit on backlog:write; queueing on both backlog:write and products:write (the
|
|
41525
41589
|
* state route checks both for a drop into queue); an initiative request
|
|
41526
41590
|
* (an agent job), the resume and the review gate on products:write alone, as
|
|
41527
41591
|
* their routes are (the item ID they take also comes back from a request or a
|
|
@@ -41540,6 +41604,7 @@ function registerBacklogTools(server, client) {
|
|
|
41540
41604
|
const may = (capability) => client.hasCapability(capability);
|
|
41541
41605
|
if (may("backlog:read")) registerBacklogReads(server, client);
|
|
41542
41606
|
if (may("backlog:write")) registerMove(server, client);
|
|
41607
|
+
if (may("backlog:write")) registerEdit(server, client);
|
|
41543
41608
|
if (may("products:write")) registerRequest(server, client);
|
|
41544
41609
|
if (may("backlog:write") && may("products:write")) registerQueue(server, client);
|
|
41545
41610
|
if (may("products:write")) registerResume(server, client);
|
|
@@ -41703,7 +41768,7 @@ function registerRequest(server, client) {
|
|
|
41703
41768
|
function registerMove(server, client) {
|
|
41704
41769
|
server.registerTool("taiga_move_initiative", {
|
|
41705
41770
|
title: "Move initiative on the board",
|
|
41706
|
-
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.",
|
|
41771
|
+
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. To change its title, description or criteria, edit it with taiga_update_initiative; do not cancel it and request a new one.",
|
|
41707
41772
|
inputSchema: object({
|
|
41708
41773
|
initiativeId,
|
|
41709
41774
|
state: _enum(USER_DROP_STATES).describe("The column to move into"),
|
|
@@ -41718,6 +41783,108 @@ function registerMove(server, client) {
|
|
|
41718
41783
|
return outcome((await client.transitionInitiative(id, body)).data);
|
|
41719
41784
|
}));
|
|
41720
41785
|
}
|
|
41786
|
+
/**
|
|
41787
|
+
* A criterion as the edit takes it: its text, and whether it needs an
|
|
41788
|
+
* end-to-end check. Whether it is met is not the caller's to say: checking a
|
|
41789
|
+
* criterion off is a person's verdict or a run's verification, and the web's
|
|
41790
|
+
* editor does not offer it either.
|
|
41791
|
+
*/
|
|
41792
|
+
const criterionInput = object({
|
|
41793
|
+
criterion: string$2().trim().min(1).describe("What must be true when the work is done"),
|
|
41794
|
+
endToEnd: boolean().optional().describe("true when it can only be shown through the running product")
|
|
41795
|
+
});
|
|
41796
|
+
/**
|
|
41797
|
+
* The criteria to write, each keeping the met state, attribution and evidence
|
|
41798
|
+
* of a current criterion with the same text, once; a new or reworded one
|
|
41799
|
+
* starts unmet. The route takes the whole list and writes it as given, so
|
|
41800
|
+
* without this an edit that only fixed a typo elsewhere in the list would
|
|
41801
|
+
* clear every check-off, and a caller could mark one met. A kept criterion
|
|
41802
|
+
* keeps its stored text, so the route does not take stray whitespace for a
|
|
41803
|
+
* reworded spec; one made end-to-end starts unmet, as it needs a check it
|
|
41804
|
+
* never had.
|
|
41805
|
+
*/
|
|
41806
|
+
function carriedCriteria(current, next) {
|
|
41807
|
+
const unused = [...current ?? []];
|
|
41808
|
+
const carry = ({ criterion, endToEnd }) => {
|
|
41809
|
+
const fits = (was) => was.criterion.trim() !== criterion.trim() ? -1 : (endToEnd === void 0 || was.endToEnd === true === endToEnd ? 2 : 0) + (was.met ? 1 : 0);
|
|
41810
|
+
let at = -1;
|
|
41811
|
+
unused.forEach((was, index) => {
|
|
41812
|
+
if (fits(was) > (at === -1 ? -1 : fits(unused[at]))) at = index;
|
|
41813
|
+
});
|
|
41814
|
+
const kept = at === -1 ? null : unused.splice(at, 1)[0];
|
|
41815
|
+
if (!kept) return {
|
|
41816
|
+
criterion,
|
|
41817
|
+
met: false,
|
|
41818
|
+
...endToEnd !== void 0 ? { endToEnd } : {}
|
|
41819
|
+
};
|
|
41820
|
+
const flag = endToEnd ?? kept.endToEnd;
|
|
41821
|
+
const withFlag = flag !== void 0 ? { endToEnd: flag } : {};
|
|
41822
|
+
const stricter = flag === true && kept.endToEnd !== true;
|
|
41823
|
+
if (!kept.met || stricter) return {
|
|
41824
|
+
criterion: kept.criterion,
|
|
41825
|
+
met: false,
|
|
41826
|
+
...withFlag
|
|
41827
|
+
};
|
|
41828
|
+
return {
|
|
41829
|
+
...kept,
|
|
41830
|
+
...withFlag
|
|
41831
|
+
};
|
|
41832
|
+
};
|
|
41833
|
+
const written = new Array(next.length);
|
|
41834
|
+
next.forEach((one, index) => {
|
|
41835
|
+
if (one.endToEnd !== void 0) written[index] = carry(one);
|
|
41836
|
+
});
|
|
41837
|
+
next.forEach((one, index) => {
|
|
41838
|
+
if (one.endToEnd === void 0) written[index] = carry(one);
|
|
41839
|
+
});
|
|
41840
|
+
return written;
|
|
41841
|
+
}
|
|
41842
|
+
/** What the route counts as the criteria's spec (criteriaSpecChanged): each text and whether it is end-to-end, in order. */
|
|
41843
|
+
const criteriaSpec = (list) => JSON.stringify((list ?? []).map((c) => [c.criterion, c.endToEnd === true]));
|
|
41844
|
+
/** The largest value the priority and estimate columns hold (Postgres integer); the route has no bound of its own. */
|
|
41845
|
+
const MAX_INT = 2147483647;
|
|
41846
|
+
function registerEdit(server, client) {
|
|
41847
|
+
server.registerTool("taiga_update_initiative", {
|
|
41848
|
+
title: "Edit initiative",
|
|
41849
|
+
description: "Change an initiative's title, description, priority, estimate, category, dependencies or acceptance criteria in place, as a person edits it in the web. Use it to correct, reword or translate an initiative rather than canceling it and requesting a new one. A field left out stays as it is. dependencies and acceptanceCriteria replace the whole list: read it first with taiga_get_initiative full: true. A criterion whose text is unchanged keeps whether it is met; a new, reworded or newly end-to-end one starts unmet. The text is refused (CONFLICT) while an agent works on the initiative or its plan waits for review. taiga_move_initiative moves it on the board.",
|
|
41850
|
+
inputSchema: object({
|
|
41851
|
+
initiativeId,
|
|
41852
|
+
title: string$2().trim().min(1).max(500).optional().describe("A new title"),
|
|
41853
|
+
description: string$2().trim().min(1).max(2e4).optional().describe("The whole new description in Markdown: the problem, what it should do, what it leaves alone"),
|
|
41854
|
+
priority: number$1().int().min(1).max(MAX_INT).optional().describe("Its rank: 1 is done first"),
|
|
41855
|
+
estimate: number$1().int().min(0).max(MAX_INT).optional().describe("Its size in points"),
|
|
41856
|
+
category: _enum(BACKLOG_CATEGORIES).optional().describe("The kind of work"),
|
|
41857
|
+
dependencies: array(idInput("initiative", "taiga_list_initiatives gives it")).optional().describe("Every initiative it waits for, replacing the list; [] clears it"),
|
|
41858
|
+
acceptanceCriteria: array(criterionInput).optional().describe("Every criterion, in order, replacing the list")
|
|
41859
|
+
}),
|
|
41860
|
+
annotations: WRITE
|
|
41861
|
+
}, (params) => runTool(async () => {
|
|
41862
|
+
const { initiativeId: id, acceptanceCriteria, ...fields } = params;
|
|
41863
|
+
if (fields.dependencies?.includes(id)) return toolError("VALIDATION_ERROR", "An initiative cannot depend on itself.");
|
|
41864
|
+
if (acceptanceCriteria === void 0 && Object.values(fields).every((value) => value === void 0)) return toolError("VALIDATION_ERROR", "Give at least one of title, description, priority, estimate, category, dependencies or acceptanceCriteria.");
|
|
41865
|
+
if (acceptanceCriteria !== void 0 && !client.hasCapability("backlog:read")) return toolError("FORBIDDEN", "Editing acceptance criteria reads the current ones first and needs backlog:read, which this key lacks.");
|
|
41866
|
+
let criteria;
|
|
41867
|
+
if (acceptanceCriteria !== void 0) {
|
|
41868
|
+
const current = (await client.getBacklogItem(id)).data;
|
|
41869
|
+
const carried = carriedCriteria(current.acceptanceCriteria, acceptanceCriteria);
|
|
41870
|
+
if (criteriaSpec(carried) !== criteriaSpec(current.acceptanceCriteria)) criteria = carried;
|
|
41871
|
+
else if (Object.values(fields).every((value) => value === void 0)) return toolResult({
|
|
41872
|
+
...outcomeOf(current),
|
|
41873
|
+
unchanged: "The criteria are as they were; nothing was written."
|
|
41874
|
+
});
|
|
41875
|
+
}
|
|
41876
|
+
const item = (await client.updateBacklogItem(id, {
|
|
41877
|
+
...fields.title !== void 0 ? { title: fields.title } : {},
|
|
41878
|
+
...fields.description !== void 0 ? { description: fields.description } : {},
|
|
41879
|
+
...fields.priority !== void 0 ? { priority: fields.priority } : {},
|
|
41880
|
+
...fields.estimate !== void 0 ? { estimate: fields.estimate } : {},
|
|
41881
|
+
...fields.category !== void 0 ? { category: fields.category } : {},
|
|
41882
|
+
...fields.dependencies !== void 0 ? { dependencies: fields.dependencies } : {},
|
|
41883
|
+
...criteria !== void 0 ? { acceptanceCriteria: criteria } : {}
|
|
41884
|
+
})).data;
|
|
41885
|
+
return outcome(item);
|
|
41886
|
+
}));
|
|
41887
|
+
}
|
|
41721
41888
|
/** The two halves of the Build station, where Plan again is offered. */
|
|
41722
41889
|
const BUILD_STATION = /* @__PURE__ */ new Set(["plan", "build"]);
|
|
41723
41890
|
function registerPlanAgain(server, client) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ai/mcp-server",
|
|
3
|
-
"version": "0.38.0-dev.
|
|
3
|
+
"version": "0.38.0-dev.1202",
|
|
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",
|