nexus-agents 8.82.2 → 8.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/{ast-rule-runner-6O4S36DX.js → ast-rule-runner-O2UYBG74.js} +3 -3
  2. package/dist/{child-mcp-config-MLVCPG3Y.js → child-mcp-config-W2EPNDEU.js} +2 -2
  3. package/dist/{chunk-FJRVXEYP.js → chunk-256K77ED.js} +5 -5
  4. package/dist/chunk-2NDA4DHW.js +65 -0
  5. package/dist/chunk-2NDA4DHW.js.map +1 -0
  6. package/dist/{chunk-53JFWRL4.js → chunk-3NPRFOSH.js} +7 -7
  7. package/dist/{chunk-IDV4V5UL.js → chunk-3VZCDTK5.js} +41 -37
  8. package/dist/{chunk-IDV4V5UL.js.map → chunk-3VZCDTK5.js.map} +1 -1
  9. package/dist/{chunk-N33SRZRW.js → chunk-4NH3RNU6.js} +2 -2
  10. package/dist/{chunk-AERTVBCZ.js → chunk-6W4KJFPT.js} +2 -2
  11. package/dist/{chunk-HXIN7YWW.js → chunk-6YQTQYKD.js} +10 -10
  12. package/dist/{chunk-2TR3B7MN.js → chunk-7WJIC7H6.js} +2 -2
  13. package/dist/{chunk-KF45ROST.js → chunk-ALCCX5DS.js} +2 -59
  14. package/dist/chunk-ALCCX5DS.js.map +1 -0
  15. package/dist/{chunk-KOH6JEZI.js → chunk-APF7COQN.js} +2 -2
  16. package/dist/{chunk-F2A24T2G.js → chunk-AQVSAPQD.js} +4 -4
  17. package/dist/{chunk-XOQEJXZI.js → chunk-B5C5IMIV.js} +4 -4
  18. package/dist/{chunk-TIYLC4CO.js → chunk-BTFOWREE.js} +2 -2
  19. package/dist/{chunk-5EOIYZDU.js → chunk-BZPRF4SJ.js} +3 -3
  20. package/dist/{chunk-HD6ZDDJ6.js → chunk-C4SNSFBV.js} +2 -2
  21. package/dist/{chunk-WDYKG5O4.js → chunk-FMN3QH3O.js} +2 -2
  22. package/dist/{chunk-7F2FCMQ4.js → chunk-H4X7QDTB.js} +144 -9
  23. package/dist/chunk-H4X7QDTB.js.map +1 -0
  24. package/dist/{chunk-SV2TOCSR.js → chunk-IPZC5BXM.js} +3 -3
  25. package/dist/{chunk-OHBE6HR2.js → chunk-JM7Z4XKP.js} +280 -175
  26. package/dist/chunk-JM7Z4XKP.js.map +1 -0
  27. package/dist/{chunk-NMZREDJU.js → chunk-KJHB4KH2.js} +3 -3
  28. package/dist/{chunk-FBEFRZVN.js → chunk-LWVRXNCL.js} +2 -2
  29. package/dist/{chunk-U3INGOUL.js → chunk-NO55AP2L.js} +7 -5
  30. package/dist/{chunk-U3INGOUL.js.map → chunk-NO55AP2L.js.map} +1 -1
  31. package/dist/{chunk-UMC4ZQD3.js → chunk-NYF2WZAK.js} +2 -2
  32. package/dist/{chunk-RRTISAC5.js → chunk-OY27GVJ4.js} +35 -25
  33. package/dist/chunk-OY27GVJ4.js.map +1 -0
  34. package/dist/{chunk-PI4IEWV7.js → chunk-PD2GZQYH.js} +2 -2
  35. package/dist/{chunk-GNEEMEFT.js → chunk-PW4DLY5W.js} +2 -2
  36. package/dist/{chunk-AOGHVE7R.js → chunk-QOJS3KCM.js} +3 -3
  37. package/dist/{chunk-XTAQB2Q7.js → chunk-TURGEY3I.js} +2 -2
  38. package/dist/{chunk-UENTSMG4.js → chunk-U53CKPED.js} +2 -2
  39. package/dist/{chunk-QMPGR6OV.js → chunk-UFO5A53B.js} +2 -2
  40. package/dist/{chunk-QZDAUREE.js → chunk-UMFQ52XI.js} +11 -9
  41. package/dist/{chunk-QZDAUREE.js.map → chunk-UMFQ52XI.js.map} +1 -1
  42. package/dist/{chunk-IKE2GXXX.js → chunk-XNX4SH4O.js} +2 -2
  43. package/dist/{chunk-3V2D36A4.js → chunk-YRTHZDTO.js} +2 -2
  44. package/dist/{chunk-AVF7O3PL.js → chunk-YWEZ7W4K.js} +4 -4
  45. package/dist/{cli-circuit-breaker-FXQH22KK.js → cli-circuit-breaker-2T4GGSUE.js} +3 -3
  46. package/dist/cli.js +52 -47
  47. package/dist/cli.js.map +1 -1
  48. package/dist/{composite-router-APJYUPW4.js → composite-router-DH2S2IVK.js} +2 -2
  49. package/dist/{consensus-vote-2OADIAQL.js → consensus-vote-TV7NW6HD.js} +17 -16
  50. package/dist/{context-retriever-3XWQNB5L.js → context-retriever-5NGYA4JC.js} +8 -8
  51. package/dist/{doctor-deep-FCD7FJ3V.js → doctor-deep-535NDUD2.js} +3 -3
  52. package/dist/{doctor-live-Z7MLIFKZ.js → doctor-live-CAREILU5.js} +11 -10
  53. package/dist/{doctor-live-Z7MLIFKZ.js.map → doctor-live-CAREILU5.js.map} +1 -1
  54. package/dist/{expert-bridge-MTEI4DDI.js → expert-bridge-7WAFFJWN.js} +4 -4
  55. package/dist/{factory-MPBBQ4FK.js → factory-L2OVYRN4.js} +10 -9
  56. package/dist/{factory-ZNMNAIZA.js → factory-ZU75VK4Z.js} +5 -5
  57. package/dist/{improvement-review-WOR3EFIY.js → improvement-review-6D6LV5H5.js} +6 -5
  58. package/dist/index.d.ts +129 -68
  59. package/dist/index.js +31 -30
  60. package/dist/index.js.map +1 -1
  61. package/dist/{init-opencode-ODHQ4XBO.js → init-opencode-SHNOT2CZ.js} +6 -5
  62. package/dist/{init-opencode-ODHQ4XBO.js.map → init-opencode-SHNOT2CZ.js.map} +1 -1
  63. package/dist/issue-triage-XG2AISLY.js +16 -0
  64. package/dist/model-registry.generated.json +7269 -3654
  65. package/dist/models-dev-snapshot.json +98 -2
  66. package/dist/{pr-reviewer-helpers-QQZOOUTR.js → pr-reviewer-helpers-P6DXUMTO.js} +4 -4
  67. package/dist/{registry-command-L737NQV4.js → registry-command-R336DHZS.js} +2 -2
  68. package/dist/{repo-security-plan-VH3TC2PF.js → repo-security-plan-LLTLKJWF.js} +3 -3
  69. package/dist/{research-helpers-synthesize-447FYLA6.js → research-helpers-synthesize-N7NYBAKW.js} +4 -4
  70. package/dist/{routing-memory-GIBMSJ3G.js → routing-memory-YLQPO5OH.js} +2 -2
  71. package/dist/{session-memory-FCUX7KDT.js → session-memory-6PNSAPG4.js} +3 -3
  72. package/dist/{setup-config-VASKDBCD.js → setup-config-SY3HM5OH.js} +3 -3
  73. package/dist/{setup-custom-api-7UZRT3HI.js → setup-custom-api-ZEGB745O.js} +4 -4
  74. package/dist/setup-data-dir-Y6FMGFGP.js +32 -0
  75. package/dist/{tool-memory-LKD4XXNT.js → tool-memory-3GBF2OOW.js} +5 -5
  76. package/dist/{unified-registry-5Q4CHKFW.js → unified-registry-SCYTXNHW.js} +11 -10
  77. package/dist/{weather-report-NZDS5BLK.js → weather-report-NGBJYVS6.js} +2 -2
  78. package/package.json +4 -4
  79. package/dist/chunk-7F2FCMQ4.js.map +0 -1
  80. package/dist/chunk-KF45ROST.js.map +0 -1
  81. package/dist/chunk-OHBE6HR2.js.map +0 -1
  82. package/dist/chunk-RRTISAC5.js.map +0 -1
  83. package/dist/issue-triage-2EG4ARA4.js +0 -16
  84. package/dist/setup-data-dir-ZHSJ3AQ5.js +0 -31
  85. /package/dist/{ast-rule-runner-6O4S36DX.js.map → ast-rule-runner-O2UYBG74.js.map} +0 -0
  86. /package/dist/{child-mcp-config-MLVCPG3Y.js.map → child-mcp-config-W2EPNDEU.js.map} +0 -0
  87. /package/dist/{chunk-FJRVXEYP.js.map → chunk-256K77ED.js.map} +0 -0
  88. /package/dist/{chunk-53JFWRL4.js.map → chunk-3NPRFOSH.js.map} +0 -0
  89. /package/dist/{chunk-N33SRZRW.js.map → chunk-4NH3RNU6.js.map} +0 -0
  90. /package/dist/{chunk-AERTVBCZ.js.map → chunk-6W4KJFPT.js.map} +0 -0
  91. /package/dist/{chunk-HXIN7YWW.js.map → chunk-6YQTQYKD.js.map} +0 -0
  92. /package/dist/{chunk-2TR3B7MN.js.map → chunk-7WJIC7H6.js.map} +0 -0
  93. /package/dist/{chunk-KOH6JEZI.js.map → chunk-APF7COQN.js.map} +0 -0
  94. /package/dist/{chunk-F2A24T2G.js.map → chunk-AQVSAPQD.js.map} +0 -0
  95. /package/dist/{chunk-XOQEJXZI.js.map → chunk-B5C5IMIV.js.map} +0 -0
  96. /package/dist/{chunk-TIYLC4CO.js.map → chunk-BTFOWREE.js.map} +0 -0
  97. /package/dist/{chunk-5EOIYZDU.js.map → chunk-BZPRF4SJ.js.map} +0 -0
  98. /package/dist/{chunk-HD6ZDDJ6.js.map → chunk-C4SNSFBV.js.map} +0 -0
  99. /package/dist/{chunk-WDYKG5O4.js.map → chunk-FMN3QH3O.js.map} +0 -0
  100. /package/dist/{chunk-SV2TOCSR.js.map → chunk-IPZC5BXM.js.map} +0 -0
  101. /package/dist/{chunk-NMZREDJU.js.map → chunk-KJHB4KH2.js.map} +0 -0
  102. /package/dist/{chunk-FBEFRZVN.js.map → chunk-LWVRXNCL.js.map} +0 -0
  103. /package/dist/{chunk-UMC4ZQD3.js.map → chunk-NYF2WZAK.js.map} +0 -0
  104. /package/dist/{chunk-PI4IEWV7.js.map → chunk-PD2GZQYH.js.map} +0 -0
  105. /package/dist/{chunk-GNEEMEFT.js.map → chunk-PW4DLY5W.js.map} +0 -0
  106. /package/dist/{chunk-AOGHVE7R.js.map → chunk-QOJS3KCM.js.map} +0 -0
  107. /package/dist/{chunk-XTAQB2Q7.js.map → chunk-TURGEY3I.js.map} +0 -0
  108. /package/dist/{chunk-UENTSMG4.js.map → chunk-U53CKPED.js.map} +0 -0
  109. /package/dist/{chunk-QMPGR6OV.js.map → chunk-UFO5A53B.js.map} +0 -0
  110. /package/dist/{chunk-IKE2GXXX.js.map → chunk-XNX4SH4O.js.map} +0 -0
  111. /package/dist/{chunk-3V2D36A4.js.map → chunk-YRTHZDTO.js.map} +0 -0
  112. /package/dist/{chunk-AVF7O3PL.js.map → chunk-YWEZ7W4K.js.map} +0 -0
  113. /package/dist/{cli-circuit-breaker-FXQH22KK.js.map → cli-circuit-breaker-2T4GGSUE.js.map} +0 -0
  114. /package/dist/{composite-router-APJYUPW4.js.map → composite-router-DH2S2IVK.js.map} +0 -0
  115. /package/dist/{consensus-vote-2OADIAQL.js.map → consensus-vote-TV7NW6HD.js.map} +0 -0
  116. /package/dist/{context-retriever-3XWQNB5L.js.map → context-retriever-5NGYA4JC.js.map} +0 -0
  117. /package/dist/{doctor-deep-FCD7FJ3V.js.map → doctor-deep-535NDUD2.js.map} +0 -0
  118. /package/dist/{expert-bridge-MTEI4DDI.js.map → expert-bridge-7WAFFJWN.js.map} +0 -0
  119. /package/dist/{factory-MPBBQ4FK.js.map → factory-L2OVYRN4.js.map} +0 -0
  120. /package/dist/{factory-ZNMNAIZA.js.map → factory-ZU75VK4Z.js.map} +0 -0
  121. /package/dist/{improvement-review-WOR3EFIY.js.map → improvement-review-6D6LV5H5.js.map} +0 -0
  122. /package/dist/{issue-triage-2EG4ARA4.js.map → issue-triage-XG2AISLY.js.map} +0 -0
  123. /package/dist/{pr-reviewer-helpers-QQZOOUTR.js.map → pr-reviewer-helpers-P6DXUMTO.js.map} +0 -0
  124. /package/dist/{registry-command-L737NQV4.js.map → registry-command-R336DHZS.js.map} +0 -0
  125. /package/dist/{repo-security-plan-VH3TC2PF.js.map → repo-security-plan-LLTLKJWF.js.map} +0 -0
  126. /package/dist/{research-helpers-synthesize-447FYLA6.js.map → research-helpers-synthesize-N7NYBAKW.js.map} +0 -0
  127. /package/dist/{routing-memory-GIBMSJ3G.js.map → routing-memory-YLQPO5OH.js.map} +0 -0
  128. /package/dist/{session-memory-FCUX7KDT.js.map → session-memory-6PNSAPG4.js.map} +0 -0
  129. /package/dist/{setup-config-VASKDBCD.js.map → setup-config-SY3HM5OH.js.map} +0 -0
  130. /package/dist/{setup-custom-api-7UZRT3HI.js.map → setup-custom-api-ZEGB745O.js.map} +0 -0
  131. /package/dist/{setup-data-dir-ZHSJ3AQ5.js.map → setup-data-dir-Y6FMGFGP.js.map} +0 -0
  132. /package/dist/{tool-memory-LKD4XXNT.js.map → tool-memory-3GBF2OOW.js.map} +0 -0
  133. /package/dist/{unified-registry-5Q4CHKFW.js.map → unified-registry-SCYTXNHW.js.map} +0 -0
  134. /package/dist/{weather-report-NZDS5BLK.js.map → weather-report-NGBJYVS6.js.map} +0 -0
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  isGatewayModelAdapter
3
- } from "./chunk-U3INGOUL.js";
3
+ } from "./chunk-NO55AP2L.js";
4
4
  import {
5
5
  allOf
6
6
  } from "./chunk-OQB3XC5O.js";
7
7
  import {
8
8
  DEFAULT_CONSENSUS_CONFIG,
9
9
  DEFAULT_INCREMENTAL_QUORUM_CONFIG,
10
+ ERROR_ENVELOPE_META_KEY,
10
11
  ERROR_FLOOR_FRACTION,
11
12
  NOOP_NOTIFIER,
12
13
  ProposalSchema,
@@ -24,20 +25,20 @@ import {
24
25
  toolSuccessStructured,
25
26
  withProgressHeartbeat,
26
27
  wrapToolWithTimeout
27
- } from "./chunk-RRTISAC5.js";
28
+ } from "./chunk-OY27GVJ4.js";
28
29
  import {
29
30
  VERSION
30
- } from "./chunk-2TR3B7MN.js";
31
+ } from "./chunk-7WJIC7H6.js";
31
32
  import {
32
33
  UNRESOLVED_MODEL_ID,
33
34
  assessPanelIndependence,
34
35
  countDistinctModels,
35
36
  createEvent,
36
37
  getGlobalRegistry
37
- } from "./chunk-AVF7O3PL.js";
38
+ } from "./chunk-YWEZ7W4K.js";
38
39
  import {
39
40
  getToolMemory
40
- } from "./chunk-F2A24T2G.js";
41
+ } from "./chunk-AQVSAPQD.js";
41
42
  import {
42
43
  authRemediation,
43
44
  classifyExtractedError,
@@ -47,10 +48,11 @@ import {
47
48
  isTimeoutText,
48
49
  sleep,
49
50
  withTimeout
50
- } from "./chunk-QZDAUREE.js";
51
+ } from "./chunk-UMFQ52XI.js";
51
52
  import {
53
+ sanitizeErrorDetails,
52
54
  sanitizeOutput
53
- } from "./chunk-KF45ROST.js";
55
+ } from "./chunk-2NDA4DHW.js";
54
56
  import {
55
57
  AgentError,
56
58
  CLI_NAMES,
@@ -86,7 +88,7 @@ import {
86
88
  resolveClassGuardMs,
87
89
  resolveVoteTimeout,
88
90
  stepBus
89
- } from "./chunk-SV2TOCSR.js";
91
+ } from "./chunk-IPZC5BXM.js";
90
92
  import {
91
93
  ensureLearningDir,
92
94
  getOutcomesFile
@@ -100,7 +102,7 @@ import {
100
102
  } from "./chunk-RNDHNRSX.js";
101
103
 
102
104
  // src/mcp/tools/consensus-vote.ts
103
- import { z as z15 } from "zod";
105
+ import { z as z16 } from "zod";
104
106
 
105
107
  // src/mcp/tools/async-dispatch-input.ts
106
108
  import { z } from "zod";
@@ -6433,7 +6435,7 @@ function logPartialProposal(bounded, log) {
6433
6435
  }
6434
6436
  async function runContrarianCheck(proposal, log, opts) {
6435
6437
  try {
6436
- const { executeExpert } = await import("./expert-bridge-MTEI4DDI.js");
6438
+ const { executeExpert } = await import("./expert-bridge-7WAFFJWN.js");
6437
6439
  const bounded = boundArtifactForReview(proposal, CONTRARIAN_PROPOSAL_BUDGET, "proposal");
6438
6440
  logPartialProposal(bounded, log);
6439
6441
  const result = await executeExpert("architecture", buildContrarianPrompt(bounded, opts), {
@@ -7216,7 +7218,7 @@ function warnOnce(toolName, logger11) {
7216
7218
  // src/mcp/jobs/job-result-store.ts
7217
7219
  import { existsSync as existsSync6, readdirSync, unlinkSync, writeFileSync as writeFileSync3, chmodSync, mkdirSync as mkdirSync3 } from "node:fs";
7218
7220
  import { dirname as dirname3 } from "node:path";
7219
- import { z as z13 } from "zod";
7221
+ import { z as z14 } from "zod";
7220
7222
 
7221
7223
  // src/mcp/jobs/job-idempotency.ts
7222
7224
  import { createHash as createHash3, randomUUID } from "node:crypto";
@@ -7459,30 +7461,114 @@ function syncAlternateCandidates(jobId, primaryPath, record, logger11, persistFn
7459
7461
  }
7460
7462
  }
7461
7463
 
7464
+ // src/mcp/jobs/job-failure-detail.ts
7465
+ import { z as z13 } from "zod";
7466
+ var JobFailureDetailSchema = z13.object({
7467
+ /** Identifier of the failing adapter (e.g. 'claude', 'codex', 'api:anthropic'). */
7468
+ adapter: z13.string().min(1),
7469
+ /** Transport mechanism where the failure occurred (e.g. 'subprocess', 'mcp', 'stdio'). */
7470
+ transport: z13.string().min(1),
7471
+ /** Normalized failure category (e.g. 'rate_limited', 'timeout', 'capacity_exhausted'). */
7472
+ category: z13.string().min(1)
7473
+ });
7474
+ function isRecord(value) {
7475
+ return typeof value === "object" && value !== null;
7476
+ }
7477
+ function getNonEmptyString(value) {
7478
+ return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
7479
+ }
7480
+ function normalizeFailureCategory(raw) {
7481
+ return raw.trim().toLowerCase();
7482
+ }
7483
+ function extractCategory(candidate) {
7484
+ const direct = getNonEmptyString(candidate.category) ?? getNonEmptyString(candidate.code);
7485
+ if (direct !== void 0) {
7486
+ return normalizeFailureCategory(direct);
7487
+ }
7488
+ const msg = getNonEmptyString(candidate.message);
7489
+ if (msg?.toLowerCase().includes("capacity_exhausted") === true) {
7490
+ return "capacity_exhausted";
7491
+ }
7492
+ return void 0;
7493
+ }
7494
+ function inspectExplicitFailureDetail(candidate) {
7495
+ if (!isRecord(candidate.failureDetail)) return void 0;
7496
+ const fd = candidate.failureDetail;
7497
+ const adapter = getNonEmptyString(fd.adapter);
7498
+ const transport = getNonEmptyString(fd.transport);
7499
+ const category = getNonEmptyString(fd.category);
7500
+ if (adapter !== void 0 && transport !== void 0 && category !== void 0) {
7501
+ return {
7502
+ adapter,
7503
+ transport,
7504
+ category: normalizeFailureCategory(category)
7505
+ };
7506
+ }
7507
+ return void 0;
7508
+ }
7509
+ function inspectCandidateForDetail(candidate) {
7510
+ const explicit = inspectExplicitFailureDetail(candidate);
7511
+ if (explicit !== void 0) return explicit;
7512
+ const adapter = getNonEmptyString(candidate.adapter) ?? getNonEmptyString(candidate.cli);
7513
+ if (adapter === void 0) return void 0;
7514
+ const transport = getNonEmptyString(candidate.transport) ?? "subprocess";
7515
+ const category = extractCategory(candidate);
7516
+ if (category === void 0) return void 0;
7517
+ return { adapter, transport, category };
7518
+ }
7519
+ function inspectMetaForDetail(meta) {
7520
+ if (!isRecord(meta)) return void 0;
7521
+ const direct = inspectCandidateForDetail(meta);
7522
+ if (direct !== void 0) return direct;
7523
+ const env = meta[ERROR_ENVELOPE_META_KEY];
7524
+ if (isRecord(env) && isRecord(env.detail)) {
7525
+ return inspectCandidateForDetail(env.detail);
7526
+ }
7527
+ return void 0;
7528
+ }
7529
+ function extractFailureDetail(source) {
7530
+ if (!isRecord(source)) return void 0;
7531
+ return inspectCandidateForDetail(source) ?? inspectMetaForDetail(source._meta) ?? (isRecord(source.error) ? inspectCandidateForDetail(source.error) : void 0) ?? (isRecord(source.cause) ? inspectCandidateForDetail(source.cause) : void 0);
7532
+ }
7533
+ function validateAndSanitizeFailureDetail(detail) {
7534
+ if (detail === void 0) return void 0;
7535
+ return JobFailureDetailSchema.parse({
7536
+ adapter: sanitizeErrorDetails(detail.adapter),
7537
+ transport: sanitizeErrorDetails(detail.transport),
7538
+ category: sanitizeErrorDetails(detail.category)
7539
+ });
7540
+ }
7541
+
7462
7542
  // src/mcp/jobs/job-result-store.ts
7463
7543
  var logger8 = createLogger({ component: "job-result-store" });
7464
- var JobStatusSchema = z13.enum(["pending", "complete", "failed", "cancelled"]);
7465
- var JobResultSchema = z13.object({
7544
+ var JobStatusSchema = z14.enum(["pending", "complete", "failed", "cancelled"]);
7545
+ var JobResultSchema = z14.object({
7466
7546
  /** Format version. Currently `1` — bump if the shape changes. */
7467
- v: z13.literal(1),
7468
- jobId: z13.string().min(1),
7547
+ v: z14.literal(1),
7548
+ jobId: z14.string().min(1),
7469
7549
  /** Tool that was invoked (e.g. `orchestrate`). */
7470
- toolName: z13.string().min(1),
7550
+ toolName: z14.string().min(1),
7471
7551
  status: JobStatusSchema,
7472
- createdAt: z13.iso.datetime(),
7552
+ createdAt: z14.iso.datetime(),
7473
7553
  /** Set when the job leaves `pending` — either via `complete` or `failed` or `cancelled`. */
7474
- completedAt: z13.iso.datetime().optional(),
7554
+ completedAt: z14.iso.datetime().optional(),
7475
7555
  /**
7476
7556
  * Structured payload the synchronous mode would have returned. Present
7477
7557
  * only when `status === 'complete'`. Shape is tool-specific — readers
7478
7558
  * cast to the tool's known output type after status check.
7479
7559
  */
7480
- result: z13.unknown().optional(),
7560
+ result: z14.unknown().optional(),
7481
7561
  /**
7482
7562
  * Failure message when `status === 'failed'`. Cannot be paired with
7483
7563
  * `result` — the discriminator is `status`.
7484
7564
  */
7485
- error: z13.string().optional(),
7565
+ error: z14.string().optional(),
7566
+ /**
7567
+ * Structured failure detail when `status === 'failed'` (#4375).
7568
+ * Holds normalized adapter, transport, and category information without
7569
+ * raw response bodies or prompt strings.
7570
+ */
7571
+ failureDetail: JobFailureDetailSchema.optional(),
7486
7572
  /**
7487
7573
  * Machine-readable reason for a `failed` record that was NOT settled by the
7488
7574
  * process that ran the job (#6224). `abandoned` is written only by
@@ -7491,7 +7577,7 @@ var JobResultSchema = z13.object({
7491
7577
  * the sweep rewrote it rather than deleting it. Absent on every record the
7492
7578
  * job's own process wrote — `error` alone carries those failures.
7493
7579
  */
7494
- errorKind: z13.literal("abandoned").optional(),
7580
+ errorKind: z14.literal("abandoned").optional(),
7495
7581
  /**
7496
7582
  * Whether the tool's `run` callback accepts `runAsJob`'s `AbortSignal`
7497
7583
  * (#4972).
@@ -7507,7 +7593,7 @@ var JobResultSchema = z13.object({
7507
7593
  * "cancellation can reach this tool", not "the work stopped". Absent means
7508
7594
  * the writer did not report it, which is not the same as `false`.
7509
7595
  */
7510
- signalAccepted: z13.boolean().optional(),
7596
+ signalAccepted: z14.boolean().optional(),
7511
7597
  /**
7512
7598
  * `VERSION` of the nexus-agents process that WROTE this record (#5008) —
7513
7599
  * i.e. the build that ran the job, not the build that reads it back.
@@ -7528,7 +7614,7 @@ var JobResultSchema = z13.object({
7528
7614
  * `'dev'` — readers MUST run it through {@link isMeasuredBuildVersion}
7529
7615
  * before treating two stamps as comparable.
7530
7616
  */
7531
- producerVersion: z13.string().optional(),
7617
+ producerVersion: z14.string().optional(),
7532
7618
  /**
7533
7619
  * When the job body last heartbeat — `runAsJob`'s `progress()` callback,
7534
7620
  * `heartbeatJob`, or a pipeline-bus event the body emitted (#6162). Present
@@ -7540,7 +7626,7 @@ var JobResultSchema = z13.object({
7540
7626
  * `run-as-job.ts` fails a body that stops heartbeating as wedged, measuring
7541
7627
  * silence from this stamp (or from job start when there is none).
7542
7628
  */
7543
- lastProgressAt: z13.iso.datetime().optional()
7629
+ lastProgressAt: z14.iso.datetime().optional()
7544
7630
  });
7545
7631
  var UNMEASURED_BUILD_VERSION = "dev";
7546
7632
  function isMeasuredBuildVersion(version) {
@@ -7614,7 +7700,7 @@ function writeJobComplete(jobId, toolName, result, producerVersion = VERSION) {
7614
7700
  syncAlternateCandidates(jobId, primaryPath, record, logger8, persistJobRecord);
7615
7701
  logger8.debug("Wrote complete job record", { jobId, toolName });
7616
7702
  }
7617
- function writeJobFailed(jobId, toolName, error, producerVersion = VERSION) {
7703
+ function writeJobFailed(jobId, toolName, error, producerVersion = VERSION, failureDetail) {
7618
7704
  const existing = readJobResult(jobId);
7619
7705
  if (existing?.status === "cancelled") {
7620
7706
  logger8.debug("Skipping failed write \u2014 job already cancelled (preserving cancellation)", {
@@ -7623,6 +7709,8 @@ function writeJobFailed(jobId, toolName, error, producerVersion = VERSION) {
7623
7709
  });
7624
7710
  return;
7625
7711
  }
7712
+ const sanitizedError = sanitizeErrorDetails(error);
7713
+ const validatedDetail = validateAndSanitizeFailureDetail(failureDetail);
7626
7714
  const record = {
7627
7715
  v: 1,
7628
7716
  jobId,
@@ -7630,14 +7718,15 @@ function writeJobFailed(jobId, toolName, error, producerVersion = VERSION) {
7630
7718
  status: "failed",
7631
7719
  createdAt: existing?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
7632
7720
  completedAt: (/* @__PURE__ */ new Date()).toISOString(),
7633
- error,
7721
+ error: sanitizedError,
7722
+ ...validatedDetail !== void 0 ? { failureDetail: validatedDetail } : {},
7634
7723
  producerVersion,
7635
7724
  ...carriedProgress(existing)
7636
7725
  };
7637
7726
  const primaryPath = jobResultPath(jobId);
7638
7727
  persistJobRecord(primaryPath, record);
7639
7728
  syncAlternateCandidates(jobId, primaryPath, record, logger8, persistJobRecord);
7640
- logger8.debug("Wrote failed job record", { jobId, toolName, error });
7729
+ logger8.debug("Wrote failed job record", { jobId, toolName, error: sanitizedError });
7641
7730
  }
7642
7731
  function heartbeatJob(jobId, at = new Date(getTimeProvider().now()).toISOString()) {
7643
7732
  persistProgressStamp(jobId, at);
@@ -7664,6 +7753,7 @@ function persistProgressStamp(jobId, at) {
7664
7753
  }
7665
7754
  function writeJobCancelled(jobId, toolName, reason, producerVersion = VERSION) {
7666
7755
  const existing = readJobResult(jobId);
7756
+ const sanitizedReason = reason !== void 0 ? sanitizeErrorDetails(reason) : void 0;
7667
7757
  const record = {
7668
7758
  v: 1,
7669
7759
  jobId,
@@ -7671,14 +7761,14 @@ function writeJobCancelled(jobId, toolName, reason, producerVersion = VERSION) {
7671
7761
  status: "cancelled",
7672
7762
  createdAt: existing?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
7673
7763
  completedAt: (/* @__PURE__ */ new Date()).toISOString(),
7674
- ...reason !== void 0 ? { error: reason } : {},
7764
+ ...sanitizedReason !== void 0 ? { error: sanitizedReason } : {},
7675
7765
  producerVersion,
7676
7766
  ...carriedProgress(existing)
7677
7767
  };
7678
7768
  const primaryPath = jobResultPath(jobId);
7679
7769
  persistJobRecord(primaryPath, record);
7680
7770
  syncAlternateCandidates(jobId, primaryPath, record, logger8, persistJobRecord);
7681
- logger8.debug("Wrote cancelled job record", { jobId, toolName, reason });
7771
+ logger8.debug("Wrote cancelled job record", { jobId, toolName, reason: sanitizedReason });
7682
7772
  }
7683
7773
  function readJobResult(jobId) {
7684
7774
  return readJobResultAcrossCandidates(jobId, logger8);
@@ -7842,8 +7932,8 @@ import * as path from "node:path";
7842
7932
  import { AsyncLocalStorage } from "node:async_hooks";
7843
7933
 
7844
7934
  // src/context/structured-task-state-types.ts
7845
- import { z as z14 } from "zod";
7846
- var TaskStageSchema = z14.enum([
7935
+ import { z as z15 } from "zod";
7936
+ var TaskStageSchema = z15.enum([
7847
7937
  "planning",
7848
7938
  "executing",
7849
7939
  "verifying",
@@ -7855,59 +7945,59 @@ var TaskStageSchema = z14.enum([
7855
7945
  // failed run in StructuredTaskState instead of the Stage-1 sidecar.
7856
7946
  "failed"
7857
7947
  ]);
7858
- var TaskDecisionSchema = z14.object({
7859
- ts: z14.iso.datetime(),
7860
- decision: z14.string().min(1),
7861
- rationale: z14.string().min(1)
7948
+ var TaskDecisionSchema = z15.object({
7949
+ ts: z15.iso.datetime(),
7950
+ decision: z15.string().min(1),
7951
+ rationale: z15.string().min(1)
7862
7952
  });
7863
- var TaskBlockerSchema = z14.object({
7864
- ts: z14.iso.datetime(),
7865
- blocker: z14.string().min(1),
7866
- resolved: z14.iso.datetime().optional()
7953
+ var TaskBlockerSchema = z15.object({
7954
+ ts: z15.iso.datetime(),
7955
+ blocker: z15.string().min(1),
7956
+ resolved: z15.iso.datetime().optional()
7867
7957
  });
7868
- var TaskPositionSchema = z14.object({
7869
- currentStep: z14.string().min(1),
7870
- nextStep: z14.string().optional()
7958
+ var TaskPositionSchema = z15.object({
7959
+ currentStep: z15.string().min(1),
7960
+ nextStep: z15.string().optional()
7871
7961
  });
7872
- var TaskLedgerSchema = z14.object({
7962
+ var TaskLedgerSchema = z15.object({
7873
7963
  /** Verifiable observations: what we have observed/measured/confirmed. */
7874
- facts: z14.array(z14.string()),
7964
+ facts: z15.array(z15.string()),
7875
7965
  /** Working assumptions: useful guesses we proceed under, marked separately. */
7876
- guesses: z14.array(z14.string()),
7966
+ guesses: z15.array(z15.string()),
7877
7967
  /** Things we still need to figure out before the plan is sound. */
7878
- openQuestions: z14.array(z14.string()),
7879
- updatedAt: z14.iso.datetime()
7968
+ openQuestions: z15.array(z15.string()),
7969
+ updatedAt: z15.iso.datetime()
7880
7970
  });
7881
- var ReflectActionSchema = z14.enum(["continue", "revise_plan", "escalate_to_human", "abort"]);
7882
- var ProgressLedgerEntrySchema = z14.object({
7883
- ts: z14.iso.datetime(),
7971
+ var ReflectActionSchema = z15.enum(["continue", "revise_plan", "escalate_to_human", "abort"]);
7972
+ var ProgressLedgerEntrySchema = z15.object({
7973
+ ts: z15.iso.datetime(),
7884
7974
  /** What just happened (the step we are reflecting on). */
7885
- step: z14.string().min(1),
7975
+ step: z15.string().min(1),
7886
7976
  /** Is the outer Task Ledger plan still right after this step? */
7887
- planStillValid: z14.boolean(),
7977
+ planStillValid: z15.boolean(),
7888
7978
  /** Are we making progress, or have we stalled? */
7889
- stuck: z14.boolean(),
7979
+ stuck: z15.boolean(),
7890
7980
  /** What the orchestrator should do next based on this reflection. */
7891
7981
  suggestedAction: ReflectActionSchema,
7892
7982
  /** Why this action was chosen — required so future readers can audit the call. */
7893
- rationale: z14.string().min(1)
7983
+ rationale: z15.string().min(1)
7894
7984
  });
7895
- var TaskCancellationSchema = z14.object({
7896
- requestedAt: z14.iso.datetime(),
7985
+ var TaskCancellationSchema = z15.object({
7986
+ requestedAt: z15.iso.datetime(),
7897
7987
  /** Optional human-readable note carried back to the caller. */
7898
- reason: z14.string().max(1e3).optional()
7988
+ reason: z15.string().max(1e3).optional()
7899
7989
  });
7900
7990
  var TASK_RESULT_MAX_BYTES = 1048576;
7901
- var StructuredTaskStateSchema = z14.object({
7902
- taskId: z14.string().min(1),
7991
+ var StructuredTaskStateSchema = z15.object({
7992
+ taskId: z15.string().min(1),
7903
7993
  /**
7904
7994
  * Marks state created by the shared async-job dispatcher (#5622).
7905
7995
  * Optional for backward compatibility; absence does not prove async dispatch.
7906
7996
  */
7907
- dispatch: z14.literal("async").optional(),
7997
+ dispatch: z15.literal("async").optional(),
7908
7998
  stage: TaskStageSchema,
7909
- decisions: z14.array(TaskDecisionSchema),
7910
- blockers: z14.array(TaskBlockerSchema),
7999
+ decisions: z15.array(TaskDecisionSchema),
8000
+ blockers: z15.array(TaskBlockerSchema),
7911
8001
  position: TaskPositionSchema,
7912
8002
  /**
7913
8003
  * Magentic-One Task Ledger (#2278). Mutable single-object outer-loop state:
@@ -7920,7 +8010,7 @@ var StructuredTaskStateSchema = z14.object({
7920
8010
  * Most recent entry's `suggestedAction` is what `reflect()` returns. Optional
7921
8011
  * for the same backward-compat reason as `taskLedger`.
7922
8012
  */
7923
- progressLedger: z14.array(ProgressLedgerEntrySchema).optional(),
8013
+ progressLedger: z15.array(ProgressLedgerEntrySchema).optional(),
7924
8014
  /**
7925
8015
  * Monotonic version counter (#3043 / epic #2631 Stage 2). Increments by
7926
8016
  * 1 on every write; polling clients use this to detect "I missed a
@@ -7930,7 +8020,7 @@ var StructuredTaskStateSchema = z14.object({
7930
8020
  * state logs (pre-Stage-2) don't carry it; the reducer treats their
7931
8021
  * baseline as v0 and starts counting from there.
7932
8022
  */
7933
- version: z14.number().int().nonnegative().optional(),
8023
+ version: z15.number().int().nonnegative().optional(),
7934
8024
  /**
7935
8025
  * Tool result payload (#3043 / epic #2631 Stage 2). Set atomically
7936
8026
  * via the `result` log event when `stage === 'complete'`. Carries the
@@ -7946,7 +8036,7 @@ var StructuredTaskStateSchema = z14.object({
7946
8036
  * field, then the sidecar files become legacy that the next cleanup
7947
8037
  * sweep can remove.
7948
8038
  */
7949
- result: z14.unknown().optional(),
8039
+ result: z15.unknown().optional(),
7950
8040
  /**
7951
8041
  * Cancellation marker (#3043 / epic #2631 Stage 2). Set by `cancel_job`
7952
8042
  * — the running tool checks for this at safe-point boundaries (between
@@ -7963,70 +8053,70 @@ var StructuredTaskStateSchema = z14.object({
7963
8053
  * transition has been recorded. Optional for backward-compat with
7964
8054
  * pre-#3090 logs (the reducer backfills it from the init entry).
7965
8055
  */
7966
- createdAt: z14.iso.datetime().optional(),
7967
- updatedAt: z14.iso.datetime()
8056
+ createdAt: z15.iso.datetime().optional(),
8057
+ updatedAt: z15.iso.datetime()
7968
8058
  });
7969
- var StructuredTaskLogEntrySchema = z14.discriminatedUnion("event", [
7970
- z14.object({
7971
- event: z14.literal("init"),
7972
- ts: z14.iso.datetime(),
8059
+ var StructuredTaskLogEntrySchema = z15.discriminatedUnion("event", [
8060
+ z15.object({
8061
+ event: z15.literal("init"),
8062
+ ts: z15.iso.datetime(),
7973
8063
  state: StructuredTaskStateSchema
7974
8064
  }),
7975
- z14.object({
7976
- event: z14.literal("decision"),
7977
- ts: z14.iso.datetime(),
8065
+ z15.object({
8066
+ event: z15.literal("decision"),
8067
+ ts: z15.iso.datetime(),
7978
8068
  decision: TaskDecisionSchema
7979
8069
  }),
7980
- z14.object({
7981
- event: z14.literal("blocker"),
7982
- ts: z14.iso.datetime(),
8070
+ z15.object({
8071
+ event: z15.literal("blocker"),
8072
+ ts: z15.iso.datetime(),
7983
8073
  blocker: TaskBlockerSchema
7984
8074
  }),
7985
- z14.object({
7986
- event: z14.literal("blocker_resolved"),
7987
- ts: z14.iso.datetime(),
8075
+ z15.object({
8076
+ event: z15.literal("blocker_resolved"),
8077
+ ts: z15.iso.datetime(),
7988
8078
  /** Index of the blocker in the state's blockers[] array. */
7989
- blockerIndex: z14.number().int().nonnegative(),
7990
- resolvedAt: z14.iso.datetime()
8079
+ blockerIndex: z15.number().int().nonnegative(),
8080
+ resolvedAt: z15.iso.datetime()
7991
8081
  }),
7992
- z14.object({
7993
- event: z14.literal("stage"),
7994
- ts: z14.iso.datetime(),
8082
+ z15.object({
8083
+ event: z15.literal("stage"),
8084
+ ts: z15.iso.datetime(),
7995
8085
  stage: TaskStageSchema
7996
8086
  }),
7997
- z14.object({
7998
- event: z14.literal("position"),
7999
- ts: z14.iso.datetime(),
8087
+ z15.object({
8088
+ event: z15.literal("position"),
8089
+ ts: z15.iso.datetime(),
8000
8090
  position: TaskPositionSchema
8001
8091
  }),
8002
8092
  // Magentic-One Task Ledger replacement event — the outer loop revises the
8003
8093
  // entire ledger atomically when replanning. Always replaces, never partial.
8004
- z14.object({
8005
- event: z14.literal("task_ledger"),
8006
- ts: z14.iso.datetime(),
8094
+ z15.object({
8095
+ event: z15.literal("task_ledger"),
8096
+ ts: z15.iso.datetime(),
8007
8097
  ledger: TaskLedgerSchema
8008
8098
  }),
8009
8099
  // Magentic-One Progress Ledger append event — one self-reflection per step.
8010
- z14.object({
8011
- event: z14.literal("progress_ledger"),
8012
- ts: z14.iso.datetime(),
8100
+ z15.object({
8101
+ event: z15.literal("progress_ledger"),
8102
+ ts: z15.iso.datetime(),
8013
8103
  entry: ProgressLedgerEntrySchema
8014
8104
  }),
8015
8105
  // #3043 / epic #2631 Stage 2 — tool result payload set when stage flips
8016
8106
  // to 'complete'. Written by appendResult; replayed into state.result.
8017
8107
  // The payload itself is `unknown` because each tool's result shape is
8018
8108
  // its own; readers cast after a status check.
8019
- z14.object({
8020
- event: z14.literal("result"),
8021
- ts: z14.iso.datetime(),
8022
- result: z14.unknown()
8109
+ z15.object({
8110
+ event: z15.literal("result"),
8111
+ ts: z15.iso.datetime(),
8112
+ result: z15.unknown()
8023
8113
  }),
8024
8114
  // #3043 / epic #2631 Stage 2 — cancellation marker. Append-only: the
8025
8115
  // reducer ignores a second cancellation event so a malicious or buggy
8026
8116
  // double-cancel can't rewrite the requestedAt timestamp.
8027
- z14.object({
8028
- event: z14.literal("cancellation"),
8029
- ts: z14.iso.datetime(),
8117
+ z15.object({
8118
+ event: z15.literal("cancellation"),
8119
+ ts: z15.iso.datetime(),
8030
8120
  cancellation: TaskCancellationSchema
8031
8121
  })
8032
8122
  ]);
@@ -8573,6 +8663,26 @@ function runAsJob(params) {
8573
8663
  void runJobInBackground(jobId, params);
8574
8664
  return env.pending(jobId);
8575
8665
  }
8666
+ function settleJobResult(jobId, params, result) {
8667
+ const failure = detectFailureShapedResult(result);
8668
+ if (failure !== null && params.allowFailureShapedResult === void 0) {
8669
+ writeJobFailed(
8670
+ jobId,
8671
+ params.toolName,
8672
+ describeFailureShape(failure),
8673
+ params.producerVersion,
8674
+ extractFailureDetail(result)
8675
+ );
8676
+ return;
8677
+ }
8678
+ if (failure !== null) {
8679
+ params.logger?.warn(
8680
+ `Recorded a failure-shaped ${params.toolName} result as complete (opted out)`,
8681
+ { jobId, key: failure.key, reason: params.allowFailureShapedResult }
8682
+ );
8683
+ }
8684
+ writeJobComplete(jobId, params.toolName, result, params.producerVersion);
8685
+ }
8576
8686
  async function runJobInBackground(jobId, params) {
8577
8687
  const guardMs = resolveClassGuardMs(ASYNC_JOB_BODY_GUARD_CLASS);
8578
8688
  params.logger?.info(`Async ${params.toolName} job started under runaway guard`, {
@@ -8589,22 +8699,17 @@ async function runJobInBackground(jobId, params) {
8589
8699
  () => params.run(jobId, params.input, controller.signal, guard.progress)
8590
8700
  );
8591
8701
  const result = await Promise.race([body, guard.expired]);
8592
- const failure = detectFailureShapedResult(result);
8593
- if (failure !== null && params.allowFailureShapedResult === void 0) {
8594
- writeJobFailed(jobId, params.toolName, describeFailureShape(failure), params.producerVersion);
8595
- } else {
8596
- if (failure !== null) {
8597
- params.logger?.warn(
8598
- `Recorded a failure-shaped ${params.toolName} result as complete (opted out)`,
8599
- { jobId, key: failure.key, reason: params.allowFailureShapedResult }
8600
- );
8601
- }
8602
- writeJobComplete(jobId, params.toolName, result, params.producerVersion);
8603
- }
8702
+ settleJobResult(jobId, params, result);
8604
8703
  } catch (err2) {
8605
8704
  const errObj = err2 instanceof Error ? err2 : new Error(String(err2));
8606
8705
  params.logger?.error(`Async ${params.toolName} dispatch failed`, errObj, { jobId });
8607
- writeJobFailed(jobId, params.toolName, errObj.message, params.producerVersion);
8706
+ writeJobFailed(
8707
+ jobId,
8708
+ params.toolName,
8709
+ errObj.message,
8710
+ params.producerVersion,
8711
+ extractFailureDetail(err2)
8712
+ );
8608
8713
  } finally {
8609
8714
  unbridge();
8610
8715
  guard.clear();
@@ -9177,49 +9282,49 @@ var ASYNC_ENVELOPES = {
9177
9282
  };
9178
9283
  var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
9179
9284
  /** Async-dispatch envelope discriminator — absent on a completed vote. */
9180
- status: z15.enum(["pending", "busy", "replay"]).optional(),
9181
- jobId: z15.string().max(200).optional(),
9182
- pollTool: z15.literal("get_job_result").optional(),
9183
- note: z15.string().max(500).optional(),
9184
- retryAfterMs: z15.number().optional(),
9185
- proposal: z15.string().optional(),
9285
+ status: z16.enum(["pending", "busy", "replay"]).optional(),
9286
+ jobId: z16.string().max(200).optional(),
9287
+ pollTool: z16.literal("get_job_result").optional(),
9288
+ note: z16.string().max(500).optional(),
9289
+ retryAfterMs: z16.number().optional(),
9290
+ proposal: z16.string().optional(),
9186
9291
  strategy: VotingStrategySchema.optional(),
9187
9292
  // Reuses the canonical VoteDecisionStatusSchema (single source) — a hand-listed
9188
9293
  // subset here (was ['approved','rejected','no_quorum']) omitted the reachable
9189
9294
  // 'timeout'/'pending' outcomes and made strict clients reject those votes (#4032).
9190
9295
  decision: VoteDecisionStatusSchema.optional(),
9191
- approvalPercentage: z15.number().optional(),
9192
- voteCounts: z15.object({
9193
- approve: z15.number(),
9194
- reject: z15.number(),
9195
- abstain: z15.number(),
9196
- error: z15.number(),
9296
+ approvalPercentage: z16.number().optional(),
9297
+ voteCounts: z16.object({
9298
+ approve: z16.number(),
9299
+ reject: z16.number(),
9300
+ abstain: z16.number(),
9301
+ error: z16.number(),
9197
9302
  /** #6094: seats that could not read the artifact; always present. */
9198
- unverifiable: z15.number()
9303
+ unverifiable: z16.number()
9199
9304
  }).optional(),
9200
9305
  // #6111: the quick-mode contrarian check is not a seat, so `voteCounts.error`
9201
9306
  // cannot count it. Present on every completed vote (`skipped` when it did not
9202
9307
  // run); optional here only because the async envelope shares this schema.
9203
9308
  contrarianCheck: ContrarianCheckStatusSchema.optional(),
9204
- votes: z15.array(
9205
- z15.object({
9206
- role: z15.string().max(100),
9207
- decision: z15.enum(["approve", "reject", "abstain"]),
9208
- confidence: z15.number(),
9209
- reasoning: z15.string().max(4e3),
9210
- simulated: z15.boolean(),
9211
- error: z15.boolean(),
9309
+ votes: z16.array(
9310
+ z16.object({
9311
+ role: z16.string().max(100),
9312
+ decision: z16.enum(["approve", "reject", "abstain"]),
9313
+ confidence: z16.number(),
9314
+ reasoning: z16.string().max(4e3),
9315
+ simulated: z16.boolean(),
9316
+ error: z16.boolean(),
9212
9317
  /** #6094: present only when the seat could not read the artifact. */
9213
- unverifiable: z15.literal(true).optional(),
9318
+ unverifiable: z16.literal(true).optional(),
9214
9319
  /** #6115: present only when the seat answered elsewhere than assigned. */
9215
- fallback: z15.object({
9216
- fromCli: z15.string().max(100),
9217
- fromModel: z15.string().max(100).optional(),
9218
- reason: z15.enum(["rate-limit", "capacity", "auth", "timeout", "sandbox", "unknown"])
9320
+ fallback: z16.object({
9321
+ fromCli: z16.string().max(100),
9322
+ fromModel: z16.string().max(100).optional(),
9323
+ reason: z16.enum(["rate-limit", "capacity", "auth", "timeout", "sandbox", "unknown"])
9219
9324
  }).optional(),
9220
- modelUsed: z15.string().max(100).optional(),
9221
- rejectionCategories: z15.array(
9222
- z15.enum([
9325
+ modelUsed: z16.string().max(100).optional(),
9326
+ rejectionCategories: z16.array(
9327
+ z16.enum([
9223
9328
  "YAGNI",
9224
9329
  "DRY_VIOLATION",
9225
9330
  "OVER_ENGINEERING",
@@ -9232,48 +9337,48 @@ var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
9232
9337
  })
9233
9338
  ).optional(),
9234
9339
  threshold: VoteThresholdSchema.optional(),
9235
- durationMs: z15.number().optional(),
9236
- simulateVotes: z15.boolean().optional(),
9340
+ durationMs: z16.number().optional(),
9341
+ simulateVotes: z16.boolean().optional(),
9237
9342
  // #6110: the project the panel judged and how the name was decided. Always
9238
9343
  // on the response; optional here like every field, because the async
9239
9344
  // `pending` envelope shares this schema.
9240
- project: z15.object({
9241
- name: z15.string().max(200),
9242
- source: z15.enum(["input", "derived", "default"])
9345
+ project: z16.object({
9346
+ name: z16.string().max(200),
9347
+ source: z16.enum(["input", "derived", "default"])
9243
9348
  }).optional(),
9244
- higherOrderMetadata: z15.object({
9245
- posteriorApproval: z15.number(),
9246
- posteriorRejection: z15.number(),
9247
- effectiveVoteCount: z15.number(),
9248
- method: z15.enum(["ow", "isp", "simple"]),
9249
- usedCorrelationData: z15.boolean(),
9250
- improvementOverBaseline: z15.number(),
9251
- downweightedAgents: z15.array(z15.string().max(100)).max(10),
9252
- reasoning: z15.string().max(2e3)
9349
+ higherOrderMetadata: z16.object({
9350
+ posteriorApproval: z16.number(),
9351
+ posteriorRejection: z16.number(),
9352
+ effectiveVoteCount: z16.number(),
9353
+ method: z16.enum(["ow", "isp", "simple"]),
9354
+ usedCorrelationData: z16.boolean(),
9355
+ improvementOverBaseline: z16.number(),
9356
+ downweightedAgents: z16.array(z16.string().max(100)).max(10),
9357
+ reasoning: z16.string().max(2e3)
9253
9358
  }).optional(),
9254
9359
  // #3124: explains a `rejected` decision that coexists with a high
9255
9360
  // approvalPercentage (an error-policy short-circuit, e.g. fail_closed).
9256
- policyReason: z15.string().max(200).optional(),
9361
+ policyReason: z16.string().max(200).optional(),
9257
9362
  // #3991: whether the authentic vote record was persisted at vote time. Post-
9258
9363
  // #3991 it routes through nexusDataPath under governance/, so true is the
9259
9364
  // normal case; false means all-simulated (skipped by design) or write-failed
9260
9365
  // (data dir unwritable) — voteRecordNote carries the actionable reason. Makes
9261
9366
  // a previously WARN-only skip visible to MCP callers.
9262
- voteRecordPersisted: z15.boolean().optional(),
9263
- voteRecordNote: z15.string().max(500).optional(),
9367
+ voteRecordPersisted: z16.boolean().optional(),
9368
+ voteRecordNote: z16.string().max(500).optional(),
9264
9369
  // #5130: the persisted record's id, so the caller-commits script can name it.
9265
- voteRecordId: z15.string().max(200).optional(),
9370
+ voteRecordId: z16.string().max(200).optional(),
9266
9371
  // #3587: set when the panel DEGRADED (some voters errored), so the decision
9267
9372
  // rests on fewer voters than requested. Part of the response since #3587 but
9268
9373
  // omitted from this schema until #4032 — its absence made a strict MCP client
9269
9374
  // reject any degraded-panel vote (`-32602 additional properties`).
9270
- panelWarning: z15.string().optional(),
9375
+ panelWarning: z16.string().optional(),
9271
9376
  // #6115: distinct answering models and seats that answered elsewhere than
9272
9377
  // assigned. Always on the response (explicit zeros); optional here only
9273
9378
  // because the async `pending` envelope shares this schema.
9274
- panelDiversity: z15.object({
9275
- distinctModels: z15.number().int().nonnegative(),
9276
- fallbacks: z15.number().int().nonnegative()
9379
+ panelDiversity: z16.object({
9380
+ distinctModels: z16.number().int().nonnegative(),
9381
+ fallbacks: z16.number().int().nonnegative()
9277
9382
  }).optional(),
9278
9383
  // #3855: per-decision cost rollup. Same omission as panelWarning (#4032) — it
9279
9384
  // is present on the response whenever cost recording succeeds (common in `api`
@@ -9282,18 +9387,18 @@ var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
9282
9387
  // #4472: declared-option outcome. Present whenever the proposal declared
9283
9388
  // `options`. `unattributedApprovals` is part of the contract, not telemetry:
9284
9389
  // without it a caller cannot tell a real split from unreadable responses.
9285
- optionOutcome: z15.object({
9286
- tally: z15.array(z15.object({ option: z15.string(), count: z15.number().int().nonnegative() })),
9287
- leadingOption: z15.string().optional(),
9288
- leadingShare: z15.number().min(0).max(1),
9289
- approverCount: z15.number().int().nonnegative(),
9290
- selectedCount: z15.number().int().nonnegative(),
9291
- unattributedApprovals: z15.number().int().nonnegative(),
9292
- thresholdMet: z15.boolean(),
9390
+ optionOutcome: z16.object({
9391
+ tally: z16.array(z16.object({ option: z16.string(), count: z16.number().int().nonnegative() })),
9392
+ leadingOption: z16.string().optional(),
9393
+ leadingShare: z16.number().min(0).max(1),
9394
+ approverCount: z16.number().int().nonnegative(),
9395
+ selectedCount: z16.number().int().nonnegative(),
9396
+ unattributedApprovals: z16.number().int().nonnegative(),
9397
+ thresholdMet: z16.boolean(),
9293
9398
  // #4529: present only on a veto. Declared here because a strict MCP
9294
9399
  // client rejects any property the advertised schema omits — the same
9295
9400
  // drift that made degraded-panel votes unusable before #4032.
9296
- vetoReason: z15.string().max(400).optional()
9401
+ vetoReason: z16.string().max(400).optional()
9297
9402
  }).optional()
9298
9403
  };
9299
9404
  var CONSENSUS_VOTE_TOOL_SCHEMA = ConsensusVoteInputSchema.shape;
@@ -9438,4 +9543,4 @@ export {
9438
9543
  CONSENSUS_VOTE_TOOL_SCHEMA,
9439
9544
  registerConsensusVoteTool
9440
9545
  };
9441
- //# sourceMappingURL=chunk-OHBE6HR2.js.map
9546
+ //# sourceMappingURL=chunk-JM7Z4XKP.js.map