nexus-agents 8.117.0 → 8.118.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.
- package/dist/{ast-rule-runner-TBEMNCEM.js → ast-rule-runner-E67T34J6.js} +3 -3
- package/dist/{child-mcp-config-ZYAMNUSI.js → child-mcp-config-I7QXA4PU.js} +2 -2
- package/dist/{chunk-TC33JR2R.js → chunk-36ZRLRH4.js} +2 -2
- package/dist/chunk-52OA4YRV.js +294 -0
- package/dist/chunk-52OA4YRV.js.map +1 -0
- package/dist/{chunk-LXHNZWEI.js → chunk-5W2GYHYM.js} +2 -2
- package/dist/{chunk-2W3EA2WQ.js → chunk-6HJ2LLG4.js} +2 -2
- package/dist/{chunk-HGHUR3D2.js → chunk-7H33Z34W.js} +2 -2
- package/dist/{chunk-W5CZY7XH.js → chunk-AANXFVMA.js} +3 -3
- package/dist/{chunk-RYXH3MW5.js → chunk-ACGWYCEH.js} +2 -2
- package/dist/{chunk-2GQ7HGUC.js → chunk-B2KJ36K6.js} +2 -2
- package/dist/{chunk-HHXQ6MTA.js → chunk-CKNCC6GY.js} +2 -2
- package/dist/{chunk-2WZLDQ3F.js → chunk-CRMVFXQI.js} +8 -10
- package/dist/{chunk-2WZLDQ3F.js.map → chunk-CRMVFXQI.js.map} +1 -1
- package/dist/{chunk-AMJHBMS3.js → chunk-EALYDTHY.js} +4 -4
- package/dist/{chunk-A42AQZ42.js → chunk-EP6QPWLT.js} +13 -6
- package/dist/{chunk-A42AQZ42.js.map → chunk-EP6QPWLT.js.map} +1 -1
- package/dist/{chunk-TTBXQ3XY.js → chunk-F3ITBPV5.js} +2 -2
- package/dist/{chunk-7QEWP66K.js → chunk-HXMWPOPI.js} +64 -59
- package/dist/{chunk-7QEWP66K.js.map → chunk-HXMWPOPI.js.map} +1 -1
- package/dist/{chunk-ZAQIKVFA.js → chunk-JAJLMHLM.js} +2 -2
- package/dist/{chunk-YIFRLHIO.js → chunk-JQCI6CM3.js} +8 -8
- package/dist/{chunk-7SHNFTZL.js → chunk-KB4GPUBH.js} +24 -15
- package/dist/chunk-KB4GPUBH.js.map +1 -0
- package/dist/{chunk-UFMA7B3K.js → chunk-KMRPYX2E.js} +2 -2
- package/dist/{chunk-3IGKSXSW.js → chunk-MZLYGY7T.js} +3 -3
- package/dist/{chunk-6KXMFUIS.js → chunk-NATBQ42L.js} +2 -2
- package/dist/{chunk-NA4UZV33.js → chunk-POFDIXEQ.js} +2 -2
- package/dist/{chunk-HOQ6IQDM.js → chunk-QMTCFFIZ.js} +20 -17
- package/dist/chunk-QMTCFFIZ.js.map +1 -0
- package/dist/{chunk-3LYZHDBR.js → chunk-RG4B3TRM.js} +4 -4
- package/dist/{chunk-3UPLTDCG.js → chunk-SBKBM4XK.js} +5 -5
- package/dist/{chunk-PCHJEZG6.js → chunk-TH3HPZ7B.js} +5 -5
- package/dist/{chunk-3D6VZUMD.js → chunk-TJOQMJQZ.js} +2 -2
- package/dist/{chunk-YKONAMEB.js → chunk-UE6W5CVM.js} +4 -4
- package/dist/{chunk-7CKZMLMF.js → chunk-V2764VZD.js} +3 -3
- package/dist/{chunk-L6RY37CY.js → chunk-VHREI22J.js} +2 -2
- package/dist/{chunk-U2COYWHP.js → chunk-VLAX6EGN.js} +14 -14
- package/dist/{chunk-DL3IPHIS.js → chunk-XB3QB7QT.js} +7 -7
- package/dist/{chunk-S7QDJWWN.js → chunk-YYSXYN53.js} +3 -3
- package/dist/{chunk-ESI42DJA.js → chunk-ZIN775QZ.js} +2 -2
- package/dist/{chunk-Y45MXDIH.js → chunk-ZUKBQ7TD.js} +2 -2
- package/dist/{chunk-R6QANTJE.js → chunk-ZZYHNIKP.js} +33 -15
- package/dist/{chunk-R6QANTJE.js.map → chunk-ZZYHNIKP.js.map} +1 -1
- package/dist/{cli-circuit-breaker-ATLGIZHJ.js → cli-circuit-breaker-MDYHAQUN.js} +3 -3
- package/dist/cli.js +69 -62
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-32IHJVPU.js → composite-router-2XQS55LZ.js} +2 -2
- package/dist/{consensus-vote-AASABIRM.js → consensus-vote-3D5KNT5F.js} +17 -18
- package/dist/{context-retriever-E5WG44MR.js → context-retriever-KAUT6MOS.js} +8 -8
- package/dist/{doctor-deep-36OHMZBQ.js → doctor-deep-BIFDDMVK.js} +3 -3
- package/dist/doctor-gateway-report-XLAZSLNV.js +19 -0
- package/dist/{doctor-live-AEMBB5SA.js → doctor-live-B3VFC7PD.js} +11 -11
- package/dist/{expert-bridge-IWJ2YWHE.js → expert-bridge-4RMQHMJ3.js} +4 -5
- package/dist/{factory-D6ZSZ43V.js → factory-GKPHMR6C.js} +10 -10
- package/dist/{factory-JCHE2VG2.js → factory-KTBNJUA7.js} +5 -5
- package/dist/{improvement-review-2ML5UX24.js → improvement-review-Q4PCQ7ZZ.js} +6 -6
- package/dist/index.d.ts +20 -3
- package/dist/index.js +50 -51
- package/dist/index.js.map +1 -1
- package/dist/{init-opencode-IX6DHIDC.js → init-opencode-HRLHYORN.js} +6 -6
- package/dist/{issue-triage-OMJTUZHR.js → issue-triage-MCCE5VBM.js} +6 -6
- package/dist/{openai-compat-adapter-ALR2W274.js → openai-compat-adapter-2UHURUZC.js} +6 -6
- package/dist/{pr-reviewer-helpers-VXW3VQRJ.js → pr-reviewer-helpers-GEBK72V3.js} +4 -4
- package/dist/{registry-command-OJP3BT2R.js → registry-command-6EKFKIES.js} +2 -2
- package/dist/{repo-security-plan-E6IBGVSX.js → repo-security-plan-KYYICKO7.js} +3 -3
- package/dist/{research-helpers-synthesize-TROUC5Q5.js → research-helpers-synthesize-PRIYBOJT.js} +4 -4
- package/dist/{routing-memory-VEH4YR4B.js → routing-memory-SELBLFLA.js} +2 -2
- package/dist/{session-memory-IJLOM2GI.js → session-memory-2YVUDB6X.js} +3 -3
- package/dist/{setup-config-TUV4YSIV.js → setup-config-6H3YA2NF.js} +3 -3
- package/dist/{setup-custom-api-5M65Q47K.js → setup-custom-api-CMPXEUU6.js} +4 -4
- package/dist/setup-data-dir-ROE67QTA.js +33 -0
- package/dist/{tool-memory-AXYUILQN.js → tool-memory-FEKOGAWF.js} +5 -5
- package/dist/{unified-registry-2UJJB533.js → unified-registry-HCXXN5SF.js} +11 -12
- package/dist/{weather-report-VMXL4RCA.js → weather-report-6P52KHIQ.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-7SHNFTZL.js.map +0 -1
- package/dist/chunk-HOQ6IQDM.js.map +0 -1
- package/dist/chunk-MX7TQLA6.js +0 -82
- package/dist/chunk-MX7TQLA6.js.map +0 -1
- package/dist/chunk-XBUEG2X3.js +0 -153
- package/dist/chunk-XBUEG2X3.js.map +0 -1
- package/dist/doctor-gateway-report-P6WNWTOS.js +0 -17
- package/dist/setup-data-dir-WZ2GACH5.js +0 -34
- /package/dist/{ast-rule-runner-TBEMNCEM.js.map → ast-rule-runner-E67T34J6.js.map} +0 -0
- /package/dist/{child-mcp-config-ZYAMNUSI.js.map → child-mcp-config-I7QXA4PU.js.map} +0 -0
- /package/dist/{chunk-TC33JR2R.js.map → chunk-36ZRLRH4.js.map} +0 -0
- /package/dist/{chunk-LXHNZWEI.js.map → chunk-5W2GYHYM.js.map} +0 -0
- /package/dist/{chunk-2W3EA2WQ.js.map → chunk-6HJ2LLG4.js.map} +0 -0
- /package/dist/{chunk-HGHUR3D2.js.map → chunk-7H33Z34W.js.map} +0 -0
- /package/dist/{chunk-W5CZY7XH.js.map → chunk-AANXFVMA.js.map} +0 -0
- /package/dist/{chunk-RYXH3MW5.js.map → chunk-ACGWYCEH.js.map} +0 -0
- /package/dist/{chunk-2GQ7HGUC.js.map → chunk-B2KJ36K6.js.map} +0 -0
- /package/dist/{chunk-HHXQ6MTA.js.map → chunk-CKNCC6GY.js.map} +0 -0
- /package/dist/{chunk-AMJHBMS3.js.map → chunk-EALYDTHY.js.map} +0 -0
- /package/dist/{chunk-TTBXQ3XY.js.map → chunk-F3ITBPV5.js.map} +0 -0
- /package/dist/{chunk-ZAQIKVFA.js.map → chunk-JAJLMHLM.js.map} +0 -0
- /package/dist/{chunk-YIFRLHIO.js.map → chunk-JQCI6CM3.js.map} +0 -0
- /package/dist/{chunk-UFMA7B3K.js.map → chunk-KMRPYX2E.js.map} +0 -0
- /package/dist/{chunk-3IGKSXSW.js.map → chunk-MZLYGY7T.js.map} +0 -0
- /package/dist/{chunk-6KXMFUIS.js.map → chunk-NATBQ42L.js.map} +0 -0
- /package/dist/{chunk-NA4UZV33.js.map → chunk-POFDIXEQ.js.map} +0 -0
- /package/dist/{chunk-3LYZHDBR.js.map → chunk-RG4B3TRM.js.map} +0 -0
- /package/dist/{chunk-3UPLTDCG.js.map → chunk-SBKBM4XK.js.map} +0 -0
- /package/dist/{chunk-PCHJEZG6.js.map → chunk-TH3HPZ7B.js.map} +0 -0
- /package/dist/{chunk-3D6VZUMD.js.map → chunk-TJOQMJQZ.js.map} +0 -0
- /package/dist/{chunk-YKONAMEB.js.map → chunk-UE6W5CVM.js.map} +0 -0
- /package/dist/{chunk-7CKZMLMF.js.map → chunk-V2764VZD.js.map} +0 -0
- /package/dist/{chunk-L6RY37CY.js.map → chunk-VHREI22J.js.map} +0 -0
- /package/dist/{chunk-U2COYWHP.js.map → chunk-VLAX6EGN.js.map} +0 -0
- /package/dist/{chunk-DL3IPHIS.js.map → chunk-XB3QB7QT.js.map} +0 -0
- /package/dist/{chunk-S7QDJWWN.js.map → chunk-YYSXYN53.js.map} +0 -0
- /package/dist/{chunk-ESI42DJA.js.map → chunk-ZIN775QZ.js.map} +0 -0
- /package/dist/{chunk-Y45MXDIH.js.map → chunk-ZUKBQ7TD.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-ATLGIZHJ.js.map → cli-circuit-breaker-MDYHAQUN.js.map} +0 -0
- /package/dist/{composite-router-32IHJVPU.js.map → composite-router-2XQS55LZ.js.map} +0 -0
- /package/dist/{consensus-vote-AASABIRM.js.map → consensus-vote-3D5KNT5F.js.map} +0 -0
- /package/dist/{context-retriever-E5WG44MR.js.map → context-retriever-KAUT6MOS.js.map} +0 -0
- /package/dist/{doctor-deep-36OHMZBQ.js.map → doctor-deep-BIFDDMVK.js.map} +0 -0
- /package/dist/{doctor-gateway-report-P6WNWTOS.js.map → doctor-gateway-report-XLAZSLNV.js.map} +0 -0
- /package/dist/{doctor-live-AEMBB5SA.js.map → doctor-live-B3VFC7PD.js.map} +0 -0
- /package/dist/{expert-bridge-IWJ2YWHE.js.map → expert-bridge-4RMQHMJ3.js.map} +0 -0
- /package/dist/{factory-D6ZSZ43V.js.map → factory-GKPHMR6C.js.map} +0 -0
- /package/dist/{factory-JCHE2VG2.js.map → factory-KTBNJUA7.js.map} +0 -0
- /package/dist/{improvement-review-2ML5UX24.js.map → improvement-review-Q4PCQ7ZZ.js.map} +0 -0
- /package/dist/{init-opencode-IX6DHIDC.js.map → init-opencode-HRLHYORN.js.map} +0 -0
- /package/dist/{issue-triage-OMJTUZHR.js.map → issue-triage-MCCE5VBM.js.map} +0 -0
- /package/dist/{openai-compat-adapter-ALR2W274.js.map → openai-compat-adapter-2UHURUZC.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-VXW3VQRJ.js.map → pr-reviewer-helpers-GEBK72V3.js.map} +0 -0
- /package/dist/{registry-command-OJP3BT2R.js.map → registry-command-6EKFKIES.js.map} +0 -0
- /package/dist/{repo-security-plan-E6IBGVSX.js.map → repo-security-plan-KYYICKO7.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-TROUC5Q5.js.map → research-helpers-synthesize-PRIYBOJT.js.map} +0 -0
- /package/dist/{routing-memory-VEH4YR4B.js.map → routing-memory-SELBLFLA.js.map} +0 -0
- /package/dist/{session-memory-IJLOM2GI.js.map → session-memory-2YVUDB6X.js.map} +0 -0
- /package/dist/{setup-config-TUV4YSIV.js.map → setup-config-6H3YA2NF.js.map} +0 -0
- /package/dist/{setup-custom-api-5M65Q47K.js.map → setup-custom-api-CMPXEUU6.js.map} +0 -0
- /package/dist/{setup-data-dir-WZ2GACH5.js.map → setup-data-dir-ROE67QTA.js.map} +0 -0
- /package/dist/{tool-memory-AXYUILQN.js.map → tool-memory-FEKOGAWF.js.map} +0 -0
- /package/dist/{unified-registry-2UJJB533.js.map → unified-registry-HCXXN5SF.js.map} +0 -0
- /package/dist/{weather-report-VMXL4RCA.js.map → weather-report-6P52KHIQ.js.map} +0 -0
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
getBuiltInAstRulesPath,
|
|
10
10
|
loadRules,
|
|
11
11
|
runAstQaRules
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NATBQ42L.js";
|
|
13
13
|
import "./chunk-XEPZSDN5.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-ZZYHNIKP.js";
|
|
15
15
|
import "./chunk-UE7A2XHM.js";
|
|
16
16
|
import "./chunk-LWOX65CP.js";
|
|
17
17
|
import "./chunk-PX6F3LHL.js";
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
loadRules,
|
|
28
28
|
runAstQaRules
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=ast-rule-runner-
|
|
30
|
+
//# sourceMappingURL=ast-rule-runner-E67T34J6.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-OITVVSWO.js";
|
|
4
4
|
import {
|
|
5
5
|
createLogger
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
7
7
|
import "./chunk-UE7A2XHM.js";
|
|
8
8
|
import "./chunk-LWOX65CP.js";
|
|
9
9
|
import "./chunk-PX6F3LHL.js";
|
|
@@ -49,4 +49,4 @@ async function generateMcpConfig(options) {
|
|
|
49
49
|
export {
|
|
50
50
|
generateMcpConfig
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=child-mcp-config-
|
|
52
|
+
//# sourceMappingURL=child-mcp-config-I7QXA4PU.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
lookupInTreeCapability,
|
|
14
14
|
ok,
|
|
15
15
|
resolveRetryAfterMs
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
17
17
|
|
|
18
18
|
// src/adapters/base-adapter.ts
|
|
19
19
|
var AdapterModelError = class extends ModelError {
|
|
@@ -1046,4 +1046,4 @@ export {
|
|
|
1046
1046
|
gatewayClientOptions,
|
|
1047
1047
|
gatewayAiSdkOptions
|
|
1048
1048
|
};
|
|
1049
|
-
//# sourceMappingURL=chunk-
|
|
1049
|
+
//# sourceMappingURL=chunk-36ZRLRH4.js.map
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigError,
|
|
3
|
+
DEFAULT_MODEL_PER_CLI,
|
|
4
|
+
MODEL_IDS,
|
|
5
|
+
createLogger,
|
|
6
|
+
err,
|
|
7
|
+
getErrorMessage,
|
|
8
|
+
getTimeProvider,
|
|
9
|
+
logGatewaySlotMapping,
|
|
10
|
+
resolveModelIdentitySync,
|
|
11
|
+
setGatewaySlotCatalog
|
|
12
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
13
|
+
|
|
14
|
+
// src/config/model-availability.ts
|
|
15
|
+
var DEFAULT_TTL_MS = 6e4;
|
|
16
|
+
var DEFAULT_MAX_ENTRIES = 50;
|
|
17
|
+
var AvailabilityCache = class {
|
|
18
|
+
cache = /* @__PURE__ */ new Map();
|
|
19
|
+
ttlMs;
|
|
20
|
+
maxEntries;
|
|
21
|
+
constructor(config = {}) {
|
|
22
|
+
this.ttlMs = config.ttlMs ?? DEFAULT_TTL_MS;
|
|
23
|
+
this.maxEntries = config.maxEntries ?? DEFAULT_MAX_ENTRIES;
|
|
24
|
+
}
|
|
25
|
+
/** Get a cached probe result, or undefined if expired/missing. */
|
|
26
|
+
get(modelId) {
|
|
27
|
+
const entry = this.cache.get(modelId);
|
|
28
|
+
if (entry === void 0) return void 0;
|
|
29
|
+
if (getTimeProvider().now() - entry.checkedAt > this.ttlMs) {
|
|
30
|
+
this.cache.delete(modelId);
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
33
|
+
return entry;
|
|
34
|
+
}
|
|
35
|
+
/** Store a probe result, evicting oldest if at capacity. */
|
|
36
|
+
set(result) {
|
|
37
|
+
if (this.cache.size >= this.maxEntries && !this.cache.has(result.modelId)) {
|
|
38
|
+
const oldest = this.cache.keys().next();
|
|
39
|
+
if (oldest.done !== true) {
|
|
40
|
+
this.cache.delete(oldest.value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
this.cache.set(result.modelId, result);
|
|
44
|
+
}
|
|
45
|
+
/** Mark a model as unavailable without a full probe. */
|
|
46
|
+
markUnavailable(modelId, error) {
|
|
47
|
+
this.set({
|
|
48
|
+
modelId,
|
|
49
|
+
available: false,
|
|
50
|
+
latencyMs: 0,
|
|
51
|
+
checkedAt: getTimeProvider().now(),
|
|
52
|
+
error
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/** Mark a model as available. */
|
|
56
|
+
markAvailable(modelId, latencyMs) {
|
|
57
|
+
this.set({
|
|
58
|
+
modelId,
|
|
59
|
+
available: true,
|
|
60
|
+
latencyMs,
|
|
61
|
+
checkedAt: getTimeProvider().now()
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/** Check if a model is known-unavailable (cached and not expired). */
|
|
65
|
+
isKnownUnavailable(modelId) {
|
|
66
|
+
const entry = this.get(modelId);
|
|
67
|
+
return entry !== void 0 && !entry.available;
|
|
68
|
+
}
|
|
69
|
+
/** Get all cached entries (for diagnostics). */
|
|
70
|
+
entries() {
|
|
71
|
+
return [...this.cache.values()];
|
|
72
|
+
}
|
|
73
|
+
/** Number of cached entries. */
|
|
74
|
+
get size() {
|
|
75
|
+
return this.cache.size;
|
|
76
|
+
}
|
|
77
|
+
/** Clear all cached entries. */
|
|
78
|
+
clear() {
|
|
79
|
+
this.cache.clear();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var FALLBACK_CHAINS = {
|
|
83
|
+
claude: ["claude-opus", "claude-sonnet", "claude-haiku"],
|
|
84
|
+
gemini: ["gemini-3-pro", "gemini-pro", "gemini-3-flash", "gemini-flash"],
|
|
85
|
+
codex: ["codex-5.3", "codex-5.2", "codex-5.1-mini"],
|
|
86
|
+
opencode: ["opencode-custom-opus", "opencode-custom-sonnet", "opencode-default"]
|
|
87
|
+
};
|
|
88
|
+
function resolveFallback(modelId, cache) {
|
|
89
|
+
const cli = getCliForModelId(modelId);
|
|
90
|
+
if (cli === void 0) return null;
|
|
91
|
+
const chain = FALLBACK_CHAINS[cli];
|
|
92
|
+
for (const candidate of chain) {
|
|
93
|
+
if (candidate === modelId) continue;
|
|
94
|
+
if (!cache.isKnownUnavailable(candidate)) {
|
|
95
|
+
return {
|
|
96
|
+
modelId: candidate,
|
|
97
|
+
reason: `Fallback from ${modelId} (unavailable) to ${candidate}`
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
function getFallbackChain(cli) {
|
|
104
|
+
return FALLBACK_CHAINS[cli];
|
|
105
|
+
}
|
|
106
|
+
function getCliForModelId(modelId) {
|
|
107
|
+
for (const [cli, defaultModel] of Object.entries(DEFAULT_MODEL_PER_CLI)) {
|
|
108
|
+
const chain = FALLBACK_CHAINS[cli];
|
|
109
|
+
if (chain.includes(modelId)) return cli;
|
|
110
|
+
if (defaultModel === modelId) return cli;
|
|
111
|
+
}
|
|
112
|
+
return void 0;
|
|
113
|
+
}
|
|
114
|
+
var VENDOR_TO_CLI_SLOT = {
|
|
115
|
+
anthropic: "claude",
|
|
116
|
+
google: "gemini",
|
|
117
|
+
openai: "codex"
|
|
118
|
+
};
|
|
119
|
+
function resolveCliSlot(model) {
|
|
120
|
+
if (model === void 0 || model === "") return void 0;
|
|
121
|
+
if (MODEL_IDS.includes(model)) {
|
|
122
|
+
const exact = getCliForModelId(model);
|
|
123
|
+
if (exact !== void 0) return exact;
|
|
124
|
+
}
|
|
125
|
+
const { vendor } = resolveModelIdentitySync(model);
|
|
126
|
+
return VENDOR_TO_CLI_SLOT[vendor] ?? "opencode";
|
|
127
|
+
}
|
|
128
|
+
var globalCache;
|
|
129
|
+
function getAvailabilityCache() {
|
|
130
|
+
globalCache ??= new AvailabilityCache();
|
|
131
|
+
return globalCache;
|
|
132
|
+
}
|
|
133
|
+
function resetAvailabilityCache() {
|
|
134
|
+
globalCache = void 0;
|
|
135
|
+
}
|
|
136
|
+
function filterAvailableModels(modelIds, cache) {
|
|
137
|
+
const available = [];
|
|
138
|
+
const removed = [];
|
|
139
|
+
for (const id of modelIds) {
|
|
140
|
+
if (cache.isKnownUnavailable(id)) {
|
|
141
|
+
removed.push(id);
|
|
142
|
+
} else {
|
|
143
|
+
available.push(id);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return { available, removed };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// src/adapters/gateway-discovery.ts
|
|
150
|
+
var defaultLogger = createLogger({ component: "gateway-discovery" });
|
|
151
|
+
var probe;
|
|
152
|
+
var settled;
|
|
153
|
+
var lazy;
|
|
154
|
+
function discoverGatewayOnce(logger = defaultLogger) {
|
|
155
|
+
probe ??= runProbe(logger).then((result) => {
|
|
156
|
+
settled = { result };
|
|
157
|
+
return result;
|
|
158
|
+
});
|
|
159
|
+
return probe;
|
|
160
|
+
}
|
|
161
|
+
async function runProbe(logger) {
|
|
162
|
+
try {
|
|
163
|
+
const { buildOpenAICompatAdapters: build } = await import("./openai-compat-adapter-2UHURUZC.js");
|
|
164
|
+
return await build(logger);
|
|
165
|
+
} catch (error) {
|
|
166
|
+
return err(new ConfigError(`Gateway discovery threw: ${getErrorMessage(error)}`));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function gatewayDiscoveryStatus() {
|
|
170
|
+
if (probe === void 0) return "unattempted";
|
|
171
|
+
if (settled === void 0) return "pending";
|
|
172
|
+
const { result } = settled;
|
|
173
|
+
if (result === null) return "not_configured";
|
|
174
|
+
return discoveredModels(result) === void 0 ? "failed" : "discovered";
|
|
175
|
+
}
|
|
176
|
+
function discoveredModels(result) {
|
|
177
|
+
return result.ok && result.value.length > 0 ? result.value : void 0;
|
|
178
|
+
}
|
|
179
|
+
function ensureGatewayCatalogue(logger = defaultLogger) {
|
|
180
|
+
if (lazy !== void 0) return lazy;
|
|
181
|
+
if (probe !== void 0) return probe.then(() => void 0);
|
|
182
|
+
lazy = discoverGatewayOnce(logger).then((result) => {
|
|
183
|
+
registerLazily(result, logger);
|
|
184
|
+
});
|
|
185
|
+
return lazy;
|
|
186
|
+
}
|
|
187
|
+
function registerLazily(result, logger) {
|
|
188
|
+
if (result === null) return;
|
|
189
|
+
const models = discoveredModels(result);
|
|
190
|
+
if (models === void 0) {
|
|
191
|
+
logger.warn(
|
|
192
|
+
"OpenAI-compatible gateway discovery failed in this process: no gateway catalogue, so gateway family slots are unavailable and a custom-openai fallback model is unverified",
|
|
193
|
+
{ error: result.ok ? "the gateway listed 0 models" : result.error.message }
|
|
194
|
+
);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
setGatewaySlotCatalog(models);
|
|
198
|
+
logger.info("OpenAI-compatible gateway discovered on first use", {
|
|
199
|
+
modelCount: models.length
|
|
200
|
+
});
|
|
201
|
+
logGatewaySlotMapping(logger);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// src/adapters/gateway-rediscovery.ts
|
|
205
|
+
var GATEWAY_REDISCOVERY_INTERVAL_MS = 6e4;
|
|
206
|
+
var generation = 0;
|
|
207
|
+
function gatewayDiscoveryGeneration() {
|
|
208
|
+
return generation;
|
|
209
|
+
}
|
|
210
|
+
var GatewayRediscovery = class {
|
|
211
|
+
constructor(options) {
|
|
212
|
+
this.options = options;
|
|
213
|
+
this.minIntervalMs = options.minIntervalMs ?? GATEWAY_REDISCOVERY_INTERVAL_MS;
|
|
214
|
+
this.lastAttemptAt = options.lastAttemptAt ?? getTimeProvider().now();
|
|
215
|
+
}
|
|
216
|
+
options;
|
|
217
|
+
minIntervalMs;
|
|
218
|
+
lastAttemptAt;
|
|
219
|
+
inFlight;
|
|
220
|
+
refused = false;
|
|
221
|
+
/**
|
|
222
|
+
* Re-run discovery if the gateway is still missing and the backoff allows.
|
|
223
|
+
* Never rejects: a failed attempt is logged and the caller proceeds on
|
|
224
|
+
* whatever the list holds (empty means the CLI path, as at boot).
|
|
225
|
+
*/
|
|
226
|
+
ensure() {
|
|
227
|
+
if (this.refused || this.options.target.length > 0) return Promise.resolve();
|
|
228
|
+
if (this.inFlight !== void 0) return this.inFlight;
|
|
229
|
+
const now = getTimeProvider().now();
|
|
230
|
+
if (now - this.lastAttemptAt < this.minIntervalMs) return Promise.resolve();
|
|
231
|
+
this.lastAttemptAt = now;
|
|
232
|
+
this.inFlight = this.attempt().finally(() => {
|
|
233
|
+
this.inFlight = void 0;
|
|
234
|
+
});
|
|
235
|
+
return this.inFlight;
|
|
236
|
+
}
|
|
237
|
+
async attempt() {
|
|
238
|
+
const { logger, target } = this.options;
|
|
239
|
+
let found;
|
|
240
|
+
try {
|
|
241
|
+
found = await this.options.discover();
|
|
242
|
+
} catch (error) {
|
|
243
|
+
logger.warn("Gateway re-discovery threw; calls stay on CLI subprocesses", {
|
|
244
|
+
error: getErrorMessage(error)
|
|
245
|
+
});
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (found === "refused") {
|
|
249
|
+
this.refused = true;
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (found === void 0 || found.length === 0) {
|
|
253
|
+
logger.warn(
|
|
254
|
+
`Gateway re-discovery found no usable gateway; calls stay on CLI subprocesses. Next attempt no sooner than ${String(Math.round(this.minIntervalMs / 1e3))} s, on the next gateway call.`
|
|
255
|
+
);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
target.push(...found);
|
|
259
|
+
logger.info("OpenAI-compatible gateway re-discovered; gateway calls now go in-process", {
|
|
260
|
+
modelCount: found.length
|
|
261
|
+
});
|
|
262
|
+
this.options.onDiscovered?.(found);
|
|
263
|
+
generation += 1;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
var active;
|
|
267
|
+
function setGatewayRediscovery(rediscovery) {
|
|
268
|
+
active = rediscovery;
|
|
269
|
+
}
|
|
270
|
+
async function ensureGatewayDiscovered() {
|
|
271
|
+
if (active !== void 0) {
|
|
272
|
+
await active.ensure();
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
await ensureGatewayCatalogue();
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export {
|
|
279
|
+
AvailabilityCache,
|
|
280
|
+
resolveFallback,
|
|
281
|
+
getFallbackChain,
|
|
282
|
+
getCliForModelId,
|
|
283
|
+
resolveCliSlot,
|
|
284
|
+
getAvailabilityCache,
|
|
285
|
+
resetAvailabilityCache,
|
|
286
|
+
filterAvailableModels,
|
|
287
|
+
discoverGatewayOnce,
|
|
288
|
+
gatewayDiscoveryStatus,
|
|
289
|
+
gatewayDiscoveryGeneration,
|
|
290
|
+
GatewayRediscovery,
|
|
291
|
+
setGatewayRediscovery,
|
|
292
|
+
ensureGatewayDiscovered
|
|
293
|
+
};
|
|
294
|
+
//# sourceMappingURL=chunk-52OA4YRV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/config/model-availability.ts","../src/adapters/gateway-discovery.ts","../src/adapters/gateway-rediscovery.ts"],"sourcesContent":["/**\n * nexus-agents/config - Model Availability Probes & Fallback Chains\n *\n * Runtime availability tracking for model APIs. Maintains a bounded\n * TTL cache of probe results and provides fallback chain resolution\n * when a model is unavailable.\n *\n * @module config/model-availability\n * (Source: Issue #869)\n */\n\nimport { getTimeProvider } from '../core/index.js';\nimport type { ModelId, CliNameLiteral } from './model-capabilities-types.js';\nimport { MODEL_IDS } from './model-capabilities-types.js';\nimport { DEFAULT_MODEL_PER_CLI } from './in-tree-data.js';\nimport { resolveModelIdentitySync, type ModelVendor } from './model-identity.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** Status of a model probe. */\nexport interface ProbeResult {\n readonly modelId: ModelId;\n readonly available: boolean;\n readonly latencyMs: number;\n readonly checkedAt: number;\n readonly error?: string;\n}\n\n/** Configuration for the availability cache. */\nexport interface AvailabilityCacheConfig {\n /** Time-to-live in ms for probe results. Default: 60_000 (1 min). */\n readonly ttlMs?: number;\n /** Maximum entries in the cache. Default: 50. */\n readonly maxEntries?: number;\n}\n\n/** A function that probes whether a model is reachable. */\nexport type ProbeFn = (modelId: ModelId) => Promise<ProbeResult>;\n\n/** Fallback chain entry with model and reason for fallback. */\nexport interface FallbackEntry {\n readonly modelId: ModelId;\n readonly reason: string;\n}\n\n// ---------------------------------------------------------------------------\n// Availability Cache\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_TTL_MS = 60_000;\nconst DEFAULT_MAX_ENTRIES = 50;\n\n/**\n * Bounded TTL cache for model availability probe results.\n * Thread-safe for single-threaded Node.js; no locks needed.\n */\nexport class AvailabilityCache {\n private readonly cache = new Map<ModelId, ProbeResult>();\n private readonly ttlMs: number;\n private readonly maxEntries: number;\n\n constructor(config: AvailabilityCacheConfig = {}) {\n this.ttlMs = config.ttlMs ?? DEFAULT_TTL_MS;\n this.maxEntries = config.maxEntries ?? DEFAULT_MAX_ENTRIES;\n }\n\n /** Get a cached probe result, or undefined if expired/missing. */\n get(modelId: ModelId): ProbeResult | undefined {\n const entry = this.cache.get(modelId);\n if (entry === undefined) return undefined;\n if (getTimeProvider().now() - entry.checkedAt > this.ttlMs) {\n this.cache.delete(modelId);\n return undefined;\n }\n return entry;\n }\n\n /** Store a probe result, evicting oldest if at capacity. */\n set(result: ProbeResult): void {\n if (this.cache.size >= this.maxEntries && !this.cache.has(result.modelId)) {\n const oldest = this.cache.keys().next();\n if (oldest.done !== true) {\n this.cache.delete(oldest.value);\n }\n }\n this.cache.set(result.modelId, result);\n }\n\n /** Mark a model as unavailable without a full probe. */\n markUnavailable(modelId: ModelId, error: string): void {\n this.set({\n modelId,\n available: false,\n latencyMs: 0,\n checkedAt: getTimeProvider().now(),\n error,\n });\n }\n\n /** Mark a model as available. */\n markAvailable(modelId: ModelId, latencyMs: number): void {\n this.set({\n modelId,\n available: true,\n latencyMs,\n checkedAt: getTimeProvider().now(),\n });\n }\n\n /** Check if a model is known-unavailable (cached and not expired). */\n isKnownUnavailable(modelId: ModelId): boolean {\n const entry = this.get(modelId);\n return entry !== undefined && !entry.available;\n }\n\n /** Get all cached entries (for diagnostics). */\n entries(): ReadonlyArray<ProbeResult> {\n return [...this.cache.values()];\n }\n\n /** Number of cached entries. */\n get size(): number {\n return this.cache.size;\n }\n\n /** Clear all cached entries. */\n clear(): void {\n this.cache.clear();\n }\n}\n\n// ---------------------------------------------------------------------------\n// Fallback Chain Resolution\n// ---------------------------------------------------------------------------\n\n/** Default fallback order per CLI (strongest → weakest). */\nconst FALLBACK_CHAINS: Readonly<Record<CliNameLiteral, readonly ModelId[]>> = {\n claude: ['claude-opus', 'claude-sonnet', 'claude-haiku'],\n gemini: ['gemini-3-pro', 'gemini-pro', 'gemini-3-flash', 'gemini-flash'],\n codex: ['codex-5.3', 'codex-5.2', 'codex-5.1-mini'],\n opencode: ['opencode-custom-opus', 'opencode-custom-sonnet', 'opencode-default'],\n};\n\n/**\n * Resolves a fallback chain for a given model.\n * Returns the first available model in the chain, skipping known-unavailable ones.\n */\nexport function resolveFallback(modelId: ModelId, cache: AvailabilityCache): FallbackEntry | null {\n const cli = getCliForModelId(modelId);\n if (cli === undefined) return null;\n\n const chain = FALLBACK_CHAINS[cli];\n for (const candidate of chain) {\n if (candidate === modelId) continue;\n if (!cache.isKnownUnavailable(candidate)) {\n return {\n modelId: candidate,\n reason: `Fallback from ${modelId} (unavailable) to ${candidate}`,\n };\n }\n }\n return null;\n}\n\n/**\n * Get the fallback chain for a CLI tool.\n */\nexport function getFallbackChain(cli: CliNameLiteral): readonly ModelId[] {\n return FALLBACK_CHAINS[cli];\n}\n\n/**\n * Get the CLI name for a model ID.\n */\nexport function getCliForModelId(modelId: ModelId): CliNameLiteral | undefined {\n for (const [cli, defaultModel] of Object.entries(DEFAULT_MODEL_PER_CLI)) {\n const chain = FALLBACK_CHAINS[cli as CliNameLiteral];\n if (chain.includes(modelId)) return cli as CliNameLiteral;\n if (defaultModel === modelId) return cli as CliNameLiteral;\n }\n return undefined;\n}\n\n/**\n * Vendor → canonical `CliName` slot, for models NOT in the curated registry\n * (brand-new releases, or API/openrouter models). Keeps the routing/outcome/\n * tune pipeline keyed on a real slot instead of dropping the outcome (#3317 /\n * #3293). `opencode` is the multi-model catch-all slot for non-big-3 vendors.\n */\nconst VENDOR_TO_CLI_SLOT: Partial<Record<ModelVendor, CliNameLiteral>> = {\n anthropic: 'claude',\n google: 'gemini',\n openai: 'codex',\n};\n\n/**\n * Resolve a model string to a canonical `CliName` slot for routing/outcome\n * recording. Known models resolve to their exact curated slot; **unknown**\n * models (new releases, API/openrouter models not yet in the registry) fall\n * back to the vendor-derived slot — so the routing/outcome/tune pipeline still\n * records and learns instead of silently dropping the outcome with an\n * undefined cli (#3317 / #3293). Returns undefined only for an absent model\n * (no execution happened).\n */\nexport function resolveCliSlot(model: string | undefined): CliNameLiteral | undefined {\n if (model === undefined || model === '') return undefined;\n if ((MODEL_IDS as readonly string[]).includes(model)) {\n const exact = getCliForModelId(model as ModelId);\n if (exact !== undefined) return exact;\n }\n const { vendor } = resolveModelIdentitySync(model);\n return VENDOR_TO_CLI_SLOT[vendor] ?? 'opencode';\n}\n\n// ---------------------------------------------------------------------------\n// Singleton Cache (shared across the process)\n// ---------------------------------------------------------------------------\n\nlet globalCache: AvailabilityCache | undefined;\n\n/** Get the shared availability cache (lazy-init). */\nexport function getAvailabilityCache(): AvailabilityCache {\n globalCache ??= new AvailabilityCache();\n return globalCache;\n}\n\n/** Reset the global cache (for testing). */\nexport function resetAvailabilityCache(): void {\n globalCache = undefined;\n}\n\n// ---------------------------------------------------------------------------\n// Filter Integration\n// ---------------------------------------------------------------------------\n\n/**\n * Filters out known-unavailable models from a set of model IDs.\n * Returns the filtered set, or null if no models were removed.\n * Used by scoreAllModels() to skip unavailable models.\n */\nexport function filterAvailableModels(\n modelIds: readonly string[],\n cache: AvailabilityCache\n): { available: string[]; removed: string[] } {\n const available: string[] = [];\n const removed: string[] = [];\n for (const id of modelIds) {\n if (cache.isKnownUnavailable(id as ModelId)) {\n removed.push(id);\n } else {\n available.push(id);\n }\n }\n return { available, removed };\n}\n","/**\n * One gateway discovery per process, for every process (#4392).\n *\n * Discovery (`GET /v1/models`, `buildOpenAICompatAdapters`) used to run only\n * in the MCP server bootstrap (`cli-server-gateway.ts`). A CLI process —\n * `nexus-agents orchestrate`, or any direct `createAutoAdapter` caller — never\n * had a catalogue, so every gateway-aware path fell back to its no-gateway\n * branch: the family slots stayed `inactive` and the `custom-openai` fallback\n * sent `NEXUS_CUSTOM_MODEL ?? 'gpt-5.5'` to a gateway that might not serve it.\n *\n * This module memoizes the discovery for the process:\n *\n * - {@link discoverGatewayOnce} — the one probe. The server bootstrap awaits\n * it and handles the outcome itself (sandbox exits, arm registration), so a\n * server never probes twice.\n * - {@link ensureGatewayCatalogue} — the lazy path. Called on first adapter\n * use (through `ensureGatewayDiscovered`), it runs the probe if nothing has\n * and registers the family-slot catalogue on success. When the bootstrap\n * already ran the probe it only waits for it: registration is the\n * bootstrap's.\n *\n * Outcomes, named (the empty case included):\n * - no gateway configured → `not_configured`: nothing registered, every\n * caller's behaviour is what it was before this module existed;\n * - models discovered → `discovered`: the catalogue is registered;\n * - probe failed, threw, refused, or listed zero models → `failed`: logged\n * once, nothing registered. Callers that still send a model read\n * {@link gatewayDiscoveryStatus} and say the model is unverified\n * (`auto-adapter.ts` `customModelChoice`) instead of sending it as if valid.\n *\n * A failed lazy probe is not retried in this process: a CLI process is short\n * and the operator sees the warning. The long-lived server retries through\n * `gateway-rediscovery.ts`, which is unaffected.\n *\n * @module adapters/gateway-discovery\n */\n\nimport type { ILogger, IModelAdapter } from '../core/index.js';\nimport { createLogger, err, getErrorMessage, ConfigError } from '../core/index.js';\nimport type { buildOpenAICompatAdapters } from './openai-compat-adapter.js';\nimport { logGatewaySlotMapping, setGatewaySlotCatalog } from './gateway-family-slots.js';\n\n/** One discovery's raw result, as `buildOpenAICompatAdapters` returns it. */\nexport type GatewayDiscoveryResult = Awaited<ReturnType<typeof buildOpenAICompatAdapters>>;\n\n/** Where this process's discovery stands. */\nexport type GatewayDiscoveryStatus =\n 'unattempted' | 'pending' | 'not_configured' | 'discovered' | 'failed';\n\nconst defaultLogger = createLogger({ component: 'gateway-discovery' });\n\nlet probe: Promise<GatewayDiscoveryResult> | undefined;\nlet settled: { readonly result: GatewayDiscoveryResult } | undefined;\nlet lazy: Promise<void> | undefined;\n\n/**\n * The process's one discovery probe; every call after the first returns the\n * same promise. Never rejects: a thrown probe becomes an error result.\n */\nexport function discoverGatewayOnce(\n logger: ILogger = defaultLogger\n): Promise<GatewayDiscoveryResult> {\n probe ??= runProbe(logger).then((result) => {\n settled = { result };\n return result;\n });\n return probe;\n}\n\nasync function runProbe(logger: ILogger): Promise<GatewayDiscoveryResult> {\n try {\n // Loaded on first probe, not at import: this module sits under\n // `gateway-rediscovery.ts`, which every resilient adapter imports, and the\n // openai-compat chain (the `openai` SDK) should not load with it.\n const { buildOpenAICompatAdapters: build } = await import('./openai-compat-adapter.js');\n return await build(logger);\n } catch (error: unknown) {\n return err(new ConfigError(`Gateway discovery threw: ${getErrorMessage(error)}`));\n }\n}\n\n/** Where this process's discovery stands; see the module doc for each value. */\nexport function gatewayDiscoveryStatus(): GatewayDiscoveryStatus {\n if (probe === undefined) return 'unattempted';\n if (settled === undefined) return 'pending';\n const { result } = settled;\n if (result === null) return 'not_configured';\n return discoveredModels(result) === undefined ? 'failed' : 'discovered';\n}\n\n/** The discovered models, or undefined for a failed or empty discovery. */\nfunction discoveredModels(\n result: NonNullable<GatewayDiscoveryResult>\n): readonly IModelAdapter[] | undefined {\n return result.ok && result.value.length > 0 ? result.value : undefined;\n}\n\n/**\n * Make sure this process has tried discovery, registering the family-slot\n * catalogue when the probe is this call's. Never rejects.\n */\nexport function ensureGatewayCatalogue(logger: ILogger = defaultLogger): Promise<void> {\n if (lazy !== undefined) return lazy;\n // The bootstrap's probe: it registers what it found itself.\n if (probe !== undefined) return probe.then(() => undefined);\n lazy = discoverGatewayOnce(logger).then((result) => {\n registerLazily(result, logger);\n });\n return lazy;\n}\n\nfunction registerLazily(result: GatewayDiscoveryResult, logger: ILogger): void {\n if (result === null) return; // not configured: the named empty case\n const models = discoveredModels(result);\n if (models === undefined) {\n logger.warn(\n 'OpenAI-compatible gateway discovery failed in this process: no gateway catalogue, so ' +\n 'gateway family slots are unavailable and a custom-openai fallback model is unverified',\n { error: result.ok ? 'the gateway listed 0 models' : result.error.message }\n );\n return;\n }\n setGatewaySlotCatalog(models);\n logger.info('OpenAI-compatible gateway discovered on first use', {\n modelCount: models.length,\n });\n logGatewaySlotMapping(logger);\n}\n\n/** Test-only: forget this process's discovery. */\nexport function _resetGatewayDiscovery(): void {\n probe = undefined;\n settled = undefined;\n lazy = undefined;\n}\n","/**\n * Lazy gateway re-discovery (#6608 item 4, #6659).\n *\n * Discovery runs once at startup. A gateway that was down at boot used to\n * leave the process on CLI subprocesses for its whole life. When the boot\n * probe fails for a reason that can clear on its own (unreachable, error\n * status, zero models), the bootstrap hands the tools an EMPTY, live adapter\n * list and arms a {@link GatewayRediscovery}; the first gateway-needing call\n * after the backoff re-runs discovery and fills that list in place, so every\n * holder of the reference sees the gateway from then on.\n *\n * Who triggers it (#6659): every adapter the registry hands out is a\n * `ResilientAdapter`, whose `ensureAdapter` calls\n * {@link ensureGatewayDiscovered} before each call, so orchestrate,\n * execute_expert and every other registry consumer trigger it, not only the\n * voter paths. A successful late discovery bumps\n * {@link gatewayDiscoveryGeneration}; a resilient adapter that detected\n * before it re-detects once, which moves the default adapter and the\n * family-slot adapters onto the gateway.\n *\n * Bounds, by construction: never at startup (the boot attempt is the first\n * attempt, and the clock starts there); at most one attempt per\n * {@link GATEWAY_REDISCOVERY_INTERVAL_MS}; concurrent callers share one\n * in-flight attempt, which the discovery request's own timeout bounds;\n * nothing retries on a timer, so an idle process makes no calls; once the\n * list is filled, or discovery was refused for a reason retrying cannot fix,\n * the check is a flag test.\n *\n * @module adapters/gateway-rediscovery\n */\n\nimport type { ILogger, IModelAdapter } from '../core/index.js';\nimport { getErrorMessage, getTimeProvider } from '../core/index.js';\nimport { ensureGatewayCatalogue } from './gateway-discovery.js';\n\n/** Minimum spacing between discovery attempts, the boot attempt included. */\nconst GATEWAY_REDISCOVERY_INTERVAL_MS = 60_000;\n\n/**\n * One discovery attempt's result: the adapters; `undefined` when it failed in\n * a way that can clear (already logged; retried after the backoff); or\n * `'refused'` when retrying cannot help (already logged; never retried).\n */\ntype GatewayDiscoveryAttempt = readonly IModelAdapter[] | 'refused' | undefined;\n\nexport interface GatewayRediscoveryOptions {\n /** The live list the tools hold. Filled in place on success; never replaced. */\n readonly target: IModelAdapter[];\n /** One discovery attempt. */\n readonly discover: () => Promise<GatewayDiscoveryAttempt>;\n /** Runs once, after the target is filled — the bootstrap registers the arm here. */\n readonly onDiscovered?: (adapters: readonly IModelAdapter[]) => void;\n readonly logger: ILogger;\n readonly minIntervalMs?: number;\n /** When the last attempt ran; defaults to now (the boot attempt just failed). */\n readonly lastAttemptAt?: number;\n}\n\n/** Successful late discoveries in this process; 0 until one happens. */\nlet generation = 0;\n\n/**\n * How many late discoveries have succeeded. A holder of an adapter chosen\n * before the gateway existed compares it with the value it saw then, and\n * re-selects when it moved.\n */\nexport function gatewayDiscoveryGeneration(): number {\n return generation;\n}\n\nexport class GatewayRediscovery {\n private readonly minIntervalMs: number;\n private lastAttemptAt: number;\n private inFlight: Promise<void> | undefined;\n private refused = false;\n\n constructor(private readonly options: GatewayRediscoveryOptions) {\n this.minIntervalMs = options.minIntervalMs ?? GATEWAY_REDISCOVERY_INTERVAL_MS;\n this.lastAttemptAt = options.lastAttemptAt ?? getTimeProvider().now();\n }\n\n /**\n * Re-run discovery if the gateway is still missing and the backoff allows.\n * Never rejects: a failed attempt is logged and the caller proceeds on\n * whatever the list holds (empty means the CLI path, as at boot).\n */\n ensure(): Promise<void> {\n if (this.refused || this.options.target.length > 0) return Promise.resolve();\n if (this.inFlight !== undefined) return this.inFlight;\n const now = getTimeProvider().now();\n if (now - this.lastAttemptAt < this.minIntervalMs) return Promise.resolve();\n this.lastAttemptAt = now;\n this.inFlight = this.attempt().finally(() => {\n this.inFlight = undefined;\n });\n return this.inFlight;\n }\n\n private async attempt(): Promise<void> {\n const { logger, target } = this.options;\n let found: GatewayDiscoveryAttempt;\n try {\n found = await this.options.discover();\n } catch (error: unknown) {\n logger.warn('Gateway re-discovery threw; calls stay on CLI subprocesses', {\n error: getErrorMessage(error),\n });\n return;\n }\n if (found === 'refused') {\n // Logged with its remedy by `discover`; retrying cannot change it.\n this.refused = true;\n return;\n }\n if (found === undefined || found.length === 0) {\n logger.warn(\n `Gateway re-discovery found no usable gateway; calls stay on CLI subprocesses. ` +\n `Next attempt no sooner than ${String(Math.round(this.minIntervalMs / 1000))} s, on the next gateway call.`\n );\n return;\n }\n target.push(...found);\n logger.info('OpenAI-compatible gateway re-discovered; gateway calls now go in-process', {\n modelCount: found.length,\n });\n this.options.onDiscovered?.(found);\n generation += 1;\n }\n}\n\nlet active: GatewayRediscovery | undefined;\n\n/** Install (or with `undefined`, clear) the process's re-discovery. Set by the bootstrap. */\nexport function setGatewayRediscovery(rediscovery: GatewayRediscovery | undefined): void {\n active = rediscovery;\n}\n\n/**\n * Called on the gateway-needing paths before they read gateway state. With a\n * re-discovery armed (the server's boot probe failed retryably) it runs that.\n * Otherwise it makes sure this process has tried discovery at all (#4392):\n * outside the MCP server nothing else does, so the first call runs the one\n * memoized probe (`gateway-discovery.ts`) and registers the catalogue; every\n * later call, and every call in a server whose bootstrap probed, is a settled\n * promise. No gateway configured probes nothing.\n */\nexport async function ensureGatewayDiscovered(): Promise<void> {\n if (active !== undefined) {\n await active.ensure();\n return;\n }\n await ensureGatewayCatalogue();\n}\n"],"mappings":";;;;;;;;;;;;;;AAmDA,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAMrB,IAAM,oBAAN,MAAwB;AAAA,EACZ,QAAQ,oBAAI,IAA0B;AAAA,EACtC;AAAA,EACA;AAAA,EAEjB,YAAY,SAAkC,CAAC,GAAG;AAChD,SAAK,QAAQ,OAAO,SAAS;AAC7B,SAAK,aAAa,OAAO,cAAc;AAAA,EACzC;AAAA;AAAA,EAGA,IAAI,SAA2C;AAC7C,UAAM,QAAQ,KAAK,MAAM,IAAI,OAAO;AACpC,QAAI,UAAU,OAAW,QAAO;AAChC,QAAI,gBAAgB,EAAE,IAAI,IAAI,MAAM,YAAY,KAAK,OAAO;AAC1D,WAAK,MAAM,OAAO,OAAO;AACzB,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,IAAI,QAA2B;AAC7B,QAAI,KAAK,MAAM,QAAQ,KAAK,cAAc,CAAC,KAAK,MAAM,IAAI,OAAO,OAAO,GAAG;AACzE,YAAM,SAAS,KAAK,MAAM,KAAK,EAAE,KAAK;AACtC,UAAI,OAAO,SAAS,MAAM;AACxB,aAAK,MAAM,OAAO,OAAO,KAAK;AAAA,MAChC;AAAA,IACF;AACA,SAAK,MAAM,IAAI,OAAO,SAAS,MAAM;AAAA,EACvC;AAAA;AAAA,EAGA,gBAAgB,SAAkB,OAAqB;AACrD,SAAK,IAAI;AAAA,MACP;AAAA,MACA,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW,gBAAgB,EAAE,IAAI;AAAA,MACjC;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA,EAGA,cAAc,SAAkB,WAAyB;AACvD,SAAK,IAAI;AAAA,MACP;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA,WAAW,gBAAgB,EAAE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ok
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
12
12
|
import {
|
|
13
13
|
findRepoRoot,
|
|
14
14
|
getActiveWorkspaceRoot,
|
|
@@ -213,4 +213,4 @@ export {
|
|
|
213
213
|
loadPapersRegistry,
|
|
214
214
|
savePapersRegistry
|
|
215
215
|
};
|
|
216
|
-
//# sourceMappingURL=chunk-
|
|
216
|
+
//# sourceMappingURL=chunk-5W2GYHYM.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
MCP_TIMEOUTS,
|
|
9
9
|
TEST_TIMEOUTS,
|
|
10
10
|
WORKFLOW_TIMEOUTS
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
12
12
|
import {
|
|
13
13
|
createGetToolRateLimit
|
|
14
14
|
} from "./chunk-LWOX65CP.js";
|
|
@@ -223,4 +223,4 @@ export {
|
|
|
223
223
|
CUSTOM_API_DEFAULT_MODEL,
|
|
224
224
|
DEFAULTS
|
|
225
225
|
};
|
|
226
|
-
//# sourceMappingURL=chunk-
|
|
226
|
+
//# sourceMappingURL=chunk-6HJ2LLG4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
redactCredentialShapes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
4
4
|
|
|
5
5
|
// src/security/output-sanitizer.ts
|
|
6
6
|
var REDACTED_KEY_PLACEHOLDER = "[REDACTED_KEY]";
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
sanitizeErrorDetails,
|
|
55
55
|
sanitizeStringLeaves
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-7H33Z34W.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
assessReputation,
|
|
6
6
|
sanitizeInput
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZUKBQ7TD.js";
|
|
8
8
|
import {
|
|
9
9
|
allOf
|
|
10
10
|
} from "./chunk-EZNIYU5T.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
err,
|
|
14
14
|
getTimeProvider,
|
|
15
15
|
ok
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
17
17
|
|
|
18
18
|
// src/dogfooding/pr-reviewer-helpers.ts
|
|
19
19
|
import { randomUUID } from "node:crypto";
|
|
@@ -477,4 +477,4 @@ export {
|
|
|
477
477
|
createFailedReview,
|
|
478
478
|
reviewPostingBlock
|
|
479
479
|
};
|
|
480
|
-
//# sourceMappingURL=chunk-
|
|
480
|
+
//# sourceMappingURL=chunk-AANXFVMA.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getErrorMessage,
|
|
8
8
|
getTimeProvider,
|
|
9
9
|
ok
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
11
11
|
|
|
12
12
|
// src/context/session-memory.ts
|
|
13
13
|
import * as fs from "node:fs";
|
|
@@ -374,4 +374,4 @@ export {
|
|
|
374
374
|
SessionMemory,
|
|
375
375
|
createSessionMemory
|
|
376
376
|
};
|
|
377
|
-
//# sourceMappingURL=chunk-
|
|
377
|
+
//# sourceMappingURL=chunk-ACGWYCEH.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
createLogger,
|
|
6
6
|
getTimeProvider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
8
8
|
|
|
9
9
|
// src/mcp/tools/scanner-registry-fetcher.ts
|
|
10
10
|
import { z } from "zod";
|
|
@@ -740,4 +740,4 @@ export {
|
|
|
740
740
|
generateSecurityPlan,
|
|
741
741
|
buildPlanFromAnalysis
|
|
742
742
|
};
|
|
743
|
-
//# sourceMappingURL=chunk-
|
|
743
|
+
//# sourceMappingURL=chunk-B2KJ36K6.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getAdaptiveBonus,
|
|
9
9
|
getOutcomeStore,
|
|
10
10
|
hasMeasuredCategory
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZZYHNIKP.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-
|
|
151
|
+
//# sourceMappingURL=chunk-CKNCC6GY.js.map
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureGatewayDiscovered,
|
|
3
|
-
gatewayDiscoveryGeneration
|
|
4
|
-
} from "./chunk-MX7TQLA6.js";
|
|
5
|
-
import {
|
|
3
|
+
gatewayDiscoveryGeneration,
|
|
6
4
|
resolveCliSlot
|
|
7
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-52OA4YRV.js";
|
|
8
6
|
import {
|
|
9
7
|
createLogger,
|
|
10
8
|
getTimeProvider,
|
|
11
9
|
isRateLimitText
|
|
12
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZZYHNIKP.js";
|
|
13
11
|
|
|
14
12
|
// src/pipeline/expert-access-mode.ts
|
|
15
13
|
var logger = createLogger({ component: "expert-bridge" });
|
|
@@ -71,7 +69,7 @@ async function getMcpConfigPath() {
|
|
|
71
69
|
if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;
|
|
72
70
|
mcpConfigInitPromise ??= (async () => {
|
|
73
71
|
try {
|
|
74
|
-
const { generateMcpConfig } = await import("./child-mcp-config-
|
|
72
|
+
const { generateMcpConfig } = await import("./child-mcp-config-I7QXA4PU.js");
|
|
75
73
|
const config = await generateMcpConfig();
|
|
76
74
|
cachedMcpConfigPath = config.configPath;
|
|
77
75
|
cachedMcpConfigCleanup = config.cleanup;
|
|
@@ -165,8 +163,8 @@ async function getRouter() {
|
|
|
165
163
|
}
|
|
166
164
|
if (cachedRouter !== null) return cachedRouter;
|
|
167
165
|
routerInitPromise ??= (async () => {
|
|
168
|
-
const { createAllAdapters } = await import("./factory-
|
|
169
|
-
const { createCompositeRouter } = await import("./composite-router-
|
|
166
|
+
const { createAllAdapters } = await import("./factory-GKPHMR6C.js");
|
|
167
|
+
const { createCompositeRouter } = await import("./composite-router-2XQS55LZ.js");
|
|
170
168
|
const adapters = createAllAdapters();
|
|
171
169
|
const superseded = generation !== routerGeneration;
|
|
172
170
|
if (adapters.size === 0) {
|
|
@@ -177,7 +175,7 @@ async function getRouter() {
|
|
|
177
175
|
if (superseded) return router;
|
|
178
176
|
cachedRouter = router;
|
|
179
177
|
try {
|
|
180
|
-
const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-
|
|
178
|
+
const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-MDYHAQUN.js");
|
|
181
179
|
cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);
|
|
182
180
|
} catch (error) {
|
|
183
181
|
const msg = error instanceof Error ? error.message : String(error);
|
|
@@ -325,4 +323,4 @@ export {
|
|
|
325
323
|
tokenSplitFromUsage,
|
|
326
324
|
executeExpert
|
|
327
325
|
};
|
|
328
|
-
//# sourceMappingURL=chunk-
|
|
326
|
+
//# sourceMappingURL=chunk-CRMVFXQI.js.map
|