nexus-agents 8.100.0 → 8.102.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 (143) hide show
  1. package/dist/{ast-rule-runner-5S3B2F7B.js → ast-rule-runner-AWL7WA6O.js} +3 -3
  2. package/dist/{child-mcp-config-XAPZFOSJ.js → child-mcp-config-JQLYDUUY.js} +2 -2
  3. package/dist/{chunk-OUBCCWNV.js → chunk-22ORYF2M.js} +6 -6
  4. package/dist/{chunk-JMVE5ZMR.js → chunk-2JLWILT3.js} +3 -3
  5. package/dist/{chunk-EN7RV5VK.js → chunk-3JPTRESH.js} +173 -80
  6. package/dist/chunk-3JPTRESH.js.map +1 -0
  7. package/dist/{chunk-W5JCLDRL.js → chunk-45JNFWOK.js} +2 -2
  8. package/dist/{chunk-J7RP6KQG.js → chunk-5ZQYRVZ6.js} +6 -6
  9. package/dist/{chunk-BSTGUADO.js → chunk-6I2O2TTX.js} +2 -2
  10. package/dist/{chunk-FJC5UCDB.js → chunk-7IP3RMJY.js} +3 -2
  11. package/dist/{chunk-WH7D2YJD.js → chunk-BYVA3QIU.js} +132 -76
  12. package/dist/{chunk-WH7D2YJD.js.map → chunk-BYVA3QIU.js.map} +1 -1
  13. package/dist/chunk-C2MLEXZC.js +81 -0
  14. package/dist/chunk-C2MLEXZC.js.map +1 -0
  15. package/dist/{chunk-7SR7J43H.js → chunk-C5RANIUS.js} +2 -2
  16. package/dist/{chunk-QYDVF72S.js → chunk-DXWTSSZ5.js} +40 -52
  17. package/dist/chunk-DXWTSSZ5.js.map +1 -0
  18. package/dist/{chunk-XCKWAVAW.js → chunk-EQHSJEX3.js} +2 -2
  19. package/dist/{chunk-JBK2O46P.js → chunk-EZSDF2RN.js} +42 -30
  20. package/dist/chunk-EZSDF2RN.js.map +1 -0
  21. package/dist/{chunk-XVTESCVO.js → chunk-FEMR5VNG.js} +2 -2
  22. package/dist/{chunk-SI6EIAOF.js → chunk-FHJ6MTK3.js} +42 -21
  23. package/dist/chunk-FHJ6MTK3.js.map +1 -0
  24. package/dist/{chunk-E7SVR4AE.js → chunk-FLSZ7MC4.js} +2 -2
  25. package/dist/{chunk-FZV7PQYK.js → chunk-FXQJLU3O.js} +7 -7
  26. package/dist/{chunk-WOUK4QL4.js → chunk-G3PASAET.js} +2 -2
  27. package/dist/{chunk-7DEJKQFG.js → chunk-H3UYZK5S.js} +79 -18
  28. package/dist/chunk-H3UYZK5S.js.map +1 -0
  29. package/dist/{chunk-FWMZLHMV.js → chunk-H7Z53A5H.js} +4 -4
  30. package/dist/{chunk-4ECZEXUP.js → chunk-HRWT6UU6.js} +2 -2
  31. package/dist/{chunk-YQN3GJKY.js → chunk-I2CI4EFZ.js} +5 -5
  32. package/dist/{chunk-5WKFOW7O.js → chunk-JAYHSYQ5.js} +2 -2
  33. package/dist/{chunk-SCT3O6WA.js → chunk-MQ7RCD65.js} +2 -2
  34. package/dist/{chunk-CLIRHX7X.js → chunk-N7SQKRKG.js} +3 -3
  35. package/dist/{chunk-KCK5ASQG.js → chunk-NEZQ3YTI.js} +2 -2
  36. package/dist/{chunk-F23W7Z6M.js → chunk-NPLCVC3G.js} +120 -25
  37. package/dist/chunk-NPLCVC3G.js.map +1 -0
  38. package/dist/{chunk-FRZN32H3.js → chunk-RWH4GY4O.js} +7 -5
  39. package/dist/chunk-RWH4GY4O.js.map +1 -0
  40. package/dist/{chunk-R5PGISWG.js → chunk-S4FLNZHK.js} +2 -2
  41. package/dist/{chunk-PA3L4YLB.js → chunk-TDJ2FZF3.js} +2 -2
  42. package/dist/{chunk-754FLBGW.js → chunk-TFZVQBPC.js} +13 -9
  43. package/dist/chunk-TFZVQBPC.js.map +1 -0
  44. package/dist/{chunk-PDEFAEH2.js → chunk-WPGNM4VM.js} +2 -2
  45. package/dist/{chunk-OTOIKZNT.js → chunk-XEXEZF2L.js} +2 -2
  46. package/dist/{chunk-JLMTORFA.js → chunk-YD5RDIKE.js} +4 -4
  47. package/dist/{cli-circuit-breaker-4LMK2QKT.js → cli-circuit-breaker-TEP2DWWH.js} +3 -3
  48. package/dist/cli.d.ts +5 -1
  49. package/dist/cli.js +113 -87
  50. package/dist/cli.js.map +1 -1
  51. package/dist/{composite-router-DL5TCA5E.js → composite-router-GLNDX2GV.js} +2 -2
  52. package/dist/{consensus-vote-ONTASY3I.js → consensus-vote-WIAUGC5V.js} +18 -18
  53. package/dist/{consensus-vote-types-CUlmEZWo.d.ts → consensus-vote-types-0WGuII6a.d.ts} +8 -0
  54. package/dist/{context-retriever-7N6EYNUR.js → context-retriever-AUID4ELJ.js} +8 -8
  55. package/dist/{doctor-deep-OWM63GEP.js → doctor-deep-4K23X2QK.js} +3 -3
  56. package/dist/doctor-gateway-report-Q5RXOEMR.js +77 -0
  57. package/dist/doctor-gateway-report-Q5RXOEMR.js.map +1 -0
  58. package/dist/{doctor-live-LANTOIUT.js → doctor-live-CU6O4MNI.js} +12 -12
  59. package/dist/{expert-bridge-R55ZI3QO.js → expert-bridge-YWCGQKN2.js} +4 -4
  60. package/dist/{factory-KVR57WN7.js → factory-J42N5QU6.js} +11 -11
  61. package/dist/{factory-YLAJMS5T.js → factory-NOC7DSJG.js} +5 -5
  62. package/dist/{improvement-review-ETE7HFWF.js → improvement-review-53QJQMBZ.js} +6 -6
  63. package/dist/index.d.ts +27 -3
  64. package/dist/index.js +101 -100
  65. package/dist/index.js.map +1 -1
  66. package/dist/{init-opencode-4GUXCAKD.js → init-opencode-KHWB4OQY.js} +5 -5
  67. package/dist/init-opencode-KHWB4OQY.js.map +1 -0
  68. package/dist/issue-triage-E55KBDOD.js +16 -0
  69. package/dist/openai-compat-adapter-5BCCGH32.js +26 -0
  70. package/dist/{pr-reviewer-helpers-NLYAPH6N.js → pr-reviewer-helpers-EHAG74L5.js} +4 -4
  71. package/dist/{registry-command-LVGNBYEJ.js → registry-command-CS42ODV3.js} +2 -2
  72. package/dist/{repo-security-plan-JMJ4TYVA.js → repo-security-plan-ENHKDRM3.js} +3 -3
  73. package/dist/{research-helpers-synthesize-DZDG3FPO.js → research-helpers-synthesize-XYMCJHFU.js} +4 -4
  74. package/dist/{routing-memory-LI2WXDSJ.js → routing-memory-KLIKEK6N.js} +2 -2
  75. package/dist/{session-memory-G5MKOAS2.js → session-memory-LHZYRRFM.js} +3 -3
  76. package/dist/{setup-config-2EUIGDXM.js → setup-config-YZ6E7RSF.js} +3 -3
  77. package/dist/{setup-custom-api-H3YWZOSO.js → setup-custom-api-AITNIHMR.js} +5 -5
  78. package/dist/setup-data-dir-7Y7A3RUJ.js +33 -0
  79. package/dist/{tool-memory-QAXICAJW.js → tool-memory-YEHRAJXA.js} +5 -5
  80. package/dist/{unified-registry-42YOG25E.js → unified-registry-7LJW5VLX.js} +12 -12
  81. package/dist/{weather-report-KFZYGEYI.js → weather-report-P3NJN6LU.js} +2 -2
  82. package/dist/weather-report-P3NJN6LU.js.map +1 -0
  83. package/package.json +1 -1
  84. package/dist/chunk-754FLBGW.js.map +0 -1
  85. package/dist/chunk-7DEJKQFG.js.map +0 -1
  86. package/dist/chunk-EN7RV5VK.js.map +0 -1
  87. package/dist/chunk-F23W7Z6M.js.map +0 -1
  88. package/dist/chunk-FRZN32H3.js.map +0 -1
  89. package/dist/chunk-JBK2O46P.js.map +0 -1
  90. package/dist/chunk-QYDVF72S.js.map +0 -1
  91. package/dist/chunk-SI6EIAOF.js.map +0 -1
  92. package/dist/init-opencode-4GUXCAKD.js.map +0 -1
  93. package/dist/issue-triage-EVHSZLEF.js +0 -16
  94. package/dist/setup-data-dir-UXUSHIIL.js +0 -32
  95. /package/dist/{ast-rule-runner-5S3B2F7B.js.map → ast-rule-runner-AWL7WA6O.js.map} +0 -0
  96. /package/dist/{child-mcp-config-XAPZFOSJ.js.map → child-mcp-config-JQLYDUUY.js.map} +0 -0
  97. /package/dist/{chunk-OUBCCWNV.js.map → chunk-22ORYF2M.js.map} +0 -0
  98. /package/dist/{chunk-JMVE5ZMR.js.map → chunk-2JLWILT3.js.map} +0 -0
  99. /package/dist/{chunk-W5JCLDRL.js.map → chunk-45JNFWOK.js.map} +0 -0
  100. /package/dist/{chunk-J7RP6KQG.js.map → chunk-5ZQYRVZ6.js.map} +0 -0
  101. /package/dist/{chunk-BSTGUADO.js.map → chunk-6I2O2TTX.js.map} +0 -0
  102. /package/dist/{chunk-FJC5UCDB.js.map → chunk-7IP3RMJY.js.map} +0 -0
  103. /package/dist/{chunk-7SR7J43H.js.map → chunk-C5RANIUS.js.map} +0 -0
  104. /package/dist/{chunk-XCKWAVAW.js.map → chunk-EQHSJEX3.js.map} +0 -0
  105. /package/dist/{chunk-XVTESCVO.js.map → chunk-FEMR5VNG.js.map} +0 -0
  106. /package/dist/{chunk-E7SVR4AE.js.map → chunk-FLSZ7MC4.js.map} +0 -0
  107. /package/dist/{chunk-FZV7PQYK.js.map → chunk-FXQJLU3O.js.map} +0 -0
  108. /package/dist/{chunk-WOUK4QL4.js.map → chunk-G3PASAET.js.map} +0 -0
  109. /package/dist/{chunk-FWMZLHMV.js.map → chunk-H7Z53A5H.js.map} +0 -0
  110. /package/dist/{chunk-4ECZEXUP.js.map → chunk-HRWT6UU6.js.map} +0 -0
  111. /package/dist/{chunk-YQN3GJKY.js.map → chunk-I2CI4EFZ.js.map} +0 -0
  112. /package/dist/{chunk-5WKFOW7O.js.map → chunk-JAYHSYQ5.js.map} +0 -0
  113. /package/dist/{chunk-SCT3O6WA.js.map → chunk-MQ7RCD65.js.map} +0 -0
  114. /package/dist/{chunk-CLIRHX7X.js.map → chunk-N7SQKRKG.js.map} +0 -0
  115. /package/dist/{chunk-KCK5ASQG.js.map → chunk-NEZQ3YTI.js.map} +0 -0
  116. /package/dist/{chunk-R5PGISWG.js.map → chunk-S4FLNZHK.js.map} +0 -0
  117. /package/dist/{chunk-PA3L4YLB.js.map → chunk-TDJ2FZF3.js.map} +0 -0
  118. /package/dist/{chunk-PDEFAEH2.js.map → chunk-WPGNM4VM.js.map} +0 -0
  119. /package/dist/{chunk-OTOIKZNT.js.map → chunk-XEXEZF2L.js.map} +0 -0
  120. /package/dist/{chunk-JLMTORFA.js.map → chunk-YD5RDIKE.js.map} +0 -0
  121. /package/dist/{cli-circuit-breaker-4LMK2QKT.js.map → cli-circuit-breaker-TEP2DWWH.js.map} +0 -0
  122. /package/dist/{composite-router-DL5TCA5E.js.map → composite-router-GLNDX2GV.js.map} +0 -0
  123. /package/dist/{consensus-vote-ONTASY3I.js.map → consensus-vote-WIAUGC5V.js.map} +0 -0
  124. /package/dist/{context-retriever-7N6EYNUR.js.map → context-retriever-AUID4ELJ.js.map} +0 -0
  125. /package/dist/{doctor-deep-OWM63GEP.js.map → doctor-deep-4K23X2QK.js.map} +0 -0
  126. /package/dist/{doctor-live-LANTOIUT.js.map → doctor-live-CU6O4MNI.js.map} +0 -0
  127. /package/dist/{expert-bridge-R55ZI3QO.js.map → expert-bridge-YWCGQKN2.js.map} +0 -0
  128. /package/dist/{factory-KVR57WN7.js.map → factory-J42N5QU6.js.map} +0 -0
  129. /package/dist/{factory-YLAJMS5T.js.map → factory-NOC7DSJG.js.map} +0 -0
  130. /package/dist/{improvement-review-ETE7HFWF.js.map → improvement-review-53QJQMBZ.js.map} +0 -0
  131. /package/dist/{issue-triage-EVHSZLEF.js.map → issue-triage-E55KBDOD.js.map} +0 -0
  132. /package/dist/{pr-reviewer-helpers-NLYAPH6N.js.map → openai-compat-adapter-5BCCGH32.js.map} +0 -0
  133. /package/dist/{repo-security-plan-JMJ4TYVA.js.map → pr-reviewer-helpers-EHAG74L5.js.map} +0 -0
  134. /package/dist/{registry-command-LVGNBYEJ.js.map → registry-command-CS42ODV3.js.map} +0 -0
  135. /package/dist/{research-helpers-synthesize-DZDG3FPO.js.map → repo-security-plan-ENHKDRM3.js.map} +0 -0
  136. /package/dist/{routing-memory-LI2WXDSJ.js.map → research-helpers-synthesize-XYMCJHFU.js.map} +0 -0
  137. /package/dist/{session-memory-G5MKOAS2.js.map → routing-memory-KLIKEK6N.js.map} +0 -0
  138. /package/dist/{setup-config-2EUIGDXM.js.map → session-memory-LHZYRRFM.js.map} +0 -0
  139. /package/dist/{setup-data-dir-UXUSHIIL.js.map → setup-config-YZ6E7RSF.js.map} +0 -0
  140. /package/dist/{setup-custom-api-H3YWZOSO.js.map → setup-custom-api-AITNIHMR.js.map} +0 -0
  141. /package/dist/{tool-memory-QAXICAJW.js.map → setup-data-dir-7Y7A3RUJ.js.map} +0 -0
  142. /package/dist/{unified-registry-42YOG25E.js.map → tool-memory-YEHRAJXA.js.map} +0 -0
  143. /package/dist/{weather-report-KFZYGEYI.js.map → unified-registry-7LJW5VLX.js.map} +0 -0
@@ -9,8 +9,8 @@ import {
9
9
  getBuiltInAstRulesPath,
10
10
  loadRules,
11
11
  runAstQaRules
12
- } from "./chunk-PA3L4YLB.js";
13
- import "./chunk-F23W7Z6M.js";
12
+ } from "./chunk-TDJ2FZF3.js";
13
+ import "./chunk-NPLCVC3G.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-5S3B2F7B.js.map
29
+ //# sourceMappingURL=ast-rule-runner-AWL7WA6O.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-OITVVSWO.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-F23W7Z6M.js";
6
+ } from "./chunk-NPLCVC3G.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-XAPZFOSJ.js.map
59
+ //# sourceMappingURL=child-mcp-config-JQLYDUUY.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-BSTGUADO.js";
4
- import {
5
- sanitizeErrorDetails
6
- } from "./chunk-2NDA4DHW.js";
3
+ } from "./chunk-6I2O2TTX.js";
7
4
  import {
8
5
  DEFAULT_EXECUTION_MODE
9
6
  } from "./chunk-ECJ52NSK.js";
7
+ import {
8
+ sanitizeErrorDetails
9
+ } from "./chunk-2NDA4DHW.js";
10
10
  import {
11
11
  CACHE_TIMEOUTS,
12
12
  MCP_TIMEOUTS,
@@ -23,7 +23,7 @@ import {
23
23
  getTimeProvider,
24
24
  ok,
25
25
  resolveToolClassGuardMs
26
- } from "./chunk-F23W7Z6M.js";
26
+ } from "./chunk-NPLCVC3G.js";
27
27
  import {
28
28
  getNexusDataDir,
29
29
  parseBoolValue
@@ -2342,4 +2342,4 @@ export {
2342
2342
  DEFAULT_CONSENSUS_CONFIG,
2343
2343
  ConsensusMetricsSchema
2344
2344
  };
2345
- //# sourceMappingURL=chunk-OUBCCWNV.js.map
2345
+ //# sourceMappingURL=chunk-22ORYF2M.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  loadPapersRegistry
3
- } from "./chunk-XCKWAVAW.js";
3
+ } from "./chunk-EQHSJEX3.js";
4
4
  import {
5
5
  getErrorMessage
6
- } from "./chunk-F23W7Z6M.js";
6
+ } from "./chunk-NPLCVC3G.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-JMVE5ZMR.js.map
879
+ //# sourceMappingURL=chunk-2JLWILT3.js.map
@@ -1,21 +1,27 @@
1
1
  import {
2
2
  SERVES_PROBE_PROMPT
3
- } from "./chunk-4ECZEXUP.js";
3
+ } from "./chunk-HRWT6UU6.js";
4
4
  import {
5
- readOpenAICompatEndpoint,
6
- readOpenAICompatEnv
7
- } from "./chunk-JBK2O46P.js";
8
- import {
9
- allOf
10
- } from "./chunk-EZNIYU5T.js";
5
+ printVoterTransportCheck
6
+ } from "./chunk-C2MLEXZC.js";
11
7
  import {
12
8
  NODE_ENGINE_RANGE,
13
9
  VERSION,
14
10
  isNodeVersionSupported
15
- } from "./chunk-BSTGUADO.js";
11
+ } from "./chunk-6I2O2TTX.js";
12
+ import {
13
+ allOf
14
+ } from "./chunk-EZNIYU5T.js";
15
+ import {
16
+ checkGatewayHost,
17
+ createOpenAICompatAdapter,
18
+ discoverGatewayCatalog,
19
+ readOpenAICompatEndpoint,
20
+ readOpenAICompatEnv
21
+ } from "./chunk-EZSDF2RN.js";
16
22
  import {
17
23
  claimGlobalRegistry
18
- } from "./chunk-FRZN32H3.js";
24
+ } from "./chunk-RWH4GY4O.js";
19
25
  import {
20
26
  capitalize
21
27
  } from "./chunk-7LP6VJRP.js";
@@ -27,27 +33,26 @@ import {
27
33
  createAllAdapters,
28
34
  isCliDisabled,
29
35
  probeCli
30
- } from "./chunk-QYDVF72S.js";
36
+ } from "./chunk-DXWTSSZ5.js";
37
+ import {
38
+ gatewayProxyUrl
39
+ } from "./chunk-7IP3RMJY.js";
31
40
  import {
32
41
  resolveGatewayEnv
33
- } from "./chunk-KCK5ASQG.js";
42
+ } from "./chunk-NEZQ3YTI.js";
34
43
  import {
35
44
  getNexusTmpDir
36
45
  } from "./chunk-OITVVSWO.js";
37
46
  import {
38
47
  DEFAULT_CAPABILITIES,
39
- DEFAULT_OPENAI_COMPAT_ENDPOINT,
40
- GATEWAY_COST_ENV,
41
- OPENAI_COMPAT_ENDPOINT_ENV,
42
- OPENAI_COMPAT_KEY_ENV,
43
- OPENAI_COMPAT_URL_ENV,
44
48
  colors,
45
49
  countEligibleOutcomesInFile,
46
50
  countRoutedOutcomesInFile,
47
51
  createLogger,
48
- describeGatewayCostDeclaration,
49
52
  err,
50
53
  gatewayCostStatus,
54
+ gatewayModelFamily,
55
+ gatewaySlotMapping,
51
56
  getCliModelName,
52
57
  getDefaultModelForCli,
53
58
  getDefaultRegistry,
@@ -60,7 +65,7 @@ import {
60
65
  resolveGatewayCostDeclaration,
61
66
  symbols,
62
67
  writeLine
63
- } from "./chunk-F23W7Z6M.js";
68
+ } from "./chunk-NPLCVC3G.js";
64
69
  import {
65
70
  getLearningDir,
66
71
  getOutcomesFile,
@@ -419,49 +424,6 @@ function formatClaudeModelLine(probe) {
419
424
  return `${icon} Claude model ${probe.alias}: ${STATUS_LABEL[probe.status]}${detail}`;
420
425
  }
421
426
 
422
- // src/cli/doctor-voter-transport.ts
423
- var CHECK = `${colors.green}${symbols.check}${colors.reset}`;
424
- var WARN = `${colors.yellow}${symbols.warn}${colors.reset}`;
425
- function printVoterTransportCheck(check) {
426
- if (check.configured) {
427
- writeLine(`${CHECK} Voter transport: In-process gateway`);
428
- printGatewayCostLine(check.cost);
429
- printDeprecatedEnvLines(check.deprecatedEnv);
430
- return;
431
- }
432
- writeLine(`${CHECK} Voter transport: ${colors.dim}CLI subprocess${colors.reset}`);
433
- writeLine(
434
- ` ${colors.dim}Set ${OPENAI_COMPAT_URL_ENV} and ${OPENAI_COMPAT_KEY_ENV} for faster in-process voting${colors.reset}`
435
- );
436
- printDeprecatedEnvLines(check.deprecatedEnv);
437
- }
438
- function printDeprecatedEnvLines(deprecatedEnv) {
439
- if (deprecatedEnv === void 0 || deprecatedEnv.length === 0) return;
440
- for (const d of deprecatedEnv) {
441
- const status = d.shadowed ? `ignored because ${d.replacement} is set` : "honoured";
442
- writeLine(
443
- `${WARN} ${d.name} is deprecated \u2014 use ${d.replacement} (alias until the next major, #6291); ${status}`
444
- );
445
- }
446
- writeLine(
447
- ` ${colors.dim}The legacy names configure only the single-model custom-openai path; renaming to NEXUS_OPENAI_COMPAT_* opts into the gateway path (model discovery, in-process voter transport, api:<endpoint> arm)${colors.reset}`
448
- );
449
- }
450
- var CEILING_CONSEQUENCE = "the task-class cost ceiling and the per-task budget exclude this gateway until declared";
451
- var GAP_LINES = {
452
- unset: `Gateway cost: UNSET \u2014 set ${GATEWAY_COST_ENV}=free|local|priced[:<in>,<out>]; ${CEILING_CONSEQUENCE}`,
453
- invalid: `Gateway cost: INVALID \u2014 ${GATEWAY_COST_ENV} does not parse (the startup env warning names the reason); ${CEILING_CONSEQUENCE}`,
454
- "no-default": `Gateway cost: NOT DECLARED for the voter gateway \u2014 ${GATEWAY_COST_ENV} names neither a bare declaration nor this gateway's endpoint (${OPENAI_COMPAT_ENDPOINT_ENV}, default ${DEFAULT_OPENAI_COMPAT_ENDPOINT}); add a bare or <endpoint>= entry; ${CEILING_CONSEQUENCE}`
455
- };
456
- function printGatewayCostLine(cost) {
457
- if (cost === void 0) return;
458
- if (typeof cost === "string") {
459
- writeLine(`${WARN} ${GAP_LINES[cost]}`);
460
- return;
461
- }
462
- writeLine(`${CHECK} Gateway cost: ${describeGatewayCostDeclaration(cost)}`);
463
- }
464
-
465
427
  // src/cli/doctor-disabled-clis.ts
466
428
  function printDisabledClis(disabled) {
467
429
  if (disabled.length === 0) return;
@@ -520,9 +482,129 @@ function readGlobalVersion(exec) {
520
482
  }
521
483
  }
522
484
 
485
+ // src/cli/doctor-gateway.ts
486
+ var PROBE_FAMILIES = ["anthropic", "openai", "google"];
487
+ var PROBE_SLOT = {
488
+ anthropic: "claude",
489
+ openai: "codex",
490
+ google: "gemini"
491
+ };
492
+ var PROBE_MAX_TOKENS = 256;
493
+ var PROBE_TIMEOUT_MS = 3e4;
494
+ async function checkGatewayHealth(options = {}) {
495
+ const config = options.config !== void 0 ? options.config : readOpenAICompatEnv();
496
+ if (config === null) return { state: "not_configured" };
497
+ const env = options.env ?? process.env;
498
+ const proxy = proxyStatus(config, env);
499
+ const guard = await checkGatewayHost(config.baseUrl);
500
+ if (guard.state === "refused_private_host") {
501
+ const { host: host2, reason, remedy } = guard;
502
+ return { state: "refused_private_host", host: host2, reason, remedy, proxy };
503
+ }
504
+ const host = guard.host;
505
+ const discovered = await discoverGatewayCatalog(config);
506
+ if (!discovered.ok) {
507
+ return {
508
+ state: "discovery_failed",
509
+ host,
510
+ error: redact(discovered.error.message, config),
511
+ proxy
512
+ };
513
+ }
514
+ const { listedCount, models } = discovered.value;
515
+ if (models.length === 0) return { state: "no_chat_models", host, listedCount, proxy };
516
+ const adapters = models.map((m) => createOpenAICompatAdapter(m.id, config, m.created));
517
+ const slots = gatewaySlotMapping(adapters, env);
518
+ return {
519
+ state: "healthy",
520
+ host,
521
+ listedCount,
522
+ chatCount: models.length,
523
+ allowlistActive: (config.modelAllowlist ?? []).length > 0,
524
+ census: censusOf(models.map((m) => m.id)),
525
+ slots,
526
+ proxy,
527
+ probes: options.probe === true ? await probeFamilies(adapters, slots, config) : "skipped"
528
+ };
529
+ }
530
+ function censusOf(ids) {
531
+ const census = {
532
+ anthropic: 0,
533
+ openai: 0,
534
+ google: 0,
535
+ unknown: 0
536
+ };
537
+ for (const id of ids) {
538
+ const family = gatewayModelFamily(id);
539
+ const bucket = family === void 0 || family === "other" ? "unknown" : family;
540
+ census[bucket] += 1;
541
+ }
542
+ return census;
543
+ }
544
+ function proxyStatus(config, env) {
545
+ if (config.proxyUrl !== void 0) return { kind: "proxy", proxyHost: proxyHostOf(config) };
546
+ if (gatewayProxyUrl(config.baseUrl, env) !== void 0) return { kind: "ignored" };
547
+ const withoutNoProxy = { ...env, no_proxy: void 0, NO_PROXY: void 0 };
548
+ if (gatewayProxyUrl(config.baseUrl, withoutNoProxy) !== void 0) return { kind: "exempt" };
549
+ return { kind: "direct" };
550
+ }
551
+ function proxyHostOf(config) {
552
+ try {
553
+ return new URL(config.proxyUrl ?? "").host;
554
+ } catch {
555
+ return "<unparseable proxy>";
556
+ }
557
+ }
558
+ async function probeFamilies(adapters, slots, config) {
559
+ const probes = [];
560
+ for (const family of PROBE_FAMILIES) {
561
+ const model = slots[PROBE_SLOT[family]];
562
+ const adapter = adapters.find((a) => a.modelId === model);
563
+ if (adapter === void 0) {
564
+ probes.push({ family, outcome: "no_model" });
565
+ continue;
566
+ }
567
+ probes.push(await probeOne(family, adapter, config));
568
+ }
569
+ return probes;
570
+ }
571
+ async function probeOne(family, adapter, config) {
572
+ const clock = getTimeProvider();
573
+ const started = clock.now();
574
+ const base = { family, model: adapter.modelId };
575
+ try {
576
+ const result = await adapter.complete({
577
+ messages: [{ role: "user", content: "Reply with the single word OK." }],
578
+ maxTokens: PROBE_MAX_TOKENS,
579
+ timeoutMs: PROBE_TIMEOUT_MS
580
+ });
581
+ const latencyMs = clock.now() - started;
582
+ if (result.ok) return { ...base, outcome: "ok", latencyMs };
583
+ return { ...base, outcome: "failed", latencyMs, error: redact(result.error.message, config) };
584
+ } catch (e) {
585
+ const latencyMs = clock.now() - started;
586
+ return { ...base, outcome: "failed", latencyMs, error: redact(getErrorMessage(e), config) };
587
+ }
588
+ }
589
+ function redact(message, config) {
590
+ const secrets = [config.apiKey, ...Object.values(config.extraHeaders ?? {})];
591
+ return secrets.filter((s) => s !== "").reduce((text, secret) => text.replaceAll(secret, "<redacted>"), message);
592
+ }
593
+ function gatewayVerdict(health) {
594
+ if (health.state === "not_configured") return "absent";
595
+ if (health.state !== "healthy") return "fail";
596
+ const failed = health.probes !== "skipped" && health.probes.some((p) => p.outcome === "failed");
597
+ return failed ? "fail" : "pass";
598
+ }
599
+ function cliFailsVerdict(cli, gateway) {
600
+ if (!cli.installed) return gateway !== "pass";
601
+ return !cli.authenticated || cli.versionStatus === "unsupported";
602
+ }
603
+
523
604
  // src/cli/doctor-verdict-terms.ts
524
605
  function failingVerdictTerms(result) {
525
- const terms = [];
606
+ const gateway = gatewayVerdict(result.gateway);
607
+ const terms = gatewayTerms(result.gateway, gateway);
526
608
  if (!result.nodeVersion.supported) terms.push("node version");
527
609
  if (!result.mcpServerReady) terms.push("MCP server");
528
610
  if (!installFreshnessIsHealthy(result.installFreshness)) {
@@ -530,13 +612,14 @@ function failingVerdictTerms(result) {
530
612
  }
531
613
  if (!scratchSeverityIsAcceptable(worstSeverity(result.scratchSpace))) terms.push("scratch space");
532
614
  for (const c of result.clis) {
533
- if (!c.installed || !c.authenticated || c.versionStatus === "unsupported") {
534
- terms.push(`CLI ${c.name}`);
535
- }
615
+ if (cliFailsVerdict(c, gateway)) terms.push(`CLI ${c.name}`);
536
616
  }
537
- if (result.clis.length === 0) terms.push("no CLIs detected");
617
+ if (result.clis.length === 0 && gateway !== "pass") terms.push("no CLIs detected");
538
618
  return terms;
539
619
  }
620
+ function gatewayTerms(health, verdict) {
621
+ return verdict === "fail" && health.state !== "not_configured" ? [`gateway ${health.host}`] : [];
622
+ }
540
623
 
541
624
  // src/cli/doctor-formatting.ts
542
625
  function formatStatus(healthy, warn = false) {
@@ -820,7 +903,7 @@ function printDoctorResults(result) {
820
903
  writeLine(`${colors.cyan}Checking MCP configuration...${colors.reset}`);
821
904
  writeLine("");
822
905
  printMcpModes(result);
823
- printVoterTransportCheck(result.voterTransport);
906
+ printVoterTransportCheck(result.voterTransport, result.gateway);
824
907
  writeLine("");
825
908
  writeLine(`${colors.cyan}Checking capabilities...${colors.reset}`);
826
909
  writeLine("");
@@ -1336,17 +1419,20 @@ function voterGatewayCostDeclaration(endpoint) {
1336
1419
  return resolveGatewayCostDeclaration(`api:${endpoint}`) ?? "no-default";
1337
1420
  }
1338
1421
  function isAllHealthy(input) {
1339
- return input.nodeSupported && input.hasAuthMethod && input.mcpServerReady && installFreshnessIsHealthy(input.installFreshness) && scratchSeverityIsAcceptable(worstSeverity(input.scratchSpace)) && // whenEmpty = false: zero detected CLIs is not a healthy install (#4581).
1340
- allOf(
1341
- input.clis,
1342
- (c) => c.installed && c.authenticated && c.versionStatus !== "unsupported",
1343
- false
1344
- );
1422
+ return input.gateway !== "fail" && input.nodeSupported && input.hasAuthMethod && input.mcpServerReady && installFreshnessIsHealthy(input.installFreshness) && scratchSeverityIsAcceptable(worstSeverity(input.scratchSpace)) && // whenEmpty: zero detected CLIs is not a healthy install (#4581) — unless
1423
+ // a passing gateway serves the slots (#6609), as on a gateway-only host.
1424
+ allOf(input.clis, (c) => !cliFailsVerdict(c, input.gateway), input.gateway === "pass");
1345
1425
  }
1346
1426
  function probeClaudeModelFor(clis, probe = (installed) => probeClaudePinnedModel({ installed })) {
1347
1427
  const claudeCheck = clis.find((c) => c.name === "claude");
1348
1428
  return probe(claudeCheck?.installed === true);
1349
1429
  }
1430
+ function hasAnyAuthMethod(apiKeys, clis, gateway) {
1431
+ return apiKeys.some((k) => k.configured) || clis.some((c) => c.installed && c.authenticated) || gateway === "pass";
1432
+ }
1433
+ function measureGateway(check, probe) {
1434
+ return (check ?? checkGatewayHealth)({ probe: probe === true });
1435
+ }
1350
1436
  async function runDoctor(deps = {}) {
1351
1437
  const allClis = ["claude", "gemini", "codex", "opencode"];
1352
1438
  const disabledClis = allClis.filter((cli) => isCliDisabled(cli));
@@ -1366,14 +1452,16 @@ async function runDoctor(deps = {}) {
1366
1452
  const dataDirectory = checkDataDirectory();
1367
1453
  const sandbox = checkSandbox();
1368
1454
  const env = collectEnvironmentChecks();
1369
- const hasAuthMethod = apiKeys.some((k) => k.configured) || clis.some((c) => c.installed && c.authenticated);
1455
+ const gateway = await measureGateway(deps.checkGateway, deps.gatewayProbe);
1456
+ const gatewayTerm = gatewayVerdict(gateway);
1370
1457
  const allHealthy = isAllHealthy({
1371
1458
  nodeSupported: nodeVersion.supported,
1372
- hasAuthMethod,
1459
+ hasAuthMethod: hasAnyAuthMethod(apiKeys, clis, gatewayTerm),
1373
1460
  mcpServerReady,
1374
1461
  installFreshness: env.installFreshness,
1375
1462
  scratchSpace: env.scratchSpace,
1376
- clis
1463
+ clis,
1464
+ gateway: gatewayTerm
1377
1465
  });
1378
1466
  return {
1379
1467
  clis,
@@ -1389,14 +1477,19 @@ async function runDoctor(deps = {}) {
1389
1477
  dataDirectory,
1390
1478
  sandbox,
1391
1479
  ...env,
1480
+ gateway,
1392
1481
  claudeModel,
1393
1482
  allHealthy,
1394
1483
  timestamp: new Date(getTimeProvider().now())
1395
1484
  };
1396
1485
  }
1397
1486
  async function doctorCommand(options = {}) {
1398
- const result = await runDoctor();
1487
+ const result = await runDoctor({ gatewayProbe: options.probe === true });
1399
1488
  printDoctorResults(result);
1489
+ if (options.gateway === true || options.probe === true) {
1490
+ const { formatGatewayReport } = await import("./doctor-gateway-report-Q5RXOEMR.js");
1491
+ for (const line of formatGatewayReport(result.gateway)) process.stdout.write(line + "\n");
1492
+ }
1400
1493
  if (options.fix === true) {
1401
1494
  await runDoctorFix(result);
1402
1495
  }
@@ -1411,13 +1504,13 @@ async function runDoctorFix(result) {
1411
1504
  writeLine2("\u2500".repeat(40));
1412
1505
  let fixCount = 0;
1413
1506
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1414
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-UXUSHIIL.js");
1507
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-7Y7A3RUJ.js");
1415
1508
  const outcome = describeDataDirFix2(initDataDirectories2());
1416
1509
  writeLine2(outcome.line);
1417
1510
  if (outcome.counted) fixCount++;
1418
1511
  }
1419
1512
  if (!result.configFile.found) {
1420
- const { runConfigInitSync } = await import("./setup-config-2EUIGDXM.js");
1513
+ const { runConfigInitSync } = await import("./setup-config-YZ6E7RSF.js");
1421
1514
  const configResult = runConfigInitSync(process.cwd(), false, false);
1422
1515
  if (configResult.success && configResult.created) {
1423
1516
  writeLine2(`\u2713 Generated config: ${configResult.path}`);
@@ -1513,4 +1606,4 @@ export {
1513
1606
  startStdioServer,
1514
1607
  closeServer
1515
1608
  };
1516
- //# sourceMappingURL=chunk-EN7RV5VK.js.map
1609
+ //# sourceMappingURL=chunk-3JPTRESH.js.map