@taiga-ai/mcp-server 0.26.0-dev.489 → 0.26.0-dev.492

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 +26 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1352,7 +1352,8 @@ const READY_BLOCKERS = [
1352
1352
  * - `ci_fix_stalled`: a fix round on the failing head pushed nothing;
1353
1353
  * - `conflict_cap`: the branch still conflicts with its base at the cap;
1354
1354
  * - `ready_blocked`: CI is green, but the description says why it is a draft;
1355
- * - `check_weakened`: CI went green only after a fix loosened a check;
1355
+ * - `check_weakened`: CI went green only after a fix changed a CI workflow or
1356
+ * deleted a test, which may have weakened a check;
1356
1357
  * - `review_bot_cap`: a review BOT (Copilot, CodeRabbit) kept reviewing after
1357
1358
  * the automatic rounds ran out (PRO-2480). A bot's review never resets the
1358
1359
  * streak a person's does, so the agent and the bot cannot loop without end.
@@ -2643,11 +2644,27 @@ function inProductWords(value) {
2643
2644
  function inProductWording(said) {
2644
2645
  return said.replace(/^Backlog item not found/i, "Initiative not found").replace(/^Build run step not found/i, "Run step not found").replace(/^Build run not found/i, "Run not found").replace(/^Custom document not found/i, "Knowledge file not found").replace(/^(Branch "[^"]*" does not exist in \S+?)\.?$/i, "$1. taiga_list_repository_branches lists the branches it has.").replace(/^This product already has a repository\. Change it instead of linking another\./i, "This product already has a repository. Pass replacesRepositoryId to swap it in one step, or taiga_unlink_repository first (taiga_list_product_repositories gives its ID).");
2645
2646
  }
2647
+ /**
2648
+ * A float without its binary noise: six significant digits. Delivery metrics
2649
+ * came as `deploysPerWeek: 6.766666666666667`, sixteen digits nobody reads
2650
+ * (PRO-2847). Significant digits rather than fixed decimals: an EPSS score of
2651
+ * 0.00043, a 0.4% failure rate or 99.995% uptime keep what they say, where
2652
+ * two decimals read them as 0, 0 and 100.
2653
+ */
2654
+ const roundFloats = (_key, value) => typeof value === "number" && Number.isFinite(value) && !Number.isInteger(value) ? Number(value.toPrecision(6)) : value;
2655
+ /**
2656
+ * A result as the model reads it: compact JSON, in the product's words, its
2657
+ * floats rounded. Indentation was a fifth of a list's characters (PRO-2847),
2658
+ * paid on every call; the model reads JSON without it.
2659
+ */
2660
+ function serializeResult(value) {
2661
+ return JSON.stringify(inProductWords(value), roundFloats);
2662
+ }
2646
2663
  /** A successful tool result: one JSON text block the model reads. */
2647
2664
  function toolResult(value) {
2648
2665
  return { content: [{
2649
2666
  type: "text",
2650
- text: JSON.stringify(inProductWords(value), null, 2)
2667
+ text: serializeResult(value)
2651
2668
  }] };
2652
2669
  }
2653
2670
  /**
@@ -3918,14 +3935,14 @@ function handbackSaid(escalation) {
3918
3935
  case "review_bot_cap": return `review bots still have open comments${rounds}`;
3919
3936
  case "ci_never_settled": return "CI did not finish in time";
3920
3937
  case "ready_blocked": return `CI is green, but Taiga kept the pull request a draft${blockers.length ? `: ${blockers.join("; ")}` : ""}`;
3921
- case "check_weakened": return `CI went green only after a check was loosened${typeof e.file === "string" ? ` in ${e.file}` : ""}`;
3938
+ case "check_weakened": return `CI went green only after a fix changed ${typeof e.file === "string" ? e.file : "a CI workflow or a test"}`;
3922
3939
  default: return typeof e.reason === "string" ? e.reason : null;
3923
3940
  }
3924
3941
  }
3925
3942
  /** What a person does about a handback, by its reason, as the web's handback detail says it. */
3926
3943
  function handbackNextStep(escalation) {
3927
3944
  const reason = escalation && typeof escalation === "object" ? escalation.reason : null;
3928
- if (reason === "check_weakened") return "review the loosened check on GitHub before merging";
3945
+ if (reason === "check_weakened") return "review that change on GitHub before merging";
3929
3946
  if (reason === "ci_never_settled") return "look at what is still running or queued in CI on GitHub, then review the pull request";
3930
3947
  return "fix it by hand, or review the pull request on GitHub, which hands it back to the agent";
3931
3948
  }
@@ -6145,13 +6162,13 @@ async function productContext(client, product, options) {
6145
6162
  unavailable,
6146
6163
  readNext: "Read a policy, which is the organization's and takes no productId, with taiga_get_document (type, then sections: [] for its outline or a control id such as SEC-5.1); the product's own specification, architecture and other documents with taiga_get_product_document (productId); an initiative with taiga_get_initiative (taiga_list_initiatives pages a truncated backlog) and a run with taiga_get_run."
6147
6164
  };
6148
- let characters = JSON.stringify(inProductWords(result), null, 2).length;
6165
+ let characters = serializeResult(result).length;
6149
6166
  for (let measured = -1; measured !== characters;) {
6150
6167
  measured = characters;
6151
- characters = JSON.stringify(inProductWords({
6168
+ characters = serializeResult({
6152
6169
  ...result,
6153
6170
  characters: measured
6154
- }), null, 2).length;
6171
+ }).length;
6155
6172
  }
6156
6173
  return toolResult({
6157
6174
  characters,
@@ -6533,12 +6550,13 @@ function registerObserveTools(server, client) {
6533
6550
  ]);
6534
6551
  const now = current.data;
6535
6552
  const note = environments.rows.length === 0 ? "This product has no environments yet: an environment is defined with taiga_create_environment, and its deployments are mirrored from the provider once it is." : history.data.length === 0 && !params.cursor ? "No deployments recorded yet: none was mirrored from the provider (syncStatus says when it last synced), or nothing has been deployed." : null;
6553
+ const live = new Set([...now.current ?? [], ...now.deploying ?? []].map((row) => row.id));
6536
6554
  return toolResult({
6537
6555
  environments: pickFields(environments.rows, ENVIRONMENT_FIELDS),
6538
6556
  ...environments.more ? { moreEnvironments: true } : {},
6539
6557
  running: deploymentLines(now.current ?? []),
6540
6558
  deploying: deploymentLines(now.deploying ?? []),
6541
- history: page(deploymentLines(history.data), history.nextCursor),
6559
+ history: page(deploymentLines(history.data.filter((row) => !live.has(row.id))), history.nextCursor),
6542
6560
  ..."value" in sync ? { syncStatus: sync.value.data } : {
6543
6561
  syncStatus: null,
6544
6562
  syncUnavailable: sync.unavailable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.26.0-dev.489",
3
+ "version": "0.26.0-dev.492",
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
  "type": "module",