nexus-agents 2.85.0 → 2.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,10 +38,11 @@ import {
38
38
  withAccessPolicy,
39
39
  withProgressHeartbeat,
40
40
  wrapToolWithTimeout,
41
+ writeJobCancelled,
41
42
  writeJobComplete,
42
43
  writeJobFailed,
43
44
  writeJobPending
44
- } from "./chunk-IF6TXCSE.js";
45
+ } from "./chunk-EHBSXLX6.js";
45
46
  import {
46
47
  REGISTRY_PATH,
47
48
  getProjectRoot,
@@ -81,7 +82,7 @@ import {
81
82
  DEFAULT_TASK_TTL_MS,
82
83
  DEFAULT_TOOL_RATE_LIMITS,
83
84
  clampTaskTtl
84
- } from "./chunk-OXVOUVKH.js";
85
+ } from "./chunk-QOOYL3B3.js";
85
86
  import {
86
87
  getAvailabilityCache,
87
88
  resolveFallback
@@ -23546,10 +23547,10 @@ function calculateZStatistic(params) {
23546
23547
  function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
23547
23548
  const difference = p1 - p2;
23548
23549
  const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
23549
- const z109 = getZScore(confidence);
23550
+ const z110 = getZScore(confidence);
23550
23551
  return {
23551
- lower: difference - z109 * seDiff,
23552
- upper: difference + z109 * seDiff,
23552
+ lower: difference - z110 * seDiff,
23553
+ upper: difference + z110 * seDiff,
23553
23554
  estimate: difference,
23554
23555
  confidence,
23555
23556
  n: total1 + total2,
@@ -23572,11 +23573,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
23572
23573
  standardError: 0
23573
23574
  };
23574
23575
  }
23575
- const z109 = getZScore(opts.confidence);
23576
- const z210 = z109 * z109;
23576
+ const z110 = getZScore(opts.confidence);
23577
+ const z210 = z110 * z110;
23577
23578
  const denominator = 1 + z210 / n;
23578
23579
  const center = (p + z210 / (2 * n)) / denominator;
23579
- const margin = z109 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
23580
+ const margin = z110 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
23580
23581
  const lower = Math.max(0, center - margin);
23581
23582
  const upper = Math.min(1, center + margin);
23582
23583
  const standardError = Math.sqrt(p * (1 - p) / n);
@@ -23606,8 +23607,8 @@ function meanConfidenceInterval(values, options = {}) {
23606
23607
  const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
23607
23608
  const stdDev = Math.sqrt(variance);
23608
23609
  const standardError = stdDev / Math.sqrt(n);
23609
- const z109 = getZScore(opts.confidence);
23610
- const margin = z109 * standardError;
23610
+ const z110 = getZScore(opts.confidence);
23611
+ const margin = z110 * standardError;
23611
23612
  return {
23612
23613
  lower: mean - margin,
23613
23614
  upper: mean + margin,
@@ -43475,7 +43476,7 @@ ${contextBlock}`;
43475
43476
  const strategy = config.votingStrategy ?? "higher_order";
43476
43477
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
43477
43478
  try {
43478
- const { executeVoting } = await import("./consensus-vote-LPYEXUVC.js");
43479
+ const { executeVoting } = await import("./consensus-vote-K7HSOLYR.js");
43479
43480
  const votingResult = await executeVoting(
43480
43481
  {
43481
43482
  proposal: plan.slice(0, 4e3),
@@ -46422,12 +46423,90 @@ function registerListJobsTool(server, deps) {
46422
46423
  logger53.info("Registered list_jobs tool");
46423
46424
  }
46424
46425
 
46426
+ // src/mcp/tools/cancel-job-tool.ts
46427
+ import { z as z99 } from "zod";
46428
+ var CancelJobInputSchema = z99.object({
46429
+ jobId: z99.string().min(1).max(128).describe("Job ID returned by orchestrate / run_workflow / consensus_vote in async mode"),
46430
+ reason: z99.string().max(1e3).optional().describe('Optional human-readable note (e.g. "user clicked cancel").')
46431
+ });
46432
+ function cancelJobHandler(args) {
46433
+ const parsed = CancelJobInputSchema.safeParse(args);
46434
+ if (!parsed.success) {
46435
+ return Promise.resolve(
46436
+ toolStructuredError({
46437
+ errorCategory: "validation",
46438
+ message: `Validation error: ${formatZodError(parsed.error)}`
46439
+ })
46440
+ );
46441
+ }
46442
+ const { jobId, reason } = parsed.data;
46443
+ const existing = readJobResult(jobId);
46444
+ if (existing === null) {
46445
+ const response2 = {
46446
+ jobId,
46447
+ outcome: "unknown_job",
46448
+ message: `No job record found for jobId "${jobId}". The job may never have been dispatched, or the sidecar file is unreadable.`
46449
+ };
46450
+ return Promise.resolve(toolSuccess(JSON.stringify(response2, null, 2)));
46451
+ }
46452
+ if (existing.status === "complete" || existing.status === "failed") {
46453
+ const response2 = {
46454
+ jobId,
46455
+ outcome: "already_complete",
46456
+ status: existing.status,
46457
+ message: `Job already terminated with status "${existing.status}" \u2014 cancel is a no-op.`
46458
+ };
46459
+ return Promise.resolve(toolSuccess(JSON.stringify(response2, null, 2)));
46460
+ }
46461
+ if (existing.status === "cancelled") {
46462
+ const response2 = {
46463
+ jobId,
46464
+ outcome: "already_cancelled",
46465
+ status: "cancelled",
46466
+ message: "Job is already cancelled \u2014 second cancel is an idempotent no-op."
46467
+ };
46468
+ return Promise.resolve(toolSuccess(JSON.stringify(response2, null, 2)));
46469
+ }
46470
+ writeJobCancelled(jobId, existing.toolName, reason);
46471
+ const response = {
46472
+ jobId,
46473
+ outcome: "cancelled",
46474
+ status: "cancelled",
46475
+ message: `Job ${jobId} marked cancelled. In-flight work in the dispatching process aborts via AbortSignal; cross-process workers need to poll get_job_result to observe.`
46476
+ };
46477
+ return Promise.resolve(toolSuccess(JSON.stringify(response, null, 2)));
46478
+ }
46479
+ function registerCancelJobTool(server, deps) {
46480
+ const logger53 = deps.logger ?? createLogger({ tool: "cancel_job" });
46481
+ const toolSchema = {
46482
+ jobId: z99.string().min(1).max(128).describe("Job ID returned by orchestrate / run_workflow / consensus_vote in async mode"),
46483
+ reason: z99.string().max(1e3).optional().describe('Optional human-readable note (e.g. "user clicked cancel").')
46484
+ };
46485
+ const description2 = "Mark an async-mode job as cancelled (#3042 Stage 1b / epic #2631). Same-process dispatcher unwinds via AbortSignal (#3035/#3038); cross-process workers observe via get_job_result. Idempotent \u2014 cancel-after-complete is a no-op (preserves the terminal record); second cancel returns already_cancelled.";
46486
+ const secureHandler = createSecureHandler(cancelJobHandler, {
46487
+ toolName: "cancel_job",
46488
+ rateLimiter: deps.rateLimiter,
46489
+ logger: logger53
46490
+ });
46491
+ const timeoutMs = getToolTimeout("cancel_job", deps.security);
46492
+ const wrappedHandler = wrapToolWithTimeout("cancel_job", secureHandler, {
46493
+ timeoutMs,
46494
+ logger: logger53
46495
+ });
46496
+ server.registerTool(
46497
+ "cancel_job",
46498
+ { description: description2, inputSchema: toolSchema, annotations: getToolAnnotations("cancel_job") },
46499
+ toSdkCallback(wrappedHandler)
46500
+ );
46501
+ logger53.info("Registered cancel_job tool");
46502
+ }
46503
+
46425
46504
  // src/mcp/tools/verify-audit-chain-tool.ts
46426
46505
  import * as fs12 from "fs/promises";
46427
46506
  import * as path11 from "path";
46428
- import { z as z99 } from "zod";
46429
- var VerifyAuditChainInputSchema = z99.object({
46430
- logDir: z99.string().min(1).max(512).describe(
46507
+ import { z as z100 } from "zod";
46508
+ var VerifyAuditChainInputSchema = z100.object({
46509
+ logDir: z100.string().min(1).max(512).describe(
46431
46510
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files in lexicographic order and verifies the combined chain."
46432
46511
  )
46433
46512
  });
@@ -46504,7 +46583,7 @@ async function handler2(args, ctx) {
46504
46583
  function registerVerifyAuditChainTool(server, deps) {
46505
46584
  const logger53 = deps.logger ?? createLogger({ tool: "verify_audit_chain" });
46506
46585
  const toolSchema = {
46507
- logDir: z99.string().min(1).max(512).describe(
46586
+ logDir: z100.string().min(1).max(512).describe(
46508
46587
  "Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files and verifies the combined hash chain."
46509
46588
  )
46510
46589
  };
@@ -46528,18 +46607,18 @@ function registerVerifyAuditChainTool(server, deps) {
46528
46607
  }
46529
46608
 
46530
46609
  // src/mcp/tools/pipeline-tool.ts
46531
- import { z as z100 } from "zod";
46610
+ import { z as z101 } from "zod";
46532
46611
  import * as fs13 from "fs";
46533
46612
  import * as path12 from "path";
46534
- var PipelineInputSchema = z100.object({
46613
+ var PipelineInputSchema = z101.object({
46535
46614
  /** The task to execute. */
46536
- task: z100.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
46615
+ task: z101.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
46537
46616
  /** Path to a spec file (.md, .yaml) to use as task input. */
46538
- specFile: z100.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
46617
+ specFile: z101.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
46539
46618
  /** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
46540
- template: z100.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
46619
+ template: z101.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
46541
46620
  /** Voting strategy for consensus stages. */
46542
- votingStrategy: z100.enum([
46621
+ votingStrategy: z101.enum([
46543
46622
  "simple_majority",
46544
46623
  "supermajority",
46545
46624
  "unanimous",
@@ -46550,13 +46629,13 @@ var PipelineInputSchema = z100.object({
46550
46629
  "Voting strategy for plan approval. simple_majority (default), supermajority (67%), unanimous, higher_order (Bayesian), proof_of_learning, opinion_wise"
46551
46630
  ),
46552
46631
  /** Use 3 agents instead of 6 for faster voting. */
46553
- quickMode: z100.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
46632
+ quickMode: z101.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
46554
46633
  /** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
46555
- timeoutMs: z100.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
46634
+ timeoutMs: z101.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
46556
46635
  /** Stop after planning/voting (no implementation). */
46557
- dryRun: z100.boolean().default(false).describe("Stop after vote stage (no implementation)"),
46636
+ dryRun: z101.boolean().default(false).describe("Stop after vote stage (no implementation)"),
46558
46637
  /** TESTS ONLY — random output, must not be used for real decisions. (#2319) */
46559
- simulateVotes: z100.boolean().default(false).describe("TESTS ONLY \u2014 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)")
46560
46639
  });
46561
46640
  function buildOutput2(result) {
46562
46641
  return {
@@ -46658,7 +46737,7 @@ function registerPipelineTool(server, deps) {
46658
46737
  }
46659
46738
 
46660
46739
  // src/mcp/tools/supply-chain-tradeoff-panel.ts
46661
- import { z as z101 } from "zod";
46740
+ import { z as z102 } from "zod";
46662
46741
  var DEFAULT_AXES = [
46663
46742
  "build_time_determinism",
46664
46743
  "supply_chain_risk",
@@ -46678,16 +46757,16 @@ var FULL_PANEL = [
46678
46757
  "scope_steward"
46679
46758
  ];
46680
46759
  var QUICK_PANEL = ["architect", "security", "scope_steward"];
46681
- var SupplyChainTradeoffPanelInputSchema = z101.object({
46682
- proposal: z101.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
46683
- axes: z101.array(z101.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
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(
46684
46763
  `Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
46685
46764
  ),
46686
- context: z101.string().max(MAX_CONTEXT_LENGTH).optional().describe(
46765
+ context: z102.string().max(MAX_CONTEXT_LENGTH).optional().describe(
46687
46766
  "Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
46688
46767
  ),
46689
- quickMode: z101.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
46690
- simulate: z101.boolean().optional().default(false).describe("Use simulated voters (testing only)")
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)")
46691
46770
  });
46692
46771
  function buildTradeoffProposal(input) {
46693
46772
  const axes = input.axes ?? DEFAULT_AXES;
@@ -47353,6 +47432,25 @@ var TOOL_ANNOTATIONS = {
47353
47432
  }
47354
47433
  ]
47355
47434
  },
47435
+ cancel_job: {
47436
+ annotations: {
47437
+ title: "Cancel Job",
47438
+ readOnlyHint: false,
47439
+ destructiveHint: false,
47440
+ idempotentHint: true,
47441
+ openWorldHint: false
47442
+ },
47443
+ sideEffects: [
47444
+ {
47445
+ category: "explicit",
47446
+ description: "Writes cancellation record to the async-mode sidecar (#3042 Stage 1b)"
47447
+ },
47448
+ {
47449
+ category: "coupling",
47450
+ description: "Triggers AbortSignal unwind in same-process dispatcher (cross-process workers must poll)"
47451
+ }
47452
+ ]
47453
+ },
47356
47454
  verify_audit_chain: {
47357
47455
  annotations: {
47358
47456
  title: "Verify Audit Chain",
@@ -47571,6 +47669,7 @@ var REGISTERED_TOOL_NAMES = [
47571
47669
  "query_task_state",
47572
47670
  "get_job_result",
47573
47671
  "list_jobs",
47672
+ "cancel_job",
47574
47673
  "verify_audit_chain",
47575
47674
  "repo_analyze",
47576
47675
  "repo_security_plan",
@@ -47715,40 +47814,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
47715
47814
  })(RiskLevel || {});
47716
47815
 
47717
47816
  // src/mcp/safety/stpa-schemas.ts
47718
- import { z as z102 } from "zod";
47719
- var HazardCategorySchema = z102.enum(HazardCategory);
47720
- var HazardSeveritySchema = z102.enum(HazardSeverity);
47721
- var ConstraintPrioritySchema = z102.enum(ConstraintPriority);
47722
- var RiskLevelSchema = z102.enum(RiskLevel);
47723
- var TriggerPatternSchema = z102.object({
47724
- parameter: z102.string().min(1),
47725
- matchType: z102.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
47726
- pattern: z102.string(),
47727
- reason: z102.string()
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()
47728
47827
  });
47729
- var HazardSchema = z102.object({
47730
- id: z102.string().min(1),
47731
- description: z102.string(),
47828
+ var HazardSchema = z103.object({
47829
+ id: z103.string().min(1),
47830
+ description: z103.string(),
47732
47831
  category: HazardCategorySchema,
47733
47832
  severity: HazardSeveritySchema,
47734
- likelihood: z102.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
47735
- triggerConditions: z102.array(z102.string()),
47736
- consequences: z102.array(z102.string())
47833
+ likelihood: z103.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
47834
+ triggerConditions: z103.array(z103.string()),
47835
+ consequences: z103.array(z103.string())
47737
47836
  });
47738
- var UnsafeControlActionSchema = z102.object({
47739
- id: z102.string().min(1),
47740
- toolName: z102.string().min(1),
47741
- type: z102.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
47742
- description: z102.string(),
47743
- unsafeContext: z102.string(),
47744
- relatedHazards: z102.array(z102.string()),
47745
- triggerPatterns: z102.array(TriggerPatternSchema).optional()
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()
47746
47845
  });
47747
- var SafetyConstraintSchema = z102.object({
47748
- id: z102.string().min(1),
47749
- description: z102.string(),
47750
- mitigates: z102.array(z102.string()),
47751
- enforcement: z102.enum([
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([
47752
47851
  "prevent",
47753
47852
  "require_confirmation",
47754
47853
  "alert",
@@ -47756,54 +47855,54 @@ var SafetyConstraintSchema = z102.object({
47756
47855
  "rate_limit",
47757
47856
  "require_privilege"
47758
47857
  ]),
47759
- validationFunction: z102.string().optional(),
47858
+ validationFunction: z103.string().optional(),
47760
47859
  priority: ConstraintPrioritySchema
47761
47860
  });
47762
- var PropertySchemaSchema = z102.object({
47763
- type: z102.string(),
47764
- description: z102.string().optional(),
47765
- enum: z102.array(z102.unknown()).optional(),
47766
- pattern: z102.string().optional(),
47767
- minimum: z102.number().optional(),
47768
- maximum: z102.number().optional()
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()
47769
47868
  });
47770
- var ToolInputSchemaSchema = z102.object({
47771
- type: z102.string(),
47772
- properties: z102.record(z102.string(), PropertySchemaSchema).optional(),
47773
- required: z102.array(z102.string()).optional(),
47774
- additionalProperties: z102.boolean().optional()
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()
47775
47874
  });
47776
- var ToolDefinitionSchema = z102.object({
47777
- name: z102.string().min(1),
47778
- description: z102.string(),
47875
+ var ToolDefinitionSchema = z103.object({
47876
+ name: z103.string().min(1),
47877
+ description: z103.string(),
47779
47878
  inputSchema: ToolInputSchemaSchema
47780
47879
  });
47781
- var AnalysisConfigurationSchema = z102.object({
47782
- includeLowSeverity: z102.boolean().default(true),
47783
- generateAllConstraints: z102.boolean().default(true),
47784
- checkInteractions: z102.boolean().default(true),
47785
- maxHazardsPerTool: z102.number().int().min(1).max(100).default(50),
47786
- categories: z102.array(HazardCategorySchema).default([])
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([])
47787
47886
  });
47788
- var ConstraintViolationSchema = z102.object({
47789
- constraintId: z102.string().min(1),
47790
- constraintDescription: z102.string(),
47887
+ var ConstraintViolationSchema = z103.object({
47888
+ constraintId: z103.string().min(1),
47889
+ constraintDescription: z103.string(),
47791
47890
  severity: HazardSeveritySchema,
47792
- details: z102.string(),
47793
- remediation: z102.string()
47891
+ details: z103.string(),
47892
+ remediation: z103.string()
47794
47893
  });
47795
- var ValidationWarningSchema = z102.object({
47796
- code: z102.string().min(1),
47797
- message: z102.string(),
47798
- affected: z102.string()
47894
+ var ValidationWarningSchema = z103.object({
47895
+ code: z103.string().min(1),
47896
+ message: z103.string(),
47897
+ affected: z103.string()
47799
47898
  });
47800
- var ValidationResultSchema = z102.object({
47801
- valid: z102.boolean(),
47802
- toolName: z102.string().min(1),
47803
- violations: z102.array(ConstraintViolationSchema),
47804
- passed: z102.array(z102.string()),
47805
- warnings: z102.array(ValidationWarningSchema),
47806
- validatedAt: z102.date()
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()
47807
47906
  });
47808
47907
 
47809
47908
  // src/mcp/safety/stpa-types.ts
@@ -48888,43 +48987,43 @@ var GeminiResponseParser = class {
48888
48987
  };
48889
48988
 
48890
48989
  // src/cli-adapters/router-types.ts
48891
- import { z as z103 } from "zod";
48892
- var RouterConfigSchema = z103.object({
48893
- minCapacityThreshold: z103.number().min(0).max(1).default(0.1),
48894
- preferCostEfficient: z103.boolean().default(false),
48895
- maxDecisionTimeMs: z103.number().min(1).max(1e3).default(100)
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)
48896
48995
  });
48897
48996
 
48898
48997
  // src/cli-adapters/agreement-cascade-types.ts
48899
- import { z as z104 } from "zod";
48900
- var AgreementCascadeConfigSchema = z104.object({
48901
- agreementThreshold: z104.number().min(0.5).max(1).default(0.7),
48902
- maxStages: z104.number().int().min(1).max(5).default(3),
48903
- modelTimeoutMs: z104.number().int().min(1e3).max(3e5).default(6e4)
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)
48904
49003
  });
48905
49004
 
48906
49005
  // src/cli-adapters/agreement-cascade-router.ts
48907
49006
  var logger43 = createLogger({ component: "agreement-cascade-router" });
48908
49007
 
48909
49008
  // src/cli-adapters/task-classifier.ts
48910
- import { z as z105 } from "zod";
48911
- var ClassificationPatternsSchema = z105.object({
48912
- code: z105.array(z105.string()).readonly(),
48913
- research: z105.array(z105.string()).readonly(),
48914
- documentation: z105.array(z105.string()).readonly(),
48915
- analysis: z105.array(z105.string()).readonly()
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()
48916
49015
  });
48917
49016
 
48918
49017
  // src/cli-adapters/response-cache-types.ts
48919
- import { z as z106 } from "zod";
48920
- var ResponseCacheConfigSchema = z106.object({
48921
- defaultTTL: z106.number().min(1e3).max(36e5).default(3e5),
49018
+ import { z as z107 } from "zod";
49019
+ var ResponseCacheConfigSchema = z107.object({
49020
+ defaultTTL: z107.number().min(1e3).max(36e5).default(3e5),
48922
49021
  // 5 minutes
48923
- maxEntries: z106.number().min(10).max(1e5).default(1e3),
48924
- maxMemoryMB: z106.number().min(1).max(1e3).default(50),
48925
- cleanupInterval: z106.number().min(1e3).max(6e5).default(6e4),
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),
48926
49025
  // 1 minute
48927
- enableLogging: z106.boolean().default(false)
49026
+ enableLogging: z107.boolean().default(false)
48928
49027
  });
48929
49028
 
48930
49029
  // src/cli-adapters/response-cache-utils.ts
@@ -48932,12 +49031,12 @@ import { createHash as createHash4 } from "crypto";
48932
49031
  var logger44 = createLogger({ component: "ResponseCacheUtils" });
48933
49032
 
48934
49033
  // src/cli-adapters/unified-routing-types.ts
48935
- import { z as z107 } from "zod";
48936
- var UnifiedRoutingDecisionSchema = z107.object({
48937
- selectedCli: z107.string(),
48938
- confidence: z107.number().min(0).max(1),
48939
- reason: z107.string(),
48940
- strategy: z107.enum([
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([
48941
49040
  "composite",
48942
49041
  "quality",
48943
49042
  "budget",
@@ -48949,57 +49048,57 @@ var UnifiedRoutingDecisionSchema = z107.object({
48949
49048
  "linucb",
48950
49049
  "direct"
48951
49050
  ]),
48952
- decisionTimeMs: z107.number().nonnegative(),
48953
- alternatives: z107.array(z107.string()).readonly(),
48954
- stagesExecuted: z107.array(z107.string()).readonly(),
48955
- withinBudget: z107.boolean().optional(),
48956
- estimatedComplexity: z107.enum(["simple", "moderate", "complex", "expert"]).optional(),
48957
- estimatedTokens: z107.number().int().positive().optional(),
48958
- topsisScore: z107.number().optional(),
48959
- ucbScore: z107.number().optional(),
48960
- resolvedAtStage: z107.number().int().nonnegative().optional(),
48961
- consensusReached: z107.boolean().optional(),
48962
- agreementScore: z107.number().min(0).max(1).optional(),
48963
- metadata: z107.record(z107.string(), z107.unknown()).optional()
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()
48964
49063
  });
48965
49064
 
48966
49065
  // src/learning/outcome-feedback-types.ts
48967
- import { z as z108 } from "zod";
48968
- var QualitySignalsSchema = z108.object({
48969
- testsPass: z108.boolean().optional(),
48970
- lintErrors: z108.number().int().min(0).optional(),
48971
- userApproved: z108.boolean().optional(),
48972
- retryCount: z108.number().int().min(0).default(0),
48973
- completionRatio: z108.number().min(0).max(1).default(1),
48974
- validStructure: z108.boolean().optional(),
48975
- coherenceScore: z108.number().min(0).max(1).optional()
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()
48976
49075
  });
48977
- var RoutingDecisionSchema = z108.object({
48978
- id: z108.uuid(),
48979
- timestamp: z108.iso.datetime(),
48980
- query: z108.string(),
48981
- routerType: z108.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
48982
- selectedModel: z108.string(),
48983
- selectedTier: z108.enum(["strong", "weak"]).optional(),
48984
- armIndex: z108.number().int().min(0).optional(),
48985
- banditContext: z108.record(z108.string(), z108.unknown()).optional(),
48986
- queryFeatures: z108.record(z108.string(), z108.unknown()).optional(),
48987
- ucbScore: z108.number().optional(),
48988
- confidence: z108.number().min(0).max(1).optional(),
48989
- traceId: z108.string(),
48990
- domain: z108.string().optional()
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()
48991
49090
  });
48992
- var TaskOutcomeSchema = z108.object({
48993
- routingDecisionId: z108.uuid(),
48994
- timestamp: z108.iso.datetime(),
48995
- outcomeClass: z108.enum(["success", "partial", "failure", "timeout", "error"]),
48996
- success: z108.boolean(),
48997
- qualityScore: z108.number().min(0).max(1),
48998
- durationMs: z108.number().min(0),
48999
- tokenUsage: z108.number().int().min(0),
49000
- errorMessage: z108.string().optional(),
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(),
49001
49100
  qualitySignals: QualitySignalsSchema,
49002
- traceId: z108.string()
49101
+ traceId: z109.string()
49003
49102
  });
49004
49103
  var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
49005
49104
  maxPendingDecisions: 1e3,
@@ -49014,17 +49113,17 @@ var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
49014
49113
  targetTokenUsage: 2e3,
49015
49114
  maxHistorySize: 1e4
49016
49115
  };
49017
- var FeedbackCollectorConfigSchema = z108.object({
49018
- maxPendingDecisions: z108.number().int().positive().default(1e3),
49019
- pendingTimeoutMs: z108.number().positive().default(3e5),
49020
- enableAutoReward: z108.boolean().default(true),
49021
- qualityWeight: z108.number().min(0).max(1).default(0.5),
49022
- speedWeight: z108.number().min(0).max(1).default(0.2),
49023
- efficiencyWeight: z108.number().min(0).max(1).default(0.2),
49024
- retryPenalty: z108.number().min(0).max(1).default(0.1),
49025
- targetDurationMs: z108.number().positive().default(5e3),
49026
- targetTokenUsage: z108.number().positive().default(2e3),
49027
- maxHistorySize: z108.number().int().positive().default(1e4)
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)
49028
49127
  });
49029
49128
 
49030
49129
  // src/learning/outcome-feedback-helpers.ts
@@ -51270,6 +51369,7 @@ export {
51270
51369
  registerQueryTaskStateTool,
51271
51370
  registerGetJobResultTool,
51272
51371
  registerListJobsTool,
51372
+ registerCancelJobTool,
51273
51373
  AuditError,
51274
51374
  AuditCategorySchema,
51275
51375
  AuditSeveritySchema,
@@ -51353,4 +51453,4 @@ export {
51353
51453
  detectBackend,
51354
51454
  createTaskTracker
51355
51455
  };
51356
- //# sourceMappingURL=chunk-6KZL5DMU.js.map
51456
+ //# sourceMappingURL=chunk-RZNED4KY.js.map