nexus-agents 2.86.0 → 2.87.1

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.
@@ -42,7 +42,7 @@ import {
42
42
  writeJobComplete,
43
43
  writeJobFailed,
44
44
  writeJobPending
45
- } from "./chunk-EHBSXLX6.js";
45
+ } from "./chunk-YYUNZPDK.js";
46
46
  import {
47
47
  REGISTRY_PATH,
48
48
  getProjectRoot,
@@ -82,7 +82,7 @@ import {
82
82
  DEFAULT_TASK_TTL_MS,
83
83
  DEFAULT_TOOL_RATE_LIMITS,
84
84
  clampTaskTtl
85
- } from "./chunk-QOOYL3B3.js";
85
+ } from "./chunk-ISWYUTXP.js";
86
86
  import {
87
87
  getAvailabilityCache,
88
88
  resolveFallback
@@ -23547,10 +23547,10 @@ function calculateZStatistic(params) {
23547
23547
  function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
23548
23548
  const difference = p1 - p2;
23549
23549
  const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
23550
- const z110 = getZScore(confidence);
23550
+ const z111 = getZScore(confidence);
23551
23551
  return {
23552
- lower: difference - z110 * seDiff,
23553
- upper: difference + z110 * seDiff,
23552
+ lower: difference - z111 * seDiff,
23553
+ upper: difference + z111 * seDiff,
23554
23554
  estimate: difference,
23555
23555
  confidence,
23556
23556
  n: total1 + total2,
@@ -23573,11 +23573,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
23573
23573
  standardError: 0
23574
23574
  };
23575
23575
  }
23576
- const z110 = getZScore(opts.confidence);
23577
- const z210 = z110 * z110;
23576
+ const z111 = getZScore(opts.confidence);
23577
+ const z210 = z111 * z111;
23578
23578
  const denominator = 1 + z210 / n;
23579
23579
  const center = (p + z210 / (2 * n)) / denominator;
23580
- const margin = z110 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
23580
+ const margin = z111 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
23581
23581
  const lower = Math.max(0, center - margin);
23582
23582
  const upper = Math.min(1, center + margin);
23583
23583
  const standardError = Math.sqrt(p * (1 - p) / n);
@@ -23607,8 +23607,8 @@ function meanConfidenceInterval(values, options = {}) {
23607
23607
  const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
23608
23608
  const stdDev = Math.sqrt(variance);
23609
23609
  const standardError = stdDev / Math.sqrt(n);
23610
- const z110 = getZScore(opts.confidence);
23611
- const margin = z110 * standardError;
23610
+ const z111 = getZScore(opts.confidence);
23611
+ const margin = z111 * standardError;
23612
23612
  return {
23613
23613
  lower: mean - margin,
23614
23614
  upper: mean + margin,
@@ -43476,7 +43476,7 @@ ${contextBlock}`;
43476
43476
  const strategy = config.votingStrategy ?? "higher_order";
43477
43477
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
43478
43478
  try {
43479
- const { executeVoting } = await import("./consensus-vote-K7HSOLYR.js");
43479
+ const { executeVoting } = await import("./consensus-vote-ZP33MR4A.js");
43480
43480
  const votingResult = await executeVoting(
43481
43481
  {
43482
43482
  proposal: plan.slice(0, 4e3),
@@ -46501,12 +46501,180 @@ function registerCancelJobTool(server, deps) {
46501
46501
  logger53.info("Registered cancel_job tool");
46502
46502
  }
46503
46503
 
46504
+ // src/mcp/tools/ci-health-check-tool.ts
46505
+ import { z as z100 } from "zod";
46506
+ var CiHealthStatusSchema = z100.enum(["healthy", "degraded", "outage", "unknown"]);
46507
+ var CiHealthCheckInputSchema = z100.object({
46508
+ /**
46509
+ * Repo to check for the recent-runs activity signal (in `owner/repo` form).
46510
+ * Optional — when omitted, only the status-page signal is consulted.
46511
+ */
46512
+ repo: z100.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."),
46513
+ /**
46514
+ * How far back to look for recent-runs activity (minutes). Default 30 —
46515
+ * matches the typical wedge-detection window from the #3070 / #3076 outages.
46516
+ */
46517
+ activityWindowMinutes: z100.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
46518
+ });
46519
+ var STATUS_PAGE_URL = "https://www.githubstatus.com/api/v2/components.json";
46520
+ function mapStatusPageStatus(raw) {
46521
+ if (raw === "operational") return "healthy";
46522
+ if (raw === "degraded_performance" || raw === "under_maintenance") return "degraded";
46523
+ if (raw === "partial_outage" || raw === "major_outage") return "outage";
46524
+ return "unknown";
46525
+ }
46526
+ async function checkGithubStatus(logger53) {
46527
+ try {
46528
+ const res = await fetch(STATUS_PAGE_URL, {
46529
+ // 5s budget — status page is fast, hangs here are themselves a degraded signal.
46530
+ signal: AbortSignal.timeout(5e3)
46531
+ });
46532
+ if (!res.ok) {
46533
+ return {
46534
+ source: "github-status",
46535
+ status: "unknown",
46536
+ evidence: `status page returned HTTP ${String(res.status)}`
46537
+ };
46538
+ }
46539
+ const payload = await res.json();
46540
+ const actions = payload.components?.find((c) => c.name === "GitHub Actions");
46541
+ if (actions?.status === void 0) {
46542
+ return {
46543
+ source: "github-status",
46544
+ status: "unknown",
46545
+ evidence: "GitHub Actions component not found in status page response"
46546
+ };
46547
+ }
46548
+ return {
46549
+ source: "github-status",
46550
+ status: mapStatusPageStatus(actions.status),
46551
+ evidence: `GitHub Actions component reports: ${actions.status}`
46552
+ };
46553
+ } catch (err2) {
46554
+ logger53.warn("Status page fetch failed", {
46555
+ error: err2 instanceof Error ? err2.message : String(err2)
46556
+ });
46557
+ return {
46558
+ source: "github-status",
46559
+ status: "unknown",
46560
+ evidence: `status page fetch failed: ${err2 instanceof Error ? err2.message : "network error"}`
46561
+ };
46562
+ }
46563
+ }
46564
+ function countRecentRuns(runs, sinceMs) {
46565
+ return runs.filter((r) => r.created_at !== void 0 && Date.parse(r.created_at) >= sinceMs).length;
46566
+ }
46567
+ async function checkRepoActivity(repo, windowMinutes, logger53) {
46568
+ const sinceMs = Date.now() - windowMinutes * 6e4;
46569
+ try {
46570
+ const res = await fetch(`https://api.github.com/repos/${repo}/actions/runs?per_page=30`, {
46571
+ signal: AbortSignal.timeout(8e3),
46572
+ headers: { Accept: "application/vnd.github+json" }
46573
+ });
46574
+ if (!res.ok) {
46575
+ return {
46576
+ source: "repo-activity-window",
46577
+ status: "unknown",
46578
+ evidence: `actions/runs API returned HTTP ${String(res.status)}`
46579
+ };
46580
+ }
46581
+ const payload = await res.json();
46582
+ const recentCount = countRecentRuns(payload.workflow_runs ?? [], sinceMs);
46583
+ if (recentCount === 0) {
46584
+ return {
46585
+ source: "repo-activity-window",
46586
+ status: "degraded",
46587
+ evidence: `no workflow runs in last ${String(windowMinutes)} min on ${repo} \u2014 could be wedge or quiet repo`
46588
+ };
46589
+ }
46590
+ return {
46591
+ source: "repo-activity-window",
46592
+ status: "healthy",
46593
+ evidence: `${String(recentCount)} workflow run(s) in last ${String(windowMinutes)} min on ${repo}`
46594
+ };
46595
+ } catch (err2) {
46596
+ logger53.warn("Repo activity check failed", {
46597
+ repo,
46598
+ error: err2 instanceof Error ? err2.message : String(err2)
46599
+ });
46600
+ return {
46601
+ source: "repo-activity-window",
46602
+ status: "unknown",
46603
+ evidence: `actions/runs API fetch failed: ${err2 instanceof Error ? err2.message : "network error"}`
46604
+ };
46605
+ }
46606
+ }
46607
+ function combineSignals(signals) {
46608
+ const PRIORITY = {
46609
+ outage: 3,
46610
+ degraded: 2,
46611
+ healthy: 1,
46612
+ unknown: 0
46613
+ };
46614
+ let worst = "unknown";
46615
+ for (const s of signals) {
46616
+ if (s.status !== "unknown" && PRIORITY[s.status] > PRIORITY[worst]) {
46617
+ worst = s.status;
46618
+ }
46619
+ }
46620
+ return worst;
46621
+ }
46622
+ async function ciHealthCheckHandler(args, logger53) {
46623
+ const parsed = CiHealthCheckInputSchema.safeParse(args);
46624
+ if (!parsed.success) {
46625
+ return toolStructuredError({
46626
+ errorCategory: "validation",
46627
+ message: `Validation error: ${formatZodError(parsed.error)}`
46628
+ });
46629
+ }
46630
+ const { repo, activityWindowMinutes } = parsed.data;
46631
+ const signals = [];
46632
+ signals.push(await checkGithubStatus(logger53));
46633
+ if (repo !== void 0) {
46634
+ signals.push(await checkRepoActivity(repo, activityWindowMinutes, logger53));
46635
+ }
46636
+ const response = {
46637
+ status: combineSignals(signals),
46638
+ checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
46639
+ signals
46640
+ };
46641
+ return toolSuccess(JSON.stringify(response, null, 2));
46642
+ }
46643
+ var DESCRIPTION = "Check CI infrastructure health before triggering / polling runs (#3076). Returns { status: healthy|degraded|outage|unknown, signals } composing GitHub status-page state + the configured repo's recent workflow-runs activity. Use BEFORE a long auto-merge wait to skip the wedge cycle when CI is broken org-wide. Read-only, idempotent, no network state mutated.";
46644
+ function registerCiHealthCheckTool(server, deps) {
46645
+ const logger53 = deps.logger ?? createLogger({ tool: "ci_health_check" });
46646
+ const toolSchema = {
46647
+ repo: z100.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."),
46648
+ activityWindowMinutes: z100.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
46649
+ };
46650
+ const secureHandler = createSecureHandler((args) => ciHealthCheckHandler(args, logger53), {
46651
+ toolName: "ci_health_check",
46652
+ rateLimiter: deps.rateLimiter,
46653
+ logger: logger53
46654
+ });
46655
+ const timeoutMs = getToolTimeout("ci_health_check", deps.security);
46656
+ const wrappedHandler = wrapToolWithTimeout("ci_health_check", secureHandler, {
46657
+ timeoutMs,
46658
+ logger: logger53
46659
+ });
46660
+ server.registerTool(
46661
+ "ci_health_check",
46662
+ {
46663
+ description: DESCRIPTION,
46664
+ inputSchema: toolSchema,
46665
+ annotations: getToolAnnotations("ci_health_check")
46666
+ },
46667
+ toSdkCallback(wrappedHandler)
46668
+ );
46669
+ logger53.info("Registered ci_health_check tool");
46670
+ }
46671
+
46504
46672
  // src/mcp/tools/verify-audit-chain-tool.ts
46505
46673
  import * as fs12 from "fs/promises";
46506
46674
  import * as path11 from "path";
46507
- import { z as z100 } from "zod";
46508
- var VerifyAuditChainInputSchema = z100.object({
46509
- logDir: z100.string().min(1).max(512).describe(
46675
+ import { z as z101 } from "zod";
46676
+ var VerifyAuditChainInputSchema = z101.object({
46677
+ logDir: z101.string().min(1).max(512).describe(
46510
46678
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files in lexicographic order and verifies the combined chain."
46511
46679
  )
46512
46680
  });
@@ -46583,7 +46751,7 @@ async function handler2(args, ctx) {
46583
46751
  function registerVerifyAuditChainTool(server, deps) {
46584
46752
  const logger53 = deps.logger ?? createLogger({ tool: "verify_audit_chain" });
46585
46753
  const toolSchema = {
46586
- logDir: z100.string().min(1).max(512).describe(
46754
+ logDir: z101.string().min(1).max(512).describe(
46587
46755
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files and verifies the combined hash chain."
46588
46756
  )
46589
46757
  };
@@ -46607,18 +46775,18 @@ function registerVerifyAuditChainTool(server, deps) {
46607
46775
  }
46608
46776
 
46609
46777
  // src/mcp/tools/pipeline-tool.ts
46610
- import { z as z101 } from "zod";
46778
+ import { z as z102 } from "zod";
46611
46779
  import * as fs13 from "fs";
46612
46780
  import * as path12 from "path";
46613
- var PipelineInputSchema = z101.object({
46781
+ var PipelineInputSchema = z102.object({
46614
46782
  /** The task to execute. */
46615
- task: z101.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
46783
+ task: z102.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
46616
46784
  /** Path to a spec file (.md, .yaml) to use as task input. */
46617
- specFile: z101.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
46785
+ specFile: z102.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
46618
46786
  /** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
46619
- template: z101.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
46787
+ template: z102.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
46620
46788
  /** Voting strategy for consensus stages. */
46621
- votingStrategy: z101.enum([
46789
+ votingStrategy: z102.enum([
46622
46790
  "simple_majority",
46623
46791
  "supermajority",
46624
46792
  "unanimous",
@@ -46629,13 +46797,13 @@ var PipelineInputSchema = z101.object({
46629
46797
  "Voting strategy for plan approval. simple_majority (default), supermajority (67%), unanimous, higher_order (Bayesian), proof_of_learning, opinion_wise"
46630
46798
  ),
46631
46799
  /** Use 3 agents instead of 6 for faster voting. */
46632
- quickMode: z101.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
46800
+ quickMode: z102.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
46633
46801
  /** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
46634
- timeoutMs: z101.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
46802
+ timeoutMs: z102.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
46635
46803
  /** Stop after planning/voting (no implementation). */
46636
- dryRun: z101.boolean().default(false).describe("Stop after vote stage (no implementation)"),
46804
+ dryRun: z102.boolean().default(false).describe("Stop after vote stage (no implementation)"),
46637
46805
  /** TESTS ONLY — random output, must not be used for real decisions. (#2319) */
46638
- simulateVotes: z101.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
46806
+ simulateVotes: z102.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
46639
46807
  });
46640
46808
  function buildOutput2(result) {
46641
46809
  return {
@@ -46737,7 +46905,7 @@ function registerPipelineTool(server, deps) {
46737
46905
  }
46738
46906
 
46739
46907
  // src/mcp/tools/supply-chain-tradeoff-panel.ts
46740
- import { z as z102 } from "zod";
46908
+ import { z as z103 } from "zod";
46741
46909
  var DEFAULT_AXES = [
46742
46910
  "build_time_determinism",
46743
46911
  "supply_chain_risk",
@@ -46757,16 +46925,16 @@ var FULL_PANEL = [
46757
46925
  "scope_steward"
46758
46926
  ];
46759
46927
  var QUICK_PANEL = ["architect", "security", "scope_steward"];
46760
- var SupplyChainTradeoffPanelInputSchema = z102.object({
46761
- proposal: z102.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
46762
- axes: z102.array(z102.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
46928
+ var SupplyChainTradeoffPanelInputSchema = z103.object({
46929
+ proposal: z103.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
46930
+ axes: z103.array(z103.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
46763
46931
  `Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
46764
46932
  ),
46765
- context: z102.string().max(MAX_CONTEXT_LENGTH).optional().describe(
46933
+ context: z103.string().max(MAX_CONTEXT_LENGTH).optional().describe(
46766
46934
  "Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
46767
46935
  ),
46768
- quickMode: z102.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
46769
- simulate: z102.boolean().optional().default(false).describe("Use simulated voters (testing only)")
46936
+ quickMode: z103.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
46937
+ simulate: z103.boolean().optional().default(false).describe("Use simulated voters (testing only)")
46770
46938
  });
46771
46939
  function buildTradeoffProposal(input) {
46772
46940
  const axes = input.axes ?? DEFAULT_AXES;
@@ -47466,6 +47634,22 @@ var TOOL_ANNOTATIONS = {
47466
47634
  }
47467
47635
  ]
47468
47636
  },
47637
+ ci_health_check: {
47638
+ annotations: {
47639
+ title: "CI Health Check",
47640
+ readOnlyHint: true,
47641
+ destructiveHint: false,
47642
+ idempotentHint: true,
47643
+ // Outbound network to githubstatus.com + GitHub API.
47644
+ openWorldHint: true
47645
+ },
47646
+ sideEffects: [
47647
+ {
47648
+ category: "implicit",
47649
+ description: "Fetches GitHub status-page + repo actions/runs to assess CI infrastructure health (#3076)"
47650
+ }
47651
+ ]
47652
+ },
47469
47653
  extract_symbols: {
47470
47654
  annotations: {
47471
47655
  title: "Extract Symbols",
@@ -47670,6 +47854,7 @@ var REGISTERED_TOOL_NAMES = [
47670
47854
  "get_job_result",
47671
47855
  "list_jobs",
47672
47856
  "cancel_job",
47857
+ "ci_health_check",
47673
47858
  "verify_audit_chain",
47674
47859
  "repo_analyze",
47675
47860
  "repo_security_plan",
@@ -47814,40 +47999,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
47814
47999
  })(RiskLevel || {});
47815
48000
 
47816
48001
  // src/mcp/safety/stpa-schemas.ts
47817
- import { z as z103 } from "zod";
47818
- var HazardCategorySchema = z103.enum(HazardCategory);
47819
- var HazardSeveritySchema = z103.enum(HazardSeverity);
47820
- var ConstraintPrioritySchema = z103.enum(ConstraintPriority);
47821
- var RiskLevelSchema = z103.enum(RiskLevel);
47822
- var TriggerPatternSchema = z103.object({
47823
- parameter: z103.string().min(1),
47824
- matchType: z103.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
47825
- pattern: z103.string(),
47826
- reason: z103.string()
48002
+ import { z as z104 } from "zod";
48003
+ var HazardCategorySchema = z104.enum(HazardCategory);
48004
+ var HazardSeveritySchema = z104.enum(HazardSeverity);
48005
+ var ConstraintPrioritySchema = z104.enum(ConstraintPriority);
48006
+ var RiskLevelSchema = z104.enum(RiskLevel);
48007
+ var TriggerPatternSchema = z104.object({
48008
+ parameter: z104.string().min(1),
48009
+ matchType: z104.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
48010
+ pattern: z104.string(),
48011
+ reason: z104.string()
47827
48012
  });
47828
- var HazardSchema = z103.object({
47829
- id: z103.string().min(1),
47830
- description: z103.string(),
48013
+ var HazardSchema = z104.object({
48014
+ id: z104.string().min(1),
48015
+ description: z104.string(),
47831
48016
  category: HazardCategorySchema,
47832
48017
  severity: HazardSeveritySchema,
47833
- likelihood: z103.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
47834
- triggerConditions: z103.array(z103.string()),
47835
- consequences: z103.array(z103.string())
48018
+ likelihood: z104.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
48019
+ triggerConditions: z104.array(z104.string()),
48020
+ consequences: z104.array(z104.string())
47836
48021
  });
47837
- var UnsafeControlActionSchema = z103.object({
47838
- id: z103.string().min(1),
47839
- toolName: z103.string().min(1),
47840
- type: z103.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
47841
- description: z103.string(),
47842
- unsafeContext: z103.string(),
47843
- relatedHazards: z103.array(z103.string()),
47844
- triggerPatterns: z103.array(TriggerPatternSchema).optional()
48022
+ var UnsafeControlActionSchema = z104.object({
48023
+ id: z104.string().min(1),
48024
+ toolName: z104.string().min(1),
48025
+ type: z104.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
48026
+ description: z104.string(),
48027
+ unsafeContext: z104.string(),
48028
+ relatedHazards: z104.array(z104.string()),
48029
+ triggerPatterns: z104.array(TriggerPatternSchema).optional()
47845
48030
  });
47846
- var SafetyConstraintSchema = z103.object({
47847
- id: z103.string().min(1),
47848
- description: z103.string(),
47849
- mitigates: z103.array(z103.string()),
47850
- enforcement: z103.enum([
48031
+ var SafetyConstraintSchema = z104.object({
48032
+ id: z104.string().min(1),
48033
+ description: z104.string(),
48034
+ mitigates: z104.array(z104.string()),
48035
+ enforcement: z104.enum([
47851
48036
  "prevent",
47852
48037
  "require_confirmation",
47853
48038
  "alert",
@@ -47855,54 +48040,54 @@ var SafetyConstraintSchema = z103.object({
47855
48040
  "rate_limit",
47856
48041
  "require_privilege"
47857
48042
  ]),
47858
- validationFunction: z103.string().optional(),
48043
+ validationFunction: z104.string().optional(),
47859
48044
  priority: ConstraintPrioritySchema
47860
48045
  });
47861
- var PropertySchemaSchema = z103.object({
47862
- type: z103.string(),
47863
- description: z103.string().optional(),
47864
- enum: z103.array(z103.unknown()).optional(),
47865
- pattern: z103.string().optional(),
47866
- minimum: z103.number().optional(),
47867
- maximum: z103.number().optional()
48046
+ var PropertySchemaSchema = z104.object({
48047
+ type: z104.string(),
48048
+ description: z104.string().optional(),
48049
+ enum: z104.array(z104.unknown()).optional(),
48050
+ pattern: z104.string().optional(),
48051
+ minimum: z104.number().optional(),
48052
+ maximum: z104.number().optional()
47868
48053
  });
47869
- var ToolInputSchemaSchema = z103.object({
47870
- type: z103.string(),
47871
- properties: z103.record(z103.string(), PropertySchemaSchema).optional(),
47872
- required: z103.array(z103.string()).optional(),
47873
- additionalProperties: z103.boolean().optional()
48054
+ var ToolInputSchemaSchema = z104.object({
48055
+ type: z104.string(),
48056
+ properties: z104.record(z104.string(), PropertySchemaSchema).optional(),
48057
+ required: z104.array(z104.string()).optional(),
48058
+ additionalProperties: z104.boolean().optional()
47874
48059
  });
47875
- var ToolDefinitionSchema = z103.object({
47876
- name: z103.string().min(1),
47877
- description: z103.string(),
48060
+ var ToolDefinitionSchema = z104.object({
48061
+ name: z104.string().min(1),
48062
+ description: z104.string(),
47878
48063
  inputSchema: ToolInputSchemaSchema
47879
48064
  });
47880
- var AnalysisConfigurationSchema = z103.object({
47881
- includeLowSeverity: z103.boolean().default(true),
47882
- generateAllConstraints: z103.boolean().default(true),
47883
- checkInteractions: z103.boolean().default(true),
47884
- maxHazardsPerTool: z103.number().int().min(1).max(100).default(50),
47885
- categories: z103.array(HazardCategorySchema).default([])
48065
+ var AnalysisConfigurationSchema = z104.object({
48066
+ includeLowSeverity: z104.boolean().default(true),
48067
+ generateAllConstraints: z104.boolean().default(true),
48068
+ checkInteractions: z104.boolean().default(true),
48069
+ maxHazardsPerTool: z104.number().int().min(1).max(100).default(50),
48070
+ categories: z104.array(HazardCategorySchema).default([])
47886
48071
  });
47887
- var ConstraintViolationSchema = z103.object({
47888
- constraintId: z103.string().min(1),
47889
- constraintDescription: z103.string(),
48072
+ var ConstraintViolationSchema = z104.object({
48073
+ constraintId: z104.string().min(1),
48074
+ constraintDescription: z104.string(),
47890
48075
  severity: HazardSeveritySchema,
47891
- details: z103.string(),
47892
- remediation: z103.string()
48076
+ details: z104.string(),
48077
+ remediation: z104.string()
47893
48078
  });
47894
- var ValidationWarningSchema = z103.object({
47895
- code: z103.string().min(1),
47896
- message: z103.string(),
47897
- affected: z103.string()
48079
+ var ValidationWarningSchema = z104.object({
48080
+ code: z104.string().min(1),
48081
+ message: z104.string(),
48082
+ affected: z104.string()
47898
48083
  });
47899
- var ValidationResultSchema = z103.object({
47900
- valid: z103.boolean(),
47901
- toolName: z103.string().min(1),
47902
- violations: z103.array(ConstraintViolationSchema),
47903
- passed: z103.array(z103.string()),
47904
- warnings: z103.array(ValidationWarningSchema),
47905
- validatedAt: z103.date()
48084
+ var ValidationResultSchema = z104.object({
48085
+ valid: z104.boolean(),
48086
+ toolName: z104.string().min(1),
48087
+ violations: z104.array(ConstraintViolationSchema),
48088
+ passed: z104.array(z104.string()),
48089
+ warnings: z104.array(ValidationWarningSchema),
48090
+ validatedAt: z104.date()
47906
48091
  });
47907
48092
 
47908
48093
  // src/mcp/safety/stpa-types.ts
@@ -48987,43 +49172,43 @@ var GeminiResponseParser = class {
48987
49172
  };
48988
49173
 
48989
49174
  // src/cli-adapters/router-types.ts
48990
- import { z as z104 } from "zod";
48991
- var RouterConfigSchema = z104.object({
48992
- minCapacityThreshold: z104.number().min(0).max(1).default(0.1),
48993
- preferCostEfficient: z104.boolean().default(false),
48994
- maxDecisionTimeMs: z104.number().min(1).max(1e3).default(100)
49175
+ import { z as z105 } from "zod";
49176
+ var RouterConfigSchema = z105.object({
49177
+ minCapacityThreshold: z105.number().min(0).max(1).default(0.1),
49178
+ preferCostEfficient: z105.boolean().default(false),
49179
+ maxDecisionTimeMs: z105.number().min(1).max(1e3).default(100)
48995
49180
  });
48996
49181
 
48997
49182
  // src/cli-adapters/agreement-cascade-types.ts
48998
- import { z as z105 } from "zod";
48999
- var AgreementCascadeConfigSchema = z105.object({
49000
- agreementThreshold: z105.number().min(0.5).max(1).default(0.7),
49001
- maxStages: z105.number().int().min(1).max(5).default(3),
49002
- modelTimeoutMs: z105.number().int().min(1e3).max(3e5).default(6e4)
49183
+ import { z as z106 } from "zod";
49184
+ var AgreementCascadeConfigSchema = z106.object({
49185
+ agreementThreshold: z106.number().min(0.5).max(1).default(0.7),
49186
+ maxStages: z106.number().int().min(1).max(5).default(3),
49187
+ modelTimeoutMs: z106.number().int().min(1e3).max(3e5).default(6e4)
49003
49188
  });
49004
49189
 
49005
49190
  // src/cli-adapters/agreement-cascade-router.ts
49006
49191
  var logger43 = createLogger({ component: "agreement-cascade-router" });
49007
49192
 
49008
49193
  // src/cli-adapters/task-classifier.ts
49009
- import { z as z106 } from "zod";
49010
- var ClassificationPatternsSchema = z106.object({
49011
- code: z106.array(z106.string()).readonly(),
49012
- research: z106.array(z106.string()).readonly(),
49013
- documentation: z106.array(z106.string()).readonly(),
49014
- analysis: z106.array(z106.string()).readonly()
49194
+ import { z as z107 } from "zod";
49195
+ var ClassificationPatternsSchema = z107.object({
49196
+ code: z107.array(z107.string()).readonly(),
49197
+ research: z107.array(z107.string()).readonly(),
49198
+ documentation: z107.array(z107.string()).readonly(),
49199
+ analysis: z107.array(z107.string()).readonly()
49015
49200
  });
49016
49201
 
49017
49202
  // src/cli-adapters/response-cache-types.ts
49018
- import { z as z107 } from "zod";
49019
- var ResponseCacheConfigSchema = z107.object({
49020
- defaultTTL: z107.number().min(1e3).max(36e5).default(3e5),
49203
+ import { z as z108 } from "zod";
49204
+ var ResponseCacheConfigSchema = z108.object({
49205
+ defaultTTL: z108.number().min(1e3).max(36e5).default(3e5),
49021
49206
  // 5 minutes
49022
- maxEntries: z107.number().min(10).max(1e5).default(1e3),
49023
- maxMemoryMB: z107.number().min(1).max(1e3).default(50),
49024
- cleanupInterval: z107.number().min(1e3).max(6e5).default(6e4),
49207
+ maxEntries: z108.number().min(10).max(1e5).default(1e3),
49208
+ maxMemoryMB: z108.number().min(1).max(1e3).default(50),
49209
+ cleanupInterval: z108.number().min(1e3).max(6e5).default(6e4),
49025
49210
  // 1 minute
49026
- enableLogging: z107.boolean().default(false)
49211
+ enableLogging: z108.boolean().default(false)
49027
49212
  });
49028
49213
 
49029
49214
  // src/cli-adapters/response-cache-utils.ts
@@ -49031,12 +49216,12 @@ import { createHash as createHash4 } from "crypto";
49031
49216
  var logger44 = createLogger({ component: "ResponseCacheUtils" });
49032
49217
 
49033
49218
  // src/cli-adapters/unified-routing-types.ts
49034
- import { z as z108 } from "zod";
49035
- var UnifiedRoutingDecisionSchema = z108.object({
49036
- selectedCli: z108.string(),
49037
- confidence: z108.number().min(0).max(1),
49038
- reason: z108.string(),
49039
- strategy: z108.enum([
49219
+ import { z as z109 } from "zod";
49220
+ var UnifiedRoutingDecisionSchema = z109.object({
49221
+ selectedCli: z109.string(),
49222
+ confidence: z109.number().min(0).max(1),
49223
+ reason: z109.string(),
49224
+ strategy: z109.enum([
49040
49225
  "composite",
49041
49226
  "quality",
49042
49227
  "budget",
@@ -49048,57 +49233,57 @@ var UnifiedRoutingDecisionSchema = z108.object({
49048
49233
  "linucb",
49049
49234
  "direct"
49050
49235
  ]),
49051
- decisionTimeMs: z108.number().nonnegative(),
49052
- alternatives: z108.array(z108.string()).readonly(),
49053
- stagesExecuted: z108.array(z108.string()).readonly(),
49054
- withinBudget: z108.boolean().optional(),
49055
- estimatedComplexity: z108.enum(["simple", "moderate", "complex", "expert"]).optional(),
49056
- estimatedTokens: z108.number().int().positive().optional(),
49057
- topsisScore: z108.number().optional(),
49058
- ucbScore: z108.number().optional(),
49059
- resolvedAtStage: z108.number().int().nonnegative().optional(),
49060
- consensusReached: z108.boolean().optional(),
49061
- agreementScore: z108.number().min(0).max(1).optional(),
49062
- metadata: z108.record(z108.string(), z108.unknown()).optional()
49236
+ decisionTimeMs: z109.number().nonnegative(),
49237
+ alternatives: z109.array(z109.string()).readonly(),
49238
+ stagesExecuted: z109.array(z109.string()).readonly(),
49239
+ withinBudget: z109.boolean().optional(),
49240
+ estimatedComplexity: z109.enum(["simple", "moderate", "complex", "expert"]).optional(),
49241
+ estimatedTokens: z109.number().int().positive().optional(),
49242
+ topsisScore: z109.number().optional(),
49243
+ ucbScore: z109.number().optional(),
49244
+ resolvedAtStage: z109.number().int().nonnegative().optional(),
49245
+ consensusReached: z109.boolean().optional(),
49246
+ agreementScore: z109.number().min(0).max(1).optional(),
49247
+ metadata: z109.record(z109.string(), z109.unknown()).optional()
49063
49248
  });
49064
49249
 
49065
49250
  // src/learning/outcome-feedback-types.ts
49066
- import { z as z109 } from "zod";
49067
- var QualitySignalsSchema = z109.object({
49068
- testsPass: z109.boolean().optional(),
49069
- lintErrors: z109.number().int().min(0).optional(),
49070
- userApproved: z109.boolean().optional(),
49071
- retryCount: z109.number().int().min(0).default(0),
49072
- completionRatio: z109.number().min(0).max(1).default(1),
49073
- validStructure: z109.boolean().optional(),
49074
- coherenceScore: z109.number().min(0).max(1).optional()
49251
+ import { z as z110 } from "zod";
49252
+ var QualitySignalsSchema = z110.object({
49253
+ testsPass: z110.boolean().optional(),
49254
+ lintErrors: z110.number().int().min(0).optional(),
49255
+ userApproved: z110.boolean().optional(),
49256
+ retryCount: z110.number().int().min(0).default(0),
49257
+ completionRatio: z110.number().min(0).max(1).default(1),
49258
+ validStructure: z110.boolean().optional(),
49259
+ coherenceScore: z110.number().min(0).max(1).optional()
49075
49260
  });
49076
- var RoutingDecisionSchema = z109.object({
49077
- id: z109.uuid(),
49078
- timestamp: z109.iso.datetime(),
49079
- query: z109.string(),
49080
- routerType: z109.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
49081
- selectedModel: z109.string(),
49082
- selectedTier: z109.enum(["strong", "weak"]).optional(),
49083
- armIndex: z109.number().int().min(0).optional(),
49084
- banditContext: z109.record(z109.string(), z109.unknown()).optional(),
49085
- queryFeatures: z109.record(z109.string(), z109.unknown()).optional(),
49086
- ucbScore: z109.number().optional(),
49087
- confidence: z109.number().min(0).max(1).optional(),
49088
- traceId: z109.string(),
49089
- domain: z109.string().optional()
49261
+ var RoutingDecisionSchema = z110.object({
49262
+ id: z110.uuid(),
49263
+ timestamp: z110.iso.datetime(),
49264
+ query: z110.string(),
49265
+ routerType: z110.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
49266
+ selectedModel: z110.string(),
49267
+ selectedTier: z110.enum(["strong", "weak"]).optional(),
49268
+ armIndex: z110.number().int().min(0).optional(),
49269
+ banditContext: z110.record(z110.string(), z110.unknown()).optional(),
49270
+ queryFeatures: z110.record(z110.string(), z110.unknown()).optional(),
49271
+ ucbScore: z110.number().optional(),
49272
+ confidence: z110.number().min(0).max(1).optional(),
49273
+ traceId: z110.string(),
49274
+ domain: z110.string().optional()
49090
49275
  });
49091
- var TaskOutcomeSchema = z109.object({
49092
- routingDecisionId: z109.uuid(),
49093
- timestamp: z109.iso.datetime(),
49094
- outcomeClass: z109.enum(["success", "partial", "failure", "timeout", "error"]),
49095
- success: z109.boolean(),
49096
- qualityScore: z109.number().min(0).max(1),
49097
- durationMs: z109.number().min(0),
49098
- tokenUsage: z109.number().int().min(0),
49099
- errorMessage: z109.string().optional(),
49276
+ var TaskOutcomeSchema = z110.object({
49277
+ routingDecisionId: z110.uuid(),
49278
+ timestamp: z110.iso.datetime(),
49279
+ outcomeClass: z110.enum(["success", "partial", "failure", "timeout", "error"]),
49280
+ success: z110.boolean(),
49281
+ qualityScore: z110.number().min(0).max(1),
49282
+ durationMs: z110.number().min(0),
49283
+ tokenUsage: z110.number().int().min(0),
49284
+ errorMessage: z110.string().optional(),
49100
49285
  qualitySignals: QualitySignalsSchema,
49101
- traceId: z109.string()
49286
+ traceId: z110.string()
49102
49287
  });
49103
49288
  var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
49104
49289
  maxPendingDecisions: 1e3,
@@ -49113,17 +49298,17 @@ var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
49113
49298
  targetTokenUsage: 2e3,
49114
49299
  maxHistorySize: 1e4
49115
49300
  };
49116
- var FeedbackCollectorConfigSchema = z109.object({
49117
- maxPendingDecisions: z109.number().int().positive().default(1e3),
49118
- pendingTimeoutMs: z109.number().positive().default(3e5),
49119
- enableAutoReward: z109.boolean().default(true),
49120
- qualityWeight: z109.number().min(0).max(1).default(0.5),
49121
- speedWeight: z109.number().min(0).max(1).default(0.2),
49122
- efficiencyWeight: z109.number().min(0).max(1).default(0.2),
49123
- retryPenalty: z109.number().min(0).max(1).default(0.1),
49124
- targetDurationMs: z109.number().positive().default(5e3),
49125
- targetTokenUsage: z109.number().positive().default(2e3),
49126
- maxHistorySize: z109.number().int().positive().default(1e4)
49301
+ var FeedbackCollectorConfigSchema = z110.object({
49302
+ maxPendingDecisions: z110.number().int().positive().default(1e3),
49303
+ pendingTimeoutMs: z110.number().positive().default(3e5),
49304
+ enableAutoReward: z110.boolean().default(true),
49305
+ qualityWeight: z110.number().min(0).max(1).default(0.5),
49306
+ speedWeight: z110.number().min(0).max(1).default(0.2),
49307
+ efficiencyWeight: z110.number().min(0).max(1).default(0.2),
49308
+ retryPenalty: z110.number().min(0).max(1).default(0.1),
49309
+ targetDurationMs: z110.number().positive().default(5e3),
49310
+ targetTokenUsage: z110.number().positive().default(2e3),
49311
+ maxHistorySize: z110.number().int().positive().default(1e4)
49127
49312
  });
49128
49313
 
49129
49314
  // src/learning/outcome-feedback-helpers.ts
@@ -51370,6 +51555,7 @@ export {
51370
51555
  registerGetJobResultTool,
51371
51556
  registerListJobsTool,
51372
51557
  registerCancelJobTool,
51558
+ registerCiHealthCheckTool,
51373
51559
  AuditError,
51374
51560
  AuditCategorySchema,
51375
51561
  AuditSeveritySchema,
@@ -51453,4 +51639,4 @@ export {
51453
51639
  detectBackend,
51454
51640
  createTaskTracker
51455
51641
  };
51456
- //# sourceMappingURL=chunk-RZNED4KY.js.map
51642
+ //# sourceMappingURL=chunk-QDGD5FVT.js.map