@omnicross/core 0.4.4 → 0.4.6

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 (109) hide show
  1. package/dist/{CompletionService-BniP7j88.d.cts → CompletionService-BJu4AWVc.d.cts} +1 -1
  2. package/dist/{CompletionService-BqrKPwfA.d.ts → CompletionService-C4W2gBi_.d.ts} +1 -1
  3. package/dist/{ProviderProxy-Ckr6oTrE.d.ts → ProviderProxy-DxsNi3cO.d.ts} +1 -1
  4. package/dist/{ProviderProxy-Bz_nkOwq.d.cts → ProviderProxy-OuQPYW2I.d.cts} +1 -1
  5. package/dist/auth/GeminiCodeAssistProjectResolver.cjs +4 -4
  6. package/dist/auth/GeminiCodeAssistProjectResolver.js +3 -3
  7. package/dist/{chunk-NKVZ6Z3Y.cjs → chunk-4HMAS74X.cjs} +8 -3
  8. package/dist/{chunk-MPFOC7AT.js → chunk-5XG6FR5F.js} +2 -2
  9. package/dist/{chunk-VFFCV4J6.cjs → chunk-CXRJMNJJ.cjs} +12 -6
  10. package/dist/{chunk-E5RCCGE7.cjs → chunk-DF5JXK36.cjs} +2 -2
  11. package/dist/{chunk-NCZDUBC2.js → chunk-DRUT7H5H.js} +1 -1
  12. package/dist/{chunk-RX3BCX53.cjs → chunk-DV7656NN.cjs} +1208 -527
  13. package/dist/{chunk-CGEZQC2G.cjs → chunk-F3TT5XPV.cjs} +2 -2
  14. package/dist/{chunk-EE7VP4O3.js → chunk-HQ7C3VB6.js} +1 -1
  15. package/dist/{chunk-ZJJBITUN.js → chunk-IAWLTZUP.js} +2 -2
  16. package/dist/{chunk-57Y2EA2G.cjs → chunk-JGRNVH7C.cjs} +1 -1
  17. package/dist/{chunk-NTF7TLT7.js → chunk-LBIXTHP7.js} +11 -5
  18. package/dist/{chunk-GWC7HCZI.cjs → chunk-LWBXQXZ3.cjs} +1 -1
  19. package/dist/{chunk-7PIUVCKK.js → chunk-MZCJL3QU.js} +1 -1
  20. package/dist/{chunk-K6J2RIEX.js → chunk-NDJSLJIA.js} +1 -1
  21. package/dist/{chunk-UOOLU64V.cjs → chunk-QLVRJ5FS.cjs} +4 -4
  22. package/dist/{chunk-F6P4DIBL.js → chunk-TLYFFUW4.js} +1 -1
  23. package/dist/{chunk-YV4JSBPA.js → chunk-TU4BB776.js} +789 -108
  24. package/dist/{chunk-GL6XM527.js → chunk-TX7ZM4OI.js} +8 -3
  25. package/dist/{chunk-ZMERU7D3.js → chunk-VXHN5IDL.js} +1 -1
  26. package/dist/{chunk-NDIBVTBZ.cjs → chunk-XYFCNDJK.cjs} +2 -2
  27. package/dist/{chunk-X6GHTNDL.cjs → chunk-ZG57GAVU.cjs} +7 -7
  28. package/dist/{chunk-QWNUOR7F.cjs → chunk-ZTN2PVKO.cjs} +1 -1
  29. package/dist/completion/CompletionService.cjs +12 -12
  30. package/dist/completion/CompletionService.d.cts +2 -2
  31. package/dist/completion/CompletionService.d.ts +2 -2
  32. package/dist/completion/CompletionService.js +11 -11
  33. package/dist/completion.cjs +12 -12
  34. package/dist/completion.d.cts +2 -2
  35. package/dist/completion.d.ts +2 -2
  36. package/dist/completion.js +11 -11
  37. package/dist/image-generation.d.cts +4 -4
  38. package/dist/image-generation.d.ts +4 -4
  39. package/dist/index.cjs +14 -12
  40. package/dist/index.d.cts +7 -7
  41. package/dist/index.d.ts +7 -7
  42. package/dist/index.js +13 -11
  43. package/dist/openai-operation.d.cts +1 -1
  44. package/dist/openai-operation.d.ts +1 -1
  45. package/dist/outbound-api/routeResolver.cjs +2 -2
  46. package/dist/outbound-api/routeResolver.d.cts +5 -5
  47. package/dist/outbound-api/routeResolver.d.ts +5 -5
  48. package/dist/outbound-api/routeResolver.js +1 -1
  49. package/dist/outbound-api/subscriptionRegistryPort.d.cts +9 -1
  50. package/dist/outbound-api/subscriptionRegistryPort.d.ts +9 -1
  51. package/dist/outbound-api/types.d.cts +5 -5
  52. package/dist/outbound-api/types.d.ts +5 -5
  53. package/dist/outbound-api.cjs +14 -12
  54. package/dist/outbound-api.d.cts +49 -8
  55. package/dist/outbound-api.d.ts +49 -8
  56. package/dist/outbound-api.js +13 -11
  57. package/dist/pipeline/AccountAllowanceScheduling.d.cts +4 -4
  58. package/dist/pipeline/AccountAllowanceScheduling.d.ts +4 -4
  59. package/dist/pipeline/AccountRouteActivity.cjs +2 -2
  60. package/dist/pipeline/AccountRouteActivity.d.cts +33 -8
  61. package/dist/pipeline/AccountRouteActivity.d.ts +33 -8
  62. package/dist/pipeline/AccountRouteActivity.js +1 -1
  63. package/dist/pipeline/SubscriptionAuthSource.d.cts +11 -0
  64. package/dist/pipeline/SubscriptionAuthSource.d.ts +11 -0
  65. package/dist/pipeline/upstreamFetch.cjs +3 -3
  66. package/dist/pipeline/upstreamFetch.d.cts +15 -1
  67. package/dist/pipeline/upstreamFetch.d.ts +15 -1
  68. package/dist/pipeline/upstreamFetch.js +2 -2
  69. package/dist/ports.d.cts +4 -4
  70. package/dist/ports.d.ts +4 -4
  71. package/dist/provider-proxy/ProviderProxy.cjs +12 -12
  72. package/dist/provider-proxy/ProviderProxy.d.cts +2 -2
  73. package/dist/provider-proxy/ProviderProxy.d.ts +2 -2
  74. package/dist/provider-proxy/ProviderProxy.js +11 -11
  75. package/dist/provider-proxy/identity/codexCliHeaders.d.cts +6 -4
  76. package/dist/provider-proxy/identity/codexCliHeaders.d.ts +6 -4
  77. package/dist/provider-proxy/identity/openCodeGoHeaders.cjs +2 -2
  78. package/dist/provider-proxy/identity/openCodeGoHeaders.js +1 -1
  79. package/dist/provider-proxy/ingress/providerProxyShared.cjs +20 -12
  80. package/dist/provider-proxy/ingress/providerProxyShared.d.cts +54 -2
  81. package/dist/provider-proxy/ingress/providerProxyShared.d.ts +54 -2
  82. package/dist/provider-proxy/ingress/providerProxyShared.js +19 -11
  83. package/dist/provider-proxy/types.d.cts +1 -1
  84. package/dist/provider-proxy/types.d.ts +1 -1
  85. package/dist/provider-proxy.cjs +12 -12
  86. package/dist/provider-proxy.d.cts +6 -6
  87. package/dist/provider-proxy.d.ts +6 -6
  88. package/dist/provider-proxy.js +11 -11
  89. package/dist/{routeResolver-C2z0pp-q.d.cts → routeResolver-BQYMEXer.d.cts} +2 -2
  90. package/dist/{routeResolver-BLTleO4H.d.ts → routeResolver-DTfyzaFb.d.ts} +2 -2
  91. package/dist/transformer/transformers/AntigravityTransformer.cjs +6 -6
  92. package/dist/transformer/transformers/AntigravityTransformer.js +5 -5
  93. package/dist/transformer/transformers/OpenAITransformer.cjs +2 -2
  94. package/dist/transformer/transformers/OpenAITransformer.js +1 -1
  95. package/dist/transformer/transformers/antigravityFailover.cjs +7 -7
  96. package/dist/transformer/transformers/antigravityFailover.js +6 -6
  97. package/dist/transformer/transformers/antigravityIdentity.cjs +4 -4
  98. package/dist/transformer/transformers/antigravityIdentity.js +3 -3
  99. package/dist/transformer/transformers.cjs +9 -9
  100. package/dist/transformer/transformers.js +8 -8
  101. package/dist/transformer.cjs +9 -9
  102. package/dist/transformer.js +8 -8
  103. package/dist/{types-C6m-Db26.d.cts → types-BpSkj2JA.d.cts} +66 -5
  104. package/dist/{types-BVwJQ9ZS.d.cts → types-BsZ1s_a_.d.cts} +1 -1
  105. package/dist/{types-By9Tg6-I.d.ts → types-Di8VH1c9.d.ts} +12 -0
  106. package/dist/{types-BSIJdsyl.d.cts → types-Dpr5IAaP.d.cts} +12 -0
  107. package/dist/{types-Da735j2d.d.ts → types-EReErShW.d.ts} +66 -5
  108. package/dist/{types-VAHRysdP.d.ts → types-USaixzVP.d.ts} +1 -1
  109. package/package.json +2 -2
@@ -89,6 +89,17 @@ interface SubscriptionAuthProfile {
89
89
  * byte-identity).
90
90
  */
91
91
  readonly resolveProviderTransformerNames?: (model: string, config?: unknown) => readonly string[];
92
+ /**
93
+ * OPTIONAL chat-bridge-only chain-name resolver (openai-chat-bridge OQ1
94
+ * closure). The OpenAI-chat ingress consults it INSTEAD of
95
+ * `resolveProviderTransformerNames`/`providerTransformerNames` because a chat
96
+ * caller's wire is Unified: an anthropic-shape upstream needs the
97
+ * `['anthropic']` ENCODER, whereas the messages path's same-shape `[]` means
98
+ * "the caller already speaks Anthropic" — different answers for the same
99
+ * shape. Only opencodego sets it; absent ⇒ the chat ingress keeps the static
100
+ * `providerTransformerNames` (claude/kimi/grok route-to chains).
101
+ */
102
+ readonly chatBridgeTransformerNames?: (model: string, config?: unknown) => readonly string[];
92
103
  /**
93
104
  * Pass-through (claude) vs transformer (codex / opencodego / gemini). The
94
105
  * built-in `/v1/messages` subscription path (RT2.1) reads this for its
@@ -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
@@ -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 { U as UsageSink } from './types-BSIJdsyl.cjs';
8
- export { O as OutboundCredentialStore } from './types-C6m-Db26.cjs';
7
+ export { U as UsageSink } from './types-Dpr5IAaP.cjs';
8
+ export { O as OutboundCredentialStore } from './types-BpSkj2JA.cjs';
9
9
  import '@omnicross/contracts/pricing-types';
10
10
  import '@omnicross/contracts/llm-config';
11
11
  import './transformer/types.cjs';
@@ -25,7 +25,7 @@ import './frontends-Doz0RaWu.cjs';
25
25
  import '@omnicross/contracts/search-types';
26
26
  import './runtime-t8AZacFF.cjs';
27
27
  import '@omnicross/contracts/image-generation-types';
28
- import './types-BVwJQ9ZS.cjs';
28
+ import './types-BsZ1s_a_.cjs';
29
29
  import 'node:fs/promises';
30
30
  import '@omnicross/contracts/account-tokens-types';
31
31
  import '@omnicross/contracts/audit-types';
@@ -33,6 +33,6 @@ import '@omnicross/contracts/billing-types';
33
33
  import '@omnicross/contracts/health-logging-types';
34
34
  import '@omnicross/contracts/voucher-types';
35
35
  import '@omnicross/contracts/webhook-types';
36
- import './ProviderProxy-Bz_nkOwq.cjs';
36
+ import './ProviderProxy-OuQPYW2I.cjs';
37
37
  import './types-CbCZqLGg.cjs';
38
38
  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 { U as UsageSink } from './types-By9Tg6-I.js';
8
- export { O as OutboundCredentialStore } from './types-Da735j2d.js';
7
+ export { U as UsageSink } from './types-Di8VH1c9.js';
8
+ export { O as OutboundCredentialStore } from './types-EReErShW.js';
9
9
  import '@omnicross/contracts/pricing-types';
10
10
  import '@omnicross/contracts/llm-config';
11
11
  import './transformer/types.js';
@@ -25,7 +25,7 @@ import './frontends-Doz0RaWu.js';
25
25
  import '@omnicross/contracts/search-types';
26
26
  import './runtime-t8AZacFF.js';
27
27
  import '@omnicross/contracts/image-generation-types';
28
- import './types-VAHRysdP.js';
28
+ import './types-USaixzVP.js';
29
29
  import 'node:fs/promises';
30
30
  import '@omnicross/contracts/account-tokens-types';
31
31
  import '@omnicross/contracts/audit-types';
@@ -33,6 +33,6 @@ import '@omnicross/contracts/billing-types';
33
33
  import '@omnicross/contracts/health-logging-types';
34
34
  import '@omnicross/contracts/voucher-types';
35
35
  import '@omnicross/contracts/webhook-types';
36
- import './ProviderProxy-Ckr6oTrE.js';
36
+ import './ProviderProxy-DxsNi3cO.js';
37
37
  import './types-CbCZqLGg.js';
38
38
  import './keyPolicy-zdWTu3CQ.js';
@@ -1,17 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkRX3BCX53cjs = require('../chunk-RX3BCX53.cjs');
4
+ var _chunkDV7656NNcjs = require('../chunk-DV7656NN.cjs');
5
5
  require('../chunk-QVOB2DNX.cjs');
6
- require('../chunk-UOOLU64V.cjs');
6
+ require('../chunk-QLVRJ5FS.cjs');
7
7
  require('../chunk-NOITAVHA.cjs');
8
- require('../chunk-QWNUOR7F.cjs');
8
+ require('../chunk-ZTN2PVKO.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');
@@ -25,7 +25,7 @@ require('../chunk-HQP3K7PU.cjs');
25
25
  require('../chunk-SQU2FGXI.cjs');
26
26
  require('../chunk-RPII3E6Z.cjs');
27
27
  require('../chunk-6RPZADX3.cjs');
28
- require('../chunk-GWC7HCZI.cjs');
28
+ require('../chunk-LWBXQXZ3.cjs');
29
29
  require('../chunk-UKQHBK4Q.cjs');
30
30
  require('../chunk-UIBD2YY5.cjs');
31
31
  require('../chunk-R3HK6R4B.cjs');
@@ -47,7 +47,7 @@ require('../chunk-APYG5QD7.cjs');
47
47
  require('../chunk-L74VDN4A.cjs');
48
48
  require('../chunk-XSVNC2UD.cjs');
49
49
  require('../chunk-4YINUUKQ.cjs');
50
- require('../chunk-57Y2EA2G.cjs');
50
+ require('../chunk-JGRNVH7C.cjs');
51
51
  require('../chunk-QBZJ7P2T.cjs');
52
52
  require('../chunk-LL3MZ7O5.cjs');
53
53
  require('../chunk-JMJBSACD.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 = _chunkRX3BCX53cjs.ProviderProxy; exports.isLoopbackAddress = _chunkRX3BCX53cjs.isLoopbackAddress;
73
+ exports.ProviderProxy = _chunkDV7656NNcjs.ProviderProxy; exports.isLoopbackAddress = _chunkDV7656NNcjs.isLoopbackAddress;
@@ -1,5 +1,5 @@
1
- export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-Bz_nkOwq.cjs';
2
- import '../types-BSIJdsyl.cjs';
1
+ export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-OuQPYW2I.cjs';
2
+ import '../types-Dpr5IAaP.cjs';
3
3
  import 'node:http';
4
4
  import '@omnicross/contracts/completion-types';
5
5
  import '@omnicross/contracts/usage-stats-types';
@@ -1,5 +1,5 @@
1
- export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-Ckr6oTrE.js';
2
- import '../types-By9Tg6-I.js';
1
+ export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-DxsNi3cO.js';
2
+ import '../types-Di8VH1c9.js';
3
3
  import 'node:http';
4
4
  import '@omnicross/contracts/completion-types';
5
5
  import '@omnicross/contracts/usage-stats-types';
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  ProviderProxy,
3
3
  isLoopbackAddress
4
- } from "../chunk-YV4JSBPA.js";
4
+ } from "../chunk-TU4BB776.js";
5
5
  import "../chunk-WTQMX2Q6.js";
6
- import "../chunk-MPFOC7AT.js";
6
+ import "../chunk-5XG6FR5F.js";
7
7
  import "../chunk-V53ZEFXC.js";
8
- import "../chunk-7PIUVCKK.js";
8
+ import "../chunk-MZCJL3QU.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";
@@ -25,7 +25,7 @@ import "../chunk-VVEHS2LI.js";
25
25
  import "../chunk-4LSZ7NFM.js";
26
26
  import "../chunk-XTEI64OU.js";
27
27
  import "../chunk-XX6NQJMA.js";
28
- import "../chunk-NCZDUBC2.js";
28
+ import "../chunk-DRUT7H5H.js";
29
29
  import "../chunk-ONTTXSRL.js";
30
30
  import "../chunk-OE6TDIWW.js";
31
31
  import "../chunk-DRWHTIIZ.js";
@@ -47,7 +47,7 @@ import "../chunk-WLYIIEAF.js";
47
47
  import "../chunk-TKJMZBAH.js";
48
48
  import "../chunk-OZFM4X3S.js";
49
49
  import "../chunk-3QFXFCHG.js";
50
- import "../chunk-ZMERU7D3.js";
50
+ import "../chunk-VXHN5IDL.js";
51
51
  import "../chunk-AQ5TNQB7.js";
52
52
  import "../chunk-6I4SAWCN.js";
53
53
  import "../chunk-Y7FO65VT.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";
@@ -36,10 +36,12 @@ 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
  */
@@ -36,10 +36,12 @@ 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
  */
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkGWC7HCZIcjs = require('../../chunk-GWC7HCZI.cjs');
8
+ var _chunkLWBXQXZ3cjs = require('../../chunk-LWBXQXZ3.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 = _chunkGWC7HCZIcjs.OPENCODE_SESSION_HEADER; exports.__resetOpenCodeGoHeadersForTests = _chunkGWC7HCZIcjs.__resetOpenCodeGoHeadersForTests; exports.extractOpenCodeSessionHeader = _chunkGWC7HCZIcjs.extractOpenCodeSessionHeader; exports.getOpenCodeGoUserAgent = _chunkGWC7HCZIcjs.getOpenCodeGoUserAgent; exports.resolveOpenCodeSessionHeader = _chunkGWC7HCZIcjs.resolveOpenCodeSessionHeader; exports.setOpenCodeGoUserAgent = _chunkGWC7HCZIcjs.setOpenCodeGoUserAgent;
17
+ exports.OPENCODE_SESSION_HEADER = _chunkLWBXQXZ3cjs.OPENCODE_SESSION_HEADER; exports.__resetOpenCodeGoHeadersForTests = _chunkLWBXQXZ3cjs.__resetOpenCodeGoHeadersForTests; exports.extractOpenCodeSessionHeader = _chunkLWBXQXZ3cjs.extractOpenCodeSessionHeader; exports.getOpenCodeGoUserAgent = _chunkLWBXQXZ3cjs.getOpenCodeGoUserAgent; exports.resolveOpenCodeSessionHeader = _chunkLWBXQXZ3cjs.resolveOpenCodeSessionHeader; exports.setOpenCodeGoUserAgent = _chunkLWBXQXZ3cjs.setOpenCodeGoUserAgent;
@@ -5,7 +5,7 @@ import {
5
5
  getOpenCodeGoUserAgent,
6
6
  resolveOpenCodeSessionHeader,
7
7
  setOpenCodeGoUserAgent
8
- } from "../../chunk-NCZDUBC2.js";
8
+ } from "../../chunk-DRUT7H5H.js";
9
9
  import "../../chunk-ONTTXSRL.js";
10
10
  export {
11
11
  OPENCODE_SESSION_HEADER,
@@ -11,17 +11,21 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkRX3BCX53cjs = require('../../chunk-RX3BCX53.cjs');
14
+
15
+
16
+
17
+
18
+ var _chunkDV7656NNcjs = require('../../chunk-DV7656NN.cjs');
15
19
  require('../../chunk-QVOB2DNX.cjs');
16
- require('../../chunk-UOOLU64V.cjs');
20
+ require('../../chunk-QLVRJ5FS.cjs');
17
21
  require('../../chunk-NOITAVHA.cjs');
18
- require('../../chunk-QWNUOR7F.cjs');
22
+ require('../../chunk-ZTN2PVKO.cjs');
19
23
  require('../../chunk-47E3I5PF.cjs');
20
24
  require('../../chunk-5RSZYQJH.cjs');
21
25
  require('../../chunk-VGBJPHHD.cjs');
22
- require('../../chunk-CGEZQC2G.cjs');
23
- require('../../chunk-X6GHTNDL.cjs');
24
- require('../../chunk-E5RCCGE7.cjs');
26
+ require('../../chunk-F3TT5XPV.cjs');
27
+ require('../../chunk-ZG57GAVU.cjs');
28
+ require('../../chunk-DF5JXK36.cjs');
25
29
  require('../../chunk-BTSADEX4.cjs');
26
30
  require('../../chunk-32SRZFFP.cjs');
27
31
  require('../../chunk-2E42SAW3.cjs');
@@ -35,7 +39,7 @@ require('../../chunk-HQP3K7PU.cjs');
35
39
  require('../../chunk-SQU2FGXI.cjs');
36
40
  require('../../chunk-RPII3E6Z.cjs');
37
41
  require('../../chunk-6RPZADX3.cjs');
38
- require('../../chunk-GWC7HCZI.cjs');
42
+ require('../../chunk-LWBXQXZ3.cjs');
39
43
  require('../../chunk-UKQHBK4Q.cjs');
40
44
  require('../../chunk-UIBD2YY5.cjs');
41
45
  require('../../chunk-R3HK6R4B.cjs');
@@ -57,7 +61,7 @@ require('../../chunk-APYG5QD7.cjs');
57
61
  require('../../chunk-L74VDN4A.cjs');
58
62
  require('../../chunk-XSVNC2UD.cjs');
59
63
  require('../../chunk-4YINUUKQ.cjs');
60
- require('../../chunk-57Y2EA2G.cjs');
64
+ require('../../chunk-JGRNVH7C.cjs');
61
65
  require('../../chunk-QBZJ7P2T.cjs');
62
66
  require('../../chunk-LL3MZ7O5.cjs');
63
67
  require('../../chunk-JMJBSACD.cjs');
@@ -65,15 +69,15 @@ require('../../chunk-GMMT7RVN.cjs');
65
69
  require('../../chunk-UNEFIWXI.cjs');
66
70
  require('../../chunk-A2YMUCBT.cjs');
67
71
  require('../../chunk-GDIXXKF2.cjs');
68
- require('../../chunk-NDIBVTBZ.cjs');
72
+ require('../../chunk-XYFCNDJK.cjs');
69
73
  require('../../chunk-N3MGNLCU.cjs');
70
74
  require('../../chunk-4NAMH4UE.cjs');
71
75
  require('../../chunk-77USGNRW.cjs');
72
76
  require('../../chunk-IUL4VWNU.cjs');
73
- require('../../chunk-VFFCV4J6.cjs');
77
+ require('../../chunk-CXRJMNJJ.cjs');
74
78
  require('../../chunk-235MXAGX.cjs');
75
79
  require('../../chunk-VYOBVPNB.cjs');
76
- require('../../chunk-NKVZ6Z3Y.cjs');
80
+ require('../../chunk-4HMAS74X.cjs');
77
81
  require('../../chunk-INY54AYX.cjs');
78
82
  require('../../chunk-G4CZIUIB.cjs');
79
83
  require('../../chunk-2RCCLQYV.cjs');
@@ -90,4 +94,8 @@ require('../../chunk-2RCCLQYV.cjs');
90
94
 
91
95
 
92
96
 
93
- exports.aggregateAnthropicSseToJsonBody = _chunkRX3BCX53cjs.aggregateAnthropicSseToJsonBody; exports.cancelDiscardedResponse = _chunkRX3BCX53cjs.cancelDiscardedResponse; exports.getAnthropicEndpointTransformer = _chunkRX3BCX53cjs.getAnthropicEndpointTransformer; exports.getGeminiEndpointTransformer = _chunkRX3BCX53cjs.getGeminiEndpointTransformer; exports.getResponsesEndpointTransformer = _chunkRX3BCX53cjs.getResponsesEndpointTransformer; exports.getSharedExecutor = _chunkRX3BCX53cjs.getSharedExecutor; exports.projectUpstreamResponseHeaders = _chunkRX3BCX53cjs.projectUpstreamResponseHeaders; exports.readBody = _chunkRX3BCX53cjs.readBody; exports.relayResponse = _chunkRX3BCX53cjs.relayResponse; exports.resolvePoolBoundKey = _chunkRX3BCX53cjs.resolvePoolBoundKey; exports.writeBoundAccountError = _chunkRX3BCX53cjs.writeBoundAccountError; exports.writeError = _chunkRX3BCX53cjs.writeError;
97
+
98
+
99
+
100
+
101
+ exports.aggregateAnthropicSseToJsonBody = _chunkDV7656NNcjs.aggregateAnthropicSseToJsonBody; exports.aggregateOpenAIChatChunksToJsonBody = _chunkDV7656NNcjs.aggregateOpenAIChatChunksToJsonBody; exports.aggregateResponsesSseToJsonBody = _chunkDV7656NNcjs.aggregateResponsesSseToJsonBody; exports.buildByoRouteActivityMeta = _chunkDV7656NNcjs.buildByoRouteActivityMeta; exports.cancelDiscardedResponse = _chunkDV7656NNcjs.cancelDiscardedResponse; exports.getAnthropicEndpointTransformer = _chunkDV7656NNcjs.getAnthropicEndpointTransformer; exports.getGeminiEndpointTransformer = _chunkDV7656NNcjs.getGeminiEndpointTransformer; exports.getResponsesEndpointTransformer = _chunkDV7656NNcjs.getResponsesEndpointTransformer; exports.getSharedExecutor = _chunkDV7656NNcjs.getSharedExecutor; exports.projectUpstreamResponseHeaders = _chunkDV7656NNcjs.projectUpstreamResponseHeaders; exports.readBody = _chunkDV7656NNcjs.readBody; exports.relayResponse = _chunkDV7656NNcjs.relayResponse; exports.resolvePoolBoundKey = _chunkDV7656NNcjs.resolvePoolBoundKey; exports.sniffIsSseResponse = _chunkDV7656NNcjs.sniffIsSseResponse; exports.writeBoundAccountError = _chunkDV7656NNcjs.writeBoundAccountError; exports.writeError = _chunkDV7656NNcjs.writeError;
@@ -3,7 +3,7 @@ import { LLMProvider } from '@omnicross/contracts/llm-config';
3
3
  import { BoundAccountSelectionError } from '../../pipeline/BoundAccountSelectionError.cjs';
4
4
  import { TransformerChainExecutor } from '../../transformer/TransformerChainExecutor.cjs';
5
5
  import { Transformer } from '../../transformer/types.cjs';
6
- import { W as ProviderProxyDeps } from '../../types-BSIJdsyl.cjs';
6
+ import { W as ProviderProxyDeps } from '../../types-Dpr5IAaP.cjs';
7
7
  import '@omnicross/contracts/completion-types';
8
8
  import '@omnicross/contracts/usage-stats-types';
9
9
  import '@omnicross/contracts/subscription-types';
@@ -127,6 +127,40 @@ onSseEvent?: (event: Record<string, unknown>) => void, signal?: AbortSignal): Pr
127
127
  * Best-effort: a malformed event is skipped, never thrown.
128
128
  */
129
129
  declare function aggregateAnthropicSseToJsonBody(response: Response, rewriteModel?: string, signal?: AbortSignal): Promise<string>;
130
+ /**
131
+ * Collapse an OpenAI Responses SSE stream into the single `response` JSON a
132
+ * NON-streaming client expects. The Responses wire carries the complete final
133
+ * response object on its terminal event, so aggregation = keep the LAST
134
+ * `response.completed` / `response.failed` / `response.incomplete` payload
135
+ * (`response.failed`/`incomplete` surface the upstream's own error state —
136
+ * relayed verbatim, not rewritten into an error envelope). `rewriteModel`
137
+ * overrides `model` to mirror `relayResponse`'s non-stream branch.
138
+ *
139
+ * Serves the codex subscription contract on BOTH ingress paths: the backend
140
+ * rejects `stream:false` outright, so a non-streaming client is answered by
141
+ * forcing `stream:true` upstream and collapsing the SSE back. Best-effort like
142
+ * the Anthropic twin: a malformed event is skipped; no terminal event found →
143
+ * null (the caller surfaces its own 502).
144
+ */
145
+ declare function aggregateResponsesSseToJsonBody(response: Response, rewriteModel?: string, signal?: AbortSignal): Promise<string | null>;
146
+ /**
147
+ * Collapse an OpenAI Chat Completions SSE chunk stream into the single
148
+ * `chat.completion` JSON a NON-streaming client expects. Accumulates the FIRST
149
+ * `id`/`created`/`model`, every `delta` (content text, `reasoning_content`,
150
+ * `tool_calls` by index with concatenated argument fragments), the last non-null
151
+ * `finish_reason`, and the last `usage` (present on the final chunk when the
152
+ * caller asked for `stream_options.include_usage`, else omitted). Mirrors the
153
+ * Anthropic twin's best-effort contract; no terminal/finish found → null.
154
+ */
155
+ declare function aggregateOpenAIChatChunksToJsonBody(response: Response, rewriteModel?: string, signal?: AbortSignal): Promise<string | null>;
156
+ /**
157
+ * Whether a response body is an SSE stream. The header check is the cheap
158
+ * first pass; ChatGPT's codex backend OMITS Content-Type on its SSE streams
159
+ * (see OpenAIResponseTransformer's twin sniff), so a header-less body is
160
+ * decided by peeking the first chunk for an `event:`/`data:` frame start.
161
+ * The peek clones — the original body is left unread for the consumer.
162
+ */
163
+ declare function sniffIsSseResponse(response: Response): Promise<boolean>;
130
164
  /**
131
165
  * Write a JSON error response if the headers have not been sent.
132
166
  *
@@ -173,5 +207,23 @@ declare function writeBoundAccountError(res: http.ServerResponse, error: BoundAc
173
207
  * so the pool branch needs no further `$ENV` expansion.
174
208
  */
175
209
  declare function resolvePoolBoundKey(deps: ProviderProxyDeps, providerId: string, provider: LLMProvider, sessionId: string | null, preferredKeyId?: string, boundKeyFallbackPolicy?: 'strict' | 'pool'): Promise<string>;
210
+ /**
211
+ * BYO route-activity metadata for one plan — everything the fetch seam needs to
212
+ * record a `provider-key` row, resolved LIVE at fetch time so an ApiKeyPool
213
+ * rebind retry (the rotated-key `runOnce(newKey)` re-run) attributes the SECOND
214
+ * attempt to the NEW key.
215
+ *
216
+ * `providerId` is the provider ROW id (the display identity an operator
217
+ * recognizes) — never the egress proxy key `'byo'`. `resolveKeyId` reads the
218
+ * pool's CURRENT session binding (the same map `resolvePoolBoundKey` seeds and
219
+ * `reportError` rotates), so it is exactly the key this attempt sends whenever
220
+ * the pool is bound; `undefined` for non-pool BYO (static row key) — the store
221
+ * then records the row without a key id and affinity treats it as one identity.
222
+ */
223
+ interface ByoRouteActivityMeta {
224
+ readonly providerId: string;
225
+ readonly resolveKeyId: () => string | undefined;
226
+ }
227
+ declare function buildByoRouteActivityMeta(deps: ProviderProxyDeps, providerId: string, sessionId: string | null | undefined): ByoRouteActivityMeta;
176
228
 
177
- export { type StreamUsageTap, aggregateAnthropicSseToJsonBody, cancelDiscardedResponse, getAnthropicEndpointTransformer, getGeminiEndpointTransformer, getResponsesEndpointTransformer, getSharedExecutor, projectUpstreamResponseHeaders, readBody, relayResponse, resolvePoolBoundKey, writeBoundAccountError, writeError };
229
+ export { type ByoRouteActivityMeta, type StreamUsageTap, aggregateAnthropicSseToJsonBody, aggregateOpenAIChatChunksToJsonBody, aggregateResponsesSseToJsonBody, buildByoRouteActivityMeta, cancelDiscardedResponse, getAnthropicEndpointTransformer, getGeminiEndpointTransformer, getResponsesEndpointTransformer, getSharedExecutor, projectUpstreamResponseHeaders, readBody, relayResponse, resolvePoolBoundKey, sniffIsSseResponse, writeBoundAccountError, writeError };
@@ -3,7 +3,7 @@ import { LLMProvider } from '@omnicross/contracts/llm-config';
3
3
  import { BoundAccountSelectionError } from '../../pipeline/BoundAccountSelectionError.js';
4
4
  import { TransformerChainExecutor } from '../../transformer/TransformerChainExecutor.js';
5
5
  import { Transformer } from '../../transformer/types.js';
6
- import { W as ProviderProxyDeps } from '../../types-By9Tg6-I.js';
6
+ import { W as ProviderProxyDeps } from '../../types-Di8VH1c9.js';
7
7
  import '@omnicross/contracts/completion-types';
8
8
  import '@omnicross/contracts/usage-stats-types';
9
9
  import '@omnicross/contracts/subscription-types';
@@ -127,6 +127,40 @@ onSseEvent?: (event: Record<string, unknown>) => void, signal?: AbortSignal): Pr
127
127
  * Best-effort: a malformed event is skipped, never thrown.
128
128
  */
129
129
  declare function aggregateAnthropicSseToJsonBody(response: Response, rewriteModel?: string, signal?: AbortSignal): Promise<string>;
130
+ /**
131
+ * Collapse an OpenAI Responses SSE stream into the single `response` JSON a
132
+ * NON-streaming client expects. The Responses wire carries the complete final
133
+ * response object on its terminal event, so aggregation = keep the LAST
134
+ * `response.completed` / `response.failed` / `response.incomplete` payload
135
+ * (`response.failed`/`incomplete` surface the upstream's own error state —
136
+ * relayed verbatim, not rewritten into an error envelope). `rewriteModel`
137
+ * overrides `model` to mirror `relayResponse`'s non-stream branch.
138
+ *
139
+ * Serves the codex subscription contract on BOTH ingress paths: the backend
140
+ * rejects `stream:false` outright, so a non-streaming client is answered by
141
+ * forcing `stream:true` upstream and collapsing the SSE back. Best-effort like
142
+ * the Anthropic twin: a malformed event is skipped; no terminal event found →
143
+ * null (the caller surfaces its own 502).
144
+ */
145
+ declare function aggregateResponsesSseToJsonBody(response: Response, rewriteModel?: string, signal?: AbortSignal): Promise<string | null>;
146
+ /**
147
+ * Collapse an OpenAI Chat Completions SSE chunk stream into the single
148
+ * `chat.completion` JSON a NON-streaming client expects. Accumulates the FIRST
149
+ * `id`/`created`/`model`, every `delta` (content text, `reasoning_content`,
150
+ * `tool_calls` by index with concatenated argument fragments), the last non-null
151
+ * `finish_reason`, and the last `usage` (present on the final chunk when the
152
+ * caller asked for `stream_options.include_usage`, else omitted). Mirrors the
153
+ * Anthropic twin's best-effort contract; no terminal/finish found → null.
154
+ */
155
+ declare function aggregateOpenAIChatChunksToJsonBody(response: Response, rewriteModel?: string, signal?: AbortSignal): Promise<string | null>;
156
+ /**
157
+ * Whether a response body is an SSE stream. The header check is the cheap
158
+ * first pass; ChatGPT's codex backend OMITS Content-Type on its SSE streams
159
+ * (see OpenAIResponseTransformer's twin sniff), so a header-less body is
160
+ * decided by peeking the first chunk for an `event:`/`data:` frame start.
161
+ * The peek clones — the original body is left unread for the consumer.
162
+ */
163
+ declare function sniffIsSseResponse(response: Response): Promise<boolean>;
130
164
  /**
131
165
  * Write a JSON error response if the headers have not been sent.
132
166
  *
@@ -173,5 +207,23 @@ declare function writeBoundAccountError(res: http.ServerResponse, error: BoundAc
173
207
  * so the pool branch needs no further `$ENV` expansion.
174
208
  */
175
209
  declare function resolvePoolBoundKey(deps: ProviderProxyDeps, providerId: string, provider: LLMProvider, sessionId: string | null, preferredKeyId?: string, boundKeyFallbackPolicy?: 'strict' | 'pool'): Promise<string>;
210
+ /**
211
+ * BYO route-activity metadata for one plan — everything the fetch seam needs to
212
+ * record a `provider-key` row, resolved LIVE at fetch time so an ApiKeyPool
213
+ * rebind retry (the rotated-key `runOnce(newKey)` re-run) attributes the SECOND
214
+ * attempt to the NEW key.
215
+ *
216
+ * `providerId` is the provider ROW id (the display identity an operator
217
+ * recognizes) — never the egress proxy key `'byo'`. `resolveKeyId` reads the
218
+ * pool's CURRENT session binding (the same map `resolvePoolBoundKey` seeds and
219
+ * `reportError` rotates), so it is exactly the key this attempt sends whenever
220
+ * the pool is bound; `undefined` for non-pool BYO (static row key) — the store
221
+ * then records the row without a key id and affinity treats it as one identity.
222
+ */
223
+ interface ByoRouteActivityMeta {
224
+ readonly providerId: string;
225
+ readonly resolveKeyId: () => string | undefined;
226
+ }
227
+ declare function buildByoRouteActivityMeta(deps: ProviderProxyDeps, providerId: string, sessionId: string | null | undefined): ByoRouteActivityMeta;
176
228
 
177
- export { type StreamUsageTap, aggregateAnthropicSseToJsonBody, cancelDiscardedResponse, getAnthropicEndpointTransformer, getGeminiEndpointTransformer, getResponsesEndpointTransformer, getSharedExecutor, projectUpstreamResponseHeaders, readBody, relayResponse, resolvePoolBoundKey, writeBoundAccountError, writeError };
229
+ export { type ByoRouteActivityMeta, type StreamUsageTap, aggregateAnthropicSseToJsonBody, aggregateOpenAIChatChunksToJsonBody, aggregateResponsesSseToJsonBody, buildByoRouteActivityMeta, cancelDiscardedResponse, getAnthropicEndpointTransformer, getGeminiEndpointTransformer, getResponsesEndpointTransformer, getSharedExecutor, projectUpstreamResponseHeaders, readBody, relayResponse, resolvePoolBoundKey, sniffIsSseResponse, writeBoundAccountError, writeError };