@taiga-ai/mcp-server 0.34.0-dev.732 → 0.34.0-dev.736

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 +78 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -24577,6 +24577,62 @@ const CODE_REMEDIATION_KINDS = [
24577
24577
  "sast",
24578
24578
  "iac_misconfig"
24579
24579
  ];
24580
+ /** True when the fix is a code change, so no fixed version is required. */
24581
+ function isCodeRemediationKind(kind) {
24582
+ return CODE_REMEDIATION_KINDS.includes(kind);
24583
+ }
24584
+ /**
24585
+ * Whether a remediation build IN THIS REPOSITORY may act on the finding.
24586
+ *
24587
+ * A POSITIVE test, deliberately (PR #1781). `remediableBy` is an open
24588
+ * vocabulary: `pointer_bump` is already a value the CHECK constraint accepts,
24589
+ * reserved for work that does not exist yet, and every gate written as
24590
+ * `!== 'upstream_only'` would wave it straight through into planning and a
24591
+ * build with no idea what to do with it. A value this release does not
24592
+ * understand is not a value it may act on.
24593
+ *
24594
+ * Absent or null reads as `coding_agent`: rows written before PRO-1837 carry
24595
+ * no value at all and are ordinary first-party findings, so the migration's
24596
+ * default and this predicate agree.
24597
+ */
24598
+ function isAgentRemediable(finding) {
24599
+ return !finding.remediableBy || finding.remediableBy === "coding_agent";
24600
+ }
24601
+ /**
24602
+ * Whether a finding can be remediated right now (PRO-1384, PRO-1448, PRO-1837).
24603
+ *
24604
+ * Three shapes of "not fixable": a dependency finding with no advised version
24605
+ * to bump to; a secret that exists only in git history; and a finding whose
24606
+ * code belongs to another repository. A code finding (secret, sast,
24607
+ * iac_misconfig) in this repository is otherwise always fixable -- its remedy
24608
+ * is a change at the location, not a version. Three surfaces (the row, the
24609
+ * group header, the detail page) each hand-wrote this and one drifted: a code
24610
+ * finding had a Fix button in the list and none on its own page. One
24611
+ * predicate, so a rule added here reaches every surface at once.
24612
+ */
24613
+ function isFixableFinding(finding) {
24614
+ if (finding.status !== "open") return false;
24615
+ if (finding.location?.historyOnly) return false;
24616
+ if (!isAgentRemediable(finding)) return false;
24617
+ if (finding.kind === "vulnerable_dependency" && isMaliciousPackageFinding(finding)) return true;
24618
+ return isCodeRemediationKind(finding.kind) || !!finding.recommendedVersion;
24619
+ }
24620
+ /**
24621
+ * A malicious package (OSV `MAL-*`): its advisory id or one of its aliases
24622
+ * says so, or its tier is Act now with no KEV listing, which only a malware
24623
+ * advisory earns (`findingTierReason`). The id and aliases come first: a
24624
+ * malware report that also aliases a KEV-listed CVE is tiered `kev`. Its fix
24625
+ * is removing the package, not a version. The one rule the API's gate, its
24626
+ * Fix, the web and the MCP read (PRO-3601).
24627
+ */
24628
+ function isMaliciousPackageFinding(finding) {
24629
+ if (typeof finding.malicious === "boolean") return finding.malicious;
24630
+ const mal = (id) => typeof id === "string" && /^MAL-/i.test(id);
24631
+ if (mal(finding.advisoryId)) return true;
24632
+ const aliases = finding.data && typeof finding.data === "object" ? finding.data.aliases : void 0;
24633
+ if (Array.isArray(aliases) && aliases.some(mal)) return true;
24634
+ return finding.tier === "act_now" && finding.kevListedAt == null;
24635
+ }
24580
24636
  new Map(Object.entries({
24581
24637
  deps: [
24582
24638
  "vulnerable_dependency",
@@ -25951,6 +26007,8 @@ const FINDING_ROW_FIELDS = [
25951
26007
  "kind",
25952
26008
  "severity",
25953
26009
  "tier",
26010
+ "kevListedAt",
26011
+ "malicious",
25954
26012
  "status",
25955
26013
  "title",
25956
26014
  "ecosystem",
@@ -26084,7 +26142,25 @@ function withFixability(row) {
26084
26142
  fixable: false,
26085
26143
  fixNote: "A license violation has no fix version: approve the license (taiga_change_license), ignore the finding, or replace the packages under it; taiga_fix_finding refuses it."
26086
26144
  };
26087
- if ((row["kind"] === "vulnerable_dependency" || row["kind"] === "outdated_dependency") && !row["recommendedVersion"] && row["remediableBy"] === "coding_agent") return {
26145
+ const dependency = row["kind"] === "vulnerable_dependency" || row["kind"] === "outdated_dependency";
26146
+ const signals = {
26147
+ malicious: typeof row["malicious"] === "boolean" ? row["malicious"] : null,
26148
+ advisoryId: typeof row["advisoryId"] === "string" ? row["advisoryId"] : null,
26149
+ tier: typeof row["tier"] === "string" ? row["tier"] : null,
26150
+ kevListedAt: typeof row["kevListedAt"] === "string" ? row["kevListedAt"] : null
26151
+ };
26152
+ if (row["kind"] === "vulnerable_dependency" && isMaliciousPackageFinding(signals)) return isFixableFinding({
26153
+ ...signals,
26154
+ status: String(row["status"]),
26155
+ kind: "vulnerable_dependency",
26156
+ recommendedVersion: typeof row["recommendedVersion"] === "string" ? row["recommendedVersion"] : null,
26157
+ remediableBy: typeof row["remediableBy"] === "string" ? row["remediableBy"] : null
26158
+ }) ? {
26159
+ ...row,
26160
+ fixable: true,
26161
+ fixNote: "A malicious package: taiga_fix_finding removes it (or replaces it), with every advisory on that version."
26162
+ } : row;
26163
+ if (dependency && !row["recommendedVersion"] && row["remediableBy"] === "coding_agent") return {
26088
26164
  ...row,
26089
26165
  fixable: false,
26090
26166
  fixNote: "No fixed version is known yet: taiga_fix_finding refuses it until one is published."
@@ -26472,7 +26548,7 @@ function registerMaintenanceTools(server, client) {
26472
26548
  }));
26473
26549
  server.registerTool("taiga_fix_finding", {
26474
26550
  title: "Fix a finding",
26475
- 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).",
26551
+ 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. A malicious package is removed, with every advisory on that version, whatever wholeGroup says. 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).",
26476
26552
  inputSchema: object({
26477
26553
  productId,
26478
26554
  findingId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.34.0-dev.732",
3
+ "version": "0.34.0-dev.736",
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",