nexus-agents 2.55.1 → 2.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/{adaptive-memory-SUNFPY2W.js → adaptive-memory-TSZEJUJC.js} +3 -3
  2. package/dist/{chunk-4FVISCDB.js → chunk-6QU4DJYW.js} +2 -2
  3. package/dist/{chunk-NYNBDP7M.js → chunk-7Y36JLES.js} +2 -2
  4. package/dist/{chunk-FWSTXEG2.js → chunk-AFSIP6JH.js} +99 -23
  5. package/dist/chunk-AFSIP6JH.js.map +1 -0
  6. package/dist/{chunk-BPMQRYGU.js → chunk-BOZ26RIB.js} +283 -79
  7. package/dist/chunk-BOZ26RIB.js.map +1 -0
  8. package/dist/{chunk-VKZKC4SM.js → chunk-EDGG3RQE.js} +2 -2
  9. package/dist/{chunk-2SPRLBOS.js → chunk-EZXOJZYE.js} +2 -2
  10. package/dist/{chunk-W5AJRK4U.js → chunk-GMOGKX4E.js} +2 -2
  11. package/dist/chunk-H43PABG4.js +402 -0
  12. package/dist/chunk-H43PABG4.js.map +1 -0
  13. package/dist/{chunk-IOU7F5PH.js → chunk-K7EA5OV4.js} +2 -2
  14. package/dist/chunk-NUBSJGQZ.js +14 -0
  15. package/dist/chunk-NUBSJGQZ.js.map +1 -0
  16. package/dist/{chunk-KRIFBGWZ.js → chunk-PTGBJFSD.js} +3 -3
  17. package/dist/{chunk-EKYT4NMD.js → chunk-QGZBCD2A.js} +24 -9
  18. package/dist/chunk-QGZBCD2A.js.map +1 -0
  19. package/dist/{chunk-XYCS5X3H.js → chunk-QNYNQ257.js} +422 -72
  20. package/dist/chunk-QNYNQ257.js.map +1 -0
  21. package/dist/{chunk-UOUJZIKH.js → chunk-R2Y57PM3.js} +38 -15
  22. package/dist/chunk-R2Y57PM3.js.map +1 -0
  23. package/dist/{chunk-RSUCXOQM.js → chunk-SXWZS2V4.js} +26 -53
  24. package/dist/chunk-SXWZS2V4.js.map +1 -0
  25. package/dist/{chunk-JERFBN73.js → chunk-TC46TRLR.js} +7 -17
  26. package/dist/chunk-TC46TRLR.js.map +1 -0
  27. package/dist/{chunk-3IDJSFWT.js → chunk-TFEFN37P.js} +2 -2
  28. package/dist/{chunk-Q5TKQWOI.js → chunk-V5CGWMYL.js} +2 -2
  29. package/dist/{chunk-TCQNNY4J.js → chunk-XEMRMZUN.js} +4 -4
  30. package/dist/chunk-Y7CD6AZW.js +2136 -0
  31. package/dist/chunk-Y7CD6AZW.js.map +1 -0
  32. package/dist/{chunk-R66AWJJ7.js → chunk-YU4NABXM.js} +2 -2
  33. package/dist/{chunk-KVWHK72T.js → chunk-ZL3IBCH6.js} +2356 -3687
  34. package/dist/chunk-ZL3IBCH6.js.map +1 -0
  35. package/dist/{chunk-VLVHPC72.js → chunk-ZUWOFHNC.js} +6 -6
  36. package/dist/{cli-circuit-breaker-7MCMHSDY.js → cli-circuit-breaker-SL73NWX2.js} +4 -4
  37. package/dist/cli.d.ts +9 -2
  38. package/dist/cli.js +468 -311
  39. package/dist/cli.js.map +1 -1
  40. package/dist/{composite-router-LXFOSMSE.js → composite-router-A7URDW4X.js} +2 -2
  41. package/dist/{consensus-vote-G6H532ME.js → consensus-vote-CQ2JP6DC.js} +9 -8
  42. package/dist/{doctor-deep-RKMOZSIS.js → doctor-deep-VN6KMUCG.js} +3 -3
  43. package/dist/{expert-bridge-KHHE42JP.js → expert-bridge-LT7PKUPS.js} +3 -3
  44. package/dist/{factory-KRNR7XHD.js → factory-FA7WDPZW.js} +5 -5
  45. package/dist/{factory-JVN47MFN.js → factory-FZ2KSVYC.js} +4 -4
  46. package/dist/index.d.ts +324 -16
  47. package/dist/index.js +84 -68
  48. package/dist/index.js.map +1 -1
  49. package/dist/{issue-triage-O3C7P66H.js → issue-triage-YYTE6KTC.js} +4 -4
  50. package/dist/{mcp-config-QRERKGR4.js → mcp-config-34XMRM64.js} +3 -3
  51. package/dist/{mobimem-FAOAXV3B.js → mobimem-QDBP37H7.js} +2 -2
  52. package/dist/model-registry.generated.json +17033 -0
  53. package/dist/registry-command-S46JJ2SX.js +580 -0
  54. package/dist/registry-command-S46JJ2SX.js.map +1 -0
  55. package/dist/{repo-security-plan-AZ5HMGFC.js → repo-security-plan-C3LLE3Z7.js} +3 -3
  56. package/dist/research-helpers-synthesize-NVQIWLQL.js +11 -0
  57. package/dist/{routing-memory-MXF45FXT.js → routing-memory-W3YWMLJM.js} +2 -2
  58. package/dist/{session-memory-HL5XDBIL.js → session-memory-DWF5Z2LC.js} +3 -3
  59. package/dist/{setup-command-B6AFJGZB.js → setup-command-6EJONTOU.js} +10 -7
  60. package/dist/{setup-config-PWK6WHMG.js → setup-config-JA5IX53Q.js} +3 -3
  61. package/dist/{setup-custom-api-XAWKRDWV.js → setup-custom-api-CSB26HWD.js} +7 -5
  62. package/dist/setup-custom-api-CSB26HWD.js.map +1 -0
  63. package/dist/{weather-report-XZ5CENHE.js → weather-report-YQSLX4MS.js} +2 -2
  64. package/package.json +1 -1
  65. package/dist/chunk-BPMQRYGU.js.map +0 -1
  66. package/dist/chunk-EKYT4NMD.js.map +0 -1
  67. package/dist/chunk-FWSTXEG2.js.map +0 -1
  68. package/dist/chunk-JERFBN73.js.map +0 -1
  69. package/dist/chunk-KVWHK72T.js.map +0 -1
  70. package/dist/chunk-OC7RMLN2.js +0 -839
  71. package/dist/chunk-OC7RMLN2.js.map +0 -1
  72. package/dist/chunk-RSUCXOQM.js.map +0 -1
  73. package/dist/chunk-UOUJZIKH.js.map +0 -1
  74. package/dist/chunk-XYCS5X3H.js.map +0 -1
  75. package/dist/research-helpers-synthesize-TFZIXBX3.js +0 -10
  76. package/dist/setup-custom-api-XAWKRDWV.js.map +0 -1
  77. /package/dist/{adaptive-memory-SUNFPY2W.js.map → adaptive-memory-TSZEJUJC.js.map} +0 -0
  78. /package/dist/{chunk-4FVISCDB.js.map → chunk-6QU4DJYW.js.map} +0 -0
  79. /package/dist/{chunk-NYNBDP7M.js.map → chunk-7Y36JLES.js.map} +0 -0
  80. /package/dist/{chunk-VKZKC4SM.js.map → chunk-EDGG3RQE.js.map} +0 -0
  81. /package/dist/{chunk-2SPRLBOS.js.map → chunk-EZXOJZYE.js.map} +0 -0
  82. /package/dist/{chunk-W5AJRK4U.js.map → chunk-GMOGKX4E.js.map} +0 -0
  83. /package/dist/{chunk-IOU7F5PH.js.map → chunk-K7EA5OV4.js.map} +0 -0
  84. /package/dist/{chunk-KRIFBGWZ.js.map → chunk-PTGBJFSD.js.map} +0 -0
  85. /package/dist/{chunk-3IDJSFWT.js.map → chunk-TFEFN37P.js.map} +0 -0
  86. /package/dist/{chunk-Q5TKQWOI.js.map → chunk-V5CGWMYL.js.map} +0 -0
  87. /package/dist/{chunk-TCQNNY4J.js.map → chunk-XEMRMZUN.js.map} +0 -0
  88. /package/dist/{chunk-R66AWJJ7.js.map → chunk-YU4NABXM.js.map} +0 -0
  89. /package/dist/{chunk-VLVHPC72.js.map → chunk-ZUWOFHNC.js.map} +0 -0
  90. /package/dist/{cli-circuit-breaker-7MCMHSDY.js.map → cli-circuit-breaker-SL73NWX2.js.map} +0 -0
  91. /package/dist/{composite-router-LXFOSMSE.js.map → composite-router-A7URDW4X.js.map} +0 -0
  92. /package/dist/{consensus-vote-G6H532ME.js.map → consensus-vote-CQ2JP6DC.js.map} +0 -0
  93. /package/dist/{doctor-deep-RKMOZSIS.js.map → doctor-deep-VN6KMUCG.js.map} +0 -0
  94. /package/dist/{expert-bridge-KHHE42JP.js.map → expert-bridge-LT7PKUPS.js.map} +0 -0
  95. /package/dist/{factory-JVN47MFN.js.map → factory-FA7WDPZW.js.map} +0 -0
  96. /package/dist/{factory-KRNR7XHD.js.map → factory-FZ2KSVYC.js.map} +0 -0
  97. /package/dist/{issue-triage-O3C7P66H.js.map → issue-triage-YYTE6KTC.js.map} +0 -0
  98. /package/dist/{mcp-config-QRERKGR4.js.map → mcp-config-34XMRM64.js.map} +0 -0
  99. /package/dist/{mobimem-FAOAXV3B.js.map → mobimem-QDBP37H7.js.map} +0 -0
  100. /package/dist/{repo-security-plan-AZ5HMGFC.js.map → repo-security-plan-C3LLE3Z7.js.map} +0 -0
  101. /package/dist/{research-helpers-synthesize-TFZIXBX3.js.map → research-helpers-synthesize-NVQIWLQL.js.map} +0 -0
  102. /package/dist/{routing-memory-MXF45FXT.js.map → routing-memory-W3YWMLJM.js.map} +0 -0
  103. /package/dist/{session-memory-HL5XDBIL.js.map → session-memory-DWF5Z2LC.js.map} +0 -0
  104. /package/dist/{setup-command-B6AFJGZB.js.map → setup-command-6EJONTOU.js.map} +0 -0
  105. /package/dist/{setup-config-PWK6WHMG.js.map → setup-config-JA5IX53Q.js.map} +0 -0
  106. /package/dist/{weather-report-XZ5CENHE.js.map → weather-report-YQSLX4MS.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -12,30 +12,25 @@ import {
12
12
  parseFindings,
13
13
  sumFindings
14
14
  } from "./chunk-6E3NMMEY.js";
15
- import "./chunk-4FVISCDB.js";
15
+ import "./chunk-6QU4DJYW.js";
16
16
  import {
17
- setupCommandAsync
18
- } from "./chunk-XYCS5X3H.js";
19
- import "./chunk-EKYT4NMD.js";
17
+ setupCommandAsync,
18
+ verifyCommand
19
+ } from "./chunk-QNYNQ257.js";
20
+ import "./chunk-QGZBCD2A.js";
20
21
  import {
21
22
  AuthHandler,
22
- CustomExpertDefinitionSchema,
23
- DEFAULTS,
24
23
  DEFAULT_EXPERTS,
25
24
  DEFAULT_SWE_BENCH_CONFIG,
26
25
  DEVELOPMENT_POLICY,
27
26
  ExpertFactory,
28
27
  FeedbackIntegration,
29
- MAX_SYSTEM_PROMPT_LENGTH,
30
28
  Orchestrator,
31
29
  PuppeteerOrchestrator,
32
30
  READONLY_POLICY,
33
31
  SwarmObserver,
34
- VALID_EXPERT_DOMAINS,
35
- VALID_EXPERT_TIERS,
36
32
  ValidationDashboard,
37
33
  WorkflowDefinitionSchema,
38
- adaptRoutingConfig,
39
34
  addResearchPaper,
40
35
  analyzeTools,
41
36
  createAgentStages,
@@ -61,7 +56,6 @@ import {
61
56
  createTestingExpert,
62
57
  createToolObservabilityProxy,
63
58
  createToolRateLimiterFactory,
64
- defaultConfig,
65
59
  detectBackend,
66
60
  discoverDeepMind,
67
61
  discoverGitHubRepos,
@@ -83,8 +77,6 @@ import {
83
77
  generateSwarmVisualization,
84
78
  generateSystemSummary,
85
79
  getCompletedInstanceIds,
86
- getConfig,
87
- getConfigManager,
88
80
  getDatasetInfo,
89
81
  getDefaultTokenPath,
90
82
  getEventBusStats,
@@ -103,7 +95,6 @@ import {
103
95
  initializeSandbox,
104
96
  initializeSica,
105
97
  loadAllExternalPacks,
106
- loadConfig,
107
98
  loadDataset,
108
99
  loadSourcesRegistry,
109
100
  loadWorkflowFile,
@@ -148,13 +139,12 @@ import {
148
139
  setGlobalToolRateLimiterFactory,
149
140
  validateArgs,
150
141
  validateCommand,
151
- validateNexusEnv,
152
142
  validateWorkflow,
153
143
  wrapInMarkdownFence
154
- } from "./chunk-KVWHK72T.js";
144
+ } from "./chunk-ZL3IBCH6.js";
155
145
  import {
156
146
  resolveToken
157
- } from "./chunk-2SPRLBOS.js";
147
+ } from "./chunk-EZXOJZYE.js";
158
148
  import {
159
149
  CATEGORY_DISPLAY_NAMES,
160
150
  DEFAULT_PR_REVIEW_CONFIG
@@ -170,57 +160,68 @@ import {
170
160
  registerConsensusVoteTool,
171
161
  shutdownToolMemory,
172
162
  validateTimeout
173
- } from "./chunk-BPMQRYGU.js";
174
- import "./chunk-R66AWJJ7.js";
163
+ } from "./chunk-BOZ26RIB.js";
164
+ import "./chunk-YU4NABXM.js";
175
165
  import {
176
166
  loadPapersRegistry,
177
167
  loadTechniquesRegistry,
178
168
  savePapersRegistry,
179
169
  synthesizeResearch
180
- } from "./chunk-JERFBN73.js";
170
+ } from "./chunk-TC46TRLR.js";
181
171
  import {
182
172
  classifyTrust,
183
173
  createFullGitHubProvider,
184
174
  evaluatePolicy,
185
175
  parsePRUrl,
186
176
  sanitizeInput
187
- } from "./chunk-FWSTXEG2.js";
188
- import "./chunk-IOU7F5PH.js";
189
- import "./chunk-Q5TKQWOI.js";
177
+ } from "./chunk-AFSIP6JH.js";
178
+ import "./chunk-K7EA5OV4.js";
179
+ import "./chunk-V5CGWMYL.js";
190
180
  import "./chunk-BC3M4VLP.js";
191
181
  import "./chunk-AP2FD37C.js";
192
182
  import "./chunk-BQ4YXGGQ.js";
193
183
  import "./chunk-ED6VQWNG.js";
194
184
  import {
195
- BUILT_IN_EXPERTS
196
- } from "./chunk-GJVHRJO2.js";
197
- import {
185
+ CustomExpertDefinitionSchema,
186
+ MAX_SYSTEM_PROMPT_LENGTH,
187
+ VALID_EXPERT_DOMAINS,
188
+ VALID_EXPERT_TIERS,
198
189
  VERSION,
190
+ adaptRoutingConfig,
199
191
  closeServer,
200
192
  connectTransport,
201
193
  createServer,
202
194
  doctorCommand,
195
+ getConfig,
196
+ getConfigManager,
203
197
  initDataDirectories,
204
- runDoctor
205
- } from "./chunk-OC7RMLN2.js";
206
- import "./chunk-NYNBDP7M.js";
198
+ loadConfig,
199
+ runDoctor,
200
+ validateNexusEnv
201
+ } from "./chunk-Y7CD6AZW.js";
202
+ import {
203
+ DEFAULTS
204
+ } from "./chunk-H43PABG4.js";
205
+ import "./chunk-NUBSJGQZ.js";
206
+ import "./chunk-GJVHRJO2.js";
207
+ import "./chunk-7Y36JLES.js";
207
208
  import {
208
209
  MemoryError
209
- } from "./chunk-3IDJSFWT.js";
210
+ } from "./chunk-TFEFN37P.js";
210
211
  import {
211
212
  capitalize,
212
213
  capitalizeKebab,
213
214
  truncateSentence
214
215
  } from "./chunk-633WH2ML.js";
215
- import "./chunk-VKZKC4SM.js";
216
- import "./chunk-KRIFBGWZ.js";
217
- import "./chunk-VLVHPC72.js";
216
+ import "./chunk-EDGG3RQE.js";
217
+ import "./chunk-PTGBJFSD.js";
218
+ import "./chunk-ZUWOFHNC.js";
218
219
  import {
219
220
  createAllAdapters,
220
221
  getAvailableClis,
221
222
  isRecord
222
- } from "./chunk-RSUCXOQM.js";
223
- import "./chunk-W5AJRK4U.js";
223
+ } from "./chunk-SXWZS2V4.js";
224
+ import "./chunk-GMOGKX4E.js";
224
225
  import {
225
226
  API_TIMEOUTS,
226
227
  AgentCapability,
@@ -285,7 +286,7 @@ import {
285
286
  toError,
286
287
  writeEmptyLine,
287
288
  writeLine
288
- } from "./chunk-UOUJZIKH.js";
289
+ } from "./chunk-R2Y57PM3.js";
289
290
  import "./chunk-CLYZ7FWP.js";
290
291
  import "./chunk-UP2VWCW5.js";
291
292
 
@@ -5836,7 +5837,7 @@ function recordVoteToGitHub(issueNumber, result) {
5836
5837
  async function runVote(options) {
5837
5838
  const threshold = THRESHOLD_MAP[options.threshold ?? "supermajority"] ?? "supermajority";
5838
5839
  const useQuick = options.quick === true;
5839
- const roles = useQuick ? ["architect", "security", "pm"] : ["architect", "security", "devex", "ai_ml", "pm", "catfish"];
5840
+ const roles = useQuick ? ["architect", "security", "scope_steward"] : ["architect", "security", "devex", "ai_ml", "pm", "catfish", "scope_steward"];
5840
5841
  const start = getTimeProvider().now();
5841
5842
  const requestedTimeoutMs = options.timeoutMs ?? DEFAULT_VOTE_TIMEOUT_MS;
5842
5843
  const { value: timeoutMs, clamped } = validateTimeout(requestedTimeoutMs);
@@ -9258,44 +9259,283 @@ function sanitizeTool(tool) {
9258
9259
  // src/indexer/entrypoint-cli-extractor.ts
9259
9260
  import { SyntaxKind } from "ts-morph";
9260
9261
  import * as path12 from "path";
9261
- function parseHelpTextCommands(helpText) {
9262
- const commands = [];
9263
- const lines = helpText.split("\n");
9264
- let inCommandsSection = false;
9265
- for (const line of lines) {
9266
- if (line.trim() === "COMMANDS:") {
9267
- inCommandsSection = true;
9268
- continue;
9269
- }
9270
- const trimmed = line.trim();
9271
- if (trimmed.endsWith(":") && trimmed !== "COMMANDS:" && !trimmed.startsWith("-")) {
9272
- inCommandsSection = false;
9273
- continue;
9274
- }
9275
- if (!inCommandsSection) continue;
9276
- const match = line.match(/^\s{2}(\S+(?:\s+\S+)?)\s{2,}(.+)$/);
9277
- if (match !== null) {
9278
- const cmdPart = match[1];
9279
- const descriptionPart = match[2];
9280
- if (cmdPart === void 0 || descriptionPart === void 0) continue;
9281
- const parts = cmdPart.trim().split(/\s+/);
9282
- const name = parts[0];
9283
- if (name === void 0) continue;
9284
- const subcommand = parts.length > 1 ? parts[1] : void 0;
9285
- const existing = commands.find((c) => c.name === name);
9286
- if (existing !== void 0 && subcommand !== void 0) {
9287
- existing.subcommands.push(subcommand);
9288
- } else if (existing === void 0) {
9289
- commands.push({
9290
- name,
9291
- description: descriptionPart.trim(),
9292
- subcommands: subcommand !== void 0 ? [subcommand] : []
9293
- });
9294
- }
9262
+
9263
+ // src/cli-command-catalog.ts
9264
+ var COMMAND_CATALOG = [
9265
+ // ── Essential ────────────────────────────────────────────────────────────
9266
+ {
9267
+ command: "(default)",
9268
+ description: "Start MCP server with stdio transport",
9269
+ audience: "essential"
9270
+ },
9271
+ {
9272
+ command: "hello",
9273
+ description: "Show welcome message and quick start (no API keys needed)",
9274
+ audience: "essential"
9275
+ },
9276
+ {
9277
+ command: "setup",
9278
+ description: "Configure CLI integration (MCP + .rules + data dirs)",
9279
+ audience: "essential"
9280
+ },
9281
+ {
9282
+ command: "verify",
9283
+ description: "Check install health (sqlite, adapters, config)",
9284
+ audience: "essential"
9285
+ },
9286
+ {
9287
+ command: "doctor",
9288
+ description: "Detailed system/adapter health check",
9289
+ audience: "essential"
9290
+ },
9291
+ {
9292
+ command: "config",
9293
+ description: "Manage configuration (init, get, set, list, export, import)",
9294
+ audience: "essential"
9295
+ },
9296
+ {
9297
+ command: "orchestrate",
9298
+ description: "Execute a task via CLI tools (standalone mode)",
9299
+ audience: "essential"
9300
+ },
9301
+ {
9302
+ command: "vote",
9303
+ description: "Run consensus vote on a proposal (5-6 agents)",
9304
+ audience: "essential"
9305
+ },
9306
+ {
9307
+ command: "workflow",
9308
+ description: "Manage and run workflow templates (list, run)",
9309
+ audience: "essential"
9310
+ },
9311
+ {
9312
+ command: "expert",
9313
+ description: "Manage expert agents (list, create, execute)",
9314
+ audience: "essential"
9315
+ },
9316
+ {
9317
+ command: "research",
9318
+ description: "Manage research registry (status, add, stats, refresh)",
9319
+ audience: "essential"
9320
+ },
9321
+ // ── Advanced ─────────────────────────────────────────────────────────────
9322
+ {
9323
+ command: "session",
9324
+ description: "Manage session persistence (list, show, export, delete)",
9325
+ audience: "advanced"
9326
+ },
9327
+ {
9328
+ command: "auth",
9329
+ description: "Manage MCP authentication tokens (init, show, rotate)",
9330
+ audience: "advanced"
9331
+ },
9332
+ {
9333
+ command: "status",
9334
+ description: "At-a-glance project health dashboard",
9335
+ audience: "advanced"
9336
+ },
9337
+ {
9338
+ command: "capabilities",
9339
+ description: "Show model capabilities matrix",
9340
+ audience: "advanced"
9341
+ },
9342
+ {
9343
+ command: "registry",
9344
+ description: "Inspect + refresh the dynamic model registry (doctor / refresh)",
9345
+ audience: "advanced"
9346
+ },
9347
+ {
9348
+ command: "review",
9349
+ description: "Review a GitHub PR (dogfooding helper)",
9350
+ audience: "advanced"
9351
+ },
9352
+ {
9353
+ command: "scaffold",
9354
+ description: "Generate project files from templates",
9355
+ audience: "advanced"
9356
+ },
9357
+ {
9358
+ command: "validate",
9359
+ description: "Run unified validation (doctor + fitness + config)",
9360
+ audience: "advanced"
9361
+ },
9362
+ {
9363
+ command: "index",
9364
+ description: "Generate and manage codebase index",
9365
+ audience: "advanced"
9366
+ },
9367
+ // ── Maintainer (hidden by default) ───────────────────────────────────────
9368
+ {
9369
+ command: "demo",
9370
+ description: "API-free exploration mode (marketing/demo flow)",
9371
+ audience: "maintainer"
9372
+ },
9373
+ {
9374
+ command: "hooks",
9375
+ description: "Claude CLI hook integration commands",
9376
+ audience: "maintainer"
9377
+ },
9378
+ {
9379
+ command: "routing-audit",
9380
+ description: "Debug model routing decisions",
9381
+ audience: "maintainer"
9382
+ },
9383
+ {
9384
+ command: "fitness-audit",
9385
+ description: "Run CLI orchestration fitness score audit",
9386
+ audience: "maintainer"
9387
+ },
9388
+ {
9389
+ command: "system-review",
9390
+ description: "Automated system review (5-phase checklist)",
9391
+ audience: "maintainer"
9392
+ },
9393
+ {
9394
+ command: "sprint",
9395
+ description: "Automated sprint planning from open issues",
9396
+ audience: "maintainer"
9397
+ },
9398
+ {
9399
+ command: "evaluate",
9400
+ description: "Self-evaluation of codebase components",
9401
+ audience: "maintainer"
9402
+ },
9403
+ {
9404
+ command: "issue",
9405
+ description: "Issue template validation and management",
9406
+ audience: "maintainer"
9407
+ },
9408
+ {
9409
+ command: "validation",
9410
+ description: "Learning validation dashboard",
9411
+ audience: "maintainer"
9412
+ },
9413
+ {
9414
+ command: "learning-metrics",
9415
+ description: "Aggregated learning metrics dashboard",
9416
+ audience: "maintainer"
9417
+ },
9418
+ {
9419
+ command: "swe-bench",
9420
+ description: "Run SWE-bench evaluation benchmark",
9421
+ audience: "maintainer"
9422
+ },
9423
+ {
9424
+ command: "atbench",
9425
+ description: "Run ATBench trajectory-safety evaluation",
9426
+ audience: "maintainer"
9427
+ },
9428
+ {
9429
+ command: "visualize",
9430
+ description: "Generate Mermaid diagrams and ASCII dashboards",
9431
+ audience: "maintainer"
9432
+ },
9433
+ {
9434
+ command: "health",
9435
+ description: "Swarm health metrics dashboard",
9436
+ audience: "maintainer"
9437
+ },
9438
+ {
9439
+ command: "release-notes",
9440
+ description: "Generate release notes from git commits",
9441
+ audience: "maintainer"
9442
+ },
9443
+ {
9444
+ command: "release-validate",
9445
+ description: "Run expert swarm validation for releases",
9446
+ audience: "maintainer"
9447
+ },
9448
+ {
9449
+ command: "release-announce",
9450
+ description: "Generate release announcements (blog, social)",
9451
+ audience: "maintainer"
9452
+ },
9453
+ // ── Internal (hidden everywhere; here for extractor/index completeness) ──
9454
+ {
9455
+ command: "server",
9456
+ // Synonym for the no-arg invocation — `nexus-agents` and
9457
+ // `nexus-agents server` both run `handleServerCommand`. Listed here for
9458
+ // extractor completeness; humans see `(default)` in --help.
9459
+ description: "Start MCP server with stdio transport (explicit form)",
9460
+ audience: "internal"
9461
+ },
9462
+ {
9463
+ command: "e2e-eval",
9464
+ description: "E2E evaluation scenario runner (dev loop)",
9465
+ audience: "internal"
9466
+ },
9467
+ {
9468
+ command: "memory-benchmark",
9469
+ description: "Memory-system benchmark runner (dev loop)",
9470
+ audience: "internal"
9471
+ },
9472
+ {
9473
+ command: "memory-eval",
9474
+ description: "Comparative memory evaluation benchmark (dev loop)",
9475
+ audience: "internal"
9476
+ },
9477
+ {
9478
+ command: "routing-ab",
9479
+ description: "A/B comparison of routing strategies (dev loop)",
9480
+ audience: "internal"
9481
+ },
9482
+ {
9483
+ command: "scenario",
9484
+ description: "Execute a named scenario from the testing framework",
9485
+ audience: "internal"
9486
+ },
9487
+ {
9488
+ command: "warm-up",
9489
+ description: "Warm the model/adapter caches before a run",
9490
+ audience: "internal"
9491
+ }
9492
+ ];
9493
+ function filterCatalog(showAll) {
9494
+ const visible = COMMAND_CATALOG.filter((e) => e.audience !== "internal");
9495
+ if (showAll) return visible;
9496
+ return visible.filter((e) => e.audience !== "maintainer");
9497
+ }
9498
+ function catalogForExtractors() {
9499
+ return COMMAND_CATALOG.filter((e) => e.command !== "(default)");
9500
+ }
9501
+ function groupByAudience(entries) {
9502
+ const groups = /* @__PURE__ */ new Map();
9503
+ for (const entry of entries) {
9504
+ const existing = groups.get(entry.audience) ?? [];
9505
+ existing.push(entry);
9506
+ groups.set(entry.audience, existing);
9507
+ }
9508
+ return groups;
9509
+ }
9510
+ var AUDIENCE_HEADINGS = {
9511
+ essential: "Essential \u2014 install, configure, run",
9512
+ advanced: "Advanced \u2014 day-to-day extras",
9513
+ maintainer: "Maintainer \u2014 benchmarks, releases, deep diagnostics",
9514
+ // Never rendered (filterCatalog strips internal before renderCommandsSection
9515
+ // iterates), but required by the Record<CommandAudience, string> contract.
9516
+ internal: "Internal \u2014 dev/eval loops (hidden from --help)"
9517
+ };
9518
+ function renderCommandsSection(showAll) {
9519
+ const filtered = filterCatalog(showAll);
9520
+ const groups = groupByAudience(filtered);
9521
+ const lines = [];
9522
+ const order = showAll ? ["essential", "advanced", "maintainer"] : ["essential", "advanced"];
9523
+ for (const audience of order) {
9524
+ const entries = groups.get(audience);
9525
+ if (entries === void 0 || entries.length === 0) continue;
9526
+ lines.push(` ${AUDIENCE_HEADINGS[audience]}`);
9527
+ for (const entry of entries) {
9528
+ lines.push(` ${entry.command.padEnd(16)} ${entry.description}`);
9295
9529
  }
9530
+ lines.push("");
9296
9531
  }
9297
- return commands;
9532
+ if (!showAll) {
9533
+ lines.push(" Run with --all to show maintainer commands (benchmarks, release tooling).");
9534
+ }
9535
+ return lines.join("\n").replace(/\n+$/, "");
9298
9536
  }
9537
+
9538
+ // src/indexer/entrypoint-cli-extractor.ts
9299
9539
  function extractCliOptions(sourceFile) {
9300
9540
  const options = /* @__PURE__ */ new Map();
9301
9541
  const configVar = sourceFile.getVariableDeclaration("PARSE_ARGS_CONFIG");
@@ -9389,46 +9629,54 @@ function getCommandOptions(name, cliOptions) {
9389
9629
  }
9390
9630
  return cmdOptions;
9391
9631
  }
9392
- function extractCliCommands(project, packageRoot, cliCommandsPath, cliTypesPath) {
9393
- const commands = [];
9632
+ function buildCommandSpec(entry, ctx) {
9633
+ const handlerName = `handle${toPascalCase(entry.command)}Command`;
9634
+ const handlerFunc = ctx.commandsFile.getFunction(handlerName);
9635
+ const sourceLine = handlerFunc?.getStartLineNumber() ?? 1;
9636
+ if (handlerFunc === void 0 && ctx.warnings !== void 0) {
9637
+ ctx.warnings.push(
9638
+ `CLI extraction: catalog entry "${entry.command}" has no matching ${handlerName} function in ${ctx.cliCommandsPath}. Check naming drift.`
9639
+ );
9640
+ }
9641
+ const cmdOptions = getCommandOptions(entry.command, ctx.cliOptions);
9642
+ const cmdSpec = {
9643
+ name: entry.command,
9644
+ description: entry.description,
9645
+ source_file: ctx.relativePath,
9646
+ source_line: sourceLine
9647
+ };
9648
+ if (cmdOptions.length > 0) {
9649
+ cmdSpec.options = cmdOptions;
9650
+ }
9651
+ return cmdSpec;
9652
+ }
9653
+ function extractCliCommands(project, packageRoot, cliCommandsPath, cliTypesPath, warnings) {
9394
9654
  const typesFullPath = path12.join(packageRoot, cliTypesPath);
9395
9655
  const typesFile = project.getSourceFile(typesFullPath);
9396
- let helpTextCommands = [];
9397
- let cliOptions = /* @__PURE__ */ new Map();
9398
- if (typesFile !== void 0) {
9399
- const helpTextVar = typesFile.getVariableDeclaration("HELP_TEXT");
9400
- if (helpTextVar !== void 0) {
9401
- const helpText = helpTextVar.getInitializer()?.getText() ?? "";
9402
- const cleanText = helpText.slice(1, -1).replace(/^\s*\n/, "").replace(/\n\s*$/, "");
9403
- helpTextCommands = parseHelpTextCommands(cleanText);
9404
- }
9405
- cliOptions = extractCliOptions(typesFile);
9656
+ if (typesFile === void 0 && warnings !== void 0) {
9657
+ warnings.push(
9658
+ `CLI extraction: types file not loaded (${typesFullPath}). PARSE_ARGS_CONFIG options will be missing from the manifest.`
9659
+ );
9406
9660
  }
9661
+ const cliOptions = typesFile !== void 0 ? extractCliOptions(typesFile) : /* @__PURE__ */ new Map();
9407
9662
  const commandsFullPath = path12.join(packageRoot, cliCommandsPath);
9408
9663
  const commandsFile = project.getSourceFile(commandsFullPath);
9409
- if (commandsFile === void 0) return commands;
9410
- const relativePath = path12.relative(process.cwd(), commandsFullPath);
9411
- for (const cmdMeta of helpTextCommands) {
9412
- if (cmdMeta.name === "(default)") continue;
9413
- const handlerName = `handle${toPascalCase(cmdMeta.name)}Command`;
9414
- const handlerFunc = commandsFile.getFunction(handlerName);
9415
- const sourceLine = handlerFunc?.getStartLineNumber() ?? 1;
9416
- const cmdOptions = getCommandOptions(cmdMeta.name, cliOptions);
9417
- const cmdSpec = {
9418
- name: cmdMeta.name,
9419
- description: cmdMeta.description,
9420
- source_file: relativePath,
9421
- source_line: sourceLine
9422
- };
9423
- if (cmdMeta.subcommands.length > 0) {
9424
- cmdSpec.subcommands = cmdMeta.subcommands;
9425
- }
9426
- if (cmdOptions.length > 0) {
9427
- cmdSpec.options = cmdOptions;
9664
+ if (commandsFile === void 0) {
9665
+ if (warnings !== void 0) {
9666
+ warnings.push(
9667
+ `CLI extraction: commands file not loaded (${commandsFullPath}). Returning zero commands.`
9668
+ );
9428
9669
  }
9429
- commands.push(cmdSpec);
9670
+ return [];
9430
9671
  }
9431
- return commands;
9672
+ const ctx = {
9673
+ commandsFile,
9674
+ relativePath: path12.relative(process.cwd(), commandsFullPath),
9675
+ cliOptions,
9676
+ cliCommandsPath,
9677
+ ...warnings !== void 0 && { warnings }
9678
+ };
9679
+ return catalogForExtractors().map((entry) => buildCommandSpec(entry, ctx));
9432
9680
  }
9433
9681
 
9434
9682
  // src/indexer/entrypoint-mcp-extractor.ts
@@ -9474,10 +9722,15 @@ function extractZodParameters(schemaObj) {
9474
9722
  }
9475
9723
  return params;
9476
9724
  }
9477
- function extractMcpTools(project, packageRoot, mcpToolsPath) {
9725
+ function extractMcpTools(project, packageRoot, mcpToolsPath, warnings) {
9478
9726
  const tools = [];
9479
9727
  const toolsDir = path13.join(packageRoot, mcpToolsPath);
9480
9728
  const toolFiles = project.getSourceFiles(`${toolsDir}/*.ts`);
9729
+ if (toolFiles.length === 0 && warnings !== void 0) {
9730
+ warnings.push(
9731
+ `MCP tool extraction: glob "${toolsDir}/*.ts" matched zero files. Check that the path exists and is included in the ts-morph project.`
9732
+ );
9733
+ }
9481
9734
  for (const sourceFile of toolFiles) {
9482
9735
  const filePath = sourceFile.getFilePath();
9483
9736
  const fileName = path13.basename(filePath);
@@ -9499,7 +9752,11 @@ function extractToolsFromFile(sourceFile, relativePath) {
9499
9752
  if (args.length < 2) continue;
9500
9753
  const nameArg = args[0];
9501
9754
  if (nameArg === void 0) continue;
9502
- const toolName = nameArg.getText().replace(/['"]/g, "");
9755
+ const nameKind = nameArg.getKind();
9756
+ if (nameKind !== SyntaxKind2.StringLiteral && nameKind !== SyntaxKind2.NoSubstitutionTemplateLiteral) {
9757
+ continue;
9758
+ }
9759
+ const toolName = nameArg.getText().replace(/['"`]/g, "");
9503
9760
  const { description, schemaArg } = extractToolMeta(callText, args, sourceFile);
9504
9761
  let parameters = [];
9505
9762
  if (schemaArg !== void 0) {
@@ -9591,6 +9848,11 @@ function createProject(opts) {
9591
9848
  project.addSourceFilesAtPaths([
9592
9849
  path14.join(opts.packageRoot, opts.cliCommandsPath),
9593
9850
  path14.join(opts.packageRoot, "src/cli-types.ts"),
9851
+ // HELP_TEXT was extracted to cli-help-text.ts in #293 (Jan 2026) and
9852
+ // cli-types.ts now only re-exports it. The extractor reads it via AST,
9853
+ // so we have to load the defining file — a bare re-export isn't enough.
9854
+ // Without this line the CLI command list silently came back empty.
9855
+ path14.join(opts.packageRoot, "src/cli-help-text.ts"),
9594
9856
  path14.join(opts.packageRoot, opts.mcpToolsPath, "*.ts")
9595
9857
  ]);
9596
9858
  return project;
@@ -9605,9 +9867,10 @@ function extractEntrypoints(options = {}) {
9605
9867
  project,
9606
9868
  opts.packageRoot,
9607
9869
  opts.cliCommandsPath,
9608
- "src/cli-types.ts"
9870
+ "src/cli-types.ts",
9871
+ warnings
9609
9872
  );
9610
- const mcpTools = extractMcpTools(project, opts.packageRoot, opts.mcpToolsPath);
9873
+ const mcpTools = extractMcpTools(project, opts.packageRoot, opts.mcpToolsPath, warnings);
9611
9874
  const finalCommands = opts.sanitize ? cliCommands.map(sanitizeCommand) : cliCommands;
9612
9875
  const finalTools = opts.sanitize ? mcpTools.map(sanitizeTool) : mcpTools;
9613
9876
  const manifest = {
@@ -10409,182 +10672,6 @@ function parseValidationArgs(positionals, format, verbose) {
10409
10672
  return options;
10410
10673
  }
10411
10674
 
10412
- // src/cli/verify-command.ts
10413
- function checkNodeVersion() {
10414
- const version = process.version;
10415
- const major = parseInt(version.slice(1).split(".")[0] ?? "0", 10);
10416
- if (major >= 22) {
10417
- return {
10418
- name: "Node.js Version",
10419
- passed: true,
10420
- message: `${version} (LTS)`
10421
- };
10422
- }
10423
- if (major >= 18) {
10424
- return {
10425
- name: "Node.js Version",
10426
- passed: true,
10427
- message: `${version} (supported, recommend 22.x LTS)`
10428
- };
10429
- }
10430
- return {
10431
- name: "Node.js Version",
10432
- passed: false,
10433
- message: `${version} (unsupported)`,
10434
- fix: "Install Node.js 22.x LTS from https://nodejs.org"
10435
- };
10436
- }
10437
- function checkPackageExports() {
10438
- try {
10439
- const hasVersion = typeof VERSION === "string" && VERSION.length > 0;
10440
- const hasConfig = typeof defaultConfig === "object";
10441
- const hasBuiltInExperts = typeof BUILT_IN_EXPERTS === "object";
10442
- if (hasVersion && hasConfig && hasBuiltInExperts) {
10443
- return {
10444
- name: "Package Exports",
10445
- passed: true,
10446
- message: "All core modules accessible"
10447
- };
10448
- }
10449
- return {
10450
- name: "Package Exports",
10451
- passed: false,
10452
- message: "Some modules failed to load",
10453
- fix: "Try reinstalling: npm install -g nexus-agents"
10454
- };
10455
- } catch {
10456
- return {
10457
- name: "Package Exports",
10458
- passed: false,
10459
- message: "Failed to load core modules",
10460
- fix: "Try reinstalling: npm install -g nexus-agents"
10461
- };
10462
- }
10463
- }
10464
- function checkConfigLoading() {
10465
- try {
10466
- const hasModels = typeof defaultConfig.models === "object";
10467
- const hasSecurity = typeof defaultConfig.security === "object";
10468
- if (hasModels && hasSecurity) {
10469
- return {
10470
- name: "Configuration",
10471
- passed: true,
10472
- message: "Default config accessible"
10473
- };
10474
- }
10475
- return {
10476
- name: "Configuration",
10477
- passed: true,
10478
- // Config errors are not fatal for verification
10479
- message: "Using default configuration"
10480
- };
10481
- } catch {
10482
- return {
10483
- name: "Configuration",
10484
- passed: true,
10485
- // Still works with defaults
10486
- message: "Using default configuration"
10487
- };
10488
- }
10489
- }
10490
- function checkExpertSystem() {
10491
- const expertTypes = Object.keys(BUILT_IN_EXPERTS);
10492
- const count = expertTypes.length;
10493
- if (count >= 5) {
10494
- return {
10495
- name: "Expert System",
10496
- passed: true,
10497
- message: `${String(count)} expert types available`
10498
- };
10499
- }
10500
- return {
10501
- name: "Expert System",
10502
- passed: false,
10503
- message: "Expert types not loaded",
10504
- fix: "Try reinstalling: npm install -g nexus-agents"
10505
- };
10506
- }
10507
- function runVerify() {
10508
- const time = getTimeProvider();
10509
- const startTime = time.now();
10510
- const checks = [
10511
- checkNodeVersion(),
10512
- checkPackageExports(),
10513
- checkConfigLoading(),
10514
- checkExpertSystem()
10515
- ];
10516
- const allPassed = checks.every((c) => c.passed);
10517
- const durationMs = time.now() - startTime;
10518
- return Promise.resolve({
10519
- version: VERSION,
10520
- nodeVersion: process.version,
10521
- checks,
10522
- allPassed,
10523
- durationMs
10524
- });
10525
- }
10526
- function formatCheck(check) {
10527
- const symbol = check.passed ? `${colors.green}${symbols.check}${colors.reset}` : `${colors.red}${symbols.cross}${colors.reset}`;
10528
- let line = ` ${symbol} ${check.name}: ${check.message}`;
10529
- if (!check.passed && check.fix !== void 0) {
10530
- line += `
10531
- ${colors.dim}Fix: ${check.fix}${colors.reset}`;
10532
- }
10533
- return line;
10534
- }
10535
- function printVerifyResult(result, verbose) {
10536
- process.stdout.write("\n");
10537
- process.stdout.write(`${colors.bold}nexus-agents verify${colors.reset}
10538
- `);
10539
- process.stdout.write("===================\n");
10540
- process.stdout.write("\n");
10541
- process.stdout.write(`Version: ${result.version}
10542
- `);
10543
- process.stdout.write(`Node.js: ${result.nodeVersion}
10544
- `);
10545
- process.stdout.write("\n");
10546
- process.stdout.write(`${colors.cyan}Running checks...${colors.reset}
10547
- `);
10548
- process.stdout.write("\n");
10549
- for (const check of result.checks) {
10550
- process.stdout.write(formatCheck(check) + "\n");
10551
- }
10552
- process.stdout.write("\n");
10553
- if (result.allPassed) {
10554
- process.stdout.write(
10555
- `${colors.green}${colors.bold}Installation verified successfully!${colors.reset}
10556
- `
10557
- );
10558
- process.stdout.write("\n");
10559
- process.stdout.write(`${colors.cyan}Next steps:${colors.reset}
10560
- `);
10561
- process.stdout.write(' 1. Run "nexus-agents doctor" to check external CLI integrations\n');
10562
- process.stdout.write(
10563
- ' 2. Run "nexus-agents review --setup" to configure GitHub integration\n'
10564
- );
10565
- process.stdout.write(' 3. Try "nexus-agents --help" for all available commands\n');
10566
- } else {
10567
- const failedCount = result.checks.filter((c) => !c.passed).length;
10568
- process.stdout.write(
10569
- `${colors.red}${colors.bold}Verification failed: ${String(failedCount)} issue(s) found${colors.reset}
10570
- `
10571
- );
10572
- process.stdout.write("\n");
10573
- process.stdout.write("Please fix the issues above and try again.\n");
10574
- }
10575
- process.stdout.write("\n");
10576
- if (verbose) {
10577
- process.stdout.write(`${colors.dim}Duration: ${String(result.durationMs)}ms${colors.reset}
10578
- `);
10579
- process.stdout.write("\n");
10580
- }
10581
- }
10582
- async function verifyCommand(options) {
10583
- const result = await runVerify();
10584
- printVerifyResult(result, options.verbose);
10585
- return result.allPassed ? 0 : 1;
10586
- }
10587
-
10588
10675
  // src/cli/swe-bench-command.ts
10589
10676
  import * as os2 from "os";
10590
10677
  import * as path18 from "path";
@@ -14276,9 +14363,15 @@ var FitnessScoreCalculator = class {
14276
14363
  }
14277
14364
  /**
14278
14365
  * Check explicit behavior: penalize hidden/magic behavior.
14279
- * TODO: This dimension lacks strong filesystem signals. Currently checks
14280
- * for NEXUS_ALLOW_MOCK_ORCHESTRATION guard and magic routing patterns.
14281
- * Future: add AST-based detection of implicit fallbacks.
14366
+ *
14367
+ * Implementation is intentionally filesystem-signal-based (no AST parse).
14368
+ * The `NEXUS_ALLOW_MOCK_ORCHESTRATION` guard and magic-routing pattern
14369
+ * grep capture the observable failure modes that historically slipped
14370
+ * past review. AST-based detection of implicit fallbacks was considered
14371
+ * but not pursued — it would significantly widen this function's
14372
+ * footprint and the filesystem signals already catch the recurring
14373
+ * regressions. Revisit only if a new class of hidden-behavior bug
14374
+ * surfaces that this grep-over-source approach can't catch.
14282
14375
  */
14283
14376
  checkExplicitBehavior() {
14284
14377
  const findings = [];
@@ -17294,6 +17387,15 @@ EXAMPLES:
17294
17387
 
17295
17388
  For more information, visit: https://github.com/williamzujkowski/nexus-agents
17296
17389
  `.trim();
17390
+ var COMMANDS_BLOCK_RE = /COMMANDS:\n([\s\S]*?)\n\nOPTIONS:/;
17391
+ function renderHelp(opts) {
17392
+ if (opts.all) return HELP_TEXT;
17393
+ const replacement = renderCommandsSection(false);
17394
+ return HELP_TEXT.replace(COMMANDS_BLOCK_RE, `COMMANDS:
17395
+ ${replacement}
17396
+
17397
+ OPTIONS:`);
17398
+ }
17297
17399
 
17298
17400
  // src/cli-types.ts
17299
17401
  var EXIT_CODES = {
@@ -17322,6 +17424,11 @@ var PARSE_ARGS_CONFIG = {
17322
17424
  type: "boolean",
17323
17425
  default: false
17324
17426
  },
17427
+ // Tiered --help output (Issue #2135): `--help --all` unhides maintainer commands
17428
+ all: {
17429
+ type: "boolean",
17430
+ default: false
17431
+ },
17325
17432
  mode: {
17326
17433
  type: "string",
17327
17434
  short: "m",
@@ -17536,6 +17643,14 @@ var PARSE_ARGS_CONFIG = {
17536
17643
  deep: {
17537
17644
  type: "boolean",
17538
17645
  default: false
17646
+ },
17647
+ // Registry command options (#2179)
17648
+ json: {
17649
+ type: "boolean",
17650
+ default: false
17651
+ },
17652
+ source: {
17653
+ type: "string"
17539
17654
  }
17540
17655
  },
17541
17656
  allowPositionals: true,
@@ -17586,7 +17701,8 @@ function isValidCommand(value) {
17586
17701
  "routing-ab",
17587
17702
  "memory-eval",
17588
17703
  "health",
17589
- "validate"
17704
+ "validate",
17705
+ "registry"
17590
17706
  ];
17591
17707
  return validCommands.includes(value);
17592
17708
  }
@@ -19884,12 +20000,14 @@ function setupShutdownHandlers(cleanup, logger17) {
19884
20000
  process.exit(EXIT_CODES.SHUTDOWN_ERROR);
19885
20001
  }
19886
20002
  };
19887
- process.on("SIGINT", () => {
19888
- void handleShutdown("SIGINT");
19889
- });
19890
- process.on("SIGTERM", () => {
19891
- void handleShutdown("SIGTERM");
19892
- });
20003
+ const onSignal = (signal) => () => {
20004
+ handleShutdown(signal).catch((err2) => {
20005
+ logger17.error("Shutdown handler crashed", err2 instanceof Error ? err2 : new Error(String(err2)));
20006
+ process.exit(EXIT_CODES.SHUTDOWN_ERROR);
20007
+ });
20008
+ };
20009
+ process.on("SIGINT", onSignal("SIGINT"));
20010
+ process.on("SIGTERM", onSignal("SIGTERM"));
19893
20011
  process.on("uncaughtException", (error) => {
19894
20012
  logger17.error("Uncaught exception", error);
19895
20013
  process.exit(EXIT_CODES.SERVER_START_FAILED);
@@ -20085,7 +20203,7 @@ async function initializeSubsystems(config, logger17) {
20085
20203
  await initializeAndLogSandbox(serverLogger, config.security?.sandbox);
20086
20204
  const policyFirewall = logSecurityConfig(serverLogger, config);
20087
20205
  const auditLogger = initializeAuditLogger(config.security, serverLogger);
20088
- const authInit = initializeAuth(config, serverLogger);
20206
+ initializeAuth(config, serverLogger);
20089
20207
  await initializeAndRegisterTools(
20090
20208
  server,
20091
20209
  serverLogger,
@@ -20093,8 +20211,9 @@ async function initializeSubsystems(config, logger17) {
20093
20211
  config,
20094
20212
  feedbackResult.feedbackIntegration
20095
20213
  );
20096
- return { server, serverLogger, observer, eventBusBridge, policyFirewall, auditLogger, authInit };
20214
+ return { server, serverLogger, observer, eventBusBridge, auditLogger };
20097
20215
  }
20216
+ var SERVER_STARTUP_TIMEOUT_MS = 3e4;
20098
20217
  async function startServer(verbose, mode, modeWasExplicit = false, orchestratorOptions) {
20099
20218
  const logger17 = createLogger({ component: "cli" });
20100
20219
  if (verbose) logger17.setLevel("debug");
@@ -20103,6 +20222,13 @@ async function startServer(verbose, mode, modeWasExplicit = false, orchestratorO
20103
20222
  await startOrchestratorMode(orchestratorOptions ?? { verbose });
20104
20223
  return;
20105
20224
  }
20225
+ const startupWatchdog = setTimeout(() => {
20226
+ logger17.error(
20227
+ `Server startup exceeded ${String(SERVER_STARTUP_TIMEOUT_MS)}ms \u2014 aborting. Common causes: hung config load, blocked subsystem init, stdio transport stall.`
20228
+ );
20229
+ process.exit(EXIT_CODES.SERVER_START_FAILED);
20230
+ }, SERVER_STARTUP_TIMEOUT_MS);
20231
+ startupWatchdog.unref();
20106
20232
  const detectionResult = detectMode({ explicitMode: modeWasExplicit ? mode : void 0 });
20107
20233
  logStartupInfo(logger17, detectionResult, verbose);
20108
20234
  const configResult = loadAndLogConfig(logger17);
@@ -20127,6 +20253,7 @@ async function startServer(verbose, mode, modeWasExplicit = false, orchestratorO
20127
20253
  auditLogger
20128
20254
  });
20129
20255
  setupShutdownHandlers(cleanup, logger17);
20256
+ clearTimeout(startupWatchdog);
20130
20257
  logger17.debug("Server running, waiting for requests...");
20131
20258
  }
20132
20259
 
@@ -20158,6 +20285,11 @@ function isValidIndexFormat(value) {
20158
20285
  function isValidResearchFormat(value) {
20159
20286
  return value === "table" || value === "json";
20160
20287
  }
20288
+ function parsePositiveInt(arg, defaultVal) {
20289
+ if (arg === void 0) return defaultVal;
20290
+ const parsed = parseInt(arg, 10);
20291
+ return Number.isNaN(parsed) || parsed <= 0 ? defaultVal : parsed;
20292
+ }
20161
20293
 
20162
20294
  // src/cli-commands-usage.ts
20163
20295
  function printWorkflowRunUsage() {
@@ -20504,6 +20636,32 @@ async function handleResearchCommand(args) {
20504
20636
  process.exit(EXIT_CODES.SERVER_START_FAILED);
20505
20637
  }
20506
20638
  }
20639
+ async function handleRegistryCommand(args) {
20640
+ const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-S46JJ2SX.js");
20641
+ const subcommand = args.subcommand;
20642
+ if (!isValidRegistrySubcommand(subcommand)) {
20643
+ process.stdout.write(`${formatRegistryUsage()}
20644
+ `);
20645
+ process.exit(EXIT_CODES.INVALID_ARGS);
20646
+ }
20647
+ const source = typeof args.options.source === "string" ? args.options.source : void 0;
20648
+ const options = {
20649
+ json: args.options.json === true,
20650
+ dryRun: args.options.dryRun,
20651
+ ...source !== void 0 ? { source } : {}
20652
+ };
20653
+ try {
20654
+ const result = await registryCommand(subcommand, options);
20655
+ process.stdout.write(`${result.text}
20656
+ `);
20657
+ process.exit(result.exitCode === 0 ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
20658
+ } catch (error) {
20659
+ const message = getErrorMessage(error);
20660
+ process.stdout.write(`Error: ${message}
20661
+ `);
20662
+ process.exit(EXIT_CODES.SERVER_START_FAILED);
20663
+ }
20664
+ }
20507
20665
  function handleValidationCommand(args) {
20508
20666
  const options = parseValidationArgs(args.positionals, args.options.format, args.options.verbose);
20509
20667
  const exitCode = validationDashboardCommand(options);
@@ -20527,7 +20685,7 @@ async function handleVerifyCommand(args) {
20527
20685
  async function handleDoctorCommand(args) {
20528
20686
  const exitCode = await doctorCommand({ fix: args.options.fix });
20529
20687
  if (args.options.deep) {
20530
- const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-RKMOZSIS.js");
20688
+ const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-VN6KMUCG.js");
20531
20689
  const diag = runDeepDiagnostics2();
20532
20690
  process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
20533
20691
  }
@@ -20556,7 +20714,7 @@ async function handleSetupCommandAsync(args) {
20556
20714
  process.exit(exitCode === 0 ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
20557
20715
  }
20558
20716
  async function runCustomApiSetup(args) {
20559
- const { configureCustomApi } = await import("./setup-custom-api-XAWKRDWV.js");
20717
+ const { configureCustomApi } = await import("./setup-custom-api-CSB26HWD.js");
20560
20718
  const baseUrl = args.options.customApi;
20561
20719
  if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
20562
20720
  const input = {
@@ -20716,25 +20874,19 @@ function handleWarmUpCommand(_args) {
20716
20874
  process.exit(EXIT_CODES.SUCCESS);
20717
20875
  }
20718
20876
  function handleE2EEvalCommand(args) {
20719
- const countArg = args.positionals[1];
20720
- const taskCount = countArg !== void 0 ? parseInt(countArg, 10) : 50;
20721
- const count = Number.isNaN(taskCount) || taskCount <= 0 ? 50 : taskCount;
20877
+ const count = parsePositiveInt(args.positionals[1], 50);
20722
20878
  const result = runE2EEval({ taskCount: count });
20723
20879
  process.stdout.write(formatE2EEvalResult(result) + "\n");
20724
20880
  process.exit(result.passed ? EXIT_CODES.SUCCESS : 1);
20725
20881
  }
20726
20882
  function handleRoutingABCommand(args) {
20727
- const countArg = args.positionals[1];
20728
- const taskCount = countArg !== void 0 ? parseInt(countArg, 10) : 30;
20729
- const count = Number.isNaN(taskCount) || taskCount <= 0 ? 30 : taskCount;
20883
+ const count = parsePositiveInt(args.positionals[1], 30);
20730
20884
  const result = runRoutingAB({ taskCount: count });
20731
20885
  process.stdout.write(formatABReport(result) + "\n");
20732
20886
  process.exit(EXIT_CODES.SUCCESS);
20733
20887
  }
20734
20888
  function handleMemoryEvalCommand(args) {
20735
- const sizeArg = args.positionals[1];
20736
- const size = sizeArg !== void 0 ? parseInt(sizeArg, 10) : 50;
20737
- const count = Number.isNaN(size) || size <= 0 ? 50 : size;
20889
+ const count = parsePositiveInt(args.positionals[1], 50);
20738
20890
  const result = runMemoryEval(count);
20739
20891
  process.stdout.write(formatMemoryEvalReport(result) + "\n");
20740
20892
  process.exit(EXIT_CODES.SUCCESS);
@@ -22614,8 +22766,9 @@ async function handleValidateCommand(args) {
22614
22766
  }
22615
22767
 
22616
22768
  // src/cli-commands.ts
22617
- function printHelp() {
22618
- process.stdout.write(HELP_TEXT + "\n");
22769
+ function printHelp(args) {
22770
+ const all = args?.options.all ?? false;
22771
+ process.stdout.write(renderHelp({ all }) + "\n");
22619
22772
  }
22620
22773
  function printVersion() {
22621
22774
  process.stdout.write(`nexus-agents v${VERSION}
@@ -22652,7 +22805,7 @@ var SYNC_COMMAND_HANDLERS = {
22652
22805
  };
22653
22806
  function handleSyncCommand(args) {
22654
22807
  if (args.command === "help") {
22655
- printHelp();
22808
+ printHelp(args);
22656
22809
  process.exit(EXIT_CODES.SUCCESS);
22657
22810
  }
22658
22811
  if (args.command === "version") {
@@ -22677,6 +22830,7 @@ var ASYNC_COMMAND_HANDLERS = {
22677
22830
  vote: handleVoteCommand,
22678
22831
  index: handleIndexCommand2,
22679
22832
  research: handleResearchCommand,
22833
+ registry: handleRegistryCommand,
22680
22834
  "swe-bench": handleSweBenchCommand,
22681
22835
  atbench: handleAtbenchCommand,
22682
22836
  hooks: handleHooksCommand,
@@ -23067,6 +23221,7 @@ function buildOptions(values) {
23067
23221
  version: values.version,
23068
23222
  verbose: values.verbose,
23069
23223
  interactive: values.interactive,
23224
+ all: values.all,
23070
23225
  mode: detectionResult.mode,
23071
23226
  force: values.force,
23072
23227
  format: values.format,
@@ -23079,6 +23234,8 @@ function buildOptions(values) {
23079
23234
  quick: values.quick,
23080
23235
  mock: values.mock,
23081
23236
  deep: values.deep,
23237
+ json: values.json,
23238
+ ...values.source !== void 0 && { source: values.source },
23082
23239
  ...values.output !== void 0 && { output: values.output },
23083
23240
  ...values.input !== void 0 && { input: values.input },
23084
23241
  ...buildOrchestrateOptions(values),