@taiga-ai/mcp-server 0.38.0-rc.1199 → 0.38.0

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.
Files changed (2) hide show
  1. package/dist/index.js +222 -8
  2. 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"];
@@ -28971,6 +28977,11 @@ Object.freeze({
28971
28977
  gracePeriodDays: 0,
28972
28978
  requiredSince: null
28973
28979
  });
28980
+ [...TURN_EVENT_TRIGGERS];
28981
+ /** What a member can ask the admins for (PRO-4544, PRO-4545). */
28982
+ const ACCESS_REQUEST_KINDS = ["auroras", "write_access"];
28983
+ /** Longest request for changes from Taiga (PRO-3035): about four pages of prose. */
28984
+ const CHANGE_REQUEST_MAX_CHARS = 1e4;
28974
28985
  //#endregion
28975
28986
  //#region ../../packages/types/dist/notifications.js
28976
28987
  /**
@@ -28987,11 +28998,6 @@ const NOTIFICATION_CONTACT_TYPES = [
28987
28998
  "operations",
28988
28999
  "billing"
28989
29000
  ];
28990
- [...TURN_EVENT_TRIGGERS];
28991
- /** What a member can ask the admins for (PRO-4544, PRO-4545). */
28992
- const ACCESS_REQUEST_KINDS = ["auroras", "write_access"];
28993
- /** Longest request for changes from Taiga (PRO-3035): about four pages of prose. */
28994
- const CHANGE_REQUEST_MAX_CHARS = 1e4;
28995
29001
  //#endregion
28996
29002
  //#region ../../packages/types/dist/requests.js
28997
29003
  /**
@@ -30104,6 +30110,44 @@ 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
+ /**
30141
+ * What a refresh of one source answers. `busy` is another refresh of the
30142
+ * same source still running: nothing was read, and its result will arrive.
30143
+ */
30144
+ const TICKET_REFRESH_OUTCOMES = [...[
30145
+ "read",
30146
+ "unreachable",
30147
+ "refused",
30148
+ "rejected"
30149
+ ], "busy"];
30150
+ //#endregion
30107
30151
  //#region ../../packages/types/dist/product-network.js
30108
30152
  /**
30109
30153
  * Where an engineer build's sandbox may connect to (PRO-2793, part of
@@ -30185,6 +30229,19 @@ object({
30185
30229
  verificationError: string$2().nullable()
30186
30230
  });
30187
30231
  const uuid = string$2().uuid();
30232
+ /** A place as a source names it: the tracker's id for it, checked against the tracker before it is stored. */
30233
+ const trackerPlaceId = string$2().trim().min(1).max(255);
30234
+ /** A provider-neutral filter field name, such as `component`. */
30235
+ const trackerFilterField = string$2().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/, "That is not a filter field");
30236
+ /**
30237
+ * The one field a source is held to, by the tracker's ids for its values. A
30238
+ * value's name is read from the tracker where the tracker gives values ids of
30239
+ * their own; a free-text value, such as a label, is its own name.
30240
+ */
30241
+ const ticketSourceFilter = strictObject({
30242
+ field: trackerFilterField,
30243
+ valueIds: array(string$2().trim().min(1).max(255)).min(1).max(50)
30244
+ });
30188
30245
  const sha256 = string$2().regex(/^[0-9a-f]{64}$/, "sha256 must be 64 lowercase hex characters");
30189
30246
  object({ jobId: string$2() });
30190
30247
  /** An upload's grant: a presigned PUT to staging and the headers it signed. */
@@ -30763,6 +30820,10 @@ strictObject({
30763
30820
  answer: _enum(SCOPE_ANSWER_VALUES),
30764
30821
  note: string$2().trim().max(SCOPE_ANSWER_NOTE_MAX_LENGTH).optional()
30765
30822
  }), strictObject({ environments: array(string$2()).default(["development"]) }), object({ id: string$2().uuid() }), strictObject({
30823
+ connectionId: uuid,
30824
+ placeId: trackerPlaceId,
30825
+ filter: ticketSourceFilter.nullable().optional()
30826
+ }), object({ sourceId: uuid }), strictObject({
30766
30827
  connection: newCloudConnection,
30767
30828
  environment: object({
30768
30829
  name: string$2().min(1).max(100),
@@ -30858,6 +30919,47 @@ const gitlabValidationReport = object({
30858
30919
  warnings: array(string$2())
30859
30920
  });
30860
30921
  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");
30922
+ /** The secret half of a tracker credential: an API token, a client secret or an API key. */
30923
+ 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");
30924
+ /** The account half, where the provider has one: an email address or a client id. */
30925
+ const trackerAccount = string$2().trim().min(1).max(320);
30926
+ object({
30927
+ status: _enum(TRACKER_CONNECTION_STATUSES),
30928
+ detail: string$2().nullable(),
30929
+ lastValidatedAt: string$2()
30930
+ });
30931
+ strictObject({ filter: ticketSourceFilter.nullable() }), object({
30932
+ outcome: _enum(TICKET_REFRESH_OUTCOMES),
30933
+ tickets: number$1().int().nullable(),
30934
+ truncated: boolean()
30935
+ });
30936
+ strictObject({
30937
+ displayName: string$2().trim().min(1).max(255).optional(),
30938
+ account: trackerAccount.optional(),
30939
+ secret: trackerSecret.optional()
30940
+ }), strictObject({ placeId: trackerPlaceId }), object({ fields: array(object({
30941
+ field: string$2(),
30942
+ label: string$2(),
30943
+ freeText: boolean()
30944
+ })).nullable() }), strictObject({
30945
+ placeId: trackerPlaceId,
30946
+ field: trackerFilterField,
30947
+ search: string$2().trim().max(100).optional()
30948
+ }), object({
30949
+ values: array(object({
30950
+ id: string$2(),
30951
+ name: string$2()
30952
+ })).nullable(),
30953
+ truncated: boolean()
30954
+ }), strictObject({ search: string$2().trim().max(100).optional() }), object({
30955
+ places: array(object({
30956
+ id: string$2(),
30957
+ key: string$2().nullable(),
30958
+ name: string$2(),
30959
+ kind: _enum(TRACKER_PLACE_KINDS)
30960
+ })).nullable(),
30961
+ truncated: boolean()
30962
+ });
30861
30963
  strictObject({
30862
30964
  displayName: string$2().trim().min(1).max(255).optional(),
30863
30965
  token: azureDevopsToken.optional(),
@@ -31174,6 +31276,12 @@ strictObject({
31174
31276
  baseUrl: string$2().trim().min(1).max(512),
31175
31277
  token: azureDevopsToken,
31176
31278
  access: _enum(FORGE_ACCESS).optional()
31279
+ }), object({ connectionId: uuid }), strictObject({
31280
+ provider: _enum(TRACKER_PROVIDERS),
31281
+ displayName: string$2().trim().min(1).max(255),
31282
+ baseUrl: string$2().trim().min(1).max(480).optional(),
31283
+ account: trackerAccount.optional(),
31284
+ secret: trackerSecret
31177
31285
  }), object({ connectionId: uuid }), strictObject({
31178
31286
  displayName: string$2().min(1).max(255),
31179
31287
  ecosystem: _enum(REGISTRY_ECOSYSTEMS).optional(),
@@ -31375,6 +31483,7 @@ strictObject({
31375
31483
  status: _enum(CLOUD_CONNECTION_STATUSES).optional(),
31376
31484
  providerConfig: record(string$2(), unknown$1()).refine(isTenantWritableProviderConfig, { message: TAIGA_MANAGED_PROVIDER_CONFIG_MESSAGE }).optional()
31377
31485
  });
31486
+ strictObject({ enabled: boolean() });
31378
31487
  object({
31379
31488
  url: string$2().url(),
31380
31489
  expiresAt: string$2(),
@@ -37086,6 +37195,7 @@ const TOOLSET_OF = {
37086
37195
  taiga_wait: "core",
37087
37196
  taiga_queue_initiative: "operate",
37088
37197
  taiga_move_initiative: "operate",
37198
+ taiga_update_initiative: "operate",
37089
37199
  taiga_review_plan: "operate",
37090
37200
  taiga_plan_again: "operate",
37091
37201
  taiga_resume_initiative: "operate",
@@ -37173,6 +37283,7 @@ const DELIVERY_TOOLS = /* @__PURE__ */ new Set([
37173
37283
  "taiga_get_line",
37174
37284
  "taiga_queue_initiative",
37175
37285
  "taiga_move_initiative",
37286
+ "taiga_update_initiative",
37176
37287
  "taiga_review_plan",
37177
37288
  "taiga_plan_again",
37178
37289
  "taiga_resume_initiative",
@@ -41519,8 +41630,8 @@ const outcomeOf = (item) => withSituation(item, {
41519
41630
  const outcome = (item) => toolResult(outcomeOf(item));
41520
41631
  /**
41521
41632
  * Each tool is registered under the capability its route requires, so a
41522
- * key sees exactly what it may call: reads on backlog:read; the board move on
41523
- * backlog:write; queueing on both backlog:write and products:write (the
41633
+ * key sees exactly what it may call: reads on backlog:read; the board move and
41634
+ * the edit on backlog:write; queueing on both backlog:write and products:write (the
41524
41635
  * state route checks both for a drop into queue); an initiative request
41525
41636
  * (an agent job), the resume and the review gate on products:write alone, as
41526
41637
  * their routes are (the item ID they take also comes back from a request or a
@@ -41539,6 +41650,7 @@ function registerBacklogTools(server, client) {
41539
41650
  const may = (capability) => client.hasCapability(capability);
41540
41651
  if (may("backlog:read")) registerBacklogReads(server, client);
41541
41652
  if (may("backlog:write")) registerMove(server, client);
41653
+ if (may("backlog:write")) registerEdit(server, client);
41542
41654
  if (may("products:write")) registerRequest(server, client);
41543
41655
  if (may("backlog:write") && may("products:write")) registerQueue(server, client);
41544
41656
  if (may("products:write")) registerResume(server, client);
@@ -41702,7 +41814,7 @@ function registerRequest(server, client) {
41702
41814
  function registerMove(server, client) {
41703
41815
  server.registerTool("taiga_move_initiative", {
41704
41816
  title: "Move initiative on the board",
41705
- 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.",
41817
+ 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.",
41706
41818
  inputSchema: object({
41707
41819
  initiativeId,
41708
41820
  state: _enum(USER_DROP_STATES).describe("The column to move into"),
@@ -41717,6 +41829,108 @@ function registerMove(server, client) {
41717
41829
  return outcome((await client.transitionInitiative(id, body)).data);
41718
41830
  }));
41719
41831
  }
41832
+ /**
41833
+ * A criterion as the edit takes it: its text, and whether it needs an
41834
+ * end-to-end check. Whether it is met is not the caller's to say: checking a
41835
+ * criterion off is a person's verdict or a run's verification, and the web's
41836
+ * editor does not offer it either.
41837
+ */
41838
+ const criterionInput = object({
41839
+ criterion: string$2().trim().min(1).describe("What must be true when the work is done"),
41840
+ endToEnd: boolean().optional().describe("true when it can only be shown through the running product")
41841
+ });
41842
+ /**
41843
+ * The criteria to write, each keeping the met state, attribution and evidence
41844
+ * of a current criterion with the same text, once; a new or reworded one
41845
+ * starts unmet. The route takes the whole list and writes it as given, so
41846
+ * without this an edit that only fixed a typo elsewhere in the list would
41847
+ * clear every check-off, and a caller could mark one met. A kept criterion
41848
+ * keeps its stored text, so the route does not take stray whitespace for a
41849
+ * reworded spec; one made end-to-end starts unmet, as it needs a check it
41850
+ * never had.
41851
+ */
41852
+ function carriedCriteria(current, next) {
41853
+ const unused = [...current ?? []];
41854
+ const carry = ({ criterion, endToEnd }) => {
41855
+ const fits = (was) => was.criterion.trim() !== criterion.trim() ? -1 : (endToEnd === void 0 || was.endToEnd === true === endToEnd ? 2 : 0) + (was.met ? 1 : 0);
41856
+ let at = -1;
41857
+ unused.forEach((was, index) => {
41858
+ if (fits(was) > (at === -1 ? -1 : fits(unused[at]))) at = index;
41859
+ });
41860
+ const kept = at === -1 ? null : unused.splice(at, 1)[0];
41861
+ if (!kept) return {
41862
+ criterion,
41863
+ met: false,
41864
+ ...endToEnd !== void 0 ? { endToEnd } : {}
41865
+ };
41866
+ const flag = endToEnd ?? kept.endToEnd;
41867
+ const withFlag = flag !== void 0 ? { endToEnd: flag } : {};
41868
+ const stricter = flag === true && kept.endToEnd !== true;
41869
+ if (!kept.met || stricter) return {
41870
+ criterion: kept.criterion,
41871
+ met: false,
41872
+ ...withFlag
41873
+ };
41874
+ return {
41875
+ ...kept,
41876
+ ...withFlag
41877
+ };
41878
+ };
41879
+ const written = new Array(next.length);
41880
+ next.forEach((one, index) => {
41881
+ if (one.endToEnd !== void 0) written[index] = carry(one);
41882
+ });
41883
+ next.forEach((one, index) => {
41884
+ if (one.endToEnd === void 0) written[index] = carry(one);
41885
+ });
41886
+ return written;
41887
+ }
41888
+ /** What the route counts as the criteria's spec (criteriaSpecChanged): each text and whether it is end-to-end, in order. */
41889
+ const criteriaSpec = (list) => JSON.stringify((list ?? []).map((c) => [c.criterion, c.endToEnd === true]));
41890
+ /** The largest value the priority and estimate columns hold (Postgres integer); the route has no bound of its own. */
41891
+ const MAX_INT = 2147483647;
41892
+ function registerEdit(server, client) {
41893
+ server.registerTool("taiga_update_initiative", {
41894
+ title: "Edit initiative",
41895
+ 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.",
41896
+ inputSchema: object({
41897
+ initiativeId,
41898
+ title: string$2().trim().min(1).max(500).optional().describe("A new title"),
41899
+ 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"),
41900
+ priority: number$1().int().min(1).max(MAX_INT).optional().describe("Its rank: 1 is done first"),
41901
+ estimate: number$1().int().min(0).max(MAX_INT).optional().describe("Its size in points"),
41902
+ category: _enum(BACKLOG_CATEGORIES).optional().describe("The kind of work"),
41903
+ dependencies: array(idInput("initiative", "taiga_list_initiatives gives it")).optional().describe("Every initiative it waits for, replacing the list; [] clears it"),
41904
+ acceptanceCriteria: array(criterionInput).optional().describe("Every criterion, in order, replacing the list")
41905
+ }),
41906
+ annotations: WRITE
41907
+ }, (params) => runTool(async () => {
41908
+ const { initiativeId: id, acceptanceCriteria, ...fields } = params;
41909
+ if (fields.dependencies?.includes(id)) return toolError("VALIDATION_ERROR", "An initiative cannot depend on itself.");
41910
+ 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.");
41911
+ 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.");
41912
+ let criteria;
41913
+ if (acceptanceCriteria !== void 0) {
41914
+ const current = (await client.getBacklogItem(id)).data;
41915
+ const carried = carriedCriteria(current.acceptanceCriteria, acceptanceCriteria);
41916
+ if (criteriaSpec(carried) !== criteriaSpec(current.acceptanceCriteria)) criteria = carried;
41917
+ else if (Object.values(fields).every((value) => value === void 0)) return toolResult({
41918
+ ...outcomeOf(current),
41919
+ unchanged: "The criteria are as they were; nothing was written."
41920
+ });
41921
+ }
41922
+ const item = (await client.updateBacklogItem(id, {
41923
+ ...fields.title !== void 0 ? { title: fields.title } : {},
41924
+ ...fields.description !== void 0 ? { description: fields.description } : {},
41925
+ ...fields.priority !== void 0 ? { priority: fields.priority } : {},
41926
+ ...fields.estimate !== void 0 ? { estimate: fields.estimate } : {},
41927
+ ...fields.category !== void 0 ? { category: fields.category } : {},
41928
+ ...fields.dependencies !== void 0 ? { dependencies: fields.dependencies } : {},
41929
+ ...criteria !== void 0 ? { acceptanceCriteria: criteria } : {}
41930
+ })).data;
41931
+ return outcome(item);
41932
+ }));
41933
+ }
41720
41934
  /** The two halves of the Build station, where Plan again is offered. */
41721
41935
  const BUILD_STATION = /* @__PURE__ */ new Set(["plan", "build"]);
41722
41936
  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-rc.1199",
3
+ "version": "0.38.0",
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",