@omnicross/core 0.1.9 → 0.2.0

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