@omnicross/core 0.1.5 → 0.1.7
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/ApiConverter.cjs +2 -2
- package/dist/ApiConverter.js +1 -1
- package/dist/{CompletionService-DdWaAxq0.d.ts → CompletionService-C3BX0Ovy.d.ts} +4 -3
- package/dist/{CompletionService-D3a47vdU.d.cts → CompletionService-kNA17cfI.d.cts} +4 -3
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +8 -6
- package/dist/auth/GeminiCodeAssistProjectResolver.js +6 -4
- package/dist/{chunk-3Z5BQZFM.cjs → chunk-235MXAGX.cjs} +3 -1
- package/dist/{chunk-HRRYG2AX.js → chunk-23S5OPIO.js} +10 -1
- package/dist/chunk-25GXJCEZ.cjs +40 -0
- package/dist/chunk-2E42SAW3.cjs +323 -0
- package/dist/chunk-2JYRIADS.js +40 -0
- package/dist/chunk-2Z4XM3H5.cjs +44 -0
- package/dist/{chunk-BODMAL6G.js → chunk-32O35CIF.js} +271 -91
- package/dist/chunk-3SCOLIPT.cjs +63 -0
- package/dist/{chunk-SYQF7OIR.js → chunk-3WD4HTR2.js} +2 -0
- package/dist/{chunk-CGKLE6IW.cjs → chunk-4BB343BI.cjs} +1489 -520
- package/dist/{chunk-VACWOIRE.cjs → chunk-4VZX5F4T.cjs} +39 -15
- package/dist/{chunk-5ZQBEOMD.js → chunk-5NJLQ6T6.js} +46 -12
- package/dist/chunk-5RSZYQJH.cjs +62 -0
- package/dist/chunk-6QQG7YG3.cjs +153 -0
- package/dist/{chunk-IFXJ2BG7.js → chunk-7C7DET6S.js} +51 -6
- package/dist/{chunk-IK3KE3AU.js → chunk-DE2SRBFZ.js} +1 -1
- package/dist/{chunk-FH2P4OCD.js → chunk-E3COOKUP.js} +1240 -271
- package/dist/{chunk-UHGVBFU3.js → chunk-EBLFCNPY.js} +38 -14
- package/dist/chunk-FU7EAR73.js +62 -0
- package/dist/chunk-FXR6N3SR.js +323 -0
- package/dist/{chunk-SUEGJ75D.cjs → chunk-GDIXXKF2.cjs} +46 -12
- package/dist/chunk-GFIZ6LQI.js +170 -0
- package/dist/chunk-GL6XM527.js +61 -0
- package/dist/chunk-HVBBDBS3.cjs +350 -0
- package/dist/{chunk-46ZIFWYG.cjs → chunk-IIRPUVPH.cjs} +7 -1
- package/dist/chunk-J3QQ6JS5.cjs +170 -0
- package/dist/{chunk-JWVTXXPX.cjs → chunk-KBM2W6UY.cjs} +8 -4
- package/dist/chunk-LB6EBS6Y.js +69 -0
- package/dist/{chunk-IWQAX3CS.js → chunk-LVUCAWMK.js} +1 -1
- package/dist/chunk-MKF46GNZ.js +350 -0
- package/dist/{chunk-HYN75H6G.cjs → chunk-MUHWHQVM.cjs} +1 -1
- package/dist/chunk-MYYR3HZL.js +44 -0
- package/dist/{chunk-MFZ5437A.js → chunk-N5T4M4GU.js} +1 -1
- package/dist/{chunk-5ENKBSWO.js → chunk-N7OOJI5V.js} +88 -8
- package/dist/chunk-NKVZ6Z3Y.cjs +61 -0
- package/dist/chunk-OF3BECU2.cjs +69 -0
- package/dist/{chunk-SNYBEXLB.cjs → chunk-OJGQKHN5.cjs} +3 -1
- package/dist/{chunk-DDMRUL76.cjs → chunk-OKMJLEXX.cjs} +5 -5
- package/dist/chunk-OPRS4IQZ.js +153 -0
- package/dist/chunk-OTZC4TNH.cjs +79 -0
- package/dist/{chunk-3Q6Z6JTO.cjs → chunk-OVQBNVSV.cjs} +287 -107
- package/dist/{chunk-4XMYPW46.cjs → chunk-OXHNSZ53.cjs} +84 -44
- package/dist/{chunk-C6OV7GCC.js → chunk-PEGTIPB3.js} +52 -12
- package/dist/chunk-PO3XB56Z.js +79 -0
- package/dist/{chunk-D3TDKWRP.js → chunk-RJ5ZGNI3.js} +54 -5
- package/dist/{chunk-PG7PS2NN.cjs → chunk-RJUONLUQ.cjs} +59 -10
- package/dist/{chunk-BPKCU575.js → chunk-SOO562NM.js} +3 -1
- package/dist/{chunk-6QZGDLL4.js → chunk-TOVPMMHM.js} +5 -1
- package/dist/{chunk-K52THW2C.cjs → chunk-V4TXMEJS.cjs} +5 -5
- package/dist/{chunk-G2UTNSGU.js → chunk-WNKWAEUR.js} +7 -1
- package/dist/{chunk-UNWKG6EI.cjs → chunk-XPIOJQS2.cjs} +51 -6
- package/dist/chunk-XXFYLL7R.js +63 -0
- package/dist/{chunk-KFI44N2R.cjs → chunk-YNJNTCSQ.cjs} +10 -1
- package/dist/{chunk-VQY5W4YW.cjs → chunk-YWL7YZWS.cjs} +90 -10
- package/dist/completion/ApiKeyPoolService.cjs +12 -0
- package/dist/completion/ApiKeyPoolService.d.cts +6 -0
- package/dist/completion/ApiKeyPoolService.d.ts +6 -0
- package/dist/completion/ApiKeyPoolService.js +12 -0
- package/dist/completion/CompletionService.cjs +30 -24
- package/dist/completion/CompletionService.d.cts +3 -1
- package/dist/completion/CompletionService.d.ts +3 -1
- package/dist/completion/CompletionService.js +29 -23
- package/dist/completion.cjs +32 -26
- package/dist/completion.d.cts +3 -1
- package/dist/completion.d.ts +3 -1
- package/dist/completion.js +31 -25
- package/dist/index.cjs +56 -29
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +61 -34
- package/dist/{keyPolicy-Cp0FntZl.d.cts → keyPolicy-zdWTu3CQ.d.cts} +1 -1
- package/dist/{keyPolicy-Cp0FntZl.d.ts → keyPolicy-zdWTu3CQ.d.ts} +1 -1
- package/dist/outbound-api/auditCapture.cjs +2 -2
- package/dist/outbound-api/auditCapture.d.cts +3 -4
- package/dist/outbound-api/auditCapture.d.ts +3 -4
- package/dist/outbound-api/auditCapture.js +1 -1
- package/dist/outbound-api/quotaWarn.d.cts +1 -1
- package/dist/outbound-api/quotaWarn.d.ts +1 -1
- package/dist/outbound-api/routeResolver.cjs +2 -2
- package/dist/outbound-api/routeResolver.d.cts +5 -3
- package/dist/outbound-api/routeResolver.d.ts +5 -3
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.cts +2 -0
- package/dist/outbound-api/subscriptionRegistryPort.d.ts +2 -0
- package/dist/outbound-api/types.d.cts +4 -2
- package/dist/outbound-api/types.d.ts +4 -2
- package/dist/outbound-api.cjs +52 -25
- package/dist/outbound-api.d.cts +131 -87
- package/dist/outbound-api.d.ts +131 -87
- package/dist/outbound-api.js +55 -28
- package/dist/pipeline/AccountAllowanceScheduling.cjs +15 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +91 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +91 -0
- package/dist/pipeline/AccountAllowanceScheduling.js +15 -0
- package/dist/pipeline/AccountAllowanceStore.cjs +20 -0
- package/dist/pipeline/AccountAllowanceStore.d.cts +77 -0
- package/dist/pipeline/AccountAllowanceStore.d.ts +77 -0
- package/dist/pipeline/AccountAllowanceStore.js +20 -0
- package/dist/pipeline/AccountRouteActivity.cjs +10 -0
- package/dist/pipeline/AccountRouteActivity.d.cts +61 -0
- package/dist/pipeline/AccountRouteActivity.d.ts +61 -0
- package/dist/pipeline/AccountRouteActivity.js +10 -0
- package/dist/pipeline/AuthSource.d.cts +11 -2
- package/dist/pipeline/AuthSource.d.ts +11 -2
- package/dist/pipeline/BoundAccountSelectionError.cjs +10 -0
- package/dist/pipeline/BoundAccountSelectionError.d.cts +28 -0
- package/dist/pipeline/BoundAccountSelectionError.d.ts +28 -0
- package/dist/pipeline/BoundAccountSelectionError.js +10 -0
- package/dist/pipeline/LlmConfigProviderAuth.d.cts +1 -0
- package/dist/pipeline/LlmConfigProviderAuth.d.ts +1 -0
- package/dist/pipeline/ServerOverloadCounter.cjs +16 -0
- package/dist/pipeline/ServerOverloadCounter.d.cts +77 -0
- package/dist/pipeline/ServerOverloadCounter.d.ts +77 -0
- package/dist/pipeline/ServerOverloadCounter.js +16 -0
- package/dist/pipeline/SubscriptionAccountHealth.cjs +6 -2
- package/dist/pipeline/SubscriptionAccountHealth.d.cts +65 -8
- package/dist/pipeline/SubscriptionAccountHealth.d.ts +65 -8
- package/dist/pipeline/SubscriptionAccountHealth.js +5 -1
- package/dist/pipeline/SubscriptionAuthSource.cjs +5 -2
- package/dist/pipeline/SubscriptionAuthSource.d.cts +1 -0
- package/dist/pipeline/SubscriptionAuthSource.d.ts +1 -0
- package/dist/pipeline/SubscriptionAuthSource.js +4 -1
- package/dist/pipeline/SubscriptionAuthStrategy.d.cts +8 -3
- package/dist/pipeline/SubscriptionAuthStrategy.d.ts +8 -3
- package/dist/pipeline/executeProviderCall.cjs +2 -2
- package/dist/pipeline/executeProviderCall.d.cts +8 -3
- package/dist/pipeline/executeProviderCall.d.ts +8 -3
- package/dist/pipeline/executeProviderCall.js +1 -1
- package/dist/pipeline/resolveProviderChain.d.cts +2 -3
- package/dist/pipeline/resolveProviderChain.d.ts +2 -3
- package/dist/pipeline/resolveSubscriptionChain.d.cts +1 -0
- package/dist/pipeline/resolveSubscriptionChain.d.ts +1 -0
- package/dist/pipeline/upstreamFetch.cjs +5 -3
- package/dist/pipeline/upstreamFetch.d.cts +35 -6
- package/dist/pipeline/upstreamFetch.d.ts +35 -6
- package/dist/pipeline/upstreamFetch.js +4 -2
- package/dist/pipeline/upstreamTrace.cjs +4 -2
- package/dist/pipeline/upstreamTrace.d.cts +22 -8
- package/dist/pipeline/upstreamTrace.d.ts +22 -8
- package/dist/pipeline/upstreamTrace.js +3 -1
- package/dist/ports/pricing-store.d.cts +4 -3
- package/dist/ports/pricing-store.d.ts +4 -3
- package/dist/ports.d.cts +4 -3
- package/dist/ports.d.ts +4 -3
- package/dist/provider-proxy/ProviderProxy.cjs +30 -24
- package/dist/provider-proxy/ProviderProxy.d.cts +2 -0
- package/dist/provider-proxy/ProviderProxy.d.ts +2 -0
- package/dist/provider-proxy/ProviderProxy.js +29 -23
- package/dist/provider-proxy/identity/codexCliHeaders.cjs +10 -0
- package/dist/provider-proxy/identity/codexCliHeaders.d.cts +45 -0
- package/dist/provider-proxy/identity/codexCliHeaders.d.ts +45 -0
- package/dist/provider-proxy/identity/codexCliHeaders.js +10 -0
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +32 -24
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +44 -5
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +44 -5
- package/dist/provider-proxy/ingress/providerProxyShared.js +31 -23
- package/dist/provider-proxy/matchText.cjs +4 -2
- package/dist/provider-proxy/matchText.d.cts +39 -6
- package/dist/provider-proxy/matchText.d.ts +39 -6
- package/dist/provider-proxy/matchText.js +3 -1
- package/dist/provider-proxy/types.d.cts +35 -2
- package/dist/provider-proxy/types.d.ts +35 -2
- package/dist/provider-proxy.cjs +30 -24
- package/dist/provider-proxy.d.cts +2 -0
- package/dist/provider-proxy.d.ts +2 -0
- package/dist/provider-proxy.js +29 -23
- package/dist/{routeResolver-C4T7yClx.d.ts → routeResolver-BxOfunbm.d.ts} +1 -1
- package/dist/{routeResolver-CB3tvJKy.d.cts → routeResolver-D5OzD0iM.d.cts} +1 -1
- package/dist/transformer/TransformerChainExecutor.cjs +2 -2
- package/dist/transformer/TransformerChainExecutor.js +1 -1
- package/dist/transformer/transformers/AnthropicTransformer.cjs +3 -2
- package/dist/transformer/transformers/AnthropicTransformer.js +2 -1
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +2 -2
- package/dist/transformer/transformers/GeminiTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiTransformer.js +2 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.cts +1 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.ts +1 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -1
- package/dist/transformer/transformers/OpenAITransformer.cjs +6 -0
- package/dist/transformer/transformers/OpenAITransformer.d.cts +68 -0
- package/dist/transformer/transformers/OpenAITransformer.d.ts +68 -0
- package/dist/transformer/transformers/OpenAITransformer.js +6 -0
- package/dist/transformer/transformers.cjs +9 -14
- package/dist/transformer/transformers.d.cts +12 -48
- package/dist/transformer/transformers.d.ts +12 -48
- package/dist/transformer/transformers.js +11 -16
- package/dist/transformer/types.d.cts +17 -0
- package/dist/transformer/types.d.ts +17 -0
- package/dist/transformer.cjs +12 -12
- package/dist/transformer.d.cts +1 -2
- package/dist/transformer.d.ts +1 -2
- package/dist/transformer.js +12 -12
- package/dist/{types-lgPYQuZS.d.ts → types-CqZD77rS.d.ts} +173 -7
- package/dist/{types-B8Arpxn0.d.cts → types-gjJ5lJ5n.d.cts} +173 -7
- package/dist/usage/pricing-engine.cjs +2 -2
- package/dist/usage/pricing-engine.d.cts +29 -1
- package/dist/usage/pricing-engine.d.ts +29 -1
- package/dist/usage/pricing-engine.js +1 -1
- package/dist/usage/usage-recorder.cjs +2 -2
- package/dist/usage/usage-recorder.d.cts +5 -1
- package/dist/usage/usage-recorder.d.ts +5 -1
- package/dist/usage/usage-recorder.js +1 -1
- package/dist/usage.cjs +3 -3
- package/dist/usage.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-7FEBOPJO.cjs +0 -50
- package/dist/chunk-DWKQZ2SK.cjs +0 -254
- package/dist/chunk-IAXWICZU.js +0 -69
- package/dist/chunk-IB3FDI4O.js +0 -50
- package/dist/chunk-OQWKZCXP.js +0 -242
- package/dist/chunk-QWBWGODS.cjs +0 -69
- package/dist/chunk-YMFAJFQT.cjs +0 -173
- package/dist/chunk-ZCIQ3L3R.cjs +0 -242
- package/dist/chunk-ZJZAOKI7.js +0 -254
- package/dist/chunk-ZLX3KGXX.js +0 -173
- package/dist/transformer/transformers/OpenCodeGoTransformer.cjs +0 -6
- package/dist/transformer/transformers/OpenCodeGoTransformer.d.cts +0 -51
- package/dist/transformer/transformers/OpenCodeGoTransformer.d.ts +0 -51
- package/dist/transformer/transformers/OpenCodeGoTransformer.js +0 -6
- package/dist/transformer/transformers/ReasoningTransformer.cjs +0 -6
- package/dist/transformer/transformers/ReasoningTransformer.d.cts +0 -47
- package/dist/transformer/transformers/ReasoningTransformer.d.ts +0 -47
- package/dist/transformer/transformers/ReasoningTransformer.js +0 -6
|
@@ -8,12 +8,14 @@ import '../logger-4GvQNzhE.js';
|
|
|
8
8
|
import '../ports/provider-config-source.js';
|
|
9
9
|
import '../ProviderProxy-C-xqrkKi.js';
|
|
10
10
|
import '../provider-proxy/types.js';
|
|
11
|
-
|
|
11
|
+
import '../pipeline/BoundAccountSelectionError.js';
|
|
12
|
+
export { S as AccountHealthConfig, A as AccountProbeConfig, a as AllowanceSchedulingConfig, C as ChatDispatchMode, b as ConcurrencyQueueConfig, E as ENDPOINT_MODEL_KINDS, c as EndpointRoutingConfig, F as FingerprintConfig, G as GatewayBinding, d as GatewayBindingFallback, e as GatewayBindingKeyScope, f as GatewayBindingModelMode, g as GatewayBindingTarget, h as GatewayModelMapping, k as KindMappedEndpoint, M as MessagesModelKind, l as ModelKind, m as ModelPrefixTargets, Q as ModelRef, n as OutboundApiDeps, o as OutboundApiKeyCreated, p as OutboundApiKeyInfo, q as OutboundApiServerConfig, r as OutboundApiServerStatus, s as OutboundEndpoint, t as OutboundFormatUrls, u as OutboundKeyActivationMode, O as OutboundKeyDb, v as OutboundKeyDbRow, T as OutboundKeyModelRestrictionMode, w as OutboundKeyPolicy, x as OutboundProxyConfig, R as RequestRole, y as ResponsesModelKind, U as UserMessageQueueConfig } from '../types-CqZD77rS.js';
|
|
12
13
|
import '@omnicross/contracts/llm-config';
|
|
13
14
|
import '../transformer/types.js';
|
|
14
15
|
import '../transformer/TransformerService.js';
|
|
15
16
|
import 'node:http';
|
|
16
17
|
import '@omnicross/contracts/completion-types';
|
|
18
|
+
import '@omnicross/contracts/usage-stats-types';
|
|
17
19
|
import '@omnicross/contracts/subscription-types';
|
|
18
20
|
import '@omnicross/contracts/usage-types';
|
|
19
21
|
import '../completion/ApiKeyPoolService.js';
|
|
@@ -22,4 +24,4 @@ import '../pipeline/SubscriptionAuthSource.js';
|
|
|
22
24
|
import '../pipeline/SubscriptionAuthStrategy.js';
|
|
23
25
|
import '../ports/web-search-backend.js';
|
|
24
26
|
import '@omnicross/contracts/websearch-types';
|
|
25
|
-
import '../keyPolicy-
|
|
27
|
+
import '../keyPolicy-zdWTu3CQ.js';
|
package/dist/outbound-api.cjs
CHANGED
|
@@ -55,33 +55,49 @@
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
var _chunk4BB343BIcjs = require('./chunk-4BB343BI.cjs');
|
|
59
67
|
require('./chunk-HQP3K7PU.cjs');
|
|
60
68
|
require('./chunk-FZ46M34D.cjs');
|
|
61
|
-
require('./chunk-
|
|
62
|
-
require('./chunk-
|
|
63
|
-
require('./chunk-
|
|
64
|
-
require('./chunk-
|
|
65
|
-
require('./chunk-
|
|
66
|
-
require('./chunk-
|
|
67
|
-
require('./chunk-K52THW2C.cjs');
|
|
68
|
-
require('./chunk-3Q6Z6JTO.cjs');
|
|
69
|
+
require('./chunk-2Z4XM3H5.cjs');
|
|
70
|
+
require('./chunk-OXHNSZ53.cjs');
|
|
71
|
+
require('./chunk-V4TXMEJS.cjs');
|
|
72
|
+
require('./chunk-OVQBNVSV.cjs');
|
|
73
|
+
require('./chunk-5RSZYQJH.cjs');
|
|
74
|
+
require('./chunk-OF3BECU2.cjs');
|
|
69
75
|
require('./chunk-EYZYXJTJ.cjs');
|
|
70
|
-
require('./chunk-
|
|
71
|
-
require('./chunk-
|
|
76
|
+
require('./chunk-2E42SAW3.cjs');
|
|
77
|
+
require('./chunk-OJGQKHN5.cjs');
|
|
78
|
+
require('./chunk-IIRPUVPH.cjs');
|
|
72
79
|
require('./chunk-GBHYAGX3.cjs');
|
|
80
|
+
require('./chunk-3OPYJG76.cjs');
|
|
81
|
+
require('./chunk-3SCOLIPT.cjs');
|
|
73
82
|
require('./chunk-RPII3E6Z.cjs');
|
|
74
83
|
require('./chunk-6RPZADX3.cjs');
|
|
75
|
-
require('./chunk-
|
|
84
|
+
require('./chunk-J3QQ6JS5.cjs');
|
|
76
85
|
require('./chunk-UIBD2YY5.cjs');
|
|
77
86
|
require('./chunk-R3HK6R4B.cjs');
|
|
78
|
-
require('./chunk-HYN75H6G.cjs');
|
|
79
|
-
require('./chunk-Q27JY5RG.cjs');
|
|
80
87
|
require('./chunk-QXD4MV2X.cjs');
|
|
81
88
|
require('./chunk-NYUNU75A.cjs');
|
|
82
|
-
require('./chunk-
|
|
83
|
-
require('./chunk-
|
|
89
|
+
require('./chunk-OTZC4TNH.cjs');
|
|
90
|
+
require('./chunk-YWL7YZWS.cjs');
|
|
91
|
+
require('./chunk-YNJNTCSQ.cjs');
|
|
84
92
|
require('./chunk-SVNDB62D.cjs');
|
|
93
|
+
require('./chunk-6QQG7YG3.cjs');
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
var _chunk25GXJCEZcjs = require('./chunk-25GXJCEZ.cjs');
|
|
99
|
+
require('./chunk-MUHWHQVM.cjs');
|
|
100
|
+
require('./chunk-Q27JY5RG.cjs');
|
|
85
101
|
|
|
86
102
|
|
|
87
103
|
var _chunkAPYG5QD7cjs = require('./chunk-APYG5QD7.cjs');
|
|
@@ -102,8 +118,7 @@ require('./chunk-4YINUUKQ.cjs');
|
|
|
102
118
|
|
|
103
119
|
|
|
104
120
|
|
|
105
|
-
|
|
106
|
-
var _chunkVACWOIREcjs = require('./chunk-VACWOIRE.cjs');
|
|
121
|
+
var _chunk4VZX5F4Tcjs = require('./chunk-4VZX5F4T.cjs');
|
|
107
122
|
require('./chunk-QBZJ7P2T.cjs');
|
|
108
123
|
|
|
109
124
|
|
|
@@ -111,18 +126,20 @@ var _chunk4IH4EL7Mcjs = require('./chunk-4IH4EL7M.cjs');
|
|
|
111
126
|
require('./chunk-A2YMUCBT.cjs');
|
|
112
127
|
|
|
113
128
|
|
|
114
|
-
var
|
|
129
|
+
var _chunkXPIOJQS2cjs = require('./chunk-XPIOJQS2.cjs');
|
|
115
130
|
|
|
116
131
|
|
|
117
132
|
|
|
118
133
|
var _chunkFCR77GYMcjs = require('./chunk-FCR77GYM.cjs');
|
|
119
134
|
require('./chunk-AEOZIDEB.cjs');
|
|
120
135
|
require('./chunk-XSVNC2UD.cjs');
|
|
121
|
-
require('./chunk-
|
|
122
|
-
require('./chunk-
|
|
123
|
-
require('./chunk-
|
|
124
|
-
require('./chunk-
|
|
125
|
-
require('./chunk-
|
|
136
|
+
require('./chunk-GDIXXKF2.cjs');
|
|
137
|
+
require('./chunk-OKMJLEXX.cjs');
|
|
138
|
+
require('./chunk-KBM2W6UY.cjs');
|
|
139
|
+
require('./chunk-RJUONLUQ.cjs');
|
|
140
|
+
require('./chunk-235MXAGX.cjs');
|
|
141
|
+
require('./chunk-HVBBDBS3.cjs');
|
|
142
|
+
require('./chunk-NKVZ6Z3Y.cjs');
|
|
126
143
|
require('./chunk-NZYN7C3P.cjs');
|
|
127
144
|
require('./chunk-JMJBSACD.cjs');
|
|
128
145
|
require('./chunk-GMMT7RVN.cjs');
|
|
@@ -204,4 +221,14 @@ require('./chunk-UNEFIWXI.cjs');
|
|
|
204
221
|
|
|
205
222
|
|
|
206
223
|
|
|
207
|
-
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
exports.AUDIT_REDACTED = _chunkFCR77GYMcjs.AUDIT_REDACTED; exports.BoundAccountSelectionError = _chunk25GXJCEZcjs.BoundAccountSelectionError; exports.ConcurrencyQueueFullError = _chunk4BB343BIcjs.ConcurrencyQueueFullError; exports.ConcurrencyWaitCancelledError = _chunk4BB343BIcjs.ConcurrencyWaitCancelledError; exports.ConcurrencyWaitTimeoutError = _chunk4BB343BIcjs.ConcurrencyWaitTimeoutError; exports.DEFAULT_ACCOUNT_PROBE = _chunk4BB343BIcjs.DEFAULT_ACCOUNT_PROBE; exports.DEFAULT_ALLOWANCE_SCHEDULING = _chunk4BB343BIcjs.DEFAULT_ALLOWANCE_SCHEDULING; exports.DEFAULT_CONCURRENCY_QUEUE = _chunk4BB343BIcjs.DEFAULT_CONCURRENCY_QUEUE; exports.DEFAULT_FINGERPRINT = _chunk4BB343BIcjs.DEFAULT_FINGERPRINT; exports.DEFAULT_OUTBOUND_PORT = _chunk4BB343BIcjs.DEFAULT_OUTBOUND_PORT; exports.DEFAULT_USER_MESSAGE_QUEUE = _chunk4BB343BIcjs.DEFAULT_USER_MESSAGE_QUEUE; exports.ENDPOINT_MODEL_KINDS = _chunk4IH4EL7Mcjs.ENDPOINT_MODEL_KINDS; exports.KeySpendTracker = _chunk4BB343BIcjs.KeySpendTracker; exports.KeyedMutex = _chunk4BB343BIcjs.KeyedMutex; exports.OUTBOUND_API_SERVER_CONFIG_KEY = _chunk4BB343BIcjs.OUTBOUND_API_SERVER_CONFIG_KEY; exports.OutboundApiServer = _chunk4BB343BIcjs.OutboundApiServer; exports.OutboundConcurrencyGate = _chunk4BB343BIcjs.OutboundConcurrencyGate; exports.OutboundRateLimiter = _chunk4BB343BIcjs.OutboundRateLimiter; exports.SUBSCRIPTION_PROVIDER_IDS = _chunk4VZX5F4Tcjs.SUBSCRIPTION_PROVIDER_IDS; exports.SerialQueueTimeoutError = _chunk4BB343BIcjs.SerialQueueTimeoutError; exports.UserMessageSerialQueue = _chunk4BB343BIcjs.UserMessageSerialQueue; exports.__resetOutboundApiServerForTests = _chunk4BB343BIcjs.__resetOutboundApiServerForTests; exports.beginAuditCapture = _chunkXPIOJQS2cjs.beginAuditCapture; exports.beginBillingCapture = _chunkAPYG5QD7cjs.beginBillingCapture; exports.boundAccountSelectionMessage = _chunk25GXJCEZcjs.boundAccountSelectionMessage; exports.candidateBackgroundModelIds = _chunk4BB343BIcjs.candidateBackgroundModelIds; exports.candidateGatewayBindings = _chunk4BB343BIcjs.candidateGatewayBindings; exports.checkKeyQuota = _chunk4BB343BIcjs.checkKeyQuota; exports.classifyModelPrefix = _chunk4VZX5F4Tcjs.classifyModelPrefix; exports.computeKeyExpiry = _chunk4BB343BIcjs.computeKeyExpiry; exports.computeVoucherGrant = _chunk4BB343BIcjs.computeVoucherGrant; exports.createIntegrationKey = _chunk4BB343BIcjs.createIntegrationKey; exports.createNamedKey = _chunk4BB343BIcjs.createNamedKey; exports.defaultServerConfig = _chunk4BB343BIcjs.defaultServerConfig; exports.detectModelKind = _chunk4VZX5F4Tcjs.detectModelKind; exports.detectRequestRole = _chunk4VZX5F4Tcjs.detectRequestRole; exports.endpointSupportsSubscription = _chunk4VZX5F4Tcjs.endpointSupportsSubscription; exports.endpointToIngressFormat = _chunk4VZX5F4Tcjs.endpointToIngressFormat; exports.formatUrls = _chunk4BB343BIcjs.formatUrls; exports.gatewayBindingToEndpointConfig = _chunk4BB343BIcjs.gatewayBindingToEndpointConfig; exports.generateVoucherCode = _chunk4BB343BIcjs.generateVoucherCode; exports.getOutboundApiServer = _chunk4BB343BIcjs.getOutboundApiServer; exports.handleVoucherRedeem = _chunk4BB343BIcjs.handleVoucherRedeem; exports.hashKey = _chunk4BB343BIcjs.hashKey; exports.hashVoucherCode = _chunk4BB343BIcjs.hashVoucherCode; exports.isBoundAccountSelectionError = _chunk25GXJCEZcjs.isBoundAccountSelectionError; exports.isConcurrencyRejection = _chunk4BB343BIcjs.isConcurrencyRejection; exports.isKindMappedEndpoint = _chunk4VZX5F4Tcjs.isKindMappedEndpoint; exports.isRedeemRequest = _chunk4BB343BIcjs.isRedeemRequest; exports.isSerialQueueTimeout = _chunk4BB343BIcjs.isSerialQueueTimeout; exports.isSubscriptionProviderId = _chunk4VZX5F4Tcjs.isSubscriptionProviderId; exports.isUserMessageRequest = _chunk4BB343BIcjs.isUserMessageRequest; exports.legacyEndpointsToBindings = _chunk4BB343BIcjs.legacyEndpointsToBindings; exports.loadServerConfig = _chunk4BB343BIcjs.loadServerConfig; exports.mergeServerConfig = _chunk4BB343BIcjs.mergeServerConfig; exports.modelKindsForEndpoint = _chunk4VZX5F4Tcjs.modelKindsForEndpoint; exports.newVoucherId = _chunk4BB343BIcjs.newVoucherId; exports.normalizeAccountProbe = _chunk4BB343BIcjs.normalizeAccountProbe; exports.normalizeAllowanceScheduling = _chunk4BB343BIcjs.normalizeAllowanceScheduling; exports.normalizeAudit = _chunk4BB343BIcjs.normalizeAudit; exports.normalizeBilling = _chunk4BB343BIcjs.normalizeBilling; exports.normalizeFingerprint = _chunk4BB343BIcjs.normalizeFingerprint; exports.normalizeGatewayBindings = _chunk4BB343BIcjs.normalizeGatewayBindings; exports.normalizePrefixTargets = _chunk4BB343BIcjs.normalizePrefixTargets; exports.normalizeProxyConfig = _chunk4BB343BIcjs.normalizeProxyConfig; exports.normalizeProxySegment = _chunk4BB343BIcjs.normalizeProxySegment; exports.normalizeQueueSegments = _chunk4BB343BIcjs.normalizeQueueSegments; exports.normalizeServerConfig = _chunk4BB343BIcjs.normalizeServerConfig; exports.normalizeVoucher = _chunk4BB343BIcjs.normalizeVoucher; exports.normalizeWebhookDestination = _chunk4BB343BIcjs.normalizeWebhookDestination; exports.normalizeWebhookSegment = _chunk4BB343BIcjs.normalizeWebhookSegment; exports.parseModelRef = _chunk4VZX5F4Tcjs.parseModelRef; exports.pickModelRefFromList = _chunk4VZX5F4Tcjs.pickModelRefFromList; exports.randomBase62 = _chunk4BB343BIcjs.randomBase62; exports.redactAuditText = _chunkFCR77GYMcjs.redactAuditText; exports.resolveGatewayBinding = _chunk4BB343BIcjs.resolveGatewayBinding; exports.resolvePrefixTarget = _chunk4VZX5F4Tcjs.resolvePrefixTarget; exports.resolveRoute = _chunk4VZX5F4Tcjs.resolveRoute; exports.saveServerConfig = _chunk4BB343BIcjs.saveServerConfig; exports.startOfLocalDay = _chunk4BB343BIcjs.startOfLocalDay; exports.startOfLocalWeek = _chunk4BB343BIcjs.startOfLocalWeek; exports.toVoucherInfo = _chunk4BB343BIcjs.toVoucherInfo; exports.validateEndpointModelConfig = _chunk4VZX5F4Tcjs.validateEndpointModelConfig; exports.verifyKey = _chunk4BB343BIcjs.verifyKey; exports.verifyPresentedKey = _chunk4BB343BIcjs.verifyPresentedKey; exports.voucherCodePrefix = _chunk4BB343BIcjs.voucherCodePrefix;
|
package/dist/outbound-api.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VoucherConfig } from '@omnicross/contracts/voucher-types';
|
|
2
|
-
import {
|
|
3
|
-
export { C as ChatDispatchMode, E as ENDPOINT_MODEL_KINDS, K as KeySpendReader,
|
|
2
|
+
import { c as EndpointRoutingConfig, G as GatewayBinding, U as UserMessageQueueConfig, b as ConcurrencyQueueConfig, n as OutboundApiDeps, r as OutboundApiServerStatus, t as OutboundFormatUrls, A as AccountProbeConfig, a as AllowanceSchedulingConfig, F as FingerprintConfig, q as OutboundApiServerConfig, m as ModelPrefixTargets, x as OutboundProxyConfig, s as OutboundEndpoint, R as RequestRole, Q as ModelRef, k as KindMappedEndpoint, l as ModelKind, O as OutboundKeyDb, o as OutboundApiKeyCreated } from './types-gjJ5lJ5n.cjs';
|
|
3
|
+
export { C as ChatDispatchMode, E as ENDPOINT_MODEL_KINDS, d as GatewayBindingFallback, e as GatewayBindingKeyScope, f as GatewayBindingModelMode, g as GatewayBindingTarget, h as GatewayModelMapping, K as KeySpendReader, i as KeySpendSeeder, j as KeySpendTracker, M as MessagesModelKind, p as OutboundApiKeyInfo, u as OutboundKeyActivationMode, v as OutboundKeyDbRow, w as OutboundKeyPolicy, y as ResponsesModelKind, V as VoucherCreateInput, z as VoucherDb, B as computeVoucherGrant, D as generateVoucherCode, H as hashVoucherCode, I as newVoucherId, J as startOfLocalDay, L as startOfLocalWeek, N as toVoucherInfo, P as voucherCodePrefix } from './types-gjJ5lJ5n.cjs';
|
|
4
4
|
import { ProxyConfig } from '@omnicross/contracts/account-tokens-types';
|
|
5
5
|
import { AuditConfig } from '@omnicross/contracts/audit-types';
|
|
6
6
|
import { BillingConfig } from '@omnicross/contracts/billing-types';
|
|
@@ -8,11 +8,12 @@ import { WebhookDestination, WebhookConfig } from '@omnicross/contracts/webhook-
|
|
|
8
8
|
export { AUDIT_REDACTED, redactAuditText } from './outbound-api/auditRedact.cjs';
|
|
9
9
|
export { AuditCaptureContext, beginAuditCapture } from './outbound-api/auditCapture.cjs';
|
|
10
10
|
export { BillingCaptureContext, beginBillingCapture } from './outbound-api/billingCapture.cjs';
|
|
11
|
-
import { K as KeyCostLimits, M as ModelRestriction } from './keyPolicy-
|
|
12
|
-
export { a as KeyExpiryInput, b as KeyExpiryResult, c as KeySpend, Q as QuotaDecision, d as checkKeyQuota, e as computeKeyExpiry } from './keyPolicy-
|
|
11
|
+
import { K as KeyCostLimits, M as ModelRestriction } from './keyPolicy-zdWTu3CQ.cjs';
|
|
12
|
+
export { a as KeyExpiryInput, b as KeyExpiryResult, c as KeySpend, Q as QuotaDecision, d as checkKeyQuota, e as computeKeyExpiry } from './keyPolicy-zdWTu3CQ.cjs';
|
|
13
13
|
import http from 'node:http';
|
|
14
14
|
import { IngressFormat } from './provider-proxy/types.cjs';
|
|
15
|
-
export { S as SUBSCRIPTION_PROVIDER_IDS, e as endpointSupportsSubscription, i as isSubscriptionProviderId, p as parseModelRef, a as pickModelRefFromList, r as resolveRoute } from './routeResolver-
|
|
15
|
+
export { S as SUBSCRIPTION_PROVIDER_IDS, e as endpointSupportsSubscription, i as isSubscriptionProviderId, p as parseModelRef, a as pickModelRefFromList, r as resolveRoute } from './routeResolver-D5OzD0iM.cjs';
|
|
16
|
+
export { BoundAccountFallbackPolicy, BoundAccountSelectionError, BoundAccountSelectionFailureReason, boundAccountSelectionMessage, isBoundAccountSelectionError } from './pipeline/BoundAccountSelectionError.cjs';
|
|
16
17
|
import '@omnicross/contracts/health-logging-types';
|
|
17
18
|
import './logger-4GvQNzhE.cjs';
|
|
18
19
|
import './ports/provider-config-source.cjs';
|
|
@@ -21,6 +22,7 @@ import './transformer/types.cjs';
|
|
|
21
22
|
import './transformer/TransformerService.cjs';
|
|
22
23
|
import './ProviderProxy-CnMQYN59.cjs';
|
|
23
24
|
import '@omnicross/contracts/completion-types';
|
|
25
|
+
import '@omnicross/contracts/usage-stats-types';
|
|
24
26
|
import '@omnicross/contracts/subscription-types';
|
|
25
27
|
import '@omnicross/contracts/usage-types';
|
|
26
28
|
import './completion/ApiKeyPoolService.cjs';
|
|
@@ -30,70 +32,6 @@ import './pipeline/SubscriptionAuthStrategy.cjs';
|
|
|
30
32
|
import './ports/web-search-backend.cjs';
|
|
31
33
|
import '@omnicross/contracts/websearch-types';
|
|
32
34
|
|
|
33
|
-
/**
|
|
34
|
-
* kindDetection — classify an outbound request's model KIND for the kind-mapped
|
|
35
|
-
* endpoints (`messages`/`responses`) and validate their config completeness
|
|
36
|
-
* (`outbound-api-server`, model-kind-mapping contract).
|
|
37
|
-
*
|
|
38
|
-
* The kind-mapped endpoints route by a version-INDEPENDENT model KIND rather
|
|
39
|
-
* than by role: the user configures one upstream ref per kind
|
|
40
|
-
* ({@link ENDPOINT_MODEL_KINDS}) and an incoming versioned client id
|
|
41
|
-
* (`claude-opus-4-8-2026xxxx`) is classified to its kind (`opus`) so CLI
|
|
42
|
-
* upgrades need no reconfig. `chat`/`gemini` stay on `roleDetection`.
|
|
43
|
-
*
|
|
44
|
-
* Pure module — no I/O. The router decides, per endpoint, whether to call
|
|
45
|
-
* `detectModelKind` (messages/responses) or `detectRequestRole` (chat/gemini);
|
|
46
|
-
* the routing RESOLUTION and the startup-gate ENFORCEMENT live downstream.
|
|
47
|
-
*
|
|
48
|
-
* @module outbound-api/kindDetection
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Narrow an endpoint to the kind-mapped set (`messages`/`responses`). `chat`
|
|
53
|
-
* and `gemini` are role-based and return false.
|
|
54
|
-
*/
|
|
55
|
-
declare function isKindMappedEndpoint(endpoint: OutboundEndpoint): endpoint is KindMappedEndpoint;
|
|
56
|
-
/** The canonical kinds for a kind-mapped endpoint (in declaration order). */
|
|
57
|
-
declare function modelKindsForEndpoint(endpoint: KindMappedEndpoint): readonly ModelKind[];
|
|
58
|
-
/**
|
|
59
|
-
* Extract the version-INDEPENDENT model KIND for a kind-mapped endpoint.
|
|
60
|
-
* - `messages`: the FIRST id token that is one of {fable,opus,sonnet,haiku};
|
|
61
|
-
* `undefined` when no token matches (the unmatched-kind fallback is SERVING's
|
|
62
|
-
* decision, not core's).
|
|
63
|
-
* - `responses`: `mini` when {@link isBackgroundTierModel}; else `codex`
|
|
64
|
-
* (codex is the else-branch — a present id always resolves).
|
|
65
|
-
* - Any empty/blank id ⇒ `undefined`.
|
|
66
|
-
*
|
|
67
|
-
* Reuses `normalizeModelId` + the shared `/[-._:/\s]+/` tokenizer
|
|
68
|
-
* (`modelTokens`) + the small-tier token set (`isBackgroundTierModel`) so the
|
|
69
|
-
* kind and role detectors stay token-boundary-consistent.
|
|
70
|
-
*/
|
|
71
|
-
declare function detectModelKind(endpoint: KindMappedEndpoint, requestedModelId: string | undefined): ModelKind | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* The kinds THIS endpoint declares but leaves unconfigured (blank/absent ref).
|
|
74
|
-
* Role-based endpoints (`chat`/`gemini`) have no declared kinds → `[]`.
|
|
75
|
-
* Absent and blank refs are treated identically; a malformed-but-non-blank ref
|
|
76
|
-
* is a serving-time concern, not a startup-gate one.
|
|
77
|
-
*/
|
|
78
|
-
declare function validateEndpointModelConfig(config: EndpointRoutingConfig): ModelKind[];
|
|
79
|
-
/** One incomplete kind-mapped endpoint and the kinds it is missing. */
|
|
80
|
-
interface EndpointModelConfigError {
|
|
81
|
-
endpoint: KindMappedEndpoint;
|
|
82
|
-
missingKinds: ModelKind[];
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Server-level completeness, PER-ENDPOINT: a kind-mapped endpoint whose
|
|
86
|
-
* declared kinds are ALL blank/absent counts as UNCONFIGURED — the operator
|
|
87
|
-
* simply doesn't use that endpoint, so it does NOT block startup (its requests
|
|
88
|
-
* 503 per-request instead). Only a PARTIALLY configured endpoint (some kinds
|
|
89
|
-
* set, some blank — a real config mistake that would silently misroute) is
|
|
90
|
-
* returned as an error. Empty result ⇒ the config satisfies the startup gate.
|
|
91
|
-
*
|
|
92
|
-
* Serving consumes this for the gate ENFORCEMENT; it MAY tighten to an
|
|
93
|
-
* all-endpoints-strict policy by composing {@link validateEndpointModelConfig}.
|
|
94
|
-
*/
|
|
95
|
-
declare function validateServerModelConfig(config: OutboundApiServerConfig): EndpointModelConfigError[];
|
|
96
|
-
|
|
97
35
|
/**
|
|
98
36
|
* OutboundApiServer — the external-facing HTTP listener for the outbound API
|
|
99
37
|
* server (`outbound-api-server`, design D1/D4/D5).
|
|
@@ -125,6 +63,8 @@ interface ApplyConfigInput {
|
|
|
125
63
|
enabled: boolean;
|
|
126
64
|
networkBinding: boolean;
|
|
127
65
|
endpoints: EndpointRoutingConfig[];
|
|
66
|
+
/** Independent resource bindings; absent preserves legacy endpoint routing. */
|
|
67
|
+
bindings?: GatewayBinding[];
|
|
128
68
|
port?: number;
|
|
129
69
|
/** User-message serial-queue segment (normalized/defaulted by core). */
|
|
130
70
|
userMessageQueue?: UserMessageQueueConfig;
|
|
@@ -134,17 +74,6 @@ interface ApplyConfigInput {
|
|
|
134
74
|
* disabled ⇒ the `/redeem` endpoint is inert (zero regression). */
|
|
135
75
|
voucher?: VoucherConfig;
|
|
136
76
|
}
|
|
137
|
-
/**
|
|
138
|
-
* Thrown by {@link OutboundApiServer.applyConfig} when an ENABLED server is asked
|
|
139
|
-
* to bind with an INCOMPLETE model-kind map (the "未配置 → 无法启动接口服务" gate,
|
|
140
|
-
* design D6). Carries the per-endpoint missing kinds so the daemon/UI can render
|
|
141
|
-
* an actionable message; the server does NOT bind. Exported from the barrel so
|
|
142
|
-
* the daemon (surface) can `instanceof`-narrow it.
|
|
143
|
-
*/
|
|
144
|
-
declare class OutboundApiConfigError extends Error {
|
|
145
|
-
readonly missing: EndpointModelConfigError[];
|
|
146
|
-
constructor(missing: EndpointModelConfigError[]);
|
|
147
|
-
}
|
|
148
77
|
declare class OutboundApiServer {
|
|
149
78
|
private readonly deps;
|
|
150
79
|
/** Called when the actual bound port differs from the requested one. */
|
|
@@ -153,6 +82,7 @@ declare class OutboundApiServer {
|
|
|
153
82
|
private boundPort;
|
|
154
83
|
private boundAddr;
|
|
155
84
|
private endpoints;
|
|
85
|
+
private bindings;
|
|
156
86
|
private userMessageQueue;
|
|
157
87
|
private concurrencyQueue;
|
|
158
88
|
private voucherConfig;
|
|
@@ -256,14 +186,19 @@ declare const DEFAULT_CONCURRENCY_QUEUE: ConcurrencyQueueConfig;
|
|
|
256
186
|
* a load-safety valve (see `AccountProbeConfig`).
|
|
257
187
|
*/
|
|
258
188
|
declare const DEFAULT_ACCOUNT_PROBE: AccountProbeConfig;
|
|
189
|
+
/** Default-off thresholds for allowance-aware account scheduling. */
|
|
190
|
+
declare const DEFAULT_ALLOWANCE_SCHEDULING: AllowanceSchedulingConfig;
|
|
191
|
+
/** Fill and clamp the optional allowance scheduling segment. */
|
|
192
|
+
declare function normalizeAllowanceScheduling(raw: Partial<OutboundApiServerConfig> | undefined | null): AllowanceSchedulingConfig;
|
|
259
193
|
/** Fill + range-CLAMP the account-probe segment to the frozen defaults. */
|
|
260
194
|
declare function normalizeAccountProbe(raw: Partial<OutboundApiServerConfig> | undefined | null): AccountProbeConfig;
|
|
261
195
|
/**
|
|
262
196
|
* Fill + range-CLAMP the request-audit segment to the frozen defaults
|
|
263
197
|
* (request-audit-log, design D2). Lenient like the other segment normalizers:
|
|
264
198
|
* `enabled`/`captureBodies`/`trustForwardedFor` coerce to booleans (default
|
|
265
|
-
* false)
|
|
266
|
-
* `[1, 365]`. Default (all-off) ⇒
|
|
199
|
+
* false). `maxBodyBytes:-1` means unlimited; other finite values clamp to
|
|
200
|
+
* `[0, 1_048_576]`. `retentionDays` clamps to `[1, 365]`. Default (all-off) ⇒
|
|
201
|
+
* no capture ⇒ zero regression.
|
|
267
202
|
*/
|
|
268
203
|
declare function normalizeAudit(raw: Partial<OutboundApiServerConfig> | undefined | null): AuditConfig;
|
|
269
204
|
/**
|
|
@@ -359,6 +294,17 @@ interface ApiServerSettingsStore {
|
|
|
359
294
|
* targets simply routes nothing until configured). Never throws.
|
|
360
295
|
*/
|
|
361
296
|
declare function normalizePrefixTargets(raw: unknown): ModelPrefixTargets | undefined;
|
|
297
|
+
/**
|
|
298
|
+
* One-time migration off the removed global endpoint fallback: every configured
|
|
299
|
+
* legacy endpoint block becomes an equivalent downstream route. Runs only when
|
|
300
|
+
* the config carries no routes yet, so a user who has since deleted their routes
|
|
301
|
+
* does not get the old ones resurrected. Idempotent by construction —
|
|
302
|
+
* {@link normalizeServerConfig} blanks the legacy blocks in the same pass, so a
|
|
303
|
+
* second run finds nothing to project.
|
|
304
|
+
*/
|
|
305
|
+
declare function legacyEndpointsToBindings(endpoints: readonly EndpointRoutingConfig[]): GatewayBinding[];
|
|
306
|
+
/** Normalize independent gateway bindings while dropping malformed entries. */
|
|
307
|
+
declare function normalizeGatewayBindings(raw: unknown): GatewayBinding[];
|
|
362
308
|
/** The default server config: disabled, loopback, four blank endpoints. */
|
|
363
309
|
declare function defaultServerConfig(): OutboundApiServerConfig;
|
|
364
310
|
/**
|
|
@@ -374,6 +320,51 @@ declare function saveServerConfig(store: ApiServerSettingsStore, config: Outboun
|
|
|
374
320
|
/** Apply a partial patch to a config, returning the merged whole. */
|
|
375
321
|
declare function mergeServerConfig(current: OutboundApiServerConfig, patch: Partial<OutboundApiServerConfig>): OutboundApiServerConfig;
|
|
376
322
|
|
|
323
|
+
/**
|
|
324
|
+
* Either the winning route projected to the resolver shape, or `none` — no
|
|
325
|
+
* enabled route for this key/endpoint could serve the request. There is no
|
|
326
|
+
* global fallback: `none` is terminal and the caller answers with a route error.
|
|
327
|
+
*/
|
|
328
|
+
type GatewayBindingResolution = {
|
|
329
|
+
source: 'binding';
|
|
330
|
+
binding: GatewayBinding;
|
|
331
|
+
config: EndpointRoutingConfig;
|
|
332
|
+
} | {
|
|
333
|
+
source: 'none';
|
|
334
|
+
};
|
|
335
|
+
interface ResolveGatewayBindingInput {
|
|
336
|
+
bindings: readonly GatewayBinding[] | undefined;
|
|
337
|
+
apiKeyId: string;
|
|
338
|
+
endpoint: OutboundEndpoint;
|
|
339
|
+
requestedModel?: string;
|
|
340
|
+
role?: RequestRole;
|
|
341
|
+
}
|
|
342
|
+
/** Project one downstream route into the legacy route-resolver shape. */
|
|
343
|
+
declare function gatewayBindingToEndpointConfig(binding: GatewayBinding, requestedModel?: string): EndpointRoutingConfig;
|
|
344
|
+
/**
|
|
345
|
+
* The enabled routes one verified key may enter on one endpoint, in resolution
|
|
346
|
+
* order. Exact key-scoped routes outrank unscoped ones (and suppress them
|
|
347
|
+
* entirely); within a tier the lower priority value wins, id breaking ties.
|
|
348
|
+
*/
|
|
349
|
+
declare function candidateGatewayBindings(bindings: readonly GatewayBinding[] | undefined, apiKeyId: string, endpoint: OutboundEndpoint): GatewayBinding[];
|
|
350
|
+
/**
|
|
351
|
+
* The background-tier model ids the role-based endpoint should recognize for
|
|
352
|
+
* this request. Role detection runs BEFORE a route is picked (the pick needs the
|
|
353
|
+
* role), so the hint is the union across every candidate route.
|
|
354
|
+
*/
|
|
355
|
+
declare function candidateBackgroundModelIds(bindings: readonly GatewayBinding[] | undefined, apiKeyId: string, endpoint: OutboundEndpoint): string[] | undefined;
|
|
356
|
+
/**
|
|
357
|
+
* Resolve the resource route for one verified client key. A route with
|
|
358
|
+
* `fallback: next` that has no model for this request yields to the next
|
|
359
|
+
* candidate, while `fail` remains selected immediately.
|
|
360
|
+
*
|
|
361
|
+
* When no candidate can serve, the FIRST candidate is still selected so route
|
|
362
|
+
* resolution produces its specific, actionable error (e.g. 404 for a model
|
|
363
|
+
* outside a chat route's list) rather than a generic one. `none` is reserved
|
|
364
|
+
* for having no candidate route at all.
|
|
365
|
+
*/
|
|
366
|
+
declare function resolveGatewayBinding(input: ResolveGatewayBindingInput): GatewayBindingResolution;
|
|
367
|
+
|
|
377
368
|
/**
|
|
378
369
|
* modelPrefixDispatch — pure model-name PREFIX classification for the `chat`
|
|
379
370
|
* endpoint's opt-in `dispatchMode: 'prefix'` (openai-chat-bridge #11, design D2).
|
|
@@ -426,8 +417,7 @@ declare function resolvePrefixTarget(targets: ModelPrefixTargets | undefined, mo
|
|
|
426
417
|
* waiter can be CANCELLED (the wire layer binds this to `res.close` so a client
|
|
427
418
|
* that disconnects mid-queue frees its spot). Release + cancel are idempotent
|
|
428
419
|
* (guarded by a per-acquisition `settled` flag) so the wire's `finally` +
|
|
429
|
-
* `res.once('close')` double-fire is safe
|
|
430
|
-
* slot leak.
|
|
420
|
+
* `res.once('close')` double-fire is safe and cannot leak a concurrency slot.
|
|
431
421
|
*
|
|
432
422
|
* Memory-only, injected clock, resets on restart. `limit <= 0` means unlimited
|
|
433
423
|
* (the wire layer bypasses the gate entirely for such keys; a defensive call
|
|
@@ -526,8 +516,7 @@ declare class OutboundConcurrencyGate {
|
|
|
526
516
|
* concurrent humans. Only human-INITIATED turns should be serialized; a
|
|
527
517
|
* tool-loop turn (the client feeding a tool result back) must NOT be throttled
|
|
528
518
|
* or it stalls the agent. This module classifies the LAST turn per ingress
|
|
529
|
-
* format
|
|
530
|
-
* covering all four omnicross ingress formats.
|
|
519
|
+
* format and covers all four Omnicross ingress formats.
|
|
531
520
|
*
|
|
532
521
|
* SAFETY BIAS: default `false` (bypass) on any shape it cannot POSITIVELY
|
|
533
522
|
* classify as a human turn. Under-serializing only costs the (opt-in, default-
|
|
@@ -623,6 +612,53 @@ declare class UserMessageSerialQueue {
|
|
|
623
612
|
reset(): void;
|
|
624
613
|
}
|
|
625
614
|
|
|
615
|
+
/**
|
|
616
|
+
* kindDetection — classify an outbound request's model KIND for the kind-mapped
|
|
617
|
+
* endpoints (`messages`/`responses`) and validate their config completeness
|
|
618
|
+
* (`outbound-api-server`, model-kind-mapping contract).
|
|
619
|
+
*
|
|
620
|
+
* The kind-mapped endpoints route by a version-INDEPENDENT model KIND rather
|
|
621
|
+
* than by role: the user configures one upstream ref per kind
|
|
622
|
+
* ({@link ENDPOINT_MODEL_KINDS}) and an incoming versioned client id
|
|
623
|
+
* (`claude-opus-4-8-2026xxxx`) is classified to its kind (`opus`) so CLI
|
|
624
|
+
* upgrades need no reconfig. `chat`/`gemini` stay on `roleDetection`.
|
|
625
|
+
*
|
|
626
|
+
* Pure module — no I/O. The router decides, per endpoint, whether to call
|
|
627
|
+
* `detectModelKind` (messages/responses) or `detectRequestRole` (chat/gemini);
|
|
628
|
+
* the routing RESOLUTION and the startup-gate ENFORCEMENT live downstream.
|
|
629
|
+
*
|
|
630
|
+
* @module outbound-api/kindDetection
|
|
631
|
+
*/
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Narrow an endpoint to the kind-mapped set (`messages`/`responses`). `chat`
|
|
635
|
+
* and `gemini` are role-based and return false.
|
|
636
|
+
*/
|
|
637
|
+
declare function isKindMappedEndpoint(endpoint: OutboundEndpoint): endpoint is KindMappedEndpoint;
|
|
638
|
+
/** The canonical kinds for a kind-mapped endpoint (in declaration order). */
|
|
639
|
+
declare function modelKindsForEndpoint(endpoint: KindMappedEndpoint): readonly ModelKind[];
|
|
640
|
+
/**
|
|
641
|
+
* Extract the version-INDEPENDENT model KIND for a kind-mapped endpoint.
|
|
642
|
+
* - `messages`: the FIRST id token that is one of {fable,opus,sonnet,haiku};
|
|
643
|
+
* `undefined` when no token matches (the unmatched-kind fallback is SERVING's
|
|
644
|
+
* decision, not core's).
|
|
645
|
+
* - `responses`: `mini` when {@link isBackgroundTierModel}; else `codex`
|
|
646
|
+
* (codex is the else-branch — a present id always resolves).
|
|
647
|
+
* - Any empty/blank id ⇒ `undefined`.
|
|
648
|
+
*
|
|
649
|
+
* Reuses `normalizeModelId` + the shared `/[-._:/\s]+/` tokenizer
|
|
650
|
+
* (`modelTokens`) + the small-tier token set (`isBackgroundTierModel`) so the
|
|
651
|
+
* kind and role detectors stay token-boundary-consistent.
|
|
652
|
+
*/
|
|
653
|
+
declare function detectModelKind(endpoint: KindMappedEndpoint, requestedModelId: string | undefined): ModelKind | undefined;
|
|
654
|
+
/**
|
|
655
|
+
* The kinds THIS endpoint declares but leaves unconfigured (blank/absent ref).
|
|
656
|
+
* Role-based endpoints (`chat`/`gemini`) have no declared kinds → `[]`.
|
|
657
|
+
* Absent and blank refs are treated identically; a malformed-but-non-blank ref
|
|
658
|
+
* is a serving-time concern, not a startup-gate one.
|
|
659
|
+
*/
|
|
660
|
+
declare function validateEndpointModelConfig(config: EndpointRoutingConfig): ModelKind[];
|
|
661
|
+
|
|
626
662
|
/**
|
|
627
663
|
* outboundApiKeyAuth — named-key generation, hashing, and verification for the
|
|
628
664
|
* outbound API server (`outbound-api-server`).
|
|
@@ -649,12 +685,20 @@ declare function hashKey(secret: string): string;
|
|
|
649
685
|
* prefix are stored.
|
|
650
686
|
*/
|
|
651
687
|
declare function createNamedKey(db: OutboundKeyDb, name: string): Promise<OutboundApiKeyCreated>;
|
|
688
|
+
/**
|
|
689
|
+
* Mint the local gateway key used by native CLI configuration adapters. Unlike
|
|
690
|
+
* a user-distributed key it is explicitly loopback-only and endpoint-scoped.
|
|
691
|
+
*/
|
|
692
|
+
declare function createIntegrationKey(db: OutboundKeyDb, name: string, allowedEndpoints?: OutboundEndpoint[]): Promise<OutboundApiKeyCreated>;
|
|
652
693
|
/**
|
|
653
694
|
* A verified key + the enforcement inputs carried from the row so the wire layer
|
|
654
695
|
* runs its policy checks WITHOUT a second DB read (mirrors `maxConcurrency`).
|
|
655
696
|
*/
|
|
656
697
|
interface VerifiedKey {
|
|
657
698
|
id: string;
|
|
699
|
+
kind?: 'client' | 'integration';
|
|
700
|
+
allowedEndpoints?: OutboundEndpoint[];
|
|
701
|
+
loopbackOnly?: boolean;
|
|
658
702
|
/**
|
|
659
703
|
* The key's per-key concurrency ceiling, carried from the row so the wire
|
|
660
704
|
* layer keys the concurrency gate without a second DB read. Absent/`0` =
|
|
@@ -875,4 +919,4 @@ declare function getOutboundApiServer(deps?: OutboundApiDeps, onPortChange?: (po
|
|
|
875
919
|
/** Reset the singleton (tests / teardown only). */
|
|
876
920
|
declare function __resetOutboundApiServerForTests(): void;
|
|
877
921
|
|
|
878
|
-
export { AccountProbeConfig, type ApiServerSettingsStore, type ApplyConfigInput, ConcurrencyQueueConfig, ConcurrencyQueueFullError, ConcurrencyWaitCancelledError, ConcurrencyWaitTimeoutError, DEFAULT_ACCOUNT_PROBE, DEFAULT_CONCURRENCY_QUEUE, DEFAULT_FINGERPRINT, DEFAULT_OUTBOUND_PORT, DEFAULT_USER_MESSAGE_QUEUE,
|
|
922
|
+
export { AccountProbeConfig, AllowanceSchedulingConfig, type ApiServerSettingsStore, type ApplyConfigInput, ConcurrencyQueueConfig, ConcurrencyQueueFullError, ConcurrencyWaitCancelledError, ConcurrencyWaitTimeoutError, DEFAULT_ACCOUNT_PROBE, DEFAULT_ALLOWANCE_SCHEDULING, DEFAULT_CONCURRENCY_QUEUE, DEFAULT_FINGERPRINT, DEFAULT_OUTBOUND_PORT, DEFAULT_USER_MESSAGE_QUEUE, EndpointRoutingConfig, FingerprintConfig, type GateAcquireOptions, type GateAcquisition, type GateSlot, type GateStatusEntry, GatewayBinding, type GatewayBindingResolution, KeyCostLimits, type KeyVerification, KeyedMutex, KindMappedEndpoint, ModelKind, type ModelPrefixKind, ModelPrefixTargets, OUTBOUND_API_SERVER_CONFIG_KEY, OutboundApiDeps, OutboundApiKeyCreated, OutboundApiServer, OutboundApiServerConfig, OutboundApiServerStatus, OutboundConcurrencyGate, OutboundEndpoint, OutboundFormatUrls, OutboundKeyDb, OutboundProxyConfig, OutboundRateLimiter, RequestRole, type ResolveGatewayBindingInput, type SerialAcquireOptions, type SerialQueueStatusEntry, SerialQueueTimeoutError, type SerialSlot, UserMessageQueueConfig, UserMessageSerialQueue, type VerifiedKey, __resetOutboundApiServerForTests, candidateBackgroundModelIds, candidateGatewayBindings, classifyModelPrefix, createIntegrationKey, createNamedKey, defaultServerConfig, detectModelKind, detectRequestRole, endpointToIngressFormat, formatUrls, gatewayBindingToEndpointConfig, getOutboundApiServer, handleVoucherRedeem, hashKey, isConcurrencyRejection, isKindMappedEndpoint, isRedeemRequest, isSerialQueueTimeout, isUserMessageRequest, legacyEndpointsToBindings, loadServerConfig, mergeServerConfig, modelKindsForEndpoint, normalizeAccountProbe, normalizeAllowanceScheduling, normalizeAudit, normalizeBilling, normalizeFingerprint, normalizeGatewayBindings, normalizePrefixTargets, normalizeProxyConfig, normalizeProxySegment, normalizeQueueSegments, normalizeServerConfig, normalizeVoucher, normalizeWebhookDestination, normalizeWebhookSegment, randomBase62, resolveGatewayBinding, resolvePrefixTarget, saveServerConfig, validateEndpointModelConfig, verifyKey, verifyPresentedKey };
|