@taiga-ai/mcp-server 0.37.0-dev.1192 → 0.37.0-dev.1194

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 +129 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -23928,6 +23928,21 @@ var TaigaClient = class {
23928
23928
  async getOrganizationLicenses() {
23929
23929
  return this.request("GET", "/tenants/current/licenses");
23930
23930
  }
23931
+ async listOrgFindings(opts) {
23932
+ return this.request("GET", `/tenants/current/findings${query$1(opts)}`);
23933
+ }
23934
+ async listOrgPackages(opts) {
23935
+ return this.request("GET", `/tenants/current/packages${query$1(opts)}`);
23936
+ }
23937
+ async listOrgStanding(factoryId) {
23938
+ return this.request("GET", `/tenants/current/standing${query$1({ factoryId })}`);
23939
+ }
23940
+ async listOrgDelivery(factoryId) {
23941
+ return this.request("GET", `/tenants/current/delivery${query$1({ factoryId })}`);
23942
+ }
23943
+ async listOrgInitiatives(opts) {
23944
+ return this.request("GET", `/tenants/current/initiatives${query$1(opts)}`);
23945
+ }
23931
23946
  /** Where one licence is used across the organization (PRO-3311). */
23932
23947
  async getOrganizationLicense(license) {
23933
23948
  return this.request("GET", `/tenants/current/licenses/detail?license=${encodeURIComponent(license)}`);
@@ -37802,6 +37817,41 @@ function licenseKey(license, allowlist) {
37802
37817
  return outsideAllowlist(license, allowlist) ?? license;
37803
37818
  }
37804
37819
  //#endregion
37820
+ //#region src/tools/org-scope.ts
37821
+ /**
37822
+ * Reads across products (PRO-4841): a read tool that names a product reads
37823
+ * that product; where the API serves the reads across products (introspection
37824
+ * names `orgReads`, behind the API's `orgChat` flag) the same tool with no
37825
+ * product reads every product the caller can open, or one factory's.
37826
+ *
37827
+ * Offered only where the API names it, so a server never sends a read an
37828
+ * older API, or one with the flag off, answers with 404.
37829
+ */
37830
+ function offersOrgReads(client) {
37831
+ return client.getIntrospection()?.mcpFeatures?.includes("orgReads") ?? false;
37832
+ }
37833
+ /** What a read tool's productId says where it may be left out. */
37834
+ const ACROSS_PRODUCTS = "Product ID -- taiga_list_products gives it. Omit it to read every product you can see (factoryId narrows to one factory)";
37835
+ /** The factory a read across products is narrowed to. */
37836
+ const factoryId$1 = idInput("factory", "taiga_list_factories gives it").optional().describe("Without productId: only this factory's products (taiga_list_factories gives it)");
37837
+ /** A factory named beside a product says nothing the product does not: refused, so the model does not think it narrowed. */
37838
+ const FACTORY_WITH_PRODUCT = "factoryId narrows a read across products; drop it, or drop productId.";
37839
+ /**
37840
+ * A read across products as a tool answers it: the rows, what they cover, and
37841
+ * a sentence when products were left out or the read stopped short, so a
37842
+ * partial answer is never read as the whole organization.
37843
+ */
37844
+ function orgResult(read, nextCursor = null) {
37845
+ const { scope } = read;
37846
+ return toolResult({
37847
+ scope,
37848
+ rows: read.rows,
37849
+ ...nextCursor ? { nextCursor } : {},
37850
+ ...scope.leftOut > 0 ? { leftOut: `${scope.leftOut} product${scope.leftOut === 1 ? "" : "s"} in this scope ${scope.leftOut === 1 ? "is" : "are"} not included: you are not a member of ${scope.leftOut === 1 ? "it" : "them"}.` } : {},
37851
+ ...read.complete === false ? { incomplete: "Not every match is here: the read stopped at its limit, or before it had looked at every finding. Raise the limit, or narrow by severity, status or kind." } : {}
37852
+ });
37853
+ }
37854
+ //#endregion
37805
37855
  //#region src/tools/summarize.ts
37806
37856
  /**
37807
37857
  * Keep only the named fields of each item. List tools return summaries (the
@@ -38523,11 +38573,13 @@ function registerMaintenanceTools(server, client) {
38523
38573
  return toolResult((await client.changeLicenseAllowlist(params.action === "approve" ? { approve: [params.license] } : { remove: [params.license] })).data);
38524
38574
  }));
38525
38575
  if (!client.hasCapability("products:read")) return;
38576
+ const acrossProducts = offersOrgReads(client);
38526
38577
  server.registerTool("taiga_list_findings", {
38527
38578
  title: "List maintenance findings",
38528
- description: "List the security and dependency problems sweeps found in a product's code: vulnerable dependencies, secrets, insecure code and infrastructure. Each says how urgent it is (tier), where it is, whether the coding agent can fix it, and why Taiga is not fixing it on its own when it holds the fix (autoFixHeld: major_upgrade, daily_limit, attempts_used, came_back or blocked_by_dependency, which carries blockingPackage and blockingConstraint: the fix version is capped by another dependency's declared constraint). The first page says when the product was last swept, so an empty list is not read as all clear. An ignored finding says who ignored it (decidedBy: person, or auto for the factory's verdict). Findings of one rule in one repository fold into one row per page, so a row's count is that page's (group: false lists each); controlId keeps the ones behind one policy control.",
38579
+ description: "List the security and dependency problems sweeps found in a product's code: vulnerable dependencies, secrets, insecure code and infrastructure. Each says how urgent it is (tier), where it is, whether the coding agent can fix it, and why Taiga is not fixing it on its own when it holds the fix (autoFixHeld: major_upgrade, daily_limit, attempts_used, came_back or blocked_by_dependency, which carries blockingPackage and blockingConstraint: the fix version is capped by another dependency's declared constraint). The first page says when the product was last swept, so an empty list is not read as all clear. An ignored finding says who ignored it (decidedBy: person, or auto for the factory's verdict). Findings of one rule in one repository fold into one row per page, so a row's count is that page's (group: false lists each); controlId keeps the ones behind one policy control." + (acrossProducts ? " Without productId, the findings across every product you can see, most urgent first, each naming its product (factoryId narrows to one factory); the answer says how many products it left out." : ""),
38529
38580
  inputSchema: object({
38530
- productId,
38581
+ productId: acrossProducts ? productId.optional().describe(ACROSS_PRODUCTS) : productId,
38582
+ ...acrossProducts ? { factoryId: factoryId$1 } : {},
38531
38583
  controlId: string$2().trim().min(1).max(40).optional().describe("Only the findings that breach this control, such as SEC-5.1 (one page, searched across all)"),
38532
38584
  status: _enum(MAINTENANCE_FINDING_STATUSES).optional().describe("Only findings in this status; omit for the ones needing action"),
38533
38585
  severity: _enum(MAINTENANCE_FINDING_SEVERITIES).optional().describe("Only this severity"),
@@ -38537,7 +38589,18 @@ function registerMaintenanceTools(server, client) {
38537
38589
  }),
38538
38590
  annotations: READ_ONLY
38539
38591
  }, (params) => runTool(async () => {
38540
- const { productId: id, controlId, ...filters } = params;
38592
+ const { productId: id, controlId, ...asked } = params;
38593
+ const { factoryId: factory, ...filters } = asked;
38594
+ if (id === void 0) {
38595
+ const { group: _group, ...across } = filters;
38596
+ const read = await client.listOrgFindings({
38597
+ ...across,
38598
+ controlId,
38599
+ factoryId: factory
38600
+ });
38601
+ return orgResult(read.data, read.nextCursor);
38602
+ }
38603
+ if (factory !== void 0) return toolError("VALIDATION_ERROR", FACTORY_WITH_PRODUCT);
38541
38604
  if (controlId) {
38542
38605
  if (params.cursor !== void 0) return toolError("VALIDATION_ERROR", "controlId reads every page itself; drop the cursor.");
38543
38606
  const wanted = controlId.toUpperCase();
@@ -38568,9 +38631,10 @@ function registerMaintenanceTools(server, client) {
38568
38631
  }));
38569
38632
  server.registerTool("taiga_list_packages", {
38570
38633
  title: "List the package inventory",
38571
- description: "List every package a product's code uses, with version, license, whether it is direct or dev only, and what pulls a transitive one in; ownCode marks the organization's own packages, approved as its own code. allowed says a person allowed the package in this product, and fix how its own replacement stands. The first page summarizes licenses against the allowed list. Filter by license (licensePage for every string a license decision holds), name or repository. NOT_FOUND where the licenses feature is off.",
38634
+ description: "List every package a product's code uses, with version, license, whether it is direct or dev only, and what pulls a transitive one in; ownCode marks the organization's own packages, approved as its own code. allowed says a person allowed the package in this product, and fix how its own replacement stands. The first page summarizes licenses against the allowed list. Filter by license (licensePage for every string a license decision holds), name or repository. NOT_FOUND where the licenses feature is off." + (acrossProducts ? " Without productId, where a package or license is used across every product you can see, by search or license (factoryId narrows to one factory); licensePage and linkId need a product." : ""),
38572
38635
  inputSchema: object({
38573
- productId,
38636
+ productId: acrossProducts ? productId.optional().describe(ACROSS_PRODUCTS) : productId,
38637
+ ...acrossProducts ? { factoryId: factoryId$1 } : {},
38574
38638
  license: string$2().min(1).max(MAINTENANCE_LICENSE_FILTER_MAX).optional().describe("Only packages carrying exactly this SPDX string"),
38575
38639
  licensePage: string$2().min(1).max(MAINTENANCE_LICENSE_FILTER_MAX).optional().describe("Only the packages of this license as a decision names it: every string decided on it, as MPL-2.0 holds MIT AND MPL-2.0. The packages taiga_replace_license_package and taiga_allow_license_package act on under it"),
38576
38640
  search: string$2().min(1).max(255).optional().describe("Case-insensitive substring of the package name"),
@@ -38579,7 +38643,20 @@ function registerMaintenanceTools(server, client) {
38579
38643
  }),
38580
38644
  annotations: READ_ONLY
38581
38645
  }, (params) => runTool(async () => {
38582
- const { productId: id, linkId: link, ...filters } = params;
38646
+ const { productId: id, linkId: link, ...asked } = params;
38647
+ const { factoryId: factory, ...filters } = asked;
38648
+ if (id === void 0) {
38649
+ if (filters.licensePage !== void 0 || link !== void 0) return toolError("VALIDATION_ERROR", "licensePage and linkId read one product: name it (productId).");
38650
+ const read = await client.listOrgPackages({
38651
+ factoryId: factory,
38652
+ search: filters.search,
38653
+ license: filters.license,
38654
+ limit: filters.limit,
38655
+ cursor: filters.cursor
38656
+ });
38657
+ return orgResult(read.data, read.nextCursor);
38658
+ }
38659
+ if (factory !== void 0) return toolError("VALIDATION_ERROR", FACTORY_WITH_PRODUCT);
38583
38660
  const [result, summary, decisions] = await Promise.all([
38584
38661
  client.listPackages(id, {
38585
38662
  ...filters,
@@ -38649,15 +38726,28 @@ function registerMaintenanceTools(server, client) {
38649
38726
  }));
38650
38727
  server.registerTool("taiga_get_policy_standing", {
38651
38728
  title: "Get a product's policy standing",
38652
- description: "See how a product meets the organization's policies: which controls are met, violated or not assessed. By default the counts and each violated control with its critical and high violations; controlId reads one control with the evidence behind its verdict; violationId reads one violation in full. Not assessed means no evidence either way, not a pass. Fix a violation with taiga_fix_policy_violation.",
38729
+ description: "See how a product meets the organization's policies: which controls are met, violated or not assessed. By default the counts and each violated control with its critical and high violations; controlId reads one control with the evidence behind its verdict; violationId reads one violation in full. Not assessed means no evidence either way, not a pass. Fix a violation with taiga_fix_policy_violation." + (acrossProducts ? " Without productId, every product you can see: its controls by state and the ids of the ones it breaches, and its standing findings by severity, most breached first (factoryId narrows to one factory)." : ""),
38653
38730
  inputSchema: object({
38654
- productId,
38731
+ productId: acrossProducts ? productId.optional().describe(ACROSS_PRODUCTS) : productId,
38732
+ ...acrossProducts ? { factoryId: factoryId$1 } : {},
38655
38733
  full: boolean().optional().describe("Carry each violation's evidence and policy excerpt, cut to about 1,500 characters each, and up to 20 resolved violations (default false)"),
38656
38734
  violationId: idInput("violation", "this tool lists them").optional().describe("Only this violation, in full and uncut: its evidence, policy excerpt and work"),
38657
38735
  controlId: string$2().trim().min(1).max(40).optional().describe("Only this control, such as SEC-5.1: whether it is met, not applicable, violated or not assessed, with the passage")
38658
38736
  }),
38659
38737
  annotations: READ_ONLY
38660
38738
  }, (params) => runTool(async () => {
38739
+ const factory = params.factoryId;
38740
+ if (params.productId === void 0) {
38741
+ if (params.violationId !== void 0 || params.full !== void 0) return toolError("VALIDATION_ERROR", "violationId and full read one product: name it (productId).");
38742
+ const read = (await client.listOrgStanding(factory)).data;
38743
+ if (params.controlId === void 0) return orgResult(read);
38744
+ const wanted = params.controlId.toUpperCase();
38745
+ return orgResult({
38746
+ ...read,
38747
+ rows: read.rows.filter((row) => row.breachedControlIds.some((id) => id.toUpperCase() === wanted))
38748
+ });
38749
+ }
38750
+ if (factory !== void 0) return toolError("VALIDATION_ERROR", FACTORY_WITH_PRODUCT);
38661
38751
  const standing = (await client.getPolicyStanding(params.productId)).data;
38662
38752
  const controls = Array.isArray(standing.controls) ? standing.controls : [];
38663
38753
  const violations = Array.isArray(standing.divergences) ? standing.divergences : [];
@@ -41400,9 +41490,10 @@ function registerBacklogTools(server, client) {
41400
41490
  function registerBacklogReads(server, client) {
41401
41491
  server.registerTool("taiga_list_initiatives", {
41402
41492
  title: "List initiatives",
41403
- description: "List a product's initiatives (units of work), newest first: open ones unless column says otherwise. Each row says its board column, whose turn it is (you, agent or idle), one sentence on where it stands, its latest run and how many acceptance criteria are met. query finds one by title.",
41493
+ description: "List a product's initiatives (units of work), newest first: open ones unless column says otherwise. Each row says its board column, whose turn it is (you, agent or idle), one sentence on where it stands, its latest run and how many acceptance criteria are met. query finds one by title." + (offersOrgReads(client) ? " Without productId, the initiatives across every product you can see, newest first, each naming its product, by column and title (factoryId narrows to one factory; category and includeArchived need a product)." : ""),
41404
41494
  inputSchema: object({
41405
- productId,
41495
+ productId: offersOrgReads(client) ? productId.optional().describe(ACROSS_PRODUCTS) : productId,
41496
+ ...offersOrgReads(client) ? { factoryId: factoryId$1 } : {},
41406
41497
  query: string$2().trim().min(1).max(200).optional().describe("Part of the title, any case: only the items that contain it"),
41407
41498
  column: _enum([
41408
41499
  "open",
@@ -41420,7 +41511,21 @@ function registerBacklogReads(server, client) {
41420
41511
  }),
41421
41512
  annotations: READ_ONLY
41422
41513
  }, (params) => runTool(async () => {
41423
- const { query, column = "open", productId: id, ...filters } = params;
41514
+ const { query, column = "open", productId: asked, ...rest } = params;
41515
+ const { factoryId: factory, ...filters } = rest;
41516
+ if (asked === void 0) {
41517
+ if (filters.category !== void 0 || filters.includeArchived !== void 0) return toolError("VALIDATION_ERROR", "category and includeArchived read one product: name it (productId).");
41518
+ const read = await client.listOrgInitiatives({
41519
+ factoryId: factory,
41520
+ search: query,
41521
+ ...column === "open" ? { open: true } : column === "all" ? {} : { state: column },
41522
+ limit: filters.limit,
41523
+ cursor: filters.cursor
41524
+ });
41525
+ return orgResult(read.data, read.nextCursor);
41526
+ }
41527
+ if (factory !== void 0) return toolError("VALIDATION_ERROR", FACTORY_WITH_PRODUCT);
41528
+ const id = asked;
41424
41529
  const apiFilters = {
41425
41530
  ...filters,
41426
41531
  order: "newest",
@@ -43387,19 +43492,27 @@ function registerObserveTools(server, client) {
43387
43492
  }));
43388
43493
  server.registerTool("taiga_get_delivery_metrics", {
43389
43494
  title: "Get delivery metrics",
43390
- description: "Read a product's delivery performance (DORA): how often it deploys, lead time, recovery time, change failure and rework rates, with trends, over 30, 60 or 90 days. Without environmentId, the product's production environment when it has exactly one; otherwise name the environment. It also reports how much people steered the work (steeringSignals, not tied to an environment): first-time plan approval rate, rejections per initiative, requests for changes per run, review rounds before merge, and handbacks by cause, split by coding agent version (legacy, or engineer with its images). Unreviewed work is counted apart. Null means nothing to measure.",
43495
+ description: "Read a product's delivery performance (DORA): how often it deploys, lead time, recovery time, change failure and rework rates, with trends, over 30, 60 or 90 days. Without environmentId, the product's production environment when it has exactly one; otherwise name the environment. It also reports how much people steered the work (steeringSignals, not tied to an environment): first-time plan approval rate, rejections per initiative, requests for changes per run, review rounds before merge, and handbacks by cause, split by coding agent version (legacy, or engineer with its images). Unreviewed work is counted apart. Null means nothing to measure." + (offersOrgReads(client) ? " Without productId, every product you can see: each production environment's DORA metrics and bands over the last 30 days, no trends or steering (factoryId narrows to one factory)." : ""),
43391
43496
  inputSchema: object({
43392
- productId,
43497
+ productId: offersOrgReads(client) ? productId.optional().describe(ACROSS_PRODUCTS) : productId,
43498
+ ...offersOrgReads(client) ? { factoryId: factoryId$1 } : {},
43393
43499
  environmentId: environmentId.optional(),
43394
43500
  windowDays
43395
43501
  }),
43396
43502
  annotations: READ_ONLY
43397
43503
  }, (params) => runTool(async () => {
43504
+ const factory = params.factoryId;
43505
+ if (params.productId === void 0) {
43506
+ if (params.environmentId !== void 0 || (params.windowDays ?? 30) !== 30) return toolError("VALIDATION_ERROR", "Across products the read is every production environment over 30 days; name a product (productId) for another environment or window.");
43507
+ return orgResult((await client.listOrgDelivery(factory)).data);
43508
+ }
43509
+ if (factory !== void 0) return toolError("VALIDATION_ERROR", FACTORY_WITH_PRODUCT);
43510
+ const id = params.productId;
43398
43511
  const days = params.windowDays ?? 30;
43399
- const readSteering = async () => (await client.getSteeringSignals(params.productId, days)).data;
43512
+ const readSteering = async () => (await client.getSteeringSignals(id, days)).data;
43400
43513
  let environment = params.environmentId;
43401
43514
  if (!environment) {
43402
- const { rows: all, more } = await allEnvironments(client, params.productId);
43515
+ const { rows: all, more } = await allEnvironments(client, id);
43403
43516
  if (all.length === 0 && !more) return toolResult({
43404
43517
  metrics: null,
43405
43518
  note: "This product has no environments, so there is nothing to measure: an environment is defined with taiga_create_environment, and its deployments are mirrored from the provider once it is.",
@@ -43413,7 +43526,7 @@ function registerObserveTools(server, client) {
43413
43526
  })) });
43414
43527
  environment = production[0].id;
43415
43528
  }
43416
- const [doraData, steeringSignals] = await Promise.all([client.getDeliveryMetrics(params.productId, environment, days).then((result) => result.data), readSteering()]);
43529
+ const [doraData, steeringSignals] = await Promise.all([client.getDeliveryMetrics(id, environment, days).then((result) => result.data), readSteering()]);
43417
43530
  return toolResult({
43418
43531
  ...doraData,
43419
43532
  steeringSignals
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.37.0-dev.1192",
3
+ "version": "0.37.0-dev.1194",
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",