@taiga-ai/mcp-server 0.18.0-dev.446 → 0.18.0-dev.447

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 CHANGED
@@ -4842,6 +4842,20 @@ const ENVIRONMENT_FIELDS = [
4842
4842
  "isProtected",
4843
4843
  "url"
4844
4844
  ];
4845
+ /**
4846
+ * Deployments as lines, each naming the repository that deployed it: every
4847
+ * repository runs its own deployment in an environment, so two running in
4848
+ * production are two repositories, not a contradiction (PRO-2528).
4849
+ */
4850
+ function deploymentLines(rows) {
4851
+ return rows.map((row) => {
4852
+ const repository = row.metadata?.repositoryFullName;
4853
+ return {
4854
+ ...pickFields([row], DEPLOYMENT_FIELDS)[0],
4855
+ repository: typeof repository === "string" ? repository : null
4856
+ };
4857
+ });
4858
+ }
4845
4859
  const environmentId = idInput("environment", "taiga_list_environments lists them; a product ID is not one");
4846
4860
  /** The windows the pages offer, as the schema's own values rather than a number checked afterwards. */
4847
4861
  const windowDays = z.literal([
@@ -4910,9 +4924,9 @@ function registerObserveTools(server, client) {
4910
4924
  return toolResult({
4911
4925
  environments: pickFields(environments.rows, ENVIRONMENT_FIELDS),
4912
4926
  ...environments.more ? { moreEnvironments: true } : {},
4913
- running: pickFields(now.current ?? [], DEPLOYMENT_FIELDS),
4914
- deploying: pickFields(now.deploying ?? [], DEPLOYMENT_FIELDS),
4915
- history: page(pickFields(history.data, DEPLOYMENT_FIELDS), history.nextCursor),
4927
+ running: deploymentLines(now.current ?? []),
4928
+ deploying: deploymentLines(now.deploying ?? []),
4929
+ history: page(deploymentLines(history.data), history.nextCursor),
4916
4930
  ..."value" in sync ? { syncStatus: sync.value.data } : {
4917
4931
  syncStatus: null,
4918
4932
  syncUnavailable: sync.unavailable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.18.0-dev.446",
3
+ "version": "0.18.0-dev.447",
4
4
  "description": "MCP server for Taiga -- gives AI assistants access to documents and products",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -5201,7 +5201,7 @@ describe('MCP server integration', () => {
5201
5201
  commitSha: 'abc',
5202
5202
  commitSubject: 'Merge #1',
5203
5203
  artifacts: {},
5204
- metadata: { big: true },
5204
+ metadata: { big: true, repositoryFullName: 'acme/api' },
5205
5205
  };
5206
5206
  const { client, fetchSpy } = await bootMcpPair({
5207
5207
  capabilities: ['products:read'],
@@ -5246,8 +5246,11 @@ describe('MCP server integration', () => {
5246
5246
  });
5247
5247
  expect(result.environments.map((e: { id: string }) => e.id)).toEqual([ENV_ID, ENV_ID_2]);
5248
5248
  expect(result).not.toHaveProperty('moreEnvironments');
5249
- expect(result.running[0]).toMatchObject({ id: 'd1', commitSubject: 'Merge #1' });
5249
+ // Named by the repository that deployed it: each runs its own in an
5250
+ // environment (PRO-2528). The rest of the metadata stays behind.
5251
+ expect(result.running[0]).toMatchObject({ id: 'd1', commitSubject: 'Merge #1', repository: 'acme/api' });
5250
5252
  expect(result.running[0]).not.toHaveProperty('metadata');
5253
+ expect(result.history.data[0]).toMatchObject({ id: 'd1', repository: 'acme/api' });
5251
5254
  expect(result.history).toMatchObject({ nextCursor: 'more' });
5252
5255
  expect(result.syncStatus).toBeNull();
5253
5256
  expect(result.syncUnavailable).toContain('500');
@@ -39,6 +39,21 @@ const DEPLOYMENT_FIELDS = [
39
39
 
40
40
  const ENVIRONMENT_FIELDS = ['id', 'name', 'slug', 'type', 'ordinal', 'status', 'isProtected', 'url'] as const;
41
41
 
42
+ /**
43
+ * Deployments as lines, each naming the repository that deployed it: every
44
+ * repository runs its own deployment in an environment, so two running in
45
+ * production are two repositories, not a contradiction (PRO-2528).
46
+ */
47
+ function deploymentLines(rows: Row[]): Row[] {
48
+ return rows.map((row) => {
49
+ const repository = (row.metadata as Row | undefined)?.repositoryFullName;
50
+ return {
51
+ ...pickFields([row], DEPLOYMENT_FIELDS)[0],
52
+ repository: typeof repository === 'string' ? repository : null,
53
+ };
54
+ });
55
+ }
56
+
42
57
  const environmentId = idInput('environment', 'taiga_list_environments lists them; a product ID is not one');
43
58
  /** The windows the pages offer, as the schema's own values rather than a number checked afterwards. */
44
59
  const windowDays = z.literal([30, 60, 90]).optional().describe('Days to look back: 30, 60 or 90 (default 30)');
@@ -118,9 +133,9 @@ export function registerObserveTools(server: McpServer, client: TaigaClient) {
118
133
  return toolResult({
119
134
  environments: pickFields(environments.rows, ENVIRONMENT_FIELDS),
120
135
  ...(environments.more ? { moreEnvironments: true } : {}),
121
- running: pickFields(now.current ?? [], DEPLOYMENT_FIELDS),
122
- deploying: pickFields(now.deploying ?? [], DEPLOYMENT_FIELDS),
123
- history: page(pickFields(history.data as Row[], DEPLOYMENT_FIELDS), history.nextCursor),
136
+ running: deploymentLines(now.current ?? []),
137
+ deploying: deploymentLines(now.deploying ?? []),
138
+ history: page(deploymentLines(history.data as Row[]), history.nextCursor),
124
139
  ...('value' in sync
125
140
  ? { syncStatus: sync.value.data }
126
141
  : { syncStatus: null, syncUnavailable: sync.unavailable }),