@omnicross/core 0.1.4 → 0.1.6

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 (204) 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 +7 -5
  6. package/dist/auth/GeminiCodeAssistProjectResolver.js +5 -3
  7. package/dist/{chunk-HRRYG2AX.js → chunk-23S5OPIO.js} +10 -1
  8. package/dist/chunk-25GXJCEZ.cjs +40 -0
  9. package/dist/chunk-2JYRIADS.js +40 -0
  10. package/dist/chunk-3Z5BQZFM.cjs +52 -0
  11. package/dist/{chunk-4VAVYUZS.cjs → chunk-4VLRHHFE.cjs} +82 -40
  12. package/dist/{chunk-VACWOIRE.cjs → chunk-4VZX5F4T.cjs} +39 -15
  13. package/dist/{chunk-FTQ7IQUC.js → chunk-6CL5HTPQ.js} +52 -10
  14. package/dist/chunk-6QQG7YG3.cjs +153 -0
  15. package/dist/{chunk-SU2GCLAC.cjs → chunk-6VUQPOV3.cjs} +359 -60
  16. package/dist/chunk-7AK7B36B.cjs +44 -0
  17. package/dist/{chunk-5ZQBEOMD.js → chunk-AT7B7SOZ.js} +25 -2
  18. package/dist/{chunk-IK3KE3AU.js → chunk-DE2SRBFZ.js} +1 -1
  19. package/dist/chunk-DLXZEZWO.cjs +285 -0
  20. package/dist/{chunk-UHGVBFU3.js → chunk-EBLFCNPY.js} +38 -14
  21. package/dist/chunk-EJLH6NFT.cjs +166 -0
  22. package/dist/chunk-HVBBDBS3.cjs +350 -0
  23. package/dist/{chunk-7Y47UCF2.js → chunk-IFXJ2BG7.js} +5 -38
  24. package/dist/{chunk-46ZIFWYG.cjs → chunk-IIRPUVPH.cjs} +7 -1
  25. package/dist/{chunk-YGXJGRFI.cjs → chunk-KBM2W6UY.cjs} +111 -24
  26. package/dist/{chunk-OCEUVQHW.cjs → chunk-KCVJWJST.cjs} +73 -3
  27. package/dist/chunk-LB6EBS6Y.js +69 -0
  28. package/dist/{chunk-C7PSERMH.js → chunk-LVUCAWMK.js} +1 -1
  29. package/dist/chunk-MKF46GNZ.js +350 -0
  30. package/dist/{chunk-HYN75H6G.cjs → chunk-MUHWHQVM.cjs} +1 -1
  31. package/dist/{chunk-Z7Y2NPHY.js → chunk-N5T4M4GU.js} +1 -1
  32. package/dist/{chunk-TIER4SUC.js → chunk-OEWZUX4G.js} +346 -47
  33. package/dist/chunk-OF3BECU2.cjs +69 -0
  34. package/dist/{chunk-RSJ3TWJQ.cjs → chunk-OKMJLEXX.cjs} +5 -5
  35. package/dist/chunk-OPRS4IQZ.js +153 -0
  36. package/dist/{chunk-XK5CIRMQ.js → chunk-SIZQQD6T.js} +72 -2
  37. package/dist/{chunk-DKPXN34V.cjs → chunk-SQYVORNP.cjs} +1334 -510
  38. package/dist/chunk-SYQF7OIR.js +52 -0
  39. package/dist/{chunk-S4WBV25P.js → chunk-TOVPMMHM.js} +111 -24
  40. package/dist/{chunk-QYTT6GE3.js → chunk-UDCC7EMR.js} +1093 -269
  41. package/dist/{chunk-E3UCVHLP.cjs → chunk-UNWKG6EI.cjs} +5 -38
  42. package/dist/{chunk-ZLX3KGXX.js → chunk-UX7VWA46.js} +135 -23
  43. package/dist/{chunk-7YN22L2H.cjs → chunk-V4TXMEJS.cjs} +5 -5
  44. package/dist/chunk-VRFBB5DB.js +44 -0
  45. package/dist/chunk-WB6PH56J.js +166 -0
  46. package/dist/{chunk-G2UTNSGU.js → chunk-WNKWAEUR.js} +7 -1
  47. package/dist/{chunk-SUEGJ75D.cjs → chunk-WYTEQ4Q5.cjs} +25 -2
  48. package/dist/{chunk-5ENKBSWO.js → chunk-YJVHCHQX.js} +42 -6
  49. package/dist/{chunk-VQY5W4YW.cjs → chunk-YK57NMIF.cjs} +44 -8
  50. package/dist/{chunk-KFI44N2R.cjs → chunk-YNJNTCSQ.cjs} +10 -1
  51. package/dist/completion/ApiKeyPoolService.cjs +12 -0
  52. package/dist/completion/ApiKeyPoolService.d.cts +6 -0
  53. package/dist/completion/ApiKeyPoolService.d.ts +6 -0
  54. package/dist/completion/ApiKeyPoolService.js +12 -0
  55. package/dist/completion/CompletionService.cjs +27 -24
  56. package/dist/completion/CompletionService.d.cts +2 -1
  57. package/dist/completion/CompletionService.d.ts +2 -1
  58. package/dist/completion/CompletionService.js +26 -23
  59. package/dist/completion.cjs +27 -24
  60. package/dist/completion.d.cts +2 -1
  61. package/dist/completion.d.ts +2 -1
  62. package/dist/completion.js +26 -23
  63. package/dist/index.cjs +53 -29
  64. package/dist/index.d.cts +8 -8
  65. package/dist/index.d.ts +8 -8
  66. package/dist/index.js +56 -32
  67. package/dist/{keyPolicy-Cp0FntZl.d.cts → keyPolicy-zdWTu3CQ.d.cts} +1 -1
  68. package/dist/{keyPolicy-Cp0FntZl.d.ts → keyPolicy-zdWTu3CQ.d.ts} +1 -1
  69. package/dist/outbound-api/auditCapture.cjs +2 -2
  70. package/dist/outbound-api/auditCapture.d.cts +5 -3
  71. package/dist/outbound-api/auditCapture.d.ts +5 -3
  72. package/dist/outbound-api/auditCapture.js +1 -1
  73. package/dist/outbound-api/quotaWarn.d.cts +1 -1
  74. package/dist/outbound-api/quotaWarn.d.ts +1 -1
  75. package/dist/outbound-api/routeResolver.cjs +2 -2
  76. package/dist/outbound-api/routeResolver.d.cts +4 -3
  77. package/dist/outbound-api/routeResolver.d.ts +4 -3
  78. package/dist/outbound-api/routeResolver.js +1 -1
  79. package/dist/outbound-api/subscriptionRegistryPort.d.cts +1 -0
  80. package/dist/outbound-api/subscriptionRegistryPort.d.ts +1 -0
  81. package/dist/outbound-api/types.d.cts +3 -2
  82. package/dist/outbound-api/types.d.ts +3 -2
  83. package/dist/outbound-api.cjs +49 -25
  84. package/dist/outbound-api.d.cts +127 -85
  85. package/dist/outbound-api.d.ts +127 -85
  86. package/dist/outbound-api.js +52 -28
  87. package/dist/pipeline/AccountAllowanceScheduling.cjs +15 -0
  88. package/dist/pipeline/AccountAllowanceScheduling.d.cts +90 -0
  89. package/dist/pipeline/AccountAllowanceScheduling.d.ts +90 -0
  90. package/dist/pipeline/AccountAllowanceScheduling.js +15 -0
  91. package/dist/pipeline/AccountAllowanceStore.cjs +20 -0
  92. package/dist/pipeline/AccountAllowanceStore.d.cts +77 -0
  93. package/dist/pipeline/AccountAllowanceStore.d.ts +77 -0
  94. package/dist/pipeline/AccountAllowanceStore.js +20 -0
  95. package/dist/pipeline/AuthSource.d.cts +11 -2
  96. package/dist/pipeline/AuthSource.d.ts +11 -2
  97. package/dist/pipeline/BoundAccountSelectionError.cjs +10 -0
  98. package/dist/pipeline/BoundAccountSelectionError.d.cts +28 -0
  99. package/dist/pipeline/BoundAccountSelectionError.d.ts +28 -0
  100. package/dist/pipeline/BoundAccountSelectionError.js +10 -0
  101. package/dist/pipeline/LlmConfigProviderAuth.d.cts +1 -0
  102. package/dist/pipeline/LlmConfigProviderAuth.d.ts +1 -0
  103. package/dist/pipeline/SubscriptionAccountHealth.cjs +4 -2
  104. package/dist/pipeline/SubscriptionAccountHealth.d.cts +34 -6
  105. package/dist/pipeline/SubscriptionAccountHealth.d.ts +34 -6
  106. package/dist/pipeline/SubscriptionAccountHealth.js +3 -1
  107. package/dist/pipeline/SubscriptionAuthSource.cjs +5 -2
  108. package/dist/pipeline/SubscriptionAuthSource.d.cts +1 -0
  109. package/dist/pipeline/SubscriptionAuthSource.d.ts +1 -0
  110. package/dist/pipeline/SubscriptionAuthSource.js +4 -1
  111. package/dist/pipeline/SubscriptionAuthStrategy.d.cts +8 -3
  112. package/dist/pipeline/SubscriptionAuthStrategy.d.ts +8 -3
  113. package/dist/pipeline/executeProviderCall.cjs +2 -2
  114. package/dist/pipeline/executeProviderCall.d.cts +8 -3
  115. package/dist/pipeline/executeProviderCall.d.ts +8 -3
  116. package/dist/pipeline/executeProviderCall.js +1 -1
  117. package/dist/pipeline/resolveProviderChain.d.cts +2 -3
  118. package/dist/pipeline/resolveProviderChain.d.ts +2 -3
  119. package/dist/pipeline/resolveSubscriptionChain.d.cts +1 -0
  120. package/dist/pipeline/resolveSubscriptionChain.d.ts +1 -0
  121. package/dist/pipeline/upstreamFetch.cjs +4 -2
  122. package/dist/pipeline/upstreamFetch.d.cts +6 -0
  123. package/dist/pipeline/upstreamFetch.d.ts +6 -0
  124. package/dist/pipeline/upstreamFetch.js +3 -1
  125. package/dist/pipeline/upstreamTrace.cjs +14 -0
  126. package/dist/pipeline/upstreamTrace.d.cts +85 -0
  127. package/dist/pipeline/upstreamTrace.d.ts +85 -0
  128. package/dist/pipeline/upstreamTrace.js +14 -0
  129. package/dist/ports/pricing-store.d.cts +4 -3
  130. package/dist/ports/pricing-store.d.ts +4 -3
  131. package/dist/ports.d.cts +4 -3
  132. package/dist/ports.d.ts +4 -3
  133. package/dist/provider-proxy/ProviderProxy.cjs +27 -24
  134. package/dist/provider-proxy/ProviderProxy.d.cts +1 -0
  135. package/dist/provider-proxy/ProviderProxy.d.ts +1 -0
  136. package/dist/provider-proxy/ProviderProxy.js +26 -23
  137. package/dist/provider-proxy/ingress/providerProxyShared.cjs +31 -24
  138. package/dist/provider-proxy/ingress/providerProxyShared.d.cts +50 -5
  139. package/dist/provider-proxy/ingress/providerProxyShared.d.ts +50 -5
  140. package/dist/provider-proxy/ingress/providerProxyShared.js +30 -23
  141. package/dist/provider-proxy/matchText.cjs +4 -2
  142. package/dist/provider-proxy/matchText.d.cts +41 -6
  143. package/dist/provider-proxy/matchText.d.ts +41 -6
  144. package/dist/provider-proxy/matchText.js +3 -1
  145. package/dist/provider-proxy/types.d.cts +30 -2
  146. package/dist/provider-proxy/types.d.ts +30 -2
  147. package/dist/provider-proxy.cjs +27 -24
  148. package/dist/provider-proxy.d.cts +1 -0
  149. package/dist/provider-proxy.d.ts +1 -0
  150. package/dist/provider-proxy.js +26 -23
  151. package/dist/{routeResolver-C4T7yClx.d.ts → routeResolver-CHTv_Bs5.d.ts} +1 -1
  152. package/dist/{routeResolver-CB3tvJKy.d.cts → routeResolver-kepxnfcC.d.cts} +1 -1
  153. package/dist/transformer/TransformerChainExecutor.cjs +2 -2
  154. package/dist/transformer/TransformerChainExecutor.js +1 -1
  155. package/dist/transformer/transformers/AnthropicTransformer.cjs +2 -2
  156. package/dist/transformer/transformers/AnthropicTransformer.js +1 -1
  157. package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +3 -3
  158. package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +2 -2
  159. package/dist/transformer/transformers/GeminiTransformer.cjs +3 -3
  160. package/dist/transformer/transformers/GeminiTransformer.js +2 -2
  161. package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +2 -2
  162. package/dist/transformer/transformers/OpenAIResponseTransformer.d.cts +1 -1
  163. package/dist/transformer/transformers/OpenAIResponseTransformer.d.ts +1 -1
  164. package/dist/transformer/transformers/OpenAIResponseTransformer.js +1 -1
  165. package/dist/transformer/transformers/OpenAITransformer.cjs +6 -0
  166. package/dist/transformer/transformers/OpenAITransformer.d.cts +68 -0
  167. package/dist/transformer/transformers/OpenAITransformer.d.ts +68 -0
  168. package/dist/transformer/transformers/OpenAITransformer.js +6 -0
  169. package/dist/transformer/transformers.cjs +8 -14
  170. package/dist/transformer/transformers.d.cts +12 -48
  171. package/dist/transformer/transformers.d.ts +12 -48
  172. package/dist/transformer/transformers.js +11 -17
  173. package/dist/transformer/types.d.cts +17 -0
  174. package/dist/transformer/types.d.ts +17 -0
  175. package/dist/transformer.cjs +11 -12
  176. package/dist/transformer.d.cts +1 -2
  177. package/dist/transformer.d.ts +1 -2
  178. package/dist/transformer.js +11 -12
  179. package/dist/{types-B8Arpxn0.d.cts → types-H3wGZSOo.d.cts} +134 -7
  180. package/dist/{types-lgPYQuZS.d.ts → types-hsoKrVQS.d.ts} +134 -7
  181. package/dist/usage/pricing-engine.cjs +2 -2
  182. package/dist/usage/pricing-engine.d.cts +9 -1
  183. package/dist/usage/pricing-engine.d.ts +9 -1
  184. package/dist/usage/pricing-engine.js +1 -1
  185. package/dist/usage.cjs +2 -2
  186. package/dist/usage.js +1 -1
  187. package/package.json +1 -1
  188. package/dist/chunk-C72S6TTV.cjs +0 -49
  189. package/dist/chunk-DWKQZ2SK.cjs +0 -254
  190. package/dist/chunk-IAXWICZU.js +0 -69
  191. package/dist/chunk-QWBWGODS.cjs +0 -69
  192. package/dist/chunk-RGTR7CIO.cjs +0 -235
  193. package/dist/chunk-VPBAUQ2M.js +0 -235
  194. package/dist/chunk-YMFAJFQT.cjs +0 -173
  195. package/dist/chunk-Z7LUNECE.js +0 -49
  196. package/dist/chunk-ZJZAOKI7.js +0 -254
  197. package/dist/transformer/transformers/OpenCodeGoTransformer.cjs +0 -6
  198. package/dist/transformer/transformers/OpenCodeGoTransformer.d.cts +0 -51
  199. package/dist/transformer/transformers/OpenCodeGoTransformer.d.ts +0 -51
  200. package/dist/transformer/transformers/OpenCodeGoTransformer.js +0 -6
  201. package/dist/transformer/transformers/ReasoningTransformer.cjs +0 -6
  202. package/dist/transformer/transformers/ReasoningTransformer.d.cts +0 -47
  203. package/dist/transformer/transformers/ReasoningTransformer.d.ts +0 -47
  204. package/dist/transformer/transformers/ReasoningTransformer.js +0 -6
@@ -1,39 +1,33 @@
1
1
  import {
2
2
  BUILTIN_TRANSFORMER_NAMES,
3
3
  BuiltinTransformers,
4
- DeepseekTransformer,
5
4
  getBuiltinTransformers,
6
5
  registerBuiltinTransformers
7
- } from "../chunk-VPBAUQ2M.js";
8
- import {
9
- ReasoningTransformer
10
- } from "../chunk-ZJZAOKI7.js";
11
- import {
12
- AnthropicTransformer
13
- } from "../chunk-FTQ7IQUC.js";
6
+ } from "../chunk-VRFBB5DB.js";
14
7
  import {
15
8
  GeminiTransformer
16
- } from "../chunk-C7PSERMH.js";
9
+ } from "../chunk-LVUCAWMK.js";
17
10
  import {
18
11
  OpenAIResponseTransformer
19
- } from "../chunk-TIER4SUC.js";
12
+ } from "../chunk-OEWZUX4G.js";
20
13
  import {
21
- OpenCodeGoTransformer
22
- } from "../chunk-Z7LUNECE.js";
14
+ OpenAITransformer
15
+ } from "../chunk-LB6EBS6Y.js";
16
+ import {
17
+ AnthropicTransformer
18
+ } from "../chunk-6CL5HTPQ.js";
23
19
  import {
24
20
  GeminiCodeAssistTransformer
25
- } from "../chunk-Z7Y2NPHY.js";
26
- import "../chunk-S4WBV25P.js";
21
+ } from "../chunk-N5T4M4GU.js";
22
+ import "../chunk-TOVPMMHM.js";
27
23
  export {
28
24
  AnthropicTransformer,
29
25
  BUILTIN_TRANSFORMER_NAMES,
30
26
  BuiltinTransformers,
31
- DeepseekTransformer,
32
27
  GeminiCodeAssistTransformer,
33
28
  GeminiTransformer,
34
29
  OpenAIResponseTransformer,
35
- OpenCodeGoTransformer,
36
- ReasoningTransformer,
30
+ OpenAITransformer,
37
31
  getBuiltinTransformers,
38
32
  registerBuiltinTransformers
39
33
  };
@@ -145,6 +145,23 @@ interface UnifiedChatRequestMeta {
145
145
  engineOrigin?: 'completion' | 'claude-sdk' | 'claude-sdk-direct' | 'codex-ingress' | (string & {});
146
146
  /** The api-key-pool entry id selected for this request. */
147
147
  apiKeyId?: string | null;
148
+ /**
149
+ * codex custom-tool protocol state, recorded while DECODING a Responses
150
+ * request and read back while ENCODING the response.
151
+ *
152
+ * codex declares its tools in an `additional_tools` input item, where one of
153
+ * them (`exec`) is a `custom` tool taking FREE-FORM text rather than JSON
154
+ * arguments, and others live under a `namespace`. Neither concept exists in
155
+ * OpenAI-chat, so the decode flattens them into plain function tools and
156
+ * records here what has to be restored on the way back: which names must be
157
+ * re-encoded as `custom_tool_call` items, and which carry a namespace.
158
+ */
159
+ codexTools?: {
160
+ /** Tool names declared `type:'custom'` — re-encode as `custom_tool_call`. */
161
+ customToolNames?: string[];
162
+ /** Tool name → codex namespace, restored onto `function_call` items. */
163
+ toolNamespaces?: Record<string, string>;
164
+ };
148
165
  }
149
166
  /**
150
167
  * URL citation annotation
@@ -145,6 +145,23 @@ interface UnifiedChatRequestMeta {
145
145
  engineOrigin?: 'completion' | 'claude-sdk' | 'claude-sdk-direct' | 'codex-ingress' | (string & {});
146
146
  /** The api-key-pool entry id selected for this request. */
147
147
  apiKeyId?: string | null;
148
+ /**
149
+ * codex custom-tool protocol state, recorded while DECODING a Responses
150
+ * request and read back while ENCODING the response.
151
+ *
152
+ * codex declares its tools in an `additional_tools` input item, where one of
153
+ * them (`exec`) is a `custom` tool taking FREE-FORM text rather than JSON
154
+ * arguments, and others live under a `namespace`. Neither concept exists in
155
+ * OpenAI-chat, so the decode flattens them into plain function tools and
156
+ * records here what has to be restored on the way back: which names must be
157
+ * re-encoded as `custom_tool_call` items, and which carry a namespace.
158
+ */
159
+ codexTools?: {
160
+ /** Tool names declared `type:'custom'` — re-encode as `custom_tool_call`. */
161
+ customToolNames?: string[];
162
+ /** Tool name → codex namespace, restored onto `function_call` items. */
163
+ toolNamespaces?: Record<string, string>;
164
+ };
148
165
  }
149
166
  /**
150
167
  * URL citation annotation
@@ -1,23 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-FZ46M34D.cjs');
2
2
 
3
3
 
4
- var _chunk3OPYJG76cjs = require('./chunk-3OPYJG76.cjs');
4
+ var _chunkIIRPUVPHcjs = require('./chunk-IIRPUVPH.cjs');
5
+ require('./chunk-GBHYAGX3.cjs');
5
6
 
6
7
 
7
- var _chunkRGTR7CIOcjs = require('./chunk-RGTR7CIO.cjs');
8
- require('./chunk-DWKQZ2SK.cjs');
9
- require('./chunk-4VAVYUZS.cjs');
10
- require('./chunk-7YN22L2H.cjs');
11
- require('./chunk-SU2GCLAC.cjs');
12
- require('./chunk-C72S6TTV.cjs');
8
+ var _chunk3OPYJG76cjs = require('./chunk-3OPYJG76.cjs');
13
9
 
14
10
 
15
- var _chunk46ZIFWYGcjs = require('./chunk-46ZIFWYG.cjs');
16
- require('./chunk-GBHYAGX3.cjs');
17
- require('./chunk-RSJ3TWJQ.cjs');
18
- require('./chunk-YGXJGRFI.cjs');
11
+ var _chunk7AK7B36Bcjs = require('./chunk-7AK7B36B.cjs');
12
+ require('./chunk-V4TXMEJS.cjs');
13
+ require('./chunk-6VUQPOV3.cjs');
14
+ require('./chunk-OF3BECU2.cjs');
15
+ require('./chunk-4VLRHHFE.cjs');
16
+ require('./chunk-OKMJLEXX.cjs');
17
+ require('./chunk-KBM2W6UY.cjs');
19
18
 
20
19
 
21
20
 
22
21
 
23
- exports.TransformerChainExecutor = _chunk46ZIFWYGcjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.registerBuiltinTransformers = _chunkRGTR7CIOcjs.registerBuiltinTransformers;
22
+ exports.TransformerChainExecutor = _chunkIIRPUVPHcjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.registerBuiltinTransformers = _chunk7AK7B36Bcjs.registerBuiltinTransformers;
@@ -6,5 +6,4 @@ import './transformer/transformers/AnthropicTransformer.cjs';
6
6
  import './transformer/transformers/GeminiCodeAssistTransformer.cjs';
7
7
  import './transformer/transformers/GeminiTransformer.cjs';
8
8
  import './transformer/transformers/OpenAIResponseTransformer.cjs';
9
- import './transformer/transformers/OpenCodeGoTransformer.cjs';
10
- import './transformer/transformers/ReasoningTransformer.cjs';
9
+ import './transformer/transformers/OpenAITransformer.cjs';
@@ -6,5 +6,4 @@ import './transformer/transformers/AnthropicTransformer.js';
6
6
  import './transformer/transformers/GeminiCodeAssistTransformer.js';
7
7
  import './transformer/transformers/GeminiTransformer.js';
8
8
  import './transformer/transformers/OpenAIResponseTransformer.js';
9
- import './transformer/transformers/OpenCodeGoTransformer.js';
10
- import './transformer/transformers/ReasoningTransformer.js';
9
+ import './transformer/transformers/OpenAITransformer.js';
@@ -1,21 +1,20 @@
1
1
  import "./chunk-46RLHI7D.js";
2
+ import {
3
+ TransformerChainExecutor
4
+ } from "./chunk-WNKWAEUR.js";
5
+ import "./chunk-MZNPGW5Q.js";
2
6
  import {
3
7
  TransformerService
4
8
  } from "./chunk-DK4A7DLE.js";
5
9
  import {
6
10
  registerBuiltinTransformers
7
- } from "./chunk-VPBAUQ2M.js";
8
- import "./chunk-ZJZAOKI7.js";
9
- import "./chunk-FTQ7IQUC.js";
10
- import "./chunk-C7PSERMH.js";
11
- import "./chunk-TIER4SUC.js";
12
- import "./chunk-Z7LUNECE.js";
13
- import {
14
- TransformerChainExecutor
15
- } from "./chunk-G2UTNSGU.js";
16
- import "./chunk-MZNPGW5Q.js";
17
- import "./chunk-Z7Y2NPHY.js";
18
- import "./chunk-S4WBV25P.js";
11
+ } from "./chunk-VRFBB5DB.js";
12
+ import "./chunk-LVUCAWMK.js";
13
+ import "./chunk-OEWZUX4G.js";
14
+ import "./chunk-LB6EBS6Y.js";
15
+ import "./chunk-6CL5HTPQ.js";
16
+ import "./chunk-N5T4M4GU.js";
17
+ import "./chunk-TOVPMMHM.js";
19
18
  export {
20
19
  TransformerChainExecutor,
21
20
  TransformerService,
@@ -8,7 +8,8 @@ import { L as Logger } from './logger-4GvQNzhE.cjs';
8
8
  import { ProviderConfigSource } from './ports/provider-config-source.cjs';
9
9
  import { P as ProviderProxy } from './ProviderProxy-CnMQYN59.cjs';
10
10
  import { ProviderProxyDeps } from './provider-proxy/types.cjs';
11
- import { c as KeySpend } from './keyPolicy-Cp0FntZl.cjs';
11
+ import { BoundAccountFallbackPolicy } from './pipeline/BoundAccountSelectionError.cjs';
12
+ import { c as KeySpend } from './keyPolicy-zdWTu3CQ.cjs';
12
13
 
13
14
  /**
14
15
  * keySpendTracker — a cheap in-memory per-key accumulated-spend cache
@@ -313,15 +314,30 @@ interface EndpointRoutingConfig {
313
314
  /**
314
315
  * OPTIONAL subscription-mode binding to ONE specific subscription account id
315
316
  * (provider/subscription duality). Absent/blank ⇒ the provider's account pool
316
- * auto-schedules (priority/LRU/health). When set and the account is
317
- * schedulable it is used directly; otherwise the pool is the fallback.
317
+ * auto-schedules (priority/LRU/health). When set, strict mode requires this
318
+ * account to serve; the pool is a fallback only with the explicit policy below.
318
319
  */
319
320
  boundAccountId?: string;
321
+ /**
322
+ * What a bound account does when it cannot serve this request. Meaningful
323
+ * only with `boundAccountId`; normalization drops it otherwise. A legacy
324
+ * bound endpoint with no field migrates to `'strict'`. The pool is used only
325
+ * when this is explicitly set to `'pool'`.
326
+ */
327
+ boundAccountFallbackPolicy?: BoundAccountFallbackPolicy;
328
+ /**
329
+ * Runtime-only account-group selector used by a {@link GatewayBinding}.
330
+ * Legacy endpoint persistence does not synthesize this field; it is projected
331
+ * from an independent binding immediately before route resolution.
332
+ */
333
+ boundAccountGroup?: string;
320
334
  /**
321
335
  * OPTIONAL provider-mode binding to ONE specific BYO key id (from the
322
336
  * provider's key pool). Absent/blank ⇒ the provider's default key / key pool.
323
337
  */
324
338
  boundKeyId?: string;
339
+ /** Strict by default; `'pool'` permits the provider's normal key pool. */
340
+ boundKeyFallbackPolicy?: BoundAccountFallbackPolicy;
325
341
  /**
326
342
  * OPTIONAL "background model id" override list (role-based `gemini` only).
327
343
  * When set, an incoming requested model id appearing in this list is
@@ -364,7 +380,7 @@ interface ConcurrencyQueueConfig {
364
380
  * Persisted + strictly validated like the queue segments; applied to the shared
365
381
  * `SubscriptionAccountHealth` tracker at daemon boot.
366
382
  * - `overloadCooldownEnabled` default **true** — a 529 places the account in
367
- * overload cooldown (ON by default; CRS ships it off).
383
+ * overload cooldown (enabled by default).
368
384
  * - `overloadCooldownMs` default **600000** (10 min), valid `60000..3600000`.
369
385
  */
370
386
  interface AccountHealthConfig {
@@ -397,6 +413,89 @@ interface AccountProbeConfig {
397
413
  historySize: number;
398
414
  staggerMs: number;
399
415
  }
416
+ /** A resource selected by a client-to-upstream gateway binding. */
417
+ type GatewayBindingTarget = {
418
+ kind: 'account';
419
+ providerId: string;
420
+ accountId: string;
421
+ } | {
422
+ kind: 'account-group';
423
+ providerId: string;
424
+ group: string;
425
+ } | {
426
+ /**
427
+ * The provider's WHOLE subscription pool, with no account preference —
428
+ * plain priority/LRU/health scheduling. Distinct from `account-group`,
429
+ * which pins a preferred group, and from `provider`, which is BYO-key.
430
+ */
431
+ kind: 'account-pool';
432
+ providerId: string;
433
+ } | {
434
+ kind: 'provider';
435
+ providerId: string;
436
+ keyId?: string;
437
+ };
438
+ /**
439
+ * Behavior when a binding cannot serve the requested model or credential.
440
+ * `next` yields to the next matching route (and lets a bound account fall back
441
+ * to its provider pool); `fail` keeps the route strict and errors instead.
442
+ */
443
+ type GatewayBindingFallback = 'next' | 'fail';
444
+ /** Which named API keys may enter a downstream route. */
445
+ type GatewayBindingKeyScope = 'all' | 'selected';
446
+ /** Whether the downstream model id is forwarded or explicitly remapped. */
447
+ type GatewayBindingModelMode = 'passthrough' | 'mapped';
448
+ /** One exact or `*` wildcard model-name rewrite owned by a downstream route. */
449
+ interface GatewayModelMapping {
450
+ source: string;
451
+ target: ModelRef;
452
+ }
453
+ /**
454
+ * Independent client-to-upstream route aggregate.
455
+ *
456
+ * A binding belongs to exactly one endpoint and one upstream resource. Keeping
457
+ * it separate from account/provider DTOs lets the same resource participate in
458
+ * multiple client-key routes without changing its identity or secret shape.
459
+ */
460
+ interface GatewayBinding {
461
+ id: string;
462
+ name: string;
463
+ enabled: boolean;
464
+ /** Legacy entries without this field keep the former all-vs-list behavior. */
465
+ keyScope?: GatewayBindingKeyScope;
466
+ /** Used only when `keyScope` resolves to `selected`. */
467
+ apiKeyIds?: string[];
468
+ endpoint: OutboundEndpoint;
469
+ target: GatewayBindingTarget;
470
+ /** Lower values win. Key-scoped bindings win before this comparison. */
471
+ priority?: number;
472
+ /** Next yields to the following matching route; fail keeps the binding strict. */
473
+ fallback: GatewayBindingFallback;
474
+ /** Empty passthrough routes preserve the client's requested model id. */
475
+ modelMode?: GatewayBindingModelMode;
476
+ /** Preferred generic mapping shape; legacy endpoint-specific fields remain readable. */
477
+ modelMappings?: GatewayModelMapping[];
478
+ modelMap?: Record<string, ModelRef>;
479
+ models?: ModelRef[];
480
+ dispatchMode?: ChatDispatchMode;
481
+ prefixTargets?: ModelPrefixTargets;
482
+ defaultModel?: ModelRef;
483
+ backgroundModel?: ModelRef;
484
+ backgroundModelIds?: string[];
485
+ }
486
+ /**
487
+ * Optional allowance-aware account scheduling. Default-off keeps allowance
488
+ * telemetry display-only. When enabled, only fresh Claude/Codex snapshots are
489
+ * considered: accounts above `demoteAtPercent` receive a temporary priority
490
+ * penalty; accounts above `pauseAtPercent` are excluded until the provider's
491
+ * reset/freshness deadline. Missing or stale data never excludes an account.
492
+ */
493
+ interface AllowanceSchedulingConfig {
494
+ enabled: boolean;
495
+ demoteAtPercent: number;
496
+ pauseAtPercent: number;
497
+ priorityPenalty: number;
498
+ }
400
499
  /**
401
500
  * Client-fingerprint segment (subscription-client-fingerprint #7). Opt-in,
402
501
  * default OFF: when disabled the claude-subscription outbound headers are
@@ -435,8 +534,19 @@ interface OutboundApiServerConfig {
435
534
  enabled: boolean;
436
535
  /** When true the listener binds `0.0.0.0` (LAN) instead of `127.0.0.1`. */
437
536
  networkBinding: boolean;
438
- /** Per-endpoint routing config, one per endpoint (4 entries). */
537
+ /**
538
+ * LEGACY per-endpoint routing config, one per endpoint (4 entries). No longer
539
+ * a routing source: {@link normalizeServerConfig} projects any configured
540
+ * entry into {@link bindings} once and leaves these blank. Retained as the
541
+ * projection shape {@link EndpointRoutingConfig} and for embedders that build
542
+ * a config by hand.
543
+ */
439
544
  endpoints: EndpointRoutingConfig[];
545
+ /**
546
+ * Resource-centric routes — the SSOT for routing. Optional in the raw
547
+ * persisted shape; normalized Omnicross configs always carry an array.
548
+ */
549
+ bindings?: GatewayBinding[];
440
550
  /** Persisted port (fixed default; falls back to ephemeral on EADDRINUSE). */
441
551
  port?: number;
442
552
  /**
@@ -463,6 +573,8 @@ interface OutboundApiServerConfig {
463
573
  * boot; a change takes effect on restart. Default-off ⇒ no scheduler runs.
464
574
  */
465
575
  accountProbe?: AccountProbeConfig;
576
+ /** Default-off allowance-aware scheduling; hot-reloaded by the daemon. */
577
+ allowanceScheduling?: AllowanceSchedulingConfig;
466
578
  /**
467
579
  * Layered upstream-proxy segment (upstream-proxy). Optional; when absent no
468
580
  * global/provider proxy applies (direct egress). `normalizeServerConfig` drops
@@ -546,6 +658,12 @@ interface OutboundApiKeyInfo {
546
658
  createdAt: number;
547
659
  lastUsedAt: number | null;
548
660
  revoked: boolean;
661
+ /** Intended consumer. Existing rows default to a general client key. */
662
+ kind?: 'client' | 'integration';
663
+ /** Optional endpoint allow-list. Absent means every outbound endpoint. */
664
+ allowedEndpoints?: OutboundEndpoint[];
665
+ /** When true the key is rejected unless the TCP peer is loopback. */
666
+ loopbackOnly?: boolean;
549
667
  /**
550
668
  * Per-key concurrency ceiling for the outbound concurrency gate. Absent or
551
669
  * `0` = unlimited (the gate is bypassed entirely for this key).
@@ -571,7 +689,7 @@ interface OutboundApiKeyInfo {
571
689
  rateLimitWindowMs?: number | null;
572
690
  /** Master switch: when false/unset the model list is inert (no restriction). */
573
691
  enableModelRestriction?: boolean;
574
- /** Restriction mode; absent ⇒ `'blacklist'` (CRS-parity). */
692
+ /** Restriction mode; absent ⇒ `'blacklist'`. */
575
693
  restrictionMode?: OutboundKeyModelRestrictionMode;
576
694
  /** The model-id list the mode acts on (bare modelIds; empty allowlist denies all). */
577
695
  restrictedModels?: string[];
@@ -637,6 +755,12 @@ interface OutboundKeyDbRow {
637
755
  createdAt: number;
638
756
  lastUsedAt: number | null;
639
757
  revokedAt: number | null;
758
+ /** Intended consumer. Existing rows without this field remain client keys. */
759
+ kind?: 'client' | 'integration';
760
+ /** Optional endpoint allow-list for least-privilege integration keys. */
761
+ allowedEndpoints?: OutboundEndpoint[];
762
+ /** Restrict use to requests whose direct socket peer is loopback. */
763
+ loopbackOnly?: boolean;
640
764
  /**
641
765
  * Per-key concurrency ceiling. Absent/`0` = unlimited = the concurrency gate
642
766
  * is bypassed for this key. Persisted by the daemon (`omnicross-uqc-daemon`).
@@ -676,6 +800,9 @@ interface OutboundKeyDb {
676
800
  keyHash: string;
677
801
  keyPrefix: string;
678
802
  createdAt?: number;
803
+ kind?: 'client' | 'integration';
804
+ allowedEndpoints?: OutboundEndpoint[];
805
+ loopbackOnly?: boolean;
679
806
  }): Promise<OutboundKeyDbRow>;
680
807
  outboundApiKeysRevoke(id: string): Promise<boolean>;
681
808
  outboundApiKeysTouchLastUsed(id: string): Promise<boolean>;
@@ -751,4 +878,4 @@ interface OutboundApiDeps {
751
878
  readonly logger?: Logger;
752
879
  }
753
880
 
754
- export { type AccountProbeConfig as A, toVoucherInfo as B, type ChatDispatchMode as C, voucherCodePrefix as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type ModelRef as G, type AccountHealthConfig as H, type OutboundKeyModelRestrictionMode as I, type KeySpendReader as K, type MessagesModelKind as M, type OutboundKeyDb as O, type RequestRole as R, type UserMessageQueueConfig as U, type VoucherCreateInput as V, type ConcurrencyQueueConfig as a, type EndpointRoutingConfig as b, type KeySpendSeeder as c, KeySpendTracker as d, type KindMappedEndpoint as e, type ModelKind as f, type ModelPrefixTargets as g, type OutboundApiDeps as h, type OutboundApiKeyCreated as i, type OutboundApiKeyInfo as j, type OutboundApiServerConfig as k, type OutboundApiServerStatus as l, type OutboundEndpoint as m, type OutboundFormatUrls as n, type OutboundKeyActivationMode as o, type OutboundKeyDbRow as p, type OutboundKeyPolicy as q, type OutboundProxyConfig as r, type ResponsesModelKind as s, type VoucherDb as t, computeVoucherGrant as u, generateVoucherCode as v, hashVoucherCode as w, newVoucherId as x, startOfLocalDay as y, startOfLocalWeek as z };
881
+ export { type AccountProbeConfig as A, computeVoucherGrant as B, type ChatDispatchMode as C, generateVoucherCode as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type GatewayBinding as G, hashVoucherCode as H, newVoucherId as I, startOfLocalDay as J, type KeySpendReader as K, startOfLocalWeek as L, type MessagesModelKind as M, toVoucherInfo as N, type OutboundKeyDb as O, voucherCodePrefix as P, type ModelRef as Q, type RequestRole as R, type AccountHealthConfig as S, type OutboundKeyModelRestrictionMode as T, type UserMessageQueueConfig as U, type VoucherCreateInput as V, type AllowanceSchedulingConfig as a, type ConcurrencyQueueConfig as b, type EndpointRoutingConfig as c, type GatewayBindingFallback as d, type GatewayBindingKeyScope as e, type GatewayBindingModelMode as f, type GatewayBindingTarget as g, type GatewayModelMapping as h, type KeySpendSeeder as i, KeySpendTracker as j, type KindMappedEndpoint as k, type ModelKind as l, type ModelPrefixTargets as m, type OutboundApiDeps as n, type OutboundApiKeyCreated as o, type OutboundApiKeyInfo as p, type OutboundApiServerConfig as q, type OutboundApiServerStatus as r, type OutboundEndpoint as s, type OutboundFormatUrls as t, type OutboundKeyActivationMode as u, type OutboundKeyDbRow as v, type OutboundKeyPolicy as w, type OutboundProxyConfig as x, type ResponsesModelKind as y, type VoucherDb as z };
@@ -8,7 +8,8 @@ import { L as Logger } from './logger-4GvQNzhE.js';
8
8
  import { ProviderConfigSource } from './ports/provider-config-source.js';
9
9
  import { P as ProviderProxy } from './ProviderProxy-C-xqrkKi.js';
10
10
  import { ProviderProxyDeps } from './provider-proxy/types.js';
11
- import { c as KeySpend } from './keyPolicy-Cp0FntZl.js';
11
+ import { BoundAccountFallbackPolicy } from './pipeline/BoundAccountSelectionError.js';
12
+ import { c as KeySpend } from './keyPolicy-zdWTu3CQ.js';
12
13
 
13
14
  /**
14
15
  * keySpendTracker — a cheap in-memory per-key accumulated-spend cache
@@ -313,15 +314,30 @@ interface EndpointRoutingConfig {
313
314
  /**
314
315
  * OPTIONAL subscription-mode binding to ONE specific subscription account id
315
316
  * (provider/subscription duality). Absent/blank ⇒ the provider's account pool
316
- * auto-schedules (priority/LRU/health). When set and the account is
317
- * schedulable it is used directly; otherwise the pool is the fallback.
317
+ * auto-schedules (priority/LRU/health). When set, strict mode requires this
318
+ * account to serve; the pool is a fallback only with the explicit policy below.
318
319
  */
319
320
  boundAccountId?: string;
321
+ /**
322
+ * What a bound account does when it cannot serve this request. Meaningful
323
+ * only with `boundAccountId`; normalization drops it otherwise. A legacy
324
+ * bound endpoint with no field migrates to `'strict'`. The pool is used only
325
+ * when this is explicitly set to `'pool'`.
326
+ */
327
+ boundAccountFallbackPolicy?: BoundAccountFallbackPolicy;
328
+ /**
329
+ * Runtime-only account-group selector used by a {@link GatewayBinding}.
330
+ * Legacy endpoint persistence does not synthesize this field; it is projected
331
+ * from an independent binding immediately before route resolution.
332
+ */
333
+ boundAccountGroup?: string;
320
334
  /**
321
335
  * OPTIONAL provider-mode binding to ONE specific BYO key id (from the
322
336
  * provider's key pool). Absent/blank ⇒ the provider's default key / key pool.
323
337
  */
324
338
  boundKeyId?: string;
339
+ /** Strict by default; `'pool'` permits the provider's normal key pool. */
340
+ boundKeyFallbackPolicy?: BoundAccountFallbackPolicy;
325
341
  /**
326
342
  * OPTIONAL "background model id" override list (role-based `gemini` only).
327
343
  * When set, an incoming requested model id appearing in this list is
@@ -364,7 +380,7 @@ interface ConcurrencyQueueConfig {
364
380
  * Persisted + strictly validated like the queue segments; applied to the shared
365
381
  * `SubscriptionAccountHealth` tracker at daemon boot.
366
382
  * - `overloadCooldownEnabled` default **true** — a 529 places the account in
367
- * overload cooldown (ON by default; CRS ships it off).
383
+ * overload cooldown (enabled by default).
368
384
  * - `overloadCooldownMs` default **600000** (10 min), valid `60000..3600000`.
369
385
  */
370
386
  interface AccountHealthConfig {
@@ -397,6 +413,89 @@ interface AccountProbeConfig {
397
413
  historySize: number;
398
414
  staggerMs: number;
399
415
  }
416
+ /** A resource selected by a client-to-upstream gateway binding. */
417
+ type GatewayBindingTarget = {
418
+ kind: 'account';
419
+ providerId: string;
420
+ accountId: string;
421
+ } | {
422
+ kind: 'account-group';
423
+ providerId: string;
424
+ group: string;
425
+ } | {
426
+ /**
427
+ * The provider's WHOLE subscription pool, with no account preference —
428
+ * plain priority/LRU/health scheduling. Distinct from `account-group`,
429
+ * which pins a preferred group, and from `provider`, which is BYO-key.
430
+ */
431
+ kind: 'account-pool';
432
+ providerId: string;
433
+ } | {
434
+ kind: 'provider';
435
+ providerId: string;
436
+ keyId?: string;
437
+ };
438
+ /**
439
+ * Behavior when a binding cannot serve the requested model or credential.
440
+ * `next` yields to the next matching route (and lets a bound account fall back
441
+ * to its provider pool); `fail` keeps the route strict and errors instead.
442
+ */
443
+ type GatewayBindingFallback = 'next' | 'fail';
444
+ /** Which named API keys may enter a downstream route. */
445
+ type GatewayBindingKeyScope = 'all' | 'selected';
446
+ /** Whether the downstream model id is forwarded or explicitly remapped. */
447
+ type GatewayBindingModelMode = 'passthrough' | 'mapped';
448
+ /** One exact or `*` wildcard model-name rewrite owned by a downstream route. */
449
+ interface GatewayModelMapping {
450
+ source: string;
451
+ target: ModelRef;
452
+ }
453
+ /**
454
+ * Independent client-to-upstream route aggregate.
455
+ *
456
+ * A binding belongs to exactly one endpoint and one upstream resource. Keeping
457
+ * it separate from account/provider DTOs lets the same resource participate in
458
+ * multiple client-key routes without changing its identity or secret shape.
459
+ */
460
+ interface GatewayBinding {
461
+ id: string;
462
+ name: string;
463
+ enabled: boolean;
464
+ /** Legacy entries without this field keep the former all-vs-list behavior. */
465
+ keyScope?: GatewayBindingKeyScope;
466
+ /** Used only when `keyScope` resolves to `selected`. */
467
+ apiKeyIds?: string[];
468
+ endpoint: OutboundEndpoint;
469
+ target: GatewayBindingTarget;
470
+ /** Lower values win. Key-scoped bindings win before this comparison. */
471
+ priority?: number;
472
+ /** Next yields to the following matching route; fail keeps the binding strict. */
473
+ fallback: GatewayBindingFallback;
474
+ /** Empty passthrough routes preserve the client's requested model id. */
475
+ modelMode?: GatewayBindingModelMode;
476
+ /** Preferred generic mapping shape; legacy endpoint-specific fields remain readable. */
477
+ modelMappings?: GatewayModelMapping[];
478
+ modelMap?: Record<string, ModelRef>;
479
+ models?: ModelRef[];
480
+ dispatchMode?: ChatDispatchMode;
481
+ prefixTargets?: ModelPrefixTargets;
482
+ defaultModel?: ModelRef;
483
+ backgroundModel?: ModelRef;
484
+ backgroundModelIds?: string[];
485
+ }
486
+ /**
487
+ * Optional allowance-aware account scheduling. Default-off keeps allowance
488
+ * telemetry display-only. When enabled, only fresh Claude/Codex snapshots are
489
+ * considered: accounts above `demoteAtPercent` receive a temporary priority
490
+ * penalty; accounts above `pauseAtPercent` are excluded until the provider's
491
+ * reset/freshness deadline. Missing or stale data never excludes an account.
492
+ */
493
+ interface AllowanceSchedulingConfig {
494
+ enabled: boolean;
495
+ demoteAtPercent: number;
496
+ pauseAtPercent: number;
497
+ priorityPenalty: number;
498
+ }
400
499
  /**
401
500
  * Client-fingerprint segment (subscription-client-fingerprint #7). Opt-in,
402
501
  * default OFF: when disabled the claude-subscription outbound headers are
@@ -435,8 +534,19 @@ interface OutboundApiServerConfig {
435
534
  enabled: boolean;
436
535
  /** When true the listener binds `0.0.0.0` (LAN) instead of `127.0.0.1`. */
437
536
  networkBinding: boolean;
438
- /** Per-endpoint routing config, one per endpoint (4 entries). */
537
+ /**
538
+ * LEGACY per-endpoint routing config, one per endpoint (4 entries). No longer
539
+ * a routing source: {@link normalizeServerConfig} projects any configured
540
+ * entry into {@link bindings} once and leaves these blank. Retained as the
541
+ * projection shape {@link EndpointRoutingConfig} and for embedders that build
542
+ * a config by hand.
543
+ */
439
544
  endpoints: EndpointRoutingConfig[];
545
+ /**
546
+ * Resource-centric routes — the SSOT for routing. Optional in the raw
547
+ * persisted shape; normalized Omnicross configs always carry an array.
548
+ */
549
+ bindings?: GatewayBinding[];
440
550
  /** Persisted port (fixed default; falls back to ephemeral on EADDRINUSE). */
441
551
  port?: number;
442
552
  /**
@@ -463,6 +573,8 @@ interface OutboundApiServerConfig {
463
573
  * boot; a change takes effect on restart. Default-off ⇒ no scheduler runs.
464
574
  */
465
575
  accountProbe?: AccountProbeConfig;
576
+ /** Default-off allowance-aware scheduling; hot-reloaded by the daemon. */
577
+ allowanceScheduling?: AllowanceSchedulingConfig;
466
578
  /**
467
579
  * Layered upstream-proxy segment (upstream-proxy). Optional; when absent no
468
580
  * global/provider proxy applies (direct egress). `normalizeServerConfig` drops
@@ -546,6 +658,12 @@ interface OutboundApiKeyInfo {
546
658
  createdAt: number;
547
659
  lastUsedAt: number | null;
548
660
  revoked: boolean;
661
+ /** Intended consumer. Existing rows default to a general client key. */
662
+ kind?: 'client' | 'integration';
663
+ /** Optional endpoint allow-list. Absent means every outbound endpoint. */
664
+ allowedEndpoints?: OutboundEndpoint[];
665
+ /** When true the key is rejected unless the TCP peer is loopback. */
666
+ loopbackOnly?: boolean;
549
667
  /**
550
668
  * Per-key concurrency ceiling for the outbound concurrency gate. Absent or
551
669
  * `0` = unlimited (the gate is bypassed entirely for this key).
@@ -571,7 +689,7 @@ interface OutboundApiKeyInfo {
571
689
  rateLimitWindowMs?: number | null;
572
690
  /** Master switch: when false/unset the model list is inert (no restriction). */
573
691
  enableModelRestriction?: boolean;
574
- /** Restriction mode; absent ⇒ `'blacklist'` (CRS-parity). */
692
+ /** Restriction mode; absent ⇒ `'blacklist'`. */
575
693
  restrictionMode?: OutboundKeyModelRestrictionMode;
576
694
  /** The model-id list the mode acts on (bare modelIds; empty allowlist denies all). */
577
695
  restrictedModels?: string[];
@@ -637,6 +755,12 @@ interface OutboundKeyDbRow {
637
755
  createdAt: number;
638
756
  lastUsedAt: number | null;
639
757
  revokedAt: number | null;
758
+ /** Intended consumer. Existing rows without this field remain client keys. */
759
+ kind?: 'client' | 'integration';
760
+ /** Optional endpoint allow-list for least-privilege integration keys. */
761
+ allowedEndpoints?: OutboundEndpoint[];
762
+ /** Restrict use to requests whose direct socket peer is loopback. */
763
+ loopbackOnly?: boolean;
640
764
  /**
641
765
  * Per-key concurrency ceiling. Absent/`0` = unlimited = the concurrency gate
642
766
  * is bypassed for this key. Persisted by the daemon (`omnicross-uqc-daemon`).
@@ -676,6 +800,9 @@ interface OutboundKeyDb {
676
800
  keyHash: string;
677
801
  keyPrefix: string;
678
802
  createdAt?: number;
803
+ kind?: 'client' | 'integration';
804
+ allowedEndpoints?: OutboundEndpoint[];
805
+ loopbackOnly?: boolean;
679
806
  }): Promise<OutboundKeyDbRow>;
680
807
  outboundApiKeysRevoke(id: string): Promise<boolean>;
681
808
  outboundApiKeysTouchLastUsed(id: string): Promise<boolean>;
@@ -751,4 +878,4 @@ interface OutboundApiDeps {
751
878
  readonly logger?: Logger;
752
879
  }
753
880
 
754
- export { type AccountProbeConfig as A, toVoucherInfo as B, type ChatDispatchMode as C, voucherCodePrefix as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type ModelRef as G, type AccountHealthConfig as H, type OutboundKeyModelRestrictionMode as I, type KeySpendReader as K, type MessagesModelKind as M, type OutboundKeyDb as O, type RequestRole as R, type UserMessageQueueConfig as U, type VoucherCreateInput as V, type ConcurrencyQueueConfig as a, type EndpointRoutingConfig as b, type KeySpendSeeder as c, KeySpendTracker as d, type KindMappedEndpoint as e, type ModelKind as f, type ModelPrefixTargets as g, type OutboundApiDeps as h, type OutboundApiKeyCreated as i, type OutboundApiKeyInfo as j, type OutboundApiServerConfig as k, type OutboundApiServerStatus as l, type OutboundEndpoint as m, type OutboundFormatUrls as n, type OutboundKeyActivationMode as o, type OutboundKeyDbRow as p, type OutboundKeyPolicy as q, type OutboundProxyConfig as r, type ResponsesModelKind as s, type VoucherDb as t, computeVoucherGrant as u, generateVoucherCode as v, hashVoucherCode as w, newVoucherId as x, startOfLocalDay as y, startOfLocalWeek as z };
881
+ export { type AccountProbeConfig as A, computeVoucherGrant as B, type ChatDispatchMode as C, generateVoucherCode as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type GatewayBinding as G, hashVoucherCode as H, newVoucherId as I, startOfLocalDay as J, type KeySpendReader as K, startOfLocalWeek as L, type MessagesModelKind as M, toVoucherInfo as N, type OutboundKeyDb as O, voucherCodePrefix as P, type ModelRef as Q, type RequestRole as R, type AccountHealthConfig as S, type OutboundKeyModelRestrictionMode as T, type UserMessageQueueConfig as U, type VoucherCreateInput as V, type AllowanceSchedulingConfig as a, type ConcurrencyQueueConfig as b, type EndpointRoutingConfig as c, type GatewayBindingFallback as d, type GatewayBindingKeyScope as e, type GatewayBindingModelMode as f, type GatewayBindingTarget as g, type GatewayModelMapping as h, type KeySpendSeeder as i, KeySpendTracker as j, type KindMappedEndpoint as k, type ModelKind as l, type ModelPrefixTargets as m, type OutboundApiDeps as n, type OutboundApiKeyCreated as o, type OutboundApiKeyInfo as p, type OutboundApiServerConfig as q, type OutboundApiServerStatus as r, type OutboundEndpoint as s, type OutboundFormatUrls as t, type OutboundKeyActivationMode as u, type OutboundKeyDbRow as v, type OutboundKeyPolicy as w, type OutboundProxyConfig as x, type ResponsesModelKind as y, type VoucherDb as z };
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYMFAJFQTcjs = require('../chunk-YMFAJFQT.cjs');
3
+ var _chunkDLXZEZWOcjs = require('../chunk-DLXZEZWO.cjs');
4
4
 
5
5
 
6
- exports.PricingEngine = _chunkYMFAJFQTcjs.PricingEngine;
6
+ exports.PricingEngine = _chunkDLXZEZWOcjs.PricingEngine;