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