nexus-agents 8.22.2 → 8.22.4

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 (130) hide show
  1. package/dist/{ast-rule-runner-UMOL7AO3.js → ast-rule-runner-G6IOGUCV.js} +3 -3
  2. package/dist/{child-mcp-config-7DNOX3U3.js → child-mcp-config-GDTLUXGR.js} +2 -2
  3. package/dist/{chunk-XS423Y73.js → chunk-22EEMQUS.js} +2 -2
  4. package/dist/{chunk-2RUDLEIT.js → chunk-3GFNNZTS.js} +12 -14
  5. package/dist/chunk-3GFNNZTS.js.map +1 -0
  6. package/dist/{chunk-DW3RU6GC.js → chunk-3VBOYUPH.js} +2 -2
  7. package/dist/{chunk-P3WRF3A7.js → chunk-4E6T32D3.js} +2 -2
  8. package/dist/{chunk-JNCOVP77.js → chunk-4O7NQB46.js} +4 -4
  9. package/dist/{chunk-6IOI5SK3.js → chunk-4XBYQAED.js} +2 -2
  10. package/dist/chunk-5HAGSY6E.js +14 -0
  11. package/dist/chunk-5HAGSY6E.js.map +1 -0
  12. package/dist/{chunk-NG7T6DN5.js → chunk-5O5FKZUU.js} +3 -3
  13. package/dist/{chunk-OPWJJXZU.js → chunk-AXZJNY4F.js} +3 -3
  14. package/dist/{chunk-BAWRHK4W.js → chunk-BTZ7BKID.js} +2 -2
  15. package/dist/{chunk-R2CDVI4E.js → chunk-C2EZXKVE.js} +2 -2
  16. package/dist/{chunk-OFLMRACR.js → chunk-CHP7WNJS.js} +2 -2
  17. package/dist/{chunk-RZUYKWEY.js → chunk-CN3VAMQD.js} +7 -7
  18. package/dist/{chunk-2IJOZA75.js → chunk-GEKIA6CI.js} +2 -2
  19. package/dist/{chunk-CY6KGPAP.js → chunk-JC3O7WTI.js} +4 -4
  20. package/dist/{chunk-3J5WKA2S.js → chunk-JQS2A5MW.js} +4 -4
  21. package/dist/{chunk-ZWI54SPH.js → chunk-KAWGEKXW.js} +2 -2
  22. package/dist/{chunk-HZ3R63IV.js → chunk-KIAMP743.js} +3 -3
  23. package/dist/{chunk-QWYY5DD6.js → chunk-OUOBB5XR.js} +5 -5
  24. package/dist/{chunk-BU5LR2JJ.js → chunk-OYTRYITB.js} +2 -2
  25. package/dist/{chunk-FCIAKQNN.js → chunk-OZD3IGK6.js} +2 -2
  26. package/dist/{chunk-3R5TFUS5.js → chunk-PMO7TY2K.js} +5 -5
  27. package/dist/{chunk-HSOZPMQN.js → chunk-Q5J7PV3G.js} +2 -2
  28. package/dist/{chunk-P4QYPDTB.js → chunk-QEZGPM4S.js} +2 -2
  29. package/dist/{chunk-NNM6ZIXQ.js → chunk-QOKSFHWH.js} +3 -3
  30. package/dist/{chunk-SX5EZNPS.js → chunk-SZUUY4MP.js} +36 -36
  31. package/dist/{chunk-52QVQASD.js → chunk-TPBPFBO3.js} +16 -8
  32. package/dist/{chunk-52QVQASD.js.map → chunk-TPBPFBO3.js.map} +1 -1
  33. package/dist/{chunk-HILA36W2.js → chunk-UOKUUBJP.js} +2 -2
  34. package/dist/{chunk-V2RNDE4R.js → chunk-UWE6AN65.js} +2 -2
  35. package/dist/{chunk-KCDE6VIZ.js → chunk-V52KBX67.js} +6 -6
  36. package/dist/{chunk-SRC2TLRU.js → chunk-W5WSXEAB.js} +2 -2
  37. package/dist/{chunk-GHBR6ZG3.js → chunk-XNZHNPAX.js} +4 -4
  38. package/dist/{chunk-3MSPZLGF.js → chunk-YOT4GWJV.js} +2 -2
  39. package/dist/{chunk-BKE522YB.js → chunk-ZV4XS5LW.js} +9 -9
  40. package/dist/{cli-circuit-breaker-CWQPO6SJ.js → cli-circuit-breaker-QV5J45LJ.js} +3 -3
  41. package/dist/cli.js +205 -135
  42. package/dist/cli.js.map +1 -1
  43. package/dist/{composite-router-EVIISDZX.js → composite-router-5AAXEJI3.js} +2 -2
  44. package/dist/{consensus-vote-4Q4ZT5U7.js → consensus-vote-L6YSUPHT.js} +17 -17
  45. package/dist/{context-retriever-7KBTMNCV.js → context-retriever-GB4EC3XI.js} +8 -8
  46. package/dist/{doctor-deep-WFHCOZJY.js → doctor-deep-FDASNUC6.js} +3 -3
  47. package/dist/{doctor-live-LR2TJT45.js → doctor-live-M2A46PS3.js} +9 -9
  48. package/dist/{expert-bridge-KWVJB63Y.js → expert-bridge-M6OU7IYP.js} +4 -4
  49. package/dist/{factory-XOSRNGBJ.js → factory-NR2H2QR4.js} +5 -5
  50. package/dist/{factory-MVWNG55G.js → factory-OPVHIZ3G.js} +9 -9
  51. package/dist/{improvement-review-F7CCW4HQ.js → improvement-review-RX23MLAD.js} +6 -6
  52. package/dist/index.d.ts +1 -1
  53. package/dist/index.js +31 -31
  54. package/dist/{init-opencode-EEOVDBRF.js → init-opencode-2PVLMIJK.js} +6 -6
  55. package/dist/issue-triage-FCFX56WQ.js +17 -0
  56. package/dist/{pr-reviewer-helpers-2ZSPMIG4.js → pr-reviewer-helpers-3VQNHIXI.js} +4 -4
  57. package/dist/{registry-command-SD3YGORZ.js → registry-command-GAL4MBUA.js} +2 -2
  58. package/dist/{repo-security-plan-Z3EHJNZA.js → repo-security-plan-ZUZJEUIS.js} +3 -3
  59. package/dist/{research-helpers-synthesize-KIZIELHL.js → research-helpers-synthesize-Z2PJPIJD.js} +4 -4
  60. package/dist/{routing-memory-RRMEGPQB.js → routing-memory-N7YBCDAV.js} +2 -2
  61. package/dist/{session-memory-MMRSHXSO.js → session-memory-PRSYLZO7.js} +3 -3
  62. package/dist/{setup-config-54QMOSKC.js → setup-config-KF2VUAFU.js} +3 -3
  63. package/dist/{setup-custom-api-7CCRA6AP.js → setup-custom-api-T47OPCDE.js} +4 -4
  64. package/dist/setup-data-dir-NIV65UAR.js +29 -0
  65. package/dist/{tool-memory-YV64LYJ3.js → tool-memory-CLV7MXC4.js} +5 -5
  66. package/dist/{unified-registry-DRKRTGHZ.js → unified-registry-33QL65WE.js} +10 -10
  67. package/dist/{weather-report-PJBGR7WX.js → weather-report-VFWJVLP3.js} +2 -2
  68. package/package.json +1 -1
  69. package/dist/chunk-2RUDLEIT.js.map +0 -1
  70. package/dist/chunk-X76M44I2.js +0 -7
  71. package/dist/chunk-X76M44I2.js.map +0 -1
  72. package/dist/issue-triage-WVSJEHYI.js +0 -17
  73. package/dist/setup-data-dir-6OR7TLY6.js +0 -29
  74. /package/dist/{ast-rule-runner-UMOL7AO3.js.map → ast-rule-runner-G6IOGUCV.js.map} +0 -0
  75. /package/dist/{child-mcp-config-7DNOX3U3.js.map → child-mcp-config-GDTLUXGR.js.map} +0 -0
  76. /package/dist/{chunk-XS423Y73.js.map → chunk-22EEMQUS.js.map} +0 -0
  77. /package/dist/{chunk-DW3RU6GC.js.map → chunk-3VBOYUPH.js.map} +0 -0
  78. /package/dist/{chunk-P3WRF3A7.js.map → chunk-4E6T32D3.js.map} +0 -0
  79. /package/dist/{chunk-JNCOVP77.js.map → chunk-4O7NQB46.js.map} +0 -0
  80. /package/dist/{chunk-6IOI5SK3.js.map → chunk-4XBYQAED.js.map} +0 -0
  81. /package/dist/{chunk-NG7T6DN5.js.map → chunk-5O5FKZUU.js.map} +0 -0
  82. /package/dist/{chunk-OPWJJXZU.js.map → chunk-AXZJNY4F.js.map} +0 -0
  83. /package/dist/{chunk-BAWRHK4W.js.map → chunk-BTZ7BKID.js.map} +0 -0
  84. /package/dist/{chunk-R2CDVI4E.js.map → chunk-C2EZXKVE.js.map} +0 -0
  85. /package/dist/{chunk-OFLMRACR.js.map → chunk-CHP7WNJS.js.map} +0 -0
  86. /package/dist/{chunk-RZUYKWEY.js.map → chunk-CN3VAMQD.js.map} +0 -0
  87. /package/dist/{chunk-2IJOZA75.js.map → chunk-GEKIA6CI.js.map} +0 -0
  88. /package/dist/{chunk-CY6KGPAP.js.map → chunk-JC3O7WTI.js.map} +0 -0
  89. /package/dist/{chunk-3J5WKA2S.js.map → chunk-JQS2A5MW.js.map} +0 -0
  90. /package/dist/{chunk-ZWI54SPH.js.map → chunk-KAWGEKXW.js.map} +0 -0
  91. /package/dist/{chunk-HZ3R63IV.js.map → chunk-KIAMP743.js.map} +0 -0
  92. /package/dist/{chunk-QWYY5DD6.js.map → chunk-OUOBB5XR.js.map} +0 -0
  93. /package/dist/{chunk-BU5LR2JJ.js.map → chunk-OYTRYITB.js.map} +0 -0
  94. /package/dist/{chunk-FCIAKQNN.js.map → chunk-OZD3IGK6.js.map} +0 -0
  95. /package/dist/{chunk-3R5TFUS5.js.map → chunk-PMO7TY2K.js.map} +0 -0
  96. /package/dist/{chunk-HSOZPMQN.js.map → chunk-Q5J7PV3G.js.map} +0 -0
  97. /package/dist/{chunk-P4QYPDTB.js.map → chunk-QEZGPM4S.js.map} +0 -0
  98. /package/dist/{chunk-NNM6ZIXQ.js.map → chunk-QOKSFHWH.js.map} +0 -0
  99. /package/dist/{chunk-SX5EZNPS.js.map → chunk-SZUUY4MP.js.map} +0 -0
  100. /package/dist/{chunk-HILA36W2.js.map → chunk-UOKUUBJP.js.map} +0 -0
  101. /package/dist/{chunk-V2RNDE4R.js.map → chunk-UWE6AN65.js.map} +0 -0
  102. /package/dist/{chunk-KCDE6VIZ.js.map → chunk-V52KBX67.js.map} +0 -0
  103. /package/dist/{chunk-SRC2TLRU.js.map → chunk-W5WSXEAB.js.map} +0 -0
  104. /package/dist/{chunk-GHBR6ZG3.js.map → chunk-XNZHNPAX.js.map} +0 -0
  105. /package/dist/{chunk-3MSPZLGF.js.map → chunk-YOT4GWJV.js.map} +0 -0
  106. /package/dist/{chunk-BKE522YB.js.map → chunk-ZV4XS5LW.js.map} +0 -0
  107. /package/dist/{cli-circuit-breaker-CWQPO6SJ.js.map → cli-circuit-breaker-QV5J45LJ.js.map} +0 -0
  108. /package/dist/{composite-router-EVIISDZX.js.map → composite-router-5AAXEJI3.js.map} +0 -0
  109. /package/dist/{consensus-vote-4Q4ZT5U7.js.map → consensus-vote-L6YSUPHT.js.map} +0 -0
  110. /package/dist/{context-retriever-7KBTMNCV.js.map → context-retriever-GB4EC3XI.js.map} +0 -0
  111. /package/dist/{doctor-deep-WFHCOZJY.js.map → doctor-deep-FDASNUC6.js.map} +0 -0
  112. /package/dist/{doctor-live-LR2TJT45.js.map → doctor-live-M2A46PS3.js.map} +0 -0
  113. /package/dist/{expert-bridge-KWVJB63Y.js.map → expert-bridge-M6OU7IYP.js.map} +0 -0
  114. /package/dist/{factory-MVWNG55G.js.map → factory-NR2H2QR4.js.map} +0 -0
  115. /package/dist/{factory-XOSRNGBJ.js.map → factory-OPVHIZ3G.js.map} +0 -0
  116. /package/dist/{improvement-review-F7CCW4HQ.js.map → improvement-review-RX23MLAD.js.map} +0 -0
  117. /package/dist/{init-opencode-EEOVDBRF.js.map → init-opencode-2PVLMIJK.js.map} +0 -0
  118. /package/dist/{issue-triage-WVSJEHYI.js.map → issue-triage-FCFX56WQ.js.map} +0 -0
  119. /package/dist/{pr-reviewer-helpers-2ZSPMIG4.js.map → pr-reviewer-helpers-3VQNHIXI.js.map} +0 -0
  120. /package/dist/{registry-command-SD3YGORZ.js.map → registry-command-GAL4MBUA.js.map} +0 -0
  121. /package/dist/{repo-security-plan-Z3EHJNZA.js.map → repo-security-plan-ZUZJEUIS.js.map} +0 -0
  122. /package/dist/{research-helpers-synthesize-KIZIELHL.js.map → research-helpers-synthesize-Z2PJPIJD.js.map} +0 -0
  123. /package/dist/{routing-memory-RRMEGPQB.js.map → routing-memory-N7YBCDAV.js.map} +0 -0
  124. /package/dist/{session-memory-MMRSHXSO.js.map → session-memory-PRSYLZO7.js.map} +0 -0
  125. /package/dist/{setup-config-54QMOSKC.js.map → setup-config-KF2VUAFU.js.map} +0 -0
  126. /package/dist/{setup-custom-api-7CCRA6AP.js.map → setup-custom-api-T47OPCDE.js.map} +0 -0
  127. /package/dist/{setup-data-dir-6OR7TLY6.js.map → setup-data-dir-NIV65UAR.js.map} +0 -0
  128. /package/dist/{tool-memory-YV64LYJ3.js.map → tool-memory-CLV7MXC4.js.map} +0 -0
  129. /package/dist/{unified-registry-DRKRTGHZ.js.map → unified-registry-33QL65WE.js.map} +0 -0
  130. /package/dist/{weather-report-PJBGR7WX.js.map → weather-report-VFWJVLP3.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -23,11 +23,11 @@ import {
23
23
  parseExpertReview,
24
24
  reviewPostingBlock,
25
25
  sumFindings
26
- } from "./chunk-HZ3R63IV.js";
27
- import "./chunk-P3WRF3A7.js";
26
+ } from "./chunk-KIAMP743.js";
27
+ import "./chunk-4E6T32D3.js";
28
28
  import {
29
29
  runConfigInitSync
30
- } from "./chunk-ZWI54SPH.js";
30
+ } from "./chunk-KAWGEKXW.js";
31
31
  import {
32
32
  AuthHandler,
33
33
  CustomExpertDefinitionSchema,
@@ -157,11 +157,11 @@ import {
157
157
  validateNexusEnv,
158
158
  validateWorkflow,
159
159
  wrapInMarkdownFence
160
- } from "./chunk-SX5EZNPS.js";
161
- import "./chunk-XS423Y73.js";
160
+ } from "./chunk-SZUUY4MP.js";
161
+ import "./chunk-22EEMQUS.js";
162
162
  import "./chunk-DGWT7DXX.js";
163
163
  import "./chunk-64GMIUM5.js";
164
- import "./chunk-BAWRHK4W.js";
164
+ import "./chunk-BTZ7BKID.js";
165
165
  import {
166
166
  CATEGORY_DISPLAY_NAMES,
167
167
  DEFAULT_PR_REVIEW_CONFIG
@@ -177,14 +177,14 @@ import {
177
177
  doctorCommand,
178
178
  initDataDirectories,
179
179
  runDoctor
180
- } from "./chunk-2RUDLEIT.js";
180
+ } from "./chunk-3GFNNZTS.js";
181
181
  import {
182
182
  buildOpenAICompatAdapters,
183
183
  readOpenAICompatEnv
184
- } from "./chunk-QWYY5DD6.js";
184
+ } from "./chunk-OUOBB5XR.js";
185
185
  import {
186
186
  shutdownExpertBridge
187
- } from "./chunk-RZUYKWEY.js";
187
+ } from "./chunk-CN3VAMQD.js";
188
188
  import {
189
189
  ConsensusVoteInputSchema,
190
190
  DEFAULT_VOTE_TIMEOUT_MS,
@@ -196,18 +196,18 @@ import {
196
196
  recordAuthenticVote,
197
197
  registerConsensusVoteTool,
198
198
  toRecordDecision
199
- } from "./chunk-BKE522YB.js";
199
+ } from "./chunk-ZV4XS5LW.js";
200
200
  import {
201
201
  loadUsageEvents,
202
202
  rollupByModel
203
- } from "./chunk-P4QYPDTB.js";
203
+ } from "./chunk-QEZGPM4S.js";
204
204
  import {
205
205
  allOf,
206
206
  anyOf
207
207
  } from "./chunk-OQB3XC5O.js";
208
208
  import {
209
209
  synthesizeResearch
210
- } from "./chunk-NG7T6DN5.js";
210
+ } from "./chunk-5O5FKZUU.js";
211
211
  import {
212
212
  DRAFT_REPLY_BODY_MAX_LENGTH,
213
213
  configureUntrustedInputFirewall,
@@ -217,12 +217,12 @@ import {
217
217
  runUntrustedInputFirewall,
218
218
  validateAgentAction,
219
219
  validateCorroboration
220
- } from "./chunk-KCDE6VIZ.js";
221
- import "./chunk-6IOI5SK3.js";
220
+ } from "./chunk-V52KBX67.js";
221
+ import "./chunk-4XBYQAED.js";
222
222
  import {
223
223
  ReputationCache,
224
224
  sanitizeInput
225
- } from "./chunk-BU5LR2JJ.js";
225
+ } from "./chunk-OYTRYITB.js";
226
226
  import {
227
227
  ImprovementReviewInputSchema,
228
228
  calculateFitnessScore,
@@ -236,20 +236,22 @@ import {
236
236
  registerImprovementReviewTool,
237
237
  runImprovementReview,
238
238
  scanForSecrets
239
- } from "./chunk-OPWJJXZU.js";
239
+ } from "./chunk-AXZJNY4F.js";
240
240
  import {
241
241
  createDefaultPolicyFirewall,
242
242
  setGlobalPolicyFirewall,
243
243
  stagePolicyFirewallForRollout
244
- } from "./chunk-GHBR6ZG3.js";
244
+ } from "./chunk-XNZHNPAX.js";
245
245
  import {
246
- VERSION
247
- } from "./chunk-X76M44I2.js";
248
- import "./chunk-3MSPZLGF.js";
246
+ NODE_ENGINE_RANGE,
247
+ VERSION,
248
+ isNodeVersionSupported
249
+ } from "./chunk-5HAGSY6E.js";
250
+ import "./chunk-YOT4GWJV.js";
249
251
  import {
250
252
  createUnifiedRegistry,
251
253
  getGlobalRegistry
252
- } from "./chunk-JNCOVP77.js";
254
+ } from "./chunk-4O7NQB46.js";
253
255
  import {
254
256
  CodebaseIndexSchema,
255
257
  PaperStatusSchema,
@@ -275,26 +277,26 @@ import {
275
277
  loadSourcesRegistry,
276
278
  rankDiscoveredItems,
277
279
  saveSourcesRegistry
278
- } from "./chunk-3R5TFUS5.js";
280
+ } from "./chunk-PMO7TY2K.js";
279
281
  import {
280
282
  loadPapersRegistry,
281
283
  loadTechniquesRegistry,
282
284
  savePapersRegistry
283
- } from "./chunk-R2CDVI4E.js";
285
+ } from "./chunk-C2EZXKVE.js";
284
286
  import {
285
287
  resolveToken
286
- } from "./chunk-HILA36W2.js";
288
+ } from "./chunk-UOKUUBJP.js";
287
289
  import {
288
290
  MemoryError,
289
291
  configureToolMemory,
290
292
  shutdownToolMemory
291
- } from "./chunk-CY6KGPAP.js";
293
+ } from "./chunk-JC3O7WTI.js";
292
294
  import {
293
295
  capitalize,
294
296
  capitalizeKebab,
295
297
  truncateText
296
298
  } from "./chunk-7LP6VJRP.js";
297
- import "./chunk-SRC2TLRU.js";
299
+ import "./chunk-W5WSXEAB.js";
298
300
  import {
299
301
  BUILT_IN_EXPERTS
300
302
  } from "./chunk-43SVUIPL.js";
@@ -306,20 +308,21 @@ import {
306
308
  getAvailableClis,
307
309
  isRecord,
308
310
  probeAllClis,
309
- readSubprocessDepth
310
- } from "./chunk-52QVQASD.js";
311
- import "./chunk-DW3RU6GC.js";
311
+ readSubprocessDepth,
312
+ safeJsonParse
313
+ } from "./chunk-TPBPFBO3.js";
314
+ import "./chunk-3VBOYUPH.js";
312
315
  import {
313
316
  DEFAULTS
314
- } from "./chunk-2IJOZA75.js";
315
- import "./chunk-HSOZPMQN.js";
317
+ } from "./chunk-GEKIA6CI.js";
318
+ import "./chunk-Q5J7PV3G.js";
316
319
  import {
317
320
  nexusMkdtempSync
318
321
  } from "./chunk-DKHBIJO4.js";
319
- import "./chunk-V2RNDE4R.js";
322
+ import "./chunk-UWE6AN65.js";
320
323
  import "./chunk-QZUG667L.js";
321
- import "./chunk-OFLMRACR.js";
322
- import "./chunk-FCIAKQNN.js";
324
+ import "./chunk-CHP7WNJS.js";
325
+ import "./chunk-OZD3IGK6.js";
323
326
  import {
324
327
  API_TIMEOUTS,
325
328
  AgentCapability,
@@ -397,7 +400,7 @@ import {
397
400
  validateTimeout,
398
401
  writeEmptyLine,
399
402
  writeLine
400
- } from "./chunk-NNM6ZIXQ.js";
403
+ } from "./chunk-QOKSFHWH.js";
401
404
  import "./chunk-7WJGV5DN.js";
402
405
  import {
403
406
  applyPortableMode,
@@ -4451,7 +4454,7 @@ Provide a structured review with:
4451
4454
  * (Source: Issue #828 — Wire policy gate into production pipeline)
4452
4455
  */
4453
4456
  async postReviewToGitHub(provider, pr, result, gateDecision) {
4454
- const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-2ZSPMIG4.js");
4457
+ const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-3VQNHIXI.js");
4455
4458
  const formattedBody = formatReviewComment2(result);
4456
4459
  const body = truncateText(formattedBody, DRAFT_REPLY_BODY_MAX_LENGTH, "\u2026[review truncated]");
4457
4460
  const sources = pr.files.slice(0, 20).map((file) => ({ type: "repoFile", path: file.filename }));
@@ -10086,12 +10089,13 @@ async function handleStatusCommand(args, options) {
10086
10089
  format
10087
10090
  };
10088
10091
  const result = await getResearchStatus(statusOptions);
10089
- return formatStatusResult(result, format);
10092
+ const text = formatStatusResult(result, format);
10093
+ return result.success ? text : failure(text);
10090
10094
  }
10091
10095
  async function handleOverlapCommand(args, options) {
10092
10096
  const techniqueId = args[0];
10093
10097
  if (techniqueId === void 0 || techniqueId === "") {
10094
- return "Error: technique-id is required for overlap command";
10098
+ return failure("Error: technique-id is required for overlap command");
10095
10099
  }
10096
10100
  const format = optString(options, "format") ?? "table";
10097
10101
  const overlapOptions = {
@@ -10100,12 +10104,13 @@ async function handleOverlapCommand(args, options) {
10100
10104
  format
10101
10105
  };
10102
10106
  const result = await findOverlaps(overlapOptions);
10103
- return formatOverlapResult(result, format);
10107
+ const text = formatOverlapResult(result, format);
10108
+ return result.success ? text : failure(text);
10104
10109
  }
10105
10110
  async function handleAddCommand(args, options) {
10106
10111
  const arxivId = args[0];
10107
10112
  if (arxivId === void 0 || arxivId === "") {
10108
- return "Error: arxiv-id is required for add command";
10113
+ return failure("Error: arxiv-id is required for add command");
10109
10114
  }
10110
10115
  const topic = optString(options, "topic");
10111
10116
  const priority = optString(options, "priority");
@@ -10169,7 +10174,7 @@ function renderDiscoverResponse(response) {
10169
10174
  async function handleDiscoverCommand(args, options) {
10170
10175
  const topic = args[0] ?? optString(options, "topic");
10171
10176
  if (topic === void 0 || topic === "") {
10172
- return "Error: --topic is required for discover command";
10177
+ return failure("Error: --topic is required for discover command");
10173
10178
  }
10174
10179
  const parsed = ResearchDiscoverInputSchema.safeParse({
10175
10180
  topic,
@@ -10179,7 +10184,7 @@ async function handleDiscoverCommand(args, options) {
10179
10184
  }
10180
10185
  });
10181
10186
  if (!parsed.success) {
10182
- return `Error: ${parsed.error.issues.map((i) => i.message).join("; ")}`;
10187
+ return failure(`Error: ${parsed.error.issues.map((i) => i.message).join("; ")}`);
10183
10188
  }
10184
10189
  const logger22 = createLogger({ component: "cli-research-discover" });
10185
10190
  const response = await executeDiscovery(parsed.data, logger22);
@@ -10188,7 +10193,7 @@ async function handleDiscoverCommand(args, options) {
10188
10193
  async function handleReviewCommand(args, options) {
10189
10194
  const topic = args[0] ?? optString(options, "topic");
10190
10195
  if (topic === void 0 || topic === "") {
10191
- return "Error: --topic is required for review command";
10196
+ return failure("Error: --topic is required for review command");
10192
10197
  }
10193
10198
  const maxResults = optNumber(options, "maxResults") ?? 10;
10194
10199
  const createIssues = optBoolean(options, "createIssues");
@@ -10208,7 +10213,7 @@ async function handleSynthesizeCommand(args, options) {
10208
10213
  const topic = args[0] ?? optString(options, "topic");
10209
10214
  const result = await synthesizeResearch(topic);
10210
10215
  if (!result.ok) {
10211
- return `Error: ${result.error.message}`;
10216
+ return failure(`Error: ${result.error.message}`);
10212
10217
  }
10213
10218
  return formatSynthesisResult(result.value);
10214
10219
  }
@@ -10325,26 +10330,25 @@ var VALID_SUBCOMMANDS = [
10325
10330
  function isValidResearchSubcommand(value) {
10326
10331
  return value !== void 0 && VALID_SUBCOMMANDS.includes(value);
10327
10332
  }
10333
+ function failure(text) {
10334
+ return { text, exitCode: 1 };
10335
+ }
10328
10336
  function ok2(handler) {
10329
- return async (args, options) => ({
10330
- text: await handler(args, options),
10331
- exitCode: 0
10332
- });
10337
+ return async (args, options) => {
10338
+ const result = await handler(args, options);
10339
+ if (typeof result !== "string") return result;
10340
+ return { text: result, exitCode: result.startsWith("Error:") ? 1 : 0 };
10341
+ };
10333
10342
  }
10334
10343
  async function handleIndexCommand(args) {
10335
10344
  const indexOptions = parseResearchIndexArgs(args);
10336
10345
  const result = await researchIndexCommand(indexOptions);
10337
10346
  return { text: result.message, exitCode: result.exitCode };
10338
10347
  }
10339
- async function handleAddCommandWithExit(args, options) {
10340
- const text = await handleAddCommand(args, options);
10341
- const exitCode = text.startsWith("Error:") ? 1 : 0;
10342
- return { text, exitCode };
10343
- }
10344
10348
  var SUBCOMMAND_HANDLERS = {
10345
10349
  status: ok2(handleStatusCommand),
10346
10350
  overlap: ok2(handleOverlapCommand),
10347
- add: handleAddCommandWithExit,
10351
+ add: ok2(handleAddCommand),
10348
10352
  stats: ok2((_args, options) => handleStatsCommand(options)),
10349
10353
  refresh: ok2((_args, options) => handleRefreshCommand(options)),
10350
10354
  check: ok2(() => handleCheckCommand()),
@@ -11860,7 +11864,7 @@ function probeGrammars(register, parse6, probes = GRAMMAR_PROBES) {
11860
11864
  }
11861
11865
  async function loadGrammarModules() {
11862
11866
  const [{ ensurePolyglotLangs }, napi] = await Promise.all([
11863
- import("./ast-rule-runner-UMOL7AO3.js"),
11867
+ import("./ast-rule-runner-G6IOGUCV.js"),
11864
11868
  import("@ast-grep/napi")
11865
11869
  ]);
11866
11870
  return { register: ensurePolyglotLangs, parse: napi.parse };
@@ -11882,26 +11886,18 @@ async function checkNativeGrammars(load = loadGrammarModules) {
11882
11886
  // src/cli/verify-command.ts
11883
11887
  function checkNodeVersion() {
11884
11888
  const version = process.version;
11885
- const major = parseInt(version.slice(1).split(".")[0] ?? "0", 10);
11886
- if (major >= 22) {
11887
- return {
11888
- name: "Node.js Version",
11889
- passed: true,
11890
- message: `${version} (LTS)`
11891
- };
11892
- }
11893
- if (major >= 18) {
11889
+ if (isNodeVersionSupported(version)) {
11894
11890
  return {
11895
11891
  name: "Node.js Version",
11896
11892
  passed: true,
11897
- message: `${version} (supported, recommend 22.x LTS)`
11893
+ message: `${version} (supported)`
11898
11894
  };
11899
11895
  }
11900
11896
  return {
11901
11897
  name: "Node.js Version",
11902
11898
  passed: false,
11903
- message: `${version} (unsupported)`,
11904
- fix: "Install Node.js 22.x LTS from https://nodejs.org"
11899
+ message: `${version} (unsupported; requires Node.js ${NODE_ENGINE_RANGE})`,
11900
+ fix: `Install Node.js ${NODE_ENGINE_RANGE} from https://nodejs.org`
11905
11901
  };
11906
11902
  }
11907
11903
  function checkPackageExports() {
@@ -16882,6 +16878,7 @@ import { readFileSync as readFileSync12 } from "node:fs";
16882
16878
  // src/cli/release-validate-helpers.ts
16883
16879
  import { execSync as execSync5 } from "node:child_process";
16884
16880
  import { existsSync as existsSync15, readFileSync as readFileSync11 } from "node:fs";
16881
+ import { z as z9 } from "zod";
16885
16882
 
16886
16883
  // src/cli/release-secret-scan.ts
16887
16884
  import { execSync as execSync4 } from "node:child_process";
@@ -16905,24 +16902,77 @@ function scanRecentCommitsForSecrets(options = {}) {
16905
16902
  }
16906
16903
 
16907
16904
  // src/cli/release-validate-helpers.ts
16908
- async function validateSecurity(options) {
16909
- const startTime = Date.now();
16910
- const findings = [];
16905
+ var NPM_AUDIT_REPORT_SCHEMA = z9.object({
16906
+ metadata: z9.object({
16907
+ vulnerabilities: z9.object({
16908
+ moderate: z9.number().int().nonnegative(),
16909
+ high: z9.number().int().nonnegative(),
16910
+ critical: z9.number().int().nonnegative()
16911
+ })
16912
+ })
16913
+ });
16914
+ function parseNpmAuditCounts(output2) {
16915
+ const parsed = NPM_AUDIT_REPORT_SCHEMA.safeParse(safeJsonParse(output2));
16916
+ return parsed.success ? parsed.data.metadata.vulnerabilities : void 0;
16917
+ }
16918
+ function createNpmAuditFinding(counts) {
16919
+ const severeCounts = [
16920
+ ...counts.high > 0 ? [`${String(counts.high)} high`] : [],
16921
+ ...counts.critical > 0 ? [`${String(counts.critical)} critical`] : []
16922
+ ];
16923
+ if (severeCounts.length > 0) {
16924
+ return {
16925
+ severity: "error",
16926
+ category: "security",
16927
+ title: `npm audit found ${severeCounts.join(" and ")} vulnerabilities`,
16928
+ description: "npm audit reported high or critical vulnerabilities.",
16929
+ remediation: "Run npm audit fix or review and update vulnerable dependencies."
16930
+ };
16931
+ }
16932
+ if (counts.moderate === 0) return void 0;
16933
+ return {
16934
+ severity: "warning",
16935
+ category: "security",
16936
+ title: `npm audit found ${String(counts.moderate)} moderate vulnerabilities`,
16937
+ description: "npm audit reported moderate vulnerabilities.",
16938
+ remediation: "Review and update vulnerable dependencies."
16939
+ };
16940
+ }
16941
+ function unavailableNpmAuditFinding(reason) {
16942
+ return {
16943
+ severity: "error",
16944
+ category: "security",
16945
+ title: `npm audit unavailable: ${reason}`,
16946
+ description: "npm audit did not produce a valid vulnerability report.",
16947
+ remediation: "Restore npm audit availability and rerun release validation."
16948
+ };
16949
+ }
16950
+ function getErrorStdout(error) {
16951
+ if (typeof error !== "object" || error === null || !("stdout" in error)) return void 0;
16952
+ return typeof error.stdout === "string" ? error.stdout : void 0;
16953
+ }
16954
+ function runNpmAudit() {
16911
16955
  try {
16912
- execSync5("npm audit --audit-level=high 2>/dev/null", {
16956
+ const output2 = execSync5("npm audit --json --audit-level=high", {
16913
16957
  encoding: "utf-8",
16914
16958
  stdio: ["pipe", "pipe", "pipe"],
16915
16959
  timeout: CLI_SUBPROCESS_TIMEOUTS.ghCommandMs
16916
16960
  });
16917
- } catch {
16918
- findings.push({
16919
- severity: "warning",
16920
- category: "security",
16921
- title: "npm audit has findings",
16922
- description: "npm audit reported high or critical vulnerabilities.",
16923
- remediation: "Run npm audit fix or review and update vulnerable dependencies."
16924
- });
16961
+ const counts = parseNpmAuditCounts(output2);
16962
+ return counts === void 0 ? unavailableNpmAuditFinding("invalid JSON response") : createNpmAuditFinding(counts);
16963
+ } catch (error) {
16964
+ const stdout = getErrorStdout(error);
16965
+ const counts = stdout === void 0 ? void 0 : parseNpmAuditCounts(stdout);
16966
+ if (counts !== void 0) return createNpmAuditFinding(counts);
16967
+ const reason = error instanceof Error ? error.message : String(error);
16968
+ return unavailableNpmAuditFinding(reason);
16925
16969
  }
16970
+ }
16971
+ async function validateSecurity(options) {
16972
+ const startTime = Date.now();
16973
+ const findings = [];
16974
+ const auditFinding = runNpmAudit();
16975
+ if (auditFinding !== void 0) findings.push(auditFinding);
16926
16976
  if (existsSync15(".env")) {
16927
16977
  findings.push({
16928
16978
  severity: "error",
@@ -19672,7 +19722,7 @@ function startImprovementReviewScheduler(options) {
19672
19722
  let running = false;
19673
19723
  const runOnce = async () => {
19674
19724
  try {
19675
- const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-F7CCW4HQ.js");
19725
+ const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-RX23MLAD.js");
19676
19726
  const input = ImprovementReviewInputSchema2.parse({ fileIssues });
19677
19727
  const result = await runImprovementReview2(input, { logger: logger22 });
19678
19728
  logger22.info("Scheduled improvement_review complete", {
@@ -20105,8 +20155,8 @@ async function initUpstreamServers(gatewayConfig, server, logger22) {
20105
20155
  servers: upstreamServers.length,
20106
20156
  tools: tools.length
20107
20157
  });
20108
- const { z: z14 } = await import("zod");
20109
- const passthroughSchema = z14.looseObject({});
20158
+ const { z: z15 } = await import("zod");
20159
+ const passthroughSchema = z15.looseObject({});
20110
20160
  for (const tool of tools) {
20111
20161
  const toolName = tool.name;
20112
20162
  const desc = tool.description ?? `Upstream tool: ${toolName}`;
@@ -21758,7 +21808,7 @@ function adaptConfigToLibrary(config) {
21758
21808
  }
21759
21809
  function createBeliefPromoter() {
21760
21810
  return async (event) => {
21761
- const { getToolMemory } = await import("./tool-memory-YV64LYJ3.js");
21811
+ const { getToolMemory } = await import("./tool-memory-CLV7MXC4.js");
21762
21812
  const tm = getToolMemory();
21763
21813
  await tm.recordBelief(
21764
21814
  `skill:${event.name}`,
@@ -22503,7 +22553,8 @@ var RESEARCH_HELP = {
22503
22553
  ],
22504
22554
  flags: [
22505
22555
  { flag: "--format=<fmt>", description: "Output format: table, json", defaultValue: "table" },
22506
- { flag: "-o, --output=<path>", description: "Custom output path for refresh" }
22556
+ { flag: "-o, --output=<path>", description: "Custom output path for refresh" },
22557
+ { flag: "--source=<source>", description: "Discovery source for the discover subcommand" }
22507
22558
  ]
22508
22559
  };
22509
22560
  var FITNESS_AUDIT_HELP = {
@@ -22648,6 +22699,15 @@ function printResearchUsage() {
22648
22699
  process.stdout.write(" discover Discover papers/repos from external sources\n");
22649
22700
  process.stdout.write(" review Discover, score, and rank research findings\n");
22650
22701
  process.stdout.write(" prioritize Rank actionable techniques by priority\n");
22702
+ const flags = getCommandHelp("research")?.flags ?? [];
22703
+ if (flags.length > 0) {
22704
+ process.stdout.write("Options:\n");
22705
+ for (const entry of flags) {
22706
+ const suffix = entry.defaultValue === void 0 ? "" : ` (default: ${entry.defaultValue})`;
22707
+ process.stdout.write(` ${entry.flag} ${entry.description}${suffix}
22708
+ `);
22709
+ }
22710
+ }
22651
22711
  }
22652
22712
 
22653
22713
  // src/cli-command-suggester.ts
@@ -22968,6 +23028,16 @@ async function handleResearchCommand(args) {
22968
23028
  if (args.options.dryRun) {
22969
23029
  options["dryRun"] = true;
22970
23030
  }
23031
+ if (args.options.source !== void 0) {
23032
+ const source = ResearchDiscoverInputSchema.shape.source.safeParse(args.options.source);
23033
+ if (!source.success) {
23034
+ const message = `Invalid research source: ${args.options.source}`;
23035
+ process.stdout.write(`Error: ${message}
23036
+ `);
23037
+ return cliExit(EXIT_CODES.INVALID_ARGS, message);
23038
+ }
23039
+ options["source"] = source.data;
23040
+ }
22971
23041
  try {
22972
23042
  const result = await researchCommand(subcommand, positionalArgs, options);
22973
23043
  process.stdout.write(result.text + "\n");
@@ -22980,7 +23050,7 @@ async function handleResearchCommand(args) {
22980
23050
  }
22981
23051
  }
22982
23052
  async function handleRegistryCommand(args) {
22983
- const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-SD3YGORZ.js");
23053
+ const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-GAL4MBUA.js");
22984
23054
  const subcommand = args.subcommand;
22985
23055
  if (!isValidRegistrySubcommand(subcommand)) {
22986
23056
  process.stdout.write(`${formatRegistryUsage()}
@@ -23028,12 +23098,12 @@ async function handleVerifyCommand(args) {
23028
23098
  async function handleDoctorCommand(args) {
23029
23099
  const exitCode = await doctorCommand({ fix: args.options.fix });
23030
23100
  if (args.options.deep) {
23031
- const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-WFHCOZJY.js");
23101
+ const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-FDASNUC6.js");
23032
23102
  const diag = runDeepDiagnostics2();
23033
23103
  process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
23034
23104
  }
23035
23105
  if (args.options.live) {
23036
- const { runLiveReadiness, formatLiveReadiness } = await import("./doctor-live-LR2TJT45.js");
23106
+ const { runLiveReadiness, formatLiveReadiness } = await import("./doctor-live-M2A46PS3.js");
23037
23107
  const report = await runLiveReadiness();
23038
23108
  process.stdout.write(formatLiveReadiness(report) + "\n");
23039
23109
  if (report.some((r) => r.levels.serves.status === "failed")) {
@@ -23086,7 +23156,7 @@ async function runInitPortableFlow(args) {
23086
23156
  return cliExit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
23087
23157
  }
23088
23158
  async function runInitOpencodeFlow(args) {
23089
- const { runInitOpencode } = await import("./init-opencode-EEOVDBRF.js");
23159
+ const { runInitOpencode } = await import("./init-opencode-2PVLMIJK.js");
23090
23160
  const opencodePath = args.options.opencode;
23091
23161
  if (opencodePath === void 0 || opencodePath === "") {
23092
23162
  process.stderr.write("Error: --opencode requires a path argument.\n");
@@ -23112,7 +23182,7 @@ async function runInitOpencodeFlow(args) {
23112
23182
  return cliExit(EXIT_CODES.SUCCESS);
23113
23183
  }
23114
23184
  async function renderOpencodeValidate(opencodePath) {
23115
- const { runOpencodeValidate } = await import("./init-opencode-EEOVDBRF.js");
23185
+ const { runOpencodeValidate } = await import("./init-opencode-2PVLMIJK.js");
23116
23186
  const result = await runOpencodeValidate(opencodePath);
23117
23187
  if (!result.ok) {
23118
23188
  process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
@@ -23151,7 +23221,7 @@ async function handleSetupCommandAsync(args) {
23151
23221
  return cliExitFromStatus(exitCode);
23152
23222
  }
23153
23223
  async function runCustomApiSetup(args) {
23154
- const { configureCustomApi } = await import("./setup-custom-api-7CCRA6AP.js");
23224
+ const { configureCustomApi } = await import("./setup-custom-api-T47OPCDE.js");
23155
23225
  const baseUrl = args.options.customApi;
23156
23226
  if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
23157
23227
  const input = {
@@ -24591,8 +24661,8 @@ ${colors.green}${symbols.check} All thresholds passed${colors.reset}`);
24591
24661
  }
24592
24662
  writeLine5(`
24593
24663
  ${colors.red}${symbols.cross} Threshold validation failed:${colors.reset}`);
24594
- for (const failure of failures) {
24595
- writeLine5(` ${colors.red}${symbols.bullet} ${failure}${colors.reset}`);
24664
+ for (const failure2 of failures) {
24665
+ writeLine5(` ${colors.red}${symbols.bullet} ${failure2}${colors.reset}`);
24596
24666
  }
24597
24667
  return false;
24598
24668
  }
@@ -25706,7 +25776,7 @@ import { writeFile as writeFile5, mkdir as mkdir4 } from "node:fs/promises";
25706
25776
  import { join as join21, dirname as dirname9 } from "node:path";
25707
25777
 
25708
25778
  // src/mcp/tools/improvement-remediation-capability.ts
25709
- import { z as z9 } from "zod";
25779
+ import { z as z10 } from "zod";
25710
25780
  var PHASE_CAPABILITIES = {
25711
25781
  research: /* @__PURE__ */ new Set(["untrusted-input", "secrets"]),
25712
25782
  implement: /* @__PURE__ */ new Set(["repo-write", "secrets"])
@@ -25747,7 +25817,7 @@ var CapabilityLedger = class {
25747
25817
  }
25748
25818
  }
25749
25819
  };
25750
- var RemediationActionKindSchema = z9.enum([
25820
+ var RemediationActionKindSchema = z10.enum([
25751
25821
  "investigate",
25752
25822
  "adjust-routing",
25753
25823
  "add-test",
@@ -25755,17 +25825,17 @@ var RemediationActionKindSchema = z9.enum([
25755
25825
  "update-docs",
25756
25826
  "fix-bug"
25757
25827
  ]);
25758
- var RemediationStepSchema = z9.object({
25828
+ var RemediationStepSchema = z10.object({
25759
25829
  kind: RemediationActionKindSchema,
25760
- description: z9.string().min(1).max(500),
25830
+ description: z10.string().min(1).max(500),
25761
25831
  /** Optional path hint; bounded inert string, validated for traversal at use. */
25762
- targetPath: z9.string().min(1).max(300).optional()
25832
+ targetPath: z10.string().min(1).max(300).optional()
25763
25833
  }).strict();
25764
- var RemediationPlanSchema = z9.object({
25834
+ var RemediationPlanSchema = z10.object({
25765
25835
  /** Source signal key (mirrors ImprovementSignal.signalKey). */
25766
- signalKey: z9.string().min(1).max(200),
25836
+ signalKey: z10.string().min(1).max(200),
25767
25837
  /** Signal category (mirrors SignalCategory; 'tool-fitness' #3852, 'perf-regression' #3692). */
25768
- category: z9.enum([
25838
+ category: z10.enum([
25769
25839
  "routing",
25770
25840
  "tech-debt",
25771
25841
  "bug",
@@ -25774,8 +25844,8 @@ var RemediationPlanSchema = z9.object({
25774
25844
  "tool-fitness",
25775
25845
  "perf-regression"
25776
25846
  ]),
25777
- summary: z9.string().min(1).max(1e3),
25778
- steps: z9.array(RemediationStepSchema).min(1).max(20)
25847
+ summary: z10.string().min(1).max(1e3),
25848
+ steps: z10.array(RemediationStepSchema).min(1).max(20)
25779
25849
  }).strict();
25780
25850
  function parseRemediationPlan(raw) {
25781
25851
  const result = RemediationPlanSchema.safeParse(raw);
@@ -25905,25 +25975,25 @@ function makeGhPrCreator() {
25905
25975
  }
25906
25976
 
25907
25977
  // src/mcp/tools/remediation-review.ts
25908
- import { z as z10 } from "zod";
25978
+ import { z as z11 } from "zod";
25909
25979
  function soakRefOf(record) {
25910
25980
  return `${record.signalKey}::${record.timestamp}`;
25911
25981
  }
25912
- var ReviewRecordSchema = z10.object({
25982
+ var ReviewRecordSchema = z11.object({
25913
25983
  /** Reference to the reviewed soak selection (`signalKey::timestamp`). */
25914
- soakRef: z10.string(),
25984
+ soakRef: z11.string(),
25915
25985
  /** ISO-8601 time the review was recorded. */
25916
- reviewedAt: z10.string(),
25986
+ reviewedAt: z11.string(),
25917
25987
  /** Always true — a persisted record is, by construction, a review. */
25918
- reviewed: z10.literal(true),
25988
+ reviewed: z11.literal(true),
25919
25989
  /** Whether the evaluator assessed the selection SOUND. */
25920
- sound: z10.boolean(),
25990
+ sound: z11.boolean(),
25921
25991
  /** Named evaluator who performed the review (required — the gate's named-evaluator criterion). */
25922
- evaluator: z10.string().min(1),
25992
+ evaluator: z11.string().min(1),
25923
25993
  /** Named owner accepting enforcement, recorded at sign-off time (optional per record). */
25924
- owner: z10.string().min(1).optional(),
25994
+ owner: z11.string().min(1).optional(),
25925
25995
  /** Free-text note (secret-scrubbed). */
25926
- note: z10.string().optional()
25996
+ note: z11.string().optional()
25927
25997
  });
25928
25998
  var REVIEW_MAX_RECORDS = 1e4;
25929
25999
  function getRemediationReviewFile() {
@@ -26069,12 +26139,12 @@ import { createHash as createHash3 } from "node:crypto";
26069
26139
  import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync11, rmSync as rmSync2, realpathSync as realpathSync2 } from "node:fs";
26070
26140
  import { dirname as dirname11, join as join22 } from "node:path";
26071
26141
  import { execFileSync as execFileSync5 } from "node:child_process";
26072
- import { z as z12 } from "zod";
26142
+ import { z as z13 } from "zod";
26073
26143
 
26074
26144
  // src/mcp/tools/codepr-guards.ts
26075
26145
  import { realpathSync } from "node:fs";
26076
26146
  import { isAbsolute as isAbsolute3, resolve as resolve13, relative as relative4, sep as sep3, dirname as dirname10, basename as basename5 } from "node:path";
26077
- import { z as z11 } from "zod";
26147
+ import { z as z12 } from "zod";
26078
26148
  function deny(reason, detail) {
26079
26149
  return { ok: false, reason, detail };
26080
26150
  }
@@ -26220,11 +26290,11 @@ function classifyPath(relPath) {
26220
26290
  }
26221
26291
  return { sensitive: false };
26222
26292
  }
26223
- var BlastRadiusLimitsSchema = z11.object({
26293
+ var BlastRadiusLimitsSchema = z12.object({
26224
26294
  /** Max number of files the change may touch. Default 20. */
26225
- maxFiles: z11.number().int().positive().default(20),
26295
+ maxFiles: z12.number().int().positive().default(20),
26226
26296
  /** Max total changed lines (added + removed across all files). Default 400. */
26227
- maxLines: z11.number().int().positive().default(400)
26297
+ maxLines: z12.number().int().positive().default(400)
26228
26298
  }).strict();
26229
26299
  var DEFAULT_BLAST_RADIUS_LIMITS = Object.freeze(
26230
26300
  BlastRadiusLimitsSchema.parse({})
@@ -26302,13 +26372,13 @@ function auditAutonomousEvent(logger22, record) {
26302
26372
  }
26303
26373
  return { ok: true };
26304
26374
  }
26305
- var ResourceBudgetLimitsSchema = z11.object({
26375
+ var ResourceBudgetLimitsSchema = z12.object({
26306
26376
  /** Wall-clock ceiling in ms. Default 600000 (10 min). */
26307
- maxWallClockMs: z11.number().int().positive().default(6e5),
26377
+ maxWallClockMs: z12.number().int().positive().default(6e5),
26308
26378
  /** Token ceiling. Default 200000. */
26309
- maxTokens: z11.number().int().positive().default(2e5),
26379
+ maxTokens: z12.number().int().positive().default(2e5),
26310
26380
  /** Tool-call ceiling. Default 200. */
26311
- maxToolCalls: z11.number().int().positive().default(200)
26381
+ maxToolCalls: z12.number().int().positive().default(200)
26312
26382
  }).strict();
26313
26383
  var DEFAULT_RESOURCE_BUDGET_LIMITS = Object.freeze(
26314
26384
  ResourceBudgetLimitsSchema.parse({})
@@ -26368,19 +26438,19 @@ function runGuard(name, fn) {
26368
26438
  }
26369
26439
 
26370
26440
  // src/mcp/tools/codepr-orchestrator.ts
26371
- var ProposedChangeSchema = z12.object({
26441
+ var ProposedChangeSchema = z13.object({
26372
26442
  /** Repo-relative path the change would write. */
26373
- relPath: z12.string().min(1),
26443
+ relPath: z13.string().min(1),
26374
26444
  /** The full new file content. */
26375
- newContent: z12.string()
26445
+ newContent: z13.string()
26376
26446
  }).strict();
26377
- var CodePrRunInputSchema = z12.object({
26447
+ var CodePrRunInputSchema = z13.object({
26378
26448
  /** Correlates all audit events for this run. */
26379
- runId: z12.string().min(1),
26449
+ runId: z13.string().min(1),
26380
26450
  /** Hash of the source signal (fitness/improvement) that triggered the run. */
26381
- sourceSignalHash: z12.string().min(1),
26451
+ sourceSignalHash: z13.string().min(1),
26382
26452
  /** The proposed change set. */
26383
- changes: z12.array(ProposedChangeSchema).min(1)
26453
+ changes: z13.array(ProposedChangeSchema).min(1)
26384
26454
  }).strict();
26385
26455
  var ORCHESTRATOR_USAGE_ZERO = { wallClockMs: 0, tokens: 0, toolCalls: 0 };
26386
26456
  function sha256(s) {
@@ -26591,20 +26661,20 @@ function planCodePrRun(input, logger22, options = {}) {
26591
26661
  }
26592
26662
 
26593
26663
  // src/mcp/tools/codepr-soak-store.ts
26594
- import { z as z13 } from "zod";
26595
- var CodePrSoakRecordSchema = z13.object({
26664
+ import { z as z14 } from "zod";
26665
+ var CodePrSoakRecordSchema = z14.object({
26596
26666
  /** ISO-8601 capture time. */
26597
- timestamp: z13.string(),
26667
+ timestamp: z14.string(),
26598
26668
  /** Correlates the data point to the dry-run's orchestrator runId. */
26599
- runId: z13.string(),
26669
+ runId: z14.string(),
26600
26670
  /** The improvement signal's stable key that triggered the dry-run. */
26601
- signalKey: z13.string(),
26671
+ signalKey: z14.string(),
26602
26672
  /** True when the dry-run plan succeeded with ZERO guard denial. */
26603
- green: z13.boolean(),
26673
+ green: z14.boolean(),
26604
26674
  /** The guard denial reason when `green` is false; omitted for a green plan. */
26605
- denialReason: z13.string().optional(),
26675
+ denialReason: z14.string().optional(),
26606
26676
  /** Files the dry-run plan touched (0 on denial before the diff was realized). */
26607
- filesTouched: z13.number().int().nonnegative()
26677
+ filesTouched: z14.number().int().nonnegative()
26608
26678
  }).strict();
26609
26679
  var CODEPR_SOAK_MAX_RECORDS = 1e4;
26610
26680
  function getCodePrSoakFile() {