@omnicross/core 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/NOTICE +57 -57
- package/README.md +15 -15
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +4 -4
- package/dist/auth/GeminiCodeAssistProjectResolver.js +3 -3
- package/dist/chunk-3QFXFCHG.js +33 -0
- package/dist/chunk-4YINUUKQ.cjs +33 -0
- package/dist/chunk-7Y47UCF2.js +142 -0
- package/dist/chunk-APYG5QD7.cjs +50 -0
- package/dist/{chunk-CWM2ZDU5.js → chunk-BPKCU575.js} +3 -10
- package/dist/{chunk-2FMI2B6V.cjs → chunk-DKPXN34V.cjs} +222 -448
- package/dist/chunk-E3UCVHLP.cjs +142 -0
- package/dist/chunk-FCR77GYM.cjs +33 -0
- package/dist/{chunk-N5QFKSDO.js → chunk-HRRYG2AX.js} +2 -1
- package/dist/{chunk-KUU2RNG6.cjs → chunk-HYN75H6G.cjs} +3 -0
- package/dist/{chunk-JO5NLTLY.js → chunk-IK3KE3AU.js} +3 -0
- package/dist/chunk-K5NM7VAH.js +33 -0
- package/dist/{chunk-Y6OM7EV7.cjs → chunk-KFI44N2R.cjs} +2 -1
- package/dist/{chunk-S6JGLF3G.cjs → chunk-OCEUVQHW.cjs} +27 -4
- package/dist/chunk-OE6TDIWW.js +22 -0
- package/dist/chunk-OZFM4X3S.js +18 -0
- package/dist/{chunk-4DECIFU7.js → chunk-QYTT6GE3.js} +62 -288
- package/dist/{chunk-FFALUUZZ.cjs → chunk-RGTR7CIO.cjs} +5 -5
- package/dist/{chunk-3QOSDDNI.cjs → chunk-SNYBEXLB.cjs} +6 -13
- package/dist/{chunk-2DCNB7DF.cjs → chunk-SU2GCLAC.cjs} +30 -10
- package/dist/{chunk-5HTVET6E.js → chunk-TIER4SUC.js} +24 -4
- package/dist/{chunk-CZHZGRU7.js → chunk-UHGVBFU3.js} +2 -0
- package/dist/chunk-UIBD2YY5.cjs +22 -0
- package/dist/{chunk-SVXC36MU.cjs → chunk-VACWOIRE.cjs} +2 -0
- package/dist/{chunk-MQNDWYPN.js → chunk-VPBAUQ2M.js} +4 -4
- package/dist/chunk-WLYIIEAF.js +50 -0
- package/dist/{chunk-BO4RFWBR.js → chunk-XK5CIRMQ.js} +24 -1
- package/dist/chunk-XSVNC2UD.cjs +18 -0
- package/dist/completion/CompletionService.cjs +22 -16
- package/dist/completion/CompletionService.js +21 -15
- package/dist/completion.cjs +24 -18
- package/dist/completion.js +23 -17
- package/dist/index.cjs +33 -24
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +42 -33
- package/dist/keyPolicy-Cp0FntZl.d.cts +90 -0
- package/dist/keyPolicy-Cp0FntZl.d.ts +90 -0
- package/dist/outbound-api/auditCapture.cjs +9 -0
- package/dist/outbound-api/auditCapture.d.cts +52 -0
- package/dist/outbound-api/auditCapture.d.ts +52 -0
- package/dist/outbound-api/auditCapture.js +9 -0
- package/dist/outbound-api/auditRedact.cjs +8 -0
- package/dist/outbound-api/auditRedact.d.cts +30 -0
- package/dist/outbound-api/auditRedact.d.ts +30 -0
- package/dist/outbound-api/auditRedact.js +8 -0
- package/dist/outbound-api/billingCapture.cjs +8 -0
- package/dist/outbound-api/billingCapture.d.cts +61 -0
- package/dist/outbound-api/billingCapture.d.ts +61 -0
- package/dist/outbound-api/billingCapture.js +8 -0
- package/dist/outbound-api/quotaWarn.cjs +12 -0
- package/dist/outbound-api/quotaWarn.d.cts +43 -0
- package/dist/outbound-api/quotaWarn.d.ts +43 -0
- package/dist/outbound-api/quotaWarn.js +12 -0
- package/dist/outbound-api/routeResolver.cjs +2 -2
- package/dist/outbound-api/routeResolver.d.cts +3 -2
- package/dist/outbound-api/routeResolver.d.ts +3 -2
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/types.d.cts +2 -1
- package/dist/outbound-api/types.d.ts +2 -1
- package/dist/outbound-api.cjs +29 -20
- package/dist/outbound-api.d.cts +9 -140
- package/dist/outbound-api.d.ts +9 -140
- package/dist/outbound-api.js +28 -19
- package/dist/pipeline/AuthSource.d.cts +6 -0
- package/dist/pipeline/AuthSource.d.ts +6 -0
- package/dist/pipeline/SubscriptionAuthSource.cjs +2 -2
- package/dist/pipeline/SubscriptionAuthSource.js +1 -1
- package/dist/pipeline/SubscriptionAuthStrategy.d.cts +6 -0
- package/dist/pipeline/SubscriptionAuthStrategy.d.ts +6 -0
- package/dist/pipeline/auditUsageStash.cjs +10 -0
- package/dist/pipeline/auditUsageStash.d.cts +37 -0
- package/dist/pipeline/auditUsageStash.d.ts +37 -0
- package/dist/pipeline/auditUsageStash.js +10 -0
- package/dist/pipeline/executeProviderCall.cjs +2 -2
- package/dist/pipeline/executeProviderCall.js +1 -1
- package/dist/pipeline/upstreamFetch.cjs +14 -0
- package/dist/pipeline/upstreamFetch.d.cts +83 -0
- package/dist/pipeline/upstreamFetch.d.ts +83 -0
- package/dist/pipeline/upstreamFetch.js +14 -0
- package/dist/pipeline/webhookEmit.cjs +10 -0
- package/dist/pipeline/webhookEmit.d.cts +36 -0
- package/dist/pipeline/webhookEmit.d.ts +36 -0
- package/dist/pipeline/webhookEmit.js +10 -0
- package/dist/ports.d.cts +2 -1
- package/dist/ports.d.ts +2 -1
- package/dist/provider-proxy/ProviderProxy.cjs +22 -16
- package/dist/provider-proxy/ProviderProxy.js +21 -15
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +22 -16
- package/dist/provider-proxy/ingress/providerProxyShared.js +21 -15
- package/dist/provider-proxy/types.d.cts +7 -0
- package/dist/provider-proxy/types.d.ts +7 -0
- package/dist/provider-proxy.cjs +22 -16
- package/dist/provider-proxy.js +21 -15
- package/dist/{routeResolver-B1NglTfe.d.ts → routeResolver-C4T7yClx.d.ts} +1 -1
- package/dist/{routeResolver-CbG5uBgm.d.cts → routeResolver-CB3tvJKy.d.cts} +1 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +2 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +1 -1
- package/dist/transformer/transformers.cjs +6 -6
- package/dist/transformer/transformers.js +5 -5
- package/dist/transformer.cjs +7 -7
- package/dist/transformer.js +6 -6
- package/dist/{types-aBFFXoBz.d.cts → types-B8Arpxn0.d.cts} +14 -90
- package/dist/{types-6OUY_xfA.d.ts → types-lgPYQuZS.d.ts} +14 -90
- package/dist/usage/usage-recorder.cjs +3 -2
- package/dist/usage/usage-recorder.js +2 -1
- package/dist/usage.cjs +3 -2
- package/dist/usage.js +2 -1
- package/package.json +64 -64
package/dist/index.cjs
CHANGED
|
@@ -71,11 +71,7 @@
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var _chunk2FMI2B6Vcjs = require('./chunk-2FMI2B6V.cjs');
|
|
74
|
+
var _chunkDKPXN34Vcjs = require('./chunk-DKPXN34V.cjs');
|
|
79
75
|
|
|
80
76
|
|
|
81
77
|
|
|
@@ -83,43 +79,50 @@ var _chunkHQP3K7PUcjs = require('./chunk-HQP3K7PU.cjs');
|
|
|
83
79
|
require('./chunk-FZ46M34D.cjs');
|
|
84
80
|
|
|
85
81
|
|
|
86
|
-
var _chunk46ZIFWYGcjs = require('./chunk-46ZIFWYG.cjs');
|
|
87
|
-
|
|
88
|
-
|
|
89
82
|
var _chunk3OPYJG76cjs = require('./chunk-3OPYJG76.cjs');
|
|
90
83
|
|
|
91
84
|
|
|
92
|
-
var
|
|
93
|
-
require('./chunk-C72S6TTV.cjs');
|
|
85
|
+
var _chunkRGTR7CIOcjs = require('./chunk-RGTR7CIO.cjs');
|
|
94
86
|
require('./chunk-DWKQZ2SK.cjs');
|
|
95
87
|
require('./chunk-4VAVYUZS.cjs');
|
|
96
88
|
require('./chunk-7YN22L2H.cjs');
|
|
97
|
-
require('./chunk-
|
|
89
|
+
require('./chunk-SU2GCLAC.cjs');
|
|
90
|
+
require('./chunk-C72S6TTV.cjs');
|
|
98
91
|
require('./chunk-EYZYXJTJ.cjs');
|
|
99
92
|
|
|
100
93
|
|
|
101
94
|
var _chunkYMFAJFQTcjs = require('./chunk-YMFAJFQT.cjs');
|
|
102
95
|
|
|
103
96
|
|
|
104
|
-
var
|
|
97
|
+
var _chunkSNYBEXLBcjs = require('./chunk-SNYBEXLB.cjs');
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
var _chunk46ZIFWYGcjs = require('./chunk-46ZIFWYG.cjs');
|
|
105
101
|
require('./chunk-GBHYAGX3.cjs');
|
|
106
102
|
require('./chunk-RPII3E6Z.cjs');
|
|
107
103
|
require('./chunk-6RPZADX3.cjs');
|
|
108
104
|
require('./chunk-QWBWGODS.cjs');
|
|
105
|
+
require('./chunk-UIBD2YY5.cjs');
|
|
106
|
+
require('./chunk-R3HK6R4B.cjs');
|
|
107
|
+
require('./chunk-HYN75H6G.cjs');
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
var _chunkQ27JY5RGcjs = require('./chunk-Q27JY5RG.cjs');
|
|
111
|
+
require('./chunk-QXD4MV2X.cjs');
|
|
109
112
|
require('./chunk-NYUNU75A.cjs');
|
|
110
113
|
require('./chunk-VQY5W4YW.cjs');
|
|
111
|
-
require('./chunk-
|
|
114
|
+
require('./chunk-KFI44N2R.cjs');
|
|
112
115
|
|
|
113
116
|
|
|
114
117
|
var _chunkSVNDB62Dcjs = require('./chunk-SVNDB62D.cjs');
|
|
115
|
-
|
|
116
|
-
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
var _chunkAPYG5QD7cjs = require('./chunk-APYG5QD7.cjs');
|
|
117
121
|
require('./chunk-L74VDN4A.cjs');
|
|
118
|
-
require('./chunk-
|
|
122
|
+
require('./chunk-4YINUUKQ.cjs');
|
|
123
|
+
|
|
119
124
|
|
|
120
125
|
|
|
121
|
-
var _chunkQ27JY5RGcjs = require('./chunk-Q27JY5RG.cjs');
|
|
122
|
-
require('./chunk-QXD4MV2X.cjs');
|
|
123
126
|
|
|
124
127
|
|
|
125
128
|
|
|
@@ -130,12 +133,14 @@ require('./chunk-QXD4MV2X.cjs');
|
|
|
130
133
|
|
|
131
134
|
|
|
132
135
|
|
|
133
|
-
var _chunkA2YMUCBTcjs = require('./chunk-A2YMUCBT.cjs');
|
|
134
136
|
|
|
135
137
|
|
|
136
138
|
|
|
139
|
+
var _chunkVACWOIREcjs = require('./chunk-VACWOIRE.cjs');
|
|
140
|
+
require('./chunk-QBZJ7P2T.cjs');
|
|
137
141
|
|
|
138
142
|
|
|
143
|
+
var _chunk4IH4EL7Mcjs = require('./chunk-4IH4EL7M.cjs');
|
|
139
144
|
|
|
140
145
|
|
|
141
146
|
|
|
@@ -146,12 +151,16 @@ var _chunkA2YMUCBTcjs = require('./chunk-A2YMUCBT.cjs');
|
|
|
146
151
|
|
|
147
152
|
|
|
148
153
|
|
|
154
|
+
var _chunkA2YMUCBTcjs = require('./chunk-A2YMUCBT.cjs');
|
|
149
155
|
|
|
150
|
-
var _chunkSVXC36MUcjs = require('./chunk-SVXC36MU.cjs');
|
|
151
|
-
require('./chunk-QBZJ7P2T.cjs');
|
|
152
156
|
|
|
157
|
+
var _chunkE3UCVHLPcjs = require('./chunk-E3UCVHLP.cjs');
|
|
153
158
|
|
|
154
|
-
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
var _chunkFCR77GYMcjs = require('./chunk-FCR77GYM.cjs');
|
|
162
|
+
require('./chunk-AEOZIDEB.cjs');
|
|
163
|
+
require('./chunk-XSVNC2UD.cjs');
|
|
155
164
|
|
|
156
165
|
|
|
157
166
|
|
|
@@ -164,9 +173,9 @@ var _chunk4IH4EL7Mcjs = require('./chunk-4IH4EL7M.cjs');
|
|
|
164
173
|
|
|
165
174
|
|
|
166
175
|
var _chunkSUEGJ75Dcjs = require('./chunk-SUEGJ75D.cjs');
|
|
167
|
-
require('./chunk-S6JGLF3G.cjs');
|
|
168
176
|
require('./chunk-RSJ3TWJQ.cjs');
|
|
169
177
|
require('./chunk-YGXJGRFI.cjs');
|
|
178
|
+
require('./chunk-OCEUVQHW.cjs');
|
|
170
179
|
|
|
171
180
|
|
|
172
181
|
|
|
@@ -316,4 +325,4 @@ var _chunkUNEFIWXIcjs = require('./chunk-UNEFIWXI.cjs');
|
|
|
316
325
|
|
|
317
326
|
|
|
318
327
|
|
|
319
|
-
exports.AUDIT_REDACTED =
|
|
328
|
+
exports.AUDIT_REDACTED = _chunkFCR77GYMcjs.AUDIT_REDACTED; exports.BuiltinToolExecutor = _chunkNZYN7C3Pcjs.BuiltinToolExecutor; exports.CompletionService = _chunkDKPXN34Vcjs.CompletionService; exports.ConcurrencyQueueFullError = _chunkDKPXN34Vcjs.ConcurrencyQueueFullError; exports.ConcurrencyWaitCancelledError = _chunkDKPXN34Vcjs.ConcurrencyWaitCancelledError; exports.ConcurrencyWaitTimeoutError = _chunkDKPXN34Vcjs.ConcurrencyWaitTimeoutError; exports.DEFAULT_ACCOUNT_PROBE = _chunkDKPXN34Vcjs.DEFAULT_ACCOUNT_PROBE; exports.DEFAULT_CONCURRENCY_QUEUE = _chunkDKPXN34Vcjs.DEFAULT_CONCURRENCY_QUEUE; exports.DEFAULT_FINGERPRINT = _chunkDKPXN34Vcjs.DEFAULT_FINGERPRINT; exports.DEFAULT_OUTBOUND_PORT = _chunkDKPXN34Vcjs.DEFAULT_OUTBOUND_PORT; exports.DEFAULT_ROUTE_IDLE_MS = _chunkDKPXN34Vcjs.DEFAULT_ROUTE_IDLE_MS; exports.DEFAULT_USER_MESSAGE_QUEUE = _chunkDKPXN34Vcjs.DEFAULT_USER_MESSAGE_QUEUE; exports.ENDPOINT_MODEL_KINDS = _chunk4IH4EL7Mcjs.ENDPOINT_MODEL_KINDS; exports.KeySpendTracker = _chunkDKPXN34Vcjs.KeySpendTracker; exports.KeyedMutex = _chunkDKPXN34Vcjs.KeyedMutex; exports.NATIVE_SEARCH_TOOL_NAMES = _chunkGMMT7RVNcjs.NATIVE_SEARCH_TOOL_NAMES; exports.OPENROUTER_APP_HEADERS = _chunkUNEFIWXIcjs.OPENROUTER_APP_HEADERS; exports.OUTBOUND_API_SERVER_CONFIG_KEY = _chunkDKPXN34Vcjs.OUTBOUND_API_SERVER_CONFIG_KEY; exports.OutboundApiConfigError = _chunkDKPXN34Vcjs.OutboundApiConfigError; exports.OutboundApiServer = _chunkDKPXN34Vcjs.OutboundApiServer; exports.OutboundConcurrencyGate = _chunkDKPXN34Vcjs.OutboundConcurrencyGate; exports.OutboundRateLimiter = _chunkDKPXN34Vcjs.OutboundRateLimiter; exports.PricingEngine = _chunkYMFAJFQTcjs.PricingEngine; exports.ProviderProxy = _chunkDKPXN34Vcjs.ProviderProxy; exports.ProviderProxyRouteMap = _chunkDKPXN34Vcjs.ProviderProxyRouteMap; exports.SUBSCRIPTION_PROVIDER_IDS = _chunkVACWOIREcjs.SUBSCRIPTION_PROVIDER_IDS; exports.SerialQueueTimeoutError = _chunkDKPXN34Vcjs.SerialQueueTimeoutError; exports.TransformerChainExecutor = _chunk46ZIFWYGcjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.UsageRecorder = _chunkSNYBEXLBcjs.UsageRecorder; exports.UserMessageSerialQueue = _chunkDKPXN34Vcjs.UserMessageSerialQueue; exports.__resetOutboundApiServerForTests = _chunkDKPXN34Vcjs.__resetOutboundApiServerForTests; exports.__resetProviderProxyForTests = _chunkDKPXN34Vcjs.__resetProviderProxyForTests; exports.addOpenRouterProviderToRequest = _chunkDKPXN34Vcjs.addOpenRouterProviderToRequest; exports.applyAugmentation = _chunkJMJBSACDcjs.applyAugmentation; exports.attachStreamEventBuffer = _chunkDKPXN34Vcjs.attach; exports.beginAuditCapture = _chunkE3UCVHLPcjs.beginAuditCapture; exports.beginBillingCapture = _chunkAPYG5QD7cjs.beginBillingCapture; exports.buildAnthropicApiUrl = _chunkA2YMUCBTcjs.buildAnthropicApiUrl; exports.buildAzureOpenAIApiUrl = _chunkA2YMUCBTcjs.buildAzureOpenAIApiUrl; exports.buildGeminiApiUrl = _chunkA2YMUCBTcjs.buildGeminiApiUrl; exports.buildNativeSearchAugmentation = _chunkJMJBSACDcjs.buildNativeSearchAugmentation; exports.buildOpenAIApiUrl = _chunkA2YMUCBTcjs.buildOpenAIApiUrl; exports.buildOpenAIResponseApiUrl = _chunkA2YMUCBTcjs.buildOpenAIResponseApiUrl; exports.buildProviderApiUrl = _chunkA2YMUCBTcjs.buildProviderApiUrl; exports.checkKeyQuota = _chunkDKPXN34Vcjs.checkKeyQuota; exports.classifyModelPrefix = _chunkVACWOIREcjs.classifyModelPrefix; exports.computeKeyExpiry = _chunkDKPXN34Vcjs.computeKeyExpiry; exports.computeVoucherGrant = _chunkDKPXN34Vcjs.computeVoucherGrant; exports.convertAnthropicRequestToOpenAI = _chunkSUEGJ75Dcjs.convertAnthropicRequestToOpenAI; exports.convertAnthropicStreamToOpenAI = _chunkSUEGJ75Dcjs.convertAnthropicStreamToOpenAI; exports.convertAnthropicToOpenAI = _chunkSUEGJ75Dcjs.convertAnthropicToOpenAI; exports.convertAnthropicToOpenAIWithThinking = _chunkSUEGJ75Dcjs.convertAnthropicToOpenAIWithThinking; exports.convertMessageToAnthropic = _chunkDKPXN34Vcjs.convertMessageToAnthropic; exports.convertMessageToGemini = _chunkDKPXN34Vcjs.convertMessageToGemini; exports.convertMessageToOpenAI = _chunkDKPXN34Vcjs.convertMessageToOpenAI; exports.convertOpenAIResponseToAnthropic = _chunkSUEGJ75Dcjs.convertOpenAIResponseToAnthropic; exports.convertOpenAIStreamToAnthropic = _chunkSUEGJ75Dcjs.convertOpenAIStreamToAnthropic; exports.convertOpenAIToAnthropic = _chunkSUEGJ75Dcjs.convertOpenAIToAnthropic; exports.convertOpenAIToAnthropicWithThinking = _chunkSUEGJ75Dcjs.convertOpenAIToAnthropicWithThinking; exports.createNamedKey = _chunkDKPXN34Vcjs.createNamedKey; exports.createSSEParser = _chunkHQP3K7PUcjs.createSSEParser; exports.defaultServerConfig = _chunkDKPXN34Vcjs.defaultServerConfig; exports.detectModelKind = _chunkVACWOIREcjs.detectModelKind; exports.detectNativeSearch = _chunkJMJBSACDcjs.detectNativeSearch; exports.detectRequestRole = _chunkVACWOIREcjs.detectRequestRole; exports.emitStreamEvent = _chunkDKPXN34Vcjs.emit; exports.endpointSupportsSubscription = _chunkVACWOIREcjs.endpointSupportsSubscription; exports.endpointToIngressFormat = _chunkVACWOIREcjs.endpointToIngressFormat; exports.extractRouteToken = _chunkDKPXN34Vcjs.extractRouteToken; exports.formatUrls = _chunkDKPXN34Vcjs.formatUrls; exports.generateVoucherCode = _chunkDKPXN34Vcjs.generateVoucherCode; exports.getBuiltinSearchTools = _chunkNZYN7C3Pcjs.getBuiltinSearchTools; exports.getOpenRouterAppIdentity = _chunkUNEFIWXIcjs.getOpenRouterAppIdentity; exports.getOpenRouterProviderConfig = _chunkDKPXN34Vcjs.getOpenRouterProviderConfig; exports.getOutboundApiServer = _chunkDKPXN34Vcjs.getOutboundApiServer; exports.getProviderHeaders = _chunkQ27JY5RGcjs.getProviderHeaders; exports.getProviderProxy = _chunkDKPXN34Vcjs.getProviderProxy; exports.handleVoucherRedeem = _chunkDKPXN34Vcjs.handleVoucherRedeem; exports.hasImageContent = _chunkSUEGJ75Dcjs.hasImageContent; exports.hasThinkingEnabled = _chunkSUEGJ75Dcjs.hasThinkingEnabled; exports.hashKey = _chunkDKPXN34Vcjs.hashKey; exports.hashVoucherCode = _chunkDKPXN34Vcjs.hashVoucherCode; exports.isConcurrencyRejection = _chunkDKPXN34Vcjs.isConcurrencyRejection; exports.isKindMappedEndpoint = _chunkVACWOIREcjs.isKindMappedEndpoint; exports.isOpenRouterProvider = _chunkUNEFIWXIcjs.isOpenRouterProvider; exports.isRedeemRequest = _chunkDKPXN34Vcjs.isRedeemRequest; exports.isSerialQueueTimeout = _chunkDKPXN34Vcjs.isSerialQueueTimeout; exports.isSubscriptionProviderId = _chunkVACWOIREcjs.isSubscriptionProviderId; exports.isUserMessageRequest = _chunkDKPXN34Vcjs.isUserMessageRequest; exports.loadServerConfig = _chunkDKPXN34Vcjs.loadServerConfig; exports.mergeServerConfig = _chunkDKPXN34Vcjs.mergeServerConfig; exports.modelKindsForEndpoint = _chunkVACWOIREcjs.modelKindsForEndpoint; exports.newVoucherId = _chunkDKPXN34Vcjs.newVoucherId; exports.normalizeAccountProbe = _chunkDKPXN34Vcjs.normalizeAccountProbe; exports.normalizeAudit = _chunkDKPXN34Vcjs.normalizeAudit; exports.normalizeAzureEndpoint = _chunkA2YMUCBTcjs.normalizeAzureEndpoint; exports.normalizeBilling = _chunkDKPXN34Vcjs.normalizeBilling; exports.normalizeFingerprint = _chunkDKPXN34Vcjs.normalizeFingerprint; exports.normalizePrefixTargets = _chunkDKPXN34Vcjs.normalizePrefixTargets; exports.normalizeProxyConfig = _chunkDKPXN34Vcjs.normalizeProxyConfig; exports.normalizeProxySegment = _chunkDKPXN34Vcjs.normalizeProxySegment; exports.normalizeQueueSegments = _chunkDKPXN34Vcjs.normalizeQueueSegments; exports.normalizeServerConfig = _chunkDKPXN34Vcjs.normalizeServerConfig; exports.normalizeVoucher = _chunkDKPXN34Vcjs.normalizeVoucher; exports.normalizeWebhookDestination = _chunkDKPXN34Vcjs.normalizeWebhookDestination; exports.normalizeWebhookSegment = _chunkDKPXN34Vcjs.normalizeWebhookSegment; exports.parseModelRef = _chunkVACWOIREcjs.parseModelRef; exports.pickModelRefFromList = _chunkVACWOIREcjs.pickModelRefFromList; exports.randomBase62 = _chunkDKPXN34Vcjs.randomBase62; exports.redactAuditText = _chunkFCR77GYMcjs.redactAuditText; exports.registerBuiltinTransformers = _chunkRGTR7CIOcjs.registerBuiltinTransformers; exports.registerStreamEventBuffer = _chunkDKPXN34Vcjs.register; exports.releaseStreamEventBuffer = _chunkDKPXN34Vcjs.release; exports.resolveApiFormat = _chunkA2YMUCBTcjs.resolveApiFormat; exports.resolvePrefixTarget = _chunkVACWOIREcjs.resolvePrefixTarget; exports.resolveProviderEndpoint = _chunkA2YMUCBTcjs.resolveProviderEndpoint; exports.resolveRoute = _chunkVACWOIREcjs.resolveRoute; exports.saveServerConfig = _chunkDKPXN34Vcjs.saveServerConfig; exports.serializeError = _chunkSVNDB62Dcjs.serializeError; exports.setOpenRouterAppIdentity = _chunkUNEFIWXIcjs.setOpenRouterAppIdentity; exports.startOfLocalDay = _chunkDKPXN34Vcjs.startOfLocalDay; exports.startOfLocalWeek = _chunkDKPXN34Vcjs.startOfLocalWeek; exports.streamSSEResponse = _chunkHQP3K7PUcjs.streamSSEResponse; exports.toVoucherInfo = _chunkDKPXN34Vcjs.toVoucherInfo; exports.validateEndpointModelConfig = _chunkVACWOIREcjs.validateEndpointModelConfig; exports.validateServerModelConfig = _chunkVACWOIREcjs.validateServerModelConfig; exports.verifyKey = _chunkDKPXN34Vcjs.verifyKey; exports.verifyPresentedKey = _chunkDKPXN34Vcjs.verifyPresentedKey; exports.voucherCodePrefix = _chunkDKPXN34Vcjs.voucherCodePrefix;
|
package/dist/index.d.cts
CHANGED
|
@@ -9,7 +9,7 @@ export { ProviderConfigSource } from './ports/provider-config-source.cjs';
|
|
|
9
9
|
export { UsageEventStore } from './ports/usage-event-store.cjs';
|
|
10
10
|
export { WebSearchBackend } from './ports/web-search-backend.cjs';
|
|
11
11
|
export { AnthropicIngressHandler, AnthropicIngressHandlerFactory, AnthropicRouteHandlerParams, AnthropicSdkHints, ExtendedContextHint, IngressFormat, ProviderProxyDeps, ProxyAttribution, RetryCallback, RouteAuthMode, RouteContext, StreamEventCallback, SubscriptionDispatchProfile, SubscriptionRequestSummary, TargetProviderFormat, UsageRecorderImport, UsageRecorderImport as UsageSink } from './provider-proxy/types.cjs';
|
|
12
|
-
export { A as AccountProbeConfig, C as ChatDispatchMode, a as ConcurrencyQueueConfig, E as ENDPOINT_MODEL_KINDS, b as EndpointRoutingConfig, F as FingerprintConfig, K as
|
|
12
|
+
export { A as AccountProbeConfig, C as ChatDispatchMode, a as ConcurrencyQueueConfig, E as ENDPOINT_MODEL_KINDS, b as EndpointRoutingConfig, F as FingerprintConfig, K as KeySpendReader, c as KeySpendSeeder, d as KeySpendTracker, e as KindMappedEndpoint, M as MessagesModelKind, f as ModelKind, g as ModelPrefixTargets, h as OutboundApiDeps, i as OutboundApiKeyCreated, j as OutboundApiKeyInfo, k as OutboundApiServerConfig, l as OutboundApiServerStatus, O as OutboundCredentialStore, m as OutboundEndpoint, n as OutboundFormatUrls, o as OutboundKeyActivationMode, O as OutboundKeyDb, p as OutboundKeyDbRow, q as OutboundKeyPolicy, r as OutboundProxyConfig, R as RequestRole, s as ResponsesModelKind, U as UserMessageQueueConfig, 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-B8Arpxn0.cjs';
|
|
13
13
|
export { CostCalculation, PricingEngine, PricingEngineOptions } from './usage/pricing-engine.cjs';
|
|
14
14
|
export { UsageRecordInput, UsageRecorder, UsageRecorderOptions } from './usage/usage-recorder.cjs';
|
|
15
15
|
export { A as ApiFormat, C as CompletionOptions, a as CompletionResult, N as NATIVE_SEARCH_TOOL_NAMES, b as NativeSearchAugmentation, c as NativeSearchDetectionResult, d as NativeSearchProvider, e as NativeSearchUserConfig, S as StreamCallbacks } from './types-BScIHmPr.cjs';
|
|
@@ -18,14 +18,18 @@ export { SimpleChatGeminiMessage, SimpleChatGeminiPart, StreamEvent, StreamEvent
|
|
|
18
18
|
export { buildAnthropicApiUrl, buildAzureOpenAIApiUrl, buildGeminiApiUrl, buildOpenAIApiUrl, buildOpenAIResponseApiUrl, buildProviderApiUrl, normalizeAzureEndpoint, resolveApiFormat, resolveProviderEndpoint } from './completion/url-builder.cjs';
|
|
19
19
|
export { applyAugmentation, buildNativeSearchAugmentation, detectNativeSearch } from './completion/NativeSearchInjector.cjs';
|
|
20
20
|
export { __resetProviderProxyForTests, extractRouteToken, getProviderProxy } from './provider-proxy.cjs';
|
|
21
|
-
export {
|
|
21
|
+
export { ApiServerSettingsStore, ApplyConfigInput, ConcurrencyQueueFullError, ConcurrencyWaitCancelledError, ConcurrencyWaitTimeoutError, DEFAULT_ACCOUNT_PROBE, DEFAULT_CONCURRENCY_QUEUE, DEFAULT_FINGERPRINT, DEFAULT_OUTBOUND_PORT, DEFAULT_USER_MESSAGE_QUEUE, EndpointModelConfigError, GateAcquireOptions, GateAcquisition, GateSlot, GateStatusEntry, KeyVerification, KeyedMutex, ModelPrefixKind, OUTBOUND_API_SERVER_CONFIG_KEY, OutboundApiConfigError, OutboundApiServer, OutboundConcurrencyGate, OutboundRateLimiter, SerialAcquireOptions, SerialQueueStatusEntry, SerialQueueTimeoutError, SerialSlot, UserMessageSerialQueue, 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 } from './outbound-api.cjs';
|
|
22
22
|
export { convertAnthropicRequestToOpenAI, convertAnthropicStreamToOpenAI, convertAnthropicToOpenAI, convertAnthropicToOpenAIWithThinking, convertOpenAIResponseToAnthropic, convertOpenAIStreamToAnthropic, convertOpenAIToAnthropic, convertOpenAIToAnthropicWithThinking, hasImageContent, hasThinkingEnabled } from './ApiConverter.cjs';
|
|
23
23
|
export { ChainExecutionOptions, TransformerChainExecutor } from './transformer/TransformerChainExecutor.cjs';
|
|
24
24
|
export { TransformerService } from './transformer/TransformerService.cjs';
|
|
25
25
|
export { registerBuiltinTransformers } from './transformer/transformers.cjs';
|
|
26
26
|
export { Annotation, ImageContent, MessageContent, ModelRoute, ModelTransformerConfig, ReasoningConfig, RequestConfig, RequestRouteInfo, ResolvedTransformerChain, StreamChunk, TextContent, ThinkLevel, ThinkingContent, ToolCall, ToolChoice, ToolParameterSchema, TransformRequestResult, Transformer, TransformerChainConfig, TransformerConfigEntry, TransformerConstructor, TransformerContext, TransformerLogger, TransformerOptions, TransformerReference, TransformerServiceConfig, UnifiedChatRequest, UnifiedChatResponse, UnifiedMessage, UnifiedTool, UrlCitation } from './transformer/types.cjs';
|
|
27
|
+
export { AUDIT_REDACTED, redactAuditText } from './outbound-api/auditRedact.cjs';
|
|
28
|
+
export { AuditCaptureContext, beginAuditCapture } from './outbound-api/auditCapture.cjs';
|
|
29
|
+
export { BillingCaptureContext, beginBillingCapture } from './outbound-api/billingCapture.cjs';
|
|
27
30
|
export { D as DEFAULT_ROUTE_IDLE_MS, P as ProviderProxy, a as ProviderProxyRouteMap } from './ProviderProxy-CnMQYN59.cjs';
|
|
28
|
-
export {
|
|
31
|
+
export { K as KeyCostLimits, a as KeyExpiryInput, b as KeyExpiryResult, c as KeySpend, Q as QuotaDecision, d as checkKeyQuota, e as computeKeyExpiry } from './keyPolicy-Cp0FntZl.cjs';
|
|
32
|
+
export { S as SUBSCRIPTION_PROVIDER_IDS, e as endpointSupportsSubscription, i as isSubscriptionProviderId, p as parseModelRef, a as pickModelRefFromList, r as resolveRoute } from './routeResolver-CB3tvJKy.cjs';
|
|
29
33
|
import '@omnicross/contracts/message-blocks';
|
|
30
34
|
import '@omnicross/contracts/completion-types';
|
|
31
35
|
import '@omnicross/contracts/mcp-types';
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { ProviderConfigSource } from './ports/provider-config-source.js';
|
|
|
9
9
|
export { UsageEventStore } from './ports/usage-event-store.js';
|
|
10
10
|
export { WebSearchBackend } from './ports/web-search-backend.js';
|
|
11
11
|
export { AnthropicIngressHandler, AnthropicIngressHandlerFactory, AnthropicRouteHandlerParams, AnthropicSdkHints, ExtendedContextHint, IngressFormat, ProviderProxyDeps, ProxyAttribution, RetryCallback, RouteAuthMode, RouteContext, StreamEventCallback, SubscriptionDispatchProfile, SubscriptionRequestSummary, TargetProviderFormat, UsageRecorderImport, UsageRecorderImport as UsageSink } from './provider-proxy/types.js';
|
|
12
|
-
export { A as AccountProbeConfig, C as ChatDispatchMode, a as ConcurrencyQueueConfig, E as ENDPOINT_MODEL_KINDS, b as EndpointRoutingConfig, F as FingerprintConfig, K as
|
|
12
|
+
export { A as AccountProbeConfig, C as ChatDispatchMode, a as ConcurrencyQueueConfig, E as ENDPOINT_MODEL_KINDS, b as EndpointRoutingConfig, F as FingerprintConfig, K as KeySpendReader, c as KeySpendSeeder, d as KeySpendTracker, e as KindMappedEndpoint, M as MessagesModelKind, f as ModelKind, g as ModelPrefixTargets, h as OutboundApiDeps, i as OutboundApiKeyCreated, j as OutboundApiKeyInfo, k as OutboundApiServerConfig, l as OutboundApiServerStatus, O as OutboundCredentialStore, m as OutboundEndpoint, n as OutboundFormatUrls, o as OutboundKeyActivationMode, O as OutboundKeyDb, p as OutboundKeyDbRow, q as OutboundKeyPolicy, r as OutboundProxyConfig, R as RequestRole, s as ResponsesModelKind, U as UserMessageQueueConfig, 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';
|
|
13
13
|
export { CostCalculation, PricingEngine, PricingEngineOptions } from './usage/pricing-engine.js';
|
|
14
14
|
export { UsageRecordInput, UsageRecorder, UsageRecorderOptions } from './usage/usage-recorder.js';
|
|
15
15
|
export { A as ApiFormat, C as CompletionOptions, a as CompletionResult, N as NATIVE_SEARCH_TOOL_NAMES, b as NativeSearchAugmentation, c as NativeSearchDetectionResult, d as NativeSearchProvider, e as NativeSearchUserConfig, S as StreamCallbacks } from './types-BScIHmPr.js';
|
|
@@ -18,14 +18,18 @@ export { SimpleChatGeminiMessage, SimpleChatGeminiPart, StreamEvent, StreamEvent
|
|
|
18
18
|
export { buildAnthropicApiUrl, buildAzureOpenAIApiUrl, buildGeminiApiUrl, buildOpenAIApiUrl, buildOpenAIResponseApiUrl, buildProviderApiUrl, normalizeAzureEndpoint, resolveApiFormat, resolveProviderEndpoint } from './completion/url-builder.js';
|
|
19
19
|
export { applyAugmentation, buildNativeSearchAugmentation, detectNativeSearch } from './completion/NativeSearchInjector.js';
|
|
20
20
|
export { __resetProviderProxyForTests, extractRouteToken, getProviderProxy } from './provider-proxy.js';
|
|
21
|
-
export {
|
|
21
|
+
export { ApiServerSettingsStore, ApplyConfigInput, ConcurrencyQueueFullError, ConcurrencyWaitCancelledError, ConcurrencyWaitTimeoutError, DEFAULT_ACCOUNT_PROBE, DEFAULT_CONCURRENCY_QUEUE, DEFAULT_FINGERPRINT, DEFAULT_OUTBOUND_PORT, DEFAULT_USER_MESSAGE_QUEUE, EndpointModelConfigError, GateAcquireOptions, GateAcquisition, GateSlot, GateStatusEntry, KeyVerification, KeyedMutex, ModelPrefixKind, OUTBOUND_API_SERVER_CONFIG_KEY, OutboundApiConfigError, OutboundApiServer, OutboundConcurrencyGate, OutboundRateLimiter, SerialAcquireOptions, SerialQueueStatusEntry, SerialQueueTimeoutError, SerialSlot, UserMessageSerialQueue, 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 } from './outbound-api.js';
|
|
22
22
|
export { convertAnthropicRequestToOpenAI, convertAnthropicStreamToOpenAI, convertAnthropicToOpenAI, convertAnthropicToOpenAIWithThinking, convertOpenAIResponseToAnthropic, convertOpenAIStreamToAnthropic, convertOpenAIToAnthropic, convertOpenAIToAnthropicWithThinking, hasImageContent, hasThinkingEnabled } from './ApiConverter.js';
|
|
23
23
|
export { ChainExecutionOptions, TransformerChainExecutor } from './transformer/TransformerChainExecutor.js';
|
|
24
24
|
export { TransformerService } from './transformer/TransformerService.js';
|
|
25
25
|
export { registerBuiltinTransformers } from './transformer/transformers.js';
|
|
26
26
|
export { Annotation, ImageContent, MessageContent, ModelRoute, ModelTransformerConfig, ReasoningConfig, RequestConfig, RequestRouteInfo, ResolvedTransformerChain, StreamChunk, TextContent, ThinkLevel, ThinkingContent, ToolCall, ToolChoice, ToolParameterSchema, TransformRequestResult, Transformer, TransformerChainConfig, TransformerConfigEntry, TransformerConstructor, TransformerContext, TransformerLogger, TransformerOptions, TransformerReference, TransformerServiceConfig, UnifiedChatRequest, UnifiedChatResponse, UnifiedMessage, UnifiedTool, UrlCitation } from './transformer/types.js';
|
|
27
|
+
export { AUDIT_REDACTED, redactAuditText } from './outbound-api/auditRedact.js';
|
|
28
|
+
export { AuditCaptureContext, beginAuditCapture } from './outbound-api/auditCapture.js';
|
|
29
|
+
export { BillingCaptureContext, beginBillingCapture } from './outbound-api/billingCapture.js';
|
|
27
30
|
export { D as DEFAULT_ROUTE_IDLE_MS, P as ProviderProxy, a as ProviderProxyRouteMap } from './ProviderProxy-C-xqrkKi.js';
|
|
28
|
-
export {
|
|
31
|
+
export { K as KeyCostLimits, a as KeyExpiryInput, b as KeyExpiryResult, c as KeySpend, Q as QuotaDecision, d as checkKeyQuota, e as computeKeyExpiry } from './keyPolicy-Cp0FntZl.js';
|
|
32
|
+
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';
|
|
29
33
|
import '@omnicross/contracts/message-blocks';
|
|
30
34
|
import '@omnicross/contracts/completion-types';
|
|
31
35
|
import '@omnicross/contracts/mcp-types';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AUDIT_REDACTED,
|
|
3
2
|
CompletionService,
|
|
4
3
|
ConcurrencyQueueFullError,
|
|
5
4
|
ConcurrencyWaitCancelledError,
|
|
@@ -25,8 +24,6 @@ import {
|
|
|
25
24
|
__resetProviderProxyForTests,
|
|
26
25
|
addOpenRouterProviderToRequest,
|
|
27
26
|
attach,
|
|
28
|
-
beginAuditCapture,
|
|
29
|
-
beginBillingCapture,
|
|
30
27
|
checkKeyQuota,
|
|
31
28
|
computeKeyExpiry,
|
|
32
29
|
computeVoucherGrant,
|
|
@@ -65,7 +62,6 @@ import {
|
|
|
65
62
|
normalizeWebhookDestination,
|
|
66
63
|
normalizeWebhookSegment,
|
|
67
64
|
randomBase62,
|
|
68
|
-
redactAuditText,
|
|
69
65
|
register,
|
|
70
66
|
release,
|
|
71
67
|
saveServerConfig,
|
|
@@ -75,62 +71,55 @@ import {
|
|
|
75
71
|
verifyKey,
|
|
76
72
|
verifyPresentedKey,
|
|
77
73
|
voucherCodePrefix
|
|
78
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-QYTT6GE3.js";
|
|
79
75
|
import {
|
|
80
76
|
createSSEParser,
|
|
81
77
|
streamSSEResponse
|
|
82
78
|
} from "./chunk-VVEHS2LI.js";
|
|
83
79
|
import "./chunk-46RLHI7D.js";
|
|
84
|
-
import {
|
|
85
|
-
TransformerChainExecutor
|
|
86
|
-
} from "./chunk-G2UTNSGU.js";
|
|
87
80
|
import {
|
|
88
81
|
TransformerService
|
|
89
82
|
} from "./chunk-DK4A7DLE.js";
|
|
90
83
|
import {
|
|
91
84
|
registerBuiltinTransformers
|
|
92
|
-
} from "./chunk-
|
|
93
|
-
import "./chunk-Z7LUNECE.js";
|
|
85
|
+
} from "./chunk-VPBAUQ2M.js";
|
|
94
86
|
import "./chunk-ZJZAOKI7.js";
|
|
95
87
|
import "./chunk-FTQ7IQUC.js";
|
|
96
88
|
import "./chunk-C7PSERMH.js";
|
|
97
|
-
import "./chunk-
|
|
89
|
+
import "./chunk-TIER4SUC.js";
|
|
90
|
+
import "./chunk-Z7LUNECE.js";
|
|
98
91
|
import "./chunk-7VU7V2E4.js";
|
|
99
92
|
import {
|
|
100
93
|
PricingEngine
|
|
101
94
|
} from "./chunk-ZLX3KGXX.js";
|
|
102
95
|
import {
|
|
103
96
|
UsageRecorder
|
|
104
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-BPKCU575.js";
|
|
98
|
+
import {
|
|
99
|
+
TransformerChainExecutor
|
|
100
|
+
} from "./chunk-G2UTNSGU.js";
|
|
105
101
|
import "./chunk-MZNPGW5Q.js";
|
|
106
102
|
import "./chunk-XTEI64OU.js";
|
|
107
103
|
import "./chunk-XX6NQJMA.js";
|
|
108
104
|
import "./chunk-IAXWICZU.js";
|
|
109
|
-
import "./chunk-
|
|
110
|
-
import "./chunk-5ENKBSWO.js";
|
|
111
|
-
import "./chunk-N5QFKSDO.js";
|
|
112
|
-
import {
|
|
113
|
-
serializeError
|
|
114
|
-
} from "./chunk-AVYJ4YBN.js";
|
|
105
|
+
import "./chunk-OE6TDIWW.js";
|
|
115
106
|
import "./chunk-DRWHTIIZ.js";
|
|
116
|
-
import "./chunk-
|
|
117
|
-
import "./chunk-TKJMZBAH.js";
|
|
118
|
-
import "./chunk-JO5NLTLY.js";
|
|
107
|
+
import "./chunk-IK3KE3AU.js";
|
|
119
108
|
import {
|
|
120
109
|
getProviderHeaders
|
|
121
110
|
} from "./chunk-ZY6KU6P3.js";
|
|
122
111
|
import "./chunk-JWC6APFQ.js";
|
|
112
|
+
import "./chunk-5ERIZW3D.js";
|
|
113
|
+
import "./chunk-5ENKBSWO.js";
|
|
114
|
+
import "./chunk-HRRYG2AX.js";
|
|
123
115
|
import {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
resolveApiFormat,
|
|
132
|
-
resolveProviderEndpoint
|
|
133
|
-
} from "./chunk-H5JUT3KV.js";
|
|
116
|
+
serializeError
|
|
117
|
+
} from "./chunk-AVYJ4YBN.js";
|
|
118
|
+
import {
|
|
119
|
+
beginBillingCapture
|
|
120
|
+
} from "./chunk-WLYIIEAF.js";
|
|
121
|
+
import "./chunk-TKJMZBAH.js";
|
|
122
|
+
import "./chunk-3QFXFCHG.js";
|
|
134
123
|
import {
|
|
135
124
|
SUBSCRIPTION_PROVIDER_IDS,
|
|
136
125
|
classifyModelPrefix,
|
|
@@ -147,11 +136,31 @@ import {
|
|
|
147
136
|
resolveRoute,
|
|
148
137
|
validateEndpointModelConfig,
|
|
149
138
|
validateServerModelConfig
|
|
150
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-UHGVBFU3.js";
|
|
151
140
|
import "./chunk-AQ5TNQB7.js";
|
|
152
141
|
import {
|
|
153
142
|
ENDPOINT_MODEL_KINDS
|
|
154
143
|
} from "./chunk-XEKD23J5.js";
|
|
144
|
+
import {
|
|
145
|
+
buildAnthropicApiUrl,
|
|
146
|
+
buildAzureOpenAIApiUrl,
|
|
147
|
+
buildGeminiApiUrl,
|
|
148
|
+
buildOpenAIApiUrl,
|
|
149
|
+
buildOpenAIResponseApiUrl,
|
|
150
|
+
buildProviderApiUrl,
|
|
151
|
+
normalizeAzureEndpoint,
|
|
152
|
+
resolveApiFormat,
|
|
153
|
+
resolveProviderEndpoint
|
|
154
|
+
} from "./chunk-H5JUT3KV.js";
|
|
155
|
+
import {
|
|
156
|
+
beginAuditCapture
|
|
157
|
+
} from "./chunk-7Y47UCF2.js";
|
|
158
|
+
import {
|
|
159
|
+
AUDIT_REDACTED,
|
|
160
|
+
redactAuditText
|
|
161
|
+
} from "./chunk-K5NM7VAH.js";
|
|
162
|
+
import "./chunk-WNY4WMRF.js";
|
|
163
|
+
import "./chunk-OZFM4X3S.js";
|
|
155
164
|
import {
|
|
156
165
|
convertAnthropicRequestToOpenAI,
|
|
157
166
|
convertAnthropicStreamToOpenAI,
|
|
@@ -164,9 +173,9 @@ import {
|
|
|
164
173
|
hasImageContent,
|
|
165
174
|
hasThinkingEnabled
|
|
166
175
|
} from "./chunk-5ZQBEOMD.js";
|
|
167
|
-
import "./chunk-BO4RFWBR.js";
|
|
168
176
|
import "./chunk-Z7Y2NPHY.js";
|
|
169
177
|
import "./chunk-S4WBV25P.js";
|
|
178
|
+
import "./chunk-XK5CIRMQ.js";
|
|
170
179
|
import {
|
|
171
180
|
BuiltinToolExecutor,
|
|
172
181
|
getBuiltinSearchTools
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* keyPolicy — PURE decision helpers for the outbound key-policy envelope
|
|
3
|
+
* (`outbound-key-policy`, design D2/D4). Expiry/activation resolution +
|
|
4
|
+
* cost-quota decision. No I/O, no clock ownership (the caller passes `now`), so
|
|
5
|
+
* these are trivially unit-testable and reused by both the auth path
|
|
6
|
+
* (`verifyKey`) and the wire path (`outboundApiRouter`).
|
|
7
|
+
*
|
|
8
|
+
* The #6 (`restrictedModels`) and #9 (voucher) children EXTEND the key-policy
|
|
9
|
+
* schema; they must not change the shapes frozen here.
|
|
10
|
+
*
|
|
11
|
+
* @module outbound-api/keyPolicy
|
|
12
|
+
*/
|
|
13
|
+
/** The expiry/activation subset of a key row `computeKeyExpiry` reads. */
|
|
14
|
+
interface KeyExpiryInput {
|
|
15
|
+
/** Fixed-mode absolute expiry (epoch ms). */
|
|
16
|
+
expiresAt?: number | null;
|
|
17
|
+
/** Expiry mode; absent ⇒ `'fixed'`. */
|
|
18
|
+
activationMode?: 'fixed' | 'activation';
|
|
19
|
+
/** Activation-mode lifetime in days (absent/null ⇒ never expires). */
|
|
20
|
+
activationDays?: number | null;
|
|
21
|
+
/** First-use activation stamp (epoch ms); null ⇒ not yet activated. */
|
|
22
|
+
activatedAt?: number | null;
|
|
23
|
+
}
|
|
24
|
+
/** Result of {@link computeKeyExpiry}. */
|
|
25
|
+
interface KeyExpiryResult {
|
|
26
|
+
expired: boolean;
|
|
27
|
+
/** The resolved absolute expiry (epoch ms), when the key has one. */
|
|
28
|
+
effectiveExpiresAt?: number;
|
|
29
|
+
/**
|
|
30
|
+
* True when this is an activation-mode key that has NOT been activated yet, so
|
|
31
|
+
* the caller SHOULD stamp the activation (best-effort) on a successful verify.
|
|
32
|
+
*/
|
|
33
|
+
needsActivation?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve whether a key is past its effective expiry (design D2).
|
|
37
|
+
* - `fixed`: expired when `expiresAt != null && now >= expiresAt`.
|
|
38
|
+
* - `activation`: while `activatedAt == null` the key is NOT expired (it
|
|
39
|
+
* activates on THIS use → `needsActivation`); once activated, expired when
|
|
40
|
+
* `now >= activatedAt + activationDays*DAY`. A null `activationDays` never
|
|
41
|
+
* expires.
|
|
42
|
+
* A key with no expiry configured never expires.
|
|
43
|
+
*/
|
|
44
|
+
declare function computeKeyExpiry(row: KeyExpiryInput, now: number): KeyExpiryResult;
|
|
45
|
+
/** Per-key USD cost limits carried on the verified key (absent scope ⇒ no cap). */
|
|
46
|
+
interface KeyCostLimits {
|
|
47
|
+
dailyUsd?: number;
|
|
48
|
+
totalUsd?: number;
|
|
49
|
+
weeklyUsd?: number;
|
|
50
|
+
}
|
|
51
|
+
/** In-memory per-key accumulated spend snapshot (see `keySpendTracker`). */
|
|
52
|
+
interface KeySpend {
|
|
53
|
+
dailyUsd: number;
|
|
54
|
+
/** Local-midnight boundary the `dailyUsd` window opened at (epoch ms). */
|
|
55
|
+
dailyWindowStart: number;
|
|
56
|
+
weeklyUsd: number;
|
|
57
|
+
/** Local week-start boundary the `weeklyUsd` window opened at (epoch ms). */
|
|
58
|
+
weeklyWindowStart: number;
|
|
59
|
+
totalUsd: number;
|
|
60
|
+
}
|
|
61
|
+
/** Decision returned by {@link checkKeyQuota}. */
|
|
62
|
+
type QuotaDecision = {
|
|
63
|
+
allowed: true;
|
|
64
|
+
} | {
|
|
65
|
+
allowed: false;
|
|
66
|
+
scope: 'daily' | 'weekly' | 'total';
|
|
67
|
+
limitUsd: number;
|
|
68
|
+
spentUsd: number;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Decide whether the key's accumulated spend already meets/exceeds any
|
|
72
|
+
* configured cost limit (design D4). `allowed:false` when a scope's PRIOR spend
|
|
73
|
+
* is `>= limit` (the triggering request's own cost is unknown pre-flight →
|
|
74
|
+
* bounded one-request overage, CRS-equivalent). An unconfigured scope is never
|
|
75
|
+
* gated; a `limits`-less key always passes.
|
|
76
|
+
*/
|
|
77
|
+
declare function checkKeyQuota(limits: KeyCostLimits | undefined, spend: KeySpend): QuotaDecision;
|
|
78
|
+
/**
|
|
79
|
+
* Per-key model restriction carried on the verified key (outbound-key-policy #6).
|
|
80
|
+
* Present ONLY when the key has `enableModelRestriction === true` — so the wire
|
|
81
|
+
* layer's presence check (`if (key.modelRestriction) …`) is the zero-regression
|
|
82
|
+
* gate.
|
|
83
|
+
*/
|
|
84
|
+
interface ModelRestriction {
|
|
85
|
+
mode: 'blacklist' | 'allowlist';
|
|
86
|
+
/** Bare modelIds the mode acts on. Empty allowlist denies every model. */
|
|
87
|
+
models: string[];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { type KeyCostLimits as K, type ModelRestriction as M, type QuotaDecision as Q, type KeyExpiryInput as a, type KeyExpiryResult as b, type KeySpend as c, checkKeyQuota as d, computeKeyExpiry as e };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* keyPolicy — PURE decision helpers for the outbound key-policy envelope
|
|
3
|
+
* (`outbound-key-policy`, design D2/D4). Expiry/activation resolution +
|
|
4
|
+
* cost-quota decision. No I/O, no clock ownership (the caller passes `now`), so
|
|
5
|
+
* these are trivially unit-testable and reused by both the auth path
|
|
6
|
+
* (`verifyKey`) and the wire path (`outboundApiRouter`).
|
|
7
|
+
*
|
|
8
|
+
* The #6 (`restrictedModels`) and #9 (voucher) children EXTEND the key-policy
|
|
9
|
+
* schema; they must not change the shapes frozen here.
|
|
10
|
+
*
|
|
11
|
+
* @module outbound-api/keyPolicy
|
|
12
|
+
*/
|
|
13
|
+
/** The expiry/activation subset of a key row `computeKeyExpiry` reads. */
|
|
14
|
+
interface KeyExpiryInput {
|
|
15
|
+
/** Fixed-mode absolute expiry (epoch ms). */
|
|
16
|
+
expiresAt?: number | null;
|
|
17
|
+
/** Expiry mode; absent ⇒ `'fixed'`. */
|
|
18
|
+
activationMode?: 'fixed' | 'activation';
|
|
19
|
+
/** Activation-mode lifetime in days (absent/null ⇒ never expires). */
|
|
20
|
+
activationDays?: number | null;
|
|
21
|
+
/** First-use activation stamp (epoch ms); null ⇒ not yet activated. */
|
|
22
|
+
activatedAt?: number | null;
|
|
23
|
+
}
|
|
24
|
+
/** Result of {@link computeKeyExpiry}. */
|
|
25
|
+
interface KeyExpiryResult {
|
|
26
|
+
expired: boolean;
|
|
27
|
+
/** The resolved absolute expiry (epoch ms), when the key has one. */
|
|
28
|
+
effectiveExpiresAt?: number;
|
|
29
|
+
/**
|
|
30
|
+
* True when this is an activation-mode key that has NOT been activated yet, so
|
|
31
|
+
* the caller SHOULD stamp the activation (best-effort) on a successful verify.
|
|
32
|
+
*/
|
|
33
|
+
needsActivation?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve whether a key is past its effective expiry (design D2).
|
|
37
|
+
* - `fixed`: expired when `expiresAt != null && now >= expiresAt`.
|
|
38
|
+
* - `activation`: while `activatedAt == null` the key is NOT expired (it
|
|
39
|
+
* activates on THIS use → `needsActivation`); once activated, expired when
|
|
40
|
+
* `now >= activatedAt + activationDays*DAY`. A null `activationDays` never
|
|
41
|
+
* expires.
|
|
42
|
+
* A key with no expiry configured never expires.
|
|
43
|
+
*/
|
|
44
|
+
declare function computeKeyExpiry(row: KeyExpiryInput, now: number): KeyExpiryResult;
|
|
45
|
+
/** Per-key USD cost limits carried on the verified key (absent scope ⇒ no cap). */
|
|
46
|
+
interface KeyCostLimits {
|
|
47
|
+
dailyUsd?: number;
|
|
48
|
+
totalUsd?: number;
|
|
49
|
+
weeklyUsd?: number;
|
|
50
|
+
}
|
|
51
|
+
/** In-memory per-key accumulated spend snapshot (see `keySpendTracker`). */
|
|
52
|
+
interface KeySpend {
|
|
53
|
+
dailyUsd: number;
|
|
54
|
+
/** Local-midnight boundary the `dailyUsd` window opened at (epoch ms). */
|
|
55
|
+
dailyWindowStart: number;
|
|
56
|
+
weeklyUsd: number;
|
|
57
|
+
/** Local week-start boundary the `weeklyUsd` window opened at (epoch ms). */
|
|
58
|
+
weeklyWindowStart: number;
|
|
59
|
+
totalUsd: number;
|
|
60
|
+
}
|
|
61
|
+
/** Decision returned by {@link checkKeyQuota}. */
|
|
62
|
+
type QuotaDecision = {
|
|
63
|
+
allowed: true;
|
|
64
|
+
} | {
|
|
65
|
+
allowed: false;
|
|
66
|
+
scope: 'daily' | 'weekly' | 'total';
|
|
67
|
+
limitUsd: number;
|
|
68
|
+
spentUsd: number;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Decide whether the key's accumulated spend already meets/exceeds any
|
|
72
|
+
* configured cost limit (design D4). `allowed:false` when a scope's PRIOR spend
|
|
73
|
+
* is `>= limit` (the triggering request's own cost is unknown pre-flight →
|
|
74
|
+
* bounded one-request overage, CRS-equivalent). An unconfigured scope is never
|
|
75
|
+
* gated; a `limits`-less key always passes.
|
|
76
|
+
*/
|
|
77
|
+
declare function checkKeyQuota(limits: KeyCostLimits | undefined, spend: KeySpend): QuotaDecision;
|
|
78
|
+
/**
|
|
79
|
+
* Per-key model restriction carried on the verified key (outbound-key-policy #6).
|
|
80
|
+
* Present ONLY when the key has `enableModelRestriction === true` — so the wire
|
|
81
|
+
* layer's presence check (`if (key.modelRestriction) …`) is the zero-regression
|
|
82
|
+
* gate.
|
|
83
|
+
*/
|
|
84
|
+
interface ModelRestriction {
|
|
85
|
+
mode: 'blacklist' | 'allowlist';
|
|
86
|
+
/** Bare modelIds the mode acts on. Empty allowlist denies every model. */
|
|
87
|
+
models: string[];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { type KeyCostLimits as K, type ModelRestriction as M, type QuotaDecision as Q, type KeyExpiryInput as a, type KeyExpiryResult as b, type KeySpend as c, checkKeyQuota as d, computeKeyExpiry as e };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkE3UCVHLPcjs = require('../chunk-E3UCVHLP.cjs');
|
|
4
|
+
require('../chunk-FCR77GYM.cjs');
|
|
5
|
+
require('../chunk-AEOZIDEB.cjs');
|
|
6
|
+
require('../chunk-XSVNC2UD.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.beginAuditCapture = _chunkE3UCVHLPcjs.beginAuditCapture;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import http from 'node:http';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* auditCapture — the outbound server's post-response audit capture hook
|
|
5
|
+
* (request-audit-log, design D1/D3/D5).
|
|
6
|
+
*
|
|
7
|
+
* {@link beginAuditCapture} is called at the TOP of `handleOutboundRequest`. It
|
|
8
|
+
* reads the active capture config from the core slot; when audit is DISABLED it
|
|
9
|
+
* returns `null` immediately (one slot read — no assembly, no listener, zero
|
|
10
|
+
* regression). When enabled it:
|
|
11
|
+
* - registers a one-shot `res.on('close')` listener that, at response end,
|
|
12
|
+
* assembles the {@link AuditRecord} from the http `req` (IP via the socket, or
|
|
13
|
+
* a trusted `X-Forwarded-For` only when configured — LEAD OQ1 anti-spoof; UA;
|
|
14
|
+
* method; path with the query string DROPPED), the response `statusCode`, the
|
|
15
|
+
* elapsed ms, and the fields the handler fills in (keyId / model / provider /
|
|
16
|
+
* error / bodies) — then hands it to the fire-and-forget `recordAudit`;
|
|
17
|
+
* - when `captureBodies` is ALSO on, wraps `res.write`/`res.end` to accumulate a
|
|
18
|
+
* BOUNDED response body (metadata-only for a streaming `text/event-stream`
|
|
19
|
+
* response — a full stream is unbounded), and truncates+redacts both bodies.
|
|
20
|
+
*
|
|
21
|
+
* Request HEADERS are NEVER read into a record (Authorization / x-api-key live
|
|
22
|
+
* there). Every stored body passes through {@link redactAuditText}. The assembly
|
|
23
|
+
* is wrapped so a capture failure can never surface into the relay path.
|
|
24
|
+
*
|
|
25
|
+
* @module @omnicross/core/outbound-api/auditCapture
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The mutable context the request handler enriches as it progresses. `null` is
|
|
30
|
+
* returned by {@link beginAuditCapture} when audit is disabled — the handler
|
|
31
|
+
* guards every write with `if (audit)`.
|
|
32
|
+
*/
|
|
33
|
+
interface AuditCaptureContext {
|
|
34
|
+
/** Outbound key id (set after auth). NEVER the key material. */
|
|
35
|
+
keyId?: string | null;
|
|
36
|
+
/** Resolved upstream model (set after route resolution). */
|
|
37
|
+
model?: string;
|
|
38
|
+
/** Upstream provider id (set after route resolution). */
|
|
39
|
+
provider?: string;
|
|
40
|
+
/** Sanitized error message (set on a relay/dispatch failure). */
|
|
41
|
+
error?: string;
|
|
42
|
+
/** Stash the raw request body for capture (a no-op unless `captureBodies`). */
|
|
43
|
+
setRequestBody(raw: string): void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Begin audit capture for one request. Returns a mutable context the handler
|
|
47
|
+
* enriches, or `null` when audit is disabled (zero-cost path). The record is
|
|
48
|
+
* emitted on response `close` via the fire-and-forget sink.
|
|
49
|
+
*/
|
|
50
|
+
declare function beginAuditCapture(req: http.IncomingMessage, res: http.ServerResponse, now: number): AuditCaptureContext | null;
|
|
51
|
+
|
|
52
|
+
export { type AuditCaptureContext, beginAuditCapture };
|