@omnicross/core 0.1.2 → 0.1.3

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 (131) hide show
  1. package/dist/auth/GeminiCodeAssistProjectResolver.cjs +6 -1
  2. package/dist/auth/GeminiCodeAssistProjectResolver.js +6 -1
  3. package/dist/{chunk-SN3YWBX7.cjs → chunk-2FMI2B6V.cjs} +2329 -533
  4. package/dist/{chunk-XBSYYZIY.cjs → chunk-3QOSDDNI.cjs} +39 -3
  5. package/dist/{chunk-2FEVTJWG.js → chunk-4DECIFU7.js} +2162 -366
  6. package/dist/chunk-4IH4EL7M.cjs +9 -0
  7. package/dist/chunk-5ENKBSWO.js +311 -0
  8. package/dist/chunk-6RPZADX3.cjs +92 -0
  9. package/dist/chunk-AEOZIDEB.cjs +32 -0
  10. package/dist/chunk-BO4RFWBR.js +89 -0
  11. package/dist/{chunk-MNYKI4CI.js → chunk-CWM2ZDU5.js} +36 -0
  12. package/dist/chunk-CZHZGRU7.js +383 -0
  13. package/dist/{chunk-4NBS6KPV.cjs → chunk-DQ5VAYZ6.cjs} +7 -8
  14. package/dist/chunk-HUZZZ3JL.js +32 -0
  15. package/dist/{chunk-QOCNX236.js → chunk-IAXWICZU.js} +24 -1
  16. package/dist/{chunk-V5KPWNYX.cjs → chunk-JMJBSACD.cjs} +3 -3
  17. package/dist/chunk-L74VDN4A.cjs +32 -0
  18. package/dist/{chunk-74TMJA7Z.js → chunk-N5QFKSDO.js} +7 -4
  19. package/dist/{chunk-LKZJEL6E.cjs → chunk-Q27JY5RG.cjs} +6 -4
  20. package/dist/{chunk-SPVWWUHX.cjs → chunk-QWBWGODS.cjs} +24 -1
  21. package/dist/chunk-RPII3E6Z.cjs +145 -0
  22. package/dist/chunk-S6JGLF3G.cjs +89 -0
  23. package/dist/chunk-SVXC36MU.cjs +383 -0
  24. package/dist/chunk-TKJMZBAH.js +32 -0
  25. package/dist/{chunk-ZSVQT3PW.js → chunk-UBWEBKRC.js} +5 -6
  26. package/dist/chunk-UNEFIWXI.cjs +32 -0
  27. package/dist/chunk-VQY5W4YW.cjs +311 -0
  28. package/dist/chunk-WNY4WMRF.js +32 -0
  29. package/dist/chunk-XEKD23J5.js +9 -0
  30. package/dist/chunk-XTEI64OU.js +145 -0
  31. package/dist/chunk-XX6NQJMA.js +92 -0
  32. package/dist/{chunk-N3V2J5ZO.cjs → chunk-Y6OM7EV7.cjs} +7 -4
  33. package/dist/{chunk-745DV5FL.js → chunk-Y7FO65VT.js} +3 -3
  34. package/dist/{chunk-PXUJF5HS.js → chunk-ZY6KU6P3.js} +4 -2
  35. package/dist/completion/CompletionService.cjs +22 -15
  36. package/dist/completion/CompletionService.js +21 -14
  37. package/dist/completion/NativeSearchInjector.cjs +3 -3
  38. package/dist/completion/NativeSearchInjector.js +2 -2
  39. package/dist/completion/openrouter-headers.cjs +3 -6
  40. package/dist/completion/openrouter-headers.d.cts +9 -12
  41. package/dist/completion/openrouter-headers.d.ts +9 -12
  42. package/dist/completion/openrouter-headers.js +2 -5
  43. package/dist/completion/openrouter-models.cjs +4 -3
  44. package/dist/completion/openrouter-models.js +2 -1
  45. package/dist/completion.cjs +22 -15
  46. package/dist/completion.js +21 -14
  47. package/dist/index.cjs +139 -17
  48. package/dist/index.d.cts +40 -10
  49. package/dist/index.d.ts +40 -10
  50. package/dist/index.js +146 -24
  51. package/dist/outbound-api/routeResolver.cjs +5 -2
  52. package/dist/outbound-api/routeResolver.d.cts +8 -2
  53. package/dist/outbound-api/routeResolver.d.ts +8 -2
  54. package/dist/outbound-api/routeResolver.js +4 -1
  55. package/dist/outbound-api/types.cjs +6 -1
  56. package/dist/outbound-api/types.d.cts +11 -144
  57. package/dist/outbound-api/types.d.ts +11 -144
  58. package/dist/outbound-api/types.js +6 -0
  59. package/dist/outbound-api.cjs +133 -15
  60. package/dist/outbound-api.d.cts +786 -25
  61. package/dist/outbound-api.d.ts +786 -25
  62. package/dist/outbound-api.js +137 -19
  63. package/dist/pipeline/AuthSource.d.cts +23 -1
  64. package/dist/pipeline/AuthSource.d.ts +23 -1
  65. package/dist/pipeline/LlmConfigProviderAuth.cjs +3 -3
  66. package/dist/pipeline/LlmConfigProviderAuth.js +2 -2
  67. package/dist/pipeline/SubscriptionAccountHealth.cjs +22 -0
  68. package/dist/pipeline/SubscriptionAccountHealth.d.cts +235 -0
  69. package/dist/pipeline/SubscriptionAccountHealth.d.ts +235 -0
  70. package/dist/pipeline/SubscriptionAccountHealth.js +22 -0
  71. package/dist/pipeline/SubscriptionAuthSource.cjs +2 -2
  72. package/dist/pipeline/SubscriptionAuthSource.d.cts +3 -2
  73. package/dist/pipeline/SubscriptionAuthSource.d.ts +3 -2
  74. package/dist/pipeline/SubscriptionAuthSource.js +1 -1
  75. package/dist/pipeline/SubscriptionAuthStrategy.d.cts +24 -1
  76. package/dist/pipeline/SubscriptionAuthStrategy.d.ts +24 -1
  77. package/dist/pipeline/auditSink.cjs +14 -0
  78. package/dist/pipeline/auditSink.d.cts +48 -0
  79. package/dist/pipeline/auditSink.d.ts +48 -0
  80. package/dist/pipeline/auditSink.js +14 -0
  81. package/dist/pipeline/billingEmit.cjs +14 -0
  82. package/dist/pipeline/billingEmit.d.cts +49 -0
  83. package/dist/pipeline/billingEmit.d.ts +49 -0
  84. package/dist/pipeline/billingEmit.js +14 -0
  85. package/dist/ports/usage-event-store.d.cts +26 -1
  86. package/dist/ports/usage-event-store.d.ts +26 -1
  87. package/dist/ports.d.cts +7 -1
  88. package/dist/ports.d.ts +7 -1
  89. package/dist/provider-proxy/ProviderProxy.cjs +22 -15
  90. package/dist/provider-proxy/ProviderProxy.js +21 -14
  91. package/dist/provider-proxy/identity/SubscriptionIdentityStore.cjs +15 -0
  92. package/dist/provider-proxy/identity/SubscriptionIdentityStore.d.cts +121 -0
  93. package/dist/provider-proxy/identity/SubscriptionIdentityStore.d.ts +121 -0
  94. package/dist/provider-proxy/identity/SubscriptionIdentityStore.js +15 -0
  95. package/dist/provider-proxy/identity/fingerprintHeaders.cjs +20 -0
  96. package/dist/provider-proxy/identity/fingerprintHeaders.d.cts +89 -0
  97. package/dist/provider-proxy/identity/fingerprintHeaders.d.ts +89 -0
  98. package/dist/provider-proxy/identity/fingerprintHeaders.js +20 -0
  99. package/dist/provider-proxy/ingress/providerProxyShared.cjs +22 -15
  100. package/dist/provider-proxy/ingress/providerProxyShared.d.cts +11 -2
  101. package/dist/provider-proxy/ingress/providerProxyShared.d.ts +11 -2
  102. package/dist/provider-proxy/ingress/providerProxyShared.js +21 -14
  103. package/dist/provider-proxy/matchText.cjs +4 -2
  104. package/dist/provider-proxy/matchText.d.cts +14 -1
  105. package/dist/provider-proxy/matchText.d.ts +14 -1
  106. package/dist/provider-proxy/matchText.js +3 -1
  107. package/dist/provider-proxy/types.d.cts +23 -0
  108. package/dist/provider-proxy/types.d.ts +23 -0
  109. package/dist/provider-proxy.cjs +22 -15
  110. package/dist/provider-proxy.js +21 -14
  111. package/dist/{routeResolver-HE-ZO0fO.d.ts → routeResolver-B1NglTfe.d.ts} +36 -10
  112. package/dist/{routeResolver-BrbK6ja9.d.cts → routeResolver-CbG5uBgm.d.cts} +36 -10
  113. package/dist/transformer/transformers.cjs +7 -7
  114. package/dist/transformer/transformers.js +7 -7
  115. package/dist/transformer.cjs +5 -5
  116. package/dist/transformer.js +4 -4
  117. package/dist/types-6OUY_xfA.d.ts +830 -0
  118. package/dist/types-aBFFXoBz.d.cts +830 -0
  119. package/dist/usage/usage-recorder.cjs +2 -2
  120. package/dist/usage/usage-recorder.d.cts +19 -1
  121. package/dist/usage/usage-recorder.d.ts +19 -1
  122. package/dist/usage/usage-recorder.js +1 -1
  123. package/dist/usage.cjs +2 -2
  124. package/dist/usage.js +1 -1
  125. package/package.json +4 -2
  126. package/dist/chunk-3MEACFK3.js +0 -193
  127. package/dist/chunk-6VIXXLMX.cjs +0 -14
  128. package/dist/chunk-E3WHL7CO.js +0 -14
  129. package/dist/chunk-G2FUJNA2.cjs +0 -193
  130. package/dist/{chunk-UYPEN5XE.cjs → chunk-FFALUUZZ.cjs} +5 -5
  131. package/dist/{chunk-O466Y272.js → chunk-MQNDWYPN.js} +6 -6
package/dist/index.js CHANGED
@@ -1,39 +1,81 @@
1
1
  import {
2
+ AUDIT_REDACTED,
2
3
  CompletionService,
4
+ ConcurrencyQueueFullError,
5
+ ConcurrencyWaitCancelledError,
6
+ ConcurrencyWaitTimeoutError,
7
+ DEFAULT_ACCOUNT_PROBE,
8
+ DEFAULT_CONCURRENCY_QUEUE,
9
+ DEFAULT_FINGERPRINT,
3
10
  DEFAULT_OUTBOUND_PORT,
4
11
  DEFAULT_ROUTE_IDLE_MS,
12
+ DEFAULT_USER_MESSAGE_QUEUE,
13
+ KeySpendTracker,
14
+ KeyedMutex,
5
15
  OUTBOUND_API_SERVER_CONFIG_KEY,
16
+ OutboundApiConfigError,
6
17
  OutboundApiServer,
18
+ OutboundConcurrencyGate,
7
19
  OutboundRateLimiter,
8
20
  ProviderProxy,
9
21
  ProviderProxyRouteMap,
22
+ SerialQueueTimeoutError,
23
+ UserMessageSerialQueue,
10
24
  __resetOutboundApiServerForTests,
11
25
  __resetProviderProxyForTests,
12
26
  addOpenRouterProviderToRequest,
13
27
  attach,
28
+ beginAuditCapture,
29
+ beginBillingCapture,
30
+ checkKeyQuota,
31
+ computeKeyExpiry,
32
+ computeVoucherGrant,
14
33
  convertMessageToAnthropic,
15
34
  convertMessageToGemini,
16
35
  convertMessageToOpenAI,
17
36
  createNamedKey,
18
37
  defaultServerConfig,
19
- detectRequestRole,
20
38
  emit,
21
- endpointToIngressFormat,
22
39
  extractRouteToken,
23
40
  formatUrls,
41
+ generateVoucherCode,
24
42
  getOpenRouterProviderConfig,
25
43
  getOutboundApiServer,
26
44
  getProviderProxy,
45
+ handleVoucherRedeem,
27
46
  hashKey,
47
+ hashVoucherCode,
48
+ isConcurrencyRejection,
49
+ isRedeemRequest,
50
+ isSerialQueueTimeout,
51
+ isUserMessageRequest,
28
52
  loadServerConfig,
29
53
  mergeServerConfig,
54
+ newVoucherId,
55
+ normalizeAccountProbe,
56
+ normalizeAudit,
57
+ normalizeBilling,
58
+ normalizeFingerprint,
59
+ normalizePrefixTargets,
60
+ normalizeProxyConfig,
61
+ normalizeProxySegment,
62
+ normalizeQueueSegments,
30
63
  normalizeServerConfig,
64
+ normalizeVoucher,
65
+ normalizeWebhookDestination,
66
+ normalizeWebhookSegment,
67
+ randomBase62,
68
+ redactAuditText,
31
69
  register,
32
70
  release,
33
71
  saveServerConfig,
34
- verifyPresentedKey
35
- } from "./chunk-2FEVTJWG.js";
36
- import "./chunk-QOCNX236.js";
72
+ startOfLocalDay,
73
+ startOfLocalWeek,
74
+ toVoucherInfo,
75
+ verifyKey,
76
+ verifyPresentedKey,
77
+ voucherCodePrefix
78
+ } from "./chunk-4DECIFU7.js";
37
79
  import {
38
80
  createSSEParser,
39
81
  streamSSEResponse
@@ -42,36 +84,42 @@ import "./chunk-46RLHI7D.js";
42
84
  import {
43
85
  TransformerChainExecutor
44
86
  } from "./chunk-G2UTNSGU.js";
45
- import "./chunk-MZNPGW5Q.js";
46
87
  import {
47
88
  TransformerService
48
89
  } from "./chunk-DK4A7DLE.js";
49
90
  import {
50
91
  registerBuiltinTransformers
51
- } from "./chunk-O466Y272.js";
52
- import "./chunk-C7PSERMH.js";
53
- import "./chunk-5HTVET6E.js";
92
+ } from "./chunk-MQNDWYPN.js";
54
93
  import "./chunk-Z7LUNECE.js";
55
94
  import "./chunk-ZJZAOKI7.js";
56
95
  import "./chunk-FTQ7IQUC.js";
96
+ import "./chunk-C7PSERMH.js";
97
+ import "./chunk-5HTVET6E.js";
57
98
  import "./chunk-7VU7V2E4.js";
58
99
  import {
59
100
  PricingEngine
60
101
  } from "./chunk-ZLX3KGXX.js";
61
102
  import {
62
103
  UsageRecorder
63
- } from "./chunk-MNYKI4CI.js";
104
+ } from "./chunk-CWM2ZDU5.js";
105
+ import "./chunk-MZNPGW5Q.js";
106
+ import "./chunk-XTEI64OU.js";
107
+ import "./chunk-XX6NQJMA.js";
108
+ import "./chunk-IAXWICZU.js";
109
+ import "./chunk-5ERIZW3D.js";
110
+ import "./chunk-5ENKBSWO.js";
111
+ import "./chunk-N5QFKSDO.js";
112
+ import {
113
+ serializeError
114
+ } from "./chunk-AVYJ4YBN.js";
64
115
  import "./chunk-DRWHTIIZ.js";
116
+ import "./chunk-WNY4WMRF.js";
117
+ import "./chunk-TKJMZBAH.js";
65
118
  import "./chunk-JO5NLTLY.js";
66
119
  import {
67
120
  getProviderHeaders
68
- } from "./chunk-PXUJF5HS.js";
121
+ } from "./chunk-ZY6KU6P3.js";
69
122
  import "./chunk-JWC6APFQ.js";
70
- import "./chunk-5ERIZW3D.js";
71
- import "./chunk-74TMJA7Z.js";
72
- import {
73
- serializeError
74
- } from "./chunk-AVYJ4YBN.js";
75
123
  import {
76
124
  buildAnthropicApiUrl,
77
125
  buildAzureOpenAIApiUrl,
@@ -85,11 +133,25 @@ import {
85
133
  } from "./chunk-H5JUT3KV.js";
86
134
  import {
87
135
  SUBSCRIPTION_PROVIDER_IDS,
136
+ classifyModelPrefix,
137
+ detectModelKind,
138
+ detectRequestRole,
88
139
  endpointSupportsSubscription,
140
+ endpointToIngressFormat,
141
+ isKindMappedEndpoint,
89
142
  isSubscriptionProviderId,
90
- resolveRoute
91
- } from "./chunk-3MEACFK3.js";
143
+ modelKindsForEndpoint,
144
+ parseModelRef,
145
+ pickModelRefFromList,
146
+ resolvePrefixTarget,
147
+ resolveRoute,
148
+ validateEndpointModelConfig,
149
+ validateServerModelConfig
150
+ } from "./chunk-CZHZGRU7.js";
92
151
  import "./chunk-AQ5TNQB7.js";
152
+ import {
153
+ ENDPOINT_MODEL_KINDS
154
+ } from "./chunk-XEKD23J5.js";
93
155
  import {
94
156
  convertAnthropicRequestToOpenAI,
95
157
  convertAnthropicStreamToOpenAI,
@@ -102,6 +164,7 @@ import {
102
164
  hasImageContent,
103
165
  hasThinkingEnabled
104
166
  } from "./chunk-5ZQBEOMD.js";
167
+ import "./chunk-BO4RFWBR.js";
105
168
  import "./chunk-Z7Y2NPHY.js";
106
169
  import "./chunk-S4WBV25P.js";
107
170
  import {
@@ -112,36 +175,55 @@ import {
112
175
  applyAugmentation,
113
176
  buildNativeSearchAugmentation,
114
177
  detectNativeSearch
115
- } from "./chunk-745DV5FL.js";
116
- import {
117
- OPENROUTER_APP_HEADERS,
118
- isOpenRouterProvider
119
- } from "./chunk-E3WHL7CO.js";
178
+ } from "./chunk-Y7FO65VT.js";
120
179
  import {
121
180
  NATIVE_SEARCH_TOOL_NAMES
122
181
  } from "./chunk-FMOBD2OQ.js";
182
+ import {
183
+ OPENROUTER_APP_HEADERS,
184
+ getOpenRouterAppIdentity,
185
+ isOpenRouterProvider,
186
+ setOpenRouterAppIdentity
187
+ } from "./chunk-HUZZZ3JL.js";
123
188
  export {
189
+ AUDIT_REDACTED,
124
190
  BuiltinToolExecutor,
125
191
  CompletionService,
192
+ ConcurrencyQueueFullError,
193
+ ConcurrencyWaitCancelledError,
194
+ ConcurrencyWaitTimeoutError,
195
+ DEFAULT_ACCOUNT_PROBE,
196
+ DEFAULT_CONCURRENCY_QUEUE,
197
+ DEFAULT_FINGERPRINT,
126
198
  DEFAULT_OUTBOUND_PORT,
127
199
  DEFAULT_ROUTE_IDLE_MS,
200
+ DEFAULT_USER_MESSAGE_QUEUE,
201
+ ENDPOINT_MODEL_KINDS,
202
+ KeySpendTracker,
203
+ KeyedMutex,
128
204
  NATIVE_SEARCH_TOOL_NAMES,
129
205
  OPENROUTER_APP_HEADERS,
130
206
  OUTBOUND_API_SERVER_CONFIG_KEY,
207
+ OutboundApiConfigError,
131
208
  OutboundApiServer,
209
+ OutboundConcurrencyGate,
132
210
  OutboundRateLimiter,
133
211
  PricingEngine,
134
212
  ProviderProxy,
135
213
  ProviderProxyRouteMap,
136
214
  SUBSCRIPTION_PROVIDER_IDS,
215
+ SerialQueueTimeoutError,
137
216
  TransformerChainExecutor,
138
217
  TransformerService,
139
218
  UsageRecorder,
219
+ UserMessageSerialQueue,
140
220
  __resetOutboundApiServerForTests,
141
221
  __resetProviderProxyForTests,
142
222
  addOpenRouterProviderToRequest,
143
223
  applyAugmentation,
144
224
  attach as attachStreamEventBuffer,
225
+ beginAuditCapture,
226
+ beginBillingCapture,
145
227
  buildAnthropicApiUrl,
146
228
  buildAzureOpenAIApiUrl,
147
229
  buildGeminiApiUrl,
@@ -149,6 +231,10 @@ export {
149
231
  buildOpenAIApiUrl,
150
232
  buildOpenAIResponseApiUrl,
151
233
  buildProviderApiUrl,
234
+ checkKeyQuota,
235
+ classifyModelPrefix,
236
+ computeKeyExpiry,
237
+ computeVoucherGrant,
152
238
  convertAnthropicRequestToOpenAI,
153
239
  convertAnthropicStreamToOpenAI,
154
240
  convertAnthropicToOpenAI,
@@ -163,6 +249,7 @@ export {
163
249
  createNamedKey,
164
250
  createSSEParser,
165
251
  defaultServerConfig,
252
+ detectModelKind,
166
253
  detectNativeSearch,
167
254
  detectRequestRole,
168
255
  emit as emitStreamEvent,
@@ -170,28 +257,63 @@ export {
170
257
  endpointToIngressFormat,
171
258
  extractRouteToken,
172
259
  formatUrls,
260
+ generateVoucherCode,
173
261
  getBuiltinSearchTools,
262
+ getOpenRouterAppIdentity,
174
263
  getOpenRouterProviderConfig,
175
264
  getOutboundApiServer,
176
265
  getProviderHeaders,
177
266
  getProviderProxy,
267
+ handleVoucherRedeem,
178
268
  hasImageContent,
179
269
  hasThinkingEnabled,
180
270
  hashKey,
271
+ hashVoucherCode,
272
+ isConcurrencyRejection,
273
+ isKindMappedEndpoint,
181
274
  isOpenRouterProvider,
275
+ isRedeemRequest,
276
+ isSerialQueueTimeout,
182
277
  isSubscriptionProviderId,
278
+ isUserMessageRequest,
183
279
  loadServerConfig,
184
280
  mergeServerConfig,
281
+ modelKindsForEndpoint,
282
+ newVoucherId,
283
+ normalizeAccountProbe,
284
+ normalizeAudit,
185
285
  normalizeAzureEndpoint,
286
+ normalizeBilling,
287
+ normalizeFingerprint,
288
+ normalizePrefixTargets,
289
+ normalizeProxyConfig,
290
+ normalizeProxySegment,
291
+ normalizeQueueSegments,
186
292
  normalizeServerConfig,
293
+ normalizeVoucher,
294
+ normalizeWebhookDestination,
295
+ normalizeWebhookSegment,
296
+ parseModelRef,
297
+ pickModelRefFromList,
298
+ randomBase62,
299
+ redactAuditText,
187
300
  registerBuiltinTransformers,
188
301
  register as registerStreamEventBuffer,
189
302
  release as releaseStreamEventBuffer,
190
303
  resolveApiFormat,
304
+ resolvePrefixTarget,
191
305
  resolveProviderEndpoint,
192
306
  resolveRoute,
193
307
  saveServerConfig,
194
308
  serializeError,
309
+ setOpenRouterAppIdentity,
310
+ startOfLocalDay,
311
+ startOfLocalWeek,
195
312
  streamSSEResponse,
196
- verifyPresentedKey
313
+ toVoucherInfo,
314
+ validateEndpointModelConfig,
315
+ validateServerModelConfig,
316
+ verifyKey,
317
+ verifyPresentedKey,
318
+ voucherCodePrefix
197
319
  };
@@ -2,10 +2,13 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkG2FUJNA2cjs = require('../chunk-G2FUJNA2.cjs');
5
+
6
+ var _chunkSVXC36MUcjs = require('../chunk-SVXC36MU.cjs');
6
7
  require('../chunk-QBZJ7P2T.cjs');
8
+ require('../chunk-4IH4EL7M.cjs');
9
+
7
10
 
8
11
 
9
12
 
10
13
 
11
- exports.isSubscriptionProviderId = _chunkG2FUJNA2cjs.isSubscriptionProviderId; exports.parseModelRef = _chunkG2FUJNA2cjs.parseModelRef; exports.resolveRoute = _chunkG2FUJNA2cjs.resolveRoute;
14
+ exports.isSubscriptionProviderId = _chunkSVXC36MUcjs.isSubscriptionProviderId; exports.parseModelRef = _chunkSVXC36MUcjs.parseModelRef; exports.pickModelRefFromList = _chunkSVXC36MUcjs.pickModelRefFromList; exports.resolveRoute = _chunkSVXC36MUcjs.resolveRoute;
@@ -1,7 +1,7 @@
1
1
  import '../ports/provider-config-source.cjs';
2
2
  import '../provider-proxy/types.cjs';
3
- import './types.cjs';
4
- export { R as RouteResolveError, a as RouteResolveResult, i as isSubscriptionProviderId, p as parseModelRef, r as resolveRoute } from '../routeResolver-BrbK6ja9.cjs';
3
+ import '../types-aBFFXoBz.cjs';
4
+ export { R as RouteResolveError, b as RouteResolveResult, i as isSubscriptionProviderId, p as parseModelRef, a as pickModelRefFromList, r as resolveRoute } from '../routeResolver-CbG5uBgm.cjs';
5
5
  import '@omnicross/contracts/llm-config';
6
6
  import '../transformer/types.cjs';
7
7
  import '../transformer/TransformerService.cjs';
@@ -16,4 +16,10 @@ import '../pipeline/SubscriptionAuthSource.cjs';
16
16
  import '../pipeline/SubscriptionAuthStrategy.cjs';
17
17
  import '../ports/web-search-backend.cjs';
18
18
  import '@omnicross/contracts/websearch-types';
19
+ import '@omnicross/contracts/account-tokens-types';
20
+ import '@omnicross/contracts/audit-types';
21
+ import '@omnicross/contracts/billing-types';
22
+ import '@omnicross/contracts/health-logging-types';
23
+ import '@omnicross/contracts/voucher-types';
24
+ import '@omnicross/contracts/webhook-types';
19
25
  import '../ProviderProxy-CnMQYN59.cjs';
@@ -1,7 +1,7 @@
1
1
  import '../ports/provider-config-source.js';
2
2
  import '../provider-proxy/types.js';
3
- import './types.js';
4
- export { R as RouteResolveError, a as RouteResolveResult, i as isSubscriptionProviderId, p as parseModelRef, r as resolveRoute } from '../routeResolver-HE-ZO0fO.js';
3
+ import '../types-6OUY_xfA.js';
4
+ export { R as RouteResolveError, b as RouteResolveResult, i as isSubscriptionProviderId, p as parseModelRef, a as pickModelRefFromList, r as resolveRoute } from '../routeResolver-B1NglTfe.js';
5
5
  import '@omnicross/contracts/llm-config';
6
6
  import '../transformer/types.js';
7
7
  import '../transformer/TransformerService.js';
@@ -16,4 +16,10 @@ import '../pipeline/SubscriptionAuthSource.js';
16
16
  import '../pipeline/SubscriptionAuthStrategy.js';
17
17
  import '../ports/web-search-backend.js';
18
18
  import '@omnicross/contracts/websearch-types';
19
+ import '@omnicross/contracts/account-tokens-types';
20
+ import '@omnicross/contracts/audit-types';
21
+ import '@omnicross/contracts/billing-types';
22
+ import '@omnicross/contracts/health-logging-types';
23
+ import '@omnicross/contracts/voucher-types';
24
+ import '@omnicross/contracts/webhook-types';
19
25
  import '../ProviderProxy-C-xqrkKi.js';
@@ -1,11 +1,14 @@
1
1
  import {
2
2
  isSubscriptionProviderId,
3
3
  parseModelRef,
4
+ pickModelRefFromList,
4
5
  resolveRoute
5
- } from "../chunk-3MEACFK3.js";
6
+ } from "../chunk-CZHZGRU7.js";
6
7
  import "../chunk-AQ5TNQB7.js";
8
+ import "../chunk-XEKD23J5.js";
7
9
  export {
8
10
  isSubscriptionProviderId,
9
11
  parseModelRef,
12
+ pickModelRefFromList,
10
13
  resolveRoute
11
14
  };
@@ -1 +1,6 @@
1
- "use strict";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk4IH4EL7Mcjs = require('../chunk-4IH4EL7M.cjs');
4
+
5
+
6
+ exports.ENDPOINT_MODEL_KINDS = _chunk4IH4EL7Mcjs.ENDPOINT_MODEL_KINDS;
@@ -1,6 +1,14 @@
1
- import { ProviderConfigSource } from '../ports/provider-config-source.cjs';
2
- import { P as ProviderProxy } from '../ProviderProxy-CnMQYN59.cjs';
3
- import { ProviderProxyDeps } from '../provider-proxy/types.cjs';
1
+ import '@omnicross/contracts/account-tokens-types';
2
+ import '@omnicross/contracts/audit-types';
3
+ import '@omnicross/contracts/billing-types';
4
+ import '@omnicross/contracts/health-logging-types';
5
+ import '@omnicross/contracts/voucher-types';
6
+ import '@omnicross/contracts/webhook-types';
7
+ import '../logger-4GvQNzhE.cjs';
8
+ import '../ports/provider-config-source.cjs';
9
+ import '../ProviderProxy-CnMQYN59.cjs';
10
+ import '../provider-proxy/types.cjs';
11
+ export { T as AccountHealthConfig, A as AccountProbeConfig, C as ChatDispatchMode, a as ConcurrencyQueueConfig, E as ENDPOINT_MODEL_KINDS, b as EndpointRoutingConfig, F as FingerprintConfig, i as KindMappedEndpoint, M as MessagesModelKind, j as ModelKind, k as ModelPrefixTargets, P as ModelRef, l as OutboundApiDeps, m as OutboundApiKeyCreated, n as OutboundApiKeyInfo, o as OutboundApiServerConfig, p as OutboundApiServerStatus, q as OutboundEndpoint, r as OutboundFormatUrls, s as OutboundKeyActivationMode, O as OutboundKeyDb, t as OutboundKeyDbRow, W as OutboundKeyModelRestrictionMode, u as OutboundKeyPolicy, v as OutboundProxyConfig, R as RequestRole, w as ResponsesModelKind, U as UserMessageQueueConfig } from '../types-aBFFXoBz.cjs';
4
12
  import '@omnicross/contracts/llm-config';
5
13
  import '../transformer/types.cjs';
6
14
  import '../transformer/TransformerService.cjs';
@@ -9,149 +17,8 @@ import '@omnicross/contracts/completion-types';
9
17
  import '@omnicross/contracts/subscription-types';
10
18
  import '@omnicross/contracts/usage-types';
11
19
  import '../completion/ApiKeyPoolService.cjs';
12
- import '../logger-4GvQNzhE.cjs';
13
20
  import '../pipeline/AuthSource.cjs';
14
21
  import '../pipeline/SubscriptionAuthSource.cjs';
15
22
  import '../pipeline/SubscriptionAuthStrategy.cjs';
16
23
  import '../ports/web-search-backend.cjs';
17
24
  import '@omnicross/contracts/websearch-types';
18
-
19
- /**
20
- * Shared contract types for the outbound API server (`outbound-api-server`).
21
- *
22
- * The outbound server is a SEPARATE long-lived HTTP listener (distinct from the
23
- * resident loopback `ProviderProxy`) that authenticates external callers via
24
- * named API keys and routes their requests through the EXISTING `provider-proxy`
25
- * ingress parsers + transformer — there is exactly one conversion stack.
26
- *
27
- * These types are kept in their own module so the server, router, auth, rate
28
- * limiter, role detection, and route resolver can share shapes without circular
29
- * imports.
30
- *
31
- * @module outbound-api/types
32
- */
33
-
34
- /** The four endpoints, 1:1 with the four wire-format ingress parsers. */
35
- type OutboundEndpoint = 'chat' | 'responses' | 'messages' | 'gemini';
36
- /** A `"providerId,modelId"` model reference (mirrors `RouterConfig` vocab). */
37
- type ModelRef = string;
38
- /** The detected request role; precedence vision > background > default. */
39
- type RequestRole = 'vision' | 'background' | 'default';
40
- /**
41
- * Per-endpoint routing config. Persisted independently of the global
42
- * "默认模型" settings tab; survives restart.
43
- */
44
- interface EndpointRoutingConfig {
45
- /** Which of the four endpoints this block configures. */
46
- endpoint: OutboundEndpoint;
47
- /** REQUIRED — model for normal (non-vision, non-background) requests. */
48
- defaultModel: ModelRef;
49
- /** REQUIRED — model for background/probe/small-task requests. */
50
- backgroundModel: ModelRef;
51
- /** OPTIONAL — model for requests carrying image/vision content. */
52
- visionModel?: ModelRef;
53
- /** Gates subscription-vs-BYO provider selection. Default FALSE. */
54
- useSubscription: boolean;
55
- /**
56
- * OPTIONAL per-endpoint "background model id" override list (human decision
57
- * after the proposal). When set, an incoming requested model id appearing in
58
- * this list is classified as the BACKGROUND role; otherwise the registry
59
- * small/haiku-class signal is the baseline. Empty/unset → registry signal
60
- * only. Compared against the requested model id (bare or `providerId,modelId`).
61
- */
62
- backgroundModelIds?: string[];
63
- }
64
- /** The persisted server config. */
65
- interface OutboundApiServerConfig {
66
- /** When false the listener never binds (off by default). */
67
- enabled: boolean;
68
- /** When true the listener binds `0.0.0.0` (LAN) instead of `127.0.0.1`. */
69
- networkBinding: boolean;
70
- /** Per-endpoint routing config, one per endpoint (4 entries). */
71
- endpoints: EndpointRoutingConfig[];
72
- /** Persisted port (fixed default; falls back to ephemeral on EADDRINUSE). */
73
- port?: number;
74
- }
75
- /** A live status snapshot the Settings tab renders. */
76
- interface OutboundApiServerStatus {
77
- running: boolean;
78
- /** Actual bound port (0 when not running). */
79
- port: number;
80
- /** Loopback base URL (always present when running). */
81
- loopbackUrl: string | null;
82
- /** LAN base URL (present only when network binding is on). */
83
- lanUrl: string | null;
84
- /** The four format endpoint URLs (loopback). */
85
- formats: OutboundFormatUrls | null;
86
- /** The four format endpoint URLs over the LAN (only when network binding on). */
87
- lanFormats: OutboundFormatUrls | null;
88
- }
89
- /** The four format endpoint URLs for one base. */
90
- interface OutboundFormatUrls {
91
- chat: string;
92
- responses: string;
93
- messages: string;
94
- gemini: string;
95
- }
96
- /** A stored key DTO (never carries the plaintext secret). */
97
- interface OutboundApiKeyInfo {
98
- id: string;
99
- name: string;
100
- keyPrefix: string;
101
- enabled: boolean;
102
- createdAt: number;
103
- lastUsedAt: number | null;
104
- revoked: boolean;
105
- }
106
- /** The one-time create result; `plaintextOnce` is shown exactly once. */
107
- interface OutboundApiKeyCreated {
108
- id: string;
109
- name: string;
110
- keyPrefix: string;
111
- createdAt: number;
112
- plaintextOnce: string;
113
- }
114
- /**
115
- * Structural subset of the DB the outbound server needs — the named-key CRUD
116
- * surface. Kept structural so the server module does not depend on the full
117
- * `DbRpc`.
118
- */
119
- interface OutboundKeyDbRow {
120
- id: string;
121
- name: string;
122
- keyHash: string;
123
- keyPrefix: string;
124
- enabled: boolean;
125
- createdAt: number;
126
- lastUsedAt: number | null;
127
- revokedAt: number | null;
128
- }
129
- interface OutboundKeyDb {
130
- outboundApiKeysList(): Promise<OutboundKeyDbRow[]>;
131
- outboundApiKeysGetByHash(hash: string): Promise<OutboundKeyDbRow | null>;
132
- outboundApiKeysCreate(input: {
133
- id: string;
134
- name: string;
135
- keyHash: string;
136
- keyPrefix: string;
137
- createdAt?: number;
138
- }): Promise<OutboundKeyDbRow>;
139
- outboundApiKeysRevoke(id: string): Promise<boolean>;
140
- outboundApiKeysTouchLastUsed(id: string): Promise<boolean>;
141
- outboundApiKeysSetEnabled(id: string, enabled: boolean): Promise<boolean>;
142
- }
143
- /**
144
- * App-session-scoped dependencies the outbound server needs. The resident
145
- * `ProviderProxy` is shared so the new listener mints routes on the SAME route
146
- * map and reuses the SAME ingress parsers + transformer.
147
- */
148
- interface OutboundApiDeps {
149
- readonly db: OutboundKeyDb;
150
- readonly llmConfig: ProviderConfigSource;
151
- /** The resident proxy — shared for route minting + ingress dispatch. */
152
- readonly providerProxy: ProviderProxy;
153
- /** The proxy's app-session deps (reused verbatim for `routeRequest`). */
154
- readonly proxyDeps: ProviderProxyDeps;
155
- }
156
-
157
- export type { EndpointRoutingConfig, ModelRef, OutboundApiDeps, OutboundApiKeyCreated, OutboundApiKeyInfo, OutboundApiServerConfig, OutboundApiServerStatus, OutboundEndpoint, OutboundFormatUrls, OutboundKeyDb, OutboundKeyDbRow, RequestRole };