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
@@ -1,19 +1,28 @@
1
1
  import {
2
2
  runConfigInitSync
3
- } from "./chunk-EKYT4NMD.js";
3
+ } from "./chunk-QGZBCD2A.js";
4
4
  import {
5
5
  VERSION,
6
+ checkApiKeys,
7
+ checkDataDirectory,
8
+ checkSqlite,
9
+ defaultConfig,
6
10
  initDataDirectories
7
- } from "./chunk-OC7RMLN2.js";
11
+ } from "./chunk-Y7CD6AZW.js";
12
+ import {
13
+ BUILT_IN_EXPERTS
14
+ } from "./chunk-GJVHRJO2.js";
8
15
  import {
9
16
  CLI_SUBPROCESS_TIMEOUTS,
17
+ colors,
10
18
  createLogger,
11
19
  formatCodeBlock,
12
20
  formatHeader,
13
21
  formatStatus,
14
22
  getErrorMessage,
15
- getTimeProvider
16
- } from "./chunk-UOUJZIKH.js";
23
+ getTimeProvider,
24
+ symbols
25
+ } from "./chunk-R2Y57PM3.js";
17
26
 
18
27
  // src/cli/setup-command.ts
19
28
  import { existsSync as existsSync4 } from "fs";
@@ -493,30 +502,70 @@ function isInteractive() {
493
502
 
494
503
  // src/cli/setup-opencode.ts
495
504
  import { existsSync as existsSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "fs";
496
- import { execFileSync as execFileSync2 } from "child_process";
497
505
  import { join as join4, resolve } from "path";
498
- import { homedir as homedir3, platform } from "os";
506
+ import { homedir as homedir3 } from "os";
499
507
  import { parse as jsoncParse, modify, applyEdits } from "jsonc-parser";
500
- var logger = createLogger({ component: "setup-opencode" });
501
- function detectOpenCodeCli() {
508
+
509
+ // src/cli/setup-cli-detection.ts
510
+ import { execFileSync as execFileSync2 } from "child_process";
511
+ import { platform } from "os";
512
+
513
+ // src/cli/cli-detection-error.ts
514
+ var DETECTION_ERROR_MESSAGES = {
515
+ "not-found": "binary not on PATH",
516
+ timeout: "detection timed out (hung PATH?)",
517
+ permission: "binary present but not executable",
518
+ other: "detection failed \u2014 check verbose logs"
519
+ };
520
+ function formatDetectionMessage(cliName, detectionError) {
521
+ if (detectionError === void 0 || detectionError === "not-found") {
522
+ return `${cliName} not installed`;
523
+ }
524
+ return `${cliName} detection failed: ${DETECTION_ERROR_MESSAGES[detectionError]}`;
525
+ }
526
+ function classifyExecError(err) {
527
+ if (typeof err !== "object" || err === null) return "other";
528
+ const e = err;
529
+ if (e.code === "ENOENT") return "not-found";
530
+ if (e.code === "ETIMEDOUT") return "timeout";
531
+ if (e.killed === true || e.signal === "SIGTERM" || e.signal === "SIGKILL") {
532
+ return "timeout";
533
+ }
534
+ if (e.code === "EACCES" || e.code === "EPERM") return "permission";
535
+ return "other";
536
+ }
537
+
538
+ // src/cli/setup-cli-detection.ts
539
+ function getCliLocatorCommand() {
540
+ return platform() === "win32" ? "where" : "which";
541
+ }
542
+ function extractSemver(output) {
543
+ const match = /(\d+\.\d+\.\d+)/.exec(output);
544
+ return match?.[1];
545
+ }
546
+ function detectCliBinary(name) {
502
547
  try {
503
- const cmd = platform() === "win32" ? "where" : "which";
504
- execFileSync2(cmd, ["opencode"], { timeout: 3e3, stdio: "pipe" });
505
- } catch {
506
- return { installed: false, version: void 0 };
548
+ execFileSync2(getCliLocatorCommand(), [name], { timeout: 3e3, stdio: "pipe" });
549
+ } catch (err) {
550
+ return { installed: false, version: void 0, detectionError: classifyExecError(err) };
507
551
  }
508
552
  try {
509
- const output = execFileSync2("opencode", ["--version"], {
553
+ const output = execFileSync2(name, ["--version"], {
510
554
  timeout: 5e3,
511
555
  stdio: "pipe",
512
556
  encoding: "utf-8"
513
557
  });
514
- const match = /(\d+\.\d+\.\d+)/.exec(output);
515
- return { installed: true, version: match?.[1] };
516
- } catch {
517
- return { installed: true, version: void 0 };
558
+ return { installed: true, version: extractSemver(output) };
559
+ } catch (err) {
560
+ return { installed: true, version: void 0, detectionError: classifyExecError(err) };
518
561
  }
519
562
  }
563
+
564
+ // src/cli/setup-opencode.ts
565
+ var logger = createLogger({ component: "setup-opencode" });
566
+ function detectOpenCodeCli() {
567
+ return detectCliBinary("opencode");
568
+ }
520
569
  function getOpenCodeConfigDir() {
521
570
  return join4(homedir3(), ".config", "opencode");
522
571
  }
@@ -623,28 +672,11 @@ function configureOpenCodeInner(force, dryRun, options) {
623
672
 
624
673
  // src/cli/setup-gemini.ts
625
674
  import { existsSync as existsSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "fs";
626
- import { execFileSync as execFileSync3 } from "child_process";
627
675
  import { join as join5 } from "path";
628
- import { homedir as homedir4, platform as platform2 } from "os";
676
+ import { homedir as homedir4 } from "os";
629
677
  var logger2 = createLogger({ component: "setup-gemini" });
630
678
  function detectGeminiCli() {
631
- try {
632
- const cmd = platform2() === "win32" ? "where" : "which";
633
- execFileSync3(cmd, ["gemini"], { timeout: 3e3, stdio: "pipe" });
634
- } catch {
635
- return { installed: false, version: void 0 };
636
- }
637
- try {
638
- const output = execFileSync3("gemini", ["--version"], {
639
- timeout: 5e3,
640
- stdio: "pipe",
641
- encoding: "utf-8"
642
- });
643
- const match = /(\d+\.\d+\.\d+)/.exec(output);
644
- return { installed: true, version: match?.[1] };
645
- } catch {
646
- return { installed: true, version: void 0 };
647
- }
679
+ return detectCliBinary("gemini");
648
680
  }
649
681
  function getGeminiConfigDir(scope, projectRoot) {
650
682
  if (scope === "project" && projectRoot !== void 0) {
@@ -724,31 +756,14 @@ function configureGemini(force, dryRun, scope = "user", projectRoot) {
724
756
  }
725
757
 
726
758
  // src/cli/setup-codex.ts
727
- import { execFileSync as execFileSync4 } from "child_process";
728
- import { platform as platform3 } from "os";
759
+ import { execFileSync as execFileSync3 } from "child_process";
729
760
  var logger3 = createLogger({ component: "setup-codex" });
730
761
  function detectCodexCli() {
731
- try {
732
- const cmd = platform3() === "win32" ? "where" : "which";
733
- execFileSync4(cmd, ["codex"], { timeout: 3e3, stdio: "pipe" });
734
- } catch {
735
- return { installed: false, version: void 0 };
736
- }
737
- try {
738
- const output = execFileSync4("codex", ["--version"], {
739
- timeout: 5e3,
740
- stdio: "pipe",
741
- encoding: "utf-8"
742
- });
743
- const match = /(\d+\.\d+\.\d+)/.exec(output);
744
- return { installed: true, version: match?.[1] };
745
- } catch {
746
- return { installed: true, version: void 0 };
747
- }
762
+ return detectCliBinary("codex");
748
763
  }
749
764
  function isAlreadyConfigured3() {
750
765
  try {
751
- const output = execFileSync4("codex", ["mcp", "list"], {
766
+ const output = execFileSync3("codex", ["mcp", "list"], {
752
767
  timeout: 5e3,
753
768
  stdio: "pipe",
754
769
  encoding: "utf-8"
@@ -760,7 +775,7 @@ function isAlreadyConfigured3() {
760
775
  }
761
776
  function removeExisting() {
762
777
  try {
763
- execFileSync4("codex", ["mcp", "remove", "nexus-agents"], {
778
+ execFileSync3("codex", ["mcp", "remove", "nexus-agents"], {
764
779
  timeout: 5e3,
765
780
  stdio: "pipe"
766
781
  });
@@ -770,7 +785,7 @@ function removeExisting() {
770
785
  }
771
786
  function addMcpServer2() {
772
787
  try {
773
- execFileSync4(
788
+ execFileSync3(
774
789
  "codex",
775
790
  ["mcp", "add", "nexus-agents", "--", "npx", "nexus-agents", "--mode=server"],
776
791
  {
@@ -1050,6 +1065,265 @@ function buildPermissionsBanner(snippet) {
1050
1065
  ].join("\n");
1051
1066
  }
1052
1067
 
1068
+ // src/cli/verify-command.ts
1069
+ function checkNodeVersion() {
1070
+ const version = process.version;
1071
+ const major = parseInt(version.slice(1).split(".")[0] ?? "0", 10);
1072
+ if (major >= 22) {
1073
+ return {
1074
+ name: "Node.js Version",
1075
+ passed: true,
1076
+ message: `${version} (LTS)`
1077
+ };
1078
+ }
1079
+ if (major >= 18) {
1080
+ return {
1081
+ name: "Node.js Version",
1082
+ passed: true,
1083
+ message: `${version} (supported, recommend 22.x LTS)`
1084
+ };
1085
+ }
1086
+ return {
1087
+ name: "Node.js Version",
1088
+ passed: false,
1089
+ message: `${version} (unsupported)`,
1090
+ fix: "Install Node.js 22.x LTS from https://nodejs.org"
1091
+ };
1092
+ }
1093
+ function checkPackageExports() {
1094
+ try {
1095
+ const hasVersion = typeof VERSION === "string" && VERSION.length > 0;
1096
+ const hasConfig = typeof defaultConfig === "object";
1097
+ const hasBuiltInExperts = typeof BUILT_IN_EXPERTS === "object";
1098
+ if (hasVersion && hasConfig && hasBuiltInExperts) {
1099
+ return {
1100
+ name: "Package Exports",
1101
+ passed: true,
1102
+ message: "All core modules accessible"
1103
+ };
1104
+ }
1105
+ return {
1106
+ name: "Package Exports",
1107
+ passed: false,
1108
+ message: "Some modules failed to load",
1109
+ fix: "Try reinstalling: npm install -g nexus-agents"
1110
+ };
1111
+ } catch {
1112
+ return {
1113
+ name: "Package Exports",
1114
+ passed: false,
1115
+ message: "Failed to load core modules",
1116
+ fix: "Try reinstalling: npm install -g nexus-agents"
1117
+ };
1118
+ }
1119
+ }
1120
+ function checkConfigLoading() {
1121
+ try {
1122
+ const hasModels = typeof defaultConfig.models === "object";
1123
+ const hasSecurity = typeof defaultConfig.security === "object";
1124
+ if (hasModels && hasSecurity) {
1125
+ return {
1126
+ name: "Configuration",
1127
+ passed: true,
1128
+ message: "Default config accessible"
1129
+ };
1130
+ }
1131
+ return {
1132
+ name: "Configuration",
1133
+ passed: true,
1134
+ // Config errors are not fatal for verification
1135
+ message: "Using default configuration"
1136
+ };
1137
+ } catch {
1138
+ return {
1139
+ name: "Configuration",
1140
+ passed: true,
1141
+ // Still works with defaults
1142
+ message: "Using default configuration"
1143
+ };
1144
+ }
1145
+ }
1146
+ function checkExpertSystem() {
1147
+ const expertTypes = Object.keys(BUILT_IN_EXPERTS);
1148
+ const count = expertTypes.length;
1149
+ if (count >= 5) {
1150
+ return {
1151
+ name: "Expert System",
1152
+ passed: true,
1153
+ message: `${String(count)} expert types available`
1154
+ };
1155
+ }
1156
+ return {
1157
+ name: "Expert System",
1158
+ passed: false,
1159
+ message: "Expert types not loaded",
1160
+ fix: "Try reinstalling: npm install -g nexus-agents"
1161
+ };
1162
+ }
1163
+ async function checkSqliteAvailability() {
1164
+ const result = await checkSqlite();
1165
+ if (result.available) {
1166
+ return {
1167
+ name: "SQLite Storage",
1168
+ passed: true,
1169
+ message: "better-sqlite3 loaded (memory backends available)"
1170
+ };
1171
+ }
1172
+ return {
1173
+ name: "SQLite Storage",
1174
+ passed: false,
1175
+ severity: "warn",
1176
+ message: result.error ?? "better-sqlite3 not available",
1177
+ fix: 'Run "pnpm rebuild better-sqlite3" or reinstall nexus-agents'
1178
+ };
1179
+ }
1180
+ function checkDataDirs() {
1181
+ const result = checkDataDirectory();
1182
+ const unwritable = result.subdirectories.filter((s) => !s.exists || !s.writable);
1183
+ if (result.rootExists && unwritable.length === 0) {
1184
+ return {
1185
+ name: "Data Directories",
1186
+ passed: true,
1187
+ message: `${result.rootPath} (all subdirectories writable)`
1188
+ };
1189
+ }
1190
+ if (!result.rootExists) {
1191
+ return {
1192
+ name: "Data Directories",
1193
+ passed: false,
1194
+ severity: "warn",
1195
+ message: `${result.rootPath} does not exist`,
1196
+ fix: "Run any nexus-agents command \u2014 directories auto-initialize on first run"
1197
+ };
1198
+ }
1199
+ return {
1200
+ name: "Data Directories",
1201
+ passed: false,
1202
+ severity: "warn",
1203
+ message: `${String(unwritable.length)} subdirectory(ies) unwritable: ${unwritable.map((s) => s.name).join(", ")}`,
1204
+ fix: `Check filesystem permissions on ${result.rootPath}`
1205
+ };
1206
+ }
1207
+ function checkAdapterAvailability() {
1208
+ const keys = checkApiKeys();
1209
+ const configured = keys.filter((k) => k.configured);
1210
+ if (configured.length > 0) {
1211
+ return {
1212
+ name: "Adapter Availability",
1213
+ passed: true,
1214
+ message: `${String(configured.length)} API key(s) configured: ${configured.map((k) => k.name).join(", ")}`
1215
+ };
1216
+ }
1217
+ return {
1218
+ name: "Adapter Availability",
1219
+ passed: false,
1220
+ severity: "warn",
1221
+ message: "No API keys configured (ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_AI_API_KEY)",
1222
+ fix: 'Set at least one API key, or install a CLI (claude/gemini/codex/opencode) and run "nexus-agents doctor"'
1223
+ };
1224
+ }
1225
+ async function runVerify() {
1226
+ const time = getTimeProvider();
1227
+ const startTime = time.now();
1228
+ const checks = [
1229
+ checkNodeVersion(),
1230
+ checkPackageExports(),
1231
+ checkConfigLoading(),
1232
+ checkExpertSystem(),
1233
+ await checkSqliteAvailability(),
1234
+ checkDataDirs(),
1235
+ checkAdapterAvailability()
1236
+ ];
1237
+ const allPassed = checks.every((c) => c.passed);
1238
+ const noHardFailures = checks.every((c) => c.passed || c.severity === "warn");
1239
+ const durationMs = time.now() - startTime;
1240
+ return {
1241
+ version: VERSION,
1242
+ nodeVersion: process.version,
1243
+ checks,
1244
+ allPassed,
1245
+ noHardFailures,
1246
+ durationMs
1247
+ };
1248
+ }
1249
+ function formatCheck(check) {
1250
+ let symbol;
1251
+ if (check.passed) {
1252
+ symbol = `${colors.green}${symbols.check}${colors.reset}`;
1253
+ } else if (check.severity === "warn") {
1254
+ symbol = `${colors.yellow}${symbols.warn}${colors.reset}`;
1255
+ } else {
1256
+ symbol = `${colors.red}${symbols.cross}${colors.reset}`;
1257
+ }
1258
+ let line = ` ${symbol} ${check.name}: ${check.message}`;
1259
+ if (!check.passed && check.fix !== void 0) {
1260
+ line += `
1261
+ ${colors.dim}Fix: ${check.fix}${colors.reset}`;
1262
+ }
1263
+ return line;
1264
+ }
1265
+ function printVerifyResult(result, verbose) {
1266
+ process.stdout.write("\n");
1267
+ process.stdout.write(`${colors.bold}nexus-agents verify${colors.reset}
1268
+ `);
1269
+ process.stdout.write("===================\n");
1270
+ process.stdout.write("\n");
1271
+ process.stdout.write(`Version: ${result.version}
1272
+ `);
1273
+ process.stdout.write(`Node.js: ${result.nodeVersion}
1274
+ `);
1275
+ process.stdout.write("\n");
1276
+ process.stdout.write(`${colors.cyan}Running checks...${colors.reset}
1277
+ `);
1278
+ process.stdout.write("\n");
1279
+ for (const check of result.checks) {
1280
+ process.stdout.write(formatCheck(check) + "\n");
1281
+ }
1282
+ process.stdout.write("\n");
1283
+ const warnCount = result.checks.filter((c) => !c.passed && c.severity === "warn").length;
1284
+ const hardCount = result.checks.filter((c) => !c.passed && c.severity !== "warn").length;
1285
+ if (result.allPassed) {
1286
+ process.stdout.write(
1287
+ `${colors.green}${colors.bold}Installation verified successfully!${colors.reset}
1288
+ `
1289
+ );
1290
+ process.stdout.write("\n");
1291
+ process.stdout.write(`${colors.cyan}Next steps:${colors.reset}
1292
+ `);
1293
+ process.stdout.write(' 1. Run "nexus-agents doctor" to check external CLI integrations\n');
1294
+ process.stdout.write(
1295
+ ' 2. Run "nexus-agents review --setup" to configure GitHub integration\n'
1296
+ );
1297
+ process.stdout.write(' 3. Try "nexus-agents --help" for all available commands\n');
1298
+ } else if (hardCount === 0) {
1299
+ process.stdout.write(
1300
+ `${colors.yellow}${colors.bold}Verified with ${String(warnCount)} warning(s) \u2014 functional but degraded${colors.reset}
1301
+ `
1302
+ );
1303
+ process.stdout.write("\n");
1304
+ process.stdout.write("The warnings above indicate reduced functionality but will not\n");
1305
+ process.stdout.write("prevent nexus-agents from running. Fix them when convenient.\n");
1306
+ } else {
1307
+ process.stdout.write(
1308
+ `${colors.red}${colors.bold}Verification failed: ${String(hardCount)} blocking issue(s), ${String(warnCount)} warning(s)${colors.reset}
1309
+ `
1310
+ );
1311
+ process.stdout.write("\n");
1312
+ process.stdout.write("Please fix the blocking issues above and try again.\n");
1313
+ }
1314
+ process.stdout.write("\n");
1315
+ if (verbose) {
1316
+ process.stdout.write(`${colors.dim}Duration: ${String(result.durationMs)}ms${colors.reset}
1317
+ `);
1318
+ process.stdout.write("\n");
1319
+ }
1320
+ }
1321
+ async function verifyCommand(options) {
1322
+ const result = await runVerify();
1323
+ printVerifyResult(result, options.verbose);
1324
+ return result.noHardFailures ? 0 : 1;
1325
+ }
1326
+
1053
1327
  // src/cli/setup-command.ts
1054
1328
  function writeLine2(text) {
1055
1329
  process.stdout.write(text + "\n");
@@ -1306,7 +1580,7 @@ function runOpenCodeStep(options) {
1306
1580
  return {
1307
1581
  name: "OpenCode MCP",
1308
1582
  status: "skipped",
1309
- message: "OpenCode CLI not installed",
1583
+ message: formatDetectionMessage("OpenCode CLI", cliInfo.detectionError),
1310
1584
  durationMs: getTimeProvider().now() - startTime
1311
1585
  };
1312
1586
  }
@@ -1333,7 +1607,7 @@ function runGeminiStep(options) {
1333
1607
  return {
1334
1608
  name: "Gemini MCP",
1335
1609
  status: "skipped",
1336
- message: "Gemini CLI not installed",
1610
+ message: formatDetectionMessage("Gemini CLI", cliInfo.detectionError),
1337
1611
  durationMs: getTimeProvider().now() - startTime
1338
1612
  };
1339
1613
  }
@@ -1373,7 +1647,7 @@ function runCodexStep(options) {
1373
1647
  return {
1374
1648
  name: "Codex MCP",
1375
1649
  status: "skipped",
1376
- message: "Codex CLI not installed",
1650
+ message: formatDetectionMessage("Codex CLI", cliInfo.detectionError),
1377
1651
  durationMs: getTimeProvider().now() - startTime
1378
1652
  };
1379
1653
  }
@@ -1547,6 +1821,60 @@ function printSetupResult(result, verbose) {
1547
1821
  printNextSteps(result.mcpConfigured === true, result.mcpSnippet !== void 0);
1548
1822
  printSummary(result.success);
1549
1823
  }
1824
+ function printGettingStartedBanner(mcpConfigured) {
1825
+ writeEmptyLine2();
1826
+ writeLine2(formatHeader("Getting started"));
1827
+ writeLine2("\u2500".repeat(40));
1828
+ writeLine2(" 1. nexus-agents hello \u2014 guided tour (no API keys needed)");
1829
+ if (mcpConfigured) {
1830
+ writeLine2(" 2. Use through Claude Code \u2014 type /mcp in Claude to list tools");
1831
+ } else {
1832
+ writeLine2(' 2. nexus-agents orchestrate "..." \u2014 run your first task');
1833
+ }
1834
+ writeLine2(" 3. nexus-agents workflow list \u2014 explore built-in workflows");
1835
+ writeEmptyLine2();
1836
+ writeLine2(` ${colors.dim}Docs: https://github.com/williamzujkowski/nexus-agents${colors.reset}`);
1837
+ writeLine2(` ${colors.dim}Harness wiring: docs/guides/HARNESS_COMPATIBILITY.md${colors.reset}`);
1838
+ }
1839
+ async function runPostSetupHealthGate(dryRun) {
1840
+ if (dryRun) return true;
1841
+ const result = await runVerify();
1842
+ const passed = result.checks.filter((c) => c.passed).length;
1843
+ const total = result.checks.length;
1844
+ writeEmptyLine2();
1845
+ writeLine2(formatHeader(`Health check (${String(passed)}/${String(total)} passed)`));
1846
+ writeLine2("\u2500".repeat(40));
1847
+ for (const check of result.checks) {
1848
+ let symbol;
1849
+ if (check.passed) {
1850
+ symbol = `${colors.green}${symbols.check}${colors.reset}`;
1851
+ } else if (check.severity === "warn") {
1852
+ symbol = `${colors.yellow}${symbols.warn}${colors.reset}`;
1853
+ } else {
1854
+ symbol = `${colors.red}${symbols.cross}${colors.reset}`;
1855
+ }
1856
+ writeLine2(` ${symbol} ${check.name}: ${check.message}`);
1857
+ if (!check.passed && check.fix !== void 0) {
1858
+ writeLine2(` ${colors.dim}\u2192 Fix: ${check.fix}${colors.reset}`);
1859
+ }
1860
+ }
1861
+ writeEmptyLine2();
1862
+ if (!result.noHardFailures) {
1863
+ writeLine2(
1864
+ `${colors.red}${colors.bold}Action required: fix the blocking issues above before using nexus-agents.${colors.reset}`
1865
+ );
1866
+ } else if (!result.allPassed) {
1867
+ const warnCount = result.checks.filter((c) => !c.passed).length;
1868
+ writeLine2(
1869
+ `${colors.yellow}${colors.bold}Setup complete with ${String(warnCount)} warning(s) \u2014 nexus-agents will run but some features are degraded.${colors.reset}`
1870
+ );
1871
+ } else {
1872
+ writeLine2(
1873
+ `${colors.green}${colors.bold}All health checks passed. nexus-agents is ready.${colors.reset}`
1874
+ );
1875
+ }
1876
+ return result.noHardFailures;
1877
+ }
1550
1878
  function setupCommand(options = {}) {
1551
1879
  const parsedOptions = SetupOptionsSchema.parse(options);
1552
1880
  if (!isInteractive() && !parsedOptions.nonInteractive) {
@@ -1558,19 +1886,40 @@ function setupCommand(options = {}) {
1558
1886
  printSetupResult(result, parsedOptions.verbose);
1559
1887
  return result.success ? 0 : 1;
1560
1888
  }
1889
+ async function runInteractiveSetup(options) {
1890
+ const wizardOptions = await runWizard();
1891
+ if (wizardOptions === void 0) return 1;
1892
+ const mergedOptions = { ...options, ...wizardOptions };
1893
+ delete mergedOptions.interactive;
1894
+ const result = runSetup(mergedOptions);
1895
+ printSetupResult(result, mergedOptions.verbose ?? false);
1896
+ const healthOk = await runPostSetupHealthGate(mergedOptions.dryRun ?? false);
1897
+ if (result.success && !(mergedOptions.dryRun ?? false)) {
1898
+ printGettingStartedBanner(result.mcpConfigured === true);
1899
+ }
1900
+ return result.success && healthOk ? 0 : 1;
1901
+ }
1561
1902
  async function setupCommandAsync(options = {}) {
1562
1903
  if (options.interactive === true) {
1563
- const wizardOptions = await runWizard();
1564
- if (wizardOptions === void 0) {
1565
- return 1;
1566
- }
1567
- const mergedOptions = { ...options, ...wizardOptions };
1568
- delete mergedOptions.interactive;
1569
- const result = runSetup(mergedOptions);
1570
- printSetupResult(result, mergedOptions.verbose ?? false);
1571
- return result.success ? 0 : 1;
1904
+ return runInteractiveSetup(options);
1572
1905
  }
1573
- return setupCommand(options);
1906
+ const setupResult = runSetupAndPrint(options);
1907
+ const healthOk = await runPostSetupHealthGate(options.dryRun ?? false);
1908
+ if (setupResult.exitCode === 0 && !(options.dryRun ?? false)) {
1909
+ printGettingStartedBanner(setupResult.mcpConfigured);
1910
+ }
1911
+ return setupResult.exitCode !== 0 || !healthOk ? 1 : 0;
1912
+ }
1913
+ function runSetupAndPrint(options) {
1914
+ const parsedOptions = SetupOptionsSchema.parse(options);
1915
+ if (!isInteractive() && !parsedOptions.nonInteractive) {
1916
+ writeLine2("Non-interactive environment detected.");
1917
+ writeLine2("Run with --non-interactive or set CI=true.");
1918
+ return { exitCode: 1, mcpConfigured: false };
1919
+ }
1920
+ const result = runSetup(options);
1921
+ printSetupResult(result, parsedOptions.verbose);
1922
+ return { exitCode: result.success ? 0 : 1, mcpConfigured: result.mcpConfigured === true };
1574
1923
  }
1575
1924
 
1576
1925
  export {
@@ -1578,9 +1927,10 @@ export {
1578
1927
  generateMcpSnippet,
1579
1928
  generateRulesContent,
1580
1929
  runWizard,
1930
+ verifyCommand,
1581
1931
  runSetup,
1582
1932
  printSetupResult,
1583
1933
  setupCommand,
1584
1934
  setupCommandAsync
1585
1935
  };
1586
- //# sourceMappingURL=chunk-XYCS5X3H.js.map
1936
+ //# sourceMappingURL=chunk-QNYNQ257.js.map