@taiga-ai/mcp-server 0.38.0-dev.1211 → 0.38.0-dev.1212

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 +116 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -24102,6 +24102,14 @@ var TaigaClient = class {
24102
24102
  async updateBacklogItem(itemId, body) {
24103
24103
  return this.request("PATCH", `/backlog/${seg(itemId)}`, body);
24104
24104
  }
24105
+ /** Everyone who can open a product, the people an initiative there can be assigned to (PRO-4982). */
24106
+ async listProductPeople(productId) {
24107
+ return this.request("GET", `/products/${seg(productId)}/people`);
24108
+ }
24109
+ /** Follows an initiative, or stops following it, for the key's own person (PRO-4982). */
24110
+ async setInitiativeFollowing(itemId, userId, subscribed) {
24111
+ return this.request("PUT", `/backlog/${seg(itemId)}/subscribers/${seg(userId)}`, { subscribed });
24112
+ }
24105
24113
  /** Deletes an initiative as the web does: its runs stop and the pull request it waits on closes (PRO-4983). */
24106
24114
  async deleteBacklogItem(itemId) {
24107
24115
  return this.request("DELETE", `/backlog/${seg(itemId)}`);
@@ -37184,6 +37192,7 @@ const TOOLSET_OF = {
37184
37192
  taiga_list_factories: "core",
37185
37193
  taiga_list_initiatives: "core",
37186
37194
  taiga_get_initiative: "core",
37195
+ taiga_list_product_people: "core",
37187
37196
  taiga_get_plan: "core",
37188
37197
  taiga_list_runs: "core",
37189
37198
  taiga_get_run: "core",
@@ -37201,6 +37210,7 @@ const TOOLSET_OF = {
37201
37210
  taiga_move_initiative: "operate",
37202
37211
  taiga_update_initiative: "operate",
37203
37212
  taiga_delete_initiative: "operate",
37213
+ taiga_follow_initiative: "operate",
37204
37214
  taiga_review_plan: "operate",
37205
37215
  taiga_plan_again: "operate",
37206
37216
  taiga_resume_initiative: "operate",
@@ -37290,6 +37300,8 @@ const DELIVERY_TOOLS = /* @__PURE__ */ new Set([
37290
37300
  "taiga_move_initiative",
37291
37301
  "taiga_update_initiative",
37292
37302
  "taiga_delete_initiative",
37303
+ "taiga_follow_initiative",
37304
+ "taiga_list_product_people",
37293
37305
  "taiga_review_plan",
37294
37306
  "taiga_plan_again",
37295
37307
  "taiga_resume_initiative",
@@ -41658,6 +41670,8 @@ function registerBacklogTools(server, client) {
41658
41670
  if (may("backlog:write")) registerMove(server, client);
41659
41671
  if (may("backlog:write")) registerEdit(server, client);
41660
41672
  if (may("backlog:write")) registerDelete(server, client);
41673
+ if (may("products:read")) registerPeople(server, client);
41674
+ if (may("backlog:read")) registerFollow(server, client);
41661
41675
  if (may("products:write")) registerRequest(server, client);
41662
41676
  if (may("backlog:write") && may("products:write")) registerQueue(server, client);
41663
41677
  if (may("products:write")) registerResume(server, client);
@@ -41736,7 +41750,7 @@ function registerBacklogReads(server, client) {
41736
41750
  }));
41737
41751
  server.registerTool("taiga_get_initiative", {
41738
41752
  title: "Get initiative",
41739
- description: "Read one initiative: where it stands (column, turn, a sentence naming the next step), its latest run, and the start of its description. full: true gives the whole description, every acceptance criterion with whether it is met, and its technical context: read it that way before implementing. A failed plan carries planFailure. webUrl is where a person opens it in Taiga (null when this Taiga has no web address set); externalRefKey and externalRefUrl name the ticket it came from in another tracker.",
41753
+ description: "Read one initiative: where it stands (column, turn, a sentence naming the next step), its latest run, and the start of its description. full: true gives the whole description, every acceptance criterion with whether it is met, and its technical context: read it that way before implementing. A failed plan carries planFailure. assignee is the one person accountable for it. webUrl is where a person opens it in Taiga (null when this Taiga has no web address set); externalRefKey and externalRefUrl name the ticket it came from in another tracker.",
41740
41754
  inputSchema: object({
41741
41755
  initiativeId,
41742
41756
  full: boolean().optional().describe("Read it whole: every criterion, technical context and the raw state fields (default false)")
@@ -41745,10 +41759,11 @@ function registerBacklogReads(server, client) {
41745
41759
  }, (params) => runTool(async () => {
41746
41760
  const item = (await client.getBacklogItem(params.initiativeId)).data;
41747
41761
  const row = item;
41748
- const planFailure = item.planningStatus === "failed" ? await planFailureOf(client, params.initiativeId, item.lifecycle?.planFailureCause) : null;
41762
+ const [planFailure, assignee] = await Promise.all([item.planningStatus === "failed" ? planFailureOf(client, params.initiativeId, item.lifecycle?.planFailureCause) : null, assigneeOf(client, item)]);
41749
41763
  const failure = planFailure ? { planFailure } : {};
41750
41764
  if (params.full) return toolResult({
41751
41765
  ...withSituation(row),
41766
+ ...assignee,
41752
41767
  ...failure
41753
41768
  });
41754
41769
  const summary = itemRows([item], ITEM_SUMMARY_FIELDS)[0];
@@ -41758,6 +41773,7 @@ function registerBacklogReads(server, client) {
41758
41773
  ...summary,
41759
41774
  description: description.length > DESCRIPTION_IN_SUMMARY ? `${description.slice(0, DESCRIPTION_IN_SUMMARY).trimEnd()}... (full: true has the rest)` : description
41760
41775
  }),
41776
+ ...assignee,
41761
41777
  ...failure
41762
41778
  });
41763
41779
  }));
@@ -42001,7 +42017,7 @@ const MAX_INT = 2147483647;
42001
42017
  function registerEdit(server, client) {
42002
42018
  server.registerTool("taiga_update_initiative", {
42003
42019
  title: "Edit initiative",
42004
- description: "Change an initiative's title, description, priority, estimate, category, dependencies, acceptance criteria or linked knowledge 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 and documentIds 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. documentIds links knowledge files the planner reads when it plans it: the product's own and its factory's, once ready (taiga_list_knowledge); the result names what it links and unlinks. taiga_move_initiative moves it on the board.",
42020
+ description: "Change an initiative's title, description, priority, estimate, category, dependencies, acceptance criteria, assignee or linked knowledge 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 and documentIds 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. documentIds links knowledge files the planner reads when it plans it: the product's own and its factory's, once ready (taiga_list_knowledge); the result names what it links and unlinks. taiga_move_initiative moves it on the board.",
42005
42021
  inputSchema: object({
42006
42022
  initiativeId,
42007
42023
  title: string$2().trim().min(1).max(500).optional().describe("A new title"),
@@ -42011,13 +42027,14 @@ function registerEdit(server, client) {
42011
42027
  category: _enum(BACKLOG_CATEGORIES).optional().describe("The kind of work"),
42012
42028
  dependencies: array(idInput("initiative", "taiga_list_initiatives gives it")).optional().describe("Every initiative it waits for, replacing the list; [] clears it"),
42013
42029
  acceptanceCriteria: array(criterionInput).optional().describe("Every criterion, in order, replacing the list"),
42030
+ assigneeId: idInput("person", "taiga_list_product_people gives it").nullable().optional().describe("The one person accountable for it, someone who can open the product; null unassigns it"),
42014
42031
  documentIds: array(idInput("knowledge file", "taiga_list_knowledge gives it")).optional().describe(`Every knowledge file it links, at most 25, replacing the list; [] clears it. Images in its description stay linked whatever is sent`)
42015
42032
  }),
42016
42033
  annotations: WRITE
42017
42034
  }, (params) => runTool(async () => {
42018
42035
  const { initiativeId: id, acceptanceCriteria, documentIds, ...fields } = params;
42019
42036
  if (fields.dependencies?.includes(id)) return toolError("VALIDATION_ERROR", "An initiative cannot depend on itself.");
42020
- if (acceptanceCriteria === void 0 && documentIds === 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, acceptanceCriteria or documentIds.");
42037
+ if (acceptanceCriteria === void 0 && documentIds === 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, acceptanceCriteria, assigneeId or documentIds.");
42021
42038
  if (documentIds !== void 0) {
42022
42039
  const lacking = LINK_KNOWLEDGE_NEEDS.filter((capability) => !client.hasCapability(capability));
42023
42040
  if (lacking.length > 0) return toolError("FORBIDDEN", `Linking knowledge reads the initiative and each file, and needs ${lacking.join(", ")}, which this key lacks.`);
@@ -42049,6 +42066,7 @@ function registerEdit(server, client) {
42049
42066
  ...fields.estimate !== void 0 ? { estimate: fields.estimate } : {},
42050
42067
  ...fields.category !== void 0 ? { category: fields.category } : {},
42051
42068
  ...fields.dependencies !== void 0 ? { dependencies: fields.dependencies } : {},
42069
+ ...fields.assigneeId !== void 0 ? { assigneeId: fields.assigneeId } : {},
42052
42070
  ...criteria !== void 0 ? { acceptanceCriteria: criteria } : {},
42053
42071
  ...links && linksChange ? { documentIds: links.send } : {}
42054
42072
  })).data;
@@ -42056,15 +42074,108 @@ function registerEdit(server, client) {
42056
42074
  if (links && error instanceof TaigaApiError && error.status === 400 && /Referenced documents/.test(error.apiMessage ?? "")) return toolError("VALIDATION_ERROR", `${error.apiMessage} Leave them out of documentIds to unlink them.`);
42057
42075
  throw error;
42058
42076
  }
42059
- if (!links) return outcome(item);
42077
+ const assigned = fields.assigneeId !== void 0 ? { assigneeId: fields.assigneeId } : {};
42078
+ if (!links) return toolResult({
42079
+ ...outcomeOf(item),
42080
+ ...assigned
42081
+ });
42060
42082
  return toolResult({
42061
42083
  ...outcomeOf(item),
42084
+ ...assigned,
42062
42085
  linkedKnowledge: links.linked,
42063
42086
  unlinkedKnowledge: links.unlinked
42064
42087
  });
42065
42088
  }));
42066
42089
  }
42067
42090
  /**
42091
+ * The initiative's assignee, named for a read (PRO-4982): the ID alone means
42092
+ * nothing to the person the client answers. The name is looked up in the
42093
+ * product's people where the key may read them; any failure of that side read
42094
+ * leaves the name null and never fails the read of the initiative itself.
42095
+ */
42096
+ async function assigneeOf(client, item) {
42097
+ const id = item.assigneeId;
42098
+ if (!id) return {};
42099
+ if (!client.hasCapability("products:read")) return { assignee: {
42100
+ id,
42101
+ name: null
42102
+ } };
42103
+ try {
42104
+ return { assignee: {
42105
+ id,
42106
+ name: (await client.listProductPeople(item.productId)).data.find((person) => person.id === id)?.name ?? null
42107
+ } };
42108
+ } catch (error) {
42109
+ if (error instanceof TaigaApiError || isNetworkFailure(error)) return { assignee: {
42110
+ id,
42111
+ name: null
42112
+ } };
42113
+ throw error;
42114
+ }
42115
+ }
42116
+ /** The most people one list answers: past it, narrowing by name says more than a longer page. */
42117
+ const PEOPLE_SHOWN = 50;
42118
+ /**
42119
+ * Who can open a product, by name: the people an initiative there can be
42120
+ * assigned to, as the web's assignee menu lists them (PRO-4982).
42121
+ */
42122
+ function registerPeople(server, client) {
42123
+ server.registerTool("taiga_list_product_people", {
42124
+ title: "List product people",
42125
+ description: "List everyone who can open a product, with their user IDs: the people an initiative there can be assigned to (taiga_update_initiative assigneeId). query narrows it by name or email. An email address is shown only where it tells two people of the same name apart, or where the query matched it.",
42126
+ inputSchema: object({
42127
+ productId,
42128
+ query: string$2().trim().min(1).max(200).optional().describe("Part of a name or email address")
42129
+ }),
42130
+ annotations: READ_ONLY
42131
+ }, (params) => runTool(async () => {
42132
+ const people = (await client.listProductPeople(params.productId)).data;
42133
+ const needle = params.query?.toLowerCase();
42134
+ const found = needle ? people.filter((person) => `${person.name}\n${person.email}`.toLowerCase().includes(needle)) : people;
42135
+ const named = /* @__PURE__ */ new Map();
42136
+ for (const person of found) named.set(person.name, (named.get(person.name) ?? 0) + 1);
42137
+ const rows = found.slice(0, PEOPLE_SHOWN).map(({ id, name, email }) => (named.get(name) ?? 0) > 1 || needle !== void 0 && email.toLowerCase().includes(needle) ? {
42138
+ id,
42139
+ name,
42140
+ email
42141
+ } : {
42142
+ id,
42143
+ name
42144
+ });
42145
+ return toolResult({
42146
+ data: rows,
42147
+ ...found.length > rows.length ? { more: `${found.length - rows.length} more; narrow the list with query.` } : {}
42148
+ });
42149
+ }));
42150
+ }
42151
+ /**
42152
+ * Following an initiative, for the key's own person, as the web's Follow does
42153
+ * (PRO-4982): what reaches them about it. Another person's following is theirs
42154
+ * to set, so the tool takes no user.
42155
+ */
42156
+ function registerFollow(server, client) {
42157
+ server.registerTool("taiga_follow_initiative", {
42158
+ title: "Follow initiative",
42159
+ description: "Follow an initiative, so its news reaches you, or stop following it (following: false). Stopping is remembered: creating it or being assigned it does not make you follow it again. Only your own following.",
42160
+ inputSchema: object({
42161
+ initiativeId,
42162
+ following: boolean().describe("true to follow it, false to stop")
42163
+ }),
42164
+ annotations: {
42165
+ ...WRITE,
42166
+ idempotentHint: true
42167
+ }
42168
+ }, (params) => runTool(async () => {
42169
+ const me = client.getIntrospection()?.userId;
42170
+ if (!me) return toolError("UNAUTHENTICATED", "The key has not been checked yet; try again.");
42171
+ const row = (await client.setInitiativeFollowing(params.initiativeId, me, params.following)).data;
42172
+ return toolResult({
42173
+ initiativeId: params.initiativeId,
42174
+ following: row.subscribed
42175
+ });
42176
+ }));
42177
+ }
42178
+ /**
42068
42179
  * Deleting an initiative, as the web's Delete does (PRO-4983). The route stops
42069
42180
  * the runs building it and closes its open pull requests, so it is paid work
42070
42181
  * asked first (PAID_WORK); canceled is the move that keeps the card and its
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.38.0-dev.1211",
3
+ "version": "0.38.0-dev.1212",
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",