@omnicross/core 0.1.10 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/{BuiltinToolExecutor-CS2WpXhM.d.cts → BuiltinToolExecutor-BHgH-EaZ.d.cts} +25 -2
- package/dist/{BuiltinToolExecutor-BluWyeob.d.ts → BuiltinToolExecutor-Bi1LmiTP.d.ts} +25 -2
- package/dist/{CompletionService-kNA17cfI.d.cts → CompletionService-BniP7j88.d.cts} +2 -2
- package/dist/{CompletionService-C3BX0Ovy.d.ts → CompletionService-BqrKPwfA.d.ts} +2 -2
- package/dist/{ProviderProxy-QdwNV6l1.d.cts → ProviderProxy-Bz_nkOwq.d.cts} +1 -1
- package/dist/{ProviderProxy--ROec6VI.d.ts → ProviderProxy-Ckr6oTrE.d.ts} +1 -1
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +6 -6
- package/dist/auth/GeminiCodeAssistProjectResolver.js +4 -4
- package/dist/{chunk-NGYOO5TO.js → chunk-2C3TTBS7.js} +7 -7
- package/dist/{chunk-QUSEZNYS.cjs → chunk-32SRZFFP.cjs} +4 -1
- package/dist/chunk-4JOU54M5.js +200 -0
- package/dist/{chunk-2UTGX6FM.js → chunk-4VVCXVB7.js} +1 -1
- package/dist/{chunk-RJUONLUQ.cjs → chunk-4Z3ZLLC2.cjs} +14 -8
- package/dist/chunk-6DDYNS2B.cjs +384 -0
- package/dist/{chunk-GXEZ2R3E.js → chunk-6OKXH2TW.js} +18 -7
- package/dist/{chunk-YWL7YZWS.cjs → chunk-7LRTPNFL.cjs} +5 -0
- package/dist/{chunk-CCVRRJOX.js → chunk-7PIUVCKK.js} +9 -2
- package/dist/chunk-7RJI3NDI.cjs +236 -0
- package/dist/{chunk-IIRPUVPH.cjs → chunk-7ZHBN75N.cjs} +3 -1
- package/dist/chunk-D4WNI6BR.cjs +386 -0
- package/dist/chunk-DBBR6RHF.js +236 -0
- package/dist/chunk-E4QHVXV5.cjs +118 -0
- package/dist/{chunk-HKB656B4.js → chunk-EUZRH544.js} +55 -287
- package/dist/{chunk-WNKWAEUR.js → chunk-EYGBM2VC.js} +3 -1
- package/dist/{chunk-UWDW6PN3.cjs → chunk-FX325I5Q.cjs} +20 -9
- package/dist/chunk-G4CZIUIB.cjs +200 -0
- package/dist/chunk-HCOQQAZE.cjs +123 -0
- package/dist/chunk-HL2YSPL7.cjs +673 -0
- package/dist/{chunk-55FMGZ3L.js → chunk-HN74IGEO.js} +1 -1
- package/dist/{chunk-ZY6KU6P3.js → chunk-HOMUGKHR.js} +8 -5
- package/dist/{chunk-AOFWNWLT.cjs → chunk-IUL4VWNU.cjs} +22 -1
- package/dist/{chunk-5LNYGCIW.cjs → chunk-KIQ2HA2A.cjs} +5 -5
- package/dist/{chunk-MUHWHQVM.cjs → chunk-KQBLZMP6.cjs} +4 -3
- package/dist/chunk-LFEH7CEO.js +384 -0
- package/dist/chunk-LFPQ2OVH.js +386 -0
- package/dist/{chunk-FEBAQI5A.js → chunk-LKDAN4D7.js} +6363 -1350
- package/dist/chunk-LQYS2N47.js +3923 -0
- package/dist/{chunk-NZYN7C3P.cjs → chunk-MPXOKQJP.cjs} +53 -53
- package/dist/chunk-MZEGQSKQ.js +118 -0
- package/dist/chunk-N76KU6F5.js +123 -0
- package/dist/chunk-NLUOTJWB.js +673 -0
- package/dist/{chunk-CMVXX7ON.cjs → chunk-NOITAVHA.cjs} +114 -58
- package/dist/{chunk-Q27JY5RG.cjs → chunk-OIKREZVQ.cjs} +7 -4
- package/dist/{chunk-ZQQUD66M.cjs → chunk-POUTD5AM.cjs} +63 -295
- package/dist/{chunk-6D4W22P4.js → chunk-QIIAMBTM.js} +4 -1
- package/dist/{chunk-56QD3YW6.cjs → chunk-QWNUOR7F.cjs} +11 -4
- package/dist/{chunk-S3DYFEBE.js → chunk-R4VCO2CB.js} +10 -1
- package/dist/{chunk-4VZX5F4T.cjs → chunk-T6NWPIYZ.cjs} +5 -2
- package/dist/{chunk-EBLFCNPY.js → chunk-U47LQXPB.js} +5 -2
- package/dist/chunk-UPQIWJIE.cjs +3923 -0
- package/dist/{chunk-N7OOJI5V.js → chunk-V2UKUTJ3.js} +5 -0
- package/dist/{chunk-45FHEOKW.js → chunk-V53ZEFXC.js} +92 -36
- package/dist/{chunk-RJ5ZGNI3.js → chunk-VL5TUDTM.js} +8 -2
- package/dist/{chunk-TIT74RIL.cjs → chunk-VSYQ6XYN.cjs} +6837 -1824
- package/dist/{chunk-OC6DOOFX.cjs → chunk-VXRTQZF2.cjs} +5 -5
- package/dist/{chunk-RICPANBY.cjs → chunk-WX2E2G7H.cjs} +13 -4
- package/dist/{chunk-DE2SRBFZ.js → chunk-X335TJNS.js} +4 -3
- package/dist/{chunk-CDHS2QDC.js → chunk-Y4CRNHJO.js} +53 -53
- package/dist/{chunk-P7EM6BND.cjs → chunk-ZAPN7XA6.cjs} +10 -10
- package/dist/{chunk-N2EIM2XJ.js → chunk-ZLNHPUFA.js} +22 -1
- package/dist/completion/BuiltinToolExecutor.cjs +2 -2
- package/dist/completion/BuiltinToolExecutor.d.cts +3 -1
- package/dist/completion/BuiltinToolExecutor.d.ts +3 -1
- package/dist/completion/BuiltinToolExecutor.js +1 -1
- package/dist/completion/CompletionService.cjs +32 -28
- package/dist/completion/CompletionService.d.cts +7 -3
- package/dist/completion/CompletionService.d.ts +7 -3
- package/dist/completion/CompletionService.js +31 -27
- package/dist/completion.cjs +40 -36
- package/dist/completion.d.cts +7 -3
- package/dist/completion.d.ts +7 -3
- package/dist/completion.js +39 -35
- package/dist/egress-I46O_p5L.d.cts +126 -0
- package/dist/egress-I46O_p5L.d.ts +126 -0
- package/dist/frontends-Doz0RaWu.d.cts +97 -0
- package/dist/frontends-Doz0RaWu.d.ts +97 -0
- package/dist/image-generation.cjs +52 -0
- package/dist/image-generation.d.cts +96 -0
- package/dist/image-generation.d.ts +96 -0
- package/dist/image-generation.js +52 -0
- package/dist/index.cjs +142 -32
- package/dist/index.d.cts +16 -8
- package/dist/index.d.ts +16 -8
- package/dist/index.js +159 -49
- package/dist/openai-operation.cjs +18 -0
- package/dist/openai-operation.d.cts +22 -0
- package/dist/openai-operation.d.ts +22 -0
- package/dist/openai-operation.js +18 -0
- package/dist/outbound-api/auditCapture.cjs +3 -3
- package/dist/outbound-api/auditCapture.d.cts +13 -2
- package/dist/outbound-api/auditCapture.d.ts +13 -2
- package/dist/outbound-api/auditCapture.js +2 -2
- package/dist/outbound-api/auditRedact.cjs +2 -2
- package/dist/outbound-api/auditRedact.js +1 -1
- package/dist/outbound-api/routeResolver.cjs +2 -2
- package/dist/outbound-api/routeResolver.d.cts +11 -4
- package/dist/outbound-api/routeResolver.d.ts +11 -4
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.cts +5 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.ts +5 -1
- package/dist/outbound-api/types.d.cts +10 -3
- package/dist/outbound-api/types.d.ts +10 -3
- package/dist/outbound-api.cjs +65 -33
- package/dist/outbound-api.d.cts +205 -10
- package/dist/outbound-api.d.ts +205 -10
- package/dist/outbound-api.js +64 -32
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +22 -15
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +22 -15
- package/dist/pipeline/LlmConfigProviderAuth.cjs +3 -3
- package/dist/pipeline/LlmConfigProviderAuth.js +2 -2
- package/dist/pipeline/SubscriptionAccountHealth.cjs +2 -2
- package/dist/pipeline/SubscriptionAccountHealth.d.cts +7 -0
- package/dist/pipeline/SubscriptionAccountHealth.d.ts +7 -0
- package/dist/pipeline/SubscriptionAccountHealth.js +1 -1
- package/dist/pipeline/executeProviderCall.cjs +2 -2
- package/dist/pipeline/executeProviderCall.d.cts +11 -6
- package/dist/pipeline/executeProviderCall.d.ts +11 -6
- package/dist/pipeline/executeProviderCall.js +1 -1
- package/dist/pipeline/upstreamFetch.cjs +2 -2
- package/dist/pipeline/upstreamFetch.d.cts +5 -0
- package/dist/pipeline/upstreamFetch.d.ts +5 -0
- package/dist/pipeline/upstreamFetch.js +1 -1
- package/dist/ports.d.cts +10 -3
- package/dist/ports.d.ts +10 -3
- package/dist/provider-proxy/ProviderProxy.cjs +32 -28
- package/dist/provider-proxy/ProviderProxy.d.cts +6 -2
- package/dist/provider-proxy/ProviderProxy.d.ts +6 -2
- package/dist/provider-proxy/ProviderProxy.js +31 -27
- package/dist/provider-proxy/identity/codexCliHeaders.cjs +4 -2
- package/dist/provider-proxy/identity/codexCliHeaders.d.cts +26 -6
- package/dist/provider-proxy/identity/codexCliHeaders.d.ts +26 -6
- package/dist/provider-proxy/identity/codexCliHeaders.js +5 -3
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +36 -28
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +41 -9
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +41 -9
- package/dist/provider-proxy/ingress/providerProxyShared.js +35 -27
- package/dist/provider-proxy/types.d.cts +17 -483
- package/dist/provider-proxy/types.d.ts +17 -483
- package/dist/provider-proxy.cjs +46 -28
- package/dist/provider-proxy.d.cts +34 -8
- package/dist/provider-proxy.d.ts +34 -8
- package/dist/provider-proxy.js +45 -27
- package/dist/proxy-UZTtjPZx.d.cts +18 -0
- package/dist/proxy-UZTtjPZx.d.ts +18 -0
- package/dist/{routeResolver-CVFE8KKe.d.cts → routeResolver-Da0yvkL1.d.cts} +4 -2
- package/dist/{routeResolver-C0mkkZaM.d.ts → routeResolver-STwMz_G4.d.ts} +4 -2
- package/dist/runtime-6QXNU526.cjs +8 -0
- package/dist/runtime-M5WXLD2R.js +8 -0
- package/dist/runtime-t8AZacFF.d.cts +233 -0
- package/dist/runtime-t8AZacFF.d.ts +233 -0
- package/dist/search/api.cjs +761 -0
- package/dist/search/api.d.cts +370 -0
- package/dist/search/api.d.ts +370 -0
- package/dist/search/api.js +761 -0
- package/dist/search/http.cjs +37 -0
- package/dist/search/http.d.cts +269 -0
- package/dist/search/http.d.ts +269 -0
- package/dist/search/http.js +37 -0
- package/dist/search.cjs +57 -0
- package/dist/search.d.cts +113 -0
- package/dist/search.d.ts +113 -0
- package/dist/search.js +57 -0
- package/dist/transformer/TransformerChainExecutor.cjs +2 -2
- package/dist/transformer/TransformerChainExecutor.d.cts +2 -2
- package/dist/transformer/TransformerChainExecutor.d.ts +2 -2
- package/dist/transformer/TransformerChainExecutor.js +1 -1
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.cjs +16 -0
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.d.cts +53 -0
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.d.ts +53 -0
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.js +16 -0
- package/dist/transformer/transformers/AnthropicTransformer.cjs +4 -3
- package/dist/transformer/transformers/AnthropicTransformer.js +3 -2
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +4 -4
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +3 -3
- package/dist/transformer/transformers/GeminiTransformer.cjs +4 -4
- package/dist/transformer/transformers/GeminiTransformer.js +3 -3
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -3
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -2
- package/dist/transformer/transformers/OpenAITransformer.cjs +3 -3
- package/dist/transformer/transformers/OpenAITransformer.js +2 -2
- package/dist/transformer/transformers.cjs +11 -10
- package/dist/transformer/transformers.js +12 -11
- package/dist/transformer/types.d.cts +39 -4
- package/dist/transformer/types.d.ts +39 -4
- package/dist/transformer.cjs +14 -13
- package/dist/transformer.js +13 -12
- package/dist/types-BSIJdsyl.d.cts +1130 -0
- package/dist/types-Be-yt_6T.d.cts +196 -0
- package/dist/types-By9Tg6-I.d.ts +1130 -0
- package/dist/types-CbCZqLGg.d.cts +127 -0
- package/dist/types-CbCZqLGg.d.ts +127 -0
- package/dist/{types-C2MwkLah.d.cts → types-D-oHYusb.d.cts} +250 -21
- package/dist/types-Dm4_36V4.d.ts +196 -0
- package/dist/{types-BB8pxk_3.d.ts → types-Dvlpjn0d.d.ts} +250 -21
- package/dist/usage.cjs +2 -2
- package/dist/usage.d.cts +6 -1
- package/dist/usage.d.ts +6 -1
- package/dist/usage.js +1 -1
- package/package.json +71 -64
- package/dist/chunk-FCR77GYM.cjs +0 -33
- package/dist/chunk-K5NM7VAH.js +0 -33
- /package/dist/{chunk-XXFYLL7R.js → chunk-ECZ3ZE2C.js} +0 -0
- /package/dist/{chunk-3SCOLIPT.cjs → chunk-MXI2PWIC.cjs} +0 -0
|
@@ -1,62 +1,66 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkVSYQ6XYNcjs = require('../chunk-VSYQ6XYN.cjs');
|
|
5
|
+
require('../chunk-E4QHVXV5.cjs');
|
|
5
6
|
require('../chunk-HQP3K7PU.cjs');
|
|
6
7
|
require('../chunk-QVOB2DNX.cjs');
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-7ZHBN75N.cjs');
|
|
9
|
+
require('../chunk-GBHYAGX3.cjs');
|
|
10
|
+
require('../chunk-3OPYJG76.cjs');
|
|
11
|
+
require('../chunk-ZAPN7XA6.cjs');
|
|
12
|
+
require('../chunk-KIQ2HA2A.cjs');
|
|
13
|
+
require('../chunk-NOITAVHA.cjs');
|
|
14
|
+
require('../chunk-QWNUOR7F.cjs');
|
|
15
|
+
require('../chunk-POUTD5AM.cjs');
|
|
16
|
+
require('../chunk-6DDYNS2B.cjs');
|
|
11
17
|
require('../chunk-5RSZYQJH.cjs');
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-QUSEZNYS.cjs');
|
|
18
|
+
require('../chunk-32SRZFFP.cjs');
|
|
14
19
|
require('../chunk-2E42SAW3.cjs');
|
|
15
20
|
require('../chunk-5UK3KLE2.cjs');
|
|
16
|
-
require('../chunk-
|
|
17
|
-
require('../chunk-GBHYAGX3.cjs');
|
|
18
|
-
require('../chunk-3OPYJG76.cjs');
|
|
19
|
-
require('../chunk-3SCOLIPT.cjs');
|
|
21
|
+
require('../chunk-MXI2PWIC.cjs');
|
|
20
22
|
require('../chunk-RPII3E6Z.cjs');
|
|
21
23
|
require('../chunk-6RPZADX3.cjs');
|
|
22
24
|
require('../chunk-J3QQ6JS5.cjs');
|
|
23
25
|
require('../chunk-UIBD2YY5.cjs');
|
|
24
26
|
require('../chunk-R3HK6R4B.cjs');
|
|
27
|
+
require('../chunk-KQBLZMP6.cjs');
|
|
28
|
+
require('../chunk-OIKREZVQ.cjs');
|
|
25
29
|
require('../chunk-QXD4MV2X.cjs');
|
|
26
30
|
require('../chunk-NYUNU75A.cjs');
|
|
27
31
|
require('../chunk-OTZC4TNH.cjs');
|
|
28
|
-
require('../chunk-
|
|
32
|
+
require('../chunk-7LRTPNFL.cjs');
|
|
29
33
|
require('../chunk-YNJNTCSQ.cjs');
|
|
30
34
|
require('../chunk-SVNDB62D.cjs');
|
|
31
35
|
require('../chunk-6QQG7YG3.cjs');
|
|
32
36
|
require('../chunk-25GXJCEZ.cjs');
|
|
33
|
-
require('../chunk-
|
|
34
|
-
require('../chunk-
|
|
37
|
+
require('../chunk-FX325I5Q.cjs');
|
|
38
|
+
require('../chunk-AEOZIDEB.cjs');
|
|
39
|
+
require('../chunk-HCOQQAZE.cjs');
|
|
35
40
|
require('../chunk-APYG5QD7.cjs');
|
|
36
41
|
require('../chunk-L74VDN4A.cjs');
|
|
42
|
+
require('../chunk-XSVNC2UD.cjs');
|
|
37
43
|
require('../chunk-4YINUUKQ.cjs');
|
|
38
|
-
require('../chunk-
|
|
44
|
+
require('../chunk-T6NWPIYZ.cjs');
|
|
39
45
|
require('../chunk-QBZJ7P2T.cjs');
|
|
40
46
|
require('../chunk-4IH4EL7M.cjs');
|
|
47
|
+
require('../chunk-JMJBSACD.cjs');
|
|
48
|
+
require('../chunk-GMMT7RVN.cjs');
|
|
49
|
+
require('../chunk-UNEFIWXI.cjs');
|
|
41
50
|
require('../chunk-A2YMUCBT.cjs');
|
|
42
|
-
require('../chunk-UWDW6PN3.cjs');
|
|
43
|
-
require('../chunk-FCR77GYM.cjs');
|
|
44
|
-
require('../chunk-AEOZIDEB.cjs');
|
|
45
|
-
require('../chunk-XSVNC2UD.cjs');
|
|
46
51
|
require('../chunk-GDIXXKF2.cjs');
|
|
47
|
-
require('../chunk-
|
|
48
|
-
require('../chunk-
|
|
52
|
+
require('../chunk-VXRTQZF2.cjs');
|
|
53
|
+
require('../chunk-WX2E2G7H.cjs');
|
|
49
54
|
require('../chunk-77USGNRW.cjs');
|
|
50
|
-
require('../chunk-
|
|
51
|
-
require('../chunk-
|
|
55
|
+
require('../chunk-IUL4VWNU.cjs');
|
|
56
|
+
require('../chunk-4Z3ZLLC2.cjs');
|
|
52
57
|
require('../chunk-235MXAGX.cjs');
|
|
53
58
|
require('../chunk-HVBBDBS3.cjs');
|
|
54
59
|
require('../chunk-NKVZ6Z3Y.cjs');
|
|
55
|
-
require('../chunk-
|
|
56
|
-
require('../chunk-
|
|
57
|
-
require('../chunk-
|
|
58
|
-
require('../chunk-UNEFIWXI.cjs');
|
|
60
|
+
require('../chunk-UPQIWJIE.cjs');
|
|
61
|
+
require('../chunk-G4CZIUIB.cjs');
|
|
62
|
+
require('../chunk-MPXOKQJP.cjs');
|
|
59
63
|
|
|
60
64
|
|
|
61
65
|
|
|
62
|
-
exports.ProviderProxy =
|
|
66
|
+
exports.ProviderProxy = _chunkVSYQ6XYNcjs.ProviderProxy; exports.isLoopbackAddress = _chunkVSYQ6XYNcjs.isLoopbackAddress;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-
|
|
2
|
-
import '
|
|
1
|
+
export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-Bz_nkOwq.cjs';
|
|
2
|
+
import '../types-BSIJdsyl.cjs';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
import '@omnicross/contracts/completion-types';
|
|
5
5
|
import '@omnicross/contracts/usage-stats-types';
|
|
@@ -17,3 +17,7 @@ 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 '../frontends-Doz0RaWu.cjs';
|
|
21
|
+
import '@omnicross/contracts/search-types';
|
|
22
|
+
import '../runtime-t8AZacFF.cjs';
|
|
23
|
+
import '@omnicross/contracts/image-generation-types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy
|
|
2
|
-
import '
|
|
1
|
+
export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-Ckr6oTrE.js';
|
|
2
|
+
import '../types-By9Tg6-I.js';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
import '@omnicross/contracts/completion-types';
|
|
5
5
|
import '@omnicross/contracts/usage-stats-types';
|
|
@@ -17,3 +17,7 @@ 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 '../frontends-Doz0RaWu.js';
|
|
21
|
+
import '@omnicross/contracts/search-types';
|
|
22
|
+
import '../runtime-t8AZacFF.js';
|
|
23
|
+
import '@omnicross/contracts/image-generation-types';
|
|
@@ -1,61 +1,65 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProviderProxy,
|
|
3
3
|
isLoopbackAddress
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LKDAN4D7.js";
|
|
5
|
+
import "../chunk-MZEGQSKQ.js";
|
|
5
6
|
import "../chunk-VVEHS2LI.js";
|
|
6
7
|
import "../chunk-WTQMX2Q6.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-EYGBM2VC.js";
|
|
9
|
+
import "../chunk-MZNPGW5Q.js";
|
|
10
|
+
import "../chunk-DK4A7DLE.js";
|
|
11
|
+
import "../chunk-2C3TTBS7.js";
|
|
12
|
+
import "../chunk-HN74IGEO.js";
|
|
13
|
+
import "../chunk-V53ZEFXC.js";
|
|
14
|
+
import "../chunk-7PIUVCKK.js";
|
|
15
|
+
import "../chunk-EUZRH544.js";
|
|
16
|
+
import "../chunk-LFEH7CEO.js";
|
|
11
17
|
import "../chunk-FU7EAR73.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-6D4W22P4.js";
|
|
18
|
+
import "../chunk-QIIAMBTM.js";
|
|
14
19
|
import "../chunk-FXR6N3SR.js";
|
|
15
20
|
import "../chunk-AQDON6MB.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-MZNPGW5Q.js";
|
|
18
|
-
import "../chunk-DK4A7DLE.js";
|
|
19
|
-
import "../chunk-XXFYLL7R.js";
|
|
21
|
+
import "../chunk-ECZ3ZE2C.js";
|
|
20
22
|
import "../chunk-XTEI64OU.js";
|
|
21
23
|
import "../chunk-XX6NQJMA.js";
|
|
22
24
|
import "../chunk-GFIZ6LQI.js";
|
|
23
25
|
import "../chunk-OE6TDIWW.js";
|
|
24
26
|
import "../chunk-DRWHTIIZ.js";
|
|
27
|
+
import "../chunk-X335TJNS.js";
|
|
28
|
+
import "../chunk-HOMUGKHR.js";
|
|
25
29
|
import "../chunk-JWC6APFQ.js";
|
|
26
30
|
import "../chunk-5ERIZW3D.js";
|
|
27
31
|
import "../chunk-PO3XB56Z.js";
|
|
28
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-V2UKUTJ3.js";
|
|
29
33
|
import "../chunk-23S5OPIO.js";
|
|
30
34
|
import "../chunk-AVYJ4YBN.js";
|
|
31
35
|
import "../chunk-OPRS4IQZ.js";
|
|
32
36
|
import "../chunk-2JYRIADS.js";
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-6OKXH2TW.js";
|
|
38
|
+
import "../chunk-WNY4WMRF.js";
|
|
39
|
+
import "../chunk-N76KU6F5.js";
|
|
35
40
|
import "../chunk-WLYIIEAF.js";
|
|
36
41
|
import "../chunk-TKJMZBAH.js";
|
|
42
|
+
import "../chunk-OZFM4X3S.js";
|
|
37
43
|
import "../chunk-3QFXFCHG.js";
|
|
38
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-U47LQXPB.js";
|
|
39
45
|
import "../chunk-AQ5TNQB7.js";
|
|
40
46
|
import "../chunk-XEKD23J5.js";
|
|
47
|
+
import "../chunk-Y7FO65VT.js";
|
|
48
|
+
import "../chunk-FMOBD2OQ.js";
|
|
49
|
+
import "../chunk-HUZZZ3JL.js";
|
|
41
50
|
import "../chunk-H5JUT3KV.js";
|
|
42
|
-
import "../chunk-GXEZ2R3E.js";
|
|
43
|
-
import "../chunk-K5NM7VAH.js";
|
|
44
|
-
import "../chunk-WNY4WMRF.js";
|
|
45
|
-
import "../chunk-OZFM4X3S.js";
|
|
46
51
|
import "../chunk-5NJLQ6T6.js";
|
|
47
|
-
import "../chunk-
|
|
48
|
-
import "../chunk-
|
|
52
|
+
import "../chunk-4VVCXVB7.js";
|
|
53
|
+
import "../chunk-R4VCO2CB.js";
|
|
49
54
|
import "../chunk-WYVGULTQ.js";
|
|
50
|
-
import "../chunk-
|
|
51
|
-
import "../chunk-
|
|
55
|
+
import "../chunk-ZLNHPUFA.js";
|
|
56
|
+
import "../chunk-VL5TUDTM.js";
|
|
52
57
|
import "../chunk-3WD4HTR2.js";
|
|
53
58
|
import "../chunk-MKF46GNZ.js";
|
|
54
59
|
import "../chunk-GL6XM527.js";
|
|
55
|
-
import "../chunk-
|
|
56
|
-
import "../chunk-
|
|
57
|
-
import "../chunk-
|
|
58
|
-
import "../chunk-HUZZZ3JL.js";
|
|
60
|
+
import "../chunk-LQYS2N47.js";
|
|
61
|
+
import "../chunk-4JOU54M5.js";
|
|
62
|
+
import "../chunk-Y4CRNHJO.js";
|
|
59
63
|
export {
|
|
60
64
|
ProviderProxy,
|
|
61
65
|
isLoopbackAddress
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var _chunk3SCOLIPTcjs = require('../../chunk-3SCOLIPT.cjs');
|
|
6
5
|
|
|
6
|
+
var _chunkMXI2PWICcjs = require('../../chunk-MXI2PWIC.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.DEFAULT_CODEX_CLI_HEADERS = _chunkMXI2PWICcjs.DEFAULT_CODEX_CLI_HEADERS; exports.codexAcceptHeader = _chunkMXI2PWICcjs.codexAcceptHeader; exports.extractCodexClientHeaders = _chunkMXI2PWICcjs.extractCodexClientHeaders; exports.fillMissingHeaders = _chunkMXI2PWICcjs.fillMissingHeaders;
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* headerMerge — the shared outbound-header merge primitive used by the
|
|
3
|
+
* per-client header builders (`claudeCodeHeaders`, `codexCliHeaders`).
|
|
4
|
+
*
|
|
5
|
+
* Split out so neither builder has to import the other just to reuse the merge.
|
|
6
|
+
*
|
|
7
|
+
* @module provider-proxy/identity/headerMerge
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Copy every entry of `source` into `headers` that `headers` does not already
|
|
11
|
+
* carry (case-insensitive on the existing keys, so an `Authorization` set by the
|
|
12
|
+
* auth strategy is never shadowed by an `authorization` from a caller bag).
|
|
13
|
+
* Existing values ALWAYS win — this only fills empty slots, which is what makes
|
|
14
|
+
* the precedence chain (auth > frozen fingerprint > caller > defaults) work by
|
|
15
|
+
* simply calling it in order.
|
|
16
|
+
*/
|
|
17
|
+
declare function fillMissingHeaders(headers: Record<string, string>, source: Readonly<Record<string, string>>): void;
|
|
18
|
+
|
|
1
19
|
/**
|
|
2
20
|
* codexCliHeaders — the Codex CLI client headers the CODEX SUBSCRIPTION relay
|
|
3
21
|
* puts on every `chatgpt.com/backend-api/codex/responses` request.
|
|
@@ -14,24 +32,26 @@
|
|
|
14
32
|
* shares this relay and must stay byte-identical — sending it `originator:
|
|
15
33
|
* codex_cli_rs` would be wrong and could trip its own checks.
|
|
16
34
|
*
|
|
17
|
-
* Modeled on
|
|
35
|
+
* Modeled on observed Codex CLI-compatible relay behavior.
|
|
18
36
|
*
|
|
19
37
|
* NOT DONE HERE (deliberate, see the relay call site):
|
|
20
|
-
* - `chatgpt-account-id`:
|
|
21
|
-
* OAuth `id_token`. Guessing it wrong risks a 403 on a
|
|
22
|
-
* works, so it is left to a follow-up that can verify
|
|
38
|
+
* - `chatgpt-account-id`: compatible implementations send the ChatGPT account
|
|
39
|
+
* id parsed out of the OAuth `id_token`. Guessing it wrong risks a 403 on a
|
|
40
|
+
* path that currently works, so it is left to a follow-up that can verify it.
|
|
23
41
|
* - forcing `store: false` on the body: a body mutation with its own regression
|
|
24
42
|
* surface, tracked separately.
|
|
25
43
|
*
|
|
26
44
|
* @module provider-proxy/identity/codexCliHeaders
|
|
27
45
|
*/
|
|
46
|
+
|
|
28
47
|
/**
|
|
29
48
|
* Client markers a real `codex` CLI invocation carries. Used ONLY to fill a slot
|
|
30
49
|
* the caller left empty — a forwarded real value always wins, so a genuine Codex
|
|
31
50
|
* CLI keeps its own identity and only a caller that sent nothing gets these.
|
|
32
51
|
*
|
|
33
52
|
* `originator` is the load-bearing one: it is how the backend tells the Codex
|
|
34
|
-
* CLI apart from a generic Responses client,
|
|
53
|
+
* CLI apart from a generic Responses client, so compatible relays send it
|
|
54
|
+
* unconditionally.
|
|
35
55
|
*/
|
|
36
56
|
declare const DEFAULT_CODEX_CLI_HEADERS: Readonly<Record<string, string>>;
|
|
37
57
|
/**
|
|
@@ -42,4 +62,4 @@ declare function extractCodexClientHeaders(reqHeaders: Record<string, string | s
|
|
|
42
62
|
/** The `accept` a Codex CLI sends, which differs by streaming mode. */
|
|
43
63
|
declare function codexAcceptHeader(isStream: boolean): string;
|
|
44
64
|
|
|
45
|
-
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders };
|
|
65
|
+
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders, fillMissingHeaders };
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* headerMerge — the shared outbound-header merge primitive used by the
|
|
3
|
+
* per-client header builders (`claudeCodeHeaders`, `codexCliHeaders`).
|
|
4
|
+
*
|
|
5
|
+
* Split out so neither builder has to import the other just to reuse the merge.
|
|
6
|
+
*
|
|
7
|
+
* @module provider-proxy/identity/headerMerge
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Copy every entry of `source` into `headers` that `headers` does not already
|
|
11
|
+
* carry (case-insensitive on the existing keys, so an `Authorization` set by the
|
|
12
|
+
* auth strategy is never shadowed by an `authorization` from a caller bag).
|
|
13
|
+
* Existing values ALWAYS win — this only fills empty slots, which is what makes
|
|
14
|
+
* the precedence chain (auth > frozen fingerprint > caller > defaults) work by
|
|
15
|
+
* simply calling it in order.
|
|
16
|
+
*/
|
|
17
|
+
declare function fillMissingHeaders(headers: Record<string, string>, source: Readonly<Record<string, string>>): void;
|
|
18
|
+
|
|
1
19
|
/**
|
|
2
20
|
* codexCliHeaders — the Codex CLI client headers the CODEX SUBSCRIPTION relay
|
|
3
21
|
* puts on every `chatgpt.com/backend-api/codex/responses` request.
|
|
@@ -14,24 +32,26 @@
|
|
|
14
32
|
* shares this relay and must stay byte-identical — sending it `originator:
|
|
15
33
|
* codex_cli_rs` would be wrong and could trip its own checks.
|
|
16
34
|
*
|
|
17
|
-
* Modeled on
|
|
35
|
+
* Modeled on observed Codex CLI-compatible relay behavior.
|
|
18
36
|
*
|
|
19
37
|
* NOT DONE HERE (deliberate, see the relay call site):
|
|
20
|
-
* - `chatgpt-account-id`:
|
|
21
|
-
* OAuth `id_token`. Guessing it wrong risks a 403 on a
|
|
22
|
-
* works, so it is left to a follow-up that can verify
|
|
38
|
+
* - `chatgpt-account-id`: compatible implementations send the ChatGPT account
|
|
39
|
+
* id parsed out of the OAuth `id_token`. Guessing it wrong risks a 403 on a
|
|
40
|
+
* path that currently works, so it is left to a follow-up that can verify it.
|
|
23
41
|
* - forcing `store: false` on the body: a body mutation with its own regression
|
|
24
42
|
* surface, tracked separately.
|
|
25
43
|
*
|
|
26
44
|
* @module provider-proxy/identity/codexCliHeaders
|
|
27
45
|
*/
|
|
46
|
+
|
|
28
47
|
/**
|
|
29
48
|
* Client markers a real `codex` CLI invocation carries. Used ONLY to fill a slot
|
|
30
49
|
* the caller left empty — a forwarded real value always wins, so a genuine Codex
|
|
31
50
|
* CLI keeps its own identity and only a caller that sent nothing gets these.
|
|
32
51
|
*
|
|
33
52
|
* `originator` is the load-bearing one: it is how the backend tells the Codex
|
|
34
|
-
* CLI apart from a generic Responses client,
|
|
53
|
+
* CLI apart from a generic Responses client, so compatible relays send it
|
|
54
|
+
* unconditionally.
|
|
35
55
|
*/
|
|
36
56
|
declare const DEFAULT_CODEX_CLI_HEADERS: Readonly<Record<string, string>>;
|
|
37
57
|
/**
|
|
@@ -42,4 +62,4 @@ declare function extractCodexClientHeaders(reqHeaders: Record<string, string | s
|
|
|
42
62
|
/** The `accept` a Codex CLI sends, which differs by streaming mode. */
|
|
43
63
|
declare function codexAcceptHeader(isStream: boolean): string;
|
|
44
64
|
|
|
45
|
-
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders };
|
|
65
|
+
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders, fillMissingHeaders };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_CODEX_CLI_HEADERS,
|
|
3
3
|
codexAcceptHeader,
|
|
4
|
-
extractCodexClientHeaders
|
|
5
|
-
|
|
4
|
+
extractCodexClientHeaders,
|
|
5
|
+
fillMissingHeaders
|
|
6
|
+
} from "../../chunk-ECZ3ZE2C.js";
|
|
6
7
|
export {
|
|
7
8
|
DEFAULT_CODEX_CLI_HEADERS,
|
|
8
9
|
codexAcceptHeader,
|
|
9
|
-
extractCodexClientHeaders
|
|
10
|
+
extractCodexClientHeaders,
|
|
11
|
+
fillMissingHeaders
|
|
10
12
|
};
|
|
@@ -9,61 +9,69 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkVSYQ6XYNcjs = require('../../chunk-VSYQ6XYN.cjs');
|
|
15
|
+
require('../../chunk-E4QHVXV5.cjs');
|
|
13
16
|
require('../../chunk-HQP3K7PU.cjs');
|
|
14
17
|
require('../../chunk-QVOB2DNX.cjs');
|
|
15
|
-
require('../../chunk-
|
|
16
|
-
require('../../chunk-
|
|
17
|
-
require('../../chunk-
|
|
18
|
-
require('../../chunk-
|
|
18
|
+
require('../../chunk-7ZHBN75N.cjs');
|
|
19
|
+
require('../../chunk-GBHYAGX3.cjs');
|
|
20
|
+
require('../../chunk-3OPYJG76.cjs');
|
|
21
|
+
require('../../chunk-ZAPN7XA6.cjs');
|
|
22
|
+
require('../../chunk-KIQ2HA2A.cjs');
|
|
23
|
+
require('../../chunk-NOITAVHA.cjs');
|
|
24
|
+
require('../../chunk-QWNUOR7F.cjs');
|
|
25
|
+
require('../../chunk-POUTD5AM.cjs');
|
|
26
|
+
require('../../chunk-6DDYNS2B.cjs');
|
|
19
27
|
require('../../chunk-5RSZYQJH.cjs');
|
|
20
|
-
require('../../chunk-
|
|
21
|
-
require('../../chunk-QUSEZNYS.cjs');
|
|
28
|
+
require('../../chunk-32SRZFFP.cjs');
|
|
22
29
|
require('../../chunk-2E42SAW3.cjs');
|
|
23
30
|
require('../../chunk-5UK3KLE2.cjs');
|
|
24
|
-
require('../../chunk-
|
|
25
|
-
require('../../chunk-GBHYAGX3.cjs');
|
|
26
|
-
require('../../chunk-3OPYJG76.cjs');
|
|
27
|
-
require('../../chunk-3SCOLIPT.cjs');
|
|
31
|
+
require('../../chunk-MXI2PWIC.cjs');
|
|
28
32
|
require('../../chunk-RPII3E6Z.cjs');
|
|
29
33
|
require('../../chunk-6RPZADX3.cjs');
|
|
30
34
|
require('../../chunk-J3QQ6JS5.cjs');
|
|
31
35
|
require('../../chunk-UIBD2YY5.cjs');
|
|
32
36
|
require('../../chunk-R3HK6R4B.cjs');
|
|
37
|
+
require('../../chunk-KQBLZMP6.cjs');
|
|
38
|
+
require('../../chunk-OIKREZVQ.cjs');
|
|
33
39
|
require('../../chunk-QXD4MV2X.cjs');
|
|
34
40
|
require('../../chunk-NYUNU75A.cjs');
|
|
35
41
|
require('../../chunk-OTZC4TNH.cjs');
|
|
36
|
-
require('../../chunk-
|
|
42
|
+
require('../../chunk-7LRTPNFL.cjs');
|
|
37
43
|
require('../../chunk-YNJNTCSQ.cjs');
|
|
38
44
|
require('../../chunk-SVNDB62D.cjs');
|
|
39
45
|
require('../../chunk-6QQG7YG3.cjs');
|
|
40
46
|
require('../../chunk-25GXJCEZ.cjs');
|
|
41
|
-
require('../../chunk-
|
|
42
|
-
require('../../chunk-
|
|
47
|
+
require('../../chunk-FX325I5Q.cjs');
|
|
48
|
+
require('../../chunk-AEOZIDEB.cjs');
|
|
49
|
+
require('../../chunk-HCOQQAZE.cjs');
|
|
43
50
|
require('../../chunk-APYG5QD7.cjs');
|
|
44
51
|
require('../../chunk-L74VDN4A.cjs');
|
|
52
|
+
require('../../chunk-XSVNC2UD.cjs');
|
|
45
53
|
require('../../chunk-4YINUUKQ.cjs');
|
|
46
|
-
require('../../chunk-
|
|
54
|
+
require('../../chunk-T6NWPIYZ.cjs');
|
|
47
55
|
require('../../chunk-QBZJ7P2T.cjs');
|
|
48
56
|
require('../../chunk-4IH4EL7M.cjs');
|
|
57
|
+
require('../../chunk-JMJBSACD.cjs');
|
|
58
|
+
require('../../chunk-GMMT7RVN.cjs');
|
|
59
|
+
require('../../chunk-UNEFIWXI.cjs');
|
|
49
60
|
require('../../chunk-A2YMUCBT.cjs');
|
|
50
|
-
require('../../chunk-UWDW6PN3.cjs');
|
|
51
|
-
require('../../chunk-FCR77GYM.cjs');
|
|
52
|
-
require('../../chunk-AEOZIDEB.cjs');
|
|
53
|
-
require('../../chunk-XSVNC2UD.cjs');
|
|
54
61
|
require('../../chunk-GDIXXKF2.cjs');
|
|
55
|
-
require('../../chunk-
|
|
56
|
-
require('../../chunk-
|
|
62
|
+
require('../../chunk-VXRTQZF2.cjs');
|
|
63
|
+
require('../../chunk-WX2E2G7H.cjs');
|
|
57
64
|
require('../../chunk-77USGNRW.cjs');
|
|
58
|
-
require('../../chunk-
|
|
59
|
-
require('../../chunk-
|
|
65
|
+
require('../../chunk-IUL4VWNU.cjs');
|
|
66
|
+
require('../../chunk-4Z3ZLLC2.cjs');
|
|
60
67
|
require('../../chunk-235MXAGX.cjs');
|
|
61
68
|
require('../../chunk-HVBBDBS3.cjs');
|
|
62
69
|
require('../../chunk-NKVZ6Z3Y.cjs');
|
|
63
|
-
require('../../chunk-
|
|
64
|
-
require('../../chunk-
|
|
65
|
-
require('../../chunk-
|
|
66
|
-
|
|
70
|
+
require('../../chunk-UPQIWJIE.cjs');
|
|
71
|
+
require('../../chunk-G4CZIUIB.cjs');
|
|
72
|
+
require('../../chunk-MPXOKQJP.cjs');
|
|
73
|
+
|
|
74
|
+
|
|
67
75
|
|
|
68
76
|
|
|
69
77
|
|
|
@@ -75,4 +83,4 @@ require('../../chunk-UNEFIWXI.cjs');
|
|
|
75
83
|
|
|
76
84
|
|
|
77
85
|
|
|
78
|
-
exports.aggregateAnthropicSseToJsonBody =
|
|
86
|
+
exports.aggregateAnthropicSseToJsonBody = _chunkVSYQ6XYNcjs.aggregateAnthropicSseToJsonBody; exports.cancelDiscardedResponse = _chunkVSYQ6XYNcjs.cancelDiscardedResponse; exports.getAnthropicEndpointTransformer = _chunkVSYQ6XYNcjs.getAnthropicEndpointTransformer; exports.getGeminiEndpointTransformer = _chunkVSYQ6XYNcjs.getGeminiEndpointTransformer; exports.getResponsesEndpointTransformer = _chunkVSYQ6XYNcjs.getResponsesEndpointTransformer; exports.getSharedExecutor = _chunkVSYQ6XYNcjs.getSharedExecutor; exports.projectUpstreamResponseHeaders = _chunkVSYQ6XYNcjs.projectUpstreamResponseHeaders; exports.readBody = _chunkVSYQ6XYNcjs.readBody; exports.relayResponse = _chunkVSYQ6XYNcjs.relayResponse; exports.resolvePoolBoundKey = _chunkVSYQ6XYNcjs.resolvePoolBoundKey; exports.writeBoundAccountError = _chunkVSYQ6XYNcjs.writeBoundAccountError; exports.writeError = _chunkVSYQ6XYNcjs.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 { ProviderProxyDeps } from '
|
|
6
|
+
import { W as ProviderProxyDeps } from '../../types-BSIJdsyl.cjs';
|
|
7
7
|
import '@omnicross/contracts/completion-types';
|
|
8
8
|
import '@omnicross/contracts/usage-stats-types';
|
|
9
9
|
import '@omnicross/contracts/subscription-types';
|
|
@@ -17,6 +17,10 @@ import '../../ports/provider-config-source.cjs';
|
|
|
17
17
|
import '../../transformer/TransformerService.cjs';
|
|
18
18
|
import '../../ports/web-search-backend.cjs';
|
|
19
19
|
import '@omnicross/contracts/websearch-types';
|
|
20
|
+
import '../../frontends-Doz0RaWu.cjs';
|
|
21
|
+
import '@omnicross/contracts/search-types';
|
|
22
|
+
import '../../runtime-t8AZacFF.cjs';
|
|
23
|
+
import '@omnicross/contracts/image-generation-types';
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
26
|
* Shared helpers for the ProviderProxy ingress parsers.
|
|
@@ -37,8 +41,8 @@ declare function getSharedExecutor(): TransformerChainExecutor;
|
|
|
37
41
|
declare function getResponsesEndpointTransformer(): Transformer;
|
|
38
42
|
declare function getAnthropicEndpointTransformer(): Transformer;
|
|
39
43
|
declare function getGeminiEndpointTransformer(): Transformer;
|
|
40
|
-
/** Read the full request body from an IncomingMessage. */
|
|
41
|
-
declare function readBody(req: http.IncomingMessage): Promise<string>;
|
|
44
|
+
/** Read the full request body from an IncomingMessage with deterministic listener cleanup. */
|
|
45
|
+
declare function readBody(req: http.IncomingMessage, signal?: AbortSignal): Promise<string>;
|
|
42
46
|
/**
|
|
43
47
|
* A usage tap for {@link relayResponse}'s stream branch. Streaming responses were
|
|
44
48
|
* previously not metered (only the non-stream branch recorded usage), so Codex
|
|
@@ -61,9 +65,28 @@ interface StreamUsageTap {
|
|
|
61
65
|
/** Called once at stream end with the last captured usage (only if any). */
|
|
62
66
|
onUsage(rawUsage: Record<string, unknown>): void;
|
|
63
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Release an upstream `Response` this request will NEVER relay — the one
|
|
70
|
+
* discarded by a 401-refresh retry, an ApiKeyPool rebind retry, or a fallback
|
|
71
|
+
* advance.
|
|
72
|
+
*
|
|
73
|
+
* Dropping the reference is NOT enough: an unread body keeps its undici socket
|
|
74
|
+
* (and the whole CONNECT tunnel through any egress proxy) checked out until the
|
|
75
|
+
* GC finalizer eventually reclaims it, so a retry-heavy period accumulates
|
|
76
|
+
* orphan connections against the proxy. Cancelling returns the socket
|
|
77
|
+
* immediately. Awaited so the release is ordered BEFORE the replacement attempt
|
|
78
|
+
* is issued; `cancel()` on an undici body is a local teardown and does no
|
|
79
|
+
* network I/O. Best-effort by construction — an already-locked/consumed body
|
|
80
|
+
* (e.g. one a health sniff read via `clone()`) and a cancel rejection are both
|
|
81
|
+
* no-ops, and a cleanup failure must never break serving.
|
|
82
|
+
*/
|
|
83
|
+
declare function cancelDiscardedResponse(response: Response | undefined): Promise<void>;
|
|
84
|
+
/** Project only explicitly safe end-to-end upstream response metadata. */
|
|
85
|
+
declare function projectUpstreamResponseHeaders(headers: Headers, upstreamIsSse: boolean): Record<string, string>;
|
|
64
86
|
/**
|
|
65
87
|
* Relay an already-wire-shaped `Response` to the http `res`.
|
|
66
|
-
* - `text/event-stream
|
|
88
|
+
* - explicit `text/event-stream`, or a confirmed headerless SSE compatibility
|
|
89
|
+
* response: pipe the ReadableStream chunk-by-chunk.
|
|
67
90
|
* - else: read the JSON text and write it once, returning it so the caller can
|
|
68
91
|
* tap usage. Mirrors the host's codex relay.
|
|
69
92
|
*
|
|
@@ -87,7 +110,7 @@ declare function relayResponse(res: http.ServerResponse, providerResponse: Respo
|
|
|
87
110
|
* server-overload event. When present, forces the line-based relay path so
|
|
88
111
|
* events are parsed even without a `rewriteModel`/`usageTap`.
|
|
89
112
|
*/
|
|
90
|
-
onSseEvent?: (event: Record<string, unknown>) => void): Promise<string | null>;
|
|
113
|
+
onSseEvent?: (event: Record<string, unknown>) => void, signal?: AbortSignal): Promise<string | null>;
|
|
91
114
|
/**
|
|
92
115
|
* Aggregate a streaming Anthropic `text/event-stream` body into ONE buffered
|
|
93
116
|
* Anthropic `message` JSON object — the inverse of the SDK's SSE wire format.
|
|
@@ -103,13 +126,22 @@ onSseEvent?: (event: Record<string, unknown>) => void): Promise<string | null>;
|
|
|
103
126
|
*
|
|
104
127
|
* Best-effort: a malformed event is skipped, never thrown.
|
|
105
128
|
*/
|
|
106
|
-
declare function aggregateAnthropicSseToJsonBody(response: Response, rewriteModel?: string): Promise<string>;
|
|
107
|
-
/**
|
|
129
|
+
declare function aggregateAnthropicSseToJsonBody(response: Response, rewriteModel?: string, signal?: AbortSignal): Promise<string>;
|
|
130
|
+
/**
|
|
131
|
+
* Write a JSON error response if the headers have not been sent.
|
|
132
|
+
*
|
|
133
|
+
* On an Anthropic-protocol request (res marked at the pipeline entry — see
|
|
134
|
+
* `anthropicErrorEnvelope`) the body takes the Anthropic error shape so
|
|
135
|
+
* Anthropic SDK clients can type-parse it; every other path keeps the legacy
|
|
136
|
+
* `provider_proxy_error` envelope byte-for-byte.
|
|
137
|
+
*/
|
|
108
138
|
declare function writeError(res: http.ServerResponse, status: number, message: string): void;
|
|
109
139
|
/**
|
|
110
140
|
* Map a strict bound-account failure to a stable structured response. The body
|
|
111
141
|
* carries only the fixed code/reason/message; account ids, tokens, and upstream
|
|
112
|
-
* error text never cross the wire.
|
|
142
|
+
* error text never cross the wire. On a marked Anthropic-protocol response the
|
|
143
|
+
* stable `code`/`reason` fields fold INTO the Anthropic `error` object and the
|
|
144
|
+
* `Retry-After` header is preserved.
|
|
113
145
|
*/
|
|
114
146
|
declare function writeBoundAccountError(res: http.ServerResponse, error: BoundAccountSelectionError): void;
|
|
115
147
|
/**
|
|
@@ -142,4 +174,4 @@ declare function writeBoundAccountError(res: http.ServerResponse, error: BoundAc
|
|
|
142
174
|
*/
|
|
143
175
|
declare function resolvePoolBoundKey(deps: ProviderProxyDeps, providerId: string, provider: LLMProvider, sessionId: string | null, preferredKeyId?: string, boundKeyFallbackPolicy?: 'strict' | 'pool'): Promise<string>;
|
|
144
176
|
|
|
145
|
-
export { type StreamUsageTap, aggregateAnthropicSseToJsonBody, getAnthropicEndpointTransformer, getGeminiEndpointTransformer, getResponsesEndpointTransformer, getSharedExecutor, readBody, relayResponse, resolvePoolBoundKey, writeBoundAccountError, writeError };
|
|
177
|
+
export { type StreamUsageTap, aggregateAnthropicSseToJsonBody, cancelDiscardedResponse, getAnthropicEndpointTransformer, getGeminiEndpointTransformer, getResponsesEndpointTransformer, getSharedExecutor, projectUpstreamResponseHeaders, readBody, relayResponse, resolvePoolBoundKey, writeBoundAccountError, writeError };
|