@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.
Files changed (231) hide show
  1. package/dist/ApiConverter.cjs +2 -2
  2. package/dist/ApiConverter.js +1 -1
  3. package/dist/{CompletionService-DdWaAxq0.d.ts → CompletionService-C3BX0Ovy.d.ts} +4 -3
  4. package/dist/{CompletionService-D3a47vdU.d.cts → CompletionService-kNA17cfI.d.cts} +4 -3
  5. package/dist/auth/GeminiCodeAssistProjectResolver.cjs +8 -6
  6. package/dist/auth/GeminiCodeAssistProjectResolver.js +6 -4
  7. package/dist/{chunk-3Z5BQZFM.cjs → chunk-235MXAGX.cjs} +3 -1
  8. package/dist/{chunk-HRRYG2AX.js → chunk-23S5OPIO.js} +10 -1
  9. package/dist/chunk-25GXJCEZ.cjs +40 -0
  10. package/dist/chunk-2E42SAW3.cjs +323 -0
  11. package/dist/chunk-2JYRIADS.js +40 -0
  12. package/dist/chunk-2Z4XM3H5.cjs +44 -0
  13. package/dist/{chunk-BODMAL6G.js → chunk-32O35CIF.js} +271 -91
  14. package/dist/chunk-3SCOLIPT.cjs +63 -0
  15. package/dist/{chunk-SYQF7OIR.js → chunk-3WD4HTR2.js} +2 -0
  16. package/dist/{chunk-CGKLE6IW.cjs → chunk-4BB343BI.cjs} +1489 -520
  17. package/dist/{chunk-VACWOIRE.cjs → chunk-4VZX5F4T.cjs} +39 -15
  18. package/dist/{chunk-5ZQBEOMD.js → chunk-5NJLQ6T6.js} +46 -12
  19. package/dist/chunk-5RSZYQJH.cjs +62 -0
  20. package/dist/chunk-6QQG7YG3.cjs +153 -0
  21. package/dist/{chunk-IFXJ2BG7.js → chunk-7C7DET6S.js} +51 -6
  22. package/dist/{chunk-IK3KE3AU.js → chunk-DE2SRBFZ.js} +1 -1
  23. package/dist/{chunk-FH2P4OCD.js → chunk-E3COOKUP.js} +1240 -271
  24. package/dist/{chunk-UHGVBFU3.js → chunk-EBLFCNPY.js} +38 -14
  25. package/dist/chunk-FU7EAR73.js +62 -0
  26. package/dist/chunk-FXR6N3SR.js +323 -0
  27. package/dist/{chunk-SUEGJ75D.cjs → chunk-GDIXXKF2.cjs} +46 -12
  28. package/dist/chunk-GFIZ6LQI.js +170 -0
  29. package/dist/chunk-GL6XM527.js +61 -0
  30. package/dist/chunk-HVBBDBS3.cjs +350 -0
  31. package/dist/{chunk-46ZIFWYG.cjs → chunk-IIRPUVPH.cjs} +7 -1
  32. package/dist/chunk-J3QQ6JS5.cjs +170 -0
  33. package/dist/{chunk-JWVTXXPX.cjs → chunk-KBM2W6UY.cjs} +8 -4
  34. package/dist/chunk-LB6EBS6Y.js +69 -0
  35. package/dist/{chunk-IWQAX3CS.js → chunk-LVUCAWMK.js} +1 -1
  36. package/dist/chunk-MKF46GNZ.js +350 -0
  37. package/dist/{chunk-HYN75H6G.cjs → chunk-MUHWHQVM.cjs} +1 -1
  38. package/dist/chunk-MYYR3HZL.js +44 -0
  39. package/dist/{chunk-MFZ5437A.js → chunk-N5T4M4GU.js} +1 -1
  40. package/dist/{chunk-5ENKBSWO.js → chunk-N7OOJI5V.js} +88 -8
  41. package/dist/chunk-NKVZ6Z3Y.cjs +61 -0
  42. package/dist/chunk-OF3BECU2.cjs +69 -0
  43. package/dist/{chunk-SNYBEXLB.cjs → chunk-OJGQKHN5.cjs} +3 -1
  44. package/dist/{chunk-DDMRUL76.cjs → chunk-OKMJLEXX.cjs} +5 -5
  45. package/dist/chunk-OPRS4IQZ.js +153 -0
  46. package/dist/chunk-OTZC4TNH.cjs +79 -0
  47. package/dist/{chunk-3Q6Z6JTO.cjs → chunk-OVQBNVSV.cjs} +287 -107
  48. package/dist/{chunk-4XMYPW46.cjs → chunk-OXHNSZ53.cjs} +84 -44
  49. package/dist/{chunk-C6OV7GCC.js → chunk-PEGTIPB3.js} +52 -12
  50. package/dist/chunk-PO3XB56Z.js +79 -0
  51. package/dist/{chunk-D3TDKWRP.js → chunk-RJ5ZGNI3.js} +54 -5
  52. package/dist/{chunk-PG7PS2NN.cjs → chunk-RJUONLUQ.cjs} +59 -10
  53. package/dist/{chunk-BPKCU575.js → chunk-SOO562NM.js} +3 -1
  54. package/dist/{chunk-6QZGDLL4.js → chunk-TOVPMMHM.js} +5 -1
  55. package/dist/{chunk-K52THW2C.cjs → chunk-V4TXMEJS.cjs} +5 -5
  56. package/dist/{chunk-G2UTNSGU.js → chunk-WNKWAEUR.js} +7 -1
  57. package/dist/{chunk-UNWKG6EI.cjs → chunk-XPIOJQS2.cjs} +51 -6
  58. package/dist/chunk-XXFYLL7R.js +63 -0
  59. package/dist/{chunk-KFI44N2R.cjs → chunk-YNJNTCSQ.cjs} +10 -1
  60. package/dist/{chunk-VQY5W4YW.cjs → chunk-YWL7YZWS.cjs} +90 -10
  61. package/dist/completion/ApiKeyPoolService.cjs +12 -0
  62. package/dist/completion/ApiKeyPoolService.d.cts +6 -0
  63. package/dist/completion/ApiKeyPoolService.d.ts +6 -0
  64. package/dist/completion/ApiKeyPoolService.js +12 -0
  65. package/dist/completion/CompletionService.cjs +30 -24
  66. package/dist/completion/CompletionService.d.cts +3 -1
  67. package/dist/completion/CompletionService.d.ts +3 -1
  68. package/dist/completion/CompletionService.js +29 -23
  69. package/dist/completion.cjs +32 -26
  70. package/dist/completion.d.cts +3 -1
  71. package/dist/completion.d.ts +3 -1
  72. package/dist/completion.js +31 -25
  73. package/dist/index.cjs +56 -29
  74. package/dist/index.d.cts +8 -8
  75. package/dist/index.d.ts +8 -8
  76. package/dist/index.js +61 -34
  77. package/dist/{keyPolicy-Cp0FntZl.d.cts → keyPolicy-zdWTu3CQ.d.cts} +1 -1
  78. package/dist/{keyPolicy-Cp0FntZl.d.ts → keyPolicy-zdWTu3CQ.d.ts} +1 -1
  79. package/dist/outbound-api/auditCapture.cjs +2 -2
  80. package/dist/outbound-api/auditCapture.d.cts +3 -4
  81. package/dist/outbound-api/auditCapture.d.ts +3 -4
  82. package/dist/outbound-api/auditCapture.js +1 -1
  83. package/dist/outbound-api/quotaWarn.d.cts +1 -1
  84. package/dist/outbound-api/quotaWarn.d.ts +1 -1
  85. package/dist/outbound-api/routeResolver.cjs +2 -2
  86. package/dist/outbound-api/routeResolver.d.cts +5 -3
  87. package/dist/outbound-api/routeResolver.d.ts +5 -3
  88. package/dist/outbound-api/routeResolver.js +1 -1
  89. package/dist/outbound-api/subscriptionRegistryPort.d.cts +2 -0
  90. package/dist/outbound-api/subscriptionRegistryPort.d.ts +2 -0
  91. package/dist/outbound-api/types.d.cts +4 -2
  92. package/dist/outbound-api/types.d.ts +4 -2
  93. package/dist/outbound-api.cjs +52 -25
  94. package/dist/outbound-api.d.cts +131 -87
  95. package/dist/outbound-api.d.ts +131 -87
  96. package/dist/outbound-api.js +55 -28
  97. package/dist/pipeline/AccountAllowanceScheduling.cjs +15 -0
  98. package/dist/pipeline/AccountAllowanceScheduling.d.cts +91 -0
  99. package/dist/pipeline/AccountAllowanceScheduling.d.ts +91 -0
  100. package/dist/pipeline/AccountAllowanceScheduling.js +15 -0
  101. package/dist/pipeline/AccountAllowanceStore.cjs +20 -0
  102. package/dist/pipeline/AccountAllowanceStore.d.cts +77 -0
  103. package/dist/pipeline/AccountAllowanceStore.d.ts +77 -0
  104. package/dist/pipeline/AccountAllowanceStore.js +20 -0
  105. package/dist/pipeline/AccountRouteActivity.cjs +10 -0
  106. package/dist/pipeline/AccountRouteActivity.d.cts +61 -0
  107. package/dist/pipeline/AccountRouteActivity.d.ts +61 -0
  108. package/dist/pipeline/AccountRouteActivity.js +10 -0
  109. package/dist/pipeline/AuthSource.d.cts +11 -2
  110. package/dist/pipeline/AuthSource.d.ts +11 -2
  111. package/dist/pipeline/BoundAccountSelectionError.cjs +10 -0
  112. package/dist/pipeline/BoundAccountSelectionError.d.cts +28 -0
  113. package/dist/pipeline/BoundAccountSelectionError.d.ts +28 -0
  114. package/dist/pipeline/BoundAccountSelectionError.js +10 -0
  115. package/dist/pipeline/LlmConfigProviderAuth.d.cts +1 -0
  116. package/dist/pipeline/LlmConfigProviderAuth.d.ts +1 -0
  117. package/dist/pipeline/ServerOverloadCounter.cjs +16 -0
  118. package/dist/pipeline/ServerOverloadCounter.d.cts +77 -0
  119. package/dist/pipeline/ServerOverloadCounter.d.ts +77 -0
  120. package/dist/pipeline/ServerOverloadCounter.js +16 -0
  121. package/dist/pipeline/SubscriptionAccountHealth.cjs +6 -2
  122. package/dist/pipeline/SubscriptionAccountHealth.d.cts +65 -8
  123. package/dist/pipeline/SubscriptionAccountHealth.d.ts +65 -8
  124. package/dist/pipeline/SubscriptionAccountHealth.js +5 -1
  125. package/dist/pipeline/SubscriptionAuthSource.cjs +5 -2
  126. package/dist/pipeline/SubscriptionAuthSource.d.cts +1 -0
  127. package/dist/pipeline/SubscriptionAuthSource.d.ts +1 -0
  128. package/dist/pipeline/SubscriptionAuthSource.js +4 -1
  129. package/dist/pipeline/SubscriptionAuthStrategy.d.cts +8 -3
  130. package/dist/pipeline/SubscriptionAuthStrategy.d.ts +8 -3
  131. package/dist/pipeline/executeProviderCall.cjs +2 -2
  132. package/dist/pipeline/executeProviderCall.d.cts +8 -3
  133. package/dist/pipeline/executeProviderCall.d.ts +8 -3
  134. package/dist/pipeline/executeProviderCall.js +1 -1
  135. package/dist/pipeline/resolveProviderChain.d.cts +2 -3
  136. package/dist/pipeline/resolveProviderChain.d.ts +2 -3
  137. package/dist/pipeline/resolveSubscriptionChain.d.cts +1 -0
  138. package/dist/pipeline/resolveSubscriptionChain.d.ts +1 -0
  139. package/dist/pipeline/upstreamFetch.cjs +5 -3
  140. package/dist/pipeline/upstreamFetch.d.cts +35 -6
  141. package/dist/pipeline/upstreamFetch.d.ts +35 -6
  142. package/dist/pipeline/upstreamFetch.js +4 -2
  143. package/dist/pipeline/upstreamTrace.cjs +4 -2
  144. package/dist/pipeline/upstreamTrace.d.cts +22 -8
  145. package/dist/pipeline/upstreamTrace.d.ts +22 -8
  146. package/dist/pipeline/upstreamTrace.js +3 -1
  147. package/dist/ports/pricing-store.d.cts +4 -3
  148. package/dist/ports/pricing-store.d.ts +4 -3
  149. package/dist/ports.d.cts +4 -3
  150. package/dist/ports.d.ts +4 -3
  151. package/dist/provider-proxy/ProviderProxy.cjs +30 -24
  152. package/dist/provider-proxy/ProviderProxy.d.cts +2 -0
  153. package/dist/provider-proxy/ProviderProxy.d.ts +2 -0
  154. package/dist/provider-proxy/ProviderProxy.js +29 -23
  155. package/dist/provider-proxy/identity/codexCliHeaders.cjs +10 -0
  156. package/dist/provider-proxy/identity/codexCliHeaders.d.cts +45 -0
  157. package/dist/provider-proxy/identity/codexCliHeaders.d.ts +45 -0
  158. package/dist/provider-proxy/identity/codexCliHeaders.js +10 -0
  159. package/dist/provider-proxy/ingress/providerProxyShared.cjs +32 -24
  160. package/dist/provider-proxy/ingress/providerProxyShared.d.cts +44 -5
  161. package/dist/provider-proxy/ingress/providerProxyShared.d.ts +44 -5
  162. package/dist/provider-proxy/ingress/providerProxyShared.js +31 -23
  163. package/dist/provider-proxy/matchText.cjs +4 -2
  164. package/dist/provider-proxy/matchText.d.cts +39 -6
  165. package/dist/provider-proxy/matchText.d.ts +39 -6
  166. package/dist/provider-proxy/matchText.js +3 -1
  167. package/dist/provider-proxy/types.d.cts +35 -2
  168. package/dist/provider-proxy/types.d.ts +35 -2
  169. package/dist/provider-proxy.cjs +30 -24
  170. package/dist/provider-proxy.d.cts +2 -0
  171. package/dist/provider-proxy.d.ts +2 -0
  172. package/dist/provider-proxy.js +29 -23
  173. package/dist/{routeResolver-C4T7yClx.d.ts → routeResolver-BxOfunbm.d.ts} +1 -1
  174. package/dist/{routeResolver-CB3tvJKy.d.cts → routeResolver-D5OzD0iM.d.cts} +1 -1
  175. package/dist/transformer/TransformerChainExecutor.cjs +2 -2
  176. package/dist/transformer/TransformerChainExecutor.js +1 -1
  177. package/dist/transformer/transformers/AnthropicTransformer.cjs +3 -2
  178. package/dist/transformer/transformers/AnthropicTransformer.js +2 -1
  179. package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +3 -3
  180. package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +2 -2
  181. package/dist/transformer/transformers/GeminiTransformer.cjs +3 -3
  182. package/dist/transformer/transformers/GeminiTransformer.js +2 -2
  183. package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -2
  184. package/dist/transformer/transformers/OpenAIResponseTransformer.d.cts +1 -1
  185. package/dist/transformer/transformers/OpenAIResponseTransformer.d.ts +1 -1
  186. package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -1
  187. package/dist/transformer/transformers/OpenAITransformer.cjs +6 -0
  188. package/dist/transformer/transformers/OpenAITransformer.d.cts +68 -0
  189. package/dist/transformer/transformers/OpenAITransformer.d.ts +68 -0
  190. package/dist/transformer/transformers/OpenAITransformer.js +6 -0
  191. package/dist/transformer/transformers.cjs +9 -14
  192. package/dist/transformer/transformers.d.cts +12 -48
  193. package/dist/transformer/transformers.d.ts +12 -48
  194. package/dist/transformer/transformers.js +11 -16
  195. package/dist/transformer/types.d.cts +17 -0
  196. package/dist/transformer/types.d.ts +17 -0
  197. package/dist/transformer.cjs +12 -12
  198. package/dist/transformer.d.cts +1 -2
  199. package/dist/transformer.d.ts +1 -2
  200. package/dist/transformer.js +12 -12
  201. package/dist/{types-lgPYQuZS.d.ts → types-CqZD77rS.d.ts} +173 -7
  202. package/dist/{types-B8Arpxn0.d.cts → types-gjJ5lJ5n.d.cts} +173 -7
  203. package/dist/usage/pricing-engine.cjs +2 -2
  204. package/dist/usage/pricing-engine.d.cts +29 -1
  205. package/dist/usage/pricing-engine.d.ts +29 -1
  206. package/dist/usage/pricing-engine.js +1 -1
  207. package/dist/usage/usage-recorder.cjs +2 -2
  208. package/dist/usage/usage-recorder.d.cts +5 -1
  209. package/dist/usage/usage-recorder.d.ts +5 -1
  210. package/dist/usage/usage-recorder.js +1 -1
  211. package/dist/usage.cjs +3 -3
  212. package/dist/usage.js +2 -2
  213. package/package.json +1 -1
  214. package/dist/chunk-7FEBOPJO.cjs +0 -50
  215. package/dist/chunk-DWKQZ2SK.cjs +0 -254
  216. package/dist/chunk-IAXWICZU.js +0 -69
  217. package/dist/chunk-IB3FDI4O.js +0 -50
  218. package/dist/chunk-OQWKZCXP.js +0 -242
  219. package/dist/chunk-QWBWGODS.cjs +0 -69
  220. package/dist/chunk-YMFAJFQT.cjs +0 -173
  221. package/dist/chunk-ZCIQ3L3R.cjs +0 -242
  222. package/dist/chunk-ZJZAOKI7.js +0 -254
  223. package/dist/chunk-ZLX3KGXX.js +0 -173
  224. package/dist/transformer/transformers/OpenCodeGoTransformer.cjs +0 -6
  225. package/dist/transformer/transformers/OpenCodeGoTransformer.d.cts +0 -51
  226. package/dist/transformer/transformers/OpenCodeGoTransformer.d.ts +0 -51
  227. package/dist/transformer/transformers/OpenCodeGoTransformer.js +0 -6
  228. package/dist/transformer/transformers/ReasoningTransformer.cjs +0 -6
  229. package/dist/transformer/transformers/ReasoningTransformer.d.cts +0 -47
  230. package/dist/transformer/transformers/ReasoningTransformer.d.ts +0 -47
  231. package/dist/transformer/transformers/ReasoningTransformer.js +0 -6
@@ -1,6 +1,6 @@
1
1
  import { VoucherConfig } from '@omnicross/contracts/voucher-types';
2
- import { e as KindMappedEndpoint, f as ModelKind, m as OutboundEndpoint, b as EndpointRoutingConfig, k as OutboundApiServerConfig, U as UserMessageQueueConfig, a as ConcurrencyQueueConfig, h as OutboundApiDeps, l as OutboundApiServerStatus, n as OutboundFormatUrls, A as AccountProbeConfig, F as FingerprintConfig, g as ModelPrefixTargets, r as OutboundProxyConfig, G as ModelRef, O as OutboundKeyDb, i as OutboundApiKeyCreated, R as RequestRole } from './types-lgPYQuZS.js';
3
- export { C as ChatDispatchMode, E as ENDPOINT_MODEL_KINDS, K as KeySpendReader, c as KeySpendSeeder, d as KeySpendTracker, M as MessagesModelKind, j as OutboundApiKeyInfo, o as OutboundKeyActivationMode, p as OutboundKeyDbRow, q as OutboundKeyPolicy, s as ResponsesModelKind, V as VoucherCreateInput, t as VoucherDb, u as computeVoucherGrant, v as generateVoucherCode, w as hashVoucherCode, x as newVoucherId, y as startOfLocalDay, z as startOfLocalWeek, B as toVoucherInfo, D as voucherCodePrefix } from './types-lgPYQuZS.js';
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-CqZD77rS.js';
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-CqZD77rS.js';
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.js';
9
9
  export { AuditCaptureContext, beginAuditCapture } from './outbound-api/auditCapture.js';
10
10
  export { BillingCaptureContext, beginBillingCapture } from './outbound-api/billingCapture.js';
11
- import { K as KeyCostLimits, M as ModelRestriction } from './keyPolicy-Cp0FntZl.js';
12
- export { a as KeyExpiryInput, b as KeyExpiryResult, c as KeySpend, Q as QuotaDecision, d as checkKeyQuota, e as computeKeyExpiry } from './keyPolicy-Cp0FntZl.js';
11
+ import { K as KeyCostLimits, M as ModelRestriction } from './keyPolicy-zdWTu3CQ.js';
12
+ export { a as KeyExpiryInput, b as KeyExpiryResult, c as KeySpend, Q as QuotaDecision, d as checkKeyQuota, e as computeKeyExpiry } from './keyPolicy-zdWTu3CQ.js';
13
13
  import http from 'node:http';
14
14
  import { IngressFormat } from './provider-proxy/types.js';
15
- export { S as SUBSCRIPTION_PROVIDER_IDS, e as endpointSupportsSubscription, i as isSubscriptionProviderId, p as parseModelRef, a as pickModelRefFromList, r as resolveRoute } from './routeResolver-C4T7yClx.js';
15
+ export { S as SUBSCRIPTION_PROVIDER_IDS, e as endpointSupportsSubscription, i as isSubscriptionProviderId, p as parseModelRef, a as pickModelRefFromList, r as resolveRoute } from './routeResolver-BxOfunbm.js';
16
+ export { BoundAccountFallbackPolicy, BoundAccountSelectionError, BoundAccountSelectionFailureReason, boundAccountSelectionMessage, isBoundAccountSelectionError } from './pipeline/BoundAccountSelectionError.js';
16
17
  import '@omnicross/contracts/health-logging-types';
17
18
  import './logger-4GvQNzhE.js';
18
19
  import './ports/provider-config-source.js';
@@ -21,6 +22,7 @@ import './transformer/types.js';
21
22
  import './transformer/TransformerService.js';
22
23
  import './ProviderProxy-C-xqrkKi.js';
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.js';
@@ -30,70 +32,6 @@ import './pipeline/SubscriptionAuthStrategy.js';
30
32
  import './ports/web-search-backend.js';
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), `maxBodyBytes` clamps to `[256, 1_048_576]`, `retentionDays` clamps to
266
- * `[1, 365]`. Default (all-off) ⇒ no capture ⇒ zero regression.
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 this directly avoids the CRS #1130
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, aligned to claude-relay-service's `isUserMessageRequest` semantics but
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, type EndpointModelConfigError, EndpointRoutingConfig, FingerprintConfig, type GateAcquireOptions, type GateAcquisition, type GateSlot, type GateStatusEntry, KeyCostLimits, type KeyVerification, KeyedMutex, KindMappedEndpoint, ModelKind, type ModelPrefixKind, ModelPrefixTargets, OUTBOUND_API_SERVER_CONFIG_KEY, OutboundApiConfigError, OutboundApiDeps, OutboundApiKeyCreated, OutboundApiServer, OutboundApiServerConfig, OutboundApiServerStatus, OutboundConcurrencyGate, OutboundEndpoint, OutboundFormatUrls, OutboundKeyDb, OutboundProxyConfig, OutboundRateLimiter, RequestRole, type SerialAcquireOptions, type SerialQueueStatusEntry, SerialQueueTimeoutError, type SerialSlot, UserMessageQueueConfig, UserMessageSerialQueue, type VerifiedKey, __resetOutboundApiServerForTests, classifyModelPrefix, createNamedKey, defaultServerConfig, detectModelKind, detectRequestRole, endpointToIngressFormat, formatUrls, getOutboundApiServer, handleVoucherRedeem, hashKey, isConcurrencyRejection, isKindMappedEndpoint, isRedeemRequest, isSerialQueueTimeout, isUserMessageRequest, loadServerConfig, mergeServerConfig, modelKindsForEndpoint, normalizeAccountProbe, normalizeAudit, normalizeBilling, normalizeFingerprint, normalizePrefixTargets, normalizeProxyConfig, normalizeProxySegment, normalizeQueueSegments, normalizeServerConfig, normalizeVoucher, normalizeWebhookDestination, normalizeWebhookSegment, randomBase62, resolvePrefixTarget, saveServerConfig, validateEndpointModelConfig, validateServerModelConfig, verifyKey, verifyPresentedKey };
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 };
@@ -3,6 +3,7 @@ import {
3
3
  ConcurrencyWaitCancelledError,
4
4
  ConcurrencyWaitTimeoutError,
5
5
  DEFAULT_ACCOUNT_PROBE,
6
+ DEFAULT_ALLOWANCE_SCHEDULING,
6
7
  DEFAULT_CONCURRENCY_QUEUE,
7
8
  DEFAULT_FINGERPRINT,
8
9
  DEFAULT_OUTBOUND_PORT,
@@ -10,19 +11,22 @@ import {
10
11
  KeySpendTracker,
11
12
  KeyedMutex,
12
13
  OUTBOUND_API_SERVER_CONFIG_KEY,
13
- OutboundApiConfigError,
14
14
  OutboundApiServer,
15
15
  OutboundConcurrencyGate,
16
16
  OutboundRateLimiter,
17
17
  SerialQueueTimeoutError,
18
18
  UserMessageSerialQueue,
19
19
  __resetOutboundApiServerForTests,
20
+ candidateBackgroundModelIds,
21
+ candidateGatewayBindings,
20
22
  checkKeyQuota,
21
23
  computeKeyExpiry,
22
24
  computeVoucherGrant,
25
+ createIntegrationKey,
23
26
  createNamedKey,
24
27
  defaultServerConfig,
25
28
  formatUrls,
29
+ gatewayBindingToEndpointConfig,
26
30
  generateVoucherCode,
27
31
  getOutboundApiServer,
28
32
  handleVoucherRedeem,
@@ -32,13 +36,16 @@ import {
32
36
  isRedeemRequest,
33
37
  isSerialQueueTimeout,
34
38
  isUserMessageRequest,
39
+ legacyEndpointsToBindings,
35
40
  loadServerConfig,
36
41
  mergeServerConfig,
37
42
  newVoucherId,
38
43
  normalizeAccountProbe,
44
+ normalizeAllowanceScheduling,
39
45
  normalizeAudit,
40
46
  normalizeBilling,
41
47
  normalizeFingerprint,
48
+ normalizeGatewayBindings,
42
49
  normalizePrefixTargets,
43
50
  normalizeProxyConfig,
44
51
  normalizeProxySegment,
@@ -48,6 +55,7 @@ import {
48
55
  normalizeWebhookDestination,
49
56
  normalizeWebhookSegment,
50
57
  randomBase62,
58
+ resolveGatewayBinding,
51
59
  saveServerConfig,
52
60
  startOfLocalDay,
53
61
  startOfLocalWeek,
@@ -55,33 +63,41 @@ import {
55
63
  verifyKey,
56
64
  verifyPresentedKey,
57
65
  voucherCodePrefix
58
- } from "./chunk-FH2P4OCD.js";
66
+ } from "./chunk-E3COOKUP.js";
59
67
  import "./chunk-VVEHS2LI.js";
60
68
  import "./chunk-46RLHI7D.js";
61
- import "./chunk-G2UTNSGU.js";
62
- import "./chunk-DK4A7DLE.js";
63
- import "./chunk-OQWKZCXP.js";
64
- import "./chunk-IB3FDI4O.js";
65
- import "./chunk-ZJZAOKI7.js";
66
- import "./chunk-C6OV7GCC.js";
67
- import "./chunk-IWQAX3CS.js";
68
- import "./chunk-BODMAL6G.js";
69
+ import "./chunk-MYYR3HZL.js";
70
+ import "./chunk-PEGTIPB3.js";
71
+ import "./chunk-LVUCAWMK.js";
72
+ import "./chunk-32O35CIF.js";
73
+ import "./chunk-FU7EAR73.js";
74
+ import "./chunk-LB6EBS6Y.js";
69
75
  import "./chunk-7VU7V2E4.js";
70
- import "./chunk-ZLX3KGXX.js";
71
- import "./chunk-BPKCU575.js";
76
+ import "./chunk-FXR6N3SR.js";
77
+ import "./chunk-SOO562NM.js";
78
+ import "./chunk-WNKWAEUR.js";
72
79
  import "./chunk-MZNPGW5Q.js";
80
+ import "./chunk-DK4A7DLE.js";
81
+ import "./chunk-XXFYLL7R.js";
73
82
  import "./chunk-XTEI64OU.js";
74
83
  import "./chunk-XX6NQJMA.js";
75
- import "./chunk-IAXWICZU.js";
84
+ import "./chunk-GFIZ6LQI.js";
76
85
  import "./chunk-OE6TDIWW.js";
77
86
  import "./chunk-DRWHTIIZ.js";
78
- import "./chunk-IK3KE3AU.js";
79
- import "./chunk-ZY6KU6P3.js";
80
87
  import "./chunk-JWC6APFQ.js";
81
88
  import "./chunk-5ERIZW3D.js";
82
- import "./chunk-5ENKBSWO.js";
83
- import "./chunk-HRRYG2AX.js";
89
+ import "./chunk-PO3XB56Z.js";
90
+ import "./chunk-N7OOJI5V.js";
91
+ import "./chunk-23S5OPIO.js";
84
92
  import "./chunk-AVYJ4YBN.js";
93
+ import "./chunk-OPRS4IQZ.js";
94
+ import {
95
+ BoundAccountSelectionError,
96
+ boundAccountSelectionMessage,
97
+ isBoundAccountSelectionError
98
+ } from "./chunk-2JYRIADS.js";
99
+ import "./chunk-DE2SRBFZ.js";
100
+ import "./chunk-ZY6KU6P3.js";
85
101
  import {
86
102
  beginBillingCapture
87
103
  } from "./chunk-WLYIIEAF.js";
@@ -101,9 +117,8 @@ import {
101
117
  pickModelRefFromList,
102
118
  resolvePrefixTarget,
103
119
  resolveRoute,
104
- validateEndpointModelConfig,
105
- validateServerModelConfig
106
- } from "./chunk-UHGVBFU3.js";
120
+ validateEndpointModelConfig
121
+ } from "./chunk-EBLFCNPY.js";
107
122
  import "./chunk-AQ5TNQB7.js";
108
123
  import {
109
124
  ENDPOINT_MODEL_KINDS
@@ -111,28 +126,32 @@ import {
111
126
  import "./chunk-H5JUT3KV.js";
112
127
  import {
113
128
  beginAuditCapture
114
- } from "./chunk-IFXJ2BG7.js";
129
+ } from "./chunk-7C7DET6S.js";
115
130
  import {
116
131
  AUDIT_REDACTED,
117
132
  redactAuditText
118
133
  } from "./chunk-K5NM7VAH.js";
119
134
  import "./chunk-WNY4WMRF.js";
120
135
  import "./chunk-OZFM4X3S.js";
121
- import "./chunk-5ZQBEOMD.js";
122
- import "./chunk-MFZ5437A.js";
123
- import "./chunk-6QZGDLL4.js";
124
- import "./chunk-D3TDKWRP.js";
125
- import "./chunk-SYQF7OIR.js";
136
+ import "./chunk-5NJLQ6T6.js";
137
+ import "./chunk-N5T4M4GU.js";
138
+ import "./chunk-TOVPMMHM.js";
139
+ import "./chunk-RJ5ZGNI3.js";
140
+ import "./chunk-3WD4HTR2.js";
141
+ import "./chunk-MKF46GNZ.js";
142
+ import "./chunk-GL6XM527.js";
126
143
  import "./chunk-CDHS2QDC.js";
127
144
  import "./chunk-Y7FO65VT.js";
128
145
  import "./chunk-FMOBD2OQ.js";
129
146
  import "./chunk-HUZZZ3JL.js";
130
147
  export {
131
148
  AUDIT_REDACTED,
149
+ BoundAccountSelectionError,
132
150
  ConcurrencyQueueFullError,
133
151
  ConcurrencyWaitCancelledError,
134
152
  ConcurrencyWaitTimeoutError,
135
153
  DEFAULT_ACCOUNT_PROBE,
154
+ DEFAULT_ALLOWANCE_SCHEDULING,
136
155
  DEFAULT_CONCURRENCY_QUEUE,
137
156
  DEFAULT_FINGERPRINT,
138
157
  DEFAULT_OUTBOUND_PORT,
@@ -141,7 +160,6 @@ export {
141
160
  KeySpendTracker,
142
161
  KeyedMutex,
143
162
  OUTBOUND_API_SERVER_CONFIG_KEY,
144
- OutboundApiConfigError,
145
163
  OutboundApiServer,
146
164
  OutboundConcurrencyGate,
147
165
  OutboundRateLimiter,
@@ -151,10 +169,14 @@ export {
151
169
  __resetOutboundApiServerForTests,
152
170
  beginAuditCapture,
153
171
  beginBillingCapture,
172
+ boundAccountSelectionMessage,
173
+ candidateBackgroundModelIds,
174
+ candidateGatewayBindings,
154
175
  checkKeyQuota,
155
176
  classifyModelPrefix,
156
177
  computeKeyExpiry,
157
178
  computeVoucherGrant,
179
+ createIntegrationKey,
158
180
  createNamedKey,
159
181
  defaultServerConfig,
160
182
  detectModelKind,
@@ -162,25 +184,30 @@ export {
162
184
  endpointSupportsSubscription,
163
185
  endpointToIngressFormat,
164
186
  formatUrls,
187
+ gatewayBindingToEndpointConfig,
165
188
  generateVoucherCode,
166
189
  getOutboundApiServer,
167
190
  handleVoucherRedeem,
168
191
  hashKey,
169
192
  hashVoucherCode,
193
+ isBoundAccountSelectionError,
170
194
  isConcurrencyRejection,
171
195
  isKindMappedEndpoint,
172
196
  isRedeemRequest,
173
197
  isSerialQueueTimeout,
174
198
  isSubscriptionProviderId,
175
199
  isUserMessageRequest,
200
+ legacyEndpointsToBindings,
176
201
  loadServerConfig,
177
202
  mergeServerConfig,
178
203
  modelKindsForEndpoint,
179
204
  newVoucherId,
180
205
  normalizeAccountProbe,
206
+ normalizeAllowanceScheduling,
181
207
  normalizeAudit,
182
208
  normalizeBilling,
183
209
  normalizeFingerprint,
210
+ normalizeGatewayBindings,
184
211
  normalizePrefixTargets,
185
212
  normalizeProxyConfig,
186
213
  normalizeProxySegment,
@@ -193,6 +220,7 @@ export {
193
220
  pickModelRefFromList,
194
221
  randomBase62,
195
222
  redactAuditText,
223
+ resolveGatewayBinding,
196
224
  resolvePrefixTarget,
197
225
  resolveRoute,
198
226
  saveServerConfig,
@@ -200,7 +228,6 @@ export {
200
228
  startOfLocalWeek,
201
229
  toVoucherInfo,
202
230
  validateEndpointModelConfig,
203
- validateServerModelConfig,
204
231
  verifyKey,
205
232
  verifyPresentedKey,
206
233
  voucherCodePrefix
@@ -0,0 +1,15 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+ var _chunk6QQG7YG3cjs = require('../chunk-6QQG7YG3.cjs');
8
+ require('../chunk-HVBBDBS3.cjs');
9
+
10
+
11
+
12
+
13
+
14
+
15
+ exports.AccountAllowanceExhaustedError = _chunk6QQG7YG3cjs.AccountAllowanceExhaustedError; exports.AccountAllowanceScheduling = _chunk6QQG7YG3cjs.AccountAllowanceScheduling; exports.__resetSharedAccountAllowanceSchedulingForTests = _chunk6QQG7YG3cjs.__resetSharedAccountAllowanceSchedulingForTests; exports.getSharedAccountAllowanceScheduling = _chunk6QQG7YG3cjs.getSharedAccountAllowanceScheduling; exports.isAccountAllowanceExhaustedError = _chunk6QQG7YG3cjs.isAccountAllowanceExhaustedError;