@omnicross/core 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApiConverter.cjs +2 -2
- package/dist/ApiConverter.js +1 -1
- package/dist/{CompletionService-DdWaAxq0.d.ts → CompletionService-C3BX0Ovy.d.ts} +4 -3
- package/dist/{CompletionService-D3a47vdU.d.cts → CompletionService-kNA17cfI.d.cts} +4 -3
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +8 -6
- package/dist/auth/GeminiCodeAssistProjectResolver.js +6 -4
- package/dist/{chunk-3Z5BQZFM.cjs → chunk-235MXAGX.cjs} +3 -1
- package/dist/{chunk-HRRYG2AX.js → chunk-23S5OPIO.js} +10 -1
- package/dist/chunk-25GXJCEZ.cjs +40 -0
- package/dist/chunk-2E42SAW3.cjs +323 -0
- package/dist/chunk-2JYRIADS.js +40 -0
- package/dist/chunk-2Z4XM3H5.cjs +44 -0
- package/dist/{chunk-BODMAL6G.js → chunk-32O35CIF.js} +271 -91
- package/dist/chunk-3SCOLIPT.cjs +63 -0
- package/dist/{chunk-SYQF7OIR.js → chunk-3WD4HTR2.js} +2 -0
- package/dist/{chunk-CGKLE6IW.cjs → chunk-4BB343BI.cjs} +1489 -520
- package/dist/{chunk-VACWOIRE.cjs → chunk-4VZX5F4T.cjs} +39 -15
- package/dist/{chunk-5ZQBEOMD.js → chunk-5NJLQ6T6.js} +46 -12
- package/dist/chunk-5RSZYQJH.cjs +62 -0
- package/dist/chunk-6QQG7YG3.cjs +153 -0
- package/dist/{chunk-IFXJ2BG7.js → chunk-7C7DET6S.js} +51 -6
- package/dist/{chunk-IK3KE3AU.js → chunk-DE2SRBFZ.js} +1 -1
- package/dist/{chunk-FH2P4OCD.js → chunk-E3COOKUP.js} +1240 -271
- package/dist/{chunk-UHGVBFU3.js → chunk-EBLFCNPY.js} +38 -14
- package/dist/chunk-FU7EAR73.js +62 -0
- package/dist/chunk-FXR6N3SR.js +323 -0
- package/dist/{chunk-SUEGJ75D.cjs → chunk-GDIXXKF2.cjs} +46 -12
- package/dist/chunk-GFIZ6LQI.js +170 -0
- package/dist/chunk-GL6XM527.js +61 -0
- package/dist/chunk-HVBBDBS3.cjs +350 -0
- package/dist/{chunk-46ZIFWYG.cjs → chunk-IIRPUVPH.cjs} +7 -1
- package/dist/chunk-J3QQ6JS5.cjs +170 -0
- package/dist/{chunk-JWVTXXPX.cjs → chunk-KBM2W6UY.cjs} +8 -4
- package/dist/chunk-LB6EBS6Y.js +69 -0
- package/dist/{chunk-IWQAX3CS.js → chunk-LVUCAWMK.js} +1 -1
- package/dist/chunk-MKF46GNZ.js +350 -0
- package/dist/{chunk-HYN75H6G.cjs → chunk-MUHWHQVM.cjs} +1 -1
- package/dist/chunk-MYYR3HZL.js +44 -0
- package/dist/{chunk-MFZ5437A.js → chunk-N5T4M4GU.js} +1 -1
- package/dist/{chunk-5ENKBSWO.js → chunk-N7OOJI5V.js} +88 -8
- package/dist/chunk-NKVZ6Z3Y.cjs +61 -0
- package/dist/chunk-OF3BECU2.cjs +69 -0
- package/dist/{chunk-SNYBEXLB.cjs → chunk-OJGQKHN5.cjs} +3 -1
- package/dist/{chunk-DDMRUL76.cjs → chunk-OKMJLEXX.cjs} +5 -5
- package/dist/chunk-OPRS4IQZ.js +153 -0
- package/dist/chunk-OTZC4TNH.cjs +79 -0
- package/dist/{chunk-3Q6Z6JTO.cjs → chunk-OVQBNVSV.cjs} +287 -107
- package/dist/{chunk-4XMYPW46.cjs → chunk-OXHNSZ53.cjs} +84 -44
- package/dist/{chunk-C6OV7GCC.js → chunk-PEGTIPB3.js} +52 -12
- package/dist/chunk-PO3XB56Z.js +79 -0
- package/dist/{chunk-D3TDKWRP.js → chunk-RJ5ZGNI3.js} +54 -5
- package/dist/{chunk-PG7PS2NN.cjs → chunk-RJUONLUQ.cjs} +59 -10
- package/dist/{chunk-BPKCU575.js → chunk-SOO562NM.js} +3 -1
- package/dist/{chunk-6QZGDLL4.js → chunk-TOVPMMHM.js} +5 -1
- package/dist/{chunk-K52THW2C.cjs → chunk-V4TXMEJS.cjs} +5 -5
- package/dist/{chunk-G2UTNSGU.js → chunk-WNKWAEUR.js} +7 -1
- package/dist/{chunk-UNWKG6EI.cjs → chunk-XPIOJQS2.cjs} +51 -6
- package/dist/chunk-XXFYLL7R.js +63 -0
- package/dist/{chunk-KFI44N2R.cjs → chunk-YNJNTCSQ.cjs} +10 -1
- package/dist/{chunk-VQY5W4YW.cjs → chunk-YWL7YZWS.cjs} +90 -10
- package/dist/completion/ApiKeyPoolService.cjs +12 -0
- package/dist/completion/ApiKeyPoolService.d.cts +6 -0
- package/dist/completion/ApiKeyPoolService.d.ts +6 -0
- package/dist/completion/ApiKeyPoolService.js +12 -0
- package/dist/completion/CompletionService.cjs +30 -24
- package/dist/completion/CompletionService.d.cts +3 -1
- package/dist/completion/CompletionService.d.ts +3 -1
- package/dist/completion/CompletionService.js +29 -23
- package/dist/completion.cjs +32 -26
- package/dist/completion.d.cts +3 -1
- package/dist/completion.d.ts +3 -1
- package/dist/completion.js +31 -25
- package/dist/index.cjs +56 -29
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +61 -34
- package/dist/{keyPolicy-Cp0FntZl.d.cts → keyPolicy-zdWTu3CQ.d.cts} +1 -1
- package/dist/{keyPolicy-Cp0FntZl.d.ts → keyPolicy-zdWTu3CQ.d.ts} +1 -1
- package/dist/outbound-api/auditCapture.cjs +2 -2
- package/dist/outbound-api/auditCapture.d.cts +3 -4
- package/dist/outbound-api/auditCapture.d.ts +3 -4
- package/dist/outbound-api/auditCapture.js +1 -1
- package/dist/outbound-api/quotaWarn.d.cts +1 -1
- package/dist/outbound-api/quotaWarn.d.ts +1 -1
- package/dist/outbound-api/routeResolver.cjs +2 -2
- package/dist/outbound-api/routeResolver.d.cts +5 -3
- package/dist/outbound-api/routeResolver.d.ts +5 -3
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.cts +2 -0
- package/dist/outbound-api/subscriptionRegistryPort.d.ts +2 -0
- package/dist/outbound-api/types.d.cts +4 -2
- package/dist/outbound-api/types.d.ts +4 -2
- package/dist/outbound-api.cjs +52 -25
- package/dist/outbound-api.d.cts +131 -87
- package/dist/outbound-api.d.ts +131 -87
- package/dist/outbound-api.js +55 -28
- package/dist/pipeline/AccountAllowanceScheduling.cjs +15 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +91 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +91 -0
- package/dist/pipeline/AccountAllowanceScheduling.js +15 -0
- package/dist/pipeline/AccountAllowanceStore.cjs +20 -0
- package/dist/pipeline/AccountAllowanceStore.d.cts +77 -0
- package/dist/pipeline/AccountAllowanceStore.d.ts +77 -0
- package/dist/pipeline/AccountAllowanceStore.js +20 -0
- package/dist/pipeline/AccountRouteActivity.cjs +10 -0
- package/dist/pipeline/AccountRouteActivity.d.cts +61 -0
- package/dist/pipeline/AccountRouteActivity.d.ts +61 -0
- package/dist/pipeline/AccountRouteActivity.js +10 -0
- package/dist/pipeline/AuthSource.d.cts +11 -2
- package/dist/pipeline/AuthSource.d.ts +11 -2
- package/dist/pipeline/BoundAccountSelectionError.cjs +10 -0
- package/dist/pipeline/BoundAccountSelectionError.d.cts +28 -0
- package/dist/pipeline/BoundAccountSelectionError.d.ts +28 -0
- package/dist/pipeline/BoundAccountSelectionError.js +10 -0
- package/dist/pipeline/LlmConfigProviderAuth.d.cts +1 -0
- package/dist/pipeline/LlmConfigProviderAuth.d.ts +1 -0
- package/dist/pipeline/ServerOverloadCounter.cjs +16 -0
- package/dist/pipeline/ServerOverloadCounter.d.cts +77 -0
- package/dist/pipeline/ServerOverloadCounter.d.ts +77 -0
- package/dist/pipeline/ServerOverloadCounter.js +16 -0
- package/dist/pipeline/SubscriptionAccountHealth.cjs +6 -2
- package/dist/pipeline/SubscriptionAccountHealth.d.cts +65 -8
- package/dist/pipeline/SubscriptionAccountHealth.d.ts +65 -8
- package/dist/pipeline/SubscriptionAccountHealth.js +5 -1
- package/dist/pipeline/SubscriptionAuthSource.cjs +5 -2
- package/dist/pipeline/SubscriptionAuthSource.d.cts +1 -0
- package/dist/pipeline/SubscriptionAuthSource.d.ts +1 -0
- package/dist/pipeline/SubscriptionAuthSource.js +4 -1
- package/dist/pipeline/SubscriptionAuthStrategy.d.cts +8 -3
- package/dist/pipeline/SubscriptionAuthStrategy.d.ts +8 -3
- package/dist/pipeline/executeProviderCall.cjs +2 -2
- package/dist/pipeline/executeProviderCall.d.cts +8 -3
- package/dist/pipeline/executeProviderCall.d.ts +8 -3
- package/dist/pipeline/executeProviderCall.js +1 -1
- package/dist/pipeline/resolveProviderChain.d.cts +2 -3
- package/dist/pipeline/resolveProviderChain.d.ts +2 -3
- package/dist/pipeline/resolveSubscriptionChain.d.cts +1 -0
- package/dist/pipeline/resolveSubscriptionChain.d.ts +1 -0
- package/dist/pipeline/upstreamFetch.cjs +5 -3
- package/dist/pipeline/upstreamFetch.d.cts +35 -6
- package/dist/pipeline/upstreamFetch.d.ts +35 -6
- package/dist/pipeline/upstreamFetch.js +4 -2
- package/dist/pipeline/upstreamTrace.cjs +4 -2
- package/dist/pipeline/upstreamTrace.d.cts +22 -8
- package/dist/pipeline/upstreamTrace.d.ts +22 -8
- package/dist/pipeline/upstreamTrace.js +3 -1
- package/dist/ports/pricing-store.d.cts +4 -3
- package/dist/ports/pricing-store.d.ts +4 -3
- package/dist/ports.d.cts +4 -3
- package/dist/ports.d.ts +4 -3
- package/dist/provider-proxy/ProviderProxy.cjs +30 -24
- package/dist/provider-proxy/ProviderProxy.d.cts +2 -0
- package/dist/provider-proxy/ProviderProxy.d.ts +2 -0
- package/dist/provider-proxy/ProviderProxy.js +29 -23
- package/dist/provider-proxy/identity/codexCliHeaders.cjs +10 -0
- package/dist/provider-proxy/identity/codexCliHeaders.d.cts +45 -0
- package/dist/provider-proxy/identity/codexCliHeaders.d.ts +45 -0
- package/dist/provider-proxy/identity/codexCliHeaders.js +10 -0
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +32 -24
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +44 -5
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +44 -5
- package/dist/provider-proxy/ingress/providerProxyShared.js +31 -23
- package/dist/provider-proxy/matchText.cjs +4 -2
- package/dist/provider-proxy/matchText.d.cts +39 -6
- package/dist/provider-proxy/matchText.d.ts +39 -6
- package/dist/provider-proxy/matchText.js +3 -1
- package/dist/provider-proxy/types.d.cts +35 -2
- package/dist/provider-proxy/types.d.ts +35 -2
- package/dist/provider-proxy.cjs +30 -24
- package/dist/provider-proxy.d.cts +2 -0
- package/dist/provider-proxy.d.ts +2 -0
- package/dist/provider-proxy.js +29 -23
- package/dist/{routeResolver-C4T7yClx.d.ts → routeResolver-BxOfunbm.d.ts} +1 -1
- package/dist/{routeResolver-CB3tvJKy.d.cts → routeResolver-D5OzD0iM.d.cts} +1 -1
- package/dist/transformer/TransformerChainExecutor.cjs +2 -2
- package/dist/transformer/TransformerChainExecutor.js +1 -1
- package/dist/transformer/transformers/AnthropicTransformer.cjs +3 -2
- package/dist/transformer/transformers/AnthropicTransformer.js +2 -1
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +2 -2
- package/dist/transformer/transformers/GeminiTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiTransformer.js +2 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.cts +1 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.ts +1 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -1
- package/dist/transformer/transformers/OpenAITransformer.cjs +6 -0
- package/dist/transformer/transformers/OpenAITransformer.d.cts +68 -0
- package/dist/transformer/transformers/OpenAITransformer.d.ts +68 -0
- package/dist/transformer/transformers/OpenAITransformer.js +6 -0
- package/dist/transformer/transformers.cjs +9 -14
- package/dist/transformer/transformers.d.cts +12 -48
- package/dist/transformer/transformers.d.ts +12 -48
- package/dist/transformer/transformers.js +11 -16
- package/dist/transformer/types.d.cts +17 -0
- package/dist/transformer/types.d.ts +17 -0
- package/dist/transformer.cjs +12 -12
- package/dist/transformer.d.cts +1 -2
- package/dist/transformer.d.ts +1 -2
- package/dist/transformer.js +12 -12
- package/dist/{types-lgPYQuZS.d.ts → types-CqZD77rS.d.ts} +173 -7
- package/dist/{types-B8Arpxn0.d.cts → types-gjJ5lJ5n.d.cts} +173 -7
- package/dist/usage/pricing-engine.cjs +2 -2
- package/dist/usage/pricing-engine.d.cts +29 -1
- package/dist/usage/pricing-engine.d.ts +29 -1
- package/dist/usage/pricing-engine.js +1 -1
- package/dist/usage/usage-recorder.cjs +2 -2
- package/dist/usage/usage-recorder.d.cts +5 -1
- package/dist/usage/usage-recorder.d.ts +5 -1
- package/dist/usage/usage-recorder.js +1 -1
- package/dist/usage.cjs +3 -3
- package/dist/usage.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-7FEBOPJO.cjs +0 -50
- package/dist/chunk-DWKQZ2SK.cjs +0 -254
- package/dist/chunk-IAXWICZU.js +0 -69
- package/dist/chunk-IB3FDI4O.js +0 -50
- package/dist/chunk-OQWKZCXP.js +0 -242
- package/dist/chunk-QWBWGODS.cjs +0 -69
- package/dist/chunk-YMFAJFQT.cjs +0 -173
- package/dist/chunk-ZCIQ3L3R.cjs +0 -242
- package/dist/chunk-ZJZAOKI7.js +0 -254
- package/dist/chunk-ZLX3KGXX.js +0 -173
- package/dist/transformer/transformers/OpenCodeGoTransformer.cjs +0 -6
- package/dist/transformer/transformers/OpenCodeGoTransformer.d.cts +0 -51
- package/dist/transformer/transformers/OpenCodeGoTransformer.d.ts +0 -51
- package/dist/transformer/transformers/OpenCodeGoTransformer.js +0 -6
- package/dist/transformer/transformers/ReasoningTransformer.cjs +0 -6
- package/dist/transformer/transformers/ReasoningTransformer.d.cts +0 -47
- package/dist/transformer/transformers/ReasoningTransformer.d.ts +0 -47
- package/dist/transformer/transformers/ReasoningTransformer.js +0 -6
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('../../chunk-
|
|
6
|
+
var _chunkOKMJLEXXcjs = require('../../chunk-OKMJLEXX.cjs');
|
|
7
|
+
require('../../chunk-KBM2W6UY.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.GeminiCodeAssistTransformer =
|
|
13
|
+
exports.GeminiCodeAssistTransformer = _chunkOKMJLEXXcjs.GeminiCodeAssistTransformer; exports.buildCodeAssistUrl = _chunkOKMJLEXXcjs.buildCodeAssistUrl; exports.resolveCodeAssistApiVersion = _chunkOKMJLEXXcjs.resolveCodeAssistApiVersion; exports.resolveCodeAssistEndpoint = _chunkOKMJLEXXcjs.resolveCodeAssistEndpoint;
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
buildCodeAssistUrl,
|
|
4
4
|
resolveCodeAssistApiVersion,
|
|
5
5
|
resolveCodeAssistEndpoint
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-N5T4M4GU.js";
|
|
7
|
+
import "../../chunk-TOVPMMHM.js";
|
|
8
8
|
export {
|
|
9
9
|
GeminiCodeAssistTransformer,
|
|
10
10
|
buildCodeAssistUrl,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var _chunkV4TXMEJScjs = require('../../chunk-V4TXMEJS.cjs');
|
|
4
|
+
require('../../chunk-KBM2W6UY.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.GeminiTransformer =
|
|
7
|
+
exports.GeminiTransformer = _chunkV4TXMEJScjs.GeminiTransformer;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkOVQBNVSVcjs = require('../../chunk-OVQBNVSV.cjs');
|
|
4
|
+
require('../../chunk-5RSZYQJH.cjs');
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
exports.OpenAIResponseTransformer =
|
|
7
|
+
exports.OpenAIResponseTransformer = _chunkOVQBNVSVcjs.OpenAIResponseTransformer;
|
|
@@ -47,7 +47,7 @@ declare class OpenAIResponseTransformer implements Transformer {
|
|
|
47
47
|
/**
|
|
48
48
|
* Transform OpenAI CC response → Response API format
|
|
49
49
|
*/
|
|
50
|
-
transformResponseIn(response: Response,
|
|
50
|
+
transformResponseIn(response: Response, context?: TransformerContext): Promise<Response>;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export { OpenAIResponseTransformer };
|
|
@@ -47,7 +47,7 @@ declare class OpenAIResponseTransformer implements Transformer {
|
|
|
47
47
|
/**
|
|
48
48
|
* Transform OpenAI CC response → Response API format
|
|
49
49
|
*/
|
|
50
|
-
transformResponseIn(response: Response,
|
|
50
|
+
transformResponseIn(response: Response, context?: TransformerContext): Promise<Response>;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export { OpenAIResponseTransformer };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Transformer, TransformerLogger, UnifiedChatRequest, LLMProvider, TransformerContext } from '../types.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OpenAITransformer — the format-axis encoder for OpenAI Chat Completions
|
|
5
|
+
* upstreams.
|
|
6
|
+
*
|
|
7
|
+
* This is the fourth format transformer, alongside `anthropic`, `gemini`, and
|
|
8
|
+
* `openai-response`. It exists because `Unified` is OpenAI-chat-*shaped* but is
|
|
9
|
+
* NOT byte-identical to the OpenAI chat wire: an endpoint decoder can attach
|
|
10
|
+
* fields that only Anthropic understands, and the pipeline threads internal
|
|
11
|
+
* routing state through the same object. Before this transformer the `openai`
|
|
12
|
+
* format had NO encoder (`getMainTransformer` returned `null`), so every one of
|
|
13
|
+
* those leaks had to be patched per-vendor — `DeepseekTransformer` and
|
|
14
|
+
* `OpenCodeGoTransformer` were two copies of the same sanitizer, and every other
|
|
15
|
+
* OpenAI provider got no sanitizing at all.
|
|
16
|
+
*
|
|
17
|
+
* ## Request (Unified → OpenAI chat wire)
|
|
18
|
+
*
|
|
19
|
+
* BLACKLIST, not whitelist. Only known-foreign fields are touched; everything
|
|
20
|
+
* else passes through verbatim. A whitelist would silently drop the parameters
|
|
21
|
+
* the chat wire legitimately carries but `UnifiedChatRequest` never declared —
|
|
22
|
+
* `top_p`, `seed`, `stop`, `response_format`, `logprobs`, and in particular
|
|
23
|
+
* `stream_options.include_usage`, which is the ONLY reason a chat stream emits
|
|
24
|
+
* a final `usage` chunk (see `openaiChatIngress`'s usage tap). Dropping it would
|
|
25
|
+
* silently zero out streaming usage for every OpenAI provider.
|
|
26
|
+
*
|
|
27
|
+
* - `meta` (top level) — internal routing metadata; `UnifiedChatRequest.meta`
|
|
28
|
+
* documents that it must never be serialised.
|
|
29
|
+
* - `reasoning` (top level) — encoded as `reasoning_effort`.
|
|
30
|
+
* - `thinking` (top level) — Anthropic-shaped; the Anthropic decoder already
|
|
31
|
+
* turned the client's `thinking` into `reasoning`, so any survivor here is
|
|
32
|
+
* residue.
|
|
33
|
+
* - `cache_control` (per message, and inside text content blocks) — an
|
|
34
|
+
* Anthropic prompt-caching marker with no OpenAI-chat equivalent.
|
|
35
|
+
* - `thinking` (per message) — ENCODED, not dropped, as `reasoning_content`.
|
|
36
|
+
* Assistant turns carry prior reasoning that a reasoning upstream requires
|
|
37
|
+
* echoed back on the next tool-result turn; dropping it yields a 400
|
|
38
|
+
* ("reasoning_content must be passed back") on multi-round tool calls. The
|
|
39
|
+
* Anthropic `signature` has no chat-wire representation and is dropped.
|
|
40
|
+
*
|
|
41
|
+
* ## Response (OpenAI chat wire → Unified)
|
|
42
|
+
*
|
|
43
|
+
* Identity. On the `/v1/chat/completions` ingress the client wire IS Unified and
|
|
44
|
+
* there is no endpoint transformer to re-encode, so rewriting `reasoning_content`
|
|
45
|
+
* here would hand an OpenAI SDK a field it cannot read. `reasoning_content`
|
|
46
|
+
* therefore stays the Unified spelling on this path, which is what the Anthropic
|
|
47
|
+
* encoder (`convertOpenAIStreamToAnthropic`) already looks for.
|
|
48
|
+
*
|
|
49
|
+
* @module transformer/transformers/OpenAITransformer
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
declare class OpenAITransformer implements Transformer {
|
|
53
|
+
static TransformerName: string;
|
|
54
|
+
name: string;
|
|
55
|
+
endPoint: string;
|
|
56
|
+
logger?: TransformerLogger;
|
|
57
|
+
/**
|
|
58
|
+
* Unified → OpenAI Chat Completions.
|
|
59
|
+
*/
|
|
60
|
+
transformRequestIn(request: UnifiedChatRequest, _provider: LLMProvider, _context: TransformerContext): Promise<Record<string, unknown>>;
|
|
61
|
+
/**
|
|
62
|
+
* OpenAI Chat Completions → Unified. Identity — see the module JSDoc for why
|
|
63
|
+
* `reasoning_content` is NOT rewritten here.
|
|
64
|
+
*/
|
|
65
|
+
transformResponseOut(response: Response, _context: TransformerContext): Promise<Response>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { OpenAITransformer };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Transformer, TransformerLogger, UnifiedChatRequest, LLMProvider, TransformerContext } from '../types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OpenAITransformer — the format-axis encoder for OpenAI Chat Completions
|
|
5
|
+
* upstreams.
|
|
6
|
+
*
|
|
7
|
+
* This is the fourth format transformer, alongside `anthropic`, `gemini`, and
|
|
8
|
+
* `openai-response`. It exists because `Unified` is OpenAI-chat-*shaped* but is
|
|
9
|
+
* NOT byte-identical to the OpenAI chat wire: an endpoint decoder can attach
|
|
10
|
+
* fields that only Anthropic understands, and the pipeline threads internal
|
|
11
|
+
* routing state through the same object. Before this transformer the `openai`
|
|
12
|
+
* format had NO encoder (`getMainTransformer` returned `null`), so every one of
|
|
13
|
+
* those leaks had to be patched per-vendor — `DeepseekTransformer` and
|
|
14
|
+
* `OpenCodeGoTransformer` were two copies of the same sanitizer, and every other
|
|
15
|
+
* OpenAI provider got no sanitizing at all.
|
|
16
|
+
*
|
|
17
|
+
* ## Request (Unified → OpenAI chat wire)
|
|
18
|
+
*
|
|
19
|
+
* BLACKLIST, not whitelist. Only known-foreign fields are touched; everything
|
|
20
|
+
* else passes through verbatim. A whitelist would silently drop the parameters
|
|
21
|
+
* the chat wire legitimately carries but `UnifiedChatRequest` never declared —
|
|
22
|
+
* `top_p`, `seed`, `stop`, `response_format`, `logprobs`, and in particular
|
|
23
|
+
* `stream_options.include_usage`, which is the ONLY reason a chat stream emits
|
|
24
|
+
* a final `usage` chunk (see `openaiChatIngress`'s usage tap). Dropping it would
|
|
25
|
+
* silently zero out streaming usage for every OpenAI provider.
|
|
26
|
+
*
|
|
27
|
+
* - `meta` (top level) — internal routing metadata; `UnifiedChatRequest.meta`
|
|
28
|
+
* documents that it must never be serialised.
|
|
29
|
+
* - `reasoning` (top level) — encoded as `reasoning_effort`.
|
|
30
|
+
* - `thinking` (top level) — Anthropic-shaped; the Anthropic decoder already
|
|
31
|
+
* turned the client's `thinking` into `reasoning`, so any survivor here is
|
|
32
|
+
* residue.
|
|
33
|
+
* - `cache_control` (per message, and inside text content blocks) — an
|
|
34
|
+
* Anthropic prompt-caching marker with no OpenAI-chat equivalent.
|
|
35
|
+
* - `thinking` (per message) — ENCODED, not dropped, as `reasoning_content`.
|
|
36
|
+
* Assistant turns carry prior reasoning that a reasoning upstream requires
|
|
37
|
+
* echoed back on the next tool-result turn; dropping it yields a 400
|
|
38
|
+
* ("reasoning_content must be passed back") on multi-round tool calls. The
|
|
39
|
+
* Anthropic `signature` has no chat-wire representation and is dropped.
|
|
40
|
+
*
|
|
41
|
+
* ## Response (OpenAI chat wire → Unified)
|
|
42
|
+
*
|
|
43
|
+
* Identity. On the `/v1/chat/completions` ingress the client wire IS Unified and
|
|
44
|
+
* there is no endpoint transformer to re-encode, so rewriting `reasoning_content`
|
|
45
|
+
* here would hand an OpenAI SDK a field it cannot read. `reasoning_content`
|
|
46
|
+
* therefore stays the Unified spelling on this path, which is what the Anthropic
|
|
47
|
+
* encoder (`convertOpenAIStreamToAnthropic`) already looks for.
|
|
48
|
+
*
|
|
49
|
+
* @module transformer/transformers/OpenAITransformer
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
declare class OpenAITransformer implements Transformer {
|
|
53
|
+
static TransformerName: string;
|
|
54
|
+
name: string;
|
|
55
|
+
endPoint: string;
|
|
56
|
+
logger?: TransformerLogger;
|
|
57
|
+
/**
|
|
58
|
+
* Unified → OpenAI Chat Completions.
|
|
59
|
+
*/
|
|
60
|
+
transformRequestIn(request: UnifiedChatRequest, _provider: LLMProvider, _context: TransformerContext): Promise<Record<string, unknown>>;
|
|
61
|
+
/**
|
|
62
|
+
* OpenAI Chat Completions → Unified. Identity — see the module JSDoc for why
|
|
63
|
+
* `reasoning_content` is NOT rewritten here.
|
|
64
|
+
*/
|
|
65
|
+
transformResponseOut(response: Response, _context: TransformerContext): Promise<Response>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { OpenAITransformer };
|
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunk2Z4XM3H5cjs = require('../chunk-2Z4XM3H5.cjs');
|
|
6
7
|
|
|
7
|
-
var _chunkZCIQ3L3Rcjs = require('../chunk-ZCIQ3L3R.cjs');
|
|
8
8
|
|
|
9
|
+
var _chunkOXHNSZ53cjs = require('../chunk-OXHNSZ53.cjs');
|
|
9
10
|
|
|
10
|
-
var _chunk7FEBOPJOcjs = require('../chunk-7FEBOPJO.cjs');
|
|
11
11
|
|
|
12
|
+
var _chunkV4TXMEJScjs = require('../chunk-V4TXMEJS.cjs');
|
|
12
13
|
|
|
13
|
-
var _chunkDWKQZ2SKcjs = require('../chunk-DWKQZ2SK.cjs');
|
|
14
14
|
|
|
15
|
+
var _chunkOVQBNVSVcjs = require('../chunk-OVQBNVSV.cjs');
|
|
16
|
+
require('../chunk-5RSZYQJH.cjs');
|
|
15
17
|
|
|
16
|
-
var _chunk4XMYPW46cjs = require('../chunk-4XMYPW46.cjs');
|
|
17
18
|
|
|
19
|
+
var _chunkOF3BECU2cjs = require('../chunk-OF3BECU2.cjs');
|
|
18
20
|
|
|
19
|
-
var _chunkK52THW2Ccjs = require('../chunk-K52THW2C.cjs');
|
|
20
21
|
|
|
22
|
+
var _chunkOKMJLEXXcjs = require('../chunk-OKMJLEXX.cjs');
|
|
23
|
+
require('../chunk-KBM2W6UY.cjs');
|
|
21
24
|
|
|
22
|
-
var _chunk3Q6Z6JTOcjs = require('../chunk-3Q6Z6JTO.cjs');
|
|
23
25
|
|
|
24
26
|
|
|
25
|
-
var _chunkDDMRUL76cjs = require('../chunk-DDMRUL76.cjs');
|
|
26
|
-
require('../chunk-JWVTXXPX.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -31,9 +31,4 @@ require('../chunk-JWVTXXPX.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
exports.AnthropicTransformer = _chunk4XMYPW46cjs.AnthropicTransformer; exports.BUILTIN_TRANSFORMER_NAMES = _chunkZCIQ3L3Rcjs.BUILTIN_TRANSFORMER_NAMES; exports.BuiltinTransformers = _chunkZCIQ3L3Rcjs.BuiltinTransformers; exports.DeepseekTransformer = _chunkZCIQ3L3Rcjs.DeepseekTransformer; exports.GeminiCodeAssistTransformer = _chunkDDMRUL76cjs.GeminiCodeAssistTransformer; exports.GeminiTransformer = _chunkK52THW2Ccjs.GeminiTransformer; exports.OpenAIResponseTransformer = _chunk3Q6Z6JTOcjs.OpenAIResponseTransformer; exports.OpenCodeGoTransformer = _chunk7FEBOPJOcjs.OpenCodeGoTransformer; exports.ReasoningTransformer = _chunkDWKQZ2SKcjs.ReasoningTransformer; exports.getBuiltinTransformers = _chunkZCIQ3L3Rcjs.getBuiltinTransformers; exports.registerBuiltinTransformers = _chunkZCIQ3L3Rcjs.registerBuiltinTransformers;
|
|
34
|
+
exports.AnthropicTransformer = _chunkOXHNSZ53cjs.AnthropicTransformer; exports.BUILTIN_TRANSFORMER_NAMES = _chunk2Z4XM3H5cjs.BUILTIN_TRANSFORMER_NAMES; exports.BuiltinTransformers = _chunk2Z4XM3H5cjs.BuiltinTransformers; exports.GeminiCodeAssistTransformer = _chunkOKMJLEXXcjs.GeminiCodeAssistTransformer; exports.GeminiTransformer = _chunkV4TXMEJScjs.GeminiTransformer; exports.OpenAIResponseTransformer = _chunkOVQBNVSVcjs.OpenAIResponseTransformer; exports.OpenAITransformer = _chunkOF3BECU2cjs.OpenAITransformer; exports.getBuiltinTransformers = _chunk2Z4XM3H5cjs.getBuiltinTransformers; exports.registerBuiltinTransformers = _chunk2Z4XM3H5cjs.registerBuiltinTransformers;
|
|
@@ -1,51 +1,10 @@
|
|
|
1
1
|
import { TransformerService } from './TransformerService.cjs';
|
|
2
2
|
import { AnthropicTransformer } from './transformers/AnthropicTransformer.cjs';
|
|
3
|
-
import { Transformer, TransformerLogger, UnifiedChatRequest, LLMProvider, TransformerContext } from './types.cjs';
|
|
4
3
|
import { GeminiCodeAssistTransformer } from './transformers/GeminiCodeAssistTransformer.cjs';
|
|
5
4
|
import { GeminiTransformer } from './transformers/GeminiTransformer.cjs';
|
|
6
5
|
import { OpenAIResponseTransformer } from './transformers/OpenAIResponseTransformer.cjs';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* DeepseekTransformer - Transformer for DeepSeek API compatibility
|
|
12
|
-
*
|
|
13
|
-
* Handles:
|
|
14
|
-
* - max_tokens limit (8192 max for DeepSeek)
|
|
15
|
-
* - reasoning_content → thinking block conversion in streams
|
|
16
|
-
*
|
|
17
|
-
* @module transformer/transformers/DeepseekTransformer
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* DeepseekTransformer handles DeepSeek-specific API adaptations
|
|
22
|
-
*
|
|
23
|
-
* Features:
|
|
24
|
-
* - Limits max_tokens to 8192 (DeepSeek API constraint)
|
|
25
|
-
* - Converts reasoning_content in stream responses to thinking blocks
|
|
26
|
-
*/
|
|
27
|
-
declare class DeepseekTransformer implements Transformer {
|
|
28
|
-
static TransformerName: string;
|
|
29
|
-
name: string;
|
|
30
|
-
logger?: TransformerLogger;
|
|
31
|
-
/**
|
|
32
|
-
* Transform request: limit max_tokens to 8192 for legacy models only
|
|
33
|
-
* V4 models support up to 384K output tokens
|
|
34
|
-
*/
|
|
35
|
-
transformRequestIn(request: UnifiedChatRequest, _provider: LLMProvider, _context: TransformerContext): Promise<Record<string, unknown>>;
|
|
36
|
-
/**
|
|
37
|
-
* Transform response: convert reasoning_content to thinking blocks
|
|
38
|
-
*/
|
|
39
|
-
transformResponseOut(response: Response, _context: TransformerContext): Promise<Response>;
|
|
40
|
-
/**
|
|
41
|
-
* Handle JSON (non-streaming) response
|
|
42
|
-
*/
|
|
43
|
-
private handleJsonResponse;
|
|
44
|
-
/**
|
|
45
|
-
* Handle streaming response - convert reasoning_content to thinking blocks
|
|
46
|
-
*/
|
|
47
|
-
private handleStreamResponse;
|
|
48
|
-
}
|
|
6
|
+
import { OpenAITransformer } from './transformers/OpenAITransformer.cjs';
|
|
7
|
+
import './types.cjs';
|
|
49
8
|
|
|
50
9
|
/**
|
|
51
10
|
* Transformer Registry
|
|
@@ -58,15 +17,20 @@ declare class DeepseekTransformer implements Transformer {
|
|
|
58
17
|
/**
|
|
59
18
|
* Map of all built-in transformers
|
|
60
19
|
* Used for automatic registration with TransformerService
|
|
20
|
+
*
|
|
21
|
+
* This is the FORMAT axis — one encoder per upstream wire, selected by a
|
|
22
|
+
* provider row's `apiFormat` (plus `gemini-code-assist`, the Code-Assist
|
|
23
|
+
* subscription's variant of the Gemini wire). The MODIFIER axis (`maxtoken`,
|
|
24
|
+
* `sampling`, `reasoning`, …) is a separate, currently-unimplemented surface:
|
|
25
|
+
* those names are declared in the UI, round-trip through config, and are warned
|
|
26
|
+
* + skipped at resolve time until something implements them.
|
|
61
27
|
*/
|
|
62
28
|
declare const BuiltinTransformers: {
|
|
63
|
-
readonly
|
|
64
|
-
readonly ReasoningTransformer: typeof ReasoningTransformer;
|
|
29
|
+
readonly OpenAITransformer: typeof OpenAITransformer;
|
|
65
30
|
readonly GeminiTransformer: typeof GeminiTransformer;
|
|
66
31
|
readonly GeminiCodeAssistTransformer: typeof GeminiCodeAssistTransformer;
|
|
67
32
|
readonly AnthropicTransformer: typeof AnthropicTransformer;
|
|
68
33
|
readonly OpenAIResponseTransformer: typeof OpenAIResponseTransformer;
|
|
69
|
-
readonly OpenCodeGoTransformer: typeof OpenCodeGoTransformer;
|
|
70
34
|
};
|
|
71
35
|
/**
|
|
72
36
|
* Get all built-in transformer constructors
|
|
@@ -75,7 +39,7 @@ declare function getBuiltinTransformers(): typeof BuiltinTransformers;
|
|
|
75
39
|
/**
|
|
76
40
|
* List of built-in transformer names
|
|
77
41
|
*/
|
|
78
|
-
declare const BUILTIN_TRANSFORMER_NAMES: readonly ["
|
|
42
|
+
declare const BUILTIN_TRANSFORMER_NAMES: readonly ["openai", "gemini", "gemini-code-assist", "anthropic", "openai-response"];
|
|
79
43
|
type BuiltinTransformerName = (typeof BUILTIN_TRANSFORMER_NAMES)[number];
|
|
80
44
|
/**
|
|
81
45
|
* Single self-registration entry point for the built-in transformer set.
|
|
@@ -97,4 +61,4 @@ type BuiltinTransformerName = (typeof BUILTIN_TRANSFORMER_NAMES)[number];
|
|
|
97
61
|
*/
|
|
98
62
|
declare function registerBuiltinTransformers(service: TransformerService): Promise<void>;
|
|
99
63
|
|
|
100
|
-
export { AnthropicTransformer, BUILTIN_TRANSFORMER_NAMES, type BuiltinTransformerName, BuiltinTransformers,
|
|
64
|
+
export { AnthropicTransformer, BUILTIN_TRANSFORMER_NAMES, type BuiltinTransformerName, BuiltinTransformers, GeminiCodeAssistTransformer, GeminiTransformer, OpenAIResponseTransformer, OpenAITransformer, getBuiltinTransformers, registerBuiltinTransformers };
|
|
@@ -1,51 +1,10 @@
|
|
|
1
1
|
import { TransformerService } from './TransformerService.js';
|
|
2
2
|
import { AnthropicTransformer } from './transformers/AnthropicTransformer.js';
|
|
3
|
-
import { Transformer, TransformerLogger, UnifiedChatRequest, LLMProvider, TransformerContext } from './types.js';
|
|
4
3
|
import { GeminiCodeAssistTransformer } from './transformers/GeminiCodeAssistTransformer.js';
|
|
5
4
|
import { GeminiTransformer } from './transformers/GeminiTransformer.js';
|
|
6
5
|
import { OpenAIResponseTransformer } from './transformers/OpenAIResponseTransformer.js';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* DeepseekTransformer - Transformer for DeepSeek API compatibility
|
|
12
|
-
*
|
|
13
|
-
* Handles:
|
|
14
|
-
* - max_tokens limit (8192 max for DeepSeek)
|
|
15
|
-
* - reasoning_content → thinking block conversion in streams
|
|
16
|
-
*
|
|
17
|
-
* @module transformer/transformers/DeepseekTransformer
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* DeepseekTransformer handles DeepSeek-specific API adaptations
|
|
22
|
-
*
|
|
23
|
-
* Features:
|
|
24
|
-
* - Limits max_tokens to 8192 (DeepSeek API constraint)
|
|
25
|
-
* - Converts reasoning_content in stream responses to thinking blocks
|
|
26
|
-
*/
|
|
27
|
-
declare class DeepseekTransformer implements Transformer {
|
|
28
|
-
static TransformerName: string;
|
|
29
|
-
name: string;
|
|
30
|
-
logger?: TransformerLogger;
|
|
31
|
-
/**
|
|
32
|
-
* Transform request: limit max_tokens to 8192 for legacy models only
|
|
33
|
-
* V4 models support up to 384K output tokens
|
|
34
|
-
*/
|
|
35
|
-
transformRequestIn(request: UnifiedChatRequest, _provider: LLMProvider, _context: TransformerContext): Promise<Record<string, unknown>>;
|
|
36
|
-
/**
|
|
37
|
-
* Transform response: convert reasoning_content to thinking blocks
|
|
38
|
-
*/
|
|
39
|
-
transformResponseOut(response: Response, _context: TransformerContext): Promise<Response>;
|
|
40
|
-
/**
|
|
41
|
-
* Handle JSON (non-streaming) response
|
|
42
|
-
*/
|
|
43
|
-
private handleJsonResponse;
|
|
44
|
-
/**
|
|
45
|
-
* Handle streaming response - convert reasoning_content to thinking blocks
|
|
46
|
-
*/
|
|
47
|
-
private handleStreamResponse;
|
|
48
|
-
}
|
|
6
|
+
import { OpenAITransformer } from './transformers/OpenAITransformer.js';
|
|
7
|
+
import './types.js';
|
|
49
8
|
|
|
50
9
|
/**
|
|
51
10
|
* Transformer Registry
|
|
@@ -58,15 +17,20 @@ declare class DeepseekTransformer implements Transformer {
|
|
|
58
17
|
/**
|
|
59
18
|
* Map of all built-in transformers
|
|
60
19
|
* Used for automatic registration with TransformerService
|
|
20
|
+
*
|
|
21
|
+
* This is the FORMAT axis — one encoder per upstream wire, selected by a
|
|
22
|
+
* provider row's `apiFormat` (plus `gemini-code-assist`, the Code-Assist
|
|
23
|
+
* subscription's variant of the Gemini wire). The MODIFIER axis (`maxtoken`,
|
|
24
|
+
* `sampling`, `reasoning`, …) is a separate, currently-unimplemented surface:
|
|
25
|
+
* those names are declared in the UI, round-trip through config, and are warned
|
|
26
|
+
* + skipped at resolve time until something implements them.
|
|
61
27
|
*/
|
|
62
28
|
declare const BuiltinTransformers: {
|
|
63
|
-
readonly
|
|
64
|
-
readonly ReasoningTransformer: typeof ReasoningTransformer;
|
|
29
|
+
readonly OpenAITransformer: typeof OpenAITransformer;
|
|
65
30
|
readonly GeminiTransformer: typeof GeminiTransformer;
|
|
66
31
|
readonly GeminiCodeAssistTransformer: typeof GeminiCodeAssistTransformer;
|
|
67
32
|
readonly AnthropicTransformer: typeof AnthropicTransformer;
|
|
68
33
|
readonly OpenAIResponseTransformer: typeof OpenAIResponseTransformer;
|
|
69
|
-
readonly OpenCodeGoTransformer: typeof OpenCodeGoTransformer;
|
|
70
34
|
};
|
|
71
35
|
/**
|
|
72
36
|
* Get all built-in transformer constructors
|
|
@@ -75,7 +39,7 @@ declare function getBuiltinTransformers(): typeof BuiltinTransformers;
|
|
|
75
39
|
/**
|
|
76
40
|
* List of built-in transformer names
|
|
77
41
|
*/
|
|
78
|
-
declare const BUILTIN_TRANSFORMER_NAMES: readonly ["
|
|
42
|
+
declare const BUILTIN_TRANSFORMER_NAMES: readonly ["openai", "gemini", "gemini-code-assist", "anthropic", "openai-response"];
|
|
79
43
|
type BuiltinTransformerName = (typeof BUILTIN_TRANSFORMER_NAMES)[number];
|
|
80
44
|
/**
|
|
81
45
|
* Single self-registration entry point for the built-in transformer set.
|
|
@@ -97,4 +61,4 @@ type BuiltinTransformerName = (typeof BUILTIN_TRANSFORMER_NAMES)[number];
|
|
|
97
61
|
*/
|
|
98
62
|
declare function registerBuiltinTransformers(service: TransformerService): Promise<void>;
|
|
99
63
|
|
|
100
|
-
export { AnthropicTransformer, BUILTIN_TRANSFORMER_NAMES, type BuiltinTransformerName, BuiltinTransformers,
|
|
64
|
+
export { AnthropicTransformer, BUILTIN_TRANSFORMER_NAMES, type BuiltinTransformerName, BuiltinTransformers, GeminiCodeAssistTransformer, GeminiTransformer, OpenAIResponseTransformer, OpenAITransformer, getBuiltinTransformers, registerBuiltinTransformers };
|
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BUILTIN_TRANSFORMER_NAMES,
|
|
3
3
|
BuiltinTransformers,
|
|
4
|
-
DeepseekTransformer,
|
|
5
4
|
getBuiltinTransformers,
|
|
6
5
|
registerBuiltinTransformers
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import {
|
|
9
|
-
OpenCodeGoTransformer
|
|
10
|
-
} from "../chunk-IB3FDI4O.js";
|
|
11
|
-
import {
|
|
12
|
-
ReasoningTransformer
|
|
13
|
-
} from "../chunk-ZJZAOKI7.js";
|
|
6
|
+
} from "../chunk-MYYR3HZL.js";
|
|
14
7
|
import {
|
|
15
8
|
AnthropicTransformer
|
|
16
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-PEGTIPB3.js";
|
|
17
10
|
import {
|
|
18
11
|
GeminiTransformer
|
|
19
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-LVUCAWMK.js";
|
|
20
13
|
import {
|
|
21
14
|
OpenAIResponseTransformer
|
|
22
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-32O35CIF.js";
|
|
16
|
+
import "../chunk-FU7EAR73.js";
|
|
17
|
+
import {
|
|
18
|
+
OpenAITransformer
|
|
19
|
+
} from "../chunk-LB6EBS6Y.js";
|
|
23
20
|
import {
|
|
24
21
|
GeminiCodeAssistTransformer
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import "../chunk-
|
|
22
|
+
} from "../chunk-N5T4M4GU.js";
|
|
23
|
+
import "../chunk-TOVPMMHM.js";
|
|
27
24
|
export {
|
|
28
25
|
AnthropicTransformer,
|
|
29
26
|
BUILTIN_TRANSFORMER_NAMES,
|
|
30
27
|
BuiltinTransformers,
|
|
31
|
-
DeepseekTransformer,
|
|
32
28
|
GeminiCodeAssistTransformer,
|
|
33
29
|
GeminiTransformer,
|
|
34
30
|
OpenAIResponseTransformer,
|
|
35
|
-
|
|
36
|
-
ReasoningTransformer,
|
|
31
|
+
OpenAITransformer,
|
|
37
32
|
getBuiltinTransformers,
|
|
38
33
|
registerBuiltinTransformers
|
|
39
34
|
};
|
|
@@ -145,6 +145,23 @@ interface UnifiedChatRequestMeta {
|
|
|
145
145
|
engineOrigin?: 'completion' | 'claude-sdk' | 'claude-sdk-direct' | 'codex-ingress' | (string & {});
|
|
146
146
|
/** The api-key-pool entry id selected for this request. */
|
|
147
147
|
apiKeyId?: string | null;
|
|
148
|
+
/**
|
|
149
|
+
* codex custom-tool protocol state, recorded while DECODING a Responses
|
|
150
|
+
* request and read back while ENCODING the response.
|
|
151
|
+
*
|
|
152
|
+
* codex declares its tools in an `additional_tools` input item, where one of
|
|
153
|
+
* them (`exec`) is a `custom` tool taking FREE-FORM text rather than JSON
|
|
154
|
+
* arguments, and others live under a `namespace`. Neither concept exists in
|
|
155
|
+
* OpenAI-chat, so the decode flattens them into plain function tools and
|
|
156
|
+
* records here what has to be restored on the way back: which names must be
|
|
157
|
+
* re-encoded as `custom_tool_call` items, and which carry a namespace.
|
|
158
|
+
*/
|
|
159
|
+
codexTools?: {
|
|
160
|
+
/** Tool names declared `type:'custom'` — re-encode as `custom_tool_call`. */
|
|
161
|
+
customToolNames?: string[];
|
|
162
|
+
/** Tool name → codex namespace, restored onto `function_call` items. */
|
|
163
|
+
toolNamespaces?: Record<string, string>;
|
|
164
|
+
};
|
|
148
165
|
}
|
|
149
166
|
/**
|
|
150
167
|
* URL citation annotation
|
|
@@ -145,6 +145,23 @@ interface UnifiedChatRequestMeta {
|
|
|
145
145
|
engineOrigin?: 'completion' | 'claude-sdk' | 'claude-sdk-direct' | 'codex-ingress' | (string & {});
|
|
146
146
|
/** The api-key-pool entry id selected for this request. */
|
|
147
147
|
apiKeyId?: string | null;
|
|
148
|
+
/**
|
|
149
|
+
* codex custom-tool protocol state, recorded while DECODING a Responses
|
|
150
|
+
* request and read back while ENCODING the response.
|
|
151
|
+
*
|
|
152
|
+
* codex declares its tools in an `additional_tools` input item, where one of
|
|
153
|
+
* them (`exec`) is a `custom` tool taking FREE-FORM text rather than JSON
|
|
154
|
+
* arguments, and others live under a `namespace`. Neither concept exists in
|
|
155
|
+
* OpenAI-chat, so the decode flattens them into plain function tools and
|
|
156
|
+
* records here what has to be restored on the way back: which names must be
|
|
157
|
+
* re-encoded as `custom_tool_call` items, and which carry a namespace.
|
|
158
|
+
*/
|
|
159
|
+
codexTools?: {
|
|
160
|
+
/** Tool names declared `type:'custom'` — re-encode as `custom_tool_call`. */
|
|
161
|
+
customToolNames?: string[];
|
|
162
|
+
/** Tool name → codex namespace, restored onto `function_call` items. */
|
|
163
|
+
toolNamespaces?: Record<string, string>;
|
|
164
|
+
};
|
|
148
165
|
}
|
|
149
166
|
/**
|
|
150
167
|
* URL citation annotation
|
package/dist/transformer.cjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-FZ46M34D.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk2Z4XM3H5cjs = require('./chunk-2Z4XM3H5.cjs');
|
|
5
|
+
require('./chunk-OXHNSZ53.cjs');
|
|
6
|
+
require('./chunk-V4TXMEJS.cjs');
|
|
7
|
+
require('./chunk-OVQBNVSV.cjs');
|
|
8
|
+
require('./chunk-5RSZYQJH.cjs');
|
|
9
|
+
require('./chunk-OF3BECU2.cjs');
|
|
5
10
|
|
|
6
11
|
|
|
7
|
-
var
|
|
12
|
+
var _chunkIIRPUVPHcjs = require('./chunk-IIRPUVPH.cjs');
|
|
13
|
+
require('./chunk-GBHYAGX3.cjs');
|
|
8
14
|
|
|
9
15
|
|
|
10
|
-
var
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-4XMYPW46.cjs');
|
|
14
|
-
require('./chunk-K52THW2C.cjs');
|
|
15
|
-
require('./chunk-3Q6Z6JTO.cjs');
|
|
16
|
-
require('./chunk-GBHYAGX3.cjs');
|
|
17
|
-
require('./chunk-DDMRUL76.cjs');
|
|
18
|
-
require('./chunk-JWVTXXPX.cjs');
|
|
16
|
+
var _chunk3OPYJG76cjs = require('./chunk-3OPYJG76.cjs');
|
|
17
|
+
require('./chunk-OKMJLEXX.cjs');
|
|
18
|
+
require('./chunk-KBM2W6UY.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
exports.TransformerChainExecutor =
|
|
23
|
+
exports.TransformerChainExecutor = _chunkIIRPUVPHcjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.registerBuiltinTransformers = _chunk2Z4XM3H5cjs.registerBuiltinTransformers;
|
package/dist/transformer.d.cts
CHANGED
|
@@ -6,5 +6,4 @@ import './transformer/transformers/AnthropicTransformer.cjs';
|
|
|
6
6
|
import './transformer/transformers/GeminiCodeAssistTransformer.cjs';
|
|
7
7
|
import './transformer/transformers/GeminiTransformer.cjs';
|
|
8
8
|
import './transformer/transformers/OpenAIResponseTransformer.cjs';
|
|
9
|
-
import './transformer/transformers/
|
|
10
|
-
import './transformer/transformers/ReasoningTransformer.cjs';
|
|
9
|
+
import './transformer/transformers/OpenAITransformer.cjs';
|
package/dist/transformer.d.ts
CHANGED
|
@@ -6,5 +6,4 @@ import './transformer/transformers/AnthropicTransformer.js';
|
|
|
6
6
|
import './transformer/transformers/GeminiCodeAssistTransformer.js';
|
|
7
7
|
import './transformer/transformers/GeminiTransformer.js';
|
|
8
8
|
import './transformer/transformers/OpenAIResponseTransformer.js';
|
|
9
|
-
import './transformer/transformers/
|
|
10
|
-
import './transformer/transformers/ReasoningTransformer.js';
|
|
9
|
+
import './transformer/transformers/OpenAITransformer.js';
|