@jsonstudio/rcc 0.89.333 → 0.89.548

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.
Files changed (191) hide show
  1. package/dist/build-info.js +3 -3
  2. package/dist/build-info.js.map +1 -1
  3. package/dist/cli.js +110 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/token-daemon.d.ts +2 -0
  6. package/dist/commands/token-daemon.js +183 -0
  7. package/dist/commands/token-daemon.js.map +1 -0
  8. package/dist/index.js +20 -3
  9. package/dist/index.js.map +1 -1
  10. package/dist/modules/llmswitch/bridge.d.ts +1 -1
  11. package/dist/modules/llmswitch/bridge.js +3 -2
  12. package/dist/modules/llmswitch/bridge.js.map +1 -1
  13. package/dist/modules/pipeline/utils/colored-logger.js +3 -1
  14. package/dist/modules/pipeline/utils/colored-logger.js.map +1 -1
  15. package/dist/providers/auth/gemini-cli-userinfo-helper.js +12 -2
  16. package/dist/providers/auth/gemini-cli-userinfo-helper.js.map +1 -1
  17. package/dist/providers/auth/oauth-lifecycle.js +337 -25
  18. package/dist/providers/auth/oauth-lifecycle.js.map +1 -1
  19. package/dist/providers/core/config/oauth-flows.d.ts +23 -0
  20. package/dist/providers/core/config/oauth-flows.js +92 -5
  21. package/dist/providers/core/config/oauth-flows.js.map +1 -1
  22. package/dist/providers/core/config/provider-oauth-configs.js +9 -3
  23. package/dist/providers/core/config/provider-oauth-configs.js.map +1 -1
  24. package/dist/providers/core/config/service-profiles.js +18 -10
  25. package/dist/providers/core/config/service-profiles.js.map +1 -1
  26. package/dist/providers/core/runtime/base-provider.d.ts +2 -0
  27. package/dist/providers/core/runtime/base-provider.js +35 -1
  28. package/dist/providers/core/runtime/base-provider.js.map +1 -1
  29. package/dist/providers/core/runtime/gemini-cli-http-provider.js +87 -20
  30. package/dist/providers/core/runtime/gemini-cli-http-provider.js.map +1 -1
  31. package/dist/providers/core/runtime/http-request-executor.d.ts +1 -0
  32. package/dist/providers/core/runtime/http-request-executor.js +75 -1
  33. package/dist/providers/core/runtime/http-request-executor.js.map +1 -1
  34. package/dist/providers/core/runtime/http-transport-provider.d.ts +2 -0
  35. package/dist/providers/core/runtime/http-transport-provider.js +60 -2
  36. package/dist/providers/core/runtime/http-transport-provider.js.map +1 -1
  37. package/dist/providers/core/runtime/iflow-http-provider.d.ts +4 -0
  38. package/dist/providers/core/runtime/iflow-http-provider.js +28 -0
  39. package/dist/providers/core/runtime/iflow-http-provider.js.map +1 -1
  40. package/dist/providers/core/runtime/rate-limit-manager.d.ts +30 -0
  41. package/dist/providers/core/runtime/rate-limit-manager.js +136 -0
  42. package/dist/providers/core/runtime/rate-limit-manager.js.map +1 -0
  43. package/dist/providers/core/runtime/responses-provider.js +8 -3
  44. package/dist/providers/core/runtime/responses-provider.js.map +1 -1
  45. package/dist/providers/core/runtime/vision-debug-utils.d.ts +13 -0
  46. package/dist/providers/core/runtime/vision-debug-utils.js +114 -0
  47. package/dist/providers/core/runtime/vision-debug-utils.js.map +1 -0
  48. package/dist/providers/core/strategies/oauth-auth-code-flow.js +75 -26
  49. package/dist/providers/core/strategies/oauth-auth-code-flow.js.map +1 -1
  50. package/dist/providers/core/utils/http-client.js +2 -1
  51. package/dist/providers/core/utils/http-client.js.map +1 -1
  52. package/dist/providers/core/utils/provider-error-reporter.js +31 -5
  53. package/dist/providers/core/utils/provider-error-reporter.js.map +1 -1
  54. package/dist/providers/core/utils/provider-type-utils.js +1 -1
  55. package/dist/providers/core/utils/provider-type-utils.js.map +1 -1
  56. package/dist/providers/core/utils/snapshot-writer.d.ts +1 -1
  57. package/dist/providers/core/utils/snapshot-writer.js.map +1 -1
  58. package/dist/server/handlers/sse-dispatcher.js +22 -2
  59. package/dist/server/handlers/sse-dispatcher.js.map +1 -1
  60. package/dist/server/runtime/http-server/index.d.ts +9 -0
  61. package/dist/server/runtime/http-server/index.js +512 -144
  62. package/dist/server/runtime/http-server/index.js.map +1 -1
  63. package/dist/server/runtime/http-server/provider-utils.js +1 -1
  64. package/dist/server/runtime/http-server/provider-utils.js.map +1 -1
  65. package/dist/server/runtime/http-server/request-executor.d.ts +10 -0
  66. package/dist/server/runtime/http-server/request-executor.js +553 -159
  67. package/dist/server/runtime/http-server/request-executor.js.map +1 -1
  68. package/dist/server/runtime/http-server/routes.d.ts +5 -0
  69. package/dist/server/runtime/http-server/routes.js +29 -0
  70. package/dist/server/runtime/http-server/routes.js.map +1 -1
  71. package/dist/server/runtime/http-server/runtime-manager.js +33 -0
  72. package/dist/server/runtime/http-server/runtime-manager.js.map +1 -1
  73. package/dist/server/utils/utf8-chunk-buffer.d.ts +43 -0
  74. package/dist/server/utils/utf8-chunk-buffer.js +132 -0
  75. package/dist/server/utils/utf8-chunk-buffer.js.map +1 -0
  76. package/dist/token-daemon/history-store.d.ts +75 -0
  77. package/dist/token-daemon/history-store.js +207 -0
  78. package/dist/token-daemon/history-store.js.map +1 -0
  79. package/dist/token-daemon/index.d.ts +7 -0
  80. package/dist/token-daemon/index.js +336 -0
  81. package/dist/token-daemon/index.js.map +1 -0
  82. package/dist/token-daemon/server-utils.d.ts +33 -0
  83. package/dist/token-daemon/server-utils.js +155 -0
  84. package/dist/token-daemon/server-utils.js.map +1 -0
  85. package/dist/token-daemon/token-daemon.d.ts +23 -0
  86. package/dist/token-daemon/token-daemon.js +249 -0
  87. package/dist/token-daemon/token-daemon.js.map +1 -0
  88. package/dist/token-daemon/token-types.d.ts +44 -0
  89. package/dist/token-daemon/token-types.js +18 -0
  90. package/dist/token-daemon/token-types.js.map +1 -0
  91. package/dist/token-daemon/token-utils.d.ts +17 -0
  92. package/dist/token-daemon/token-utils.js +153 -0
  93. package/dist/token-daemon/token-utils.js.map +1 -0
  94. package/dist/token-portal/local-token-portal.d.ts +1 -0
  95. package/dist/token-portal/local-token-portal.js +89 -0
  96. package/dist/token-portal/local-token-portal.js.map +1 -0
  97. package/dist/token-portal/render.d.ts +10 -0
  98. package/dist/token-portal/render.js +56 -0
  99. package/dist/token-portal/render.js.map +1 -0
  100. package/dist/tools/semantic-replay.js +7 -6
  101. package/dist/tools/semantic-replay.js.map +1 -1
  102. package/dist/utils/error-handler-registry.d.ts +36 -0
  103. package/dist/utils/error-handler-registry.js +93 -7
  104. package/dist/utils/error-handler-registry.js.map +1 -1
  105. package/node_modules/@jsonstudio/llms/README.md +2 -0
  106. package/node_modules/@jsonstudio/llms/dist/conversion/codecs/gemini-openai-codec.js +137 -5
  107. package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/gemini-web-search.d.ts +17 -0
  108. package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/gemini-web-search.js +68 -0
  109. package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/glm-image-content.d.ts +2 -0
  110. package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/glm-image-content.js +83 -0
  111. package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/glm-vision-prompt.d.ts +11 -0
  112. package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/glm-vision-prompt.js +177 -0
  113. package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/glm-web-search.d.ts +2 -0
  114. package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/glm-web-search.js +63 -0
  115. package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/universal-shape-filter.js +11 -0
  116. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-gemini.json +17 -0
  117. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-glm.json +190 -181
  118. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-iflow.json +195 -195
  119. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-lmstudio.json +43 -43
  120. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-qwen.json +20 -20
  121. package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/responses-c4m.json +42 -42
  122. package/node_modules/@jsonstudio/llms/dist/conversion/config/sample-config.json +1 -1
  123. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-pipeline-executor.js +24 -0
  124. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-types.d.ts +8 -0
  125. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline.js +39 -4
  126. package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/target-utils.js +6 -0
  127. package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process.js +213 -1
  128. package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/provider-response.d.ts +34 -0
  129. package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/provider-response.js +84 -24
  130. package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/server-side-tools.d.ts +26 -0
  131. package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/server-side-tools.js +383 -0
  132. package/node_modules/@jsonstudio/llms/dist/conversion/hub/semantic-mappers/gemini-mapper.js +241 -14
  133. package/node_modules/@jsonstudio/llms/dist/conversion/hub/semantic-mappers/responses-mapper.js +17 -1
  134. package/node_modules/@jsonstudio/llms/dist/conversion/hub/standardized-bridge.js +14 -0
  135. package/node_modules/@jsonstudio/llms/dist/conversion/hub/types/standardized.d.ts +1 -0
  136. package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge.js +82 -3
  137. package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils.js +92 -3
  138. package/node_modules/@jsonstudio/llms/dist/conversion/shared/bridge-message-utils.js +137 -10
  139. package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-output-builder.js +43 -2
  140. package/node_modules/@jsonstudio/llms/dist/conversion/shared/snapshot-utils.js +17 -47
  141. package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-filter-pipeline.js +1 -0
  142. package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-mapping.js +25 -2
  143. package/node_modules/@jsonstudio/llms/dist/index.d.ts +1 -0
  144. package/node_modules/@jsonstudio/llms/dist/index.js +1 -0
  145. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap.js +308 -43
  146. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/classifier.js +11 -17
  147. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/context-advisor.d.ts +0 -2
  148. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/context-advisor.js +0 -12
  149. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine.d.ts +17 -2
  150. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine.js +332 -95
  151. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/features.js +1 -1
  152. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/message-utils.js +36 -24
  153. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/provider-registry.js +2 -1
  154. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/token-counter.js +14 -3
  155. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/types.d.ts +66 -2
  156. package/node_modules/@jsonstudio/llms/dist/router/virtual-router/types.js +2 -1
  157. package/node_modules/@jsonstudio/llms/dist/servertool/engine.d.ts +27 -0
  158. package/node_modules/@jsonstudio/llms/dist/servertool/engine.js +60 -0
  159. package/node_modules/@jsonstudio/llms/dist/servertool/flow-types.d.ts +40 -0
  160. package/node_modules/@jsonstudio/llms/dist/servertool/flow-types.js +1 -0
  161. package/node_modules/@jsonstudio/llms/dist/servertool/handlers/vision.d.ts +1 -0
  162. package/node_modules/@jsonstudio/llms/dist/servertool/handlers/vision.js +194 -0
  163. package/node_modules/@jsonstudio/llms/dist/servertool/handlers/web-search.d.ts +1 -0
  164. package/node_modules/@jsonstudio/llms/dist/servertool/handlers/web-search.js +638 -0
  165. package/node_modules/@jsonstudio/llms/dist/servertool/orchestration-types.d.ts +33 -0
  166. package/node_modules/@jsonstudio/llms/dist/servertool/orchestration-types.js +1 -0
  167. package/node_modules/@jsonstudio/llms/dist/servertool/registry.d.ts +18 -0
  168. package/node_modules/@jsonstudio/llms/dist/servertool/registry.js +27 -0
  169. package/node_modules/@jsonstudio/llms/dist/servertool/server-side-tools.d.ts +8 -0
  170. package/node_modules/@jsonstudio/llms/dist/servertool/server-side-tools.js +208 -0
  171. package/node_modules/@jsonstudio/llms/dist/servertool/types.d.ts +88 -0
  172. package/node_modules/@jsonstudio/llms/dist/servertool/types.js +1 -0
  173. package/node_modules/@jsonstudio/llms/dist/servertool/vision-tool.d.ts +2 -0
  174. package/node_modules/@jsonstudio/llms/dist/servertool/vision-tool.js +185 -0
  175. package/node_modules/@jsonstudio/llms/dist/sse/json-to-sse/event-generators/responses.js +15 -3
  176. package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/builders/response-builder.js +6 -3
  177. package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/gemini-sse-to-json-converter.js +27 -1
  178. package/node_modules/@jsonstudio/llms/dist/sse/types/gemini-types.d.ts +20 -1
  179. package/node_modules/@jsonstudio/llms/dist/sse/types/responses-types.js +1 -1
  180. package/node_modules/@jsonstudio/llms/dist/telemetry/stats-center.d.ts +73 -0
  181. package/node_modules/@jsonstudio/llms/dist/telemetry/stats-center.js +280 -0
  182. package/node_modules/@jsonstudio/llms/package.json +1 -1
  183. package/package.json +3 -2
  184. package/scripts/pack-mode.mjs +2 -1
  185. package/scripts/publish-rcc.mjs +20 -4
  186. package/scripts/test-iflow-web-search.mjs +141 -0
  187. package/scripts/test-iflow.mjs +93 -1
  188. package/scripts/tests/virtual-router-health.mjs +141 -6
  189. package/dist/tools/replay-request.d.ts +0 -0
  190. package/dist/tools/replay-request.js +0 -2
  191. package/dist/tools/replay-request.js.map +0 -1
@@ -1,204 +1,204 @@
1
1
  {
2
- "id": "chat:iflow",
3
- "protocol": "openai-chat",
4
- "request": {
5
- "mappings": [
6
- { "action": "snapshot", "phase": "compat-pre" },
7
- { "action": "dto_unwrap" },
8
- {
9
- "action": "remove",
10
- "path": "metadata.toolCallIdStyle"
2
+ "id": "chat:iflow",
3
+ "protocol": "openai-chat",
4
+ "request": {
5
+ "mappings": [
6
+ { "action": "snapshot", "phase": "compat-pre" },
7
+ { "action": "dto_unwrap" },
8
+ {
9
+ "action": "remove",
10
+ "path": "metadata.toolCallIdStyle"
11
+ },
12
+ {
13
+ "action": "remove",
14
+ "path": "metadata.clientModelId"
15
+ },
16
+ {
17
+ "action": "remove",
18
+ "path": "metadata.providerHint"
19
+ },
20
+ {
21
+ "action": "shape_filter",
22
+ "target": "request",
23
+ "config": {
24
+ "request": {
25
+ "allowTopLevel": [
26
+ "model",
27
+ "messages",
28
+ "stream",
29
+ "thinking",
30
+ "do_sample",
31
+ "temperature",
32
+ "top_p",
33
+ "max_tokens",
34
+ "tools",
35
+ "tool_choice",
36
+ "stop",
37
+ "response_format"
38
+ ],
39
+ "messages": {
40
+ "allowedRoles": ["system", "user", "assistant", "tool"],
41
+ "assistantWithToolCallsContentNull": true,
42
+ "toolContentStringify": false
11
43
  },
12
- {
13
- "action": "remove",
14
- "path": "metadata.clientModelId"
44
+ "messagesRules": [],
45
+ "tools": {
46
+ "normalize": false,
47
+ "forceToolChoiceAuto": true
15
48
  },
16
- {
17
- "action": "remove",
18
- "path": "metadata.providerHint"
49
+ "assistantToolCalls": { "functionArgumentsType": "string" }
50
+ },
51
+ "response": {
52
+ "allowTopLevel": [
53
+ "id",
54
+ "request_id",
55
+ "created",
56
+ "model",
57
+ "choices",
58
+ "usage",
59
+ "video_result",
60
+ "web_search",
61
+ "content_filter",
62
+ "required_action",
63
+ "output",
64
+ "output_text",
65
+ "status"
66
+ ],
67
+ "choices": {
68
+ "required": true,
69
+ "message": {
70
+ "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
71
+ "roleDefault": "assistant",
72
+ "contentNullWhenToolCalls": true,
73
+ "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
74
+ },
75
+ "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
19
76
  },
20
- {
21
- "action": "shape_filter",
22
- "target": "request",
23
- "config": {
24
- "request": {
25
- "allowTopLevel": [
26
- "model",
27
- "messages",
28
- "stream",
29
- "thinking",
30
- "do_sample",
31
- "temperature",
32
- "top_p",
33
- "max_tokens",
34
- "tools",
35
- "tool_choice",
36
- "stop",
37
- "response_format"
38
- ],
39
- "messages": {
40
- "allowedRoles": ["system", "user", "assistant", "tool"],
41
- "assistantWithToolCallsContentNull": true,
42
- "toolContentStringify": false
43
- },
44
- "messagesRules": [],
45
- "tools": {
46
- "normalize": false,
47
- "forceToolChoiceAuto": true
48
- },
49
- "assistantToolCalls": { "functionArgumentsType": "string" }
50
- },
51
- "response": {
52
- "allowTopLevel": [
53
- "id",
54
- "request_id",
55
- "created",
56
- "model",
57
- "choices",
58
- "usage",
59
- "video_result",
60
- "web_search",
61
- "content_filter",
62
- "required_action",
63
- "output",
64
- "output_text",
65
- "status"
66
- ],
67
- "choices": {
68
- "required": true,
69
- "message": {
70
- "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
71
- "roleDefault": "assistant",
72
- "contentNullWhenToolCalls": true,
73
- "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
74
- },
75
- "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
76
- },
77
- "usage": {
78
- "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"]
79
- }
80
- }
81
- }
82
- },
83
- {
84
- "action": "field_map",
85
- "direction": "incoming",
86
- "config": [
87
- { "sourcePath": "usage.prompt_tokens", "targetPath": "usage.input_tokens", "type": "number" },
88
- { "sourcePath": "usage.completion_tokens", "targetPath": "usage.output_tokens", "type": "number" },
89
- { "sourcePath": "created", "targetPath": "created_at", "type": "number" },
90
- { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
91
- {
92
- "sourcePath": "model",
93
- "targetPath": "model",
94
- "type": "string",
95
- "transform": "normalizeModelName"
96
- },
97
- {
98
- "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
99
- "targetPath": "choices[*].message.tool_calls[*].function.arguments",
100
- "type": "string"
101
- }
102
- ]
103
- },
104
- { "action": "tool_schema_sanitize", "mode": "glm_shell" },
105
- { "action": "snapshot", "phase": "compat-post" },
106
- { "action": "dto_rewrap" }
77
+ "usage": {
78
+ "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"]
79
+ }
80
+ }
81
+ }
82
+ },
83
+ {
84
+ "action": "field_map",
85
+ "direction": "incoming",
86
+ "config": [
87
+ { "sourcePath": "usage.prompt_tokens", "targetPath": "usage.input_tokens", "type": "number" },
88
+ { "sourcePath": "usage.completion_tokens", "targetPath": "usage.output_tokens", "type": "number" },
89
+ { "sourcePath": "created", "targetPath": "created_at", "type": "number" },
90
+ { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
91
+ {
92
+ "sourcePath": "model",
93
+ "targetPath": "model",
94
+ "type": "string",
95
+ "transform": "normalizeModelName"
96
+ },
97
+ {
98
+ "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
99
+ "targetPath": "choices[*].message.tool_calls[*].function.arguments",
100
+ "type": "string"
101
+ }
107
102
  ]
108
- },
109
- "response": {
110
- "mappings": [
111
- { "action": "snapshot", "phase": "compat-pre" },
112
- { "action": "dto_unwrap" },
113
- {
114
- "action": "shape_filter",
115
- "target": "response",
116
- "config": {
117
- "request": {
118
- "allowTopLevel": [
119
- "model",
120
- "messages",
121
- "stream",
122
- "thinking",
123
- "do_sample",
124
- "temperature",
125
- "top_p",
126
- "max_tokens",
127
- "tools",
128
- "tool_choice",
129
- "stop",
130
- "response_format"
131
- ],
132
- "messages": {
133
- "allowedRoles": ["system", "user", "assistant", "tool"],
134
- "assistantWithToolCallsContentNull": true,
135
- "toolContentStringify": false
136
- },
137
- "messagesRules": [],
138
- "tools": {
139
- "normalize": false,
140
- "forceToolChoiceAuto": true
141
- },
142
- "assistantToolCalls": { "functionArgumentsType": "string" }
143
- },
144
- "response": {
145
- "allowTopLevel": [
146
- "id",
147
- "request_id",
148
- "created",
149
- "model",
150
- "choices",
151
- "usage",
152
- "video_result",
153
- "web_search",
154
- "content_filter",
155
- "required_action",
156
- "output",
157
- "output_text",
158
- "status"
159
- ],
160
- "choices": {
161
- "required": true,
162
- "message": {
163
- "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
164
- "roleDefault": "assistant",
165
- "contentNullWhenToolCalls": true,
166
- "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
167
- },
168
- "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
169
- },
170
- "usage": {
171
- "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"]
172
- }
173
- }
174
- }
103
+ },
104
+ { "action": "tool_schema_sanitize", "mode": "glm_shell" },
105
+ { "action": "snapshot", "phase": "compat-post" },
106
+ { "action": "dto_rewrap" }
107
+ ]
108
+ },
109
+ "response": {
110
+ "mappings": [
111
+ { "action": "snapshot", "phase": "compat-pre" },
112
+ { "action": "dto_unwrap" },
113
+ {
114
+ "action": "shape_filter",
115
+ "target": "response",
116
+ "config": {
117
+ "request": {
118
+ "allowTopLevel": [
119
+ "model",
120
+ "messages",
121
+ "stream",
122
+ "thinking",
123
+ "do_sample",
124
+ "temperature",
125
+ "top_p",
126
+ "max_tokens",
127
+ "tools",
128
+ "tool_choice",
129
+ "stop",
130
+ "response_format"
131
+ ],
132
+ "messages": {
133
+ "allowedRoles": ["system", "user", "assistant", "tool"],
134
+ "assistantWithToolCallsContentNull": true,
135
+ "toolContentStringify": false
136
+ },
137
+ "messagesRules": [],
138
+ "tools": {
139
+ "normalize": false,
140
+ "forceToolChoiceAuto": true
175
141
  },
176
- {
177
- "action": "field_map",
178
- "direction": "outgoing",
179
- "config": [
180
- { "sourcePath": "usage.input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
181
- { "sourcePath": "usage.output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
182
- { "sourcePath": "usage.total_input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
183
- { "sourcePath": "usage.total_output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
184
- { "sourcePath": "created_at", "targetPath": "created", "type": "number" },
185
- { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
186
- {
187
- "sourcePath": "choices[*].finish_reason",
188
- "targetPath": "choices[*].finish_reason",
189
- "type": "string",
190
- "transform": "normalizeFinishReason"
191
- },
192
- {
193
- "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
194
- "targetPath": "choices[*].message.tool_calls[*].function.arguments",
195
- "type": "string"
196
- }
197
- ]
142
+ "assistantToolCalls": { "functionArgumentsType": "string" }
143
+ },
144
+ "response": {
145
+ "allowTopLevel": [
146
+ "id",
147
+ "request_id",
148
+ "created",
149
+ "model",
150
+ "choices",
151
+ "usage",
152
+ "video_result",
153
+ "web_search",
154
+ "content_filter",
155
+ "required_action",
156
+ "output",
157
+ "output_text",
158
+ "status"
159
+ ],
160
+ "choices": {
161
+ "required": true,
162
+ "message": {
163
+ "allow": ["role", "content", "reasoning_content", "audio", "tool_calls"],
164
+ "roleDefault": "assistant",
165
+ "contentNullWhenToolCalls": true,
166
+ "tool_calls": { "function": { "nameRequired": true, "argumentsType": "string" } }
167
+ },
168
+ "finish_reason": ["stop", "tool_calls", "length", "sensitive", "network_error"]
198
169
  },
199
- { "action": "tool_schema_sanitize", "mode": "glm_shell" },
200
- { "action": "snapshot", "phase": "compat-post" },
201
- { "action": "dto_rewrap" }
170
+ "usage": {
171
+ "allow": ["prompt_tokens", "completion_tokens", "prompt_tokens_details", "total_tokens"]
172
+ }
173
+ }
174
+ }
175
+ },
176
+ {
177
+ "action": "field_map",
178
+ "direction": "outgoing",
179
+ "config": [
180
+ { "sourcePath": "usage.input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
181
+ { "sourcePath": "usage.output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
182
+ { "sourcePath": "usage.total_input_tokens", "targetPath": "usage.prompt_tokens", "type": "number" },
183
+ { "sourcePath": "usage.total_output_tokens", "targetPath": "usage.completion_tokens", "type": "number" },
184
+ { "sourcePath": "created_at", "targetPath": "created", "type": "number" },
185
+ { "sourcePath": "request_id", "targetPath": "request_id", "type": "string" },
186
+ {
187
+ "sourcePath": "choices[*].finish_reason",
188
+ "targetPath": "choices[*].finish_reason",
189
+ "type": "string",
190
+ "transform": "normalizeFinishReason"
191
+ },
192
+ {
193
+ "sourcePath": "choices[*].message.tool_calls[*].function.arguments",
194
+ "targetPath": "choices[*].message.tool_calls[*].function.arguments",
195
+ "type": "string"
196
+ }
202
197
  ]
203
- }
198
+ },
199
+ { "action": "tool_schema_sanitize", "mode": "glm_shell" },
200
+ { "action": "snapshot", "phase": "compat-post" },
201
+ { "action": "dto_rewrap" }
202
+ ]
203
+ }
204
204
  }
@@ -1,45 +1,45 @@
1
1
  {
2
- "id": "chat:lmstudio",
3
- "protocol": "openai-chat",
4
- "request": {
5
- "mappings": [
6
- { "action": "snapshot", "phase": "compat-pre" },
7
- { "action": "dto_unwrap" },
8
- {
9
- "action": "normalize_tool_choice",
10
- "path": "tool_choice",
11
- "objectReplacement": "required"
12
- },
13
- { "action": "snapshot", "phase": "compat-post" },
14
- { "action": "dto_rewrap" }
15
- ]
16
- },
17
- "response": {
18
- "mappings": [
19
- { "action": "snapshot", "phase": "compat-pre" },
20
- { "action": "dto_unwrap" },
21
- {
22
- "action": "set_default",
23
- "path": "object",
24
- "value": "chat.completion"
25
- },
26
- {
27
- "action": "set_default",
28
- "path": "id",
29
- "valueSource": "chat_completion_id"
30
- },
31
- {
32
- "action": "set_default",
33
- "path": "created",
34
- "valueSource": "timestamp_seconds"
35
- },
36
- {
37
- "action": "set_default",
38
- "path": "model",
39
- "value": "unknown"
40
- },
41
- { "action": "snapshot", "phase": "compat-post" },
42
- { "action": "dto_rewrap" }
43
- ]
44
- }
2
+ "id": "chat:lmstudio",
3
+ "protocol": "openai-chat",
4
+ "request": {
5
+ "mappings": [
6
+ { "action": "snapshot", "phase": "compat-pre" },
7
+ { "action": "dto_unwrap" },
8
+ {
9
+ "action": "normalize_tool_choice",
10
+ "path": "tool_choice",
11
+ "objectReplacement": "required"
12
+ },
13
+ { "action": "snapshot", "phase": "compat-post" },
14
+ { "action": "dto_rewrap" }
15
+ ]
16
+ },
17
+ "response": {
18
+ "mappings": [
19
+ { "action": "snapshot", "phase": "compat-pre" },
20
+ { "action": "dto_unwrap" },
21
+ {
22
+ "action": "set_default",
23
+ "path": "object",
24
+ "value": "chat.completion"
25
+ },
26
+ {
27
+ "action": "set_default",
28
+ "path": "id",
29
+ "valueSource": "chat_completion_id"
30
+ },
31
+ {
32
+ "action": "set_default",
33
+ "path": "created",
34
+ "valueSource": "timestamp_seconds"
35
+ },
36
+ {
37
+ "action": "set_default",
38
+ "path": "model",
39
+ "value": "unknown"
40
+ },
41
+ { "action": "snapshot", "phase": "compat-post" },
42
+ { "action": "dto_rewrap" }
43
+ ]
44
+ }
45
45
  }
@@ -1,22 +1,22 @@
1
1
  {
2
- "id": "chat:qwen",
3
- "protocol": "openai-chat",
4
- "request": {
5
- "mappings": [
6
- { "action": "snapshot", "phase": "compat-pre" },
7
- { "action": "dto_unwrap" },
8
- { "action": "qwen_request_transform" },
9
- { "action": "snapshot", "phase": "compat-post" },
10
- { "action": "dto_rewrap" }
11
- ]
12
- },
13
- "response": {
14
- "mappings": [
15
- { "action": "snapshot", "phase": "compat-pre" },
16
- { "action": "dto_unwrap" },
17
- { "action": "qwen_response_transform" },
18
- { "action": "snapshot", "phase": "compat-post" },
19
- { "action": "dto_rewrap" }
20
- ]
21
- }
2
+ "id": "chat:qwen",
3
+ "protocol": "openai-chat",
4
+ "request": {
5
+ "mappings": [
6
+ { "action": "snapshot", "phase": "compat-pre" },
7
+ { "action": "dto_unwrap" },
8
+ { "action": "qwen_request_transform" },
9
+ { "action": "snapshot", "phase": "compat-post" },
10
+ { "action": "dto_rewrap" }
11
+ ]
12
+ },
13
+ "response": {
14
+ "mappings": [
15
+ { "action": "snapshot", "phase": "compat-pre" },
16
+ { "action": "dto_unwrap" },
17
+ { "action": "qwen_response_transform" },
18
+ { "action": "snapshot", "phase": "compat-post" },
19
+ { "action": "dto_rewrap" }
20
+ ]
21
+ }
22
22
  }
@@ -1,45 +1,45 @@
1
1
  {
2
- "id": "responses:c4m",
3
- "protocol": "openai-responses",
4
- "request": {
5
- "mappings": [
6
- {
7
- "action": "remove",
8
- "path": "max_tokens"
9
- },
10
- {
11
- "action": "remove",
12
- "path": "maxTokens"
13
- },
14
- {
15
- "action": "remove",
16
- "path": "max_output_tokens"
17
- },
18
- {
19
- "action": "remove",
20
- "path": "maxOutputTokens"
21
- },
22
- {
23
- "action": "inject_instruction",
24
- "sourcePath": "instructions",
25
- "targetPath": "input",
26
- "role": "system",
27
- "contentType": "input_text",
28
- "stripHtml": true,
29
- "maxLengthEnv": [
30
- "ROUTECODEX_C4M_INSTRUCTIONS_MAX",
31
- "RCC_C4M_INSTRUCTIONS_MAX",
32
- "ROUTECODEX_COMPAT_INSTRUCTIONS_MAX"
33
- ]
34
- }
2
+ "id": "responses:c4m",
3
+ "protocol": "openai-responses",
4
+ "request": {
5
+ "mappings": [
6
+ {
7
+ "action": "remove",
8
+ "path": "max_tokens"
9
+ },
10
+ {
11
+ "action": "remove",
12
+ "path": "maxTokens"
13
+ },
14
+ {
15
+ "action": "remove",
16
+ "path": "max_output_tokens"
17
+ },
18
+ {
19
+ "action": "remove",
20
+ "path": "maxOutputTokens"
21
+ },
22
+ {
23
+ "action": "inject_instruction",
24
+ "sourcePath": "instructions",
25
+ "targetPath": "input",
26
+ "role": "system",
27
+ "contentType": "input_text",
28
+ "stripHtml": true,
29
+ "maxLengthEnv": [
30
+ "ROUTECODEX_C4M_INSTRUCTIONS_MAX",
31
+ "RCC_C4M_INSTRUCTIONS_MAX",
32
+ "ROUTECODEX_COMPAT_INSTRUCTIONS_MAX"
35
33
  ]
36
- },
37
- "response": {
38
- "filters": [
39
- {
40
- "action": "rate_limit_text",
41
- "needle": "The Codex-For.ME service is available, but you have reached the request limit"
42
- }
43
- ]
44
- }
34
+ }
35
+ ]
36
+ },
37
+ "response": {
38
+ "filters": [
39
+ {
40
+ "action": "rate_limit_text",
41
+ "needle": "The Codex-For.ME service is available, but you have reached the request limit"
42
+ }
43
+ ]
44
+ }
45
45
  }
@@ -189,7 +189,7 @@
189
189
  "thinking": ["chat-provider-1.chat-model-a", "chat-model-b"],
190
190
  "fast": ["chat-model-c"],
191
191
  "vision": [],
192
- "websearch": [],
192
+ "search": [],
193
193
  "background": [],
194
194
  "fallback": ["chat-provider-1.chat-model-b"]
195
195
  },