nexus-agents 7.0.2 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/dist/{child-mcp-config-ORXLS5HP.js → child-mcp-config-IPF4QIVB.js} +7 -7
  2. package/dist/chunk-227USJYZ.js +7 -0
  3. package/dist/{chunk-UVO673OY.js → chunk-2XXKUAQS.js} +3 -3
  4. package/dist/{chunk-Y742U2YM.js → chunk-3MBGQAO2.js} +124 -104
  5. package/dist/chunk-3MBGQAO2.js.map +1 -0
  6. package/dist/{chunk-4OW67KT2.js → chunk-4HXPNLZS.js} +6 -6
  7. package/dist/{chunk-W4Q5NZYZ.js → chunk-4QHAMZLU.js} +3 -3
  8. package/dist/{chunk-7U7HAYPB.js → chunk-4U62WRPL.js} +25 -59
  9. package/dist/chunk-4U62WRPL.js.map +1 -0
  10. package/dist/{chunk-AGFXJUTS.js → chunk-4VZ5GK5B.js} +14 -14
  11. package/dist/{chunk-XZEYSIGG.js → chunk-5YC3SC34.js} +4 -4
  12. package/dist/{chunk-RSMG2DPB.js → chunk-64GMIUM5.js} +5 -5
  13. package/dist/{chunk-RBF64DXJ.js → chunk-6LDUEA4I.js} +5 -5
  14. package/dist/{chunk-3CGUPSBW.js → chunk-6MPT2NRF.js} +2 -2
  15. package/dist/{chunk-33FI7W3G.js → chunk-7RLFZ6OB.js} +3 -3
  16. package/dist/{chunk-KJWD2V4K.js → chunk-CCRTVIXF.js} +7 -7
  17. package/dist/{chunk-HFOQKCD2.js → chunk-DGWT7DXX.js} +3 -3
  18. package/dist/{chunk-HFOQKCD2.js.map → chunk-DGWT7DXX.js.map} +1 -1
  19. package/dist/{chunk-XREG2HTQ.js → chunk-EWKBHDAU.js} +4 -4
  20. package/dist/{chunk-QAHGHWC7.js → chunk-F33RCSOC.js} +23 -23
  21. package/dist/{chunk-D6TL5GZV.js → chunk-F4AT3BCP.js} +5 -5
  22. package/dist/{chunk-Q6IODDEA.js → chunk-FBVOBOHS.js} +12 -12
  23. package/dist/{chunk-Q6IODDEA.js.map → chunk-FBVOBOHS.js.map} +1 -1
  24. package/dist/{chunk-LVYRGNOC.js → chunk-FFZNRJ5Q.js} +2 -2
  25. package/dist/{chunk-Y5GYBP52.js → chunk-FKWMYLSZ.js} +4 -4
  26. package/dist/{chunk-KUYKSKPV.js → chunk-GHIHBN4J.js} +214 -219
  27. package/dist/chunk-GHIHBN4J.js.map +1 -0
  28. package/dist/{chunk-JNZ3D5B5.js → chunk-HBHTXBA4.js} +4 -4
  29. package/dist/{chunk-RLBJTZHA.js → chunk-HS43MFL4.js} +2 -2
  30. package/dist/{chunk-GAYSJGKD.js → chunk-INNWBLE4.js} +13 -13
  31. package/dist/{chunk-GBHJ37V3.js → chunk-ITCKXMOH.js} +4 -4
  32. package/dist/{chunk-K2AWJGQO.js → chunk-K6EHC227.js} +8 -8
  33. package/dist/{chunk-JJT7NVNY.js → chunk-LTTUQNP2.js} +4 -4
  34. package/dist/{chunk-OGHEKPLD.js → chunk-MM223CVS.js} +10 -10
  35. package/dist/{chunk-JEAKVUWM.js → chunk-ODBLHHTP.js} +3 -3
  36. package/dist/{chunk-6GYTTWNM.js → chunk-OM5BVTVF.js} +2 -2
  37. package/dist/{chunk-IWTK6FDT.js → chunk-QP423I4T.js} +4 -4
  38. package/dist/{chunk-WLIXCNZ6.js → chunk-RB3X45G5.js} +24 -24
  39. package/dist/chunk-RB3X45G5.js.map +1 -0
  40. package/dist/{chunk-VVXHIUFQ.js → chunk-T7XKLZPC.js} +6 -6
  41. package/dist/{chunk-ZGEDIKAM.js → chunk-TO5LX5VU.js} +4 -4
  42. package/dist/{chunk-6Q3KSZVI.js → chunk-U5YJKJK2.js} +2 -2
  43. package/dist/{chunk-BTWKDT4F.js → chunk-UZULX2DZ.js} +20 -20
  44. package/dist/{chunk-OHULIRP6.js → chunk-VMMMRHCW.js} +19 -19
  45. package/dist/{chunk-S2Z7CME3.js → chunk-W2R6UVZJ.js} +2 -2
  46. package/dist/{chunk-ZD4VEHEG.js → chunk-Y5I3F3YC.js} +2 -2
  47. package/dist/{chunk-KSQSWEFH.js → chunk-YYJFZ7TO.js} +26 -11
  48. package/dist/chunk-YYJFZ7TO.js.map +1 -0
  49. package/dist/{chunk-VYAXMVI5.js → chunk-ZYPEHPRM.js} +5 -5
  50. package/dist/{chunk-VYAXMVI5.js.map → chunk-ZYPEHPRM.js.map} +1 -1
  51. package/dist/{cli-circuit-breaker-5FYJDS5O.js → cli-circuit-breaker-KRIR74SW.js} +5 -5
  52. package/dist/cli.js +378 -379
  53. package/dist/cli.js.map +1 -1
  54. package/dist/{codebase-search-RHBGEWXK.js → codebase-search-3D4TW3KR.js} +2 -2
  55. package/dist/{composite-router-GE24MYPP.js → composite-router-VTPCCQQU.js} +4 -4
  56. package/dist/{consensus-vote-62FAN4ZN.js → consensus-vote-6MHOJFIA.js} +22 -22
  57. package/dist/{context-retriever-3OO6N4V6.js → context-retriever-ASWO5E6N.js} +12 -12
  58. package/dist/{dist-IKZ53APZ.js → dist-TJCQ3JLP.js} +2 -2
  59. package/dist/doctor-deep-WLVSUPFA.js +13 -0
  60. package/dist/{doctor-live-J7JIZH3T.js → doctor-live-5L4RI4GW.js} +13 -13
  61. package/dist/{expert-bridge-PWRVRFDG.js → expert-bridge-K4FSDGPL.js} +6 -6
  62. package/dist/factory-DQWPXJHP.js +15 -0
  63. package/dist/factory-X4PUAG26.js +25 -0
  64. package/dist/{improvement-review-QUU5HR7Z.js → improvement-review-UV42QAVL.js} +8 -8
  65. package/dist/index.d.ts +58 -56
  66. package/dist/index.js +65 -76
  67. package/dist/index.js.map +1 -1
  68. package/dist/{init-opencode-GDPE4U65.js → init-opencode-73YZUQQX.js} +10 -10
  69. package/dist/issue-triage-ATDH5B5W.js +17 -0
  70. package/dist/{learning-persistence-7O5QYDM7.js → learning-persistence-7N5SZHNX.js} +3 -3
  71. package/dist/{pr-reviewer-helpers-KBOP72XG.js → pr-reviewer-helpers-XRAYFBTQ.js} +6 -6
  72. package/dist/{registry-command-ZK4NQ2MX.js → registry-command-O7TLGMNL.js} +7 -7
  73. package/dist/{repo-analyze-UJOWFGNM.js → repo-analyze-DI65XOTQ.js} +2 -2
  74. package/dist/{repo-security-plan-SZU4O2TN.js → repo-security-plan-OAOLRK5Z.js} +6 -6
  75. package/dist/research-helpers-synthesize-J66KQW2N.js +14 -0
  76. package/dist/{routing-memory-2SMMUPTB.js → routing-memory-TLALXQEY.js} +4 -4
  77. package/dist/{session-memory-YQQVPLKM.js → session-memory-DMXEXMOD.js} +5 -5
  78. package/dist/setup-config-THXHCRSH.js +11 -0
  79. package/dist/{setup-custom-api-ZSBUIJID.js → setup-custom-api-EETAAEAD.js} +7 -7
  80. package/dist/setup-data-dir-SBZB5KMI.js +29 -0
  81. package/dist/tool-memory-RSRUWJFE.js +22 -0
  82. package/dist/tool-memory-registry-adapters-PCOYMYRF.js +12 -0
  83. package/dist/unified-registry-OHYTMXKA.js +26 -0
  84. package/dist/{weather-report-6AVPMHHM.js → weather-report-R5NAYRQK.js} +4 -4
  85. package/package.json +4 -8
  86. package/dist/chunk-37JIYDVH.js +0 -7
  87. package/dist/chunk-7U7HAYPB.js.map +0 -1
  88. package/dist/chunk-KSQSWEFH.js.map +0 -1
  89. package/dist/chunk-KUYKSKPV.js.map +0 -1
  90. package/dist/chunk-WLIXCNZ6.js.map +0 -1
  91. package/dist/chunk-Y742U2YM.js.map +0 -1
  92. package/dist/doctor-deep-6WHVRRVQ.js +0 -13
  93. package/dist/factory-3BZDQQYM.js +0 -25
  94. package/dist/factory-UFKRSADE.js +0 -15
  95. package/dist/issue-triage-2LNYGQRJ.js +0 -17
  96. package/dist/research-helpers-synthesize-QY3DDHTD.js +0 -14
  97. package/dist/setup-config-LMZE4IRV.js +0 -11
  98. package/dist/setup-data-dir-ZEH7TFA6.js +0 -29
  99. package/dist/tool-memory-GUPG2M25.js +0 -22
  100. package/dist/tool-memory-registry-adapters-IMRSOAAV.js +0 -12
  101. package/dist/unified-registry-RPT4O3XB.js +0 -26
  102. package/scripts/postinstall.js +0 -12
  103. /package/dist/{child-mcp-config-ORXLS5HP.js.map → child-mcp-config-IPF4QIVB.js.map} +0 -0
  104. /package/dist/{chunk-37JIYDVH.js.map → chunk-227USJYZ.js.map} +0 -0
  105. /package/dist/{chunk-UVO673OY.js.map → chunk-2XXKUAQS.js.map} +0 -0
  106. /package/dist/{chunk-4OW67KT2.js.map → chunk-4HXPNLZS.js.map} +0 -0
  107. /package/dist/{chunk-W4Q5NZYZ.js.map → chunk-4QHAMZLU.js.map} +0 -0
  108. /package/dist/{chunk-AGFXJUTS.js.map → chunk-4VZ5GK5B.js.map} +0 -0
  109. /package/dist/{chunk-XZEYSIGG.js.map → chunk-5YC3SC34.js.map} +0 -0
  110. /package/dist/{chunk-RSMG2DPB.js.map → chunk-64GMIUM5.js.map} +0 -0
  111. /package/dist/{chunk-RBF64DXJ.js.map → chunk-6LDUEA4I.js.map} +0 -0
  112. /package/dist/{chunk-3CGUPSBW.js.map → chunk-6MPT2NRF.js.map} +0 -0
  113. /package/dist/{chunk-33FI7W3G.js.map → chunk-7RLFZ6OB.js.map} +0 -0
  114. /package/dist/{chunk-KJWD2V4K.js.map → chunk-CCRTVIXF.js.map} +0 -0
  115. /package/dist/{chunk-XREG2HTQ.js.map → chunk-EWKBHDAU.js.map} +0 -0
  116. /package/dist/{chunk-QAHGHWC7.js.map → chunk-F33RCSOC.js.map} +0 -0
  117. /package/dist/{chunk-D6TL5GZV.js.map → chunk-F4AT3BCP.js.map} +0 -0
  118. /package/dist/{chunk-LVYRGNOC.js.map → chunk-FFZNRJ5Q.js.map} +0 -0
  119. /package/dist/{chunk-Y5GYBP52.js.map → chunk-FKWMYLSZ.js.map} +0 -0
  120. /package/dist/{chunk-JNZ3D5B5.js.map → chunk-HBHTXBA4.js.map} +0 -0
  121. /package/dist/{chunk-RLBJTZHA.js.map → chunk-HS43MFL4.js.map} +0 -0
  122. /package/dist/{chunk-GAYSJGKD.js.map → chunk-INNWBLE4.js.map} +0 -0
  123. /package/dist/{chunk-GBHJ37V3.js.map → chunk-ITCKXMOH.js.map} +0 -0
  124. /package/dist/{chunk-K2AWJGQO.js.map → chunk-K6EHC227.js.map} +0 -0
  125. /package/dist/{chunk-JJT7NVNY.js.map → chunk-LTTUQNP2.js.map} +0 -0
  126. /package/dist/{chunk-OGHEKPLD.js.map → chunk-MM223CVS.js.map} +0 -0
  127. /package/dist/{chunk-JEAKVUWM.js.map → chunk-ODBLHHTP.js.map} +0 -0
  128. /package/dist/{chunk-6GYTTWNM.js.map → chunk-OM5BVTVF.js.map} +0 -0
  129. /package/dist/{chunk-IWTK6FDT.js.map → chunk-QP423I4T.js.map} +0 -0
  130. /package/dist/{chunk-VVXHIUFQ.js.map → chunk-T7XKLZPC.js.map} +0 -0
  131. /package/dist/{chunk-ZGEDIKAM.js.map → chunk-TO5LX5VU.js.map} +0 -0
  132. /package/dist/{chunk-6Q3KSZVI.js.map → chunk-U5YJKJK2.js.map} +0 -0
  133. /package/dist/{chunk-BTWKDT4F.js.map → chunk-UZULX2DZ.js.map} +0 -0
  134. /package/dist/{chunk-OHULIRP6.js.map → chunk-VMMMRHCW.js.map} +0 -0
  135. /package/dist/{chunk-S2Z7CME3.js.map → chunk-W2R6UVZJ.js.map} +0 -0
  136. /package/dist/{chunk-ZD4VEHEG.js.map → chunk-Y5I3F3YC.js.map} +0 -0
  137. /package/dist/{cli-circuit-breaker-5FYJDS5O.js.map → cli-circuit-breaker-KRIR74SW.js.map} +0 -0
  138. /package/dist/{codebase-search-RHBGEWXK.js.map → codebase-search-3D4TW3KR.js.map} +0 -0
  139. /package/dist/{composite-router-GE24MYPP.js.map → composite-router-VTPCCQQU.js.map} +0 -0
  140. /package/dist/{consensus-vote-62FAN4ZN.js.map → consensus-vote-6MHOJFIA.js.map} +0 -0
  141. /package/dist/{context-retriever-3OO6N4V6.js.map → context-retriever-ASWO5E6N.js.map} +0 -0
  142. /package/dist/{dist-IKZ53APZ.js.map → dist-TJCQ3JLP.js.map} +0 -0
  143. /package/dist/{doctor-deep-6WHVRRVQ.js.map → doctor-deep-WLVSUPFA.js.map} +0 -0
  144. /package/dist/{doctor-live-J7JIZH3T.js.map → doctor-live-5L4RI4GW.js.map} +0 -0
  145. /package/dist/{expert-bridge-PWRVRFDG.js.map → expert-bridge-K4FSDGPL.js.map} +0 -0
  146. /package/dist/{factory-3BZDQQYM.js.map → factory-DQWPXJHP.js.map} +0 -0
  147. /package/dist/{factory-UFKRSADE.js.map → factory-X4PUAG26.js.map} +0 -0
  148. /package/dist/{improvement-review-QUU5HR7Z.js.map → improvement-review-UV42QAVL.js.map} +0 -0
  149. /package/dist/{init-opencode-GDPE4U65.js.map → init-opencode-73YZUQQX.js.map} +0 -0
  150. /package/dist/{issue-triage-2LNYGQRJ.js.map → issue-triage-ATDH5B5W.js.map} +0 -0
  151. /package/dist/{learning-persistence-7O5QYDM7.js.map → learning-persistence-7N5SZHNX.js.map} +0 -0
  152. /package/dist/{pr-reviewer-helpers-KBOP72XG.js.map → pr-reviewer-helpers-XRAYFBTQ.js.map} +0 -0
  153. /package/dist/{registry-command-ZK4NQ2MX.js.map → registry-command-O7TLGMNL.js.map} +0 -0
  154. /package/dist/{repo-analyze-UJOWFGNM.js.map → repo-analyze-DI65XOTQ.js.map} +0 -0
  155. /package/dist/{repo-security-plan-SZU4O2TN.js.map → repo-security-plan-OAOLRK5Z.js.map} +0 -0
  156. /package/dist/{research-helpers-synthesize-QY3DDHTD.js.map → research-helpers-synthesize-J66KQW2N.js.map} +0 -0
  157. /package/dist/{routing-memory-2SMMUPTB.js.map → routing-memory-TLALXQEY.js.map} +0 -0
  158. /package/dist/{session-memory-YQQVPLKM.js.map → session-memory-DMXEXMOD.js.map} +0 -0
  159. /package/dist/{setup-config-LMZE4IRV.js.map → setup-config-THXHCRSH.js.map} +0 -0
  160. /package/dist/{setup-custom-api-ZSBUIJID.js.map → setup-custom-api-EETAAEAD.js.map} +0 -0
  161. /package/dist/{setup-data-dir-ZEH7TFA6.js.map → setup-data-dir-SBZB5KMI.js.map} +0 -0
  162. /package/dist/{tool-memory-GUPG2M25.js.map → tool-memory-RSRUWJFE.js.map} +0 -0
  163. /package/dist/{tool-memory-registry-adapters-IMRSOAAV.js.map → tool-memory-registry-adapters-PCOYMYRF.js.map} +0 -0
  164. /package/dist/{unified-registry-RPT4O3XB.js.map → unified-registry-OHYTMXKA.js.map} +0 -0
  165. /package/dist/{weather-report-6AVPMHHM.js.map → weather-report-R5NAYRQK.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  detectCliBinary,
4
4
  detectionRecoveryHint,
5
5
  formatDetectionMessage
6
- } from "./chunk-W4Q5NZYZ.js";
6
+ } from "./chunk-4QHAMZLU.js";
7
7
  import {
8
8
  calculateConsensus,
9
9
  countByCategory,
@@ -19,11 +19,11 @@ import {
19
19
  parseFindings,
20
20
  reviewPostingBlock,
21
21
  sumFindings
22
- } from "./chunk-JJT7NVNY.js";
23
- import "./chunk-3CGUPSBW.js";
22
+ } from "./chunk-LTTUQNP2.js";
23
+ import "./chunk-6MPT2NRF.js";
24
24
  import {
25
25
  runConfigInitSync
26
- } from "./chunk-Y5GYBP52.js";
26
+ } from "./chunk-FKWMYLSZ.js";
27
27
  import {
28
28
  AuthHandler,
29
29
  CustomExpertDefinitionSchema,
@@ -153,10 +153,10 @@ import {
153
153
  validateNexusEnv,
154
154
  validateWorkflow,
155
155
  wrapInMarkdownFence
156
- } from "./chunk-KUYKSKPV.js";
157
- import "./chunk-VYAXMVI5.js";
158
- import "./chunk-HFOQKCD2.js";
159
- import "./chunk-RSMG2DPB.js";
156
+ } from "./chunk-GHIHBN4J.js";
157
+ import "./chunk-ZYPEHPRM.js";
158
+ import "./chunk-DGWT7DXX.js";
159
+ import "./chunk-64GMIUM5.js";
160
160
  import {
161
161
  CATEGORY_DISPLAY_NAMES,
162
162
  DEFAULT_PR_REVIEW_CONFIG
@@ -172,14 +172,14 @@ import {
172
172
  doctorCommand,
173
173
  initDataDirectories,
174
174
  runDoctor
175
- } from "./chunk-WLIXCNZ6.js";
175
+ } from "./chunk-RB3X45G5.js";
176
176
  import {
177
177
  buildOpenAICompatAdapters,
178
178
  readOpenAICompatEnv
179
- } from "./chunk-VVXHIUFQ.js";
179
+ } from "./chunk-T7XKLZPC.js";
180
180
  import {
181
181
  shutdownExpertBridge
182
- } from "./chunk-KJWD2V4K.js";
182
+ } from "./chunk-CCRTVIXF.js";
183
183
  import {
184
184
  ConsensusVoteInputSchema,
185
185
  DEFAULT_VOTE_TIMEOUT_MS,
@@ -191,29 +191,29 @@ import {
191
191
  recordAuthenticVote,
192
192
  registerConsensusVoteTool,
193
193
  toRecordDecision
194
- } from "./chunk-OHULIRP6.js";
194
+ } from "./chunk-VMMMRHCW.js";
195
195
  import {
196
196
  loadUsageEvents,
197
197
  rollupByModel
198
- } from "./chunk-RBF64DXJ.js";
198
+ } from "./chunk-6LDUEA4I.js";
199
199
  import {
200
200
  allOf,
201
201
  anyOf
202
202
  } from "./chunk-OQB3XC5O.js";
203
203
  import {
204
204
  synthesizeResearch
205
- } from "./chunk-UVO673OY.js";
205
+ } from "./chunk-2XXKUAQS.js";
206
206
  import {
207
207
  classifyTrust,
208
208
  createFullGitHubProvider,
209
209
  evaluatePolicy,
210
210
  parsePRUrl
211
- } from "./chunk-Q6IODDEA.js";
212
- import "./chunk-IWTK6FDT.js";
211
+ } from "./chunk-FBVOBOHS.js";
212
+ import "./chunk-QP423I4T.js";
213
213
  import {
214
214
  ReputationCache,
215
215
  sanitizeInput
216
- } from "./chunk-RLBJTZHA.js";
216
+ } from "./chunk-HS43MFL4.js";
217
217
  import {
218
218
  ImprovementReviewInputSchema,
219
219
  calculateFitnessScore,
@@ -227,20 +227,20 @@ import {
227
227
  registerImprovementReviewTool,
228
228
  runImprovementReview,
229
229
  scanForSecrets
230
- } from "./chunk-AGFXJUTS.js";
230
+ } from "./chunk-4VZ5GK5B.js";
231
231
  import {
232
232
  createDefaultPolicyFirewall,
233
233
  setGlobalPolicyFirewall,
234
234
  stagePolicyFirewallForRollout
235
- } from "./chunk-GAYSJGKD.js";
235
+ } from "./chunk-INNWBLE4.js";
236
236
  import {
237
237
  VERSION
238
- } from "./chunk-37JIYDVH.js";
239
- import "./chunk-6Q3KSZVI.js";
238
+ } from "./chunk-227USJYZ.js";
239
+ import "./chunk-U5YJKJK2.js";
240
240
  import {
241
241
  createUnifiedRegistry,
242
242
  getGlobalRegistry
243
- } from "./chunk-D6TL5GZV.js";
243
+ } from "./chunk-F4AT3BCP.js";
244
244
  import {
245
245
  CodebaseIndexSchema,
246
246
  PaperStatusSchema,
@@ -266,29 +266,29 @@ import {
266
266
  loadSourcesRegistry,
267
267
  rankDiscoveredItems,
268
268
  saveSourcesRegistry
269
- } from "./chunk-QAHGHWC7.js";
269
+ } from "./chunk-F33RCSOC.js";
270
270
  import {
271
271
  loadPapersRegistry,
272
272
  loadTechniquesRegistry,
273
273
  savePapersRegistry
274
- } from "./chunk-K2AWJGQO.js";
274
+ } from "./chunk-K6EHC227.js";
275
275
  import {
276
276
  resolveToken
277
- } from "./chunk-XZEYSIGG.js";
277
+ } from "./chunk-5YC3SC34.js";
278
278
  import {
279
279
  MemoryError,
280
280
  shutdownToolMemory
281
- } from "./chunk-7U7HAYPB.js";
281
+ } from "./chunk-4U62WRPL.js";
282
282
  import {
283
283
  capitalize,
284
284
  capitalizeKebab
285
285
  } from "./chunk-6T3EPABN.js";
286
- import "./chunk-JNZ3D5B5.js";
286
+ import "./chunk-HBHTXBA4.js";
287
287
  import {
288
288
  BUILT_IN_EXPERTS
289
289
  } from "./chunk-43SVUIPL.js";
290
- import "./chunk-JEAKVUWM.js";
291
- import "./chunk-KSQSWEFH.js";
290
+ import "./chunk-ODBLHHTP.js";
291
+ import "./chunk-YYJFZ7TO.js";
292
292
  import {
293
293
  NEXUS_SUBPROCESS_DEPTH_ENV,
294
294
  createAllAdapters,
@@ -296,19 +296,19 @@ import {
296
296
  isRecord,
297
297
  probeAllClis,
298
298
  readSubprocessDepth
299
- } from "./chunk-BTWKDT4F.js";
300
- import "./chunk-LVYRGNOC.js";
299
+ } from "./chunk-UZULX2DZ.js";
300
+ import "./chunk-FFZNRJ5Q.js";
301
301
  import {
302
302
  DEFAULTS
303
- } from "./chunk-ZD4VEHEG.js";
304
- import "./chunk-ZGEDIKAM.js";
303
+ } from "./chunk-Y5I3F3YC.js";
304
+ import "./chunk-TO5LX5VU.js";
305
305
  import {
306
306
  nexusMkdtempSync
307
- } from "./chunk-4OW67KT2.js";
308
- import "./chunk-6GYTTWNM.js";
307
+ } from "./chunk-4HXPNLZS.js";
308
+ import "./chunk-OM5BVTVF.js";
309
309
  import "./chunk-QZUG667L.js";
310
- import "./chunk-33FI7W3G.js";
311
- import "./chunk-S2Z7CME3.js";
310
+ import "./chunk-7RLFZ6OB.js";
311
+ import "./chunk-W2R6UVZJ.js";
312
312
  import {
313
313
  API_TIMEOUTS,
314
314
  AgentCapability,
@@ -368,6 +368,7 @@ import {
368
368
  logger,
369
369
  lookupInTreeCapability,
370
370
  ok,
371
+ openSqliteDatabase,
371
372
  parseBoolEnv,
372
373
  parseIntEnv,
373
374
  parseTierOverrides,
@@ -385,8 +386,8 @@ import {
385
386
  validateTimeout,
386
387
  writeEmptyLine,
387
388
  writeLine
388
- } from "./chunk-Y742U2YM.js";
389
- import "./chunk-GBHJ37V3.js";
389
+ } from "./chunk-3MBGQAO2.js";
390
+ import "./chunk-ITCKXMOH.js";
390
391
  import {
391
392
  applyPortableMode,
392
393
  detectSandbox,
@@ -397,11 +398,11 @@ import {
397
398
  nexusSharedPath,
398
399
  sessionsDbPath,
399
400
  setActiveWorkspaceRoot
400
- } from "./chunk-OGHEKPLD.js";
401
+ } from "./chunk-MM223CVS.js";
401
402
  import "./chunk-ZPWHCABL.js";
402
403
 
403
404
  // src/cli/cli-log-bootstrap.ts
404
- import { argv, env } from "process";
405
+ import { argv, env } from "node:process";
405
406
  var SERVER_COMMANDS = /* @__PURE__ */ new Set(["server"]);
406
407
  var VERBOSE_FLAGS = /* @__PURE__ */ new Set(["--verbose", "-v", "--debug"]);
407
408
  function findSubcommand(args) {
@@ -428,13 +429,33 @@ function applyCliLogDefault(args) {
428
429
  applyCliLogDefault(argv.slice(2));
429
430
  applyPortableMode();
430
431
 
432
+ // src/cli/suppress-sqlite-warning.ts
433
+ var SQLITE_WARNING_FRAGMENT = "SQLite is an experimental feature";
434
+ function suppressSqliteExperimentalWarning() {
435
+ const proc = process;
436
+ if (proc.__nexusSqliteWarningFiltered === true) return;
437
+ proc.__nexusSqliteWarningFiltered = true;
438
+ const original = process.emitWarning.bind(process);
439
+ function filtered(...args) {
440
+ const [warning, second] = args;
441
+ const message = typeof warning === "string" ? warning : warning?.message;
442
+ const name = typeof second === "string" ? second : second?.type ?? warning?.name;
443
+ if (name === "ExperimentalWarning" && message?.includes(SQLITE_WARNING_FRAGMENT) === true) {
444
+ return;
445
+ }
446
+ original(...args);
447
+ }
448
+ process.emitWarning = filtered;
449
+ }
450
+ suppressSqliteExperimentalWarning();
451
+
431
452
  // src/cli.ts
432
- import { parseArgs } from "util";
453
+ import { parseArgs } from "node:util";
433
454
 
434
455
  // src/cli/setup-gemini.ts
435
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
436
- import { join } from "path";
437
- import { homedir } from "os";
456
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
457
+ import { join } from "node:path";
458
+ import { homedir } from "node:os";
438
459
  var logger2 = createLogger({ component: "setup-gemini" });
439
460
  function detectGeminiCli() {
440
461
  return detectCliBinary("gemini");
@@ -517,9 +538,9 @@ function configureGemini(force, dryRun, scope = "user", projectRoot) {
517
538
  }
518
539
 
519
540
  // src/cli/setup-opencode.ts
520
- import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "fs";
521
- import { join as join2, resolve } from "path";
522
- import { homedir as homedir2 } from "os";
541
+ import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
542
+ import { join as join2, resolve } from "node:path";
543
+ import { homedir as homedir2 } from "node:os";
523
544
  import { parse as jsoncParse, modify, applyEdits } from "jsonc-parser";
524
545
  var logger3 = createLogger({ component: "setup-opencode" });
525
546
  function detectOpenCodeCli() {
@@ -630,7 +651,7 @@ function configureOpenCodeInner(force, dryRun, options) {
630
651
  }
631
652
 
632
653
  // src/cli/setup-codex.ts
633
- import { execFileSync } from "child_process";
654
+ import { execFileSync } from "node:child_process";
634
655
  var logger4 = createLogger({ component: "setup-codex" });
635
656
  function detectCodexCli() {
636
657
  return detectCliBinary("codex");
@@ -755,9 +776,9 @@ function helloCommand() {
755
776
  }
756
777
 
757
778
  // src/cli/config-init.ts
758
- import { existsSync as existsSync3 } from "fs";
759
- import { writeFile, mkdir } from "fs/promises";
760
- import { dirname, resolve as resolve2 } from "path";
779
+ import { existsSync as existsSync3 } from "node:fs";
780
+ import { writeFile, mkdir } from "node:fs/promises";
781
+ import { dirname, resolve as resolve2 } from "node:path";
761
782
  var DEFAULT_CONFIG_FILE = "nexus-agents.yaml";
762
783
  var DEFAULT_CONFIG_REL_PATH = `.nexus-agents/${DEFAULT_CONFIG_FILE}`;
763
784
  function qualifiesPowerful(m) {
@@ -944,8 +965,8 @@ function resolveOutputPath(output2) {
944
965
  }
945
966
  return resolve2(process.cwd(), DEFAULT_CONFIG_REL_PATH);
946
967
  }
947
- function fileExists(path18) {
948
- return existsSync3(path18);
968
+ function fileExists(path17) {
969
+ return existsSync3(path17);
949
970
  }
950
971
  async function ensureDirectory(filePath) {
951
972
  const dir = dirname(filePath);
@@ -953,9 +974,9 @@ async function ensureDirectory(filePath) {
953
974
  await mkdir(dir, { recursive: true });
954
975
  }
955
976
  }
956
- async function writeConfigFile(path18) {
957
- await ensureDirectory(path18);
958
- await writeFile(path18, renderConfigTemplate() + CONFIG_TEMPLATE_TAIL, "utf-8");
977
+ async function writeConfigFile(path17) {
978
+ await ensureDirectory(path17);
979
+ await writeFile(path17, renderConfigTemplate() + CONFIG_TEMPLATE_TAIL, "utf-8");
959
980
  }
960
981
  async function runConfigInit(options = {}) {
961
982
  const outputPath = resolveOutputPath(options.output);
@@ -1013,7 +1034,7 @@ async function configInitCommand(options = {}) {
1013
1034
  }
1014
1035
 
1015
1036
  // src/cli/custom-expert-validation.ts
1016
- import { resolve as resolve3, sep } from "path";
1037
+ import { resolve as resolve3, sep } from "node:path";
1017
1038
  function validateConfigPath(userPath, allowedRoot) {
1018
1039
  const resolvedRoot = resolve3(allowedRoot);
1019
1040
  const resolved = resolve3(allowedRoot, userPath);
@@ -1084,8 +1105,8 @@ function formatValidationErrors(errors) {
1084
1105
  }
1085
1106
 
1086
1107
  // src/cli/custom-expert-parsing.ts
1087
- import { readFileSync as readFileSync3, existsSync as existsSync4 } from "fs";
1088
- import { resolve as resolve4 } from "path";
1108
+ import { readFileSync as readFileSync3, existsSync as existsSync4 } from "node:fs";
1109
+ import { resolve as resolve4 } from "node:path";
1089
1110
  import * as yaml from "yaml";
1090
1111
  var DEFAULT_CONFIG_FILE2 = "nexus-agents.yaml";
1091
1112
  function findConfigPath() {
@@ -1408,8 +1429,8 @@ function expertListCommand(options = {}) {
1408
1429
  }
1409
1430
 
1410
1431
  // src/cli/workflow-run.ts
1411
- import fs from "fs";
1412
- import path from "path";
1432
+ import fs from "node:fs";
1433
+ import path from "node:path";
1413
1434
 
1414
1435
  // src/cli/workflow-run-formatters.ts
1415
1436
  function writeLine2(text) {
@@ -1691,7 +1712,7 @@ async function workflowRunCommand(options) {
1691
1712
  }
1692
1713
 
1693
1714
  // src/cli/repl.ts
1694
- import * as readline from "readline";
1715
+ import * as readline from "node:readline";
1695
1716
 
1696
1717
  // src/cli/repl-types.ts
1697
1718
  var HANDLED = { handled: true, exit: false };
@@ -1971,9 +1992,9 @@ async function replCommand(options = {}) {
1971
1992
  }
1972
1993
 
1973
1994
  // src/self-eval/component-scanner.ts
1974
- import { readFileSync as readFileSync4 } from "fs";
1975
- import { readdir, readFile, stat } from "fs/promises";
1976
- import { join as join3, basename, extname, relative } from "path";
1995
+ import { readFileSync as readFileSync4 } from "node:fs";
1996
+ import { readdir, readFile, stat } from "node:fs/promises";
1997
+ import { join as join3, basename, extname, relative } from "node:path";
1977
1998
  var DEFAULT_EXTENSIONS = [".ts"];
1978
1999
  var DEFAULT_MAX_FILE_SIZE = 1024 * 1024;
1979
2000
  var COMPLEXITY_PATTERNS = [
@@ -3072,9 +3093,9 @@ async function evaluateDirectory(target, timeoutMs, store = getOutcomeStore()) {
3072
3093
  }
3073
3094
  const aggregator = createAggregator();
3074
3095
  const results = [];
3075
- for (const [path18, evaluations] of evaluationsByComponent) {
3096
+ for (const [path17, evaluations] of evaluationsByComponent) {
3076
3097
  if (evaluations.length > 0) {
3077
- results.push(aggregator.aggregate(path18, evaluations));
3098
+ results.push(aggregator.aggregate(path17, evaluations));
3078
3099
  }
3079
3100
  }
3080
3101
  const priority = { deprecate: 0, refactor: 1, review: 2, retain: 3 };
@@ -4438,7 +4459,7 @@ ${file.patch}
4438
4459
  violations: policyResult.violations
4439
4460
  });
4440
4461
  }
4441
- const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-KBOP72XG.js");
4462
+ const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-XRAYFBTQ.js");
4442
4463
  const body = formatReviewComment2(result);
4443
4464
  const postResult = await provider.createReview(pr.prNumber, body, result.decision);
4444
4465
  if (!postResult.ok) {
@@ -4532,7 +4553,7 @@ function createPRReviewer(config, adapter) {
4532
4553
  var logger6 = createLogger({ component: "ReviewCommand" });
4533
4554
 
4534
4555
  // src/cli/sandbox-exec.ts
4535
- import { execSync } from "child_process";
4556
+ import { execSync } from "node:child_process";
4536
4557
  var logger7 = createLogger({ component: "sandbox-exec" });
4537
4558
  function isOpeningQuote(char, state) {
4538
4559
  return !state.inQuote && (char === '"' || char === "'");
@@ -5494,7 +5515,7 @@ function routingAuditCommand(options) {
5494
5515
  }
5495
5516
 
5496
5517
  // src/cli/orchestrate-puppeteer.ts
5497
- import * as fs2 from "fs";
5518
+ import * as fs2 from "node:fs";
5498
5519
 
5499
5520
  // src/cli/cli-adapter-agent.ts
5500
5521
  var CliAdapterAgent = class {
@@ -5552,27 +5573,27 @@ var CliAdapterAgent = class {
5552
5573
  };
5553
5574
 
5554
5575
  // src/cli/orchestrate-puppeteer.ts
5555
- function loadPolicyParameters(path18, logger22) {
5576
+ function loadPolicyParameters(path17, logger22) {
5556
5577
  try {
5557
- if (fs2.existsSync(path18)) {
5558
- const content = fs2.readFileSync(path18, "utf-8");
5578
+ if (fs2.existsSync(path17)) {
5579
+ const content = fs2.readFileSync(path17, "utf-8");
5559
5580
  const params = JSON.parse(content);
5560
- logger22.info("Loaded policy parameters", { path: path18 });
5581
+ logger22.info("Loaded policy parameters", { path: path17 });
5561
5582
  return params;
5562
5583
  }
5563
5584
  } catch (error) {
5564
5585
  const message = getErrorMessage(error);
5565
- logger22.warn("Failed to load policy parameters", { path: path18, error: message });
5586
+ logger22.warn("Failed to load policy parameters", { path: path17, error: message });
5566
5587
  }
5567
5588
  return void 0;
5568
5589
  }
5569
- function savePolicyParameters(path18, params, logger22) {
5590
+ function savePolicyParameters(path17, params, logger22) {
5570
5591
  try {
5571
- fs2.writeFileSync(path18, JSON.stringify(params, null, 2));
5572
- logger22.info("Saved policy parameters", { path: path18 });
5592
+ fs2.writeFileSync(path17, JSON.stringify(params, null, 2));
5593
+ logger22.info("Saved policy parameters", { path: path17 });
5573
5594
  } catch (error) {
5574
5595
  const message = getErrorMessage(error);
5575
- logger22.warn("Failed to save policy parameters", { path: path18, error: message });
5596
+ logger22.warn("Failed to save policy parameters", { path: path17, error: message });
5576
5597
  }
5577
5598
  }
5578
5599
  function createAgentsFromAdapters(adapters) {
@@ -5954,8 +5975,8 @@ async function orchestrateCommand(options) {
5954
5975
  }
5955
5976
 
5956
5977
  // src/cli/session-commands.ts
5957
- import * as fs3 from "fs";
5958
- import * as path2 from "path";
5978
+ import * as fs3 from "node:fs";
5979
+ import * as path2 from "node:path";
5959
5980
 
5960
5981
  // src/cli/session-storage-types.ts
5961
5982
  import { z } from "zod";
@@ -6150,25 +6171,14 @@ var SQLiteSessionStorage = class {
6150
6171
  this.logger.info("SQLiteSessionStorage initialized", { dbPath: this.dbPath });
6151
6172
  }
6152
6173
  /** Initialize the storage backend. */
6174
+ // Stays async: this is a published Promise-returning API and its callers
6175
+ // await it. The only await was the dynamic `better-sqlite3` import, which
6176
+ // #5388 removed because `node:sqlite` is a synchronous builtin.
6177
+ // eslint-disable-next-line @typescript-eslint/require-await
6153
6178
  async initialize() {
6154
6179
  if (this.initialized) return ok(void 0);
6155
6180
  try {
6156
- const betterSqlite3Module = await import("better-sqlite3").catch((error) => {
6157
- this.logger.debug("Failed to import better-sqlite3", { error: String(error) });
6158
- return null;
6159
- });
6160
- if (betterSqlite3Module === null) {
6161
- return err(
6162
- new SessionStorageError(
6163
- "better-sqlite3 not installed. Install: npm install better-sqlite3",
6164
- {
6165
- context: { dbPath: this.dbPath }
6166
- }
6167
- )
6168
- );
6169
- }
6170
- const Database = betterSqlite3Module.default;
6171
- this.db = new Database(this.dbPath);
6181
+ this.db = openSqliteDatabase(this.dbPath);
6172
6182
  this.createTables();
6173
6183
  this.initialized = true;
6174
6184
  this.logger.info("SQLiteSessionStorage initialized", { dbPath: this.dbPath });
@@ -6647,8 +6657,8 @@ async function sessionCommand(subcommand, args, logger22) {
6647
6657
  }
6648
6658
 
6649
6659
  // src/cli/system-review.ts
6650
- import * as fs5 from "fs";
6651
- import * as path4 from "path";
6660
+ import * as fs5 from "node:fs";
6661
+ import * as path4 from "node:path";
6652
6662
 
6653
6663
  // src/cli/system-review-types.ts
6654
6664
  var SYSTEM_REVIEW_CONSTANTS = {
@@ -6884,8 +6894,8 @@ ${colors.bold}Nexus Agents System Review${colors.reset}`);
6884
6894
  }
6885
6895
 
6886
6896
  // src/indexer/freshness-analyzer.ts
6887
- import * as path3 from "path";
6888
- import * as fs4 from "fs";
6897
+ import * as path3 from "node:path";
6898
+ import * as fs4 from "node:fs";
6889
6899
  var DEFAULT_TRACKED_DOCUMENTS = [
6890
6900
  {
6891
6901
  path: "README.md",
@@ -7323,7 +7333,7 @@ function systemReviewCommand(options = {}) {
7323
7333
  }
7324
7334
 
7325
7335
  // src/cli/vote-command.ts
7326
- import * as crypto from "crypto";
7336
+ import * as crypto from "node:crypto";
7327
7337
 
7328
7338
  // src/cli/vote-audit-line.ts
7329
7339
  function auditLineFor(outcome) {
@@ -8602,9 +8612,9 @@ async function executePrioritize(options) {
8602
8612
  }
8603
8613
 
8604
8614
  // src/cli/research-index-command.ts
8605
- import * as fs8 from "fs/promises";
8606
- import * as fsSync from "fs";
8607
- import * as path7 from "path";
8615
+ import * as fs8 from "node:fs/promises";
8616
+ import * as fsSync from "node:fs";
8617
+ import * as path7 from "node:path";
8608
8618
  import * as yaml3 from "yaml";
8609
8619
 
8610
8620
  // src/research/research-schemas.ts
@@ -8786,9 +8796,9 @@ function isIntegrationFileRequired(file) {
8786
8796
  }
8787
8797
 
8788
8798
  // src/research/research-index-generator.ts
8789
- import * as crypto2 from "crypto";
8790
- import * as fs6 from "fs";
8791
- import * as path5 from "path";
8799
+ import * as crypto2 from "node:crypto";
8800
+ import * as fs6 from "node:fs";
8801
+ import * as path5 from "node:path";
8792
8802
  import * as yaml2 from "yaml";
8793
8803
 
8794
8804
  // src/research/research-index-types.ts
@@ -9168,8 +9178,8 @@ var DEFAULT_VALIDATOR_OPTIONS = {
9168
9178
  };
9169
9179
 
9170
9180
  // src/research/research-validator-helpers.ts
9171
- import * as fs7 from "fs";
9172
- import * as path6 from "path";
9181
+ import * as fs7 from "node:fs";
9182
+ import * as path6 from "node:path";
9173
9183
  function createIssue2(options) {
9174
9184
  const { severity, code, message, file, issuePath, suggestion } = options;
9175
9185
  const base = { severity, code, message, file };
@@ -9694,8 +9704,8 @@ async function researchIndexCommand(options) {
9694
9704
  }
9695
9705
 
9696
9706
  // src/cli/research-import-command.ts
9697
- import * as fs9 from "fs/promises";
9698
- import { resolve as resolve6 } from "path";
9707
+ import * as fs9 from "node:fs/promises";
9708
+ import { resolve as resolve6 } from "node:path";
9699
9709
  var VALID_TYPES = ["paper", "repo", "tool", "blog"];
9700
9710
  function parseCsvLine(line) {
9701
9711
  const fields = [];
@@ -9955,8 +9965,8 @@ async function handleImportCommand(args, options) {
9955
9965
  }
9956
9966
 
9957
9967
  // src/cli/auto-file-suggestions.ts
9958
- import { execFile } from "child_process";
9959
- import { promisify } from "util";
9968
+ import { execFile } from "node:child_process";
9969
+ import { promisify } from "node:util";
9960
9970
  var execFileAsync = promisify(execFile);
9961
9971
  var logger12 = createLogger({ component: "auto-file-suggestions" });
9962
9972
  var MACHINE_SUGGESTED_LABEL = "machine-suggested";
@@ -10352,13 +10362,11 @@ async function researchCommand(subcommand, args, options) {
10352
10362
  }
10353
10363
 
10354
10364
  // src/cli/index-command.ts
10355
- import * as fs13 from "fs/promises";
10356
- import * as path14 from "path";
10365
+ import * as fs12 from "node:fs/promises";
10366
+ import * as path13 from "node:path";
10357
10367
  import * as yaml6 from "yaml";
10358
10368
 
10359
10369
  // src/indexer/generator.ts
10360
- import * as fs10 from "fs/promises";
10361
- import * as path8 from "path";
10362
10370
  import * as yaml4 from "yaml";
10363
10371
  function indexToYaml(index) {
10364
10372
  const doc = new yaml4.Document(index);
@@ -10535,7 +10543,7 @@ var DEFAULT_ENTRYPOINT_EXTRACTOR_OPTIONS = {
10535
10543
 
10536
10544
  // src/indexer/entrypoint-extractor.ts
10537
10545
  import { Project } from "ts-morph";
10538
- import * as path11 from "path";
10546
+ import * as path10 from "node:path";
10539
10547
  import * as yaml5 from "yaml";
10540
10548
 
10541
10549
  // src/indexer/entrypoint-sanitizer.ts
@@ -10632,7 +10640,7 @@ function sanitizeTool(tool) {
10632
10640
 
10633
10641
  // src/indexer/entrypoint-cli-extractor.ts
10634
10642
  import { SyntaxKind } from "ts-morph";
10635
- import * as path9 from "path";
10643
+ import * as path8 from "node:path";
10636
10644
  function extractCliOptions(sourceFile) {
10637
10645
  const options = /* @__PURE__ */ new Map();
10638
10646
  const configVar = sourceFile.getVariableDeclaration("PARSE_ARGS_CONFIG");
@@ -10748,7 +10756,7 @@ function buildCommandSpec(entry, ctx) {
10748
10756
  return cmdSpec;
10749
10757
  }
10750
10758
  function extractCliCommands(project, packageRoot, cliCommandsPath, cliTypesPath, warnings) {
10751
- const typesFullPath = path9.join(packageRoot, cliTypesPath);
10759
+ const typesFullPath = path8.join(packageRoot, cliTypesPath);
10752
10760
  const typesFile = project.getSourceFile(typesFullPath);
10753
10761
  if (typesFile === void 0 && warnings !== void 0) {
10754
10762
  warnings.push(
@@ -10756,7 +10764,7 @@ function extractCliCommands(project, packageRoot, cliCommandsPath, cliTypesPath,
10756
10764
  );
10757
10765
  }
10758
10766
  const cliOptions = typesFile !== void 0 ? extractCliOptions(typesFile) : /* @__PURE__ */ new Map();
10759
- const commandsFullPath = path9.join(packageRoot, cliCommandsPath);
10767
+ const commandsFullPath = path8.join(packageRoot, cliCommandsPath);
10760
10768
  const commandsFile = project.getSourceFile(commandsFullPath);
10761
10769
  if (commandsFile === void 0) {
10762
10770
  if (warnings !== void 0) {
@@ -10768,7 +10776,7 @@ function extractCliCommands(project, packageRoot, cliCommandsPath, cliTypesPath,
10768
10776
  }
10769
10777
  const ctx = {
10770
10778
  commandsFile,
10771
- relativePath: path9.relative(process.cwd(), commandsFullPath),
10779
+ relativePath: path8.relative(process.cwd(), commandsFullPath),
10772
10780
  cliOptions,
10773
10781
  cliCommandsPath,
10774
10782
  ...warnings !== void 0 && { warnings }
@@ -10778,7 +10786,7 @@ function extractCliCommands(project, packageRoot, cliCommandsPath, cliTypesPath,
10778
10786
 
10779
10787
  // src/indexer/entrypoint-mcp-extractor.ts
10780
10788
  import { SyntaxKind as SyntaxKind2 } from "ts-morph";
10781
- import * as path10 from "path";
10789
+ import * as path9 from "node:path";
10782
10790
  function inferZodType(zodExpr) {
10783
10791
  if (zodExpr.includes("z.string()")) return "string";
10784
10792
  if (zodExpr.includes("z.number()")) return "number";
@@ -10821,7 +10829,7 @@ function extractZodParameters(schemaObj) {
10821
10829
  }
10822
10830
  function extractMcpTools(project, packageRoot, mcpToolsPath, warnings) {
10823
10831
  const tools = [];
10824
- const toolsDir = path10.join(packageRoot, mcpToolsPath);
10832
+ const toolsDir = path9.join(packageRoot, mcpToolsPath);
10825
10833
  const toolFiles = project.getSourceFiles(`${toolsDir}/*.ts`);
10826
10834
  if (toolFiles.length === 0 && warnings !== void 0) {
10827
10835
  warnings.push(
@@ -10830,9 +10838,9 @@ function extractMcpTools(project, packageRoot, mcpToolsPath, warnings) {
10830
10838
  }
10831
10839
  for (const sourceFile of toolFiles) {
10832
10840
  const filePath = sourceFile.getFilePath();
10833
- const fileName = path10.basename(filePath);
10841
+ const fileName = path9.basename(filePath);
10834
10842
  if (fileName.endsWith(".test.ts") || fileName === "index.ts") continue;
10835
- const relativePath = path10.relative(process.cwd(), filePath);
10843
+ const relativePath = path9.relative(process.cwd(), filePath);
10836
10844
  const extractedTools = extractToolsFromFile(sourceFile, relativePath, warnings);
10837
10845
  tools.push(...extractedTools);
10838
10846
  }
@@ -10961,18 +10969,18 @@ function generateTimestamp() {
10961
10969
  }
10962
10970
  function createProject(opts) {
10963
10971
  const project = new Project({
10964
- tsConfigFilePath: path11.join(opts.packageRoot, "tsconfig.json"),
10972
+ tsConfigFilePath: path10.join(opts.packageRoot, "tsconfig.json"),
10965
10973
  skipAddingFilesFromTsConfig: true
10966
10974
  });
10967
10975
  project.addSourceFilesAtPaths([
10968
- path11.join(opts.packageRoot, opts.cliCommandsPath),
10969
- path11.join(opts.packageRoot, "src/cli-types.ts"),
10976
+ path10.join(opts.packageRoot, opts.cliCommandsPath),
10977
+ path10.join(opts.packageRoot, "src/cli-types.ts"),
10970
10978
  // HELP_TEXT was extracted to cli-help-text.ts in #293 (Jan 2026) and
10971
10979
  // cli-types.ts now only re-exports it. The extractor reads it via AST,
10972
10980
  // so we have to load the defining file — a bare re-export isn't enough.
10973
10981
  // Without this line the CLI command list silently came back empty.
10974
- path11.join(opts.packageRoot, "src/cli-help-text.ts"),
10975
- path11.join(opts.packageRoot, opts.mcpToolsPath, "*.ts")
10982
+ path10.join(opts.packageRoot, "src/cli-help-text.ts"),
10983
+ path10.join(opts.packageRoot, opts.mcpToolsPath, "*.ts")
10976
10984
  ]);
10977
10985
  return project;
10978
10986
  }
@@ -11018,20 +11026,20 @@ function manifestToJson(manifest) {
11018
11026
  }
11019
11027
 
11020
11028
  // src/cli/index-command-link-validator.ts
11021
- import * as fs12 from "fs/promises";
11022
- import * as path13 from "path";
11029
+ import * as fs11 from "node:fs/promises";
11030
+ import * as path12 from "node:path";
11023
11031
 
11024
11032
  // src/cli/index-command-link-validation-helpers.ts
11025
- import * as fs11 from "fs/promises";
11026
- import * as path12 from "path";
11033
+ import * as fs10 from "node:fs/promises";
11034
+ import * as path11 from "node:path";
11027
11035
  async function validateInternalLink(url, sourceFile) {
11028
11036
  const [filePath, anchor] = url.split("#");
11029
11037
  if (filePath === void 0 || filePath === "") {
11030
11038
  return { valid: true };
11031
11039
  }
11032
- const resolvedPath = path12.resolve(path12.dirname(sourceFile), filePath);
11040
+ const resolvedPath = path11.resolve(path11.dirname(sourceFile), filePath);
11033
11041
  try {
11034
- await fs11.access(resolvedPath);
11042
+ await fs10.access(resolvedPath);
11035
11043
  if (anchor !== void 0 && anchor !== "") {
11036
11044
  const anchorResult = await validateAnchorInFile(anchor, resolvedPath);
11037
11045
  if (!anchorResult.valid) {
@@ -11105,7 +11113,7 @@ function headingToAnchor(heading) {
11105
11113
  }
11106
11114
  async function validateAnchorInFile(anchor, targetFile) {
11107
11115
  try {
11108
- const content = await fs11.readFile(targetFile, "utf-8");
11116
+ const content = await fs10.readFile(targetFile, "utf-8");
11109
11117
  const headingRegex = /^#{1,6}\s+(.+)$/gm;
11110
11118
  let match;
11111
11119
  while ((match = headingRegex.exec(content)) !== null) {
@@ -11114,9 +11122,9 @@ async function validateAnchorInFile(anchor, targetFile) {
11114
11122
  return { valid: true };
11115
11123
  }
11116
11124
  }
11117
- return { valid: false, error: `Anchor '#${anchor}' not found in ${path12.basename(targetFile)}` };
11125
+ return { valid: false, error: `Anchor '#${anchor}' not found in ${path11.basename(targetFile)}` };
11118
11126
  } catch {
11119
- return { valid: false, error: `Failed to read ${path12.basename(targetFile)} for anchor check` };
11127
+ return { valid: false, error: `Failed to read ${path11.basename(targetFile)} for anchor check` };
11120
11128
  }
11121
11129
  }
11122
11130
  async function validateAnchorLink(anchor, sourceFile) {
@@ -11206,9 +11214,9 @@ var REFERENCE_DEF_REGEX = /^\[([^\]]+)\]:\s*(.+)$/gm;
11206
11214
  async function findMarkdownFiles(dir) {
11207
11215
  const files = [];
11208
11216
  try {
11209
- const entries = await fs12.readdir(dir, { withFileTypes: true });
11217
+ const entries = await fs11.readdir(dir, { withFileTypes: true });
11210
11218
  for (const entry of entries) {
11211
- const fullPath = path13.join(dir, entry.name);
11219
+ const fullPath = path12.join(dir, entry.name);
11212
11220
  if (entry.name === "node_modules" || entry.name === "dist") {
11213
11221
  continue;
11214
11222
  }
@@ -11302,7 +11310,7 @@ function extractLinks(content) {
11302
11310
  }
11303
11311
  async function validateFileLinks(filePath, checkExternal, counters) {
11304
11312
  try {
11305
- const content = await fs12.readFile(filePath, "utf-8");
11313
+ const content = await fs11.readFile(filePath, "utf-8");
11306
11314
  const links = extractLinks(content);
11307
11315
  const brokenLinksInFile = [];
11308
11316
  for (const link of links) {
@@ -11403,10 +11411,10 @@ async function generateIndex(options) {
11403
11411
  `Extracted ${String(extraction.files.length)} files in ${String(extraction.durationMs)}ms`
11404
11412
  );
11405
11413
  const index = buildIndex(extraction.files);
11406
- const outputDir = path14.dirname(outputPath);
11407
- await fs13.mkdir(outputDir, { recursive: true });
11414
+ const outputDir = path13.dirname(outputPath);
11415
+ await fs12.mkdir(outputDir, { recursive: true });
11408
11416
  const content = format === "yaml" ? indexToYaml(index) : indexToJson(index);
11409
- await fs13.writeFile(outputPath, content, "utf-8");
11417
+ await fs12.writeFile(outputPath, content, "utf-8");
11410
11418
  logger13.info(`Wrote index to ${outputPath}`);
11411
11419
  return {
11412
11420
  success: true,
@@ -11421,14 +11429,14 @@ async function generateIndex(options) {
11421
11429
  async function checkIndex(options) {
11422
11430
  const indexPath = options.output ?? "docs/codebase-index.yaml";
11423
11431
  try {
11424
- await fs13.access(indexPath);
11432
+ await fs12.access(indexPath);
11425
11433
  } catch {
11426
11434
  return {
11427
11435
  success: false,
11428
11436
  message: `Index file not found: ${indexPath}. Run 'nexus-agents index generate' first.`
11429
11437
  };
11430
11438
  }
11431
- const content = await fs13.readFile(indexPath, "utf-8");
11439
+ const content = await fs12.readFile(indexPath, "utf-8");
11432
11440
  let existingIndex;
11433
11441
  try {
11434
11442
  const parsed = indexPath.endsWith(".json") ? JSON.parse(content) : yaml6.parse(content);
@@ -11464,20 +11472,20 @@ async function generateDiagram(options) {
11464
11472
  const indexPath = "docs/codebase-index.yaml";
11465
11473
  const diagramPath = options.output ?? "docs/dependency-graph.md";
11466
11474
  try {
11467
- await fs13.access(indexPath);
11475
+ await fs12.access(indexPath);
11468
11476
  } catch {
11469
11477
  logger13.info("Index not found, generating...");
11470
11478
  const indexOptions = { ...options, subcommand: "generate" };
11471
11479
  delete indexOptions.output;
11472
11480
  await generateIndex(indexOptions);
11473
11481
  }
11474
- const content = await fs13.readFile(indexPath, "utf-8");
11482
+ const content = await fs12.readFile(indexPath, "utf-8");
11475
11483
  const parsed = indexPath.endsWith(".json") ? JSON.parse(content) : yaml6.parse(content);
11476
11484
  CodebaseIndexSchema.parse(parsed);
11477
11485
  const index = parsed;
11478
11486
  const diagram = generateDiagramMarkdown(index);
11479
- await fs13.mkdir(path14.dirname(diagramPath), { recursive: true });
11480
- await fs13.writeFile(diagramPath, diagram, "utf-8");
11487
+ await fs12.mkdir(path13.dirname(diagramPath), { recursive: true });
11488
+ await fs12.writeFile(diagramPath, diagram, "utf-8");
11481
11489
  logger13.info(`Wrote diagram to ${diagramPath}`);
11482
11490
  return {
11483
11491
  success: true,
@@ -11506,7 +11514,7 @@ function extractDocumentedModules(architectureContent) {
11506
11514
  }
11507
11515
  async function getActualModules(srcPath) {
11508
11516
  try {
11509
- const entries = await fs13.readdir(srcPath, { withFileTypes: true });
11517
+ const entries = await fs12.readdir(srcPath, { withFileTypes: true });
11510
11518
  return entries.filter((e) => e.isDirectory() && !e.name.startsWith(".") && !e.name.startsWith("__")).map((e) => e.name);
11511
11519
  } catch (error) {
11512
11520
  logger13.debug("Failed to read source modules", { srcPath, error: getErrorMessage(error) });
@@ -11542,12 +11550,12 @@ async function validateArchitecture(options) {
11542
11550
  const srcPath = "packages/nexus-agents/src";
11543
11551
  let architectureContent;
11544
11552
  try {
11545
- architectureContent = await fs13.readFile(architecturePath, "utf-8");
11553
+ architectureContent = await fs12.readFile(architecturePath, "utf-8");
11546
11554
  } catch {
11547
11555
  return { success: false, message: `ARCHITECTURE.md not found at ${architecturePath}` };
11548
11556
  }
11549
11557
  try {
11550
- await fs13.access(srcPath);
11558
+ await fs12.access(srcPath);
11551
11559
  } catch {
11552
11560
  return { success: false, message: `Source directory not found: ${srcPath}` };
11553
11561
  }
@@ -11582,10 +11590,10 @@ async function entrypointsCommand(options) {
11582
11590
  for (const warning of result.warnings) {
11583
11591
  logger13.warn(warning);
11584
11592
  }
11585
- const outputDir = path14.dirname(outputPath);
11586
- await fs13.mkdir(outputDir, { recursive: true });
11593
+ const outputDir = path13.dirname(outputPath);
11594
+ await fs12.mkdir(outputDir, { recursive: true });
11587
11595
  const content = format === "yaml" ? manifestToYaml(manifest) : manifestToJson(manifest);
11588
- await fs13.writeFile(outputPath, content, "utf-8");
11596
+ await fs12.writeFile(outputPath, content, "utf-8");
11589
11597
  logger13.info(`Wrote entrypoints manifest to ${outputPath}`);
11590
11598
  const total = manifest.cli_commands.length + manifest.mcp_tools.length;
11591
11599
  return {
@@ -11604,9 +11612,9 @@ async function freshnessCommand(options) {
11604
11612
  const hasIssues = summary.stale > 0 || summary.warning > 0 || summary.unknown > 0;
11605
11613
  const output2 = options.format === "json" ? formatFreshnessJson(result) : formatFreshnessTable(result);
11606
11614
  if (options.output !== void 0) {
11607
- const outputDir = path14.dirname(options.output);
11608
- await fs13.mkdir(outputDir, { recursive: true });
11609
- await fs13.writeFile(options.output, output2, "utf-8");
11615
+ const outputDir = path13.dirname(options.output);
11616
+ await fs12.mkdir(outputDir, { recursive: true });
11617
+ await fs12.writeFile(options.output, output2, "utf-8");
11610
11618
  logger13.info(`Wrote freshness report to ${options.output}`);
11611
11619
  } else {
11612
11620
  process.stdout.write(output2 + "\n");
@@ -11638,9 +11646,9 @@ async function linksCommand(options) {
11638
11646
  const hasBrokenLinks = summary.brokenLinks > 0;
11639
11647
  const output2 = options.format === "json" ? formatLinkValidationJson(result) : formatLinkValidationTable(result);
11640
11648
  if (options.output !== void 0) {
11641
- const outputDir = path14.dirname(options.output);
11642
- await fs13.mkdir(outputDir, { recursive: true });
11643
- await fs13.writeFile(options.output, output2, "utf-8");
11649
+ const outputDir = path13.dirname(options.output);
11650
+ await fs12.mkdir(outputDir, { recursive: true });
11651
+ await fs12.writeFile(options.output, output2, "utf-8");
11644
11652
  logger13.info(`Wrote link validation report to ${options.output}`);
11645
11653
  } else {
11646
11654
  process.stdout.write(output2 + "\n");
@@ -11904,15 +11912,15 @@ async function checkSqliteAvailability() {
11904
11912
  return {
11905
11913
  name: "SQLite Storage",
11906
11914
  passed: true,
11907
- message: "better-sqlite3 loaded (memory backends available)"
11915
+ message: "node:sqlite available (memory backends available)"
11908
11916
  };
11909
11917
  }
11910
11918
  return {
11911
11919
  name: "SQLite Storage",
11912
11920
  passed: false,
11913
11921
  severity: "warn",
11914
- message: result.error ?? "better-sqlite3 not available",
11915
- fix: 'Run "pnpm rebuild better-sqlite3" or reinstall nexus-agents'
11922
+ message: result.error ?? "node:sqlite not available",
11923
+ fix: "Upgrade to Node >= 22.5.0 (node:sqlite is a builtin; nothing to install)"
11916
11924
  };
11917
11925
  }
11918
11926
  function checkDataDirs() {
@@ -12075,7 +12083,7 @@ async function verifyCommand(options) {
12075
12083
  }
12076
12084
 
12077
12085
  // src/cli/learning-metrics-command.ts
12078
- import { writeFileSync as writeFileSync5 } from "fs";
12086
+ import { writeFileSync as writeFileSync5 } from "node:fs";
12079
12087
 
12080
12088
  // src/cli/learning-metrics-logic.ts
12081
12089
  function gatherLearningMetrics(bandit, metricsCollector, feedbackIntegration, options) {
@@ -12390,7 +12398,7 @@ function learningMetricsCommand(options, context) {
12390
12398
  }
12391
12399
 
12392
12400
  // src/cli/setup-command.ts
12393
- import { existsSync as existsSync13 } from "fs";
12401
+ import { existsSync as existsSync13 } from "node:fs";
12394
12402
 
12395
12403
  // src/cli/setup-types.ts
12396
12404
  import { z as z5 } from "zod";
@@ -12422,10 +12430,10 @@ var SetupOptionsSchema = z5.object({
12422
12430
  });
12423
12431
 
12424
12432
  // src/cli/setup-environment.ts
12425
- import { execSync as execSync2 } from "child_process";
12426
- import { existsSync as existsSync12, readFileSync as readFileSync9 } from "fs";
12427
- import { homedir as homedir3 } from "os";
12428
- import { join as join12, basename as basename4 } from "path";
12433
+ import { execSync as execSync2 } from "node:child_process";
12434
+ import { existsSync as existsSync12, readFileSync as readFileSync9 } from "node:fs";
12435
+ import { homedir as homedir3 } from "node:os";
12436
+ import { join as join12, basename as basename4 } from "node:path";
12429
12437
  function parseClaudeVersion(output2) {
12430
12438
  const match = output2.match(/(\d+\.\d+\.\d+)/);
12431
12439
  return match?.[1];
@@ -12470,8 +12478,8 @@ function extractProjectServers(config) {
12470
12478
  }
12471
12479
  return [...allServers];
12472
12480
  }
12473
- function buildMcpInfo(path18, servers) {
12474
- return { exists: true, path: path18, hasNexusAgents: servers.includes("nexus-agents"), servers };
12481
+ function buildMcpInfo(path17, servers) {
12482
+ return { exists: true, path: path17, hasNexusAgents: servers.includes("nexus-agents"), servers };
12475
12483
  }
12476
12484
  function detectMcpConfig(mcpJsonPath) {
12477
12485
  if (!existsSync12(mcpJsonPath)) return void 0;
@@ -12555,9 +12563,7 @@ function detectEnvironment(projectRoot) {
12555
12563
  }
12556
12564
 
12557
12565
  // src/cli/setup-mcp.ts
12558
- import { execSync as execSync3, execFileSync as execFileSync2 } from "child_process";
12559
- import { homedir as homedir4 } from "os";
12560
- import { join as join13 } from "path";
12566
+ import { execSync as execSync3, execFileSync as execFileSync2 } from "node:child_process";
12561
12567
  var NEXUS_AGENTS_MCP_ENTRY = {
12562
12568
  command: "nexus-agents",
12563
12569
  args: ["--mode=server"]
@@ -12790,8 +12796,8 @@ function generateHookSnippet() {
12790
12796
  }
12791
12797
 
12792
12798
  // src/cli/setup-rules.ts
12793
- import { readFileSync as readFileSync10, writeFileSync as writeFileSync6, mkdirSync as mkdirSync4 } from "fs";
12794
- import { join as join14, dirname as dirname7 } from "path";
12799
+ import { readFileSync as readFileSync10, writeFileSync as writeFileSync6, mkdirSync as mkdirSync4 } from "node:fs";
12800
+ import { join as join13, dirname as dirname6 } from "node:path";
12795
12801
  function generateRulesContent() {
12796
12802
  return `# Nexus-Agents Integration
12797
12803
 
@@ -12858,13 +12864,13 @@ Run the code-review workflow with the current changes
12858
12864
  `;
12859
12865
  }
12860
12866
  function getRulesFilePath(projectRoot) {
12861
- return join14(projectRoot, ".rules", "nexus-agents.md");
12867
+ return join13(projectRoot, ".rules", "nexus-agents.md");
12862
12868
  }
12863
12869
  function createRulesFile(projectRoot, dryRun) {
12864
12870
  const rulesPath = getRulesFilePath(projectRoot);
12865
12871
  const content = generateRulesContent();
12866
12872
  if (!dryRun) {
12867
- const rulesDir = dirname7(rulesPath);
12873
+ const rulesDir = dirname6(rulesPath);
12868
12874
  mkdirSync4(rulesDir, { recursive: true });
12869
12875
  writeFileSync6(rulesPath, content, "utf-8");
12870
12876
  }
@@ -12880,7 +12886,7 @@ function isInteractive() {
12880
12886
  }
12881
12887
 
12882
12888
  // src/cli/setup-wizard.ts
12883
- import { createInterface as createInterface2 } from "readline";
12889
+ import { createInterface as createInterface2 } from "node:readline";
12884
12890
  function createReadline() {
12885
12891
  return createInterface2({
12886
12892
  input: process.stdin,
@@ -13768,9 +13774,7 @@ function isValidConfigAction(value) {
13768
13774
  }
13769
13775
 
13770
13776
  // src/cli/config-command-helpers.ts
13771
- import * as fs14 from "fs/promises";
13772
- import * as path15 from "path";
13773
- import { existsSync as existsSync14 } from "fs";
13777
+ import * as path14 from "node:path";
13774
13778
 
13775
13779
  // src/cli/config-command-formatting.ts
13776
13780
  function formatSource(source) {
@@ -14037,10 +14041,10 @@ function parseValueFromString(stringValue, defaultValue) {
14037
14041
  }
14038
14042
  function resolveFilePath(filePath, allowedBase) {
14039
14043
  const base = allowedBase ?? process.cwd();
14040
- const resolved = path15.isAbsolute(filePath) ? filePath : path15.resolve(base, filePath);
14041
- const normalizedResolved = path15.normalize(resolved);
14042
- const normalizedBase = path15.normalize(base);
14043
- const isWithinBase = normalizedResolved === normalizedBase || normalizedResolved.startsWith(normalizedBase + path15.sep);
14044
+ const resolved = path14.isAbsolute(filePath) ? filePath : path14.resolve(base, filePath);
14045
+ const normalizedResolved = path14.normalize(resolved);
14046
+ const normalizedBase = path14.normalize(base);
14047
+ const isWithinBase = normalizedResolved === normalizedBase || normalizedResolved.startsWith(normalizedBase + path14.sep);
14044
14048
  if (!isWithinBase) {
14045
14049
  throw new ConfigCommandError(
14046
14050
  "PATH_TRAVERSAL",
@@ -14051,12 +14055,12 @@ function resolveFilePath(filePath, allowedBase) {
14051
14055
  }
14052
14056
  function getDefaultExportPath(format) {
14053
14057
  const extension = format === "json" ? "json" : "yaml";
14054
- return path15.resolve(process.cwd(), `nexus-config.${extension}`);
14058
+ return path14.resolve(process.cwd(), `nexus-config.${extension}`);
14055
14059
  }
14056
14060
 
14057
14061
  // src/cli/config-command-handlers.ts
14058
- import * as fs15 from "fs/promises";
14059
- import { existsSync as existsSync15 } from "fs";
14062
+ import * as fs13 from "node:fs/promises";
14063
+ import { existsSync as existsSync14 } from "node:fs";
14060
14064
  async function handleGet(key) {
14061
14065
  const parsed = parseConfigKey(key);
14062
14066
  const config = getConfigManager();
@@ -14157,7 +14161,7 @@ function buildConfigEntries() {
14157
14161
  }
14158
14162
  async function writeConfigFile2(filePath, content) {
14159
14163
  try {
14160
- await fs15.writeFile(filePath, content, "utf-8");
14164
+ await fs13.writeFile(filePath, content, "utf-8");
14161
14165
  } catch (error) {
14162
14166
  const message = getErrorMessage(error);
14163
14167
  throw new ConfigCommandError("WRITE_ERROR", `Failed to write file: ${message}`);
@@ -14178,12 +14182,12 @@ async function handleExport2(file, format = "json") {
14178
14182
  };
14179
14183
  }
14180
14184
  async function readImportFile(filePath) {
14181
- if (!existsSync15(filePath)) {
14185
+ if (!existsSync14(filePath)) {
14182
14186
  throw new ConfigCommandError("FILE_NOT_FOUND", `File not found: ${filePath}`);
14183
14187
  }
14184
14188
  const format = filePath.endsWith(".yaml") || filePath.endsWith(".yml") ? "yaml" : "json";
14185
14189
  try {
14186
- const content = await fs15.readFile(filePath, "utf-8");
14190
+ const content = await fs13.readFile(filePath, "utf-8");
14187
14191
  return { content, format };
14188
14192
  } catch (error) {
14189
14193
  const message = getErrorMessage(error);
@@ -15012,8 +15016,8 @@ async function exportSessionMetrics(storage, sessionId, exportPath) {
15012
15016
  const session = sessionResult.value;
15013
15017
  const metrics = buildMetricsObject(session, sessionId);
15014
15018
  if (exportPath !== void 0) {
15015
- const { writeFile: writeFile7 } = await import("fs/promises");
15016
- await writeFile7(exportPath, JSON.stringify(metrics, null, 2));
15019
+ const { writeFile: writeFile6 } = await import("node:fs/promises");
15020
+ await writeFile6(exportPath, JSON.stringify(metrics, null, 2));
15017
15021
  logger17.info("Metrics exported", { path: exportPath });
15018
15022
  } else {
15019
15023
  logger17.debug("Session metrics", summarizeMetricsForDebug(metrics));
@@ -16057,7 +16061,7 @@ async function demoCommand(subcommand, args, options) {
16057
16061
  }
16058
16062
 
16059
16063
  // src/cli/tour-command.ts
16060
- import { createInterface as createInterface3 } from "readline";
16064
+ import { createInterface as createInterface3 } from "node:readline";
16061
16065
  var STEP_WELCOME = {
16062
16066
  title: "Welcome",
16063
16067
  intro: [
@@ -16231,7 +16235,6 @@ function scriptedIO() {
16231
16235
  }
16232
16236
 
16233
16237
  // src/governance/claims-registry.ts
16234
- import { existsSync as existsSync16, readFileSync as readFileSync11 } from "fs";
16235
16238
  import { parse as parseYaml2 } from "yaml";
16236
16239
  import { z as z8 } from "zod";
16237
16240
  var VerificationMethodSchema = z8.enum([
@@ -16328,10 +16331,6 @@ var ClaimsRegistrySchema = z8.object({
16328
16331
  })
16329
16332
  }).strict();
16330
16333
 
16331
- // src/governance/claims-verify.ts
16332
- import { existsSync as existsSync17, readFileSync as readFileSync12 } from "fs";
16333
- import { isAbsolute as isAbsolute2, join as join15 } from "path";
16334
-
16335
16334
  // src/cli/fitness-audit.ts
16336
16335
  var COLORS = colors;
16337
16336
  function formatScore(score, max) {
@@ -16499,7 +16498,7 @@ var CATEGORY_ORDER = [
16499
16498
  ];
16500
16499
 
16501
16500
  // src/cli/release-notes-helpers.ts
16502
- import { execFileSync as execFileSync3 } from "child_process";
16501
+ import { execFileSync as execFileSync3 } from "node:child_process";
16503
16502
  function getLatestTag() {
16504
16503
  try {
16505
16504
  const result = execFileSync3("git", ["describe", "--tags", "--abbrev=0"], {
@@ -16792,14 +16791,14 @@ async function releaseNotesCommand(args) {
16792
16791
  }
16793
16792
 
16794
16793
  // src/cli/release-validate-command.ts
16795
- import { readFileSync as readFileSync14 } from "fs";
16794
+ import { readFileSync as readFileSync12 } from "node:fs";
16796
16795
 
16797
16796
  // src/cli/release-validate-helpers.ts
16798
- import { execSync as execSync5 } from "child_process";
16799
- import { existsSync as existsSync18, readFileSync as readFileSync13 } from "fs";
16797
+ import { execSync as execSync5 } from "node:child_process";
16798
+ import { existsSync as existsSync15, readFileSync as readFileSync11 } from "node:fs";
16800
16799
 
16801
16800
  // src/cli/release-secret-scan.ts
16802
- import { execSync as execSync4 } from "child_process";
16801
+ import { execSync as execSync4 } from "node:child_process";
16803
16802
  var SECRET_LINE_PATTERN = /api[_-]?key|secret|password|token/i;
16804
16803
  var MAX_REPORTED_MATCHES = 5;
16805
16804
  function scanRecentCommitsForSecrets(options = {}) {
@@ -16838,7 +16837,7 @@ async function validateSecurity(options) {
16838
16837
  remediation: "Run npm audit fix or review and update vulnerable dependencies."
16839
16838
  });
16840
16839
  }
16841
- if (existsSync18(".env")) {
16840
+ if (existsSync15(".env")) {
16842
16841
  findings.push({
16843
16842
  severity: "error",
16844
16843
  category: "security",
@@ -16935,7 +16934,7 @@ async function validateArchitecture2(options) {
16935
16934
  async function validateDocumentation(options) {
16936
16935
  const startTime = Date.now();
16937
16936
  const findings = [];
16938
- if (!existsSync18("CHANGELOG.md")) {
16937
+ if (!existsSync15("CHANGELOG.md")) {
16939
16938
  findings.push({
16940
16939
  severity: "error",
16941
16940
  category: "docs",
@@ -16943,7 +16942,7 @@ async function validateDocumentation(options) {
16943
16942
  description: "No CHANGELOG.md found in repository root.",
16944
16943
  remediation: "Create CHANGELOG.md following Keep a Changelog format."
16945
16944
  });
16946
- } else if (!readFileSync13("CHANGELOG.md", "utf-8").includes(options.version)) {
16945
+ } else if (!readFileSync11("CHANGELOG.md", "utf-8").includes(options.version)) {
16947
16946
  findings.push({
16948
16947
  severity: "warning",
16949
16948
  category: "docs",
@@ -16953,7 +16952,7 @@ async function validateDocumentation(options) {
16953
16952
  });
16954
16953
  }
16955
16954
  const pkgCl = "packages/nexus-agents/CHANGELOG.md";
16956
- if (existsSync18(pkgCl) && !readFileSync13(pkgCl, "utf-8").includes(options.version)) {
16955
+ if (existsSync15(pkgCl) && !readFileSync11(pkgCl, "utf-8").includes(options.version)) {
16957
16956
  findings.push({
16958
16957
  severity: "warning",
16959
16958
  category: "docs",
@@ -16962,7 +16961,7 @@ async function validateDocumentation(options) {
16962
16961
  remediation: "Run pnpm changeset:version to generate changelog from pending changesets."
16963
16962
  });
16964
16963
  }
16965
- if (!existsSync18("README.md")) {
16964
+ if (!existsSync15("README.md")) {
16966
16965
  findings.push({
16967
16966
  severity: "error",
16968
16967
  category: "docs",
@@ -16971,8 +16970,8 @@ async function validateDocumentation(options) {
16971
16970
  remediation: "Create README.md with project overview and usage instructions."
16972
16971
  });
16973
16972
  }
16974
- if (existsSync18("CLAUDE.md")) {
16975
- const claudeMd = readFileSync13("CLAUDE.md", "utf-8");
16973
+ if (existsSync15("CLAUDE.md")) {
16974
+ const claudeMd = readFileSync11("CLAUDE.md", "utf-8");
16976
16975
  const match = claudeMd.match(/Governance Version: (\d{4}-\d{2}-\d{2})/);
16977
16976
  if (match?.[1]) {
16978
16977
  const governanceDate = new Date(match[1]);
@@ -17080,7 +17079,7 @@ var DEFAULT_OPTIONS2 = {
17080
17079
  };
17081
17080
  function readVersionFromPackage() {
17082
17081
  try {
17083
- const raw = JSON.parse(readFileSync14("package.json", "utf-8"));
17082
+ const raw = JSON.parse(readFileSync12("package.json", "utf-8"));
17084
17083
  if (typeof raw === "object" && raw !== null && "version" in raw) {
17085
17084
  const pkg = raw;
17086
17085
  return typeof pkg.version === "string" ? pkg.version : "unknown";
@@ -17194,7 +17193,7 @@ async function releaseValidateCommand(args) {
17194
17193
  }
17195
17194
 
17196
17195
  // src/cli/release-announce-command.ts
17197
- import { readFileSync as readFileSync15, existsSync as existsSync19 } from "fs";
17196
+ import { readFileSync as readFileSync13, existsSync as existsSync16 } from "node:fs";
17198
17197
 
17199
17198
  // src/cli/release-announce-types.ts
17200
17199
  var BLUESKY_LIMITS = {
@@ -17261,8 +17260,8 @@ var DEFAULT_OPTIONS3 = {
17261
17260
  verbose: false
17262
17261
  };
17263
17262
  function extractHighlightsFromChangelog(version) {
17264
- if (!existsSync19("CHANGELOG.md")) return [];
17265
- const changelog = readFileSync15("CHANGELOG.md", "utf-8");
17263
+ if (!existsSync16("CHANGELOG.md")) return [];
17264
+ const changelog = readFileSync13("CHANGELOG.md", "utf-8");
17266
17265
  const escaped = version.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
17267
17266
  const versionRegex = new RegExp(`## \\[${escaped}\\][^#]*`, "s");
17268
17267
  const match = changelog.match(versionRegex);
@@ -17532,7 +17531,7 @@ async function releaseAnnounceCommand(args) {
17532
17531
  version = args.options.version;
17533
17532
  } else {
17534
17533
  try {
17535
- const pkg = JSON.parse(readFileSync15("package.json", "utf-8"));
17534
+ const pkg = JSON.parse(readFileSync13("package.json", "utf-8"));
17536
17535
  if (!pkg.version) {
17537
17536
  console.error(`${colors.red}Error: Could not determine version${colors.reset}`);
17538
17537
  return 1;
@@ -17565,8 +17564,8 @@ async function releaseAnnounceCommand(args) {
17565
17564
  }
17566
17565
 
17567
17566
  // src/cli/scaffold.ts
17568
- import * as fs16 from "fs";
17569
- import * as path16 from "path";
17567
+ import * as fs14 from "node:fs";
17568
+ import * as path15 from "node:path";
17570
17569
 
17571
17570
  // src/cli/scaffold-templates.ts
17572
17571
  function toolImportsAndSchema(name, pascal) {
@@ -17902,17 +17901,17 @@ ${lines}`;
17902
17901
  function writeFiles(files) {
17903
17902
  const createdPaths = [];
17904
17903
  for (const file of files) {
17905
- const fullPath = path16.resolve(process.cwd(), file.path);
17906
- const dir = path16.dirname(fullPath);
17907
- fs16.mkdirSync(dir, { recursive: true });
17908
- if (fs16.existsSync(fullPath)) {
17904
+ const fullPath = path15.resolve(process.cwd(), file.path);
17905
+ const dir = path15.dirname(fullPath);
17906
+ fs14.mkdirSync(dir, { recursive: true });
17907
+ if (fs14.existsSync(fullPath)) {
17909
17908
  return {
17910
17909
  success: false,
17911
17910
  filesCreated: createdPaths,
17912
17911
  message: `File already exists: ${file.path}. Use a different name.`
17913
17912
  };
17914
17913
  }
17915
- fs16.writeFileSync(fullPath, file.content, "utf-8");
17914
+ fs14.writeFileSync(fullPath, file.content, "utf-8");
17916
17915
  createdPaths.push(file.path);
17917
17916
  }
17918
17917
  const lines = createdPaths.map((p) => ` ${p}`).join("\n");
@@ -18484,7 +18483,7 @@ function formatEvalDetails(baseline, reflective, improvement, datasetSize) {
18484
18483
  }
18485
18484
 
18486
18485
  // src/cli/auth-command.ts
18487
- import { existsSync as existsSync21, statSync, chmodSync } from "fs";
18486
+ import { existsSync as existsSync18, statSync, chmodSync } from "node:fs";
18488
18487
  function isValidAuthSubcommand(value) {
18489
18488
  return value === "init" || value === "show" || value === "rotate" || value === "help" || value === "status";
18490
18489
  }
@@ -18504,7 +18503,7 @@ function fixPermissions(filePath) {
18504
18503
  }
18505
18504
  function runAuthInit(options) {
18506
18505
  const tokenFile = options.tokenFile ?? getDefaultTokenPath();
18507
- const tokenExists = existsSync21(tokenFile);
18506
+ const tokenExists = existsSync18(tokenFile);
18508
18507
  if (tokenExists && options.force !== true) {
18509
18508
  return {
18510
18509
  success: false,
@@ -18528,7 +18527,7 @@ function runAuthInit(options) {
18528
18527
  }
18529
18528
  function runAuthShow(options) {
18530
18529
  const tokenFile = options.tokenFile ?? getDefaultTokenPath();
18531
- const tokenExists = existsSync21(tokenFile);
18530
+ const tokenExists = existsSync18(tokenFile);
18532
18531
  const token = readStoredToken(tokenFile);
18533
18532
  if (!tokenExists || token === void 0) {
18534
18533
  return {
@@ -18549,7 +18548,7 @@ function runAuthShow(options) {
18549
18548
  }
18550
18549
  function runAuthRotate(options) {
18551
18550
  const tokenFile = options.tokenFile ?? getDefaultTokenPath();
18552
- const tokenExists = existsSync21(tokenFile);
18551
+ const tokenExists = existsSync18(tokenFile);
18553
18552
  if (!tokenExists) {
18554
18553
  return {
18555
18554
  success: false,
@@ -18585,14 +18584,14 @@ function runAuthCommand(options) {
18585
18584
  success: true,
18586
18585
  operation: "help",
18587
18586
  tokenFile: getDefaultTokenPath(),
18588
- tokenExists: existsSync21(getDefaultTokenPath())
18587
+ tokenExists: existsSync18(getDefaultTokenPath())
18589
18588
  };
18590
18589
  default:
18591
18590
  return {
18592
18591
  success: false,
18593
18592
  operation: "help",
18594
18593
  tokenFile: getDefaultTokenPath(),
18595
- tokenExists: existsSync21(getDefaultTokenPath()),
18594
+ tokenExists: existsSync18(getDefaultTokenPath()),
18596
18595
  error: `Unknown subcommand: ${subcommand}`
18597
18596
  };
18598
18597
  }
@@ -18707,18 +18706,18 @@ function authCommand(subcommand, options) {
18707
18706
 
18708
18707
  // src/cli/init-portable.ts
18709
18708
  import {
18710
- existsSync as existsSync25,
18709
+ existsSync as existsSync22,
18711
18710
  mkdirSync as mkdirSync8,
18712
18711
  readdirSync,
18713
18712
  statSync as statSync2,
18714
18713
  appendFileSync as appendFileSync2,
18715
- readFileSync as readFileSync18
18716
- } from "fs";
18717
- import { resolve as resolve10, join as join19, isAbsolute as isAbsolute3 } from "path";
18714
+ readFileSync as readFileSync16
18715
+ } from "node:fs";
18716
+ import { resolve as resolve10, join as join17, isAbsolute as isAbsolute2 } from "node:path";
18718
18717
 
18719
18718
  // src/cli/mcp-config-emitter.ts
18720
- import { existsSync as existsSync22, readFileSync as readFileSync16, writeFileSync as writeFileSync8, appendFileSync } from "fs";
18721
- import { join as join16 } from "path";
18719
+ import { existsSync as existsSync19, readFileSync as readFileSync14, writeFileSync as writeFileSync8, appendFileSync } from "node:fs";
18720
+ import { join as join14 } from "node:path";
18722
18721
  var MCP_CONFIG_FILENAME = ".mcp.json";
18723
18722
  var NEXUS_SERVER_KEY = "nexus-agents";
18724
18723
  function buildNexusServerEntry(dataDir, commandPath) {
@@ -18740,23 +18739,23 @@ function entriesEqual(a, b) {
18740
18739
  for (const k of aKeys) if (aEnv[k] !== bEnv[k]) return false;
18741
18740
  return true;
18742
18741
  }
18743
- function loadExistingConfig(path18) {
18744
- if (!existsSync22(path18)) return { ok: true, value: void 0 };
18742
+ function loadExistingConfig(path17) {
18743
+ if (!existsSync19(path17)) return { ok: true, value: void 0 };
18745
18744
  let raw;
18746
18745
  try {
18747
- raw = readFileSync16(path18, "utf-8");
18746
+ raw = readFileSync14(path17, "utf-8");
18748
18747
  } catch (e) {
18749
18748
  return { ok: false, error: e instanceof Error ? e.message : String(e) };
18750
18749
  }
18751
18750
  try {
18752
18751
  const parsed = JSON.parse(raw);
18753
18752
  if (typeof parsed !== "object" || parsed === null) {
18754
- return { ok: false, error: `${path18}: top-level JSON must be an object` };
18753
+ return { ok: false, error: `${path17}: top-level JSON must be an object` };
18755
18754
  }
18756
18755
  return { ok: true, value: parsed };
18757
18756
  } catch (e) {
18758
18757
  const msg = e instanceof Error ? e.message : String(e);
18759
- return { ok: false, error: `${path18}: invalid JSON \u2014 ${msg}` };
18758
+ return { ok: false, error: `${path17}: invalid JSON \u2014 ${msg}` };
18760
18759
  }
18761
18760
  }
18762
18761
  function decideEmission(existing, desired, force) {
@@ -18778,12 +18777,12 @@ function decideEmission(existing, desired, force) {
18778
18777
  return { kind: "write", nextConfig: { ...existing, mcpServers: nextServers } };
18779
18778
  }
18780
18779
  function autoGitignoreMcpConfig(workspaceDir, dryRun) {
18781
- const gitDir = join16(workspaceDir, ".git");
18782
- if (!existsSync22(gitDir)) return false;
18783
- const gitignorePath = join16(workspaceDir, ".gitignore");
18780
+ const gitDir = join14(workspaceDir, ".git");
18781
+ if (!existsSync19(gitDir)) return false;
18782
+ const gitignorePath = join14(workspaceDir, ".gitignore");
18784
18783
  let existing = "";
18785
- if (existsSync22(gitignorePath)) {
18786
- existing = readFileSync16(gitignorePath, "utf-8");
18784
+ if (existsSync19(gitignorePath)) {
18785
+ existing = readFileSync14(gitignorePath, "utf-8");
18787
18786
  const already = existing.split("\n").some((l) => l.trim() === MCP_CONFIG_FILENAME || l.trim() === `/${MCP_CONFIG_FILENAME}`);
18788
18787
  if (already) return false;
18789
18788
  }
@@ -18795,7 +18794,7 @@ function autoGitignoreMcpConfig(workspaceDir, dryRun) {
18795
18794
  return true;
18796
18795
  }
18797
18796
  function emitMcpConfig(options) {
18798
- const mcpConfigPath = join16(options.workspaceDir, MCP_CONFIG_FILENAME);
18797
+ const mcpConfigPath = join14(options.workspaceDir, MCP_CONFIG_FILENAME);
18799
18798
  const dryRun = options.dryRun === true;
18800
18799
  const force = options.force === true;
18801
18800
  const desired = buildNexusServerEntry(options.dataDir, options.commandPath);
@@ -18832,14 +18831,14 @@ function makeFailure(mcpConfigPath, error) {
18832
18831
  }
18833
18832
 
18834
18833
  // src/cli/portable-installer.ts
18835
- import { execFile as execFile2 } from "child_process";
18836
- import { existsSync as existsSync24, mkdirSync as mkdirSync7, rmSync, writeFileSync as writeFileSync10 } from "fs";
18837
- import { join as join18 } from "path";
18838
- import { promisify as promisify2 } from "util";
18834
+ import { execFile as execFile2 } from "node:child_process";
18835
+ import { existsSync as existsSync21, mkdirSync as mkdirSync7, rmSync, writeFileSync as writeFileSync10 } from "node:fs";
18836
+ import { join as join16 } from "node:path";
18837
+ import { promisify as promisify2 } from "node:util";
18839
18838
 
18840
18839
  // src/cli/bin-shim.ts
18841
- import { existsSync as existsSync23, readFileSync as readFileSync17, writeFileSync as writeFileSync9, chmodSync as chmodSync2, mkdirSync as mkdirSync6 } from "fs";
18842
- import { join as join17 } from "path";
18840
+ import { existsSync as existsSync20, readFileSync as readFileSync15, writeFileSync as writeFileSync9, chmodSync as chmodSync2, mkdirSync as mkdirSync6 } from "node:fs";
18841
+ import { join as join15 } from "node:path";
18843
18842
  var SHIM_BASENAME = "nexus-agents";
18844
18843
  var SHIM_MODE = 493;
18845
18844
  function buildShimContents(cliEntryPath) {
@@ -18853,18 +18852,18 @@ function buildShimContents(cliEntryPath) {
18853
18852
  return lines.join("\n");
18854
18853
  }
18855
18854
  function writeBinShim(options) {
18856
- const shimPath = join17(options.binDir, SHIM_BASENAME);
18855
+ const shimPath = join15(options.binDir, SHIM_BASENAME);
18857
18856
  const desired = buildShimContents(options.cliEntryPath);
18858
18857
  const dryRun = options.dryRun === true;
18859
18858
  try {
18860
- if (existsSync23(shimPath)) {
18861
- const current = readFileSync17(shimPath, "utf-8");
18859
+ if (existsSync20(shimPath)) {
18860
+ const current = readFileSync15(shimPath, "utf-8");
18862
18861
  if (current === desired) {
18863
18862
  return { success: true, shimPath, written: false, alreadyMatched: true, error: null };
18864
18863
  }
18865
18864
  }
18866
18865
  if (!dryRun) {
18867
- if (!existsSync23(options.binDir)) mkdirSync6(options.binDir, { recursive: true });
18866
+ if (!existsSync20(options.binDir)) mkdirSync6(options.binDir, { recursive: true });
18868
18867
  writeFileSync9(shimPath, desired, "utf-8");
18869
18868
  chmodSync2(shimPath, SHIM_MODE);
18870
18869
  }
@@ -18899,10 +18898,10 @@ function writeInstallManifest(cliDir, version) {
18899
18898
  description: "Local install root for portable nexus-agents (generated; do not commit)",
18900
18899
  dependencies: { "nexus-agents": version }
18901
18900
  };
18902
- writeFileSync10(join18(cliDir, "package.json"), JSON.stringify(manifest, null, 2) + "\n", "utf-8");
18901
+ writeFileSync10(join16(cliDir, "package.json"), JSON.stringify(manifest, null, 2) + "\n", "utf-8");
18903
18902
  }
18904
18903
  function isAlreadyInstalled(cliDir) {
18905
- return existsSync24(join18(cliDir, "node_modules", "nexus-agents", "package.json"));
18904
+ return existsSync21(join16(cliDir, "node_modules", "nexus-agents", "package.json"));
18906
18905
  }
18907
18906
  async function spawnNpmInstall(cliDir) {
18908
18907
  await execFileAsync2("npm", ["install", "--no-audit", "--no-fund", "--silent"], {
@@ -18918,7 +18917,7 @@ function cleanupOnFailure(cliDir) {
18918
18917
  }
18919
18918
  async function runNpmStep(ctx) {
18920
18919
  try {
18921
- if (!existsSync24(ctx.cliDir)) mkdirSync7(ctx.cliDir, { recursive: true });
18920
+ if (!existsSync21(ctx.cliDir)) mkdirSync7(ctx.cliDir, { recursive: true });
18922
18921
  writeInstallManifest(ctx.cliDir, ctx.version);
18923
18922
  await spawnNpmInstall(ctx.cliDir);
18924
18923
  return void 0;
@@ -18929,8 +18928,8 @@ async function runNpmStep(ctx) {
18929
18928
  }
18930
18929
  }
18931
18930
  async function installPortable(options) {
18932
- const cliDir = join18(options.dataDir, CLI_SUBDIR);
18933
- const binDir = join18(options.dataDir, BIN_SUBDIR);
18931
+ const cliDir = join16(options.dataDir, CLI_SUBDIR);
18932
+ const binDir = join16(options.dataDir, BIN_SUBDIR);
18934
18933
  const versionResolution = resolveInstallVersion(options.version);
18935
18934
  if (!versionResolution.ok) {
18936
18935
  return {
@@ -18951,7 +18950,7 @@ async function installPortable(options) {
18951
18950
  }
18952
18951
  const npmFailure = await runNpmStep(ctx);
18953
18952
  if (npmFailure !== void 0) return npmFailure;
18954
- const shim = writeBinShim({ binDir, cliEntryPath: join18(cliDir, CLI_ENTRY_RELATIVE) });
18953
+ const shim = writeBinShim({ binDir, cliEntryPath: join16(cliDir, CLI_ENTRY_RELATIVE) });
18955
18954
  if (!shim.success) {
18956
18955
  cleanupOnFailure(cliDir);
18957
18956
  return {
@@ -18965,14 +18964,14 @@ async function installPortable(options) {
18965
18964
  return { success: true, ...ctx, shim, skipped: false, error: null };
18966
18965
  }
18967
18966
  function uninstallPortable(options) {
18968
- const cliDir = join18(options.dataDir, CLI_SUBDIR);
18969
- const binDir = join18(options.dataDir, BIN_SUBDIR);
18967
+ const cliDir = join16(options.dataDir, CLI_SUBDIR);
18968
+ const binDir = join16(options.dataDir, BIN_SUBDIR);
18970
18969
  const removed = [];
18971
18970
  const notPresent = [];
18972
18971
  const dryRun = options.dryRun === true;
18973
18972
  try {
18974
18973
  for (const dir of [cliDir, binDir]) {
18975
- if (!existsSync24(dir)) {
18974
+ if (!existsSync21(dir)) {
18976
18975
  notPresent.push(dir);
18977
18976
  continue;
18978
18977
  }
@@ -18986,8 +18985,8 @@ function uninstallPortable(options) {
18986
18985
  }
18987
18986
  }
18988
18987
  function findBinShim(dataDir) {
18989
- const shimPath = join18(dataDir, BIN_SUBDIR, "nexus-agents");
18990
- return existsSync24(shimPath) ? shimPath : void 0;
18988
+ const shimPath = join16(dataDir, BIN_SUBDIR, "nexus-agents");
18989
+ return existsSync21(shimPath) ? shimPath : void 0;
18991
18990
  }
18992
18991
 
18993
18992
  // src/cli/init-portable.ts
@@ -18997,32 +18996,32 @@ function resolveTargetPath(rawPath) {
18997
18996
  if (rawPath === void 0 || rawPath === "") {
18998
18997
  return resolve10(process.cwd(), DEFAULT_PORTABLE_DIRNAME);
18999
18998
  }
19000
- return isAbsolute3(rawPath) ? rawPath : resolve10(process.cwd(), rawPath);
18999
+ return isAbsolute2(rawPath) ? rawPath : resolve10(process.cwd(), rawPath);
19001
19000
  }
19002
19001
  function isNonEmpty(dir) {
19003
- if (!existsSync25(dir)) return false;
19002
+ if (!existsSync22(dir)) return false;
19004
19003
  const stat2 = statSync2(dir);
19005
19004
  if (!stat2.isDirectory()) return true;
19006
19005
  return readdirSync(dir).length > 0;
19007
19006
  }
19008
- function ensureDir(path18, dryRun, created, alreadyExisted, mode) {
19009
- if (existsSync25(path18)) {
19010
- alreadyExisted.push(path18);
19007
+ function ensureDir(path17, dryRun, created, alreadyExisted, mode) {
19008
+ if (existsSync22(path17)) {
19009
+ alreadyExisted.push(path17);
19011
19010
  return;
19012
19011
  }
19013
19012
  if (!dryRun) {
19014
- mkdirSync8(path18, { recursive: true, ...mode !== void 0 ? { mode } : {} });
19013
+ mkdirSync8(path17, { recursive: true, ...mode !== void 0 ? { mode } : {} });
19015
19014
  }
19016
- created.push(path18);
19015
+ created.push(path17);
19017
19016
  }
19018
19017
  function maybeUpdateGitignore(workspaceDir, portableDirName, dryRun) {
19019
- const gitDir = join19(workspaceDir, ".git");
19020
- if (!existsSync25(gitDir)) return false;
19021
- const gitignorePath = join19(workspaceDir, ".gitignore");
19018
+ const gitDir = join17(workspaceDir, ".git");
19019
+ if (!existsSync22(gitDir)) return false;
19020
+ const gitignorePath = join17(workspaceDir, ".gitignore");
19022
19021
  const entry = `${portableDirName}/`;
19023
19022
  let existing = "";
19024
- if (existsSync25(gitignorePath)) {
19025
- existing = readFileSync18(gitignorePath, "utf-8");
19023
+ if (existsSync22(gitignorePath)) {
19024
+ existing = readFileSync16(gitignorePath, "utf-8");
19026
19025
  if (existing.split("\n").some((l) => l.trim() === entry || l.trim() === portableDirName)) {
19027
19026
  return false;
19028
19027
  }
@@ -19035,18 +19034,18 @@ function maybeUpdateGitignore(workspaceDir, portableDirName, dryRun) {
19035
19034
  return true;
19036
19035
  }
19037
19036
  function inspectTarget(target) {
19038
- const exists = existsSync25(target);
19037
+ const exists = existsSync22(target);
19039
19038
  if (!exists) return { exists: false, nonEmpty: false, isExistingNexusDir: false };
19040
19039
  const nonEmpty = isNonEmpty(target);
19041
19040
  const stat2 = statSync2(target);
19042
- const isExistingNexusDir = stat2.isDirectory() && existsSync25(join19(target, "audit"));
19041
+ const isExistingNexusDir = stat2.isDirectory() && existsSync22(join17(target, "audit"));
19043
19042
  return { exists, nonEmpty, isExistingNexusDir };
19044
19043
  }
19045
19044
  function createDataLayout(target, dryRun, created, alreadyExisted) {
19046
19045
  ensureDir(target, dryRun, created, alreadyExisted);
19047
19046
  for (const subdir of DATA_SUBDIRECTORIES) {
19048
19047
  const mode = RESTRICTED_SUBDIRS.has(subdir) ? 448 : void 0;
19049
- ensureDir(join19(target, subdir), dryRun, created, alreadyExisted, mode);
19048
+ ensureDir(join17(target, subdir), dryRun, created, alreadyExisted, mode);
19050
19049
  }
19051
19050
  }
19052
19051
  function makeResult(opts) {
@@ -19587,7 +19586,7 @@ function startImprovementReviewScheduler(options) {
19587
19586
  let running = false;
19588
19587
  const runOnce = async () => {
19589
19588
  try {
19590
- const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-QUU5HR7Z.js");
19589
+ const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-UV42QAVL.js");
19591
19590
  const input = ImprovementReviewInputSchema2.parse({ fileIssues });
19592
19591
  const result = await runImprovementReview2(input, { logger: logger22 });
19593
19592
  logger22.info("Scheduled improvement_review complete", {
@@ -20297,22 +20296,22 @@ function registerMcpTools(options) {
20297
20296
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
20298
20297
 
20299
20298
  // src/mcp/workspace-roots.ts
20300
- import { existsSync as existsSync26 } from "fs";
20301
- import { join as join20 } from "path";
20302
- import { fileURLToPath } from "url";
20299
+ import { existsSync as existsSync23 } from "node:fs";
20300
+ import { join as join18 } from "node:path";
20301
+ import { fileURLToPath } from "node:url";
20303
20302
  function deriveWorkspaceRootFromRoots(roots) {
20304
20303
  let first = null;
20305
20304
  let gitRoot = null;
20306
20305
  for (const root of roots) {
20307
20306
  if (typeof root.uri !== "string" || !root.uri.startsWith("file://")) continue;
20308
- let path18;
20307
+ let path17;
20309
20308
  try {
20310
- path18 = fileURLToPath(root.uri);
20309
+ path17 = fileURLToPath(root.uri);
20311
20310
  } catch {
20312
20311
  continue;
20313
20312
  }
20314
- first ??= path18;
20315
- if (gitRoot === null && existsSync26(join20(path18, ".git"))) gitRoot = path18;
20313
+ first ??= path17;
20314
+ if (gitRoot === null && existsSync23(join18(path17, ".git"))) gitRoot = path17;
20316
20315
  }
20317
20316
  return gitRoot ?? first;
20318
20317
  }
@@ -20472,7 +20471,7 @@ function logFinalEventBusStats(logger22) {
20472
20471
  }
20473
20472
 
20474
20473
  // src/cli-orchestrator.ts
20475
- import * as readline2 from "readline";
20474
+ import * as readline2 from "node:readline";
20476
20475
  async function executeReplTask(task, options, logger22, rl) {
20477
20476
  try {
20478
20477
  await orchestrateCommand({
@@ -21672,7 +21671,7 @@ function adaptConfigToLibrary(config) {
21672
21671
  }
21673
21672
  function createBeliefPromoter() {
21674
21673
  return async (event) => {
21675
- const { getToolMemory } = await import("./tool-memory-GUPG2M25.js");
21674
+ const { getToolMemory } = await import("./tool-memory-RSRUWJFE.js");
21676
21675
  const tm = getToolMemory();
21677
21676
  await tm.recordBelief(
21678
21677
  `skill:${event.name}`,
@@ -22893,7 +22892,7 @@ async function handleResearchCommand(args) {
22893
22892
  }
22894
22893
  }
22895
22894
  async function handleRegistryCommand(args) {
22896
- const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-ZK4NQ2MX.js");
22895
+ const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-O7TLGMNL.js");
22897
22896
  const subcommand = args.subcommand;
22898
22897
  if (!isValidRegistrySubcommand(subcommand)) {
22899
22898
  process.stdout.write(`${formatRegistryUsage()}
@@ -22941,12 +22940,12 @@ async function handleVerifyCommand(args) {
22941
22940
  async function handleDoctorCommand(args) {
22942
22941
  const exitCode = await doctorCommand({ fix: args.options.fix });
22943
22942
  if (args.options.deep) {
22944
- const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-6WHVRRVQ.js");
22943
+ const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-WLVSUPFA.js");
22945
22944
  const diag = runDeepDiagnostics2();
22946
22945
  process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
22947
22946
  }
22948
22947
  if (args.options.live) {
22949
- const { runLiveReadiness, formatLiveReadiness } = await import("./doctor-live-J7JIZH3T.js");
22948
+ const { runLiveReadiness, formatLiveReadiness } = await import("./doctor-live-5L4RI4GW.js");
22950
22949
  const report = await runLiveReadiness();
22951
22950
  process.stdout.write(formatLiveReadiness(report) + "\n");
22952
22951
  if (report.some((r) => r.levels.serves.status === "failed")) {
@@ -22999,7 +22998,7 @@ async function runInitPortableFlow(args) {
22999
22998
  return cliExit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
23000
22999
  }
23001
23000
  async function runInitOpencodeFlow(args) {
23002
- const { runInitOpencode } = await import("./init-opencode-GDPE4U65.js");
23001
+ const { runInitOpencode } = await import("./init-opencode-73YZUQQX.js");
23003
23002
  const opencodePath = args.options.opencode;
23004
23003
  if (opencodePath === void 0 || opencodePath === "") {
23005
23004
  process.stderr.write("Error: --opencode requires a path argument.\n");
@@ -23025,7 +23024,7 @@ async function runInitOpencodeFlow(args) {
23025
23024
  return cliExit(EXIT_CODES.SUCCESS);
23026
23025
  }
23027
23026
  async function renderOpencodeValidate(opencodePath) {
23028
- const { runOpencodeValidate } = await import("./init-opencode-GDPE4U65.js");
23027
+ const { runOpencodeValidate } = await import("./init-opencode-73YZUQQX.js");
23029
23028
  const result = await runOpencodeValidate(opencodePath);
23030
23029
  if (!result.ok) {
23031
23030
  process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
@@ -23064,7 +23063,7 @@ async function handleSetupCommandAsync(args) {
23064
23063
  return cliExitFromStatus(exitCode);
23065
23064
  }
23066
23065
  async function runCustomApiSetup(args) {
23067
- const { configureCustomApi } = await import("./setup-custom-api-ZSBUIJID.js");
23066
+ const { configureCustomApi } = await import("./setup-custom-api-EETAAEAD.js");
23068
23067
  const baseUrl = args.options.customApi;
23069
23068
  if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
23070
23069
  const input = {
@@ -23430,25 +23429,25 @@ function handleScaffoldCommand(args) {
23430
23429
  }
23431
23430
 
23432
23431
  // src/cli/visualize-summary.ts
23433
- import * as fs17 from "fs";
23434
- import * as path17 from "path";
23435
- import { fileURLToPath as fileURLToPath2 } from "url";
23432
+ import * as fs15 from "node:fs";
23433
+ import * as path16 from "node:path";
23434
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
23436
23435
  function findPackageRoot(startDir) {
23437
23436
  let dir = startDir;
23438
23437
  for (let i = 0; i < 5; i++) {
23439
- if (fs17.existsSync(path17.join(dir, "package.json"))) return dir;
23440
- const parent = path17.dirname(dir);
23438
+ if (fs15.existsSync(path16.join(dir, "package.json"))) return dir;
23439
+ const parent = path16.dirname(dir);
23441
23440
  if (parent === dir) break;
23442
23441
  dir = parent;
23443
23442
  }
23444
23443
  return startDir;
23445
23444
  }
23446
23445
  function countFiles(dir, pattern) {
23447
- if (!fs17.existsSync(dir)) return 0;
23446
+ if (!fs15.existsSync(dir)) return 0;
23448
23447
  let count = 0;
23449
- for (const entry of fs17.readdirSync(dir, { withFileTypes: true })) {
23448
+ for (const entry of fs15.readdirSync(dir, { withFileTypes: true })) {
23450
23449
  if (entry.isDirectory() && entry.name !== "node_modules" && entry.name !== "dist") {
23451
- count += countFiles(path17.join(dir, entry.name), pattern);
23450
+ count += countFiles(path16.join(dir, entry.name), pattern);
23452
23451
  } else if (entry.isFile() && pattern.test(entry.name)) {
23453
23452
  count++;
23454
23453
  }
@@ -23457,7 +23456,7 @@ function countFiles(dir, pattern) {
23457
23456
  }
23458
23457
  function readVersion(pkgRoot) {
23459
23458
  try {
23460
- const raw = fs17.readFileSync(path17.join(pkgRoot, "package.json"), "utf-8");
23459
+ const raw = fs15.readFileSync(path16.join(pkgRoot, "package.json"), "utf-8");
23461
23460
  const pkg = JSON.parse(raw);
23462
23461
  return pkg.version ?? "unknown";
23463
23462
  } catch {
@@ -23478,13 +23477,13 @@ var LAYER_DIRS = [
23478
23477
  ];
23479
23478
  function gatherSystemSummary() {
23480
23479
  const thisFile = fileURLToPath2(import.meta.url);
23481
- const pkgRoot = findPackageRoot(path17.dirname(thisFile));
23482
- const srcDir = path17.resolve(pkgRoot, "src");
23480
+ const pkgRoot = findPackageRoot(path16.dirname(thisFile));
23481
+ const srcDir = path16.resolve(pkgRoot, "src");
23483
23482
  const allTs = countFiles(srcDir, /\.ts$/);
23484
23483
  const testTs = countFiles(srcDir, /\.test\.ts$/);
23485
23484
  const layers = LAYER_DIRS.map(({ name, dir }) => ({
23486
23485
  name,
23487
- files: countFiles(path17.join(srcDir, dir), /\.ts$/)
23486
+ files: countFiles(path16.join(srcDir, dir), /\.ts$/)
23488
23487
  })).filter((l) => l.files > 0);
23489
23488
  return {
23490
23489
  version: readVersion(pkgRoot),
@@ -23735,8 +23734,8 @@ function generateDiagramOutput(subcommand, format) {
23735
23734
  async function writeOutput(output2, outputPath) {
23736
23735
  if (outputPath !== void 0) {
23737
23736
  try {
23738
- const fs18 = await import("fs");
23739
- fs18.writeFileSync(outputPath, output2 + "\n", "utf-8");
23737
+ const fs16 = await import("node:fs");
23738
+ fs16.writeFileSync(outputPath, output2 + "\n", "utf-8");
23740
23739
  process.stdout.write(`Diagram written to ${outputPath}
23741
23740
  `);
23742
23741
  } catch (e) {
@@ -24553,7 +24552,7 @@ async function handleMemoryBenchmarkCommand(args) {
24553
24552
  }
24554
24553
 
24555
24554
  // src/cli/status-command.ts
24556
- import { execFileSync as execFileSync4 } from "child_process";
24555
+ import { execFileSync as execFileSync4 } from "node:child_process";
24557
24556
  var FITNESS_TARGET = 90;
24558
24557
  var API_ADAPTER_CHECKS = [
24559
24558
  { name: "Claude", envVar: "ANTHROPIC_API_KEY" },
@@ -24660,11 +24659,11 @@ function handleStatusCommand2(args) {
24660
24659
  }
24661
24660
 
24662
24661
  // src/cli/scenario-command.ts
24663
- import { readdir as readdir4 } from "fs/promises";
24664
- import { join as join22, resolve as resolve12 } from "path";
24662
+ import { readdir as readdir4 } from "node:fs/promises";
24663
+ import { join as join20, resolve as resolve12 } from "node:path";
24665
24664
 
24666
24665
  // src/testing/e2e/scenario-runner.ts
24667
- import { readFile as readFile7 } from "fs/promises";
24666
+ import { readFile as readFile7 } from "node:fs/promises";
24668
24667
  import * as yaml7 from "yaml";
24669
24668
 
24670
24669
  // src/testing/e2e/types.ts
@@ -24792,9 +24791,9 @@ function checkCircularDependencies(workflow) {
24792
24791
  for (const step of workflow.steps) {
24793
24792
  stepMap.set(step.id, step);
24794
24793
  }
24795
- const visit = (stepId, path18) => {
24794
+ const visit = (stepId, path17) => {
24796
24795
  if (visiting.has(stepId)) {
24797
- errors.push(`Circular dependency detected: ${[...path18, stepId].join(" -> ")}`);
24796
+ errors.push(`Circular dependency detected: ${[...path17, stepId].join(" -> ")}`);
24798
24797
  return false;
24799
24798
  }
24800
24799
  if (visited.has(stepId)) return true;
@@ -24802,7 +24801,7 @@ function checkCircularDependencies(workflow) {
24802
24801
  const step = stepMap.get(stepId);
24803
24802
  if (step?.dependsOn) {
24804
24803
  for (const dep of step.dependsOn) {
24805
- if (!visit(dep, [...path18, stepId])) {
24804
+ if (!visit(dep, [...path17, stepId])) {
24806
24805
  return false;
24807
24806
  }
24808
24807
  }
@@ -24846,8 +24845,8 @@ var ScenarioRunner = class {
24846
24845
  /**
24847
24846
  * Load a scenario fixture from a YAML file.
24848
24847
  */
24849
- async loadFixture(path18) {
24850
- const content = await readFile7(path18, "utf-8");
24848
+ async loadFixture(path17) {
24849
+ const content = await readFile7(path17, "utf-8");
24851
24850
  const data = yaml7.parse(content);
24852
24851
  return ScenarioFixtureSchema.parse(data);
24853
24852
  }
@@ -25031,7 +25030,7 @@ async function handleRun(args) {
25031
25030
  return cliExit(EXIT_CODES.SERVER_START_FAILED);
25032
25031
  }
25033
25032
  const runner = createScenarioRunner();
25034
- const fixturePath = join22(FIXTURES_DIR, `${name}${SCENARIO_SUFFIX}`);
25033
+ const fixturePath = join20(FIXTURES_DIR, `${name}${SCENARIO_SUFFIX}`);
25035
25034
  try {
25036
25035
  const fixture = await runner.loadFixture(fixturePath);
25037
25036
  const result = await runner.run(fixture);
@@ -25520,8 +25519,8 @@ function makeVoteAdapter(runner, logger22 = createLogger({ tool: "auto-remediati
25520
25519
  }
25521
25520
 
25522
25521
  // src/mcp/tools/auto-remediation-lease.ts
25523
- import { execFile as execFile3 } from "child_process";
25524
- import { promisify as promisify3 } from "util";
25522
+ import { execFile as execFile3 } from "node:child_process";
25523
+ import { promisify as promisify3 } from "node:util";
25525
25524
  var execFileAsync3 = promisify3(execFile3);
25526
25525
  function lockRef(key) {
25527
25526
  return `refs/locks/${key}`;
@@ -25583,10 +25582,10 @@ function stripRefsPrefix(ref) {
25583
25582
  }
25584
25583
 
25585
25584
  // src/mcp/tools/remediation-proposal-pr.ts
25586
- import { execFile as execFile4 } from "child_process";
25587
- import { promisify as promisify4 } from "util";
25588
- import { writeFile as writeFile6, mkdir as mkdir5 } from "fs/promises";
25589
- import { join as join23, dirname as dirname10 } from "path";
25585
+ import { execFile as execFile4 } from "node:child_process";
25586
+ import { promisify as promisify4 } from "node:util";
25587
+ import { writeFile as writeFile5, mkdir as mkdir4 } from "node:fs/promises";
25588
+ import { join as join21, dirname as dirname9 } from "node:path";
25590
25589
 
25591
25590
  // src/mcp/tools/improvement-remediation-capability.ts
25592
25591
  import { z as z9 } from "zod";
@@ -25745,14 +25744,14 @@ function makeGitWorktreeOps(repoRoot) {
25745
25744
  };
25746
25745
  return {
25747
25746
  async addWorktree(branch, baseBranch) {
25748
- const path18 = join23(repoRoot, ".nexus-worktrees", branch.replace(/\//g, "_"));
25749
- await git2(["worktree", "add", "-b", branch, path18, baseBranch], repoRoot);
25750
- return path18;
25747
+ const path17 = join21(repoRoot, ".nexus-worktrees", branch.replace(/\//g, "_"));
25748
+ await git2(["worktree", "add", "-b", branch, path17, baseBranch], repoRoot);
25749
+ return path17;
25751
25750
  },
25752
25751
  async writeFileIn(worktreePath, relPath, content) {
25753
- const abs = join23(worktreePath, relPath);
25754
- await mkdir5(dirname10(abs), { recursive: true });
25755
- await writeFile6(abs, content, "utf8");
25752
+ const abs = join21(worktreePath, relPath);
25753
+ await mkdir4(dirname9(abs), { recursive: true });
25754
+ await writeFile5(abs, content, "utf8");
25756
25755
  },
25757
25756
  async commitAll(worktreePath, message) {
25758
25757
  await git2(["add", "-A"], worktreePath);
@@ -25945,18 +25944,18 @@ function buildAutoRemediationDeps(opts = {}) {
25945
25944
  }
25946
25945
 
25947
25946
  // src/mcp/tools/codepr-soak-consumer.ts
25948
- import { createHash as createHash4 } from "crypto";
25947
+ import { createHash as createHash4 } from "node:crypto";
25949
25948
 
25950
25949
  // src/mcp/tools/codepr-orchestrator.ts
25951
- import { createHash as createHash3 } from "crypto";
25952
- import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync11, rmSync as rmSync2, realpathSync as realpathSync2 } from "fs";
25953
- import { dirname as dirname12, join as join24 } from "path";
25954
- import { execFileSync as execFileSync5 } from "child_process";
25950
+ import { createHash as createHash3 } from "node:crypto";
25951
+ import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync11, rmSync as rmSync2, realpathSync as realpathSync2 } from "node:fs";
25952
+ import { dirname as dirname11, join as join22 } from "node:path";
25953
+ import { execFileSync as execFileSync5 } from "node:child_process";
25955
25954
  import { z as z12 } from "zod";
25956
25955
 
25957
25956
  // src/mcp/tools/codepr-guards.ts
25958
- import { realpathSync } from "fs";
25959
- import { isAbsolute as isAbsolute4, resolve as resolve13, relative as relative4, sep as sep3, dirname as dirname11, basename as basename5 } from "path";
25957
+ import { realpathSync } from "node:fs";
25958
+ import { isAbsolute as isAbsolute3, resolve as resolve13, relative as relative4, sep as sep3, dirname as dirname10, basename as basename5 } from "node:path";
25960
25959
  import { z as z11 } from "zod";
25961
25960
  function deny(reason, detail) {
25962
25961
  return { ok: false, reason, detail };
@@ -25969,7 +25968,7 @@ function errnoCode(err2) {
25969
25968
  return void 0;
25970
25969
  }
25971
25970
  function confinePath(worktreeRoot, candidatePath, realpath = realpathSync) {
25972
- if (!isAbsolute4(worktreeRoot)) {
25971
+ if (!isAbsolute3(worktreeRoot)) {
25973
25972
  return deny("path_escape", "worktreeRoot must be an absolute path");
25974
25973
  }
25975
25974
  let resolvedRoot;
@@ -25978,7 +25977,7 @@ function confinePath(worktreeRoot, candidatePath, realpath = realpathSync) {
25978
25977
  } catch {
25979
25978
  return deny("path_escape", "worktreeRoot could not be resolved (fail-closed)");
25980
25979
  }
25981
- const joined = isAbsolute4(candidatePath) ? candidatePath : resolve13(resolvedRoot, candidatePath);
25980
+ const joined = isAbsolute3(candidatePath) ? candidatePath : resolve13(resolvedRoot, candidatePath);
25982
25981
  const reassembled = resolveNewFilePath(joined, realpath);
25983
25982
  if (reassembled === void 0) {
25984
25983
  return deny("path_escape", "candidate path could not be resolved (fail-closed)");
@@ -25997,7 +25996,7 @@ function resolveNewFilePath(joined, realpath) {
25997
25996
  break;
25998
25997
  } catch (err2) {
25999
25998
  if (errnoCode(err2) !== "ENOENT") return void 0;
26000
- const parent = dirname11(existing);
25999
+ const parent = dirname10(existing);
26001
26000
  if (parent === existing) return void 0;
26002
26001
  trailing.push(basename5(existing));
26003
26002
  existing = parent;
@@ -26010,7 +26009,7 @@ function isWithin(parent, child) {
26010
26009
  const rel = relative4(parent, child);
26011
26010
  if (rel === "") return true;
26012
26011
  if (rel === ".." || rel.startsWith(".." + sep3)) return false;
26013
- if (isAbsolute4(rel)) return false;
26012
+ if (isAbsolute3(rel)) return false;
26014
26013
  return true;
26015
26014
  }
26016
26015
  function basenamePosix(relPathPosix) {
@@ -26284,9 +26283,9 @@ function parseNumstat(numstat) {
26284
26283
  if (parts.length < 3) continue;
26285
26284
  const added = parts[0] === "-" ? 0 : Number.parseInt(parts[0] ?? "0", 10);
26286
26285
  const removed = parts[1] === "-" ? 0 : Number.parseInt(parts[1] ?? "0", 10);
26287
- const path18 = parts.slice(2).join(" ");
26286
+ const path17 = parts.slice(2).join(" ");
26288
26287
  files.push({
26289
- path: path18,
26288
+ path: path17,
26290
26289
  addedLines: Number.isFinite(added) ? added : 0,
26291
26290
  removedLines: Number.isFinite(removed) ? removed : 0
26292
26291
  });
@@ -26345,7 +26344,7 @@ function applyChanges(worktreeRoot, run) {
26345
26344
  for (const change of run.changes) {
26346
26345
  const confined = confinePath(worktreeRoot, change.relPath);
26347
26346
  if (!confined.ok) throw new Error(`apply: ${confined.detail}`);
26348
- mkdirSync9(dirname12(confined.resolvedPath), { recursive: true });
26347
+ mkdirSync9(dirname11(confined.resolvedPath), { recursive: true });
26349
26348
  writeFileSync11(confined.resolvedPath, change.newContent);
26350
26349
  }
26351
26350
  }
@@ -26408,7 +26407,7 @@ function runInWorktree(run, logger22, options, handle) {
26408
26407
  const fault = options.faultInjector;
26409
26408
  const repoRoot = options.repoRoot ?? process.cwd();
26410
26409
  handle.tempParent = realpathSync2(nexusMkdtempSync("codepr-orchestrator-"));
26411
- handle.worktreeRoot = join24(handle.tempParent, "wt");
26410
+ handle.worktreeRoot = join22(handle.tempParent, "wt");
26412
26411
  git(repoRoot, ["worktree", "add", "--detach", handle.worktreeRoot]);
26413
26412
  fault?.("after-worktree");
26414
26413
  const precheck = precheckChanges(handle.worktreeRoot, run, logger22);
@@ -26553,11 +26552,11 @@ function deriveProposedChanges(plan) {
26553
26552
  const changes = [];
26554
26553
  for (const step of plan.steps) {
26555
26554
  if (!CODE_TOUCHING_KINDS.has(step.kind)) continue;
26556
- const path18 = step.targetPath !== void 0 && step.targetPath !== "" ? step.targetPath : placeholderPathFor(plan, step.kind);
26557
- if (seen.has(path18)) continue;
26558
- seen.add(path18);
26555
+ const path17 = step.targetPath !== void 0 && step.targetPath !== "" ? step.targetPath : placeholderPathFor(plan, step.kind);
26556
+ if (seen.has(path17)) continue;
26557
+ seen.add(path17);
26559
26558
  changes.push({
26560
- relPath: path18,
26559
+ relPath: path17,
26561
26560
  newContent: `// codepr soak dry-run placeholder for ${plan.signalKey} (${step.kind})
26562
26561
  `
26563
26562
  });
@@ -26833,11 +26832,11 @@ var PROTECTED_PATH_FRAGMENTS = [
26833
26832
  "secret",
26834
26833
  "credential"
26835
26834
  ];
26836
- function normalize2(path18) {
26837
- return path18.replace(/\\/g, "/").replace(/^\.\//, "").toLowerCase();
26835
+ function normalize2(path17) {
26836
+ return path17.replace(/\\/g, "/").replace(/^\.\//, "").toLowerCase();
26838
26837
  }
26839
- function isProtectedPath(path18) {
26840
- const p = normalize2(path18);
26838
+ function isProtectedPath(path17) {
26839
+ const p = normalize2(path17);
26841
26840
  return PROTECTED_PATH_FRAGMENTS.some((frag) => p.includes(frag));
26842
26841
  }
26843
26842
  function planTouchesProtectedPath(plan) {
@@ -27275,18 +27274,18 @@ async function handleRemediationReviewCommand(args) {
27275
27274
  }
27276
27275
 
27277
27276
  // src/cli/migrate-command.ts
27278
- import { cpSync, existsSync as existsSync28, mkdirSync as mkdirSync10, readdirSync as readdirSync3 } from "fs";
27279
- import { homedir as homedir5 } from "os";
27280
- import { join as join25 } from "path";
27277
+ import { cpSync, existsSync as existsSync25, mkdirSync as mkdirSync10, readdirSync as readdirSync3 } from "node:fs";
27278
+ import { homedir as homedir4 } from "node:os";
27279
+ import { join as join23 } from "node:path";
27281
27280
  var logger21 = createLogger({ component: "migrate-command" });
27282
- var HOMEDIR_DEFAULT_BASE = join25(homedir5(), ".nexus-agents");
27281
+ var HOMEDIR_DEFAULT_BASE = join23(homedir4(), ".nexus-agents");
27283
27282
  function countItems(dir) {
27284
- if (!existsSync28(dir)) return 0;
27283
+ if (!existsSync25(dir)) return 0;
27285
27284
  try {
27286
27285
  const entries = readdirSync3(dir, { withFileTypes: true });
27287
27286
  let n = 0;
27288
27287
  for (const e of entries) {
27289
- const p = join25(dir, e.name);
27288
+ const p = join23(dir, e.name);
27290
27289
  if (e.isDirectory()) {
27291
27290
  n += countItems(p);
27292
27291
  } else {
@@ -27328,7 +27327,7 @@ function checkEarlyExits(fromBase, toBase, dryRun) {
27328
27327
  summary: "No git repo detected from cwd. Run from inside a repo or pass --to <path> to choose an explicit destination."
27329
27328
  };
27330
27329
  }
27331
- if (!existsSync28(fromBase)) {
27330
+ if (!existsSync25(fromBase)) {
27332
27331
  return {
27333
27332
  fromBase,
27334
27333
  toBase,
@@ -27341,8 +27340,8 @@ function checkEarlyExits(fromBase, toBase, dryRun) {
27341
27340
  return null;
27342
27341
  }
27343
27342
  function planAndExecuteEntry(name, fromBase, toBase, perRepoSet, dryRun) {
27344
- const source = join25(fromBase, name);
27345
- const target = join25(toBase, name);
27343
+ const source = join23(fromBase, name);
27344
+ const target = join23(toBase, name);
27346
27345
  if (!perRepoSet.has(name)) {
27347
27346
  return { subdir: name, status: "skipped-not-per-repo", source, target: "", itemsCopied: 0 };
27348
27347
  }
@@ -27350,7 +27349,7 @@ function planAndExecuteEntry(name, fromBase, toBase, perRepoSet, dryRun) {
27350
27349
  if (items === 0) {
27351
27350
  return { subdir: name, status: "skipped-empty", source, target, itemsCopied: 0 };
27352
27351
  }
27353
- if (existsSync28(target) && readdirSync3(target).length > 0) {
27352
+ if (existsSync25(target) && readdirSync3(target).length > 0) {
27354
27353
  return { subdir: name, status: "skipped-exists", source, target, itemsCopied: 0 };
27355
27354
  }
27356
27355
  if (!dryRun) {
@@ -27362,7 +27361,7 @@ function planAndExecuteEntry(name, fromBase, toBase, perRepoSet, dryRun) {
27362
27361
  function resolveDefaultTarget(cwd) {
27363
27362
  const repoRoot = findRepoRoot(cwd);
27364
27363
  if (repoRoot === null) return null;
27365
- return join25(repoRoot, ".nexus-agents");
27364
+ return join23(repoRoot, ".nexus-agents");
27366
27365
  }
27367
27366
  function formatMigrationResult(result) {
27368
27367
  if (!result.success) {
@@ -27404,8 +27403,8 @@ async function handleMigrateCommand(args) {
27404
27403
  }
27405
27404
 
27406
27405
  // src/cli/first-run-hint.ts
27407
- import { existsSync as existsSync29, mkdirSync as mkdirSync11, writeFileSync as writeFileSync12 } from "fs";
27408
- import { dirname as dirname13 } from "path";
27406
+ import { existsSync as existsSync26, mkdirSync as mkdirSync11, writeFileSync as writeFileSync12 } from "node:fs";
27407
+ import { dirname as dirname12 } from "node:path";
27409
27408
  var HINT_SUPPRESSED_COMMANDS = /* @__PURE__ */ new Set(["version", "help", "setup"]);
27410
27409
  function firstRunMarkerPath() {
27411
27410
  return nexusSharedPath(".first-run-done");
@@ -27415,14 +27414,14 @@ function maybeShowFirstRunHint(command) {
27415
27414
  if (!process.stderr.isTTY) return;
27416
27415
  const marker = firstRunMarkerPath();
27417
27416
  try {
27418
- if (existsSync29(marker)) return;
27417
+ if (existsSync26(marker)) return;
27419
27418
  } catch {
27420
27419
  }
27421
27420
  process.stderr.write(
27422
27421
  "\x1B[36mnexus-agents\x1B[0m: First time? Run \x1B[1mnexus-agents setup\x1B[0m to configure.\n (This one-time hint is now dismissed.)\n"
27423
27422
  );
27424
27423
  try {
27425
- mkdirSync11(dirname13(marker), { recursive: true });
27424
+ mkdirSync11(dirname12(marker), { recursive: true });
27426
27425
  writeFileSync12(marker, `${(/* @__PURE__ */ new Date()).toISOString()}
27427
27426
  `, { flag: "w" });
27428
27427
  } catch {