@taiga-ai/mcp-server 0.34.0-rc.720 → 0.34.0

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 +95 -67
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -25963,6 +25963,7 @@ const FINDING_ROW_FIELDS = [
25963
25963
  "productRepositoryId",
25964
25964
  "ownership",
25965
25965
  "remediableBy",
25966
+ "autoFixHeld",
25966
25967
  "controls",
25967
25968
  "backlogItemId",
25968
25969
  "createdAt",
@@ -26261,7 +26262,7 @@ function registerMaintenanceTools(server, client) {
26261
26262
  if (!client.hasCapability("products:read")) return;
26262
26263
  server.registerTool("taiga_list_findings", {
26263
26264
  title: "List maintenance findings",
26264
- 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, and whether the coding agent can fix it. The first page says when the product was last swept, so an empty list is not read as all clear. 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.",
26265
+ 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 or came_back). The first page says when the product was last swept, so an empty list is not read as all clear. 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.",
26265
26266
  inputSchema: object({
26266
26267
  productId,
26267
26268
  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)"),
@@ -26712,6 +26713,84 @@ function sectionReadResult(doc, asked, label, options = {}) {
26712
26713
  });
26713
26714
  }
26714
26715
  //#endregion
26716
+ //#region src/tools/autonomy.ts
26717
+ /**
26718
+ * Autonomy (docs.tai.ga, Deliver: Initiatives, Auto-merge): whether a landed
26719
+ * plan is built without a review, and whether a pull request merges on its
26720
+ * own. The organization and its factories are ceilings for merging, set by
26721
+ * an administrator in the web; a product sets defaults; an initiative's own
26722
+ * switch is the final word within the ceilings. The initiative's build gate
26723
+ * is taiga_set_auto_build.
26724
+ */
26725
+ function registerAutonomyTools(server, client) {
26726
+ if (client.hasCapability("products:write")) server.registerTool("taiga_set_product_autonomy", {
26727
+ title: "Set a product's autonomy defaults",
26728
+ description: "Set a product's defaults: whether plans are built at once or wait for approval (autoBuild), whether pull requests merge themselves (autoMerge), and how far Taiga goes on its own for each kind of finding it notices (signalAutonomy), and how many fixes it may raise on its own per day (dailyFixLimit). autoMerge and a merge level only take effect where the organization and factory allow autonomous merge; neither is changed here. The answer says what each kind resolves to and what decided it, and the daily limit in force.",
26729
+ inputSchema: object({
26730
+ productId,
26731
+ autoBuild: boolean().optional().describe("Build landed plans without a review by default"),
26732
+ autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory"),
26733
+ signalAutonomy: partialRecord(_enum(SIGNAL_KINDS), _enum(AUTONOMY_LEVELS).nullable()).optional().describe("Per kind of finding: notify (no fix raised; off is the same), propose (plan waits for a person), build (pull request waits for a person), merge (merges itself under auto-merge consent); null returns the kind to its starting level. A level above the kind's cap is refused."),
26734
+ dailyFixLimit: number$1().int().min(1).max(100).nullable().optional().describe(`Fixes Taiga may raise on its own for this product per day, across every kind (1-100); null returns it to the starting value`)
26735
+ }),
26736
+ annotations: OPERATE_SETTING
26737
+ }, (params) => runTool(async () => {
26738
+ if (params.autoBuild === void 0 && params.autoMerge === void 0 && params.signalAutonomy === void 0 && params.dailyFixLimit === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge, signalAutonomy, dailyFixLimit or several.");
26739
+ const autoMerge = params.autoMerge === true ? null : params.autoMerge;
26740
+ const product = (await client.updateProduct(params.productId, {
26741
+ ...params.autoBuild !== void 0 ? { autoBuild: params.autoBuild } : {},
26742
+ ...autoMerge !== void 0 ? { autoMerge } : {},
26743
+ ...params.signalAutonomy !== void 0 ? { signalAutonomy: params.signalAutonomy } : {},
26744
+ ...params.dailyFixLimit !== void 0 ? { dailyFixLimit: params.dailyFixLimit } : {}
26745
+ })).data;
26746
+ const dailyFixLimit = dailyFixLimitOf(product);
26747
+ return toolResult({
26748
+ ...pickFields([product], [
26749
+ "id",
26750
+ "name",
26751
+ "slug",
26752
+ "autoBuild",
26753
+ "autoMerge"
26754
+ ])[0],
26755
+ ...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {},
26756
+ ...dailyFixLimit ? { dailyFixLimit } : {}
26757
+ });
26758
+ }));
26759
+ if (client.hasCapability("backlog:write")) server.registerTool("taiga_set_auto_merge", {
26760
+ title: "Set whether an initiative's pull request merges on its own",
26761
+ description: "Set whether an initiative's pull request merges itself once the repository's checks pass (true), waits for a person (false), or follows the product (null). Where the organization or factory has turned autonomous merge off, true changes nothing.",
26762
+ inputSchema: object({
26763
+ initiativeId: idInput("initiative", "taiga_list_initiatives (query finds one by title) gives it"),
26764
+ autoMerge: boolean().nullable().describe("true merges on its own, false waits for a person, null follows the product")
26765
+ }),
26766
+ annotations: OPERATE_SETTING
26767
+ }, (params) => runTool(async () => {
26768
+ const item = (await client.updateBacklogItem(params.initiativeId, { autoMerge: params.autoMerge })).data;
26769
+ return toolResult(pickFields([item], [
26770
+ "id",
26771
+ "title",
26772
+ "state",
26773
+ "autoMerge",
26774
+ "autoBuild"
26775
+ ])[0]);
26776
+ }));
26777
+ }
26778
+ /**
26779
+ * The daily limit on fixes Taiga raises on its own in force for a product
26780
+ * (PRO-3627), and whether the product set it or it is the deployment's starting value.
26781
+ * Undefined from a response that does not carry the default (a list row).
26782
+ */
26783
+ function dailyFixLimitOf(product) {
26784
+ if (product.dailyFixLimit != null) return {
26785
+ limit: product.dailyFixLimit,
26786
+ setBy: "product"
26787
+ };
26788
+ return product.defaultDailyFixLimit != null ? {
26789
+ limit: product.defaultDailyFixLimit,
26790
+ setBy: "default"
26791
+ } : void 0;
26792
+ }
26793
+ //#endregion
26715
26794
  //#region src/tools/readiness.ts
26716
26795
  const IMPORT_STATE = {
26717
26796
  pending: "not started",
@@ -26832,7 +26911,7 @@ const PRODUCT_VIEW_FIELDS = [
26832
26911
  "createdAt",
26833
26912
  "updatedAt"
26834
26913
  ];
26835
- const UNSET_MEANS = "A null setting is unset: kind reads as application; autoMerge follows the factory, then the organization; ownsInfrastructure and ownsDeployment follow the organization default (yes when it has none); ownsApplication is yes; emitDesignStandards follows how the product started; networkAccess is allowlist. signalAutonomy is what each kind of finding resolves to (off, notify, propose, build, merge) and what decided it: the product, the kind default or cap, or auto-merge consent.";
26914
+ const UNSET_MEANS = "A null setting is unset: kind reads as application; autoMerge follows the factory, then the organization; ownsInfrastructure and ownsDeployment follow the organization default (yes when it has none); ownsApplication is yes; emitDesignStandards follows how the product started; networkAccess is allowlist. signalAutonomy is what each kind of finding resolves to (off, notify, propose, build, merge) and what decided it: the product, the kind default or cap, or auto-merge consent. dailyFixLimit is how many fixes Taiga may raise on its own per day, set by the product or the starting value (setBy default).";
26836
26915
  /**
26837
26916
  * Each product's policy standing beside its row: the counts the standing read opens with. A product still in setup
26838
26917
  * has none to read; a read the API refuses or fails says so on its row rather than failing the list.
@@ -26882,6 +26961,7 @@ function productView(product) {
26882
26961
  ...typeof settings.importStatus === "string" ? { importStatus: settings.importStatus } : {},
26883
26962
  linePaused: stoppedAt ? { since: stoppedAt } : false,
26884
26963
  ...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {},
26964
+ ...dailyFixLimitOf(product) ? { dailyFixLimit: dailyFixLimitOf(product) } : {},
26885
26965
  unsetMeans: UNSET_MEANS
26886
26966
  };
26887
26967
  }
@@ -27691,9 +27771,12 @@ function forgeOf(row) {
27691
27771
  }
27692
27772
  /** A run's change request in its forge's words: `PR #12`, `MR !12`, or the noun when it has no number. */
27693
27773
  function changeRequestOf(row) {
27694
- const forge = forgeOf(row);
27695
- const terms = FORGE_TERMS[forge ?? "github"];
27696
- return typeof row["prNumber"] === "number" ? `${terms.changeRequestShort} ${formatChangeRequestRef(forge ?? "github", row["prNumber"])}` : `its ${terms.changeRequest}`;
27774
+ return typeof row["prNumber"] === "number" ? changeRequestRef(row["provider"], row["prNumber"]) : `its ${FORGE_TERMS[forgeOf(row) ?? "github"].changeRequest}`;
27775
+ }
27776
+ /** A change request's number in its forge's words: `PR #12`, `MR !12`; a row without a forge reads as GitHub. */
27777
+ function changeRequestRef(provider, number) {
27778
+ const forge = forgeOf({ provider }) ?? "github";
27779
+ return `${FORGE_TERMS[forge].changeRequestShort} ${formatChangeRequestRef(forge, number)}`;
27697
27780
  }
27698
27781
  /** What a person does about a handback, by its reason, as the web's handback detail says it, on the run's forge. */
27699
27782
  function handbackNextStep(escalation, provider = null) {
@@ -28509,7 +28592,7 @@ function situationOf(item) {
28509
28592
  if (stalled) stage = requeued ? "Queued" : offTheLine ? "Off the line" : column === null ? "Its build stopped" : "On the line, but its build stopped";
28510
28593
  const build = life.latestBuild;
28511
28594
  if (build && typeof build.status === "string" && life.stage !== "done" && life.stage !== "canceled") {
28512
- const pr = typeof build.prNumber === "number" ? ` (PR #${build.prNumber})` : "";
28595
+ const pr = typeof build.prNumber === "number" ? ` (${changeRequestRef(build.provider, build.prNumber)})` : "";
28513
28596
  const said = BUILD_RUN_STATUSES.includes(build.status) ? RUN_STANDS[landedDisposition(build.status, build.prMerged === true)] : build.status;
28514
28597
  stage += `; its latest run ${said}${pr}`;
28515
28598
  const handback = handbackSaid(build.reviewEscalation);
@@ -28544,7 +28627,8 @@ function endingSaid(item) {
28544
28627
  const ending = item["ending"];
28545
28628
  const merged = typeof ending?.landedPr?.number === "number" ? ending.landedPr.number : null;
28546
28629
  const said = [];
28547
- if (merged !== null) said.push(`: PR #${merged} merged`);
28630
+ const lifecycle = item["lifecycle"];
28631
+ if (merged !== null) said.push(`: ${changeRequestRef(lifecycle?.latestBuild?.provider, merged)} merged`);
28548
28632
  else if (ending && (ending.via === "moved" || ending.via === "off_the_line")) {
28549
28633
  const who = typeof ending.by?.name === "string" ? ending.by.name : ending.by?.type === "system" ? "Taiga" : "someone";
28550
28634
  const when = typeof ending.at === "string" ? ` on ${ending.at.slice(0, 10)}` : "";
@@ -29898,12 +29982,15 @@ async function productContext(client, product, options) {
29898
29982
  };
29899
29983
  const parts = Object.keys(fetchers).filter(granted);
29900
29984
  const [settled, readiness] = await Promise.all([Promise.allSettled(parts.map((part) => fetchers[part]())), setupReadiness(client, product, links)]);
29901
- const signalAutonomy = product.effectiveSignalAutonomy ?? (await client.getProduct(productId)).data.effectiveSignalAutonomy;
29985
+ const detail = product.effectiveSignalAutonomy ? product : (await client.getProduct(productId)).data;
29986
+ const signalAutonomy = detail.effectiveSignalAutonomy;
29987
+ const dailyFixLimit = dailyFixLimitOf(detail);
29902
29988
  const bundle = { product: {
29903
29989
  ...pickFields([product], PRODUCT_SUMMARY_FIELDS)[0],
29904
29990
  projectType: isImportedProduct(product) ? "brownfield" : "greenfield",
29905
29991
  defaultOrigin: defaultOriginFor(product),
29906
29992
  ...signalAutonomy ? { signalAutonomy } : {},
29993
+ ...dailyFixLimit ? { dailyFixLimit } : {},
29907
29994
  ...readiness ? { readiness } : {}
29908
29995
  } };
29909
29996
  const unavailable = {};
@@ -29955,65 +30042,6 @@ function registerContextTools(server, client) {
29955
30042
  }));
29956
30043
  }
29957
30044
  //#endregion
29958
- //#region src/tools/autonomy.ts
29959
- /**
29960
- * Autonomy (docs.tai.ga, Deliver: Initiatives, Auto-merge): whether a landed
29961
- * plan is built without a review, and whether a pull request merges on its
29962
- * own. The organization and its factories are ceilings for merging, set by
29963
- * an administrator in the web; a product sets defaults; an initiative's own
29964
- * switch is the final word within the ceilings. The initiative's build gate
29965
- * is taiga_set_auto_build.
29966
- */
29967
- function registerAutonomyTools(server, client) {
29968
- if (client.hasCapability("products:write")) server.registerTool("taiga_set_product_autonomy", {
29969
- title: "Set a product's autonomy defaults",
29970
- description: "Set a product's defaults: whether plans are built at once or wait for approval (autoBuild), whether pull requests merge themselves (autoMerge), and how far Taiga goes on its own for each kind of finding it notices (signalAutonomy). autoMerge and a merge level only take effect where the organization and factory allow autonomous merge; neither is changed here. The answer says what each kind resolves to and what decided it.",
29971
- inputSchema: object({
29972
- productId,
29973
- autoBuild: boolean().optional().describe("Build landed plans without a review by default"),
29974
- autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory"),
29975
- signalAutonomy: partialRecord(_enum(SIGNAL_KINDS), _enum(AUTONOMY_LEVELS).nullable()).optional().describe("Per kind of finding: off (record only), notify (surface it), propose (plan waits for a person), build (pull request waits for a person), merge (merges itself under auto-merge consent); null follows Taiga's default for the kind. A level above the kind's cap is refused.")
29976
- }),
29977
- annotations: OPERATE_SETTING
29978
- }, (params) => runTool(async () => {
29979
- if (params.autoBuild === void 0 && params.autoMerge === void 0 && params.signalAutonomy === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge, signalAutonomy or several.");
29980
- const autoMerge = params.autoMerge === true ? null : params.autoMerge;
29981
- const product = (await client.updateProduct(params.productId, {
29982
- ...params.autoBuild !== void 0 ? { autoBuild: params.autoBuild } : {},
29983
- ...autoMerge !== void 0 ? { autoMerge } : {},
29984
- ...params.signalAutonomy !== void 0 ? { signalAutonomy: params.signalAutonomy } : {}
29985
- })).data;
29986
- return toolResult({
29987
- ...pickFields([product], [
29988
- "id",
29989
- "name",
29990
- "slug",
29991
- "autoBuild",
29992
- "autoMerge"
29993
- ])[0],
29994
- ...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {}
29995
- });
29996
- }));
29997
- if (client.hasCapability("backlog:write")) server.registerTool("taiga_set_auto_merge", {
29998
- title: "Set whether an initiative's pull request merges on its own",
29999
- description: "Set whether an initiative's pull request merges itself once the repository's checks pass (true), waits for a person (false), or follows the product (null). Where the organization or factory has turned autonomous merge off, true changes nothing.",
30000
- inputSchema: object({
30001
- initiativeId: idInput("initiative", "taiga_list_initiatives (query finds one by title) gives it"),
30002
- autoMerge: boolean().nullable().describe("true merges on its own, false waits for a person, null follows the product")
30003
- }),
30004
- annotations: OPERATE_SETTING
30005
- }, (params) => runTool(async () => {
30006
- const item = (await client.updateBacklogItem(params.initiativeId, { autoMerge: params.autoMerge })).data;
30007
- return toolResult(pickFields([item], [
30008
- "id",
30009
- "title",
30010
- "state",
30011
- "autoMerge",
30012
- "autoBuild"
30013
- ])[0]);
30014
- }));
30015
- }
30016
- //#endregion
30017
30045
  //#region src/tools/knowledge.ts
30018
30046
  /**
30019
30047
  * Knowledge (docs.tai.ga, Context): reference material agents search when
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.34.0-rc.720",
3
+ "version": "0.34.0",
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",