nexus-agents 8.102.2 → 8.103.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 (137) hide show
  1. package/dist/{ast-rule-runner-WWUOS722.js → ast-rule-runner-MG5CSPWM.js} +3 -3
  2. package/dist/{child-mcp-config-U3I7K7BT.js → child-mcp-config-WPCDGWFE.js} +2 -2
  3. package/dist/{chunk-QHMUW6G7.js → chunk-2DOH7LES.js} +4 -4
  4. package/dist/{chunk-PAICM2DX.js → chunk-3KQJ54R6.js} +4 -4
  5. package/dist/{chunk-LKMB7ZPK.js → chunk-45HAQ44K.js} +3 -3
  6. package/dist/{chunk-6NYFFN42.js → chunk-55VTUHIR.js} +4 -4
  7. package/dist/{chunk-CDCEDAEO.js → chunk-7IU7HDDO.js} +2 -2
  8. package/dist/{chunk-JASILDK4.js → chunk-AJMJPUPR.js} +3 -3
  9. package/dist/{chunk-GVSSUYBR.js → chunk-BD4GXOQB.js} +5 -5
  10. package/dist/{chunk-UA3TQ773.js → chunk-CP6NEDAC.js} +2 -2
  11. package/dist/{chunk-L265O6SP.js → chunk-CPFKM4K7.js} +4 -4
  12. package/dist/{chunk-5ML3THNH.js → chunk-FADEMLNQ.js} +7 -7
  13. package/dist/{chunk-XWMT6ZSS.js → chunk-G47QXLHM.js} +12 -12
  14. package/dist/{chunk-KMY3NA44.js → chunk-JGZHI37B.js} +2 -2
  15. package/dist/{chunk-YKC7ICXJ.js → chunk-KG7QNWWR.js} +10 -2
  16. package/dist/chunk-KG7QNWWR.js.map +1 -0
  17. package/dist/{chunk-YBV7HIRX.js → chunk-KLHFVYAP.js} +32 -17
  18. package/dist/chunk-KLHFVYAP.js.map +1 -0
  19. package/dist/{chunk-OCXGPXG2.js → chunk-LRDHTYE3.js} +2 -2
  20. package/dist/{chunk-V3YMUA74.js → chunk-MITLS7S7.js} +4 -4
  21. package/dist/{chunk-NCQGSHEH.js → chunk-N22A5RSA.js} +2 -2
  22. package/dist/{chunk-2ON7ZOBD.js → chunk-NIE77YOM.js} +39 -39
  23. package/dist/{chunk-AWUTGAQN.js → chunk-OJQNSD2R.js} +2 -2
  24. package/dist/{chunk-XROOAW6C.js → chunk-PKWOB6SS.js} +2 -2
  25. package/dist/{chunk-D5EDP3EQ.js → chunk-S7GEUHK6.js} +2 -2
  26. package/dist/{chunk-2I2I3DRA.js → chunk-SEGBB7VI.js} +5 -5
  27. package/dist/{chunk-C4T7UI2R.js → chunk-SFKQIPPE.js} +24 -13
  28. package/dist/chunk-SFKQIPPE.js.map +1 -0
  29. package/dist/{chunk-ZR5JWLC5.js → chunk-SZGVILVS.js} +3 -3
  30. package/dist/chunk-SZGVILVS.js.map +1 -0
  31. package/dist/{chunk-BY5SXMN5.js → chunk-TEKDGJ7T.js} +2 -2
  32. package/dist/{chunk-YSLHLLRK.js → chunk-THCAUXID.js} +2 -2
  33. package/dist/{chunk-BYRIEU5S.js → chunk-VFT7OHAD.js} +2 -2
  34. package/dist/{chunk-HVJIQLBC.js → chunk-WVSFUDDF.js} +2 -2
  35. package/dist/{chunk-ODLIA33L.js → chunk-XXHO52MZ.js} +2 -2
  36. package/dist/{chunk-TBTXBJ7T.js → chunk-XYUNU7UD.js} +3 -3
  37. package/dist/{chunk-MYLHKD32.js → chunk-Y6EZX773.js} +2 -2
  38. package/dist/{chunk-7YPSWDOV.js → chunk-Z7L5C35G.js} +2 -2
  39. package/dist/{chunk-RGW4TLFO.js → chunk-ZDFC5TOU.js} +3 -3
  40. package/dist/{chunk-NACTU45C.js → chunk-ZVNEWTHP.js} +2 -2
  41. package/dist/{cli-circuit-breaker-V2BTK5ZW.js → cli-circuit-breaker-FDVTKR3W.js} +3 -3
  42. package/dist/cli.d.ts +1 -1
  43. package/dist/cli.js +53 -46
  44. package/dist/cli.js.map +1 -1
  45. package/dist/{composite-router-RX3JZYIE.js → composite-router-OTSHVAIF.js} +2 -2
  46. package/dist/{consensus-vote-4ET2GP6B.js → consensus-vote-QGW6QVZO.js} +16 -16
  47. package/dist/{consensus-vote-types-0WGuII6a.d.ts → consensus-vote-types-rAhTNGvq.d.ts} +37 -2
  48. package/dist/{context-retriever-IK253TWS.js → context-retriever-QI6XW5LK.js} +8 -8
  49. package/dist/{doctor-deep-5K4BPYSH.js → doctor-deep-375FGXVN.js} +3 -3
  50. package/dist/{doctor-gateway-report-MRSOR4TR.js → doctor-gateway-report-ZPZQLULX.js} +6 -6
  51. package/dist/{doctor-live-QW4XTIZW.js → doctor-live-FCXFMIYP.js} +10 -10
  52. package/dist/{expert-bridge-IWTCC652.js → expert-bridge-VLDOWCEX.js} +4 -4
  53. package/dist/{factory-IQRYHF2K.js → factory-AXQJGIQ2.js} +5 -5
  54. package/dist/{factory-ZPHF32DK.js → factory-M4I2H672.js} +9 -9
  55. package/dist/{improvement-review-WQYWT3GP.js → improvement-review-6ZEUEFSB.js} +5 -5
  56. package/dist/index.d.ts +8 -4
  57. package/dist/index.js +31 -31
  58. package/dist/{init-opencode-6VPDLKMF.js → init-opencode-W4PHSNEW.js} +5 -5
  59. package/dist/issue-triage-D2FVG6WU.js +16 -0
  60. package/dist/{openai-compat-adapter-5WAMUIQA.js → openai-compat-adapter-DYQGI4QH.js} +5 -5
  61. package/dist/{pr-reviewer-helpers-SNUDE5TO.js → pr-reviewer-helpers-BUVRQYVV.js} +4 -4
  62. package/dist/{registry-command-APTVRLDC.js → registry-command-V5O2RJKG.js} +2 -2
  63. package/dist/{repo-security-plan-4JQGVAZZ.js → repo-security-plan-2ZLH3LHT.js} +3 -3
  64. package/dist/{research-helpers-synthesize-65NCBD5R.js → research-helpers-synthesize-52U4FSGP.js} +4 -4
  65. package/dist/{routing-memory-FH63BFPW.js → routing-memory-3FIWR6WH.js} +2 -2
  66. package/dist/{session-memory-VGDP7YE3.js → session-memory-HIH3T3NA.js} +3 -3
  67. package/dist/{setup-config-EZ5SSK6U.js → setup-config-IP75P4NY.js} +3 -3
  68. package/dist/{setup-custom-api-3HDBQLOX.js → setup-custom-api-DAFW3DKS.js} +4 -4
  69. package/dist/setup-data-dir-ZF4KKISC.js +33 -0
  70. package/dist/{tool-memory-P3ANNLKT.js → tool-memory-LAFHMYSR.js} +5 -5
  71. package/dist/{unified-registry-UBGBRRBV.js → unified-registry-N4MPRQUA.js} +10 -10
  72. package/dist/{weather-report-PBMB3PYV.js → weather-report-MKHINWCE.js} +2 -2
  73. package/package.json +1 -1
  74. package/dist/chunk-C4T7UI2R.js.map +0 -1
  75. package/dist/chunk-YBV7HIRX.js.map +0 -1
  76. package/dist/chunk-YKC7ICXJ.js.map +0 -1
  77. package/dist/chunk-ZR5JWLC5.js.map +0 -1
  78. package/dist/issue-triage-TD4LKVPI.js +0 -16
  79. package/dist/setup-data-dir-2EVIVSKU.js +0 -33
  80. /package/dist/{ast-rule-runner-WWUOS722.js.map → ast-rule-runner-MG5CSPWM.js.map} +0 -0
  81. /package/dist/{child-mcp-config-U3I7K7BT.js.map → child-mcp-config-WPCDGWFE.js.map} +0 -0
  82. /package/dist/{chunk-QHMUW6G7.js.map → chunk-2DOH7LES.js.map} +0 -0
  83. /package/dist/{chunk-PAICM2DX.js.map → chunk-3KQJ54R6.js.map} +0 -0
  84. /package/dist/{chunk-LKMB7ZPK.js.map → chunk-45HAQ44K.js.map} +0 -0
  85. /package/dist/{chunk-6NYFFN42.js.map → chunk-55VTUHIR.js.map} +0 -0
  86. /package/dist/{chunk-CDCEDAEO.js.map → chunk-7IU7HDDO.js.map} +0 -0
  87. /package/dist/{chunk-JASILDK4.js.map → chunk-AJMJPUPR.js.map} +0 -0
  88. /package/dist/{chunk-GVSSUYBR.js.map → chunk-BD4GXOQB.js.map} +0 -0
  89. /package/dist/{chunk-UA3TQ773.js.map → chunk-CP6NEDAC.js.map} +0 -0
  90. /package/dist/{chunk-L265O6SP.js.map → chunk-CPFKM4K7.js.map} +0 -0
  91. /package/dist/{chunk-5ML3THNH.js.map → chunk-FADEMLNQ.js.map} +0 -0
  92. /package/dist/{chunk-XWMT6ZSS.js.map → chunk-G47QXLHM.js.map} +0 -0
  93. /package/dist/{chunk-KMY3NA44.js.map → chunk-JGZHI37B.js.map} +0 -0
  94. /package/dist/{chunk-OCXGPXG2.js.map → chunk-LRDHTYE3.js.map} +0 -0
  95. /package/dist/{chunk-V3YMUA74.js.map → chunk-MITLS7S7.js.map} +0 -0
  96. /package/dist/{chunk-NCQGSHEH.js.map → chunk-N22A5RSA.js.map} +0 -0
  97. /package/dist/{chunk-2ON7ZOBD.js.map → chunk-NIE77YOM.js.map} +0 -0
  98. /package/dist/{chunk-AWUTGAQN.js.map → chunk-OJQNSD2R.js.map} +0 -0
  99. /package/dist/{chunk-XROOAW6C.js.map → chunk-PKWOB6SS.js.map} +0 -0
  100. /package/dist/{chunk-D5EDP3EQ.js.map → chunk-S7GEUHK6.js.map} +0 -0
  101. /package/dist/{chunk-2I2I3DRA.js.map → chunk-SEGBB7VI.js.map} +0 -0
  102. /package/dist/{chunk-BY5SXMN5.js.map → chunk-TEKDGJ7T.js.map} +0 -0
  103. /package/dist/{chunk-YSLHLLRK.js.map → chunk-THCAUXID.js.map} +0 -0
  104. /package/dist/{chunk-BYRIEU5S.js.map → chunk-VFT7OHAD.js.map} +0 -0
  105. /package/dist/{chunk-HVJIQLBC.js.map → chunk-WVSFUDDF.js.map} +0 -0
  106. /package/dist/{chunk-ODLIA33L.js.map → chunk-XXHO52MZ.js.map} +0 -0
  107. /package/dist/{chunk-TBTXBJ7T.js.map → chunk-XYUNU7UD.js.map} +0 -0
  108. /package/dist/{chunk-MYLHKD32.js.map → chunk-Y6EZX773.js.map} +0 -0
  109. /package/dist/{chunk-7YPSWDOV.js.map → chunk-Z7L5C35G.js.map} +0 -0
  110. /package/dist/{chunk-RGW4TLFO.js.map → chunk-ZDFC5TOU.js.map} +0 -0
  111. /package/dist/{chunk-NACTU45C.js.map → chunk-ZVNEWTHP.js.map} +0 -0
  112. /package/dist/{cli-circuit-breaker-V2BTK5ZW.js.map → cli-circuit-breaker-FDVTKR3W.js.map} +0 -0
  113. /package/dist/{composite-router-RX3JZYIE.js.map → composite-router-OTSHVAIF.js.map} +0 -0
  114. /package/dist/{consensus-vote-4ET2GP6B.js.map → consensus-vote-QGW6QVZO.js.map} +0 -0
  115. /package/dist/{context-retriever-IK253TWS.js.map → context-retriever-QI6XW5LK.js.map} +0 -0
  116. /package/dist/{doctor-deep-5K4BPYSH.js.map → doctor-deep-375FGXVN.js.map} +0 -0
  117. /package/dist/{doctor-gateway-report-MRSOR4TR.js.map → doctor-gateway-report-ZPZQLULX.js.map} +0 -0
  118. /package/dist/{doctor-live-QW4XTIZW.js.map → doctor-live-FCXFMIYP.js.map} +0 -0
  119. /package/dist/{expert-bridge-IWTCC652.js.map → expert-bridge-VLDOWCEX.js.map} +0 -0
  120. /package/dist/{factory-IQRYHF2K.js.map → factory-AXQJGIQ2.js.map} +0 -0
  121. /package/dist/{factory-ZPHF32DK.js.map → factory-M4I2H672.js.map} +0 -0
  122. /package/dist/{improvement-review-WQYWT3GP.js.map → improvement-review-6ZEUEFSB.js.map} +0 -0
  123. /package/dist/{init-opencode-6VPDLKMF.js.map → init-opencode-W4PHSNEW.js.map} +0 -0
  124. /package/dist/{issue-triage-TD4LKVPI.js.map → issue-triage-D2FVG6WU.js.map} +0 -0
  125. /package/dist/{openai-compat-adapter-5WAMUIQA.js.map → openai-compat-adapter-DYQGI4QH.js.map} +0 -0
  126. /package/dist/{pr-reviewer-helpers-SNUDE5TO.js.map → pr-reviewer-helpers-BUVRQYVV.js.map} +0 -0
  127. /package/dist/{registry-command-APTVRLDC.js.map → registry-command-V5O2RJKG.js.map} +0 -0
  128. /package/dist/{repo-security-plan-4JQGVAZZ.js.map → repo-security-plan-2ZLH3LHT.js.map} +0 -0
  129. /package/dist/{research-helpers-synthesize-65NCBD5R.js.map → research-helpers-synthesize-52U4FSGP.js.map} +0 -0
  130. /package/dist/{routing-memory-FH63BFPW.js.map → routing-memory-3FIWR6WH.js.map} +0 -0
  131. /package/dist/{session-memory-VGDP7YE3.js.map → session-memory-HIH3T3NA.js.map} +0 -0
  132. /package/dist/{setup-config-EZ5SSK6U.js.map → setup-config-IP75P4NY.js.map} +0 -0
  133. /package/dist/{setup-custom-api-3HDBQLOX.js.map → setup-custom-api-DAFW3DKS.js.map} +0 -0
  134. /package/dist/{setup-data-dir-2EVIVSKU.js.map → setup-data-dir-ZF4KKISC.js.map} +0 -0
  135. /package/dist/{tool-memory-P3ANNLKT.js.map → tool-memory-LAFHMYSR.js.map} +0 -0
  136. /package/dist/{unified-registry-UBGBRRBV.js.map → unified-registry-N4MPRQUA.js.map} +0 -0
  137. /package/dist/{weather-report-PBMB3PYV.js.map → weather-report-MKHINWCE.js.map} +0 -0
@@ -9,8 +9,8 @@ import {
9
9
  getBuiltInAstRulesPath,
10
10
  loadRules,
11
11
  runAstQaRules
12
- } from "./chunk-XROOAW6C.js";
13
- import "./chunk-ZR5JWLC5.js";
12
+ } from "./chunk-PKWOB6SS.js";
13
+ import "./chunk-SZGVILVS.js";
14
14
  import "./chunk-UE7A2XHM.js";
15
15
  import "./chunk-LWOX65CP.js";
16
16
  import "./chunk-PX6F3LHL.js";
@@ -26,4 +26,4 @@ export {
26
26
  loadRules,
27
27
  runAstQaRules
28
28
  };
29
- //# sourceMappingURL=ast-rule-runner-WWUOS722.js.map
29
+ //# sourceMappingURL=ast-rule-runner-MG5CSPWM.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-OITVVSWO.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-ZR5JWLC5.js";
6
+ } from "./chunk-SZGVILVS.js";
7
7
  import "./chunk-UE7A2XHM.js";
8
8
  import "./chunk-LWOX65CP.js";
9
9
  import "./chunk-PX6F3LHL.js";
@@ -56,4 +56,4 @@ async function generateMcpConfig(options) {
56
56
  export {
57
57
  generateMcpConfig
58
58
  };
59
- //# sourceMappingURL=child-mcp-config-U3I7K7BT.js.map
59
+ //# sourceMappingURL=child-mcp-config-WPCDGWFE.js.map
@@ -7,12 +7,12 @@ import {
7
7
  readGatewayTransport,
8
8
  requireApiKey,
9
9
  validateApiKeyPresence
10
- } from "./chunk-D5EDP3EQ.js";
10
+ } from "./chunk-S7GEUHK6.js";
11
11
  import {
12
12
  assertCustomApiHostResolvesPublic,
13
13
  hostnameOf,
14
14
  redactApiKey
15
- } from "./chunk-YKC7ICXJ.js";
15
+ } from "./chunk-KG7QNWWR.js";
16
16
  import {
17
17
  sanitizeErrorDetails
18
18
  } from "./chunk-2NDA4DHW.js";
@@ -40,7 +40,7 @@ import {
40
40
  readModelAllowlist,
41
41
  recordUsageEvent,
42
42
  refineGatewayCatalog
43
- } from "./chunk-ZR5JWLC5.js";
43
+ } from "./chunk-SZGVILVS.js";
44
44
 
45
45
  // src/adapters/openai-compat-adapter.ts
46
46
  import OpenAI2 from "openai";
@@ -1014,4 +1014,4 @@ export {
1014
1014
  createOpenAICompatAdapter,
1015
1015
  buildOpenAICompatAdapters
1016
1016
  };
1017
- //# sourceMappingURL=chunk-QHMUW6G7.js.map
1017
+ //# sourceMappingURL=chunk-2DOH7LES.js.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-7LP6VJRP.js";
6
6
  import {
7
7
  SessionMemory
8
- } from "./chunk-NCQGSHEH.js";
8
+ } from "./chunk-N22A5RSA.js";
9
9
  import {
10
10
  StatsOnlyAdapter,
11
11
  ensureSharedMemoryRegistry
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-MUJCGBZW.js";
16
16
  import {
17
17
  generateId
18
- } from "./chunk-7YPSWDOV.js";
18
+ } from "./chunk-Z7L5C35G.js";
19
19
  import {
20
20
  ErrorCode,
21
21
  NexusError,
@@ -29,7 +29,7 @@ import {
29
29
  ok,
30
30
  openSqliteDatabase,
31
31
  setSharedMobiMemDbPathResolver
32
- } from "./chunk-ZR5JWLC5.js";
32
+ } from "./chunk-SZGVILVS.js";
33
33
  import {
34
34
  nexusDataPath
35
35
  } from "./chunk-LWOX65CP.js";
@@ -5768,4 +5768,4 @@ export {
5768
5768
  shutdownToolMemory,
5769
5769
  ToolMemoryManager
5770
5770
  };
5771
- //# sourceMappingURL=chunk-PAICM2DX.js.map
5771
+ //# sourceMappingURL=chunk-3KQJ54R6.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  loadPapersRegistry
3
- } from "./chunk-NACTU45C.js";
3
+ } from "./chunk-ZVNEWTHP.js";
4
4
  import {
5
5
  getErrorMessage
6
- } from "./chunk-ZR5JWLC5.js";
6
+ } from "./chunk-SZGVILVS.js";
7
7
 
8
8
  // src/cli/research-helpers-synthesize.ts
9
9
  import { z } from "zod";
@@ -876,4 +876,4 @@ export {
876
876
  AttributedInsightSchema,
877
877
  synthesizeResearch
878
878
  };
879
- //# sourceMappingURL=chunk-LKMB7ZPK.js.map
879
+ //# sourceMappingURL=chunk-45HAQ44K.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createAutoAdapter
3
- } from "./chunk-C4T7UI2R.js";
3
+ } from "./chunk-SFKQIPPE.js";
4
4
  import {
5
5
  getDefaultCliCircuitBreakerRegistry,
6
6
  mapModelErrorToCategory
7
- } from "./chunk-AWUTGAQN.js";
7
+ } from "./chunk-OJQNSD2R.js";
8
8
  import {
9
9
  CircularBuffer,
10
10
  ConfigError,
@@ -30,7 +30,7 @@ import {
30
30
  resolveModelIdentitySync,
31
31
  toRateLimitError,
32
32
  warnIfGatewayCostUndeclared
33
- } from "./chunk-ZR5JWLC5.js";
33
+ } from "./chunk-SZGVILVS.js";
34
34
 
35
35
  // src/config/model-equivalence.ts
36
36
  var VARIANT_QUIRKS = /* @__PURE__ */ new Set(["small", "image"]);
@@ -1050,4 +1050,4 @@ export {
1050
1050
  getGlobalRegistry,
1051
1051
  resetGlobalRegistry
1052
1052
  };
1053
- //# sourceMappingURL=chunk-6NYFFN42.js.map
1053
+ //# sourceMappingURL=chunk-55VTUHIR.js.map
@@ -8,7 +8,7 @@ import {
8
8
  getAdaptiveBonus,
9
9
  getOutcomeStore,
10
10
  hasMeasuredCategory
11
- } from "./chunk-ZR5JWLC5.js";
11
+ } from "./chunk-SZGVILVS.js";
12
12
 
13
13
  // src/cli/doctor-deep.ts
14
14
  var CLI_NAMES = ["claude", "gemini", "codex", "opencode"];
@@ -148,4 +148,4 @@ export {
148
148
  runDeepDiagnostics,
149
149
  formatDeepDiagnostics
150
150
  };
151
- //# sourceMappingURL=chunk-CDCEDAEO.js.map
151
+ //# sourceMappingURL=chunk-7IU7HDDO.js.map
@@ -7,7 +7,7 @@ import {
7
7
  toolStructuredError,
8
8
  toolSuccessStructured,
9
9
  wrapToolWithTimeout
10
- } from "./chunk-TBTXBJ7T.js";
10
+ } from "./chunk-XYUNU7UD.js";
11
11
  import {
12
12
  JsonlStore,
13
13
  SECURITY_KEYWORDS,
@@ -21,7 +21,7 @@ import {
21
21
  hasMeasuredCategory,
22
22
  isDeclaredNeverDeprecate,
23
23
  isRegisteredToolName
24
- } from "./chunk-ZR5JWLC5.js";
24
+ } from "./chunk-SZGVILVS.js";
25
25
  import {
26
26
  getNexusDataDir,
27
27
  nexusDataPath
@@ -2284,4 +2284,4 @@ export {
2284
2284
  runImprovementReview,
2285
2285
  registerImprovementReviewTool
2286
2286
  };
2287
- //# sourceMappingURL=chunk-JASILDK4.js.map
2287
+ //# sourceMappingURL=chunk-AJMJPUPR.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  GitHubProvider,
3
3
  ScmError
4
- } from "./chunk-ODLIA33L.js";
4
+ } from "./chunk-XXHO52MZ.js";
5
5
  import {
6
6
  ROLE_DEFAULT_TRUST,
7
7
  ReputationCache,
@@ -12,10 +12,10 @@ import {
12
12
  resolveEnvMode,
13
13
  resolveReputationGatingMode,
14
14
  sanitizeInput
15
- } from "./chunk-BY5SXMN5.js";
15
+ } from "./chunk-TEKDGJ7T.js";
16
16
  import {
17
17
  hasToken
18
- } from "./chunk-KMY3NA44.js";
18
+ } from "./chunk-JGZHI37B.js";
19
19
  import {
20
20
  CLI_SUBPROCESS_TIMEOUTS,
21
21
  createLogger,
@@ -23,7 +23,7 @@ import {
23
23
  getErrorMessage,
24
24
  getTimeProvider,
25
25
  ok
26
- } from "./chunk-ZR5JWLC5.js";
26
+ } from "./chunk-SZGVILVS.js";
27
27
 
28
28
  // src/security/firewall/firewall-policy-mode.ts
29
29
  import { z } from "zod";
@@ -2650,4 +2650,4 @@ export {
2650
2650
  IssueTriage,
2651
2651
  createIssueTriage
2652
2652
  };
2653
- //# sourceMappingURL=chunk-GVSSUYBR.js.map
2653
+ //# sourceMappingURL=chunk-BD4GXOQB.js.map
@@ -3,7 +3,7 @@ import {
3
3
  MODEL_IDS,
4
4
  getTimeProvider,
5
5
  resolveModelIdentitySync
6
- } from "./chunk-ZR5JWLC5.js";
6
+ } from "./chunk-SZGVILVS.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-UA3TQ773.js.map
153
+ //# sourceMappingURL=chunk-CP6NEDAC.js.map
@@ -3,10 +3,10 @@ import {
3
3
  createOpenAICompatAdapter,
4
4
  discoverGatewayCatalog,
5
5
  readOpenAICompatEnv
6
- } from "./chunk-QHMUW6G7.js";
6
+ } from "./chunk-2DOH7LES.js";
7
7
  import {
8
8
  gatewayProxyUrl
9
- } from "./chunk-D5EDP3EQ.js";
9
+ } from "./chunk-S7GEUHK6.js";
10
10
  import {
11
11
  DEFAULT_OPENAI_COMPAT_ENDPOINT,
12
12
  GATEWAY_COST_ENV,
@@ -22,7 +22,7 @@ import {
22
22
  getTimeProvider,
23
23
  symbols,
24
24
  writeLine
25
- } from "./chunk-ZR5JWLC5.js";
25
+ } from "./chunk-SZGVILVS.js";
26
26
 
27
27
  // src/cli/doctor-gateway.ts
28
28
  var PROBE_FAMILIES = ["anthropic", "openai", "google"];
@@ -319,4 +319,4 @@ export {
319
319
  formatGatewayReport,
320
320
  formatGatewaySlotWarnings
321
321
  };
322
- //# sourceMappingURL=chunk-L265O6SP.js.map
322
+ //# sourceMappingURL=chunk-CPFKM4K7.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  resolveCliSlot
3
- } from "./chunk-UA3TQ773.js";
3
+ } from "./chunk-CP6NEDAC.js";
4
4
  import {
5
5
  createLogger,
6
6
  getTimeProvider,
7
7
  isRateLimitText
8
- } from "./chunk-ZR5JWLC5.js";
8
+ } from "./chunk-SZGVILVS.js";
9
9
 
10
10
  // src/pipeline/expert-bridge.ts
11
11
  function resolveCliFromModelString(model) {
@@ -30,7 +30,7 @@ async function getMcpConfigPath() {
30
30
  if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;
31
31
  mcpConfigInitPromise ??= (async () => {
32
32
  try {
33
- const { generateMcpConfig } = await import("./child-mcp-config-U3I7K7BT.js");
33
+ const { generateMcpConfig } = await import("./child-mcp-config-WPCDGWFE.js");
34
34
  const config = await generateMcpConfig();
35
35
  cachedMcpConfigPath = config.configPath;
36
36
  cachedMcpConfigCleanup = config.cleanup;
@@ -110,8 +110,8 @@ var routerInitPromise = null;
110
110
  async function getRouter() {
111
111
  if (cachedRouter !== null) return cachedRouter;
112
112
  routerInitPromise ??= (async () => {
113
- const { createAllAdapters } = await import("./factory-ZPHF32DK.js");
114
- const { createCompositeRouter } = await import("./composite-router-RX3JZYIE.js");
113
+ const { createAllAdapters } = await import("./factory-M4I2H672.js");
114
+ const { createCompositeRouter } = await import("./composite-router-OTSHVAIF.js");
115
115
  const adapters = createAllAdapters();
116
116
  if (adapters.size === 0) {
117
117
  routerInitPromise = null;
@@ -119,7 +119,7 @@ async function getRouter() {
119
119
  }
120
120
  cachedRouter = adaptCompositeRouter(createCompositeRouter(adapters));
121
121
  try {
122
- const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-V2BTK5ZW.js");
122
+ const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-FDVTKR3W.js");
123
123
  cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);
124
124
  } catch (error) {
125
125
  const msg = error instanceof Error ? error.message : String(error);
@@ -252,4 +252,4 @@ export {
252
252
  tokenSplitFromUsage,
253
253
  executeExpert
254
254
  };
255
- //# sourceMappingURL=chunk-5ML3THNH.js.map
255
+ //# sourceMappingURL=chunk-FADEMLNQ.js.map
@@ -1,28 +1,28 @@
1
1
  import {
2
2
  SERVES_PROBE_PROMPT
3
- } from "./chunk-BYRIEU5S.js";
3
+ } from "./chunk-VFT7OHAD.js";
4
4
  import {
5
5
  checkGatewayHealth,
6
6
  cliFailsVerdict,
7
7
  formatGatewaySlotWarnings,
8
8
  gatewayVerdict,
9
9
  printVoterTransportCheck
10
- } from "./chunk-L265O6SP.js";
10
+ } from "./chunk-CPFKM4K7.js";
11
11
  import {
12
12
  NODE_ENGINE_RANGE,
13
13
  VERSION,
14
14
  isNodeVersionSupported
15
- } from "./chunk-YSLHLLRK.js";
15
+ } from "./chunk-THCAUXID.js";
16
16
  import {
17
17
  allOf
18
18
  } from "./chunk-EZNIYU5T.js";
19
19
  import {
20
20
  readOpenAICompatEndpoint,
21
21
  readOpenAICompatEnv
22
- } from "./chunk-QHMUW6G7.js";
22
+ } from "./chunk-2DOH7LES.js";
23
23
  import {
24
24
  claimGlobalRegistry
25
- } from "./chunk-6NYFFN42.js";
25
+ } from "./chunk-55VTUHIR.js";
26
26
  import {
27
27
  capitalize
28
28
  } from "./chunk-7LP6VJRP.js";
@@ -34,10 +34,10 @@ import {
34
34
  createAllAdapters,
35
35
  isCliDisabled,
36
36
  probeCli
37
- } from "./chunk-C4T7UI2R.js";
37
+ } from "./chunk-SFKQIPPE.js";
38
38
  import {
39
39
  resolveGatewayEnv
40
- } from "./chunk-YKC7ICXJ.js";
40
+ } from "./chunk-KG7QNWWR.js";
41
41
  import {
42
42
  getNexusTmpDir
43
43
  } from "./chunk-OITVVSWO.js";
@@ -61,7 +61,7 @@ import {
61
61
  resolveGatewayCostDeclaration,
62
62
  symbols,
63
63
  writeLine
64
- } from "./chunk-ZR5JWLC5.js";
64
+ } from "./chunk-SZGVILVS.js";
65
65
  import {
66
66
  getLearningDir,
67
67
  getOutcomesFile,
@@ -1368,7 +1368,7 @@ async function doctorCommand(options = {}) {
1368
1368
  const result = await runDoctor({ gatewayProbe: options.probe === true });
1369
1369
  printDoctorResults(result);
1370
1370
  if (options.gateway === true || options.probe === true) {
1371
- const { formatGatewayReport } = await import("./doctor-gateway-report-MRSOR4TR.js");
1371
+ const { formatGatewayReport } = await import("./doctor-gateway-report-ZPZQLULX.js");
1372
1372
  for (const line of formatGatewayReport(result.gateway)) process.stdout.write(line + "\n");
1373
1373
  }
1374
1374
  if (options.fix === true) {
@@ -1385,13 +1385,13 @@ async function runDoctorFix(result) {
1385
1385
  writeLine2("\u2500".repeat(40));
1386
1386
  let fixCount = 0;
1387
1387
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1388
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-2EVIVSKU.js");
1388
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-ZF4KKISC.js");
1389
1389
  const outcome = describeDataDirFix2(initDataDirectories2());
1390
1390
  writeLine2(outcome.line);
1391
1391
  if (outcome.counted) fixCount++;
1392
1392
  }
1393
1393
  if (!result.configFile.found) {
1394
- const { runConfigInitSync } = await import("./setup-config-EZ5SSK6U.js");
1394
+ const { runConfigInitSync } = await import("./setup-config-IP75P4NY.js");
1395
1395
  const configResult = runConfigInitSync(process.cwd(), false, false);
1396
1396
  if (configResult.success && configResult.created) {
1397
1397
  writeLine2(`\u2713 Generated config: ${configResult.path}`);
@@ -1487,4 +1487,4 @@ export {
1487
1487
  startStdioServer,
1488
1488
  closeServer
1489
1489
  };
1490
- //# sourceMappingURL=chunk-XWMT6ZSS.js.map
1490
+ //# sourceMappingURL=chunk-G47QXLHM.js.map
@@ -2,7 +2,7 @@ import {
2
2
  createLogger,
3
3
  err,
4
4
  ok
5
- } from "./chunk-ZR5JWLC5.js";
5
+ } from "./chunk-SZGVILVS.js";
6
6
 
7
7
  // src/scm/token-resolver.ts
8
8
  import { execFile } from "node:child_process";
@@ -87,4 +87,4 @@ export {
87
87
  hasToken,
88
88
  getTokenEnvVars
89
89
  };
90
- //# sourceMappingURL=chunk-KMY3NA44.js.map
90
+ //# sourceMappingURL=chunk-JGZHI37B.js.map
@@ -7,7 +7,7 @@ import {
7
7
  createLogger,
8
8
  err,
9
9
  ok
10
- } from "./chunk-ZR5JWLC5.js";
10
+ } from "./chunk-SZGVILVS.js";
11
11
 
12
12
  // src/adapters/sdk/gateway-env.ts
13
13
  function readTrimmed(env, name) {
@@ -65,6 +65,13 @@ function readCustomApiSurface(env = process.env) {
65
65
  `${CUSTOM_API_SURFACE_ENV} must be one of: responses, chat (default chat); got an unrecognised value`
66
66
  );
67
67
  }
68
+ var OPENAI_BASE_URL_ENV = "OPENAI_BASE_URL";
69
+ var OPENAI_API_HOST = "api.openai.com";
70
+ function readDirectOpenAiSurface(env = process.env) {
71
+ const baseUrl = env[OPENAI_BASE_URL_ENV]?.trim() ?? "";
72
+ if (baseUrl === "" || hostnameOf(baseUrl) === OPENAI_API_HOST) return void 0;
73
+ return readCustomApiSurface(env);
74
+ }
68
75
  function hostnameOf(baseUrl) {
69
76
  try {
70
77
  const host = new URL(baseUrl).hostname;
@@ -320,9 +327,10 @@ export {
320
327
  warnDeprecatedGatewayEnvOnce,
321
328
  readGatewayEnv,
322
329
  readCustomApiSurface,
330
+ readDirectOpenAiSurface,
323
331
  hostnameOf,
324
332
  redactApiKey,
325
333
  validateCustomApiBaseUrl,
326
334
  assertCustomApiHostResolvesPublic
327
335
  };
328
- //# sourceMappingURL=chunk-YKC7ICXJ.js.map
336
+ //# sourceMappingURL=chunk-KG7QNWWR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapters/sdk/gateway-env.ts","../src/adapters/sdk/custom-api-validation.ts"],"sourcesContent":["/**\n * Env resolver for the single-model `custom-openai` gateway path (#4392\n * increment 3).\n *\n * Two mechanisms read an OpenAI-compatible gateway from the environment:\n *\n * A. the single-model SDK path — `SdkAdapter({ providerId: 'custom-openai' })`\n * via `auto-adapter.ts`, which mints the `api:custom-openai` routing arm\n * under `NEXUS_BILLING_MODE=api`;\n * B. the discovery path — `openai-compat-adapter.ts`, which lists the\n * gateway's models, serves voters in-process and registers ONE\n * `api:<endpoint>` arm.\n *\n * Both take a base URL and a key. Mechanism A historically read\n * `NEXUS_CUSTOM_API_BASE_URL` / `NEXUS_CUSTOM_API_KEY`; mechanism B reads\n * `NEXUS_OPENAI_COMPAT_URL` / `NEXUS_OPENAI_COMPAT_KEY`. This module makes the\n * old pair a deprecated ALIAS of the new pair for mechanism A only — a pure\n * rename shim, resolution `new ?? old` per variable (panel\n * vote-1789558437481-yup142p runoff, option C). Mechanism B is deliberately\n * NOT fed from the alias: renaming to the new names is what opts an operator\n * into the gateway path, and the deprecation warn says so. The aliases are\n * dropped in the next major (#6291).\n *\n * @module adapters/sdk/gateway-env\n */\n\nimport type { ILogger } from '../../core/index.js';\nimport { ConfigError, createLogger } from '../../core/index.js';\nimport {\n DEPRECATED_GATEWAY_ENV_ALIASES,\n OPENAI_COMPAT_KEY_ENV,\n OPENAI_COMPAT_URL_ENV,\n} from './types.js';\n\n/** One deprecated gateway env name found set in the environment. */\nexport interface DeprecatedGatewayEnvUse {\n readonly name: string;\n readonly replacement: string;\n /** True when the replacement is also set, so this alias is ignored. */\n readonly shadowed: boolean;\n}\n\n/** The resolved mechanism-A gateway pair plus every deprecated name in use. */\nexport interface GatewayEnv {\n /** `NEXUS_OPENAI_COMPAT_URL ?? NEXUS_CUSTOM_API_BASE_URL`, trimmed; empty is unset. */\n readonly baseUrl: string | undefined;\n /** `NEXUS_OPENAI_COMPAT_KEY ?? NEXUS_CUSTOM_API_KEY`, trimmed; empty is unset. */\n readonly apiKey: string | undefined;\n /** Deprecated names that are set, in table order — empty when none is. */\n readonly deprecated: readonly DeprecatedGatewayEnvUse[];\n}\n\n/** A set env value, trimmed; `undefined` for unset, empty, or whitespace-only. */\nfunction readTrimmed(env: NodeJS.ProcessEnv, name: string): string | undefined {\n const value = env[name]?.trim();\n return value === undefined || value === '' ? undefined : value;\n}\n\n/**\n * Resolve the mechanism-A gateway pair from `env` (default `process.env`).\n * Pure: no logging, no once-guard. `readGatewayEnv` is the production entry;\n * this one serves the report surfaces (env-schema, doctor) that must not warn.\n */\nexport function resolveGatewayEnv(env: NodeJS.ProcessEnv = process.env): GatewayEnv {\n const deprecated: DeprecatedGatewayEnvUse[] = [];\n for (const alias of DEPRECATED_GATEWAY_ENV_ALIASES) {\n if (readTrimmed(env, alias.deprecated) === undefined) continue;\n deprecated.push({\n name: alias.deprecated,\n replacement: alias.replacement,\n shadowed: readTrimmed(env, alias.replacement) !== undefined,\n });\n }\n return {\n baseUrl: readWithAlias(env, OPENAI_COMPAT_URL_ENV),\n apiKey: readWithAlias(env, OPENAI_COMPAT_KEY_ENV),\n deprecated,\n };\n}\n\n/** `new ?? old` for one variable, the old spelling taken from the alias table. */\nfunction readWithAlias(env: NodeJS.ProcessEnv, replacement: string): string | undefined {\n const current = readTrimmed(env, replacement);\n if (current !== undefined) return current;\n const alias = DEPRECATED_GATEWAY_ENV_ALIASES.find((a) => a.replacement === replacement);\n return alias === undefined ? undefined : readTrimmed(env, alias.deprecated);\n}\n\nconst defaultLogger = createLogger({ component: 'gateway-env' });\n\n/**\n * Once per process: a deprecated name is set, so the operator hears about it\n * exactly once, from whichever reader gets there first (or from server\n * startup). Names only — never a value.\n */\nlet deprecationWarned = false;\n\n/** Test-only: re-arm the once-guard. */\nexport function _resetDeprecatedGatewayEnvWarning(): void {\n deprecationWarned = false;\n}\n\n/**\n * Emit the one deprecation warn if any deprecated gateway name is set and it\n * has not been emitted yet in this process. Safe to call from every reader;\n * the gateway bootstrap (`cli-server-gateway.ts` `tryWireGatewayAdapters`)\n * calls it at server startup so the line appears even when no reader of the\n * alias is reached (plan billing with a CLI available never consults\n * mechanism A).\n */\nexport function warnDeprecatedGatewayEnvOnce(\n env: NodeJS.ProcessEnv = process.env,\n logger: ILogger = defaultLogger\n): void {\n if (deprecationWarned) return;\n const { deprecated } = resolveGatewayEnv(env);\n if (deprecated.length === 0) return;\n deprecationWarned = true;\n logger.warn(formatDeprecationWarning(deprecated));\n}\n\n/**\n * The warn line. Each name says whether it is honoured or ignored (shadowed\n * by its replacement), then the option-C consequence: these names configure\n * only the single-model `custom-openai` path, and the rename is the opt-in\n * to the gateway path. No value is ever interpolated — a URL can carry\n * userinfo and the key is the key.\n */\nfunction formatDeprecationWarning(deprecated: readonly DeprecatedGatewayEnvUse[]): string {\n const uses = deprecated\n .map((d) =>\n d.shadowed\n ? `${d.name} (ignored: ${d.replacement} is set)`\n : `${d.name} (honoured; rename to ${d.replacement})`\n )\n .join('; ');\n return (\n `Deprecated gateway environment variable(s) set (#4392): ${uses}. ` +\n 'These names configure only the single-model custom-openai path and stay aliases ' +\n 'until the next major (#6291). Rename to NEXUS_OPENAI_COMPAT_* to opt into the ' +\n 'gateway path (model discovery, in-process voter transport, api:<endpoint> arm).'\n );\n}\n\n/**\n * The production reader for mechanism A: resolve the pair and emit the\n * once-per-process deprecation warn when a deprecated name is set.\n */\nexport function readGatewayEnv(\n env: NodeJS.ProcessEnv = process.env,\n logger: ILogger = defaultLogger\n): GatewayEnv {\n const resolved = resolveGatewayEnv(env);\n if (resolved.deprecated.length > 0) warnDeprecatedGatewayEnvOnce(env, logger);\n return resolved;\n}\n\n/**\n * The OpenAI API surface the single-model `custom-openai` path calls (#6645):\n * `chat` is `POST <base>/chat/completions`, `responses` is `POST <base>/responses`.\n */\ntype CustomApiSurface = 'chat' | 'responses';\n\nconst CUSTOM_API_SURFACE_ENV = 'NEXUS_CUSTOM_API_SURFACE';\n\n/**\n * Read `NEXUS_CUSTOM_API_SURFACE` (#6645). Unset or empty means `chat`: the\n * AI SDK's default is the Responses API, but OpenAI-spec gateways commonly\n * serve `/chat/completions` only, so `responses` is the opt-in. Any other\n * value throws a `ConfigError` rather than guessing a surface.\n */\nexport function readCustomApiSurface(env: NodeJS.ProcessEnv = process.env): CustomApiSurface {\n const raw = env[CUSTOM_API_SURFACE_ENV]?.trim().toLowerCase() ?? '';\n if (raw === '' || raw === 'chat') return 'chat';\n if (raw === 'responses') return 'responses';\n throw new ConfigError(\n `${CUSTOM_API_SURFACE_ENV} must be one of: responses, chat (default chat); got an unrecognised value`\n );\n}\n\n/** Read by `@ai-sdk/openai` itself; the direct OpenAI adapter never passes a baseURL. */\nconst OPENAI_BASE_URL_ENV = 'OPENAI_BASE_URL';\nconst OPENAI_API_HOST = 'api.openai.com';\n\n/**\n * The surface the direct OpenAI adapter (`OPENAI_API_KEY`) calls (#6654).\n * `undefined` means the provider's own default (the Responses API), exactly\n * as before: `OPENAI_BASE_URL` unset, blank, or naming `api.openai.com`, and\n * `NEXUS_CUSTOM_API_SURFACE` is then not read at all. Any other host is an\n * OpenAI-compatible gateway, so it gets {@link readCustomApiSurface}'s answer:\n * chat completions unless `NEXUS_CUSTOM_API_SURFACE=responses`.\n */\nexport function readDirectOpenAiSurface(\n env: NodeJS.ProcessEnv = process.env\n): CustomApiSurface | undefined {\n const baseUrl = env[OPENAI_BASE_URL_ENV]?.trim() ?? '';\n if (baseUrl === '' || hostnameOf(baseUrl) === OPENAI_API_HOST) return undefined;\n return readCustomApiSurface(env);\n}\n\n/**\n * The host of a gateway base URL, for log lines and error messages. A base\n * URL can carry userinfo (`https://user:key@host/v1`), so the full string\n * must never reach a log. Two failure shapes, both replaced rather than\n * echoed: a string that does not parse at all, and a scheme-less paste such\n * as `key@host/v1`, which WHATWG parses with `key:` as the SCHEME and an\n * empty hostname (measured: `new URL('u:pw@host/v1').hostname === ''`).\n */\nexport function hostnameOf(baseUrl: string): string {\n try {\n const host = new URL(baseUrl).hostname;\n return host === '' ? '<no host>' : host;\n } catch {\n return '<unparseable url>';\n }\n}\n\n/**\n * Every exact occurrence of `apiKey` in `message` replaced with `<redacted>`.\n * The pattern-based sanitizer only knows vendor key shapes; a gateway key can\n * be any string, and a 401 body may echo the one it rejected. An empty key\n * matches nothing (`replaceAll('')` would interleave the marker).\n */\nexport function redactApiKey(message: string, apiKey: string | undefined): string {\n return apiKey === undefined || apiKey === '' ? message : message.replaceAll(apiKey, '<redacted>');\n}\n","/**\n * Validation for the `custom-openai` SDK adapter's gateway URL.\n *\n * The base URL is user-provided, so without validation the adapter becomes\n * an SSRF vector: a malicious prompt that reshaped env vars, or a typo in\n * the config, could point nexus-agents at `http://169.254.169.254/` (AWS\n * metadata) or `http://localhost:5432/` (internal services). This module\n * rejects such URLs unless the user explicitly opts in via\n * `NEXUS_CUSTOM_API_ALLOW_PRIVATE=1`.\n *\n * Called out in the #2119 consensus vote by the Security Engineer role.\n *\n * @module adapters/sdk/custom-api-validation\n */\n\nimport { isIPv4, isIPv6 } from 'node:net';\nimport { lookup as dnsLookup } from 'node:dns/promises';\nimport { ConfigError, ok, err, createLogger, type Result } from '../../core/index.js';\nimport { CUSTOM_API_ALLOW_PRIVATE_ENV } from './types.js';\n\nconst logger = createLogger({ module: 'custom-api-validation' });\n\n/**\n * Why a given URL was rejected. Machine-readable so error messages can\n * distinguish root causes in downstream tooling.\n */\nexport type BaseUrlRejectionReason =\n | 'empty'\n | 'not_a_url'\n | 'not_http_https'\n | 'loopback'\n | 'link_local'\n | 'private_range'\n | 'reserved';\n\ninterface RejectionDetail {\n readonly reason: BaseUrlRejectionReason;\n readonly message: string;\n}\n\n/**\n * Validates a user-provided custom-gateway base URL. Returns the URL as an\n * `ok` Result if it passes, or a `ConfigError` with a machine-readable\n * reason if it fails.\n *\n * Pass `{ allowPrivate: true }` (or set the env var) to bypass the SSRF\n * checks — use this only when the gateway is on a trusted internal host\n * and you accept the risk.\n */\nexport function validateCustomApiBaseUrl(\n raw: string | undefined,\n opts: { readonly allowPrivate?: boolean } = {}\n): Result<URL, ConfigError> {\n if (raw === undefined || raw.trim() === '') {\n return err(\n new ConfigError(\n 'Custom API base URL is required but missing. Set NEXUS_OPENAI_COMPAT_URL or pass `baseUrl` in config.'\n )\n );\n }\n\n let url: URL;\n try {\n url = new URL(raw);\n } catch {\n // Not echoed: these messages reach the resilient-adapter warn line, and\n // the raw string can carry userinfo (#4392 inc 3).\n return err(new ConfigError('Custom API base URL is not a valid URL'));\n }\n\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n return err(\n new ConfigError(`Custom API base URL must use http or https, got \"${url.protocol}\"`)\n );\n }\n\n const allowPrivate = opts.allowPrivate === true || resolveAllowPrivateFromEnv();\n if (!allowPrivate) {\n const rejection = classifyPrivateHost(url.hostname);\n if (rejection !== null) {\n return err(\n new ConfigError(\n `Custom API base URL rejected (SSRF guard, reason=\"${rejection.reason}\"): ${rejection.message}. ` +\n `Set ${CUSTOM_API_ALLOW_PRIVATE_ENV}=1 to bypass if the gateway runs on a trusted internal host.`\n )\n );\n }\n }\n\n return ok(url);\n}\n\nfunction resolveAllowPrivateFromEnv(): boolean {\n // Deliberately strict (case-sensitive, not parseBoolEnv): this disables an\n // SSRF guard, so we don't want extra case variants (e.g. `TRUE`) to loosen\n // the control. Fail-closed on anything but exact `1`/`true` (#3297).\n const v = process.env[CUSTOM_API_ALLOW_PRIVATE_ENV];\n return v === '1' || v === 'true';\n}\n\n/**\n * Returns a rejection reason if the hostname resolves (by string form) to\n * a loopback, link-local, or RFC 1918 private address; `null` otherwise.\n *\n * Note: this is a string-level check. It does NOT perform DNS resolution,\n * so a public DNS name that secretly resolves to a private IP will pass.\n * For that level of defense, callers should additionally run\n * {@link assertCustomApiHostResolvesPublic}, which performs a DNS lookup\n * and classifies each resolved address with the same range tables below.\n */\nfunction classifyPrivateHost(hostname: string): RejectionDetail | null {\n const normalized = normalizeHost(hostname);\n\n // Literal IP addresses — classify directly against the range tables.\n const literal = classifyIpAddress(normalized);\n if (literal !== 'not_an_ip') {\n return literal;\n }\n\n // Hostname literals that resolve to loopback without needing DNS\n if (\n normalized === 'localhost' ||\n normalized.endsWith('.localhost') ||\n normalized.endsWith('.local') // mDNS\n ) {\n return {\n reason: 'loopback',\n message: `hostname \"${hostname}\" resolves to loopback/mDNS`,\n };\n }\n\n return null;\n}\n\n/**\n * Strips IPv6 bracket wrapping (URL.hostname yields \"[::1]\") and lowercases,\n * giving the bare form the `node:net` checks expect. Shared by the sync and\n * async guards so the normalization rule lives in one place.\n */\nfunction normalizeHost(hostname: string): string {\n const stripped =\n hostname.startsWith('[') && hostname.endsWith(']') ? hostname.slice(1, -1) : hostname;\n return stripped.toLowerCase();\n}\n\n/**\n * Classifies a single (already normalized, bracket-stripped) address string.\n * Returns:\n * - a {@link RejectionDetail} if it is a private/loopback/link-local/reserved IP,\n * - `null` if it is a public IP literal (safe),\n * - the sentinel `'not_an_ip'` if the string is not an IP literal at all.\n *\n * This is the shared per-address classifier reused by both the sync\n * string-level guard ({@link classifyPrivateHost}) and the async\n * DNS-resolve-time guard ({@link assertCustomApiHostResolvesPublic}), so the\n * IPv4/IPv6 range tables live in exactly one place.\n */\nfunction classifyIpAddress(normalized: string): RejectionDetail | null | 'not_an_ip' {\n if (isIPv4(normalized)) {\n return classifyIPv4(normalized);\n }\n if (isIPv6(normalized)) {\n return classifyIPv6(normalized);\n }\n return 'not_an_ip';\n}\n\n/** Verdict for a host that is already an IP literal — no DNS required. */\nfunction classifyLiteral(hostname: string, normalized: string): Result<void, ConfigError> {\n const literal = classifyIpAddress(normalized);\n if (literal === null || literal === 'not_an_ip') return ok(undefined);\n return err(\n new ConfigError(\n `Custom API host '${hostname}' is a ${literal.reason} address: ${literal.message}`\n )\n );\n}\n\n/**\n * DNS-resolve-time SSRF guard for the custom-openai gateway.\n *\n * The sync {@link validateCustomApiBaseUrl} only inspects the hostname as a\n * string, so a PUBLIC DNS name that resolves to a PRIVATE/loopback/link-local\n * IP (e.g. an attacker-controlled `gateway.evil.test` pointing at\n * `169.254.169.254`) slips past it. This function closes that gap: it resolves\n * the hostname and runs the EXISTING IP classification against every returned\n * address, failing closed if ANY of them is private.\n *\n * Behaviour:\n * - `allowPrivate` (opt or env) → bypass, returns `ok` (matches the sync guard).\n * - hostname is already an IP literal → no DNS needed; the sync guard already\n * classified literals at construction, so return `ok`.\n * - otherwise `dns.lookup(hostname, { all: true })` and classify each address.\n * If ANY resolves private → `err(ConfigError)`.\n * - on a `dns.lookup` THROW (transient/NXDOMAIN/network error) → log debug and\n * return `ok`. Failing closed here is too aggressive: it would break legit\n * gateways on a flaky resolver, and this is additive defense-in-depth layered\n * on top of the sync string guard that already ran at construction. We only\n * REJECT on a SUCCESSFUL resolution to a private address.\n *\n * Residual risk (TOCTOU): this is RESOLVE-time, not socket-connect-time. A name\n * that passes here could rebind to a private IP before the actual connect\n * (DNS rebinding). A full fix needs a custom `fetch` `lookup` hook validating\n * the peer address at the socket layer — out of scope for this LOW\n * defense-in-depth pass (#3426).\n */\nexport async function assertCustomApiHostResolvesPublic(\n hostname: string,\n opts: { readonly allowPrivate?: boolean } = {}\n): Promise<Result<void, ConfigError>> {\n const allowPrivate = opts.allowPrivate === true || resolveAllowPrivateFromEnv();\n if (allowPrivate) {\n return ok(undefined);\n }\n\n const normalized = normalizeHost(hostname);\n\n // A literal needs no DNS, but it is still classified HERE rather than\n // assumed handled elsewhere. This used to return ok for any literal on the\n // grounds that the sync guard had classified it at construction — but\n // `discoverModels` calls only this guard, never the sync one, so on that\n // path each deferred to the other and neither ran. `http://169.254.169.254/`\n // reached IMDS, from a base URL that can come from a file rather than from\n // operator intent.\n if (isIPv4(normalized) || isIPv6(normalized)) {\n return classifyLiteral(hostname, normalized);\n }\n\n // Only `address` is read; the resolver's `family` is intentionally NOT\n // trusted — `classifyIpAddress` re-derives v4/v6 from the address string, so\n // a mislabeled family in the lookup result cannot let a private IP slip past.\n let addresses: ReadonlyArray<{ readonly address: string }>;\n try {\n addresses = await dnsLookup(hostname, { all: true });\n } catch (error) {\n // Fail OPEN: transient/NXDOMAIN/network errors must not break legit\n // gateways. The sync string guard already ran; this is additive only.\n logger.debug('custom-api SSRF resolve check: DNS lookup failed, skipping (fail-open)', {\n hostname,\n error: error instanceof Error ? error.message : String(error),\n });\n return ok(undefined);\n }\n\n const rejection = firstPrivateAddress(addresses);\n if (rejection !== null) {\n return err(\n new ConfigError(\n `Custom API base URL rejected (SSRF resolve guard, reason=\"${rejection.reason}\"): ` +\n `hostname \"${hostname}\" resolved to ${rejection.message}. ` +\n `Set ${CUSTOM_API_ALLOW_PRIVATE_ENV}=1 to bypass if the gateway runs on a trusted internal host.`\n )\n );\n }\n\n return ok(undefined);\n}\n\n/**\n * Returns the {@link RejectionDetail} for the first resolved address that\n * classifies as private/loopback/link-local/reserved, or `null` if every\n * address is public. Fail-closed: any single private hit trips the guard.\n */\nfunction firstPrivateAddress(\n addresses: ReadonlyArray<{ readonly address: string }>\n): RejectionDetail | null {\n for (const { address } of addresses) {\n const rejection = classifyIpAddress(address.toLowerCase());\n if (rejection !== null && rejection !== 'not_an_ip') {\n return rejection;\n }\n }\n return null;\n}\n\n/**\n * IPv4 ranges the SSRF guard rejects, in order of specificity.\n *\n * \"Not RFC1918\" is not the same as \"public\". The blocks below RFC1918 are\n * here because each is reachable from a host and serves something: 100.64/10\n * carries Alibaba Cloud's metadata endpoint, 192.0.0/24 carries a legacy\n * Oracle Cloud one, and multicast/reserved/broadcast reach the local segment\n * rather than the internet (second pass over #4884).\n */\nconst IPV4_RULES: ReadonlyArray<{\n readonly match: (a: number, b: number, c: number) => boolean;\n readonly reason: BaseUrlRejectionReason;\n readonly label: string;\n}> = [\n { match: (a) => a === 127, reason: 'loopback', label: 'IPv4 loopback' },\n { match: (a) => a === 10, reason: 'private_range', label: 'IPv4 private (10/8)' },\n {\n match: (a, b) => a === 172 && b >= 16 && b <= 31,\n reason: 'private_range',\n label: 'IPv4 private (172.16/12)',\n },\n {\n match: (a, b) => a === 192 && b === 168,\n reason: 'private_range',\n label: 'IPv4 private (192.168/16)',\n },\n {\n match: (a, b) => a === 169 && b === 254,\n reason: 'link_local',\n label: 'IPv4 link-local (169.254/16 — AWS IMDS)',\n },\n { match: (a) => a === 0, reason: 'reserved', label: 'IPv4 reserved (0/8)' },\n {\n match: (a, b) => a === 100 && b >= 64 && b <= 127,\n reason: 'private_range',\n label: 'IPv4 shared address space (100.64/10 — CGNAT, Alibaba metadata)',\n },\n {\n match: (a, b, c) => a === 192 && b === 0 && c === 0,\n reason: 'reserved',\n label: 'IPv4 IETF protocol assignments (192.0.0/24 — legacy Oracle metadata)',\n },\n {\n match: (a, b) => a === 198 && (b === 18 || b === 19),\n reason: 'reserved',\n label: 'IPv4 benchmarking (198.18/15)',\n },\n { match: (a) => a >= 224 && a <= 239, reason: 'reserved', label: 'IPv4 multicast (224/4)' },\n {\n match: (a) => a >= 240,\n reason: 'reserved',\n label: 'IPv4 reserved (240/4, includes 255.255.255.255 broadcast)',\n },\n];\n\nfunction classifyIPv4(ip: string): RejectionDetail | null {\n const parts = ip.split('.').map((p) => Number.parseInt(p, 10));\n if (parts.length !== 4 || parts.some((n) => Number.isNaN(n))) return null;\n const [a, b, c] = parts as [number, number, number, number];\n for (const rule of IPV4_RULES) {\n if (rule.match(a, b, c)) {\n return { reason: rule.reason, message: `${rule.label} (${ip})` };\n }\n }\n return null;\n}\n\n/**\n * Expand an IPv6 literal to its eight 16-bit groups, or null if unparseable.\n *\n * A trailing dotted quad (`::ffff:1.2.3.4`) is folded into two groups first,\n * so callers see one representation regardless of spelling.\n */\nfunction foldTrailingQuad(s: string): string | null {\n const dotted = /(?:^|:)((?:\\d{1,3}\\.){3}\\d{1,3})$/.exec(s);\n if (dotted?.[1] === undefined) return s;\n const q = dotted[1].split('.').map((n) => Number.parseInt(n, 10));\n if (q.length !== 4 || q.some((n) => Number.isNaN(n) || n < 0 || n > 255)) return null;\n const hi = (((q[0] ?? 0) << 8) | (q[1] ?? 0)).toString(16);\n const lo = (((q[2] ?? 0) << 8) | (q[3] ?? 0)).toString(16);\n return `${s.slice(0, s.length - dotted[1].length)}${hi}:${lo}`;\n}\n\nfunction toHextets(ip: string): number[] | null {\n const s = foldTrailingQuad(ip.toLowerCase());\n if (s === null) return null;\n const halves = s.split('::');\n if (halves.length > 2) return null;\n const head = halves[0] === '' || halves[0] === undefined ? [] : halves[0].split(':');\n const tail = halves[1] === '' || halves[1] === undefined ? [] : halves[1].split(':');\n const groups =\n halves.length === 1\n ? head\n : [...head, ...Array<string>(8 - head.length - tail.length).fill('0'), ...tail];\n if (groups.length !== 8) return null;\n const out = groups.map((g) => Number.parseInt(g === '' ? '0' : g, 16));\n return out.some((n) => Number.isNaN(n) || n < 0 || n > 0xffff) ? null : out;\n}\n\n/**\n * The IPv4 address embedded in an IPv6 literal, in dotted form, or null.\n *\n * Covers every prefix that carries a routable IPv4 payload: IPv4-mapped\n * (`::ffff:0:0/96`), IPv4-translated (`::ffff:0:0:0/96`), the NAT64\n * well-known prefix (`64:ff9b::/96`), 6to4 (`2002::/16`), and the deprecated\n * IPv4-compatible form (`::a.b.c.d`). Each is the same destination under a\n * different spelling, and the IPv4 rules must apply to all of them.\n */\nfunction embeddedIPv4(g: readonly number[]): string | null {\n // 6to4 is the odd one out: the payload sits in hextets 1-2, not 6-7, so it\n // cannot share the trailing-quad extraction below.\n if (g[0] === 0x2002) return hextetPairToDotted(g[1] ?? 0, g[2] ?? 0);\n const top = g.slice(0, 6);\n const prefixes: ReadonlyArray<readonly number[]> = [\n [0, 0, 0, 0, 0, 0xffff], // ::ffff:0:0/96 — IPv4-mapped\n [0, 0, 0, 0, 0xffff, 0], // ::ffff:0:0:0/96 — IPv4-translated\n [0x64, 0xff9b, 0, 0, 0, 0], // 64:ff9b::/96 — NAT64 well-known\n [0, 0, 0, 0, 0, 0], // ::a.b.c.d — deprecated IPv4-compatible\n ];\n const matched = prefixes.some((p) => p.every((v, i) => top[i] === v));\n if (!matched) return null;\n const g6 = g[6] ?? 0;\n const g7 = g[7] ?? 0;\n // `::` and `::1` are their own addresses, not embedded IPv4.\n if (top.every((v) => v === 0) && g6 === 0 && g7 <= 1) return null;\n return hextetPairToDotted(g6, g7);\n}\n\n/** The dotted IPv4 address carried by two consecutive 16-bit hextets. */\nfunction hextetPairToDotted(hi: number, lo: number): string {\n return [(hi >> 8) & 255, hi & 255, (lo >> 8) & 255, lo & 255].join('.');\n}\n\n/**\n * Classify an IPv6 address by its first hextet, or null if it is not in a\n * non-global prefix.\n *\n * Numeric rather than a string prefix test. The previous `startsWith('fe80:')`\n * covered 1/64th of fe80::/10 — `febf::1` is equally link-local and was\n * allowed — and site-local fec0::/10 had no check at all (second pass over #4884).\n */\nfunction classifyIPv6Prefix(first: number, ip: string): RejectionDetail | null {\n if (first >= 0xfc00 && first <= 0xfdff) {\n return { reason: 'private_range', message: `IPv6 unique-local (${ip}, fc00::/7)` };\n }\n if (first >= 0xfe80 && first <= 0xfebf) {\n return { reason: 'link_local', message: `IPv6 link-local (${ip}, fe80::/10)` };\n }\n if (first >= 0xfec0 && first <= 0xfeff) {\n return { reason: 'private_range', message: `IPv6 site-local (${ip}, fec0::/10)` };\n }\n return null;\n}\n\nfunction classifyIPv6(ip: string): RejectionDetail | null {\n const lower = ip.toLowerCase();\n if (lower === '::1') return { reason: 'loopback', message: `IPv6 loopback (${ip})` };\n\n const groups = toHextets(lower);\n if (groups === null) return null;\n\n const prefixDetail = classifyIPv6Prefix(groups[0] ?? 0, ip);\n if (prefixDetail !== null) return prefixDetail;\n\n if (groups.every((n) => n === 0)) {\n return { reason: 'reserved', message: `IPv6 unspecified (${ip}) — routes to localhost` };\n }\n\n // An IPv4 address written in IPv6 form is still that IPv4 address, and\n // `isIPv6` is true for it so it never reached the IPv4 rules — IMDS,\n // loopback and RFC1918 were all reachable this way. Note the URL parser\n // normalises the dotted spelling to hex, so the hex form is the one that\n // actually arrives.\n const v4 = embeddedIPv4(groups);\n if (v4 === null) return null;\n const detail = classifyIPv4(v4);\n return detail === null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