nexus-agents 2.98.0 → 2.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{chunk-DE3J2HYT.js → chunk-B364VMMP.js} +471 -193
  2. package/dist/chunk-B364VMMP.js.map +1 -0
  3. package/dist/{chunk-6ZXNMJEX.js → chunk-BFN7RO3R.js} +4 -4
  4. package/dist/{chunk-6ZXNMJEX.js.map → chunk-BFN7RO3R.js.map} +1 -1
  5. package/dist/{chunk-PK4TTHXW.js → chunk-FU2AMASK.js} +3 -3
  6. package/dist/{chunk-6IHEDRKI.js → chunk-H4LBBFCO.js} +2 -2
  7. package/dist/{chunk-G4A7SSML.js → chunk-JFFI54DW.js} +11 -1
  8. package/dist/{chunk-G4A7SSML.js.map → chunk-JFFI54DW.js.map} +1 -1
  9. package/dist/{chunk-EM7NUGMG.js → chunk-P453545L.js} +21 -2
  10. package/dist/chunk-P453545L.js.map +1 -0
  11. package/dist/{chunk-RCKLAJ2H.js → chunk-TYELRYRO.js} +10 -5
  12. package/dist/chunk-TYELRYRO.js.map +1 -0
  13. package/dist/{chunk-MKFLI5DK.js → chunk-YREYQSYA.js} +2 -2
  14. package/dist/chunk-YREYQSYA.js.map +1 -0
  15. package/dist/cli.js +17 -10
  16. package/dist/cli.js.map +1 -1
  17. package/dist/{consensus-vote-Z3BWJLRE.js → consensus-vote-PGOS5AA6.js} +4 -4
  18. package/dist/{expert-bridge-EOVHUCJ4.js → expert-bridge-L25WFHQF.js} +2 -2
  19. package/dist/{factory-NJRJAZKK.js → factory-PVN7DDNZ.js} +2 -2
  20. package/dist/{improvement-review-Q4LBTVQP.js → improvement-review-IWV2BMR7.js} +3 -3
  21. package/dist/index.d.ts +27 -0
  22. package/dist/index.js +8 -8
  23. package/dist/{setup-command-JVJ2PNL6.js → setup-command-RRBGCIBW.js} +4 -4
  24. package/package.json +1 -1
  25. package/dist/chunk-DE3J2HYT.js.map +0 -1
  26. package/dist/chunk-EM7NUGMG.js.map +0 -1
  27. package/dist/chunk-MKFLI5DK.js.map +0 -1
  28. package/dist/chunk-RCKLAJ2H.js.map +0 -1
  29. /package/dist/{chunk-PK4TTHXW.js.map → chunk-FU2AMASK.js.map} +0 -0
  30. /package/dist/{chunk-6IHEDRKI.js.map → chunk-H4LBBFCO.js.map} +0 -0
  31. /package/dist/{consensus-vote-Z3BWJLRE.js.map → consensus-vote-PGOS5AA6.js.map} +0 -0
  32. /package/dist/{expert-bridge-EOVHUCJ4.js.map → expert-bridge-L25WFHQF.js.map} +0 -0
  33. /package/dist/{factory-NJRJAZKK.js.map → factory-PVN7DDNZ.js.map} +0 -0
  34. /package/dist/{improvement-review-Q4LBTVQP.js.map → improvement-review-IWV2BMR7.js.map} +0 -0
  35. /package/dist/{setup-command-JVJ2PNL6.js.map → setup-command-RRBGCIBW.js.map} +0 -0
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-UWQ3BALH.js";
10
10
  import {
11
11
  executeExpert
12
- } from "./chunk-6IHEDRKI.js";
12
+ } from "./chunk-H4LBBFCO.js";
13
13
  import {
14
14
  EventTopics,
15
15
  JobStatusSchema,
@@ -30,7 +30,7 @@ import {
30
30
  writeJobComplete,
31
31
  writeJobFailed,
32
32
  writeJobPending
33
- } from "./chunk-RCKLAJ2H.js";
33
+ } from "./chunk-TYELRYRO.js";
34
34
  import {
35
35
  REGISTRY_PATH,
36
36
  getProjectRoot,
@@ -51,7 +51,7 @@ import {
51
51
  } from "./chunk-VD4TXDMR.js";
52
52
  import {
53
53
  withPrerequisite
54
- } from "./chunk-MKFLI5DK.js";
54
+ } from "./chunk-YREYQSYA.js";
55
55
  import {
56
56
  NOOP_NOTIFIER,
57
57
  RateLimiter,
@@ -70,7 +70,7 @@ import {
70
70
  withAccessPolicy,
71
71
  withProgressHeartbeat,
72
72
  wrapToolWithTimeout
73
- } from "./chunk-G4A7SSML.js";
73
+ } from "./chunk-JFFI54DW.js";
74
74
  import {
75
75
  generateSecurityPlan
76
76
  } from "./chunk-BKUKBOGV.js";
@@ -92,7 +92,7 @@ import {
92
92
  DEFAULT_TASK_TTL_MS,
93
93
  DEFAULT_TOOL_RATE_LIMITS,
94
94
  clampTaskTtl
95
- } from "./chunk-6ZXNMJEX.js";
95
+ } from "./chunk-BFN7RO3R.js";
96
96
  import {
97
97
  getAvailabilityCache,
98
98
  getCliForModelId,
@@ -116,7 +116,7 @@ import {
116
116
  getAvailableClis,
117
117
  sleep,
118
118
  withTimeout
119
- } from "./chunk-EM7NUGMG.js";
119
+ } from "./chunk-P453545L.js";
120
120
  import {
121
121
  generateHyphenId,
122
122
  generateUUID
@@ -23559,10 +23559,10 @@ function calculateZStatistic(params) {
23559
23559
  function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
23560
23560
  const difference = p1 - p2;
23561
23561
  const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
23562
- const z111 = getZScore(confidence);
23562
+ const z112 = getZScore(confidence);
23563
23563
  return {
23564
- lower: difference - z111 * seDiff,
23565
- upper: difference + z111 * seDiff,
23564
+ lower: difference - z112 * seDiff,
23565
+ upper: difference + z112 * seDiff,
23566
23566
  estimate: difference,
23567
23567
  confidence,
23568
23568
  n: total1 + total2,
@@ -23585,11 +23585,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
23585
23585
  standardError: 0
23586
23586
  };
23587
23587
  }
23588
- const z111 = getZScore(opts.confidence);
23589
- const z210 = z111 * z111;
23588
+ const z112 = getZScore(opts.confidence);
23589
+ const z210 = z112 * z112;
23590
23590
  const denominator = 1 + z210 / n;
23591
23591
  const center = (p + z210 / (2 * n)) / denominator;
23592
- const margin = z111 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
23592
+ const margin = z112 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
23593
23593
  const lower = Math.max(0, center - margin);
23594
23594
  const upper = Math.min(1, center + margin);
23595
23595
  const standardError = Math.sqrt(p * (1 - p) / n);
@@ -23619,8 +23619,8 @@ function meanConfidenceInterval(values, options = {}) {
23619
23619
  const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
23620
23620
  const stdDev = Math.sqrt(variance);
23621
23621
  const standardError = stdDev / Math.sqrt(n);
23622
- const z111 = getZScore(opts.confidence);
23623
- const margin = z111 * standardError;
23622
+ const z112 = getZScore(opts.confidence);
23623
+ const margin = z112 * standardError;
23624
23624
  return {
23625
23625
  lower: mean - margin,
23626
23626
  upper: mean + margin,
@@ -42436,7 +42436,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
42436
42436
  ]);
42437
42437
  async function classifyWithLLM(task) {
42438
42438
  try {
42439
- const { executeExpert: executeExpert2 } = await import("./expert-bridge-EOVHUCJ4.js");
42439
+ const { executeExpert: executeExpert2 } = await import("./expert-bridge-L25WFHQF.js");
42440
42440
  const prompt = [
42441
42441
  "Classify this task into exactly one pipeline template.",
42442
42442
  "Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
@@ -43181,6 +43181,77 @@ function buildScanSummary(total, confirmed, falsePositives, osvCount) {
43181
43181
  return parts.join(", ");
43182
43182
  }
43183
43183
 
43184
+ // src/security/quality-gate.ts
43185
+ async function runCommandCheck(name, command, args) {
43186
+ const start = Date.now();
43187
+ try {
43188
+ const { execFile: execFile3 } = await import("child_process");
43189
+ const { promisify: promisify3 } = await import("util");
43190
+ const exec2 = promisify3(execFile3);
43191
+ await exec2(command, [...args], { timeout: 12e4 });
43192
+ return {
43193
+ name,
43194
+ verdict: "pass",
43195
+ details: `${name} completed successfully`,
43196
+ durationMs: Date.now() - start
43197
+ };
43198
+ } catch (error) {
43199
+ const msg = error instanceof Error ? error.message : String(error);
43200
+ return {
43201
+ name,
43202
+ verdict: "fail",
43203
+ details: msg.slice(0, 500),
43204
+ durationMs: Date.now() - start
43205
+ };
43206
+ }
43207
+ }
43208
+ function checkTypeCheck(projectDir) {
43209
+ return () => runCommandCheck("type_check", "npx", ["tsc", "--noEmit", "--project", projectDir]);
43210
+ }
43211
+ function checkLint(projectDir) {
43212
+ return () => runCommandCheck("lint", "npx", ["eslint", "--max-warnings", "0", projectDir]);
43213
+ }
43214
+ function checkTests(projectDir) {
43215
+ return () => runCommandCheck("tests", "npx", ["vitest", "run", "--dir", projectDir]);
43216
+ }
43217
+ function checkBuild() {
43218
+ return () => runCommandCheck("build", "pnpm", ["build"]);
43219
+ }
43220
+ function aggregateResults2(checks) {
43221
+ let pass = 0;
43222
+ let fail = 0;
43223
+ let skip = 0;
43224
+ for (const c of checks) {
43225
+ if (c.verdict === "pass") pass++;
43226
+ else if (c.verdict === "fail") fail++;
43227
+ else skip++;
43228
+ }
43229
+ return { verdict: fail > 0 ? "fail" : "pass", summary: { pass, fail, skip } };
43230
+ }
43231
+ function generateFeedback2(checks) {
43232
+ const failures = checks.filter((c) => c.verdict === "fail");
43233
+ if (failures.length === 0) return "All checks passed.";
43234
+ const lines = failures.map((f) => `- ${f.name}: ${f.details}`);
43235
+ return `${String(failures.length)} check(s) failed:
43236
+ ${lines.join("\n")}`;
43237
+ }
43238
+ async function runQualityGate(stage, checks, iteration = 1) {
43239
+ const results = [];
43240
+ for (const check of checks) {
43241
+ const result = await check();
43242
+ results.push(result);
43243
+ }
43244
+ const { verdict, summary } = aggregateResults2(results);
43245
+ return {
43246
+ stage,
43247
+ verdict,
43248
+ checks: results,
43249
+ summary,
43250
+ feedback: generateFeedback2(results),
43251
+ iteration
43252
+ };
43253
+ }
43254
+
43184
43255
  // src/pipeline/agent-executor.ts
43185
43256
  var logger38 = createLogger({ component: "agent-executor" });
43186
43257
  function emitStageEvent2(stage, status, details) {
@@ -43433,7 +43504,7 @@ ${contextBlock}`;
43433
43504
  const strategy = config.votingStrategy ?? "higher_order";
43434
43505
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
43435
43506
  try {
43436
- const { executeVoting } = await import("./consensus-vote-Z3BWJLRE.js");
43507
+ const { executeVoting } = await import("./consensus-vote-PGOS5AA6.js");
43437
43508
  const votingResult = await executeVoting(
43438
43509
  {
43439
43510
  proposal: plan.slice(0, 4e3),
@@ -43566,6 +43637,33 @@ Verdict: PASS/NEEDS_WORK/REJECT`
43566
43637
  await postProgress(config, `QA [${task.id}]`, review.verdict);
43567
43638
  return review;
43568
43639
  },
43640
+ qualityGate: async () => {
43641
+ emitStageEvent2("quality-gate", "started");
43642
+ const start = getTimeProvider().now();
43643
+ const target = config.scanTarget ?? process.cwd();
43644
+ await postProgress(config, "QualityGate", `Typecheck/lint/tests on ${target}...`);
43645
+ const result = await runQualityGate("qa", [
43646
+ checkTypeCheck(target),
43647
+ checkLint(target),
43648
+ checkTests(target)
43649
+ ]);
43650
+ const passed = result.verdict !== "fail";
43651
+ const ms = getTimeProvider().now() - start;
43652
+ emitStageEvent2("quality-gate", passed ? "completed" : "failed", { durationMs: ms });
43653
+ recordOutcome({
43654
+ taskId: "quality-gate",
43655
+ category: "code_review",
43656
+ cli: void 0,
43657
+ success: passed,
43658
+ durationMs: ms
43659
+ });
43660
+ await postProgress(
43661
+ config,
43662
+ "QualityGate",
43663
+ passed ? "Passed" : `Gate failed: ${result.feedback}`
43664
+ );
43665
+ return { passed, feedback: result.feedback };
43666
+ },
43569
43667
  securityScan: async () => {
43570
43668
  emitStageEvent2("security", "started");
43571
43669
  const start = getTimeProvider().now();
@@ -43864,7 +43962,13 @@ async function runDevPipelineInner(task, stages, options, sid, prior) {
43864
43962
  logger41.info("Harness mode \u2014 returning tasks for external implementation");
43865
43963
  return buildHarnessResult(planResult, tasks);
43866
43964
  }
43867
- const result = await runImplSecurityPhase(planResult, tasks, stages, sid);
43965
+ const result = await runImplSecurityPhase(
43966
+ planResult,
43967
+ tasks,
43968
+ stages,
43969
+ sid,
43970
+ options?.qualityGate ?? "off"
43971
+ );
43868
43972
  applyPipelineHindsight(bm, task, sid, result);
43869
43973
  return result;
43870
43974
  }
@@ -43980,10 +44084,21 @@ function buildHarnessResult(planResult, tasks) {
43980
44084
  securityPassed: false
43981
44085
  };
43982
44086
  }
43983
- async function runImplSecurityPhase(planResult, tasks, stages, sid) {
44087
+ async function runImplSecurityPhase(planResult, tasks, stages, sid, qualityGateMode) {
43984
44088
  const implResult = await implementQaLoop(tasks, stages);
43985
44089
  if (sid !== void 0)
43986
44090
  saveStageCheckpoint(sid, "implement", { type: "implement", tasks: implResult.completedTasks });
44091
+ const qaGate = await runQualityGateStage(stages, qualityGateMode);
44092
+ if (qualityGateMode === "blocking" && !qaGate.passed) {
44093
+ return {
44094
+ completed: false,
44095
+ plan: planResult.plan,
44096
+ tasks: implResult.completedTasks.length > 0 ? implResult.completedTasks : tasks,
44097
+ voteIterations: planResult.iterations,
44098
+ qaIterations: implResult.totalIterations,
44099
+ securityPassed: false
44100
+ };
44101
+ }
43987
44102
  const security = await withStep(
43988
44103
  { name: "security-scan", kind: "pipeline.stage" },
43989
44104
  async (ctx) => {
@@ -44005,6 +44120,26 @@ async function runImplSecurityPhase(planResult, tasks, stages, sid) {
44005
44120
  securityPassed: security.passed
44006
44121
  };
44007
44122
  }
44123
+ async function runQualityGateStage(stages, mode) {
44124
+ if (mode === "off" || stages.qualityGate === void 0) {
44125
+ return { passed: true, feedback: "Quality gate skipped" };
44126
+ }
44127
+ const runGate = stages.qualityGate.bind(stages);
44128
+ return withStep(
44129
+ { name: "quality-gate", kind: "pipeline.stage", attrs: { mode } },
44130
+ async (ctx) => {
44131
+ const r = await runGate();
44132
+ const advisory = mode === "advisory" && !r.passed;
44133
+ ctx.setSummary(r.passed ? "passed" : advisory ? "FAILED (advisory)" : "FAILED");
44134
+ if (advisory) {
44135
+ logger41.warn("Quality gate failed (advisory \u2014 not blocking)", {
44136
+ feedback: r.feedback.slice(0, 200)
44137
+ });
44138
+ }
44139
+ return r;
44140
+ }
44141
+ );
44142
+ }
44008
44143
  async function runOrResume(prior, stage, run) {
44009
44144
  if (prior?.research !== void 0 && stage === "research") {
44010
44145
  logger41.info("Resuming from checkpoint", { stage });
@@ -45905,12 +46040,131 @@ function registerCiHealthCheckTool(server, deps) {
45905
46040
  logger55.info("Registered ci_health_check tool");
45906
46041
  }
45907
46042
 
46043
+ // src/mcp/tools/quality-gate-tool.ts
46044
+ import { statSync as statSync3 } from "fs";
46045
+ import { z as z101 } from "zod";
46046
+ var QualityCheckSchema = z101.enum(["typecheck", "lint", "tests", "build", "security"]);
46047
+ var DEFAULT_CHECKS = ["typecheck", "lint", "tests"];
46048
+ var RunQualityGateInputSchema = z101.object({
46049
+ /** Project directory to run checks against. Must resolve inside the repo/cwd root. */
46050
+ projectDir: z101.string().optional().describe(
46051
+ "Project directory to run checks against (default: cwd). Must stay inside the repo root."
46052
+ ),
46053
+ /** Which allowlisted checks to run. */
46054
+ checks: z101.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
46055
+ /** 1-based iteration counter, forwarded to the engine for feedback context. */
46056
+ iteration: z101.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
46057
+ });
46058
+ function validateProjectDir(raw) {
46059
+ const candidate = raw ?? process.cwd();
46060
+ const safe = resolveInsideRoot(candidate);
46061
+ if (safe === null) {
46062
+ return {
46063
+ error: toolStructuredError({
46064
+ errorCategory: "permission",
46065
+ message: `Invalid projectDir: "${candidate}" resolves outside the repository root (path traversal rejected).`
46066
+ })
46067
+ };
46068
+ }
46069
+ let stat5;
46070
+ try {
46071
+ stat5 = statSync3(safe);
46072
+ } catch {
46073
+ return {
46074
+ error: toolStructuredError({
46075
+ errorCategory: "validation",
46076
+ message: `Invalid projectDir: "${candidate}" does not exist.`
46077
+ })
46078
+ };
46079
+ }
46080
+ if (!stat5.isDirectory()) {
46081
+ return {
46082
+ error: toolStructuredError({
46083
+ errorCategory: "validation",
46084
+ message: `Invalid projectDir: "${candidate}" is not a directory.`
46085
+ })
46086
+ };
46087
+ }
46088
+ return { dir: safe };
46089
+ }
46090
+ function buildCheck(name, projectDir) {
46091
+ switch (name) {
46092
+ case "typecheck":
46093
+ return checkTypeCheck(projectDir);
46094
+ case "lint":
46095
+ return checkLint(projectDir);
46096
+ case "tests":
46097
+ return checkTests(projectDir);
46098
+ case "build":
46099
+ return checkBuild();
46100
+ case "security":
46101
+ return checkSecurityScan(projectDir);
46102
+ }
46103
+ }
46104
+ async function runQualityGateHandler(args, logger55) {
46105
+ const parsed = RunQualityGateInputSchema.safeParse(args);
46106
+ if (!parsed.success) {
46107
+ return toolStructuredError({
46108
+ errorCategory: "validation",
46109
+ message: `Validation error: ${formatZodError(parsed.error)}`
46110
+ });
46111
+ }
46112
+ const { projectDir, checks, iteration } = parsed.data;
46113
+ const validated = validateProjectDir(projectDir);
46114
+ if ("error" in validated) return validated.error;
46115
+ const checkFns = checks.map((name) => buildCheck(name, validated.dir));
46116
+ logger55.info("Running quality gate", { checks, iteration });
46117
+ try {
46118
+ const result = await runQualityGate("qa", checkFns, iteration);
46119
+ return toolSuccess(JSON.stringify(result, null, 2));
46120
+ } catch (err2) {
46121
+ return toolStructuredError({
46122
+ errorCategory: "internal",
46123
+ message: `Quality gate execution failed: ${err2 instanceof Error ? err2.message : String(err2)}`
46124
+ });
46125
+ }
46126
+ }
46127
+ var DESCRIPTION2 = "Run the QA quality gate (#1684 engine) against a project directory. Allowlisted checks: typecheck | lint | tests | build | security (default ['typecheck','lint','tests']). Returns the structured { stage, verdict, checks[], summary, feedback } verdict. projectDir must stay inside the repository root; per-check output is capped at 500 chars.";
46128
+ function registerRunQualityGateTool(server, deps) {
46129
+ const logger55 = deps.logger ?? createLogger({ tool: "run_quality_gate" });
46130
+ const toolSchema = {
46131
+ projectDir: z101.string().optional().describe(
46132
+ "Project directory to run checks against (default: cwd). Must stay inside the repo root."
46133
+ ),
46134
+ checks: z101.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
46135
+ iteration: z101.number().int().min(1).optional().describe("1-based iteration number (default 1).")
46136
+ };
46137
+ const secureHandler = createSecureHandler(
46138
+ (args) => runQualityGateHandler(args, logger55),
46139
+ {
46140
+ toolName: "run_quality_gate",
46141
+ rateLimiter: deps.rateLimiter,
46142
+ logger: logger55
46143
+ }
46144
+ );
46145
+ const timeoutMs = getToolTimeout("run_quality_gate", deps.security);
46146
+ const wrappedHandler = wrapToolWithTimeout("run_quality_gate", secureHandler, {
46147
+ timeoutMs,
46148
+ logger: logger55
46149
+ });
46150
+ server.registerTool(
46151
+ "run_quality_gate",
46152
+ {
46153
+ description: DESCRIPTION2,
46154
+ inputSchema: toolSchema,
46155
+ annotations: getToolAnnotations("run_quality_gate")
46156
+ },
46157
+ toSdkCallback(wrappedHandler)
46158
+ );
46159
+ logger55.info("Registered run_quality_gate tool");
46160
+ }
46161
+
45908
46162
  // src/mcp/tools/verify-audit-chain-tool.ts
45909
46163
  import * as fs12 from "fs/promises";
45910
46164
  import * as path11 from "path";
45911
- import { z as z101 } from "zod";
45912
- var VerifyAuditChainInputSchema = z101.object({
45913
- logDir: z101.string().min(1).max(512).describe(
46165
+ import { z as z102 } from "zod";
46166
+ var VerifyAuditChainInputSchema = z102.object({
46167
+ logDir: z102.string().min(1).max(512).describe(
45914
46168
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files in lexicographic order and verifies the combined chain."
45915
46169
  )
45916
46170
  });
@@ -45987,7 +46241,7 @@ async function handler2(args, ctx) {
45987
46241
  function registerVerifyAuditChainTool(server, deps) {
45988
46242
  const logger55 = deps.logger ?? createLogger({ tool: "verify_audit_chain" });
45989
46243
  const toolSchema = {
45990
- logDir: z101.string().min(1).max(512).describe(
46244
+ logDir: z102.string().min(1).max(512).describe(
45991
46245
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files and verifies the combined hash chain."
45992
46246
  )
45993
46247
  };
@@ -46011,18 +46265,18 @@ function registerVerifyAuditChainTool(server, deps) {
46011
46265
  }
46012
46266
 
46013
46267
  // src/mcp/tools/pipeline-tool.ts
46014
- import { z as z102 } from "zod";
46268
+ import { z as z103 } from "zod";
46015
46269
  import * as fs13 from "fs";
46016
46270
  import * as path12 from "path";
46017
- var PipelineInputSchema = z102.object({
46271
+ var PipelineInputSchema = z103.object({
46018
46272
  /** The task to execute. */
46019
- task: z102.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
46273
+ task: z103.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
46020
46274
  /** Path to a spec file (.md, .yaml) to use as task input. */
46021
- specFile: z102.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
46275
+ specFile: z103.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
46022
46276
  /** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
46023
- template: z102.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
46277
+ template: z103.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
46024
46278
  /** Voting strategy for consensus stages. */
46025
- votingStrategy: z102.enum([
46279
+ votingStrategy: z103.enum([
46026
46280
  "simple_majority",
46027
46281
  "supermajority",
46028
46282
  "unanimous",
@@ -46033,13 +46287,13 @@ var PipelineInputSchema = z102.object({
46033
46287
  "Voting strategy for plan approval. simple_majority (default), supermajority (67%), unanimous, higher_order (Bayesian), proof_of_learning, opinion_wise"
46034
46288
  ),
46035
46289
  /** Use 3 agents instead of 6 for faster voting. */
46036
- quickMode: z102.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
46290
+ quickMode: z103.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
46037
46291
  /** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
46038
- timeoutMs: z102.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
46292
+ timeoutMs: z103.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
46039
46293
  /** Stop after planning/voting (no implementation). */
46040
- dryRun: z102.boolean().default(false).describe("Stop after vote stage (no implementation)"),
46294
+ dryRun: z103.boolean().default(false).describe("Stop after vote stage (no implementation)"),
46041
46295
  /** TESTS ONLY — random output, must not be used for real decisions. (#2319) */
46042
- simulateVotes: z102.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
46296
+ simulateVotes: z103.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
46043
46297
  });
46044
46298
  function buildOutput2(result) {
46045
46299
  return {
@@ -46141,7 +46395,7 @@ function registerPipelineTool(server, deps) {
46141
46395
  }
46142
46396
 
46143
46397
  // src/mcp/tools/supply-chain-tradeoff-panel.ts
46144
- import { z as z103 } from "zod";
46398
+ import { z as z104 } from "zod";
46145
46399
  var DEFAULT_AXES = [
46146
46400
  "build_time_determinism",
46147
46401
  "supply_chain_risk",
@@ -46161,16 +46415,16 @@ var FULL_PANEL = [
46161
46415
  "scope_steward"
46162
46416
  ];
46163
46417
  var QUICK_PANEL = ["architect", "security", "scope_steward"];
46164
- var SupplyChainTradeoffPanelInputSchema = z103.object({
46165
- proposal: z103.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
46166
- axes: z103.array(z103.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
46418
+ var SupplyChainTradeoffPanelInputSchema = z104.object({
46419
+ proposal: z104.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
46420
+ axes: z104.array(z104.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
46167
46421
  `Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
46168
46422
  ),
46169
- context: z103.string().max(MAX_CONTEXT_LENGTH).optional().describe(
46423
+ context: z104.string().max(MAX_CONTEXT_LENGTH).optional().describe(
46170
46424
  "Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
46171
46425
  ),
46172
- quickMode: z103.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
46173
- simulate: z103.boolean().optional().default(false).describe("Use simulated voters (testing only)")
46426
+ quickMode: z104.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
46427
+ simulate: z104.boolean().optional().default(false).describe("Use simulated voters (testing only)")
46174
46428
  });
46175
46429
  function buildTradeoffProposal(input) {
46176
46430
  const axes = input.axes ?? DEFAULT_AXES;
@@ -46676,6 +46930,28 @@ var TOOL_ANNOTATIONS = {
46676
46930
  { category: "implicit", description: "Consumes rate limit quota" }
46677
46931
  ]
46678
46932
  },
46933
+ run_quality_gate: {
46934
+ annotations: {
46935
+ title: "Run Quality Gate",
46936
+ // Spawns build/test toolchains which can write artifacts — not read-only.
46937
+ readOnlyHint: false,
46938
+ destructiveHint: false,
46939
+ // Same checks against the same code yield the same verdict.
46940
+ idempotentHint: true,
46941
+ // build/test/security invoke local toolchains and may reach the network.
46942
+ openWorldHint: true
46943
+ },
46944
+ sideEffects: [
46945
+ {
46946
+ category: "implicit",
46947
+ description: "Spawns local toolchain processes (tsc/eslint/vitest/build) in the target project dir"
46948
+ },
46949
+ {
46950
+ category: "implicit",
46951
+ description: "build/test checks may write build artifacts and coverage output to disk"
46952
+ }
46953
+ ]
46954
+ },
46679
46955
  issue_triage: {
46680
46956
  annotations: {
46681
46957
  title: "Issue Triage",
@@ -47100,7 +47376,8 @@ var REGISTERED_TOOL_NAMES = [
47100
47376
  "run_pipeline",
47101
47377
  "pr_review",
47102
47378
  "supply_chain_tradeoff_panel",
47103
- "improvement_review"
47379
+ "improvement_review",
47380
+ "run_quality_gate"
47104
47381
  ];
47105
47382
  function registerTools(server, options) {
47106
47383
  const logger55 = options?.logger ?? createMcpLogger({ component: "tools" });
@@ -47235,40 +47512,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
47235
47512
  })(RiskLevel || {});
47236
47513
 
47237
47514
  // src/mcp/safety/stpa-schemas.ts
47238
- import { z as z104 } from "zod";
47239
- var HazardCategorySchema = z104.enum(HazardCategory);
47240
- var HazardSeveritySchema = z104.enum(HazardSeverity);
47241
- var ConstraintPrioritySchema = z104.enum(ConstraintPriority);
47242
- var RiskLevelSchema = z104.enum(RiskLevel);
47243
- var TriggerPatternSchema = z104.object({
47244
- parameter: z104.string().min(1),
47245
- matchType: z104.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
47246
- pattern: z104.string(),
47247
- reason: z104.string()
47515
+ import { z as z105 } from "zod";
47516
+ var HazardCategorySchema = z105.enum(HazardCategory);
47517
+ var HazardSeveritySchema = z105.enum(HazardSeverity);
47518
+ var ConstraintPrioritySchema = z105.enum(ConstraintPriority);
47519
+ var RiskLevelSchema = z105.enum(RiskLevel);
47520
+ var TriggerPatternSchema = z105.object({
47521
+ parameter: z105.string().min(1),
47522
+ matchType: z105.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
47523
+ pattern: z105.string(),
47524
+ reason: z105.string()
47248
47525
  });
47249
- var HazardSchema = z104.object({
47250
- id: z104.string().min(1),
47251
- description: z104.string(),
47526
+ var HazardSchema = z105.object({
47527
+ id: z105.string().min(1),
47528
+ description: z105.string(),
47252
47529
  category: HazardCategorySchema,
47253
47530
  severity: HazardSeveritySchema,
47254
- likelihood: z104.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
47255
- triggerConditions: z104.array(z104.string()),
47256
- consequences: z104.array(z104.string())
47531
+ likelihood: z105.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
47532
+ triggerConditions: z105.array(z105.string()),
47533
+ consequences: z105.array(z105.string())
47257
47534
  });
47258
- var UnsafeControlActionSchema = z104.object({
47259
- id: z104.string().min(1),
47260
- toolName: z104.string().min(1),
47261
- type: z104.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
47262
- description: z104.string(),
47263
- unsafeContext: z104.string(),
47264
- relatedHazards: z104.array(z104.string()),
47265
- triggerPatterns: z104.array(TriggerPatternSchema).optional()
47535
+ var UnsafeControlActionSchema = z105.object({
47536
+ id: z105.string().min(1),
47537
+ toolName: z105.string().min(1),
47538
+ type: z105.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
47539
+ description: z105.string(),
47540
+ unsafeContext: z105.string(),
47541
+ relatedHazards: z105.array(z105.string()),
47542
+ triggerPatterns: z105.array(TriggerPatternSchema).optional()
47266
47543
  });
47267
- var SafetyConstraintSchema = z104.object({
47268
- id: z104.string().min(1),
47269
- description: z104.string(),
47270
- mitigates: z104.array(z104.string()),
47271
- enforcement: z104.enum([
47544
+ var SafetyConstraintSchema = z105.object({
47545
+ id: z105.string().min(1),
47546
+ description: z105.string(),
47547
+ mitigates: z105.array(z105.string()),
47548
+ enforcement: z105.enum([
47272
47549
  "prevent",
47273
47550
  "require_confirmation",
47274
47551
  "alert",
@@ -47276,54 +47553,54 @@ var SafetyConstraintSchema = z104.object({
47276
47553
  "rate_limit",
47277
47554
  "require_privilege"
47278
47555
  ]),
47279
- validationFunction: z104.string().optional(),
47556
+ validationFunction: z105.string().optional(),
47280
47557
  priority: ConstraintPrioritySchema
47281
47558
  });
47282
- var PropertySchemaSchema = z104.object({
47283
- type: z104.string(),
47284
- description: z104.string().optional(),
47285
- enum: z104.array(z104.unknown()).optional(),
47286
- pattern: z104.string().optional(),
47287
- minimum: z104.number().optional(),
47288
- maximum: z104.number().optional()
47559
+ var PropertySchemaSchema = z105.object({
47560
+ type: z105.string(),
47561
+ description: z105.string().optional(),
47562
+ enum: z105.array(z105.unknown()).optional(),
47563
+ pattern: z105.string().optional(),
47564
+ minimum: z105.number().optional(),
47565
+ maximum: z105.number().optional()
47289
47566
  });
47290
- var ToolInputSchemaSchema = z104.object({
47291
- type: z104.string(),
47292
- properties: z104.record(z104.string(), PropertySchemaSchema).optional(),
47293
- required: z104.array(z104.string()).optional(),
47294
- additionalProperties: z104.boolean().optional()
47567
+ var ToolInputSchemaSchema = z105.object({
47568
+ type: z105.string(),
47569
+ properties: z105.record(z105.string(), PropertySchemaSchema).optional(),
47570
+ required: z105.array(z105.string()).optional(),
47571
+ additionalProperties: z105.boolean().optional()
47295
47572
  });
47296
- var ToolDefinitionSchema = z104.object({
47297
- name: z104.string().min(1),
47298
- description: z104.string(),
47573
+ var ToolDefinitionSchema = z105.object({
47574
+ name: z105.string().min(1),
47575
+ description: z105.string(),
47299
47576
  inputSchema: ToolInputSchemaSchema
47300
47577
  });
47301
- var AnalysisConfigurationSchema = z104.object({
47302
- includeLowSeverity: z104.boolean().default(true),
47303
- generateAllConstraints: z104.boolean().default(true),
47304
- checkInteractions: z104.boolean().default(true),
47305
- maxHazardsPerTool: z104.number().int().min(1).max(100).default(50),
47306
- categories: z104.array(HazardCategorySchema).default([])
47578
+ var AnalysisConfigurationSchema = z105.object({
47579
+ includeLowSeverity: z105.boolean().default(true),
47580
+ generateAllConstraints: z105.boolean().default(true),
47581
+ checkInteractions: z105.boolean().default(true),
47582
+ maxHazardsPerTool: z105.number().int().min(1).max(100).default(50),
47583
+ categories: z105.array(HazardCategorySchema).default([])
47307
47584
  });
47308
- var ConstraintViolationSchema = z104.object({
47309
- constraintId: z104.string().min(1),
47310
- constraintDescription: z104.string(),
47585
+ var ConstraintViolationSchema = z105.object({
47586
+ constraintId: z105.string().min(1),
47587
+ constraintDescription: z105.string(),
47311
47588
  severity: HazardSeveritySchema,
47312
- details: z104.string(),
47313
- remediation: z104.string()
47589
+ details: z105.string(),
47590
+ remediation: z105.string()
47314
47591
  });
47315
- var ValidationWarningSchema = z104.object({
47316
- code: z104.string().min(1),
47317
- message: z104.string(),
47318
- affected: z104.string()
47592
+ var ValidationWarningSchema = z105.object({
47593
+ code: z105.string().min(1),
47594
+ message: z105.string(),
47595
+ affected: z105.string()
47319
47596
  });
47320
- var ValidationResultSchema = z104.object({
47321
- valid: z104.boolean(),
47322
- toolName: z104.string().min(1),
47323
- violations: z104.array(ConstraintViolationSchema),
47324
- passed: z104.array(z104.string()),
47325
- warnings: z104.array(ValidationWarningSchema),
47326
- validatedAt: z104.date()
47597
+ var ValidationResultSchema = z105.object({
47598
+ valid: z105.boolean(),
47599
+ toolName: z105.string().min(1),
47600
+ violations: z105.array(ConstraintViolationSchema),
47601
+ passed: z105.array(z105.string()),
47602
+ warnings: z105.array(ValidationWarningSchema),
47603
+ validatedAt: z105.date()
47327
47604
  });
47328
47605
 
47329
47606
  // src/mcp/safety/stpa-types.ts
@@ -48408,43 +48685,43 @@ var GeminiResponseParser = class {
48408
48685
  };
48409
48686
 
48410
48687
  // src/cli-adapters/router-types.ts
48411
- import { z as z105 } from "zod";
48412
- var RouterConfigSchema = z105.object({
48413
- minCapacityThreshold: z105.number().min(0).max(1).default(0.1),
48414
- preferCostEfficient: z105.boolean().default(false),
48415
- maxDecisionTimeMs: z105.number().min(1).max(1e3).default(100)
48688
+ import { z as z106 } from "zod";
48689
+ var RouterConfigSchema = z106.object({
48690
+ minCapacityThreshold: z106.number().min(0).max(1).default(0.1),
48691
+ preferCostEfficient: z106.boolean().default(false),
48692
+ maxDecisionTimeMs: z106.number().min(1).max(1e3).default(100)
48416
48693
  });
48417
48694
 
48418
48695
  // src/cli-adapters/agreement-cascade-types.ts
48419
- import { z as z106 } from "zod";
48420
- var AgreementCascadeConfigSchema = z106.object({
48421
- agreementThreshold: z106.number().min(0.5).max(1).default(0.7),
48422
- maxStages: z106.number().int().min(1).max(5).default(3),
48423
- modelTimeoutMs: z106.number().int().min(1e3).max(3e5).default(6e4)
48696
+ import { z as z107 } from "zod";
48697
+ var AgreementCascadeConfigSchema = z107.object({
48698
+ agreementThreshold: z107.number().min(0.5).max(1).default(0.7),
48699
+ maxStages: z107.number().int().min(1).max(5).default(3),
48700
+ modelTimeoutMs: z107.number().int().min(1e3).max(3e5).default(6e4)
48424
48701
  });
48425
48702
 
48426
48703
  // src/cli-adapters/agreement-cascade-router.ts
48427
48704
  var logger45 = createLogger({ component: "agreement-cascade-router" });
48428
48705
 
48429
48706
  // src/cli-adapters/task-classifier.ts
48430
- import { z as z107 } from "zod";
48431
- var ClassificationPatternsSchema = z107.object({
48432
- code: z107.array(z107.string()).readonly(),
48433
- research: z107.array(z107.string()).readonly(),
48434
- documentation: z107.array(z107.string()).readonly(),
48435
- analysis: z107.array(z107.string()).readonly()
48707
+ import { z as z108 } from "zod";
48708
+ var ClassificationPatternsSchema = z108.object({
48709
+ code: z108.array(z108.string()).readonly(),
48710
+ research: z108.array(z108.string()).readonly(),
48711
+ documentation: z108.array(z108.string()).readonly(),
48712
+ analysis: z108.array(z108.string()).readonly()
48436
48713
  });
48437
48714
 
48438
48715
  // src/cli-adapters/response-cache-types.ts
48439
- import { z as z108 } from "zod";
48440
- var ResponseCacheConfigSchema = z108.object({
48441
- defaultTTL: z108.number().min(1e3).max(36e5).default(3e5),
48716
+ import { z as z109 } from "zod";
48717
+ var ResponseCacheConfigSchema = z109.object({
48718
+ defaultTTL: z109.number().min(1e3).max(36e5).default(3e5),
48442
48719
  // 5 minutes
48443
- maxEntries: z108.number().min(10).max(1e5).default(1e3),
48444
- maxMemoryMB: z108.number().min(1).max(1e3).default(50),
48445
- cleanupInterval: z108.number().min(1e3).max(6e5).default(6e4),
48720
+ maxEntries: z109.number().min(10).max(1e5).default(1e3),
48721
+ maxMemoryMB: z109.number().min(1).max(1e3).default(50),
48722
+ cleanupInterval: z109.number().min(1e3).max(6e5).default(6e4),
48446
48723
  // 1 minute
48447
- enableLogging: z108.boolean().default(false)
48724
+ enableLogging: z109.boolean().default(false)
48448
48725
  });
48449
48726
 
48450
48727
  // src/cli-adapters/response-cache-utils.ts
@@ -48452,12 +48729,12 @@ import { createHash as createHash4 } from "crypto";
48452
48729
  var logger46 = createLogger({ component: "ResponseCacheUtils" });
48453
48730
 
48454
48731
  // src/cli-adapters/unified-routing-types.ts
48455
- import { z as z109 } from "zod";
48456
- var UnifiedRoutingDecisionSchema = z109.object({
48457
- selectedCli: z109.string(),
48458
- confidence: z109.number().min(0).max(1),
48459
- reason: z109.string(),
48460
- strategy: z109.enum([
48732
+ import { z as z110 } from "zod";
48733
+ var UnifiedRoutingDecisionSchema = z110.object({
48734
+ selectedCli: z110.string(),
48735
+ confidence: z110.number().min(0).max(1),
48736
+ reason: z110.string(),
48737
+ strategy: z110.enum([
48461
48738
  "composite",
48462
48739
  "quality",
48463
48740
  "budget",
@@ -48469,57 +48746,57 @@ var UnifiedRoutingDecisionSchema = z109.object({
48469
48746
  "linucb",
48470
48747
  "direct"
48471
48748
  ]),
48472
- decisionTimeMs: z109.number().nonnegative(),
48473
- alternatives: z109.array(z109.string()).readonly(),
48474
- stagesExecuted: z109.array(z109.string()).readonly(),
48475
- withinBudget: z109.boolean().optional(),
48476
- estimatedComplexity: z109.enum(["simple", "moderate", "complex", "expert"]).optional(),
48477
- estimatedTokens: z109.number().int().positive().optional(),
48478
- topsisScore: z109.number().optional(),
48479
- ucbScore: z109.number().optional(),
48480
- resolvedAtStage: z109.number().int().nonnegative().optional(),
48481
- consensusReached: z109.boolean().optional(),
48482
- agreementScore: z109.number().min(0).max(1).optional(),
48483
- metadata: z109.record(z109.string(), z109.unknown()).optional()
48749
+ decisionTimeMs: z110.number().nonnegative(),
48750
+ alternatives: z110.array(z110.string()).readonly(),
48751
+ stagesExecuted: z110.array(z110.string()).readonly(),
48752
+ withinBudget: z110.boolean().optional(),
48753
+ estimatedComplexity: z110.enum(["simple", "moderate", "complex", "expert"]).optional(),
48754
+ estimatedTokens: z110.number().int().positive().optional(),
48755
+ topsisScore: z110.number().optional(),
48756
+ ucbScore: z110.number().optional(),
48757
+ resolvedAtStage: z110.number().int().nonnegative().optional(),
48758
+ consensusReached: z110.boolean().optional(),
48759
+ agreementScore: z110.number().min(0).max(1).optional(),
48760
+ metadata: z110.record(z110.string(), z110.unknown()).optional()
48484
48761
  });
48485
48762
 
48486
48763
  // src/learning/outcome-feedback-types.ts
48487
- import { z as z110 } from "zod";
48488
- var QualitySignalsSchema = z110.object({
48489
- testsPass: z110.boolean().optional(),
48490
- lintErrors: z110.number().int().min(0).optional(),
48491
- userApproved: z110.boolean().optional(),
48492
- retryCount: z110.number().int().min(0).default(0),
48493
- completionRatio: z110.number().min(0).max(1).default(1),
48494
- validStructure: z110.boolean().optional(),
48495
- coherenceScore: z110.number().min(0).max(1).optional()
48764
+ import { z as z111 } from "zod";
48765
+ var QualitySignalsSchema = z111.object({
48766
+ testsPass: z111.boolean().optional(),
48767
+ lintErrors: z111.number().int().min(0).optional(),
48768
+ userApproved: z111.boolean().optional(),
48769
+ retryCount: z111.number().int().min(0).default(0),
48770
+ completionRatio: z111.number().min(0).max(1).default(1),
48771
+ validStructure: z111.boolean().optional(),
48772
+ coherenceScore: z111.number().min(0).max(1).optional()
48496
48773
  });
48497
- var RoutingDecisionSchema = z110.object({
48498
- id: z110.uuid(),
48499
- timestamp: z110.iso.datetime(),
48500
- query: z110.string(),
48501
- routerType: z110.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
48502
- selectedModel: z110.string(),
48503
- selectedTier: z110.enum(["strong", "weak"]).optional(),
48504
- armIndex: z110.number().int().min(0).optional(),
48505
- banditContext: z110.record(z110.string(), z110.unknown()).optional(),
48506
- queryFeatures: z110.record(z110.string(), z110.unknown()).optional(),
48507
- ucbScore: z110.number().optional(),
48508
- confidence: z110.number().min(0).max(1).optional(),
48509
- traceId: z110.string(),
48510
- domain: z110.string().optional()
48774
+ var RoutingDecisionSchema = z111.object({
48775
+ id: z111.uuid(),
48776
+ timestamp: z111.iso.datetime(),
48777
+ query: z111.string(),
48778
+ routerType: z111.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
48779
+ selectedModel: z111.string(),
48780
+ selectedTier: z111.enum(["strong", "weak"]).optional(),
48781
+ armIndex: z111.number().int().min(0).optional(),
48782
+ banditContext: z111.record(z111.string(), z111.unknown()).optional(),
48783
+ queryFeatures: z111.record(z111.string(), z111.unknown()).optional(),
48784
+ ucbScore: z111.number().optional(),
48785
+ confidence: z111.number().min(0).max(1).optional(),
48786
+ traceId: z111.string(),
48787
+ domain: z111.string().optional()
48511
48788
  });
48512
- var TaskOutcomeSchema = z110.object({
48513
- routingDecisionId: z110.uuid(),
48514
- timestamp: z110.iso.datetime(),
48515
- outcomeClass: z110.enum(["success", "partial", "failure", "timeout", "error"]),
48516
- success: z110.boolean(),
48517
- qualityScore: z110.number().min(0).max(1),
48518
- durationMs: z110.number().min(0),
48519
- tokenUsage: z110.number().int().min(0),
48520
- errorMessage: z110.string().optional(),
48789
+ var TaskOutcomeSchema = z111.object({
48790
+ routingDecisionId: z111.uuid(),
48791
+ timestamp: z111.iso.datetime(),
48792
+ outcomeClass: z111.enum(["success", "partial", "failure", "timeout", "error"]),
48793
+ success: z111.boolean(),
48794
+ qualityScore: z111.number().min(0).max(1),
48795
+ durationMs: z111.number().min(0),
48796
+ tokenUsage: z111.number().int().min(0),
48797
+ errorMessage: z111.string().optional(),
48521
48798
  qualitySignals: QualitySignalsSchema,
48522
- traceId: z110.string()
48799
+ traceId: z111.string()
48523
48800
  });
48524
48801
  var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
48525
48802
  maxPendingDecisions: 1e3,
@@ -48534,17 +48811,17 @@ var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
48534
48811
  targetTokenUsage: 2e3,
48535
48812
  maxHistorySize: 1e4
48536
48813
  };
48537
- var FeedbackCollectorConfigSchema = z110.object({
48538
- maxPendingDecisions: z110.number().int().positive().default(1e3),
48539
- pendingTimeoutMs: z110.number().positive().default(3e5),
48540
- enableAutoReward: z110.boolean().default(true),
48541
- qualityWeight: z110.number().min(0).max(1).default(0.5),
48542
- speedWeight: z110.number().min(0).max(1).default(0.2),
48543
- efficiencyWeight: z110.number().min(0).max(1).default(0.2),
48544
- retryPenalty: z110.number().min(0).max(1).default(0.1),
48545
- targetDurationMs: z110.number().positive().default(5e3),
48546
- targetTokenUsage: z110.number().positive().default(2e3),
48547
- maxHistorySize: z110.number().int().positive().default(1e4)
48814
+ var FeedbackCollectorConfigSchema = z111.object({
48815
+ maxPendingDecisions: z111.number().int().positive().default(1e3),
48816
+ pendingTimeoutMs: z111.number().positive().default(3e5),
48817
+ enableAutoReward: z111.boolean().default(true),
48818
+ qualityWeight: z111.number().min(0).max(1).default(0.5),
48819
+ speedWeight: z111.number().min(0).max(1).default(0.2),
48820
+ efficiencyWeight: z111.number().min(0).max(1).default(0.2),
48821
+ retryPenalty: z111.number().min(0).max(1).default(0.1),
48822
+ targetDurationMs: z111.number().positive().default(5e3),
48823
+ targetTokenUsage: z111.number().positive().default(2e3),
48824
+ maxHistorySize: z111.number().int().positive().default(1e4)
48548
48825
  });
48549
48826
 
48550
48827
  // src/learning/outcome-feedback-helpers.ts
@@ -50781,6 +51058,7 @@ export {
50781
51058
  registerListJobsTool,
50782
51059
  registerCancelJobTool,
50783
51060
  registerCiHealthCheckTool,
51061
+ registerRunQualityGateTool,
50784
51062
  AuditError,
50785
51063
  AuditCategorySchema,
50786
51064
  AuditSeveritySchema,
@@ -50864,4 +51142,4 @@ export {
50864
51142
  detectBackend,
50865
51143
  createTaskTracker
50866
51144
  };
50867
- //# sourceMappingURL=chunk-DE3J2HYT.js.map
51145
+ //# sourceMappingURL=chunk-B364VMMP.js.map