nexus-agents 2.79.3 → 2.80.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 (127) hide show
  1. package/README.md +2 -2
  2. package/dist/{child-mcp-config-CTO2MBRM.js → child-mcp-config-SM5I7USN.js} +3 -3
  3. package/dist/{chunk-YXWGEIQR.js → chunk-2DBPZQLO.js} +8 -5
  4. package/dist/chunk-2DBPZQLO.js.map +1 -0
  5. package/dist/chunk-2JQXC3CK.js +317 -0
  6. package/dist/chunk-2JQXC3CK.js.map +1 -0
  7. package/dist/{chunk-6E3NMMEY.js → chunk-3RZWLQSC.js} +2 -2
  8. package/dist/{chunk-6E3NMMEY.js.map → chunk-3RZWLQSC.js.map} +1 -1
  9. package/dist/{chunk-2UYTFLMO.js → chunk-4XGKCVJL.js} +2 -2
  10. package/dist/{chunk-SWFJU3W2.js → chunk-6CJIKX6I.js} +63 -51
  11. package/dist/chunk-6CJIKX6I.js.map +1 -0
  12. package/dist/{chunk-3NIPH6UP.js → chunk-AYZ6P7CK.js} +2 -2
  13. package/dist/{chunk-HYU4GZY6.js → chunk-BSIGP5XF.js} +2 -2
  14. package/dist/{chunk-GONMG4NM.js → chunk-CTSESEFA.js} +2 -2
  15. package/dist/{chunk-FVPYP5DD.js → chunk-EKRMWVAH.js} +4 -4
  16. package/dist/{chunk-7XCUZI4G.js → chunk-EVZ7YR7H.js} +4 -4
  17. package/dist/{chunk-L6SCKLGO.js → chunk-FAJAWO42.js} +3 -3
  18. package/dist/{chunk-5O6XLBPP.js → chunk-FJHZW7CR.js} +2 -2
  19. package/dist/{chunk-HB4MIDHJ.js → chunk-GNRANMQ3.js} +122 -72
  20. package/dist/chunk-GNRANMQ3.js.map +1 -0
  21. package/dist/{chunk-KT5FIBWS.js → chunk-HBKZ2DJK.js} +2 -2
  22. package/dist/{chunk-2YPG6PDG.js → chunk-J5XEJHIQ.js} +3 -3
  23. package/dist/{chunk-ZVCED4Z4.js → chunk-JLWKHYIU.js} +2 -2
  24. package/dist/{chunk-DLXT23AC.js → chunk-JXDDSNEK.js} +2 -2
  25. package/dist/{chunk-Q5CFPIJ5.js → chunk-OO6MTUDS.js} +4 -4
  26. package/dist/chunk-Q2U6SFN2.js +136 -0
  27. package/dist/chunk-Q2U6SFN2.js.map +1 -0
  28. package/dist/{chunk-6TFTVW77.js → chunk-QVHXEQFM.js} +3 -3
  29. package/dist/{chunk-FJWWSVWB.js → chunk-RIUUFBX4.js} +2 -2
  30. package/dist/{chunk-DNO2INX5.js → chunk-SHVGZK4A.js} +4 -4
  31. package/dist/{chunk-VIQOVK4E.js → chunk-SJUSQGKH.js} +82 -186
  32. package/dist/chunk-SJUSQGKH.js.map +1 -0
  33. package/dist/{chunk-JI7S55R3.js → chunk-UGXR4PAY.js} +35 -9
  34. package/dist/chunk-UGXR4PAY.js.map +1 -0
  35. package/dist/{chunk-SD76JZBG.js → chunk-UVALD724.js} +2 -2
  36. package/dist/{chunk-K2QILJG4.js → chunk-VS4KB3AX.js} +33 -9
  37. package/dist/chunk-VS4KB3AX.js.map +1 -0
  38. package/dist/{chunk-PLX6FCFC.js → chunk-YGKPWUJ6.js} +2 -2
  39. package/dist/{chunk-WDYCIJWN.js → chunk-YMT6H2HQ.js} +13 -14
  40. package/dist/chunk-YMT6H2HQ.js.map +1 -0
  41. package/dist/{chunk-D6TM2VHX.js → chunk-ZU2Q3DWE.js} +49 -24
  42. package/dist/chunk-ZU2Q3DWE.js.map +1 -0
  43. package/dist/{cli-circuit-breaker-I74ZQ44Q.js → cli-circuit-breaker-JGX54DAD.js} +5 -5
  44. package/dist/cli.d.ts +1 -1
  45. package/dist/cli.js +574 -531
  46. package/dist/cli.js.map +1 -1
  47. package/dist/{composite-router-V3OC57IE.js → composite-router-UYFYSMBT.js} +3 -3
  48. package/dist/{consensus-vote-ESFPGEJE.js → consensus-vote-BZ6JSN67.js} +12 -12
  49. package/dist/{context-retriever-MB3D7KS6.js → context-retriever-G23VVJ5S.js} +6 -6
  50. package/dist/{doctor-deep-KQ765XZA.js → doctor-deep-OF2LXZ6A.js} +4 -4
  51. package/dist/expert-bridge-6ZLD2NWD.js +11 -0
  52. package/dist/{factory-LHHYDVZX.js → factory-I54TX7OY.js} +5 -5
  53. package/dist/factory-UHDCLEUE.js +14 -0
  54. package/dist/index.d.ts +31 -7
  55. package/dist/index.js +31 -29
  56. package/dist/index.js.map +1 -1
  57. package/dist/{init-opencode-GXZN2W5S.js → init-opencode-FE7HVWQL.js} +6 -6
  58. package/dist/issue-triage-7NR5NQUY.js +15 -0
  59. package/dist/{learning-persistence-Q3HTOGTU.js → learning-persistence-TGOBRUUU.js} +2 -2
  60. package/dist/{pr-reviewer-helpers-XCY7HOPE.js → pr-reviewer-helpers-L4L324FQ.js} +2 -2
  61. package/dist/{registry-command-6E4YKAMT.js → registry-command-NZLX7ZFV.js} +3 -3
  62. package/dist/{repo-security-plan-AGRU72DL.js → repo-security-plan-74GJWJSV.js} +4 -4
  63. package/dist/{research-helpers-synthesize-K2UCJQQG.js → research-helpers-synthesize-LFPEXRIV.js} +4 -4
  64. package/dist/{routing-memory-3B6DDZ76.js → routing-memory-Y2LSEQVS.js} +3 -3
  65. package/dist/{session-memory-L7EQIY2O.js → session-memory-RCNQJDJR.js} +4 -4
  66. package/dist/{setup-command-QSAGFMGN.js → setup-command-ZPLPOJF2.js} +13 -10
  67. package/dist/setup-config-F7VRWXY3.js +10 -0
  68. package/dist/{setup-custom-api-IBDV654K.js → setup-custom-api-XTJ6YZM6.js} +5 -5
  69. package/dist/{tool-memory-6HCHQLAN.js → tool-memory-COZK6SR7.js} +5 -5
  70. package/dist/{weather-report-ER3WUZ7S.js → weather-report-O4XOYGPK.js} +3 -3
  71. package/package.json +4 -4
  72. package/scripts/postinstall.js +1 -1
  73. package/dist/chunk-7BMOZJYS.js +0 -83
  74. package/dist/chunk-7BMOZJYS.js.map +0 -1
  75. package/dist/chunk-D6TM2VHX.js.map +0 -1
  76. package/dist/chunk-HB4MIDHJ.js.map +0 -1
  77. package/dist/chunk-JI7S55R3.js.map +0 -1
  78. package/dist/chunk-K2QILJG4.js.map +0 -1
  79. package/dist/chunk-SWFJU3W2.js.map +0 -1
  80. package/dist/chunk-VIQOVK4E.js.map +0 -1
  81. package/dist/chunk-WDYCIJWN.js.map +0 -1
  82. package/dist/chunk-YXWGEIQR.js.map +0 -1
  83. package/dist/expert-bridge-JKLC57IC.js +0 -10
  84. package/dist/factory-BUUXNGIB.js +0 -14
  85. package/dist/issue-triage-RMXPDZ2K.js +0 -15
  86. package/dist/setup-config-EQT24DD4.js +0 -10
  87. /package/dist/{child-mcp-config-CTO2MBRM.js.map → child-mcp-config-SM5I7USN.js.map} +0 -0
  88. /package/dist/{chunk-2UYTFLMO.js.map → chunk-4XGKCVJL.js.map} +0 -0
  89. /package/dist/{chunk-3NIPH6UP.js.map → chunk-AYZ6P7CK.js.map} +0 -0
  90. /package/dist/{chunk-HYU4GZY6.js.map → chunk-BSIGP5XF.js.map} +0 -0
  91. /package/dist/{chunk-GONMG4NM.js.map → chunk-CTSESEFA.js.map} +0 -0
  92. /package/dist/{chunk-FVPYP5DD.js.map → chunk-EKRMWVAH.js.map} +0 -0
  93. /package/dist/{chunk-7XCUZI4G.js.map → chunk-EVZ7YR7H.js.map} +0 -0
  94. /package/dist/{chunk-L6SCKLGO.js.map → chunk-FAJAWO42.js.map} +0 -0
  95. /package/dist/{chunk-5O6XLBPP.js.map → chunk-FJHZW7CR.js.map} +0 -0
  96. /package/dist/{chunk-KT5FIBWS.js.map → chunk-HBKZ2DJK.js.map} +0 -0
  97. /package/dist/{chunk-2YPG6PDG.js.map → chunk-J5XEJHIQ.js.map} +0 -0
  98. /package/dist/{chunk-ZVCED4Z4.js.map → chunk-JLWKHYIU.js.map} +0 -0
  99. /package/dist/{chunk-DLXT23AC.js.map → chunk-JXDDSNEK.js.map} +0 -0
  100. /package/dist/{chunk-Q5CFPIJ5.js.map → chunk-OO6MTUDS.js.map} +0 -0
  101. /package/dist/{chunk-6TFTVW77.js.map → chunk-QVHXEQFM.js.map} +0 -0
  102. /package/dist/{chunk-FJWWSVWB.js.map → chunk-RIUUFBX4.js.map} +0 -0
  103. /package/dist/{chunk-DNO2INX5.js.map → chunk-SHVGZK4A.js.map} +0 -0
  104. /package/dist/{chunk-SD76JZBG.js.map → chunk-UVALD724.js.map} +0 -0
  105. /package/dist/{chunk-PLX6FCFC.js.map → chunk-YGKPWUJ6.js.map} +0 -0
  106. /package/dist/{cli-circuit-breaker-I74ZQ44Q.js.map → cli-circuit-breaker-JGX54DAD.js.map} +0 -0
  107. /package/dist/{composite-router-V3OC57IE.js.map → composite-router-UYFYSMBT.js.map} +0 -0
  108. /package/dist/{consensus-vote-ESFPGEJE.js.map → consensus-vote-BZ6JSN67.js.map} +0 -0
  109. /package/dist/{context-retriever-MB3D7KS6.js.map → context-retriever-G23VVJ5S.js.map} +0 -0
  110. /package/dist/{doctor-deep-KQ765XZA.js.map → doctor-deep-OF2LXZ6A.js.map} +0 -0
  111. /package/dist/{expert-bridge-JKLC57IC.js.map → expert-bridge-6ZLD2NWD.js.map} +0 -0
  112. /package/dist/{factory-BUUXNGIB.js.map → factory-I54TX7OY.js.map} +0 -0
  113. /package/dist/{factory-LHHYDVZX.js.map → factory-UHDCLEUE.js.map} +0 -0
  114. /package/dist/{init-opencode-GXZN2W5S.js.map → init-opencode-FE7HVWQL.js.map} +0 -0
  115. /package/dist/{issue-triage-RMXPDZ2K.js.map → issue-triage-7NR5NQUY.js.map} +0 -0
  116. /package/dist/{learning-persistence-Q3HTOGTU.js.map → learning-persistence-TGOBRUUU.js.map} +0 -0
  117. /package/dist/{pr-reviewer-helpers-XCY7HOPE.js.map → pr-reviewer-helpers-L4L324FQ.js.map} +0 -0
  118. /package/dist/{registry-command-6E4YKAMT.js.map → registry-command-NZLX7ZFV.js.map} +0 -0
  119. /package/dist/{repo-security-plan-AGRU72DL.js.map → repo-security-plan-74GJWJSV.js.map} +0 -0
  120. /package/dist/{research-helpers-synthesize-K2UCJQQG.js.map → research-helpers-synthesize-LFPEXRIV.js.map} +0 -0
  121. /package/dist/{routing-memory-3B6DDZ76.js.map → routing-memory-Y2LSEQVS.js.map} +0 -0
  122. /package/dist/{session-memory-L7EQIY2O.js.map → session-memory-RCNQJDJR.js.map} +0 -0
  123. /package/dist/{setup-command-QSAGFMGN.js.map → setup-command-ZPLPOJF2.js.map} +0 -0
  124. /package/dist/{setup-config-EQT24DD4.js.map → setup-config-F7VRWXY3.js.map} +0 -0
  125. /package/dist/{setup-custom-api-IBDV654K.js.map → setup-custom-api-XTJ6YZM6.js.map} +0 -0
  126. /package/dist/{tool-memory-6HCHQLAN.js.map → tool-memory-COZK6SR7.js.map} +0 -0
  127. /package/dist/{weather-report-ER3WUZ7S.js.map → weather-report-O4XOYGPK.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULTS
3
- } from "./chunk-HYU4GZY6.js";
3
+ } from "./chunk-BSIGP5XF.js";
4
4
  import {
5
5
  resolveInsideRoot
6
6
  } from "./chunk-NUBSJGQZ.js";
@@ -10,12 +10,11 @@ import {
10
10
  import {
11
11
  createAllAdapters,
12
12
  probeCli
13
- } from "./chunk-D6TM2VHX.js";
13
+ } from "./chunk-ZU2Q3DWE.js";
14
14
  import {
15
15
  CliNameSchema,
16
16
  DEFAULT_CAPABILITIES,
17
17
  DEFAULT_COMPOSITE_CONFIG,
18
- DEFAULT_MODEL_PER_CLI,
19
18
  DEFAULT_ZERO_ROUTER_CONFIG,
20
19
  colors,
21
20
  createLogger,
@@ -27,18 +26,21 @@ import {
27
26
  ok,
28
27
  symbols,
29
28
  writeLine
30
- } from "./chunk-WDYCIJWN.js";
29
+ } from "./chunk-YMT6H2HQ.js";
31
30
  import {
32
31
  detectSandbox,
33
32
  getLearningDir,
34
33
  getNexusDataDir,
34
+ getNexusRepoDir,
35
35
  getOutcomesFile,
36
+ getPerRepoSubdirs,
36
37
  getRulesFile,
37
- isPersistenceEnabled
38
- } from "./chunk-7BMOZJYS.js";
38
+ isPersistenceEnabled,
39
+ nexusDataPath
40
+ } from "./chunk-2JQXC3CK.js";
39
41
 
40
42
  // src/version.ts
41
- var VERSION = true ? "2.79.3" : "dev";
43
+ var VERSION = true ? "2.80.0" : "dev";
42
44
 
43
45
  // src/config/schemas-core.ts
44
46
  import { z } from "zod";
@@ -722,127 +724,6 @@ function getKnownNexusVarNames() {
722
724
  return KNOWN_NAMES;
723
725
  }
724
726
 
725
- // src/config/model-availability.ts
726
- var DEFAULT_TTL_MS = 6e4;
727
- var DEFAULT_MAX_ENTRIES = 50;
728
- var AvailabilityCache = class {
729
- cache = /* @__PURE__ */ new Map();
730
- ttlMs;
731
- maxEntries;
732
- constructor(config = {}) {
733
- this.ttlMs = config.ttlMs ?? DEFAULT_TTL_MS;
734
- this.maxEntries = config.maxEntries ?? DEFAULT_MAX_ENTRIES;
735
- }
736
- /** Get a cached probe result, or undefined if expired/missing. */
737
- get(modelId) {
738
- const entry = this.cache.get(modelId);
739
- if (entry === void 0) return void 0;
740
- if (getTimeProvider().now() - entry.checkedAt > this.ttlMs) {
741
- this.cache.delete(modelId);
742
- return void 0;
743
- }
744
- return entry;
745
- }
746
- /** Store a probe result, evicting oldest if at capacity. */
747
- set(result) {
748
- if (this.cache.size >= this.maxEntries && !this.cache.has(result.modelId)) {
749
- const oldest = this.cache.keys().next();
750
- if (oldest.done !== true) {
751
- this.cache.delete(oldest.value);
752
- }
753
- }
754
- this.cache.set(result.modelId, result);
755
- }
756
- /** Mark a model as unavailable without a full probe. */
757
- markUnavailable(modelId, error) {
758
- this.set({
759
- modelId,
760
- available: false,
761
- latencyMs: 0,
762
- checkedAt: getTimeProvider().now(),
763
- error
764
- });
765
- }
766
- /** Mark a model as available. */
767
- markAvailable(modelId, latencyMs) {
768
- this.set({
769
- modelId,
770
- available: true,
771
- latencyMs,
772
- checkedAt: getTimeProvider().now()
773
- });
774
- }
775
- /** Check if a model is known-unavailable (cached and not expired). */
776
- isKnownUnavailable(modelId) {
777
- const entry = this.get(modelId);
778
- return entry !== void 0 && !entry.available;
779
- }
780
- /** Get all cached entries (for diagnostics). */
781
- entries() {
782
- return [...this.cache.values()];
783
- }
784
- /** Number of cached entries. */
785
- get size() {
786
- return this.cache.size;
787
- }
788
- /** Clear all cached entries. */
789
- clear() {
790
- this.cache.clear();
791
- }
792
- };
793
- var FALLBACK_CHAINS = {
794
- claude: ["claude-opus", "claude-sonnet", "claude-haiku"],
795
- gemini: ["gemini-3-pro", "gemini-pro", "gemini-3-flash", "gemini-flash"],
796
- codex: ["codex-5.3", "codex-5.2", "codex-5.1-mini"],
797
- opencode: ["opencode-custom-opus", "opencode-custom-sonnet", "opencode-default"]
798
- };
799
- function resolveFallback(modelId, cache) {
800
- const cli = getCliForModelId(modelId);
801
- if (cli === void 0) return null;
802
- const chain = FALLBACK_CHAINS[cli];
803
- for (const candidate of chain) {
804
- if (candidate === modelId) continue;
805
- if (!cache.isKnownUnavailable(candidate)) {
806
- return {
807
- modelId: candidate,
808
- reason: `Fallback from ${modelId} (unavailable) to ${candidate}`
809
- };
810
- }
811
- }
812
- return null;
813
- }
814
- function getFallbackChain(cli) {
815
- return FALLBACK_CHAINS[cli];
816
- }
817
- function getCliForModelId(modelId) {
818
- for (const [cli, defaultModel] of Object.entries(DEFAULT_MODEL_PER_CLI)) {
819
- const chain = FALLBACK_CHAINS[cli];
820
- if (chain.includes(modelId)) return cli;
821
- if (defaultModel === modelId) return cli;
822
- }
823
- return void 0;
824
- }
825
- var globalCache;
826
- function getAvailabilityCache() {
827
- globalCache ??= new AvailabilityCache();
828
- return globalCache;
829
- }
830
- function resetAvailabilityCache() {
831
- globalCache = void 0;
832
- }
833
- function filterAvailableModels(modelIds, cache) {
834
- const available = [];
835
- const removed = [];
836
- for (const id of modelIds) {
837
- if (cache.isKnownUnavailable(id)) {
838
- removed.push(id);
839
- } else {
840
- available.push(id);
841
- }
842
- }
843
- return { available, removed };
844
- }
845
-
846
727
  // src/config/routing-config-adapter.ts
847
728
  var ADAPTER_DEFAULTS = {
848
729
  latencyScoreWeight: 0.2
@@ -1128,6 +1009,12 @@ import { resolve, join } from "path";
1128
1009
  import * as yaml from "yaml";
1129
1010
  var DEFAULT_CONFIG_FILE = "nexus-agents.yaml";
1130
1011
  var ALTERNATE_CONFIG_FILE = "nexus-agents.yml";
1012
+ var CONFIG_LOOKUP_PATHS = [
1013
+ `.nexus-agents/${DEFAULT_CONFIG_FILE}`,
1014
+ `.nexus-agents/${ALTERNATE_CONFIG_FILE}`,
1015
+ DEFAULT_CONFIG_FILE,
1016
+ ALTERNATE_CONFIG_FILE
1017
+ ];
1131
1018
  var ConfigLoadError = class extends Error {
1132
1019
  code;
1133
1020
  constructor(message, code, cause) {
@@ -1156,13 +1043,11 @@ function findConfigPath(cwd) {
1156
1043
  return validation.value;
1157
1044
  }
1158
1045
  }
1159
- const yamlPath = resolve(cwd, DEFAULT_CONFIG_FILE);
1160
- if (existsSync(yamlPath)) {
1161
- return yamlPath;
1162
- }
1163
- const ymlPath = resolve(cwd, ALTERNATE_CONFIG_FILE);
1164
- if (existsSync(ymlPath)) {
1165
- return ymlPath;
1046
+ for (const rel of CONFIG_LOOKUP_PATHS) {
1047
+ const abs = resolve(cwd, rel);
1048
+ if (existsSync(abs)) {
1049
+ return abs;
1050
+ }
1166
1051
  }
1167
1052
  const globalDir = getNexusDataDir();
1168
1053
  const globalYamlPath = join(globalDir, DEFAULT_CONFIG_FILE);
@@ -1296,7 +1181,6 @@ function getConfig(options) {
1296
1181
 
1297
1182
  // src/cli/setup-data-dir.ts
1298
1183
  import { mkdirSync, existsSync as existsSync4 } from "fs";
1299
- import { join as join4 } from "path";
1300
1184
 
1301
1185
  // src/cli/doctor.ts
1302
1186
  import {
@@ -1306,7 +1190,6 @@ import {
1306
1190
  accessSync,
1307
1191
  constants as fsConstants
1308
1192
  } from "fs";
1309
- import { join as join3 } from "path";
1310
1193
 
1311
1194
  // src/mcp/server.ts
1312
1195
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -1651,34 +1534,36 @@ function printSqliteCheck(check) {
1651
1534
  writeLine(` ${colors.dim}Fix: npm install -g better-sqlite3${colors.reset}`);
1652
1535
  }
1653
1536
  }
1537
+ function printDataDirGroup(label, rootHint, subdirs) {
1538
+ if (subdirs.length === 0) return;
1539
+ const existCount = subdirs.filter((d) => d.exists).length;
1540
+ writeLine(
1541
+ ` ${colors.dim}${label} \u2014 ${rootHint} (${String(existCount)}/${String(subdirs.length)})${colors.reset}`
1542
+ );
1543
+ for (const dir of subdirs) {
1544
+ let marker;
1545
+ if (!dir.exists) marker = `${colors.dim}\xB7${colors.reset}`;
1546
+ else if (!dir.writable) marker = `${colors.yellow}!${colors.reset}`;
1547
+ else marker = `${colors.green}\u2713${colors.reset}`;
1548
+ const note = !dir.exists ? ` ${colors.dim}(missing \u2014 created on first use)${colors.reset}` : !dir.writable ? ` ${colors.yellow}(not writable)${colors.reset}` : "";
1549
+ writeLine(` ${marker} ${dir.name} ${colors.dim}${dir.path}${colors.reset}${note}`);
1550
+ }
1551
+ }
1654
1552
  function printDataDirectory(check) {
1655
- if (check.rootExists) {
1656
- const existCount = check.subdirectories.filter((d) => d.exists).length;
1657
- const totalCount = check.subdirectories.length;
1658
- const allExist = existCount === totalCount;
1659
- const allWritable = check.subdirectories.every((d) => !d.exists || d.writable);
1660
- const healthy = allExist && allWritable;
1661
- writeLine(
1662
- `${formatStatus(healthy, !healthy)} Data directory: ${check.rootPath} (${String(existCount)}/${String(totalCount)} subdirs)`
1663
- );
1664
- if (!allExist) {
1665
- const missing = check.subdirectories.filter((d) => !d.exists);
1666
- for (const dir of missing) {
1667
- writeLine(` ${colors.dim}Missing: ${dir.name}/${colors.reset}`);
1668
- }
1669
- writeLine(` ${colors.dim}Fix: nexus-agents setup${colors.reset}`);
1670
- }
1671
- if (!allWritable) {
1672
- const readonly_ = check.subdirectories.filter((d) => d.exists && !d.writable);
1673
- for (const dir of readonly_) {
1674
- writeLine(` ${colors.yellow}Not writable: ${dir.name}/${colors.reset}`);
1675
- }
1676
- }
1553
+ const allExist = check.subdirectories.every((d) => d.exists);
1554
+ const allWritable = check.subdirectories.every((d) => !d.exists || d.writable);
1555
+ const healthy = check.rootExists && allWritable;
1556
+ writeLine(`${formatStatus(healthy, !healthy)} Data directory layout:`);
1557
+ const perRepo = check.subdirectories.filter((d) => d.scope === "per-repo");
1558
+ const crossRepo = check.subdirectories.filter((d) => d.scope === "cross-repo");
1559
+ if (check.repoRoot !== null) {
1560
+ printDataDirGroup("Per-repo", check.repoRoot, perRepo);
1677
1561
  } else {
1678
- writeLine(
1679
- `${formatStatus(false, true)} Data directory: ${colors.yellow}Not created${colors.reset}`
1680
- );
1681
- writeLine(` ${colors.dim}Run: nexus-agents setup${colors.reset}`);
1562
+ printDataDirGroup("Per-repo (homedir \u2014 repo-preferred off)", check.rootPath, perRepo);
1563
+ }
1564
+ printDataDirGroup("Cross-repo", check.rootPath, crossRepo);
1565
+ if (!allExist) {
1566
+ writeLine(` ${colors.dim}Fix: nexus-agents setup${colors.reset}`);
1682
1567
  }
1683
1568
  }
1684
1569
  function printSandboxHeader(check) {
@@ -1866,7 +1751,12 @@ function inspectFile(harness, relativePath, absolutePath) {
1866
1751
  // src/cli/doctor.ts
1867
1752
  var REQUIRED_NODE_MAJOR2 = 22;
1868
1753
  var API_KEY_VARS = ["ANTHROPIC_API_KEY", "OPENAI_API_KEY", "GOOGLE_AI_API_KEY"];
1869
- var CONFIG_FILE_PATHS = ["./nexus-agents.yaml", "./nexus-agents.yml"];
1754
+ var CONFIG_FILE_PATHS = [
1755
+ "./.nexus-agents/nexus-agents.yaml",
1756
+ "./.nexus-agents/nexus-agents.yml",
1757
+ "./nexus-agents.yaml",
1758
+ "./nexus-agents.yml"
1759
+ ];
1870
1760
  var DATA_SUBDIRECTORIES = [
1871
1761
  "memory",
1872
1762
  "memory/beliefs",
@@ -2125,12 +2015,16 @@ async function checkSqlite() {
2125
2015
  function checkDataDirectory() {
2126
2016
  const rootPath = getNexusDataDir();
2127
2017
  const rootExists = existsSync3(rootPath);
2018
+ const repoRoot = getNexusRepoDir();
2019
+ const perRepoSet = getPerRepoSubdirs();
2128
2020
  const subdirectories = DATA_SUBDIRECTORIES.map((name) => {
2129
- const fullPath = join3(rootPath, name);
2021
+ const segments = name.split("/");
2022
+ const fullPath = nexusDataPath(...segments);
2130
2023
  const exists = existsSync3(fullPath);
2131
- return { name, path: fullPath, exists, writable: exists && isWritable(fullPath) };
2024
+ const scope = perRepoSet.has(segments[0] ?? "") ? "per-repo" : "cross-repo";
2025
+ return { name, path: fullPath, scope, exists, writable: exists && isWritable(fullPath) };
2132
2026
  });
2133
- return { rootExists, rootPath, subdirectories };
2027
+ return { rootExists, rootPath, repoRoot, subdirectories };
2134
2028
  }
2135
2029
  function isWritable(dirPath) {
2136
2030
  try {
@@ -2213,7 +2107,7 @@ async function runDoctorFix(result) {
2213
2107
  writeLine2("\u2500".repeat(40));
2214
2108
  let fixCount = 0;
2215
2109
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
2216
- const { runSetup } = await import("./setup-command-QSAGFMGN.js");
2110
+ const { runSetup } = await import("./setup-command-ZPLPOJF2.js");
2217
2111
  const setupResult = runSetup({
2218
2112
  skipMcp: true,
2219
2113
  skipRules: true,
@@ -2227,7 +2121,7 @@ async function runDoctorFix(result) {
2227
2121
  }
2228
2122
  }
2229
2123
  if (!result.configFile.found) {
2230
- const { runConfigInitSync } = await import("./setup-config-EQT24DD4.js");
2124
+ const { runConfigInitSync } = await import("./setup-config-F7VRWXY3.js");
2231
2125
  const configResult = runConfigInitSync(process.cwd(), false, false);
2232
2126
  if (configResult.success && configResult.created) {
2233
2127
  writeLine2(`\u2713 Generated config: ${configResult.path}`);
@@ -2256,17 +2150,26 @@ var RESTRICTED_DIRS = /* @__PURE__ */ new Set(["auth"]);
2256
2150
  function initDataDirectories(dryRun = false) {
2257
2151
  const created = [];
2258
2152
  const alreadyExisted = [];
2259
- try {
2260
- ensureDir(NEXUS_DATA_DIR, dryRun, created, alreadyExisted);
2261
- for (const subdir of DATA_SUBDIRECTORIES) {
2262
- const mode = RESTRICTED_DIRS.has(subdir) ? 448 : void 0;
2263
- ensureDir(join4(NEXUS_DATA_DIR, subdir), dryRun, created, alreadyExisted, mode);
2153
+ const failures = [];
2154
+ for (const subdir of DATA_SUBDIRECTORIES) {
2155
+ const mode = RESTRICTED_DIRS.has(subdir) ? 448 : void 0;
2156
+ const target = nexusDataPath(...subdir.split("/"));
2157
+ try {
2158
+ ensureDir(target, dryRun, created, alreadyExisted, mode);
2159
+ } catch (error) {
2160
+ failures.push(`${target}: ${error instanceof Error ? error.message : String(error)}`);
2264
2161
  }
2265
- return { success: true, rootPath: NEXUS_DATA_DIR, created, alreadyExisted, error: null };
2266
- } catch (error) {
2267
- const msg = error instanceof Error ? error.message : String(error);
2268
- return { success: false, rootPath: NEXUS_DATA_DIR, created, alreadyExisted, error: msg };
2269
2162
  }
2163
+ if (failures.length > 0) {
2164
+ return {
2165
+ success: false,
2166
+ rootPath: NEXUS_DATA_DIR,
2167
+ created,
2168
+ alreadyExisted,
2169
+ error: `Failed to create ${String(failures.length)} dir(s): ${failures.join("; ")}`
2170
+ };
2171
+ }
2172
+ return { success: true, rootPath: NEXUS_DATA_DIR, created, alreadyExisted, error: null };
2270
2173
  }
2271
2174
  function ensureDir(dirPath, dryRun, created, alreadyExisted, mode) {
2272
2175
  if (existsSync4(dirPath)) {
@@ -2302,13 +2205,6 @@ export {
2302
2205
  getConfig,
2303
2206
  validateNexusEnv,
2304
2207
  getKnownNexusVarNames,
2305
- AvailabilityCache,
2306
- resolveFallback,
2307
- getFallbackChain,
2308
- getCliForModelId,
2309
- getAvailabilityCache,
2310
- resetAvailabilityCache,
2311
- filterAvailableModels,
2312
2208
  DEFAULT_TASK_TTL_MS,
2313
2209
  clampTaskTtl,
2314
2210
  DATA_SUBDIRECTORIES,
@@ -2323,4 +2219,4 @@ export {
2323
2219
  startStdioServer,
2324
2220
  closeServer
2325
2221
  };
2326
- //# sourceMappingURL=chunk-VIQOVK4E.js.map
2222
+ //# sourceMappingURL=chunk-SJUSQGKH.js.map