@jsonstudio/llms 0.6.2979 → 0.6.3238
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/args-mapping.js +8 -0
- package/dist/conversion/{shared/bridge-actions.js → bridge-actions.js} +2 -1
- package/dist/conversion/{shared/bridge-id-utils.js → bridge-id-utils.js} +1 -1
- package/dist/conversion/{shared/bridge-instructions.js → bridge-instructions.js} +1 -1
- package/dist/conversion/{shared/bridge-message-utils.d.ts → bridge-message-utils.d.ts} +1 -1
- package/dist/conversion/{shared/bridge-message-utils.js → bridge-message-utils.js} +5 -149
- package/dist/conversion/{shared/bridge-metadata.js → bridge-metadata.js} +1 -1
- package/dist/conversion/{shared/bridge-policies.js → bridge-policies.js} +1 -1
- package/dist/conversion/codecs/gemini-openai-codec.js +27 -8
- package/dist/conversion/codecs/responses-openai-codec.js +1 -1
- package/dist/conversion/{shared/compaction-detect.d.ts → compaction-detect.d.ts} +1 -1
- package/dist/conversion/compaction-detect.js +4 -0
- package/dist/conversion/compat/actions/apply-patch-fixer.js +2 -2
- package/dist/conversion/compat/actions/deepseek-web-response.d.ts +0 -1
- package/dist/conversion/compat/actions/deepseek-web-response.js +15 -405
- package/dist/conversion/compat/actions/harvest-tool-calls-from-text.js +1 -1
- package/dist/conversion/compat/actions/lmstudio-responses-fc-ids.js +1 -1
- package/dist/conversion/compat/actions/qwen-transform.js +74 -2
- package/dist/conversion/compat/actions/snapshot.js +1 -1
- package/dist/conversion/compat/antigravity-session-signature.js +36 -0
- package/dist/conversion/compat/profiles/chat-deepseek-web.json +0 -22
- package/dist/conversion/compat/profiles/chat-glm.json +251 -72
- package/dist/conversion/compat/profiles/chat-iflow.json +174 -39
- package/dist/conversion/compat/profiles/chat-lmstudio.json +43 -14
- package/dist/conversion/hub/operation-table/operation-table-runner.js +2 -2
- package/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper.js +1 -1
- package/dist/conversion/hub/operation-table/semantic-mappers/archive/chat-mapper.archive.d.ts +8 -0
- package/dist/conversion/hub/operation-table/semantic-mappers/archive/chat-mapper.archive.js +404 -0
- package/dist/conversion/hub/operation-table/semantic-mappers/chat-mapper.js +5 -381
- package/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper.js +2 -2
- package/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.js +2 -8
- package/dist/conversion/hub/pipeline/hub-pipeline.d.ts +1 -0
- package/dist/conversion/hub/pipeline/hub-pipeline.js +50 -3
- package/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.d.ts +1 -1
- package/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.js +62 -0
- package/dist/conversion/hub/pipeline/stages/req_process/req_process_stage2_route_select/index.js +3 -1
- package/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/index.js +1 -1
- package/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/chat-process-semantics-bridge.d.ts +1 -1
- package/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.js +42 -29
- package/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage2_finalize/index.js +12 -0
- package/dist/conversion/hub/policy/protocol-spec.js +1 -1
- package/dist/conversion/hub/process/chat-process-clock-reminders.js +1 -1
- package/dist/conversion/hub/process/chat-process-clock-tools.js +1 -1
- package/dist/conversion/hub/process/chat-process-continue-execution.js +1 -1
- package/dist/conversion/hub/process/chat-process-servertool-orchestration.js +1 -1
- package/dist/conversion/hub/process/chat-process-web-search.js +1 -1
- package/dist/conversion/hub/response/provider-response.js +14 -5
- package/dist/conversion/hub/response/response-mappers.js +23 -1
- package/dist/conversion/hub/response/response-runtime.js +28 -5
- package/dist/conversion/hub/snapshot-recorder.js +3 -92
- package/dist/conversion/hub/tool-governance/engine.d.ts +8 -0
- package/dist/conversion/hub/tool-governance/engine.js +40 -193
- package/dist/conversion/hub/tool-governance/rules.js +73 -69
- package/dist/conversion/hub/tool-surface/tool-surface-engine.js +1 -1
- package/dist/conversion/index.d.ts +1 -2
- package/dist/conversion/index.js +1 -2
- package/dist/conversion/{shared/jsonish.js → jsonish.js} +1 -1
- package/dist/conversion/{shared/mcp-injection.js → mcp-injection.js} +1 -1
- package/dist/conversion/media.js +4 -0
- package/dist/conversion/{shared/metadata-passthrough.d.ts → metadata-passthrough.d.ts} +1 -1
- package/dist/conversion/{shared/metadata-passthrough.js → metadata-passthrough.js} +2 -2
- package/dist/conversion/payload-budget.js +47 -0
- package/dist/conversion/protocol-field-allowlists.d.ts +7 -0
- package/dist/conversion/protocol-field-allowlists.js +9 -0
- package/dist/conversion/{shared/protocol-state.d.ts → protocol-state.d.ts} +2 -2
- package/dist/conversion/{shared/protocol-state.js → protocol-state.js} +2 -2
- package/dist/conversion/{shared/errors.d.ts → provider-protocol-error.d.ts} +0 -3
- package/dist/conversion/provider-protocol-error.js +25 -0
- package/dist/conversion/responses/responses-openai-bridge/response-payload.js +8 -5
- package/dist/conversion/responses/responses-openai-bridge/types.d.ts +1 -1
- package/dist/conversion/responses/responses-openai-bridge.d.ts +1 -1
- package/dist/conversion/responses/responses-openai-bridge.js +43 -10
- package/dist/conversion/{shared/runtime-metadata.d.ts → runtime-metadata.d.ts} +1 -1
- package/dist/conversion/{shared/runtime-metadata.js → runtime-metadata.js} +2 -2
- package/dist/conversion/shared/anthropic-message-utils.js +19 -8
- package/dist/conversion/shared/chat-request-filters.d.ts +3 -4
- package/dist/conversion/shared/chat-request-filters.js +22 -78
- package/dist/conversion/shared/gemini-tool-utils.d.ts +1 -1
- package/dist/conversion/shared/openai-finalizer.js +1 -0
- package/dist/conversion/shared/openai-message-normalize.js +2 -2
- package/dist/conversion/shared/reasoning-normalizer.js +6 -0
- package/dist/conversion/shared/reasoning-utils.js +5 -2
- package/dist/conversion/shared/responses-conversation-store.js +1 -1
- package/dist/conversion/shared/responses-output-builder.js +55 -11
- package/dist/conversion/shared/responses-reasoning-registry.d.ts +14 -2
- package/dist/conversion/shared/responses-reasoning-registry.js +34 -6
- package/dist/conversion/shared/responses-response-utils.js +99 -9
- package/dist/conversion/shared/responses-tool-utils.js +1 -1
- package/dist/conversion/shared/text-markup-normalizer/normalize.d.ts +1 -1
- package/dist/conversion/shared/text-markup-normalizer.d.ts +2 -2
- package/dist/conversion/shared/text-markup-normalizer.js +1 -1
- package/dist/conversion/shared/tool-filter-pipeline.js +1 -1
- package/dist/conversion/shared/tool-governor.js +3 -3
- package/dist/conversion/shared/tool-mapping.d.ts +1 -1
- package/dist/conversion/{shared/snapshot-utils.d.ts → snapshot-utils.d.ts} +11 -0
- package/dist/conversion/{shared/snapshot-utils.js → snapshot-utils.js} +14 -23
- package/dist/conversion/types/text-markup-normalizer.d.ts +13 -0
- package/dist/conversion/types/text-markup-normalizer.js +1 -0
- package/dist/filters/special/request-tools-normalize.js +1 -1
- package/dist/filters/special/response-tool-text-canonicalize.js +2 -2
- package/dist/native/router_hotpath_napi.node +0 -0
- package/dist/quota/quota-manager.js +31 -59
- package/dist/quota/quota-state.js +14 -7
- package/dist/router/virtual-router/bootstrap/profile-builder.d.ts +1 -0
- package/dist/router/virtual-router/bootstrap/profile-builder.js +13 -0
- package/dist/router/virtual-router/bootstrap/provider-normalization.d.ts +2 -0
- package/dist/router/virtual-router/bootstrap/provider-normalization.js +4 -1
- package/dist/router/virtual-router/bootstrap/streaming-helpers.d.ts +7 -0
- package/dist/router/virtual-router/bootstrap/streaming-helpers.js +44 -0
- package/dist/router/virtual-router/bootstrap.js +2 -0
- package/dist/router/virtual-router/engine/routing-state/store.d.ts +1 -2
- package/dist/router/virtual-router/engine/routing-state/store.js +2 -2
- package/dist/router/virtual-router/engine-legacy/config.d.ts +11 -0
- package/dist/router/virtual-router/engine-legacy/config.js +108 -0
- package/dist/router/virtual-router/engine-legacy/direct-model.d.ts +10 -0
- package/dist/router/virtual-router/engine-legacy/direct-model.js +38 -0
- package/dist/router/virtual-router/engine-legacy/health.d.ts +13 -0
- package/dist/router/virtual-router/engine-legacy/health.js +104 -0
- package/dist/router/virtual-router/engine-legacy/helpers.d.ts +16 -0
- package/dist/router/virtual-router/engine-legacy/helpers.js +226 -0
- package/dist/router/virtual-router/engine-legacy/route-finalize.d.ts +9 -0
- package/dist/router/virtual-router/engine-legacy/route-finalize.js +84 -0
- package/dist/router/virtual-router/engine-legacy/route-selection.d.ts +17 -0
- package/dist/router/virtual-router/engine-legacy/route-selection.js +205 -0
- package/dist/router/virtual-router/engine-legacy/route-state-allowlist.d.ts +3 -0
- package/dist/router/virtual-router/engine-legacy/route-state-allowlist.js +36 -0
- package/dist/router/virtual-router/engine-legacy/route-state.d.ts +12 -0
- package/dist/router/virtual-router/engine-legacy/route-state.js +386 -0
- package/dist/router/virtual-router/engine-legacy/route-utils.d.ts +19 -0
- package/dist/router/virtual-router/engine-legacy/route-utils.js +212 -0
- package/dist/router/virtual-router/engine-legacy/routing.d.ts +8 -0
- package/dist/router/virtual-router/engine-legacy/routing.js +8 -0
- package/dist/router/virtual-router/engine-legacy/selection-core.d.ts +28 -0
- package/dist/router/virtual-router/engine-legacy/selection-core.js +112 -0
- package/dist/router/virtual-router/engine-legacy/selection-state.d.ts +16 -0
- package/dist/router/virtual-router/engine-legacy/selection-state.js +187 -0
- package/dist/router/virtual-router/engine-legacy/state-accessors.d.ts +21 -0
- package/dist/router/virtual-router/engine-legacy/state-accessors.js +118 -0
- package/dist/router/virtual-router/engine-legacy.d.ts +123 -0
- package/dist/router/virtual-router/engine-legacy.js +194 -0
- package/dist/router/virtual-router/engine-logging.d.ts +2 -0
- package/dist/router/virtual-router/engine-logging.js +7 -2
- package/dist/router/virtual-router/engine-selection/key-parsing.js +0 -3
- package/dist/router/virtual-router/engine-selection/native-chat-request-filter-semantics.d.ts +1 -0
- package/dist/router/virtual-router/engine-selection/native-chat-request-filter-semantics.js +54 -0
- package/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.d.ts +10 -0
- package/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.js +67 -0
- package/dist/router/virtual-router/engine-selection/native-hub-pipeline-governance-semantics.d.ts +30 -0
- package/dist/router/virtual-router/engine-selection/native-hub-pipeline-governance-semantics.js +202 -0
- package/dist/router/virtual-router/engine-selection/native-hub-pipeline-semantic-mappers.d.ts +2 -0
- package/dist/router/virtual-router/engine-selection/native-hub-pipeline-semantic-mappers.js +83 -0
- package/dist/router/virtual-router/engine-selection/native-router-hotpath-loader.js +43 -2
- package/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.d.ts +75 -0
- package/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.js +205 -0
- package/dist/router/virtual-router/engine-selection/native-snapshot-hooks.d.ts +3 -0
- package/dist/router/virtual-router/engine-selection/native-snapshot-hooks.js +109 -0
- package/dist/router/virtual-router/engine-selection/native-virtual-router-engine-proxy.d.ts +16 -0
- package/dist/router/virtual-router/engine-selection/native-virtual-router-engine-proxy.js +14 -0
- package/dist/router/virtual-router/engine-selection/native-virtual-router-routing-instructions-semantics.d.ts +2 -0
- package/dist/router/virtual-router/engine-selection/native-virtual-router-routing-instructions-semantics.js +86 -0
- package/dist/router/virtual-router/engine-selection/tier-selection-quota-integration.js +100 -0
- package/dist/router/virtual-router/engine-selection/tier-selection-select.js +99 -0
- package/dist/router/virtual-router/engine.d.ts +22 -105
- package/dist/router/virtual-router/engine.js +274 -1641
- package/dist/router/virtual-router/load-balancer.d.ts +8 -0
- package/dist/router/virtual-router/load-balancer.js +65 -2
- package/dist/router/virtual-router/provider-registry.js +2 -0
- package/dist/router/virtual-router/routing-instructions/clean.d.ts +3 -0
- package/dist/router/virtual-router/routing-instructions/clean.js +34 -0
- package/dist/router/virtual-router/routing-instructions/parse.d.ts +18 -0
- package/dist/router/virtual-router/routing-instructions/parse.js +377 -0
- package/dist/router/virtual-router/routing-instructions/state.d.ts +4 -0
- package/dist/router/virtual-router/routing-instructions/state.js +245 -0
- package/dist/router/virtual-router/routing-instructions/types.d.ts +70 -0
- package/dist/router/virtual-router/routing-instructions/types.js +2 -0
- package/dist/router/virtual-router/routing-instructions.d.ts +5 -89
- package/dist/router/virtual-router/routing-instructions.js +4 -655
- package/dist/router/virtual-router/sticky-session-store.d.ts +4 -0
- package/dist/router/virtual-router/sticky-session-store.js +19 -81
- package/dist/router/virtual-router/tool-signals.js +21 -3
- package/dist/router/virtual-router/types.d.ts +4 -0
- package/dist/servertool/clock/session-scope.js +32 -1
- package/dist/servertool/engine.js +79 -8
- package/dist/servertool/handlers/antigravity-thought-signature-bootstrap.js +1 -1
- package/dist/servertool/handlers/clock-auto.js +1 -1
- package/dist/servertool/handlers/clock.js +1 -1
- package/dist/servertool/handlers/compaction-detect.d.ts +1 -1
- package/dist/servertool/handlers/compaction-detect.js +1 -1
- package/dist/servertool/handlers/gemini-empty-reply-continue.js +1 -1
- package/dist/servertool/handlers/iflow-model-error-retry.js +1 -1
- package/dist/servertool/handlers/recursive-detection-guard.js +1 -1
- package/dist/servertool/handlers/review.js +1 -1
- package/dist/servertool/handlers/stop-message-auto/iflow-followup.js +1 -1
- package/dist/servertool/handlers/stop-message-auto/runtime-utils.js +1 -1
- package/dist/servertool/handlers/stop-message-auto.js +1 -1
- package/dist/servertool/handlers/vision.js +1 -1
- package/dist/servertool/handlers/web-search.js +1 -1
- package/dist/servertool/reenter-backend.js +1 -1
- package/dist/servertool/server-side-tools.js +2 -2
- package/dist/servertool/stop-gateway-context.js +1 -1
- package/dist/servertool/stop-message-compare-context.js +1 -1
- package/dist/sse/json-to-sse/event-generators/responses.d.ts +4 -0
- package/dist/sse/json-to-sse/event-generators/responses.js +95 -1
- package/dist/sse/json-to-sse/sequencers/responses-sequencer.js +6 -4
- package/dist/sse/sse-to-json/builders/response-builder.d.ts +8 -0
- package/dist/sse/sse-to-json/builders/response-builder.js +162 -4
- package/dist/sse/sse-to-json/responses-sse-to-json-converter.js +2 -0
- package/dist/sse/types/responses-types.d.ts +6 -2
- package/dist/tools/apply-patch/structured/coercion.js +5 -0
- package/dist/tools/args-json.js +29 -0
- package/package.json +8 -5
- package/dist/conversion/shared/args-mapping.js +0 -77
- package/dist/conversion/shared/compaction-detect.js +0 -4
- package/dist/conversion/shared/errors.js +0 -31
- package/dist/conversion/shared/media.js +0 -4
- package/dist/conversion/shared/payload-budget.js +0 -165
- package/dist/conversion/shared/protocol-field-allowlists.d.ts +0 -7
- package/dist/conversion/shared/protocol-field-allowlists.js +0 -149
- package/dist/conversion/shared/snapshot-hooks.d.ts +0 -11
- package/dist/conversion/shared/snapshot-hooks.js +0 -503
- package/dist/conversion/shared/text-markup-normalizer/extractors-apply-patch.d.ts +0 -2
- package/dist/conversion/shared/text-markup-normalizer/extractors-apply-patch.js +0 -129
- package/dist/conversion/shared/text-markup-normalizer/extractors-json.d.ts +0 -4
- package/dist/conversion/shared/text-markup-normalizer/extractors-json.js +0 -637
- package/dist/conversion/shared/text-markup-normalizer/extractors-shared.d.ts +0 -21
- package/dist/conversion/shared/text-markup-normalizer/extractors-shared.js +0 -177
- package/dist/conversion/shared/text-markup-normalizer/extractors-transcript.d.ts +0 -5
- package/dist/conversion/shared/text-markup-normalizer/extractors-transcript.js +0 -385
- package/dist/conversion/shared/text-markup-normalizer/extractors-xml.d.ts +0 -10
- package/dist/conversion/shared/text-markup-normalizer/extractors-xml.js +0 -602
- package/dist/conversion/shared/text-markup-normalizer/extractors.d.ts +0 -5
- package/dist/conversion/shared/text-markup-normalizer/extractors.js +0 -4
- package/dist/conversion/shared/tool-canonicalizer.d.ts +0 -2
- package/dist/conversion/shared/tool-canonicalizer.js +0 -38
- /package/dist/conversion/{shared/args-mapping.d.ts → args-mapping.d.ts} +0 -0
- /package/dist/conversion/{shared/bridge-actions.d.ts → bridge-actions.d.ts} +0 -0
- /package/dist/conversion/{shared/bridge-id-utils.d.ts → bridge-id-utils.d.ts} +0 -0
- /package/dist/conversion/{shared/bridge-instructions.d.ts → bridge-instructions.d.ts} +0 -0
- /package/dist/conversion/{shared/bridge-metadata.d.ts → bridge-metadata.d.ts} +0 -0
- /package/dist/conversion/{shared/bridge-policies.d.ts → bridge-policies.d.ts} +0 -0
- /package/dist/conversion/{shared/jsonish.d.ts → jsonish.d.ts} +0 -0
- /package/dist/conversion/{shared/mcp-injection.d.ts → mcp-injection.d.ts} +0 -0
- /package/dist/conversion/{shared/media.d.ts → media.d.ts} +0 -0
- /package/dist/conversion/{shared/payload-budget.d.ts → payload-budget.d.ts} +0 -0
- /package/dist/conversion/{shared → types}/bridge-message-types.d.ts +0 -0
- /package/dist/conversion/{shared → types}/bridge-message-types.js +0 -0
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
"protocol": "openai-chat",
|
|
4
4
|
"request": {
|
|
5
5
|
"mappings": [
|
|
6
|
-
{
|
|
7
|
-
|
|
6
|
+
{
|
|
7
|
+
"action": "snapshot",
|
|
8
|
+
"phase": "compat-pre"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"action": "dto_unwrap"
|
|
12
|
+
},
|
|
8
13
|
{
|
|
9
14
|
"action": "remove",
|
|
10
15
|
"path": "metadata.toolCallIdStyle"
|
|
@@ -38,7 +43,12 @@
|
|
|
38
43
|
"web_search"
|
|
39
44
|
],
|
|
40
45
|
"messages": {
|
|
41
|
-
"allowedRoles": [
|
|
46
|
+
"allowedRoles": [
|
|
47
|
+
"system",
|
|
48
|
+
"user",
|
|
49
|
+
"assistant",
|
|
50
|
+
"tool"
|
|
51
|
+
],
|
|
42
52
|
"assistantWithToolCallsContentNull": true,
|
|
43
53
|
"toolContentStringify": false
|
|
44
54
|
},
|
|
@@ -47,7 +57,9 @@
|
|
|
47
57
|
"normalize": false,
|
|
48
58
|
"forceToolChoiceAuto": true
|
|
49
59
|
},
|
|
50
|
-
"assistantToolCalls": {
|
|
60
|
+
"assistantToolCalls": {
|
|
61
|
+
"functionArgumentsType": "string"
|
|
62
|
+
}
|
|
51
63
|
},
|
|
52
64
|
"response": {
|
|
53
65
|
"allowTopLevel": [
|
|
@@ -68,30 +80,74 @@
|
|
|
68
80
|
"choices": {
|
|
69
81
|
"required": true,
|
|
70
82
|
"message": {
|
|
71
|
-
"allow": [
|
|
83
|
+
"allow": [
|
|
84
|
+
"role",
|
|
85
|
+
"content",
|
|
86
|
+
"reasoning_content",
|
|
87
|
+
"audio",
|
|
88
|
+
"tool_calls"
|
|
89
|
+
],
|
|
72
90
|
"roleDefault": "assistant",
|
|
73
91
|
"contentNullWhenToolCalls": true,
|
|
74
|
-
"tool_calls": {
|
|
92
|
+
"tool_calls": {
|
|
93
|
+
"function": {
|
|
94
|
+
"nameRequired": true,
|
|
95
|
+
"argumentsType": "string"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
75
98
|
},
|
|
76
|
-
"finish_reason": [
|
|
99
|
+
"finish_reason": [
|
|
100
|
+
"stop",
|
|
101
|
+
"tool_calls",
|
|
102
|
+
"length",
|
|
103
|
+
"sensitive",
|
|
104
|
+
"network_error"
|
|
105
|
+
]
|
|
77
106
|
},
|
|
78
107
|
"usage": {
|
|
79
|
-
"allow": [
|
|
108
|
+
"allow": [
|
|
109
|
+
"prompt_tokens",
|
|
110
|
+
"completion_tokens",
|
|
111
|
+
"prompt_tokens_details",
|
|
112
|
+
"total_tokens"
|
|
113
|
+
]
|
|
80
114
|
}
|
|
81
115
|
}
|
|
82
116
|
}
|
|
83
117
|
},
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
|
|
118
|
+
{
|
|
119
|
+
"action": "iflow_kimi_history_media_placeholder"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"action": "iflow_kimi_cli_defaults"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"action": "iflow_kimi_thinking_reasoning_fill"
|
|
126
|
+
},
|
|
87
127
|
{
|
|
88
128
|
"action": "field_map",
|
|
89
129
|
"direction": "incoming",
|
|
90
130
|
"config": [
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
131
|
+
{
|
|
132
|
+
"sourcePath": "usage.prompt_tokens",
|
|
133
|
+
"targetPath": "usage.input_tokens",
|
|
134
|
+
"type": "number"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"sourcePath": "usage.completion_tokens",
|
|
138
|
+
"targetPath": "usage.output_tokens",
|
|
139
|
+
"type": "number"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"sourcePath": "created",
|
|
143
|
+
"targetPath": "created_at",
|
|
144
|
+
"type": "number"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"sourcePath": "request_id",
|
|
148
|
+
"targetPath": "request_id",
|
|
149
|
+
"type": "string"
|
|
150
|
+
},
|
|
95
151
|
{
|
|
96
152
|
"sourcePath": "model",
|
|
97
153
|
"targetPath": "model",
|
|
@@ -105,25 +161,43 @@
|
|
|
105
161
|
}
|
|
106
162
|
]
|
|
107
163
|
},
|
|
108
|
-
{
|
|
164
|
+
{
|
|
165
|
+
"action": "tool_schema_sanitize",
|
|
166
|
+
"mode": "glm_shell"
|
|
167
|
+
},
|
|
109
168
|
{
|
|
110
169
|
"action": "iflow_tool_text_fallback",
|
|
111
|
-
"models": [
|
|
170
|
+
"models": [
|
|
171
|
+
"minimax-m2.5"
|
|
172
|
+
]
|
|
112
173
|
},
|
|
113
174
|
{
|
|
114
175
|
"action": "iflow_web_search_request"
|
|
115
176
|
},
|
|
116
|
-
{
|
|
117
|
-
|
|
177
|
+
{
|
|
178
|
+
"action": "snapshot",
|
|
179
|
+
"phase": "compat-post"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"action": "dto_rewrap"
|
|
183
|
+
}
|
|
118
184
|
]
|
|
119
185
|
},
|
|
120
186
|
"response": {
|
|
121
187
|
"mappings": [
|
|
122
|
-
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{
|
|
188
|
+
{
|
|
189
|
+
"action": "snapshot",
|
|
190
|
+
"phase": "compat-pre"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"action": "dto_unwrap"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"action": "iflow_response_body_unwrap"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"action": "strip_orphan_function_calls_tag"
|
|
200
|
+
},
|
|
127
201
|
{
|
|
128
202
|
"action": "shape_filter",
|
|
129
203
|
"target": "response",
|
|
@@ -144,7 +218,12 @@
|
|
|
144
218
|
"response_format"
|
|
145
219
|
],
|
|
146
220
|
"messages": {
|
|
147
|
-
"allowedRoles": [
|
|
221
|
+
"allowedRoles": [
|
|
222
|
+
"system",
|
|
223
|
+
"user",
|
|
224
|
+
"assistant",
|
|
225
|
+
"tool"
|
|
226
|
+
],
|
|
148
227
|
"assistantWithToolCallsContentNull": true,
|
|
149
228
|
"toolContentStringify": false
|
|
150
229
|
},
|
|
@@ -153,7 +232,9 @@
|
|
|
153
232
|
"normalize": false,
|
|
154
233
|
"forceToolChoiceAuto": true
|
|
155
234
|
},
|
|
156
|
-
"assistantToolCalls": {
|
|
235
|
+
"assistantToolCalls": {
|
|
236
|
+
"functionArgumentsType": "string"
|
|
237
|
+
}
|
|
157
238
|
},
|
|
158
239
|
"response": {
|
|
159
240
|
"allowTopLevel": [
|
|
@@ -174,15 +255,37 @@
|
|
|
174
255
|
"choices": {
|
|
175
256
|
"required": true,
|
|
176
257
|
"message": {
|
|
177
|
-
"allow": [
|
|
258
|
+
"allow": [
|
|
259
|
+
"role",
|
|
260
|
+
"content",
|
|
261
|
+
"reasoning_content",
|
|
262
|
+
"audio",
|
|
263
|
+
"tool_calls"
|
|
264
|
+
],
|
|
178
265
|
"roleDefault": "assistant",
|
|
179
266
|
"contentNullWhenToolCalls": true,
|
|
180
|
-
"tool_calls": {
|
|
267
|
+
"tool_calls": {
|
|
268
|
+
"function": {
|
|
269
|
+
"nameRequired": true,
|
|
270
|
+
"argumentsType": "string"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
181
273
|
},
|
|
182
|
-
"finish_reason": [
|
|
274
|
+
"finish_reason": [
|
|
275
|
+
"stop",
|
|
276
|
+
"tool_calls",
|
|
277
|
+
"length",
|
|
278
|
+
"sensitive",
|
|
279
|
+
"network_error"
|
|
280
|
+
]
|
|
183
281
|
},
|
|
184
282
|
"usage": {
|
|
185
|
-
"allow": [
|
|
283
|
+
"allow": [
|
|
284
|
+
"prompt_tokens",
|
|
285
|
+
"completion_tokens",
|
|
286
|
+
"prompt_tokens_details",
|
|
287
|
+
"total_tokens"
|
|
288
|
+
]
|
|
186
289
|
}
|
|
187
290
|
}
|
|
188
291
|
}
|
|
@@ -191,12 +294,36 @@
|
|
|
191
294
|
"action": "field_map",
|
|
192
295
|
"direction": "outgoing",
|
|
193
296
|
"config": [
|
|
194
|
-
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
{
|
|
297
|
+
{
|
|
298
|
+
"sourcePath": "usage.input_tokens",
|
|
299
|
+
"targetPath": "usage.prompt_tokens",
|
|
300
|
+
"type": "number"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"sourcePath": "usage.output_tokens",
|
|
304
|
+
"targetPath": "usage.completion_tokens",
|
|
305
|
+
"type": "number"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"sourcePath": "usage.total_input_tokens",
|
|
309
|
+
"targetPath": "usage.prompt_tokens",
|
|
310
|
+
"type": "number"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"sourcePath": "usage.total_output_tokens",
|
|
314
|
+
"targetPath": "usage.completion_tokens",
|
|
315
|
+
"type": "number"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"sourcePath": "created_at",
|
|
319
|
+
"targetPath": "created",
|
|
320
|
+
"type": "number"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"sourcePath": "request_id",
|
|
324
|
+
"targetPath": "request_id",
|
|
325
|
+
"type": "string"
|
|
326
|
+
},
|
|
200
327
|
{
|
|
201
328
|
"sourcePath": "choices[*].finish_reason",
|
|
202
329
|
"targetPath": "choices[*].finish_reason",
|
|
@@ -210,9 +337,17 @@
|
|
|
210
337
|
}
|
|
211
338
|
]
|
|
212
339
|
},
|
|
213
|
-
{
|
|
214
|
-
|
|
215
|
-
|
|
340
|
+
{
|
|
341
|
+
"action": "tool_schema_sanitize",
|
|
342
|
+
"mode": "glm_shell"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"action": "snapshot",
|
|
346
|
+
"phase": "compat-post"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"action": "dto_rewrap"
|
|
350
|
+
}
|
|
216
351
|
]
|
|
217
352
|
}
|
|
218
353
|
}
|
|
@@ -3,27 +3,51 @@
|
|
|
3
3
|
"protocol": "",
|
|
4
4
|
"request": {
|
|
5
5
|
"mappings": [
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
6
|
+
{
|
|
7
|
+
"action": "snapshot",
|
|
8
|
+
"phase": "compat-pre"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"action": "dto_unwrap"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"action": "lmstudio_responses_input_stringify"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"action": "normalize_tool_call_ids"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"action": "lmstudio_responses_fc_ids"
|
|
21
|
+
},
|
|
11
22
|
{
|
|
12
23
|
"action": "normalize_tool_choice",
|
|
13
24
|
"path": "tool_choice",
|
|
14
25
|
"objectReplacement": "required"
|
|
15
26
|
},
|
|
16
|
-
{
|
|
17
|
-
|
|
27
|
+
{
|
|
28
|
+
"action": "snapshot",
|
|
29
|
+
"phase": "compat-post"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"action": "dto_rewrap"
|
|
33
|
+
}
|
|
18
34
|
]
|
|
19
35
|
},
|
|
20
36
|
"response": {
|
|
21
37
|
"mappings": [
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
38
|
+
{
|
|
39
|
+
"action": "snapshot",
|
|
40
|
+
"phase": "compat-pre"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"action": "dto_unwrap"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"action": "strip_orphan_function_calls_tag"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"action": "normalize_tool_call_ids"
|
|
50
|
+
},
|
|
27
51
|
{
|
|
28
52
|
"action": "set_default",
|
|
29
53
|
"path": "object",
|
|
@@ -44,8 +68,13 @@
|
|
|
44
68
|
"path": "model",
|
|
45
69
|
"value": "unknown"
|
|
46
70
|
},
|
|
47
|
-
{
|
|
48
|
-
|
|
71
|
+
{
|
|
72
|
+
"action": "snapshot",
|
|
73
|
+
"phase": "compat-post"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"action": "dto_rewrap"
|
|
77
|
+
}
|
|
49
78
|
]
|
|
50
79
|
}
|
|
51
80
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createBridgeActionState, runBridgeActionPipeline } from '../../
|
|
2
|
-
import { resolveBridgePolicy, resolvePolicyActions } from '../../
|
|
1
|
+
import { createBridgeActionState, runBridgeActionPipeline } from '../../bridge-actions.js';
|
|
2
|
+
import { resolveBridgePolicy, resolvePolicyActions } from '../../bridge-policies.js';
|
|
3
3
|
import { normalizeProviderProtocolTokenWithNative } from '../../../router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.js';
|
|
4
4
|
const INBOUND_BRIDGE_SPECS = {
|
|
5
5
|
'openai-chat': { protocol: 'openai-chat', stage: 'request_inbound', messages: 'chat_envelope' },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isJsonObject, jsonClone } from '../../types/json.js';
|
|
2
2
|
import { buildOpenAIChatFromAnthropic, buildAnthropicRequestFromOpenAIChat } from '../../../codecs/anthropic-openai-codec.js';
|
|
3
|
-
import { encodeMetadataPassthrough, extractMetadataPassthrough } from '../../../
|
|
3
|
+
import { encodeMetadataPassthrough, extractMetadataPassthrough } from '../../../metadata-passthrough.js';
|
|
4
4
|
import { buildAnthropicToolAliasMapWithNative } from '../../../../router/virtual-router/engine-selection/native-chat-process-governance-semantics.js';
|
|
5
5
|
import { ChatSemanticMapper } from './chat-mapper.js';
|
|
6
6
|
const ANTHROPIC_PARAMETER_KEYS = [
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SemanticMapper } from '../../../format-adapters/index.js';
|
|
2
|
+
import type { AdapterContext, ChatEnvelope } from '../../../types/chat-envelope.js';
|
|
3
|
+
import type { FormatEnvelope } from '../../../types/format-envelope.js';
|
|
4
|
+
export declare function maybeAugmentApplyPatchErrorContent(content: string, toolName?: string): string;
|
|
5
|
+
export declare class ChatSemanticMapper implements SemanticMapper {
|
|
6
|
+
toChat(format: FormatEnvelope, ctx: AdapterContext): Promise<ChatEnvelope>;
|
|
7
|
+
fromChat(chat: ChatEnvelope, ctx: AdapterContext): Promise<FormatEnvelope>;
|
|
8
|
+
}
|