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

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 +66 -93
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -26712,84 +26712,6 @@ function sectionReadResult(doc, asked, label, options = {}) {
26712
26712
  });
26713
26713
  }
26714
26714
  //#endregion
26715
- //#region src/tools/autonomy.ts
26716
- /**
26717
- * Autonomy (docs.tai.ga, Deliver: Initiatives, Auto-merge): whether a landed
26718
- * plan is built without a review, and whether a pull request merges on its
26719
- * own. The organization and its factories are ceilings for merging, set by
26720
- * an administrator in the web; a product sets defaults; an initiative's own
26721
- * switch is the final word within the ceilings. The initiative's build gate
26722
- * is taiga_set_auto_build.
26723
- */
26724
- function registerAutonomyTools(server, client) {
26725
- if (client.hasCapability("products:write")) server.registerTool("taiga_set_product_autonomy", {
26726
- title: "Set a product's autonomy defaults",
26727
- 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.",
26728
- inputSchema: object({
26729
- productId,
26730
- autoBuild: boolean().optional().describe("Build landed plans without a review by default"),
26731
- autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory"),
26732
- 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."),
26733
- 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 follows Taiga's default`)
26734
- }),
26735
- annotations: OPERATE_SETTING
26736
- }, (params) => runTool(async () => {
26737
- 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.");
26738
- const autoMerge = params.autoMerge === true ? null : params.autoMerge;
26739
- const product = (await client.updateProduct(params.productId, {
26740
- ...params.autoBuild !== void 0 ? { autoBuild: params.autoBuild } : {},
26741
- ...autoMerge !== void 0 ? { autoMerge } : {},
26742
- ...params.signalAutonomy !== void 0 ? { signalAutonomy: params.signalAutonomy } : {},
26743
- ...params.dailyFixLimit !== void 0 ? { dailyFixLimit: params.dailyFixLimit } : {}
26744
- })).data;
26745
- const dailyFixLimit = dailyFixLimitOf(product);
26746
- return toolResult({
26747
- ...pickFields([product], [
26748
- "id",
26749
- "name",
26750
- "slug",
26751
- "autoBuild",
26752
- "autoMerge"
26753
- ])[0],
26754
- ...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {},
26755
- ...dailyFixLimit ? { dailyFixLimit } : {}
26756
- });
26757
- }));
26758
- if (client.hasCapability("backlog:write")) server.registerTool("taiga_set_auto_merge", {
26759
- title: "Set whether an initiative's pull request merges on its own",
26760
- 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.",
26761
- inputSchema: object({
26762
- initiativeId: idInput("initiative", "taiga_list_initiatives (query finds one by title) gives it"),
26763
- autoMerge: boolean().nullable().describe("true merges on its own, false waits for a person, null follows the product")
26764
- }),
26765
- annotations: OPERATE_SETTING
26766
- }, (params) => runTool(async () => {
26767
- const item = (await client.updateBacklogItem(params.initiativeId, { autoMerge: params.autoMerge })).data;
26768
- return toolResult(pickFields([item], [
26769
- "id",
26770
- "title",
26771
- "state",
26772
- "autoMerge",
26773
- "autoBuild"
26774
- ])[0]);
26775
- }));
26776
- }
26777
- /**
26778
- * The daily limit on fixes Taiga raises on its own in force for a product
26779
- * (PRO-3627), and whether the product set it or it is Taiga's default.
26780
- * Undefined from a response that does not carry the default (a list row).
26781
- */
26782
- function dailyFixLimitOf(product) {
26783
- if (product.dailyFixLimit != null) return {
26784
- limit: product.dailyFixLimit,
26785
- setBy: "product"
26786
- };
26787
- return product.defaultDailyFixLimit != null ? {
26788
- limit: product.defaultDailyFixLimit,
26789
- setBy: "default"
26790
- } : void 0;
26791
- }
26792
- //#endregion
26793
26715
  //#region src/tools/readiness.ts
26794
26716
  const IMPORT_STATE = {
26795
26717
  pending: "not started",
@@ -26910,7 +26832,7 @@ const PRODUCT_VIEW_FIELDS = [
26910
26832
  "createdAt",
26911
26833
  "updatedAt"
26912
26834
  ];
26913
- 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 Taiga's default.";
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
26836
  /**
26915
26837
  * Each product's policy standing beside its row: the counts the standing read opens with. A product still in setup
26916
26838
  * has none to read; a read the API refuses or fails says so on its row rather than failing the list.
@@ -26960,7 +26882,6 @@ function productView(product) {
26960
26882
  ...typeof settings.importStatus === "string" ? { importStatus: settings.importStatus } : {},
26961
26883
  linePaused: stoppedAt ? { since: stoppedAt } : false,
26962
26884
  ...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {},
26963
- ...dailyFixLimitOf(product) ? { dailyFixLimit: dailyFixLimitOf(product) } : {},
26964
26885
  unsetMeans: UNSET_MEANS
26965
26886
  };
26966
26887
  }
@@ -27770,12 +27691,9 @@ function forgeOf(row) {
27770
27691
  }
27771
27692
  /** A run's change request in its forge's words: `PR #12`, `MR !12`, or the noun when it has no number. */
27772
27693
  function changeRequestOf(row) {
27773
- return typeof row["prNumber"] === "number" ? changeRequestRef(row["provider"], row["prNumber"]) : `its ${FORGE_TERMS[forgeOf(row) ?? "github"].changeRequest}`;
27774
- }
27775
- /** A change request's number in its forge's words: `PR #12`, `MR !12`; a row without a forge reads as GitHub. */
27776
- function changeRequestRef(provider, number) {
27777
- const forge = forgeOf({ provider }) ?? "github";
27778
- return `${FORGE_TERMS[forge].changeRequestShort} ${formatChangeRequestRef(forge, number)}`;
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}`;
27779
27697
  }
27780
27698
  /** What a person does about a handback, by its reason, as the web's handback detail says it, on the run's forge. */
27781
27699
  function handbackNextStep(escalation, provider = null) {
@@ -28591,7 +28509,7 @@ function situationOf(item) {
28591
28509
  if (stalled) stage = requeued ? "Queued" : offTheLine ? "Off the line" : column === null ? "Its build stopped" : "On the line, but its build stopped";
28592
28510
  const build = life.latestBuild;
28593
28511
  if (build && typeof build.status === "string" && life.stage !== "done" && life.stage !== "canceled") {
28594
- const pr = typeof build.prNumber === "number" ? ` (${changeRequestRef(build.provider, build.prNumber)})` : "";
28512
+ const pr = typeof build.prNumber === "number" ? ` (PR #${build.prNumber})` : "";
28595
28513
  const said = BUILD_RUN_STATUSES.includes(build.status) ? RUN_STANDS[landedDisposition(build.status, build.prMerged === true)] : build.status;
28596
28514
  stage += `; its latest run ${said}${pr}`;
28597
28515
  const handback = handbackSaid(build.reviewEscalation);
@@ -28626,8 +28544,7 @@ function endingSaid(item) {
28626
28544
  const ending = item["ending"];
28627
28545
  const merged = typeof ending?.landedPr?.number === "number" ? ending.landedPr.number : null;
28628
28546
  const said = [];
28629
- const lifecycle = item["lifecycle"];
28630
- if (merged !== null) said.push(`: ${changeRequestRef(lifecycle?.latestBuild?.provider, merged)} merged`);
28547
+ if (merged !== null) said.push(`: PR #${merged} merged`);
28631
28548
  else if (ending && (ending.via === "moved" || ending.via === "off_the_line")) {
28632
28549
  const who = typeof ending.by?.name === "string" ? ending.by.name : ending.by?.type === "system" ? "Taiga" : "someone";
28633
28550
  const when = typeof ending.at === "string" ? ` on ${ending.at.slice(0, 10)}` : "";
@@ -29981,15 +29898,12 @@ async function productContext(client, product, options) {
29981
29898
  };
29982
29899
  const parts = Object.keys(fetchers).filter(granted);
29983
29900
  const [settled, readiness] = await Promise.all([Promise.allSettled(parts.map((part) => fetchers[part]())), setupReadiness(client, product, links)]);
29984
- const detail = product.effectiveSignalAutonomy ? product : (await client.getProduct(productId)).data;
29985
- const signalAutonomy = detail.effectiveSignalAutonomy;
29986
- const dailyFixLimit = dailyFixLimitOf(detail);
29901
+ const signalAutonomy = product.effectiveSignalAutonomy ?? (await client.getProduct(productId)).data.effectiveSignalAutonomy;
29987
29902
  const bundle = { product: {
29988
29903
  ...pickFields([product], PRODUCT_SUMMARY_FIELDS)[0],
29989
29904
  projectType: isImportedProduct(product) ? "brownfield" : "greenfield",
29990
29905
  defaultOrigin: defaultOriginFor(product),
29991
29906
  ...signalAutonomy ? { signalAutonomy } : {},
29992
- ...dailyFixLimit ? { dailyFixLimit } : {},
29993
29907
  ...readiness ? { readiness } : {}
29994
29908
  } };
29995
29909
  const unavailable = {};
@@ -30041,6 +29955,65 @@ function registerContextTools(server, client) {
30041
29955
  }));
30042
29956
  }
30043
29957
  //#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
30044
30017
  //#region src/tools/knowledge.ts
30045
30018
  /**
30046
30019
  * 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-dev.722",
3
+ "version": "0.34.0-rc.720",
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",