nexus-agents 11.5.2 → 11.5.4

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 (30) hide show
  1. package/dist/{chunk-ZPCTULSZ.js → chunk-65ENP3HN.js} +2 -2
  2. package/dist/{chunk-ZMFKWTMT.js → chunk-6V25ZIPU.js} +3 -3
  3. package/dist/{chunk-TEI6W4ED.js → chunk-HH4FMRXL.js} +3 -3
  4. package/dist/{chunk-S3RKQGKV.js → chunk-IQYJPOMW.js} +2 -2
  5. package/dist/{chunk-ZX5262PS.js → chunk-NKITVLTK.js} +2 -2
  6. package/dist/{chunk-7B4FUABZ.js → chunk-O76YJOEG.js} +2 -2
  7. package/dist/{chunk-CI3FOOUF.js → chunk-TH3MSFDF.js} +561 -430
  8. package/dist/chunk-TH3MSFDF.js.map +1 -0
  9. package/dist/{chunk-BDP422B2.js → chunk-Z2AAMUNG.js} +1 -1
  10. package/dist/chunk-Z2AAMUNG.js.map +1 -0
  11. package/dist/cli.js +26 -19
  12. package/dist/cli.js.map +1 -1
  13. package/dist/{consensus-vote-OAYLGVUE.js → consensus-vote-KQTXJS5E.js} +4 -4
  14. package/dist/{improvement-review-NUUQMU4Z.js → improvement-review-6PXKRGRU.js} +4 -4
  15. package/dist/index.js +7 -7
  16. package/dist/{pr-reviewer-helpers-WUK6PQLA.js → pr-reviewer-helpers-J2KQYHPB.js} +3 -3
  17. package/dist/{setup-data-dir-2H2E66OU.js → setup-data-dir-AY6JK4P6.js} +3 -3
  18. package/package.json +1 -1
  19. package/dist/chunk-BDP422B2.js.map +0 -1
  20. package/dist/chunk-CI3FOOUF.js.map +0 -1
  21. /package/dist/{chunk-ZPCTULSZ.js.map → chunk-65ENP3HN.js.map} +0 -0
  22. /package/dist/{chunk-ZMFKWTMT.js.map → chunk-6V25ZIPU.js.map} +0 -0
  23. /package/dist/{chunk-TEI6W4ED.js.map → chunk-HH4FMRXL.js.map} +0 -0
  24. /package/dist/{chunk-S3RKQGKV.js.map → chunk-IQYJPOMW.js.map} +0 -0
  25. /package/dist/{chunk-ZX5262PS.js.map → chunk-NKITVLTK.js.map} +0 -0
  26. /package/dist/{chunk-7B4FUABZ.js.map → chunk-O76YJOEG.js.map} +0 -0
  27. /package/dist/{consensus-vote-OAYLGVUE.js.map → consensus-vote-KQTXJS5E.js.map} +0 -0
  28. /package/dist/{improvement-review-NUUQMU4Z.js.map → improvement-review-6PXKRGRU.js.map} +0 -0
  29. /package/dist/{pr-reviewer-helpers-WUK6PQLA.js.map → pr-reviewer-helpers-J2KQYHPB.js.map} +0 -0
  30. /package/dist/{setup-data-dir-2H2E66OU.js.map → setup-data-dir-AY6JK4P6.js.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  FINDING_SEVERITY_LEVELS,
3
3
  SARIF_LEVEL_MAP,
4
4
  SEVERITY_ORDER
5
- } from "./chunk-BDP422B2.js";
5
+ } from "./chunk-Z2AAMUNG.js";
6
6
  import {
7
7
  executeExpert
8
8
  } from "./chunk-XBXLA6DJ.js";
@@ -58,7 +58,7 @@ import {
58
58
  updateStage,
59
59
  withFileLock,
60
60
  writeJobCancelled
61
- } from "./chunk-ZMFKWTMT.js";
61
+ } from "./chunk-6V25ZIPU.js";
62
62
  import {
63
63
  normalizeTopicToCanonical,
64
64
  synthesizeResearch
@@ -77,7 +77,7 @@ import {
77
77
  } from "./chunk-773AZVR3.js";
78
78
  import {
79
79
  withPrerequisite
80
- } from "./chunk-ZX5262PS.js";
80
+ } from "./chunk-NKITVLTK.js";
81
81
  import {
82
82
  NOOP_NOTIFIER,
83
83
  RateLimiter,
@@ -105,7 +105,7 @@ import {
105
105
  toolSuccess,
106
106
  withProgressHeartbeat,
107
107
  wrapToolWithTimeout
108
- } from "./chunk-S3RKQGKV.js";
108
+ } from "./chunk-IQYJPOMW.js";
109
109
  import {
110
110
  generateSecurityPlan
111
111
  } from "./chunk-6ZTMMN2N.js";
@@ -187,7 +187,7 @@ import {
187
187
  import {
188
188
  DEFAULT_TASK_TTL_MS,
189
189
  clampTaskTtl
190
- } from "./chunk-TEI6W4ED.js";
190
+ } from "./chunk-HH4FMRXL.js";
191
191
  import {
192
192
  allOf,
193
193
  anyOf
@@ -196,7 +196,7 @@ import {
196
196
  VERSION,
197
197
  createRequestContext,
198
198
  measuredTrustTier
199
- } from "./chunk-7B4FUABZ.js";
199
+ } from "./chunk-O76YJOEG.js";
200
200
  import {
201
201
  BWRAP_READ_ONLY_ARGS,
202
202
  CliDetectionCache,
@@ -26919,10 +26919,10 @@ function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
26919
26919
  const difference = p1 - p2;
26920
26920
  const measured = total1 > 0 && total2 > 0;
26921
26921
  const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
26922
- const z117 = getZScore(confidence);
26922
+ const z118 = getZScore(confidence);
26923
26923
  return {
26924
- lower: difference - z117 * seDiff,
26925
- upper: difference + z117 * seDiff,
26924
+ lower: difference - z118 * seDiff,
26925
+ upper: difference + z118 * seDiff,
26926
26926
  estimate: difference,
26927
26927
  confidence,
26928
26928
  n: total1 + total2,
@@ -26950,11 +26950,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
26950
26950
  measured: false
26951
26951
  };
26952
26952
  }
26953
- const z117 = getZScore(opts.confidence);
26954
- const z210 = z117 * z117;
26953
+ const z118 = getZScore(opts.confidence);
26954
+ const z210 = z118 * z118;
26955
26955
  const denominator = 1 + z210 / n;
26956
26956
  const center = (p + z210 / (2 * n)) / denominator;
26957
- const margin = z117 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
26957
+ const margin = z118 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
26958
26958
  const lower = Math.max(0, center - margin);
26959
26959
  const upper = Math.min(1, center + margin);
26960
26960
  const standardError = Math.sqrt(p * (1 - p) / n);
@@ -26992,8 +26992,8 @@ function meanConfidenceInterval(values, options = {}) {
26992
26992
  const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
26993
26993
  const stdDev = Math.sqrt(variance);
26994
26994
  const standardError = stdDev / Math.sqrt(n);
26995
- const z117 = getZScore(opts.confidence);
26996
- const margin = z117 * standardError;
26995
+ const z118 = getZScore(opts.confidence);
26996
+ const margin = z118 * standardError;
26997
26997
  return {
26998
26998
  lower: mean - margin,
26999
26999
  upper: mean + margin,
@@ -46682,7 +46682,7 @@ function buildVotingInput(plan, config) {
46682
46682
  }
46683
46683
  async function executeSingleVote(plan, config, log) {
46684
46684
  try {
46685
- const { executeVoting } = await import("./consensus-vote-OAYLGVUE.js");
46685
+ const { executeVoting } = await import("./consensus-vote-KQTXJS5E.js");
46686
46686
  const input = buildVotingInput(plan, config);
46687
46687
  const result = await executeVoting(input, log);
46688
46688
  return parseVotingResult(result);
@@ -48577,7 +48577,7 @@ function createVoteStage({ config, startStage }) {
48577
48577
  const strategy = config.votingStrategy ?? "higher_order";
48578
48578
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
48579
48579
  try {
48580
- const { executeVoting } = await import("./consensus-vote-OAYLGVUE.js");
48580
+ const { executeVoting } = await import("./consensus-vote-KQTXJS5E.js");
48581
48581
  const proposal = buildVoteProposal(plan, research);
48582
48582
  const votingResult = await executeVoting(
48583
48583
  {
@@ -48678,67 +48678,136 @@ Verdict: PASS/NEEDS_WORK/REJECT`;
48678
48678
  }
48679
48679
 
48680
48680
  // src/mcp/tools/security-scan.ts
48681
- import { z as z93 } from "zod";
48681
+ import { z as z94 } from "zod";
48682
48682
 
48683
48683
  // src/security/sarif-parser.ts
48684
+ import { z as z93 } from "zod";
48685
+
48686
+ // src/security/sarif-diagnostics.ts
48684
48687
  import { z as z92 } from "zod";
48685
- var SarifLocationSchema = z92.object({
48686
- physicalLocation: z92.object({
48687
- artifactLocation: z92.object({ uri: z92.string().optional().catch(void 0) }).optional(),
48688
- region: z92.object({
48689
- startLine: z92.number().optional().catch(void 0),
48690
- endLine: z92.number().int().min(1).optional().catch(void 0),
48691
- snippet: z92.object({
48692
- text: z92.string().optional().catch(void 0),
48688
+ var SarifNotificationSchema = z92.object({
48689
+ descriptor: z92.object({ id: z92.string().optional() }).optional(),
48690
+ level: z92.string().optional(),
48691
+ message: z92.object({ text: z92.string().optional() }).optional()
48692
+ });
48693
+ var CONTROL_CHARACTERS = /[\u0000-\u001f\u007f-\u009f\u2028\u2029]+/g;
48694
+ function hasControlCharacter(text) {
48695
+ return text.replace(CONTROL_CHARACTERS, "") !== text;
48696
+ }
48697
+ function stripControlCharacters(text) {
48698
+ return text.replace(CONTROL_CHARACTERS, " ");
48699
+ }
48700
+ function checkConfigurationNotifications(notifications, errors) {
48701
+ for (const notification of notifications ?? []) {
48702
+ if (notification.level !== "note" && notification.level !== "none")
48703
+ errors.push(
48704
+ `Scanner configuration: ${notification.message?.text ?? "unknown configuration error"}`
48705
+ );
48706
+ }
48707
+ }
48708
+ function diagnosticFields(parseDiagnostics, scannerDiagnostics) {
48709
+ return {
48710
+ ...parseDiagnostics.length > 0 ? { parseDiagnostics } : {},
48711
+ ...scannerDiagnostics.length > 0 ? { scannerDiagnostics } : {}
48712
+ };
48713
+ }
48714
+ function checkNotifications(notifications, errors, parseDiagnostics, scannerDiagnostics, scanner) {
48715
+ for (const notification of notifications ?? []) {
48716
+ const diagnostic = parseNotification(notification);
48717
+ const scannerDiagnostic = parseScannerNotification(notification, scanner);
48718
+ if (diagnostic !== void 0) parseDiagnostics.push(diagnostic);
48719
+ else if (scannerDiagnostic !== void 0) scannerDiagnostics.push(scannerDiagnostic);
48720
+ else if (notification.level !== "note" && notification.level !== "none")
48721
+ errors.push(`Scanner notification: ${notification.message?.text ?? "unknown scanner error"}`);
48722
+ }
48723
+ }
48724
+ function parseScannerNotification(notification, scanner) {
48725
+ const kind = fileErrorKind(notification.descriptor?.id, scanner);
48726
+ const message = notification.message?.text;
48727
+ if (kind === void 0 || message === void 0) return void 0;
48728
+ const location = fileErrorLocation(message, kind);
48729
+ return location === void 0 ? void 0 : { ...location, kind, scanner, message };
48730
+ }
48731
+ function fileErrorLocation(message, kind) {
48732
+ const header = /^(Internal matching error|Timeout) (?:when running (\S+) on ([^\n]+)|at line ([^\n]+):\d+):\n/.exec(
48733
+ message
48734
+ );
48735
+ if (header?.[1] !== kind) return void 0;
48736
+ const file = header[3] ?? header[4];
48737
+ const rule = header[2];
48738
+ if (file === void 0 || hasControlCharacter(file) || kind === "Internal matching error" && rule === void 0)
48739
+ return void 0;
48740
+ return { file, ...rule === void 0 ? {} : { rule } };
48741
+ }
48742
+ function fileErrorKind(kind, scanner) {
48743
+ if (!["semgrep", "semgrep oss"].includes(scanner.toLowerCase())) return void 0;
48744
+ if (kind !== "Internal matching error" && kind !== "Timeout") return void 0;
48745
+ return kind;
48746
+ }
48747
+ function parseNotification(notification) {
48748
+ if (!/^(?:Syntax error|Other syntax error)$/.test(notification.descriptor?.id ?? ""))
48749
+ return void 0;
48750
+ const message = notification.message?.text;
48751
+ if (message === void 0) return void 0;
48752
+ const file = /^(?:Syntax error|Other syntax error) at line (.+):(\d+):(?:\n|$| )/.exec(
48753
+ message
48754
+ )?.[1];
48755
+ return file === void 0 || hasControlCharacter(file) ? void 0 : { file, kind: "parse", message };
48756
+ }
48757
+
48758
+ // src/security/sarif-parser.ts
48759
+ var SarifLocationSchema = z93.object({
48760
+ physicalLocation: z93.object({
48761
+ artifactLocation: z93.object({ uri: z93.string().optional().catch(void 0) }).optional(),
48762
+ region: z93.object({
48763
+ startLine: z93.number().optional().catch(void 0),
48764
+ endLine: z93.number().int().min(1).optional().catch(void 0),
48765
+ snippet: z93.object({
48766
+ text: z93.string().optional().catch(void 0),
48693
48767
  // Unknown truncation metadata cannot establish a complete snippet.
48694
- truncated: z92.boolean().optional().catch(true)
48768
+ truncated: z93.boolean().optional().catch(true)
48695
48769
  }).optional().catch(void 0)
48696
48770
  }).optional()
48697
48771
  }).optional()
48698
48772
  });
48699
- var SarifResultSchema = z92.object({
48700
- ruleId: z92.string().nullish(),
48701
- level: z92.string().nullish(),
48702
- message: z92.object({ text: z92.string().optional() }).nullish(),
48703
- locations: z92.array(SarifLocationSchema).nullish()
48773
+ var SarifResultSchema = z93.object({
48774
+ ruleId: z93.string().nullish(),
48775
+ level: z93.string().nullish(),
48776
+ message: z93.object({ text: z93.string().optional() }).nullish(),
48777
+ locations: z93.array(SarifLocationSchema).nullish()
48704
48778
  });
48705
- var SarifRuleSchema = z92.object({
48706
- id: z92.string(),
48707
- shortDescription: z92.object({ text: z92.string().optional().catch(void 0) }).optional(),
48708
- defaultConfiguration: z92.object({ level: z92.string().optional().catch(void 0) }).optional(),
48709
- properties: z92.object({
48710
- precision: z92.string().optional().catch(void 0),
48711
- tags: z92.array(z92.string()).optional().catch(void 0),
48779
+ var SarifRuleSchema = z93.object({
48780
+ id: z93.string(),
48781
+ shortDescription: z93.object({ text: z93.string().optional().catch(void 0) }).optional(),
48782
+ defaultConfiguration: z93.object({ level: z93.string().optional().catch(void 0) }).optional(),
48783
+ properties: z93.object({
48784
+ precision: z93.string().optional().catch(void 0),
48785
+ tags: z93.array(z93.string()).optional().catch(void 0),
48712
48786
  // Accept the number form and normalize; `resolveSeverityFromScore`
48713
48787
  // parses it either way.
48714
- "security-severity": z92.union([z92.string(), z92.number()]).optional().catch(void 0)
48788
+ "security-severity": z93.union([z93.string(), z93.number()]).optional().catch(void 0)
48715
48789
  }).optional().catch(void 0),
48716
- helpUri: z92.string().optional().catch(void 0),
48717
- help: z92.object({ markdown: z92.string().optional().catch(void 0) }).optional()
48790
+ helpUri: z93.string().optional().catch(void 0),
48791
+ help: z93.object({ markdown: z93.string().optional().catch(void 0) }).optional()
48718
48792
  });
48719
- var SarifRunSchema = z92.object({
48720
- tool: z92.object({
48721
- driver: z92.object({
48722
- name: z92.string().optional(),
48723
- rules: z92.array(z92.unknown()).optional()
48793
+ var SarifRunSchema = z93.object({
48794
+ tool: z93.object({
48795
+ driver: z93.object({
48796
+ name: z93.string().optional(),
48797
+ rules: z93.array(z93.unknown()).optional()
48724
48798
  }).optional()
48725
48799
  }).optional(),
48726
- results: z92.array(z92.unknown()).nullish(),
48727
- invocations: z92.array(z92.unknown()).optional()
48728
- });
48729
- var SarifNotificationSchema = z92.object({
48730
- descriptor: z92.object({ id: z92.string().optional() }).optional(),
48731
- level: z92.string().optional(),
48732
- message: z92.object({ text: z92.string().optional() }).optional()
48800
+ results: z93.array(z93.unknown()).nullish(),
48801
+ invocations: z93.array(z93.unknown()).optional()
48733
48802
  });
48734
- var SarifInvocationSchema = z92.object({
48735
- executionSuccessful: z92.boolean().optional(),
48736
- toolExecutionNotifications: z92.array(SarifNotificationSchema).optional(),
48737
- toolConfigurationNotifications: z92.array(SarifNotificationSchema).optional()
48803
+ var SarifInvocationSchema = z93.object({
48804
+ executionSuccessful: z93.boolean().optional(),
48805
+ toolExecutionNotifications: z93.array(SarifNotificationSchema).optional(),
48806
+ toolConfigurationNotifications: z93.array(SarifNotificationSchema).optional()
48738
48807
  });
48739
- var SarifLogSchema = z92.object({
48740
- version: z92.string().optional(),
48741
- runs: z92.array(z92.unknown()).optional()
48808
+ var SarifLogSchema = z93.object({
48809
+ version: z93.string().optional(),
48810
+ runs: z93.array(z93.unknown()).optional()
48742
48811
  });
48743
48812
  var UNMAPPED_LEVEL_SEVERITY = "high";
48744
48813
  var MAX_MESSAGE_LENGTH = 2e3;
@@ -48787,6 +48856,7 @@ function parseLog(log, maxFindings, errors) {
48787
48856
  if (runs === void 0 || runs.length === 0) return emptyResult("No runs in SARIF");
48788
48857
  let scanner = "unknown";
48789
48858
  const parseDiagnostics = [];
48859
+ const scannerDiagnostics = [];
48790
48860
  const findings = [];
48791
48861
  for (const [index, raw] of runs.entries()) {
48792
48862
  const parsedRun = SarifRunSchema.safeParse(raw);
@@ -48797,7 +48867,13 @@ function parseLog(log, maxFindings, errors) {
48797
48867
  const driver = describeDriver(parsedRun.data);
48798
48868
  checkRunCoverage(parsedRun.data, errors);
48799
48869
  if (index === 0) scanner = driver.scanner;
48800
- checkInvocations(parsedRun.data.invocations ?? [], errors, parseDiagnostics);
48870
+ checkInvocations(
48871
+ parsedRun.data.invocations ?? [],
48872
+ errors,
48873
+ parseDiagnostics,
48874
+ scannerDiagnostics,
48875
+ driver.scanner
48876
+ );
48801
48877
  const ruleMap = buildRuleMap(driver.rules, errors);
48802
48878
  findings.push(
48803
48879
  ...collectFindings(parsedRun.data.results ?? [], driver.scanner, ruleMap, errors)
@@ -48815,7 +48891,7 @@ function parseLog(log, maxFindings, errors) {
48815
48891
  findings: findings.slice(0, maxFindings),
48816
48892
  errors,
48817
48893
  coverageComplete: errors.length === 0,
48818
- ...parseDiagnostics.length > 0 ? { parseDiagnostics } : {}
48894
+ ...diagnosticFields(parseDiagnostics, scannerDiagnostics)
48819
48895
  };
48820
48896
  }
48821
48897
  function checkRunCoverage(run, errors) {
@@ -48826,7 +48902,7 @@ function checkRunCoverage(run, errors) {
48826
48902
  errors.push("SARIF run missing measured results");
48827
48903
  }
48828
48904
  }
48829
- function checkInvocations(invocations, errors, parseDiagnostics) {
48905
+ function checkInvocations(invocations, errors, parseDiagnostics, scannerDiagnostics, scanner) {
48830
48906
  for (const raw of invocations) {
48831
48907
  const parsed = SarifInvocationSchema.safeParse(raw);
48832
48908
  if (!parsed.success) {
@@ -48834,31 +48910,16 @@ function checkInvocations(invocations, errors, parseDiagnostics) {
48834
48910
  continue;
48835
48911
  }
48836
48912
  if (parsed.data.executionSuccessful === false) errors.push("Scanner invocation failed");
48837
- const notifications = [
48838
- ...parsed.data.toolExecutionNotifications ?? [],
48839
- ...parsed.data.toolConfigurationNotifications ?? []
48840
- ];
48841
- checkNotifications(notifications, errors, parseDiagnostics);
48842
- }
48843
- }
48844
- function checkNotifications(notifications, errors, parseDiagnostics) {
48845
- for (const notification of notifications ?? []) {
48846
- const diagnostic = parseNotification(notification);
48847
- if (diagnostic !== void 0) parseDiagnostics.push(diagnostic);
48848
- else if (notification.level !== "note" && notification.level !== "none")
48849
- errors.push(`Scanner notification: ${notification.message?.text ?? "unknown scanner error"}`);
48913
+ checkNotifications(
48914
+ parsed.data.toolExecutionNotifications,
48915
+ errors,
48916
+ parseDiagnostics,
48917
+ scannerDiagnostics,
48918
+ parsed.data.executionSuccessful === true ? scanner : "unknown"
48919
+ );
48920
+ checkConfigurationNotifications(parsed.data.toolConfigurationNotifications, errors);
48850
48921
  }
48851
48922
  }
48852
- function parseNotification(notification) {
48853
- if (!/^(?:Syntax error|Other syntax error)$/.test(notification.descriptor?.id ?? ""))
48854
- return void 0;
48855
- const message = notification.message?.text;
48856
- if (message === void 0) return void 0;
48857
- const file = /^(?:Syntax error|Other syntax error) at line (.+):(\d+):(?:\n|$| )/.exec(
48858
- message
48859
- )?.[1];
48860
- return file === void 0 ? void 0 : { file, kind: "parse", message };
48861
- }
48862
48923
  function collectFindings(results, scanner, ruleMap, errors) {
48863
48924
  const findings = [];
48864
48925
  for (const [index, raw] of results.entries()) {
@@ -49191,10 +49252,10 @@ async function executeSecurityScan(input, options = {}) {
49191
49252
  );
49192
49253
  }
49193
49254
  }
49194
- var InvocationSuccessSchema = z93.object({
49195
- runs: z93.array(
49196
- z93.object({
49197
- invocations: z93.array(z93.object({ executionSuccessful: z93.literal(true) })).min(1)
49255
+ var InvocationSuccessSchema = z94.object({
49256
+ runs: z94.array(
49257
+ z94.object({
49258
+ invocations: z94.array(z94.object({ executionSuccessful: z94.literal(true) })).min(1)
49198
49259
  })
49199
49260
  ).min(1)
49200
49261
  });
@@ -49212,11 +49273,14 @@ function scannerInvocationsSuccessful(output2) {
49212
49273
  return false;
49213
49274
  }
49214
49275
  }
49276
+ function hasFileDiagnostics(result) {
49277
+ return (result.parseDiagnostics?.length ?? 0) + (result.scannerDiagnostics?.length ?? 0) > 0;
49278
+ }
49215
49279
  function handleScanFailure(error, version, maxFindings) {
49216
49280
  const output2 = failureOutput(error);
49217
49281
  const result = output2 === void 0 ? void 0 : parseSarif(output2, maxFindings);
49218
49282
  if (result !== void 0 && output2 !== void 0 && failureCode(error) === 3) {
49219
- if (result.coverageComplete === true && (result.parseDiagnostics?.length ?? 0) > 0 && scannerInvocationsSuccessful(output2)) {
49283
+ if (result.coverageComplete === true && hasFileDiagnostics(result) && scannerInvocationsSuccessful(output2)) {
49220
49284
  return { ...result, scannerVersion: version };
49221
49285
  }
49222
49286
  }
@@ -49226,7 +49290,9 @@ function handleScanFailure(error, version, maxFindings) {
49226
49290
  }
49227
49291
  function failedOutputDetails(result) {
49228
49292
  if (result === void 0) return "";
49229
- const files = result.parseDiagnostics?.map((diagnostic) => diagnostic.file) ?? [];
49293
+ const files = [...result.parseDiagnostics ?? [], ...result.scannerDiagnostics ?? []].map(
49294
+ (diagnostic) => diagnostic.file
49295
+ );
49230
49296
  const diagnostics = files.length > 0 ? `; affected files: ${[...new Set(files)].join(", ")}` : "";
49231
49297
  const errors = result.errors.length > 0 ? `; ${result.errors.join("; ")}` : "";
49232
49298
  return diagnostics + errors;
@@ -49257,21 +49323,21 @@ function isScannerNoise(line) {
49257
49323
  // src/pipeline/dependency-gate.ts
49258
49324
  import { join as join15, resolve as resolve9 } from "node:path";
49259
49325
  import { existsSync as existsSync11, lstatSync as lstatSync2, readFileSync as readFileSync9 } from "node:fs";
49260
- import { z as z95 } from "zod";
49326
+ import { z as z96 } from "zod";
49261
49327
 
49262
49328
  // src/security/osv-lookup.ts
49263
- import { z as z94 } from "zod";
49329
+ import { z as z95 } from "zod";
49264
49330
  var logger48 = createLogger({ component: "osv-lookup" });
49265
49331
  var OSV_API_URL = "https://api.osv.dev/v1/query";
49266
49332
  var DEFAULT_TIMEOUT_MS4 = NETWORK_FETCH_TIMEOUT_MS;
49267
- var OsvVulnerabilitySchema = z94.object({
49268
- id: z94.string(),
49269
- summary: z94.string().optional(),
49270
- severity: z94.enum(["CRITICAL", "HIGH", "MODERATE", "LOW", "UNKNOWN"]).optional(),
49271
- aliases: z94.array(z94.string()).default([]),
49272
- affectedVersions: z94.string().optional(),
49273
- fixedVersion: z94.string().optional(),
49274
- url: z94.string().optional()
49333
+ var OsvVulnerabilitySchema = z95.object({
49334
+ id: z95.string(),
49335
+ summary: z95.string().optional(),
49336
+ severity: z95.enum(["CRITICAL", "HIGH", "MODERATE", "LOW", "UNKNOWN"]).optional(),
49337
+ aliases: z95.array(z95.string()).default([]),
49338
+ affectedVersions: z95.string().optional(),
49339
+ fixedVersion: z95.string().optional(),
49340
+ url: z95.string().optional()
49275
49341
  });
49276
49342
  var DEFAULT_OSV_CONFIG = {
49277
49343
  timeoutMs: DEFAULT_TIMEOUT_MS4
@@ -49365,7 +49431,7 @@ async function queryOsvBatch(packages, config = DEFAULT_OSV_CONFIG, signal) {
49365
49431
 
49366
49432
  // src/pipeline/dependency-gate.ts
49367
49433
  var logger49 = createLogger({ component: "dependency-gate" });
49368
- var MANIFEST_SCHEMA = z95.object({ dependencies: z95.record(z95.string(), z95.string()).optional() });
49434
+ var MANIFEST_SCHEMA = z96.object({ dependencies: z96.record(z96.string(), z96.string()).optional() });
49369
49435
  var OSV_EMPTY = {
49370
49436
  vulnerabilities: [],
49371
49437
  failedLookups: 0,
@@ -49488,13 +49554,14 @@ function mergeOsvChecks(previous, next) {
49488
49554
  }
49489
49555
 
49490
49556
  // src/pipeline/security-baseline.ts
49491
- import { createHash as createHash4 } from "node:crypto";
49557
+ import { createHash as createHash5 } from "node:crypto";
49492
49558
  import { mkdtemp, rm, readFile as readFile7, readlink } from "node:fs/promises";
49493
49559
  import { tmpdir as tmpdir2 } from "node:os";
49494
49560
  import { isAbsolute as isAbsolute8, join as join17 } from "node:path";
49495
49561
 
49496
49562
  // src/pipeline/security-baseline-coverage.ts
49497
- import { readFile as readFile6 } from "node:fs/promises";
49563
+ import { createHash as createHash4 } from "node:crypto";
49564
+ import { readFile as readFile6, realpath as realpath3, lstat } from "node:fs/promises";
49498
49565
  import { isAbsolute as isAbsolute7, join as join16, relative as relative6 } from "node:path";
49499
49566
  function scanErrors(scan, side) {
49500
49567
  if ("error" in scan) return [`${side}: ${scan.error}`];
@@ -49515,6 +49582,11 @@ function normalizedScan(scan, directory) {
49515
49582
  if ("error" in scan) return scan;
49516
49583
  return {
49517
49584
  ...scan,
49585
+ scannerDiagnostics: (scan.scannerDiagnostics ?? []).map((diagnostic) => ({
49586
+ ...diagnostic,
49587
+ file: isAbsolute7(diagnostic.file) ? relative6(directory, diagnostic.file) : diagnostic.file.replace(/^\.\//, ""),
49588
+ message: diagnostic.message.split(join16(directory, "/")).join("")
49589
+ })),
49518
49590
  parseDiagnostics: (scan.parseDiagnostics ?? []).map((diagnostic) => ({
49519
49591
  ...diagnostic,
49520
49592
  file: isAbsolute7(diagnostic.file) ? relative6(directory, diagnostic.file) : diagnostic.file.replace(/^\.\//, ""),
@@ -49530,42 +49602,82 @@ function ambiguousSnippet(finding) {
49530
49602
  return finding.snippet === void 0 || finding.snippet.trim() === "" || finding.snippetTruncated === true;
49531
49603
  }
49532
49604
  async function compareParseCoverage(input) {
49533
- const base = input.base.parseDiagnostics ?? [];
49534
- const worktree = input.worktree.parseDiagnostics ?? [];
49605
+ const base = coverageDiagnostics(input.base);
49606
+ const worktree = coverageDiagnostics(input.worktree);
49535
49607
  const files = [...new Set([...base, ...worktree].map((diagnostic) => diagnostic.file))].sort();
49536
49608
  const errors = [];
49537
49609
  const unscannedCoverage = [];
49610
+ if (files.length === 0) return { errors, unscannedCoverage };
49538
49611
  for (const file of files) {
49539
49612
  if (outsideTree(file)) {
49540
- errors.push(`Parse diagnostic path outside scanned tree: ${file}`);
49613
+ errors.push(`Coverage diagnostic path outside scanned tree: ${JSON.stringify(file)}`);
49541
49614
  continue;
49542
49615
  }
49543
- const identities = (diagnostics) => JSON.stringify(
49544
- diagnostics.filter((d) => d.file === file).map(({ kind, message }) => JSON.stringify([kind, message])).sort()
49545
- );
49546
- if (identities(base) !== identities(worktree)) {
49547
- errors.push(`New or changed parse diagnostics: ${file}`);
49616
+ if (diagnosticIdentities(base, file) !== diagnosticIdentities(worktree, file)) {
49617
+ errors.push(`New or changed coverage diagnostics: ${file}`);
49548
49618
  continue;
49549
49619
  }
49550
49620
  try {
49551
- const [oldBytes, newBytes, diff] = await Promise.all([
49552
- readFile6(join16(input.baseDirectory, file)),
49553
- readFile6(join16(input.target, file)),
49554
- input.diff(file)
49555
- ]);
49556
- if (!oldBytes.equals(newBytes) || diff !== "") {
49557
- errors.push(`Change touches partially parsed file: ${file}`);
49558
- } else unscannedCoverage.push(file);
49621
+ if (!await unchangedFile(input, file)) {
49622
+ errors.push(`Change touches unscanned file: ${file}`);
49623
+ } else {
49624
+ unscannedCoverage.push(describeUnscanned(file, worktree));
49625
+ }
49559
49626
  } catch (error) {
49560
49627
  errors.push(
49561
- `Cannot verify partially parsed file ${file}: ${error instanceof Error ? error.message : String(error)}`
49628
+ `Cannot verify unscanned file ${file}: ${error instanceof Error ? error.message : String(error)}`
49562
49629
  );
49563
49630
  }
49564
49631
  }
49565
49632
  return { errors, unscannedCoverage };
49566
49633
  }
49634
+ function coverageDiagnostics(scan) {
49635
+ return [...scan.parseDiagnostics ?? [], ...scan.scannerDiagnostics ?? []];
49636
+ }
49637
+ function diagnosticIdentities(diagnostics, file) {
49638
+ return JSON.stringify(
49639
+ diagnostics.filter((d) => d.file === file).map(
49640
+ (d) => JSON.stringify("scanner" in d ? [d.scanner, d.kind, d.rule] : [d.kind, d.message])
49641
+ ).sort()
49642
+ );
49643
+ }
49644
+ function describeUnscanned(file, diagnostics) {
49645
+ const failures = diagnostics.filter((d) => d.file === file && "scanner" in d);
49646
+ if (failures.length === 0) return file;
49647
+ return `${file}: ${failures.map(
49648
+ (d) => "scanner" in d ? `${d.scanner} ${d.rule ?? "(no rule)"} (${d.kind}): ${d.message}` : ""
49649
+ ).join("; ")}`;
49650
+ }
49651
+ async function unchangedFile(input, file) {
49652
+ const [oldPath, newPath, entry, diff] = await Promise.all([
49653
+ confinedFile(input.baseDirectory, file),
49654
+ confinedFile(input.target, file),
49655
+ input.pinnedEntry(file),
49656
+ input.diff(file)
49657
+ ]);
49658
+ const match = /^(100644|100755) blob ([a-f0-9]{40}|[a-f0-9]{64})\t([^\0]+)\0$/.exec(entry);
49659
+ if (match?.[3] !== file || diff !== "") return false;
49660
+ const [oldBytes, newBytes, oldStat, newStat] = await Promise.all([
49661
+ readFile6(oldPath),
49662
+ readFile6(newPath),
49663
+ lstat(oldPath),
49664
+ lstat(newPath)
49665
+ ]);
49666
+ const mode = (stat5) => (stat5.mode & 73) === 0 ? "100644" : "100755";
49667
+ const hash = match[2];
49668
+ if (hash === void 0 || !oldStat.isFile() || !newStat.isFile()) return false;
49669
+ const digest = (bytes2) => createHash4(hash.length === 64 ? "sha256" : "sha1").update(`blob ${String(bytes2.length)}\0`).update(bytes2).digest("hex");
49670
+ return mode(oldStat) === match[1] && mode(newStat) === match[1] && digest(oldBytes) === hash && digest(newBytes) === hash;
49671
+ }
49672
+ async function confinedFile(root, file) {
49673
+ const path9 = join16(root, file);
49674
+ const [canonicalRoot, canonicalPath] = await Promise.all([realpath3(root), realpath3(path9)]);
49675
+ if (relative6(canonicalRoot, canonicalPath) !== file || !(await lstat(path9)).isFile())
49676
+ throw new Error(`Unverifiable file path: ${file}`);
49677
+ return path9;
49678
+ }
49567
49679
  function outsideTree(file) {
49568
- return isAbsolute7(file) || file.split("/").includes("..") || /^[a-z]+:/i.test(file);
49680
+ return file === "" || hasControlCharacter(file) || file.includes("\\") || isAbsolute7(file) || file.split("/").includes("..") || /^[a-z]+:/i.test(file);
49569
49681
  }
49570
49682
 
49571
49683
  // src/pipeline/security-baseline.ts
@@ -49689,6 +49801,7 @@ async function assessComparison(input) {
49689
49801
  worktree,
49690
49802
  baseDirectory: input.baseDirectory,
49691
49803
  target,
49804
+ pinnedEntry: async (file) => git2(target, ["ls-tree", "-z", sha, "--", file]),
49692
49805
  diff: async (file) => git2(target, [
49693
49806
  "diff",
49694
49807
  "--text",
@@ -49722,7 +49835,7 @@ async function verifyArchive(directory, tree) {
49722
49835
  for (const entry of tree.split("\0").filter((record) => record !== "")) {
49723
49836
  const { mode, hash, file } = parseTreeEntry(entry);
49724
49837
  const contents = mode === "120000" ? Buffer.from(await readlink(join17(directory, file))) : await readFile7(join17(directory, file));
49725
- const digest = createHash4(hash.length === 64 ? "sha256" : "sha1").update(`blob ${String(contents.length)}\0`).update(contents).digest("hex");
49838
+ const digest = createHash5(hash.length === 64 ? "sha256" : "sha1").update(`blob ${String(contents.length)}\0`).update(contents).digest("hex");
49726
49839
  if (digest !== hash) throw new Error(`Pinned archive content differs: ${file}`);
49727
49840
  }
49728
49841
  }
@@ -49852,11 +49965,12 @@ function checkSecurityScan(targetDir, rulesets = ["p/default"], config = {}) {
49852
49965
  signal
49853
49966
  );
49854
49967
  if (gateResult.verdict === "fail") return gateResult;
49855
- if (result.parseDiagnostics !== void 0 && result.parseDiagnostics.length > 0) {
49968
+ const gaps = [...result.parseDiagnostics ?? [], ...result.scannerDiagnostics ?? []];
49969
+ if (gaps.length > 0) {
49856
49970
  return {
49857
49971
  ...gateResult,
49858
49972
  verdict: "skip",
49859
- details: `Security scan incomplete: unparsed files ${result.parseDiagnostics.map((d) => d.file).join(", ")}`,
49973
+ details: `Security scan incomplete: unscanned files ${gaps.map((d) => d.file).join(", ")}`,
49860
49974
  durationMs: Date.now() - start
49861
49975
  };
49862
49976
  }
@@ -49869,16 +49983,14 @@ async function runBaselineGate(target, rulesets, config, signal) {
49869
49983
  const osv = await runOsvCheck(config.dependencyTarget ?? target, config, signal);
49870
49984
  throwIfAborted(signal, "Security baseline scan aborted");
49871
49985
  const osvFailed = blocksDependencyCheck(osv);
49986
+ const scanNote = unscannedNote(comparison);
49872
49987
  const details = comparison.complete ? `Base ${String(comparison.baseCount)}, worktree ${String(comparison.worktreeCount)} findings; ${String(comparison.introducedBlockingCount)} introduced blocking; ${buildScanSummary(comparison.worktreeCount ?? 0, comparison.introducedBlockingCount ?? 0, osv.vulnerabilities.length, osv)}` : `Dependency check: ${buildScanSummary(null, 0, osv.vulnerabilities.length, osv)}; Security comparison incomplete: ${comparison.errors.join("; ")}`;
49873
49988
  return {
49874
49989
  name: "security_scan",
49875
49990
  verdict: osvFailed ? "fail" : !comparison.complete ? "skip" : comparison.introducedBlockingCount === 0 ? "pass" : "fail",
49876
- details: (osv.manifestError === void 0 ? details : `${osv.manifestError}; ${details}`).slice(
49877
- 0,
49878
- 500
49879
- ),
49991
+ details: `${(osv.manifestError === void 0 ? details : `${osv.manifestError}; ${details}`).slice(0, 500)}${scanNote === void 0 ? "" : `; ${scanNote}`}`,
49880
49992
  comparison,
49881
- ...coverageNoteField(osv),
49993
+ ...combinedCoverageNote(osv, scanNote),
49882
49994
  durationMs: Date.now() - start
49883
49995
  };
49884
49996
  }
@@ -49937,6 +50049,25 @@ function coverageNoteField(osv) {
49937
50049
  if (osv.declared > osv.queried) gaps.push(cappedCoverageNote(osv));
49938
50050
  return gaps.length === 0 ? {} : { coverageNote: `Dependency coverage partial: ${gaps.join("; ")}` };
49939
50051
  }
50052
+ var UNSCANNED_ENTRY_MAX_CHARS = 200;
50053
+ var UNSCANNED_NOTE_MAX_CHARS = 500;
50054
+ function boundedUnscannedEntry(entry) {
50055
+ const flat = stripControlCharacters(entry).trim();
50056
+ return flat.length <= UNSCANNED_ENTRY_MAX_CHARS ? flat : `${flat.slice(0, UNSCANNED_ENTRY_MAX_CHARS)}\u2026`;
50057
+ }
50058
+ function unscannedNote(comparison) {
50059
+ const unscanned = comparison.unscannedCoverage ?? [];
50060
+ if (unscanned.length === 0) return void 0;
50061
+ const note = `SAST coverage partial; unscanned: ${unscanned.map(boundedUnscannedEntry).join("; ")}`;
50062
+ if (note.length <= UNSCANNED_NOTE_MAX_CHARS) return note;
50063
+ const suffix = `\u2026 (${String(unscanned.length)} unscanned entries; truncated)`;
50064
+ return `${note.slice(0, UNSCANNED_NOTE_MAX_CHARS - suffix.length)}${suffix}`;
50065
+ }
50066
+ function combinedCoverageNote(osv, scanNote) {
50067
+ const dependencyNote = coverageNoteField(osv).coverageNote;
50068
+ const notes = [dependencyNote, scanNote].filter((note) => note !== void 0);
50069
+ return notes.length === 0 ? {} : { coverageNote: notes.join("; ") };
50070
+ }
49940
50071
  function buildScanSummary(total, blocking2, osvCount, osv, sarifParseErrors = 0) {
49941
50072
  const parts = total === null ? [] : [`${String(total)} SAST findings`];
49942
50073
  if (sarifParseErrors > 0) {
@@ -51208,7 +51339,7 @@ ${FINDINGS_FORMAT_INSTRUCTIONS}
51208
51339
  }
51209
51340
 
51210
51341
  // src/mcp/tools/pr-review-tool.ts
51211
- import { z as z96 } from "zod";
51342
+ import { z as z97 } from "zod";
51212
51343
  import { randomUUID as randomUUID14 } from "node:crypto";
51213
51344
 
51214
51345
  // src/audit/reviewed-diff-hash.ts
@@ -51759,19 +51890,19 @@ var MAX_REPO_CONTEXT_LENGTH = 2e3;
51759
51890
  var MAX_TITLE_LENGTH = 500;
51760
51891
  var MAX_DESCRIPTION_LENGTH = 1e4;
51761
51892
  var PR_REVIEW_ASYNC_HINT = "A pr_review run fans out to 5 live LLM voters and can exceed the synchronous MCP request timeout. Retry with `dispatch: 'async'` to get a jobId immediately, then poll get_job_result({ jobId }) for the result.";
51762
- var PrReviewInputSchema = z96.object({
51763
- prTitle: z96.string().min(1).max(MAX_TITLE_LENGTH).describe("PR title"),
51764
- prDescription: z96.string().max(MAX_DESCRIPTION_LENGTH).optional().describe("PR body / description"),
51765
- prDiff: z96.string().min(1).max(MAX_DIFF_INPUT_LENGTH).refine(looksLikeUnifiedDiff, {
51893
+ var PrReviewInputSchema = z97.object({
51894
+ prTitle: z97.string().min(1).max(MAX_TITLE_LENGTH).describe("PR title"),
51895
+ prDescription: z97.string().max(MAX_DESCRIPTION_LENGTH).optional().describe("PR body / description"),
51896
+ prDiff: z97.string().min(1).max(MAX_DIFF_INPUT_LENGTH).refine(looksLikeUnifiedDiff, {
51766
51897
  message: "prDiff must be a unified diff (expected a `diff --git`, `---`/`+++`, or `@@ \u2026 @@` line). Prose descriptions of a change are rejected: a review of a summary is not a review of the code, and would be recorded as though it were (#4451)."
51767
51898
  }).describe(
51768
51899
  `Unified diff text (max ${String(MAX_DIFF_INPUT_LENGTH)} chars). REQUIRED SHAPE (#4451): must contain a \`diff --git\` header, an \`@@ \u2026 @@\` hunk header backed by +/- lines, or a \`---\`/\`+++\` header pair \u2014 a prose summary of the change is REJECTED, because reviewing a summary is not reviewing the code and would be recorded as though it were. (Stated here because Zod refinements do not survive JSON-schema generation, so this constraint is otherwise invisible to clients.) No need to truncate before calling: the panel reads the whole diff whenever it fits the voters' context windows (#6003); a diff larger than that is security-prioritized and PARTIALLY reviewed (lowest-priority whole files dropped; a partial panel read can block but never verified-approve). Separately, the audit record's hash binds only the first ${String(MAX_DIFF_LENGTH)} UTF-8 bytes; the response \`coverage\` and the record summary state both what the panel read and what the hash binds.`
51769
51900
  ),
51770
- repoContext: z96.string().max(MAX_REPO_CONTEXT_LENGTH).optional().describe(
51901
+ repoContext: z97.string().max(MAX_REPO_CONTEXT_LENGTH).optional().describe(
51771
51902
  `Optional one-paragraph repo context (architecture, conventions; max ${String(MAX_REPO_CONTEXT_LENGTH)} chars; trim before calling)`
51772
51903
  ),
51773
- baseRef: z96.string().max(200).optional().describe("Base branch ref (e.g. main)"),
51774
- headRef: z96.string().max(200).optional().describe("Head branch ref"),
51904
+ baseRef: z97.string().max(200).optional().describe("Base branch ref (e.g. main)"),
51905
+ headRef: z97.string().max(200).optional().describe("Head branch ref"),
51775
51906
  /**
51776
51907
  * Option-C audit binding (#4031). When BOTH `prNumber` and `baseSha` are
51777
51908
  * supplied AND the review is live (not simulated), pr_review persists an
@@ -51787,14 +51918,14 @@ var PrReviewInputSchema = z96.object({
51787
51918
  * the PR opened and drifts as main advances), so pass the merge-base as
51788
51919
  * `baseSha` or the record will not match on an aged branch (#5692).
51789
51920
  */
51790
- prNumber: z96.number().int().positive().optional().describe("PR number \u2014 with baseSha, enables Option-C audit-record persistence (#4031)"),
51791
- baseSha: z96.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha").optional().describe(
51921
+ prNumber: z97.number().int().positive().optional().describe("PR number \u2014 with baseSha, enables Option-C audit-record persistence (#4031)"),
51922
+ baseSha: z97.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha").optional().describe(
51792
51923
  "40-hex base commit sha the reviewed diff was computed from \u2014 pass `git merge-base origin/<base> <head>`, the base the gate recomputes (Option-C binding, #4031, #5692)"
51793
51924
  ),
51794
- repoPath: z96.string().max(1024).optional().describe(
51925
+ repoPath: z97.string().max(1024).optional().describe(
51795
51926
  "Repo root path for persisting the governance pr-review record (overrides cwd auto-detection). Must contain a .git ancestor \u2014 relative paths are resolved against cwd; ignored (falls back to cwd auto-detection) if it is not a real repo root. Env NEXUS_PR_REVIEW_RECORDS_PATH still takes precedence and is unrestricted."
51796
51927
  ),
51797
- simulate: z96.boolean().default(false).describe("Use simulated voters (testing only; never ship live with this true)"),
51928
+ simulate: z97.boolean().default(false).describe("Use simulated voters (testing only; never ship live with this true)"),
51798
51929
  /**
51799
51930
  * Error policy (#4132). `standard` (default) excludes absent voters but
51800
51931
  * requires a majority of the requested panel to approve. `absolute_quorum` gates
@@ -51806,7 +51937,7 @@ var PrReviewInputSchema = z96.object({
51806
51937
  * verified approve. A genuine `request_changes` blocker still wins (Tiers 1-2
51807
51938
  * run first).
51808
51939
  */
51809
- errorPolicy: z96.enum(["standard", "absolute_quorum"]).default("standard").describe(
51940
+ errorPolicy: z97.enum(["standard", "absolute_quorum"]).default("standard").describe(
51810
51941
  "Error policy (#4132). 'standard' (default): absent voters excluded; approval requires a majority of the requested panel. 'absolute_quorum': any errored voter \u2014 esp. the contrarian \u2014 degrades a would-be approve to a recoverable abstain (verified:false); never manufactures a verified approve from an induced error."
51811
51942
  ),
51812
51943
  // #6123: same field as consensus_vote — the panel judges the caller's project.
@@ -52162,27 +52293,27 @@ function absoluteQuorumApprove(reviews, valid) {
52162
52293
  }
52163
52294
 
52164
52295
  // src/mcp/tools/survey-oss-landscape.ts
52165
- import { z as z97 } from "zod";
52166
- var SurveyOssLandscapeInputSchema = z97.object({
52167
- query: z97.string().min(1).max(200).describe('Free-text search query, e.g. "cargo nextest replacement" or "OSS SBOM tools"'),
52168
- maxResults: z97.number().int().min(1).max(50).optional().default(10).describe("Maximum candidates to return (1-50; default 10)"),
52169
- minStars: z97.number().int().min(0).optional().default(0).describe("Minimum star count to include (default 0; useful for filtering noise)"),
52170
- language: z97.string().max(50).optional().describe('GitHub language filter, e.g. "rust" or "typescript"')
52296
+ import { z as z98 } from "zod";
52297
+ var SurveyOssLandscapeInputSchema = z98.object({
52298
+ query: z98.string().min(1).max(200).describe('Free-text search query, e.g. "cargo nextest replacement" or "OSS SBOM tools"'),
52299
+ maxResults: z98.number().int().min(1).max(50).optional().default(10).describe("Maximum candidates to return (1-50; default 10)"),
52300
+ minStars: z98.number().int().min(0).optional().default(0).describe("Minimum star count to include (default 0; useful for filtering noise)"),
52301
+ language: z98.string().max(50).optional().describe('GitHub language filter, e.g. "rust" or "typescript"')
52171
52302
  });
52172
- var GitHubRepoSchema = z97.object({
52173
- full_name: z97.string().optional(),
52174
- html_url: z97.string().optional(),
52175
- description: z97.string().nullable().optional(),
52176
- stargazers_count: z97.number().optional(),
52177
- pushed_at: z97.string().nullable().optional(),
52178
- language: z97.string().nullable().optional(),
52179
- license: z97.object({
52180
- spdx_id: z97.string().nullable().optional()
52303
+ var GitHubRepoSchema = z98.object({
52304
+ full_name: z98.string().optional(),
52305
+ html_url: z98.string().optional(),
52306
+ description: z98.string().nullable().optional(),
52307
+ stargazers_count: z98.number().optional(),
52308
+ pushed_at: z98.string().nullable().optional(),
52309
+ language: z98.string().nullable().optional(),
52310
+ license: z98.object({
52311
+ spdx_id: z98.string().nullable().optional()
52181
52312
  }).nullable().optional()
52182
52313
  });
52183
- var GitHubSearchResponseSchema = z97.object({
52184
- total_count: z97.number().optional(),
52185
- items: z97.array(GitHubRepoSchema).optional()
52314
+ var GitHubSearchResponseSchema = z98.object({
52315
+ total_count: z98.number().optional(),
52316
+ items: z98.array(GitHubRepoSchema).optional()
52186
52317
  });
52187
52318
  var GITHUB_SEARCH_BASE = "https://api.github.com/search/repositories";
52188
52319
  function buildGithubQuery(input) {
@@ -52304,16 +52435,16 @@ function createSurveyHandler(deps) {
52304
52435
  });
52305
52436
  return withToolError("Survey failed", logger59, async () => {
52306
52437
  const result = await executeSurvey(validation.data, logger59);
52307
- return structuredToolSuccess(z97.object(SURVEY_OUTPUT_SCHEMA), result);
52438
+ return structuredToolSuccess(z98.object(SURVEY_OUTPUT_SCHEMA), result);
52308
52439
  });
52309
52440
  };
52310
52441
  }
52311
52442
  var SURVEY_OUTPUT_SCHEMA = {
52312
- query: z97.string(),
52313
- totalFound: z97.number(),
52314
- candidates: z97.array(z97.unknown()),
52315
- sourcesQueried: z97.array(z97.string()),
52316
- sourcesFailed: z97.array(z97.string())
52443
+ query: z98.string(),
52444
+ totalFound: z98.number(),
52445
+ candidates: z98.array(z98.unknown()),
52446
+ sourcesQueried: z98.array(z98.string()),
52447
+ sourcesFailed: z98.array(z98.string())
52317
52448
  };
52318
52449
  var SURVEY_DESCRIPTION = 'Transient OSS project search. Returns a ranked list of GitHub repositories with license, last-commit, star-count, and one-line description. Does NOT persist to the research registry \u2014 use `research_add_source` for that. Best for one-off engineering decisions like "what tools exist in this space?".';
52319
52450
  function registerSurveyOssLandscapeTool(server, deps) {
@@ -52343,7 +52474,7 @@ function registerSurveyOssLandscapeTool(server, deps) {
52343
52474
  }
52344
52475
 
52345
52476
  // src/mcp/tools/vendor-publishing-audit.ts
52346
- import { z as z98 } from "zod";
52477
+ import { z as z99 } from "zod";
52347
52478
 
52348
52479
  // src/mcp/tools/vendor-publishing-seed.ts
52349
52480
  var VENDOR_PUBLISHING_SEED = {
@@ -52416,8 +52547,8 @@ function listKnownVendors() {
52416
52547
  }
52417
52548
 
52418
52549
  // src/mcp/tools/vendor-publishing-audit.ts
52419
- var VendorPublishingAuditInputSchema = z98.object({
52420
- vendor: z98.string().min(1).max(50).toLowerCase().describe('Vendor identifier, lowercase. e.g. "ubuntu", "debian", "fedora"')
52550
+ var VendorPublishingAuditInputSchema = z99.object({
52551
+ vendor: z99.string().min(1).max(50).toLowerCase().describe('Vendor identifier, lowercase. e.g. "ubuntu", "debian", "fedora"')
52421
52552
  });
52422
52553
  function lookupVendor(vendor) {
52423
52554
  if (isKnownVendor(vendor)) {
@@ -52445,26 +52576,26 @@ function createVendorPublishingAuditHandler(deps) {
52445
52576
  return withToolError("Vendor publishing audit failed", logger59, () => {
52446
52577
  const result = lookupVendor(validation.data.vendor);
52447
52578
  return Promise.resolve(
52448
- structuredToolSuccess(z98.object(VENDOR_PUBLISHING_OUTPUT_SCHEMA), result)
52579
+ structuredToolSuccess(z99.object(VENDOR_PUBLISHING_OUTPUT_SCHEMA), result)
52449
52580
  );
52450
52581
  });
52451
52582
  };
52452
52583
  }
52453
52584
  var VENDOR_PUBLISHING_OUTPUT_SCHEMA = {
52454
- vendor: z98.string(),
52455
- known: z98.boolean(),
52585
+ vendor: z99.string(),
52586
+ known: z99.boolean(),
52456
52587
  // Fields below populate when known=true; permissive optional for known=false.
52457
- sha256SumsUrlPattern: z98.string().optional(),
52458
- sha256SumsSignatureUrlPattern: z98.string().optional(),
52459
- signaturePattern: z98.string().optional(),
52460
- gpgKeys: z98.array(z98.unknown()).optional(),
52461
- releaseCadence: z98.string().optional(),
52462
- keyRotationNotes: z98.string().optional(),
52463
- vendorDocUrl: z98.string().optional(),
52464
- citedAt: z98.string().optional(),
52588
+ sha256SumsUrlPattern: z99.string().optional(),
52589
+ sha256SumsSignatureUrlPattern: z99.string().optional(),
52590
+ signaturePattern: z99.string().optional(),
52591
+ gpgKeys: z99.array(z99.unknown()).optional(),
52592
+ releaseCadence: z99.string().optional(),
52593
+ keyRotationNotes: z99.string().optional(),
52594
+ vendorDocUrl: z99.string().optional(),
52595
+ citedAt: z99.string().optional(),
52465
52596
  // Fields below populate when known=false.
52466
- message: z98.string().optional(),
52467
- knownVendors: z98.array(z98.string()).optional()
52597
+ message: z99.string().optional(),
52598
+ knownVendors: z99.array(z99.string()).optional()
52468
52599
  };
52469
52600
  var VENDOR_PUBLISHING_DESCRIPTION = "Look up a vendor's published-artifact signing infrastructure: GPG key fingerprints, SHA256SUMS URL pattern, signature shape (clearsigned / detached / detached-on-iso), release cadence, key rotation notes, and the vendor doc citation. Static lookup against a curated seed dataset; the vendor doc URL is the authoritative source. Returns `{known: false, knownVendors: [...]}` for vendors without a seed entry. v1 covers ubuntu, debian, fedora.";
52470
52601
  function registerVendorPublishingAuditTool(server, deps) {
@@ -52494,17 +52625,17 @@ function registerVendorPublishingAuditTool(server, deps) {
52494
52625
  }
52495
52626
 
52496
52627
  // src/mcp/tools/compare-data-feeds.ts
52497
- import { z as z99 } from "zod";
52628
+ import { z as z100 } from "zod";
52498
52629
  import * as path6 from "node:path";
52499
52630
  import * as fs7 from "node:fs";
52500
52631
  import * as yaml3 from "yaml";
52501
- var CompareDataFeedsInputSchema = z99.object({
52502
- feedAPath: z99.string().min(1).max(1e3).describe("Filesystem path to feed A (YAML or JSON, auto-detected by extension)"),
52503
- feedBPath: z99.string().min(1).max(1e3).describe("Filesystem path to feed B"),
52504
- keyPath: z99.string().min(1).max(200).describe(
52632
+ var CompareDataFeedsInputSchema = z100.object({
52633
+ feedAPath: z100.string().min(1).max(1e3).describe("Filesystem path to feed A (YAML or JSON, auto-detected by extension)"),
52634
+ feedBPath: z100.string().min(1).max(1e3).describe("Filesystem path to feed B"),
52635
+ keyPath: z100.string().min(1).max(200).describe(
52505
52636
  'Dotted path to the entry key, e.g. "id" or "name". Each entry must have this field.'
52506
52637
  ),
52507
- compareFields: z99.array(z99.string().min(1).max(200)).max(20).optional().describe(
52638
+ compareFields: z100.array(z100.string().min(1).max(200)).max(20).optional().describe(
52508
52639
  'Optional dotted field paths to compare across matched entries (e.g. ["license", "sha256"])'
52509
52640
  )
52510
52641
  });
@@ -52682,29 +52813,29 @@ function createCompareDataFeedsHandler(deps) {
52682
52813
  });
52683
52814
  return withToolError("Compare data feeds failed", logger59, () => {
52684
52815
  const result = executeCompare(validation.data);
52685
- return Promise.resolve(structuredToolSuccess(z99.object(COMPARE_OUTPUT_SCHEMA), result));
52816
+ return Promise.resolve(structuredToolSuccess(z100.object(COMPARE_OUTPUT_SCHEMA), result));
52686
52817
  });
52687
52818
  };
52688
52819
  }
52689
52820
  var COMPARE_OUTPUT_SCHEMA = {
52690
- feedAPath: z99.string(),
52691
- feedBPath: z99.string(),
52692
- keyPath: z99.string(),
52693
- counts: z99.object({
52694
- entriesInA: z99.number(),
52695
- entriesInB: z99.number(),
52696
- onlyInA: z99.number(),
52697
- onlyInB: z99.number(),
52698
- inBoth: z99.number(),
52699
- fieldDifferences: z99.number()
52821
+ feedAPath: z100.string(),
52822
+ feedBPath: z100.string(),
52823
+ keyPath: z100.string(),
52824
+ counts: z100.object({
52825
+ entriesInA: z100.number(),
52826
+ entriesInB: z100.number(),
52827
+ onlyInA: z100.number(),
52828
+ onlyInB: z100.number(),
52829
+ inBoth: z100.number(),
52830
+ fieldDifferences: z100.number()
52700
52831
  }),
52701
- coverage: z99.object({
52702
- onlyInA: z99.array(z99.string()),
52703
- onlyInB: z99.array(z99.string()),
52704
- inBoth: z99.array(z99.string())
52832
+ coverage: z100.object({
52833
+ onlyInA: z100.array(z100.string()),
52834
+ onlyInB: z100.array(z100.string()),
52835
+ inBoth: z100.array(z100.string())
52705
52836
  }),
52706
- fieldDifferences: z99.array(z99.unknown()),
52707
- summary: z99.string()
52837
+ fieldDifferences: z100.array(z100.unknown()),
52838
+ summary: z100.string()
52708
52839
  };
52709
52840
  var COMPARE_DESCRIPTION = "Diff two upstream data feeds (YAML or JSON files) along coverage and per-field axes. Returns which entries exist in A, B, both, plus optional field-level diffs across matched entries. v1 takes file paths only (no URL fetch \u2014 that needs an SSRF design pass). Both feeds must be a top-level array OR a top-level object with exactly one array field.";
52710
52841
  function registerCompareDataFeedsTool(server, deps) {
@@ -52734,9 +52865,9 @@ function registerCompareDataFeedsTool(server, deps) {
52734
52865
  }
52735
52866
 
52736
52867
  // src/mcp/tools/query-task-state-tool.ts
52737
- import { z as z100 } from "zod";
52738
- var QueryTaskStateInputSchema = z100.object({
52739
- taskId: z100.string().min(1).max(128).describe("Task ID whose structured state log should be read")
52868
+ import { z as z101 } from "zod";
52869
+ var QueryTaskStateInputSchema = z101.object({
52870
+ taskId: z101.string().min(1).max(128).describe("Task ID whose structured state log should be read")
52740
52871
  });
52741
52872
  function queryTaskStateHandler(args, ctx) {
52742
52873
  const parsed = QueryTaskStateInputSchema.safeParse(args);
@@ -52771,7 +52902,7 @@ function queryTaskStateHandler(args, ctx) {
52771
52902
  function registerQueryTaskStateTool(server, deps) {
52772
52903
  const logger59 = deps.logger ?? createLogger({ tool: "query_task_state" });
52773
52904
  const toolSchema = {
52774
- taskId: z100.string().min(1).max(128).describe("Task ID whose structured state log should be read")
52905
+ taskId: z101.string().min(1).max(128).describe("Task ID whose structured state log should be read")
52775
52906
  };
52776
52907
  const description = "Read the structured state log for a task ID and return the current snapshot. Includes Magentic-One Task Ledger (facts/guesses/openQuestions) and Progress Ledger (per-step reflections with suggestedAction) when orchestrators have written them. Structured state is only written when NEXUS_TASK_STATE_ENABLED=1 was set during the orchestrate invocation.";
52777
52908
  const secureHandler = createSecureHandler(queryTaskStateHandler, {
@@ -52793,28 +52924,28 @@ function registerQueryTaskStateTool(server, deps) {
52793
52924
  }
52794
52925
 
52795
52926
  // src/mcp/tools/ci-health-check-tool.ts
52796
- import { z as z103 } from "zod";
52927
+ import { z as z104 } from "zod";
52797
52928
 
52798
52929
  // src/mcp/tools/ci-health-log.ts
52799
52930
  import { appendFileSync as appendFileSync5, existsSync as existsSync14, readFileSync as readFileSync12, statSync as statSync2, writeFileSync as writeFileSync3 } from "node:fs";
52800
- import { z as z102 } from "zod";
52931
+ import { z as z103 } from "zod";
52801
52932
 
52802
52933
  // src/mcp/tools/ci-health-types.ts
52803
- import { z as z101 } from "zod";
52804
- var CiHealthStatusSchema = z101.enum(["healthy", "degraded", "outage", "unknown"]);
52934
+ import { z as z102 } from "zod";
52935
+ var CiHealthStatusSchema = z102.enum(["healthy", "degraded", "outage", "unknown"]);
52805
52936
 
52806
52937
  // src/mcp/tools/ci-health-log.ts
52807
52938
  var logger53 = createLogger({ component: "ci-health-log" });
52808
- var CiHealthEventSchema = z102.object({
52809
- v: z102.literal(1),
52810
- ts: z102.iso.datetime(),
52939
+ var CiHealthEventSchema = z103.object({
52940
+ v: z103.literal(1),
52941
+ ts: z103.iso.datetime(),
52811
52942
  status: CiHealthStatusSchema,
52812
- repo: z102.string().optional(),
52813
- signals: z102.array(
52814
- z102.object({
52815
- source: z102.enum(["github-status", "repo-activity-window"]),
52943
+ repo: z103.string().optional(),
52944
+ signals: z103.array(
52945
+ z103.object({
52946
+ source: z103.enum(["github-status", "repo-activity-window"]),
52816
52947
  status: CiHealthStatusSchema,
52817
- evidence: z102.string()
52948
+ evidence: z103.string()
52818
52949
  })
52819
52950
  )
52820
52951
  });
@@ -52894,17 +53025,17 @@ function eventFromCheck(params) {
52894
53025
  }
52895
53026
 
52896
53027
  // src/mcp/tools/ci-health-check-tool.ts
52897
- var CiHealthCheckInputSchema = z103.object({
53028
+ var CiHealthCheckInputSchema = z104.object({
52898
53029
  /**
52899
53030
  * Repo to check for the recent-runs activity signal (in `owner/repo` form).
52900
53031
  * Optional — when omitted, only the status-page signal is consulted.
52901
53032
  */
52902
- repo: z103.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/, "Must be owner/repo form").optional().describe("GitHub repo (owner/repo) to check for recent CI activity. Optional."),
53033
+ repo: z104.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/, "Must be owner/repo form").optional().describe("GitHub repo (owner/repo) to check for recent CI activity. Optional."),
52903
53034
  /**
52904
53035
  * How far back to look for recent-runs activity (minutes). Default 30 —
52905
53036
  * matches the typical wedge-detection window from the #3070 / #3076 outages.
52906
53037
  */
52907
- activityWindowMinutes: z103.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
53038
+ activityWindowMinutes: z104.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
52908
53039
  });
52909
53040
  var STATUS_PAGE_URL = "https://www.githubstatus.com/api/v2/components.json";
52910
53041
  function mapStatusPageStatus(raw) {
@@ -53063,8 +53194,8 @@ var DESCRIPTION = "Check CI infrastructure health before triggering / polling ru
53063
53194
  function registerCiHealthCheckTool(server, deps) {
53064
53195
  const logger59 = deps.logger ?? createLogger({ tool: "ci_health_check" });
53065
53196
  const toolSchema = {
53066
- repo: z103.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/, "Must be owner/repo form").optional().describe("GitHub repo (owner/repo) to check for recent CI activity. Optional."),
53067
- activityWindowMinutes: z103.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
53197
+ repo: z104.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/, "Must be owner/repo form").optional().describe("GitHub repo (owner/repo) to check for recent CI activity. Optional."),
53198
+ activityWindowMinutes: z104.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
53068
53199
  };
53069
53200
  const secureHandler = createSecureHandler((args) => ciHealthCheckHandler(args, logger59), {
53070
53201
  toolName: "ci_health_check",
@@ -53090,18 +53221,18 @@ function registerCiHealthCheckTool(server, deps) {
53090
53221
 
53091
53222
  // src/mcp/tools/quality-gate-tool.ts
53092
53223
  import { statSync as statSync3 } from "node:fs";
53093
- import { z as z104 } from "zod";
53094
- var QualityCheckSchema = z104.enum(["typecheck", "lint", "tests", "build", "security"]);
53224
+ import { z as z105 } from "zod";
53225
+ var QualityCheckSchema = z105.enum(["typecheck", "lint", "tests", "build", "security"]);
53095
53226
  var DEFAULT_CHECKS = ["typecheck", "lint", "tests"];
53096
- var RunQualityGateInputSchema = z104.object({
53227
+ var RunQualityGateInputSchema = z105.object({
53097
53228
  /** Project directory to run checks against. Must resolve inside the repo/cwd root. */
53098
- projectDir: z104.string().optional().describe(
53229
+ projectDir: z105.string().optional().describe(
53099
53230
  "Project directory to run checks against (default: cwd). Must stay inside the repo root."
53100
53231
  ),
53101
53232
  /** Which allowlisted checks to run. */
53102
- checks: z104.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
53233
+ checks: z105.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
53103
53234
  /** 1-based iteration counter, forwarded to the engine for feedback context. */
53104
- iteration: z104.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
53235
+ iteration: z105.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
53105
53236
  });
53106
53237
  function validateProjectDir(raw) {
53107
53238
  const candidate = raw ?? process.cwd();
@@ -53176,11 +53307,11 @@ var DESCRIPTION2 = "Run the QA quality gate (#1684 engine) against a project dir
53176
53307
  function registerRunQualityGateTool(server, deps) {
53177
53308
  const logger59 = deps.logger ?? createLogger({ tool: "run_quality_gate" });
53178
53309
  const toolSchema = {
53179
- projectDir: z104.string().optional().describe(
53310
+ projectDir: z105.string().optional().describe(
53180
53311
  "Project directory to run checks against (default: cwd). Must stay inside the repo root."
53181
53312
  ),
53182
- checks: z104.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
53183
- iteration: z104.number().int().min(1).optional().describe("1-based iteration number (default 1).")
53313
+ checks: z105.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
53314
+ iteration: z105.number().int().min(1).optional().describe("1-based iteration number (default 1).")
53184
53315
  };
53185
53316
  const secureHandler = createSecureHandler(
53186
53317
  (args) => runQualityGateHandler(args, logger59),
@@ -53210,7 +53341,7 @@ function registerRunQualityGateTool(server, deps) {
53210
53341
  // src/mcp/tools/verify-audit-chain-tool.ts
53211
53342
  import * as fs8 from "node:fs/promises";
53212
53343
  import * as path7 from "node:path";
53213
- import { z as z105 } from "zod";
53344
+ import { z as z106 } from "zod";
53214
53345
 
53215
53346
  // src/cli-server-auth.ts
53216
53347
  function resolveAuthEnabled(config) {
@@ -53384,11 +53515,11 @@ function logSecurityConfig(logger59, config) {
53384
53515
  }
53385
53516
 
53386
53517
  // src/mcp/tools/verify-audit-chain-tool.ts
53387
- var VerifyAuditChainInputSchema = z105.object({
53388
- logDir: z105.string().min(1).max(512).describe(
53518
+ var VerifyAuditChainInputSchema = z106.object({
53519
+ logDir: z106.string().min(1).max(512).describe(
53389
53520
  "Filesystem path to the FileAuditStorage log directory. Must lie inside the nexus data dir, a repo-local `.nexus-agents/`, or the configured `security.audit.logDir`. Tool reads all `audit-*.jsonl` files in lexicographic order and verifies the combined chain."
53390
53521
  ),
53391
- filePrefix: z105.string().min(1).max(64).optional().default(DEFAULT_AUDIT_FILE_PREFIX).describe(
53522
+ filePrefix: z106.string().min(1).max(64).optional().default(DEFAULT_AUDIT_FILE_PREFIX).describe(
53392
53523
  'Filename prefix for audit log files (defaults to "audit"). Files matching `${filePrefix}-*.jsonl` will be verified.'
53393
53524
  )
53394
53525
  });
@@ -53517,10 +53648,10 @@ async function handler2(args, ctx, security) {
53517
53648
  function registerVerifyAuditChainTool(server, deps) {
53518
53649
  const logger59 = deps.logger ?? createLogger({ tool: "verify_audit_chain" });
53519
53650
  const toolSchema = {
53520
- logDir: z105.string().min(1).max(512).describe(
53651
+ logDir: z106.string().min(1).max(512).describe(
53521
53652
  "Filesystem path to the FileAuditStorage log directory. Must lie inside the nexus data dir, a repo-local `.nexus-agents/`, or the configured `security.audit.logDir`. Tool reads all `audit-*.jsonl` files and verifies the combined hash chain."
53522
53653
  ),
53523
- filePrefix: z105.string().min(1).max(64).optional().describe(
53654
+ filePrefix: z106.string().min(1).max(64).optional().describe(
53524
53655
  'Filename prefix for audit log files (defaults to "audit"). Files matching `${filePrefix}-*.jsonl` will be verified.'
53525
53656
  )
53526
53657
  };
@@ -53544,7 +53675,7 @@ function registerVerifyAuditChainTool(server, deps) {
53544
53675
  }
53545
53676
 
53546
53677
  // src/mcp/tools/suggest-research-tasks-tool.ts
53547
- import { z as z106 } from "zod";
53678
+ import { z as z107 } from "zod";
53548
53679
  var SUGGEST_RESEARCH_TASKS_NOTE = "Suggestions derived from external research (untrusted); review before acting \u2014 nothing was executed or filed.";
53549
53680
  var RESEARCH_BUDGET_MS = 2e4;
53550
53681
  var RESEARCH_TIMED_OUT = /* @__PURE__ */ Symbol("research-budget-exceeded");
@@ -53561,11 +53692,11 @@ async function withResearchBudget(p, ms) {
53561
53692
  if (timer !== void 0) clearTimeout(timer);
53562
53693
  }
53563
53694
  }
53564
- var SuggestResearchTasksInputSchema = z106.object({
53565
- topic: z106.string().optional().describe("Topic filter passed to research_discover. Optional."),
53566
- qualityThreshold: z106.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
53567
- maxTriggers: z106.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
53568
- existingTaskIds: z106.array(z106.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
53695
+ var SuggestResearchTasksInputSchema = z107.object({
53696
+ topic: z107.string().optional().describe("Topic filter passed to research_discover. Optional."),
53697
+ qualityThreshold: z107.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
53698
+ maxTriggers: z107.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
53699
+ existingTaskIds: z107.array(z107.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
53569
53700
  });
53570
53701
  function toTriggerConfig(input) {
53571
53702
  return {
@@ -53622,10 +53753,10 @@ var DESCRIPTION3 = "SUGGEST-ONLY: surface candidate pipeline tasks for human/orc
53622
53753
  function registerSuggestResearchTasksTool(server, deps) {
53623
53754
  const logger59 = deps.logger ?? createLogger({ tool: "suggest_research_tasks" });
53624
53755
  const toolSchema = {
53625
- topic: z106.string().optional().describe("Topic filter passed to research_discover. Optional."),
53626
- qualityThreshold: z106.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
53627
- maxTriggers: z106.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
53628
- existingTaskIds: z106.array(z106.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
53756
+ topic: z107.string().optional().describe("Topic filter passed to research_discover. Optional."),
53757
+ qualityThreshold: z107.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
53758
+ maxTriggers: z107.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
53759
+ existingTaskIds: z107.array(z107.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
53629
53760
  };
53630
53761
  const secureHandler = createSecureHandler(
53631
53762
  (args) => suggestResearchTasksHandler(args, logger59),
@@ -53653,7 +53784,7 @@ function registerSuggestResearchTasksTool(server, deps) {
53653
53784
  }
53654
53785
 
53655
53786
  // src/mcp/tools/run-tool.ts
53656
- import { z as z110 } from "zod";
53787
+ import { z as z111 } from "zod";
53657
53788
  import { randomUUID as randomUUID19 } from "node:crypto";
53658
53789
 
53659
53790
  // src/orchestration/consensus-enforcement-mode.ts
@@ -54275,7 +54406,7 @@ function createMetaOrchestrator(options) {
54275
54406
 
54276
54407
  // src/orchestration/meta-shadow-selector.ts
54277
54408
  import { appendFileSync as appendFileSync6, existsSync as existsSync15, readFileSync as readFileSync13 } from "node:fs";
54278
- import { z as z107 } from "zod";
54409
+ import { z as z108 } from "zod";
54279
54410
  var SHADOW_STRATEGY_ARMS = [
54280
54411
  "single-shot",
54281
54412
  "dev-pipeline",
@@ -54364,19 +54495,19 @@ function createHydratableSelector() {
54364
54495
  var META_OUTCOME_SCHEMA_VERSION = 1;
54365
54496
  var HYDRATE_LOOKBACK_DAYS = 30;
54366
54497
  var HYDRATE_LOOKBACK_MS = HYDRATE_LOOKBACK_DAYS * 24 * 60 * 60 * 1e3;
54367
- var PersistedContextSchema = z107.object({
54368
- taskComplexity: z107.number(),
54369
- contextLengthNormalized: z107.number(),
54370
- isCodeTask: z107.number(),
54371
- isReasoningTask: z107.number(),
54372
- budgetUtilization: z107.number(),
54373
- timePressure: z107.number()
54498
+ var PersistedContextSchema = z108.object({
54499
+ taskComplexity: z108.number(),
54500
+ contextLengthNormalized: z108.number(),
54501
+ isCodeTask: z108.number(),
54502
+ isReasoningTask: z108.number(),
54503
+ budgetUtilization: z108.number(),
54504
+ timePressure: z108.number()
54374
54505
  });
54375
- var PersistedMetaOutcomeSchema = z107.object({
54376
- schema: z107.literal(META_OUTCOME_SCHEMA_VERSION),
54377
- timestamp: z107.string(),
54378
- strategy: z107.enum(SHADOW_STRATEGY_ARMS),
54379
- success: z107.boolean(),
54506
+ var PersistedMetaOutcomeSchema = z108.object({
54507
+ schema: z108.literal(META_OUTCOME_SCHEMA_VERSION),
54508
+ timestamp: z108.string(),
54509
+ strategy: z108.enum(SHADOW_STRATEGY_ARMS),
54510
+ success: z108.boolean(),
54380
54511
  context: PersistedContextSchema
54381
54512
  });
54382
54513
  var persistLogger = createLogger({ component: "MetaShadowSelector" });
@@ -54769,7 +54900,7 @@ function evaluateMetaStrategyReadiness(result, config = DEFAULT_META_STRATEGY_RE
54769
54900
  }
54770
54901
 
54771
54902
  // src/mcp/tools/dev-pipeline-tool.ts
54772
- import { z as z108 } from "zod";
54903
+ import { z as z109 } from "zod";
54773
54904
  import * as fs10 from "node:fs";
54774
54905
  import { randomUUID as randomUUID17 } from "node:crypto";
54775
54906
 
@@ -55034,48 +55165,48 @@ var DEV_PIPELINE_DRY_RUN_NOTE = "This was a dry run (plan+vote), which always ru
55034
55165
  function dispatchNoteFor(dryRun) {
55035
55166
  return dryRun ? DEV_PIPELINE_DRY_RUN_NOTE : DEV_PIPELINE_ASYNC_HINT;
55036
55167
  }
55037
- var DevPipelineInputSchema = z108.object({
55168
+ var DevPipelineInputSchema = z109.object({
55038
55169
  /** Direct task instructions. */
55039
- task: z108.string().max(1e4).optional().describe("Direct task instructions (what to build)"),
55170
+ task: z109.string().max(1e4).optional().describe("Direct task instructions (what to build)"),
55040
55171
  /** Declared provenance of the task text (#6795); omitted means '3'. */
55041
55172
  sourceTrustTier: TaskSourceTrustTierSchema,
55042
55173
  /** Path to a plan file (.md, .yaml, .txt) to use as input. */
55043
- planFile: z108.string().max(500).optional().describe("Path to a plan/spec file to use as input"),
55174
+ planFile: z109.string().max(500).optional().describe("Path to a plan/spec file to use as input"),
55044
55175
  /** Whether to run in dry-run mode (plan+vote only, no implementation). */
55045
- dryRun: z108.boolean().default(false).describe("If true, stop after plan+vote (no implementation)"),
55176
+ dryRun: z109.boolean().default(false).describe("If true, stop after plan+vote (no implementation)"),
55046
55177
  /** Maximum vote iterations before proceeding (default: 3). */
55047
- maxVoteIterations: z108.number().int().min(1).max(5).default(3).describe("Max plan\u2192vote iterations"),
55178
+ maxVoteIterations: z109.number().int().min(1).max(5).default(3).describe("Max plan\u2192vote iterations"),
55048
55179
  /** Maximum QA iterations per task (default: 3). */
55049
- maxQaIterations: z108.number().int().min(1).max(5).default(3).describe("Max QA review iterations per task"),
55180
+ maxQaIterations: z109.number().int().min(1).max(5).default(3).describe("Max QA review iterations per task"),
55050
55181
  /** Working directory for the pipeline (default: cwd). Used for security scan and context. */
55051
- workingDir: z108.string().max(500).optional().describe("Working directory (default: cwd)"),
55182
+ workingDir: z109.string().max(500).optional().describe("Working directory (default: cwd)"),
55052
55183
  /** GitHub issue number to track progress on. Updates posted as comments. */
55053
- issueNumber: z108.number().int().positive().optional().describe("GitHub issue to post progress to"),
55184
+ issueNumber: z109.number().int().positive().optional().describe("GitHub issue to post progress to"),
55054
55185
  /** GitHub repo (owner/name) for issue tracking. */
55055
- repo: z108.string().max(200).optional().describe("GitHub repo for issue tracking (e.g., owner/repo)"),
55186
+ repo: z109.string().max(200).optional().describe("GitHub repo for issue tracking (e.g., owner/repo)"),
55056
55187
  /** Task tracking backend: github, gitlab, or json (default: json). */
55057
- trackerBackend: z108.enum(["github", "gitlab", "json"]).default("json").describe("Task tracking backend for issue creation"),
55188
+ trackerBackend: z109.enum(["github", "gitlab", "json"]).default("json").describe("Task tracking backend for issue creation"),
55058
55189
  /** Labels to apply to created issues. */
55059
- labels: z108.array(z108.string()).optional().describe("Labels for created issues"),
55190
+ labels: z109.array(z109.string()).optional().describe("Labels for created issues"),
55060
55191
  /** Session ID for checkpoint/resume. Enables crash recovery. */
55061
- sessionId: z108.string().max(128).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Session ID for checkpoint/resume (crash recovery)"),
55192
+ sessionId: z109.string().max(128).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Session ID for checkpoint/resume (crash recovery)"),
55062
55193
  /**
55063
55194
  * TESTS ONLY — when true, voters return random decisions. Must not be used as
55064
55195
  * a fallback when adapters are unavailable; configure an adapter instead. (#2319)
55065
55196
  */
55066
- simulateVotes: z108.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
55197
+ simulateVotes: z109.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
55067
55198
  /** Voting strategy for consensus stages. */
55068
55199
  votingStrategy: VotingStrategySchema.optional().describe(
55069
55200
  "Voting strategy for plan approval (default: higher_order)"
55070
55201
  ),
55071
55202
  /** Use 3 agents instead of 6 for faster voting. */
55072
- quickMode: z108.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
55203
+ quickMode: z109.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
55073
55204
  /**
55074
55205
  * Deadline for EACH stage call in milliseconds (min 30s, max 600s), not a
55075
55206
  * budget for the whole run (#6736). Replaces every stage's default, the
55076
55207
  * vote's included; clamped to the `pipeline` class guard.
55077
55208
  */
55078
- timeoutMs: z108.number().int().min(3e4).max(6e5).optional().describe(
55209
+ timeoutMs: z109.number().int().min(3e4).max(6e5).optional().describe(
55079
55210
  "Max time for EACH stage call in ms (30000-600000), not for the whole run; applies to every stage, the vote included, and to each plan/vote and implement/QA iteration. A stage past it fails with a timeout and its model calls are aborted. Default: the vote stage gets the multi-LLM panel guard (900000 unless overridden), other stages the pipeline guard (1800000 unless overridden)"
55080
55211
  ),
55081
55212
  /**
@@ -55083,7 +55214,7 @@ var DevPipelineInputSchema = z108.object({
55083
55214
  * dispatch. A caller who learned `mode: 'async'` elsewhere gets an error
55084
55215
  * naming `dispatch` rather than the bare enum message (#4968).
55085
55216
  */
55086
- mode: z108.enum(["autonomous", "harness"], { error: modeEnumErrorNamingDispatch }).default("autonomous").describe(
55217
+ mode: z109.enum(["autonomous", "harness"], { error: modeEnumErrorNamingDispatch }).default("autonomous").describe(
55087
55218
  "'autonomous': full pipeline. 'harness': stops after decompose, returns tasks for caller to implement. (Not the async switch \u2014 that is `dispatch`.)"
55088
55219
  ),
55089
55220
  /**
@@ -55097,11 +55228,11 @@ var DevPipelineInputSchema = z108.object({
55097
55228
  */
55098
55229
  dispatch: dispatchFieldDefaultSync("Ignored for dryRun."),
55099
55230
  /** Local pre-ship quality gate (typecheck/lint/tests) mode (#3356). */
55100
- qualityGate: z108.enum(["off", "advisory", "blocking"]).default("off").describe(
55231
+ qualityGate: z109.enum(["off", "advisory", "blocking"]).default("off").describe(
55101
55232
  "Pre-ship local quality gate. 'off' (default): skip. 'advisory': run + record feedback, never fail. 'blocking': a red gate fails the pipeline."
55102
55233
  ),
55103
55234
  /** Opt-in per-run token budget — a safety cap for unattended runs (#3395). */
55104
- maxBudgetTokens: z108.number().int().positive().optional().describe(
55235
+ maxBudgetTokens: z109.number().int().positive().optional().describe(
55105
55236
  "Per-run token ceiling (#3395). When set, expert calls stop (returning failures) once cumulative usage crosses it \u2014 a hard-stop safety cap for unattended/multi-day runs. Omit to disable (default)."
55106
55237
  )
55107
55238
  });
@@ -55188,7 +55319,7 @@ async function executeDevPipelineBody(taskText, stages, pipelineOptions, simulat
55188
55319
  detail: output2
55189
55320
  });
55190
55321
  }
55191
- return structuredToolSuccess(z108.record(z108.string(), z108.unknown()), output2);
55322
+ return structuredToolSuccess(z109.record(z109.string(), z109.unknown()), output2);
55192
55323
  }
55193
55324
  function describeIncompleteRun(result) {
55194
55325
  if (result.planStatus !== void 0) {
@@ -55320,33 +55451,33 @@ function registerDevPipelineTool(server, deps) {
55320
55451
  }
55321
55452
 
55322
55453
  // src/mcp/tools/pipeline-tool.ts
55323
- import { z as z109 } from "zod";
55454
+ import { z as z110 } from "zod";
55324
55455
  import * as fs11 from "node:fs";
55325
55456
  import { randomUUID as randomUUID18 } from "node:crypto";
55326
55457
  var PIPELINE_ASYNC_HINT = "A full run_pipeline run can exceed the synchronous MCP request timeout. Retry with `dispatch: 'async'` to get a jobId immediately, then poll get_job_result({ jobId }) for the result.";
55327
- var PipelineInputSchema = z109.object({
55458
+ var PipelineInputSchema = z110.object({
55328
55459
  /** The task to execute. */
55329
- task: z109.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
55460
+ task: z110.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
55330
55461
  /** Path to a spec file (.md, .yaml) to use as task input. */
55331
- specFile: z109.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
55462
+ specFile: z110.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
55332
55463
  /** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
55333
- template: z109.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
55464
+ template: z110.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
55334
55465
  /** Voting strategy for consensus stages. */
55335
55466
  votingStrategy: VotingStrategySchema.optional().describe(
55336
55467
  "Voting strategy for plan approval. simple_majority (default), supermajority (67%), unanimous, higher_order (Bayesian), opinion_wise"
55337
55468
  ),
55338
55469
  /** Use 3 agents instead of 7 for faster voting. */
55339
- quickMode: z109.boolean().default(false).describe("Use 3 agents instead of 7 for faster consensus voting"),
55470
+ quickMode: z110.boolean().default(false).describe("Use 3 agents instead of 7 for faster consensus voting"),
55340
55471
  /**
55341
55472
  * Deadline for EACH stage in milliseconds (min 30s, max 600s), not a budget
55342
55473
  * for the whole run (#6730). Replaces every stage's default, the vote's
55343
55474
  * included; clamped to the `pipeline` class guard.
55344
55475
  */
55345
- timeoutMs: z109.number().int().min(3e4).max(6e5).optional().describe(
55476
+ timeoutMs: z110.number().int().min(3e4).max(6e5).optional().describe(
55346
55477
  "Max time for EACH stage in ms (30000-600000), not for the whole run; applies to every stage, the vote included. Default: the vote stage gets the multi-LLM panel guard (900000 unless overridden), other stages 120000"
55347
55478
  ),
55348
55479
  /** Stop after planning/voting (no implementation). */
55349
- dryRun: z109.boolean().default(false).describe("Stop after vote stage (no implementation)"),
55480
+ dryRun: z110.boolean().default(false).describe("Stop after vote stage (no implementation)"),
55350
55481
  /**
55351
55482
  * Dispatch mode (#3730). `sync` (default) runs the pipeline inline and
55352
55483
  * returns the result — but a real multi-stage adaptive run can exceed the
@@ -55357,7 +55488,7 @@ var PipelineInputSchema = z109.object({
55357
55488
  */
55358
55489
  ...asyncDispatchInputDefaultSync("Ignored for dryRun."),
55359
55490
  /** TESTS ONLY — random output, must not be used for real decisions. (#2319) */
55360
- simulateVotes: z109.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
55491
+ simulateVotes: z110.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
55361
55492
  });
55362
55493
  function buildOutput3(result, simulated) {
55363
55494
  return {
@@ -55383,14 +55514,14 @@ function buildOutput3(result, simulated) {
55383
55514
  rateLimitHint: result.error?.toLowerCase().includes("rate limit") === true ? "Consider using quickMode or increasing delay between pipeline runs" : void 0
55384
55515
  };
55385
55516
  }
55386
- var VoteEvidenceSchema = z109.object({
55387
- approvalPercentage: z109.number(),
55388
- voteRecordId: z109.string().optional()
55517
+ var VoteEvidenceSchema = z110.object({
55518
+ approvalPercentage: z110.number(),
55519
+ voteRecordId: z110.string().optional()
55389
55520
  });
55390
- var VoteResultSchema = z109.discriminatedUnion("kind", [
55391
- VoteEvidenceSchema.extend({ kind: z109.literal("approved") }),
55392
- VoteEvidenceSchema.extend({ kind: z109.literal("rejected"), feedback: z109.string() }),
55393
- VoteEvidenceSchema.extend({ kind: z109.literal("no_quorum"), reason: z109.string() })
55521
+ var VoteResultSchema = z110.discriminatedUnion("kind", [
55522
+ VoteEvidenceSchema.extend({ kind: z110.literal("approved") }),
55523
+ VoteEvidenceSchema.extend({ kind: z110.literal("rejected"), feedback: z110.string() }),
55524
+ VoteEvidenceSchema.extend({ kind: z110.literal("no_quorum"), reason: z110.string() })
55394
55525
  ]);
55395
55526
  function isVoteResult(value) {
55396
55527
  return VoteResultSchema.safeParse(value).success;
@@ -55492,7 +55623,7 @@ async function executePipelineBody(task, stages, run) {
55492
55623
  detail: output2
55493
55624
  });
55494
55625
  }
55495
- return structuredToolSuccess(z109.record(z109.string(), z109.unknown()), output2);
55626
+ return structuredToolSuccess(z110.record(z110.string(), z110.unknown()), output2);
55496
55627
  }
55497
55628
  function createPipelineAgentStages(input, config) {
55498
55629
  return createAgentStages({
@@ -55643,9 +55774,9 @@ function cancellableExecutor(strategy, executor, signal) {
55643
55774
  }
55644
55775
 
55645
55776
  // src/mcp/tools/run-tool.ts
55646
- var RunInputSchema = z110.object({
55647
- goal: z110.string().min(1).describe("Natural-language goal. nexus-agents selects how to execute it."),
55648
- forceStrategy: z110.enum([
55777
+ var RunInputSchema = z111.object({
55778
+ goal: z111.string().min(1).describe("Natural-language goal. nexus-agents selects how to execute it."),
55779
+ forceStrategy: z111.enum([
55649
55780
  "single-shot",
55650
55781
  "dev-pipeline",
55651
55782
  "pipeline",
@@ -55657,10 +55788,10 @@ var RunInputSchema = z110.object({
55657
55788
  ]).optional().describe(
55658
55789
  "Power-user override: force a specific strategy instead of letting the router choose."
55659
55790
  ),
55660
- requiresConsensus: z110.boolean().optional().describe("Hint: the task needs a multi-perspective consensus decision."),
55661
- dependencyStructure: z110.enum(["linear", "dag", "independent", "unknown"]).optional().describe("Hint: the dependency structure of the work."),
55662
- isNovel: z110.boolean().optional().describe("Hint: this kind of task has not been seen before."),
55663
- execute: z110.boolean().optional().describe(
55791
+ requiresConsensus: z111.boolean().optional().describe("Hint: the task needs a multi-perspective consensus decision."),
55792
+ dependencyStructure: z111.enum(["linear", "dag", "independent", "unknown"]).optional().describe("Hint: the dependency structure of the work."),
55793
+ isNovel: z111.boolean().optional().describe("Hint: this kind of task has not been seen before."),
55794
+ execute: z111.boolean().optional().describe(
55664
55795
  "When true, actually run the selected strategy (if an executor is wired) and return its result; otherwise return the routing decision only (default false, read-only)."
55665
55796
  ),
55666
55797
  /**
@@ -55675,7 +55806,7 @@ var RunInputSchema = z110.object({
55675
55806
  * other, the call is REFUSED rather than executed: silently ignoring a
55676
55807
  * do-not-act flag is the one outcome a governance substrate cannot allow.
55677
55808
  */
55678
- dryRun: z110.boolean().optional().describe(
55809
+ dryRun: z111.boolean().optional().describe(
55679
55810
  "Plan and vote only, no implementation (#4806). Requires the dev-pipeline strategy \u2014 refused (never silently executed) when the router selects another."
55680
55811
  ),
55681
55812
  /**
@@ -55911,12 +56042,12 @@ function registerRunTool(server, deps) {
55911
56042
  }
55912
56043
 
55913
56044
  // src/mcp/tools/list-available-models-tool.ts
55914
- import { z as z111 } from "zod";
56045
+ import { z as z112 } from "zod";
55915
56046
  var DESCRIPTION5 = "Probe every model-discovery transport (OpenRouter API, the configured gateway, and the opencode/claude/codex/gemini CLIs) and report a per-transport health summary: probe ok/failed, model count, and a sample of usable ids. Models with open route breakers are excluded; each CLI reports whether its default-route breaker is open. Use it to validate the CLIs and APIs are wired and reachable. Read-only; does not change routing.";
55916
56047
  var PROBE_TIMEOUT_MS = 12e3;
55917
- var ListAvailableModelsInputSchema = z111.object({
55918
- includeModelIds: z111.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
55919
- includeOpenRouter: z111.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
56048
+ var ListAvailableModelsInputSchema = z112.object({
56049
+ includeModelIds: z112.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
56050
+ includeOpenRouter: z112.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
55920
56051
  });
55921
56052
  async function probeSource(source, includeModelIds) {
55922
56053
  let timer;
@@ -56025,8 +56156,8 @@ async function listAvailableModelsHandler(args, deps, logger59) {
56025
56156
  function registerListAvailableModelsTool(server, deps) {
56026
56157
  const logger59 = deps.logger ?? createLogger({ tool: "list_available_models" });
56027
56158
  const toolSchema = {
56028
- includeModelIds: z111.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
56029
- includeOpenRouter: z111.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
56159
+ includeModelIds: z112.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
56160
+ includeOpenRouter: z112.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
56030
56161
  };
56031
56162
  const secureHandler = createSecureHandler(
56032
56163
  (args) => listAvailableModelsHandler(args, deps, logger59),
@@ -56050,9 +56181,9 @@ function registerListAvailableModelsTool(server, deps) {
56050
56181
  }
56051
56182
 
56052
56183
  // src/mcp/tools/pr-review-eval-types.ts
56053
- import { z as z112 } from "zod";
56184
+ import { z as z113 } from "zod";
56054
56185
  var MAX_EVAL_FINDINGS = 100;
56055
- var VoterEvalFindingSchema = z112.object({
56186
+ var VoterEvalFindingSchema = z113.object({
56056
56187
  summary: RawFindingSchema.shape.summary,
56057
56188
  location: RawFindingSchema.shape.location,
56058
56189
  severity: RawFindingSchema.shape.severity.unwrap(),
@@ -56060,14 +56191,14 @@ var VoterEvalFindingSchema = z112.object({
56060
56191
  gate: RawFindingSchema.shape.gate.extend({
56061
56192
  named_assertion: RawFindingSchema.shape.claim.min(0)
56062
56193
  }).optional(),
56063
- verified: z112.boolean().optional(),
56064
- classification: z112.enum(["TP", "FP", "FN", "excluded"]),
56065
- source: z112.enum(["voter", "ground_truth"]),
56194
+ verified: z113.boolean().optional(),
56195
+ classification: z113.enum(["TP", "FP", "FN", "excluded"]),
56196
+ source: z113.enum(["voter", "ground_truth"]),
56066
56197
  /** Original index in the voter's raw findings; repeated TP evidence shares it. */
56067
- findingIndex: z112.number().int().nonnegative().optional(),
56068
- knownBugIndex: z112.number().int().nonnegative().optional(),
56198
+ findingIndex: z113.number().int().nonnegative().optional(),
56199
+ knownBugIndex: z113.number().int().nonnegative().optional(),
56069
56200
  /** String fields shortened by the producer, never silently truncated. */
56070
- truncatedFields: z112.array(z112.enum(["summary", "location", "rationale", "gate.named_assertion"])).max(4).optional()
56201
+ truncatedFields: z113.array(z113.enum(["summary", "location", "rationale", "gate.named_assertion"])).max(4).optional()
56071
56202
  });
56072
56203
  var PR_REVIEW_EVAL_ROLES = [
56073
56204
  "architect",
@@ -56076,47 +56207,47 @@ var PR_REVIEW_EVAL_ROLES = [
56076
56207
  "catfish",
56077
56208
  "scope_steward"
56078
56209
  ];
56079
- var PrReviewEvalRoleSchema = z112.enum(PR_REVIEW_EVAL_ROLES);
56080
- var PrReviewCaseClassSchema = z112.enum(["buggy", "clean", "borderline"]);
56081
- var VoterEvalVerdictSchema = z112.object({
56210
+ var PrReviewEvalRoleSchema = z113.enum(PR_REVIEW_EVAL_ROLES);
56211
+ var PrReviewCaseClassSchema = z113.enum(["buggy", "clean", "borderline"]);
56212
+ var VoterEvalVerdictSchema = z113.object({
56082
56213
  /** Stable record id (e.g. `${runId}:${caseNumber}:${role}`). */
56083
- id: z112.string().min(1).max(160),
56214
+ id: z113.string().min(1).max(160),
56084
56215
  /** The pr_review run / batch this verdict belongs to. */
56085
- runId: z112.string().min(1).max(64),
56216
+ runId: z113.string().min(1).max(64),
56086
56217
  /** Dataset case identifier (the dataset's `number` field). */
56087
- caseNumber: z112.string().min(1).max(80),
56218
+ caseNumber: z113.string().min(1).max(80),
56088
56219
  /** Rubric class of the case (ground-truth label). */
56089
56220
  caseClass: PrReviewCaseClassSchema,
56090
56221
  /** The voter role being scored. */
56091
56222
  role: PrReviewEvalRoleSchema,
56092
56223
  /** Verified findings that matched a known bug. */
56093
- truePositives: z112.number().int().nonnegative(),
56224
+ truePositives: z113.number().int().nonnegative(),
56094
56225
  /** Verified findings on clean code that matched no known bug. */
56095
- falsePositives: z112.number().int().nonnegative(),
56226
+ falsePositives: z113.number().int().nonnegative(),
56096
56227
  /** Known bugs this voter failed to flag. */
56097
- falseNegatives: z112.number().int().nonnegative(),
56228
+ falseNegatives: z113.number().int().nonnegative(),
56098
56229
  /** Optional for legacy records/count-only callers; [] means measured, no evidence. */
56099
- findings: z112.array(VoterEvalFindingSchema).max(MAX_EVAL_FINDINGS).optional(),
56230
+ findings: z113.array(VoterEvalFindingSchema).max(MAX_EVAL_FINDINGS).optional(),
56100
56231
  /** Number of evidence entries omitted at the cap; full tallies are unchanged. */
56101
- findingsTruncated: z112.number().int().nonnegative().optional(),
56232
+ findingsTruncated: z113.number().int().nonnegative().optional(),
56102
56233
  /** Rubric version the ground truth was adjudicated under. */
56103
- rubricVersion: z112.string().min(1).max(32),
56234
+ rubricVersion: z113.string().min(1).max(32),
56104
56235
  /** ISO-8601 timestamp the verdict was recorded. */
56105
- timestamp: z112.string().min(1).max(40)
56236
+ timestamp: z113.string().min(1).max(40)
56106
56237
  });
56107
- var VoterEvalVerdictQuerySchema = z112.object({
56238
+ var VoterEvalVerdictQuerySchema = z113.object({
56108
56239
  role: PrReviewEvalRoleSchema.optional(),
56109
- runId: z112.string().min(1).max(64).optional(),
56240
+ runId: z113.string().min(1).max(64).optional(),
56110
56241
  caseClass: PrReviewCaseClassSchema.optional(),
56111
- rubricVersion: z112.string().min(1).max(32).optional(),
56242
+ rubricVersion: z113.string().min(1).max(32).optional(),
56112
56243
  /** ISO-8601 lower bound (inclusive) on `timestamp`. */
56113
- since: z112.string().optional(),
56244
+ since: z113.string().optional(),
56114
56245
  /** Most-recent-N cap. */
56115
- limit: z112.number().int().positive().optional()
56246
+ limit: z113.number().int().positive().optional()
56116
56247
  });
56117
56248
 
56118
56249
  // src/mcp/tools/supply-chain-tradeoff-panel.ts
56119
- import { z as z113 } from "zod";
56250
+ import { z as z114 } from "zod";
56120
56251
  import { randomUUID as randomUUID20 } from "node:crypto";
56121
56252
  var DEFAULT_AXES = [
56122
56253
  "build_time_determinism",
@@ -56138,16 +56269,16 @@ var FULL_PANEL = [
56138
56269
  "scope_steward"
56139
56270
  ];
56140
56271
  var QUICK_PANEL = ["architect", "security", "scope_steward"];
56141
- var SupplyChainTradeoffPanelInputSchema = z113.object({
56142
- proposal: z113.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
56143
- axes: z113.array(z113.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
56272
+ var SupplyChainTradeoffPanelInputSchema = z114.object({
56273
+ proposal: z114.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
56274
+ axes: z114.array(z114.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
56144
56275
  `Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
56145
56276
  ),
56146
- context: z113.string().max(MAX_CONTEXT_LENGTH).optional().describe(
56277
+ context: z114.string().max(MAX_CONTEXT_LENGTH).optional().describe(
56147
56278
  "Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
56148
56279
  ),
56149
- quickMode: z113.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
56150
- simulate: z113.boolean().optional().default(false).describe("Use simulated voters (testing only)"),
56280
+ quickMode: z114.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
56281
+ simulate: z114.boolean().optional().default(false).describe("Use simulated voters (testing only)"),
56151
56282
  // #6123: same field as consensus_vote — the panel judges the caller's project.
56152
56283
  project: VoterProjectInputSchema,
56153
56284
  /**
@@ -56769,40 +56900,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
56769
56900
  })(RiskLevel || {});
56770
56901
 
56771
56902
  // src/mcp/safety/stpa-schemas.ts
56772
- import { z as z114 } from "zod";
56773
- var HazardCategorySchema = z114.enum(HazardCategory);
56774
- var HazardSeveritySchema = z114.enum(HazardSeverity);
56775
- var ConstraintPrioritySchema = z114.enum(ConstraintPriority);
56776
- var RiskLevelSchema = z114.enum(RiskLevel);
56777
- var TriggerPatternSchema = z114.object({
56778
- parameter: z114.string().min(1),
56779
- matchType: z114.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
56780
- pattern: z114.string(),
56781
- reason: z114.string()
56903
+ import { z as z115 } from "zod";
56904
+ var HazardCategorySchema = z115.enum(HazardCategory);
56905
+ var HazardSeveritySchema = z115.enum(HazardSeverity);
56906
+ var ConstraintPrioritySchema = z115.enum(ConstraintPriority);
56907
+ var RiskLevelSchema = z115.enum(RiskLevel);
56908
+ var TriggerPatternSchema = z115.object({
56909
+ parameter: z115.string().min(1),
56910
+ matchType: z115.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
56911
+ pattern: z115.string(),
56912
+ reason: z115.string()
56782
56913
  });
56783
- var HazardSchema = z114.object({
56784
- id: z114.string().min(1),
56785
- description: z114.string(),
56914
+ var HazardSchema = z115.object({
56915
+ id: z115.string().min(1),
56916
+ description: z115.string(),
56786
56917
  category: HazardCategorySchema,
56787
56918
  severity: HazardSeveritySchema,
56788
- likelihood: z114.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
56789
- triggerConditions: z114.array(z114.string()),
56790
- consequences: z114.array(z114.string())
56919
+ likelihood: z115.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
56920
+ triggerConditions: z115.array(z115.string()),
56921
+ consequences: z115.array(z115.string())
56791
56922
  });
56792
- var UnsafeControlActionSchema = z114.object({
56793
- id: z114.string().min(1),
56794
- toolName: z114.string().min(1),
56795
- type: z114.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
56796
- description: z114.string(),
56797
- unsafeContext: z114.string(),
56798
- relatedHazards: z114.array(z114.string()),
56799
- triggerPatterns: z114.array(TriggerPatternSchema).optional()
56923
+ var UnsafeControlActionSchema = z115.object({
56924
+ id: z115.string().min(1),
56925
+ toolName: z115.string().min(1),
56926
+ type: z115.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
56927
+ description: z115.string(),
56928
+ unsafeContext: z115.string(),
56929
+ relatedHazards: z115.array(z115.string()),
56930
+ triggerPatterns: z115.array(TriggerPatternSchema).optional()
56800
56931
  });
56801
- var SafetyConstraintSchema = z114.object({
56802
- id: z114.string().min(1),
56803
- description: z114.string(),
56804
- mitigates: z114.array(z114.string()),
56805
- enforcement: z114.enum([
56932
+ var SafetyConstraintSchema = z115.object({
56933
+ id: z115.string().min(1),
56934
+ description: z115.string(),
56935
+ mitigates: z115.array(z115.string()),
56936
+ enforcement: z115.enum([
56806
56937
  "prevent",
56807
56938
  "require_confirmation",
56808
56939
  "alert",
@@ -56810,52 +56941,52 @@ var SafetyConstraintSchema = z114.object({
56810
56941
  "rate_limit",
56811
56942
  "require_privilege"
56812
56943
  ]),
56813
- validationFunction: z114.string().optional(),
56944
+ validationFunction: z115.string().optional(),
56814
56945
  priority: ConstraintPrioritySchema
56815
56946
  });
56816
- var PropertySchemaSchema = z114.object({
56817
- type: z114.string(),
56818
- description: z114.string().optional(),
56819
- enum: z114.array(z114.unknown()).optional(),
56820
- pattern: z114.string().optional(),
56821
- minimum: z114.number().optional(),
56822
- maximum: z114.number().optional()
56947
+ var PropertySchemaSchema = z115.object({
56948
+ type: z115.string(),
56949
+ description: z115.string().optional(),
56950
+ enum: z115.array(z115.unknown()).optional(),
56951
+ pattern: z115.string().optional(),
56952
+ minimum: z115.number().optional(),
56953
+ maximum: z115.number().optional()
56823
56954
  });
56824
- var ToolInputSchemaSchema = z114.object({
56825
- type: z114.string(),
56826
- properties: z114.record(z114.string(), PropertySchemaSchema).optional(),
56827
- required: z114.array(z114.string()).optional(),
56828
- additionalProperties: z114.boolean().optional()
56955
+ var ToolInputSchemaSchema = z115.object({
56956
+ type: z115.string(),
56957
+ properties: z115.record(z115.string(), PropertySchemaSchema).optional(),
56958
+ required: z115.array(z115.string()).optional(),
56959
+ additionalProperties: z115.boolean().optional()
56829
56960
  });
56830
- var ToolDefinitionSchema = z114.object({
56831
- name: z114.string().min(1),
56832
- description: z114.string(),
56961
+ var ToolDefinitionSchema = z115.object({
56962
+ name: z115.string().min(1),
56963
+ description: z115.string(),
56833
56964
  inputSchema: ToolInputSchemaSchema
56834
56965
  });
56835
- var AnalysisConfigurationSchema = z114.object({
56836
- includeLowSeverity: z114.boolean().default(true),
56837
- generateAllConstraints: z114.boolean().default(true),
56838
- checkInteractions: z114.boolean().default(true),
56839
- maxHazardsPerTool: z114.number().int().min(1).max(100).default(50),
56840
- categories: z114.array(HazardCategorySchema).default([])
56966
+ var AnalysisConfigurationSchema = z115.object({
56967
+ includeLowSeverity: z115.boolean().default(true),
56968
+ generateAllConstraints: z115.boolean().default(true),
56969
+ checkInteractions: z115.boolean().default(true),
56970
+ maxHazardsPerTool: z115.number().int().min(1).max(100).default(50),
56971
+ categories: z115.array(HazardCategorySchema).default([])
56841
56972
  });
56842
- var ConstraintViolationSchema = z114.object({
56843
- constraintId: z114.string().min(1),
56844
- constraintDescription: z114.string(),
56973
+ var ConstraintViolationSchema = z115.object({
56974
+ constraintId: z115.string().min(1),
56975
+ constraintDescription: z115.string(),
56845
56976
  severity: HazardSeveritySchema,
56846
- details: z114.string(),
56847
- remediation: z114.string()
56977
+ details: z115.string(),
56978
+ remediation: z115.string()
56848
56979
  });
56849
- var ValidationWarningSchema = z114.object({
56850
- code: z114.string().min(1),
56851
- message: z114.string(),
56852
- affected: z114.string()
56980
+ var ValidationWarningSchema = z115.object({
56981
+ code: z115.string().min(1),
56982
+ message: z115.string(),
56983
+ affected: z115.string()
56853
56984
  });
56854
- var ValidationResultSchema = z114.object({
56855
- valid: z114.boolean(),
56856
- toolName: z114.string().min(1),
56857
- violations: z114.array(ConstraintViolationSchema),
56858
- passed: z114.array(z114.string()),
56985
+ var ValidationResultSchema = z115.object({
56986
+ valid: z115.boolean(),
56987
+ toolName: z115.string().min(1),
56988
+ violations: z115.array(ConstraintViolationSchema),
56989
+ passed: z115.array(z115.string()),
56859
56990
  // Optional rather than required, deliberately. `ValidationResult` declares
56860
56991
  // both fields required because every result this package produces has them;
56861
56992
  // the schema is the lenient inbound edge for a result that arrived from
@@ -56866,10 +56997,10 @@ var ValidationResultSchema = z114.object({
56866
56997
  // "nothing was evaluated". The strict/lenient split is safe because nothing
56867
56998
  // bridges the two with `z.infer`: a parsed result will not typecheck as a
56868
56999
  // `ValidationResult` without handling the absent fields.
56869
- evaluated: z114.array(z114.string()).optional(),
56870
- notApplicable: z114.array(z114.string()).optional(),
56871
- warnings: z114.array(ValidationWarningSchema),
56872
- validatedAt: z114.date()
57000
+ evaluated: z115.array(z115.string()).optional(),
57001
+ notApplicable: z115.array(z115.string()).optional(),
57002
+ warnings: z115.array(ValidationWarningSchema),
57003
+ validatedAt: z115.date()
56873
57004
  });
56874
57005
 
56875
57006
  // src/mcp/safety/stpa-types.ts
@@ -57954,18 +58085,18 @@ var GeminiResponseParser = class {
57954
58085
  };
57955
58086
 
57956
58087
  // src/cli-adapters/router-types.ts
57957
- import { z as z115 } from "zod";
57958
- var RouterConfigSchema = z115.object({
57959
- preferCostEfficient: z115.boolean().default(false)
58088
+ import { z as z116 } from "zod";
58089
+ var RouterConfigSchema = z116.object({
58090
+ preferCostEfficient: z116.boolean().default(false)
57960
58091
  });
57961
58092
 
57962
58093
  // src/cli-adapters/task-classifier.ts
57963
- import { z as z116 } from "zod";
57964
- var ClassificationPatternsSchema = z116.object({
57965
- code: z116.array(z116.string()).readonly(),
57966
- research: z116.array(z116.string()).readonly(),
57967
- documentation: z116.array(z116.string()).readonly(),
57968
- analysis: z116.array(z116.string()).readonly()
58094
+ import { z as z117 } from "zod";
58095
+ var ClassificationPatternsSchema = z117.object({
58096
+ code: z117.array(z117.string()).readonly(),
58097
+ research: z117.array(z117.string()).readonly(),
58098
+ documentation: z117.array(z117.string()).readonly(),
58099
+ analysis: z117.array(z117.string()).readonly()
57969
58100
  });
57970
58101
 
57971
58102
  // src/security/sandbox/sandbox-types.ts
@@ -59343,4 +59474,4 @@ export {
59343
59474
  initializeSandbox,
59344
59475
  getSandboxMode
59345
59476
  };
59346
- //# sourceMappingURL=chunk-CI3FOOUF.js.map
59477
+ //# sourceMappingURL=chunk-TH3MSFDF.js.map