nexus-agents 2.129.0 → 2.129.2

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.
@@ -31,7 +31,7 @@ import {
31
31
  toJobSummary,
32
32
  warnIfSimulatedOutsideTests,
33
33
  writeJobCancelled
34
- } from "./chunk-6CDAMT2O.js";
34
+ } from "./chunk-HMOPW3XC.js";
35
35
  import {
36
36
  normalizeTopicToCanonical,
37
37
  synthesizeResearch
@@ -123,7 +123,7 @@ import {
123
123
  DEFAULT_TASK_TTL_MS,
124
124
  DEFAULT_TOOL_RATE_LIMITS,
125
125
  clampTaskTtl
126
- } from "./chunk-ECGYBJQ3.js";
126
+ } from "./chunk-6RXP55DL.js";
127
127
  import {
128
128
  resolveInsideRoot
129
129
  } from "./chunk-NUBSJGQZ.js";
@@ -23615,10 +23615,10 @@ function calculateZStatistic(params) {
23615
23615
  function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
23616
23616
  const difference = p1 - p2;
23617
23617
  const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
23618
- const z113 = getZScore(confidence);
23618
+ const z114 = getZScore(confidence);
23619
23619
  return {
23620
- lower: difference - z113 * seDiff,
23621
- upper: difference + z113 * seDiff,
23620
+ lower: difference - z114 * seDiff,
23621
+ upper: difference + z114 * seDiff,
23622
23622
  estimate: difference,
23623
23623
  confidence,
23624
23624
  n: total1 + total2,
@@ -23641,11 +23641,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
23641
23641
  standardError: 0
23642
23642
  };
23643
23643
  }
23644
- const z113 = getZScore(opts.confidence);
23645
- const z210 = z113 * z113;
23644
+ const z114 = getZScore(opts.confidence);
23645
+ const z210 = z114 * z114;
23646
23646
  const denominator = 1 + z210 / n;
23647
23647
  const center = (p + z210 / (2 * n)) / denominator;
23648
- const margin = z113 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
23648
+ const margin = z114 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
23649
23649
  const lower = Math.max(0, center - margin);
23650
23650
  const upper = Math.min(1, center + margin);
23651
23651
  const standardError = Math.sqrt(p * (1 - p) / n);
@@ -23675,8 +23675,8 @@ function meanConfidenceInterval(values, options = {}) {
23675
23675
  const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
23676
23676
  const stdDev = Math.sqrt(variance);
23677
23677
  const standardError = stdDev / Math.sqrt(n);
23678
- const z113 = getZScore(opts.confidence);
23679
- const margin = z113 * standardError;
23678
+ const z114 = getZScore(opts.confidence);
23679
+ const margin = z114 * standardError;
23680
23680
  return {
23681
23681
  lower: mean - margin,
23682
23682
  upper: mean + margin,
@@ -43238,7 +43238,7 @@ ${contextBlock}`;
43238
43238
  const strategy = config.votingStrategy ?? "higher_order";
43239
43239
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
43240
43240
  try {
43241
- const { executeVoting } = await import("./consensus-vote-RT3DJYEI.js");
43241
+ const { executeVoting } = await import("./consensus-vote-3EMLBZ25.js");
43242
43242
  const votingResult = await executeVoting(
43243
43243
  {
43244
43244
  proposal: buildVoteProposal(plan, research),
@@ -44696,22 +44696,28 @@ function registerQueryTaskStateTool(server, deps) {
44696
44696
  }
44697
44697
 
44698
44698
  // src/mcp/tools/ci-health-check-tool.ts
44699
- import { z as z96 } from "zod";
44699
+ import { z as z97 } from "zod";
44700
44700
 
44701
44701
  // src/mcp/tools/ci-health-log.ts
44702
44702
  import { appendFileSync as appendFileSync4, existsSync as existsSync10, readFileSync as readFileSync8, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
44703
+ import { z as z96 } from "zod";
44704
+
44705
+ // src/mcp/tools/ci-health-types.ts
44703
44706
  import { z as z95 } from "zod";
44707
+ var CiHealthStatusSchema = z95.enum(["healthy", "degraded", "outage", "unknown"]);
44708
+
44709
+ // src/mcp/tools/ci-health-log.ts
44704
44710
  var logger45 = createLogger({ component: "ci-health-log" });
44705
- var CiHealthEventSchema = z95.object({
44706
- v: z95.literal(1),
44707
- ts: z95.iso.datetime(),
44711
+ var CiHealthEventSchema = z96.object({
44712
+ v: z96.literal(1),
44713
+ ts: z96.iso.datetime(),
44708
44714
  status: CiHealthStatusSchema,
44709
- repo: z95.string().optional(),
44710
- signals: z95.array(
44711
- z95.object({
44712
- source: z95.enum(["github-status", "repo-activity-window"]),
44715
+ repo: z96.string().optional(),
44716
+ signals: z96.array(
44717
+ z96.object({
44718
+ source: z96.enum(["github-status", "repo-activity-window"]),
44713
44719
  status: CiHealthStatusSchema,
44714
- evidence: z95.string()
44720
+ evidence: z96.string()
44715
44721
  })
44716
44722
  )
44717
44723
  });
@@ -44791,18 +44797,17 @@ function eventFromCheck(params) {
44791
44797
  }
44792
44798
 
44793
44799
  // src/mcp/tools/ci-health-check-tool.ts
44794
- var CiHealthStatusSchema = z96.enum(["healthy", "degraded", "outage", "unknown"]);
44795
- var CiHealthCheckInputSchema = z96.object({
44800
+ var CiHealthCheckInputSchema = z97.object({
44796
44801
  /**
44797
44802
  * Repo to check for the recent-runs activity signal (in `owner/repo` form).
44798
44803
  * Optional — when omitted, only the status-page signal is consulted.
44799
44804
  */
44800
- repo: z96.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."),
44805
+ repo: z97.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."),
44801
44806
  /**
44802
44807
  * How far back to look for recent-runs activity (minutes). Default 30 —
44803
44808
  * matches the typical wedge-detection window from the #3070 / #3076 outages.
44804
44809
  */
44805
- activityWindowMinutes: z96.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
44810
+ activityWindowMinutes: z97.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
44806
44811
  });
44807
44812
  var STATUS_PAGE_URL = "https://www.githubstatus.com/api/v2/components.json";
44808
44813
  function mapStatusPageStatus(raw) {
@@ -44935,8 +44940,8 @@ var DESCRIPTION = "Check CI infrastructure health before triggering / polling ru
44935
44940
  function registerCiHealthCheckTool(server, deps) {
44936
44941
  const logger57 = deps.logger ?? createLogger({ tool: "ci_health_check" });
44937
44942
  const toolSchema = {
44938
- repo: z96.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."),
44939
- activityWindowMinutes: z96.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
44943
+ repo: z97.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."),
44944
+ activityWindowMinutes: z97.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
44940
44945
  };
44941
44946
  const secureHandler = createSecureHandler((args) => ciHealthCheckHandler(args, logger57), {
44942
44947
  toolName: "ci_health_check",
@@ -44962,18 +44967,18 @@ function registerCiHealthCheckTool(server, deps) {
44962
44967
 
44963
44968
  // src/mcp/tools/quality-gate-tool.ts
44964
44969
  import { statSync as statSync3 } from "fs";
44965
- import { z as z97 } from "zod";
44966
- var QualityCheckSchema = z97.enum(["typecheck", "lint", "tests", "build", "security"]);
44970
+ import { z as z98 } from "zod";
44971
+ var QualityCheckSchema = z98.enum(["typecheck", "lint", "tests", "build", "security"]);
44967
44972
  var DEFAULT_CHECKS = ["typecheck", "lint", "tests"];
44968
- var RunQualityGateInputSchema = z97.object({
44973
+ var RunQualityGateInputSchema = z98.object({
44969
44974
  /** Project directory to run checks against. Must resolve inside the repo/cwd root. */
44970
- projectDir: z97.string().optional().describe(
44975
+ projectDir: z98.string().optional().describe(
44971
44976
  "Project directory to run checks against (default: cwd). Must stay inside the repo root."
44972
44977
  ),
44973
44978
  /** Which allowlisted checks to run. */
44974
- checks: z97.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
44979
+ checks: z98.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
44975
44980
  /** 1-based iteration counter, forwarded to the engine for feedback context. */
44976
- iteration: z97.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
44981
+ iteration: z98.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
44977
44982
  });
44978
44983
  function validateProjectDir(raw) {
44979
44984
  const candidate = raw ?? process.cwd();
@@ -45048,11 +45053,11 @@ var DESCRIPTION2 = "Run the QA quality gate (#1684 engine) against a project dir
45048
45053
  function registerRunQualityGateTool(server, deps) {
45049
45054
  const logger57 = deps.logger ?? createLogger({ tool: "run_quality_gate" });
45050
45055
  const toolSchema = {
45051
- projectDir: z97.string().optional().describe(
45056
+ projectDir: z98.string().optional().describe(
45052
45057
  "Project directory to run checks against (default: cwd). Must stay inside the repo root."
45053
45058
  ),
45054
- checks: z97.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
45055
- iteration: z97.number().int().min(1).optional().describe("1-based iteration number (default 1).")
45059
+ checks: z98.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
45060
+ iteration: z98.number().int().min(1).optional().describe("1-based iteration number (default 1).")
45056
45061
  };
45057
45062
  const secureHandler = createSecureHandler(
45058
45063
  (args) => runQualityGateHandler(args, logger57),
@@ -45082,9 +45087,9 @@ function registerRunQualityGateTool(server, deps) {
45082
45087
  // src/mcp/tools/verify-audit-chain-tool.ts
45083
45088
  import * as fs9 from "fs/promises";
45084
45089
  import * as path8 from "path";
45085
- import { z as z98 } from "zod";
45086
- var VerifyAuditChainInputSchema = z98.object({
45087
- logDir: z98.string().min(1).max(512).describe(
45090
+ import { z as z99 } from "zod";
45091
+ var VerifyAuditChainInputSchema = z99.object({
45092
+ logDir: z99.string().min(1).max(512).describe(
45088
45093
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files in lexicographic order and verifies the combined chain."
45089
45094
  )
45090
45095
  });
@@ -45161,7 +45166,7 @@ async function handler2(args, ctx) {
45161
45166
  function registerVerifyAuditChainTool(server, deps) {
45162
45167
  const logger57 = deps.logger ?? createLogger({ tool: "verify_audit_chain" });
45163
45168
  const toolSchema = {
45164
- logDir: z98.string().min(1).max(512).describe(
45169
+ logDir: z99.string().min(1).max(512).describe(
45165
45170
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files and verifies the combined hash chain."
45166
45171
  )
45167
45172
  };
@@ -45185,7 +45190,7 @@ function registerVerifyAuditChainTool(server, deps) {
45185
45190
  }
45186
45191
 
45187
45192
  // src/mcp/tools/suggest-research-tasks-tool.ts
45188
- import { z as z99 } from "zod";
45193
+ import { z as z100 } from "zod";
45189
45194
  var SUGGEST_RESEARCH_TASKS_NOTE = "Suggestions derived from external research (untrusted); review before acting \u2014 nothing was executed or filed.";
45190
45195
  var RESEARCH_BUDGET_MS = 2e4;
45191
45196
  var RESEARCH_TIMED_OUT = /* @__PURE__ */ Symbol("research-budget-exceeded");
@@ -45202,11 +45207,11 @@ async function withResearchBudget(p, ms) {
45202
45207
  if (timer !== void 0) clearTimeout(timer);
45203
45208
  }
45204
45209
  }
45205
- var SuggestResearchTasksInputSchema = z99.object({
45206
- topic: z99.string().optional().describe("Topic filter passed to research_discover. Optional."),
45207
- qualityThreshold: z99.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
45208
- maxTriggers: z99.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
45209
- existingTaskIds: z99.array(z99.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
45210
+ var SuggestResearchTasksInputSchema = z100.object({
45211
+ topic: z100.string().optional().describe("Topic filter passed to research_discover. Optional."),
45212
+ qualityThreshold: z100.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
45213
+ maxTriggers: z100.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
45214
+ existingTaskIds: z100.array(z100.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
45210
45215
  });
45211
45216
  function toTriggerConfig(input) {
45212
45217
  return {
@@ -45263,10 +45268,10 @@ var DESCRIPTION3 = "SUGGEST-ONLY: surface candidate pipeline tasks for human/orc
45263
45268
  function registerSuggestResearchTasksTool(server, deps) {
45264
45269
  const logger57 = deps.logger ?? createLogger({ tool: "suggest_research_tasks" });
45265
45270
  const toolSchema = {
45266
- topic: z99.string().optional().describe("Topic filter passed to research_discover. Optional."),
45267
- qualityThreshold: z99.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
45268
- maxTriggers: z99.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
45269
- existingTaskIds: z99.array(z99.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
45271
+ topic: z100.string().optional().describe("Topic filter passed to research_discover. Optional."),
45272
+ qualityThreshold: z100.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
45273
+ maxTriggers: z100.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
45274
+ existingTaskIds: z100.array(z100.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
45270
45275
  };
45271
45276
  const secureHandler = createSecureHandler(
45272
45277
  (args) => suggestResearchTasksHandler(args, logger57),
@@ -45294,7 +45299,7 @@ function registerSuggestResearchTasksTool(server, deps) {
45294
45299
  }
45295
45300
 
45296
45301
  // src/mcp/tools/run-tool.ts
45297
- import { z as z103 } from "zod";
45302
+ import { z as z104 } from "zod";
45298
45303
  import { randomUUID as randomUUID17 } from "crypto";
45299
45304
 
45300
45305
  // src/orchestration/meta-orchestrator.ts
@@ -45499,7 +45504,7 @@ function createMetaOrchestrator(options) {
45499
45504
 
45500
45505
  // src/orchestration/meta-shadow-selector.ts
45501
45506
  import { appendFileSync as appendFileSync5, existsSync as existsSync11, readFileSync as readFileSync9 } from "fs";
45502
- import { z as z100 } from "zod";
45507
+ import { z as z101 } from "zod";
45503
45508
  var SHADOW_STRATEGY_ARMS = [
45504
45509
  "single-shot",
45505
45510
  "dev-pipeline",
@@ -45580,19 +45585,19 @@ function createHydratableSelector() {
45580
45585
  var META_OUTCOME_SCHEMA_VERSION = 1;
45581
45586
  var HYDRATE_LOOKBACK_DAYS = 30;
45582
45587
  var HYDRATE_LOOKBACK_MS = HYDRATE_LOOKBACK_DAYS * 24 * 60 * 60 * 1e3;
45583
- var PersistedContextSchema = z100.object({
45584
- taskComplexity: z100.number(),
45585
- contextLengthNormalized: z100.number(),
45586
- isCodeTask: z100.number(),
45587
- isReasoningTask: z100.number(),
45588
- budgetUtilization: z100.number(),
45589
- timePressure: z100.number()
45588
+ var PersistedContextSchema = z101.object({
45589
+ taskComplexity: z101.number(),
45590
+ contextLengthNormalized: z101.number(),
45591
+ isCodeTask: z101.number(),
45592
+ isReasoningTask: z101.number(),
45593
+ budgetUtilization: z101.number(),
45594
+ timePressure: z101.number()
45590
45595
  });
45591
- var PersistedMetaOutcomeSchema = z100.object({
45592
- schema: z100.literal(META_OUTCOME_SCHEMA_VERSION),
45593
- timestamp: z100.string(),
45594
- strategy: z100.enum(SHADOW_STRATEGY_ARMS),
45595
- success: z100.boolean(),
45596
+ var PersistedMetaOutcomeSchema = z101.object({
45597
+ schema: z101.literal(META_OUTCOME_SCHEMA_VERSION),
45598
+ timestamp: z101.string(),
45599
+ strategy: z101.enum(SHADOW_STRATEGY_ARMS),
45600
+ success: z101.boolean(),
45596
45601
  context: PersistedContextSchema
45597
45602
  });
45598
45603
  var persistLogger = createLogger({ component: "MetaShadowSelector" });
@@ -45763,7 +45768,7 @@ function createMetaDispatcher(options) {
45763
45768
  }
45764
45769
 
45765
45770
  // src/mcp/tools/dev-pipeline-tool.ts
45766
- import { z as z101 } from "zod";
45771
+ import { z as z102 } from "zod";
45767
45772
  import * as fs11 from "fs";
45768
45773
  import * as path10 from "path";
45769
45774
  import { randomUUID as randomUUID15 } from "crypto";
@@ -45910,36 +45915,36 @@ function createTaskTracker(config) {
45910
45915
 
45911
45916
  // src/mcp/tools/dev-pipeline-tool.ts
45912
45917
  var DEV_PIPELINE_ASYNC_HINT = "A full run_dev_pipeline run can exceed the 900s synchronous MCP timeout. Retry with `dispatch: 'async'` to get a jobId immediately, then poll get_job_result({ jobId }) for the result.";
45913
- var DevPipelineInputSchema = z101.object({
45918
+ var DevPipelineInputSchema = z102.object({
45914
45919
  /** Direct task instructions. */
45915
- task: z101.string().max(1e4).optional().describe("Direct task instructions (what to build)"),
45920
+ task: z102.string().max(1e4).optional().describe("Direct task instructions (what to build)"),
45916
45921
  /** Path to a plan file (.md, .yaml, .txt) to use as input. */
45917
- planFile: z101.string().max(500).optional().describe("Path to a plan/spec file to use as input"),
45922
+ planFile: z102.string().max(500).optional().describe("Path to a plan/spec file to use as input"),
45918
45923
  /** Whether to run in dry-run mode (plan+vote only, no implementation). */
45919
- dryRun: z101.boolean().default(false).describe("If true, stop after plan+vote (no implementation)"),
45924
+ dryRun: z102.boolean().default(false).describe("If true, stop after plan+vote (no implementation)"),
45920
45925
  /** Maximum vote iterations before proceeding (default: 3). */
45921
- maxVoteIterations: z101.number().int().min(1).max(5).default(3).describe("Max plan\u2192vote iterations"),
45926
+ maxVoteIterations: z102.number().int().min(1).max(5).default(3).describe("Max plan\u2192vote iterations"),
45922
45927
  /** Maximum QA iterations per task (default: 3). */
45923
- maxQaIterations: z101.number().int().min(1).max(5).default(3).describe("Max QA review iterations per task"),
45928
+ maxQaIterations: z102.number().int().min(1).max(5).default(3).describe("Max QA review iterations per task"),
45924
45929
  /** Working directory for the pipeline (default: cwd). Used for security scan and context. */
45925
- workingDir: z101.string().max(500).optional().describe("Working directory (default: cwd)"),
45930
+ workingDir: z102.string().max(500).optional().describe("Working directory (default: cwd)"),
45926
45931
  /** GitHub issue number to track progress on. Updates posted as comments. */
45927
- issueNumber: z101.number().int().positive().optional().describe("GitHub issue to post progress to"),
45932
+ issueNumber: z102.number().int().positive().optional().describe("GitHub issue to post progress to"),
45928
45933
  /** GitHub repo (owner/name) for issue tracking. */
45929
- repo: z101.string().max(200).optional().describe("GitHub repo for issue tracking (e.g., owner/repo)"),
45934
+ repo: z102.string().max(200).optional().describe("GitHub repo for issue tracking (e.g., owner/repo)"),
45930
45935
  /** Task tracking backend: github, gitlab, or json (default: json). */
45931
- trackerBackend: z101.enum(["github", "gitlab", "json"]).default("json").describe("Task tracking backend for issue creation"),
45936
+ trackerBackend: z102.enum(["github", "gitlab", "json"]).default("json").describe("Task tracking backend for issue creation"),
45932
45937
  /** Labels to apply to created issues. */
45933
- labels: z101.array(z101.string()).optional().describe("Labels for created issues"),
45938
+ labels: z102.array(z102.string()).optional().describe("Labels for created issues"),
45934
45939
  /** Session ID for checkpoint/resume. Enables crash recovery. */
45935
- sessionId: z101.string().max(128).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Session ID for checkpoint/resume (crash recovery)"),
45940
+ sessionId: z102.string().max(128).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Session ID for checkpoint/resume (crash recovery)"),
45936
45941
  /**
45937
45942
  * TESTS ONLY — when true, voters return random decisions. Must not be used as
45938
45943
  * a fallback when adapters are unavailable; configure an adapter instead. (#2319)
45939
45944
  */
45940
- simulateVotes: z101.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
45945
+ simulateVotes: z102.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
45941
45946
  /** Voting strategy for consensus stages. */
45942
- votingStrategy: z101.enum([
45947
+ votingStrategy: z102.enum([
45943
45948
  "simple_majority",
45944
45949
  "supermajority",
45945
45950
  "unanimous",
@@ -45948,11 +45953,11 @@ var DevPipelineInputSchema = z101.object({
45948
45953
  "opinion_wise"
45949
45954
  ]).optional().describe("Voting strategy for plan approval (default: higher_order)"),
45950
45955
  /** Use 3 agents instead of 6 for faster voting. */
45951
- quickMode: z101.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
45956
+ quickMode: z102.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
45952
45957
  /** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
45953
- timeoutMs: z101.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
45958
+ timeoutMs: z102.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
45954
45959
  /** Pipeline execution mode. */
45955
- mode: z101.enum(["autonomous", "harness"]).default("autonomous").describe(
45960
+ mode: z102.enum(["autonomous", "harness"]).default("autonomous").describe(
45956
45961
  "'autonomous': full pipeline. 'harness': stops after decompose, returns tasks for caller to implement."
45957
45962
  ),
45958
45963
  /**
@@ -45963,15 +45968,15 @@ var DevPipelineInputSchema = z101.object({
45963
45968
  * `get_job_result({ jobId })` for the result. Ignored when `dryRun` is
45964
45969
  * true (plan+vote completes fast, so dry runs always stay sync).
45965
45970
  */
45966
- dispatch: z101.enum(["sync", "async"]).default("sync").describe(
45971
+ dispatch: z102.enum(["sync", "async"]).default("sync").describe(
45967
45972
  "Dispatch mode (#3726). 'sync' (default): run inline. 'async': return a jobId immediately + run in background (poll get_job_result). Ignored for dryRun."
45968
45973
  ),
45969
45974
  /** Local pre-ship quality gate (typecheck/lint/tests) mode (#3356). */
45970
- qualityGate: z101.enum(["off", "advisory", "blocking"]).default("off").describe(
45975
+ qualityGate: z102.enum(["off", "advisory", "blocking"]).default("off").describe(
45971
45976
  "Pre-ship local quality gate. 'off' (default): skip. 'advisory': run + record feedback, never fail. 'blocking': a red gate fails the pipeline."
45972
45977
  ),
45973
45978
  /** Opt-in per-run token budget — a safety cap for unattended runs (#3395). */
45974
- maxBudgetTokens: z101.number().int().positive().optional().describe(
45979
+ maxBudgetTokens: z102.number().int().positive().optional().describe(
45975
45980
  "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)."
45976
45981
  )
45977
45982
  });
@@ -46136,20 +46141,20 @@ function registerDevPipelineTool(server, deps) {
46136
46141
  }
46137
46142
 
46138
46143
  // src/mcp/tools/pipeline-tool.ts
46139
- import { z as z102 } from "zod";
46144
+ import { z as z103 } from "zod";
46140
46145
  import * as fs12 from "fs";
46141
46146
  import * as path11 from "path";
46142
46147
  import { randomUUID as randomUUID16 } from "crypto";
46143
46148
  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.";
46144
- var PipelineInputSchema = z102.object({
46149
+ var PipelineInputSchema = z103.object({
46145
46150
  /** The task to execute. */
46146
- task: z102.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
46151
+ task: z103.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
46147
46152
  /** Path to a spec file (.md, .yaml) to use as task input. */
46148
- specFile: z102.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
46153
+ specFile: z103.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
46149
46154
  /** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
46150
- template: z102.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
46155
+ template: z103.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
46151
46156
  /** Voting strategy for consensus stages. */
46152
- votingStrategy: z102.enum([
46157
+ votingStrategy: z103.enum([
46153
46158
  "simple_majority",
46154
46159
  "supermajority",
46155
46160
  "unanimous",
@@ -46160,11 +46165,11 @@ var PipelineInputSchema = z102.object({
46160
46165
  "Voting strategy for plan approval. simple_majority (default), supermajority (67%), unanimous, higher_order (Bayesian), proof_of_learning, opinion_wise"
46161
46166
  ),
46162
46167
  /** Use 3 agents instead of 6 for faster voting. */
46163
- quickMode: z102.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
46168
+ quickMode: z103.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
46164
46169
  /** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
46165
- timeoutMs: z102.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
46170
+ timeoutMs: z103.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
46166
46171
  /** Stop after planning/voting (no implementation). */
46167
- dryRun: z102.boolean().default(false).describe("Stop after vote stage (no implementation)"),
46172
+ dryRun: z103.boolean().default(false).describe("Stop after vote stage (no implementation)"),
46168
46173
  /**
46169
46174
  * Dispatch mode (#3730). `sync` (default) runs the pipeline inline and
46170
46175
  * returns the result — but a real multi-stage adaptive run can exceed the
@@ -46173,11 +46178,11 @@ var PipelineInputSchema = z102.object({
46173
46178
  * `get_job_result({ jobId })` for the result. Ignored when `dryRun` is true
46174
46179
  * (plan+vote completes fast, so dry runs always stay sync).
46175
46180
  */
46176
- dispatch: z102.enum(["sync", "async"]).default("sync").describe(
46181
+ dispatch: z103.enum(["sync", "async"]).default("sync").describe(
46177
46182
  "Dispatch mode (#3730). 'sync' (default): run inline. 'async': return a jobId immediately + run in background (poll get_job_result). Ignored for dryRun."
46178
46183
  ),
46179
46184
  /** TESTS ONLY — random output, must not be used for real decisions. (#2319) */
46180
- simulateVotes: z102.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
46185
+ simulateVotes: z103.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
46181
46186
  });
46182
46187
  function buildOutput2(result) {
46183
46188
  return {
@@ -46333,9 +46338,9 @@ var STRATEGY_ENTRYPOINT_TOOL = {
46333
46338
  spec: "execute_spec",
46334
46339
  research: "run_pipeline"
46335
46340
  };
46336
- var RunInputSchema = z103.object({
46337
- goal: z103.string().min(1).describe("Natural-language goal. nexus-agents selects how to execute it."),
46338
- forceStrategy: z103.enum([
46341
+ var RunInputSchema = z104.object({
46342
+ goal: z104.string().min(1).describe("Natural-language goal. nexus-agents selects how to execute it."),
46343
+ forceStrategy: z104.enum([
46339
46344
  "single-shot",
46340
46345
  "dev-pipeline",
46341
46346
  "pipeline",
@@ -46347,10 +46352,10 @@ var RunInputSchema = z103.object({
46347
46352
  ]).optional().describe(
46348
46353
  "Power-user override: force a specific strategy instead of letting the router choose."
46349
46354
  ),
46350
- requiresConsensus: z103.boolean().optional().describe("Hint: the task needs a multi-perspective consensus decision."),
46351
- dependencyStructure: z103.enum(["linear", "dag", "independent", "unknown"]).optional().describe("Hint: the dependency structure of the work."),
46352
- isNovel: z103.boolean().optional().describe("Hint: this kind of task has not been seen before."),
46353
- execute: z103.boolean().optional().describe(
46355
+ requiresConsensus: z104.boolean().optional().describe("Hint: the task needs a multi-perspective consensus decision."),
46356
+ dependencyStructure: z104.enum(["linear", "dag", "independent", "unknown"]).optional().describe("Hint: the dependency structure of the work."),
46357
+ isNovel: z104.boolean().optional().describe("Hint: this kind of task has not been seen before."),
46358
+ execute: z104.boolean().optional().describe(
46354
46359
  "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)."
46355
46360
  ),
46356
46361
  /**
@@ -46361,7 +46366,7 @@ var RunInputSchema = z103.object({
46361
46366
  * envelope immediately and runs in the background; poll
46362
46367
  * `get_job_result({ jobId })`. Ignored for read-only routing (execute:false).
46363
46368
  */
46364
- dispatch: z103.enum(["sync", "async"]).optional().describe(
46369
+ dispatch: z104.enum(["sync", "async"]).optional().describe(
46365
46370
  "Dispatch mode (#3732). 'sync' (default): run inline. 'async' (only with execute:true): return a jobId immediately + run in background (poll get_job_result)."
46366
46371
  )
46367
46372
  });
@@ -46521,12 +46526,12 @@ function registerRunTool(server, deps) {
46521
46526
  }
46522
46527
 
46523
46528
  // src/mcp/tools/list-available-models-tool.ts
46524
- import { z as z104 } from "zod";
46529
+ import { z as z105 } from "zod";
46525
46530
  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.";
46526
46531
  var PROBE_TIMEOUT_MS = 12e3;
46527
- var ListAvailableModelsInputSchema = z104.object({
46528
- includeModelIds: z104.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
46529
- includeOpenRouter: z104.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
46532
+ var ListAvailableModelsInputSchema = z105.object({
46533
+ includeModelIds: z105.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
46534
+ includeOpenRouter: z105.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
46530
46535
  });
46531
46536
  async function probeSource(source, includeModelIds) {
46532
46537
  let timer;
@@ -46590,8 +46595,8 @@ async function listAvailableModelsHandler(args, deps, logger57) {
46590
46595
  function registerListAvailableModelsTool(server, deps) {
46591
46596
  const logger57 = deps.logger ?? createLogger({ tool: "list_available_models" });
46592
46597
  const toolSchema = {
46593
- includeModelIds: z104.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
46594
- includeOpenRouter: z104.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
46598
+ includeModelIds: z105.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
46599
+ includeOpenRouter: z105.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
46595
46600
  };
46596
46601
  const secureHandler = createSecureHandler(
46597
46602
  (args) => listAvailableModelsHandler(args, deps, logger57),
@@ -46615,7 +46620,7 @@ function registerListAvailableModelsTool(server, deps) {
46615
46620
  }
46616
46621
 
46617
46622
  // src/mcp/tools/supply-chain-tradeoff-panel.ts
46618
- import { z as z105 } from "zod";
46623
+ import { z as z106 } from "zod";
46619
46624
  import { randomUUID as randomUUID18 } from "crypto";
46620
46625
  var DEFAULT_AXES = [
46621
46626
  "build_time_determinism",
@@ -46637,16 +46642,16 @@ var FULL_PANEL = [
46637
46642
  "scope_steward"
46638
46643
  ];
46639
46644
  var QUICK_PANEL = ["architect", "security", "scope_steward"];
46640
- var SupplyChainTradeoffPanelInputSchema = z105.object({
46641
- proposal: z105.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
46642
- axes: z105.array(z105.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
46645
+ var SupplyChainTradeoffPanelInputSchema = z106.object({
46646
+ proposal: z106.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
46647
+ axes: z106.array(z106.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
46643
46648
  `Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
46644
46649
  ),
46645
- context: z105.string().max(MAX_CONTEXT_LENGTH).optional().describe(
46650
+ context: z106.string().max(MAX_CONTEXT_LENGTH).optional().describe(
46646
46651
  "Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
46647
46652
  ),
46648
- quickMode: z105.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
46649
- simulate: z105.boolean().optional().default(false).describe("Use simulated voters (testing only)"),
46653
+ quickMode: z106.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
46654
+ simulate: z106.boolean().optional().default(false).describe("Use simulated voters (testing only)"),
46650
46655
  /**
46651
46656
  * Dispatch mode (#3731). `sync` (default) runs the panel inline and returns
46652
46657
  * the result — but a live fan-out (up to 7 voters) can exceed the MCP request
@@ -46654,7 +46659,7 @@ var SupplyChainTradeoffPanelInputSchema = z105.object({
46654
46659
  * immediately and runs the panel in the background; poll
46655
46660
  * `get_job_result({ jobId })` for the result.
46656
46661
  */
46657
- dispatch: z105.enum(["sync", "async"]).default("sync").describe(
46662
+ dispatch: z106.enum(["sync", "async"]).default("sync").describe(
46658
46663
  "Dispatch mode (#3731). 'sync' (default): run inline. 'async': return a jobId immediately + run the panel in background (poll get_job_result)."
46659
46664
  )
46660
46665
  });
@@ -47121,40 +47126,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
47121
47126
  })(RiskLevel || {});
47122
47127
 
47123
47128
  // src/mcp/safety/stpa-schemas.ts
47124
- import { z as z106 } from "zod";
47125
- var HazardCategorySchema = z106.enum(HazardCategory);
47126
- var HazardSeveritySchema = z106.enum(HazardSeverity);
47127
- var ConstraintPrioritySchema = z106.enum(ConstraintPriority);
47128
- var RiskLevelSchema = z106.enum(RiskLevel);
47129
- var TriggerPatternSchema = z106.object({
47130
- parameter: z106.string().min(1),
47131
- matchType: z106.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
47132
- pattern: z106.string(),
47133
- reason: z106.string()
47129
+ import { z as z107 } from "zod";
47130
+ var HazardCategorySchema = z107.enum(HazardCategory);
47131
+ var HazardSeveritySchema = z107.enum(HazardSeverity);
47132
+ var ConstraintPrioritySchema = z107.enum(ConstraintPriority);
47133
+ var RiskLevelSchema = z107.enum(RiskLevel);
47134
+ var TriggerPatternSchema = z107.object({
47135
+ parameter: z107.string().min(1),
47136
+ matchType: z107.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
47137
+ pattern: z107.string(),
47138
+ reason: z107.string()
47134
47139
  });
47135
- var HazardSchema = z106.object({
47136
- id: z106.string().min(1),
47137
- description: z106.string(),
47140
+ var HazardSchema = z107.object({
47141
+ id: z107.string().min(1),
47142
+ description: z107.string(),
47138
47143
  category: HazardCategorySchema,
47139
47144
  severity: HazardSeveritySchema,
47140
- likelihood: z106.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
47141
- triggerConditions: z106.array(z106.string()),
47142
- consequences: z106.array(z106.string())
47145
+ likelihood: z107.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
47146
+ triggerConditions: z107.array(z107.string()),
47147
+ consequences: z107.array(z107.string())
47143
47148
  });
47144
- var UnsafeControlActionSchema = z106.object({
47145
- id: z106.string().min(1),
47146
- toolName: z106.string().min(1),
47147
- type: z106.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
47148
- description: z106.string(),
47149
- unsafeContext: z106.string(),
47150
- relatedHazards: z106.array(z106.string()),
47151
- triggerPatterns: z106.array(TriggerPatternSchema).optional()
47149
+ var UnsafeControlActionSchema = z107.object({
47150
+ id: z107.string().min(1),
47151
+ toolName: z107.string().min(1),
47152
+ type: z107.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
47153
+ description: z107.string(),
47154
+ unsafeContext: z107.string(),
47155
+ relatedHazards: z107.array(z107.string()),
47156
+ triggerPatterns: z107.array(TriggerPatternSchema).optional()
47152
47157
  });
47153
- var SafetyConstraintSchema = z106.object({
47154
- id: z106.string().min(1),
47155
- description: z106.string(),
47156
- mitigates: z106.array(z106.string()),
47157
- enforcement: z106.enum([
47158
+ var SafetyConstraintSchema = z107.object({
47159
+ id: z107.string().min(1),
47160
+ description: z107.string(),
47161
+ mitigates: z107.array(z107.string()),
47162
+ enforcement: z107.enum([
47158
47163
  "prevent",
47159
47164
  "require_confirmation",
47160
47165
  "alert",
@@ -47162,54 +47167,54 @@ var SafetyConstraintSchema = z106.object({
47162
47167
  "rate_limit",
47163
47168
  "require_privilege"
47164
47169
  ]),
47165
- validationFunction: z106.string().optional(),
47170
+ validationFunction: z107.string().optional(),
47166
47171
  priority: ConstraintPrioritySchema
47167
47172
  });
47168
- var PropertySchemaSchema = z106.object({
47169
- type: z106.string(),
47170
- description: z106.string().optional(),
47171
- enum: z106.array(z106.unknown()).optional(),
47172
- pattern: z106.string().optional(),
47173
- minimum: z106.number().optional(),
47174
- maximum: z106.number().optional()
47173
+ var PropertySchemaSchema = z107.object({
47174
+ type: z107.string(),
47175
+ description: z107.string().optional(),
47176
+ enum: z107.array(z107.unknown()).optional(),
47177
+ pattern: z107.string().optional(),
47178
+ minimum: z107.number().optional(),
47179
+ maximum: z107.number().optional()
47175
47180
  });
47176
- var ToolInputSchemaSchema = z106.object({
47177
- type: z106.string(),
47178
- properties: z106.record(z106.string(), PropertySchemaSchema).optional(),
47179
- required: z106.array(z106.string()).optional(),
47180
- additionalProperties: z106.boolean().optional()
47181
+ var ToolInputSchemaSchema = z107.object({
47182
+ type: z107.string(),
47183
+ properties: z107.record(z107.string(), PropertySchemaSchema).optional(),
47184
+ required: z107.array(z107.string()).optional(),
47185
+ additionalProperties: z107.boolean().optional()
47181
47186
  });
47182
- var ToolDefinitionSchema = z106.object({
47183
- name: z106.string().min(1),
47184
- description: z106.string(),
47187
+ var ToolDefinitionSchema = z107.object({
47188
+ name: z107.string().min(1),
47189
+ description: z107.string(),
47185
47190
  inputSchema: ToolInputSchemaSchema
47186
47191
  });
47187
- var AnalysisConfigurationSchema = z106.object({
47188
- includeLowSeverity: z106.boolean().default(true),
47189
- generateAllConstraints: z106.boolean().default(true),
47190
- checkInteractions: z106.boolean().default(true),
47191
- maxHazardsPerTool: z106.number().int().min(1).max(100).default(50),
47192
- categories: z106.array(HazardCategorySchema).default([])
47192
+ var AnalysisConfigurationSchema = z107.object({
47193
+ includeLowSeverity: z107.boolean().default(true),
47194
+ generateAllConstraints: z107.boolean().default(true),
47195
+ checkInteractions: z107.boolean().default(true),
47196
+ maxHazardsPerTool: z107.number().int().min(1).max(100).default(50),
47197
+ categories: z107.array(HazardCategorySchema).default([])
47193
47198
  });
47194
- var ConstraintViolationSchema = z106.object({
47195
- constraintId: z106.string().min(1),
47196
- constraintDescription: z106.string(),
47199
+ var ConstraintViolationSchema = z107.object({
47200
+ constraintId: z107.string().min(1),
47201
+ constraintDescription: z107.string(),
47197
47202
  severity: HazardSeveritySchema,
47198
- details: z106.string(),
47199
- remediation: z106.string()
47203
+ details: z107.string(),
47204
+ remediation: z107.string()
47200
47205
  });
47201
- var ValidationWarningSchema = z106.object({
47202
- code: z106.string().min(1),
47203
- message: z106.string(),
47204
- affected: z106.string()
47206
+ var ValidationWarningSchema = z107.object({
47207
+ code: z107.string().min(1),
47208
+ message: z107.string(),
47209
+ affected: z107.string()
47205
47210
  });
47206
- var ValidationResultSchema = z106.object({
47207
- valid: z106.boolean(),
47208
- toolName: z106.string().min(1),
47209
- violations: z106.array(ConstraintViolationSchema),
47210
- passed: z106.array(z106.string()),
47211
- warnings: z106.array(ValidationWarningSchema),
47212
- validatedAt: z106.date()
47211
+ var ValidationResultSchema = z107.object({
47212
+ valid: z107.boolean(),
47213
+ toolName: z107.string().min(1),
47214
+ violations: z107.array(ConstraintViolationSchema),
47215
+ passed: z107.array(z107.string()),
47216
+ warnings: z107.array(ValidationWarningSchema),
47217
+ validatedAt: z107.date()
47213
47218
  });
47214
47219
 
47215
47220
  // src/mcp/safety/stpa-types.ts
@@ -48294,43 +48299,43 @@ var GeminiResponseParser = class {
48294
48299
  };
48295
48300
 
48296
48301
  // src/cli-adapters/router-types.ts
48297
- import { z as z107 } from "zod";
48298
- var RouterConfigSchema = z107.object({
48299
- minCapacityThreshold: z107.number().min(0).max(1).default(0.1),
48300
- preferCostEfficient: z107.boolean().default(false),
48301
- maxDecisionTimeMs: z107.number().min(1).max(1e3).default(100)
48302
+ import { z as z108 } from "zod";
48303
+ var RouterConfigSchema = z108.object({
48304
+ minCapacityThreshold: z108.number().min(0).max(1).default(0.1),
48305
+ preferCostEfficient: z108.boolean().default(false),
48306
+ maxDecisionTimeMs: z108.number().min(1).max(1e3).default(100)
48302
48307
  });
48303
48308
 
48304
48309
  // src/cli-adapters/agreement-cascade-types.ts
48305
- import { z as z108 } from "zod";
48306
- var AgreementCascadeConfigSchema = z108.object({
48307
- agreementThreshold: z108.number().min(0.5).max(1).default(0.7),
48308
- maxStages: z108.number().int().min(1).max(5).default(3),
48309
- modelTimeoutMs: z108.number().int().min(1e3).max(3e5).default(6e4)
48310
+ import { z as z109 } from "zod";
48311
+ var AgreementCascadeConfigSchema = z109.object({
48312
+ agreementThreshold: z109.number().min(0.5).max(1).default(0.7),
48313
+ maxStages: z109.number().int().min(1).max(5).default(3),
48314
+ modelTimeoutMs: z109.number().int().min(1e3).max(3e5).default(6e4)
48310
48315
  });
48311
48316
 
48312
48317
  // src/cli-adapters/agreement-cascade-router.ts
48313
48318
  var logger48 = createLogger({ component: "agreement-cascade-router" });
48314
48319
 
48315
48320
  // src/cli-adapters/task-classifier.ts
48316
- import { z as z109 } from "zod";
48317
- var ClassificationPatternsSchema = z109.object({
48318
- code: z109.array(z109.string()).readonly(),
48319
- research: z109.array(z109.string()).readonly(),
48320
- documentation: z109.array(z109.string()).readonly(),
48321
- analysis: z109.array(z109.string()).readonly()
48321
+ import { z as z110 } from "zod";
48322
+ var ClassificationPatternsSchema = z110.object({
48323
+ code: z110.array(z110.string()).readonly(),
48324
+ research: z110.array(z110.string()).readonly(),
48325
+ documentation: z110.array(z110.string()).readonly(),
48326
+ analysis: z110.array(z110.string()).readonly()
48322
48327
  });
48323
48328
 
48324
48329
  // src/cli-adapters/response-cache-types.ts
48325
- import { z as z110 } from "zod";
48326
- var ResponseCacheConfigSchema = z110.object({
48327
- defaultTTL: z110.number().min(1e3).max(36e5).default(3e5),
48330
+ import { z as z111 } from "zod";
48331
+ var ResponseCacheConfigSchema = z111.object({
48332
+ defaultTTL: z111.number().min(1e3).max(36e5).default(3e5),
48328
48333
  // 5 minutes
48329
- maxEntries: z110.number().min(10).max(1e5).default(1e3),
48330
- maxMemoryMB: z110.number().min(1).max(1e3).default(50),
48331
- cleanupInterval: z110.number().min(1e3).max(6e5).default(6e4),
48334
+ maxEntries: z111.number().min(10).max(1e5).default(1e3),
48335
+ maxMemoryMB: z111.number().min(1).max(1e3).default(50),
48336
+ cleanupInterval: z111.number().min(1e3).max(6e5).default(6e4),
48332
48337
  // 1 minute
48333
- enableLogging: z110.boolean().default(false)
48338
+ enableLogging: z111.boolean().default(false)
48334
48339
  });
48335
48340
 
48336
48341
  // src/cli-adapters/response-cache-utils.ts
@@ -48338,12 +48343,12 @@ import { createHash as createHash4 } from "crypto";
48338
48343
  var logger49 = createLogger({ component: "ResponseCacheUtils" });
48339
48344
 
48340
48345
  // src/cli-adapters/unified-routing-types.ts
48341
- import { z as z111 } from "zod";
48342
- var UnifiedRoutingDecisionSchema = z111.object({
48343
- selectedCli: z111.string(),
48344
- confidence: z111.number().min(0).max(1),
48345
- reason: z111.string(),
48346
- strategy: z111.enum([
48346
+ import { z as z112 } from "zod";
48347
+ var UnifiedRoutingDecisionSchema = z112.object({
48348
+ selectedCli: z112.string(),
48349
+ confidence: z112.number().min(0).max(1),
48350
+ reason: z112.string(),
48351
+ strategy: z112.enum([
48347
48352
  "composite",
48348
48353
  "quality",
48349
48354
  "budget",
@@ -48355,57 +48360,57 @@ var UnifiedRoutingDecisionSchema = z111.object({
48355
48360
  "linucb",
48356
48361
  "direct"
48357
48362
  ]),
48358
- decisionTimeMs: z111.number().nonnegative(),
48359
- alternatives: z111.array(z111.string()).readonly(),
48360
- stagesExecuted: z111.array(z111.string()).readonly(),
48361
- withinBudget: z111.boolean().optional(),
48362
- estimatedComplexity: z111.enum(["simple", "moderate", "complex", "expert"]).optional(),
48363
- estimatedTokens: z111.number().int().positive().optional(),
48364
- topsisScore: z111.number().optional(),
48365
- ucbScore: z111.number().optional(),
48366
- resolvedAtStage: z111.number().int().nonnegative().optional(),
48367
- consensusReached: z111.boolean().optional(),
48368
- agreementScore: z111.number().min(0).max(1).optional(),
48369
- metadata: z111.record(z111.string(), z111.unknown()).optional()
48363
+ decisionTimeMs: z112.number().nonnegative(),
48364
+ alternatives: z112.array(z112.string()).readonly(),
48365
+ stagesExecuted: z112.array(z112.string()).readonly(),
48366
+ withinBudget: z112.boolean().optional(),
48367
+ estimatedComplexity: z112.enum(["simple", "moderate", "complex", "expert"]).optional(),
48368
+ estimatedTokens: z112.number().int().positive().optional(),
48369
+ topsisScore: z112.number().optional(),
48370
+ ucbScore: z112.number().optional(),
48371
+ resolvedAtStage: z112.number().int().nonnegative().optional(),
48372
+ consensusReached: z112.boolean().optional(),
48373
+ agreementScore: z112.number().min(0).max(1).optional(),
48374
+ metadata: z112.record(z112.string(), z112.unknown()).optional()
48370
48375
  });
48371
48376
 
48372
48377
  // src/learning/outcome-feedback-types.ts
48373
- import { z as z112 } from "zod";
48374
- var QualitySignalsSchema = z112.object({
48375
- testsPass: z112.boolean().optional(),
48376
- lintErrors: z112.number().int().min(0).optional(),
48377
- userApproved: z112.boolean().optional(),
48378
- retryCount: z112.number().int().min(0).default(0),
48379
- completionRatio: z112.number().min(0).max(1).default(1),
48380
- validStructure: z112.boolean().optional(),
48381
- coherenceScore: z112.number().min(0).max(1).optional()
48378
+ import { z as z113 } from "zod";
48379
+ var QualitySignalsSchema = z113.object({
48380
+ testsPass: z113.boolean().optional(),
48381
+ lintErrors: z113.number().int().min(0).optional(),
48382
+ userApproved: z113.boolean().optional(),
48383
+ retryCount: z113.number().int().min(0).default(0),
48384
+ completionRatio: z113.number().min(0).max(1).default(1),
48385
+ validStructure: z113.boolean().optional(),
48386
+ coherenceScore: z113.number().min(0).max(1).optional()
48382
48387
  });
48383
- var RoutingDecisionSchema = z112.object({
48384
- id: z112.uuid(),
48385
- timestamp: z112.iso.datetime(),
48386
- query: z112.string(),
48387
- routerType: z112.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
48388
- selectedModel: z112.string(),
48389
- selectedTier: z112.enum(["strong", "weak"]).optional(),
48390
- armIndex: z112.number().int().min(0).optional(),
48391
- banditContext: z112.record(z112.string(), z112.unknown()).optional(),
48392
- queryFeatures: z112.record(z112.string(), z112.unknown()).optional(),
48393
- ucbScore: z112.number().optional(),
48394
- confidence: z112.number().min(0).max(1).optional(),
48395
- traceId: z112.string(),
48396
- domain: z112.string().optional()
48388
+ var RoutingDecisionSchema = z113.object({
48389
+ id: z113.uuid(),
48390
+ timestamp: z113.iso.datetime(),
48391
+ query: z113.string(),
48392
+ routerType: z113.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
48393
+ selectedModel: z113.string(),
48394
+ selectedTier: z113.enum(["strong", "weak"]).optional(),
48395
+ armIndex: z113.number().int().min(0).optional(),
48396
+ banditContext: z113.record(z113.string(), z113.unknown()).optional(),
48397
+ queryFeatures: z113.record(z113.string(), z113.unknown()).optional(),
48398
+ ucbScore: z113.number().optional(),
48399
+ confidence: z113.number().min(0).max(1).optional(),
48400
+ traceId: z113.string(),
48401
+ domain: z113.string().optional()
48397
48402
  });
48398
- var TaskOutcomeSchema = z112.object({
48399
- routingDecisionId: z112.uuid(),
48400
- timestamp: z112.iso.datetime(),
48401
- outcomeClass: z112.enum(["success", "partial", "failure", "timeout", "error"]),
48402
- success: z112.boolean(),
48403
- qualityScore: z112.number().min(0).max(1),
48404
- durationMs: z112.number().min(0),
48405
- tokenUsage: z112.number().int().min(0),
48406
- errorMessage: z112.string().optional(),
48403
+ var TaskOutcomeSchema = z113.object({
48404
+ routingDecisionId: z113.uuid(),
48405
+ timestamp: z113.iso.datetime(),
48406
+ outcomeClass: z113.enum(["success", "partial", "failure", "timeout", "error"]),
48407
+ success: z113.boolean(),
48408
+ qualityScore: z113.number().min(0).max(1),
48409
+ durationMs: z113.number().min(0),
48410
+ tokenUsage: z113.number().int().min(0),
48411
+ errorMessage: z113.string().optional(),
48407
48412
  qualitySignals: QualitySignalsSchema,
48408
- traceId: z112.string()
48413
+ traceId: z113.string()
48409
48414
  });
48410
48415
  var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
48411
48416
  maxPendingDecisions: 1e3,
@@ -48420,17 +48425,17 @@ var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
48420
48425
  targetTokenUsage: 2e3,
48421
48426
  maxHistorySize: 1e4
48422
48427
  };
48423
- var FeedbackCollectorConfigSchema = z112.object({
48424
- maxPendingDecisions: z112.number().int().positive().default(1e3),
48425
- pendingTimeoutMs: z112.number().positive().default(3e5),
48426
- enableAutoReward: z112.boolean().default(true),
48427
- qualityWeight: z112.number().min(0).max(1).default(0.5),
48428
- speedWeight: z112.number().min(0).max(1).default(0.2),
48429
- efficiencyWeight: z112.number().min(0).max(1).default(0.2),
48430
- retryPenalty: z112.number().min(0).max(1).default(0.1),
48431
- targetDurationMs: z112.number().positive().default(5e3),
48432
- targetTokenUsage: z112.number().positive().default(2e3),
48433
- maxHistorySize: z112.number().int().positive().default(1e4)
48428
+ var FeedbackCollectorConfigSchema = z113.object({
48429
+ maxPendingDecisions: z113.number().int().positive().default(1e3),
48430
+ pendingTimeoutMs: z113.number().positive().default(3e5),
48431
+ enableAutoReward: z113.boolean().default(true),
48432
+ qualityWeight: z113.number().min(0).max(1).default(0.5),
48433
+ speedWeight: z113.number().min(0).max(1).default(0.2),
48434
+ efficiencyWeight: z113.number().min(0).max(1).default(0.2),
48435
+ retryPenalty: z113.number().min(0).max(1).default(0.1),
48436
+ targetDurationMs: z113.number().positive().default(5e3),
48437
+ targetTokenUsage: z113.number().positive().default(2e3),
48438
+ maxHistorySize: z113.number().int().positive().default(1e4)
48434
48439
  });
48435
48440
 
48436
48441
  // src/learning/outcome-feedback-helpers.ts
@@ -50577,4 +50582,4 @@ export {
50577
50582
  shutdownFeedbackSubscriber,
50578
50583
  createEventBusBridge
50579
50584
  };
50580
- //# sourceMappingURL=chunk-O3COR3G2.js.map
50585
+ //# sourceMappingURL=chunk-SDLDZL4K.js.map