@omnicross/core 0.1.9 → 0.2.0
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 +22 -15
- package/dist/{CompletionService-kNA17cfI.d.cts → CompletionService-BiJqftc-.d.cts} +1 -1
- package/dist/{CompletionService-C3BX0Ovy.d.ts → CompletionService-NXN_Av5W.d.ts} +1 -1
- package/dist/{ProviderProxy-QdwNV6l1.d.cts → ProviderProxy-CgIcCVwk.d.cts} +1 -1
- package/dist/{ProviderProxy--ROec6VI.d.ts → ProviderProxy-DYoY5XoT.d.ts} +1 -1
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +6 -6
- package/dist/auth/GeminiCodeAssistProjectResolver.js +4 -4
- package/dist/chunk-32SRZFFP.cjs +153 -0
- package/dist/chunk-4JOU54M5.js +200 -0
- package/dist/{chunk-2UTGX6FM.js → chunk-4VVCXVB7.js} +1 -1
- package/dist/{chunk-EPN67EGP.cjs → chunk-5UK3KLE2.cjs} +9 -1
- package/dist/chunk-6DDYNS2B.cjs +384 -0
- package/dist/{chunk-HKB656B4.js → chunk-6OC3ORW6.js} +55 -287
- package/dist/chunk-6OKXH2TW.js +320 -0
- package/dist/{chunk-XELFM7KL.cjs → chunk-7B56AJBB.cjs} +6275 -2421
- package/dist/{chunk-YWL7YZWS.cjs → chunk-7LRTPNFL.cjs} +5 -0
- package/dist/{chunk-CCVRRJOX.js → chunk-7PIUVCKK.js} +9 -2
- package/dist/{chunk-IIRPUVPH.cjs → chunk-7ZHBN75N.cjs} +3 -1
- package/dist/{chunk-UAPBLNN2.js → chunk-AQDON6MB.js} +8 -0
- package/dist/{chunk-RJ5ZGNI3.js → chunk-CFSGYFOZ.js} +1 -1
- package/dist/chunk-CTKM773J.cjs +3919 -0
- package/dist/chunk-DEIUR2TH.js +3919 -0
- package/dist/{chunk-WNKWAEUR.js → chunk-EYGBM2VC.js} +3 -1
- package/dist/{chunk-NGYOO5TO.js → chunk-FJNKXOWE.js} +9 -9
- package/dist/chunk-FX325I5Q.cjs +320 -0
- package/dist/chunk-G4CZIUIB.cjs +200 -0
- package/dist/chunk-HCOQQAZE.cjs +123 -0
- package/dist/{chunk-55FMGZ3L.js → chunk-HN74IGEO.js} +1 -1
- package/dist/{chunk-ZY6KU6P3.js → chunk-HOMUGKHR.js} +8 -5
- package/dist/{chunk-AOFWNWLT.cjs → chunk-IUL4VWNU.cjs} +22 -1
- package/dist/{chunk-5LNYGCIW.cjs → chunk-KIQ2HA2A.cjs} +5 -5
- package/dist/{chunk-MUHWHQVM.cjs → chunk-KQBLZMP6.cjs} +4 -3
- package/dist/chunk-LFEH7CEO.js +384 -0
- package/dist/chunk-N76KU6F5.js +123 -0
- package/dist/{chunk-CMVXX7ON.cjs → chunk-NOITAVHA.cjs} +114 -58
- package/dist/{chunk-Q27JY5RG.cjs → chunk-OIKREZVQ.cjs} +7 -4
- package/dist/{chunk-RJUONLUQ.cjs → chunk-OST5RJOJ.cjs} +1 -1
- package/dist/chunk-QIIAMBTM.js +153 -0
- package/dist/{chunk-56QD3YW6.cjs → chunk-QWNUOR7F.cjs} +11 -4
- package/dist/{chunk-S3DYFEBE.js → chunk-R4VCO2CB.js} +10 -1
- package/dist/{chunk-ZQQUD66M.cjs → chunk-SQMAEDNE.cjs} +63 -295
- package/dist/{chunk-4VZX5F4T.cjs → chunk-T6NWPIYZ.cjs} +5 -2
- package/dist/{chunk-P7EM6BND.cjs → chunk-TVYA5JSQ.cjs} +10 -10
- package/dist/{chunk-EBLFCNPY.js → chunk-U47LQXPB.js} +5 -2
- package/dist/{chunk-N7OOJI5V.js → chunk-V2UKUTJ3.js} +5 -0
- package/dist/{chunk-45FHEOKW.js → chunk-V53ZEFXC.js} +92 -36
- package/dist/{chunk-OC6DOOFX.cjs → chunk-VXRTQZF2.cjs} +5 -5
- package/dist/{chunk-CQIJCPMF.js → chunk-WSJE42SG.js} +5149 -1295
- package/dist/{chunk-RICPANBY.cjs → chunk-WX2E2G7H.cjs} +13 -4
- package/dist/{chunk-DE2SRBFZ.js → chunk-X335TJNS.js} +4 -3
- package/dist/{chunk-N2EIM2XJ.js → chunk-ZLNHPUFA.js} +22 -1
- package/dist/completion/CompletionService.cjs +30 -27
- package/dist/completion/CompletionService.d.cts +3 -2
- package/dist/completion/CompletionService.d.ts +3 -2
- package/dist/completion/CompletionService.js +29 -26
- package/dist/completion.cjs +38 -35
- package/dist/completion.d.cts +3 -2
- package/dist/completion.d.ts +3 -2
- package/dist/completion.js +37 -34
- package/dist/image-generation.cjs +52 -0
- package/dist/image-generation.d.cts +93 -0
- package/dist/image-generation.d.ts +93 -0
- package/dist/image-generation.js +52 -0
- package/dist/index.cjs +126 -31
- package/dist/index.d.cts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +143 -48
- package/dist/openai-operation.cjs +18 -0
- package/dist/openai-operation.d.cts +19 -0
- package/dist/openai-operation.d.ts +19 -0
- package/dist/openai-operation.js +18 -0
- package/dist/outbound-api/auditCapture.cjs +3 -3
- package/dist/outbound-api/auditCapture.d.cts +19 -2
- package/dist/outbound-api/auditCapture.d.ts +19 -2
- package/dist/outbound-api/auditCapture.js +2 -2
- package/dist/outbound-api/auditRedact.cjs +2 -2
- package/dist/outbound-api/auditRedact.js +1 -1
- package/dist/outbound-api/routeResolver.cjs +2 -2
- package/dist/outbound-api/routeResolver.d.cts +7 -4
- package/dist/outbound-api/routeResolver.d.ts +7 -4
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.cts +2 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.ts +2 -1
- package/dist/outbound-api/types.d.cts +6 -3
- package/dist/outbound-api/types.d.ts +6 -3
- package/dist/outbound-api.cjs +49 -32
- package/dist/outbound-api.d.cts +97 -10
- package/dist/outbound-api.d.ts +97 -10
- package/dist/outbound-api.js +48 -31
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +18 -15
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +18 -15
- package/dist/pipeline/LlmConfigProviderAuth.cjs +3 -3
- package/dist/pipeline/LlmConfigProviderAuth.js +2 -2
- package/dist/pipeline/SubscriptionAccountHealth.cjs +2 -2
- package/dist/pipeline/SubscriptionAccountHealth.d.cts +7 -0
- package/dist/pipeline/SubscriptionAccountHealth.d.ts +7 -0
- package/dist/pipeline/SubscriptionAccountHealth.js +1 -1
- package/dist/pipeline/executeProviderCall.cjs +2 -2
- package/dist/pipeline/executeProviderCall.d.cts +11 -6
- package/dist/pipeline/executeProviderCall.d.ts +11 -6
- package/dist/pipeline/executeProviderCall.js +1 -1
- package/dist/pipeline/upstreamFetch.cjs +2 -2
- package/dist/pipeline/upstreamFetch.d.cts +5 -0
- package/dist/pipeline/upstreamFetch.d.ts +5 -0
- package/dist/pipeline/upstreamFetch.js +1 -1
- package/dist/ports.d.cts +6 -3
- package/dist/ports.d.ts +6 -3
- package/dist/provider-proxy/ProviderProxy.cjs +30 -27
- package/dist/provider-proxy/ProviderProxy.d.cts +3 -2
- package/dist/provider-proxy/ProviderProxy.d.ts +3 -2
- package/dist/provider-proxy/ProviderProxy.js +29 -26
- package/dist/provider-proxy/identity/codexCliHeaders.cjs +4 -2
- package/dist/provider-proxy/identity/codexCliHeaders.d.cts +26 -6
- package/dist/provider-proxy/identity/codexCliHeaders.d.ts +26 -6
- package/dist/provider-proxy/identity/codexCliHeaders.js +5 -3
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +32 -27
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +21 -8
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +21 -8
- package/dist/provider-proxy/ingress/providerProxyShared.js +31 -26
- package/dist/provider-proxy/types.d.cts +14 -483
- package/dist/provider-proxy/types.d.ts +14 -483
- package/dist/provider-proxy.cjs +44 -27
- package/dist/provider-proxy.d.cts +30 -8
- package/dist/provider-proxy.d.ts +30 -8
- package/dist/provider-proxy.js +43 -26
- package/dist/{routeResolver-C0mkkZaM.d.ts → routeResolver-CTCcSHWu.d.ts} +4 -2
- package/dist/{routeResolver-CVFE8KKe.d.cts → routeResolver-rpKQLyDO.d.cts} +4 -2
- package/dist/transformer/TransformerChainExecutor.cjs +2 -2
- package/dist/transformer/TransformerChainExecutor.d.cts +2 -2
- package/dist/transformer/TransformerChainExecutor.d.ts +2 -2
- package/dist/transformer/TransformerChainExecutor.js +1 -1
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.cjs +16 -0
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.d.cts +53 -0
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.d.ts +53 -0
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.js +16 -0
- package/dist/transformer/transformers/AnthropicTransformer.cjs +4 -3
- package/dist/transformer/transformers/AnthropicTransformer.js +3 -2
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +4 -4
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +3 -3
- package/dist/transformer/transformers/GeminiTransformer.cjs +4 -4
- package/dist/transformer/transformers/GeminiTransformer.js +3 -3
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -3
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -2
- package/dist/transformer/transformers/OpenAITransformer.cjs +3 -3
- package/dist/transformer/transformers/OpenAITransformer.js +2 -2
- package/dist/transformer/transformers.cjs +10 -9
- package/dist/transformer/transformers.js +13 -12
- package/dist/transformer/types.d.cts +39 -4
- package/dist/transformer/types.d.ts +39 -4
- package/dist/transformer.cjs +14 -13
- package/dist/transformer.js +14 -13
- package/dist/{types-BB8pxk_3.d.ts → types-5T223WYQ.d.ts} +183 -23
- package/dist/types-Bd72H4SB.d.ts +196 -0
- package/dist/types-CVRge76p.d.ts +1115 -0
- package/dist/types-CbglB73l.d.cts +196 -0
- package/dist/types-DsHBBk3h.d.cts +1115 -0
- package/dist/{types-C2MwkLah.d.cts → types-jjU24eYG.d.cts} +183 -23
- package/dist/usage/usage-recorder.cjs +2 -2
- package/dist/usage/usage-recorder.d.cts +12 -2
- package/dist/usage/usage-recorder.d.ts +12 -2
- package/dist/usage/usage-recorder.js +1 -1
- package/dist/usage.cjs +20 -3
- package/dist/usage.d.cts +154 -0
- package/dist/usage.d.ts +154 -0
- package/dist/usage.js +20 -3
- package/package.json +69 -64
- package/dist/chunk-7C7DET6S.js +0 -154
- package/dist/chunk-7VU7V2E4.js +0 -0
- package/dist/chunk-EYZYXJTJ.cjs +0 -1
- package/dist/chunk-FCR77GYM.cjs +0 -33
- package/dist/chunk-K5NM7VAH.js +0 -33
- package/dist/chunk-XPIOJQS2.cjs +0 -154
- /package/dist/{chunk-XXFYLL7R.js → chunk-ECZ3ZE2C.js} +0 -0
- /package/dist/{chunk-3SCOLIPT.cjs → chunk-MXI2PWIC.cjs} +0 -0
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { SubscriptionProviderId } from '@omnicross/contracts/subscription-types';
|
|
2
|
-
import { a as AllowanceSchedulingConfig } from '../types-
|
|
2
|
+
import { a as AllowanceSchedulingConfig } from '../types-5T223WYQ.js';
|
|
3
3
|
import { AccountAllowanceStore } from './AccountAllowanceStore.js';
|
|
4
|
-
import '
|
|
5
|
-
import '@omnicross/contracts/
|
|
6
|
-
import '
|
|
7
|
-
import '@omnicross/contracts/health-logging-types';
|
|
8
|
-
import '@omnicross/contracts/voucher-types';
|
|
9
|
-
import '@omnicross/contracts/webhook-types';
|
|
10
|
-
import '../logger-4GvQNzhE.js';
|
|
11
|
-
import '../ports/provider-config-source.js';
|
|
12
|
-
import '@omnicross/contracts/llm-config';
|
|
13
|
-
import '../transformer/types.js';
|
|
14
|
-
import '@omnicross/contracts/completion-types';
|
|
15
|
-
import '../transformer/TransformerService.js';
|
|
16
|
-
import '../ProviderProxy--ROec6VI.js';
|
|
17
|
-
import '../provider-proxy/types.js';
|
|
4
|
+
import '../types-Bd72H4SB.js';
|
|
5
|
+
import '@omnicross/contracts/image-generation-types';
|
|
6
|
+
import '../types-CVRge76p.js';
|
|
18
7
|
import 'node:http';
|
|
8
|
+
import '@omnicross/contracts/completion-types';
|
|
19
9
|
import '@omnicross/contracts/usage-stats-types';
|
|
20
10
|
import '@omnicross/contracts/usage-types';
|
|
21
11
|
import '../completion/ApiKeyPoolService.js';
|
|
12
|
+
import '@omnicross/contracts/llm-config';
|
|
13
|
+
import '../logger-4GvQNzhE.js';
|
|
22
14
|
import './AuthSource.js';
|
|
23
15
|
import './BoundAccountSelectionError.js';
|
|
24
16
|
import './SubscriptionAuthSource.js';
|
|
25
17
|
import './SubscriptionAuthStrategy.js';
|
|
18
|
+
import '../ports/provider-config-source.js';
|
|
19
|
+
import '../transformer/types.js';
|
|
20
|
+
import '../transformer/TransformerService.js';
|
|
26
21
|
import '../ports/web-search-backend.js';
|
|
27
22
|
import '@omnicross/contracts/websearch-types';
|
|
23
|
+
import 'node:fs/promises';
|
|
24
|
+
import '@omnicross/contracts/account-tokens-types';
|
|
25
|
+
import '@omnicross/contracts/audit-types';
|
|
26
|
+
import '@omnicross/contracts/billing-types';
|
|
27
|
+
import '@omnicross/contracts/health-logging-types';
|
|
28
|
+
import '@omnicross/contracts/voucher-types';
|
|
29
|
+
import '@omnicross/contracts/webhook-types';
|
|
30
|
+
import '../ProviderProxy-DYoY5XoT.js';
|
|
28
31
|
import '../keyPolicy-zdWTu3CQ.js';
|
|
29
32
|
import '@omnicross/contracts/account-allowance-types';
|
|
30
33
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-A2YMUCBT.cjs');
|
|
3
|
+
var _chunkOIKREZVQcjs = require('../chunk-OIKREZVQ.cjs');
|
|
5
4
|
require('../chunk-UNEFIWXI.cjs');
|
|
5
|
+
require('../chunk-A2YMUCBT.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.LlmConfigProviderAuth =
|
|
8
|
+
exports.LlmConfigProviderAuth = _chunkOIKREZVQcjs.LlmConfigProviderAuth;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunk7LRTPNFLcjs = require('../chunk-7LRTPNFL.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -23,4 +23,4 @@ var _chunkYWL7YZWScjs = require('../chunk-YWL7YZWS.cjs');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
exports.ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT =
|
|
26
|
+
exports.ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT = _chunk7LRTPNFLcjs.ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT; exports.AUTH_ERROR_TTL_MS = _chunk7LRTPNFLcjs.AUTH_ERROR_TTL_MS; exports.MAX_QUOTA_COOLDOWN_MS = _chunk7LRTPNFLcjs.MAX_QUOTA_COOLDOWN_MS; exports.OVERLOAD_ENABLED_DEFAULT = _chunk7LRTPNFLcjs.OVERLOAD_ENABLED_DEFAULT; exports.OVERLOAD_TTL_MS = _chunk7LRTPNFLcjs.OVERLOAD_TTL_MS; exports.SERVER_ERROR_TTL_MS = _chunk7LRTPNFLcjs.SERVER_ERROR_TTL_MS; exports.SubscriptionAccountHealth = _chunk7LRTPNFLcjs.SubscriptionAccountHealth; exports.__resetSharedAccountHealthForTests = _chunk7LRTPNFLcjs.__resetSharedAccountHealthForTests; exports.getSharedAccountHealth = _chunk7LRTPNFLcjs.getSharedAccountHealth; exports.resolveResetSeconds = _chunk7LRTPNFLcjs.resolveResetSeconds; exports.setSharedAccountHealth = _chunk7LRTPNFLcjs.setSharedAccountHealth;
|
|
@@ -138,6 +138,13 @@ interface RecordUpstreamOutcomeInput {
|
|
|
138
138
|
retryAfterSeconds?: number | null;
|
|
139
139
|
/** Bounded response body text for the 403-ban sniff (only read on a 403). */
|
|
140
140
|
bodyText?: string;
|
|
141
|
+
/**
|
|
142
|
+
* DIAGNOSTIC-ONLY (claude-api-transform-fidelity, R11): the upstream error
|
|
143
|
+
* body's `error.type` on failure statuses (429/529/≥500). Logged, never
|
|
144
|
+
* consulted by any decision branch — a table-driven test pins that outcomes
|
|
145
|
+
* are identical with and without it.
|
|
146
|
+
*/
|
|
147
|
+
upstreamErrorType?: string;
|
|
141
148
|
/** Injectable clock (default the tracker's `now`). */
|
|
142
149
|
now?: number;
|
|
143
150
|
}
|
|
@@ -138,6 +138,13 @@ interface RecordUpstreamOutcomeInput {
|
|
|
138
138
|
retryAfterSeconds?: number | null;
|
|
139
139
|
/** Bounded response body text for the 403-ban sniff (only read on a 403). */
|
|
140
140
|
bodyText?: string;
|
|
141
|
+
/**
|
|
142
|
+
* DIAGNOSTIC-ONLY (claude-api-transform-fidelity, R11): the upstream error
|
|
143
|
+
* body's `error.type` on failure statuses (429/529/≥500). Logged, never
|
|
144
|
+
* consulted by any decision branch — a table-driven test pins that outcomes
|
|
145
|
+
* are identical with and without it.
|
|
146
|
+
*/
|
|
147
|
+
upstreamErrorType?: string;
|
|
141
148
|
/** Injectable clock (default the tracker's `now`). */
|
|
142
149
|
now?: number;
|
|
143
150
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkKQBLZMP6cjs = require('../chunk-KQBLZMP6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
exports.executeProviderCall =
|
|
6
|
+
exports.executeProviderCall = _chunkKQBLZMP6cjs.executeProviderCall;
|
|
@@ -31,8 +31,8 @@ import '@omnicross/contracts/completion-types';
|
|
|
31
31
|
* mutated `prepareBody` output. Each site passes a DIFFERENT variable
|
|
32
32
|
* there today (proxy → post-transform `requestBody`; Adapter/Handler →
|
|
33
33
|
* the pre-transform `unifiedRequest`), so the core does not hard-code
|
|
34
|
-
* it — `responseChainRequest`
|
|
35
|
-
*
|
|
34
|
+
* it — `responseChainRequest` may be supplied by the caller, while a
|
|
35
|
+
* wire ingress can explicitly retain the post-endpoint Unified request.
|
|
36
36
|
*
|
|
37
37
|
* 2. The engine adapter and Handler check `response.ok` on the RAW fetch response
|
|
38
38
|
* BEFORE running the response chain. Those sites therefore set
|
|
@@ -113,12 +113,17 @@ interface ProviderCallContext {
|
|
|
113
113
|
runResponseChain?: boolean;
|
|
114
114
|
/**
|
|
115
115
|
* The first argument passed to `executeResponseChain` when
|
|
116
|
-
* `runResponseChain` is true.
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
116
|
+
* `runResponseChain` is true. Sites diverge on which variable they pass
|
|
117
|
+
* (proxy → post-transform `requestBody`; unified ingresses → the
|
|
118
|
+
* pre-transform request), so callers can supply it explicitly. The core
|
|
119
|
+
* never assumes it equals `prepareBody`'s output.
|
|
120
120
|
*/
|
|
121
121
|
responseChainRequest?: UnifiedChatRequest;
|
|
122
|
+
/**
|
|
123
|
+
* Use the post-endpoint, pre-target Unified request for response encoding.
|
|
124
|
+
* Opt-in preserves the historical proxy fallback to final `requestBody`.
|
|
125
|
+
*/
|
|
126
|
+
preserveEndpointRequestForResponseChain?: boolean;
|
|
122
127
|
}
|
|
123
128
|
/**
|
|
124
129
|
* Result of the common exchange.
|
|
@@ -31,8 +31,8 @@ import '@omnicross/contracts/completion-types';
|
|
|
31
31
|
* mutated `prepareBody` output. Each site passes a DIFFERENT variable
|
|
32
32
|
* there today (proxy → post-transform `requestBody`; Adapter/Handler →
|
|
33
33
|
* the pre-transform `unifiedRequest`), so the core does not hard-code
|
|
34
|
-
* it — `responseChainRequest`
|
|
35
|
-
*
|
|
34
|
+
* it — `responseChainRequest` may be supplied by the caller, while a
|
|
35
|
+
* wire ingress can explicitly retain the post-endpoint Unified request.
|
|
36
36
|
*
|
|
37
37
|
* 2. The engine adapter and Handler check `response.ok` on the RAW fetch response
|
|
38
38
|
* BEFORE running the response chain. Those sites therefore set
|
|
@@ -113,12 +113,17 @@ interface ProviderCallContext {
|
|
|
113
113
|
runResponseChain?: boolean;
|
|
114
114
|
/**
|
|
115
115
|
* The first argument passed to `executeResponseChain` when
|
|
116
|
-
* `runResponseChain` is true.
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
116
|
+
* `runResponseChain` is true. Sites diverge on which variable they pass
|
|
117
|
+
* (proxy → post-transform `requestBody`; unified ingresses → the
|
|
118
|
+
* pre-transform request), so callers can supply it explicitly. The core
|
|
119
|
+
* never assumes it equals `prepareBody`'s output.
|
|
120
120
|
*/
|
|
121
121
|
responseChainRequest?: UnifiedChatRequest;
|
|
122
|
+
/**
|
|
123
|
+
* Use the post-endpoint, pre-target Unified request for response encoding.
|
|
124
|
+
* Opt-in preserves the historical proxy fallback to final `requestBody`.
|
|
125
|
+
*/
|
|
126
|
+
preserveEndpointRequestForResponseChain?: boolean;
|
|
122
127
|
}
|
|
123
128
|
/**
|
|
124
129
|
* Result of the common exchange.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkOST5RJOJcjs = require('../chunk-OST5RJOJ.cjs');
|
|
8
8
|
require('../chunk-235MXAGX.cjs');
|
|
9
9
|
require('../chunk-HVBBDBS3.cjs');
|
|
10
10
|
require('../chunk-NKVZ6Z3Y.cjs');
|
|
@@ -14,4 +14,4 @@ require('../chunk-NKVZ6Z3Y.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.__resetUpstreamProxyForTests =
|
|
17
|
+
exports.__resetUpstreamProxyForTests = _chunkOST5RJOJcjs.__resetUpstreamProxyForTests; exports.bumpUpstreamProxyGeneration = _chunkOST5RJOJcjs.bumpUpstreamProxyGeneration; exports.fetchUpstream = _chunkOST5RJOJcjs.fetchUpstream; exports.resolveUpstreamDispatcher = _chunkOST5RJOJcjs.resolveUpstreamDispatcher; exports.setUpstreamProxyResolver = _chunkOST5RJOJcjs.setUpstreamProxyResolver;
|
|
@@ -57,6 +57,11 @@ interface UpstreamProxyContext {
|
|
|
57
57
|
providerId?: string;
|
|
58
58
|
/** The selected pooled account id (per-account override input). */
|
|
59
59
|
accountId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Irreversible account identity allowed in debug traces. The raw `accountId`
|
|
62
|
+
* remains available to proxy, allowance, and route-attribution internals only.
|
|
63
|
+
*/
|
|
64
|
+
traceAccountFingerprint?: string;
|
|
60
65
|
/** Metadata-only live route activity. Never contains prompts, headers, or tokens. */
|
|
61
66
|
routeActivity?: AccountRouteActivityContext;
|
|
62
67
|
/**
|
|
@@ -57,6 +57,11 @@ interface UpstreamProxyContext {
|
|
|
57
57
|
providerId?: string;
|
|
58
58
|
/** The selected pooled account id (per-account override input). */
|
|
59
59
|
accountId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Irreversible account identity allowed in debug traces. The raw `accountId`
|
|
62
|
+
* remains available to proxy, allowance, and route-attribution internals only.
|
|
63
|
+
*/
|
|
64
|
+
traceAccountFingerprint?: string;
|
|
60
65
|
/** Metadata-only live route activity. Never contains prompts, headers, or tokens. */
|
|
61
66
|
routeActivity?: AccountRouteActivityContext;
|
|
62
67
|
/**
|
package/dist/ports.d.cts
CHANGED
|
@@ -4,8 +4,8 @@ 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
|
-
export {
|
|
8
|
-
export { O as OutboundCredentialStore } from './types-
|
|
7
|
+
export { U as UsageSink } from './types-DsHBBk3h.cjs';
|
|
8
|
+
export { O as OutboundCredentialStore } from './types-jjU24eYG.cjs';
|
|
9
9
|
import '@omnicross/contracts/pricing-types';
|
|
10
10
|
import '@omnicross/contracts/llm-config';
|
|
11
11
|
import './transformer/types.cjs';
|
|
@@ -21,11 +21,14 @@ import './pipeline/AuthSource.cjs';
|
|
|
21
21
|
import './pipeline/BoundAccountSelectionError.cjs';
|
|
22
22
|
import './pipeline/SubscriptionAuthSource.cjs';
|
|
23
23
|
import './pipeline/SubscriptionAuthStrategy.cjs';
|
|
24
|
+
import '@omnicross/contracts/image-generation-types';
|
|
25
|
+
import './types-CbglB73l.cjs';
|
|
26
|
+
import 'node:fs/promises';
|
|
24
27
|
import '@omnicross/contracts/account-tokens-types';
|
|
25
28
|
import '@omnicross/contracts/audit-types';
|
|
26
29
|
import '@omnicross/contracts/billing-types';
|
|
27
30
|
import '@omnicross/contracts/health-logging-types';
|
|
28
31
|
import '@omnicross/contracts/voucher-types';
|
|
29
32
|
import '@omnicross/contracts/webhook-types';
|
|
30
|
-
import './ProviderProxy-
|
|
33
|
+
import './ProviderProxy-CgIcCVwk.cjs';
|
|
31
34
|
import './keyPolicy-zdWTu3CQ.cjs';
|
package/dist/ports.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ 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
|
-
export {
|
|
8
|
-
export { O as OutboundCredentialStore } from './types-
|
|
7
|
+
export { U as UsageSink } from './types-CVRge76p.js';
|
|
8
|
+
export { O as OutboundCredentialStore } from './types-5T223WYQ.js';
|
|
9
9
|
import '@omnicross/contracts/pricing-types';
|
|
10
10
|
import '@omnicross/contracts/llm-config';
|
|
11
11
|
import './transformer/types.js';
|
|
@@ -21,11 +21,14 @@ import './pipeline/AuthSource.js';
|
|
|
21
21
|
import './pipeline/BoundAccountSelectionError.js';
|
|
22
22
|
import './pipeline/SubscriptionAuthSource.js';
|
|
23
23
|
import './pipeline/SubscriptionAuthStrategy.js';
|
|
24
|
+
import '@omnicross/contracts/image-generation-types';
|
|
25
|
+
import './types-Bd72H4SB.js';
|
|
26
|
+
import 'node:fs/promises';
|
|
24
27
|
import '@omnicross/contracts/account-tokens-types';
|
|
25
28
|
import '@omnicross/contracts/audit-types';
|
|
26
29
|
import '@omnicross/contracts/billing-types';
|
|
27
30
|
import '@omnicross/contracts/health-logging-types';
|
|
28
31
|
import '@omnicross/contracts/voucher-types';
|
|
29
32
|
import '@omnicross/contracts/webhook-types';
|
|
30
|
-
import './ProviderProxy
|
|
33
|
+
import './ProviderProxy-DYoY5XoT.js';
|
|
31
34
|
import './keyPolicy-zdWTu3CQ.js';
|
|
@@ -1,62 +1,65 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7B56AJBBcjs = require('../chunk-7B56AJBB.cjs');
|
|
5
5
|
require('../chunk-HQP3K7PU.cjs');
|
|
6
6
|
require('../chunk-QVOB2DNX.cjs');
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-7ZHBN75N.cjs');
|
|
8
|
+
require('../chunk-3OPYJG76.cjs');
|
|
9
|
+
require('../chunk-TVYA5JSQ.cjs');
|
|
10
|
+
require('../chunk-NOITAVHA.cjs');
|
|
11
|
+
require('../chunk-QWNUOR7F.cjs');
|
|
12
|
+
require('../chunk-SQMAEDNE.cjs');
|
|
11
13
|
require('../chunk-5RSZYQJH.cjs');
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-
|
|
14
|
+
require('../chunk-6DDYNS2B.cjs');
|
|
15
|
+
require('../chunk-KIQ2HA2A.cjs');
|
|
16
|
+
require('../chunk-32SRZFFP.cjs');
|
|
14
17
|
require('../chunk-2E42SAW3.cjs');
|
|
15
|
-
require('../chunk-
|
|
16
|
-
require('../chunk-IIRPUVPH.cjs');
|
|
18
|
+
require('../chunk-5UK3KLE2.cjs');
|
|
17
19
|
require('../chunk-GBHYAGX3.cjs');
|
|
18
|
-
require('../chunk-
|
|
19
|
-
require('../chunk-3SCOLIPT.cjs');
|
|
20
|
+
require('../chunk-MXI2PWIC.cjs');
|
|
20
21
|
require('../chunk-RPII3E6Z.cjs');
|
|
21
22
|
require('../chunk-6RPZADX3.cjs');
|
|
22
23
|
require('../chunk-J3QQ6JS5.cjs');
|
|
23
24
|
require('../chunk-UIBD2YY5.cjs');
|
|
24
25
|
require('../chunk-R3HK6R4B.cjs');
|
|
26
|
+
require('../chunk-KQBLZMP6.cjs');
|
|
27
|
+
require('../chunk-OIKREZVQ.cjs');
|
|
25
28
|
require('../chunk-QXD4MV2X.cjs');
|
|
26
29
|
require('../chunk-NYUNU75A.cjs');
|
|
27
30
|
require('../chunk-OTZC4TNH.cjs');
|
|
28
|
-
require('../chunk-
|
|
31
|
+
require('../chunk-7LRTPNFL.cjs');
|
|
29
32
|
require('../chunk-YNJNTCSQ.cjs');
|
|
30
33
|
require('../chunk-SVNDB62D.cjs');
|
|
31
34
|
require('../chunk-6QQG7YG3.cjs');
|
|
32
35
|
require('../chunk-25GXJCEZ.cjs');
|
|
33
|
-
require('../chunk-
|
|
34
|
-
require('../chunk-
|
|
36
|
+
require('../chunk-FX325I5Q.cjs');
|
|
37
|
+
require('../chunk-AEOZIDEB.cjs');
|
|
38
|
+
require('../chunk-HCOQQAZE.cjs');
|
|
35
39
|
require('../chunk-APYG5QD7.cjs');
|
|
36
40
|
require('../chunk-L74VDN4A.cjs');
|
|
41
|
+
require('../chunk-XSVNC2UD.cjs');
|
|
37
42
|
require('../chunk-4YINUUKQ.cjs');
|
|
38
|
-
require('../chunk-
|
|
43
|
+
require('../chunk-T6NWPIYZ.cjs');
|
|
39
44
|
require('../chunk-QBZJ7P2T.cjs');
|
|
40
45
|
require('../chunk-4IH4EL7M.cjs');
|
|
46
|
+
require('../chunk-JMJBSACD.cjs');
|
|
47
|
+
require('../chunk-GMMT7RVN.cjs');
|
|
48
|
+
require('../chunk-UNEFIWXI.cjs');
|
|
41
49
|
require('../chunk-A2YMUCBT.cjs');
|
|
42
|
-
require('../chunk-XPIOJQS2.cjs');
|
|
43
|
-
require('../chunk-FCR77GYM.cjs');
|
|
44
|
-
require('../chunk-AEOZIDEB.cjs');
|
|
45
|
-
require('../chunk-XSVNC2UD.cjs');
|
|
46
50
|
require('../chunk-GDIXXKF2.cjs');
|
|
47
|
-
require('../chunk-
|
|
48
|
-
require('../chunk-
|
|
51
|
+
require('../chunk-VXRTQZF2.cjs');
|
|
52
|
+
require('../chunk-WX2E2G7H.cjs');
|
|
49
53
|
require('../chunk-77USGNRW.cjs');
|
|
50
|
-
require('../chunk-
|
|
51
|
-
require('../chunk-
|
|
54
|
+
require('../chunk-IUL4VWNU.cjs');
|
|
55
|
+
require('../chunk-OST5RJOJ.cjs');
|
|
52
56
|
require('../chunk-235MXAGX.cjs');
|
|
53
57
|
require('../chunk-HVBBDBS3.cjs');
|
|
54
58
|
require('../chunk-NKVZ6Z3Y.cjs');
|
|
59
|
+
require('../chunk-CTKM773J.cjs');
|
|
60
|
+
require('../chunk-G4CZIUIB.cjs');
|
|
55
61
|
require('../chunk-NZYN7C3P.cjs');
|
|
56
|
-
require('../chunk-JMJBSACD.cjs');
|
|
57
|
-
require('../chunk-GMMT7RVN.cjs');
|
|
58
|
-
require('../chunk-UNEFIWXI.cjs');
|
|
59
62
|
|
|
60
63
|
|
|
61
64
|
|
|
62
|
-
exports.ProviderProxy =
|
|
65
|
+
exports.ProviderProxy = _chunk7B56AJBBcjs.ProviderProxy; exports.isLoopbackAddress = _chunk7B56AJBBcjs.isLoopbackAddress;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-
|
|
2
|
-
import '
|
|
1
|
+
export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-CgIcCVwk.cjs';
|
|
2
|
+
import '../types-DsHBBk3h.cjs';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
import '@omnicross/contracts/completion-types';
|
|
5
5
|
import '@omnicross/contracts/usage-stats-types';
|
|
@@ -17,3 +17,4 @@ import '../transformer/types.cjs';
|
|
|
17
17
|
import '../transformer/TransformerService.cjs';
|
|
18
18
|
import '../ports/web-search-backend.cjs';
|
|
19
19
|
import '@omnicross/contracts/websearch-types';
|
|
20
|
+
import '@omnicross/contracts/image-generation-types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy
|
|
2
|
-
import '
|
|
1
|
+
export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-DYoY5XoT.js';
|
|
2
|
+
import '../types-CVRge76p.js';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
import '@omnicross/contracts/completion-types';
|
|
5
5
|
import '@omnicross/contracts/usage-stats-types';
|
|
@@ -17,3 +17,4 @@ import '../transformer/types.js';
|
|
|
17
17
|
import '../transformer/TransformerService.js';
|
|
18
18
|
import '../ports/web-search-backend.js';
|
|
19
19
|
import '@omnicross/contracts/websearch-types';
|
|
20
|
+
import '@omnicross/contracts/image-generation-types';
|
|
@@ -1,61 +1,64 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProviderProxy,
|
|
3
3
|
isLoopbackAddress
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-WSJE42SG.js";
|
|
5
5
|
import "../chunk-VVEHS2LI.js";
|
|
6
6
|
import "../chunk-WTQMX2Q6.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-EYGBM2VC.js";
|
|
8
|
+
import "../chunk-DK4A7DLE.js";
|
|
9
|
+
import "../chunk-FJNKXOWE.js";
|
|
10
|
+
import "../chunk-V53ZEFXC.js";
|
|
11
|
+
import "../chunk-7PIUVCKK.js";
|
|
12
|
+
import "../chunk-6OC3ORW6.js";
|
|
11
13
|
import "../chunk-FU7EAR73.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-LFEH7CEO.js";
|
|
15
|
+
import "../chunk-HN74IGEO.js";
|
|
16
|
+
import "../chunk-QIIAMBTM.js";
|
|
14
17
|
import "../chunk-FXR6N3SR.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-WNKWAEUR.js";
|
|
18
|
+
import "../chunk-AQDON6MB.js";
|
|
17
19
|
import "../chunk-MZNPGW5Q.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-XXFYLL7R.js";
|
|
20
|
+
import "../chunk-ECZ3ZE2C.js";
|
|
20
21
|
import "../chunk-XTEI64OU.js";
|
|
21
22
|
import "../chunk-XX6NQJMA.js";
|
|
22
23
|
import "../chunk-GFIZ6LQI.js";
|
|
23
24
|
import "../chunk-OE6TDIWW.js";
|
|
24
25
|
import "../chunk-DRWHTIIZ.js";
|
|
26
|
+
import "../chunk-X335TJNS.js";
|
|
27
|
+
import "../chunk-HOMUGKHR.js";
|
|
25
28
|
import "../chunk-JWC6APFQ.js";
|
|
26
29
|
import "../chunk-5ERIZW3D.js";
|
|
27
30
|
import "../chunk-PO3XB56Z.js";
|
|
28
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-V2UKUTJ3.js";
|
|
29
32
|
import "../chunk-23S5OPIO.js";
|
|
30
33
|
import "../chunk-AVYJ4YBN.js";
|
|
31
34
|
import "../chunk-OPRS4IQZ.js";
|
|
32
35
|
import "../chunk-2JYRIADS.js";
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-6OKXH2TW.js";
|
|
37
|
+
import "../chunk-WNY4WMRF.js";
|
|
38
|
+
import "../chunk-N76KU6F5.js";
|
|
35
39
|
import "../chunk-WLYIIEAF.js";
|
|
36
40
|
import "../chunk-TKJMZBAH.js";
|
|
41
|
+
import "../chunk-OZFM4X3S.js";
|
|
37
42
|
import "../chunk-3QFXFCHG.js";
|
|
38
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-U47LQXPB.js";
|
|
39
44
|
import "../chunk-AQ5TNQB7.js";
|
|
40
45
|
import "../chunk-XEKD23J5.js";
|
|
46
|
+
import "../chunk-Y7FO65VT.js";
|
|
47
|
+
import "../chunk-FMOBD2OQ.js";
|
|
48
|
+
import "../chunk-HUZZZ3JL.js";
|
|
41
49
|
import "../chunk-H5JUT3KV.js";
|
|
42
|
-
import "../chunk-7C7DET6S.js";
|
|
43
|
-
import "../chunk-K5NM7VAH.js";
|
|
44
|
-
import "../chunk-WNY4WMRF.js";
|
|
45
|
-
import "../chunk-OZFM4X3S.js";
|
|
46
50
|
import "../chunk-5NJLQ6T6.js";
|
|
47
|
-
import "../chunk-
|
|
48
|
-
import "../chunk-
|
|
51
|
+
import "../chunk-4VVCXVB7.js";
|
|
52
|
+
import "../chunk-R4VCO2CB.js";
|
|
49
53
|
import "../chunk-WYVGULTQ.js";
|
|
50
|
-
import "../chunk-
|
|
51
|
-
import "../chunk-
|
|
54
|
+
import "../chunk-ZLNHPUFA.js";
|
|
55
|
+
import "../chunk-CFSGYFOZ.js";
|
|
52
56
|
import "../chunk-3WD4HTR2.js";
|
|
53
57
|
import "../chunk-MKF46GNZ.js";
|
|
54
58
|
import "../chunk-GL6XM527.js";
|
|
59
|
+
import "../chunk-DEIUR2TH.js";
|
|
60
|
+
import "../chunk-4JOU54M5.js";
|
|
55
61
|
import "../chunk-CDHS2QDC.js";
|
|
56
|
-
import "../chunk-Y7FO65VT.js";
|
|
57
|
-
import "../chunk-FMOBD2OQ.js";
|
|
58
|
-
import "../chunk-HUZZZ3JL.js";
|
|
59
62
|
export {
|
|
60
63
|
ProviderProxy,
|
|
61
64
|
isLoopbackAddress
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var _chunk3SCOLIPTcjs = require('../../chunk-3SCOLIPT.cjs');
|
|
6
5
|
|
|
6
|
+
var _chunkMXI2PWICcjs = require('../../chunk-MXI2PWIC.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.DEFAULT_CODEX_CLI_HEADERS = _chunkMXI2PWICcjs.DEFAULT_CODEX_CLI_HEADERS; exports.codexAcceptHeader = _chunkMXI2PWICcjs.codexAcceptHeader; exports.extractCodexClientHeaders = _chunkMXI2PWICcjs.extractCodexClientHeaders; exports.fillMissingHeaders = _chunkMXI2PWICcjs.fillMissingHeaders;
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* headerMerge — the shared outbound-header merge primitive used by the
|
|
3
|
+
* per-client header builders (`claudeCodeHeaders`, `codexCliHeaders`).
|
|
4
|
+
*
|
|
5
|
+
* Split out so neither builder has to import the other just to reuse the merge.
|
|
6
|
+
*
|
|
7
|
+
* @module provider-proxy/identity/headerMerge
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Copy every entry of `source` into `headers` that `headers` does not already
|
|
11
|
+
* carry (case-insensitive on the existing keys, so an `Authorization` set by the
|
|
12
|
+
* auth strategy is never shadowed by an `authorization` from a caller bag).
|
|
13
|
+
* Existing values ALWAYS win — this only fills empty slots, which is what makes
|
|
14
|
+
* the precedence chain (auth > frozen fingerprint > caller > defaults) work by
|
|
15
|
+
* simply calling it in order.
|
|
16
|
+
*/
|
|
17
|
+
declare function fillMissingHeaders(headers: Record<string, string>, source: Readonly<Record<string, string>>): void;
|
|
18
|
+
|
|
1
19
|
/**
|
|
2
20
|
* codexCliHeaders — the Codex CLI client headers the CODEX SUBSCRIPTION relay
|
|
3
21
|
* puts on every `chatgpt.com/backend-api/codex/responses` request.
|
|
@@ -14,24 +32,26 @@
|
|
|
14
32
|
* shares this relay and must stay byte-identical — sending it `originator:
|
|
15
33
|
* codex_cli_rs` would be wrong and could trip its own checks.
|
|
16
34
|
*
|
|
17
|
-
* Modeled on
|
|
35
|
+
* Modeled on observed Codex CLI-compatible relay behavior.
|
|
18
36
|
*
|
|
19
37
|
* NOT DONE HERE (deliberate, see the relay call site):
|
|
20
|
-
* - `chatgpt-account-id`:
|
|
21
|
-
* OAuth `id_token`. Guessing it wrong risks a 403 on a
|
|
22
|
-
* works, so it is left to a follow-up that can verify
|
|
38
|
+
* - `chatgpt-account-id`: compatible implementations send the ChatGPT account
|
|
39
|
+
* id parsed out of the OAuth `id_token`. Guessing it wrong risks a 403 on a
|
|
40
|
+
* path that currently works, so it is left to a follow-up that can verify it.
|
|
23
41
|
* - forcing `store: false` on the body: a body mutation with its own regression
|
|
24
42
|
* surface, tracked separately.
|
|
25
43
|
*
|
|
26
44
|
* @module provider-proxy/identity/codexCliHeaders
|
|
27
45
|
*/
|
|
46
|
+
|
|
28
47
|
/**
|
|
29
48
|
* Client markers a real `codex` CLI invocation carries. Used ONLY to fill a slot
|
|
30
49
|
* the caller left empty — a forwarded real value always wins, so a genuine Codex
|
|
31
50
|
* CLI keeps its own identity and only a caller that sent nothing gets these.
|
|
32
51
|
*
|
|
33
52
|
* `originator` is the load-bearing one: it is how the backend tells the Codex
|
|
34
|
-
* CLI apart from a generic Responses client,
|
|
53
|
+
* CLI apart from a generic Responses client, so compatible relays send it
|
|
54
|
+
* unconditionally.
|
|
35
55
|
*/
|
|
36
56
|
declare const DEFAULT_CODEX_CLI_HEADERS: Readonly<Record<string, string>>;
|
|
37
57
|
/**
|
|
@@ -42,4 +62,4 @@ declare function extractCodexClientHeaders(reqHeaders: Record<string, string | s
|
|
|
42
62
|
/** The `accept` a Codex CLI sends, which differs by streaming mode. */
|
|
43
63
|
declare function codexAcceptHeader(isStream: boolean): string;
|
|
44
64
|
|
|
45
|
-
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders };
|
|
65
|
+
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders, fillMissingHeaders };
|