@omnicross/core 0.4.3 → 0.4.5
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/auth/GeminiCodeAssistProjectResolver.cjs +4 -4
- package/dist/auth/GeminiCodeAssistProjectResolver.js +3 -3
- package/dist/{chunk-MPFOC7AT.js → chunk-24W3DVGI.js} +1 -1
- package/dist/{chunk-WYECWQ3J.cjs → chunk-2DMOOZ4F.cjs} +1 -1
- package/dist/{chunk-NKVZ6Z3Y.cjs → chunk-4HMAS74X.cjs} +8 -3
- package/dist/{chunk-M6PKXP6T.js → chunk-4LSZ7NFM.js} +14 -2
- package/dist/{chunk-VFFCV4J6.cjs → chunk-CXRJMNJJ.cjs} +12 -6
- package/dist/{chunk-E5RCCGE7.cjs → chunk-DF5JXK36.cjs} +2 -2
- package/dist/{chunk-CGEZQC2G.cjs → chunk-F3TT5XPV.cjs} +2 -2
- package/dist/{chunk-EE7VP4O3.js → chunk-HQ7C3VB6.js} +1 -1
- package/dist/{chunk-ZJJBITUN.js → chunk-IAWLTZUP.js} +2 -2
- package/dist/{chunk-SWY2LTMR.js → chunk-L4L77G3X.js} +574 -100
- package/dist/{chunk-NTF7TLT7.js → chunk-LBIXTHP7.js} +11 -5
- package/dist/{chunk-UOOLU64V.cjs → chunk-LVQOCIES.cjs} +2 -2
- package/dist/{chunk-J5XMB5KY.cjs → chunk-NCCEWVWY.cjs} +978 -504
- package/dist/{chunk-K6J2RIEX.js → chunk-NDJSLJIA.js} +1 -1
- package/dist/{chunk-AFH5CEMF.cjs → chunk-SQU2FGXI.cjs} +15 -3
- package/dist/{chunk-F6P4DIBL.js → chunk-TLYFFUW4.js} +1 -1
- package/dist/{chunk-GL6XM527.js → chunk-TX7ZM4OI.js} +8 -3
- package/dist/{chunk-HRBXQ5AC.js → chunk-WYUXJKMK.js} +1 -1
- package/dist/{chunk-NDIBVTBZ.cjs → chunk-XYFCNDJK.cjs} +2 -2
- package/dist/{chunk-X6GHTNDL.cjs → chunk-ZG57GAVU.cjs} +7 -7
- package/dist/completion/CompletionService.cjs +11 -11
- package/dist/completion/CompletionService.js +10 -10
- package/dist/completion.cjs +11 -11
- package/dist/completion.js +10 -10
- package/dist/index.cjs +13 -11
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -10
- package/dist/outbound-api/routeResolver.d.cts +2 -2
- package/dist/outbound-api/routeResolver.d.ts +2 -2
- package/dist/outbound-api/types.d.cts +2 -2
- package/dist/outbound-api/types.d.ts +2 -2
- package/dist/outbound-api.cjs +13 -11
- package/dist/outbound-api.d.cts +46 -5
- package/dist/outbound-api.d.ts +46 -5
- package/dist/outbound-api.js +12 -10
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +1 -1
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +1 -1
- package/dist/pipeline/AccountRouteActivity.cjs +2 -2
- package/dist/pipeline/AccountRouteActivity.d.cts +33 -8
- package/dist/pipeline/AccountRouteActivity.d.ts +33 -8
- package/dist/pipeline/AccountRouteActivity.js +1 -1
- package/dist/pipeline/upstreamFetch.cjs +3 -3
- package/dist/pipeline/upstreamFetch.d.cts +15 -1
- package/dist/pipeline/upstreamFetch.d.ts +15 -1
- package/dist/pipeline/upstreamFetch.js +2 -2
- package/dist/ports.d.cts +1 -1
- package/dist/ports.d.ts +1 -1
- package/dist/provider-proxy/ProviderProxy.cjs +11 -11
- package/dist/provider-proxy/ProviderProxy.js +10 -10
- package/dist/provider-proxy/identity/codexCliHeaders.cjs +6 -2
- package/dist/provider-proxy/identity/codexCliHeaders.d.cts +42 -11
- package/dist/provider-proxy/identity/codexCliHeaders.d.ts +42 -11
- package/dist/provider-proxy/identity/codexCliHeaders.js +6 -2
- package/dist/provider-proxy/identity/openCodeGoHeaders.cjs +2 -2
- package/dist/provider-proxy/identity/openCodeGoHeaders.js +1 -1
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +13 -11
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +19 -1
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +19 -1
- package/dist/provider-proxy/ingress/providerProxyShared.js +12 -10
- package/dist/provider-proxy.cjs +11 -11
- package/dist/provider-proxy.d.cts +1 -1
- package/dist/provider-proxy.d.ts +1 -1
- package/dist/provider-proxy.js +10 -10
- package/dist/{routeResolver-C2z0pp-q.d.cts → routeResolver-BdNJvTZP.d.cts} +1 -1
- package/dist/{routeResolver-BLTleO4H.d.ts → routeResolver-zVoCx9r3.d.ts} +1 -1
- package/dist/transformer/transformers/AntigravityTransformer.cjs +6 -6
- package/dist/transformer/transformers/AntigravityTransformer.js +5 -5
- package/dist/transformer/transformers/antigravityFailover.cjs +7 -7
- package/dist/transformer/transformers/antigravityFailover.js +6 -6
- package/dist/transformer/transformers/antigravityIdentity.cjs +4 -4
- package/dist/transformer/transformers/antigravityIdentity.js +3 -3
- package/dist/transformer/transformers.cjs +8 -8
- package/dist/transformer/transformers.js +7 -7
- package/dist/transformer.cjs +8 -8
- package/dist/transformer.js +7 -7
- package/dist/{types-C6m-Db26.d.cts → types-Dt1bgHPg.d.cts} +63 -2
- package/dist/{types-Da735j2d.d.ts → types-IRPv4i1Y.d.ts} +63 -2
- package/package.json +2 -2
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Bounded, metadata-only history of
|
|
2
|
+
* Bounded, metadata-only history of upstream routing decisions.
|
|
3
3
|
*
|
|
4
4
|
* Records are created at the shared upstream fetch seam, after authentication has
|
|
5
|
-
* reported the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* reported the credential that will actually serve the request. TWO credential
|
|
6
|
+
* kinds share one timeline: subscription POOL ACCOUNTS (`credentialKind:
|
|
7
|
+
* 'subscription-account'`, identified by `accountId`) and BYO provider API KEYS
|
|
8
|
+
* (`credentialKind: 'provider-key'`, identified by `keyId` when the ApiKeyPool
|
|
9
|
+
* bound one). The store is intentionally process-local: it is useful for live
|
|
10
|
+
* operator diagnostics without turning session/account affinity into a durable
|
|
11
|
+
* tracking database.
|
|
8
12
|
*/
|
|
9
13
|
declare const ACCOUNT_ROUTE_ACTIVITY_LIMIT = 300;
|
|
10
|
-
type AccountRouteEndpoint = 'responses' | 'messages';
|
|
11
|
-
|
|
14
|
+
type AccountRouteEndpoint = 'responses' | 'messages' | 'chat' | 'generateContent';
|
|
15
|
+
/**
|
|
16
|
+
* Which kind of upstream credential a row attributes. Absent on records minted
|
|
17
|
+
* by older callers — those are subscription-account rows (the historical only
|
|
18
|
+
* kind), so the DEFAULT is `'subscription-account'`.
|
|
19
|
+
*/
|
|
20
|
+
type RouteCredentialKind = 'subscription-account' | 'provider-key';
|
|
21
|
+
type AccountRouteSessionSource = 'session-header' | 'thread-header' | 'body-session-id' | 'body-thread-id' | 'prompt-cache-key' | 'content-fingerprint' | 'api-key-fallback' | 'route-session-id' | 'none';
|
|
12
22
|
type AccountRouteAffinity = 'new' | 'sticky' | 'switched' | 'untracked';
|
|
13
23
|
interface AccountRouteActivityInput {
|
|
24
|
+
/**
|
|
25
|
+
* Display provider id: a subscription provider id (`claude`/`codex`/…) for
|
|
26
|
+
* account rows, the PROVIDER ROW id for provider-key rows. This is NOT the
|
|
27
|
+
* egress proxy key (`'byo'`) — it must be the id an operator recognizes.
|
|
28
|
+
*/
|
|
14
29
|
providerId: string;
|
|
15
|
-
|
|
30
|
+
/** Which kind of credential served the request. Defaults to
|
|
31
|
+
* `'subscription-account'` for back-compat with older callers. */
|
|
32
|
+
credentialKind?: RouteCredentialKind;
|
|
33
|
+
/** Subscription pool account id (required for `subscription-account` rows). */
|
|
34
|
+
accountId?: string;
|
|
35
|
+
/** ApiKeyPool key id when known (provider-key rows). Metadata only — the key
|
|
36
|
+
* STRING never enters this store. */
|
|
37
|
+
keyId?: string;
|
|
16
38
|
endpoint: AccountRouteEndpoint;
|
|
17
39
|
sessionKey?: string;
|
|
18
40
|
sessionSource: AccountRouteSessionSource;
|
|
@@ -33,11 +55,14 @@ interface AccountRouteActivityRecord extends AccountRouteActivityInput {
|
|
|
33
55
|
ts: number;
|
|
34
56
|
affinity: AccountRouteAffinity;
|
|
35
57
|
previousAccountId?: string;
|
|
58
|
+
/** For `provider-key` rows whose session switched keys (pool rotation). */
|
|
59
|
+
previousKeyId?: string;
|
|
36
60
|
}
|
|
37
61
|
interface AccountRouteActivityQuery {
|
|
38
62
|
providerId?: string;
|
|
39
63
|
accountId?: string;
|
|
40
64
|
sessionKey?: string;
|
|
65
|
+
credentialKind?: RouteCredentialKind;
|
|
41
66
|
limit?: number;
|
|
42
67
|
}
|
|
43
68
|
declare class AccountRouteActivityStore {
|
|
@@ -58,4 +83,4 @@ declare class AccountRouteActivityStore {
|
|
|
58
83
|
}
|
|
59
84
|
declare function getSharedAccountRouteActivity(): AccountRouteActivityStore;
|
|
60
85
|
|
|
61
|
-
export { ACCOUNT_ROUTE_ACTIVITY_LIMIT, type AccountRouteActivityInput, type AccountRouteActivityQuery, type AccountRouteActivityRecord, AccountRouteActivityStore, type AccountRouteAffinity, type AccountRouteEndpoint, type AccountRouteSessionSource, getSharedAccountRouteActivity };
|
|
86
|
+
export { ACCOUNT_ROUTE_ACTIVITY_LIMIT, type AccountRouteActivityInput, type AccountRouteActivityQuery, type AccountRouteActivityRecord, AccountRouteActivityStore, type AccountRouteAffinity, type AccountRouteEndpoint, type AccountRouteSessionSource, type RouteCredentialKind, getSharedAccountRouteActivity };
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Bounded, metadata-only history of
|
|
2
|
+
* Bounded, metadata-only history of upstream routing decisions.
|
|
3
3
|
*
|
|
4
4
|
* Records are created at the shared upstream fetch seam, after authentication has
|
|
5
|
-
* reported the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* reported the credential that will actually serve the request. TWO credential
|
|
6
|
+
* kinds share one timeline: subscription POOL ACCOUNTS (`credentialKind:
|
|
7
|
+
* 'subscription-account'`, identified by `accountId`) and BYO provider API KEYS
|
|
8
|
+
* (`credentialKind: 'provider-key'`, identified by `keyId` when the ApiKeyPool
|
|
9
|
+
* bound one). The store is intentionally process-local: it is useful for live
|
|
10
|
+
* operator diagnostics without turning session/account affinity into a durable
|
|
11
|
+
* tracking database.
|
|
8
12
|
*/
|
|
9
13
|
declare const ACCOUNT_ROUTE_ACTIVITY_LIMIT = 300;
|
|
10
|
-
type AccountRouteEndpoint = 'responses' | 'messages';
|
|
11
|
-
|
|
14
|
+
type AccountRouteEndpoint = 'responses' | 'messages' | 'chat' | 'generateContent';
|
|
15
|
+
/**
|
|
16
|
+
* Which kind of upstream credential a row attributes. Absent on records minted
|
|
17
|
+
* by older callers — those are subscription-account rows (the historical only
|
|
18
|
+
* kind), so the DEFAULT is `'subscription-account'`.
|
|
19
|
+
*/
|
|
20
|
+
type RouteCredentialKind = 'subscription-account' | 'provider-key';
|
|
21
|
+
type AccountRouteSessionSource = 'session-header' | 'thread-header' | 'body-session-id' | 'body-thread-id' | 'prompt-cache-key' | 'content-fingerprint' | 'api-key-fallback' | 'route-session-id' | 'none';
|
|
12
22
|
type AccountRouteAffinity = 'new' | 'sticky' | 'switched' | 'untracked';
|
|
13
23
|
interface AccountRouteActivityInput {
|
|
24
|
+
/**
|
|
25
|
+
* Display provider id: a subscription provider id (`claude`/`codex`/…) for
|
|
26
|
+
* account rows, the PROVIDER ROW id for provider-key rows. This is NOT the
|
|
27
|
+
* egress proxy key (`'byo'`) — it must be the id an operator recognizes.
|
|
28
|
+
*/
|
|
14
29
|
providerId: string;
|
|
15
|
-
|
|
30
|
+
/** Which kind of credential served the request. Defaults to
|
|
31
|
+
* `'subscription-account'` for back-compat with older callers. */
|
|
32
|
+
credentialKind?: RouteCredentialKind;
|
|
33
|
+
/** Subscription pool account id (required for `subscription-account` rows). */
|
|
34
|
+
accountId?: string;
|
|
35
|
+
/** ApiKeyPool key id when known (provider-key rows). Metadata only — the key
|
|
36
|
+
* STRING never enters this store. */
|
|
37
|
+
keyId?: string;
|
|
16
38
|
endpoint: AccountRouteEndpoint;
|
|
17
39
|
sessionKey?: string;
|
|
18
40
|
sessionSource: AccountRouteSessionSource;
|
|
@@ -33,11 +55,14 @@ interface AccountRouteActivityRecord extends AccountRouteActivityInput {
|
|
|
33
55
|
ts: number;
|
|
34
56
|
affinity: AccountRouteAffinity;
|
|
35
57
|
previousAccountId?: string;
|
|
58
|
+
/** For `provider-key` rows whose session switched keys (pool rotation). */
|
|
59
|
+
previousKeyId?: string;
|
|
36
60
|
}
|
|
37
61
|
interface AccountRouteActivityQuery {
|
|
38
62
|
providerId?: string;
|
|
39
63
|
accountId?: string;
|
|
40
64
|
sessionKey?: string;
|
|
65
|
+
credentialKind?: RouteCredentialKind;
|
|
41
66
|
limit?: number;
|
|
42
67
|
}
|
|
43
68
|
declare class AccountRouteActivityStore {
|
|
@@ -58,4 +83,4 @@ declare class AccountRouteActivityStore {
|
|
|
58
83
|
}
|
|
59
84
|
declare function getSharedAccountRouteActivity(): AccountRouteActivityStore;
|
|
60
85
|
|
|
61
|
-
export { ACCOUNT_ROUTE_ACTIVITY_LIMIT, type AccountRouteActivityInput, type AccountRouteActivityQuery, type AccountRouteActivityRecord, AccountRouteActivityStore, type AccountRouteAffinity, type AccountRouteEndpoint, type AccountRouteSessionSource, getSharedAccountRouteActivity };
|
|
86
|
+
export { ACCOUNT_ROUTE_ACTIVITY_LIMIT, type AccountRouteActivityInput, type AccountRouteActivityQuery, type AccountRouteActivityRecord, AccountRouteActivityStore, type AccountRouteAffinity, type AccountRouteEndpoint, type AccountRouteSessionSource, type RouteCredentialKind, getSharedAccountRouteActivity };
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkCXRJMNJJcjs = require('../chunk-CXRJMNJJ.cjs');
|
|
8
8
|
require('../chunk-235MXAGX.cjs');
|
|
9
9
|
require('../chunk-VYOBVPNB.cjs');
|
|
10
|
-
require('../chunk-
|
|
10
|
+
require('../chunk-4HMAS74X.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.__resetUpstreamProxyForTests =
|
|
17
|
+
exports.__resetUpstreamProxyForTests = _chunkCXRJMNJJcjs.__resetUpstreamProxyForTests; exports.bumpUpstreamProxyGeneration = _chunkCXRJMNJJcjs.bumpUpstreamProxyGeneration; exports.fetchUpstream = _chunkCXRJMNJJcjs.fetchUpstream; exports.resolveUpstreamDispatcher = _chunkCXRJMNJJcjs.resolveUpstreamDispatcher; exports.setUpstreamProxyResolver = _chunkCXRJMNJJcjs.setUpstreamProxyResolver;
|
|
@@ -1,6 +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
|
+
import { RouteCredentialKind, AccountRouteEndpoint, AccountRouteSessionSource, AccountRouteActivityRecord } from './AccountRouteActivity.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* upstreamFetch — the single proxy-aware egress seam for `@omnicross/core`
|
|
@@ -39,6 +39,20 @@ import { AccountRouteEndpoint, AccountRouteSessionSource, AccountRouteActivityRe
|
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
interface AccountRouteActivityContext {
|
|
42
|
+
/**
|
|
43
|
+
* DISPLAY provider id for the row: the subscription provider id
|
|
44
|
+
* (`claude`/`codex`/…) for account rows, or the PROVIDER ROW id for BYO
|
|
45
|
+
* provider-key rows. Deliberately NOT the egress ctx's `providerId` for BYO —
|
|
46
|
+
* that is the proxy-layer key, the literal `'byo'`, useless as a row identity.
|
|
47
|
+
* Falls back to `ctx.providerId` when absent (legacy account-row callers).
|
|
48
|
+
*/
|
|
49
|
+
providerId?: string;
|
|
50
|
+
/** Which credential kind served the call. Defaults `subscription-account`. */
|
|
51
|
+
credentialKind?: RouteCredentialKind;
|
|
52
|
+
/** Subscription account id — required to record an account row. */
|
|
53
|
+
accountId?: string;
|
|
54
|
+
/** ApiKeyPool key id for provider-key rows, when the pool bound one. */
|
|
55
|
+
keyId?: string;
|
|
42
56
|
endpoint: AccountRouteEndpoint;
|
|
43
57
|
sessionKey?: string;
|
|
44
58
|
sessionSource: AccountRouteSessionSource;
|
|
@@ -1,6 +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
|
+
import { RouteCredentialKind, AccountRouteEndpoint, AccountRouteSessionSource, AccountRouteActivityRecord } from './AccountRouteActivity.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* upstreamFetch — the single proxy-aware egress seam for `@omnicross/core`
|
|
@@ -39,6 +39,20 @@ import { AccountRouteEndpoint, AccountRouteSessionSource, AccountRouteActivityRe
|
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
interface AccountRouteActivityContext {
|
|
42
|
+
/**
|
|
43
|
+
* DISPLAY provider id for the row: the subscription provider id
|
|
44
|
+
* (`claude`/`codex`/…) for account rows, or the PROVIDER ROW id for BYO
|
|
45
|
+
* provider-key rows. Deliberately NOT the egress ctx's `providerId` for BYO —
|
|
46
|
+
* that is the proxy-layer key, the literal `'byo'`, useless as a row identity.
|
|
47
|
+
* Falls back to `ctx.providerId` when absent (legacy account-row callers).
|
|
48
|
+
*/
|
|
49
|
+
providerId?: string;
|
|
50
|
+
/** Which credential kind served the call. Defaults `subscription-account`. */
|
|
51
|
+
credentialKind?: RouteCredentialKind;
|
|
52
|
+
/** Subscription account id — required to record an account row. */
|
|
53
|
+
accountId?: string;
|
|
54
|
+
/** ApiKeyPool key id for provider-key rows, when the pool bound one. */
|
|
55
|
+
keyId?: string;
|
|
42
56
|
endpoint: AccountRouteEndpoint;
|
|
43
57
|
sessionKey?: string;
|
|
44
58
|
sessionSource: AccountRouteSessionSource;
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
fetchUpstream,
|
|
5
5
|
resolveUpstreamDispatcher,
|
|
6
6
|
setUpstreamProxyResolver
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-LBIXTHP7.js";
|
|
8
8
|
import "../chunk-3WD4HTR2.js";
|
|
9
9
|
import "../chunk-FYPKKMB3.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-TX7ZM4OI.js";
|
|
11
11
|
export {
|
|
12
12
|
__resetUpstreamProxyForTests,
|
|
13
13
|
bumpUpstreamProxyGeneration,
|
package/dist/ports.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ 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 { U as UsageSink } from './types-BSIJdsyl.cjs';
|
|
8
|
-
export { O as OutboundCredentialStore } from './types-
|
|
8
|
+
export { O as OutboundCredentialStore } from './types-Dt1bgHPg.cjs';
|
|
9
9
|
import '@omnicross/contracts/pricing-types';
|
|
10
10
|
import '@omnicross/contracts/llm-config';
|
|
11
11
|
import './transformer/types.cjs';
|
package/dist/ports.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ 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 { U as UsageSink } from './types-By9Tg6-I.js';
|
|
8
|
-
export { O as OutboundCredentialStore } from './types-
|
|
8
|
+
export { O as OutboundCredentialStore } from './types-IRPv4i1Y.js';
|
|
9
9
|
import '@omnicross/contracts/pricing-types';
|
|
10
10
|
import '@omnicross/contracts/llm-config';
|
|
11
11
|
import './transformer/types.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkNCCEWVWYcjs = require('../chunk-NCCEWVWY.cjs');
|
|
5
5
|
require('../chunk-QVOB2DNX.cjs');
|
|
6
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-LVQOCIES.cjs');
|
|
7
7
|
require('../chunk-NOITAVHA.cjs');
|
|
8
8
|
require('../chunk-QWNUOR7F.cjs');
|
|
9
9
|
require('../chunk-47E3I5PF.cjs');
|
|
10
10
|
require('../chunk-5RSZYQJH.cjs');
|
|
11
11
|
require('../chunk-VGBJPHHD.cjs');
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-
|
|
14
|
-
require('../chunk-
|
|
12
|
+
require('../chunk-F3TT5XPV.cjs');
|
|
13
|
+
require('../chunk-ZG57GAVU.cjs');
|
|
14
|
+
require('../chunk-DF5JXK36.cjs');
|
|
15
15
|
require('../chunk-BTSADEX4.cjs');
|
|
16
16
|
require('../chunk-32SRZFFP.cjs');
|
|
17
17
|
require('../chunk-2E42SAW3.cjs');
|
|
@@ -22,10 +22,10 @@ require('../chunk-3OPYJG76.cjs');
|
|
|
22
22
|
require('../chunk-J3QQ6JS5.cjs');
|
|
23
23
|
require('../chunk-E4QHVXV5.cjs');
|
|
24
24
|
require('../chunk-HQP3K7PU.cjs');
|
|
25
|
-
require('../chunk-
|
|
25
|
+
require('../chunk-SQU2FGXI.cjs');
|
|
26
26
|
require('../chunk-RPII3E6Z.cjs');
|
|
27
27
|
require('../chunk-6RPZADX3.cjs');
|
|
28
|
-
require('../chunk-
|
|
28
|
+
require('../chunk-2DMOOZ4F.cjs');
|
|
29
29
|
require('../chunk-UKQHBK4Q.cjs');
|
|
30
30
|
require('../chunk-UIBD2YY5.cjs');
|
|
31
31
|
require('../chunk-R3HK6R4B.cjs');
|
|
@@ -55,19 +55,19 @@ require('../chunk-GMMT7RVN.cjs');
|
|
|
55
55
|
require('../chunk-UNEFIWXI.cjs');
|
|
56
56
|
require('../chunk-A2YMUCBT.cjs');
|
|
57
57
|
require('../chunk-GDIXXKF2.cjs');
|
|
58
|
-
require('../chunk-
|
|
58
|
+
require('../chunk-XYFCNDJK.cjs');
|
|
59
59
|
require('../chunk-N3MGNLCU.cjs');
|
|
60
60
|
require('../chunk-4NAMH4UE.cjs');
|
|
61
61
|
require('../chunk-77USGNRW.cjs');
|
|
62
62
|
require('../chunk-IUL4VWNU.cjs');
|
|
63
|
-
require('../chunk-
|
|
63
|
+
require('../chunk-CXRJMNJJ.cjs');
|
|
64
64
|
require('../chunk-235MXAGX.cjs');
|
|
65
65
|
require('../chunk-VYOBVPNB.cjs');
|
|
66
|
-
require('../chunk-
|
|
66
|
+
require('../chunk-4HMAS74X.cjs');
|
|
67
67
|
require('../chunk-INY54AYX.cjs');
|
|
68
68
|
require('../chunk-G4CZIUIB.cjs');
|
|
69
69
|
require('../chunk-2RCCLQYV.cjs');
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
exports.ProviderProxy =
|
|
73
|
+
exports.ProviderProxy = _chunkNCCEWVWYcjs.ProviderProxy; exports.isLoopbackAddress = _chunkNCCEWVWYcjs.isLoopbackAddress;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProviderProxy,
|
|
3
3
|
isLoopbackAddress
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-L4L77G3X.js";
|
|
5
5
|
import "../chunk-WTQMX2Q6.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-24W3DVGI.js";
|
|
7
7
|
import "../chunk-V53ZEFXC.js";
|
|
8
8
|
import "../chunk-7PIUVCKK.js";
|
|
9
9
|
import "../chunk-TKZ3DZS5.js";
|
|
10
10
|
import "../chunk-FU7EAR73.js";
|
|
11
11
|
import "../chunk-IDPMD4B7.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-NDJSLJIA.js";
|
|
13
|
+
import "../chunk-IAWLTZUP.js";
|
|
14
|
+
import "../chunk-TLYFFUW4.js";
|
|
15
15
|
import "../chunk-OXBGNEYR.js";
|
|
16
16
|
import "../chunk-QIIAMBTM.js";
|
|
17
17
|
import "../chunk-FXR6N3SR.js";
|
|
@@ -22,10 +22,10 @@ import "../chunk-DK4A7DLE.js";
|
|
|
22
22
|
import "../chunk-GFIZ6LQI.js";
|
|
23
23
|
import "../chunk-MZEGQSKQ.js";
|
|
24
24
|
import "../chunk-VVEHS2LI.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-4LSZ7NFM.js";
|
|
26
26
|
import "../chunk-XTEI64OU.js";
|
|
27
27
|
import "../chunk-XX6NQJMA.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-WYUXJKMK.js";
|
|
29
29
|
import "../chunk-ONTTXSRL.js";
|
|
30
30
|
import "../chunk-OE6TDIWW.js";
|
|
31
31
|
import "../chunk-DRWHTIIZ.js";
|
|
@@ -55,15 +55,15 @@ import "../chunk-FMOBD2OQ.js";
|
|
|
55
55
|
import "../chunk-HUZZZ3JL.js";
|
|
56
56
|
import "../chunk-H5JUT3KV.js";
|
|
57
57
|
import "../chunk-5NJLQ6T6.js";
|
|
58
|
-
import "../chunk-
|
|
58
|
+
import "../chunk-HQ7C3VB6.js";
|
|
59
59
|
import "../chunk-QSOHEDKO.js";
|
|
60
60
|
import "../chunk-YEHQ5FXZ.js";
|
|
61
61
|
import "../chunk-WYVGULTQ.js";
|
|
62
62
|
import "../chunk-ZLNHPUFA.js";
|
|
63
|
-
import "../chunk-
|
|
63
|
+
import "../chunk-LBIXTHP7.js";
|
|
64
64
|
import "../chunk-3WD4HTR2.js";
|
|
65
65
|
import "../chunk-FYPKKMB3.js";
|
|
66
|
-
import "../chunk-
|
|
66
|
+
import "../chunk-TX7ZM4OI.js";
|
|
67
67
|
import "../chunk-4RM22ETG.js";
|
|
68
68
|
import "../chunk-4JOU54M5.js";
|
|
69
69
|
import "../chunk-4PFWFODB.js";
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkSQU2FGXIcjs = require('../../chunk-SQU2FGXI.cjs');
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
var _chunkUKQHBK4Qcjs = require('../../chunk-UKQHBK4Q.cjs');
|
|
@@ -11,4 +13,6 @@ var _chunkUKQHBK4Qcjs = require('../../chunk-UKQHBK4Q.cjs');
|
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.CODEX_ORIGINATOR_MARKER = _chunkSQU2FGXIcjs.CODEX_ORIGINATOR_MARKER; exports.DEFAULT_CODEX_CLI_HEADERS = _chunkSQU2FGXIcjs.DEFAULT_CODEX_CLI_HEADERS; exports.codexAcceptHeader = _chunkSQU2FGXIcjs.codexAcceptHeader; exports.extractCodexClientHeaders = _chunkSQU2FGXIcjs.extractCodexClientHeaders; exports.fillMissingCodexCliIdentity = _chunkSQU2FGXIcjs.fillMissingCodexCliIdentity; exports.fillMissingHeaders = _chunkUKQHBK4Qcjs.fillMissingHeaders;
|
|
@@ -36,24 +36,55 @@ declare function fillMissingHeaders(headers: Record<string, string>, source: Rea
|
|
|
36
36
|
*
|
|
37
37
|
* NOT DONE HERE (deliberate, see the relay call site):
|
|
38
38
|
* - `chatgpt-account-id`: compatible implementations send the ChatGPT account
|
|
39
|
-
* id parsed out of the OAuth `id_token`.
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
39
|
+
* id parsed out of the OAuth `id_token`. Verified 2026-09-12 against the
|
|
40
|
+
* live backend: the header is NOT required (a request without it authorizes
|
|
41
|
+
* fine), so it stays omitted — sending a guessed id risks a 403.
|
|
42
|
+
* - forcing `store: false` on the body: DONE since 2026-09-12 in the driver's
|
|
43
|
+
* `applyPlanAuth` — the backend now 400s any /codex/responses call without
|
|
44
|
+
* it (`{"detail":"Store must be set to false"}`).
|
|
43
45
|
*
|
|
44
46
|
* @module provider-proxy/identity/codexCliHeaders
|
|
45
47
|
*/
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
|
-
* Client markers a real `codex` CLI invocation carries.
|
|
49
|
-
*
|
|
50
|
-
*
|
|
50
|
+
* Client markers a real `codex` CLI invocation carries. This is the COMPLETE
|
|
51
|
+
* synthetic persona spread onto a caller that brought NO identity of its own
|
|
52
|
+
* (no `user-agent`) — originator + a coherent (user-agent, version) pair.
|
|
51
53
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
54
|
+
* NEVER applied under a caller's own `user-agent`: see
|
|
55
|
+
* `fillMissingCodexCliIdentity` for why a fabricated `version` there is not
|
|
56
|
+
* merely cosmetic but a hard failure.
|
|
57
|
+
*
|
|
58
|
+
* The pinned version is a floor for anonymous traffic only and WILL drift from
|
|
59
|
+
* the real CLI — acceptable because the backend's per-model minimum-version
|
|
60
|
+
* gate is the one place it matters, and an absent `version` passes that gate.
|
|
55
61
|
*/
|
|
56
62
|
declare const DEFAULT_CODEX_CLI_HEADERS: Readonly<Record<string, string>>;
|
|
63
|
+
/**
|
|
64
|
+
* The always-safe marker: how the backend tells the Codex CLI apart from a
|
|
65
|
+
* generic Responses client. Filled for EVERY codex-subscription caller, real
|
|
66
|
+
* client or not — compatible relays send it unconditionally.
|
|
67
|
+
*/
|
|
68
|
+
declare const CODEX_ORIGINATOR_MARKER: Readonly<Record<string, string>>;
|
|
69
|
+
/**
|
|
70
|
+
* Fill the codex client-identity markers a caller left empty — WITHOUT ever
|
|
71
|
+
* fabricating a `version` under a caller that brought its own `user-agent`.
|
|
72
|
+
*
|
|
73
|
+
* WHY THE SPLIT (2026-09 incident): the ChatGPT backend gates newer models on
|
|
74
|
+
* the request's client `version` header — `gpt-6-astra` answered a relayed
|
|
75
|
+
* `version: 0.144.5` with
|
|
76
|
+
* `The 'gpt-6-astra' model requires a newer version of Codex. Please upgrade…`
|
|
77
|
+
* even though the caller WAS the latest CLI (0.153.4): the Codex CLI only
|
|
78
|
+
* attaches its `version` header to the BUILT-IN openai provider, so a custom
|
|
79
|
+
* provider (this relay) arrives without one, and the old unconditional fill
|
|
80
|
+
* pinned a stale number under the caller's real UA. A caller that omits
|
|
81
|
+
* `version` goes WITHOUT one — the exact shape compatible relays send and the
|
|
82
|
+
* anthropic-path egress has always used, which the backend accepts.
|
|
83
|
+
*
|
|
84
|
+
* So: real client (own `user-agent`) ⇒ originator only; anonymous caller ⇒
|
|
85
|
+
* the full coherent persona above.
|
|
86
|
+
*/
|
|
87
|
+
declare function fillMissingCodexCliIdentity(headers: Record<string, string>): void;
|
|
57
88
|
/**
|
|
58
89
|
* Extract the caller's forwardable Codex CLI headers (lowercased keys). Ungated:
|
|
59
90
|
* passing along what the client actually sent is not fingerprint synthesis.
|
|
@@ -62,4 +93,4 @@ declare function extractCodexClientHeaders(reqHeaders: Record<string, string | s
|
|
|
62
93
|
/** The `accept` a Codex CLI sends, which differs by streaming mode. */
|
|
63
94
|
declare function codexAcceptHeader(isStream: boolean): string;
|
|
64
95
|
|
|
65
|
-
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders, fillMissingHeaders };
|
|
96
|
+
export { CODEX_ORIGINATOR_MARKER, DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders, fillMissingCodexCliIdentity, fillMissingHeaders };
|
|
@@ -36,24 +36,55 @@ declare function fillMissingHeaders(headers: Record<string, string>, source: Rea
|
|
|
36
36
|
*
|
|
37
37
|
* NOT DONE HERE (deliberate, see the relay call site):
|
|
38
38
|
* - `chatgpt-account-id`: compatible implementations send the ChatGPT account
|
|
39
|
-
* id parsed out of the OAuth `id_token`.
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
39
|
+
* id parsed out of the OAuth `id_token`. Verified 2026-09-12 against the
|
|
40
|
+
* live backend: the header is NOT required (a request without it authorizes
|
|
41
|
+
* fine), so it stays omitted — sending a guessed id risks a 403.
|
|
42
|
+
* - forcing `store: false` on the body: DONE since 2026-09-12 in the driver's
|
|
43
|
+
* `applyPlanAuth` — the backend now 400s any /codex/responses call without
|
|
44
|
+
* it (`{"detail":"Store must be set to false"}`).
|
|
43
45
|
*
|
|
44
46
|
* @module provider-proxy/identity/codexCliHeaders
|
|
45
47
|
*/
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
|
-
* Client markers a real `codex` CLI invocation carries.
|
|
49
|
-
*
|
|
50
|
-
*
|
|
50
|
+
* Client markers a real `codex` CLI invocation carries. This is the COMPLETE
|
|
51
|
+
* synthetic persona spread onto a caller that brought NO identity of its own
|
|
52
|
+
* (no `user-agent`) — originator + a coherent (user-agent, version) pair.
|
|
51
53
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
54
|
+
* NEVER applied under a caller's own `user-agent`: see
|
|
55
|
+
* `fillMissingCodexCliIdentity` for why a fabricated `version` there is not
|
|
56
|
+
* merely cosmetic but a hard failure.
|
|
57
|
+
*
|
|
58
|
+
* The pinned version is a floor for anonymous traffic only and WILL drift from
|
|
59
|
+
* the real CLI — acceptable because the backend's per-model minimum-version
|
|
60
|
+
* gate is the one place it matters, and an absent `version` passes that gate.
|
|
55
61
|
*/
|
|
56
62
|
declare const DEFAULT_CODEX_CLI_HEADERS: Readonly<Record<string, string>>;
|
|
63
|
+
/**
|
|
64
|
+
* The always-safe marker: how the backend tells the Codex CLI apart from a
|
|
65
|
+
* generic Responses client. Filled for EVERY codex-subscription caller, real
|
|
66
|
+
* client or not — compatible relays send it unconditionally.
|
|
67
|
+
*/
|
|
68
|
+
declare const CODEX_ORIGINATOR_MARKER: Readonly<Record<string, string>>;
|
|
69
|
+
/**
|
|
70
|
+
* Fill the codex client-identity markers a caller left empty — WITHOUT ever
|
|
71
|
+
* fabricating a `version` under a caller that brought its own `user-agent`.
|
|
72
|
+
*
|
|
73
|
+
* WHY THE SPLIT (2026-09 incident): the ChatGPT backend gates newer models on
|
|
74
|
+
* the request's client `version` header — `gpt-6-astra` answered a relayed
|
|
75
|
+
* `version: 0.144.5` with
|
|
76
|
+
* `The 'gpt-6-astra' model requires a newer version of Codex. Please upgrade…`
|
|
77
|
+
* even though the caller WAS the latest CLI (0.153.4): the Codex CLI only
|
|
78
|
+
* attaches its `version` header to the BUILT-IN openai provider, so a custom
|
|
79
|
+
* provider (this relay) arrives without one, and the old unconditional fill
|
|
80
|
+
* pinned a stale number under the caller's real UA. A caller that omits
|
|
81
|
+
* `version` goes WITHOUT one — the exact shape compatible relays send and the
|
|
82
|
+
* anthropic-path egress has always used, which the backend accepts.
|
|
83
|
+
*
|
|
84
|
+
* So: real client (own `user-agent`) ⇒ originator only; anonymous caller ⇒
|
|
85
|
+
* the full coherent persona above.
|
|
86
|
+
*/
|
|
87
|
+
declare function fillMissingCodexCliIdentity(headers: Record<string, string>): void;
|
|
57
88
|
/**
|
|
58
89
|
* Extract the caller's forwardable Codex CLI headers (lowercased keys). Ungated:
|
|
59
90
|
* passing along what the client actually sent is not fingerprint synthesis.
|
|
@@ -62,4 +93,4 @@ declare function extractCodexClientHeaders(reqHeaders: Record<string, string | s
|
|
|
62
93
|
/** The `accept` a Codex CLI sends, which differs by streaming mode. */
|
|
63
94
|
declare function codexAcceptHeader(isStream: boolean): string;
|
|
64
95
|
|
|
65
|
-
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders, fillMissingHeaders };
|
|
96
|
+
export { CODEX_ORIGINATOR_MARKER, DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders, fillMissingCodexCliIdentity, fillMissingHeaders };
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CODEX_ORIGINATOR_MARKER,
|
|
2
3
|
DEFAULT_CODEX_CLI_HEADERS,
|
|
3
4
|
codexAcceptHeader,
|
|
4
|
-
extractCodexClientHeaders
|
|
5
|
-
|
|
5
|
+
extractCodexClientHeaders,
|
|
6
|
+
fillMissingCodexCliIdentity
|
|
7
|
+
} from "../../chunk-4LSZ7NFM.js";
|
|
6
8
|
import {
|
|
7
9
|
fillMissingHeaders
|
|
8
10
|
} from "../../chunk-ONTTXSRL.js";
|
|
9
11
|
export {
|
|
12
|
+
CODEX_ORIGINATOR_MARKER,
|
|
10
13
|
DEFAULT_CODEX_CLI_HEADERS,
|
|
11
14
|
codexAcceptHeader,
|
|
12
15
|
extractCodexClientHeaders,
|
|
16
|
+
fillMissingCodexCliIdentity,
|
|
13
17
|
fillMissingHeaders
|
|
14
18
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk2DMOOZ4Fcjs = require('../../chunk-2DMOOZ4F.cjs');
|
|
9
9
|
require('../../chunk-UKQHBK4Q.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
@@ -14,4 +14,4 @@ require('../../chunk-UKQHBK4Q.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.OPENCODE_SESSION_HEADER =
|
|
17
|
+
exports.OPENCODE_SESSION_HEADER = _chunk2DMOOZ4Fcjs.OPENCODE_SESSION_HEADER; exports.__resetOpenCodeGoHeadersForTests = _chunk2DMOOZ4Fcjs.__resetOpenCodeGoHeadersForTests; exports.extractOpenCodeSessionHeader = _chunk2DMOOZ4Fcjs.extractOpenCodeSessionHeader; exports.getOpenCodeGoUserAgent = _chunk2DMOOZ4Fcjs.getOpenCodeGoUserAgent; exports.resolveOpenCodeSessionHeader = _chunk2DMOOZ4Fcjs.resolveOpenCodeSessionHeader; exports.setOpenCodeGoUserAgent = _chunk2DMOOZ4Fcjs.setOpenCodeGoUserAgent;
|