@omnicross/core 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApiConverter.cjs +2 -2
- package/dist/ApiConverter.js +1 -1
- package/dist/{CompletionService-DdWaAxq0.d.ts → CompletionService-C3BX0Ovy.d.ts} +4 -3
- package/dist/{CompletionService-D3a47vdU.d.cts → CompletionService-kNA17cfI.d.cts} +4 -3
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +8 -6
- package/dist/auth/GeminiCodeAssistProjectResolver.js +6 -4
- package/dist/{chunk-3Z5BQZFM.cjs → chunk-235MXAGX.cjs} +3 -1
- package/dist/{chunk-HRRYG2AX.js → chunk-23S5OPIO.js} +10 -1
- package/dist/chunk-25GXJCEZ.cjs +40 -0
- package/dist/chunk-2E42SAW3.cjs +323 -0
- package/dist/chunk-2JYRIADS.js +40 -0
- package/dist/chunk-2Z4XM3H5.cjs +44 -0
- package/dist/{chunk-BODMAL6G.js → chunk-32O35CIF.js} +271 -91
- package/dist/chunk-3SCOLIPT.cjs +63 -0
- package/dist/{chunk-SYQF7OIR.js → chunk-3WD4HTR2.js} +2 -0
- package/dist/{chunk-CGKLE6IW.cjs → chunk-4BB343BI.cjs} +1489 -520
- package/dist/{chunk-VACWOIRE.cjs → chunk-4VZX5F4T.cjs} +39 -15
- package/dist/{chunk-5ZQBEOMD.js → chunk-5NJLQ6T6.js} +46 -12
- package/dist/chunk-5RSZYQJH.cjs +62 -0
- package/dist/chunk-6QQG7YG3.cjs +153 -0
- package/dist/{chunk-IFXJ2BG7.js → chunk-7C7DET6S.js} +51 -6
- package/dist/{chunk-IK3KE3AU.js → chunk-DE2SRBFZ.js} +1 -1
- package/dist/{chunk-FH2P4OCD.js → chunk-E3COOKUP.js} +1240 -271
- package/dist/{chunk-UHGVBFU3.js → chunk-EBLFCNPY.js} +38 -14
- package/dist/chunk-FU7EAR73.js +62 -0
- package/dist/chunk-FXR6N3SR.js +323 -0
- package/dist/{chunk-SUEGJ75D.cjs → chunk-GDIXXKF2.cjs} +46 -12
- package/dist/chunk-GFIZ6LQI.js +170 -0
- package/dist/chunk-GL6XM527.js +61 -0
- package/dist/chunk-HVBBDBS3.cjs +350 -0
- package/dist/{chunk-46ZIFWYG.cjs → chunk-IIRPUVPH.cjs} +7 -1
- package/dist/chunk-J3QQ6JS5.cjs +170 -0
- package/dist/{chunk-JWVTXXPX.cjs → chunk-KBM2W6UY.cjs} +8 -4
- package/dist/chunk-LB6EBS6Y.js +69 -0
- package/dist/{chunk-IWQAX3CS.js → chunk-LVUCAWMK.js} +1 -1
- package/dist/chunk-MKF46GNZ.js +350 -0
- package/dist/{chunk-HYN75H6G.cjs → chunk-MUHWHQVM.cjs} +1 -1
- package/dist/chunk-MYYR3HZL.js +44 -0
- package/dist/{chunk-MFZ5437A.js → chunk-N5T4M4GU.js} +1 -1
- package/dist/{chunk-5ENKBSWO.js → chunk-N7OOJI5V.js} +88 -8
- package/dist/chunk-NKVZ6Z3Y.cjs +61 -0
- package/dist/chunk-OF3BECU2.cjs +69 -0
- package/dist/{chunk-SNYBEXLB.cjs → chunk-OJGQKHN5.cjs} +3 -1
- package/dist/{chunk-DDMRUL76.cjs → chunk-OKMJLEXX.cjs} +5 -5
- package/dist/chunk-OPRS4IQZ.js +153 -0
- package/dist/chunk-OTZC4TNH.cjs +79 -0
- package/dist/{chunk-3Q6Z6JTO.cjs → chunk-OVQBNVSV.cjs} +287 -107
- package/dist/{chunk-4XMYPW46.cjs → chunk-OXHNSZ53.cjs} +84 -44
- package/dist/{chunk-C6OV7GCC.js → chunk-PEGTIPB3.js} +52 -12
- package/dist/chunk-PO3XB56Z.js +79 -0
- package/dist/{chunk-D3TDKWRP.js → chunk-RJ5ZGNI3.js} +54 -5
- package/dist/{chunk-PG7PS2NN.cjs → chunk-RJUONLUQ.cjs} +59 -10
- package/dist/{chunk-BPKCU575.js → chunk-SOO562NM.js} +3 -1
- package/dist/{chunk-6QZGDLL4.js → chunk-TOVPMMHM.js} +5 -1
- package/dist/{chunk-K52THW2C.cjs → chunk-V4TXMEJS.cjs} +5 -5
- package/dist/{chunk-G2UTNSGU.js → chunk-WNKWAEUR.js} +7 -1
- package/dist/{chunk-UNWKG6EI.cjs → chunk-XPIOJQS2.cjs} +51 -6
- package/dist/chunk-XXFYLL7R.js +63 -0
- package/dist/{chunk-KFI44N2R.cjs → chunk-YNJNTCSQ.cjs} +10 -1
- package/dist/{chunk-VQY5W4YW.cjs → chunk-YWL7YZWS.cjs} +90 -10
- package/dist/completion/ApiKeyPoolService.cjs +12 -0
- package/dist/completion/ApiKeyPoolService.d.cts +6 -0
- package/dist/completion/ApiKeyPoolService.d.ts +6 -0
- package/dist/completion/ApiKeyPoolService.js +12 -0
- package/dist/completion/CompletionService.cjs +30 -24
- package/dist/completion/CompletionService.d.cts +3 -1
- package/dist/completion/CompletionService.d.ts +3 -1
- package/dist/completion/CompletionService.js +29 -23
- package/dist/completion.cjs +32 -26
- package/dist/completion.d.cts +3 -1
- package/dist/completion.d.ts +3 -1
- package/dist/completion.js +31 -25
- package/dist/index.cjs +56 -29
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +61 -34
- package/dist/{keyPolicy-Cp0FntZl.d.cts → keyPolicy-zdWTu3CQ.d.cts} +1 -1
- package/dist/{keyPolicy-Cp0FntZl.d.ts → keyPolicy-zdWTu3CQ.d.ts} +1 -1
- package/dist/outbound-api/auditCapture.cjs +2 -2
- package/dist/outbound-api/auditCapture.d.cts +3 -4
- package/dist/outbound-api/auditCapture.d.ts +3 -4
- package/dist/outbound-api/auditCapture.js +1 -1
- package/dist/outbound-api/quotaWarn.d.cts +1 -1
- package/dist/outbound-api/quotaWarn.d.ts +1 -1
- package/dist/outbound-api/routeResolver.cjs +2 -2
- package/dist/outbound-api/routeResolver.d.cts +5 -3
- package/dist/outbound-api/routeResolver.d.ts +5 -3
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.cts +2 -0
- package/dist/outbound-api/subscriptionRegistryPort.d.ts +2 -0
- package/dist/outbound-api/types.d.cts +4 -2
- package/dist/outbound-api/types.d.ts +4 -2
- package/dist/outbound-api.cjs +52 -25
- package/dist/outbound-api.d.cts +131 -87
- package/dist/outbound-api.d.ts +131 -87
- package/dist/outbound-api.js +55 -28
- package/dist/pipeline/AccountAllowanceScheduling.cjs +15 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +91 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +91 -0
- package/dist/pipeline/AccountAllowanceScheduling.js +15 -0
- package/dist/pipeline/AccountAllowanceStore.cjs +20 -0
- package/dist/pipeline/AccountAllowanceStore.d.cts +77 -0
- package/dist/pipeline/AccountAllowanceStore.d.ts +77 -0
- package/dist/pipeline/AccountAllowanceStore.js +20 -0
- package/dist/pipeline/AccountRouteActivity.cjs +10 -0
- package/dist/pipeline/AccountRouteActivity.d.cts +61 -0
- package/dist/pipeline/AccountRouteActivity.d.ts +61 -0
- package/dist/pipeline/AccountRouteActivity.js +10 -0
- package/dist/pipeline/AuthSource.d.cts +11 -2
- package/dist/pipeline/AuthSource.d.ts +11 -2
- package/dist/pipeline/BoundAccountSelectionError.cjs +10 -0
- package/dist/pipeline/BoundAccountSelectionError.d.cts +28 -0
- package/dist/pipeline/BoundAccountSelectionError.d.ts +28 -0
- package/dist/pipeline/BoundAccountSelectionError.js +10 -0
- package/dist/pipeline/LlmConfigProviderAuth.d.cts +1 -0
- package/dist/pipeline/LlmConfigProviderAuth.d.ts +1 -0
- package/dist/pipeline/ServerOverloadCounter.cjs +16 -0
- package/dist/pipeline/ServerOverloadCounter.d.cts +77 -0
- package/dist/pipeline/ServerOverloadCounter.d.ts +77 -0
- package/dist/pipeline/ServerOverloadCounter.js +16 -0
- package/dist/pipeline/SubscriptionAccountHealth.cjs +6 -2
- package/dist/pipeline/SubscriptionAccountHealth.d.cts +65 -8
- package/dist/pipeline/SubscriptionAccountHealth.d.ts +65 -8
- package/dist/pipeline/SubscriptionAccountHealth.js +5 -1
- package/dist/pipeline/SubscriptionAuthSource.cjs +5 -2
- package/dist/pipeline/SubscriptionAuthSource.d.cts +1 -0
- package/dist/pipeline/SubscriptionAuthSource.d.ts +1 -0
- package/dist/pipeline/SubscriptionAuthSource.js +4 -1
- package/dist/pipeline/SubscriptionAuthStrategy.d.cts +8 -3
- package/dist/pipeline/SubscriptionAuthStrategy.d.ts +8 -3
- package/dist/pipeline/executeProviderCall.cjs +2 -2
- package/dist/pipeline/executeProviderCall.d.cts +8 -3
- package/dist/pipeline/executeProviderCall.d.ts +8 -3
- package/dist/pipeline/executeProviderCall.js +1 -1
- package/dist/pipeline/resolveProviderChain.d.cts +2 -3
- package/dist/pipeline/resolveProviderChain.d.ts +2 -3
- package/dist/pipeline/resolveSubscriptionChain.d.cts +1 -0
- package/dist/pipeline/resolveSubscriptionChain.d.ts +1 -0
- package/dist/pipeline/upstreamFetch.cjs +5 -3
- package/dist/pipeline/upstreamFetch.d.cts +35 -6
- package/dist/pipeline/upstreamFetch.d.ts +35 -6
- package/dist/pipeline/upstreamFetch.js +4 -2
- package/dist/pipeline/upstreamTrace.cjs +4 -2
- package/dist/pipeline/upstreamTrace.d.cts +22 -8
- package/dist/pipeline/upstreamTrace.d.ts +22 -8
- package/dist/pipeline/upstreamTrace.js +3 -1
- package/dist/ports/pricing-store.d.cts +4 -3
- package/dist/ports/pricing-store.d.ts +4 -3
- package/dist/ports.d.cts +4 -3
- package/dist/ports.d.ts +4 -3
- package/dist/provider-proxy/ProviderProxy.cjs +30 -24
- package/dist/provider-proxy/ProviderProxy.d.cts +2 -0
- package/dist/provider-proxy/ProviderProxy.d.ts +2 -0
- package/dist/provider-proxy/ProviderProxy.js +29 -23
- package/dist/provider-proxy/identity/codexCliHeaders.cjs +10 -0
- package/dist/provider-proxy/identity/codexCliHeaders.d.cts +45 -0
- package/dist/provider-proxy/identity/codexCliHeaders.d.ts +45 -0
- package/dist/provider-proxy/identity/codexCliHeaders.js +10 -0
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +32 -24
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +44 -5
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +44 -5
- package/dist/provider-proxy/ingress/providerProxyShared.js +31 -23
- package/dist/provider-proxy/matchText.cjs +4 -2
- package/dist/provider-proxy/matchText.d.cts +39 -6
- package/dist/provider-proxy/matchText.d.ts +39 -6
- package/dist/provider-proxy/matchText.js +3 -1
- package/dist/provider-proxy/types.d.cts +35 -2
- package/dist/provider-proxy/types.d.ts +35 -2
- package/dist/provider-proxy.cjs +30 -24
- package/dist/provider-proxy.d.cts +2 -0
- package/dist/provider-proxy.d.ts +2 -0
- package/dist/provider-proxy.js +29 -23
- package/dist/{routeResolver-C4T7yClx.d.ts → routeResolver-BxOfunbm.d.ts} +1 -1
- package/dist/{routeResolver-CB3tvJKy.d.cts → routeResolver-D5OzD0iM.d.cts} +1 -1
- package/dist/transformer/TransformerChainExecutor.cjs +2 -2
- package/dist/transformer/TransformerChainExecutor.js +1 -1
- package/dist/transformer/transformers/AnthropicTransformer.cjs +3 -2
- package/dist/transformer/transformers/AnthropicTransformer.js +2 -1
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +2 -2
- package/dist/transformer/transformers/GeminiTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiTransformer.js +2 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.cts +1 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.ts +1 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -1
- package/dist/transformer/transformers/OpenAITransformer.cjs +6 -0
- package/dist/transformer/transformers/OpenAITransformer.d.cts +68 -0
- package/dist/transformer/transformers/OpenAITransformer.d.ts +68 -0
- package/dist/transformer/transformers/OpenAITransformer.js +6 -0
- package/dist/transformer/transformers.cjs +9 -14
- package/dist/transformer/transformers.d.cts +12 -48
- package/dist/transformer/transformers.d.ts +12 -48
- package/dist/transformer/transformers.js +11 -16
- package/dist/transformer/types.d.cts +17 -0
- package/dist/transformer/types.d.ts +17 -0
- package/dist/transformer.cjs +12 -12
- package/dist/transformer.d.cts +1 -2
- package/dist/transformer.d.ts +1 -2
- package/dist/transformer.js +12 -12
- package/dist/{types-lgPYQuZS.d.ts → types-CqZD77rS.d.ts} +173 -7
- package/dist/{types-B8Arpxn0.d.cts → types-gjJ5lJ5n.d.cts} +173 -7
- package/dist/usage/pricing-engine.cjs +2 -2
- package/dist/usage/pricing-engine.d.cts +29 -1
- package/dist/usage/pricing-engine.d.ts +29 -1
- package/dist/usage/pricing-engine.js +1 -1
- package/dist/usage/usage-recorder.cjs +2 -2
- package/dist/usage/usage-recorder.d.cts +5 -1
- package/dist/usage/usage-recorder.d.ts +5 -1
- package/dist/usage/usage-recorder.js +1 -1
- package/dist/usage.cjs +3 -3
- package/dist/usage.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-7FEBOPJO.cjs +0 -50
- package/dist/chunk-DWKQZ2SK.cjs +0 -254
- package/dist/chunk-IAXWICZU.js +0 -69
- package/dist/chunk-IB3FDI4O.js +0 -50
- package/dist/chunk-OQWKZCXP.js +0 -242
- package/dist/chunk-QWBWGODS.cjs +0 -69
- package/dist/chunk-YMFAJFQT.cjs +0 -173
- package/dist/chunk-ZCIQ3L3R.cjs +0 -242
- package/dist/chunk-ZJZAOKI7.js +0 -254
- package/dist/chunk-ZLX3KGXX.js +0 -173
- package/dist/transformer/transformers/OpenCodeGoTransformer.cjs +0 -6
- package/dist/transformer/transformers/OpenCodeGoTransformer.d.cts +0 -51
- package/dist/transformer/transformers/OpenCodeGoTransformer.d.ts +0 -51
- package/dist/transformer/transformers/OpenCodeGoTransformer.js +0 -6
- package/dist/transformer/transformers/ReasoningTransformer.cjs +0 -6
- package/dist/transformer/transformers/ReasoningTransformer.d.cts +0 -47
- package/dist/transformer/transformers/ReasoningTransformer.d.ts +0 -47
- package/dist/transformer/transformers/ReasoningTransformer.js +0 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SubscriptionProviderId, SubscriptionStatusEntry } from '@omnicross/contracts/subscription-types';
|
|
2
|
+
import { BoundAccountFallbackPolicy } from './BoundAccountSelectionError.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* SubscriptionAuthStrategy — the pluggable subscription-auth contract, defined
|
|
@@ -51,10 +52,14 @@ interface AuthApplyHints {
|
|
|
51
52
|
reportSelection?: (accountId: string, isActive: boolean, remappedModel?: string) => void;
|
|
52
53
|
/**
|
|
53
54
|
* OPTIONAL preferred subscription account id (provider/subscription duality).
|
|
54
|
-
* When set
|
|
55
|
-
*
|
|
55
|
+
* When set, strict is the default; only the explicit `'pool'` policy permits
|
|
56
|
+
* pool fallback. Absent bindings keep pool auto-scheduling.
|
|
56
57
|
*/
|
|
57
58
|
preferredAccountId?: string;
|
|
59
|
+
/** Optional account group selected by a resource-level gateway binding. */
|
|
60
|
+
preferredAccountGroup?: string;
|
|
61
|
+
/** `'pool'` is an explicit opt-in; strict is the default for bindings. */
|
|
62
|
+
boundAccountFallbackPolicy?: BoundAccountFallbackPolicy;
|
|
58
63
|
}
|
|
59
64
|
interface AuthStrategy {
|
|
60
65
|
/** Discriminator — also surfaced through `subscription:list` to renderers. */
|
|
@@ -87,4 +92,4 @@ interface AuthStrategy {
|
|
|
87
92
|
describeStatus(): Promise<SubscriptionStatusEntry>;
|
|
88
93
|
}
|
|
89
94
|
|
|
90
|
-
export type
|
|
95
|
+
export { type AuthApplyHints, type AuthStrategy, BoundAccountFallbackPolicy };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SubscriptionProviderId, SubscriptionStatusEntry } from '@omnicross/contracts/subscription-types';
|
|
2
|
+
import { BoundAccountFallbackPolicy } from './BoundAccountSelectionError.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* SubscriptionAuthStrategy — the pluggable subscription-auth contract, defined
|
|
@@ -51,10 +52,14 @@ interface AuthApplyHints {
|
|
|
51
52
|
reportSelection?: (accountId: string, isActive: boolean, remappedModel?: string) => void;
|
|
52
53
|
/**
|
|
53
54
|
* OPTIONAL preferred subscription account id (provider/subscription duality).
|
|
54
|
-
* When set
|
|
55
|
-
*
|
|
55
|
+
* When set, strict is the default; only the explicit `'pool'` policy permits
|
|
56
|
+
* pool fallback. Absent bindings keep pool auto-scheduling.
|
|
56
57
|
*/
|
|
57
58
|
preferredAccountId?: string;
|
|
59
|
+
/** Optional account group selected by a resource-level gateway binding. */
|
|
60
|
+
preferredAccountGroup?: string;
|
|
61
|
+
/** `'pool'` is an explicit opt-in; strict is the default for bindings. */
|
|
62
|
+
boundAccountFallbackPolicy?: BoundAccountFallbackPolicy;
|
|
58
63
|
}
|
|
59
64
|
interface AuthStrategy {
|
|
60
65
|
/** Discriminator — also surfaced through `subscription:list` to renderers. */
|
|
@@ -87,4 +92,4 @@ interface AuthStrategy {
|
|
|
87
92
|
describeStatus(): Promise<SubscriptionStatusEntry>;
|
|
88
93
|
}
|
|
89
94
|
|
|
90
|
-
export type
|
|
95
|
+
export { type AuthApplyHints, type AuthStrategy, BoundAccountFallbackPolicy };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMUHWHQVMcjs = require('../chunk-MUHWHQVM.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
exports.executeProviderCall =
|
|
6
|
+
exports.executeProviderCall = _chunkMUHWHQVMcjs.executeProviderCall;
|
|
@@ -101,8 +101,9 @@ interface ProviderCallContext {
|
|
|
101
101
|
*/
|
|
102
102
|
fetchFn: (url: string, headers: Record<string, string>, body: unknown) => Promise<Response>;
|
|
103
103
|
/**
|
|
104
|
-
* When `true`, the core runs `executeResponseChain` on
|
|
105
|
-
* response and returns the TRANSFORMED response
|
|
104
|
+
* When `true`, the core runs `executeResponseChain` on a SUCCESSFUL fetched
|
|
105
|
+
* response and returns the TRANSFORMED response; a failed (`!response.ok`)
|
|
106
|
+
* response is returned raw so its status and error body survive. When `false` (default),
|
|
106
107
|
* the core returns the RAW fetched response and the caller runs the
|
|
107
108
|
* response chain itself — this preserves call sites that gate on
|
|
108
109
|
* `response.ok` BEFORE the response chain (Adapter / Handler).
|
|
@@ -127,7 +128,11 @@ interface ProviderCallContext {
|
|
|
127
128
|
* before, and so the wire-capture / logging hooks keep their inputs.
|
|
128
129
|
*/
|
|
129
130
|
interface ProviderCallResult {
|
|
130
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Transformed response (runResponseChain=true AND the upstream response was
|
|
133
|
+
* `ok`), otherwise the RAW fetched response — see the `.ok` gate in the
|
|
134
|
+
* implementation for why failures are never transformed.
|
|
135
|
+
*/
|
|
131
136
|
response: Response;
|
|
132
137
|
/** Request-chain output body (pre-`prepareBody`). */
|
|
133
138
|
requestBody: unknown;
|
|
@@ -101,8 +101,9 @@ interface ProviderCallContext {
|
|
|
101
101
|
*/
|
|
102
102
|
fetchFn: (url: string, headers: Record<string, string>, body: unknown) => Promise<Response>;
|
|
103
103
|
/**
|
|
104
|
-
* When `true`, the core runs `executeResponseChain` on
|
|
105
|
-
* response and returns the TRANSFORMED response
|
|
104
|
+
* When `true`, the core runs `executeResponseChain` on a SUCCESSFUL fetched
|
|
105
|
+
* response and returns the TRANSFORMED response; a failed (`!response.ok`)
|
|
106
|
+
* response is returned raw so its status and error body survive. When `false` (default),
|
|
106
107
|
* the core returns the RAW fetched response and the caller runs the
|
|
107
108
|
* response chain itself — this preserves call sites that gate on
|
|
108
109
|
* `response.ok` BEFORE the response chain (Adapter / Handler).
|
|
@@ -127,7 +128,11 @@ interface ProviderCallContext {
|
|
|
127
128
|
* before, and so the wire-capture / logging hooks keep their inputs.
|
|
128
129
|
*/
|
|
129
130
|
interface ProviderCallResult {
|
|
130
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Transformed response (runResponseChain=true AND the upstream response was
|
|
133
|
+
* `ok`), otherwise the RAW fetched response — see the `.ok` gate in the
|
|
134
|
+
* implementation for why failures are never transformed.
|
|
135
|
+
*/
|
|
131
136
|
response: Response;
|
|
132
137
|
/** Request-chain output body (pre-`prepareBody`). */
|
|
133
138
|
requestBody: unknown;
|
|
@@ -13,9 +13,8 @@ import '../transformer/TransformerService.cjs';
|
|
|
13
13
|
* block verbatim. This module extracts that single shared helper so the
|
|
14
14
|
* logic lives in exactly one place.
|
|
15
15
|
*
|
|
16
|
-
* IMPORTANT: body mutations that are proxy-specific (
|
|
17
|
-
*
|
|
18
|
-
* they remain at each call site as before.
|
|
16
|
+
* IMPORTANT: body mutations that are proxy-specific (thinkingLevel body-inject)
|
|
17
|
+
* are NOT part of this helper — they remain at each call site as before.
|
|
19
18
|
*
|
|
20
19
|
* @module pipeline/resolveProviderChain
|
|
21
20
|
*/
|
|
@@ -13,9 +13,8 @@ import '../transformer/TransformerService.js';
|
|
|
13
13
|
* block verbatim. This module extracts that single shared helper so the
|
|
14
14
|
* logic lives in exactly one place.
|
|
15
15
|
*
|
|
16
|
-
* IMPORTANT: body mutations that are proxy-specific (
|
|
17
|
-
*
|
|
18
|
-
* they remain at each call site as before.
|
|
16
|
+
* IMPORTANT: body mutations that are proxy-specific (thinkingLevel body-inject)
|
|
17
|
+
* are NOT part of this helper — they remain at each call site as before.
|
|
19
18
|
*
|
|
20
19
|
* @module pipeline/resolveProviderChain
|
|
21
20
|
*/
|
|
@@ -3,6 +3,7 @@ import { Transformer, ResolvedTransformerChain } from '../transformer/types.cjs'
|
|
|
3
3
|
import { SubscriptionAuthProfile } from './SubscriptionAuthSource.cjs';
|
|
4
4
|
import '@omnicross/contracts/subscription-types';
|
|
5
5
|
import './AuthSource.cjs';
|
|
6
|
+
import './BoundAccountSelectionError.cjs';
|
|
6
7
|
import './SubscriptionAuthStrategy.cjs';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -3,6 +3,7 @@ import { Transformer, ResolvedTransformerChain } from '../transformer/types.js';
|
|
|
3
3
|
import { SubscriptionAuthProfile } from './SubscriptionAuthSource.js';
|
|
4
4
|
import '@omnicross/contracts/subscription-types';
|
|
5
5
|
import './AuthSource.js';
|
|
6
|
+
import './BoundAccountSelectionError.js';
|
|
6
7
|
import './SubscriptionAuthStrategy.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('../chunk-
|
|
7
|
+
var _chunkRJUONLUQcjs = require('../chunk-RJUONLUQ.cjs');
|
|
8
|
+
require('../chunk-235MXAGX.cjs');
|
|
9
|
+
require('../chunk-HVBBDBS3.cjs');
|
|
10
|
+
require('../chunk-NKVZ6Z3Y.cjs');
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
exports.__resetUpstreamProxyForTests =
|
|
17
|
+
exports.__resetUpstreamProxyForTests = _chunkRJUONLUQcjs.__resetUpstreamProxyForTests; exports.bumpUpstreamProxyGeneration = _chunkRJUONLUQcjs.bumpUpstreamProxyGeneration; exports.fetchUpstream = _chunkRJUONLUQcjs.fetchUpstream; exports.resolveUpstreamDispatcher = _chunkRJUONLUQcjs.resolveUpstreamDispatcher; exports.setUpstreamProxyResolver = _chunkRJUONLUQcjs.setUpstreamProxyResolver;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ProxyConfig } from '@omnicross/contracts/account-tokens-types';
|
|
2
2
|
import { Dispatcher } from 'undici';
|
|
3
|
+
import { AccountRouteEndpoint, AccountRouteSessionSource, AccountRouteActivityRecord } from './AccountRouteActivity.cjs';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* upstreamFetch — the single proxy-aware egress seam for `@omnicross/core`
|
|
@@ -28,27 +29,55 @@ import { Dispatcher } from 'undici';
|
|
|
28
29
|
* FROZEN SEAM: `#7` (client fingerprint) attaches per-account TLS/agent behavior
|
|
29
30
|
* at this SAME dispatcher point — do not fork a second egress path.
|
|
30
31
|
*
|
|
31
|
-
* DEBUG TRACE: when
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* DEBUG TRACE: when a diagnostic caller explicitly installs an upstream-trace
|
|
33
|
+
* path, relay calls (`ctx.providerId` set) clone the response and append the
|
|
34
|
+
* FULL exchange (request + verbatim response incl. SSE) to the trace file. The
|
|
35
|
+
* daemon audit runtime never installs this path, preventing duplicate body
|
|
36
|
+
* storage. Absent a path (the default) it is a pure no-op — zero regression.
|
|
36
37
|
*
|
|
37
38
|
* @module @omnicross/core/pipeline/upstreamFetch
|
|
38
39
|
*/
|
|
39
40
|
|
|
41
|
+
interface AccountRouteActivityContext {
|
|
42
|
+
endpoint: AccountRouteEndpoint;
|
|
43
|
+
sessionKey?: string;
|
|
44
|
+
sessionSource: AccountRouteSessionSource;
|
|
45
|
+
model: string;
|
|
46
|
+
/**
|
|
47
|
+
* Invoked once with the freshly-recorded activity record. Lets a caller
|
|
48
|
+
* capture the record `id` so it can {@link AccountRouteActivityStore.amend}
|
|
49
|
+
* the SAME row later, once a post-hoc fact (e.g. an overload event buried in
|
|
50
|
+
* the 200 SSE body) becomes known during relay. Best-effort: never throws.
|
|
51
|
+
*/
|
|
52
|
+
onRecorded?: (record: AccountRouteActivityRecord) => void;
|
|
53
|
+
}
|
|
40
54
|
/** The opaque call context the resolver maps to a proxy (precedence input). */
|
|
41
55
|
interface UpstreamProxyContext {
|
|
42
56
|
/** The subscription provider id (`claude`/`codex`/`gemini`/`opencodego`) or `'byo'`. */
|
|
43
57
|
providerId?: string;
|
|
44
58
|
/** The selected pooled account id (per-account override input). */
|
|
45
59
|
accountId?: string;
|
|
60
|
+
/** Metadata-only live route activity. Never contains prompts, headers, or tokens. */
|
|
61
|
+
routeActivity?: AccountRouteActivityContext;
|
|
46
62
|
/**
|
|
47
63
|
* The target upstream URL. Injected by {@link fetchUpstream} so the resolver can
|
|
48
64
|
* apply host-based bypass (loopback / `NO_PROXY`). Callers of the ingress helpers
|
|
49
65
|
* do NOT set this — it is filled from the fetch `url`.
|
|
50
66
|
*/
|
|
51
67
|
url?: string;
|
|
68
|
+
/**
|
|
69
|
+
* CREDENTIAL EXCHANGE — this call's request/response BODIES carry secrets (an
|
|
70
|
+
* authorization code + PKCE verifier out, an access/refresh token back), so the
|
|
71
|
+
* debug trace must record the exchange's METADATA only and replace both bodies
|
|
72
|
+
* with a placeholder.
|
|
73
|
+
*
|
|
74
|
+
* Set it on every OAuth token-endpoint call (interactive login + refresh).
|
|
75
|
+
* Those calls still need a `providerId` so the per-provider proxy layer applies
|
|
76
|
+
* and so a failure is traceable at all — but the trace captures bodies verbatim
|
|
77
|
+
* (that is its purpose for relay traffic), and a plaintext token must never
|
|
78
|
+
* reach the trace file. Purely a trace concern: the proxy resolver ignores it.
|
|
79
|
+
*/
|
|
80
|
+
redactBodies?: boolean;
|
|
52
81
|
}
|
|
53
82
|
/**
|
|
54
83
|
* The layered proxy lookup the daemon injects. Applies precedence
|
|
@@ -86,4 +115,4 @@ declare function fetchUpstream(url: string, init: RequestInit, ctx?: UpstreamPro
|
|
|
86
115
|
/** TEST SEAM — clear the resolver + cache so a suite starts from the direct-fetch baseline. */
|
|
87
116
|
declare function __resetUpstreamProxyForTests(): void;
|
|
88
117
|
|
|
89
|
-
export { type UpstreamProxyContext, type UpstreamProxyResolver, __resetUpstreamProxyForTests, bumpUpstreamProxyGeneration, fetchUpstream, resolveUpstreamDispatcher, setUpstreamProxyResolver };
|
|
118
|
+
export { type AccountRouteActivityContext, type UpstreamProxyContext, type UpstreamProxyResolver, __resetUpstreamProxyForTests, bumpUpstreamProxyGeneration, fetchUpstream, resolveUpstreamDispatcher, setUpstreamProxyResolver };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ProxyConfig } from '@omnicross/contracts/account-tokens-types';
|
|
2
2
|
import { Dispatcher } from 'undici';
|
|
3
|
+
import { AccountRouteEndpoint, AccountRouteSessionSource, AccountRouteActivityRecord } from './AccountRouteActivity.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* upstreamFetch — the single proxy-aware egress seam for `@omnicross/core`
|
|
@@ -28,27 +29,55 @@ import { Dispatcher } from 'undici';
|
|
|
28
29
|
* FROZEN SEAM: `#7` (client fingerprint) attaches per-account TLS/agent behavior
|
|
29
30
|
* at this SAME dispatcher point — do not fork a second egress path.
|
|
30
31
|
*
|
|
31
|
-
* DEBUG TRACE: when
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* DEBUG TRACE: when a diagnostic caller explicitly installs an upstream-trace
|
|
33
|
+
* path, relay calls (`ctx.providerId` set) clone the response and append the
|
|
34
|
+
* FULL exchange (request + verbatim response incl. SSE) to the trace file. The
|
|
35
|
+
* daemon audit runtime never installs this path, preventing duplicate body
|
|
36
|
+
* storage. Absent a path (the default) it is a pure no-op — zero regression.
|
|
36
37
|
*
|
|
37
38
|
* @module @omnicross/core/pipeline/upstreamFetch
|
|
38
39
|
*/
|
|
39
40
|
|
|
41
|
+
interface AccountRouteActivityContext {
|
|
42
|
+
endpoint: AccountRouteEndpoint;
|
|
43
|
+
sessionKey?: string;
|
|
44
|
+
sessionSource: AccountRouteSessionSource;
|
|
45
|
+
model: string;
|
|
46
|
+
/**
|
|
47
|
+
* Invoked once with the freshly-recorded activity record. Lets a caller
|
|
48
|
+
* capture the record `id` so it can {@link AccountRouteActivityStore.amend}
|
|
49
|
+
* the SAME row later, once a post-hoc fact (e.g. an overload event buried in
|
|
50
|
+
* the 200 SSE body) becomes known during relay. Best-effort: never throws.
|
|
51
|
+
*/
|
|
52
|
+
onRecorded?: (record: AccountRouteActivityRecord) => void;
|
|
53
|
+
}
|
|
40
54
|
/** The opaque call context the resolver maps to a proxy (precedence input). */
|
|
41
55
|
interface UpstreamProxyContext {
|
|
42
56
|
/** The subscription provider id (`claude`/`codex`/`gemini`/`opencodego`) or `'byo'`. */
|
|
43
57
|
providerId?: string;
|
|
44
58
|
/** The selected pooled account id (per-account override input). */
|
|
45
59
|
accountId?: string;
|
|
60
|
+
/** Metadata-only live route activity. Never contains prompts, headers, or tokens. */
|
|
61
|
+
routeActivity?: AccountRouteActivityContext;
|
|
46
62
|
/**
|
|
47
63
|
* The target upstream URL. Injected by {@link fetchUpstream} so the resolver can
|
|
48
64
|
* apply host-based bypass (loopback / `NO_PROXY`). Callers of the ingress helpers
|
|
49
65
|
* do NOT set this — it is filled from the fetch `url`.
|
|
50
66
|
*/
|
|
51
67
|
url?: string;
|
|
68
|
+
/**
|
|
69
|
+
* CREDENTIAL EXCHANGE — this call's request/response BODIES carry secrets (an
|
|
70
|
+
* authorization code + PKCE verifier out, an access/refresh token back), so the
|
|
71
|
+
* debug trace must record the exchange's METADATA only and replace both bodies
|
|
72
|
+
* with a placeholder.
|
|
73
|
+
*
|
|
74
|
+
* Set it on every OAuth token-endpoint call (interactive login + refresh).
|
|
75
|
+
* Those calls still need a `providerId` so the per-provider proxy layer applies
|
|
76
|
+
* and so a failure is traceable at all — but the trace captures bodies verbatim
|
|
77
|
+
* (that is its purpose for relay traffic), and a plaintext token must never
|
|
78
|
+
* reach the trace file. Purely a trace concern: the proxy resolver ignores it.
|
|
79
|
+
*/
|
|
80
|
+
redactBodies?: boolean;
|
|
52
81
|
}
|
|
53
82
|
/**
|
|
54
83
|
* The layered proxy lookup the daemon injects. Applies precedence
|
|
@@ -86,4 +115,4 @@ declare function fetchUpstream(url: string, init: RequestInit, ctx?: UpstreamPro
|
|
|
86
115
|
/** TEST SEAM — clear the resolver + cache so a suite starts from the direct-fetch baseline. */
|
|
87
116
|
declare function __resetUpstreamProxyForTests(): void;
|
|
88
117
|
|
|
89
|
-
export { type UpstreamProxyContext, type UpstreamProxyResolver, __resetUpstreamProxyForTests, bumpUpstreamProxyGeneration, fetchUpstream, resolveUpstreamDispatcher, setUpstreamProxyResolver };
|
|
118
|
+
export { type AccountRouteActivityContext, type UpstreamProxyContext, type UpstreamProxyResolver, __resetUpstreamProxyForTests, bumpUpstreamProxyGeneration, fetchUpstream, resolveUpstreamDispatcher, setUpstreamProxyResolver };
|
|
@@ -4,8 +4,10 @@ import {
|
|
|
4
4
|
fetchUpstream,
|
|
5
5
|
resolveUpstreamDispatcher,
|
|
6
6
|
setUpstreamProxyResolver
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-RJ5ZGNI3.js";
|
|
8
|
+
import "../chunk-3WD4HTR2.js";
|
|
9
|
+
import "../chunk-MKF46GNZ.js";
|
|
10
|
+
import "../chunk-GL6XM527.js";
|
|
9
11
|
export {
|
|
10
12
|
__resetUpstreamProxyForTests,
|
|
11
13
|
bumpUpstreamProxyGeneration,
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var _chunk3Z5BQZFMcjs = require('../chunk-3Z5BQZFM.cjs');
|
|
8
7
|
|
|
8
|
+
var _chunk235MXAGXcjs = require('../chunk-235MXAGX.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.REDACTED_BODY = _chunk235MXAGXcjs.REDACTED_BODY; exports.__resetUpstreamTraceForTests = _chunk235MXAGXcjs.__resetUpstreamTraceForTests; exports.getUpstreamTracePath = _chunk235MXAGXcjs.getUpstreamTracePath; exports.redactHeaders = _chunk235MXAGXcjs.redactHeaders; exports.setUpstreamTracePath = _chunk235MXAGXcjs.setUpstreamTracePath; exports.writeUpstreamTrace = _chunk235MXAGXcjs.writeUpstreamTrace;
|
|
@@ -14,22 +14,36 @@
|
|
|
14
14
|
* (a `text/event-stream` included — `clone().text()` tees the stream so the
|
|
15
15
|
* relay keeps streaming the original while the clone is buffered for the
|
|
16
16
|
* trace), and appends one {@link UpstreamTraceRecord} JSON line. Relay calls
|
|
17
|
-
* carry an opaque `providerId`;
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* carry an opaque `providerId`; webhook / billing sends do not, so they are
|
|
18
|
+
* skipped (less noise). OAuth token-endpoint calls (interactive login + refresh)
|
|
19
|
+
* DO carry one — a failed login must be diagnosable — but they set the ctx's
|
|
20
|
+
* `redactBodies`, so their bodies are replaced with {@link REDACTED_BODY}.
|
|
21
|
+
* Tracing is fire-and-forget: a read/write failure is swallowed so the egress
|
|
22
|
+
* path is never affected.
|
|
20
23
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
* A diagnostic caller may explicitly install a path via
|
|
25
|
+
* {@link setUpstreamTracePath}. The daemon's audit runtime intentionally does
|
|
26
|
+
* not install one: audit bodies have a single persistence path. Absent an
|
|
27
|
+
* explicit path the trace is a pure no-op — byte-identical zero regression.
|
|
24
28
|
*
|
|
25
29
|
* Secret discipline: request/response AUTHORIZATION + api-key HEADER values are
|
|
26
30
|
* masked (`***REDACTED***`) — they are OAuth bearer tokens, not the thing under
|
|
27
31
|
* test, and a plaintext trace file must not hold them. Header KEYS stay visible
|
|
28
32
|
* so presence is verifiable. The request/response BODIES are captured VERBATIM
|
|
29
|
-
* (a prompt / a codex SSE stream) — that is the whole point
|
|
33
|
+
* (a prompt / a codex SSE stream) — that is the whole point — EXCEPT on a
|
|
34
|
+
* credential exchange, where the body IS the secret (see {@link REDACTED_BODY}).
|
|
30
35
|
*
|
|
31
36
|
* @module @omnicross/core/pipeline/upstreamTrace
|
|
32
37
|
*/
|
|
38
|
+
/**
|
|
39
|
+
* Placeholder written in place of a request/response body whose content is a
|
|
40
|
+
* CREDENTIAL rather than the thing under test — an OAuth token exchange or
|
|
41
|
+
* refresh (`fetchUpstream` ctx `redactBodies`). Those calls are still traced so a
|
|
42
|
+
* failed login/refresh is diagnosable (url, status, duration, byte count), but a
|
|
43
|
+
* plaintext authorization code / access token / refresh token must never land in
|
|
44
|
+
* this file.
|
|
45
|
+
*/
|
|
46
|
+
declare const REDACTED_BODY = "***REDACTED (credential exchange)***";
|
|
33
47
|
/**
|
|
34
48
|
* Install (or clear, with `null`/blank) the trace file path. Idempotent — last
|
|
35
49
|
* write wins. The path is resolved by the daemon relative to the audit store.
|
|
@@ -82,4 +96,4 @@ declare function writeUpstreamTrace(record: UpstreamTraceRecord): Promise<void>;
|
|
|
82
96
|
/** TEST SEAM — clear the trace path so a suite starts from the no-trace baseline. */
|
|
83
97
|
declare function __resetUpstreamTraceForTests(): void;
|
|
84
98
|
|
|
85
|
-
export { type UpstreamTraceRecord, __resetUpstreamTraceForTests, getUpstreamTracePath, redactHeaders, setUpstreamTracePath, writeUpstreamTrace };
|
|
99
|
+
export { REDACTED_BODY, type UpstreamTraceRecord, __resetUpstreamTraceForTests, getUpstreamTracePath, redactHeaders, setUpstreamTracePath, writeUpstreamTrace };
|
|
@@ -14,22 +14,36 @@
|
|
|
14
14
|
* (a `text/event-stream` included — `clone().text()` tees the stream so the
|
|
15
15
|
* relay keeps streaming the original while the clone is buffered for the
|
|
16
16
|
* trace), and appends one {@link UpstreamTraceRecord} JSON line. Relay calls
|
|
17
|
-
* carry an opaque `providerId`;
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* carry an opaque `providerId`; webhook / billing sends do not, so they are
|
|
18
|
+
* skipped (less noise). OAuth token-endpoint calls (interactive login + refresh)
|
|
19
|
+
* DO carry one — a failed login must be diagnosable — but they set the ctx's
|
|
20
|
+
* `redactBodies`, so their bodies are replaced with {@link REDACTED_BODY}.
|
|
21
|
+
* Tracing is fire-and-forget: a read/write failure is swallowed so the egress
|
|
22
|
+
* path is never affected.
|
|
20
23
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
* A diagnostic caller may explicitly install a path via
|
|
25
|
+
* {@link setUpstreamTracePath}. The daemon's audit runtime intentionally does
|
|
26
|
+
* not install one: audit bodies have a single persistence path. Absent an
|
|
27
|
+
* explicit path the trace is a pure no-op — byte-identical zero regression.
|
|
24
28
|
*
|
|
25
29
|
* Secret discipline: request/response AUTHORIZATION + api-key HEADER values are
|
|
26
30
|
* masked (`***REDACTED***`) — they are OAuth bearer tokens, not the thing under
|
|
27
31
|
* test, and a plaintext trace file must not hold them. Header KEYS stay visible
|
|
28
32
|
* so presence is verifiable. The request/response BODIES are captured VERBATIM
|
|
29
|
-
* (a prompt / a codex SSE stream) — that is the whole point
|
|
33
|
+
* (a prompt / a codex SSE stream) — that is the whole point — EXCEPT on a
|
|
34
|
+
* credential exchange, where the body IS the secret (see {@link REDACTED_BODY}).
|
|
30
35
|
*
|
|
31
36
|
* @module @omnicross/core/pipeline/upstreamTrace
|
|
32
37
|
*/
|
|
38
|
+
/**
|
|
39
|
+
* Placeholder written in place of a request/response body whose content is a
|
|
40
|
+
* CREDENTIAL rather than the thing under test — an OAuth token exchange or
|
|
41
|
+
* refresh (`fetchUpstream` ctx `redactBodies`). Those calls are still traced so a
|
|
42
|
+
* failed login/refresh is diagnosable (url, status, duration, byte count), but a
|
|
43
|
+
* plaintext authorization code / access token / refresh token must never land in
|
|
44
|
+
* this file.
|
|
45
|
+
*/
|
|
46
|
+
declare const REDACTED_BODY = "***REDACTED (credential exchange)***";
|
|
33
47
|
/**
|
|
34
48
|
* Install (or clear, with `null`/blank) the trace file path. Idempotent — last
|
|
35
49
|
* write wins. The path is resolved by the daemon relative to the audit store.
|
|
@@ -82,4 +96,4 @@ declare function writeUpstreamTrace(record: UpstreamTraceRecord): Promise<void>;
|
|
|
82
96
|
/** TEST SEAM — clear the trace path so a suite starts from the no-trace baseline. */
|
|
83
97
|
declare function __resetUpstreamTraceForTests(): void;
|
|
84
98
|
|
|
85
|
-
export { type UpstreamTraceRecord, __resetUpstreamTraceForTests, getUpstreamTracePath, redactHeaders, setUpstreamTracePath, writeUpstreamTrace };
|
|
99
|
+
export { REDACTED_BODY, type UpstreamTraceRecord, __resetUpstreamTraceForTests, getUpstreamTracePath, redactHeaders, setUpstreamTracePath, writeUpstreamTrace };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
REDACTED_BODY,
|
|
2
3
|
__resetUpstreamTraceForTests,
|
|
3
4
|
getUpstreamTracePath,
|
|
4
5
|
redactHeaders,
|
|
5
6
|
setUpstreamTracePath,
|
|
6
7
|
writeUpstreamTrace
|
|
7
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-3WD4HTR2.js";
|
|
8
9
|
export {
|
|
10
|
+
REDACTED_BODY,
|
|
9
11
|
__resetUpstreamTraceForTests,
|
|
10
12
|
getUpstreamTracePath,
|
|
11
13
|
redactHeaders,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PricingEntry, PricingEntryInput, PricingResolution } from '@omnicross/contracts/pricing-types';
|
|
1
|
+
import { PricingSource, PricingEntry, PricingEntryInput, PricingResolution } from '@omnicross/contracts/pricing-types';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* `PricingStore` — core-owned port for pricing-row persistence.
|
|
@@ -11,6 +11,7 @@ import { PricingEntry, PricingEntryInput, PricingResolution } from '@omnicross/c
|
|
|
11
11
|
* @module ports/pricing-store
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
type AutomaticPricingSource = Extract<PricingSource, 'litellm' | 'openrouter'>;
|
|
14
15
|
interface PricingStore {
|
|
15
16
|
/** Return every pricing row. The engine caches the full table in memory. */
|
|
16
17
|
getAll(): Promise<PricingEntry[]>;
|
|
@@ -29,7 +30,7 @@ interface PricingStore {
|
|
|
29
30
|
* left untouched and returned in `conflicts` as `{ current, incoming }`
|
|
30
31
|
* pairs for per-row resolution by the user.
|
|
31
32
|
*/
|
|
32
|
-
bulkApplyFromSource(entries: PricingEntryInput[]): Promise<{
|
|
33
|
+
bulkApplyFromSource(entries: PricingEntryInput[], source?: AutomaticPricingSource): Promise<{
|
|
33
34
|
applied: PricingEntry[];
|
|
34
35
|
conflicts: Array<{
|
|
35
36
|
current: PricingEntry;
|
|
@@ -47,4 +48,4 @@ interface PricingStore {
|
|
|
47
48
|
}>): Promise<PricingResolution>;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
export type { PricingStore };
|
|
51
|
+
export type { AutomaticPricingSource, PricingStore };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PricingEntry, PricingEntryInput, PricingResolution } from '@omnicross/contracts/pricing-types';
|
|
1
|
+
import { PricingSource, PricingEntry, PricingEntryInput, PricingResolution } from '@omnicross/contracts/pricing-types';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* `PricingStore` — core-owned port for pricing-row persistence.
|
|
@@ -11,6 +11,7 @@ import { PricingEntry, PricingEntryInput, PricingResolution } from '@omnicross/c
|
|
|
11
11
|
* @module ports/pricing-store
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
type AutomaticPricingSource = Extract<PricingSource, 'litellm' | 'openrouter'>;
|
|
14
15
|
interface PricingStore {
|
|
15
16
|
/** Return every pricing row. The engine caches the full table in memory. */
|
|
16
17
|
getAll(): Promise<PricingEntry[]>;
|
|
@@ -29,7 +30,7 @@ interface PricingStore {
|
|
|
29
30
|
* left untouched and returned in `conflicts` as `{ current, incoming }`
|
|
30
31
|
* pairs for per-row resolution by the user.
|
|
31
32
|
*/
|
|
32
|
-
bulkApplyFromSource(entries: PricingEntryInput[]): Promise<{
|
|
33
|
+
bulkApplyFromSource(entries: PricingEntryInput[], source?: AutomaticPricingSource): Promise<{
|
|
33
34
|
applied: PricingEntry[];
|
|
34
35
|
conflicts: Array<{
|
|
35
36
|
current: PricingEntry;
|
|
@@ -47,4 +48,4 @@ interface PricingStore {
|
|
|
47
48
|
}>): Promise<PricingResolution>;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
export type { PricingStore };
|
|
51
|
+
export type { AutomaticPricingSource, PricingStore };
|
package/dist/ports.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { C as CorePaths, a as CoreUsageEvent, b as CoreUsageTokenCounts, U as UsageEventSink } from './usage-event-sink-BX7FE1NL.cjs';
|
|
2
2
|
export { L as Logger } from './logger-4GvQNzhE.cjs';
|
|
3
|
-
export { PricingStore } from './ports/pricing-store.cjs';
|
|
3
|
+
export { AutomaticPricingSource, PricingStore } from './ports/pricing-store.cjs';
|
|
4
4
|
export { ProviderConfigSource } from './ports/provider-config-source.cjs';
|
|
5
5
|
export { UsageEventStore } from './ports/usage-event-store.cjs';
|
|
6
6
|
export { WebSearchBackend } from './ports/web-search-backend.cjs';
|
|
7
7
|
export { UsageRecorderImport as UsageSink } from './provider-proxy/types.cjs';
|
|
8
|
-
export { O as OutboundCredentialStore } from './types-
|
|
8
|
+
export { O as OutboundCredentialStore } from './types-gjJ5lJ5n.cjs';
|
|
9
9
|
import '@omnicross/contracts/pricing-types';
|
|
10
10
|
import '@omnicross/contracts/llm-config';
|
|
11
11
|
import './transformer/types.cjs';
|
|
@@ -18,6 +18,7 @@ import '@omnicross/contracts/subscription-types';
|
|
|
18
18
|
import '@omnicross/contracts/usage-types';
|
|
19
19
|
import './completion/ApiKeyPoolService.cjs';
|
|
20
20
|
import './pipeline/AuthSource.cjs';
|
|
21
|
+
import './pipeline/BoundAccountSelectionError.cjs';
|
|
21
22
|
import './pipeline/SubscriptionAuthSource.cjs';
|
|
22
23
|
import './pipeline/SubscriptionAuthStrategy.cjs';
|
|
23
24
|
import '@omnicross/contracts/account-tokens-types';
|
|
@@ -27,4 +28,4 @@ import '@omnicross/contracts/health-logging-types';
|
|
|
27
28
|
import '@omnicross/contracts/voucher-types';
|
|
28
29
|
import '@omnicross/contracts/webhook-types';
|
|
29
30
|
import './ProviderProxy-CnMQYN59.cjs';
|
|
30
|
-
import './keyPolicy-
|
|
31
|
+
import './keyPolicy-zdWTu3CQ.cjs';
|
package/dist/ports.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { C as CorePaths, a as CoreUsageEvent, b as CoreUsageTokenCounts, U as UsageEventSink } from './usage-event-sink-BX7FE1NL.js';
|
|
2
2
|
export { L as Logger } from './logger-4GvQNzhE.js';
|
|
3
|
-
export { PricingStore } from './ports/pricing-store.js';
|
|
3
|
+
export { AutomaticPricingSource, PricingStore } from './ports/pricing-store.js';
|
|
4
4
|
export { ProviderConfigSource } from './ports/provider-config-source.js';
|
|
5
5
|
export { UsageEventStore } from './ports/usage-event-store.js';
|
|
6
6
|
export { WebSearchBackend } from './ports/web-search-backend.js';
|
|
7
7
|
export { UsageRecorderImport as UsageSink } from './provider-proxy/types.js';
|
|
8
|
-
export { O as OutboundCredentialStore } from './types-
|
|
8
|
+
export { O as OutboundCredentialStore } from './types-CqZD77rS.js';
|
|
9
9
|
import '@omnicross/contracts/pricing-types';
|
|
10
10
|
import '@omnicross/contracts/llm-config';
|
|
11
11
|
import './transformer/types.js';
|
|
@@ -18,6 +18,7 @@ import '@omnicross/contracts/subscription-types';
|
|
|
18
18
|
import '@omnicross/contracts/usage-types';
|
|
19
19
|
import './completion/ApiKeyPoolService.js';
|
|
20
20
|
import './pipeline/AuthSource.js';
|
|
21
|
+
import './pipeline/BoundAccountSelectionError.js';
|
|
21
22
|
import './pipeline/SubscriptionAuthSource.js';
|
|
22
23
|
import './pipeline/SubscriptionAuthStrategy.js';
|
|
23
24
|
import '@omnicross/contracts/account-tokens-types';
|
|
@@ -27,4 +28,4 @@ import '@omnicross/contracts/health-logging-types';
|
|
|
27
28
|
import '@omnicross/contracts/voucher-types';
|
|
28
29
|
import '@omnicross/contracts/webhook-types';
|
|
29
30
|
import './ProviderProxy-C-xqrkKi.js';
|
|
30
|
-
import './keyPolicy-
|
|
31
|
+
import './keyPolicy-zdWTu3CQ.js';
|