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

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 +22 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2643,11 +2643,27 @@ function inProductWords(value) {
2643
2643
  function inProductWording(said) {
2644
2644
  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
2645
  }
2646
+ /**
2647
+ * A float without its binary noise: six significant digits. Delivery metrics
2648
+ * came as `deploysPerWeek: 6.766666666666667`, sixteen digits nobody reads
2649
+ * (PRO-2847). Significant digits rather than fixed decimals: an EPSS score of
2650
+ * 0.00043, a 0.4% failure rate or 99.995% uptime keep what they say, where
2651
+ * two decimals read them as 0, 0 and 100.
2652
+ */
2653
+ const roundFloats = (_key, value) => typeof value === "number" && Number.isFinite(value) && !Number.isInteger(value) ? Number(value.toPrecision(6)) : value;
2654
+ /**
2655
+ * A result as the model reads it: compact JSON, in the product's words, its
2656
+ * floats rounded. Indentation was a fifth of a list's characters (PRO-2847),
2657
+ * paid on every call; the model reads JSON without it.
2658
+ */
2659
+ function serializeResult(value) {
2660
+ return JSON.stringify(inProductWords(value), roundFloats);
2661
+ }
2646
2662
  /** A successful tool result: one JSON text block the model reads. */
2647
2663
  function toolResult(value) {
2648
2664
  return { content: [{
2649
2665
  type: "text",
2650
- text: JSON.stringify(inProductWords(value), null, 2)
2666
+ text: serializeResult(value)
2651
2667
  }] };
2652
2668
  }
2653
2669
  /**
@@ -6145,13 +6161,13 @@ async function productContext(client, product, options) {
6145
6161
  unavailable,
6146
6162
  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
6163
  };
6148
- let characters = JSON.stringify(inProductWords(result), null, 2).length;
6164
+ let characters = serializeResult(result).length;
6149
6165
  for (let measured = -1; measured !== characters;) {
6150
6166
  measured = characters;
6151
- characters = JSON.stringify(inProductWords({
6167
+ characters = serializeResult({
6152
6168
  ...result,
6153
6169
  characters: measured
6154
- }), null, 2).length;
6170
+ }).length;
6155
6171
  }
6156
6172
  return toolResult({
6157
6173
  characters,
@@ -6533,12 +6549,13 @@ function registerObserveTools(server, client) {
6533
6549
  ]);
6534
6550
  const now = current.data;
6535
6551
  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;
6552
+ const live = new Set([...now.current ?? [], ...now.deploying ?? []].map((row) => row.id));
6536
6553
  return toolResult({
6537
6554
  environments: pickFields(environments.rows, ENVIRONMENT_FIELDS),
6538
6555
  ...environments.more ? { moreEnvironments: true } : {},
6539
6556
  running: deploymentLines(now.current ?? []),
6540
6557
  deploying: deploymentLines(now.deploying ?? []),
6541
- history: page(deploymentLines(history.data), history.nextCursor),
6558
+ history: page(deploymentLines(history.data.filter((row) => !live.has(row.id))), history.nextCursor),
6542
6559
  ..."value" in sync ? { syncStatus: sync.value.data } : {
6543
6560
  syncStatus: null,
6544
6561
  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.490",
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",