@jsonstudio/llms 0.6.34 → 0.6.74
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/conversion/codecs/gemini-openai-codec.js +1 -2
- package/dist/conversion/codecs/responses-openai-codec.js +16 -1
- package/dist/conversion/compat/profiles/chat-glm.json +17 -0
- package/dist/conversion/compat/profiles/chat-iflow.json +36 -0
- package/dist/conversion/compat/profiles/chat-lmstudio.json +37 -0
- package/dist/conversion/compat/profiles/chat-qwen.json +18 -0
- package/dist/conversion/compat/profiles/responses-c4m.json +45 -0
- package/dist/conversion/config/compat-profiles.json +38 -0
- package/dist/conversion/config/sample-config.json +314 -0
- package/dist/conversion/config/version-switch.json +150 -0
- package/dist/conversion/hub/pipeline/compat/compat-engine.d.ts +4 -0
- package/dist/conversion/hub/pipeline/compat/compat-engine.js +667 -0
- package/dist/conversion/hub/pipeline/compat/compat-profile-store.d.ts +2 -0
- package/dist/conversion/hub/pipeline/compat/compat-profile-store.js +76 -0
- package/dist/conversion/hub/pipeline/compat/compat-types.d.ts +62 -0
- package/dist/conversion/hub/pipeline/compat/compat-types.js +1 -0
- package/dist/conversion/hub/pipeline/hub-pipeline.d.ts +1 -0
- package/dist/conversion/hub/pipeline/hub-pipeline.js +76 -28
- package/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/index.js +0 -13
- package/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.d.ts +14 -0
- package/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.js +23 -0
- package/dist/conversion/hub/response/provider-response.js +18 -0
- package/dist/conversion/hub/response/response-mappers.d.ts +1 -1
- package/dist/conversion/hub/response/response-mappers.js +2 -12
- package/dist/conversion/responses/responses-openai-bridge.d.ts +1 -0
- package/dist/conversion/responses/responses-openai-bridge.js +71 -0
- package/dist/conversion/shared/responses-output-builder.js +22 -43
- package/dist/conversion/shared/responses-response-utils.js +1 -47
- package/dist/conversion/shared/text-markup-normalizer.js +2 -2
- package/dist/conversion/shared/tool-canonicalizer.js +16 -118
- package/dist/conversion/shared/tool-filter-pipeline.js +63 -21
- package/dist/conversion/shared/tool-mapping.js +52 -32
- package/dist/filters/config/openai-openai.fieldmap.json +18 -0
- package/dist/filters/special/request-tools-normalize.js +20 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/router/virtual-router/bootstrap.js +18 -33
- package/dist/router/virtual-router/classifier.js +51 -77
- package/dist/router/virtual-router/features.js +338 -111
- package/dist/router/virtual-router/types.d.ts +2 -4
- package/dist/router/virtual-router/types.js +2 -2
- package/dist/sse/sse-to-json/builders/response-builder.js +1 -0
- package/dist/tools/tool-registry.js +4 -3
- package/package.json +3 -3
|
@@ -5,7 +5,6 @@ import type { StandardizedRequest } from '../../conversion/hub/types/standardize
|
|
|
5
5
|
export declare const DEFAULT_ROUTE = "default";
|
|
6
6
|
export declare const ROUTE_PRIORITY: string[];
|
|
7
7
|
export type RoutingPools = Record<string, string[]>;
|
|
8
|
-
export type PreviousToolCategory = 'context_read' | 'plan' | 'vision' | 'coding';
|
|
9
8
|
export interface ProviderAuthConfig {
|
|
10
9
|
type: 'apiKey' | 'oauth';
|
|
11
10
|
secretRef?: string;
|
|
@@ -48,14 +47,12 @@ export interface ProviderRuntimeProfile {
|
|
|
48
47
|
processMode?: 'chat' | 'passthrough';
|
|
49
48
|
responsesConfig?: ResponsesProviderConfig;
|
|
50
49
|
}
|
|
51
|
-
export type RouteKeywordCategory = 'thinking' | 'background' | 'vision' | 'coding';
|
|
52
50
|
export interface VirtualRouterClassifierConfig {
|
|
53
51
|
longContextThresholdTokens?: number;
|
|
54
52
|
thinkingKeywords?: string[];
|
|
55
53
|
codingKeywords?: string[];
|
|
56
54
|
backgroundKeywords?: string[];
|
|
57
55
|
visionKeywords?: string[];
|
|
58
|
-
keywordInjections?: Partial<Record<RouteKeywordCategory, string[]>>;
|
|
59
56
|
}
|
|
60
57
|
export interface LoadBalancingPolicy {
|
|
61
58
|
strategy: 'round-robin' | 'weighted' | 'sticky';
|
|
@@ -114,7 +111,8 @@ export interface RoutingFeatures {
|
|
|
114
111
|
hasCodingTool: boolean;
|
|
115
112
|
hasThinkingKeyword: boolean;
|
|
116
113
|
estimatedTokens: number;
|
|
117
|
-
|
|
114
|
+
lastAssistantToolCategory?: 'read' | 'write' | 'search' | 'other';
|
|
115
|
+
lastAssistantToolName?: string;
|
|
118
116
|
metadata: RouterMetadataInput;
|
|
119
117
|
}
|
|
120
118
|
export interface ClassificationResult {
|
|
@@ -95,11 +95,12 @@ export function validateToolCall(name, argsString) {
|
|
|
95
95
|
const rawArgs = tryParseJson(typeof argsString === 'string' ? argsString : '{}');
|
|
96
96
|
switch (normalizedName) {
|
|
97
97
|
case 'apply_patch': {
|
|
98
|
-
const
|
|
98
|
+
const input = asString(rawArgs.input);
|
|
99
|
+
const patch = asString(rawArgs.patch) ?? input;
|
|
99
100
|
if (!patch) {
|
|
100
|
-
return { ok: false, reason: '
|
|
101
|
+
return { ok: false, reason: 'missing_input' };
|
|
101
102
|
}
|
|
102
|
-
return { ok: true, normalizedArgs: toJson({ patch }) };
|
|
103
|
+
return { ok: true, normalizedArgs: toJson({ input: patch, patch }) };
|
|
103
104
|
}
|
|
104
105
|
case 'shell': {
|
|
105
106
|
const rawCommand = rawArgs.command;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsonstudio/llms",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.074",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "node scripts/bump-version.mjs && tsc -p tsconfig.json",
|
|
10
|
-
"build:dev": "node scripts/bump-version.mjs && tsc -p tsconfig.json",
|
|
9
|
+
"build": "node scripts/bump-version.mjs && tsc -p tsconfig.json && node scripts/tools/copy-compat-profiles.mjs",
|
|
10
|
+
"build:dev": "node scripts/bump-version.mjs && tsc -p tsconfig.json && node scripts/tools/copy-compat-profiles.mjs",
|
|
11
11
|
"lint": "eslint --no-eslintrc -c .eslintrc.json src --ext .ts --no-cache",
|
|
12
12
|
"lint:fix": "eslint --no-eslintrc -c .eslintrc.json src --ext .ts --no-cache --fix",
|
|
13
13
|
"postbuild": "node scripts/tests/run-matrix-ci.mjs",
|