nexus-agents 2.136.0 → 2.138.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 (142) hide show
  1. package/dist/{child-mcp-config-TM6OCARU.js → child-mcp-config-LCWPKOYE.js} +4 -4
  2. package/dist/{chunk-ZLENFXL5.js → chunk-2SWMXQZF.js} +4 -4
  3. package/dist/{chunk-MTE7THMR.js → chunk-52JN2RFG.js} +6 -6
  4. package/dist/{chunk-257QMFTM.js → chunk-5MMHH5WK.js} +3 -3
  5. package/dist/{chunk-66TXNH4S.js → chunk-7KFI6R2M.js} +9 -9
  6. package/dist/{chunk-VY4FZNZA.js → chunk-7QEGSYSU.js} +2 -2
  7. package/dist/{chunk-UH3F4RZB.js → chunk-7QR2RTA4.js} +7 -7
  8. package/dist/{chunk-GWOXPCIF.js → chunk-7XCQJXN4.js} +7 -7
  9. package/dist/{chunk-3WBEEYCS.js → chunk-AL7ZYHAF.js} +4 -4
  10. package/dist/{chunk-WOE5J5M6.js → chunk-AYA7K5F5.js} +4 -4
  11. package/dist/{chunk-3QH2KWLH.js → chunk-D2XWKFZ2.js} +2 -2
  12. package/dist/{chunk-L4QFWOOQ.js → chunk-DHVMSIT5.js} +22 -3
  13. package/dist/chunk-DHVMSIT5.js.map +1 -0
  14. package/dist/{chunk-7E5UXA4U.js → chunk-DKU7O4V2.js} +2 -2
  15. package/dist/{chunk-JK4L2TQ6.js → chunk-DOCEHXLQ.js} +3 -3
  16. package/dist/{chunk-KOVTOPEQ.js → chunk-DTHMBYSV.js} +2 -2
  17. package/dist/{chunk-HMZT2SJK.js → chunk-H3B7H67H.js} +4 -4
  18. package/dist/{chunk-7G63H7ZT.js → chunk-H4ATQPGQ.js} +2 -2
  19. package/dist/{chunk-ESP6U3LW.js → chunk-J2HWO3J3.js} +6 -6
  20. package/dist/{chunk-ZHCEOIEQ.js → chunk-JFKNUEZ7.js} +2 -2
  21. package/dist/{chunk-FIQSOSQU.js → chunk-K62WRHHK.js} +2 -2
  22. package/dist/{chunk-OCJEYHUQ.js → chunk-KWZC5LFC.js} +6 -6
  23. package/dist/{chunk-FHFEC2XM.js → chunk-LMMLLGZZ.js} +2 -2
  24. package/dist/{chunk-VN3CKPEF.js → chunk-MNHNQC7R.js} +3 -3
  25. package/dist/{chunk-FSUZIIOJ.js → chunk-MNXLJ2VX.js} +2 -2
  26. package/dist/{chunk-3AAJWZCR.js → chunk-MXDMJGVG.js} +4 -4
  27. package/dist/{chunk-JVZ7FGWR.js → chunk-NJW5GQUF.js} +3 -3
  28. package/dist/{chunk-5SXGPX34.js → chunk-NL7SZQPW.js} +2 -2
  29. package/dist/{chunk-N67LHY47.js → chunk-NWW7HLRL.js} +93 -33
  30. package/dist/chunk-NWW7HLRL.js.map +1 -0
  31. package/dist/{chunk-CQDGPGTL.js → chunk-NYSOJBF5.js} +3 -3
  32. package/dist/{chunk-5546JU53.js → chunk-PLKWH53F.js} +6 -6
  33. package/dist/{chunk-LCSGGLZZ.js → chunk-Q3EZN3Z2.js} +2 -2
  34. package/dist/{chunk-6JOXXQK2.js → chunk-R5ZQCA37.js} +44 -63
  35. package/dist/{chunk-6JOXXQK2.js.map → chunk-R5ZQCA37.js.map} +1 -1
  36. package/dist/{chunk-UGAKYSDO.js → chunk-RER74KD6.js} +2 -2
  37. package/dist/{chunk-3JSDOBOA.js → chunk-RTBVZCLD.js} +2 -2
  38. package/dist/{chunk-VVBKPRLI.js → chunk-XUH2UFSG.js} +2 -2
  39. package/dist/{chunk-ZII5MDUO.js → chunk-YPGTIJEW.js} +2 -2
  40. package/dist/{chunk-4GVPON4W.js → chunk-ZJ3WGARD.js} +3 -3
  41. package/dist/cli-circuit-breaker-TNV2PBLS.js +14 -0
  42. package/dist/cli.d.ts +1 -1
  43. package/dist/cli.js +117 -66
  44. package/dist/cli.js.map +1 -1
  45. package/dist/{composite-router-PS42433A.js → composite-router-KM4BPVY4.js} +4 -4
  46. package/dist/consensus-vote-PCIFXILX.js +39 -0
  47. package/dist/{consensus-vote-types-Dx4pf3YW.d.ts → consensus-vote-types-Qx_LRxt1.d.ts} +2 -1
  48. package/dist/{context-retriever-NIFXFYPQ.js → context-retriever-MAZKHYRD.js} +11 -11
  49. package/dist/doctor-deep-XCMFGGJ3.js +13 -0
  50. package/dist/{expert-bridge-NY6FAFQH.js → expert-bridge-EA3U3GKU.js} +6 -6
  51. package/dist/factory-FACKN4IN.js +22 -0
  52. package/dist/factory-Y5WCLQDB.js +15 -0
  53. package/dist/{improvement-review-JDSRWFHM.js → improvement-review-F7TKX4LQ.js} +6 -6
  54. package/dist/index.d.ts +6 -6
  55. package/dist/index.js +32 -32
  56. package/dist/{init-opencode-C7U6ZQK3.js → init-opencode-ZYGGEUZN.js} +8 -8
  57. package/dist/issue-triage-NI2ZDVTB.js +17 -0
  58. package/dist/{learning-persistence-EHTHKWR5.js → learning-persistence-M3OTCCNI.js} +3 -3
  59. package/dist/{pr-reviewer-helpers-D47TVXFX.js → pr-reviewer-helpers-L7L6O3VQ.js} +6 -6
  60. package/dist/{registry-command-PVC47NSQ.js → registry-command-K2KWID5D.js} +4 -4
  61. package/dist/{repo-security-plan-76IXMJNC.js → repo-security-plan-PCGHBEGZ.js} +5 -5
  62. package/dist/research-helpers-synthesize-R45KXXNH.js +15 -0
  63. package/dist/{routing-memory-RAYIYIUP.js → routing-memory-TLB5EY7J.js} +4 -4
  64. package/dist/{session-memory-WZCS7WDH.js → session-memory-PUEUWVIN.js} +5 -5
  65. package/dist/{setup-command-O62DVQ2U.js → setup-command-OHM6K4FM.js} +13 -13
  66. package/dist/setup-config-SLFGQ5F2.js +11 -0
  67. package/dist/{setup-custom-api-2PQP6UOT.js → setup-custom-api-SVCRCSKY.js} +5 -5
  68. package/dist/{tool-memory-RAQWOUXV.js → tool-memory-COQWIFB6.js} +8 -8
  69. package/dist/{tool-memory-registry-adapters-Y4EGADHN.js → tool-memory-registry-adapters-DLSE4SQH.js} +3 -3
  70. package/dist/unified-registry-44DIG4XK.js +25 -0
  71. package/dist/{weather-report-TEBEALS7.js → weather-report-WK7TJPMM.js} +4 -4
  72. package/package.json +1 -1
  73. package/dist/chunk-L4QFWOOQ.js.map +0 -1
  74. package/dist/chunk-N67LHY47.js.map +0 -1
  75. package/dist/cli-circuit-breaker-HFFMCA43.js +0 -14
  76. package/dist/consensus-vote-K2SHY4TC.js +0 -39
  77. package/dist/doctor-deep-VQQNT7VN.js +0 -13
  78. package/dist/factory-6A26HIWS.js +0 -15
  79. package/dist/factory-GGSACEWN.js +0 -22
  80. package/dist/issue-triage-7RN74LBU.js +0 -17
  81. package/dist/research-helpers-synthesize-WH4IC36H.js +0 -15
  82. package/dist/setup-config-KEBEUMC3.js +0 -11
  83. package/dist/unified-registry-L5PGLSEI.js +0 -25
  84. /package/dist/{child-mcp-config-TM6OCARU.js.map → child-mcp-config-LCWPKOYE.js.map} +0 -0
  85. /package/dist/{chunk-ZLENFXL5.js.map → chunk-2SWMXQZF.js.map} +0 -0
  86. /package/dist/{chunk-MTE7THMR.js.map → chunk-52JN2RFG.js.map} +0 -0
  87. /package/dist/{chunk-257QMFTM.js.map → chunk-5MMHH5WK.js.map} +0 -0
  88. /package/dist/{chunk-66TXNH4S.js.map → chunk-7KFI6R2M.js.map} +0 -0
  89. /package/dist/{chunk-VY4FZNZA.js.map → chunk-7QEGSYSU.js.map} +0 -0
  90. /package/dist/{chunk-UH3F4RZB.js.map → chunk-7QR2RTA4.js.map} +0 -0
  91. /package/dist/{chunk-GWOXPCIF.js.map → chunk-7XCQJXN4.js.map} +0 -0
  92. /package/dist/{chunk-3WBEEYCS.js.map → chunk-AL7ZYHAF.js.map} +0 -0
  93. /package/dist/{chunk-WOE5J5M6.js.map → chunk-AYA7K5F5.js.map} +0 -0
  94. /package/dist/{chunk-3QH2KWLH.js.map → chunk-D2XWKFZ2.js.map} +0 -0
  95. /package/dist/{chunk-7E5UXA4U.js.map → chunk-DKU7O4V2.js.map} +0 -0
  96. /package/dist/{chunk-JK4L2TQ6.js.map → chunk-DOCEHXLQ.js.map} +0 -0
  97. /package/dist/{chunk-KOVTOPEQ.js.map → chunk-DTHMBYSV.js.map} +0 -0
  98. /package/dist/{chunk-HMZT2SJK.js.map → chunk-H3B7H67H.js.map} +0 -0
  99. /package/dist/{chunk-7G63H7ZT.js.map → chunk-H4ATQPGQ.js.map} +0 -0
  100. /package/dist/{chunk-ESP6U3LW.js.map → chunk-J2HWO3J3.js.map} +0 -0
  101. /package/dist/{chunk-ZHCEOIEQ.js.map → chunk-JFKNUEZ7.js.map} +0 -0
  102. /package/dist/{chunk-FIQSOSQU.js.map → chunk-K62WRHHK.js.map} +0 -0
  103. /package/dist/{chunk-OCJEYHUQ.js.map → chunk-KWZC5LFC.js.map} +0 -0
  104. /package/dist/{chunk-FHFEC2XM.js.map → chunk-LMMLLGZZ.js.map} +0 -0
  105. /package/dist/{chunk-VN3CKPEF.js.map → chunk-MNHNQC7R.js.map} +0 -0
  106. /package/dist/{chunk-FSUZIIOJ.js.map → chunk-MNXLJ2VX.js.map} +0 -0
  107. /package/dist/{chunk-3AAJWZCR.js.map → chunk-MXDMJGVG.js.map} +0 -0
  108. /package/dist/{chunk-JVZ7FGWR.js.map → chunk-NJW5GQUF.js.map} +0 -0
  109. /package/dist/{chunk-5SXGPX34.js.map → chunk-NL7SZQPW.js.map} +0 -0
  110. /package/dist/{chunk-CQDGPGTL.js.map → chunk-NYSOJBF5.js.map} +0 -0
  111. /package/dist/{chunk-5546JU53.js.map → chunk-PLKWH53F.js.map} +0 -0
  112. /package/dist/{chunk-LCSGGLZZ.js.map → chunk-Q3EZN3Z2.js.map} +0 -0
  113. /package/dist/{chunk-UGAKYSDO.js.map → chunk-RER74KD6.js.map} +0 -0
  114. /package/dist/{chunk-3JSDOBOA.js.map → chunk-RTBVZCLD.js.map} +0 -0
  115. /package/dist/{chunk-VVBKPRLI.js.map → chunk-XUH2UFSG.js.map} +0 -0
  116. /package/dist/{chunk-ZII5MDUO.js.map → chunk-YPGTIJEW.js.map} +0 -0
  117. /package/dist/{chunk-4GVPON4W.js.map → chunk-ZJ3WGARD.js.map} +0 -0
  118. /package/dist/{cli-circuit-breaker-HFFMCA43.js.map → cli-circuit-breaker-TNV2PBLS.js.map} +0 -0
  119. /package/dist/{composite-router-PS42433A.js.map → composite-router-KM4BPVY4.js.map} +0 -0
  120. /package/dist/{consensus-vote-K2SHY4TC.js.map → consensus-vote-PCIFXILX.js.map} +0 -0
  121. /package/dist/{context-retriever-NIFXFYPQ.js.map → context-retriever-MAZKHYRD.js.map} +0 -0
  122. /package/dist/{doctor-deep-VQQNT7VN.js.map → doctor-deep-XCMFGGJ3.js.map} +0 -0
  123. /package/dist/{expert-bridge-NY6FAFQH.js.map → expert-bridge-EA3U3GKU.js.map} +0 -0
  124. /package/dist/{factory-6A26HIWS.js.map → factory-FACKN4IN.js.map} +0 -0
  125. /package/dist/{factory-GGSACEWN.js.map → factory-Y5WCLQDB.js.map} +0 -0
  126. /package/dist/{improvement-review-JDSRWFHM.js.map → improvement-review-F7TKX4LQ.js.map} +0 -0
  127. /package/dist/{init-opencode-C7U6ZQK3.js.map → init-opencode-ZYGGEUZN.js.map} +0 -0
  128. /package/dist/{issue-triage-7RN74LBU.js.map → issue-triage-NI2ZDVTB.js.map} +0 -0
  129. /package/dist/{learning-persistence-EHTHKWR5.js.map → learning-persistence-M3OTCCNI.js.map} +0 -0
  130. /package/dist/{pr-reviewer-helpers-D47TVXFX.js.map → pr-reviewer-helpers-L7L6O3VQ.js.map} +0 -0
  131. /package/dist/{registry-command-PVC47NSQ.js.map → registry-command-K2KWID5D.js.map} +0 -0
  132. /package/dist/{repo-security-plan-76IXMJNC.js.map → repo-security-plan-PCGHBEGZ.js.map} +0 -0
  133. /package/dist/{research-helpers-synthesize-WH4IC36H.js.map → research-helpers-synthesize-R45KXXNH.js.map} +0 -0
  134. /package/dist/{routing-memory-RAYIYIUP.js.map → routing-memory-TLB5EY7J.js.map} +0 -0
  135. /package/dist/{session-memory-WZCS7WDH.js.map → session-memory-PUEUWVIN.js.map} +0 -0
  136. /package/dist/{setup-command-O62DVQ2U.js.map → setup-command-OHM6K4FM.js.map} +0 -0
  137. /package/dist/{setup-config-KEBEUMC3.js.map → setup-config-SLFGQ5F2.js.map} +0 -0
  138. /package/dist/{setup-custom-api-2PQP6UOT.js.map → setup-custom-api-SVCRCSKY.js.map} +0 -0
  139. /package/dist/{tool-memory-RAQWOUXV.js.map → tool-memory-COQWIFB6.js.map} +0 -0
  140. /package/dist/{tool-memory-registry-adapters-Y4EGADHN.js.map → tool-memory-registry-adapters-DLSE4SQH.js.map} +0 -0
  141. /package/dist/{unified-registry-L5PGLSEI.js.map → unified-registry-44DIG4XK.js.map} +0 -0
  142. /package/dist/{weather-report-TEBEALS7.js.map → weather-report-WK7TJPMM.js.map} +0 -0
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createLogger
3
- } from "./chunk-OCJEYHUQ.js";
4
- import "./chunk-5SXGPX34.js";
5
- import "./chunk-L4QFWOOQ.js";
3
+ } from "./chunk-KWZC5LFC.js";
4
+ import "./chunk-NL7SZQPW.js";
5
+ import "./chunk-DHVMSIT5.js";
6
6
  import "./chunk-ZPWHCABL.js";
7
7
 
8
8
  // src/cli-adapters/child-mcp-config.ts
@@ -60,4 +60,4 @@ export {
60
60
  generateMcpConfig,
61
61
  getDefaultAllowedTools
62
62
  };
63
- //# sourceMappingURL=child-mcp-config-TM6OCARU.js.map
63
+ //# sourceMappingURL=child-mcp-config-LCWPKOYE.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  GitHubProvider,
3
3
  ScmError
4
- } from "./chunk-VVBKPRLI.js";
4
+ } from "./chunk-XUH2UFSG.js";
5
5
  import {
6
6
  resolveToken
7
- } from "./chunk-FHFEC2XM.js";
7
+ } from "./chunk-LMMLLGZZ.js";
8
8
  import {
9
9
  err,
10
10
  ok
11
- } from "./chunk-OCJEYHUQ.js";
11
+ } from "./chunk-KWZC5LFC.js";
12
12
 
13
13
  // src/scm/factory.ts
14
14
  async function createScmProvider(config) {
@@ -41,4 +41,4 @@ export {
41
41
  createScmProvider,
42
42
  createGitHubProvider
43
43
  };
44
- //# sourceMappingURL=chunk-ZLENFXL5.js.map
44
+ //# sourceMappingURL=chunk-2SWMXQZF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runConfigInitSync
3
- } from "./chunk-VY4FZNZA.js";
3
+ } from "./chunk-7QEGSYSU.js";
4
4
  import {
5
5
  VERSION,
6
6
  checkApiKeys,
@@ -8,13 +8,13 @@ import {
8
8
  checkSqlite,
9
9
  defaultConfig,
10
10
  initDataDirectories
11
- } from "./chunk-66TXNH4S.js";
11
+ } from "./chunk-7KFI6R2M.js";
12
12
  import {
13
13
  BUILT_IN_EXPERTS
14
14
  } from "./chunk-ZM4O442V.js";
15
15
  import {
16
16
  probeAllClis
17
- } from "./chunk-GWOXPCIF.js";
17
+ } from "./chunk-7XCQJXN4.js";
18
18
  import {
19
19
  CLI_SUBPROCESS_TIMEOUTS,
20
20
  colors,
@@ -25,11 +25,11 @@ import {
25
25
  getErrorMessage,
26
26
  getTimeProvider,
27
27
  symbols
28
- } from "./chunk-OCJEYHUQ.js";
28
+ } from "./chunk-KWZC5LFC.js";
29
29
  import {
30
30
  ensureGitignored,
31
31
  findRepoRoot
32
- } from "./chunk-L4QFWOOQ.js";
32
+ } from "./chunk-DHVMSIT5.js";
33
33
 
34
34
  // src/cli/setup-command.ts
35
35
  import { existsSync as existsSync4 } from "fs";
@@ -2000,4 +2000,4 @@ export {
2000
2000
  setupCommand,
2001
2001
  setupCommandAsync
2002
2002
  };
2003
- //# sourceMappingURL=chunk-MTE7THMR.js.map
2003
+ //# sourceMappingURL=chunk-52JN2RFG.js.map
@@ -3,14 +3,14 @@ import {
3
3
  createStream,
4
4
  requireApiKey,
5
5
  validateApiKeyPresence
6
- } from "./chunk-ZII5MDUO.js";
6
+ } from "./chunk-YPGTIJEW.js";
7
7
  import {
8
8
  ModelCapability,
9
9
  err,
10
10
  getCliModelName,
11
11
  getTokenEstimator,
12
12
  ok
13
- } from "./chunk-OCJEYHUQ.js";
13
+ } from "./chunk-KWZC5LFC.js";
14
14
 
15
15
  // src/adapters/openai-types.ts
16
16
  var OPENAI_MODELS = {
@@ -553,4 +553,4 @@ export {
553
553
  OpenAIAdapter,
554
554
  createOpenAIAdapter
555
555
  };
556
- //# sourceMappingURL=chunk-257QMFTM.js.map
556
+ //# sourceMappingURL=chunk-5MMHH5WK.js.map
@@ -7,10 +7,10 @@ import {
7
7
  import {
8
8
  createAllAdapters,
9
9
  probeCli
10
- } from "./chunk-GWOXPCIF.js";
10
+ } from "./chunk-7XCQJXN4.js";
11
11
  import {
12
12
  DEFAULTS
13
- } from "./chunk-7E5UXA4U.js";
13
+ } from "./chunk-DKU7O4V2.js";
14
14
  import {
15
15
  CliNameSchema,
16
16
  DEFAULT_CAPABILITIES,
@@ -26,23 +26,23 @@ import {
26
26
  ok,
27
27
  symbols,
28
28
  writeLine
29
- } from "./chunk-OCJEYHUQ.js";
29
+ } from "./chunk-KWZC5LFC.js";
30
30
  import {
31
31
  getLearningDir,
32
32
  getOutcomesFile,
33
33
  getRulesFile,
34
34
  isPersistenceEnabled
35
- } from "./chunk-5SXGPX34.js";
35
+ } from "./chunk-NL7SZQPW.js";
36
36
  import {
37
37
  detectSandbox,
38
38
  getNexusDataDir,
39
39
  getNexusRepoDir,
40
40
  getPerRepoSubdirs,
41
41
  nexusDataPath
42
- } from "./chunk-L4QFWOOQ.js";
42
+ } from "./chunk-DHVMSIT5.js";
43
43
 
44
44
  // src/version.ts
45
- var VERSION = true ? "2.136.0" : "dev";
45
+ var VERSION = true ? "2.138.0" : "dev";
46
46
 
47
47
  // src/config/schemas-core.ts
48
48
  import { z } from "zod";
@@ -2132,7 +2132,7 @@ async function runDoctorFix(result) {
2132
2132
  writeLine2("\u2500".repeat(40));
2133
2133
  let fixCount = 0;
2134
2134
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
2135
- const { runSetup } = await import("./setup-command-O62DVQ2U.js");
2135
+ const { runSetup } = await import("./setup-command-OHM6K4FM.js");
2136
2136
  const setupResult = runSetup({
2137
2137
  skipMcp: true,
2138
2138
  skipRules: true,
@@ -2146,7 +2146,7 @@ async function runDoctorFix(result) {
2146
2146
  }
2147
2147
  }
2148
2148
  if (!result.configFile.found) {
2149
- const { runConfigInitSync } = await import("./setup-config-KEBEUMC3.js");
2149
+ const { runConfigInitSync } = await import("./setup-config-SLFGQ5F2.js");
2150
2150
  const configResult = runConfigInitSync(process.cwd(), false, false);
2151
2151
  if (configResult.success && configResult.created) {
2152
2152
  writeLine2(`\u2713 Generated config: ${configResult.path}`);
@@ -2245,4 +2245,4 @@ export {
2245
2245
  startStdioServer,
2246
2246
  closeServer
2247
2247
  };
2248
- //# sourceMappingURL=chunk-66TXNH4S.js.map
2248
+ //# sourceMappingURL=chunk-7KFI6R2M.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getErrorMessage
3
- } from "./chunk-OCJEYHUQ.js";
3
+ } from "./chunk-KWZC5LFC.js";
4
4
 
5
5
  // src/cli/setup-config.ts
6
6
  import { copyFileSync, existsSync, mkdirSync, writeFileSync } from "fs";
@@ -77,4 +77,4 @@ function ensureBackup(outputPath) {
77
77
  export {
78
78
  runConfigInitSync
79
79
  };
80
- //# sourceMappingURL=chunk-VY4FZNZA.js.map
80
+ //# sourceMappingURL=chunk-7QEGSYSU.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  resolveCliSlot
3
- } from "./chunk-KOVTOPEQ.js";
3
+ } from "./chunk-DTHMBYSV.js";
4
4
  import {
5
5
  createLogger,
6
6
  getTimeProvider,
7
7
  isRateLimitText
8
- } from "./chunk-OCJEYHUQ.js";
8
+ } from "./chunk-KWZC5LFC.js";
9
9
 
10
10
  // src/pipeline/expert-bridge.ts
11
11
  function resolveCliFromModelString(model) {
@@ -21,7 +21,7 @@ async function getMcpConfigPath() {
21
21
  if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;
22
22
  mcpConfigInitPromise ??= (async () => {
23
23
  try {
24
- const { generateMcpConfig } = await import("./child-mcp-config-TM6OCARU.js");
24
+ const { generateMcpConfig } = await import("./child-mcp-config-LCWPKOYE.js");
25
25
  const config = await generateMcpConfig();
26
26
  cachedMcpConfigPath = config.configPath;
27
27
  cachedMcpConfigCleanup = config.cleanup;
@@ -93,8 +93,8 @@ var routerInitPromise = null;
93
93
  async function getRouter() {
94
94
  if (cachedRouter !== null) return cachedRouter;
95
95
  routerInitPromise ??= (async () => {
96
- const { createAllAdapters } = await import("./factory-GGSACEWN.js");
97
- const { createCompositeRouter } = await import("./composite-router-PS42433A.js");
96
+ const { createAllAdapters } = await import("./factory-FACKN4IN.js");
97
+ const { createCompositeRouter } = await import("./composite-router-KM4BPVY4.js");
98
98
  const adapters = createAllAdapters();
99
99
  if (adapters.size === 0) {
100
100
  routerInitPromise = null;
@@ -102,7 +102,7 @@ async function getRouter() {
102
102
  }
103
103
  cachedRouter = adaptCompositeRouter(createCompositeRouter(adapters));
104
104
  try {
105
- const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-HFFMCA43.js");
105
+ const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-TNV2PBLS.js");
106
106
  cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);
107
107
  } catch (error) {
108
108
  const msg = error instanceof Error ? error.message : String(error);
@@ -213,4 +213,4 @@ export {
213
213
  tokenSplitFromUsage,
214
214
  executeExpert
215
215
  };
216
- //# sourceMappingURL=chunk-UH3F4RZB.js.map
216
+ //# sourceMappingURL=chunk-7QR2RTA4.js.map
@@ -4,24 +4,24 @@ import {
4
4
  createStream,
5
5
  requireApiKey,
6
6
  validateApiKeyPresence
7
- } from "./chunk-ZII5MDUO.js";
7
+ } from "./chunk-YPGTIJEW.js";
8
8
  import {
9
9
  CUSTOM_API_BASE_URL_ENV,
10
10
  CUSTOM_API_DEFAULT_MODEL,
11
11
  PROVIDER_ENV_KEYS,
12
12
  assertCustomApiHostResolvesPublic,
13
13
  validateCustomApiBaseUrl
14
- } from "./chunk-7E5UXA4U.js";
14
+ } from "./chunk-DKU7O4V2.js";
15
15
  import {
16
16
  CliCircuitBreaker,
17
17
  DEFAULT_CIRCUIT_BREAKER_CONFIG
18
- } from "./chunk-7G63H7ZT.js";
18
+ } from "./chunk-H4ATQPGQ.js";
19
19
  import {
20
20
  getAvailabilityCache
21
- } from "./chunk-KOVTOPEQ.js";
21
+ } from "./chunk-DTHMBYSV.js";
22
22
  import {
23
23
  generateHyphenId
24
- } from "./chunk-FIQSOSQU.js";
24
+ } from "./chunk-K62WRHHK.js";
25
25
  import {
26
26
  CLI_SUBPROCESS_TIMEOUTS,
27
27
  CLI_TIMEOUTS,
@@ -57,7 +57,7 @@ import {
57
57
  loadModelsDevSnapshot,
58
58
  ok,
59
59
  resolveCliAlias
60
- } from "./chunk-OCJEYHUQ.js";
60
+ } from "./chunk-KWZC5LFC.js";
61
61
 
62
62
  // src/cli-adapters/cli-to-model-adapter.ts
63
63
  var CliToModelAdapter = class {
@@ -4838,4 +4838,4 @@ export {
4838
4838
  SdkAdapter,
4839
4839
  createAutoAdapter
4840
4840
  };
4841
- //# sourceMappingURL=chunk-GWOXPCIF.js.map
4841
+ //# sourceMappingURL=chunk-7XCQJXN4.js.map
@@ -7,7 +7,7 @@ import {
7
7
  toolStructuredError,
8
8
  toolSuccessStructured,
9
9
  wrapToolWithTimeout
10
- } from "./chunk-JVZ7FGWR.js";
10
+ } from "./chunk-NJW5GQUF.js";
11
11
  import {
12
12
  JsonlStore,
13
13
  SECURITY_KEYWORDS,
@@ -19,11 +19,11 @@ import {
19
19
  getPipelineEventBus,
20
20
  getTimeProvider,
21
21
  isDeclaredNeverDeprecate
22
- } from "./chunk-OCJEYHUQ.js";
22
+ } from "./chunk-KWZC5LFC.js";
23
23
  import {
24
24
  getNexusDataDir,
25
25
  nexusDataPath
26
- } from "./chunk-L4QFWOOQ.js";
26
+ } from "./chunk-DHVMSIT5.js";
27
27
 
28
28
  // src/mcp/tools/improvement-review.ts
29
29
  import { execFile as execFile2 } from "child_process";
@@ -2132,4 +2132,4 @@ export {
2132
2132
  runImprovementReview,
2133
2133
  registerImprovementReviewTool
2134
2134
  };
2135
- //# sourceMappingURL=chunk-3WBEEYCS.js.map
2135
+ //# sourceMappingURL=chunk-AL7ZYHAF.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  OpenAIAdapter
3
- } from "./chunk-257QMFTM.js";
3
+ } from "./chunk-5MMHH5WK.js";
4
4
  import {
5
5
  computeCostUSD,
6
6
  recordUsageEvent
7
- } from "./chunk-VN3CKPEF.js";
7
+ } from "./chunk-MNHNQC7R.js";
8
8
  import {
9
9
  ConfigError,
10
10
  createLogger,
@@ -12,7 +12,7 @@ import {
12
12
  getErrorMessage,
13
13
  getTimeProvider,
14
14
  ok
15
- } from "./chunk-OCJEYHUQ.js";
15
+ } from "./chunk-KWZC5LFC.js";
16
16
 
17
17
  // src/config/opencode-bridge.ts
18
18
  import { readFileSync } from "fs";
@@ -191,4 +191,4 @@ export {
191
191
  discoverModels,
192
192
  buildOpenAICompatAdapters
193
193
  };
194
- //# sourceMappingURL=chunk-WOE5J5M6.js.map
194
+ //# sourceMappingURL=chunk-AYA7K5F5.js.map
@@ -4,7 +4,7 @@ import {
4
4
  getErrorMessage,
5
5
  getTimeProvider,
6
6
  ok
7
- } from "./chunk-OCJEYHUQ.js";
7
+ } from "./chunk-KWZC5LFC.js";
8
8
 
9
9
  // src/context/session-memory.ts
10
10
  import * as fs from "fs";
@@ -352,4 +352,4 @@ export {
352
352
  SessionMemory,
353
353
  createSessionMemory
354
354
  };
355
- //# sourceMappingURL=chunk-3QH2KWLH.js.map
355
+ //# sourceMappingURL=chunk-D2XWKFZ2.js.map
@@ -166,11 +166,13 @@ import {
166
166
  copyFileSync,
167
167
  existsSync as existsSync4,
168
168
  mkdirSync,
169
+ realpathSync as realpathSync2,
169
170
  renameSync,
171
+ statSync as statSync3,
170
172
  unlinkSync
171
173
  } from "fs";
172
174
  import { homedir as homedir2 } from "os";
173
- import { dirname as dirname2, join as join2, resolve as resolve3 } from "path";
175
+ import { dirname as dirname2, isAbsolute as isAbsolute2, join as join2, resolve as resolve3 } from "path";
174
176
 
175
177
  // src/config/sandbox-detection.ts
176
178
  import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
@@ -242,12 +244,28 @@ function getNexusDataDir() {
242
244
  return join2(homedir2(), ".nexus-agents");
243
245
  }
244
246
  var gitignoredRoots = /* @__PURE__ */ new Set();
247
+ var activeWorkspaceRoot;
248
+ function setActiveWorkspaceRoot(root) {
249
+ const trimmed = root?.trim();
250
+ if (trimmed === void 0 || trimmed === "") {
251
+ activeWorkspaceRoot = void 0;
252
+ return false;
253
+ }
254
+ try {
255
+ const canonical = realpathSync2(resolve3(trimmed));
256
+ if (!isAbsolute2(canonical) || !statSync3(canonical).isDirectory()) return false;
257
+ activeWorkspaceRoot = canonical;
258
+ return true;
259
+ } catch {
260
+ return false;
261
+ }
262
+ }
245
263
  function getNexusRepoDir() {
246
264
  if (process.env["NEXUS_REPO_PREFERRED"] === "0") return null;
247
265
  const fromEnv = process.env["NEXUS_DATA_DIR"]?.trim();
248
266
  if (fromEnv !== void 0 && fromEnv !== "") return null;
249
267
  if (detectSandbox().active) return null;
250
- const root = findRepoRoot(process.cwd());
268
+ const root = activeWorkspaceRoot ?? findRepoRoot(process.cwd());
251
269
  if (root === null) return null;
252
270
  maybeAutoGitignore(root);
253
271
  return join2(root, ".nexus-agents");
@@ -349,6 +367,7 @@ export {
349
367
  applyPortableMode,
350
368
  ensureGitignored,
351
369
  getNexusDataDir,
370
+ setActiveWorkspaceRoot,
352
371
  getNexusRepoDir,
353
372
  nexusDataPath,
354
373
  nexusDataPathEnsure,
@@ -356,4 +375,4 @@ export {
356
375
  getPerRepoSubdirs,
357
376
  sessionsDbPath
358
377
  };
359
- //# sourceMappingURL=chunk-L4QFWOOQ.js.map
378
+ //# sourceMappingURL=chunk-DHVMSIT5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config/repo-root-detection.ts","../src/config/portable-mode.ts","../src/config/nexus-data-dir.ts","../src/config/sandbox-detection.ts"],"sourcesContent":["/**\n * Repo-root detection — walks upward from a starting directory looking for\n * `.git` so callers can scope state to the current git repo. Built for\n * epic #2872 (issue #2882) to support the per-repo `.nexus-agents/` data\n * directory ratified by vote #2876.\n *\n * Defenses adopted:\n * - Walks upward but stops at filesystem root (no infinite loop on\n * symlinks-to-self).\n * - Stops at filesystem boundary (different `stat.dev`) — refuses to\n * escape across mount points. Prevents a sandboxed workdir from\n * resolving a `.git` on the host filesystem.\n * - Detects git worktrees: `.git` may be a *file* containing\n * `gitdir: <path>` rather than a directory.\n * - Realpath's the final root and rejects results that escape the\n * starting cwd by symlink.\n *\n * Deferred (tracked separately; not blocking #2882):\n * - CVE-2022-24765-style ownership check (refuse `.git` owned by a\n * different uid than the running process). The git CLI added\n * `safe.directory` for this; we don't have a comparable allowlist\n * surface yet. In CI the heuristic is too noisy to be useful\n * (runners often clone as a different uid than the workload).\n * File-system isolation (the `stat.dev` check above) covers the\n * bulk of the attack class.\n *\n * @module config/repo-root-detection\n */\n\nimport { existsSync, readFileSync, realpathSync, statSync } from 'node:fs';\nimport { dirname, isAbsolute, resolve } from 'node:path';\n\n/**\n * Walks upward from `start` looking for `.git` (file or directory).\n * Returns the absolute path to the directory containing it, or `null`.\n *\n * Worktrees: a `.git` file (not dir) with contents `gitdir: <path>` is\n * still recognised as marking the repo root. The pointed-to gitdir is\n * NOT followed — we just need the worktree's own root.\n *\n * Filesystem boundary: stops walking if the next ancestor lives on a\n * different filesystem (different `stat.dev`). This prevents a workdir\n * mounted inside a sandbox from finding a host-side `.git`.\n */\nexport function findRepoRoot(start: string): string | null {\n if (!isAbsolute(start)) {\n start = resolve(start);\n }\n\n let current: string;\n try {\n current = realpathSync(start);\n } catch {\n return null;\n }\n\n let startDev: number | undefined;\n try {\n startDev = statSync(current).dev;\n } catch {\n return null;\n }\n\n // Walk up. Depth cap is paranoid but bounds the loop on pathological\n // symlinks even though realpathSync above should already prevent cycles.\n for (let i = 0; i < 64; i++) {\n if (isRepoRoot(current)) {\n return current;\n }\n const parent = dirname(current);\n if (parent === current) {\n // Hit filesystem root.\n return null;\n }\n try {\n if (statSync(parent).dev !== startDev) {\n // Crossed a mount point; refuse to escape.\n return null;\n }\n } catch {\n return null;\n }\n current = parent;\n }\n return null;\n}\n\n/** True iff `dir/.git` exists as a directory or a git-worktree marker file. */\nexport function isRepoRoot(dir: string): boolean {\n const gitPath = `${dir}/.git`;\n if (!existsSync(gitPath)) return false;\n try {\n const st = statSync(gitPath);\n if (st.isDirectory()) return true;\n if (st.isFile()) {\n // Worktree: first line should be `gitdir: <path>`.\n const head = readFileSync(gitPath, 'utf-8').slice(0, 256);\n return head.startsWith('gitdir:');\n }\n } catch {\n return false;\n }\n return false;\n}\n","/**\n * portable-mode — auto-detect sandboxed execution environments and\n * redirect nexus-agents data to a workspace-local directory.\n *\n * The existing `getNexusDataDir()` already respects `NEXUS_DATA_DIR` and\n * `NEXUS_PORTABLE_MODE`. This module wires up the *auto-detection* path\n * so operators running inside a Docker / restricted-FS / sandboxed\n * environment don't have to set the env vars manually — nexus-agents\n * notices and announces the flip.\n *\n * Source: Issue #2471 (epic #2467 child).\n *\n * Detection rules (first match wins):\n * 1. `NEXUS_DATA_DIR` already set → respect, no auto-detect\n * 2. `NEXUS_PORTABLE_MODE=0` → operator opted out, no auto-detect\n * 3. `NEXUS_PORTABLE_MODE=1` → portable mode, no detection needed\n * 4. Heuristic: home directory not writable\n * 5. Heuristic: container env vars set (KUBERNETES_SERVICE_HOST,\n * DOCKER_CONTAINER, ECS_CONTAINER_METADATA_URI, SANDBOX, etc.)\n *\n * When portable mode fires:\n * - Sets `process.env.NEXUS_DATA_DIR` to `<cwd>/.nexus-agents`\n * - Announces once on stderr (subsequent calls are silent)\n * - If cwd is a git repo, appends `.nexus-agents/` to .gitignore\n *\n * To force off: `NEXUS_PORTABLE_MODE=0`. To force on without heuristics:\n * `NEXUS_PORTABLE_MODE=1`. To override target dir: `NEXUS_DATA_DIR=...`.\n */\n\nimport { accessSync, constants, existsSync, readFileSync, appendFileSync, statSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join, resolve } from 'node:path';\n\n/** Container / sandbox environment variables that strongly imply portable mode. */\nconst SANDBOX_ENV_VARS: readonly string[] = [\n 'KUBERNETES_SERVICE_HOST',\n 'DOCKER_CONTAINER',\n 'ECS_CONTAINER_METADATA_URI',\n 'ECS_CONTAINER_METADATA_URI_V4',\n 'SANDBOX',\n 'NEXUS_SANDBOX',\n];\n\nlet DETECTED = false;\n\ninterface DetectionResult {\n readonly portable: boolean;\n readonly dataDir: string;\n readonly reason:\n | 'env-data-dir'\n | 'env-opt-out'\n | 'env-opt-in'\n | 'home-unwritable'\n | 'container-env'\n | 'default';\n}\n\nfunction isHomeWritable(): boolean {\n try {\n const home = homedir();\n if (!existsSync(home)) return false;\n accessSync(home, constants.W_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction inSandboxEnv(): boolean {\n for (const v of SANDBOX_ENV_VARS) {\n const val = process.env[v];\n if (val !== undefined && val !== '') return true;\n }\n return false;\n}\n\nfunction checkExplicitEnv(cwd: string): DetectionResult | null {\n const fromEnv = process.env['NEXUS_DATA_DIR']?.trim();\n if (fromEnv !== undefined && fromEnv !== '') {\n return { portable: false, dataDir: resolve(fromEnv), reason: 'env-data-dir' };\n }\n const portableEnv = process.env['NEXUS_PORTABLE_MODE'];\n if (portableEnv === '0' || portableEnv === 'false') {\n return { portable: false, dataDir: join(homedir(), '.nexus-agents'), reason: 'env-opt-out' };\n }\n if (portableEnv === '1' || portableEnv === 'true') {\n return { portable: true, dataDir: join(cwd, '.nexus-agents'), reason: 'env-opt-in' };\n }\n return null;\n}\n\nfunction checkHeuristics(cwd: string): DetectionResult | null {\n if (!isHomeWritable()) {\n return { portable: true, dataDir: join(cwd, '.nexus-agents'), reason: 'home-unwritable' };\n }\n if (inSandboxEnv()) {\n return { portable: true, dataDir: join(cwd, '.nexus-agents'), reason: 'container-env' };\n }\n return null;\n}\n\n/**\n * Decide whether to flip nexus-agents to portable mode and what data dir\n * to use. Pure function; no side effects beyond reading env + filesystem.\n */\nexport function detectPortableMode(cwd: string = process.cwd()): DetectionResult {\n return (\n checkExplicitEnv(cwd) ??\n checkHeuristics(cwd) ?? {\n portable: false,\n dataDir: join(homedir(), '.nexus-agents'),\n reason: 'default',\n }\n );\n}\n\n/**\n * Apply detected portable mode at process startup. Idempotent (subsequent\n * calls are no-ops). Announces on stderr once when the auto-detection\n * heuristic triggers — env-opt-in/out doesn't announce because the\n * operator already knows.\n */\nexport function applyPortableMode(cwd: string = process.cwd()): void {\n if (DETECTED) return;\n DETECTED = true;\n\n const result = detectPortableMode(cwd);\n\n // No env, no heuristic match — nothing to do.\n if (!result.portable) return;\n\n // The heuristic-driven cases announce; explicit opt-in is silent.\n if (result.reason === 'home-unwritable' || result.reason === 'container-env') {\n process.stderr.write(\n `[portable-mode] Sandbox detected (${result.reason}). Using ${result.dataDir} for all nexus-agents data.\\n` +\n ` Set NEXUS_PORTABLE_MODE=0 to override; see docs/guides/SANDBOXED-USAGE.md\\n`\n );\n }\n\n process.env['NEXUS_DATA_DIR'] = result.dataDir;\n\n if (isInsideGitRepo(cwd)) {\n ensureGitignored(cwd, '.nexus-agents/');\n }\n}\n\nfunction isInsideGitRepo(cwd: string): boolean {\n try {\n const gitDir = join(cwd, '.git');\n return existsSync(gitDir) && statSync(gitDir).isDirectory();\n } catch {\n return false;\n }\n}\n\n/**\n * Append `entry` to `<cwd>/.gitignore` if not already present. Stderr\n * announce on the first append. Exported because the repo-preferred\n * resolver in `nexus-data-dir.ts` reuses the same auto-gitignore behavior\n * when `<repo>/.nexus-agents/` becomes the active data dir (epic #2872).\n */\nexport function ensureGitignored(cwd: string, entry: string): void {\n const path = join(cwd, '.gitignore');\n try {\n const existing = existsSync(path) ? readFileSync(path, 'utf-8') : '';\n const lines = existing.split('\\n').map((l) => l.trim());\n if (lines.includes(entry) || lines.includes(entry.replace(/\\/$/, ''))) return;\n const sep = existing.length > 0 && !existing.endsWith('\\n') ? '\\n' : '';\n appendFileSync(path, `${sep}${entry}\\n`, 'utf-8');\n process.stderr.write(\n `[portable-mode] Added '${entry}' to ${path} so nexus-agents data is gitignored.\\n`\n );\n } catch (e: unknown) {\n // Non-fatal — operator can add the line themselves.\n const msg = e instanceof Error ? e.message : String(e);\n process.stderr.write(\n `[portable-mode] Could not auto-update ${path} (${msg}). Add '${entry}' manually if you don't want nexus-agents data tracked by git.\\n`\n );\n }\n}\n\n/** Test-only reset of the once-only state. */\nexport function _resetDetectedForTests(): void {\n DETECTED = false;\n}\n","/**\n * Nexus runtime data directory resolver (#2302, child of #2301).\n *\n * Returns the absolute path under which nexus-agents stores runtime state.\n * Two categories of state exist (epic #2872, vote #2876):\n *\n * - **Per-repo** state (sessions, checkpoints, traces, runs, audit,\n * pipeline, tasks) — tied to the work happening in a specific codebase.\n * When `NEXUS_REPO_PREFERRED=1` is set and the caller is inside a git\n * repo, these resolve to `<repo-root>/.nexus-agents/<subdir>/`.\n * - **Cross-repo** state (learning, voting, memory, weather, research,\n * auth, usage, models manifest) — accumulates across the operator's\n * whole workflow. Always resolves to `~/.nexus-agents/<subdir>/` so the\n * learning/routing feedback loop from #1389 / #1407 keeps working.\n *\n * Resolution order (first match wins):\n * 1. `NEXUS_DATA_DIR` env var if set + non-empty. Wins for both categories\n * — the operator's explicit choice overrides the split.\n * 2. Sandbox-mode default (#2501): when `NEXUS_SANDBOX` is set, use\n * `${NEXUS_SANDBOX_ROOT ?? '/'}/.nexus-agents`. Sandboxed deployments\n * typically mount a multi-repo root; state goes there, shared across\n * repo subfolders rather than buried inside one.\n * 3. Per-repo subdirs (when a repo root is known AND `NEXUS_REPO_PREFERRED`\n * is not explicitly `'0'`): `<repo-root>/.nexus-agents/<subdir>/`. The\n * repo root is the active workspace root when one has been set via\n * `setActiveWorkspaceRoot()` (the MCP server derives it from the client's\n * declared `roots`, MCP spec — see #3991), otherwise `findRepoRoot(cwd)`.\n * The active-root path exists because a globally-installed MCP server runs\n * with `process.cwd()` outside the repo, so cwd-based detection would\n * wrongly route per-repo state to homedir. Auto-adds `.nexus-agents/` to\n * the repo's `.gitignore` on first resolution (fail-closed).\n * 4. Cross-repo subdirs when `~/.nexus-agents/` is unwritable AND we're\n * in a repo: per-repo fallback at `<repo-root>/.nexus-agents/<subdir>/`\n * with one-time stderr announce. Issue #2888 — gives sandbox users\n * a working `research/`, `memory/`, etc. without env-var wrangling\n * while preserving the vote #2876 default for normal-machine users.\n * 5. `<homedir>/.nexus-agents` (cross-repo state on normal machines,\n * plus everything when not in a git repo or when\n * `NEXUS_REPO_PREFERRED=0`).\n *\n * `NEXUS_REPO_PREFERRED` defaults **ON** as of this release per vote\n * #2876. Escape hatches preserved:\n * - `NEXUS_REPO_PREFERRED=0` — fully opt out (homedir for everything).\n * - `NEXUS_DATA_DIR=~/.nexus-agents` — explicit override wins over\n * the tier and the categorization both.\n * - `nexus-agents migrate` (#2879) — relocate existing homedir state\n * into `<repo>/.nexus-agents/` before flipping in production.\n *\n * @module config/nexus-data-dir\n */\n\nimport {\n accessSync,\n constants as fsConstants,\n copyFileSync,\n existsSync,\n mkdirSync,\n realpathSync,\n renameSync,\n statSync,\n unlinkSync,\n} from 'node:fs';\nimport { homedir } from 'node:os';\nimport { dirname, isAbsolute, join, resolve } from 'node:path';\n\nimport { detectSandbox } from './sandbox-detection.js';\nimport { findRepoRoot } from './repo-root-detection.js';\nimport { ensureGitignored } from './portable-mode.js';\n\n/**\n * Subdirs scoped to a single repo's work (per the epic #2872 vote).\n * When `NEXUS_REPO_PREFERRED=1` and the caller is inside a git repo, these\n * route to `<repo-root>/.nexus-agents/`; otherwise homedir. The complement\n * (everything not in this set) always goes to homedir so cross-project\n * learning state stays intact.\n *\n * Source-of-truth for the categorization: vote #2876 conditions + audit\n * thread on epic #2872. Adding a new entry here is the appropriate way to\n * mark new state as per-repo — do that as a deliberate decision, not by\n * default.\n */\nconst PER_REPO_SUBDIRS: ReadonlySet<string> = new Set([\n 'sessions',\n 'checkpoints',\n 'traces',\n 'runs',\n 'audit',\n 'pipeline',\n 'tasks',\n // Async-mode job results (#3042 / epic #2631). Tied to work happening\n // in a specific codebase — a job dispatched on repo A shouldn't be\n // polled-against on repo B, which would happen if jobs/ were homedir-scoped.\n 'jobs',\n // CI health-check events (#3076 / #3084). Per-repo because outages\n // reported via `ci_health_check({ repo })` are repo-correlated; a wedge\n // on repo A's queue does not predict repo B's health.\n 'ci-health',\n // Governance artifacts — the runtime authentic-vote-record ledger\n // (`governance/vote-records.jsonl`, #3897/#3927/#3991). Per-repo because a\n // promotion proposal is scoped to the codebase being changed; with\n // `NEXUS_REPO_PREFERRED=1` (default) these route to\n // `<repo>/.nexus-agents/governance/` (gitignored), and to\n // `~/.nexus-agents/governance/` otherwise (global / non-repo install). This\n // is DISTINCT from the committed `<repo>/governance/vote-records.jsonl`\n // ledger the promotion gate reads — that artifact is reached only via the\n // explicit `NEXUS_VOTE_RECORDS_PATH` override (#3991).\n 'governance',\n]);\n\n/** Returns the absolute path to the nexus-agents data directory. */\nexport function getNexusDataDir(): string {\n const fromEnv = process.env['NEXUS_DATA_DIR']?.trim();\n if (fromEnv !== undefined && fromEnv !== '') {\n return resolve(fromEnv);\n }\n const sandbox = detectSandbox();\n if (sandbox.active) {\n return resolve(sandbox.root ?? '/', '.nexus-agents');\n }\n return join(homedir(), '.nexus-agents');\n}\n\n/**\n * No-op kept for source-compatibility with consumers that called this\n * earlier in development. The resolver is no longer cached, so resetting\n * is unnecessary. Kept exported (rather than removed) to avoid breaking\n * imports in tests that may have already adopted it.\n */\nexport function resetNexusDataDirCache(): void {\n // intentionally empty — see module docstring\n}\n\n/**\n * Tracks per-process state for the auto-gitignore wiring: we only need\n * to (a) probe + append to `.gitignore` once per repo, and (b) bail\n * cleanly if the operator has explicitly silenced the auto-add via\n * `NEXUS_GITIGNORE_AUTO=0`. Reset in tests via the helper below.\n */\nconst gitignoredRoots = new Set<string>();\n\n/** Test helper — clears the auto-gitignore \"already did this\" memo. */\nexport function _resetGitignoreMemoForTests(): void {\n gitignoredRoots.clear();\n}\n\n/**\n * Active workspace root, when known from a source more authoritative than\n * `process.cwd()`. Set by the MCP server (#3991) from the client's declared\n * `roots` (MCP spec) once the initialize handshake completes, because a\n * globally-installed server runs with cwd OUTSIDE the repo being worked on —\n * so cwd-based repo detection would route per-repo `.nexus-agents` state to\n * homedir instead of `<repo>/.nexus-agents/`. CLI / in-repo callers never set\n * this, so they keep resolving via `findRepoRoot(cwd)` exactly as before.\n */\nlet activeWorkspaceRoot: string | undefined;\n\n/**\n * Records the active workspace root for repo-scoped data resolution. The\n * value is cross-trust-boundary input (it arrives over the MCP transport from\n * the client), so it is validated before use: resolved to an absolute path,\n * canonicalized via `realpathSync` (defeats symlink games), and required to\n * be an existing directory. Returns `true` when accepted, `false` when the\n * value is empty/invalid (in which case the previous root is left untouched).\n * Passing `null`/empty explicitly clears any previously-set root.\n */\nexport function setActiveWorkspaceRoot(root: string | null | undefined): boolean {\n const trimmed = root?.trim();\n if (trimmed === undefined || trimmed === '') {\n activeWorkspaceRoot = undefined;\n return false;\n }\n try {\n const canonical = realpathSync(resolve(trimmed));\n if (!isAbsolute(canonical) || !statSync(canonical).isDirectory()) return false;\n activeWorkspaceRoot = canonical;\n return true;\n } catch {\n // Nonexistent path, permission error, or broken symlink — reject and keep\n // whatever was set before so a bad late signal can't corrupt resolution.\n return false;\n }\n}\n\n/** Returns the active workspace root if one has been set, else `undefined`. */\nexport function getActiveWorkspaceRoot(): string | undefined {\n return activeWorkspaceRoot;\n}\n\n/** Test helper — clears the active workspace root memo. */\nexport function _resetActiveWorkspaceRootForTests(): void {\n activeWorkspaceRoot = undefined;\n}\n\n/**\n * Returns the repo-scoped `.nexus-agents/` directory if all of the\n * following hold: `NEXUS_REPO_PREFERRED` is NOT explicitly `'0'` (it\n * defaults ON as of vote #2876), `NEXUS_DATA_DIR` is not explicitly set\n * (explicit override always wins), no sandbox is active, and a repo root is\n * known — either the active workspace root (set via\n * `setActiveWorkspaceRoot()`) or an ancestor `.git` found by\n * `findRepoRoot(cwd)`.\n *\n * Side effect: on the first successful resolution per process per repo,\n * appends `.nexus-agents/` to the repo's `.gitignore` if not already\n * present. The operator can silence this with `NEXUS_GITIGNORE_AUTO=0`\n * (e.g. on CI runners with a frozen working tree).\n *\n * Returns `null` when any precondition fails; callers fall back to\n * `getNexusDataDir()` (homedir).\n */\nexport function getNexusRepoDir(): string | null {\n if (process.env['NEXUS_REPO_PREFERRED'] === '0') return null;\n const fromEnv = process.env['NEXUS_DATA_DIR']?.trim();\n if (fromEnv !== undefined && fromEnv !== '') return null;\n if (detectSandbox().active) return null;\n // Prefer the MCP-client-declared workspace root (#3991) when the server has\n // set it; fall back to walking up from cwd for CLI / in-repo callers.\n const root = activeWorkspaceRoot ?? findRepoRoot(process.cwd());\n if (root === null) return null;\n maybeAutoGitignore(root);\n return join(root, '.nexus-agents');\n}\n\n/**\n * Best-effort fail-closed wiring: once per process per repo, ensure\n * `.nexus-agents/` is in `<repo>/.gitignore`. Silenced via\n * `NEXUS_GITIGNORE_AUTO=0`. Failures are non-fatal — the helper logs\n * to stderr and continues.\n */\nfunction maybeAutoGitignore(repoRoot: string): void {\n if (process.env['NEXUS_GITIGNORE_AUTO'] === '0') return;\n if (gitignoredRoots.has(repoRoot)) return;\n gitignoredRoots.add(repoRoot);\n // Only attempt when the repo root looks real — avoid spamming stderr\n // from temp-dir test fixtures that race the lifecycle.\n if (!existsSync(repoRoot)) return;\n ensureGitignored(repoRoot, '.nexus-agents/');\n}\n\n/**\n * Per-process memo: was the homedir base directory found writable on first\n * probe? Used to short-circuit the sandbox-fallback decision in\n * `nexusDataPath()` without spending a syscall on every call.\n */\nlet homedirWritable: boolean | undefined;\n\n/** Per-process memo: have we already announced a fallback for this subdir? */\nconst announcedFallbacks = new Set<string>();\n\n/** Test helper — clears the homedir-writability + announcement memos. */\nexport function _resetWritabilityMemoForTests(): void {\n homedirWritable = undefined;\n announcedFallbacks.clear();\n}\n\n/**\n * Returns true if `getNexusDataDir()` resolves to a writable location. Probed\n * once per process and memo'd — flips the sandbox-fallback on/off for\n * cross-repo subdirs. `mkdirSync(recursive: true)` is the safest probe\n * because it both creates the dir if missing and surfaces ENOENT/EACCES\n * issues at the same point. Failures here are non-fatal — they just route\n * cross-repo state to the per-repo fallback (issue #2888).\n */\nfunction isHomedirBaseWritable(): boolean {\n if (homedirWritable !== undefined) return homedirWritable;\n const base = getNexusDataDir();\n try {\n mkdirSync(base, { recursive: true });\n accessSync(base, fsConstants.W_OK);\n homedirWritable = true;\n } catch {\n homedirWritable = false;\n }\n return homedirWritable;\n}\n\n/**\n * Emit a one-time stderr warning when a cross-repo subdir falls back to\n * the per-repo location. Operators in sandboxes get a clear signal about\n * what happened without per-call noise.\n */\nfunction announceCrossRepoFallback(subdir: string, repoPath: string): void {\n if (announcedFallbacks.has(subdir)) return;\n announcedFallbacks.add(subdir);\n process.stderr.write(\n `[nexus] ${subdir}: homedir ~/.nexus-agents is not writable; ` +\n `using per-repo fallback at ${repoPath}. See docs/guides/SANDBOXED-USAGE.md.\\n`\n );\n}\n\n/**\n * Returns a path joined under the appropriate data directory for the\n * given subdir.\n *\n * Routing decision (first match wins):\n * 1. **Per-repo subdir + in a repo + `NEXUS_REPO_PREFERRED` not '0'** →\n * `<repo>/.nexus-agents/<subdir>/...`. Standard behavior since #2884.\n * 2. **Cross-repo subdir + homedir unwritable + in a repo** →\n * `<repo>/.nexus-agents/<subdir>/...` as a sandbox-friendly fallback\n * (issue #2888). Emits a one-time stderr warning per subdir.\n * 3. **Otherwise** → `<homedir>/.nexus-agents/<subdir>/...`. If homedir\n * is also unwritable, the actual write will surface the error.\n *\n * Existing callers don't need to change — the routing decision is driven\n * by the first segment, not by caller-declared intent.\n */\nexport function nexusDataPath(...segments: string[]): string {\n const first = segments[0];\n\n // Tier 1: per-repo subdir + repo-preferred default.\n if (first !== undefined && PER_REPO_SUBDIRS.has(first)) {\n const repoDir = getNexusRepoDir();\n if (repoDir !== null) {\n return join(repoDir, ...segments);\n }\n }\n\n // Tier 2: cross-repo subdir but homedir isn't reachable. Fall back to\n // the per-repo location if we're in a repo, so sandbox users get a\n // working `research/`, `memory/`, etc. without manual env-var setup.\n // Vote #2876 preserved: this only fires when homedir is physically\n // unreachable; normal-machine users see no change.\n if (first !== undefined && !isHomedirBaseWritable()) {\n const repoDir = getNexusRepoDir();\n if (repoDir !== null) {\n const fallbackPath = join(repoDir, ...segments);\n announceCrossRepoFallback(first, fallbackPath);\n return fallbackPath;\n }\n // No repo to fall back to AND homedir unreachable — return the\n // homedir path anyway. The caller's eventual write will surface\n // the underlying EACCES/ENOENT, which is the right error to show\n // because the environment is genuinely broken at that point.\n }\n\n return join(getNexusDataDir(), ...segments);\n}\n\n/**\n * Like `nexusDataPath()` but eagerly creates the parent directory so\n * callers don't have to remember `mkdirSync(dirname(p), { recursive: true })`\n * before every write. Issue #2890. Use when the returned path will be\n * written to immediately; for read-only resolution prefer `nexusDataPath()`.\n *\n * If the call resolves to a directory (single segment or no segments),\n * the target IS the resolved path. If it resolves to a file (multiple\n * segments), the target is its parent.\n */\nexport function nexusDataPathEnsure(...segments: string[]): string {\n const resolved = nexusDataPath(...segments);\n const target = segments.length > 1 ? dirname(resolved) : resolved;\n mkdirSync(target, { recursive: true });\n return resolved;\n}\n\n/**\n * Explicitly homedir-scoped path. Use this in code that handles\n * cross-project state (routing memory, model registry cache, auth,\n * research catalog) where you want a hard guarantee that the resolver\n * never routes per-repo, even if a new subdir gets accidentally added\n * to the `PER_REPO_SUBDIRS` allowlist later.\n */\nexport function nexusSharedPath(...segments: string[]): string {\n return join(getNexusDataDir(), ...segments);\n}\n\n/**\n * Returns the read-only categorization used by `nexusDataPath()`.\n * Exposed for tests and for tooling that wants to introspect which\n * subdirs are per-repo (e.g. the `nexus-agents migrate` command).\n */\nexport function getPerRepoSubdirs(): ReadonlySet<string> {\n return PER_REPO_SUBDIRS;\n}\n\n/** Per-process memo — the legacy session-DB relocation runs at most once. */\nlet legacySessionsDbMigrated = false;\n\n/** Test helper — clears the session-DB migration \"already did this\" memo. */\nexport function _resetSessionsDbMigrationMemoForTests(): void {\n legacySessionsDbMigrated = false;\n}\n\n/** SQLite sidecar suffixes that must travel with the main DB file. */\nconst SQLITE_SIDECAR_SUFFIXES = ['', '-wal', '-shm', '-journal'] as const;\n\n/**\n * Resolves the session-database path, performing a one-time relocation\n * of any pre-#2902 database on the first call per process.\n *\n * The session DB is per-repo episodic state and belongs in the\n * `sessions/` bucket alongside the session journals — vote #2876\n * categorized `sessions/` as per-repo, and issue #2902 (consensus\n * 3/3) extended that to the DB. Before #2902 the DB resolved via\n * `nexusDataPath('sessions.db')`; because `sessions.db` is not a\n * per-repo first segment, that landed cross-repo at\n * `~/.nexus-agents/sessions.db`, so a DB started in one repo leaked\n * into every other repo.\n *\n * If a legacy DB exists at the old location and none exists at the\n * new one, the legacy file (and any SQLite sidecars) is moved so\n * existing session history is preserved rather than silently\n * orphaned. The move is best-effort: a failure leaves the legacy DB\n * untouched for manual recovery and the caller gets a fresh DB at the\n * new path. `NEXUS_DATA_DIR` / `NEXUS_REPO_PREFERRED` / the\n * `NEXUS_SESSIONS_DB` override all sit upstream of this resolver.\n */\nexport function sessionsDbPath(): string {\n const target = nexusDataPath('sessions', 'sessions.db');\n if (!legacySessionsDbMigrated) {\n legacySessionsDbMigrated = true;\n migrateLegacySessionsDb(target);\n }\n return target;\n}\n\n/** One-time relocation of a pre-#2902 session DB. Best-effort — see `sessionsDbPath`. */\nfunction migrateLegacySessionsDb(target: string): void {\n const legacy = nexusDataPath('sessions.db'); // pre-#2902 resolution\n if (legacy === target || !existsSync(legacy) || existsSync(target)) return;\n try {\n mkdirSync(dirname(target), { recursive: true });\n for (const suffix of SQLITE_SIDECAR_SUFFIXES) {\n const from = `${legacy}${suffix}`;\n if (existsSync(from)) moveFile(from, `${target}${suffix}`);\n }\n } catch {\n // Best-effort — a migration failure must never break session storage.\n }\n}\n\n/** Moves a file, falling back to copy+unlink across a filesystem boundary. */\nfunction moveFile(from: string, to: string): void {\n try {\n renameSync(from, to);\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== 'EXDEV') throw err;\n copyFileSync(from, to);\n unlinkSync(from);\n }\n}\n","/**\n * Sandbox detection (#2501, child 1 of epic #2500).\n *\n * nexus-agents needs to know whether it's running inside a host-provided\n * sandbox (Docker Desktop Sandbox + OpenCode, Codex sandbox, locked-down\n * CI runner) so it can adjust behaviour:\n *\n * - default `NEXUS_DATA_DIR` to the multi-repo root rather than `~/...`\n * - skip CLI subprocess detection (binaries aren't there)\n * - fail-fast when the gateway is unreachable instead of degrading\n * - suppress diagnostics that don't apply\n *\n * The signal is **explicit**: the image author (Dockerfile, devcontainer,\n * harness wrapper) sets `NEXUS_SANDBOX=<flavor>`. The flavor string is\n * for diagnostics + per-flavor branching (`docker-opencode`, `codex`,\n * `claude-code`, `ci-restricted`, …); presence is the on/off signal.\n *\n * A heuristic check runs alongside for verification — if `NEXUS_SANDBOX`\n * claims `docker-opencode` but `/.dockerenv` is missing, that's a\n * misconfiguration worth surfacing to the operator.\n *\n * @module config/sandbox-detection\n */\n\nimport { existsSync, readFileSync } from 'node:fs';\n\n/**\n * Heuristic detection result. Independent from the explicit\n * `NEXUS_SANDBOX` env var; produced by inspecting filesystem markers.\n */\nexport type SandboxHeuristic = 'docker' | 'podman' | 'unknown' | null;\n\nexport interface SandboxInfo {\n /**\n * True iff `NEXUS_SANDBOX` is set + non-empty. The explicit signal\n * the rest of the codebase keys off — never `true` by heuristic alone.\n */\n readonly active: boolean;\n /**\n * Operator-supplied flavor string, e.g. `docker-opencode`. Undefined\n * when `active === false` or the env var is empty.\n */\n readonly flavor: string | undefined;\n /**\n * Multi-repo root the user mounted. From `NEXUS_SANDBOX_ROOT`. Undefined\n * when unset; consumers that need a default substitute `/`.\n */\n readonly root: string | undefined;\n /**\n * Independent heuristic match — `null` when we couldn't run the check,\n * `'unknown'` when ran but no marker matched. Used by `doctor` to flag\n * mismatches between the explicit signal and the runtime environment.\n */\n readonly heuristicMatch: SandboxHeuristic;\n}\n\n/**\n * Detect whether nexus-agents is running inside a host-provided sandbox.\n * Pure read of env + filesystem; no caching (cheap enough to recompute,\n * and tests routinely mutate process.env).\n */\nexport function detectSandbox(): SandboxInfo {\n const flavorRaw = process.env['NEXUS_SANDBOX']?.trim();\n const flavor = flavorRaw !== undefined && flavorRaw !== '' ? flavorRaw : undefined;\n const active = flavor !== undefined;\n\n const rootRaw = process.env['NEXUS_SANDBOX_ROOT']?.trim();\n const root = rootRaw !== undefined && rootRaw !== '' ? rootRaw : undefined;\n\n return {\n active,\n flavor,\n root,\n heuristicMatch: detectContainerHeuristic(),\n };\n}\n\n/**\n * Look for filesystem markers indicating a container runtime. Used as a\n * cross-check against the explicit `NEXUS_SANDBOX` signal.\n *\n * Order of checks:\n * 1. `/.dockerenv` (Docker)\n * 2. `/run/.containerenv` (Podman)\n * 3. `/proc/1/cgroup` containing `docker` or `containerd` strings\n *\n * Returns `null` when none of the checks could run (non-Linux host with\n * no `/proc`, sandbox blocks `existsSync`, etc.) — distinct from\n * `'unknown'` (checks ran, no marker matched) so the doctor message can\n * differentiate \"we couldn't tell\" from \"we checked, no container\".\n */\nfunction detectContainerHeuristic(): SandboxHeuristic {\n try {\n if (existsSync('/.dockerenv')) return 'docker';\n if (existsSync('/run/.containerenv')) return 'podman';\n if (existsSync('/proc/1/cgroup')) {\n const cgroup = readFileSync('/proc/1/cgroup', 'utf8');\n if (/\\bdocker\\b/.test(cgroup)) return 'docker';\n if (/\\bcontainerd\\b/.test(cgroup)) return 'docker';\n }\n return 'unknown';\n } catch {\n return null;\n }\n}\n"],"mappings":";AA6BA,SAAS,YAAY,cAAc,cAAc,gBAA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AAM,SAAS,SAAS,SAAS,IAAIC,SAAQ,QAAQ,IAAI;AACzD,YAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;AACrC,SAAO;AACT;AASO,SAAS,mBAAmB,UAA4B;AAC7D,SAAOD,MAAK,gBAAgB,GAAG,GAAG,QAAQ;AAC5C;AAOO,SAAS,oBAAyC;AACvD,SAAO;AACT;AAGA,IAAI,2BAA2B;AAQ/B,IAAM,0BAA0B,CAAC,IAAI,QAAQ,QAAQ,UAAU;AAuBxD,SAAS,iBAAyB;AACvC,QAAM,SAAS,cAAc,YAAY,aAAa;AACtD,MAAI,CAAC,0BAA0B;AAC7B,+BAA2B;AAC3B,4BAAwB,MAAM;AAAA,EAChC;AACA,SAAO;AACT;AAGA,SAAS,wBAAwB,QAAsB;AACrD,QAAM,SAAS,cAAc,aAAa;AAC1C,MAAI,WAAW,UAAU,CAACE,YAAW,MAAM,KAAKA,YAAW,MAAM,EAAG;AACpE,MAAI;AACF,cAAUC,SAAQ,MAAM,GAAG,EAAE,WAAW,KAAK,CAAC;AAC9C,eAAW,UAAU,yBAAyB;AAC5C,YAAM,OAAO,GAAG,MAAM,GAAG,MAAM;AAC/B,UAAID,YAAW,IAAI,EAAG,UAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE;AAAA,IAC3D;AAAA,EACF,QAAQ;AAAA,EAER;AACF;AAGA,SAAS,SAAS,MAAc,IAAkB;AAChD,MAAI;AACF,eAAW,MAAM,EAAE;AAAA,EACrB,SAAS,KAAK;AACZ,QAAK,IAA8B,SAAS,QAAS,OAAM;AAC3D,iBAAa,MAAM,EAAE;AACrB,eAAW,IAAI;AAAA,EACjB;AACF;","names":["existsSync","readFileSync","statSync","resolve","accessSync","existsSync","realpathSync","statSync","homedir","dirname","isAbsolute","join","resolve","existsSync","readFileSync","resolve","join","homedir","realpathSync","resolve","isAbsolute","statSync","join","existsSync","accessSync","join","dirname","existsSync","dirname"]}
@@ -15,7 +15,7 @@ import {
15
15
  createLogger,
16
16
  err,
17
17
  ok
18
- } from "./chunk-OCJEYHUQ.js";
18
+ } from "./chunk-KWZC5LFC.js";
19
19
 
20
20
  // src/adapters/sdk/types.ts
21
21
  var PROVIDER_ENV_KEYS = {
@@ -396,4 +396,4 @@ export {
396
396
  CUSTOM_API_DEFAULT_MODEL,
397
397
  DEFAULTS
398
398
  };
399
- //# sourceMappingURL=chunk-7E5UXA4U.js.map
399
+ //# sourceMappingURL=chunk-DKU7O4V2.js.map
@@ -9,11 +9,11 @@ import {
9
9
  gateWithReputation,
10
10
  resolveReputationGatingMode,
11
11
  sanitizeInput
12
- } from "./chunk-FSUZIIOJ.js";
12
+ } from "./chunk-MNXLJ2VX.js";
13
13
  import {
14
14
  createLogger,
15
15
  getTimeProvider
16
- } from "./chunk-OCJEYHUQ.js";
16
+ } from "./chunk-KWZC5LFC.js";
17
17
 
18
18
  // src/dogfooding/pr-reviewer-helpers.ts
19
19
  import { randomUUID } from "crypto";
@@ -288,4 +288,4 @@ export {
288
288
  formatReviewComment,
289
289
  createFailedReview
290
290
  };
291
- //# sourceMappingURL=chunk-JK4L2TQ6.js.map
291
+ //# sourceMappingURL=chunk-DOCEHXLQ.js.map
@@ -3,7 +3,7 @@ import {
3
3
  MODEL_IDS,
4
4
  getTimeProvider,
5
5
  resolveModelIdentitySync
6
- } from "./chunk-OCJEYHUQ.js";
6
+ } from "./chunk-KWZC5LFC.js";
7
7
 
8
8
  // src/config/model-availability.ts
9
9
  var DEFAULT_TTL_MS = 6e4;
@@ -150,4 +150,4 @@ export {
150
150
  resetAvailabilityCache,
151
151
  filterAvailableModels
152
152
  };
153
- //# sourceMappingURL=chunk-KOVTOPEQ.js.map
153
+ //# sourceMappingURL=chunk-DTHMBYSV.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createAutoAdapter
3
- } from "./chunk-GWOXPCIF.js";
3
+ } from "./chunk-7XCQJXN4.js";
4
4
  import {
5
5
  mapModelErrorToCategory
6
- } from "./chunk-7G63H7ZT.js";
6
+ } from "./chunk-H4ATQPGQ.js";
7
7
  import {
8
8
  CLI_NAMES,
9
9
  CircularBuffer,
@@ -24,7 +24,7 @@ import {
24
24
  ok,
25
25
  recordRateLimitEvent,
26
26
  toRateLimitError
27
- } from "./chunk-OCJEYHUQ.js";
27
+ } from "./chunk-KWZC5LFC.js";
28
28
 
29
29
  // src/agents/collaboration/event-bus-helpers.ts
30
30
  import { randomUUID } from "crypto";
@@ -1041,4 +1041,4 @@ export {
1041
1041
  getGlobalRegistry,
1042
1042
  resetGlobalRegistry
1043
1043
  };
1044
- //# sourceMappingURL=chunk-HMZT2SJK.js.map
1044
+ //# sourceMappingURL=chunk-H3B7H67H.js.map
@@ -5,7 +5,7 @@ import {
5
5
  getErrorMessage,
6
6
  getTimeProvider,
7
7
  ok
8
- } from "./chunk-OCJEYHUQ.js";
8
+ } from "./chunk-KWZC5LFC.js";
9
9
 
10
10
  // src/cli-adapters/circuit-breaker-types.ts
11
11
  var CircuitErrorCode = {
@@ -375,4 +375,4 @@ export {
375
375
  mapCliErrorToCategory,
376
376
  mapModelErrorToCategory
377
377
  };
378
- //# sourceMappingURL=chunk-7G63H7ZT.js.map
378
+ //# sourceMappingURL=chunk-H4ATQPGQ.js.map
@@ -5,17 +5,17 @@ import {
5
5
  } from "./chunk-6T3EPABN.js";
6
6
  import {
7
7
  SessionMemory
8
- } from "./chunk-3QH2KWLH.js";
8
+ } from "./chunk-D2XWKFZ2.js";
9
9
  import {
10
10
  StatsOnlyAdapter,
11
11
  ensureSharedMemoryRegistry
12
- } from "./chunk-UGAKYSDO.js";
12
+ } from "./chunk-RER74KD6.js";
13
13
  import {
14
14
  getMemoryRegistry
15
15
  } from "./chunk-2XRPKJKX.js";
16
16
  import {
17
17
  generateId
18
- } from "./chunk-FIQSOSQU.js";
18
+ } from "./chunk-K62WRHHK.js";
19
19
  import {
20
20
  ErrorCode,
21
21
  NexusError,
@@ -28,10 +28,10 @@ import {
28
28
  getTimeProvider,
29
29
  ok,
30
30
  setSharedMobiMemDbPathResolver
31
- } from "./chunk-OCJEYHUQ.js";
31
+ } from "./chunk-KWZC5LFC.js";
32
32
  import {
33
33
  nexusDataPath
34
- } from "./chunk-L4QFWOOQ.js";
34
+ } from "./chunk-DHVMSIT5.js";
35
35
 
36
36
  // src/mcp/tools/tool-memory.ts
37
37
  import * as fs3 from "fs";
@@ -5552,4 +5552,4 @@ export {
5552
5552
  reinitializeMemoryBackends,
5553
5553
  ToolMemoryManager
5554
5554
  };
5555
- //# sourceMappingURL=chunk-ESP6U3LW.js.map
5555
+ //# sourceMappingURL=chunk-J2HWO3J3.js.map