@taiga-ai/mcp-server 0.11.0 → 0.12.0-dev.417

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.11.0",
3
+ "version": "0.12.0-dev.417",
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",
package/src/client.ts CHANGED
@@ -121,7 +121,12 @@ export class TaigaClient {
121
121
  this.apiKey = opts.apiKey;
122
122
  }
123
123
 
124
- private async request<T>(method: string, path: string, body?: unknown, keep?: { tenantId: true }): Promise<T> {
124
+ private async request<T>(
125
+ method: string,
126
+ path: string,
127
+ body?: unknown,
128
+ options: { keepTenant?: true; signal?: AbortSignal | undefined } = {}
129
+ ): Promise<T> {
125
130
  const url = `${this.baseUrl}/v1${path}`;
126
131
  const headers: Record<string, string> = {
127
132
  Authorization: `Bearer ${this.apiKey}`,
@@ -135,6 +140,8 @@ export class TaigaClient {
135
140
  method,
136
141
  headers,
137
142
  body: body === undefined ? null : JSON.stringify(body),
143
+ // A caller that must stop waiting (a wait's deadline, a cancelled call) ends the read too.
144
+ ...(options.signal ? { signal: options.signal } : {}),
138
145
  });
139
146
 
140
147
  if (!response.ok) {
@@ -143,7 +150,7 @@ export class TaigaClient {
143
150
  }
144
151
 
145
152
  const parsed = (await response.json()) as T;
146
- return keep ? parsed : withoutTenant(parsed);
153
+ return options.keepTenant ? parsed : withoutTenant(parsed);
147
154
  }
148
155
 
149
156
  // ---------------------------------------------------------------------------
@@ -153,7 +160,7 @@ export class TaigaClient {
153
160
  async introspect(): Promise<ApiKeyIntrospection> {
154
161
  // The key's own identity keeps its tenant: typed so, and never handed to the model.
155
162
  const result = await this.request<{ data: ApiKeyIntrospection }>('GET', '/auth/introspect', undefined, {
156
- tenantId: true,
163
+ keepTenant: true,
157
164
  });
158
165
  this.introspection = result.data;
159
166
  return result.data;
@@ -193,8 +200,8 @@ export class TaigaClient {
193
200
  return this.request<{ data: unknown[]; nextCursor: string | null }>('GET', `/products${qs ? `?${qs}` : ''}`);
194
201
  }
195
202
 
196
- async getProduct(id: string) {
197
- return this.request<{ data: unknown }>('GET', `/products/${seg(id)}`);
203
+ async getProduct(id: string, signal?: AbortSignal) {
204
+ return this.request<{ data: unknown }>('GET', `/products/${seg(id)}`, undefined, { signal });
198
205
  }
199
206
 
200
207
  async listProductRepositories(productId: string) {
@@ -329,8 +336,8 @@ export class TaigaClient {
329
336
  );
330
337
  }
331
338
 
332
- async getBacklogItem(itemId: string) {
333
- return this.request<{ data: unknown }>('GET', `/backlog/${seg(itemId)}`);
339
+ async getBacklogItem(itemId: string, signal?: AbortSignal) {
340
+ return this.request<{ data: unknown }>('GET', `/backlog/${seg(itemId)}`, undefined, { signal });
334
341
  }
335
342
 
336
343
  async createBacklogItem(
@@ -362,6 +369,16 @@ export class TaigaClient {
362
369
  return this.request<{ data: unknown }>('POST', `/backlog/${seg(itemId)}/resume`);
363
370
  }
364
371
 
372
+ /** The initiative's own review gate: true builds a landed plan at once, false stops for a person, null follows the product. */
373
+ async setAutoBuild(itemId: string, autoBuild: boolean | null) {
374
+ return this.request<{ data: unknown }>('PUT', `/backlog/${seg(itemId)}/auto-build`, { autoBuild });
375
+ }
376
+
377
+ /** The product's live queue, in order. */
378
+ async listQueue(productId: string) {
379
+ return this.request<{ data: unknown[] }>('GET', `/products/${seg(productId)}/queue`);
380
+ }
381
+
365
382
  async getActivePlan(itemId: string) {
366
383
  return this.request<{ data: unknown }>('GET', `/backlog/${seg(itemId)}/plans/active`);
367
384
  }
@@ -408,8 +425,8 @@ export class TaigaClient {
408
425
  return this.request<{ data: unknown[]; nextCursor: string | null }>('GET', `/builds${qs ? `?${qs}` : ''}`);
409
426
  }
410
427
 
411
- async getBuildRun(id: string) {
412
- return this.request<{ data: unknown }>('GET', `/builds/${seg(id)}`);
428
+ async getBuildRun(id: string, signal?: AbortSignal) {
429
+ return this.request<{ data: unknown }>('GET', `/builds/${seg(id)}`, undefined, { signal });
413
430
  }
414
431
 
415
432
  async stopBuildRun(id: string) {