nexus-agents 2.131.0 → 2.132.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +1 -1
  2. package/dist/{child-mcp-config-M7WR4XBB.js → child-mcp-config-R67B2KM6.js} +4 -4
  3. package/dist/{chunk-5GQMP7QN.js → chunk-27DRQWON.js} +7 -123
  4. package/dist/chunk-27DRQWON.js.map +1 -0
  5. package/dist/{chunk-VTTPYENR.js → chunk-2CLFX73Y.js} +2 -2
  6. package/dist/{chunk-RPT5WZAT.js → chunk-2JZ55G3X.js} +616 -336
  7. package/dist/chunk-2JZ55G3X.js.map +1 -0
  8. package/dist/{chunk-ACARS7NG.js → chunk-4CLBJ2NA.js} +3 -3
  9. package/dist/{chunk-ULIAUMQD.js → chunk-4DLHM6LI.js} +6 -2
  10. package/dist/{chunk-ULIAUMQD.js.map → chunk-4DLHM6LI.js.map} +1 -1
  11. package/dist/{chunk-2Z4V5THE.js → chunk-7BONPRR2.js} +2 -2
  12. package/dist/{chunk-AVRE45DO.js → chunk-CI5KGCX5.js} +3 -3
  13. package/dist/{chunk-E4LAXVQE.js → chunk-E4IYX7LD.js} +2 -2
  14. package/dist/{chunk-A4MPCXZ7.js → chunk-ECDJM6UB.js} +2 -2
  15. package/dist/{chunk-7IMI64LW.js → chunk-EFDXX5MC.js} +3 -3
  16. package/dist/{chunk-ZM3S6PTN.js → chunk-FKTLAPXJ.js} +3 -3
  17. package/dist/{chunk-3XLDANPJ.js → chunk-FRHC77VK.js} +8 -8
  18. package/dist/{chunk-3N7TSFKQ.js → chunk-GET2MTLW.js} +2 -2
  19. package/dist/{chunk-PM4MZHQK.js → chunk-GYDO2WOR.js} +13 -5
  20. package/dist/{chunk-PM4MZHQK.js.map → chunk-GYDO2WOR.js.map} +1 -1
  21. package/dist/{chunk-ZQ5K3PG4.js → chunk-I2SW34K6.js} +403 -84
  22. package/dist/chunk-I2SW34K6.js.map +1 -0
  23. package/dist/{chunk-EYD6O5TQ.js → chunk-J435FU54.js} +6 -4
  24. package/dist/{chunk-EYD6O5TQ.js.map → chunk-J435FU54.js.map} +1 -1
  25. package/dist/{chunk-OGOE3NW5.js → chunk-K5WBFAR4.js} +4 -4
  26. package/dist/{chunk-5CADWTFO.js → chunk-MHIJSCPR.js} +446 -162
  27. package/dist/chunk-MHIJSCPR.js.map +1 -0
  28. package/dist/{chunk-FDY6YOFG.js → chunk-NZGNOXXW.js} +3 -2
  29. package/dist/{chunk-FDY6YOFG.js.map → chunk-NZGNOXXW.js.map} +1 -1
  30. package/dist/{chunk-CMRQR57K.js → chunk-PM63X3QG.js} +3 -3
  31. package/dist/{chunk-VY5WEC2D.js → chunk-QJIHSQZX.js} +791 -28
  32. package/dist/chunk-QJIHSQZX.js.map +1 -0
  33. package/dist/{chunk-FFJEERPZ.js → chunk-QLRH6KOT.js} +2 -2
  34. package/dist/{chunk-3UXCVSLJ.js → chunk-QMCHVYZB.js} +2 -2
  35. package/dist/{chunk-YXFQ3L56.js → chunk-RAWF4JOT.js} +8 -8
  36. package/dist/{chunk-TGDWL7FG.js → chunk-RLYXX3FQ.js} +2 -2
  37. package/dist/{chunk-KY2QMH3C.js → chunk-RR7Q2HFH.js} +6 -6
  38. package/dist/{chunk-ZGLIHPGJ.js → chunk-RUSP5PJR.js} +9 -1
  39. package/dist/chunk-RUSP5PJR.js.map +1 -0
  40. package/dist/{chunk-YEK3ZHO6.js → chunk-S4U3Z6ZS.js} +9 -6
  41. package/dist/{chunk-YEK3ZHO6.js.map → chunk-S4U3Z6ZS.js.map} +1 -1
  42. package/dist/chunk-TGGR6ST5.js +126 -0
  43. package/dist/chunk-TGGR6ST5.js.map +1 -0
  44. package/dist/{chunk-IZO437XR.js → chunk-VZCQRLXT.js} +7 -7
  45. package/dist/{chunk-4A6MSCNJ.js → chunk-WHZD2W6Q.js} +2 -2
  46. package/dist/{chunk-TA5HYM3H.js → chunk-XIFOAZ5B.js} +4 -4
  47. package/dist/{chunk-PR4QN5HX.js → chunk-ZPWHCABL.js} +6 -2
  48. package/dist/{chunk-YHBVFTRG.js → chunk-ZQEQVCIU.js} +2 -2
  49. package/dist/{chunk-ADIJIYFA.js → chunk-ZTRBMKXK.js} +5 -2
  50. package/dist/{chunk-ADIJIYFA.js.map → chunk-ZTRBMKXK.js.map} +1 -1
  51. package/dist/cli-circuit-breaker-J6UFONNE.js +13 -0
  52. package/dist/cli.d.ts +1 -1
  53. package/dist/cli.js +258 -150
  54. package/dist/cli.js.map +1 -1
  55. package/dist/{codebase-search-ZFJUVMVR.js → codebase-search-PWMWLU7O.js} +2 -2
  56. package/dist/{composite-router-V36PBE7B.js → composite-router-HQUSCJO4.js} +4 -4
  57. package/dist/consensus-vote-E2WJFEIJ.js +37 -0
  58. package/dist/{consensus-vote-types-DdruG9-X.d.ts → consensus-vote-types-CYBHW8vY.d.ts} +99 -2
  59. package/dist/{context-retriever-KCSSXI6X.js → context-retriever-5OVRAWNZ.js} +10 -10
  60. package/dist/{dist-QZLOLGIK.js → dist-A5STUO26.js} +792 -622
  61. package/dist/dist-A5STUO26.js.map +1 -0
  62. package/dist/{dist-OFXI4GYH.js → dist-C4457XNQ.js} +2 -2
  63. package/dist/doctor-deep-HJ3NQ365.js +12 -0
  64. package/dist/expert-bridge-MINXBC73.js +17 -0
  65. package/dist/{expert-config-OIIUMJFB.js → expert-config-53EBA7DT.js} +2 -2
  66. package/dist/factory-KC7BYHAP.js +21 -0
  67. package/dist/factory-ZG2FZYVA.js +14 -0
  68. package/dist/{improvement-review-AMVJW3SI.js → improvement-review-TDC4QH5P.js} +6 -6
  69. package/dist/index.d.ts +731 -339
  70. package/dist/index.js +31 -30
  71. package/dist/index.js.map +1 -1
  72. package/dist/{init-opencode-3UPZL2UQ.js → init-opencode-L3NT524E.js} +8 -7
  73. package/dist/{init-opencode-3UPZL2UQ.js.map → init-opencode-L3NT524E.js.map} +1 -1
  74. package/dist/issue-triage-CZPFNGB7.js +16 -0
  75. package/dist/{learning-persistence-C737Q6EP.js → learning-persistence-QFCQ5POD.js} +7 -3
  76. package/dist/{outcome-store-adapter-D3UDQFNQ.js → outcome-store-adapter-K4L3RUJE.js} +2 -2
  77. package/dist/{pr-reviewer-helpers-2WBM5GL7.js → pr-reviewer-helpers-PLKDVWYF.js} +6 -6
  78. package/dist/{registry-command-AXNA2H35.js → registry-command-HPKNLYUL.js} +4 -4
  79. package/dist/{repo-analyze-JZEMBE6R.js → repo-analyze-UJOWFGNM.js} +2 -2
  80. package/dist/{repo-security-plan-P2KJ4FDT.js → repo-security-plan-HSYGGVEJ.js} +5 -5
  81. package/dist/research-helpers-synthesize-IQHDU27S.js +14 -0
  82. package/dist/{routing-memory-7RNR6A45.js → routing-memory-OGUOL7UF.js} +4 -4
  83. package/dist/{session-memory-2J2UBZJA.js → session-memory-HQWAXH3C.js} +5 -5
  84. package/dist/{setup-command-UF7EQKAL.js → setup-command-CNYIKBY7.js} +13 -13
  85. package/dist/setup-config-HYX3BRSE.js +10 -0
  86. package/dist/{setup-custom-api-AZMHKIHE.js → setup-custom-api-W7EDVKWR.js} +5 -5
  87. package/dist/{tool-memory-MIZVB4ZT.js → tool-memory-Z2B7CAH7.js} +7 -7
  88. package/dist/unified-registry-UFNSWKZA.js +24 -0
  89. package/dist/{weather-report-WZKEEAC7.js → weather-report-GX7OIUL2.js} +4 -4
  90. package/package.json +12 -12
  91. package/dist/chunk-5CADWTFO.js.map +0 -1
  92. package/dist/chunk-5GQMP7QN.js.map +0 -1
  93. package/dist/chunk-RPT5WZAT.js.map +0 -1
  94. package/dist/chunk-VY5WEC2D.js.map +0 -1
  95. package/dist/chunk-ZGLIHPGJ.js.map +0 -1
  96. package/dist/chunk-ZQ5K3PG4.js.map +0 -1
  97. package/dist/cli-circuit-breaker-XRXLO2V6.js +0 -13
  98. package/dist/consensus-vote-3REPKLK4.js +0 -36
  99. package/dist/dist-QZLOLGIK.js.map +0 -1
  100. package/dist/doctor-deep-WID6FQ2F.js +0 -12
  101. package/dist/expert-bridge-F4UMZFWS.js +0 -17
  102. package/dist/factory-B3SPS47O.js +0 -21
  103. package/dist/factory-YVHULPTE.js +0 -14
  104. package/dist/issue-triage-U3VC5TKV.js +0 -16
  105. package/dist/research-helpers-synthesize-UHWT62F2.js +0 -14
  106. package/dist/setup-config-Y3S2L4RD.js +0 -10
  107. package/dist/unified-registry-V4AZ6UYA.js +0 -24
  108. /package/dist/{child-mcp-config-M7WR4XBB.js.map → child-mcp-config-R67B2KM6.js.map} +0 -0
  109. /package/dist/{chunk-VTTPYENR.js.map → chunk-2CLFX73Y.js.map} +0 -0
  110. /package/dist/{chunk-ACARS7NG.js.map → chunk-4CLBJ2NA.js.map} +0 -0
  111. /package/dist/{chunk-2Z4V5THE.js.map → chunk-7BONPRR2.js.map} +0 -0
  112. /package/dist/{chunk-AVRE45DO.js.map → chunk-CI5KGCX5.js.map} +0 -0
  113. /package/dist/{chunk-E4LAXVQE.js.map → chunk-E4IYX7LD.js.map} +0 -0
  114. /package/dist/{chunk-A4MPCXZ7.js.map → chunk-ECDJM6UB.js.map} +0 -0
  115. /package/dist/{chunk-7IMI64LW.js.map → chunk-EFDXX5MC.js.map} +0 -0
  116. /package/dist/{chunk-ZM3S6PTN.js.map → chunk-FKTLAPXJ.js.map} +0 -0
  117. /package/dist/{chunk-3XLDANPJ.js.map → chunk-FRHC77VK.js.map} +0 -0
  118. /package/dist/{chunk-3N7TSFKQ.js.map → chunk-GET2MTLW.js.map} +0 -0
  119. /package/dist/{chunk-OGOE3NW5.js.map → chunk-K5WBFAR4.js.map} +0 -0
  120. /package/dist/{chunk-CMRQR57K.js.map → chunk-PM63X3QG.js.map} +0 -0
  121. /package/dist/{chunk-FFJEERPZ.js.map → chunk-QLRH6KOT.js.map} +0 -0
  122. /package/dist/{chunk-3UXCVSLJ.js.map → chunk-QMCHVYZB.js.map} +0 -0
  123. /package/dist/{chunk-YXFQ3L56.js.map → chunk-RAWF4JOT.js.map} +0 -0
  124. /package/dist/{chunk-TGDWL7FG.js.map → chunk-RLYXX3FQ.js.map} +0 -0
  125. /package/dist/{chunk-KY2QMH3C.js.map → chunk-RR7Q2HFH.js.map} +0 -0
  126. /package/dist/{chunk-IZO437XR.js.map → chunk-VZCQRLXT.js.map} +0 -0
  127. /package/dist/{chunk-4A6MSCNJ.js.map → chunk-WHZD2W6Q.js.map} +0 -0
  128. /package/dist/{chunk-TA5HYM3H.js.map → chunk-XIFOAZ5B.js.map} +0 -0
  129. /package/dist/{chunk-PR4QN5HX.js.map → chunk-ZPWHCABL.js.map} +0 -0
  130. /package/dist/{chunk-YHBVFTRG.js.map → chunk-ZQEQVCIU.js.map} +0 -0
  131. /package/dist/{cli-circuit-breaker-XRXLO2V6.js.map → cli-circuit-breaker-J6UFONNE.js.map} +0 -0
  132. /package/dist/{codebase-search-ZFJUVMVR.js.map → codebase-search-PWMWLU7O.js.map} +0 -0
  133. /package/dist/{composite-router-V36PBE7B.js.map → composite-router-HQUSCJO4.js.map} +0 -0
  134. /package/dist/{consensus-vote-3REPKLK4.js.map → consensus-vote-E2WJFEIJ.js.map} +0 -0
  135. /package/dist/{context-retriever-KCSSXI6X.js.map → context-retriever-5OVRAWNZ.js.map} +0 -0
  136. /package/dist/{dist-OFXI4GYH.js.map → dist-C4457XNQ.js.map} +0 -0
  137. /package/dist/{doctor-deep-WID6FQ2F.js.map → doctor-deep-HJ3NQ365.js.map} +0 -0
  138. /package/dist/{expert-bridge-F4UMZFWS.js.map → expert-bridge-MINXBC73.js.map} +0 -0
  139. /package/dist/{expert-config-OIIUMJFB.js.map → expert-config-53EBA7DT.js.map} +0 -0
  140. /package/dist/{factory-B3SPS47O.js.map → factory-KC7BYHAP.js.map} +0 -0
  141. /package/dist/{factory-YVHULPTE.js.map → factory-ZG2FZYVA.js.map} +0 -0
  142. /package/dist/{improvement-review-AMVJW3SI.js.map → improvement-review-TDC4QH5P.js.map} +0 -0
  143. /package/dist/{issue-triage-U3VC5TKV.js.map → issue-triage-CZPFNGB7.js.map} +0 -0
  144. /package/dist/{learning-persistence-C737Q6EP.js.map → learning-persistence-QFCQ5POD.js.map} +0 -0
  145. /package/dist/{outcome-store-adapter-D3UDQFNQ.js.map → outcome-store-adapter-K4L3RUJE.js.map} +0 -0
  146. /package/dist/{pr-reviewer-helpers-2WBM5GL7.js.map → pr-reviewer-helpers-PLKDVWYF.js.map} +0 -0
  147. /package/dist/{registry-command-AXNA2H35.js.map → registry-command-HPKNLYUL.js.map} +0 -0
  148. /package/dist/{repo-analyze-JZEMBE6R.js.map → repo-analyze-UJOWFGNM.js.map} +0 -0
  149. /package/dist/{repo-security-plan-P2KJ4FDT.js.map → repo-security-plan-HSYGGVEJ.js.map} +0 -0
  150. /package/dist/{research-helpers-synthesize-UHWT62F2.js.map → research-helpers-synthesize-IQHDU27S.js.map} +0 -0
  151. /package/dist/{routing-memory-7RNR6A45.js.map → routing-memory-OGUOL7UF.js.map} +0 -0
  152. /package/dist/{session-memory-2J2UBZJA.js.map → session-memory-HQWAXH3C.js.map} +0 -0
  153. /package/dist/{setup-command-UF7EQKAL.js.map → setup-command-CNYIKBY7.js.map} +0 -0
  154. /package/dist/{setup-config-Y3S2L4RD.js.map → setup-config-HYX3BRSE.js.map} +0 -0
  155. /package/dist/{setup-custom-api-AZMHKIHE.js.map → setup-custom-api-W7EDVKWR.js.map} +0 -0
  156. /package/dist/{tool-memory-MIZVB4ZT.js.map → tool-memory-Z2B7CAH7.js.map} +0 -0
  157. /package/dist/{unified-registry-V4AZ6UYA.js.map → unified-registry-UFNSWKZA.js.map} +0 -0
  158. /package/dist/{weather-report-WZKEEAC7.js.map → weather-report-GX7OIUL2.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -13,19 +13,17 @@ import {
13
13
  generateSummary,
14
14
  parseFindings,
15
15
  sumFindings
16
- } from "./chunk-ZM3S6PTN.js";
17
- import "./chunk-TGDWL7FG.js";
16
+ } from "./chunk-FKTLAPXJ.js";
17
+ import "./chunk-RLYXX3FQ.js";
18
18
  import {
19
19
  buildOpenAICompatAdapters,
20
- loadUsageEvents,
21
- readOpenAICompatEnv,
22
- rollupByModel
23
- } from "./chunk-5GQMP7QN.js";
20
+ readOpenAICompatEnv
21
+ } from "./chunk-27DRQWON.js";
24
22
  import {
25
23
  setupCommandAsync,
26
24
  verifyCommand
27
- } from "./chunk-KY2QMH3C.js";
28
- import "./chunk-FFJEERPZ.js";
25
+ } from "./chunk-RR7Q2HFH.js";
26
+ import "./chunk-QLRH6KOT.js";
29
27
  import {
30
28
  AuthHandler,
31
29
  DEFAULT_EXPERTS,
@@ -144,18 +142,18 @@ import {
144
142
  validateCommand,
145
143
  validateWorkflow,
146
144
  wrapInMarkdownFence
147
- } from "./chunk-RPT5WZAT.js";
148
- import "./chunk-3N7TSFKQ.js";
145
+ } from "./chunk-2JZ55G3X.js";
146
+ import "./chunk-GET2MTLW.js";
149
147
  import "./chunk-3ACDP4E6.js";
150
148
  import {
151
149
  CATEGORY_DISPLAY_NAMES,
152
150
  DEFAULT_PR_REVIEW_CONFIG
153
151
  } from "./chunk-WAYGXUSM.js";
154
- import "./chunk-CMRQR57K.js";
155
- import "./chunk-AVRE45DO.js";
152
+ import "./chunk-PM63X3QG.js";
153
+ import "./chunk-CI5KGCX5.js";
156
154
  import {
157
155
  shutdownExpertBridge
158
- } from "./chunk-YXFQ3L56.js";
156
+ } from "./chunk-RAWF4JOT.js";
159
157
  import {
160
158
  ConsensusVoteInputSchema,
161
159
  DEFAULT_VOTE_TIMEOUT_MS,
@@ -164,24 +162,27 @@ import {
164
162
  VoteThresholdSchema,
165
163
  executeVoting,
166
164
  registerConsensusVoteTool
167
- } from "./chunk-ZQ5K3PG4.js";
165
+ } from "./chunk-I2SW34K6.js";
166
+ import {
167
+ loadUsageEvents,
168
+ rollupByModel
169
+ } from "./chunk-TGGR6ST5.js";
168
170
  import {
169
171
  synthesizeResearch
170
- } from "./chunk-7IMI64LW.js";
172
+ } from "./chunk-EFDXX5MC.js";
171
173
  import {
172
174
  classifyTrust,
173
175
  createFullGitHubProvider,
174
176
  evaluatePolicy,
175
177
  parsePRUrl
176
- } from "./chunk-EYD6O5TQ.js";
177
- import "./chunk-ULIAUMQD.js";
178
+ } from "./chunk-J435FU54.js";
179
+ import "./chunk-4DLHM6LI.js";
178
180
  import {
179
181
  ReputationCache,
180
182
  sanitizeInput
181
- } from "./chunk-3UXCVSLJ.js";
183
+ } from "./chunk-QMCHVYZB.js";
182
184
  import {
183
185
  ImprovementReviewInputSchema,
184
- JsonlStore,
185
186
  calculateFitnessScore,
186
187
  classifySignalPriority,
187
188
  consensusFor,
@@ -193,10 +194,10 @@ import {
193
194
  registerImprovementReviewTool,
194
195
  runImprovementReview,
195
196
  scanForSecrets
196
- } from "./chunk-5CADWTFO.js";
197
+ } from "./chunk-MHIJSCPR.js";
197
198
  import {
198
199
  createDefaultPolicyFirewall
199
- } from "./chunk-ACARS7NG.js";
200
+ } from "./chunk-4CLBJ2NA.js";
200
201
  import "./chunk-HFOQKCD2.js";
201
202
  import {
202
203
  PaperStatusSchema,
@@ -220,20 +221,20 @@ import {
220
221
  loadSourcesRegistry,
221
222
  rankDiscoveredItems,
222
223
  saveSourcesRegistry
223
- } from "./chunk-YEK3ZHO6.js";
224
+ } from "./chunk-S4U3Z6ZS.js";
224
225
  import {
225
226
  resolveToken
226
- } from "./chunk-YHBVFTRG.js";
227
+ } from "./chunk-ZQEQVCIU.js";
227
228
  import {
228
229
  loadPapersRegistry,
229
230
  loadTechniquesRegistry,
230
231
  savePapersRegistry
231
- } from "./chunk-VTTPYENR.js";
232
+ } from "./chunk-2CLFX73Y.js";
232
233
  import {
233
234
  MemoryError,
234
235
  shutdownToolMemory
235
- } from "./chunk-PM4MZHQK.js";
236
- import "./chunk-FDY6YOFG.js";
236
+ } from "./chunk-GYDO2WOR.js";
237
+ import "./chunk-NZGNOXXW.js";
237
238
  import {
238
239
  CustomExpertDefinitionSchema,
239
240
  DATA_SUBDIRECTORIES,
@@ -252,7 +253,7 @@ import {
252
253
  loadConfig,
253
254
  runDoctor,
254
255
  validateNexusEnv
255
- } from "./chunk-3XLDANPJ.js";
256
+ } from "./chunk-FRHC77VK.js";
256
257
  import "./chunk-NUBSJGQZ.js";
257
258
  import {
258
259
  capitalize,
@@ -263,20 +264,20 @@ import "./chunk-ZM4O442V.js";
263
264
  import "./chunk-PQHVC4BD.js";
264
265
  import {
265
266
  createUnifiedRegistry
266
- } from "./chunk-TA5HYM3H.js";
267
+ } from "./chunk-XIFOAZ5B.js";
267
268
  import {
268
269
  createAllAdapters,
269
270
  getAvailableClis,
270
271
  isRecord,
271
272
  probeAllClis
272
- } from "./chunk-IZO437XR.js";
273
+ } from "./chunk-VZCQRLXT.js";
273
274
  import {
274
275
  DEFAULTS
275
- } from "./chunk-4A6MSCNJ.js";
276
- import "./chunk-A4MPCXZ7.js";
277
- import "./chunk-ADIJIYFA.js";
278
- import "./chunk-2Z4V5THE.js";
279
- import "./chunk-E4LAXVQE.js";
276
+ } from "./chunk-WHZD2W6Q.js";
277
+ import "./chunk-ECDJM6UB.js";
278
+ import "./chunk-ZTRBMKXK.js";
279
+ import "./chunk-7BONPRR2.js";
280
+ import "./chunk-E4IYX7LD.js";
280
281
  import {
281
282
  API_TIMEOUTS,
282
283
  AgentCapability,
@@ -288,6 +289,7 @@ import {
288
289
  ErrorCode,
289
290
  INPUT_MODALITIES,
290
291
  INTERNAL_TIMEOUTS,
292
+ JsonlStore,
291
293
  LinUCBBandit,
292
294
  MCP_TIMEOUTS,
293
295
  NexusError,
@@ -349,7 +351,7 @@ import {
349
351
  validateTimeout,
350
352
  writeEmptyLine,
351
353
  writeLine
352
- } from "./chunk-VY5WEC2D.js";
354
+ } from "./chunk-QJIHSQZX.js";
353
355
  import {
354
356
  applyPortableMode,
355
357
  detectSandbox,
@@ -358,8 +360,8 @@ import {
358
360
  getPerRepoSubdirs,
359
361
  nexusDataPath,
360
362
  sessionsDbPath
361
- } from "./chunk-ZGLIHPGJ.js";
362
- import "./chunk-PR4QN5HX.js";
363
+ } from "./chunk-RUSP5PJR.js";
364
+ import "./chunk-ZPWHCABL.js";
363
365
 
364
366
  // src/cli/cli-log-bootstrap.ts
365
367
  import { argv, env } from "process";
@@ -1843,6 +1845,7 @@ var BaseEvaluator = class {
1843
1845
  this.thresholds = { ...DEFAULT_THRESHOLDS, ...config?.thresholds };
1844
1846
  this.timeoutMs = config?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
1845
1847
  }
1848
+ role;
1846
1849
  log;
1847
1850
  thresholds;
1848
1851
  timeoutMs;
@@ -3181,7 +3184,7 @@ ${file.patch}
3181
3184
  violations: policyResult.violations
3182
3185
  });
3183
3186
  }
3184
- const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-2WBM5GL7.js");
3187
+ const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-PLKDVWYF.js");
3185
3188
  const body = formatReviewComment2(result);
3186
3189
  const postResult = await provider.createReview(pr.prNumber, body, result.decision);
3187
3190
  if (!postResult.ok) {
@@ -13969,6 +13972,108 @@ function scriptedIO() {
13969
13972
  };
13970
13973
  }
13971
13974
 
13975
+ // src/governance/claims-registry.ts
13976
+ import { existsSync as existsSync12, readFileSync as readFileSync6 } from "fs";
13977
+ import { parse as parseYaml2 } from "yaml";
13978
+ import { z as z8 } from "zod";
13979
+ var VerificationMethodSchema = z8.enum([
13980
+ "file-exists",
13981
+ "file-contains",
13982
+ "source-contains-all",
13983
+ "enum-member-count",
13984
+ "manifest-tool-count",
13985
+ "roadmap-status"
13986
+ ]);
13987
+ var ClaimStatusSchema = z8.enum([
13988
+ "verified",
13989
+ // backed by live evidence the runner checks every CI run
13990
+ "partial",
13991
+ // backed, but with a documented caveat (e.g. small-n eval)
13992
+ "aspirational",
13993
+ // roadmap; allowed only when the subject doc marks it roadmap
13994
+ "stale"
13995
+ // known-broken backing; tracked, must not regress to silent
13996
+ ]);
13997
+ var EvidenceTypeSchema = z8.enum(["test", "gate", "eval-artifact", "adr", "source"]);
13998
+ var VerificationSchema = z8.object({
13999
+ method: VerificationMethodSchema,
14000
+ /** Repo-root-relative path to the live backing evidence. */
14001
+ path: z8.string().min(1),
14002
+ /**
14003
+ * Expected value. Numeric for `enum-member-count` / `manifest-tool-count`,
14004
+ * string for `file-contains` / `roadmap-status`. Unused by `file-exists`.
14005
+ */
14006
+ expected: z8.union([z8.number().int().nonnegative(), z8.string().min(1)]).optional(),
14007
+ /** Target symbol name (e.g. the exported `z.enum` const) for count methods. */
14008
+ symbol: z8.string().min(1).optional(),
14009
+ /**
14010
+ * Literal the claim's `subject` doc must contain (#3877). When present, the
14011
+ * runner verifies the doc making the claim — not just the source of truth —
14012
+ * so README/ARCHITECTURE drift fails the gate. Omit only for claims whose
14013
+ * `subject` IS the verification `path` (e.g. `roadmap-status`).
14014
+ */
14015
+ subjectContains: z8.string().min(1).optional()
14016
+ }).strict().superRefine((v, ctx) => {
14017
+ const needsNumber = v.method === "enum-member-count" || v.method === "manifest-tool-count";
14018
+ const needsString = v.method === "file-contains" || v.method === "source-contains-all" || v.method === "roadmap-status";
14019
+ if (needsNumber && typeof v.expected !== "number") {
14020
+ ctx.addIssue({
14021
+ code: "custom",
14022
+ message: `method '${v.method}' requires a numeric 'expected'`,
14023
+ path: ["expected"]
14024
+ });
14025
+ }
14026
+ if (needsString && typeof v.expected !== "string") {
14027
+ ctx.addIssue({
14028
+ code: "custom",
14029
+ message: `method '${v.method}' requires a string 'expected'`,
14030
+ path: ["expected"]
14031
+ });
14032
+ }
14033
+ if (v.method === "enum-member-count" && v.symbol === void 0) {
14034
+ ctx.addIssue({
14035
+ code: "custom",
14036
+ message: `method 'enum-member-count' requires a 'symbol'`,
14037
+ path: ["symbol"]
14038
+ });
14039
+ }
14040
+ });
14041
+ var ClaimEntrySchema = z8.object({
14042
+ /** Stable, kebab-case identifier; never reused. */
14043
+ id: z8.string().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, "id must be kebab-case"),
14044
+ /** Human-readable claim text (<=25 words). */
14045
+ claim: z8.string().min(1).refine((s) => s.trim().split(/\s+/).length <= 25, "claim must be <=25 words"),
14046
+ /** Repo-root-relative doc that makes the claim (e.g. README.md). */
14047
+ subject: z8.string().min(1),
14048
+ status: ClaimStatusSchema,
14049
+ evidenceType: EvidenceTypeSchema,
14050
+ verification: VerificationSchema,
14051
+ /** ISO date (YYYY-MM-DD) the claim was last manually verified. */
14052
+ lastVerified: z8.string().regex(/^\d{4}-\d{2}-\d{2}$/, "lastVerified must be YYYY-MM-DD"),
14053
+ /** Optional caveat surfaced in reports (required-ish for `partial`). */
14054
+ caveat: z8.string().optional()
14055
+ }).strict();
14056
+ var ClaimsRegistrySchema = z8.object({
14057
+ version: z8.number().int().positive(),
14058
+ claims: z8.array(ClaimEntrySchema).min(1).superRefine((claims, ctx) => {
14059
+ const seen = /* @__PURE__ */ new Set();
14060
+ for (const [i, c] of claims.entries()) {
14061
+ if (seen.has(c.id)) {
14062
+ ctx.addIssue({
14063
+ code: "custom",
14064
+ message: `duplicate claim id '${c.id}'`,
14065
+ path: [i, "id"]
14066
+ });
14067
+ }
14068
+ seen.add(c.id);
14069
+ }
14070
+ })
14071
+ }).strict();
14072
+
14073
+ // src/governance/claims-verify.ts
14074
+ import { existsSync as existsSync13, readFileSync as readFileSync7 } from "fs";
14075
+ import { isAbsolute as isAbsolute2, join as join12 } from "path";
14076
+
13972
14077
  // src/cli/fitness-audit.ts
13973
14078
  var COLORS = colors;
13974
14079
  function formatScore(score, max) {
@@ -14429,11 +14534,11 @@ async function releaseNotesCommand(args) {
14429
14534
  }
14430
14535
 
14431
14536
  // src/cli/release-validate-command.ts
14432
- import { readFileSync as readFileSync7 } from "fs";
14537
+ import { readFileSync as readFileSync9 } from "fs";
14433
14538
 
14434
14539
  // src/cli/release-validate-helpers.ts
14435
14540
  import { execSync as execSync2 } from "child_process";
14436
- import { existsSync as existsSync12, readFileSync as readFileSync6 } from "fs";
14541
+ import { existsSync as existsSync14, readFileSync as readFileSync8 } from "fs";
14437
14542
  async function validateSecurity(options) {
14438
14543
  const startTime = Date.now();
14439
14544
  const findings = [];
@@ -14452,7 +14557,7 @@ async function validateSecurity(options) {
14452
14557
  remediation: "Run npm audit fix or review and update vulnerable dependencies."
14453
14558
  });
14454
14559
  }
14455
- if (existsSync12(".env")) {
14560
+ if (existsSync14(".env")) {
14456
14561
  findings.push({
14457
14562
  severity: "error",
14458
14563
  category: "security",
@@ -14548,7 +14653,7 @@ async function validateArchitecture2(options) {
14548
14653
  async function validateDocumentation(options) {
14549
14654
  const startTime = Date.now();
14550
14655
  const findings = [];
14551
- if (!existsSync12("CHANGELOG.md")) {
14656
+ if (!existsSync14("CHANGELOG.md")) {
14552
14657
  findings.push({
14553
14658
  severity: "error",
14554
14659
  category: "docs",
@@ -14556,7 +14661,7 @@ async function validateDocumentation(options) {
14556
14661
  description: "No CHANGELOG.md found in repository root.",
14557
14662
  remediation: "Create CHANGELOG.md following Keep a Changelog format."
14558
14663
  });
14559
- } else if (!readFileSync6("CHANGELOG.md", "utf-8").includes(options.version)) {
14664
+ } else if (!readFileSync8("CHANGELOG.md", "utf-8").includes(options.version)) {
14560
14665
  findings.push({
14561
14666
  severity: "warning",
14562
14667
  category: "docs",
@@ -14566,7 +14671,7 @@ async function validateDocumentation(options) {
14566
14671
  });
14567
14672
  }
14568
14673
  const pkgCl = "packages/nexus-agents/CHANGELOG.md";
14569
- if (existsSync12(pkgCl) && !readFileSync6(pkgCl, "utf-8").includes(options.version)) {
14674
+ if (existsSync14(pkgCl) && !readFileSync8(pkgCl, "utf-8").includes(options.version)) {
14570
14675
  findings.push({
14571
14676
  severity: "warning",
14572
14677
  category: "docs",
@@ -14575,7 +14680,7 @@ async function validateDocumentation(options) {
14575
14680
  remediation: "Run pnpm changeset:version to generate changelog from pending changesets."
14576
14681
  });
14577
14682
  }
14578
- if (!existsSync12("README.md")) {
14683
+ if (!existsSync14("README.md")) {
14579
14684
  findings.push({
14580
14685
  severity: "error",
14581
14686
  category: "docs",
@@ -14584,8 +14689,8 @@ async function validateDocumentation(options) {
14584
14689
  remediation: "Create README.md with project overview and usage instructions."
14585
14690
  });
14586
14691
  }
14587
- if (existsSync12("CLAUDE.md")) {
14588
- const claudeMd = readFileSync6("CLAUDE.md", "utf-8");
14692
+ if (existsSync14("CLAUDE.md")) {
14693
+ const claudeMd = readFileSync8("CLAUDE.md", "utf-8");
14589
14694
  const match = claudeMd.match(/Governance Version: (\d{4}-\d{2}-\d{2})/);
14590
14695
  if (match?.[1]) {
14591
14696
  const governanceDate = new Date(match[1]);
@@ -14693,7 +14798,7 @@ var DEFAULT_OPTIONS2 = {
14693
14798
  };
14694
14799
  function readVersionFromPackage() {
14695
14800
  try {
14696
- const raw = JSON.parse(readFileSync7("package.json", "utf-8"));
14801
+ const raw = JSON.parse(readFileSync9("package.json", "utf-8"));
14697
14802
  if (typeof raw === "object" && raw !== null && "version" in raw) {
14698
14803
  const pkg = raw;
14699
14804
  return typeof pkg.version === "string" ? pkg.version : "unknown";
@@ -14807,7 +14912,7 @@ async function releaseValidateCommand(args) {
14807
14912
  }
14808
14913
 
14809
14914
  // src/cli/release-announce-command.ts
14810
- import { readFileSync as readFileSync8, existsSync as existsSync13 } from "fs";
14915
+ import { readFileSync as readFileSync10, existsSync as existsSync15 } from "fs";
14811
14916
 
14812
14917
  // src/cli/release-announce-types.ts
14813
14918
  var BLUESKY_LIMITS = {
@@ -14832,7 +14937,7 @@ function getBlueskyConfig() {
14832
14937
  }
14833
14938
  async function loadAtproto() {
14834
14939
  try {
14835
- const mod = await import("./dist-QZLOLGIK.js");
14940
+ const mod = await import("./dist-A5STUO26.js");
14836
14941
  return { AtpAgent: mod.AtpAgent, RichText: mod.RichText };
14837
14942
  } catch {
14838
14943
  return void 0;
@@ -14874,8 +14979,8 @@ var DEFAULT_OPTIONS3 = {
14874
14979
  verbose: false
14875
14980
  };
14876
14981
  function extractHighlightsFromChangelog(version) {
14877
- if (!existsSync13("CHANGELOG.md")) return [];
14878
- const changelog = readFileSync8("CHANGELOG.md", "utf-8");
14982
+ if (!existsSync15("CHANGELOG.md")) return [];
14983
+ const changelog = readFileSync10("CHANGELOG.md", "utf-8");
14879
14984
  const escaped = version.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
14880
14985
  const versionRegex = new RegExp(`## \\[${escaped}\\][^#]*`, "s");
14881
14986
  const match = changelog.match(versionRegex);
@@ -15144,7 +15249,7 @@ async function releaseAnnounceCommand(args) {
15144
15249
  version = args.options.version;
15145
15250
  } else {
15146
15251
  try {
15147
- const pkg = JSON.parse(readFileSync8("package.json", "utf-8"));
15252
+ const pkg = JSON.parse(readFileSync10("package.json", "utf-8"));
15148
15253
  if (!pkg.version) {
15149
15254
  console.error(`${colors.red}Error: Could not determine version${colors.reset}`);
15150
15255
  return 1;
@@ -16076,7 +16181,7 @@ function formatEvalDetails(baseline, reflective, improvement, datasetSize) {
16076
16181
  }
16077
16182
 
16078
16183
  // src/cli/auth-command.ts
16079
- import { existsSync as existsSync15, statSync, chmodSync } from "fs";
16184
+ import { existsSync as existsSync17, statSync, chmodSync } from "fs";
16080
16185
  function isValidAuthSubcommand(value) {
16081
16186
  return value === "init" || value === "show" || value === "rotate" || value === "help" || value === "status";
16082
16187
  }
@@ -16096,7 +16201,7 @@ function fixPermissions(filePath) {
16096
16201
  }
16097
16202
  function runAuthInit(options) {
16098
16203
  const tokenFile = options.tokenFile ?? getDefaultTokenPath();
16099
- const tokenExists = existsSync15(tokenFile);
16204
+ const tokenExists = existsSync17(tokenFile);
16100
16205
  if (tokenExists && options.force !== true) {
16101
16206
  return {
16102
16207
  success: false,
@@ -16120,7 +16225,7 @@ function runAuthInit(options) {
16120
16225
  }
16121
16226
  function runAuthShow(options) {
16122
16227
  const tokenFile = options.tokenFile ?? getDefaultTokenPath();
16123
- const tokenExists = existsSync15(tokenFile);
16228
+ const tokenExists = existsSync17(tokenFile);
16124
16229
  const token = readStoredToken(tokenFile);
16125
16230
  if (!tokenExists || token === void 0) {
16126
16231
  return {
@@ -16141,7 +16246,7 @@ function runAuthShow(options) {
16141
16246
  }
16142
16247
  function runAuthRotate(options) {
16143
16248
  const tokenFile = options.tokenFile ?? getDefaultTokenPath();
16144
- const tokenExists = existsSync15(tokenFile);
16249
+ const tokenExists = existsSync17(tokenFile);
16145
16250
  if (!tokenExists) {
16146
16251
  return {
16147
16252
  success: false,
@@ -16177,14 +16282,14 @@ function runAuthCommand(options) {
16177
16282
  success: true,
16178
16283
  operation: "help",
16179
16284
  tokenFile: getDefaultTokenPath(),
16180
- tokenExists: existsSync15(getDefaultTokenPath())
16285
+ tokenExists: existsSync17(getDefaultTokenPath())
16181
16286
  };
16182
16287
  default:
16183
16288
  return {
16184
16289
  success: false,
16185
16290
  operation: "help",
16186
16291
  tokenFile: getDefaultTokenPath(),
16187
- tokenExists: existsSync15(getDefaultTokenPath()),
16292
+ tokenExists: existsSync17(getDefaultTokenPath()),
16188
16293
  error: `Unknown subcommand: ${subcommand}`
16189
16294
  };
16190
16295
  }
@@ -16773,22 +16878,22 @@ function isValidCommand(value) {
16773
16878
  }
16774
16879
 
16775
16880
  // src/cli-commands-handlers.ts
16776
- import { existsSync as existsSync20 } from "fs";
16881
+ import { existsSync as existsSync22 } from "fs";
16777
16882
 
16778
16883
  // src/cli/init-portable.ts
16779
16884
  import {
16780
- existsSync as existsSync19,
16885
+ existsSync as existsSync21,
16781
16886
  mkdirSync as mkdirSync5,
16782
16887
  readdirSync,
16783
16888
  statSync as statSync2,
16784
16889
  appendFileSync as appendFileSync2,
16785
- readFileSync as readFileSync11
16890
+ readFileSync as readFileSync13
16786
16891
  } from "fs";
16787
- import { resolve as resolve10, join as join15, isAbsolute as isAbsolute2 } from "path";
16892
+ import { resolve as resolve10, join as join16, isAbsolute as isAbsolute3 } from "path";
16788
16893
 
16789
16894
  // src/cli/mcp-config-emitter.ts
16790
- import { existsSync as existsSync16, readFileSync as readFileSync9, writeFileSync as writeFileSync5, appendFileSync } from "fs";
16791
- import { join as join12 } from "path";
16895
+ import { existsSync as existsSync18, readFileSync as readFileSync11, writeFileSync as writeFileSync5, appendFileSync } from "fs";
16896
+ import { join as join13 } from "path";
16792
16897
  var MCP_CONFIG_FILENAME = ".mcp.json";
16793
16898
  var NEXUS_SERVER_KEY = "nexus-agents";
16794
16899
  function buildNexusServerEntry(dataDir, commandPath) {
@@ -16811,10 +16916,10 @@ function entriesEqual(a, b) {
16811
16916
  return true;
16812
16917
  }
16813
16918
  function loadExistingConfig(path21) {
16814
- if (!existsSync16(path21)) return { ok: true, value: void 0 };
16919
+ if (!existsSync18(path21)) return { ok: true, value: void 0 };
16815
16920
  let raw;
16816
16921
  try {
16817
- raw = readFileSync9(path21, "utf-8");
16922
+ raw = readFileSync11(path21, "utf-8");
16818
16923
  } catch (e) {
16819
16924
  return { ok: false, error: e instanceof Error ? e.message : String(e) };
16820
16925
  }
@@ -16848,12 +16953,12 @@ function decideEmission(existing, desired, force) {
16848
16953
  return { kind: "write", nextConfig: { ...existing, mcpServers: nextServers } };
16849
16954
  }
16850
16955
  function autoGitignoreMcpConfig(workspaceDir, dryRun) {
16851
- const gitDir = join12(workspaceDir, ".git");
16852
- if (!existsSync16(gitDir)) return false;
16853
- const gitignorePath = join12(workspaceDir, ".gitignore");
16956
+ const gitDir = join13(workspaceDir, ".git");
16957
+ if (!existsSync18(gitDir)) return false;
16958
+ const gitignorePath = join13(workspaceDir, ".gitignore");
16854
16959
  let existing = "";
16855
- if (existsSync16(gitignorePath)) {
16856
- existing = readFileSync9(gitignorePath, "utf-8");
16960
+ if (existsSync18(gitignorePath)) {
16961
+ existing = readFileSync11(gitignorePath, "utf-8");
16857
16962
  const already = existing.split("\n").some((l) => l.trim() === MCP_CONFIG_FILENAME || l.trim() === `/${MCP_CONFIG_FILENAME}`);
16858
16963
  if (already) return false;
16859
16964
  }
@@ -16865,7 +16970,7 @@ function autoGitignoreMcpConfig(workspaceDir, dryRun) {
16865
16970
  return true;
16866
16971
  }
16867
16972
  function emitMcpConfig(options) {
16868
- const mcpConfigPath = join12(options.workspaceDir, MCP_CONFIG_FILENAME);
16973
+ const mcpConfigPath = join13(options.workspaceDir, MCP_CONFIG_FILENAME);
16869
16974
  const dryRun = options.dryRun === true;
16870
16975
  const force = options.force === true;
16871
16976
  const desired = buildNexusServerEntry(options.dataDir, options.commandPath);
@@ -16903,13 +17008,13 @@ function makeFailure(mcpConfigPath, error) {
16903
17008
 
16904
17009
  // src/cli/portable-installer.ts
16905
17010
  import { execFile as execFile2 } from "child_process";
16906
- import { existsSync as existsSync18, mkdirSync as mkdirSync4, rmSync, writeFileSync as writeFileSync7 } from "fs";
16907
- import { join as join14 } from "path";
17011
+ import { existsSync as existsSync20, mkdirSync as mkdirSync4, rmSync, writeFileSync as writeFileSync7 } from "fs";
17012
+ import { join as join15 } from "path";
16908
17013
  import { promisify as promisify2 } from "util";
16909
17014
 
16910
17015
  // src/cli/bin-shim.ts
16911
- import { existsSync as existsSync17, readFileSync as readFileSync10, writeFileSync as writeFileSync6, chmodSync as chmodSync2, mkdirSync as mkdirSync3 } from "fs";
16912
- import { join as join13 } from "path";
17016
+ import { existsSync as existsSync19, readFileSync as readFileSync12, writeFileSync as writeFileSync6, chmodSync as chmodSync2, mkdirSync as mkdirSync3 } from "fs";
17017
+ import { join as join14 } from "path";
16913
17018
  var SHIM_BASENAME = "nexus-agents";
16914
17019
  var SHIM_MODE = 493;
16915
17020
  function buildShimContents(cliEntryPath) {
@@ -16923,18 +17028,18 @@ function buildShimContents(cliEntryPath) {
16923
17028
  return lines.join("\n");
16924
17029
  }
16925
17030
  function writeBinShim(options) {
16926
- const shimPath = join13(options.binDir, SHIM_BASENAME);
17031
+ const shimPath = join14(options.binDir, SHIM_BASENAME);
16927
17032
  const desired = buildShimContents(options.cliEntryPath);
16928
17033
  const dryRun = options.dryRun === true;
16929
17034
  try {
16930
- if (existsSync17(shimPath)) {
16931
- const current = readFileSync10(shimPath, "utf-8");
17035
+ if (existsSync19(shimPath)) {
17036
+ const current = readFileSync12(shimPath, "utf-8");
16932
17037
  if (current === desired) {
16933
17038
  return { success: true, shimPath, written: false, alreadyMatched: true, error: null };
16934
17039
  }
16935
17040
  }
16936
17041
  if (!dryRun) {
16937
- if (!existsSync17(options.binDir)) mkdirSync3(options.binDir, { recursive: true });
17042
+ if (!existsSync19(options.binDir)) mkdirSync3(options.binDir, { recursive: true });
16938
17043
  writeFileSync6(shimPath, desired, "utf-8");
16939
17044
  chmodSync2(shimPath, SHIM_MODE);
16940
17045
  }
@@ -16969,10 +17074,10 @@ function writeInstallManifest(cliDir, version) {
16969
17074
  description: "Local install root for portable nexus-agents (generated; do not commit)",
16970
17075
  dependencies: { "nexus-agents": version }
16971
17076
  };
16972
- writeFileSync7(join14(cliDir, "package.json"), JSON.stringify(manifest, null, 2) + "\n", "utf-8");
17077
+ writeFileSync7(join15(cliDir, "package.json"), JSON.stringify(manifest, null, 2) + "\n", "utf-8");
16973
17078
  }
16974
17079
  function isAlreadyInstalled(cliDir) {
16975
- return existsSync18(join14(cliDir, "node_modules", "nexus-agents", "package.json"));
17080
+ return existsSync20(join15(cliDir, "node_modules", "nexus-agents", "package.json"));
16976
17081
  }
16977
17082
  async function spawnNpmInstall(cliDir) {
16978
17083
  await execFileAsync2("npm", ["install", "--no-audit", "--no-fund", "--silent"], {
@@ -16988,7 +17093,7 @@ function cleanupOnFailure(cliDir) {
16988
17093
  }
16989
17094
  async function runNpmStep(ctx) {
16990
17095
  try {
16991
- if (!existsSync18(ctx.cliDir)) mkdirSync4(ctx.cliDir, { recursive: true });
17096
+ if (!existsSync20(ctx.cliDir)) mkdirSync4(ctx.cliDir, { recursive: true });
16992
17097
  writeInstallManifest(ctx.cliDir, ctx.version);
16993
17098
  await spawnNpmInstall(ctx.cliDir);
16994
17099
  return void 0;
@@ -16999,8 +17104,8 @@ async function runNpmStep(ctx) {
16999
17104
  }
17000
17105
  }
17001
17106
  async function installPortable(options) {
17002
- const cliDir = join14(options.dataDir, CLI_SUBDIR);
17003
- const binDir = join14(options.dataDir, BIN_SUBDIR);
17107
+ const cliDir = join15(options.dataDir, CLI_SUBDIR);
17108
+ const binDir = join15(options.dataDir, BIN_SUBDIR);
17004
17109
  const versionResolution = resolveInstallVersion(options.version);
17005
17110
  if (!versionResolution.ok) {
17006
17111
  return {
@@ -17021,7 +17126,7 @@ async function installPortable(options) {
17021
17126
  }
17022
17127
  const npmFailure = await runNpmStep(ctx);
17023
17128
  if (npmFailure !== void 0) return npmFailure;
17024
- const shim = writeBinShim({ binDir, cliEntryPath: join14(cliDir, CLI_ENTRY_RELATIVE) });
17129
+ const shim = writeBinShim({ binDir, cliEntryPath: join15(cliDir, CLI_ENTRY_RELATIVE) });
17025
17130
  if (!shim.success) {
17026
17131
  cleanupOnFailure(cliDir);
17027
17132
  return {
@@ -17035,14 +17140,14 @@ async function installPortable(options) {
17035
17140
  return { success: true, ...ctx, shim, skipped: false, error: null };
17036
17141
  }
17037
17142
  function uninstallPortable(options) {
17038
- const cliDir = join14(options.dataDir, CLI_SUBDIR);
17039
- const binDir = join14(options.dataDir, BIN_SUBDIR);
17143
+ const cliDir = join15(options.dataDir, CLI_SUBDIR);
17144
+ const binDir = join15(options.dataDir, BIN_SUBDIR);
17040
17145
  const removed = [];
17041
17146
  const notPresent = [];
17042
17147
  const dryRun = options.dryRun === true;
17043
17148
  try {
17044
17149
  for (const dir of [cliDir, binDir]) {
17045
- if (!existsSync18(dir)) {
17150
+ if (!existsSync20(dir)) {
17046
17151
  notPresent.push(dir);
17047
17152
  continue;
17048
17153
  }
@@ -17056,8 +17161,8 @@ function uninstallPortable(options) {
17056
17161
  }
17057
17162
  }
17058
17163
  function findBinShim(dataDir) {
17059
- const shimPath = join14(dataDir, BIN_SUBDIR, "nexus-agents");
17060
- return existsSync18(shimPath) ? shimPath : void 0;
17164
+ const shimPath = join15(dataDir, BIN_SUBDIR, "nexus-agents");
17165
+ return existsSync20(shimPath) ? shimPath : void 0;
17061
17166
  }
17062
17167
 
17063
17168
  // src/cli/init-portable.ts
@@ -17067,16 +17172,16 @@ function resolveTargetPath(rawPath) {
17067
17172
  if (rawPath === void 0 || rawPath === "") {
17068
17173
  return resolve10(process.cwd(), DEFAULT_PORTABLE_DIRNAME);
17069
17174
  }
17070
- return isAbsolute2(rawPath) ? rawPath : resolve10(process.cwd(), rawPath);
17175
+ return isAbsolute3(rawPath) ? rawPath : resolve10(process.cwd(), rawPath);
17071
17176
  }
17072
17177
  function isNonEmpty(dir) {
17073
- if (!existsSync19(dir)) return false;
17178
+ if (!existsSync21(dir)) return false;
17074
17179
  const stat2 = statSync2(dir);
17075
17180
  if (!stat2.isDirectory()) return true;
17076
17181
  return readdirSync(dir).length > 0;
17077
17182
  }
17078
17183
  function ensureDir(path21, dryRun, created, alreadyExisted, mode) {
17079
- if (existsSync19(path21)) {
17184
+ if (existsSync21(path21)) {
17080
17185
  alreadyExisted.push(path21);
17081
17186
  return;
17082
17187
  }
@@ -17086,13 +17191,13 @@ function ensureDir(path21, dryRun, created, alreadyExisted, mode) {
17086
17191
  created.push(path21);
17087
17192
  }
17088
17193
  function maybeUpdateGitignore(workspaceDir, portableDirName, dryRun) {
17089
- const gitDir = join15(workspaceDir, ".git");
17090
- if (!existsSync19(gitDir)) return false;
17091
- const gitignorePath = join15(workspaceDir, ".gitignore");
17194
+ const gitDir = join16(workspaceDir, ".git");
17195
+ if (!existsSync21(gitDir)) return false;
17196
+ const gitignorePath = join16(workspaceDir, ".gitignore");
17092
17197
  const entry = `${portableDirName}/`;
17093
17198
  let existing = "";
17094
- if (existsSync19(gitignorePath)) {
17095
- existing = readFileSync11(gitignorePath, "utf-8");
17199
+ if (existsSync21(gitignorePath)) {
17200
+ existing = readFileSync13(gitignorePath, "utf-8");
17096
17201
  if (existing.split("\n").some((l) => l.trim() === entry || l.trim() === portableDirName)) {
17097
17202
  return false;
17098
17203
  }
@@ -17105,18 +17210,18 @@ function maybeUpdateGitignore(workspaceDir, portableDirName, dryRun) {
17105
17210
  return true;
17106
17211
  }
17107
17212
  function inspectTarget(target) {
17108
- const exists = existsSync19(target);
17213
+ const exists = existsSync21(target);
17109
17214
  if (!exists) return { exists: false, nonEmpty: false, isExistingNexusDir: false };
17110
17215
  const nonEmpty = isNonEmpty(target);
17111
17216
  const stat2 = statSync2(target);
17112
- const isExistingNexusDir = stat2.isDirectory() && existsSync19(join15(target, "audit"));
17217
+ const isExistingNexusDir = stat2.isDirectory() && existsSync21(join16(target, "audit"));
17113
17218
  return { exists, nonEmpty, isExistingNexusDir };
17114
17219
  }
17115
17220
  function createDataLayout(target, dryRun, created, alreadyExisted) {
17116
17221
  ensureDir(target, dryRun, created, alreadyExisted);
17117
17222
  for (const subdir of DATA_SUBDIRECTORIES) {
17118
17223
  const mode = RESTRICTED_SUBDIRS.has(subdir) ? 448 : void 0;
17119
- ensureDir(join15(target, subdir), dryRun, created, alreadyExisted, mode);
17224
+ ensureDir(join16(target, subdir), dryRun, created, alreadyExisted, mode);
17120
17225
  }
17121
17226
  }
17122
17227
  function makeResult(opts) {
@@ -17647,7 +17752,7 @@ function startImprovementReviewScheduler(options) {
17647
17752
  let running = false;
17648
17753
  const runOnce = async () => {
17649
17754
  try {
17650
- const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-AMVJW3SI.js");
17755
+ const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-TDC4QH5P.js");
17651
17756
  const input = ImprovementReviewInputSchema2.parse({ fileIssues });
17652
17757
  const result = await runImprovementReview2(input, { logger: logger19 });
17653
17758
  logger19.info("Scheduled improvement_review complete", {
@@ -18081,8 +18186,8 @@ async function initUpstreamServers(gatewayConfig, server, logger19) {
18081
18186
  servers: upstreamServers.length,
18082
18187
  tools: tools.length
18083
18188
  });
18084
- const { z: z10 } = await import("zod");
18085
- const passthroughSchema = z10.looseObject({});
18189
+ const { z: z11 } = await import("zod");
18190
+ const passthroughSchema = z11.looseObject({});
18086
18191
  for (const tool of tools) {
18087
18192
  const toolName = tool.name;
18088
18193
  const desc = tool.description ?? `Upstream tool: ${toolName}`;
@@ -19584,7 +19689,7 @@ function adaptConfigToLibrary(config) {
19584
19689
  }
19585
19690
  function createBeliefPromoter() {
19586
19691
  return async (event) => {
19587
- const { getToolMemory } = await import("./tool-memory-MIZVB4ZT.js");
19692
+ const { getToolMemory } = await import("./tool-memory-Z2B7CAH7.js");
19588
19693
  const tm = getToolMemory();
19589
19694
  await tm.recordBelief(
19590
19695
  `skill:${event.name}`,
@@ -20335,8 +20440,8 @@ function printFirstRunHint() {
20335
20440
  const isTTY = process.stderr.isTTY;
20336
20441
  if (!isTTY) return;
20337
20442
  const dataDir = getNexusDataDir();
20338
- const hasConfig = existsSync20("./.nexus-agents/nexus-agents.yaml") || existsSync20("./.nexus-agents/nexus-agents.yml") || existsSync20("./nexus-agents.yaml") || existsSync20("./nexus-agents.yml");
20339
- if (existsSync20(dataDir) || hasConfig) return;
20443
+ const hasConfig = existsSync22("./.nexus-agents/nexus-agents.yaml") || existsSync22("./.nexus-agents/nexus-agents.yml") || existsSync22("./nexus-agents.yaml") || existsSync22("./nexus-agents.yml");
20444
+ if (existsSync22(dataDir) || hasConfig) return;
20340
20445
  process.stderr.write(
20341
20446
  "\n\x1B[36mnexus-agents\x1B[0m: First time? Run \x1B[1mnexus-agents setup\x1B[0m to configure.\n\n"
20342
20447
  );
@@ -20451,7 +20556,7 @@ async function handleResearchCommand(args) {
20451
20556
  }
20452
20557
  }
20453
20558
  async function handleRegistryCommand(args) {
20454
- const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-AXNA2H35.js");
20559
+ const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-HPKNLYUL.js");
20455
20560
  const subcommand = args.subcommand;
20456
20561
  if (!isValidRegistrySubcommand(subcommand)) {
20457
20562
  process.stdout.write(`${formatRegistryUsage()}
@@ -20499,7 +20604,7 @@ async function handleVerifyCommand(args) {
20499
20604
  async function handleDoctorCommand(args) {
20500
20605
  const exitCode = await doctorCommand({ fix: args.options.fix });
20501
20606
  if (args.options.deep) {
20502
- const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-WID6FQ2F.js");
20607
+ const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-HJ3NQ365.js");
20503
20608
  const diag = runDeepDiagnostics2();
20504
20609
  process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
20505
20610
  }
@@ -20543,7 +20648,7 @@ async function handleInitCommand(args) {
20543
20648
  process.exit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
20544
20649
  }
20545
20650
  async function runInitOpencodeFlow(args) {
20546
- const { runInitOpencode } = await import("./init-opencode-3UPZL2UQ.js");
20651
+ const { runInitOpencode } = await import("./init-opencode-L3NT524E.js");
20547
20652
  const opencodePath = args.options.opencode;
20548
20653
  if (opencodePath === void 0 || opencodePath === "") {
20549
20654
  process.stderr.write("Error: --opencode requires a path argument.\n");
@@ -20570,7 +20675,7 @@ async function runInitOpencodeFlow(args) {
20570
20675
  process.exit(EXIT_CODES.SUCCESS);
20571
20676
  }
20572
20677
  async function renderOpencodeValidate(opencodePath) {
20573
- const { runOpencodeValidate } = await import("./init-opencode-3UPZL2UQ.js");
20678
+ const { runOpencodeValidate } = await import("./init-opencode-L3NT524E.js");
20574
20679
  const result = await runOpencodeValidate(opencodePath);
20575
20680
  if (!result.ok) {
20576
20681
  process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
@@ -20610,7 +20715,7 @@ async function handleSetupCommandAsync(args) {
20610
20715
  process.exit(exitCode === 0 ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
20611
20716
  }
20612
20717
  async function runCustomApiSetup(args) {
20613
- const { configureCustomApi } = await import("./setup-custom-api-AZMHKIHE.js");
20718
+ const { configureCustomApi } = await import("./setup-custom-api-W7EDVKWR.js");
20614
20719
  const baseUrl = args.options.customApi;
20615
20720
  if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
20616
20721
  const input = {
@@ -22174,7 +22279,7 @@ function handleStatusCommand2(args) {
22174
22279
 
22175
22280
  // src/cli/scenario-command.ts
22176
22281
  import { readdir as readdir4 } from "fs/promises";
22177
- import { join as join17, resolve as resolve12 } from "path";
22282
+ import { join as join18, resolve as resolve12 } from "path";
22178
22283
 
22179
22284
  // src/testing/e2e/scenario-runner.ts
22180
22285
  import { readFile as readFile7 } from "fs/promises";
@@ -22544,7 +22649,7 @@ async function handleRun(args) {
22544
22649
  process.exit(EXIT_CODES.SERVER_START_FAILED);
22545
22650
  }
22546
22651
  const runner = createScenarioRunner();
22547
- const fixturePath = join17(FIXTURES_DIR, `${name}${SCENARIO_SUFFIX}`);
22652
+ const fixturePath = join18(FIXTURES_DIR, `${name}${SCENARIO_SUFFIX}`);
22548
22653
  try {
22549
22654
  const fixture = await runner.loadFixture(fixturePath);
22550
22655
  const result = await runner.run(fixture);
@@ -22958,7 +23063,10 @@ var ACTION_BY_CATEGORY = {
22958
23063
  "tech-debt": "refactor",
22959
23064
  security: "investigate",
22960
23065
  // conservative — security is p0/unanimous-gated regardless
22961
- consensus: "investigate"
23066
+ consensus: "investigate",
23067
+ // #3852: a deprecation/consolidation candidate is a human decision, never an
23068
+ // autonomous code change — investigate only (Epic D ratification path).
23069
+ "tool-fitness": "investigate"
22962
23070
  };
22963
23071
  function clip(s, max) {
22964
23072
  return s.length > max ? s.slice(0, max) : s;
@@ -23078,10 +23186,10 @@ function stripRefsPrefix(ref) {
23078
23186
  import { execFile as execFile4 } from "child_process";
23079
23187
  import { promisify as promisify4 } from "util";
23080
23188
  import { writeFile as writeFile6, mkdir as mkdir5 } from "fs/promises";
23081
- import { join as join18, dirname as dirname11 } from "path";
23189
+ import { join as join19, dirname as dirname11 } from "path";
23082
23190
 
23083
23191
  // src/mcp/tools/improvement-remediation-capability.ts
23084
- import { z as z8 } from "zod";
23192
+ import { z as z9 } from "zod";
23085
23193
  var PHASE_CAPABILITIES = {
23086
23194
  research: /* @__PURE__ */ new Set(["untrusted-input", "secrets"]),
23087
23195
  implement: /* @__PURE__ */ new Set(["repo-write", "secrets"])
@@ -23122,7 +23230,7 @@ var CapabilityLedger = class {
23122
23230
  }
23123
23231
  }
23124
23232
  };
23125
- var RemediationActionKindSchema = z8.enum([
23233
+ var RemediationActionKindSchema = z9.enum([
23126
23234
  "investigate",
23127
23235
  "adjust-routing",
23128
23236
  "add-test",
@@ -23130,19 +23238,19 @@ var RemediationActionKindSchema = z8.enum([
23130
23238
  "update-docs",
23131
23239
  "fix-bug"
23132
23240
  ]);
23133
- var RemediationStepSchema = z8.object({
23241
+ var RemediationStepSchema = z9.object({
23134
23242
  kind: RemediationActionKindSchema,
23135
- description: z8.string().min(1).max(500),
23243
+ description: z9.string().min(1).max(500),
23136
23244
  /** Optional path hint; bounded inert string, validated for traversal at use. */
23137
- targetPath: z8.string().min(1).max(300).optional()
23245
+ targetPath: z9.string().min(1).max(300).optional()
23138
23246
  }).strict();
23139
- var RemediationPlanSchema = z8.object({
23247
+ var RemediationPlanSchema = z9.object({
23140
23248
  /** Source signal key (mirrors ImprovementSignal.signalKey). */
23141
- signalKey: z8.string().min(1).max(200),
23142
- /** Signal category (mirrors SignalCategory). */
23143
- category: z8.enum(["routing", "tech-debt", "bug", "security", "consensus"]),
23144
- summary: z8.string().min(1).max(1e3),
23145
- steps: z8.array(RemediationStepSchema).min(1).max(20)
23249
+ signalKey: z9.string().min(1).max(200),
23250
+ /** Signal category (mirrors SignalCategory; 'tool-fitness' added #3852). */
23251
+ category: z9.enum(["routing", "tech-debt", "bug", "security", "consensus", "tool-fitness"]),
23252
+ summary: z9.string().min(1).max(1e3),
23253
+ steps: z9.array(RemediationStepSchema).min(1).max(20)
23146
23254
  }).strict();
23147
23255
  function parseRemediationPlan(raw) {
23148
23256
  const result = RemediationPlanSchema.safeParse(raw);
@@ -23229,12 +23337,12 @@ function makeGitWorktreeOps(repoRoot) {
23229
23337
  };
23230
23338
  return {
23231
23339
  async addWorktree(branch, baseBranch) {
23232
- const path21 = join18(repoRoot, ".nexus-worktrees", branch.replace(/\//g, "_"));
23340
+ const path21 = join19(repoRoot, ".nexus-worktrees", branch.replace(/\//g, "_"));
23233
23341
  await git(["worktree", "add", "-b", branch, path21, baseBranch], repoRoot);
23234
23342
  return path21;
23235
23343
  },
23236
23344
  async writeFileIn(worktreePath, relPath, content) {
23237
- const abs = join18(worktreePath, relPath);
23345
+ const abs = join19(worktreePath, relPath);
23238
23346
  await mkdir5(dirname11(abs), { recursive: true });
23239
23347
  await writeFile6(abs, content, "utf8");
23240
23348
  },
@@ -23272,25 +23380,25 @@ function makeGhPrCreator() {
23272
23380
  }
23273
23381
 
23274
23382
  // src/mcp/tools/remediation-review.ts
23275
- import { z as z9 } from "zod";
23383
+ import { z as z10 } from "zod";
23276
23384
  function soakRefOf(record) {
23277
23385
  return `${record.signalKey}::${record.timestamp}`;
23278
23386
  }
23279
- var ReviewRecordSchema = z9.object({
23387
+ var ReviewRecordSchema = z10.object({
23280
23388
  /** Reference to the reviewed soak selection (`signalKey::timestamp`). */
23281
- soakRef: z9.string(),
23389
+ soakRef: z10.string(),
23282
23390
  /** ISO-8601 time the review was recorded. */
23283
- reviewedAt: z9.string(),
23391
+ reviewedAt: z10.string(),
23284
23392
  /** Always true — a persisted record is, by construction, a review. */
23285
- reviewed: z9.literal(true),
23393
+ reviewed: z10.literal(true),
23286
23394
  /** Whether the evaluator assessed the selection SOUND. */
23287
- sound: z9.boolean(),
23395
+ sound: z10.boolean(),
23288
23396
  /** Named evaluator who performed the review (required — the gate's named-evaluator criterion). */
23289
- evaluator: z9.string().min(1),
23397
+ evaluator: z10.string().min(1),
23290
23398
  /** Named owner accepting enforcement, recorded at sign-off time (optional per record). */
23291
- owner: z9.string().min(1).optional(),
23399
+ owner: z10.string().min(1).optional(),
23292
23400
  /** Free-text note (secret-scrubbed). */
23293
- note: z9.string().optional()
23401
+ note: z10.string().optional()
23294
23402
  });
23295
23403
  var REVIEW_MAX_RECORDS = 1e4;
23296
23404
  function getRemediationReviewFile() {
@@ -23998,18 +24106,18 @@ async function handleRemediationReviewCommand(args) {
23998
24106
  }
23999
24107
 
24000
24108
  // src/cli/migrate-command.ts
24001
- import { cpSync, existsSync as existsSync22, mkdirSync as mkdirSync6, readdirSync as readdirSync3 } from "fs";
24109
+ import { cpSync, existsSync as existsSync24, mkdirSync as mkdirSync6, readdirSync as readdirSync3 } from "fs";
24002
24110
  import { homedir } from "os";
24003
- import { join as join19 } from "path";
24111
+ import { join as join20 } from "path";
24004
24112
  var logger18 = createLogger({ component: "migrate-command" });
24005
- var HOMEDIR_DEFAULT_BASE = join19(homedir(), ".nexus-agents");
24113
+ var HOMEDIR_DEFAULT_BASE = join20(homedir(), ".nexus-agents");
24006
24114
  function countItems(dir) {
24007
- if (!existsSync22(dir)) return 0;
24115
+ if (!existsSync24(dir)) return 0;
24008
24116
  try {
24009
24117
  const entries = readdirSync3(dir, { withFileTypes: true });
24010
24118
  let n = 0;
24011
24119
  for (const e of entries) {
24012
- const p = join19(dir, e.name);
24120
+ const p = join20(dir, e.name);
24013
24121
  if (e.isDirectory()) {
24014
24122
  n += countItems(p);
24015
24123
  } else {
@@ -24051,7 +24159,7 @@ function checkEarlyExits(fromBase, toBase, dryRun) {
24051
24159
  summary: "No git repo detected from cwd. Run from inside a repo or pass --to <path> to choose an explicit destination."
24052
24160
  };
24053
24161
  }
24054
- if (!existsSync22(fromBase)) {
24162
+ if (!existsSync24(fromBase)) {
24055
24163
  return {
24056
24164
  fromBase,
24057
24165
  toBase,
@@ -24064,8 +24172,8 @@ function checkEarlyExits(fromBase, toBase, dryRun) {
24064
24172
  return null;
24065
24173
  }
24066
24174
  function planAndExecuteEntry(name, fromBase, toBase, perRepoSet, dryRun) {
24067
- const source = join19(fromBase, name);
24068
- const target = join19(toBase, name);
24175
+ const source = join20(fromBase, name);
24176
+ const target = join20(toBase, name);
24069
24177
  if (!perRepoSet.has(name)) {
24070
24178
  return { subdir: name, status: "skipped-not-per-repo", source, target: "", itemsCopied: 0 };
24071
24179
  }
@@ -24073,7 +24181,7 @@ function planAndExecuteEntry(name, fromBase, toBase, perRepoSet, dryRun) {
24073
24181
  if (items === 0) {
24074
24182
  return { subdir: name, status: "skipped-empty", source, target, itemsCopied: 0 };
24075
24183
  }
24076
- if (existsSync22(target) && readdirSync3(target).length > 0) {
24184
+ if (existsSync24(target) && readdirSync3(target).length > 0) {
24077
24185
  return { subdir: name, status: "skipped-exists", source, target, itemsCopied: 0 };
24078
24186
  }
24079
24187
  if (!dryRun) {
@@ -24085,7 +24193,7 @@ function planAndExecuteEntry(name, fromBase, toBase, perRepoSet, dryRun) {
24085
24193
  function resolveDefaultTarget(cwd) {
24086
24194
  const repoRoot = findRepoRoot(cwd);
24087
24195
  if (repoRoot === null) return null;
24088
- return join19(repoRoot, ".nexus-agents");
24196
+ return join20(repoRoot, ".nexus-agents");
24089
24197
  }
24090
24198
  function formatMigrationResult(result) {
24091
24199
  if (!result.success) {