@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.
Files changed (81) hide show
  1. package/dist/auth/GeminiCodeAssistProjectResolver.cjs +4 -4
  2. package/dist/auth/GeminiCodeAssistProjectResolver.js +3 -3
  3. package/dist/{chunk-MPFOC7AT.js → chunk-24W3DVGI.js} +1 -1
  4. package/dist/{chunk-WYECWQ3J.cjs → chunk-2DMOOZ4F.cjs} +1 -1
  5. package/dist/{chunk-NKVZ6Z3Y.cjs → chunk-4HMAS74X.cjs} +8 -3
  6. package/dist/{chunk-M6PKXP6T.js → chunk-4LSZ7NFM.js} +14 -2
  7. package/dist/{chunk-VFFCV4J6.cjs → chunk-CXRJMNJJ.cjs} +12 -6
  8. package/dist/{chunk-E5RCCGE7.cjs → chunk-DF5JXK36.cjs} +2 -2
  9. package/dist/{chunk-CGEZQC2G.cjs → chunk-F3TT5XPV.cjs} +2 -2
  10. package/dist/{chunk-EE7VP4O3.js → chunk-HQ7C3VB6.js} +1 -1
  11. package/dist/{chunk-ZJJBITUN.js → chunk-IAWLTZUP.js} +2 -2
  12. package/dist/{chunk-SWY2LTMR.js → chunk-L4L77G3X.js} +574 -100
  13. package/dist/{chunk-NTF7TLT7.js → chunk-LBIXTHP7.js} +11 -5
  14. package/dist/{chunk-UOOLU64V.cjs → chunk-LVQOCIES.cjs} +2 -2
  15. package/dist/{chunk-J5XMB5KY.cjs → chunk-NCCEWVWY.cjs} +978 -504
  16. package/dist/{chunk-K6J2RIEX.js → chunk-NDJSLJIA.js} +1 -1
  17. package/dist/{chunk-AFH5CEMF.cjs → chunk-SQU2FGXI.cjs} +15 -3
  18. package/dist/{chunk-F6P4DIBL.js → chunk-TLYFFUW4.js} +1 -1
  19. package/dist/{chunk-GL6XM527.js → chunk-TX7ZM4OI.js} +8 -3
  20. package/dist/{chunk-HRBXQ5AC.js → chunk-WYUXJKMK.js} +1 -1
  21. package/dist/{chunk-NDIBVTBZ.cjs → chunk-XYFCNDJK.cjs} +2 -2
  22. package/dist/{chunk-X6GHTNDL.cjs → chunk-ZG57GAVU.cjs} +7 -7
  23. package/dist/completion/CompletionService.cjs +11 -11
  24. package/dist/completion/CompletionService.js +10 -10
  25. package/dist/completion.cjs +11 -11
  26. package/dist/completion.js +10 -10
  27. package/dist/index.cjs +13 -11
  28. package/dist/index.d.cts +3 -3
  29. package/dist/index.d.ts +3 -3
  30. package/dist/index.js +12 -10
  31. package/dist/outbound-api/routeResolver.d.cts +2 -2
  32. package/dist/outbound-api/routeResolver.d.ts +2 -2
  33. package/dist/outbound-api/types.d.cts +2 -2
  34. package/dist/outbound-api/types.d.ts +2 -2
  35. package/dist/outbound-api.cjs +13 -11
  36. package/dist/outbound-api.d.cts +46 -5
  37. package/dist/outbound-api.d.ts +46 -5
  38. package/dist/outbound-api.js +12 -10
  39. package/dist/pipeline/AccountAllowanceScheduling.d.cts +1 -1
  40. package/dist/pipeline/AccountAllowanceScheduling.d.ts +1 -1
  41. package/dist/pipeline/AccountRouteActivity.cjs +2 -2
  42. package/dist/pipeline/AccountRouteActivity.d.cts +33 -8
  43. package/dist/pipeline/AccountRouteActivity.d.ts +33 -8
  44. package/dist/pipeline/AccountRouteActivity.js +1 -1
  45. package/dist/pipeline/upstreamFetch.cjs +3 -3
  46. package/dist/pipeline/upstreamFetch.d.cts +15 -1
  47. package/dist/pipeline/upstreamFetch.d.ts +15 -1
  48. package/dist/pipeline/upstreamFetch.js +2 -2
  49. package/dist/ports.d.cts +1 -1
  50. package/dist/ports.d.ts +1 -1
  51. package/dist/provider-proxy/ProviderProxy.cjs +11 -11
  52. package/dist/provider-proxy/ProviderProxy.js +10 -10
  53. package/dist/provider-proxy/identity/codexCliHeaders.cjs +6 -2
  54. package/dist/provider-proxy/identity/codexCliHeaders.d.cts +42 -11
  55. package/dist/provider-proxy/identity/codexCliHeaders.d.ts +42 -11
  56. package/dist/provider-proxy/identity/codexCliHeaders.js +6 -2
  57. package/dist/provider-proxy/identity/openCodeGoHeaders.cjs +2 -2
  58. package/dist/provider-proxy/identity/openCodeGoHeaders.js +1 -1
  59. package/dist/provider-proxy/ingress/providerProxyShared.cjs +13 -11
  60. package/dist/provider-proxy/ingress/providerProxyShared.d.cts +19 -1
  61. package/dist/provider-proxy/ingress/providerProxyShared.d.ts +19 -1
  62. package/dist/provider-proxy/ingress/providerProxyShared.js +12 -10
  63. package/dist/provider-proxy.cjs +11 -11
  64. package/dist/provider-proxy.d.cts +1 -1
  65. package/dist/provider-proxy.d.ts +1 -1
  66. package/dist/provider-proxy.js +10 -10
  67. package/dist/{routeResolver-C2z0pp-q.d.cts → routeResolver-BdNJvTZP.d.cts} +1 -1
  68. package/dist/{routeResolver-BLTleO4H.d.ts → routeResolver-zVoCx9r3.d.ts} +1 -1
  69. package/dist/transformer/transformers/AntigravityTransformer.cjs +6 -6
  70. package/dist/transformer/transformers/AntigravityTransformer.js +5 -5
  71. package/dist/transformer/transformers/antigravityFailover.cjs +7 -7
  72. package/dist/transformer/transformers/antigravityFailover.js +6 -6
  73. package/dist/transformer/transformers/antigravityIdentity.cjs +4 -4
  74. package/dist/transformer/transformers/antigravityIdentity.js +3 -3
  75. package/dist/transformer/transformers.cjs +8 -8
  76. package/dist/transformer/transformers.js +7 -7
  77. package/dist/transformer.cjs +8 -8
  78. package/dist/transformer.js +7 -7
  79. package/dist/{types-C6m-Db26.d.cts → types-Dt1bgHPg.d.cts} +63 -2
  80. package/dist/{types-Da735j2d.d.ts → types-IRPv4i1Y.d.ts} +63 -2
  81. package/package.json +2 -2
@@ -1,18 +1,40 @@
1
1
  /**
2
- * Bounded, metadata-only history of subscription account routing decisions.
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 account that will actually serve the request. The store is
6
- * intentionally process-local: it is useful for live operator diagnostics without
7
- * turning session/account affinity into a durable tracking database.
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
- type AccountRouteSessionSource = 'session-header' | 'thread-header' | 'body-session-id' | 'body-thread-id' | 'prompt-cache-key' | 'content-fingerprint' | 'api-key-fallback' | 'none';
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
- accountId: string;
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 subscription account routing decisions.
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 account that will actually serve the request. The store is
6
- * intentionally process-local: it is useful for live operator diagnostics without
7
- * turning session/account affinity into a durable tracking database.
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
- type AccountRouteSessionSource = 'session-header' | 'thread-header' | 'body-session-id' | 'body-thread-id' | 'prompt-cache-key' | 'content-fingerprint' | 'api-key-fallback' | 'none';
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
- accountId: string;
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 };
@@ -2,7 +2,7 @@ import {
2
2
  ACCOUNT_ROUTE_ACTIVITY_LIMIT,
3
3
  AccountRouteActivityStore,
4
4
  getSharedAccountRouteActivity
5
- } from "../chunk-GL6XM527.js";
5
+ } from "../chunk-TX7ZM4OI.js";
6
6
  export {
7
7
  ACCOUNT_ROUTE_ACTIVITY_LIMIT,
8
8
  AccountRouteActivityStore,
@@ -4,14 +4,14 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkVFFCV4J6cjs = require('../chunk-VFFCV4J6.cjs');
7
+ var _chunkCXRJMNJJcjs = require('../chunk-CXRJMNJJ.cjs');
8
8
  require('../chunk-235MXAGX.cjs');
9
9
  require('../chunk-VYOBVPNB.cjs');
10
- require('../chunk-NKVZ6Z3Y.cjs');
10
+ require('../chunk-4HMAS74X.cjs');
11
11
 
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
- exports.__resetUpstreamProxyForTests = _chunkVFFCV4J6cjs.__resetUpstreamProxyForTests; exports.bumpUpstreamProxyGeneration = _chunkVFFCV4J6cjs.bumpUpstreamProxyGeneration; exports.fetchUpstream = _chunkVFFCV4J6cjs.fetchUpstream; exports.resolveUpstreamDispatcher = _chunkVFFCV4J6cjs.resolveUpstreamDispatcher; exports.setUpstreamProxyResolver = _chunkVFFCV4J6cjs.setUpstreamProxyResolver;
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-NTF7TLT7.js";
7
+ } from "../chunk-LBIXTHP7.js";
8
8
  import "../chunk-3WD4HTR2.js";
9
9
  import "../chunk-FYPKKMB3.js";
10
- import "../chunk-GL6XM527.js";
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-C6m-Db26.cjs';
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-Da735j2d.js';
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 _chunkJ5XMB5KYcjs = require('../chunk-J5XMB5KY.cjs');
4
+ var _chunkNCCEWVWYcjs = require('../chunk-NCCEWVWY.cjs');
5
5
  require('../chunk-QVOB2DNX.cjs');
6
- require('../chunk-UOOLU64V.cjs');
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-CGEZQC2G.cjs');
13
- require('../chunk-X6GHTNDL.cjs');
14
- require('../chunk-E5RCCGE7.cjs');
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-AFH5CEMF.cjs');
25
+ require('../chunk-SQU2FGXI.cjs');
26
26
  require('../chunk-RPII3E6Z.cjs');
27
27
  require('../chunk-6RPZADX3.cjs');
28
- require('../chunk-WYECWQ3J.cjs');
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-NDIBVTBZ.cjs');
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-VFFCV4J6.cjs');
63
+ require('../chunk-CXRJMNJJ.cjs');
64
64
  require('../chunk-235MXAGX.cjs');
65
65
  require('../chunk-VYOBVPNB.cjs');
66
- require('../chunk-NKVZ6Z3Y.cjs');
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 = _chunkJ5XMB5KYcjs.ProviderProxy; exports.isLoopbackAddress = _chunkJ5XMB5KYcjs.isLoopbackAddress;
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-SWY2LTMR.js";
4
+ } from "../chunk-L4L77G3X.js";
5
5
  import "../chunk-WTQMX2Q6.js";
6
- import "../chunk-MPFOC7AT.js";
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-K6J2RIEX.js";
13
- import "../chunk-ZJJBITUN.js";
14
- import "../chunk-F6P4DIBL.js";
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-M6PKXP6T.js";
25
+ import "../chunk-4LSZ7NFM.js";
26
26
  import "../chunk-XTEI64OU.js";
27
27
  import "../chunk-XX6NQJMA.js";
28
- import "../chunk-HRBXQ5AC.js";
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-EE7VP4O3.js";
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-NTF7TLT7.js";
63
+ import "../chunk-LBIXTHP7.js";
64
64
  import "../chunk-3WD4HTR2.js";
65
65
  import "../chunk-FYPKKMB3.js";
66
- import "../chunk-GL6XM527.js";
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
- var _chunkAFH5CEMFcjs = require('../../chunk-AFH5CEMF.cjs');
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
- exports.DEFAULT_CODEX_CLI_HEADERS = _chunkAFH5CEMFcjs.DEFAULT_CODEX_CLI_HEADERS; exports.codexAcceptHeader = _chunkAFH5CEMFcjs.codexAcceptHeader; exports.extractCodexClientHeaders = _chunkAFH5CEMFcjs.extractCodexClientHeaders; exports.fillMissingHeaders = _chunkUKQHBK4Qcjs.fillMissingHeaders;
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`. 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.
41
- * - forcing `store: false` on the body: a body mutation with its own regression
42
- * surface, tracked separately.
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. Used ONLY to fill a slot
49
- * the caller left empty a forwarded real value always wins, so a genuine Codex
50
- * CLI keeps its own identity and only a caller that sent nothing gets these.
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
- * `originator` is the load-bearing one: it is how the backend tells the Codex
53
- * CLI apart from a generic Responses client, so compatible relays send it
54
- * unconditionally.
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`. 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.
41
- * - forcing `store: false` on the body: a body mutation with its own regression
42
- * surface, tracked separately.
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. Used ONLY to fill a slot
49
- * the caller left empty a forwarded real value always wins, so a genuine Codex
50
- * CLI keeps its own identity and only a caller that sent nothing gets these.
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
- * `originator` is the load-bearing one: it is how the backend tells the Codex
53
- * CLI apart from a generic Responses client, so compatible relays send it
54
- * unconditionally.
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
- } from "../../chunk-M6PKXP6T.js";
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 _chunkWYECWQ3Jcjs = require('../../chunk-WYECWQ3J.cjs');
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 = _chunkWYECWQ3Jcjs.OPENCODE_SESSION_HEADER; exports.__resetOpenCodeGoHeadersForTests = _chunkWYECWQ3Jcjs.__resetOpenCodeGoHeadersForTests; exports.extractOpenCodeSessionHeader = _chunkWYECWQ3Jcjs.extractOpenCodeSessionHeader; exports.getOpenCodeGoUserAgent = _chunkWYECWQ3Jcjs.getOpenCodeGoUserAgent; exports.resolveOpenCodeSessionHeader = _chunkWYECWQ3Jcjs.resolveOpenCodeSessionHeader; exports.setOpenCodeGoUserAgent = _chunkWYECWQ3Jcjs.setOpenCodeGoUserAgent;
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;
@@ -5,7 +5,7 @@ import {
5
5
  getOpenCodeGoUserAgent,
6
6
  resolveOpenCodeSessionHeader,
7
7
  setOpenCodeGoUserAgent
8
- } from "../../chunk-HRBXQ5AC.js";
8
+ } from "../../chunk-WYUXJKMK.js";
9
9
  import "../../chunk-ONTTXSRL.js";
10
10
  export {
11
11
  OPENCODE_SESSION_HEADER,