@omnicross/core 0.1.7 → 0.1.9
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/{ProviderProxy-C-xqrkKi.d.ts → ProviderProxy--ROec6VI.d.ts} +22 -3
- package/dist/{ProviderProxy-CnMQYN59.d.cts → ProviderProxy-QdwNV6l1.d.cts} +22 -3
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +5 -3
- package/dist/auth/GeminiCodeAssistProjectResolver.js +4 -2
- package/dist/{chunk-N5T4M4GU.js → chunk-2UTGX6FM.js} +2 -2
- package/dist/{chunk-32O35CIF.js → chunk-45FHEOKW.js} +22 -7
- package/dist/{chunk-LVUCAWMK.js → chunk-55FMGZ3L.js} +13 -5
- package/dist/{chunk-OF3BECU2.cjs → chunk-56QD3YW6.cjs} +18 -5
- package/dist/{chunk-V4TXMEJS.cjs → chunk-5LNYGCIW.cjs} +15 -7
- package/dist/chunk-77USGNRW.cjs +37 -0
- package/dist/chunk-AOFWNWLT.cjs +203 -0
- package/dist/{chunk-LB6EBS6Y.js → chunk-CCVRRJOX.js} +17 -4
- package/dist/{chunk-OVQBNVSV.cjs → chunk-CMVXX7ON.cjs} +42 -27
- package/dist/{chunk-E3COOKUP.js → chunk-CQIJCPMF.js} +1108 -271
- package/dist/{chunk-OJGQKHN5.cjs → chunk-EPN67EGP.cjs} +3 -0
- package/dist/{chunk-PEGTIPB3.js → chunk-HKB656B4.js} +37 -43
- package/dist/chunk-N2EIM2XJ.js +203 -0
- package/dist/{chunk-MYYR3HZL.js → chunk-NGYOO5TO.js} +5 -5
- package/dist/{chunk-OKMJLEXX.cjs → chunk-OC6DOOFX.cjs} +5 -5
- package/dist/{chunk-2Z4XM3H5.cjs → chunk-P7EM6BND.cjs} +10 -10
- package/dist/{chunk-KBM2W6UY.cjs → chunk-RICPANBY.cjs} +41 -24
- package/dist/{chunk-TOVPMMHM.js → chunk-S3DYFEBE.js} +37 -20
- package/dist/{chunk-SOO562NM.js → chunk-UAPBLNN2.js} +3 -0
- package/dist/chunk-WYVGULTQ.js +37 -0
- package/dist/{chunk-4BB343BI.cjs → chunk-XELFM7KL.cjs} +1381 -544
- package/dist/{chunk-OXHNSZ53.cjs → chunk-ZQQUD66M.cjs} +54 -60
- package/dist/completion/ApiKeyPoolService.cjs +32 -1
- package/dist/completion/ApiKeyPoolService.d.cts +17 -1
- package/dist/completion/ApiKeyPoolService.d.ts +17 -1
- package/dist/completion/ApiKeyPoolService.js +31 -0
- package/dist/completion/CompletionService.cjs +13 -11
- package/dist/completion/CompletionService.js +12 -10
- package/dist/completion.cjs +13 -11
- package/dist/completion.js +12 -10
- package/dist/index.cjs +69 -11
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +68 -10
- package/dist/outbound-api/routeResolver.d.cts +4 -4
- package/dist/outbound-api/routeResolver.d.ts +4 -4
- package/dist/outbound-api/types.d.cts +3 -3
- package/dist/outbound-api/types.d.ts +3 -3
- package/dist/outbound-api.cjs +13 -11
- package/dist/outbound-api.d.cts +5 -5
- package/dist/outbound-api.d.ts +5 -5
- package/dist/outbound-api.js +12 -10
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +3 -3
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +3 -3
- package/dist/pipeline/executeProviderCall.d.cts +2 -0
- package/dist/pipeline/executeProviderCall.d.ts +2 -0
- package/dist/pipeline/resolveProviderChain.d.cts +1 -0
- package/dist/pipeline/resolveProviderChain.d.ts +1 -0
- package/dist/pipeline/resolveSubscriptionChain.d.cts +2 -0
- package/dist/pipeline/resolveSubscriptionChain.d.ts +2 -0
- package/dist/ports/provider-config-source.d.cts +1 -0
- package/dist/ports/provider-config-source.d.ts +1 -0
- package/dist/ports.d.cts +3 -3
- package/dist/ports.d.ts +3 -3
- package/dist/provider-proxy/ProviderProxy.cjs +13 -11
- package/dist/provider-proxy/ProviderProxy.d.cts +1 -1
- package/dist/provider-proxy/ProviderProxy.d.ts +1 -1
- package/dist/provider-proxy/ProviderProxy.js +12 -10
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +13 -11
- package/dist/provider-proxy/ingress/providerProxyShared.js +12 -10
- package/dist/provider-proxy/types.d.cts +15 -1
- package/dist/provider-proxy/types.d.ts +15 -1
- package/dist/provider-proxy.cjs +69 -11
- package/dist/provider-proxy.d.cts +254 -8
- package/dist/provider-proxy.d.ts +254 -8
- package/dist/provider-proxy.js +70 -12
- package/dist/{routeResolver-BxOfunbm.d.ts → routeResolver-C0mkkZaM.d.ts} +1 -1
- package/dist/{routeResolver-D5OzD0iM.d.cts → routeResolver-CVFE8KKe.d.cts} +1 -1
- package/dist/transformer/TransformerChainExecutor.d.cts +2 -0
- package/dist/transformer/TransformerChainExecutor.d.ts +2 -0
- package/dist/transformer/TransformerService.d.cts +2 -0
- package/dist/transformer/TransformerService.d.ts +2 -0
- package/dist/transformer/transformers/AnthropicTransformer.cjs +4 -2
- package/dist/transformer/transformers/AnthropicTransformer.d.cts +7 -2
- package/dist/transformer/transformers/AnthropicTransformer.d.ts +7 -2
- package/dist/transformer/transformers/AnthropicTransformer.js +3 -1
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +5 -3
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.d.cts +2 -0
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.d.ts +2 -0
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +4 -2
- package/dist/transformer/transformers/GeminiTransformer.cjs +5 -3
- package/dist/transformer/transformers/GeminiTransformer.d.cts +4 -2
- package/dist/transformer/transformers/GeminiTransformer.d.ts +4 -2
- package/dist/transformer/transformers/GeminiTransformer.js +4 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.cts +4 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.ts +4 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -1
- package/dist/transformer/transformers/OpenAITransformer.cjs +3 -2
- package/dist/transformer/transformers/OpenAITransformer.d.cts +3 -1
- package/dist/transformer/transformers/OpenAITransformer.d.ts +3 -1
- package/dist/transformer/transformers/OpenAITransformer.js +2 -1
- package/dist/transformer/transformers.cjs +10 -8
- package/dist/transformer/transformers.d.cts +2 -0
- package/dist/transformer/transformers.d.ts +2 -0
- package/dist/transformer/transformers.js +9 -7
- package/dist/transformer/types.d.cts +16 -5
- package/dist/transformer/types.d.ts +16 -5
- package/dist/transformer.cjs +28 -9
- package/dist/transformer.d.cts +76 -1
- package/dist/transformer.d.ts +76 -1
- package/dist/transformer.js +28 -9
- package/dist/{types-CqZD77rS.d.ts → types-BB8pxk_3.d.ts} +1 -1
- package/dist/{types-gjJ5lJ5n.d.cts → types-C2MwkLah.d.cts} +1 -1
- package/dist/usage/usage-recorder.cjs +2 -2
- package/dist/usage/usage-recorder.d.cts +6 -0
- package/dist/usage/usage-recorder.d.ts +6 -0
- package/dist/usage/usage-recorder.js +1 -1
- package/dist/usage.cjs +2 -2
- package/dist/usage.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-FZ46M34D.cjs → chunk-QVOB2DNX.cjs} +0 -0
- /package/dist/{chunk-46RLHI7D.js → chunk-WTQMX2Q6.js} +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { ModelConfig } from '@omnicross/contracts/llm-config';
|
|
2
|
+
import { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
3
|
+
export { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* TransformerService Types
|
|
3
7
|
*
|
|
@@ -6,10 +10,7 @@
|
|
|
6
10
|
*
|
|
7
11
|
* @module transformer/types
|
|
8
12
|
*/
|
|
9
|
-
|
|
10
|
-
* Thinking effort level for reasoning models
|
|
11
|
-
*/
|
|
12
|
-
type ThinkLevel = 'none' | 'low' | 'medium' | 'high';
|
|
13
|
+
|
|
13
14
|
/**
|
|
14
15
|
* Thinking content with optional signature for extended context
|
|
15
16
|
*/
|
|
@@ -118,6 +119,8 @@ interface UnifiedChatRequest {
|
|
|
118
119
|
tools?: UnifiedTool[];
|
|
119
120
|
tool_choice?: ToolChoice;
|
|
120
121
|
reasoning?: ReasoningConfig;
|
|
122
|
+
/** Native OpenAI Chat field retained by the identity-shaped ingress. */
|
|
123
|
+
reasoning_effort?: string;
|
|
121
124
|
/**
|
|
122
125
|
* Internal-only routing metadata. Populated by callers (CompletionService /
|
|
123
126
|
* the host's engine adapters and proxy servers) so the usage-capture hook can attribute
|
|
@@ -255,6 +258,8 @@ interface LLMProvider {
|
|
|
255
258
|
baseUrl: string;
|
|
256
259
|
apiKey: string;
|
|
257
260
|
models: string[];
|
|
261
|
+
/** Effective per-model capability overrides used by target encoders. */
|
|
262
|
+
modelConfigs?: Array<Pick<ModelConfig, 'id'> & Partial<ModelConfig>>;
|
|
258
263
|
transformer?: TransformerChainConfig;
|
|
259
264
|
/**
|
|
260
265
|
* Resolved Google **Code Assist** project id, threaded onto the transformer
|
|
@@ -298,6 +303,12 @@ interface TransformerContext {
|
|
|
298
303
|
logger?: TransformerLogger;
|
|
299
304
|
/** Provider name */
|
|
300
305
|
providerName?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Native request format that supplied a recognized reasoning effort.
|
|
308
|
+
* Target encoders use this provenance to preserve same-format values while
|
|
309
|
+
* continuing to negotiate genuine cross-format conversions.
|
|
310
|
+
*/
|
|
311
|
+
reasoningSourceFormat?: string;
|
|
301
312
|
/** Additional context data */
|
|
302
313
|
[key: string]: unknown;
|
|
303
314
|
}
|
|
@@ -419,4 +430,4 @@ interface TransformerServiceConfig {
|
|
|
419
430
|
transformers?: TransformerConfigEntry[];
|
|
420
431
|
}
|
|
421
432
|
|
|
422
|
-
export type { Annotation, ImageContent, LLMProvider, MessageContent, ModelRoute, ModelTransformerConfig, ReasoningConfig, RequestConfig, RequestRouteInfo, ResolvedTransformerChain, StreamChunk, TextContent,
|
|
433
|
+
export type { Annotation, ImageContent, LLMProvider, MessageContent, ModelRoute, ModelTransformerConfig, ReasoningConfig, RequestConfig, RequestRouteInfo, ResolvedTransformerChain, StreamChunk, TextContent, ThinkingContent, ToolCall, ToolChoice, ToolParameterSchema, TransformRequestResult, Transformer, TransformerChainConfig, TransformerConfigEntry, TransformerConstructor, TransformerContext, TransformerLogger, TransformerOptions, TransformerReference, TransformerServiceConfig, UnifiedChatRequest, UnifiedChatRequestMeta, UnifiedChatResponse, UnifiedMessage, UnifiedTool, UrlCitation };
|
package/dist/transformer.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-QVOB2DNX.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
4
|
+
var _chunkP7EM6BNDcjs = require('./chunk-P7EM6BND.cjs');
|
|
5
|
+
require('./chunk-ZQQUD66M.cjs');
|
|
6
|
+
require('./chunk-5LNYGCIW.cjs');
|
|
7
|
+
require('./chunk-CMVXX7ON.cjs');
|
|
8
8
|
require('./chunk-5RSZYQJH.cjs');
|
|
9
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-56QD3YW6.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkIIRPUVPHcjs = require('./chunk-IIRPUVPH.cjs');
|
|
@@ -14,10 +14,29 @@ require('./chunk-GBHYAGX3.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _chunk3OPYJG76cjs = require('./chunk-3OPYJG76.cjs');
|
|
17
|
-
require('./chunk-
|
|
18
|
-
require('./chunk-
|
|
17
|
+
require('./chunk-OC6DOOFX.cjs');
|
|
18
|
+
require('./chunk-RICPANBY.cjs');
|
|
19
|
+
require('./chunk-77USGNRW.cjs');
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
var _chunkAOFWNWLTcjs = require('./chunk-AOFWNWLT.cjs');
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
exports.THINK_LEVELS = _chunkAOFWNWLTcjs.THINK_LEVELS; exports.TransformerChainExecutor = _chunkIIRPUVPHcjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.extractReasoningIntent = _chunkAOFWNWLTcjs.extractReasoningIntent; exports.normalizeThinkLevel = _chunkAOFWNWLTcjs.normalizeThinkLevel; exports.registerBuiltinTransformers = _chunkP7EM6BNDcjs.registerBuiltinTransformers; exports.resolveReasoningEffort = _chunkAOFWNWLTcjs.resolveReasoningEffort; exports.resolveReasoningPlan = _chunkAOFWNWLTcjs.resolveReasoningPlan; exports.resolveReasoningTokenLimit = _chunkAOFWNWLTcjs.resolveReasoningTokenLimit; exports.resolveRequestReasoning = _chunkAOFWNWLTcjs.resolveRequestReasoning; exports.resolveTargetModelCapabilities = _chunkAOFWNWLTcjs.resolveTargetModelCapabilities;
|
package/dist/transformer.d.cts
CHANGED
|
@@ -1,9 +1,84 @@
|
|
|
1
1
|
export { ChainExecutionOptions, TransformerChainExecutor } from './transformer/TransformerChainExecutor.cjs';
|
|
2
2
|
export { TransformerService } from './transformer/TransformerService.cjs';
|
|
3
3
|
export { registerBuiltinTransformers } from './transformer/transformers.cjs';
|
|
4
|
-
|
|
4
|
+
import { ResolvedModelCapabilities } from '@omnicross/contracts/canonical-models';
|
|
5
|
+
import { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
6
|
+
export { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
7
|
+
import { ModelConfig } from '@omnicross/contracts/llm-config';
|
|
8
|
+
export { Annotation, ImageContent, LLMProvider, MessageContent, ModelRoute, ModelTransformerConfig, ReasoningConfig, RequestConfig, RequestRouteInfo, ResolvedTransformerChain, StreamChunk, TextContent, ThinkingContent, ToolCall, ToolChoice, ToolParameterSchema, TransformRequestResult, Transformer, TransformerChainConfig, TransformerConfigEntry, TransformerConstructor, TransformerContext, TransformerLogger, TransformerOptions, TransformerReference, TransformerServiceConfig, UnifiedChatRequest, UnifiedChatResponse, UnifiedMessage, UnifiedTool, UrlCitation } from './transformer/types.cjs';
|
|
5
9
|
import './transformer/transformers/AnthropicTransformer.cjs';
|
|
6
10
|
import './transformer/transformers/GeminiCodeAssistTransformer.cjs';
|
|
7
11
|
import './transformer/transformers/GeminiTransformer.cjs';
|
|
8
12
|
import './transformer/transformers/OpenAIResponseTransformer.cjs';
|
|
9
13
|
import './transformer/transformers/OpenAITransformer.cjs';
|
|
14
|
+
|
|
15
|
+
declare const THINK_LEVELS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
16
|
+
type ReasoningTarget = 'openai-chat' | 'openai-responses' | 'anthropic' | 'gemini';
|
|
17
|
+
interface ReasoningIntent {
|
|
18
|
+
effort?: ThinkLevel;
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
/** Explicit reasoning budget from a normalized request. */
|
|
21
|
+
max_tokens?: number;
|
|
22
|
+
}
|
|
23
|
+
type ReasoningPlan = {
|
|
24
|
+
kind: 'off';
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'level';
|
|
27
|
+
effort: ThinkLevel;
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'budget';
|
|
31
|
+
effort: ThinkLevel;
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
budgetTokens: number;
|
|
34
|
+
};
|
|
35
|
+
interface ResolveReasoningPlanInput {
|
|
36
|
+
intent?: ReasoningIntent;
|
|
37
|
+
model: string;
|
|
38
|
+
provider?: ReasoningProvider;
|
|
39
|
+
target: ReasoningTarget;
|
|
40
|
+
/** Caller-visible bound used by legacy token-budget APIs. */
|
|
41
|
+
requestMaxTokens?: number;
|
|
42
|
+
/** Preserve a recognized native effort on a same-format round trip. */
|
|
43
|
+
preserveNativeEffort?: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface ReasoningRequestLike {
|
|
46
|
+
model: string;
|
|
47
|
+
reasoning?: ReasoningIntent;
|
|
48
|
+
reasoning_effort?: unknown;
|
|
49
|
+
}
|
|
50
|
+
interface ResolveRequestReasoningOptions {
|
|
51
|
+
preserveNativeEffort?: boolean;
|
|
52
|
+
}
|
|
53
|
+
interface ReasoningProvider {
|
|
54
|
+
modelConfigs?: Array<Pick<ModelConfig, 'id'> & Partial<ModelConfig>>;
|
|
55
|
+
}
|
|
56
|
+
type TokenLimit = {
|
|
57
|
+
min: number;
|
|
58
|
+
max: number;
|
|
59
|
+
};
|
|
60
|
+
/** Normalize an untrusted wire value onto the shared seven-level domain. */
|
|
61
|
+
declare function normalizeThinkLevel(value: unknown): ThinkLevel | undefined;
|
|
62
|
+
/** Read normalized reasoning intent without mutating the request. */
|
|
63
|
+
declare function extractReasoningIntent(request: ReasoningRequestLike): ReasoningIntent | undefined;
|
|
64
|
+
/** Merge canonical metadata with the matching provider-row override. */
|
|
65
|
+
declare function resolveTargetModelCapabilities(targetModel: string, provider?: ReasoningProvider): ResolvedModelCapabilities;
|
|
66
|
+
/** Resolve an enabled effort to the nearest level supported by the target. */
|
|
67
|
+
declare function resolveReasoningEffort(requested: ThinkLevel, targetModel: string, provider?: ReasoningProvider): ThinkLevel;
|
|
68
|
+
/**
|
|
69
|
+
* Resolve token limits in provider-row → canonical → legacy regex → protocol
|
|
70
|
+
* fallback order. OpenAI discrete targets have no protocol budget fallback.
|
|
71
|
+
*/
|
|
72
|
+
declare function resolveReasoningTokenLimit(model: string, provider: ReasoningProvider | undefined, target: ReasoningTarget): TokenLimit | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Resolve normalized reasoning intent into one semantic plan. Protocol adapters
|
|
75
|
+
* consume this result and only encode its wire shape.
|
|
76
|
+
*/
|
|
77
|
+
declare function resolveReasoningPlan(input: ResolveReasoningPlanInput): ReasoningPlan | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Compatibility facade for callers that still consume a negotiated
|
|
80
|
+
* ReasoningIntent. New request builders should consume `resolveReasoningPlan`.
|
|
81
|
+
*/
|
|
82
|
+
declare function resolveRequestReasoning(request: ReasoningRequestLike, provider?: ReasoningProvider, options?: ResolveRequestReasoningOptions): ReasoningIntent | undefined;
|
|
83
|
+
|
|
84
|
+
export { type ReasoningIntent, type ReasoningPlan, type ReasoningProvider, type ReasoningTarget, type ResolveReasoningPlanInput, THINK_LEVELS, extractReasoningIntent, normalizeThinkLevel, resolveReasoningEffort, resolveReasoningPlan, resolveReasoningTokenLimit, resolveRequestReasoning, resolveTargetModelCapabilities };
|
package/dist/transformer.d.ts
CHANGED
|
@@ -1,9 +1,84 @@
|
|
|
1
1
|
export { ChainExecutionOptions, TransformerChainExecutor } from './transformer/TransformerChainExecutor.js';
|
|
2
2
|
export { TransformerService } from './transformer/TransformerService.js';
|
|
3
3
|
export { registerBuiltinTransformers } from './transformer/transformers.js';
|
|
4
|
-
|
|
4
|
+
import { ResolvedModelCapabilities } from '@omnicross/contracts/canonical-models';
|
|
5
|
+
import { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
6
|
+
export { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
7
|
+
import { ModelConfig } from '@omnicross/contracts/llm-config';
|
|
8
|
+
export { Annotation, ImageContent, LLMProvider, MessageContent, ModelRoute, ModelTransformerConfig, ReasoningConfig, RequestConfig, RequestRouteInfo, ResolvedTransformerChain, StreamChunk, TextContent, ThinkingContent, ToolCall, ToolChoice, ToolParameterSchema, TransformRequestResult, Transformer, TransformerChainConfig, TransformerConfigEntry, TransformerConstructor, TransformerContext, TransformerLogger, TransformerOptions, TransformerReference, TransformerServiceConfig, UnifiedChatRequest, UnifiedChatResponse, UnifiedMessage, UnifiedTool, UrlCitation } from './transformer/types.js';
|
|
5
9
|
import './transformer/transformers/AnthropicTransformer.js';
|
|
6
10
|
import './transformer/transformers/GeminiCodeAssistTransformer.js';
|
|
7
11
|
import './transformer/transformers/GeminiTransformer.js';
|
|
8
12
|
import './transformer/transformers/OpenAIResponseTransformer.js';
|
|
9
13
|
import './transformer/transformers/OpenAITransformer.js';
|
|
14
|
+
|
|
15
|
+
declare const THINK_LEVELS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
16
|
+
type ReasoningTarget = 'openai-chat' | 'openai-responses' | 'anthropic' | 'gemini';
|
|
17
|
+
interface ReasoningIntent {
|
|
18
|
+
effort?: ThinkLevel;
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
/** Explicit reasoning budget from a normalized request. */
|
|
21
|
+
max_tokens?: number;
|
|
22
|
+
}
|
|
23
|
+
type ReasoningPlan = {
|
|
24
|
+
kind: 'off';
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'level';
|
|
27
|
+
effort: ThinkLevel;
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'budget';
|
|
31
|
+
effort: ThinkLevel;
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
budgetTokens: number;
|
|
34
|
+
};
|
|
35
|
+
interface ResolveReasoningPlanInput {
|
|
36
|
+
intent?: ReasoningIntent;
|
|
37
|
+
model: string;
|
|
38
|
+
provider?: ReasoningProvider;
|
|
39
|
+
target: ReasoningTarget;
|
|
40
|
+
/** Caller-visible bound used by legacy token-budget APIs. */
|
|
41
|
+
requestMaxTokens?: number;
|
|
42
|
+
/** Preserve a recognized native effort on a same-format round trip. */
|
|
43
|
+
preserveNativeEffort?: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface ReasoningRequestLike {
|
|
46
|
+
model: string;
|
|
47
|
+
reasoning?: ReasoningIntent;
|
|
48
|
+
reasoning_effort?: unknown;
|
|
49
|
+
}
|
|
50
|
+
interface ResolveRequestReasoningOptions {
|
|
51
|
+
preserveNativeEffort?: boolean;
|
|
52
|
+
}
|
|
53
|
+
interface ReasoningProvider {
|
|
54
|
+
modelConfigs?: Array<Pick<ModelConfig, 'id'> & Partial<ModelConfig>>;
|
|
55
|
+
}
|
|
56
|
+
type TokenLimit = {
|
|
57
|
+
min: number;
|
|
58
|
+
max: number;
|
|
59
|
+
};
|
|
60
|
+
/** Normalize an untrusted wire value onto the shared seven-level domain. */
|
|
61
|
+
declare function normalizeThinkLevel(value: unknown): ThinkLevel | undefined;
|
|
62
|
+
/** Read normalized reasoning intent without mutating the request. */
|
|
63
|
+
declare function extractReasoningIntent(request: ReasoningRequestLike): ReasoningIntent | undefined;
|
|
64
|
+
/** Merge canonical metadata with the matching provider-row override. */
|
|
65
|
+
declare function resolveTargetModelCapabilities(targetModel: string, provider?: ReasoningProvider): ResolvedModelCapabilities;
|
|
66
|
+
/** Resolve an enabled effort to the nearest level supported by the target. */
|
|
67
|
+
declare function resolveReasoningEffort(requested: ThinkLevel, targetModel: string, provider?: ReasoningProvider): ThinkLevel;
|
|
68
|
+
/**
|
|
69
|
+
* Resolve token limits in provider-row → canonical → legacy regex → protocol
|
|
70
|
+
* fallback order. OpenAI discrete targets have no protocol budget fallback.
|
|
71
|
+
*/
|
|
72
|
+
declare function resolveReasoningTokenLimit(model: string, provider: ReasoningProvider | undefined, target: ReasoningTarget): TokenLimit | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Resolve normalized reasoning intent into one semantic plan. Protocol adapters
|
|
75
|
+
* consume this result and only encode its wire shape.
|
|
76
|
+
*/
|
|
77
|
+
declare function resolveReasoningPlan(input: ResolveReasoningPlanInput): ReasoningPlan | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Compatibility facade for callers that still consume a negotiated
|
|
80
|
+
* ReasoningIntent. New request builders should consume `resolveReasoningPlan`.
|
|
81
|
+
*/
|
|
82
|
+
declare function resolveRequestReasoning(request: ReasoningRequestLike, provider?: ReasoningProvider, options?: ResolveRequestReasoningOptions): ReasoningIntent | undefined;
|
|
83
|
+
|
|
84
|
+
export { type ReasoningIntent, type ReasoningPlan, type ReasoningProvider, type ReasoningTarget, type ResolveReasoningPlanInput, THINK_LEVELS, extractReasoningIntent, normalizeThinkLevel, resolveReasoningEffort, resolveReasoningPlan, resolveReasoningTokenLimit, resolveRequestReasoning, resolveTargetModelCapabilities };
|
package/dist/transformer.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-WTQMX2Q6.js";
|
|
2
2
|
import {
|
|
3
3
|
registerBuiltinTransformers
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-NGYOO5TO.js";
|
|
5
|
+
import "./chunk-HKB656B4.js";
|
|
6
|
+
import "./chunk-55FMGZ3L.js";
|
|
7
|
+
import "./chunk-45FHEOKW.js";
|
|
8
8
|
import "./chunk-FU7EAR73.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-CCVRRJOX.js";
|
|
10
10
|
import {
|
|
11
11
|
TransformerChainExecutor
|
|
12
12
|
} from "./chunk-WNKWAEUR.js";
|
|
@@ -14,10 +14,29 @@ import "./chunk-MZNPGW5Q.js";
|
|
|
14
14
|
import {
|
|
15
15
|
TransformerService
|
|
16
16
|
} from "./chunk-DK4A7DLE.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-2UTGX6FM.js";
|
|
18
|
+
import "./chunk-S3DYFEBE.js";
|
|
19
|
+
import "./chunk-WYVGULTQ.js";
|
|
20
|
+
import {
|
|
21
|
+
THINK_LEVELS,
|
|
22
|
+
extractReasoningIntent,
|
|
23
|
+
normalizeThinkLevel,
|
|
24
|
+
resolveReasoningEffort,
|
|
25
|
+
resolveReasoningPlan,
|
|
26
|
+
resolveReasoningTokenLimit,
|
|
27
|
+
resolveRequestReasoning,
|
|
28
|
+
resolveTargetModelCapabilities
|
|
29
|
+
} from "./chunk-N2EIM2XJ.js";
|
|
19
30
|
export {
|
|
31
|
+
THINK_LEVELS,
|
|
20
32
|
TransformerChainExecutor,
|
|
21
33
|
TransformerService,
|
|
22
|
-
|
|
34
|
+
extractReasoningIntent,
|
|
35
|
+
normalizeThinkLevel,
|
|
36
|
+
registerBuiltinTransformers,
|
|
37
|
+
resolveReasoningEffort,
|
|
38
|
+
resolveReasoningPlan,
|
|
39
|
+
resolveReasoningTokenLimit,
|
|
40
|
+
resolveRequestReasoning,
|
|
41
|
+
resolveTargetModelCapabilities
|
|
23
42
|
};
|
|
@@ -6,7 +6,7 @@ import { VoucherRecord, VoucherGrant, VoucherInfo, VoucherConfig } from '@omnicr
|
|
|
6
6
|
import { WebhookConfig } from '@omnicross/contracts/webhook-types';
|
|
7
7
|
import { L as Logger } from './logger-4GvQNzhE.js';
|
|
8
8
|
import { ProviderConfigSource } from './ports/provider-config-source.js';
|
|
9
|
-
import { P as ProviderProxy } from './ProviderProxy
|
|
9
|
+
import { P as ProviderProxy } from './ProviderProxy--ROec6VI.js';
|
|
10
10
|
import { ProviderProxyDeps } from './provider-proxy/types.js';
|
|
11
11
|
import { BoundAccountFallbackPolicy } from './pipeline/BoundAccountSelectionError.js';
|
|
12
12
|
import { c as KeySpend } from './keyPolicy-zdWTu3CQ.js';
|
|
@@ -6,7 +6,7 @@ import { VoucherRecord, VoucherGrant, VoucherInfo, VoucherConfig } from '@omnicr
|
|
|
6
6
|
import { WebhookConfig } from '@omnicross/contracts/webhook-types';
|
|
7
7
|
import { L as Logger } from './logger-4GvQNzhE.cjs';
|
|
8
8
|
import { ProviderConfigSource } from './ports/provider-config-source.cjs';
|
|
9
|
-
import { P as ProviderProxy } from './ProviderProxy-
|
|
9
|
+
import { P as ProviderProxy } from './ProviderProxy-QdwNV6l1.cjs';
|
|
10
10
|
import { ProviderProxyDeps } from './provider-proxy/types.cjs';
|
|
11
11
|
import { BoundAccountFallbackPolicy } from './pipeline/BoundAccountSelectionError.cjs';
|
|
12
12
|
import { c as KeySpend } from './keyPolicy-zdWTu3CQ.cjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkEPN67EGPcjs = require('../chunk-EPN67EGP.cjs');
|
|
4
4
|
require('../chunk-XSVNC2UD.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.UsageRecorder =
|
|
7
|
+
exports.UsageRecorder = _chunkEPN67EGPcjs.UsageRecorder;
|
|
@@ -32,6 +32,12 @@ interface UsageRecordInput {
|
|
|
32
32
|
rawUsage?: unknown;
|
|
33
33
|
/** Host run-correlation id. Optional / additive. */
|
|
34
34
|
runId?: string | null;
|
|
35
|
+
/** Token-free process-local Route Lease id. */
|
|
36
|
+
routeLeaseId?: string | null;
|
|
37
|
+
/** Bounded logical Route Lease consumer. */
|
|
38
|
+
routeLeaseConsumer?: string | null;
|
|
39
|
+
/** Bounded Route Lease stage attribution. */
|
|
40
|
+
routeLeaseStageId?: string | null;
|
|
35
41
|
/** Host event-correlation id for this call. Optional / additive. */
|
|
36
42
|
eventId?: string | null;
|
|
37
43
|
/** Safe prompt-cache-key provenance; raw key material is never recorded. */
|
|
@@ -32,6 +32,12 @@ interface UsageRecordInput {
|
|
|
32
32
|
rawUsage?: unknown;
|
|
33
33
|
/** Host run-correlation id. Optional / additive. */
|
|
34
34
|
runId?: string | null;
|
|
35
|
+
/** Token-free process-local Route Lease id. */
|
|
36
|
+
routeLeaseId?: string | null;
|
|
37
|
+
/** Bounded logical Route Lease consumer. */
|
|
38
|
+
routeLeaseConsumer?: string | null;
|
|
39
|
+
/** Bounded Route Lease stage attribution. */
|
|
40
|
+
routeLeaseStageId?: string | null;
|
|
35
41
|
/** Host event-correlation id for this call. Optional / additive. */
|
|
36
42
|
eventId?: string | null;
|
|
37
43
|
/** Safe prompt-cache-key provenance; raw key material is never recorded. */
|
package/dist/usage.cjs
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
var _chunk2E42SAW3cjs = require('./chunk-2E42SAW3.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkEPN67EGPcjs = require('./chunk-EPN67EGP.cjs');
|
|
8
8
|
require('./chunk-XSVNC2UD.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.PricingEngine = _chunk2E42SAW3cjs.PricingEngine; exports.UsageRecorder =
|
|
12
|
+
exports.PricingEngine = _chunk2E42SAW3cjs.PricingEngine; exports.UsageRecorder = _chunkEPN67EGPcjs.UsageRecorder;
|
package/dist/usage.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnicross/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Omnicross LLM serving core 鈥?provider dispatch, completion pipeline, transformers, and the provider proxy.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sayo (https://github.com/Dumoedss)",
|
|
File without changes
|
|
File without changes
|