@omnicross/core 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +6 -5
- package/dist/auth/GeminiCodeAssistProjectResolver.js +4 -3
- package/dist/{chunk-HRRYG2AX.js → chunk-23S5OPIO.js} +10 -1
- package/dist/chunk-25GXJCEZ.cjs +40 -0
- package/dist/chunk-2JYRIADS.js +40 -0
- package/dist/{chunk-4XMYPW46.cjs → chunk-4VLRHHFE.cjs} +75 -33
- package/dist/{chunk-VACWOIRE.cjs → chunk-4VZX5F4T.cjs} +39 -15
- package/dist/{chunk-C6OV7GCC.js → chunk-6CL5HTPQ.js} +44 -2
- package/dist/chunk-6QQG7YG3.cjs +153 -0
- package/dist/{chunk-3Q6Z6JTO.cjs → chunk-6VUQPOV3.cjs} +277 -86
- package/dist/chunk-7AK7B36B.cjs +44 -0
- package/dist/{chunk-5ZQBEOMD.js → chunk-AT7B7SOZ.js} +25 -2
- package/dist/{chunk-IK3KE3AU.js → chunk-DE2SRBFZ.js} +1 -1
- package/dist/chunk-DLXZEZWO.cjs +285 -0
- package/dist/{chunk-UHGVBFU3.js → chunk-EBLFCNPY.js} +38 -14
- package/dist/chunk-EJLH6NFT.cjs +166 -0
- package/dist/chunk-HVBBDBS3.cjs +350 -0
- package/dist/{chunk-46ZIFWYG.cjs → chunk-IIRPUVPH.cjs} +7 -1
- package/dist/{chunk-JWVTXXPX.cjs → chunk-KBM2W6UY.cjs} +8 -4
- package/dist/{chunk-PG7PS2NN.cjs → chunk-KCVJWJST.cjs} +14 -2
- 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-MFZ5437A.js → chunk-N5T4M4GU.js} +1 -1
- package/dist/{chunk-BODMAL6G.js → chunk-OEWZUX4G.js} +262 -71
- package/dist/chunk-OF3BECU2.cjs +69 -0
- package/dist/{chunk-DDMRUL76.cjs → chunk-OKMJLEXX.cjs} +5 -5
- package/dist/chunk-OPRS4IQZ.js +153 -0
- package/dist/{chunk-D3TDKWRP.js → chunk-SIZQQD6T.js} +14 -2
- package/dist/{chunk-CGKLE6IW.cjs → chunk-SQYVORNP.cjs} +1219 -510
- package/dist/{chunk-6QZGDLL4.js → chunk-TOVPMMHM.js} +5 -1
- package/dist/{chunk-FH2P4OCD.js → chunk-UDCC7EMR.js} +976 -267
- package/dist/{chunk-ZLX3KGXX.js → chunk-UX7VWA46.js} +135 -23
- package/dist/{chunk-K52THW2C.cjs → chunk-V4TXMEJS.cjs} +5 -5
- package/dist/chunk-VRFBB5DB.js +44 -0
- package/dist/chunk-WB6PH56J.js +166 -0
- package/dist/{chunk-G2UTNSGU.js → chunk-WNKWAEUR.js} +7 -1
- package/dist/{chunk-SUEGJ75D.cjs → chunk-WYTEQ4Q5.cjs} +25 -2
- package/dist/{chunk-5ENKBSWO.js → chunk-YJVHCHQX.js} +42 -6
- package/dist/{chunk-VQY5W4YW.cjs → chunk-YK57NMIF.cjs} +44 -8
- package/dist/{chunk-KFI44N2R.cjs → chunk-YNJNTCSQ.cjs} +10 -1
- 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 +25 -23
- package/dist/completion/CompletionService.d.cts +2 -1
- package/dist/completion/CompletionService.d.ts +2 -1
- package/dist/completion/CompletionService.js +24 -22
- package/dist/completion.cjs +25 -23
- package/dist/completion.d.cts +2 -1
- package/dist/completion.d.ts +2 -1
- package/dist/completion.js +24 -22
- package/dist/index.cjs +49 -26
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +52 -29
- package/dist/{keyPolicy-Cp0FntZl.d.ts → keyPolicy-zdWTu3CQ.d.cts} +1 -1
- package/dist/{keyPolicy-Cp0FntZl.d.cts → keyPolicy-zdWTu3CQ.d.ts} +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 +4 -3
- package/dist/outbound-api/routeResolver.d.ts +4 -3
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.cts +1 -0
- package/dist/outbound-api/subscriptionRegistryPort.d.ts +1 -0
- package/dist/outbound-api/types.d.cts +3 -2
- package/dist/outbound-api/types.d.ts +3 -2
- package/dist/outbound-api.cjs +47 -24
- package/dist/outbound-api.d.cts +127 -85
- package/dist/outbound-api.d.ts +127 -85
- package/dist/outbound-api.js +50 -27
- package/dist/pipeline/AccountAllowanceScheduling.cjs +15 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +90 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +90 -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/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/SubscriptionAccountHealth.cjs +4 -2
- package/dist/pipeline/SubscriptionAccountHealth.d.cts +34 -6
- package/dist/pipeline/SubscriptionAccountHealth.d.ts +34 -6
- package/dist/pipeline/SubscriptionAccountHealth.js +3 -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 +3 -2
- package/dist/pipeline/upstreamFetch.js +2 -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 +25 -23
- package/dist/provider-proxy/ProviderProxy.d.cts +1 -0
- package/dist/provider-proxy/ProviderProxy.d.ts +1 -0
- package/dist/provider-proxy/ProviderProxy.js +24 -22
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +27 -23
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +34 -5
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +34 -5
- package/dist/provider-proxy/ingress/providerProxyShared.js +26 -22
- package/dist/provider-proxy/matchText.cjs +4 -2
- package/dist/provider-proxy/matchText.d.cts +41 -6
- package/dist/provider-proxy/matchText.d.ts +41 -6
- package/dist/provider-proxy/matchText.js +3 -1
- package/dist/provider-proxy/types.d.cts +30 -2
- package/dist/provider-proxy/types.d.ts +30 -2
- package/dist/provider-proxy.cjs +25 -23
- package/dist/provider-proxy.d.cts +1 -0
- package/dist/provider-proxy.d.ts +1 -0
- package/dist/provider-proxy.js +24 -22
- package/dist/{routeResolver-C4T7yClx.d.ts → routeResolver-CHTv_Bs5.d.ts} +1 -1
- package/dist/{routeResolver-CB3tvJKy.d.cts → routeResolver-kepxnfcC.d.cts} +1 -1
- package/dist/transformer/TransformerChainExecutor.cjs +2 -2
- package/dist/transformer/TransformerChainExecutor.js +1 -1
- package/dist/transformer/transformers/AnthropicTransformer.cjs +2 -2
- package/dist/transformer/transformers/AnthropicTransformer.js +1 -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 +2 -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 +1 -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 +8 -14
- package/dist/transformer/transformers.d.cts +12 -48
- package/dist/transformer/transformers.d.ts +12 -48
- package/dist/transformer/transformers.js +12 -18
- package/dist/transformer/types.d.cts +17 -0
- package/dist/transformer/types.d.ts +17 -0
- package/dist/transformer.cjs +10 -11
- package/dist/transformer.d.cts +1 -2
- package/dist/transformer.d.ts +1 -2
- package/dist/transformer.js +9 -10
- package/dist/{types-B8Arpxn0.d.cts → types-H3wGZSOo.d.cts} +134 -7
- package/dist/{types-lgPYQuZS.d.ts → types-hsoKrVQS.d.ts} +134 -7
- package/dist/usage/pricing-engine.cjs +2 -2
- package/dist/usage/pricing-engine.d.cts +9 -1
- package/dist/usage/pricing-engine.d.ts +9 -1
- package/dist/usage/pricing-engine.js +1 -1
- package/dist/usage.cjs +2 -2
- package/dist/usage.js +1 -1
- 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/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
|
@@ -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,33 @@
|
|
|
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";
|
|
14
|
-
import {
|
|
15
|
-
AnthropicTransformer
|
|
16
|
-
} from "../chunk-C6OV7GCC.js";
|
|
6
|
+
} from "../chunk-VRFBB5DB.js";
|
|
17
7
|
import {
|
|
18
8
|
GeminiTransformer
|
|
19
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-LVUCAWMK.js";
|
|
20
10
|
import {
|
|
21
11
|
OpenAIResponseTransformer
|
|
22
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-OEWZUX4G.js";
|
|
13
|
+
import {
|
|
14
|
+
OpenAITransformer
|
|
15
|
+
} from "../chunk-LB6EBS6Y.js";
|
|
16
|
+
import {
|
|
17
|
+
AnthropicTransformer
|
|
18
|
+
} from "../chunk-6CL5HTPQ.js";
|
|
23
19
|
import {
|
|
24
20
|
GeminiCodeAssistTransformer
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-N5T4M4GU.js";
|
|
22
|
+
import "../chunk-TOVPMMHM.js";
|
|
27
23
|
export {
|
|
28
24
|
AnthropicTransformer,
|
|
29
25
|
BUILTIN_TRANSFORMER_NAMES,
|
|
30
26
|
BuiltinTransformers,
|
|
31
|
-
DeepseekTransformer,
|
|
32
27
|
GeminiCodeAssistTransformer,
|
|
33
28
|
GeminiTransformer,
|
|
34
29
|
OpenAIResponseTransformer,
|
|
35
|
-
|
|
36
|
-
ReasoningTransformer,
|
|
30
|
+
OpenAITransformer,
|
|
37
31
|
getBuiltinTransformers,
|
|
38
32
|
registerBuiltinTransformers
|
|
39
33
|
};
|
|
@@ -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,22 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-FZ46M34D.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkIIRPUVPHcjs = require('./chunk-IIRPUVPH.cjs');
|
|
5
|
+
require('./chunk-GBHYAGX3.cjs');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
var _chunk3OPYJG76cjs = require('./chunk-3OPYJG76.cjs');
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
var
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
17
|
-
require('./chunk-DDMRUL76.cjs');
|
|
18
|
-
require('./chunk-JWVTXXPX.cjs');
|
|
11
|
+
var _chunk7AK7B36Bcjs = require('./chunk-7AK7B36B.cjs');
|
|
12
|
+
require('./chunk-V4TXMEJS.cjs');
|
|
13
|
+
require('./chunk-6VUQPOV3.cjs');
|
|
14
|
+
require('./chunk-OF3BECU2.cjs');
|
|
15
|
+
require('./chunk-4VLRHHFE.cjs');
|
|
16
|
+
require('./chunk-OKMJLEXX.cjs');
|
|
17
|
+
require('./chunk-KBM2W6UY.cjs');
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
|
|
23
|
-
exports.TransformerChainExecutor =
|
|
22
|
+
exports.TransformerChainExecutor = _chunkIIRPUVPHcjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.registerBuiltinTransformers = _chunk7AK7B36Bcjs.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';
|
package/dist/transformer.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import "./chunk-46RLHI7D.js";
|
|
2
2
|
import {
|
|
3
3
|
TransformerChainExecutor
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WNKWAEUR.js";
|
|
5
|
+
import "./chunk-MZNPGW5Q.js";
|
|
5
6
|
import {
|
|
6
7
|
TransformerService
|
|
7
8
|
} from "./chunk-DK4A7DLE.js";
|
|
8
9
|
import {
|
|
9
10
|
registerBuiltinTransformers
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-MFZ5437A.js";
|
|
18
|
-
import "./chunk-6QZGDLL4.js";
|
|
11
|
+
} from "./chunk-VRFBB5DB.js";
|
|
12
|
+
import "./chunk-LVUCAWMK.js";
|
|
13
|
+
import "./chunk-OEWZUX4G.js";
|
|
14
|
+
import "./chunk-LB6EBS6Y.js";
|
|
15
|
+
import "./chunk-6CL5HTPQ.js";
|
|
16
|
+
import "./chunk-N5T4M4GU.js";
|
|
17
|
+
import "./chunk-TOVPMMHM.js";
|
|
19
18
|
export {
|
|
20
19
|
TransformerChainExecutor,
|
|
21
20
|
TransformerService,
|
|
@@ -8,7 +8,8 @@ import { L as Logger } from './logger-4GvQNzhE.cjs';
|
|
|
8
8
|
import { ProviderConfigSource } from './ports/provider-config-source.cjs';
|
|
9
9
|
import { P as ProviderProxy } from './ProviderProxy-CnMQYN59.cjs';
|
|
10
10
|
import { ProviderProxyDeps } from './provider-proxy/types.cjs';
|
|
11
|
-
import {
|
|
11
|
+
import { BoundAccountFallbackPolicy } from './pipeline/BoundAccountSelectionError.cjs';
|
|
12
|
+
import { c as KeySpend } from './keyPolicy-zdWTu3CQ.cjs';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* keySpendTracker — a cheap in-memory per-key accumulated-spend cache
|
|
@@ -313,15 +314,30 @@ interface EndpointRoutingConfig {
|
|
|
313
314
|
/**
|
|
314
315
|
* OPTIONAL subscription-mode binding to ONE specific subscription account id
|
|
315
316
|
* (provider/subscription duality). Absent/blank ⇒ the provider's account pool
|
|
316
|
-
* auto-schedules (priority/LRU/health). When set
|
|
317
|
-
*
|
|
317
|
+
* auto-schedules (priority/LRU/health). When set, strict mode requires this
|
|
318
|
+
* account to serve; the pool is a fallback only with the explicit policy below.
|
|
318
319
|
*/
|
|
319
320
|
boundAccountId?: string;
|
|
321
|
+
/**
|
|
322
|
+
* What a bound account does when it cannot serve this request. Meaningful
|
|
323
|
+
* only with `boundAccountId`; normalization drops it otherwise. A legacy
|
|
324
|
+
* bound endpoint with no field migrates to `'strict'`. The pool is used only
|
|
325
|
+
* when this is explicitly set to `'pool'`.
|
|
326
|
+
*/
|
|
327
|
+
boundAccountFallbackPolicy?: BoundAccountFallbackPolicy;
|
|
328
|
+
/**
|
|
329
|
+
* Runtime-only account-group selector used by a {@link GatewayBinding}.
|
|
330
|
+
* Legacy endpoint persistence does not synthesize this field; it is projected
|
|
331
|
+
* from an independent binding immediately before route resolution.
|
|
332
|
+
*/
|
|
333
|
+
boundAccountGroup?: string;
|
|
320
334
|
/**
|
|
321
335
|
* OPTIONAL provider-mode binding to ONE specific BYO key id (from the
|
|
322
336
|
* provider's key pool). Absent/blank ⇒ the provider's default key / key pool.
|
|
323
337
|
*/
|
|
324
338
|
boundKeyId?: string;
|
|
339
|
+
/** Strict by default; `'pool'` permits the provider's normal key pool. */
|
|
340
|
+
boundKeyFallbackPolicy?: BoundAccountFallbackPolicy;
|
|
325
341
|
/**
|
|
326
342
|
* OPTIONAL "background model id" override list (role-based `gemini` only).
|
|
327
343
|
* When set, an incoming requested model id appearing in this list is
|
|
@@ -364,7 +380,7 @@ interface ConcurrencyQueueConfig {
|
|
|
364
380
|
* Persisted + strictly validated like the queue segments; applied to the shared
|
|
365
381
|
* `SubscriptionAccountHealth` tracker at daemon boot.
|
|
366
382
|
* - `overloadCooldownEnabled` default **true** — a 529 places the account in
|
|
367
|
-
* overload cooldown (
|
|
383
|
+
* overload cooldown (enabled by default).
|
|
368
384
|
* - `overloadCooldownMs` default **600000** (10 min), valid `60000..3600000`.
|
|
369
385
|
*/
|
|
370
386
|
interface AccountHealthConfig {
|
|
@@ -397,6 +413,89 @@ interface AccountProbeConfig {
|
|
|
397
413
|
historySize: number;
|
|
398
414
|
staggerMs: number;
|
|
399
415
|
}
|
|
416
|
+
/** A resource selected by a client-to-upstream gateway binding. */
|
|
417
|
+
type GatewayBindingTarget = {
|
|
418
|
+
kind: 'account';
|
|
419
|
+
providerId: string;
|
|
420
|
+
accountId: string;
|
|
421
|
+
} | {
|
|
422
|
+
kind: 'account-group';
|
|
423
|
+
providerId: string;
|
|
424
|
+
group: string;
|
|
425
|
+
} | {
|
|
426
|
+
/**
|
|
427
|
+
* The provider's WHOLE subscription pool, with no account preference —
|
|
428
|
+
* plain priority/LRU/health scheduling. Distinct from `account-group`,
|
|
429
|
+
* which pins a preferred group, and from `provider`, which is BYO-key.
|
|
430
|
+
*/
|
|
431
|
+
kind: 'account-pool';
|
|
432
|
+
providerId: string;
|
|
433
|
+
} | {
|
|
434
|
+
kind: 'provider';
|
|
435
|
+
providerId: string;
|
|
436
|
+
keyId?: string;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Behavior when a binding cannot serve the requested model or credential.
|
|
440
|
+
* `next` yields to the next matching route (and lets a bound account fall back
|
|
441
|
+
* to its provider pool); `fail` keeps the route strict and errors instead.
|
|
442
|
+
*/
|
|
443
|
+
type GatewayBindingFallback = 'next' | 'fail';
|
|
444
|
+
/** Which named API keys may enter a downstream route. */
|
|
445
|
+
type GatewayBindingKeyScope = 'all' | 'selected';
|
|
446
|
+
/** Whether the downstream model id is forwarded or explicitly remapped. */
|
|
447
|
+
type GatewayBindingModelMode = 'passthrough' | 'mapped';
|
|
448
|
+
/** One exact or `*` wildcard model-name rewrite owned by a downstream route. */
|
|
449
|
+
interface GatewayModelMapping {
|
|
450
|
+
source: string;
|
|
451
|
+
target: ModelRef;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Independent client-to-upstream route aggregate.
|
|
455
|
+
*
|
|
456
|
+
* A binding belongs to exactly one endpoint and one upstream resource. Keeping
|
|
457
|
+
* it separate from account/provider DTOs lets the same resource participate in
|
|
458
|
+
* multiple client-key routes without changing its identity or secret shape.
|
|
459
|
+
*/
|
|
460
|
+
interface GatewayBinding {
|
|
461
|
+
id: string;
|
|
462
|
+
name: string;
|
|
463
|
+
enabled: boolean;
|
|
464
|
+
/** Legacy entries without this field keep the former all-vs-list behavior. */
|
|
465
|
+
keyScope?: GatewayBindingKeyScope;
|
|
466
|
+
/** Used only when `keyScope` resolves to `selected`. */
|
|
467
|
+
apiKeyIds?: string[];
|
|
468
|
+
endpoint: OutboundEndpoint;
|
|
469
|
+
target: GatewayBindingTarget;
|
|
470
|
+
/** Lower values win. Key-scoped bindings win before this comparison. */
|
|
471
|
+
priority?: number;
|
|
472
|
+
/** Next yields to the following matching route; fail keeps the binding strict. */
|
|
473
|
+
fallback: GatewayBindingFallback;
|
|
474
|
+
/** Empty passthrough routes preserve the client's requested model id. */
|
|
475
|
+
modelMode?: GatewayBindingModelMode;
|
|
476
|
+
/** Preferred generic mapping shape; legacy endpoint-specific fields remain readable. */
|
|
477
|
+
modelMappings?: GatewayModelMapping[];
|
|
478
|
+
modelMap?: Record<string, ModelRef>;
|
|
479
|
+
models?: ModelRef[];
|
|
480
|
+
dispatchMode?: ChatDispatchMode;
|
|
481
|
+
prefixTargets?: ModelPrefixTargets;
|
|
482
|
+
defaultModel?: ModelRef;
|
|
483
|
+
backgroundModel?: ModelRef;
|
|
484
|
+
backgroundModelIds?: string[];
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Optional allowance-aware account scheduling. Default-off keeps allowance
|
|
488
|
+
* telemetry display-only. When enabled, only fresh Claude/Codex snapshots are
|
|
489
|
+
* considered: accounts above `demoteAtPercent` receive a temporary priority
|
|
490
|
+
* penalty; accounts above `pauseAtPercent` are excluded until the provider's
|
|
491
|
+
* reset/freshness deadline. Missing or stale data never excludes an account.
|
|
492
|
+
*/
|
|
493
|
+
interface AllowanceSchedulingConfig {
|
|
494
|
+
enabled: boolean;
|
|
495
|
+
demoteAtPercent: number;
|
|
496
|
+
pauseAtPercent: number;
|
|
497
|
+
priorityPenalty: number;
|
|
498
|
+
}
|
|
400
499
|
/**
|
|
401
500
|
* Client-fingerprint segment (subscription-client-fingerprint #7). Opt-in,
|
|
402
501
|
* default OFF: when disabled the claude-subscription outbound headers are
|
|
@@ -435,8 +534,19 @@ interface OutboundApiServerConfig {
|
|
|
435
534
|
enabled: boolean;
|
|
436
535
|
/** When true the listener binds `0.0.0.0` (LAN) instead of `127.0.0.1`. */
|
|
437
536
|
networkBinding: boolean;
|
|
438
|
-
/**
|
|
537
|
+
/**
|
|
538
|
+
* LEGACY per-endpoint routing config, one per endpoint (4 entries). No longer
|
|
539
|
+
* a routing source: {@link normalizeServerConfig} projects any configured
|
|
540
|
+
* entry into {@link bindings} once and leaves these blank. Retained as the
|
|
541
|
+
* projection shape {@link EndpointRoutingConfig} and for embedders that build
|
|
542
|
+
* a config by hand.
|
|
543
|
+
*/
|
|
439
544
|
endpoints: EndpointRoutingConfig[];
|
|
545
|
+
/**
|
|
546
|
+
* Resource-centric routes — the SSOT for routing. Optional in the raw
|
|
547
|
+
* persisted shape; normalized Omnicross configs always carry an array.
|
|
548
|
+
*/
|
|
549
|
+
bindings?: GatewayBinding[];
|
|
440
550
|
/** Persisted port (fixed default; falls back to ephemeral on EADDRINUSE). */
|
|
441
551
|
port?: number;
|
|
442
552
|
/**
|
|
@@ -463,6 +573,8 @@ interface OutboundApiServerConfig {
|
|
|
463
573
|
* boot; a change takes effect on restart. Default-off ⇒ no scheduler runs.
|
|
464
574
|
*/
|
|
465
575
|
accountProbe?: AccountProbeConfig;
|
|
576
|
+
/** Default-off allowance-aware scheduling; hot-reloaded by the daemon. */
|
|
577
|
+
allowanceScheduling?: AllowanceSchedulingConfig;
|
|
466
578
|
/**
|
|
467
579
|
* Layered upstream-proxy segment (upstream-proxy). Optional; when absent no
|
|
468
580
|
* global/provider proxy applies (direct egress). `normalizeServerConfig` drops
|
|
@@ -546,6 +658,12 @@ interface OutboundApiKeyInfo {
|
|
|
546
658
|
createdAt: number;
|
|
547
659
|
lastUsedAt: number | null;
|
|
548
660
|
revoked: boolean;
|
|
661
|
+
/** Intended consumer. Existing rows default to a general client key. */
|
|
662
|
+
kind?: 'client' | 'integration';
|
|
663
|
+
/** Optional endpoint allow-list. Absent means every outbound endpoint. */
|
|
664
|
+
allowedEndpoints?: OutboundEndpoint[];
|
|
665
|
+
/** When true the key is rejected unless the TCP peer is loopback. */
|
|
666
|
+
loopbackOnly?: boolean;
|
|
549
667
|
/**
|
|
550
668
|
* Per-key concurrency ceiling for the outbound concurrency gate. Absent or
|
|
551
669
|
* `0` = unlimited (the gate is bypassed entirely for this key).
|
|
@@ -571,7 +689,7 @@ interface OutboundApiKeyInfo {
|
|
|
571
689
|
rateLimitWindowMs?: number | null;
|
|
572
690
|
/** Master switch: when false/unset the model list is inert (no restriction). */
|
|
573
691
|
enableModelRestriction?: boolean;
|
|
574
|
-
/** Restriction mode; absent ⇒ `'blacklist'
|
|
692
|
+
/** Restriction mode; absent ⇒ `'blacklist'`. */
|
|
575
693
|
restrictionMode?: OutboundKeyModelRestrictionMode;
|
|
576
694
|
/** The model-id list the mode acts on (bare modelIds; empty allowlist denies all). */
|
|
577
695
|
restrictedModels?: string[];
|
|
@@ -637,6 +755,12 @@ interface OutboundKeyDbRow {
|
|
|
637
755
|
createdAt: number;
|
|
638
756
|
lastUsedAt: number | null;
|
|
639
757
|
revokedAt: number | null;
|
|
758
|
+
/** Intended consumer. Existing rows without this field remain client keys. */
|
|
759
|
+
kind?: 'client' | 'integration';
|
|
760
|
+
/** Optional endpoint allow-list for least-privilege integration keys. */
|
|
761
|
+
allowedEndpoints?: OutboundEndpoint[];
|
|
762
|
+
/** Restrict use to requests whose direct socket peer is loopback. */
|
|
763
|
+
loopbackOnly?: boolean;
|
|
640
764
|
/**
|
|
641
765
|
* Per-key concurrency ceiling. Absent/`0` = unlimited = the concurrency gate
|
|
642
766
|
* is bypassed for this key. Persisted by the daemon (`omnicross-uqc-daemon`).
|
|
@@ -676,6 +800,9 @@ interface OutboundKeyDb {
|
|
|
676
800
|
keyHash: string;
|
|
677
801
|
keyPrefix: string;
|
|
678
802
|
createdAt?: number;
|
|
803
|
+
kind?: 'client' | 'integration';
|
|
804
|
+
allowedEndpoints?: OutboundEndpoint[];
|
|
805
|
+
loopbackOnly?: boolean;
|
|
679
806
|
}): Promise<OutboundKeyDbRow>;
|
|
680
807
|
outboundApiKeysRevoke(id: string): Promise<boolean>;
|
|
681
808
|
outboundApiKeysTouchLastUsed(id: string): Promise<boolean>;
|
|
@@ -751,4 +878,4 @@ interface OutboundApiDeps {
|
|
|
751
878
|
readonly logger?: Logger;
|
|
752
879
|
}
|
|
753
880
|
|
|
754
|
-
export { type AccountProbeConfig as A,
|
|
881
|
+
export { type AccountProbeConfig as A, computeVoucherGrant as B, type ChatDispatchMode as C, generateVoucherCode as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type GatewayBinding as G, hashVoucherCode as H, newVoucherId as I, startOfLocalDay as J, type KeySpendReader as K, startOfLocalWeek as L, type MessagesModelKind as M, toVoucherInfo as N, type OutboundKeyDb as O, voucherCodePrefix as P, type ModelRef as Q, type RequestRole as R, type AccountHealthConfig as S, type OutboundKeyModelRestrictionMode as T, type UserMessageQueueConfig as U, type VoucherCreateInput as V, type AllowanceSchedulingConfig as a, type ConcurrencyQueueConfig as b, type EndpointRoutingConfig as c, type GatewayBindingFallback as d, type GatewayBindingKeyScope as e, type GatewayBindingModelMode as f, type GatewayBindingTarget as g, type GatewayModelMapping as h, type KeySpendSeeder as i, KeySpendTracker as j, type KindMappedEndpoint as k, type ModelKind as l, type ModelPrefixTargets as m, type OutboundApiDeps as n, type OutboundApiKeyCreated as o, type OutboundApiKeyInfo as p, type OutboundApiServerConfig as q, type OutboundApiServerStatus as r, type OutboundEndpoint as s, type OutboundFormatUrls as t, type OutboundKeyActivationMode as u, type OutboundKeyDbRow as v, type OutboundKeyPolicy as w, type OutboundProxyConfig as x, type ResponsesModelKind as y, type VoucherDb as z };
|