nexus-agents 6.3.4 → 6.3.5

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.
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-DPFRPNAC.js";
24
+ } from "./chunk-PPCIJBHY.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-Q3DEXAOB.js";
@@ -47,7 +47,7 @@ import {
47
47
  simulationDeniedResult,
48
48
  toJobSummary,
49
49
  writeJobCancelled
50
- } from "./chunk-YBG6Y2UN.js";
50
+ } from "./chunk-SADUKKC7.js";
51
51
  import {
52
52
  allOf
53
53
  } from "./chunk-OQB3XC5O.js";
@@ -64,7 +64,7 @@ import {
64
64
  } from "./chunk-NQ2CC67G.js";
65
65
  import {
66
66
  withPrerequisite
67
- } from "./chunk-RIMEO4AY.js";
67
+ } from "./chunk-6B7IGVVI.js";
68
68
  import {
69
69
  NOOP_NOTIFIER,
70
70
  RateLimiter,
@@ -88,7 +88,7 @@ import {
88
88
  withAuditTrail,
89
89
  withProgressHeartbeat,
90
90
  wrapToolWithTimeout
91
- } from "./chunk-HJUL6YRG.js";
91
+ } from "./chunk-QBBQA57Z.js";
92
92
  import {
93
93
  createAuditTrail,
94
94
  createGraphAuditBridge,
@@ -27003,10 +27003,10 @@ function calculateZStatistic(params) {
27003
27003
  function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
27004
27004
  const difference = p1 - p2;
27005
27005
  const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
27006
- const z126 = getZScore(confidence);
27006
+ const z127 = getZScore(confidence);
27007
27007
  return {
27008
- lower: difference - z126 * seDiff,
27009
- upper: difference + z126 * seDiff,
27008
+ lower: difference - z127 * seDiff,
27009
+ upper: difference + z127 * seDiff,
27010
27010
  estimate: difference,
27011
27011
  confidence,
27012
27012
  n: total1 + total2,
@@ -27029,11 +27029,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
27029
27029
  standardError: 0
27030
27030
  };
27031
27031
  }
27032
- const z126 = getZScore(opts.confidence);
27033
- const z210 = z126 * z126;
27032
+ const z127 = getZScore(opts.confidence);
27033
+ const z210 = z127 * z127;
27034
27034
  const denominator = 1 + z210 / n;
27035
27035
  const center = (p + z210 / (2 * n)) / denominator;
27036
- const margin = z126 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
27036
+ const margin = z127 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
27037
27037
  const lower = Math.max(0, center - margin);
27038
27038
  const upper = Math.min(1, center + margin);
27039
27039
  const standardError = Math.sqrt(p * (1 - p) / n);
@@ -27063,8 +27063,8 @@ function meanConfidenceInterval(values, options = {}) {
27063
27063
  const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
27064
27064
  const stdDev = Math.sqrt(variance);
27065
27065
  const standardError = stdDev / Math.sqrt(n);
27066
- const z126 = getZScore(opts.confidence);
27067
- const margin = z126 * standardError;
27066
+ const z127 = getZScore(opts.confidence);
27067
+ const margin = z127 * standardError;
27068
27068
  return {
27069
27069
  lower: mean - margin,
27070
27070
  upper: mean + margin,
@@ -46407,31 +46407,94 @@ Verdict: PASS/NEEDS_WORK/REJECT`;
46407
46407
  }
46408
46408
 
46409
46409
  // src/security/sarif-parser.ts
46410
- function tryParseJson(json) {
46410
+ import { z as z99 } from "zod";
46411
+ var SarifLocationSchema = z99.object({
46412
+ physicalLocation: z99.object({
46413
+ artifactLocation: z99.object({ uri: z99.string().min(1).optional() }).optional(),
46414
+ region: z99.object({
46415
+ startLine: z99.number().int().min(1).optional(),
46416
+ endLine: z99.number().int().min(1).optional(),
46417
+ snippet: z99.object({ text: z99.string().optional() }).optional()
46418
+ }).optional()
46419
+ }).optional()
46420
+ });
46421
+ var SarifResultSchema = z99.object({
46422
+ ruleId: z99.string().nullish(),
46423
+ level: z99.string().nullish(),
46424
+ message: z99.object({ text: z99.string().optional() }).nullish(),
46425
+ locations: z99.array(SarifLocationSchema).nullish()
46426
+ });
46427
+ var SarifRuleSchema = z99.object({
46428
+ id: z99.string(),
46429
+ shortDescription: z99.object({ text: z99.string().optional() }).optional(),
46430
+ defaultConfiguration: z99.object({ level: z99.string().optional() }).optional(),
46431
+ properties: z99.object({
46432
+ precision: z99.string().optional(),
46433
+ tags: z99.array(z99.string()).optional(),
46434
+ "security-severity": z99.string().optional()
46435
+ }).optional(),
46436
+ helpUri: z99.string().optional(),
46437
+ help: z99.object({ markdown: z99.string().optional() }).optional()
46438
+ });
46439
+ var SarifRunSchema = z99.object({
46440
+ tool: z99.object({
46441
+ driver: z99.object({
46442
+ name: z99.string().optional(),
46443
+ rules: z99.array(z99.unknown()).optional()
46444
+ }).optional()
46445
+ }).optional(),
46446
+ results: z99.array(z99.unknown()).nullish()
46447
+ });
46448
+ var SarifLogSchema = z99.object({
46449
+ version: z99.string().optional(),
46450
+ runs: z99.array(z99.unknown()).optional()
46451
+ });
46452
+ var UNMAPPED_LEVEL_SEVERITY = "high";
46453
+ var MAX_MESSAGE_LENGTH = 2e3;
46454
+ function parseEnvelope(json) {
46455
+ let raw;
46411
46456
  try {
46412
- return JSON.parse(json);
46457
+ raw = JSON.parse(json);
46413
46458
  } catch {
46414
- return null;
46459
+ return { ok: false, error: "Invalid JSON" };
46460
+ }
46461
+ const parsed = SarifLogSchema.safeParse(raw);
46462
+ if (!parsed.success) {
46463
+ return { ok: false, error: `Malformed SARIF log: ${describeZodError(parsed.error)}` };
46415
46464
  }
46465
+ return { ok: true, log: parsed.data };
46466
+ }
46467
+ function describeZodError(error) {
46468
+ return error.issues.slice(0, 3).map((issue) => {
46469
+ const path12 = issue.path.length > 0 ? issue.path.join(".") : "(root)";
46470
+ return `${path12}: ${issue.message}`;
46471
+ }).join("; ");
46416
46472
  }
46417
46473
  function parseSarif(sarifJson, maxFindings = 100) {
46418
46474
  const errors = [];
46419
- const log = tryParseJson(sarifJson);
46420
- if (log === null) {
46421
- return { scanner: "unknown", totalFindings: 0, findings: [], errors: ["Invalid JSON"] };
46475
+ const envelope = parseEnvelope(sarifJson);
46476
+ if (!envelope.ok) {
46477
+ return { scanner: "unknown", totalFindings: 0, findings: [], errors: [envelope.error] };
46422
46478
  }
46423
- return parseLog(log, maxFindings, errors);
46479
+ return parseLog(envelope.log, maxFindings, errors);
46480
+ }
46481
+ function describeDriver(run) {
46482
+ const driver = run.tool?.driver;
46483
+ return { scanner: driver?.name ?? "unknown", rules: driver?.rules ?? [] };
46484
+ }
46485
+ function emptyResult(error) {
46486
+ return { scanner: "unknown", totalFindings: 0, findings: [], errors: [error] };
46424
46487
  }
46425
46488
  function parseLog(log, maxFindings, errors) {
46426
46489
  const runs = log.runs;
46427
- if (runs === void 0 || runs.length === 0) {
46428
- return { scanner: "unknown", totalFindings: 0, findings: [], errors: ["No runs in SARIF"] };
46490
+ if (runs === void 0 || runs.length === 0) return emptyResult("No runs in SARIF");
46491
+ const parsedRun = SarifRunSchema.safeParse(runs[0]);
46492
+ if (!parsedRun.success) {
46493
+ return emptyResult(`Malformed SARIF run: ${describeZodError(parsedRun.error)}`);
46429
46494
  }
46430
- const run = runs[0];
46431
- const scanner = run.tool?.driver?.name ?? "unknown";
46432
- const ruleMap = buildRuleMap(run.tool?.driver?.rules ?? []);
46433
- const results = run.results ?? [];
46434
- const findings = collectFindings(results, scanner, ruleMap, errors);
46495
+ const { scanner, rules } = describeDriver(parsedRun.data);
46496
+ const ruleMap = buildRuleMap(rules, errors);
46497
+ const findings = collectFindings(parsedRun.data.results ?? [], scanner, ruleMap, errors);
46435
46498
  return {
46436
46499
  scanner,
46437
46500
  totalFindings: findings.length,
@@ -46441,17 +46504,27 @@ function parseLog(log, maxFindings, errors) {
46441
46504
  }
46442
46505
  function collectFindings(results, scanner, ruleMap, errors) {
46443
46506
  const findings = [];
46444
- for (const result of results) {
46445
- const finding = parseResult(result, scanner, ruleMap, errors);
46507
+ for (const [index, raw] of results.entries()) {
46508
+ const parsed = SarifResultSchema.safeParse(raw);
46509
+ if (!parsed.success) {
46510
+ errors.push(`Skipped result ${String(index)}: ${describeZodError(parsed.error)}`);
46511
+ continue;
46512
+ }
46513
+ const finding = parseResult(parsed.data, scanner, ruleMap, errors);
46446
46514
  if (finding !== null) findings.push(finding);
46447
46515
  }
46448
46516
  findings.sort((a, b) => SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity]);
46449
46517
  return findings;
46450
46518
  }
46451
- function buildRuleMap(rules) {
46519
+ function buildRuleMap(rules, errors) {
46452
46520
  const map = /* @__PURE__ */ new Map();
46453
- for (const rule of rules) {
46454
- map.set(rule.id, rule);
46521
+ for (const [index, raw] of rules.entries()) {
46522
+ const parsed = SarifRuleSchema.safeParse(raw);
46523
+ if (!parsed.success) {
46524
+ errors.push(`Skipped rule ${String(index)}: ${describeZodError(parsed.error)}`);
46525
+ continue;
46526
+ }
46527
+ map.set(parsed.data.id, parsed.data);
46455
46528
  }
46456
46529
  return map;
46457
46530
  }
@@ -46459,6 +46532,7 @@ function getFirstPhysicalLocation(result) {
46459
46532
  const locations = result.locations;
46460
46533
  if (locations === void 0 || locations === null || locations.length === 0) return null;
46461
46534
  const first = locations[0];
46535
+ if (first === void 0) return null;
46462
46536
  return first.physicalLocation ?? null;
46463
46537
  }
46464
46538
  function buildLocation(file, startLine, phys) {
@@ -46477,6 +46551,15 @@ function extractLocation(result) {
46477
46551
  if (file === void 0 || file === "" || startLine === void 0) return null;
46478
46552
  return buildLocation(file, startLine, phys);
46479
46553
  }
46554
+ function severityWithDisclosure(result, rule, ruleId, errors) {
46555
+ const { severity, unmappedLevel } = resolveSeverity(result.level ?? void 0, rule);
46556
+ if (unmappedLevel !== void 0) {
46557
+ errors.push(
46558
+ `Finding ${ruleId}: SARIF level '${unmappedLevel}' is not defined by the spec; severity recorded as '${severity}' (fail-closed), not measured`
46559
+ );
46560
+ }
46561
+ return severity;
46562
+ }
46480
46563
  function parseResult(result, scanner, ruleMap, errors) {
46481
46564
  const ruleId = result.ruleId ?? "unknown";
46482
46565
  const rule = ruleMap.get(ruleId);
@@ -46485,12 +46568,14 @@ function parseResult(result, scanner, ruleMap, errors) {
46485
46568
  errors.push(`Skipped finding ${ruleId}: missing location`);
46486
46569
  return null;
46487
46570
  }
46488
- const message = result.message?.text ?? rule?.shortDescription?.text ?? ruleId;
46571
+ const rawMessage = result.message?.text ?? rule?.shortDescription?.text ?? ruleId;
46572
+ const message = rawMessage.slice(0, MAX_MESSAGE_LENGTH);
46573
+ const severity = severityWithDisclosure(result, rule, ruleId, errors);
46489
46574
  return {
46490
46575
  id: `${scanner}:${ruleId}:${loc.file}:${String(loc.startLine)}`,
46491
46576
  scanner,
46492
46577
  rule: ruleId,
46493
- severity: resolveSeverity(result.level ?? void 0, rule),
46578
+ severity,
46494
46579
  message,
46495
46580
  file: loc.file,
46496
46581
  startLine: loc.startLine,
@@ -46509,11 +46594,16 @@ function scoreToSeverity(score) {
46509
46594
  }
46510
46595
  function resolveSeverity(level, rule) {
46511
46596
  const fromScore = resolveSeverityFromScore(rule);
46512
- if (fromScore !== null) return fromScore;
46513
- if (level !== void 0) return SARIF_LEVEL_MAP[level] ?? "medium";
46597
+ if (fromScore !== null) return { severity: fromScore };
46598
+ if (level !== void 0) return mapLevel(level);
46514
46599
  const ruleLevel = rule?.defaultConfiguration?.level;
46515
- if (ruleLevel !== void 0) return SARIF_LEVEL_MAP[ruleLevel] ?? "medium";
46516
- return "medium";
46600
+ if (ruleLevel !== void 0) return mapLevel(ruleLevel);
46601
+ return { severity: "medium" };
46602
+ }
46603
+ function mapLevel(level) {
46604
+ const mapped = SARIF_LEVEL_MAP[level];
46605
+ if (mapped !== void 0) return { severity: mapped };
46606
+ return { severity: UNMAPPED_LEVEL_SEVERITY, unmappedLevel: level };
46517
46607
  }
46518
46608
  function resolveSeverityFromScore(rule) {
46519
46609
  if (rule === void 0) return null;
@@ -46612,18 +46702,18 @@ async function executeSecurityScan(input) {
46612
46702
  }
46613
46703
 
46614
46704
  // src/security/osv-lookup.ts
46615
- import { z as z99 } from "zod";
46705
+ import { z as z100 } from "zod";
46616
46706
  var logger44 = createLogger({ component: "osv-lookup" });
46617
46707
  var OSV_API_URL = "https://api.osv.dev/v1/query";
46618
46708
  var DEFAULT_TIMEOUT_MS4 = NETWORK_FETCH_TIMEOUT_MS;
46619
- var OsvVulnerabilitySchema = z99.object({
46620
- id: z99.string(),
46621
- summary: z99.string().optional(),
46622
- severity: z99.enum(["CRITICAL", "HIGH", "MODERATE", "LOW", "UNKNOWN"]).optional(),
46623
- aliases: z99.array(z99.string()).default([]),
46624
- affectedVersions: z99.string().optional(),
46625
- fixedVersion: z99.string().optional(),
46626
- url: z99.string().optional()
46709
+ var OsvVulnerabilitySchema = z100.object({
46710
+ id: z100.string(),
46711
+ summary: z100.string().optional(),
46712
+ severity: z100.enum(["CRITICAL", "HIGH", "MODERATE", "LOW", "UNKNOWN"]).optional(),
46713
+ aliases: z100.array(z100.string()).default([]),
46714
+ affectedVersions: z100.string().optional(),
46715
+ fixedVersion: z100.string().optional(),
46716
+ url: z100.string().optional()
46627
46717
  });
46628
46718
  var DEFAULT_OSV_CONFIG = {
46629
46719
  timeoutMs: DEFAULT_TIMEOUT_MS4
@@ -47369,7 +47459,7 @@ ${contextBlock}`;
47369
47459
  const strategy = config.votingStrategy ?? "higher_order";
47370
47460
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
47371
47461
  try {
47372
- const { executeVoting } = await import("./consensus-vote-5XRP2OY4.js");
47462
+ const { executeVoting } = await import("./consensus-vote-XICKVHZF.js");
47373
47463
  const votingResult = await executeVoting(
47374
47464
  {
47375
47465
  proposal: buildVoteProposal(plan, research),
@@ -47909,7 +47999,7 @@ function createAuditStageRegistry() {
47909
47999
  }
47910
48000
 
47911
48001
  // src/mcp/tools/pr-review-tool.ts
47912
- import { z as z101 } from "zod";
48002
+ import { z as z102 } from "zod";
47913
48003
  import { randomUUID as randomUUID13 } from "crypto";
47914
48004
 
47915
48005
  // src/mcp/tools/pr-review-findings.ts
@@ -48025,17 +48115,17 @@ import { dirname as dirname4, isAbsolute, join as join11, resolve as resolve15 }
48025
48115
 
48026
48116
  // src/audit/pr-review-record.ts
48027
48117
  import * as crypto3 from "crypto";
48028
- import { z as z100 } from "zod";
48029
- var PrReviewVerdictSchema = z100.enum(["approve", "request_changes", "abstain"]);
48030
- var PrReviewVoteCountsSchema = z100.object({
48031
- approve: z100.number().int().nonnegative(),
48032
- request_changes: z100.number().int().nonnegative(),
48033
- abstain: z100.number().int().nonnegative(),
48034
- error: z100.number().int().nonnegative(),
48035
- total: z100.number().int().nonnegative()
48118
+ import { z as z101 } from "zod";
48119
+ var PrReviewVerdictSchema = z101.enum(["approve", "request_changes", "abstain"]);
48120
+ var PrReviewVoteCountsSchema = z101.object({
48121
+ approve: z101.number().int().nonnegative(),
48122
+ request_changes: z101.number().int().nonnegative(),
48123
+ abstain: z101.number().int().nonnegative(),
48124
+ error: z101.number().int().nonnegative(),
48125
+ total: z101.number().int().nonnegative()
48036
48126
  }).strict();
48037
- var PrReviewDiffSourceSchema = z100.enum(["canonical-git", "caller-supplied"]);
48038
- var PrReviewDiffProvenanceSchema = z100.object({
48127
+ var PrReviewDiffSourceSchema = z101.enum(["canonical-git", "caller-supplied"]);
48128
+ var PrReviewDiffProvenanceSchema = z101.object({
48039
48129
  /** How the reviewed diff was obtained. */
48040
48130
  source: PrReviewDiffSourceSchema,
48041
48131
  /**
@@ -48047,9 +48137,9 @@ var PrReviewDiffProvenanceSchema = z100.object({
48047
48137
  * per-file attribution is unavailable. `false` means "a diff, but the packer
48048
48138
  * saw it as one undifferentiated blob".
48049
48139
  */
48050
- fileBoundaries: z100.boolean()
48140
+ fileBoundaries: z101.boolean()
48051
48141
  }).strict();
48052
- var PrReviewRecordSchema = z100.object({
48142
+ var PrReviewRecordSchema = z101.object({
48053
48143
  /**
48054
48144
  * Schema version. '1.1' was the Option-C binding (#3831): the record binds to
48055
48145
  * `{prNumber, baseSha, reviewedDiffHash}` instead of the rejected `headSha`.
@@ -48061,22 +48151,22 @@ var PrReviewRecordSchema = z100.object({
48061
48151
  * records at the time of this bump), so there is no data to migrate and no
48062
48152
  * reason to keep a tolerant version union.
48063
48153
  */
48064
- version: z100.literal("1.2"),
48154
+ version: z101.literal("1.2"),
48065
48155
  /**
48066
48156
  * Monotonic sequence number (integer ≥ 0). Assigned as (max existing
48067
48157
  * sequence)+1 at write time. Sorted, the set of sequences must cover
48068
48158
  * 0..maxSeq with no gap (omission detection); DUPLICATE sequences are a
48069
48159
  * benign concurrent-fork signal, not tampering.
48070
48160
  */
48071
- sequence: z100.number().int().nonnegative(),
48161
+ sequence: z101.number().int().nonnegative(),
48072
48162
  /** The PR number the review covers. */
48073
- prNumber: z100.number().int().positive(),
48163
+ prNumber: z101.number().int().positive(),
48074
48164
  /**
48075
48165
  * The 40-hex BASE commit SHA the reviewed diff was computed against (the
48076
48166
  * `<base>..<head>` range base). Part of the Option-C binding so the gate knows
48077
48167
  * which range to recompute {@link reviewedDiffHash} over.
48078
48168
  */
48079
- baseSha: z100.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha"),
48169
+ baseSha: z101.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha"),
48080
48170
  /**
48081
48171
  * DIFF-BINDING (Option-C, #3831): sha256 of the canonical reviewed diff bytes
48082
48172
  * (see `audit/reviewed-diff-hash.ts` — pinned `git diff` invocation + 50k
@@ -48085,9 +48175,9 @@ var PrReviewRecordSchema = z100.object({
48085
48175
  * byte-identical to what the voters saw. Covered by the self-hash below, so it
48086
48176
  * cannot be edited to claim a different reviewed diff.
48087
48177
  */
48088
- reviewedDiffHash: z100.string().length(64),
48178
+ reviewedDiffHash: z101.string().length(64),
48089
48179
  /** ISO-8601 timestamp the review was recorded. */
48090
- recordedAt: z100.string().min(1),
48180
+ recordedAt: z101.string().min(1),
48091
48181
  /** The resolved aggregate verdict. */
48092
48182
  verdict: PrReviewVerdictSchema,
48093
48183
  /**
@@ -48095,13 +48185,13 @@ var PrReviewRecordSchema = z100.object({
48095
48185
  * `request_changes` with `verified: true` is a strict blocker; covered by the
48096
48186
  * hash so it cannot be flipped without detection.
48097
48187
  */
48098
- verified: z100.boolean(),
48188
+ verified: z101.boolean(),
48099
48189
  /** Per-decision voter tally from the pr_review aggregate. */
48100
48190
  voteCounts: PrReviewVoteCountsSchema,
48101
48191
  /** Truncated human-readable review summary for the reviewer record. */
48102
- summary: z100.string(),
48192
+ summary: z101.string(),
48103
48193
  /** Optional correlation/decision id linking to the cost rollup / trace. */
48104
- correlationId: z100.string().min(1).optional(),
48194
+ correlationId: z101.string().min(1).optional(),
48105
48195
  /**
48106
48196
  * What this record was DERIVED FROM (#4459). OPTIONAL by necessity: the
48107
48197
  * schema is `.strict()`, so a required field would reject every record
@@ -48114,9 +48204,9 @@ var PrReviewRecordSchema = z100.object({
48114
48204
  * Retained for audit texture but NOT covered by `hash` and NOT verified —
48115
48205
  * the record-set model is position-independent (mirrors #3927).
48116
48206
  */
48117
- previousHash: z100.string().length(64).optional(),
48207
+ previousHash: z101.string().length(64).optional(),
48118
48208
  /** SHA-256 over every field above EXCEPT `previousHash` (and except `hash`). */
48119
- hash: z100.string().length(64)
48209
+ hash: z101.string().length(64)
48120
48210
  }).strict();
48121
48211
  function computePrReviewRecordHash(payload) {
48122
48212
  const canonical = JSON.stringify({
@@ -48571,19 +48661,19 @@ var MAX_DIFF_INPUT_LENGTH = 2e6;
48571
48661
  var MAX_REPO_CONTEXT_LENGTH = 2e3;
48572
48662
  var MAX_DESCRIPTION_LENGTH = 1e4;
48573
48663
  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.";
48574
- var PrReviewInputSchema = z101.object({
48575
- prTitle: z101.string().min(1).max(500).describe("PR title"),
48576
- prDescription: z101.string().max(MAX_DESCRIPTION_LENGTH).optional().describe("PR body / description"),
48577
- prDiff: z101.string().min(1).max(MAX_DIFF_INPUT_LENGTH).refine(looksLikeUnifiedDiff, {
48664
+ var PrReviewInputSchema = z102.object({
48665
+ prTitle: z102.string().min(1).max(500).describe("PR title"),
48666
+ prDescription: z102.string().max(MAX_DESCRIPTION_LENGTH).optional().describe("PR body / description"),
48667
+ prDiff: z102.string().min(1).max(MAX_DIFF_INPUT_LENGTH).refine(looksLikeUnifiedDiff, {
48578
48668
  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)."
48579
48669
  }).describe(
48580
48670
  `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: diffs over ${String(MAX_DIFF_LENGTH)} chars are security-prioritized and PARTIALLY reviewed (lowest-priority whole files dropped; coverage reported on the response, and a partial review can block but never verified-approve).`
48581
48671
  ),
48582
- repoContext: z101.string().max(MAX_REPO_CONTEXT_LENGTH).optional().describe(
48672
+ repoContext: z102.string().max(MAX_REPO_CONTEXT_LENGTH).optional().describe(
48583
48673
  `Optional one-paragraph repo context (architecture, conventions; max ${String(MAX_REPO_CONTEXT_LENGTH)} chars; trim before calling)`
48584
48674
  ),
48585
- baseRef: z101.string().max(200).optional().describe("Base branch ref (e.g. main)"),
48586
- headRef: z101.string().max(200).optional().describe("Head branch ref"),
48675
+ baseRef: z102.string().max(200).optional().describe("Base branch ref (e.g. main)"),
48676
+ headRef: z102.string().max(200).optional().describe("Head branch ref"),
48587
48677
  /**
48588
48678
  * Option-C audit binding (#4031). When BOTH `prNumber` and `baseSha` are
48589
48679
  * supplied AND the review is live (not simulated), pr_review persists an
@@ -48595,14 +48685,14 @@ var PrReviewInputSchema = z101.object({
48595
48685
  * canonical `git diff <baseSha>..<headSha>` the gate recomputes (the hash
48596
48686
  * truncates at that byte cap) — pass the canonical diff, not a reordered one.
48597
48687
  */
48598
- prNumber: z101.number().int().positive().optional().describe("PR number \u2014 with baseSha, enables Option-C audit-record persistence (#4031)"),
48599
- baseSha: z101.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha").optional().describe(
48688
+ prNumber: z102.number().int().positive().optional().describe("PR number \u2014 with baseSha, enables Option-C audit-record persistence (#4031)"),
48689
+ baseSha: z102.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha").optional().describe(
48600
48690
  "40-hex base commit sha the reviewed diff was computed from (Option-C binding, #4031)"
48601
48691
  ),
48602
- repoPath: z101.string().max(1024).optional().describe(
48692
+ repoPath: z102.string().max(1024).optional().describe(
48603
48693
  "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."
48604
48694
  ),
48605
- simulate: z101.boolean().default(false).describe("Use simulated voters (testing only; never ship live with this true)"),
48695
+ simulate: z102.boolean().default(false).describe("Use simulated voters (testing only; never ship live with this true)"),
48606
48696
  /**
48607
48697
  * Error policy (#4132). `standard` (default) keeps the pre-#4132 aggregation:
48608
48698
  * an errored voter is simply excluded from the panel. `absolute_quorum` gates
@@ -48614,7 +48704,7 @@ var PrReviewInputSchema = z101.object({
48614
48704
  * verified approve. A genuine `request_changes` blocker still wins (Tiers 1-2
48615
48705
  * run first).
48616
48706
  */
48617
- errorPolicy: z101.enum(["standard", "absolute_quorum"]).default("standard").describe(
48707
+ errorPolicy: z102.enum(["standard", "absolute_quorum"]).default("standard").describe(
48618
48708
  "Error policy (#4132). 'standard' (default): errored voters excluded. '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."
48619
48709
  ),
48620
48710
  /**
@@ -48624,7 +48714,7 @@ var PrReviewInputSchema = z101.object({
48624
48714
  * runs the panel in the background; poll `get_job_result({ jobId })` for the
48625
48715
  * result.
48626
48716
  */
48627
- dispatch: z101.enum(["sync", "async"]).default("sync").describe(
48717
+ dispatch: z102.enum(["sync", "async"]).default("sync").describe(
48628
48718
  "Dispatch mode (#3731). 'sync' (default): run inline. 'async': return a jobId immediately + run the panel in background (poll get_job_result)."
48629
48719
  )
48630
48720
  });
@@ -48859,27 +48949,27 @@ function registerPrReviewTool(server, deps) {
48859
48949
  }
48860
48950
 
48861
48951
  // src/mcp/tools/survey-oss-landscape.ts
48862
- import { z as z102 } from "zod";
48863
- var SurveyOssLandscapeInputSchema = z102.object({
48864
- query: z102.string().min(1).max(200).describe('Free-text search query, e.g. "cargo nextest replacement" or "OSS SBOM tools"'),
48865
- maxResults: z102.number().int().min(1).max(50).optional().default(10).describe("Maximum candidates to return (1-50; default 10)"),
48866
- minStars: z102.number().int().min(0).optional().default(0).describe("Minimum star count to include (default 0; useful for filtering noise)"),
48867
- language: z102.string().max(50).optional().describe('GitHub language filter, e.g. "rust" or "typescript"')
48868
- });
48869
- var GitHubRepoSchema = z102.object({
48870
- full_name: z102.string().optional(),
48871
- html_url: z102.string().optional(),
48872
- description: z102.string().nullable().optional(),
48873
- stargazers_count: z102.number().optional(),
48874
- pushed_at: z102.string().nullable().optional(),
48875
- language: z102.string().nullable().optional(),
48876
- license: z102.object({
48877
- spdx_id: z102.string().nullable().optional()
48952
+ import { z as z103 } from "zod";
48953
+ var SurveyOssLandscapeInputSchema = z103.object({
48954
+ query: z103.string().min(1).max(200).describe('Free-text search query, e.g. "cargo nextest replacement" or "OSS SBOM tools"'),
48955
+ maxResults: z103.number().int().min(1).max(50).optional().default(10).describe("Maximum candidates to return (1-50; default 10)"),
48956
+ minStars: z103.number().int().min(0).optional().default(0).describe("Minimum star count to include (default 0; useful for filtering noise)"),
48957
+ language: z103.string().max(50).optional().describe('GitHub language filter, e.g. "rust" or "typescript"')
48958
+ });
48959
+ var GitHubRepoSchema = z103.object({
48960
+ full_name: z103.string().optional(),
48961
+ html_url: z103.string().optional(),
48962
+ description: z103.string().nullable().optional(),
48963
+ stargazers_count: z103.number().optional(),
48964
+ pushed_at: z103.string().nullable().optional(),
48965
+ language: z103.string().nullable().optional(),
48966
+ license: z103.object({
48967
+ spdx_id: z103.string().nullable().optional()
48878
48968
  }).nullable().optional()
48879
48969
  });
48880
- var GitHubSearchResponseSchema = z102.object({
48881
- total_count: z102.number().optional(),
48882
- items: z102.array(GitHubRepoSchema).optional()
48970
+ var GitHubSearchResponseSchema = z103.object({
48971
+ total_count: z103.number().optional(),
48972
+ items: z103.array(GitHubRepoSchema).optional()
48883
48973
  });
48884
48974
  var GITHUB_SEARCH_BASE = "https://api.github.com/search/repositories";
48885
48975
  function buildGithubQuery(input) {
@@ -49006,11 +49096,11 @@ function createSurveyHandler(deps) {
49006
49096
  };
49007
49097
  }
49008
49098
  var SURVEY_OUTPUT_SCHEMA = {
49009
- query: z102.string(),
49010
- totalFound: z102.number(),
49011
- candidates: z102.array(z102.unknown()),
49012
- sourcesQueried: z102.array(z102.string()),
49013
- sourcesFailed: z102.array(z102.string())
49099
+ query: z103.string(),
49100
+ totalFound: z103.number(),
49101
+ candidates: z103.array(z103.unknown()),
49102
+ sourcesQueried: z103.array(z103.string()),
49103
+ sourcesFailed: z103.array(z103.string())
49014
49104
  };
49015
49105
  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?".';
49016
49106
  function registerSurveyOssLandscapeTool(server, deps) {
@@ -49039,7 +49129,7 @@ function registerSurveyOssLandscapeTool(server, deps) {
49039
49129
  }
49040
49130
 
49041
49131
  // src/mcp/tools/vendor-publishing-audit.ts
49042
- import { z as z103 } from "zod";
49132
+ import { z as z104 } from "zod";
49043
49133
 
49044
49134
  // src/mcp/tools/vendor-publishing-seed.ts
49045
49135
  var VENDOR_PUBLISHING_SEED = {
@@ -49112,8 +49202,8 @@ function listKnownVendors() {
49112
49202
  }
49113
49203
 
49114
49204
  // src/mcp/tools/vendor-publishing-audit.ts
49115
- var VendorPublishingAuditInputSchema = z103.object({
49116
- vendor: z103.string().min(1).max(50).toLowerCase().describe('Vendor identifier, lowercase. e.g. "ubuntu", "debian", "fedora"')
49205
+ var VendorPublishingAuditInputSchema = z104.object({
49206
+ vendor: z104.string().min(1).max(50).toLowerCase().describe('Vendor identifier, lowercase. e.g. "ubuntu", "debian", "fedora"')
49117
49207
  });
49118
49208
  function lookupVendor(vendor) {
49119
49209
  if (isKnownVendor(vendor)) {
@@ -49145,20 +49235,20 @@ function createVendorPublishingAuditHandler(deps) {
49145
49235
  };
49146
49236
  }
49147
49237
  var VENDOR_PUBLISHING_OUTPUT_SCHEMA = {
49148
- vendor: z103.string(),
49149
- known: z103.boolean(),
49238
+ vendor: z104.string(),
49239
+ known: z104.boolean(),
49150
49240
  // Fields below populate when known=true; permissive optional for known=false.
49151
- sha256SumsUrlPattern: z103.string().optional(),
49152
- sha256SumsSignatureUrlPattern: z103.string().optional(),
49153
- signaturePattern: z103.string().optional(),
49154
- gpgKeys: z103.array(z103.unknown()).optional(),
49155
- releaseCadence: z103.string().optional(),
49156
- keyRotationNotes: z103.string().optional(),
49157
- vendorDocUrl: z103.string().optional(),
49158
- citedAt: z103.string().optional(),
49241
+ sha256SumsUrlPattern: z104.string().optional(),
49242
+ sha256SumsSignatureUrlPattern: z104.string().optional(),
49243
+ signaturePattern: z104.string().optional(),
49244
+ gpgKeys: z104.array(z104.unknown()).optional(),
49245
+ releaseCadence: z104.string().optional(),
49246
+ keyRotationNotes: z104.string().optional(),
49247
+ vendorDocUrl: z104.string().optional(),
49248
+ citedAt: z104.string().optional(),
49159
49249
  // Fields below populate when known=false.
49160
- message: z103.string().optional(),
49161
- knownVendors: z103.array(z103.string()).optional()
49250
+ message: z104.string().optional(),
49251
+ knownVendors: z104.array(z104.string()).optional()
49162
49252
  };
49163
49253
  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.";
49164
49254
  function registerVendorPublishingAuditTool(server, deps) {
@@ -49187,17 +49277,17 @@ function registerVendorPublishingAuditTool(server, deps) {
49187
49277
  }
49188
49278
 
49189
49279
  // src/mcp/tools/compare-data-feeds.ts
49190
- import { z as z104 } from "zod";
49280
+ import { z as z105 } from "zod";
49191
49281
  import * as path7 from "path";
49192
49282
  import * as fs8 from "fs";
49193
49283
  import * as yaml4 from "yaml";
49194
- var CompareDataFeedsInputSchema = z104.object({
49195
- feedAPath: z104.string().min(1).max(1e3).describe("Filesystem path to feed A (YAML or JSON, auto-detected by extension)"),
49196
- feedBPath: z104.string().min(1).max(1e3).describe("Filesystem path to feed B"),
49197
- keyPath: z104.string().min(1).max(200).describe(
49284
+ var CompareDataFeedsInputSchema = z105.object({
49285
+ feedAPath: z105.string().min(1).max(1e3).describe("Filesystem path to feed A (YAML or JSON, auto-detected by extension)"),
49286
+ feedBPath: z105.string().min(1).max(1e3).describe("Filesystem path to feed B"),
49287
+ keyPath: z105.string().min(1).max(200).describe(
49198
49288
  'Dotted path to the entry key, e.g. "id" or "name". Each entry must have this field.'
49199
49289
  ),
49200
- compareFields: z104.array(z104.string().min(1).max(200)).max(20).optional().describe(
49290
+ compareFields: z105.array(z105.string().min(1).max(200)).max(20).optional().describe(
49201
49291
  'Optional dotted field paths to compare across matched entries (e.g. ["license", "sha256"])'
49202
49292
  )
49203
49293
  });
@@ -49381,24 +49471,24 @@ function createCompareDataFeedsHandler(deps) {
49381
49471
  };
49382
49472
  }
49383
49473
  var COMPARE_OUTPUT_SCHEMA = {
49384
- feedAPath: z104.string(),
49385
- feedBPath: z104.string(),
49386
- keyPath: z104.string(),
49387
- counts: z104.object({
49388
- entriesInA: z104.number(),
49389
- entriesInB: z104.number(),
49390
- onlyInA: z104.number(),
49391
- onlyInB: z104.number(),
49392
- inBoth: z104.number(),
49393
- fieldDifferences: z104.number()
49474
+ feedAPath: z105.string(),
49475
+ feedBPath: z105.string(),
49476
+ keyPath: z105.string(),
49477
+ counts: z105.object({
49478
+ entriesInA: z105.number(),
49479
+ entriesInB: z105.number(),
49480
+ onlyInA: z105.number(),
49481
+ onlyInB: z105.number(),
49482
+ inBoth: z105.number(),
49483
+ fieldDifferences: z105.number()
49394
49484
  }),
49395
- coverage: z104.object({
49396
- onlyInA: z104.array(z104.string()),
49397
- onlyInB: z104.array(z104.string()),
49398
- inBoth: z104.array(z104.string())
49485
+ coverage: z105.object({
49486
+ onlyInA: z105.array(z105.string()),
49487
+ onlyInB: z105.array(z105.string()),
49488
+ inBoth: z105.array(z105.string())
49399
49489
  }),
49400
- fieldDifferences: z104.array(z104.unknown()),
49401
- summary: z104.string()
49490
+ fieldDifferences: z105.array(z105.unknown()),
49491
+ summary: z105.string()
49402
49492
  };
49403
49493
  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.";
49404
49494
  function registerCompareDataFeedsTool(server, deps) {
@@ -49427,9 +49517,9 @@ function registerCompareDataFeedsTool(server, deps) {
49427
49517
  }
49428
49518
 
49429
49519
  // src/mcp/tools/query-task-state-tool.ts
49430
- import { z as z105 } from "zod";
49431
- var QueryTaskStateInputSchema = z105.object({
49432
- taskId: z105.string().min(1).max(128).describe("Task ID whose structured state log should be read")
49520
+ import { z as z106 } from "zod";
49521
+ var QueryTaskStateInputSchema = z106.object({
49522
+ taskId: z106.string().min(1).max(128).describe("Task ID whose structured state log should be read")
49433
49523
  });
49434
49524
  function queryTaskStateHandler(args, ctx) {
49435
49525
  const parsed = QueryTaskStateInputSchema.safeParse(args);
@@ -49464,7 +49554,7 @@ function queryTaskStateHandler(args, ctx) {
49464
49554
  function registerQueryTaskStateTool(server, deps) {
49465
49555
  const logger58 = deps.logger ?? createLogger({ tool: "query_task_state" });
49466
49556
  const toolSchema = {
49467
- taskId: z105.string().min(1).max(128).describe("Task ID whose structured state log should be read")
49557
+ taskId: z106.string().min(1).max(128).describe("Task ID whose structured state log should be read")
49468
49558
  };
49469
49559
  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.";
49470
49560
  const secureHandler = createSecureHandler(queryTaskStateHandler, {
@@ -49486,28 +49576,28 @@ function registerQueryTaskStateTool(server, deps) {
49486
49576
  }
49487
49577
 
49488
49578
  // src/mcp/tools/ci-health-check-tool.ts
49489
- import { z as z108 } from "zod";
49579
+ import { z as z109 } from "zod";
49490
49580
 
49491
49581
  // src/mcp/tools/ci-health-log.ts
49492
49582
  import { appendFileSync as appendFileSync5, existsSync as existsSync13, readFileSync as readFileSync11, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
49493
- import { z as z107 } from "zod";
49583
+ import { z as z108 } from "zod";
49494
49584
 
49495
49585
  // src/mcp/tools/ci-health-types.ts
49496
- import { z as z106 } from "zod";
49497
- var CiHealthStatusSchema = z106.enum(["healthy", "degraded", "outage", "unknown"]);
49586
+ import { z as z107 } from "zod";
49587
+ var CiHealthStatusSchema = z107.enum(["healthy", "degraded", "outage", "unknown"]);
49498
49588
 
49499
49589
  // src/mcp/tools/ci-health-log.ts
49500
49590
  var logger47 = createLogger({ component: "ci-health-log" });
49501
- var CiHealthEventSchema = z107.object({
49502
- v: z107.literal(1),
49503
- ts: z107.iso.datetime(),
49591
+ var CiHealthEventSchema = z108.object({
49592
+ v: z108.literal(1),
49593
+ ts: z108.iso.datetime(),
49504
49594
  status: CiHealthStatusSchema,
49505
- repo: z107.string().optional(),
49506
- signals: z107.array(
49507
- z107.object({
49508
- source: z107.enum(["github-status", "repo-activity-window"]),
49595
+ repo: z108.string().optional(),
49596
+ signals: z108.array(
49597
+ z108.object({
49598
+ source: z108.enum(["github-status", "repo-activity-window"]),
49509
49599
  status: CiHealthStatusSchema,
49510
- evidence: z107.string()
49600
+ evidence: z108.string()
49511
49601
  })
49512
49602
  )
49513
49603
  });
@@ -49587,17 +49677,17 @@ function eventFromCheck(params) {
49587
49677
  }
49588
49678
 
49589
49679
  // src/mcp/tools/ci-health-check-tool.ts
49590
- var CiHealthCheckInputSchema = z108.object({
49680
+ var CiHealthCheckInputSchema = z109.object({
49591
49681
  /**
49592
49682
  * Repo to check for the recent-runs activity signal (in `owner/repo` form).
49593
49683
  * Optional — when omitted, only the status-page signal is consulted.
49594
49684
  */
49595
- repo: z108.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."),
49685
+ repo: z109.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."),
49596
49686
  /**
49597
49687
  * How far back to look for recent-runs activity (minutes). Default 30 —
49598
49688
  * matches the typical wedge-detection window from the #3070 / #3076 outages.
49599
49689
  */
49600
- activityWindowMinutes: z108.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
49690
+ activityWindowMinutes: z109.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
49601
49691
  });
49602
49692
  var STATUS_PAGE_URL = "https://www.githubstatus.com/api/v2/components.json";
49603
49693
  function mapStatusPageStatus(raw) {
@@ -49730,8 +49820,8 @@ var DESCRIPTION = "Check CI infrastructure health before triggering / polling ru
49730
49820
  function registerCiHealthCheckTool(server, deps) {
49731
49821
  const logger58 = deps.logger ?? createLogger({ tool: "ci_health_check" });
49732
49822
  const toolSchema = {
49733
- repo: z108.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."),
49734
- activityWindowMinutes: z108.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
49823
+ repo: z109.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."),
49824
+ activityWindowMinutes: z109.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
49735
49825
  };
49736
49826
  const secureHandler = createSecureHandler((args) => ciHealthCheckHandler(args, logger58), {
49737
49827
  toolName: "ci_health_check",
@@ -49757,18 +49847,18 @@ function registerCiHealthCheckTool(server, deps) {
49757
49847
 
49758
49848
  // src/mcp/tools/quality-gate-tool.ts
49759
49849
  import { statSync as statSync3 } from "fs";
49760
- import { z as z109 } from "zod";
49761
- var QualityCheckSchema = z109.enum(["typecheck", "lint", "tests", "build", "security"]);
49850
+ import { z as z110 } from "zod";
49851
+ var QualityCheckSchema = z110.enum(["typecheck", "lint", "tests", "build", "security"]);
49762
49852
  var DEFAULT_CHECKS = ["typecheck", "lint", "tests"];
49763
- var RunQualityGateInputSchema = z109.object({
49853
+ var RunQualityGateInputSchema = z110.object({
49764
49854
  /** Project directory to run checks against. Must resolve inside the repo/cwd root. */
49765
- projectDir: z109.string().optional().describe(
49855
+ projectDir: z110.string().optional().describe(
49766
49856
  "Project directory to run checks against (default: cwd). Must stay inside the repo root."
49767
49857
  ),
49768
49858
  /** Which allowlisted checks to run. */
49769
- checks: z109.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
49859
+ checks: z110.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
49770
49860
  /** 1-based iteration counter, forwarded to the engine for feedback context. */
49771
- iteration: z109.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
49861
+ iteration: z110.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
49772
49862
  });
49773
49863
  function validateProjectDir(raw) {
49774
49864
  const candidate = raw ?? process.cwd();
@@ -49843,11 +49933,11 @@ var DESCRIPTION2 = "Run the QA quality gate (#1684 engine) against a project dir
49843
49933
  function registerRunQualityGateTool(server, deps) {
49844
49934
  const logger58 = deps.logger ?? createLogger({ tool: "run_quality_gate" });
49845
49935
  const toolSchema = {
49846
- projectDir: z109.string().optional().describe(
49936
+ projectDir: z110.string().optional().describe(
49847
49937
  "Project directory to run checks against (default: cwd). Must stay inside the repo root."
49848
49938
  ),
49849
- checks: z109.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
49850
- iteration: z109.number().int().min(1).optional().describe("1-based iteration number (default 1).")
49939
+ checks: z110.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
49940
+ iteration: z110.number().int().min(1).optional().describe("1-based iteration number (default 1).")
49851
49941
  };
49852
49942
  const secureHandler = createSecureHandler(
49853
49943
  (args) => runQualityGateHandler(args, logger58),
@@ -49877,9 +49967,9 @@ function registerRunQualityGateTool(server, deps) {
49877
49967
  // src/mcp/tools/verify-audit-chain-tool.ts
49878
49968
  import * as fs9 from "fs/promises";
49879
49969
  import * as path8 from "path";
49880
- import { z as z110 } from "zod";
49881
- var VerifyAuditChainInputSchema = z110.object({
49882
- logDir: z110.string().min(1).max(512).describe(
49970
+ import { z as z111 } from "zod";
49971
+ var VerifyAuditChainInputSchema = z111.object({
49972
+ logDir: z111.string().min(1).max(512).describe(
49883
49973
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files in lexicographic order and verifies the combined chain."
49884
49974
  )
49885
49975
  });
@@ -49969,7 +50059,7 @@ async function handler2(args, ctx) {
49969
50059
  function registerVerifyAuditChainTool(server, deps) {
49970
50060
  const logger58 = deps.logger ?? createLogger({ tool: "verify_audit_chain" });
49971
50061
  const toolSchema = {
49972
- logDir: z110.string().min(1).max(512).describe(
50062
+ logDir: z111.string().min(1).max(512).describe(
49973
50063
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files and verifies the combined hash chain."
49974
50064
  )
49975
50065
  };
@@ -49993,7 +50083,7 @@ function registerVerifyAuditChainTool(server, deps) {
49993
50083
  }
49994
50084
 
49995
50085
  // src/mcp/tools/suggest-research-tasks-tool.ts
49996
- import { z as z111 } from "zod";
50086
+ import { z as z112 } from "zod";
49997
50087
  var SUGGEST_RESEARCH_TASKS_NOTE = "Suggestions derived from external research (untrusted); review before acting \u2014 nothing was executed or filed.";
49998
50088
  var RESEARCH_BUDGET_MS = 2e4;
49999
50089
  var RESEARCH_TIMED_OUT = /* @__PURE__ */ Symbol("research-budget-exceeded");
@@ -50010,11 +50100,11 @@ async function withResearchBudget(p, ms) {
50010
50100
  if (timer !== void 0) clearTimeout(timer);
50011
50101
  }
50012
50102
  }
50013
- var SuggestResearchTasksInputSchema = z111.object({
50014
- topic: z111.string().optional().describe("Topic filter passed to research_discover. Optional."),
50015
- qualityThreshold: z111.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
50016
- maxTriggers: z111.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
50017
- existingTaskIds: z111.array(z111.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
50103
+ var SuggestResearchTasksInputSchema = z112.object({
50104
+ topic: z112.string().optional().describe("Topic filter passed to research_discover. Optional."),
50105
+ qualityThreshold: z112.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
50106
+ maxTriggers: z112.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
50107
+ existingTaskIds: z112.array(z112.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
50018
50108
  });
50019
50109
  function toTriggerConfig(input) {
50020
50110
  return {
@@ -50071,10 +50161,10 @@ var DESCRIPTION3 = "SUGGEST-ONLY: surface candidate pipeline tasks for human/orc
50071
50161
  function registerSuggestResearchTasksTool(server, deps) {
50072
50162
  const logger58 = deps.logger ?? createLogger({ tool: "suggest_research_tasks" });
50073
50163
  const toolSchema = {
50074
- topic: z111.string().optional().describe("Topic filter passed to research_discover. Optional."),
50075
- qualityThreshold: z111.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
50076
- maxTriggers: z111.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
50077
- existingTaskIds: z111.array(z111.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
50164
+ topic: z112.string().optional().describe("Topic filter passed to research_discover. Optional."),
50165
+ qualityThreshold: z112.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
50166
+ maxTriggers: z112.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
50167
+ existingTaskIds: z112.array(z112.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
50078
50168
  };
50079
50169
  const secureHandler = createSecureHandler(
50080
50170
  (args) => suggestResearchTasksHandler(args, logger58),
@@ -50102,7 +50192,7 @@ function registerSuggestResearchTasksTool(server, deps) {
50102
50192
  }
50103
50193
 
50104
50194
  // src/mcp/tools/run-tool.ts
50105
- import { z as z115 } from "zod";
50195
+ import { z as z116 } from "zod";
50106
50196
  import { randomUUID as randomUUID17 } from "crypto";
50107
50197
 
50108
50198
  // src/orchestration/meta-dispatcher.ts
@@ -50497,7 +50587,7 @@ function createMetaOrchestrator(options) {
50497
50587
 
50498
50588
  // src/orchestration/meta-shadow-selector.ts
50499
50589
  import { appendFileSync as appendFileSync6, existsSync as existsSync14, readFileSync as readFileSync12 } from "fs";
50500
- import { z as z112 } from "zod";
50590
+ import { z as z113 } from "zod";
50501
50591
  var SHADOW_STRATEGY_ARMS = [
50502
50592
  "single-shot",
50503
50593
  "dev-pipeline",
@@ -50584,19 +50674,19 @@ function createHydratableSelector() {
50584
50674
  var META_OUTCOME_SCHEMA_VERSION = 1;
50585
50675
  var HYDRATE_LOOKBACK_DAYS = 30;
50586
50676
  var HYDRATE_LOOKBACK_MS = HYDRATE_LOOKBACK_DAYS * 24 * 60 * 60 * 1e3;
50587
- var PersistedContextSchema = z112.object({
50588
- taskComplexity: z112.number(),
50589
- contextLengthNormalized: z112.number(),
50590
- isCodeTask: z112.number(),
50591
- isReasoningTask: z112.number(),
50592
- budgetUtilization: z112.number(),
50593
- timePressure: z112.number()
50594
- });
50595
- var PersistedMetaOutcomeSchema = z112.object({
50596
- schema: z112.literal(META_OUTCOME_SCHEMA_VERSION),
50597
- timestamp: z112.string(),
50598
- strategy: z112.enum(SHADOW_STRATEGY_ARMS),
50599
- success: z112.boolean(),
50677
+ var PersistedContextSchema = z113.object({
50678
+ taskComplexity: z113.number(),
50679
+ contextLengthNormalized: z113.number(),
50680
+ isCodeTask: z113.number(),
50681
+ isReasoningTask: z113.number(),
50682
+ budgetUtilization: z113.number(),
50683
+ timePressure: z113.number()
50684
+ });
50685
+ var PersistedMetaOutcomeSchema = z113.object({
50686
+ schema: z113.literal(META_OUTCOME_SCHEMA_VERSION),
50687
+ timestamp: z113.string(),
50688
+ strategy: z113.enum(SHADOW_STRATEGY_ARMS),
50689
+ success: z113.boolean(),
50600
50690
  context: PersistedContextSchema
50601
50691
  });
50602
50692
  var persistLogger = createLogger({ component: "MetaShadowSelector" });
@@ -50989,7 +51079,7 @@ function evaluateMetaStrategyReadiness(result, config = DEFAULT_META_STRATEGY_RE
50989
51079
  }
50990
51080
 
50991
51081
  // src/mcp/tools/dev-pipeline-tool.ts
50992
- import { z as z113 } from "zod";
51082
+ import { z as z114 } from "zod";
50993
51083
  import * as fs11 from "fs";
50994
51084
  import * as path10 from "path";
50995
51085
  import { randomUUID as randomUUID15 } from "crypto";
@@ -51142,36 +51232,36 @@ var DEV_PIPELINE_DRY_RUN_NOTE = "This was a dry run (plan+vote), which always ru
51142
51232
  function dispatchNoteFor(dryRun) {
51143
51233
  return dryRun ? DEV_PIPELINE_DRY_RUN_NOTE : DEV_PIPELINE_ASYNC_HINT;
51144
51234
  }
51145
- var DevPipelineInputSchema = z113.object({
51235
+ var DevPipelineInputSchema = z114.object({
51146
51236
  /** Direct task instructions. */
51147
- task: z113.string().max(1e4).optional().describe("Direct task instructions (what to build)"),
51237
+ task: z114.string().max(1e4).optional().describe("Direct task instructions (what to build)"),
51148
51238
  /** Path to a plan file (.md, .yaml, .txt) to use as input. */
51149
- planFile: z113.string().max(500).optional().describe("Path to a plan/spec file to use as input"),
51239
+ planFile: z114.string().max(500).optional().describe("Path to a plan/spec file to use as input"),
51150
51240
  /** Whether to run in dry-run mode (plan+vote only, no implementation). */
51151
- dryRun: z113.boolean().default(false).describe("If true, stop after plan+vote (no implementation)"),
51241
+ dryRun: z114.boolean().default(false).describe("If true, stop after plan+vote (no implementation)"),
51152
51242
  /** Maximum vote iterations before proceeding (default: 3). */
51153
- maxVoteIterations: z113.number().int().min(1).max(5).default(3).describe("Max plan\u2192vote iterations"),
51243
+ maxVoteIterations: z114.number().int().min(1).max(5).default(3).describe("Max plan\u2192vote iterations"),
51154
51244
  /** Maximum QA iterations per task (default: 3). */
51155
- maxQaIterations: z113.number().int().min(1).max(5).default(3).describe("Max QA review iterations per task"),
51245
+ maxQaIterations: z114.number().int().min(1).max(5).default(3).describe("Max QA review iterations per task"),
51156
51246
  /** Working directory for the pipeline (default: cwd). Used for security scan and context. */
51157
- workingDir: z113.string().max(500).optional().describe("Working directory (default: cwd)"),
51247
+ workingDir: z114.string().max(500).optional().describe("Working directory (default: cwd)"),
51158
51248
  /** GitHub issue number to track progress on. Updates posted as comments. */
51159
- issueNumber: z113.number().int().positive().optional().describe("GitHub issue to post progress to"),
51249
+ issueNumber: z114.number().int().positive().optional().describe("GitHub issue to post progress to"),
51160
51250
  /** GitHub repo (owner/name) for issue tracking. */
51161
- repo: z113.string().max(200).optional().describe("GitHub repo for issue tracking (e.g., owner/repo)"),
51251
+ repo: z114.string().max(200).optional().describe("GitHub repo for issue tracking (e.g., owner/repo)"),
51162
51252
  /** Task tracking backend: github, gitlab, or json (default: json). */
51163
- trackerBackend: z113.enum(["github", "gitlab", "json"]).default("json").describe("Task tracking backend for issue creation"),
51253
+ trackerBackend: z114.enum(["github", "gitlab", "json"]).default("json").describe("Task tracking backend for issue creation"),
51164
51254
  /** Labels to apply to created issues. */
51165
- labels: z113.array(z113.string()).optional().describe("Labels for created issues"),
51255
+ labels: z114.array(z114.string()).optional().describe("Labels for created issues"),
51166
51256
  /** Session ID for checkpoint/resume. Enables crash recovery. */
51167
- sessionId: z113.string().max(128).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Session ID for checkpoint/resume (crash recovery)"),
51257
+ sessionId: z114.string().max(128).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Session ID for checkpoint/resume (crash recovery)"),
51168
51258
  /**
51169
51259
  * TESTS ONLY — when true, voters return random decisions. Must not be used as
51170
51260
  * a fallback when adapters are unavailable; configure an adapter instead. (#2319)
51171
51261
  */
51172
- simulateVotes: z113.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
51262
+ simulateVotes: z114.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
51173
51263
  /** Voting strategy for consensus stages. */
51174
- votingStrategy: z113.enum([
51264
+ votingStrategy: z114.enum([
51175
51265
  "simple_majority",
51176
51266
  "supermajority",
51177
51267
  "unanimous",
@@ -51180,11 +51270,11 @@ var DevPipelineInputSchema = z113.object({
51180
51270
  "opinion_wise"
51181
51271
  ]).optional().describe("Voting strategy for plan approval (default: higher_order)"),
51182
51272
  /** Use 3 agents instead of 6 for faster voting. */
51183
- quickMode: z113.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
51273
+ quickMode: z114.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
51184
51274
  /** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
51185
- timeoutMs: z113.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
51275
+ timeoutMs: z114.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
51186
51276
  /** Pipeline execution mode. */
51187
- mode: z113.enum(["autonomous", "harness"]).default("autonomous").describe(
51277
+ mode: z114.enum(["autonomous", "harness"]).default("autonomous").describe(
51188
51278
  "'autonomous': full pipeline. 'harness': stops after decompose, returns tasks for caller to implement."
51189
51279
  ),
51190
51280
  /**
@@ -51195,15 +51285,15 @@ var DevPipelineInputSchema = z113.object({
51195
51285
  * `get_job_result({ jobId })` for the result. Ignored when `dryRun` is
51196
51286
  * true (plan+vote completes fast, so dry runs always stay sync).
51197
51287
  */
51198
- dispatch: z113.enum(["sync", "async"]).default("sync").describe(
51288
+ dispatch: z114.enum(["sync", "async"]).default("sync").describe(
51199
51289
  "Dispatch mode (#3726). 'sync' (default): run inline. 'async': return a jobId immediately + run in background (poll get_job_result). Ignored for dryRun."
51200
51290
  ),
51201
51291
  /** Local pre-ship quality gate (typecheck/lint/tests) mode (#3356). */
51202
- qualityGate: z113.enum(["off", "advisory", "blocking"]).default("off").describe(
51292
+ qualityGate: z114.enum(["off", "advisory", "blocking"]).default("off").describe(
51203
51293
  "Pre-ship local quality gate. 'off' (default): skip. 'advisory': run + record feedback, never fail. 'blocking': a red gate fails the pipeline."
51204
51294
  ),
51205
51295
  /** Opt-in per-run token budget — a safety cap for unattended runs (#3395). */
51206
- maxBudgetTokens: z113.number().int().positive().optional().describe(
51296
+ maxBudgetTokens: z114.number().int().positive().optional().describe(
51207
51297
  "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)."
51208
51298
  )
51209
51299
  });
@@ -51402,20 +51492,20 @@ function registerDevPipelineTool(server, deps) {
51402
51492
  }
51403
51493
 
51404
51494
  // src/mcp/tools/pipeline-tool.ts
51405
- import { z as z114 } from "zod";
51495
+ import { z as z115 } from "zod";
51406
51496
  import * as fs12 from "fs";
51407
51497
  import * as path11 from "path";
51408
51498
  import { randomUUID as randomUUID16 } from "crypto";
51409
51499
  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.";
51410
- var PipelineInputSchema = z114.object({
51500
+ var PipelineInputSchema = z115.object({
51411
51501
  /** The task to execute. */
51412
- task: z114.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
51502
+ task: z115.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
51413
51503
  /** Path to a spec file (.md, .yaml) to use as task input. */
51414
- specFile: z114.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
51504
+ specFile: z115.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
51415
51505
  /** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
51416
- template: z114.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
51506
+ template: z115.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
51417
51507
  /** Voting strategy for consensus stages. */
51418
- votingStrategy: z114.enum([
51508
+ votingStrategy: z115.enum([
51419
51509
  "simple_majority",
51420
51510
  "supermajority",
51421
51511
  "unanimous",
@@ -51426,11 +51516,11 @@ var PipelineInputSchema = z114.object({
51426
51516
  "Voting strategy for plan approval. simple_majority (default), supermajority (67%), unanimous, higher_order (Bayesian), proof_of_learning, opinion_wise"
51427
51517
  ),
51428
51518
  /** Use 3 agents instead of 6 for faster voting. */
51429
- quickMode: z114.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
51519
+ quickMode: z115.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
51430
51520
  /** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
51431
- timeoutMs: z114.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
51521
+ timeoutMs: z115.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
51432
51522
  /** Stop after planning/voting (no implementation). */
51433
- dryRun: z114.boolean().default(false).describe("Stop after vote stage (no implementation)"),
51523
+ dryRun: z115.boolean().default(false).describe("Stop after vote stage (no implementation)"),
51434
51524
  /**
51435
51525
  * Dispatch mode (#3730). `sync` (default) runs the pipeline inline and
51436
51526
  * returns the result — but a real multi-stage adaptive run can exceed the
@@ -51439,11 +51529,11 @@ var PipelineInputSchema = z114.object({
51439
51529
  * `get_job_result({ jobId })` for the result. Ignored when `dryRun` is true
51440
51530
  * (plan+vote completes fast, so dry runs always stay sync).
51441
51531
  */
51442
- dispatch: z114.enum(["sync", "async"]).default("sync").describe(
51532
+ dispatch: z115.enum(["sync", "async"]).default("sync").describe(
51443
51533
  "Dispatch mode (#3730). 'sync' (default): run inline. 'async': return a jobId immediately + run in background (poll get_job_result). Ignored for dryRun."
51444
51534
  ),
51445
51535
  /** TESTS ONLY — random output, must not be used for real decisions. (#2319) */
51446
- simulateVotes: z114.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
51536
+ simulateVotes: z115.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
51447
51537
  });
51448
51538
  function buildOutput3(result, simulated) {
51449
51539
  return {
@@ -51608,9 +51698,9 @@ function registerPipelineTool(server, deps) {
51608
51698
  }
51609
51699
 
51610
51700
  // src/mcp/tools/run-tool.ts
51611
- var RunInputSchema = z115.object({
51612
- goal: z115.string().min(1).describe("Natural-language goal. nexus-agents selects how to execute it."),
51613
- forceStrategy: z115.enum([
51701
+ var RunInputSchema = z116.object({
51702
+ goal: z116.string().min(1).describe("Natural-language goal. nexus-agents selects how to execute it."),
51703
+ forceStrategy: z116.enum([
51614
51704
  "single-shot",
51615
51705
  "dev-pipeline",
51616
51706
  "pipeline",
@@ -51622,10 +51712,10 @@ var RunInputSchema = z115.object({
51622
51712
  ]).optional().describe(
51623
51713
  "Power-user override: force a specific strategy instead of letting the router choose."
51624
51714
  ),
51625
- requiresConsensus: z115.boolean().optional().describe("Hint: the task needs a multi-perspective consensus decision."),
51626
- dependencyStructure: z115.enum(["linear", "dag", "independent", "unknown"]).optional().describe("Hint: the dependency structure of the work."),
51627
- isNovel: z115.boolean().optional().describe("Hint: this kind of task has not been seen before."),
51628
- execute: z115.boolean().optional().describe(
51715
+ requiresConsensus: z116.boolean().optional().describe("Hint: the task needs a multi-perspective consensus decision."),
51716
+ dependencyStructure: z116.enum(["linear", "dag", "independent", "unknown"]).optional().describe("Hint: the dependency structure of the work."),
51717
+ isNovel: z116.boolean().optional().describe("Hint: this kind of task has not been seen before."),
51718
+ execute: z116.boolean().optional().describe(
51629
51719
  "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)."
51630
51720
  ),
51631
51721
  /**
@@ -51640,7 +51730,7 @@ var RunInputSchema = z115.object({
51640
51730
  * other, the call is REFUSED rather than executed: silently ignoring a
51641
51731
  * do-not-act flag is the one outcome a governance substrate cannot allow.
51642
51732
  */
51643
- dryRun: z115.boolean().optional().describe(
51733
+ dryRun: z116.boolean().optional().describe(
51644
51734
  "Plan and vote only, no implementation (#4806). Requires the dev-pipeline strategy \u2014 refused (never silently executed) when the router selects another."
51645
51735
  ),
51646
51736
  /**
@@ -51651,7 +51741,7 @@ var RunInputSchema = z115.object({
51651
51741
  * envelope immediately and runs in the background; poll
51652
51742
  * `get_job_result({ jobId })`. Ignored for read-only routing (execute:false).
51653
51743
  */
51654
- dispatch: z115.enum(["sync", "async"]).optional().describe(
51744
+ dispatch: z116.enum(["sync", "async"]).optional().describe(
51655
51745
  "Dispatch mode (#3732). 'sync' (default): run inline. 'async' (only with execute:true): return a jobId immediately + run in background (poll get_job_result)."
51656
51746
  )
51657
51747
  });
@@ -51889,12 +51979,12 @@ function registerRunTool(server, deps) {
51889
51979
  }
51890
51980
 
51891
51981
  // src/mcp/tools/list-available-models-tool.ts
51892
- import { z as z116 } from "zod";
51982
+ import { z as z117 } from "zod";
51893
51983
  var DESCRIPTION5 = "Probe every model-discovery transport (OpenRouter API + opencode/claude/codex/gemini CLIs) and report a per-transport health summary: probe ok/failed, model count, and a sample of ids. Use it to validate the CLIs and APIs are wired and reachable. Read-only; does not change routing.";
51894
51984
  var PROBE_TIMEOUT_MS = 12e3;
51895
- var ListAvailableModelsInputSchema = z116.object({
51896
- includeModelIds: z116.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
51897
- includeOpenRouter: z116.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
51985
+ var ListAvailableModelsInputSchema = z117.object({
51986
+ includeModelIds: z117.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
51987
+ includeOpenRouter: z117.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
51898
51988
  });
51899
51989
  async function probeSource(source, includeModelIds) {
51900
51990
  let timer;
@@ -51961,8 +52051,8 @@ async function listAvailableModelsHandler(args, deps, logger58) {
51961
52051
  function registerListAvailableModelsTool(server, deps) {
51962
52052
  const logger58 = deps.logger ?? createLogger({ tool: "list_available_models" });
51963
52053
  const toolSchema = {
51964
- includeModelIds: z116.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
51965
- includeOpenRouter: z116.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
52054
+ includeModelIds: z117.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
52055
+ includeOpenRouter: z117.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
51966
52056
  };
51967
52057
  const secureHandler = createSecureHandler(
51968
52058
  (args) => listAvailableModelsHandler(args, deps, logger58),
@@ -51986,7 +52076,7 @@ function registerListAvailableModelsTool(server, deps) {
51986
52076
  }
51987
52077
 
51988
52078
  // src/mcp/tools/pr-review-eval-types.ts
51989
- import { z as z117 } from "zod";
52079
+ import { z as z118 } from "zod";
51990
52080
  var PR_REVIEW_EVAL_ROLES = [
51991
52081
  "architect",
51992
52082
  "security",
@@ -51994,43 +52084,43 @@ var PR_REVIEW_EVAL_ROLES = [
51994
52084
  "catfish",
51995
52085
  "scope_steward"
51996
52086
  ];
51997
- var PrReviewEvalRoleSchema = z117.enum(PR_REVIEW_EVAL_ROLES);
51998
- var PrReviewCaseClassSchema = z117.enum(["buggy", "clean", "borderline"]);
51999
- var VoterEvalVerdictSchema = z117.object({
52087
+ var PrReviewEvalRoleSchema = z118.enum(PR_REVIEW_EVAL_ROLES);
52088
+ var PrReviewCaseClassSchema = z118.enum(["buggy", "clean", "borderline"]);
52089
+ var VoterEvalVerdictSchema = z118.object({
52000
52090
  /** Stable record id (e.g. `${runId}:${caseNumber}:${role}`). */
52001
- id: z117.string().min(1).max(160),
52091
+ id: z118.string().min(1).max(160),
52002
52092
  /** The pr_review run / batch this verdict belongs to. */
52003
- runId: z117.string().min(1).max(64),
52093
+ runId: z118.string().min(1).max(64),
52004
52094
  /** Dataset case identifier (the dataset's `number` field). */
52005
- caseNumber: z117.string().min(1).max(80),
52095
+ caseNumber: z118.string().min(1).max(80),
52006
52096
  /** Rubric class of the case (ground-truth label). */
52007
52097
  caseClass: PrReviewCaseClassSchema,
52008
52098
  /** The voter role being scored. */
52009
52099
  role: PrReviewEvalRoleSchema,
52010
52100
  /** Verified findings that matched a known bug. */
52011
- truePositives: z117.number().int().nonnegative(),
52101
+ truePositives: z118.number().int().nonnegative(),
52012
52102
  /** Verified findings on clean code that matched no known bug. */
52013
- falsePositives: z117.number().int().nonnegative(),
52103
+ falsePositives: z118.number().int().nonnegative(),
52014
52104
  /** Known bugs this voter failed to flag. */
52015
- falseNegatives: z117.number().int().nonnegative(),
52105
+ falseNegatives: z118.number().int().nonnegative(),
52016
52106
  /** Rubric version the ground truth was adjudicated under. */
52017
- rubricVersion: z117.string().min(1).max(32),
52107
+ rubricVersion: z118.string().min(1).max(32),
52018
52108
  /** ISO-8601 timestamp the verdict was recorded. */
52019
- timestamp: z117.string().min(1).max(40)
52109
+ timestamp: z118.string().min(1).max(40)
52020
52110
  });
52021
- var VoterEvalVerdictQuerySchema = z117.object({
52111
+ var VoterEvalVerdictQuerySchema = z118.object({
52022
52112
  role: PrReviewEvalRoleSchema.optional(),
52023
- runId: z117.string().min(1).max(64).optional(),
52113
+ runId: z118.string().min(1).max(64).optional(),
52024
52114
  caseClass: PrReviewCaseClassSchema.optional(),
52025
- rubricVersion: z117.string().min(1).max(32).optional(),
52115
+ rubricVersion: z118.string().min(1).max(32).optional(),
52026
52116
  /** ISO-8601 lower bound (inclusive) on `timestamp`. */
52027
- since: z117.string().optional(),
52117
+ since: z118.string().optional(),
52028
52118
  /** Most-recent-N cap. */
52029
- limit: z117.number().int().positive().optional()
52119
+ limit: z118.number().int().positive().optional()
52030
52120
  });
52031
52121
 
52032
52122
  // src/mcp/tools/supply-chain-tradeoff-panel.ts
52033
- import { z as z118 } from "zod";
52123
+ import { z as z119 } from "zod";
52034
52124
  import { randomUUID as randomUUID18 } from "crypto";
52035
52125
  var DEFAULT_AXES = [
52036
52126
  "build_time_determinism",
@@ -52052,16 +52142,16 @@ var FULL_PANEL = [
52052
52142
  "scope_steward"
52053
52143
  ];
52054
52144
  var QUICK_PANEL = ["architect", "security", "scope_steward"];
52055
- var SupplyChainTradeoffPanelInputSchema = z118.object({
52056
- proposal: z118.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
52057
- axes: z118.array(z118.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
52145
+ var SupplyChainTradeoffPanelInputSchema = z119.object({
52146
+ proposal: z119.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
52147
+ axes: z119.array(z119.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
52058
52148
  `Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
52059
52149
  ),
52060
- context: z118.string().max(MAX_CONTEXT_LENGTH).optional().describe(
52150
+ context: z119.string().max(MAX_CONTEXT_LENGTH).optional().describe(
52061
52151
  "Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
52062
52152
  ),
52063
- quickMode: z118.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
52064
- simulate: z118.boolean().optional().default(false).describe("Use simulated voters (testing only)"),
52153
+ quickMode: z119.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
52154
+ simulate: z119.boolean().optional().default(false).describe("Use simulated voters (testing only)"),
52065
52155
  /**
52066
52156
  * Dispatch mode (#3731). `sync` (default) runs the panel inline and returns
52067
52157
  * the result — but a live fan-out (up to 7 voters) can exceed the MCP request
@@ -52069,7 +52159,7 @@ var SupplyChainTradeoffPanelInputSchema = z118.object({
52069
52159
  * immediately and runs the panel in the background; poll
52070
52160
  * `get_job_result({ jobId })` for the result.
52071
52161
  */
52072
- dispatch: z118.enum(["sync", "async"]).default("sync").describe(
52162
+ dispatch: z119.enum(["sync", "async"]).default("sync").describe(
52073
52163
  "Dispatch mode (#3731). 'sync' (default): run inline. 'async': return a jobId immediately + run the panel in background (poll get_job_result)."
52074
52164
  )
52075
52165
  });
@@ -52547,40 +52637,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
52547
52637
  })(RiskLevel || {});
52548
52638
 
52549
52639
  // src/mcp/safety/stpa-schemas.ts
52550
- import { z as z119 } from "zod";
52551
- var HazardCategorySchema = z119.enum(HazardCategory);
52552
- var HazardSeveritySchema = z119.enum(HazardSeverity);
52553
- var ConstraintPrioritySchema = z119.enum(ConstraintPriority);
52554
- var RiskLevelSchema = z119.enum(RiskLevel);
52555
- var TriggerPatternSchema = z119.object({
52556
- parameter: z119.string().min(1),
52557
- matchType: z119.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
52558
- pattern: z119.string(),
52559
- reason: z119.string()
52560
- });
52561
- var HazardSchema = z119.object({
52562
- id: z119.string().min(1),
52563
- description: z119.string(),
52640
+ import { z as z120 } from "zod";
52641
+ var HazardCategorySchema = z120.enum(HazardCategory);
52642
+ var HazardSeveritySchema = z120.enum(HazardSeverity);
52643
+ var ConstraintPrioritySchema = z120.enum(ConstraintPriority);
52644
+ var RiskLevelSchema = z120.enum(RiskLevel);
52645
+ var TriggerPatternSchema = z120.object({
52646
+ parameter: z120.string().min(1),
52647
+ matchType: z120.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
52648
+ pattern: z120.string(),
52649
+ reason: z120.string()
52650
+ });
52651
+ var HazardSchema = z120.object({
52652
+ id: z120.string().min(1),
52653
+ description: z120.string(),
52564
52654
  category: HazardCategorySchema,
52565
52655
  severity: HazardSeveritySchema,
52566
- likelihood: z119.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
52567
- triggerConditions: z119.array(z119.string()),
52568
- consequences: z119.array(z119.string())
52569
- });
52570
- var UnsafeControlActionSchema = z119.object({
52571
- id: z119.string().min(1),
52572
- toolName: z119.string().min(1),
52573
- type: z119.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
52574
- description: z119.string(),
52575
- unsafeContext: z119.string(),
52576
- relatedHazards: z119.array(z119.string()),
52577
- triggerPatterns: z119.array(TriggerPatternSchema).optional()
52578
- });
52579
- var SafetyConstraintSchema = z119.object({
52580
- id: z119.string().min(1),
52581
- description: z119.string(),
52582
- mitigates: z119.array(z119.string()),
52583
- enforcement: z119.enum([
52656
+ likelihood: z120.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
52657
+ triggerConditions: z120.array(z120.string()),
52658
+ consequences: z120.array(z120.string())
52659
+ });
52660
+ var UnsafeControlActionSchema = z120.object({
52661
+ id: z120.string().min(1),
52662
+ toolName: z120.string().min(1),
52663
+ type: z120.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
52664
+ description: z120.string(),
52665
+ unsafeContext: z120.string(),
52666
+ relatedHazards: z120.array(z120.string()),
52667
+ triggerPatterns: z120.array(TriggerPatternSchema).optional()
52668
+ });
52669
+ var SafetyConstraintSchema = z120.object({
52670
+ id: z120.string().min(1),
52671
+ description: z120.string(),
52672
+ mitigates: z120.array(z120.string()),
52673
+ enforcement: z120.enum([
52584
52674
  "prevent",
52585
52675
  "require_confirmation",
52586
52676
  "alert",
@@ -52588,52 +52678,52 @@ var SafetyConstraintSchema = z119.object({
52588
52678
  "rate_limit",
52589
52679
  "require_privilege"
52590
52680
  ]),
52591
- validationFunction: z119.string().optional(),
52681
+ validationFunction: z120.string().optional(),
52592
52682
  priority: ConstraintPrioritySchema
52593
52683
  });
52594
- var PropertySchemaSchema = z119.object({
52595
- type: z119.string(),
52596
- description: z119.string().optional(),
52597
- enum: z119.array(z119.unknown()).optional(),
52598
- pattern: z119.string().optional(),
52599
- minimum: z119.number().optional(),
52600
- maximum: z119.number().optional()
52601
- });
52602
- var ToolInputSchemaSchema = z119.object({
52603
- type: z119.string(),
52604
- properties: z119.record(z119.string(), PropertySchemaSchema).optional(),
52605
- required: z119.array(z119.string()).optional(),
52606
- additionalProperties: z119.boolean().optional()
52607
- });
52608
- var ToolDefinitionSchema = z119.object({
52609
- name: z119.string().min(1),
52610
- description: z119.string(),
52684
+ var PropertySchemaSchema = z120.object({
52685
+ type: z120.string(),
52686
+ description: z120.string().optional(),
52687
+ enum: z120.array(z120.unknown()).optional(),
52688
+ pattern: z120.string().optional(),
52689
+ minimum: z120.number().optional(),
52690
+ maximum: z120.number().optional()
52691
+ });
52692
+ var ToolInputSchemaSchema = z120.object({
52693
+ type: z120.string(),
52694
+ properties: z120.record(z120.string(), PropertySchemaSchema).optional(),
52695
+ required: z120.array(z120.string()).optional(),
52696
+ additionalProperties: z120.boolean().optional()
52697
+ });
52698
+ var ToolDefinitionSchema = z120.object({
52699
+ name: z120.string().min(1),
52700
+ description: z120.string(),
52611
52701
  inputSchema: ToolInputSchemaSchema
52612
52702
  });
52613
- var AnalysisConfigurationSchema = z119.object({
52614
- includeLowSeverity: z119.boolean().default(true),
52615
- generateAllConstraints: z119.boolean().default(true),
52616
- checkInteractions: z119.boolean().default(true),
52617
- maxHazardsPerTool: z119.number().int().min(1).max(100).default(50),
52618
- categories: z119.array(HazardCategorySchema).default([])
52703
+ var AnalysisConfigurationSchema = z120.object({
52704
+ includeLowSeverity: z120.boolean().default(true),
52705
+ generateAllConstraints: z120.boolean().default(true),
52706
+ checkInteractions: z120.boolean().default(true),
52707
+ maxHazardsPerTool: z120.number().int().min(1).max(100).default(50),
52708
+ categories: z120.array(HazardCategorySchema).default([])
52619
52709
  });
52620
- var ConstraintViolationSchema = z119.object({
52621
- constraintId: z119.string().min(1),
52622
- constraintDescription: z119.string(),
52710
+ var ConstraintViolationSchema = z120.object({
52711
+ constraintId: z120.string().min(1),
52712
+ constraintDescription: z120.string(),
52623
52713
  severity: HazardSeveritySchema,
52624
- details: z119.string(),
52625
- remediation: z119.string()
52626
- });
52627
- var ValidationWarningSchema = z119.object({
52628
- code: z119.string().min(1),
52629
- message: z119.string(),
52630
- affected: z119.string()
52631
- });
52632
- var ValidationResultSchema = z119.object({
52633
- valid: z119.boolean(),
52634
- toolName: z119.string().min(1),
52635
- violations: z119.array(ConstraintViolationSchema),
52636
- passed: z119.array(z119.string()),
52714
+ details: z120.string(),
52715
+ remediation: z120.string()
52716
+ });
52717
+ var ValidationWarningSchema = z120.object({
52718
+ code: z120.string().min(1),
52719
+ message: z120.string(),
52720
+ affected: z120.string()
52721
+ });
52722
+ var ValidationResultSchema = z120.object({
52723
+ valid: z120.boolean(),
52724
+ toolName: z120.string().min(1),
52725
+ violations: z120.array(ConstraintViolationSchema),
52726
+ passed: z120.array(z120.string()),
52637
52727
  // Optional rather than required, deliberately. `ValidationResult` declares
52638
52728
  // both fields required because every result this package produces has them;
52639
52729
  // the schema is the lenient inbound edge for a result that arrived from
@@ -52644,10 +52734,10 @@ var ValidationResultSchema = z119.object({
52644
52734
  // "nothing was evaluated". The strict/lenient split is safe because nothing
52645
52735
  // bridges the two with `z.infer`: a parsed result will not typecheck as a
52646
52736
  // `ValidationResult` without handling the absent fields.
52647
- evaluated: z119.array(z119.string()).optional(),
52648
- notApplicable: z119.array(z119.string()).optional(),
52649
- warnings: z119.array(ValidationWarningSchema),
52650
- validatedAt: z119.date()
52737
+ evaluated: z120.array(z120.string()).optional(),
52738
+ notApplicable: z120.array(z120.string()).optional(),
52739
+ warnings: z120.array(ValidationWarningSchema),
52740
+ validatedAt: z120.date()
52651
52741
  });
52652
52742
 
52653
52743
  // src/mcp/safety/stpa-types.ts
@@ -53732,42 +53822,42 @@ var GeminiResponseParser = class {
53732
53822
  };
53733
53823
 
53734
53824
  // src/cli-adapters/router-types.ts
53735
- import { z as z120 } from "zod";
53736
- var RouterConfigSchema = z120.object({
53737
- preferCostEfficient: z120.boolean().default(false),
53738
- maxDecisionTimeMs: z120.number().min(1).max(1e3).default(100)
53825
+ import { z as z121 } from "zod";
53826
+ var RouterConfigSchema = z121.object({
53827
+ preferCostEfficient: z121.boolean().default(false),
53828
+ maxDecisionTimeMs: z121.number().min(1).max(1e3).default(100)
53739
53829
  });
53740
53830
 
53741
53831
  // src/cli-adapters/agreement-cascade-types.ts
53742
- import { z as z121 } from "zod";
53743
- var AgreementCascadeConfigSchema = z121.object({
53744
- agreementThreshold: z121.number().min(0.5).max(1).default(0.7),
53745
- maxStages: z121.number().int().min(1).max(5).default(3),
53746
- modelTimeoutMs: z121.number().int().min(1e3).max(3e5).default(6e4)
53832
+ import { z as z122 } from "zod";
53833
+ var AgreementCascadeConfigSchema = z122.object({
53834
+ agreementThreshold: z122.number().min(0.5).max(1).default(0.7),
53835
+ maxStages: z122.number().int().min(1).max(5).default(3),
53836
+ modelTimeoutMs: z122.number().int().min(1e3).max(3e5).default(6e4)
53747
53837
  });
53748
53838
 
53749
53839
  // src/cli-adapters/agreement-cascade-router.ts
53750
53840
  var logger50 = createLogger({ component: "agreement-cascade-router" });
53751
53841
 
53752
53842
  // src/cli-adapters/task-classifier.ts
53753
- import { z as z122 } from "zod";
53754
- var ClassificationPatternsSchema = z122.object({
53755
- code: z122.array(z122.string()).readonly(),
53756
- research: z122.array(z122.string()).readonly(),
53757
- documentation: z122.array(z122.string()).readonly(),
53758
- analysis: z122.array(z122.string()).readonly()
53843
+ import { z as z123 } from "zod";
53844
+ var ClassificationPatternsSchema = z123.object({
53845
+ code: z123.array(z123.string()).readonly(),
53846
+ research: z123.array(z123.string()).readonly(),
53847
+ documentation: z123.array(z123.string()).readonly(),
53848
+ analysis: z123.array(z123.string()).readonly()
53759
53849
  });
53760
53850
 
53761
53851
  // src/cli-adapters/response-cache-types.ts
53762
- import { z as z123 } from "zod";
53763
- var ResponseCacheConfigSchema = z123.object({
53764
- defaultTTL: z123.number().min(1e3).max(36e5).default(3e5),
53852
+ import { z as z124 } from "zod";
53853
+ var ResponseCacheConfigSchema = z124.object({
53854
+ defaultTTL: z124.number().min(1e3).max(36e5).default(3e5),
53765
53855
  // 5 minutes
53766
- maxEntries: z123.number().min(10).max(1e5).default(1e3),
53767
- maxMemoryMB: z123.number().min(1).max(1e3).default(50),
53768
- cleanupInterval: z123.number().min(1e3).max(6e5).default(6e4),
53856
+ maxEntries: z124.number().min(10).max(1e5).default(1e3),
53857
+ maxMemoryMB: z124.number().min(1).max(1e3).default(50),
53858
+ cleanupInterval: z124.number().min(1e3).max(6e5).default(6e4),
53769
53859
  // 1 minute
53770
- enableLogging: z123.boolean().default(false)
53860
+ enableLogging: z124.boolean().default(false)
53771
53861
  });
53772
53862
 
53773
53863
  // src/cli-adapters/response-cache-utils.ts
@@ -53775,12 +53865,12 @@ import { createHash as createHash6 } from "crypto";
53775
53865
  var logger51 = createLogger({ component: "ResponseCacheUtils" });
53776
53866
 
53777
53867
  // src/cli-adapters/unified-routing-types.ts
53778
- import { z as z124 } from "zod";
53779
- var UnifiedRoutingDecisionSchema = z124.object({
53780
- selectedCli: z124.string(),
53781
- confidence: z124.number().min(0).max(1),
53782
- reason: z124.string(),
53783
- strategy: z124.enum([
53868
+ import { z as z125 } from "zod";
53869
+ var UnifiedRoutingDecisionSchema = z125.object({
53870
+ selectedCli: z125.string(),
53871
+ confidence: z125.number().min(0).max(1),
53872
+ reason: z125.string(),
53873
+ strategy: z125.enum([
53784
53874
  "composite",
53785
53875
  "quality",
53786
53876
  "budget",
@@ -53792,57 +53882,57 @@ var UnifiedRoutingDecisionSchema = z124.object({
53792
53882
  "linucb",
53793
53883
  "direct"
53794
53884
  ]),
53795
- decisionTimeMs: z124.number().nonnegative(),
53796
- alternatives: z124.array(z124.string()).readonly(),
53797
- stagesExecuted: z124.array(z124.string()).readonly(),
53798
- withinBudget: z124.boolean().optional(),
53799
- estimatedComplexity: z124.enum(["simple", "moderate", "complex", "expert"]).optional(),
53800
- estimatedTokens: z124.number().int().positive().optional(),
53801
- topsisScore: z124.number().optional(),
53802
- ucbScore: z124.number().optional(),
53803
- resolvedAtStage: z124.number().int().nonnegative().optional(),
53804
- consensusReached: z124.boolean().optional(),
53805
- agreementScore: z124.number().min(0).max(1).optional(),
53806
- metadata: z124.record(z124.string(), z124.unknown()).optional()
53885
+ decisionTimeMs: z125.number().nonnegative(),
53886
+ alternatives: z125.array(z125.string()).readonly(),
53887
+ stagesExecuted: z125.array(z125.string()).readonly(),
53888
+ withinBudget: z125.boolean().optional(),
53889
+ estimatedComplexity: z125.enum(["simple", "moderate", "complex", "expert"]).optional(),
53890
+ estimatedTokens: z125.number().int().positive().optional(),
53891
+ topsisScore: z125.number().optional(),
53892
+ ucbScore: z125.number().optional(),
53893
+ resolvedAtStage: z125.number().int().nonnegative().optional(),
53894
+ consensusReached: z125.boolean().optional(),
53895
+ agreementScore: z125.number().min(0).max(1).optional(),
53896
+ metadata: z125.record(z125.string(), z125.unknown()).optional()
53807
53897
  });
53808
53898
 
53809
53899
  // src/learning/outcome-feedback-types.ts
53810
- import { z as z125 } from "zod";
53811
- var QualitySignalsSchema = z125.object({
53812
- testsPass: z125.boolean().optional(),
53813
- lintErrors: z125.number().int().min(0).optional(),
53814
- userApproved: z125.boolean().optional(),
53815
- retryCount: z125.number().int().min(0).default(0),
53816
- completionRatio: z125.number().min(0).max(1).default(1),
53817
- validStructure: z125.boolean().optional(),
53818
- coherenceScore: z125.number().min(0).max(1).optional()
53819
- });
53820
- var RoutingDecisionSchema = z125.object({
53821
- id: z125.uuid(),
53822
- timestamp: z125.iso.datetime(),
53823
- query: z125.string(),
53824
- routerType: z125.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
53825
- selectedModel: z125.string(),
53826
- selectedTier: z125.enum(["strong", "weak"]).optional(),
53827
- armIndex: z125.number().int().min(0).optional(),
53828
- banditContext: z125.record(z125.string(), z125.unknown()).optional(),
53829
- queryFeatures: z125.record(z125.string(), z125.unknown()).optional(),
53830
- ucbScore: z125.number().optional(),
53831
- confidence: z125.number().min(0).max(1).optional(),
53832
- traceId: z125.string(),
53833
- domain: z125.string().optional()
53834
- });
53835
- var TaskOutcomeSchema = z125.object({
53836
- routingDecisionId: z125.uuid(),
53837
- timestamp: z125.iso.datetime(),
53838
- outcomeClass: z125.enum(["success", "partial", "failure", "timeout", "error"]),
53839
- success: z125.boolean(),
53840
- qualityScore: z125.number().min(0).max(1),
53841
- durationMs: z125.number().min(0),
53842
- tokenUsage: z125.number().int().min(0),
53843
- errorMessage: z125.string().optional(),
53900
+ import { z as z126 } from "zod";
53901
+ var QualitySignalsSchema = z126.object({
53902
+ testsPass: z126.boolean().optional(),
53903
+ lintErrors: z126.number().int().min(0).optional(),
53904
+ userApproved: z126.boolean().optional(),
53905
+ retryCount: z126.number().int().min(0).default(0),
53906
+ completionRatio: z126.number().min(0).max(1).default(1),
53907
+ validStructure: z126.boolean().optional(),
53908
+ coherenceScore: z126.number().min(0).max(1).optional()
53909
+ });
53910
+ var RoutingDecisionSchema = z126.object({
53911
+ id: z126.uuid(),
53912
+ timestamp: z126.iso.datetime(),
53913
+ query: z126.string(),
53914
+ routerType: z126.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
53915
+ selectedModel: z126.string(),
53916
+ selectedTier: z126.enum(["strong", "weak"]).optional(),
53917
+ armIndex: z126.number().int().min(0).optional(),
53918
+ banditContext: z126.record(z126.string(), z126.unknown()).optional(),
53919
+ queryFeatures: z126.record(z126.string(), z126.unknown()).optional(),
53920
+ ucbScore: z126.number().optional(),
53921
+ confidence: z126.number().min(0).max(1).optional(),
53922
+ traceId: z126.string(),
53923
+ domain: z126.string().optional()
53924
+ });
53925
+ var TaskOutcomeSchema = z126.object({
53926
+ routingDecisionId: z126.uuid(),
53927
+ timestamp: z126.iso.datetime(),
53928
+ outcomeClass: z126.enum(["success", "partial", "failure", "timeout", "error"]),
53929
+ success: z126.boolean(),
53930
+ qualityScore: z126.number().min(0).max(1),
53931
+ durationMs: z126.number().min(0),
53932
+ tokenUsage: z126.number().int().min(0),
53933
+ errorMessage: z126.string().optional(),
53844
53934
  qualitySignals: QualitySignalsSchema,
53845
- traceId: z125.string()
53935
+ traceId: z126.string()
53846
53936
  });
53847
53937
  var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
53848
53938
  maxPendingDecisions: 1e3,
@@ -53857,17 +53947,17 @@ var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
53857
53947
  targetTokenUsage: 2e3,
53858
53948
  maxHistorySize: 1e4
53859
53949
  };
53860
- var FeedbackCollectorConfigSchema = z125.object({
53861
- maxPendingDecisions: z125.number().int().positive().default(1e3),
53862
- pendingTimeoutMs: z125.number().positive().default(3e5),
53863
- enableAutoReward: z125.boolean().default(true),
53864
- qualityWeight: z125.number().min(0).max(1).default(0.5),
53865
- speedWeight: z125.number().min(0).max(1).default(0.2),
53866
- efficiencyWeight: z125.number().min(0).max(1).default(0.2),
53867
- retryPenalty: z125.number().min(0).max(1).default(0.1),
53868
- targetDurationMs: z125.number().positive().default(5e3),
53869
- targetTokenUsage: z125.number().positive().default(2e3),
53870
- maxHistorySize: z125.number().int().positive().default(1e4)
53950
+ var FeedbackCollectorConfigSchema = z126.object({
53951
+ maxPendingDecisions: z126.number().int().positive().default(1e3),
53952
+ pendingTimeoutMs: z126.number().positive().default(3e5),
53953
+ enableAutoReward: z126.boolean().default(true),
53954
+ qualityWeight: z126.number().min(0).max(1).default(0.5),
53955
+ speedWeight: z126.number().min(0).max(1).default(0.2),
53956
+ efficiencyWeight: z126.number().min(0).max(1).default(0.2),
53957
+ retryPenalty: z126.number().min(0).max(1).default(0.1),
53958
+ targetDurationMs: z126.number().positive().default(5e3),
53959
+ targetTokenUsage: z126.number().positive().default(2e3),
53960
+ maxHistorySize: z126.number().int().positive().default(1e4)
53871
53961
  });
53872
53962
 
53873
53963
  // src/learning/outcome-feedback-helpers.ts
@@ -56000,4 +56090,4 @@ export {
56000
56090
  shutdownFeedbackSubscriber,
56001
56091
  createEventBusBridge
56002
56092
  };
56003
- //# sourceMappingURL=chunk-DJN4XAQO.js.map
56093
+ //# sourceMappingURL=chunk-KXQYRZ3X.js.map