@taiga-ai/mcp-server 0.33.0-rc.682 → 0.33.0-rc.710

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 +81 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4420,6 +4420,16 @@ function record(keyType, valueType, params) {
4420
4420
  ...normalizeParams(params)
4421
4421
  });
4422
4422
  }
4423
+ function partialRecord(keyType, valueType, params) {
4424
+ const k = clone(keyType);
4425
+ k._zod.values = void 0;
4426
+ return new ZodRecord({
4427
+ type: "record",
4428
+ keyType: k,
4429
+ valueType,
4430
+ ...normalizeParams(params)
4431
+ });
4432
+ }
4423
4433
  const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
4424
4434
  $ZodEnum.init(inst, def);
4425
4435
  ZodType.init(inst, def);
@@ -24967,6 +24977,53 @@ function resolveAutoBuild(scopes) {
24967
24977
  return scopes.initiative ?? scopes.product;
24968
24978
  }
24969
24979
  //#endregion
24980
+ //#region ../../packages/types/dist/autonomy.js
24981
+ /**
24982
+ * How far Taiga goes, in ascending order -- the order IS the meaning, so a
24983
+ * ceiling is a `min` and nothing else.
24984
+ *
24985
+ * - off: the signal is recorded, nothing is surfaced or raised
24986
+ * - notify: it is surfaced for a person (today: the finding on Maintaining)
24987
+ * - propose: an initiative is raised and planned; the plan waits for a person
24988
+ * - build: planned and built; the pull request waits for a person
24989
+ * - merge: the pull request merges itself, under auto-merge consent
24990
+ */
24991
+ const AUTONOMY_LEVELS = [
24992
+ "off",
24993
+ "notify",
24994
+ "propose",
24995
+ "build",
24996
+ "merge"
24997
+ ];
24998
+ /**
24999
+ * The kinds of signal a level can be set for. Closed: adding one is a code
25000
+ * change, because a kind without a remediation path behind it is a setting that
25001
+ * promises something nothing does.
25002
+ *
25003
+ * Mapped from what the sweep already produces:
25004
+ * - vulnerable_dependency_exploited: a vulnerable dependency in tier `act_now`
25005
+ * or `urgent` that is not malware (KEV-listed, or likely-exploited and high)
25006
+ * - vulnerable_dependency_severe: tier `elevated` at high or critical severity
25007
+ * -- severe, with no evidence it is being exploited
25008
+ * - malware: a malware advisory (OSV `MAL-*`); the fix is removing the package
25009
+ * - policy_violation: the implementation contradicts an organisation policy
25010
+ * - sast, iac_misconfig, secret: the code finding kinds of the same names
25011
+ * - license: a dependency whose licence the allowlist does not satisfy
25012
+ *
25013
+ * Deliberately absent: `outdated_dependency`, and vulnerable dependencies below
25014
+ * high severity with no exploitation evidence. Nothing is raised for them.
25015
+ */
25016
+ const SIGNAL_KINDS = [
25017
+ "vulnerable_dependency_exploited",
25018
+ "vulnerable_dependency_severe",
25019
+ "malware",
25020
+ "policy_violation",
25021
+ "sast",
25022
+ "iac_misconfig",
25023
+ "secret",
25024
+ "license"
25025
+ ];
25026
+ //#endregion
24970
25027
  //#region ../../packages/types/dist/build-scope.js
24971
25028
  /**
24972
25029
  * Upper bound on `deploymentNotes`, enforced by the API's request schema.
@@ -26404,7 +26461,7 @@ function registerMaintenanceTools(server, client) {
26404
26461
  }));
26405
26462
  server.registerTool("taiga_fix_finding", {
26406
26463
  title: "Fix a finding",
26407
- description: "Raise an initiative that fixes a finding; it ends in a pull request a person merges. wholeGroup: true fixes, in that repository, every open advisory on that package version in one bump, or every place the rule flagged. Refused when no fixed version is known (fixable: false), the code is in a submodule, or a secret is only in history (rotate it outside Taiga).",
26464
+ description: "Raise an initiative that fixes a finding; it ends in a pull request, which merges on its own only where the product's auto-merge allows it. wholeGroup: true fixes, in that repository, every open advisory on that package version in one bump, or every place the rule flagged. Refused when no fixed version is known (fixable: false), the code is in a submodule, or a secret is only in history (rotate it outside Taiga).",
26408
26465
  inputSchema: object({
26409
26466
  productId,
26410
26467
  findingId,
@@ -26765,7 +26822,7 @@ const PRODUCT_VIEW_FIELDS = [
26765
26822
  "createdAt",
26766
26823
  "updatedAt"
26767
26824
  ];
26768
- 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.";
26825
+ 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 which scope decided it: the product, a factory or organization ceiling, the kind default or cap, or auto-merge consent.";
26769
26826
  /**
26770
26827
  * Each product's policy standing beside its row: the counts the standing read opens with. A product still in setup
26771
26828
  * has none to read; a read the API refuses or fails says so on its row rather than failing the list.
@@ -26814,6 +26871,7 @@ function productView(product) {
26814
26871
  projectType: isImportedProduct(product) ? "brownfield" : "greenfield",
26815
26872
  ...typeof settings.importStatus === "string" ? { importStatus: settings.importStatus } : {},
26816
26873
  linePaused: stoppedAt ? { since: stoppedAt } : false,
26874
+ ...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {},
26817
26875
  unsetMeans: UNSET_MEANS
26818
26876
  };
26819
26877
  }
@@ -27129,8 +27187,9 @@ function registerProductTools(server, client) {
27129
27187
  "remoteUrl"
27130
27188
  ]);
27131
27189
  if ("refusal" in resolved) return toolError(resolved.refusal.code, resolved.refusal.message);
27132
- const readiness = await setupReadiness(client, resolved.product);
27133
- const view = productView(resolved.product);
27190
+ const product = resolved.product.effectiveSignalAutonomy ? resolved.product : (await client.getProduct(resolved.product.id)).data;
27191
+ const readiness = await setupReadiness(client, product);
27192
+ const view = productView(product);
27134
27193
  return toolResult(readiness ? {
27135
27194
  ...view,
27136
27195
  readiness
@@ -29811,10 +29870,12 @@ async function productContext(client, product, options) {
29811
29870
  };
29812
29871
  const parts = Object.keys(fetchers).filter(granted);
29813
29872
  const [settled, readiness] = await Promise.all([Promise.allSettled(parts.map((part) => fetchers[part]())), setupReadiness(client, product, links)]);
29873
+ const signalAutonomy = product.effectiveSignalAutonomy ?? (await client.getProduct(productId)).data.effectiveSignalAutonomy;
29814
29874
  const bundle = { product: {
29815
29875
  ...pickFields([product], PRODUCT_SUMMARY_FIELDS)[0],
29816
29876
  projectType: isImportedProduct(product) ? "brownfield" : "greenfield",
29817
29877
  defaultOrigin: defaultOriginFor(product),
29878
+ ...signalAutonomy ? { signalAutonomy } : {},
29818
29879
  ...readiness ? { readiness } : {}
29819
29880
  } };
29820
29881
  const unavailable = {};
@@ -29878,27 +29939,32 @@ function registerContextTools(server, client) {
29878
29939
  function registerAutonomyTools(server, client) {
29879
29940
  if (client.hasCapability("products:write")) server.registerTool("taiga_set_product_autonomy", {
29880
29941
  title: "Set a product's autonomy defaults",
29881
- description: "Set a product's defaults: whether plans are built at once or wait for approval (autoBuild), and whether pull requests merge themselves (autoMerge). autoMerge only takes effect where the organization and factory allow autonomous merge; neither is changed here.",
29942
+ 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 which scope decided it.",
29882
29943
  inputSchema: object({
29883
29944
  productId,
29884
29945
  autoBuild: boolean().optional().describe("Build landed plans without a review by default"),
29885
- autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory")
29946
+ autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory"),
29947
+ 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 the factory and organization. A level above the kind's cap is refused.")
29886
29948
  }),
29887
29949
  annotations: OPERATE_SETTING
29888
29950
  }, (params) => runTool(async () => {
29889
- if (params.autoBuild === void 0 && params.autoMerge === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge or both.");
29951
+ if (params.autoBuild === void 0 && params.autoMerge === void 0 && params.signalAutonomy === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge, signalAutonomy or several.");
29890
29952
  const autoMerge = params.autoMerge === true ? null : params.autoMerge;
29891
29953
  const product = (await client.updateProduct(params.productId, {
29892
29954
  ...params.autoBuild !== void 0 ? { autoBuild: params.autoBuild } : {},
29893
- ...autoMerge !== void 0 ? { autoMerge } : {}
29955
+ ...autoMerge !== void 0 ? { autoMerge } : {},
29956
+ ...params.signalAutonomy !== void 0 ? { signalAutonomy: params.signalAutonomy } : {}
29894
29957
  })).data;
29895
- return toolResult(pickFields([product], [
29896
- "id",
29897
- "name",
29898
- "slug",
29899
- "autoBuild",
29900
- "autoMerge"
29901
- ])[0]);
29958
+ return toolResult({
29959
+ ...pickFields([product], [
29960
+ "id",
29961
+ "name",
29962
+ "slug",
29963
+ "autoBuild",
29964
+ "autoMerge"
29965
+ ])[0],
29966
+ ...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {}
29967
+ });
29902
29968
  }));
29903
29969
  if (client.hasCapability("backlog:write")) server.registerTool("taiga_set_auto_merge", {
29904
29970
  title: "Set whether an initiative's pull request merges on its own",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.33.0-rc.682",
3
+ "version": "0.33.0-rc.710",
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",