@jsonstudio/rcc 0.90.367 → 0.90.429

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 (1185) hide show
  1. package/config/providers/ali-coding-plan.json +5 -0
  2. package/dist/build-info.js +2 -2
  3. package/dist/cli/commands/codex.js +37 -35
  4. package/dist/cli/commands/codex.js.map +1 -1
  5. package/dist/cli/commands/heartbeat.d.ts +20 -0
  6. package/dist/cli/commands/heartbeat.js +184 -0
  7. package/dist/cli/commands/heartbeat.js.map +1 -0
  8. package/dist/cli/commands/launcher/types.d.ts +0 -1
  9. package/dist/cli/commands/launcher-kernel.js +165 -73
  10. package/dist/cli/commands/launcher-kernel.js.map +1 -1
  11. package/dist/cli/commands/start.js +5 -3
  12. package/dist/cli/commands/start.js.map +1 -1
  13. package/dist/cli/register/heartbeat-command.d.ts +3 -0
  14. package/dist/cli/register/heartbeat-command.js +5 -0
  15. package/dist/cli/register/heartbeat-command.js.map +1 -0
  16. package/dist/cli.js +11 -0
  17. package/dist/cli.js.map +1 -1
  18. package/dist/commands/validate.js +34 -13
  19. package/dist/commands/validate.js.map +1 -1
  20. package/dist/config/user-data-paths.js +14 -3
  21. package/dist/config/user-data-paths.js.map +1 -1
  22. package/dist/index.js +31 -12
  23. package/dist/index.js.map +1 -1
  24. package/dist/manager/modules/quota/antigravity-quota-manager.js +50 -37
  25. package/dist/manager/modules/quota/antigravity-quota-manager.js.map +1 -1
  26. package/dist/manager/modules/quota/antigravity-quota-persistence.js +23 -14
  27. package/dist/manager/modules/quota/antigravity-quota-persistence.js.map +1 -1
  28. package/dist/manager/modules/quota/antigravity-quota-runtime.js +20 -11
  29. package/dist/manager/modules/quota/antigravity-quota-runtime.js.map +1 -1
  30. package/dist/manager/modules/quota/quota-adapter.js +28 -12
  31. package/dist/manager/modules/quota/quota-adapter.js.map +1 -1
  32. package/dist/manager/quota/provider-quota-store.js +17 -11
  33. package/dist/manager/quota/provider-quota-store.js.map +1 -1
  34. package/dist/manager/storage/file-store.js +15 -9
  35. package/dist/manager/storage/file-store.js.map +1 -1
  36. package/dist/modules/llmswitch/bridge/index.d.ts +1 -1
  37. package/dist/modules/llmswitch/bridge/index.js +1 -1
  38. package/dist/modules/llmswitch/bridge/index.js.map +1 -1
  39. package/dist/modules/llmswitch/bridge/module-loader.js +2 -2
  40. package/dist/modules/llmswitch/bridge/module-loader.js.map +1 -1
  41. package/dist/modules/llmswitch/bridge/quota-manager.js +1 -1
  42. package/dist/modules/llmswitch/bridge/quota-manager.js.map +1 -1
  43. package/dist/modules/llmswitch/bridge/runtime-integrations.d.ts +1 -1
  44. package/dist/modules/llmswitch/bridge/runtime-integrations.js +1 -1
  45. package/dist/modules/llmswitch/bridge/runtime-integrations.js.map +1 -1
  46. package/dist/modules/llmswitch/bridge/snapshot-recorder.js +4 -1
  47. package/dist/modules/llmswitch/bridge/snapshot-recorder.js.map +1 -1
  48. package/dist/modules/llmswitch/bridge/state-integrations.d.ts +28 -0
  49. package/dist/modules/llmswitch/bridge/state-integrations.js +138 -0
  50. package/dist/modules/llmswitch/bridge/state-integrations.js.map +1 -1
  51. package/dist/modules/llmswitch/bridge.d.ts +6 -6
  52. package/dist/modules/llmswitch/bridge.js +1 -1
  53. package/dist/modules/llmswitch/bridge.js.map +1 -1
  54. package/dist/modules/llmswitch/core-loader.js +24 -35
  55. package/dist/modules/llmswitch/core-loader.js.map +1 -1
  56. package/dist/providers/auth/oauth-auth.js +5 -3
  57. package/dist/providers/auth/oauth-auth.js.map +1 -1
  58. package/dist/providers/auth/oauth-lifecycle.js +84 -34
  59. package/dist/providers/auth/oauth-lifecycle.js.map +1 -1
  60. package/dist/providers/auth/tokenfile-auth.js +22 -12
  61. package/dist/providers/auth/tokenfile-auth.js.map +1 -1
  62. package/dist/providers/core/api/provider-types.d.ts +16 -0
  63. package/dist/providers/core/strategies/oauth-auth-code-flow.js +3 -1
  64. package/dist/providers/core/strategies/oauth-auth-code-flow.js.map +1 -1
  65. package/dist/providers/core/utils/snapshot-writer.js +28 -18
  66. package/dist/providers/core/utils/snapshot-writer.js.map +1 -1
  67. package/dist/server/handlers/handler-response-utils.js +21 -7
  68. package/dist/server/handlers/handler-response-utils.js.map +1 -1
  69. package/dist/server/handlers/handler-utils.js +16 -8
  70. package/dist/server/handlers/handler-utils.js.map +1 -1
  71. package/dist/server/runtime/http-server/clock-runtime-hooks.js +7 -10
  72. package/dist/server/runtime/http-server/clock-runtime-hooks.js.map +1 -1
  73. package/dist/server/runtime/http-server/daemon-admin/providers-handler-routing-utils.js +0 -30
  74. package/dist/server/runtime/http-server/daemon-admin/providers-handler-routing-utils.js.map +1 -1
  75. package/dist/server/runtime/http-server/daemon-admin/providers-handler.js +1 -113
  76. package/dist/server/runtime/http-server/daemon-admin/providers-handler.js.map +1 -1
  77. package/dist/server/runtime/http-server/daemon-admin/status-handler.js +11 -2
  78. package/dist/server/runtime/http-server/daemon-admin/status-handler.js.map +1 -1
  79. package/dist/server/runtime/http-server/executor/client-injection-flow.js +9 -8
  80. package/dist/server/runtime/http-server/executor/client-injection-flow.js.map +1 -1
  81. package/dist/server/runtime/http-server/executor/provider-response-converter.js +2 -133
  82. package/dist/server/runtime/http-server/executor/provider-response-converter.js.map +1 -1
  83. package/dist/server/runtime/http-server/executor-metadata.js +29 -5
  84. package/dist/server/runtime/http-server/executor-metadata.js.map +1 -1
  85. package/dist/server/runtime/http-server/executor-response.js +1 -62
  86. package/dist/server/runtime/http-server/executor-response.js.map +1 -1
  87. package/dist/server/runtime/http-server/heartbeat-runtime-hooks.d.ts +23 -0
  88. package/dist/server/runtime/http-server/heartbeat-runtime-hooks.js +140 -0
  89. package/dist/server/runtime/http-server/heartbeat-runtime-hooks.js.map +1 -0
  90. package/dist/server/runtime/http-server/http-server-lifecycle.js +2 -0
  91. package/dist/server/runtime/http-server/http-server-lifecycle.js.map +1 -1
  92. package/dist/server/runtime/http-server/http-server-runtime-setup.js +2 -0
  93. package/dist/server/runtime/http-server/http-server-runtime-setup.js.map +1 -1
  94. package/dist/server/runtime/http-server/http-server-session-daemon.d.ts +1 -0
  95. package/dist/server/runtime/http-server/http-server-session-daemon.js +27 -8
  96. package/dist/server/runtime/http-server/http-server-session-daemon.js.map +1 -1
  97. package/dist/server/runtime/http-server/index.d.ts +1 -0
  98. package/dist/server/runtime/http-server/index.js +20 -1
  99. package/dist/server/runtime/http-server/index.js.map +1 -1
  100. package/dist/server/runtime/http-server/request-activity-tracker.d.ts +7 -0
  101. package/dist/server/runtime/http-server/request-activity-tracker.js +58 -0
  102. package/dist/server/runtime/http-server/request-activity-tracker.js.map +1 -0
  103. package/dist/server/runtime/http-server/request-executor.d.ts +7 -0
  104. package/dist/server/runtime/http-server/request-executor.js +529 -473
  105. package/dist/server/runtime/http-server/request-executor.js.map +1 -1
  106. package/dist/server/runtime/http-server/session-client-reaper.js +9 -2
  107. package/dist/server/runtime/http-server/session-client-reaper.js.map +1 -1
  108. package/dist/server/runtime/http-server/session-client-registry-utils.d.ts +1 -0
  109. package/dist/server/runtime/http-server/session-client-registry-utils.js +10 -2
  110. package/dist/server/runtime/http-server/session-client-registry-utils.js.map +1 -1
  111. package/dist/server/runtime/http-server/session-client-registry.d.ts +3 -0
  112. package/dist/server/runtime/http-server/session-client-registry.js +26 -0
  113. package/dist/server/runtime/http-server/session-client-registry.js.map +1 -1
  114. package/dist/server/runtime/http-server/session-client-route-utils.js +5 -38
  115. package/dist/server/runtime/http-server/session-client-route-utils.js.map +1 -1
  116. package/dist/server/runtime/http-server/session-client-routes.js +75 -2
  117. package/dist/server/runtime/http-server/session-client-routes.js.map +1 -1
  118. package/dist/server/runtime/http-server/session-storage-cleanup.d.ts +17 -0
  119. package/dist/server/runtime/http-server/session-storage-cleanup.js +251 -0
  120. package/dist/server/runtime/http-server/session-storage-cleanup.js.map +1 -0
  121. package/dist/server/runtime/http-server/tmux-scope-cleanup-policy.d.ts +21 -0
  122. package/dist/server/runtime/http-server/tmux-scope-cleanup-policy.js +59 -0
  123. package/dist/server/runtime/http-server/tmux-scope-cleanup-policy.js.map +1 -0
  124. package/dist/server/runtime/http-server/tmux-session-probe.d.ts +1 -0
  125. package/dist/server/runtime/http-server/tmux-session-probe.js +23 -0
  126. package/dist/server/runtime/http-server/tmux-session-probe.js.map +1 -1
  127. package/dist/server-lifecycle/port-utils.js +38 -7
  128. package/dist/server-lifecycle/port-utils.js.map +1 -1
  129. package/dist/tools/semantic-replay-snapshot-loader.js +2 -2
  130. package/dist/tools/semantic-replay-snapshot-loader.js.map +1 -1
  131. package/dist/utils/snapshot-writer.js +16 -6
  132. package/dist/utils/snapshot-writer.js.map +1 -1
  133. package/docs/CLOCK.md +51 -0
  134. package/docs/INSTRUCTION_MARKUP.md +28 -2
  135. package/docs/session-client-daemon-design.md +92 -0
  136. package/package.json +8 -7
  137. package/scripts/analyze-thinking-keywords.mjs +1 -1
  138. package/scripts/ci/repo-sanity.mjs +35 -31
  139. package/scripts/ensure-llmswitch-mode.mjs +63 -5
  140. package/scripts/install-global.sh +46 -0
  141. package/scripts/install-release.sh +39 -5
  142. package/scripts/install-verify.mjs +143 -18
  143. package/scripts/link-llmswitch.mjs +56 -0
  144. package/scripts/pack-mode.mjs +39 -16
  145. package/scripts/pack-rcc.mjs +63 -4
  146. package/scripts/publish-rcc.mjs +59 -4
  147. package/scripts/snapshot-inspect.mjs +5 -24
  148. package/scripts/tests/blackbox-rcc-vs-routecodex-antigravity.mjs +2 -2
  149. package/scripts/vendor-core.mjs +9 -30
  150. package/vendor/llmswitch-core/README.md +0 -271
  151. package/vendor/llmswitch-core/dist/bridge/routecodex-adapter.d.ts +0 -74
  152. package/vendor/llmswitch-core/dist/bridge/routecodex-adapter.js +0 -229
  153. package/vendor/llmswitch-core/dist/config-unified/enhanced-path-resolver.d.ts +0 -5
  154. package/vendor/llmswitch-core/dist/config-unified/enhanced-path-resolver.js +0 -46
  155. package/vendor/llmswitch-core/dist/config-unified/unified-config.d.ts +0 -26
  156. package/vendor/llmswitch-core/dist/config-unified/unified-config.js +0 -231
  157. package/vendor/llmswitch-core/dist/conversion/args-mapping.d.ts +0 -18
  158. package/vendor/llmswitch-core/dist/conversion/args-mapping.js +0 -8
  159. package/vendor/llmswitch-core/dist/conversion/bridge-actions.d.ts +0 -39
  160. package/vendor/llmswitch-core/dist/conversion/bridge-actions.js +0 -82
  161. package/vendor/llmswitch-core/dist/conversion/bridge-id-utils.d.ts +0 -9
  162. package/vendor/llmswitch-core/dist/conversion/bridge-id-utils.js +0 -13
  163. package/vendor/llmswitch-core/dist/conversion/bridge-instructions.d.ts +0 -1
  164. package/vendor/llmswitch-core/dist/conversion/bridge-instructions.js +0 -17
  165. package/vendor/llmswitch-core/dist/conversion/bridge-message-utils.d.ts +0 -23
  166. package/vendor/llmswitch-core/dist/conversion/bridge-message-utils.js +0 -45
  167. package/vendor/llmswitch-core/dist/conversion/bridge-metadata.d.ts +0 -2
  168. package/vendor/llmswitch-core/dist/conversion/bridge-metadata.js +0 -5
  169. package/vendor/llmswitch-core/dist/conversion/bridge-policies.d.ts +0 -18
  170. package/vendor/llmswitch-core/dist/conversion/bridge-policies.js +0 -11
  171. package/vendor/llmswitch-core/dist/conversion/codec-registry.d.ts +0 -10
  172. package/vendor/llmswitch-core/dist/conversion/codec-registry.js +0 -37
  173. package/vendor/llmswitch-core/dist/conversion/codecs/anthropic-openai-codec.d.ts +0 -22
  174. package/vendor/llmswitch-core/dist/conversion/codecs/anthropic-openai-codec.js +0 -52
  175. package/vendor/llmswitch-core/dist/conversion/codecs/gemini-openai-codec.d.ts +0 -17
  176. package/vendor/llmswitch-core/dist/conversion/codecs/gemini-openai-codec.js +0 -85
  177. package/vendor/llmswitch-core/dist/conversion/codecs/openai-openai-codec.d.ts +0 -12
  178. package/vendor/llmswitch-core/dist/conversion/codecs/openai-openai-codec.js +0 -54
  179. package/vendor/llmswitch-core/dist/conversion/codecs/responses-openai-codec.d.ts +0 -12
  180. package/vendor/llmswitch-core/dist/conversion/codecs/responses-openai-codec.js +0 -66
  181. package/vendor/llmswitch-core/dist/conversion/compaction-detect.d.ts +0 -2
  182. package/vendor/llmswitch-core/dist/conversion/compaction-detect.js +0 -4
  183. package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-system-prompt.d.ts +0 -4
  184. package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-system-prompt.js +0 -42
  185. package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-user-id.d.ts +0 -3
  186. package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-user-id.js +0 -30
  187. package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-cache.d.ts +0 -3
  188. package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-cache.js +0 -8
  189. package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-prepare.d.ts +0 -3
  190. package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-prepare.js +0 -26
  191. package/vendor/llmswitch-core/dist/conversion/compat/actions/apply-patch-fixer.d.ts +0 -1
  192. package/vendor/llmswitch-core/dist/conversion/compat/actions/apply-patch-fixer.js +0 -30
  193. package/vendor/llmswitch-core/dist/conversion/compat/actions/auto-thinking.d.ts +0 -6
  194. package/vendor/llmswitch-core/dist/conversion/compat/actions/auto-thinking.js +0 -26
  195. package/vendor/llmswitch-core/dist/conversion/compat/actions/claude-thinking-tools.d.ts +0 -2
  196. package/vendor/llmswitch-core/dist/conversion/compat/actions/claude-thinking-tools.js +0 -4
  197. package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-request.d.ts +0 -3
  198. package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-request.js +0 -62
  199. package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-response.d.ts +0 -12
  200. package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-response.js +0 -114
  201. package/vendor/llmswitch-core/dist/conversion/compat/actions/field-mapping.d.ts +0 -14
  202. package/vendor/llmswitch-core/dist/conversion/compat/actions/field-mapping.js +0 -155
  203. package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-cli-request.d.ts +0 -5
  204. package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-cli-request.js +0 -27
  205. package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-web-search.d.ts +0 -3
  206. package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-web-search.js +0 -24
  207. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-history-image-trim.d.ts +0 -2
  208. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-history-image-trim.js +0 -54
  209. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-image-content.d.ts +0 -2
  210. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-image-content.js +0 -54
  211. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-native-compat.d.ts +0 -6
  212. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-native-compat.js +0 -34
  213. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-tool-extraction.d.ts +0 -3
  214. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-tool-extraction.js +0 -35
  215. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-vision-prompt.d.ts +0 -11
  216. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-vision-prompt.js +0 -104
  217. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-web-search.d.ts +0 -2
  218. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-web-search.js +0 -30
  219. package/vendor/llmswitch-core/dist/conversion/compat/actions/harvest-tool-calls-from-text.d.ts +0 -15
  220. package/vendor/llmswitch-core/dist/conversion/compat/actions/harvest-tool-calls-from-text.js +0 -124
  221. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-cli-defaults.d.ts +0 -10
  222. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-cli-defaults.js +0 -31
  223. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.d.ts +0 -7
  224. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.js +0 -25
  225. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.d.ts +0 -12
  226. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.js +0 -46
  227. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-native-compat.d.ts +0 -6
  228. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-native-compat.js +0 -36
  229. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-response-body-unwrap.d.ts +0 -9
  230. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-response-body-unwrap.js +0 -25
  231. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-tool-text-fallback.d.ts +0 -5
  232. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-tool-text-fallback.js +0 -29
  233. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-web-search.d.ts +0 -18
  234. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-web-search.js +0 -49
  235. package/vendor/llmswitch-core/dist/conversion/compat/actions/index.d.ts +0 -2
  236. package/vendor/llmswitch-core/dist/conversion/compat/actions/index.js +0 -2
  237. package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-fc-ids.d.ts +0 -2
  238. package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-fc-ids.js +0 -4
  239. package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-input-stringify.d.ts +0 -14
  240. package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-input-stringify.js +0 -125
  241. package/vendor/llmswitch-core/dist/conversion/compat/actions/normalize-tool-call-ids.d.ts +0 -2
  242. package/vendor/llmswitch-core/dist/conversion/compat/actions/normalize-tool-call-ids.js +0 -10
  243. package/vendor/llmswitch-core/dist/conversion/compat/actions/qwen-transform.d.ts +0 -4
  244. package/vendor/llmswitch-core/dist/conversion/compat/actions/qwen-transform.js +0 -40
  245. package/vendor/llmswitch-core/dist/conversion/compat/actions/request-rules.d.ts +0 -24
  246. package/vendor/llmswitch-core/dist/conversion/compat/actions/request-rules.js +0 -4
  247. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-blacklist.d.ts +0 -10
  248. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-blacklist.js +0 -10
  249. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-normalize.d.ts +0 -5
  250. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-normalize.js +0 -4
  251. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-validate.d.ts +0 -5
  252. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-validate.js +0 -4
  253. package/vendor/llmswitch-core/dist/conversion/compat/actions/snapshot.d.ts +0 -8
  254. package/vendor/llmswitch-core/dist/conversion/compat/actions/snapshot.js +0 -21
  255. package/vendor/llmswitch-core/dist/conversion/compat/actions/strip-orphan-function-calls-tag.d.ts +0 -2
  256. package/vendor/llmswitch-core/dist/conversion/compat/actions/strip-orphan-function-calls-tag.js +0 -4
  257. package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-schema.d.ts +0 -6
  258. package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-schema.js +0 -91
  259. package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-text-request-guidance.d.ts +0 -9
  260. package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-text-request-guidance.js +0 -7
  261. package/vendor/llmswitch-core/dist/conversion/compat/actions/universal-shape-filter.d.ts +0 -57
  262. package/vendor/llmswitch-core/dist/conversion/compat/actions/universal-shape-filter.js +0 -14
  263. package/vendor/llmswitch-core/dist/conversion/compat/antigravity-session-signature.d.ts +0 -86
  264. package/vendor/llmswitch-core/dist/conversion/compat/antigravity-session-signature.js +0 -1143
  265. package/vendor/llmswitch-core/dist/conversion/compat/profiles/anthropic-claude-code.json +0 -17
  266. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-claude-code.json +0 -18
  267. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-deepseek-web.json +0 -47
  268. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-gemini-cli.json +0 -23
  269. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-gemini.json +0 -31
  270. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-glm.json +0 -405
  271. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-iflow.json +0 -353
  272. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-lmstudio.json +0 -80
  273. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-qwen.json +0 -22
  274. package/vendor/llmswitch-core/dist/conversion/compat/profiles/responses-c4m.json +0 -45
  275. package/vendor/llmswitch-core/dist/conversion/compat/profiles/responses-crs.json +0 -15
  276. package/vendor/llmswitch-core/dist/conversion/compat/profiles/responses-output2choices-test.json +0 -12
  277. package/vendor/llmswitch-core/dist/conversion/config/config-manager.d.ts +0 -212
  278. package/vendor/llmswitch-core/dist/conversion/config/config-manager.js +0 -310
  279. package/vendor/llmswitch-core/dist/conversion/config/sample-config.json +0 -314
  280. package/vendor/llmswitch-core/dist/conversion/config/version-switch.json +0 -150
  281. package/vendor/llmswitch-core/dist/conversion/hub/config/types.d.ts +0 -26
  282. package/vendor/llmswitch-core/dist/conversion/hub/config/types.js +0 -1
  283. package/vendor/llmswitch-core/dist/conversion/hub/core/detour-registry.d.ts +0 -11
  284. package/vendor/llmswitch-core/dist/conversion/hub/core/detour-registry.js +0 -23
  285. package/vendor/llmswitch-core/dist/conversion/hub/core/hub-context.d.ts +0 -23
  286. package/vendor/llmswitch-core/dist/conversion/hub/core/hub-context.js +0 -1
  287. package/vendor/llmswitch-core/dist/conversion/hub/core/index.d.ts +0 -4
  288. package/vendor/llmswitch-core/dist/conversion/hub/core/index.js +0 -3
  289. package/vendor/llmswitch-core/dist/conversion/hub/core/stage-driver.d.ts +0 -30
  290. package/vendor/llmswitch-core/dist/conversion/hub/core/stage-driver.js +0 -33
  291. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/anthropic-format-adapter.d.ts +0 -16
  292. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/anthropic-format-adapter.js +0 -42
  293. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/chat-format-adapter.d.ts +0 -17
  294. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/chat-format-adapter.js +0 -42
  295. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/gemini-format-adapter.d.ts +0 -16
  296. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/gemini-format-adapter.js +0 -42
  297. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/index.d.ts +0 -21
  298. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/index.js +0 -4
  299. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/responses-format-adapter.d.ts +0 -19
  300. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/responses-format-adapter.js +0 -42
  301. package/vendor/llmswitch-core/dist/conversion/hub/hub-feature.d.ts +0 -1
  302. package/vendor/llmswitch-core/dist/conversion/hub/hub-feature.js +0 -26
  303. package/vendor/llmswitch-core/dist/conversion/hub/node-support.d.ts +0 -19
  304. package/vendor/llmswitch-core/dist/conversion/hub/node-support.js +0 -136
  305. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/operation-table-runner.d.ts +0 -18
  306. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/operation-table-runner.js +0 -162
  307. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper.d.ts +0 -8
  308. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper.js +0 -503
  309. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/archive/chat-mapper.archive.d.ts +0 -8
  310. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/archive/chat-mapper.archive.js +0 -409
  311. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/chat-mapper.d.ts +0 -8
  312. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/chat-mapper.js +0 -350
  313. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper.d.ts +0 -7
  314. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper.js +0 -1540
  315. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.d.ts +0 -21
  316. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.js +0 -491
  317. package/vendor/llmswitch-core/dist/conversion/hub/ops/operations.d.ts +0 -19
  318. package/vendor/llmswitch-core/dist/conversion/hub/ops/operations.js +0 -7
  319. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-engine.d.ts +0 -9
  320. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-engine.js +0 -13
  321. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-pipeline-executor.d.ts +0 -9
  322. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-pipeline-executor.js +0 -46
  323. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-resolver.d.ts +0 -2
  324. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-resolver.js +0 -14
  325. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-store.d.ts +0 -2
  326. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-store.js +0 -94
  327. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-types.d.ts +0 -175
  328. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-types.js +0 -1
  329. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/native-adapter-context.d.ts +0 -3
  330. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/native-adapter-context.js +0 -40
  331. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-pipeline.d.ts +0 -111
  332. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-pipeline.js +0 -1927
  333. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-stage-timing.d.ts +0 -8
  334. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-stage-timing.js +0 -211
  335. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/session-identifiers.d.ts +0 -9
  336. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/session-identifiers.js +0 -16
  337. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage1_format_parse/index.d.ts +0 -10
  338. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage1_format_parse/index.js +0 -236
  339. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.d.ts +0 -24
  340. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.js +0 -132
  341. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/semantic-lift.d.ts +0 -14
  342. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/semantic-lift.js +0 -24
  343. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/archive/shell-like-tool-call-normalization-fallback.d.ts +0 -2
  344. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/archive/shell-like-tool-call-normalization-fallback.js +0 -157
  345. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-capture-orchestration.d.ts +0 -16
  346. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-capture-orchestration.js +0 -29
  347. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-factories.d.ts +0 -5
  348. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-factories.js +0 -19
  349. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/index.d.ts +0 -6
  350. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/index.js +0 -22
  351. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.d.ts +0 -8
  352. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.js +0 -28
  353. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-diagnostics.d.ts +0 -2
  354. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-diagnostics.js +0 -4
  355. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-snapshot.d.ts +0 -10
  356. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-snapshot.js +0 -12
  357. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/context-merge.d.ts +0 -3
  358. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/context-merge.js +0 -30
  359. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/index.d.ts +0 -18
  360. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/index.js +0 -84
  361. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage2_format_build/index.d.ts +0 -8
  362. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage2_format_build/index.js +0 -12
  363. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.d.ts +0 -14
  364. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.js +0 -45
  365. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage1_tool_governance/index.d.ts +0 -16
  366. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage1_tool_governance/index.js +0 -62
  367. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage2_route_select/index.d.ts +0 -17
  368. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage2_route_select/index.js +0 -35
  369. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/index.d.ts +0 -17
  370. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/index.js +0 -243
  371. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/stream-json-sniffer.d.ts +0 -3
  372. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/stream-json-sniffer.js +0 -81
  373. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage2_format_parse/index.d.ts +0 -10
  374. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage2_format_parse/index.js +0 -50
  375. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage3_semantic_map/index.d.ts +0 -13
  376. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage3_semantic_map/index.js +0 -25
  377. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/chat-process-semantics-bridge.d.ts +0 -6
  378. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/chat-process-semantics-bridge.js +0 -17
  379. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.d.ts +0 -9
  380. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.js +0 -103
  381. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.d.ts +0 -13
  382. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.js +0 -30
  383. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage2_sse_stream/index.d.ts +0 -17
  384. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage2_sse_stream/index.js +0 -35
  385. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.d.ts +0 -16
  386. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.js +0 -52
  387. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage2_finalize/index.d.ts +0 -19
  388. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage2_finalize/index.js +0 -40
  389. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.d.ts +0 -44
  390. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.js +0 -88
  391. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/utils.d.ts +0 -2
  392. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/utils.js +0 -27
  393. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/target-utils.d.ts +0 -5
  394. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/target-utils.js +0 -26
  395. package/vendor/llmswitch-core/dist/conversion/hub/pipelines/inbound.d.ts +0 -22
  396. package/vendor/llmswitch-core/dist/conversion/hub/pipelines/inbound.js +0 -66
  397. package/vendor/llmswitch-core/dist/conversion/hub/pipelines/outbound.d.ts +0 -22
  398. package/vendor/llmswitch-core/dist/conversion/hub/pipelines/outbound.js +0 -59
  399. package/vendor/llmswitch-core/dist/conversion/hub/policy/policy-engine.d.ts +0 -48
  400. package/vendor/llmswitch-core/dist/conversion/hub/policy/policy-engine.js +0 -269
  401. package/vendor/llmswitch-core/dist/conversion/hub/policy/protocol-spec.d.ts +0 -75
  402. package/vendor/llmswitch-core/dist/conversion/hub/policy/protocol-spec.js +0 -27
  403. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-anthropic-alias.d.ts +0 -2
  404. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-anthropic-alias.js +0 -36
  405. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directive-parser.d.ts +0 -5
  406. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directive-parser.js +0 -56
  407. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directives.d.ts +0 -24
  408. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directives.js +0 -98
  409. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-directives.d.ts +0 -8
  410. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-directives.js +0 -42
  411. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-finalize.d.ts +0 -14
  412. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-finalize.js +0 -10
  413. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-messages.d.ts +0 -5
  414. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-messages.js +0 -10
  415. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-orchestration.d.ts +0 -30
  416. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-orchestration.js +0 -68
  417. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-time-tag.d.ts +0 -9
  418. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-time-tag.js +0 -18
  419. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminders.d.ts +0 -2
  420. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminders.js +0 -104
  421. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tool-schemas.d.ts +0 -3
  422. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tool-schemas.js +0 -280
  423. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tools.d.ts +0 -6
  424. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tools.js +0 -41
  425. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-continue-execution.d.ts +0 -11
  426. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-continue-execution.js +0 -83
  427. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-context.d.ts +0 -15
  428. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-context.js +0 -7
  429. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-finalize.d.ts +0 -16
  430. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-finalize.js +0 -11
  431. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-orchestration.d.ts +0 -9
  432. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-orchestration.js +0 -49
  433. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-control-ops.d.ts +0 -8
  434. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-control-ops.js +0 -5
  435. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-filter-call.d.ts +0 -12
  436. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-filter-call.js +0 -18
  437. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-merge.d.ts +0 -8
  438. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-merge.js +0 -11
  439. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-media.d.ts +0 -5
  440. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-media.js +0 -108
  441. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-node-result.d.ts +0 -23
  442. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-node-result.js +0 -24
  443. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-pending-tool-sync.d.ts +0 -14
  444. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-pending-tool-sync.js +0 -52
  445. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-post-governed-normalization.d.ts +0 -8
  446. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-post-governed-normalization.js +0 -16
  447. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-review.d.ts +0 -2
  448. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-review.js +0 -8
  449. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-servertool-orchestration.d.ts +0 -8
  450. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-servertool-orchestration.js +0 -22
  451. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-session-usage.d.ts +0 -7
  452. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-session-usage.js +0 -147
  453. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-tool-normalization.d.ts +0 -2
  454. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-tool-normalization.js +0 -4
  455. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-intent.d.ts +0 -12
  456. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-intent.js +0 -13
  457. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-tool-schema.d.ts +0 -3
  458. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-tool-schema.js +0 -4
  459. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search.d.ts +0 -8
  460. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search.js +0 -26
  461. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process.d.ts +0 -15
  462. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process.js +0 -27
  463. package/vendor/llmswitch-core/dist/conversion/hub/process/client-inject-readiness.d.ts +0 -1
  464. package/vendor/llmswitch-core/dist/conversion/hub/process/client-inject-readiness.js +0 -4
  465. package/vendor/llmswitch-core/dist/conversion/hub/registry.d.ts +0 -28
  466. package/vendor/llmswitch-core/dist/conversion/hub/registry.js +0 -101
  467. package/vendor/llmswitch-core/dist/conversion/hub/response/chat-response-utils.d.ts +0 -6
  468. package/vendor/llmswitch-core/dist/conversion/hub/response/chat-response-utils.js +0 -8
  469. package/vendor/llmswitch-core/dist/conversion/hub/response/provider-response.d.ts +0 -51
  470. package/vendor/llmswitch-core/dist/conversion/hub/response/provider-response.js +0 -529
  471. package/vendor/llmswitch-core/dist/conversion/hub/response/response-mappers.d.ts +0 -24
  472. package/vendor/llmswitch-core/dist/conversion/hub/response/response-mappers.js +0 -73
  473. package/vendor/llmswitch-core/dist/conversion/hub/response/response-runtime.d.ts +0 -9
  474. package/vendor/llmswitch-core/dist/conversion/hub/response/response-runtime.js +0 -758
  475. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/anthropic-mapper.d.ts +0 -2
  476. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/anthropic-mapper.js +0 -2
  477. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/chat-mapper.d.ts +0 -2
  478. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/chat-mapper.js +0 -2
  479. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/gemini-mapper.d.ts +0 -2
  480. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/gemini-mapper.js +0 -2
  481. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/index.d.ts +0 -4
  482. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/index.js +0 -4
  483. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/responses-mapper.d.ts +0 -2
  484. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/responses-mapper.js +0 -2
  485. package/vendor/llmswitch-core/dist/conversion/hub/snapshot-recorder.d.ts +0 -13
  486. package/vendor/llmswitch-core/dist/conversion/hub/snapshot-recorder.js +0 -38
  487. package/vendor/llmswitch-core/dist/conversion/hub/standardized-bridge.d.ts +0 -12
  488. package/vendor/llmswitch-core/dist/conversion/hub/standardized-bridge.js +0 -16
  489. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/engine.d.ts +0 -24
  490. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/engine.js +0 -118
  491. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/index.d.ts +0 -3
  492. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/index.js +0 -2
  493. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/rules.d.ts +0 -2
  494. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/rules.js +0 -80
  495. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/types.d.ts +0 -38
  496. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/types.js +0 -1
  497. package/vendor/llmswitch-core/dist/conversion/hub/tool-session-compat.d.ts +0 -26
  498. package/vendor/llmswitch-core/dist/conversion/hub/tool-session-compat.js +0 -86
  499. package/vendor/llmswitch-core/dist/conversion/hub/tool-surface/tool-surface-engine.d.ts +0 -18
  500. package/vendor/llmswitch-core/dist/conversion/hub/tool-surface/tool-surface-engine.js +0 -574
  501. package/vendor/llmswitch-core/dist/conversion/hub/types/chat-envelope.d.ts +0 -79
  502. package/vendor/llmswitch-core/dist/conversion/hub/types/chat-envelope.js +0 -1
  503. package/vendor/llmswitch-core/dist/conversion/hub/types/chat-schema.d.ts +0 -112
  504. package/vendor/llmswitch-core/dist/conversion/hub/types/chat-schema.js +0 -1
  505. package/vendor/llmswitch-core/dist/conversion/hub/types/errors.d.ts +0 -5
  506. package/vendor/llmswitch-core/dist/conversion/hub/types/errors.js +0 -13
  507. package/vendor/llmswitch-core/dist/conversion/hub/types/format-envelope.d.ts +0 -7
  508. package/vendor/llmswitch-core/dist/conversion/hub/types/format-envelope.js +0 -1
  509. package/vendor/llmswitch-core/dist/conversion/hub/types/index.d.ts +0 -6
  510. package/vendor/llmswitch-core/dist/conversion/hub/types/index.js +0 -6
  511. package/vendor/llmswitch-core/dist/conversion/hub/types/json.d.ts +0 -9
  512. package/vendor/llmswitch-core/dist/conversion/hub/types/json.js +0 -9
  513. package/vendor/llmswitch-core/dist/conversion/hub/types/node.d.ts +0 -31
  514. package/vendor/llmswitch-core/dist/conversion/hub/types/node.js +0 -1
  515. package/vendor/llmswitch-core/dist/conversion/hub/types/standardized.d.ts +0 -99
  516. package/vendor/llmswitch-core/dist/conversion/hub/types/standardized.js +0 -1
  517. package/vendor/llmswitch-core/dist/conversion/index.d.ts +0 -33
  518. package/vendor/llmswitch-core/dist/conversion/index.js +0 -33
  519. package/vendor/llmswitch-core/dist/conversion/jsonish.d.ts +0 -3
  520. package/vendor/llmswitch-core/dist/conversion/jsonish.js +0 -20
  521. package/vendor/llmswitch-core/dist/conversion/mcp-injection.d.ts +0 -2
  522. package/vendor/llmswitch-core/dist/conversion/mcp-injection.js +0 -7
  523. package/vendor/llmswitch-core/dist/conversion/media.d.ts +0 -1
  524. package/vendor/llmswitch-core/dist/conversion/media.js +0 -4
  525. package/vendor/llmswitch-core/dist/conversion/metadata-passthrough.d.ts +0 -11
  526. package/vendor/llmswitch-core/dist/conversion/metadata-passthrough.js +0 -20
  527. package/vendor/llmswitch-core/dist/conversion/payload-budget.d.ts +0 -13
  528. package/vendor/llmswitch-core/dist/conversion/payload-budget.js +0 -47
  529. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/anthropic-openai-pipeline.d.ts +0 -11
  530. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/anthropic-openai-pipeline.js +0 -104
  531. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/openai-openai-pipeline.d.ts +0 -15
  532. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/openai-openai-pipeline.js +0 -176
  533. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/responses-openai-pipeline.d.ts +0 -12
  534. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/responses-openai-pipeline.js +0 -212
  535. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/shared/openai-chat-helpers.d.ts +0 -13
  536. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/shared/openai-chat-helpers.js +0 -34
  537. package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/adapter-context.d.ts +0 -7
  538. package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/adapter-context.js +0 -18
  539. package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/protocol-hooks.d.ts +0 -67
  540. package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/protocol-hooks.js +0 -1
  541. package/vendor/llmswitch-core/dist/conversion/pipeline/index.d.ts +0 -35
  542. package/vendor/llmswitch-core/dist/conversion/pipeline/index.js +0 -103
  543. package/vendor/llmswitch-core/dist/conversion/pipeline/meta/meta-bag.d.ts +0 -20
  544. package/vendor/llmswitch-core/dist/conversion/pipeline/meta/meta-bag.js +0 -81
  545. package/vendor/llmswitch-core/dist/conversion/pipeline/schema/canonical-chat.d.ts +0 -18
  546. package/vendor/llmswitch-core/dist/conversion/pipeline/schema/canonical-chat.js +0 -1
  547. package/vendor/llmswitch-core/dist/conversion/pipeline/schema/index.d.ts +0 -1
  548. package/vendor/llmswitch-core/dist/conversion/pipeline/schema/index.js +0 -1
  549. package/vendor/llmswitch-core/dist/conversion/protocol-field-allowlists.d.ts +0 -7
  550. package/vendor/llmswitch-core/dist/conversion/protocol-field-allowlists.js +0 -9
  551. package/vendor/llmswitch-core/dist/conversion/protocol-state.d.ts +0 -4
  552. package/vendor/llmswitch-core/dist/conversion/protocol-state.js +0 -27
  553. package/vendor/llmswitch-core/dist/conversion/provider-protocol-error.d.ts +0 -17
  554. package/vendor/llmswitch-core/dist/conversion/provider-protocol-error.js +0 -25
  555. package/vendor/llmswitch-core/dist/conversion/responses/responses-host-policy.d.ts +0 -6
  556. package/vendor/llmswitch-core/dist/conversion/responses/responses-host-policy.js +0 -4
  557. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/response-payload.d.ts +0 -3
  558. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/response-payload.js +0 -190
  559. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/types.d.ts +0 -35
  560. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/types.js +0 -1
  561. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge.d.ts +0 -15
  562. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge.js +0 -475
  563. package/vendor/llmswitch-core/dist/conversion/runtime-metadata.d.ts +0 -7
  564. package/vendor/llmswitch-core/dist/conversion/runtime-metadata.js +0 -31
  565. package/vendor/llmswitch-core/dist/conversion/schema-validator.d.ts +0 -7
  566. package/vendor/llmswitch-core/dist/conversion/schema-validator.js +0 -67
  567. package/vendor/llmswitch-core/dist/conversion/shared/anthropic-message-utils.d.ts +0 -22
  568. package/vendor/llmswitch-core/dist/conversion/shared/anthropic-message-utils.js +0 -1416
  569. package/vendor/llmswitch-core/dist/conversion/shared/chat-envelope-validator.d.ts +0 -8
  570. package/vendor/llmswitch-core/dist/conversion/shared/chat-envelope-validator.js +0 -4
  571. package/vendor/llmswitch-core/dist/conversion/shared/chat-output-normalizer.d.ts +0 -4
  572. package/vendor/llmswitch-core/dist/conversion/shared/chat-output-normalizer.js +0 -10
  573. package/vendor/llmswitch-core/dist/conversion/shared/chat-request-filters.d.ts +0 -8
  574. package/vendor/llmswitch-core/dist/conversion/shared/chat-request-filters.js +0 -63
  575. package/vendor/llmswitch-core/dist/conversion/shared/gemini-tool-utils.d.ts +0 -7
  576. package/vendor/llmswitch-core/dist/conversion/shared/gemini-tool-utils.js +0 -20
  577. package/vendor/llmswitch-core/dist/conversion/shared/openai-finalizer.d.ts +0 -8
  578. package/vendor/llmswitch-core/dist/conversion/shared/openai-finalizer.js +0 -22
  579. package/vendor/llmswitch-core/dist/conversion/shared/openai-message-normalize.d.ts +0 -1
  580. package/vendor/llmswitch-core/dist/conversion/shared/openai-message-normalize.js +0 -151
  581. package/vendor/llmswitch-core/dist/conversion/shared/output-content-normalizer.d.ts +0 -12
  582. package/vendor/llmswitch-core/dist/conversion/shared/output-content-normalizer.js +0 -26
  583. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-mapping.d.ts +0 -5
  584. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-mapping.js +0 -7
  585. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-normalizer.d.ts +0 -25
  586. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-normalizer.js +0 -114
  587. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-normalizer.d.ts +0 -12
  588. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-normalizer.js +0 -22
  589. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-parser.d.ts +0 -10
  590. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-parser.js +0 -11
  591. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-utils.d.ts +0 -2
  592. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-utils.js +0 -19
  593. package/vendor/llmswitch-core/dist/conversion/shared/responses-conversation-store.d.ts +0 -35
  594. package/vendor/llmswitch-core/dist/conversion/shared/responses-conversation-store.js +0 -195
  595. package/vendor/llmswitch-core/dist/conversion/shared/responses-output-builder.d.ts +0 -13
  596. package/vendor/llmswitch-core/dist/conversion/shared/responses-output-builder.js +0 -32
  597. package/vendor/llmswitch-core/dist/conversion/shared/responses-reasoning-registry.d.ts +0 -24
  598. package/vendor/llmswitch-core/dist/conversion/shared/responses-reasoning-registry.js +0 -185
  599. package/vendor/llmswitch-core/dist/conversion/shared/responses-request-adapter.d.ts +0 -7
  600. package/vendor/llmswitch-core/dist/conversion/shared/responses-request-adapter.js +0 -14
  601. package/vendor/llmswitch-core/dist/conversion/shared/responses-response-utils.d.ts +0 -3
  602. package/vendor/llmswitch-core/dist/conversion/shared/responses-response-utils.js +0 -254
  603. package/vendor/llmswitch-core/dist/conversion/shared/responses-tool-utils.d.ts +0 -14
  604. package/vendor/llmswitch-core/dist/conversion/shared/responses-tool-utils.js +0 -102
  605. package/vendor/llmswitch-core/dist/conversion/shared/streaming-text-extractor.d.ts +0 -19
  606. package/vendor/llmswitch-core/dist/conversion/shared/streaming-text-extractor.js +0 -39
  607. package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer/normalize.d.ts +0 -2
  608. package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer/normalize.js +0 -116
  609. package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer.d.ts +0 -4
  610. package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer.js +0 -3
  611. package/vendor/llmswitch-core/dist/conversion/shared/thought-signature-validator.d.ts +0 -52
  612. package/vendor/llmswitch-core/dist/conversion/shared/thought-signature-validator.js +0 -58
  613. package/vendor/llmswitch-core/dist/conversion/shared/tool-argument-repairer.d.ts +0 -39
  614. package/vendor/llmswitch-core/dist/conversion/shared/tool-argument-repairer.js +0 -53
  615. package/vendor/llmswitch-core/dist/conversion/shared/tool-call-id-manager.d.ts +0 -109
  616. package/vendor/llmswitch-core/dist/conversion/shared/tool-call-id-manager.js +0 -202
  617. package/vendor/llmswitch-core/dist/conversion/shared/tool-call-utils.d.ts +0 -11
  618. package/vendor/llmswitch-core/dist/conversion/shared/tool-call-utils.js +0 -14
  619. package/vendor/llmswitch-core/dist/conversion/shared/tool-filter-pipeline.d.ts +0 -21
  620. package/vendor/llmswitch-core/dist/conversion/shared/tool-filter-pipeline.js +0 -171
  621. package/vendor/llmswitch-core/dist/conversion/shared/tool-governor.d.ts +0 -29
  622. package/vendor/llmswitch-core/dist/conversion/shared/tool-governor.js +0 -694
  623. package/vendor/llmswitch-core/dist/conversion/shared/tool-harvester.d.ts +0 -31
  624. package/vendor/llmswitch-core/dist/conversion/shared/tool-harvester.js +0 -23
  625. package/vendor/llmswitch-core/dist/conversion/shared/tool-mapping.d.ts +0 -19
  626. package/vendor/llmswitch-core/dist/conversion/shared/tool-mapping.js +0 -65
  627. package/vendor/llmswitch-core/dist/conversion/shared/tooling.d.ts +0 -29
  628. package/vendor/llmswitch-core/dist/conversion/shared/tooling.js +0 -57
  629. package/vendor/llmswitch-core/dist/conversion/snapshot-utils.d.ts +0 -31
  630. package/vendor/llmswitch-core/dist/conversion/snapshot-utils.js +0 -49
  631. package/vendor/llmswitch-core/dist/conversion/types/bridge-message-types.d.ts +0 -41
  632. package/vendor/llmswitch-core/dist/conversion/types/bridge-message-types.js +0 -1
  633. package/vendor/llmswitch-core/dist/conversion/types/text-markup-normalizer.d.ts +0 -13
  634. package/vendor/llmswitch-core/dist/conversion/types/text-markup-normalizer.js +0 -1
  635. package/vendor/llmswitch-core/dist/conversion/types.d.ts +0 -33
  636. package/vendor/llmswitch-core/dist/conversion/types.js +0 -1
  637. package/vendor/llmswitch-core/dist/filters/builtin/add-fields-filter.d.ts +0 -8
  638. package/vendor/llmswitch-core/dist/filters/builtin/add-fields-filter.js +0 -16
  639. package/vendor/llmswitch-core/dist/filters/builtin/blacklist-filter.d.ts +0 -8
  640. package/vendor/llmswitch-core/dist/filters/builtin/blacklist-filter.js +0 -19
  641. package/vendor/llmswitch-core/dist/filters/builtin/whitelist-filter.d.ts +0 -8
  642. package/vendor/llmswitch-core/dist/filters/builtin/whitelist-filter.js +0 -19
  643. package/vendor/llmswitch-core/dist/filters/config/openai-openai.fieldmap.json +0 -18
  644. package/vendor/llmswitch-core/dist/filters/engine.d.ts +0 -16
  645. package/vendor/llmswitch-core/dist/filters/engine.js +0 -167
  646. package/vendor/llmswitch-core/dist/filters/index.d.ts +0 -18
  647. package/vendor/llmswitch-core/dist/filters/index.js +0 -22
  648. package/vendor/llmswitch-core/dist/filters/special/request-tool-choice-policy.d.ts +0 -11
  649. package/vendor/llmswitch-core/dist/filters/special/request-tool-choice-policy.js +0 -29
  650. package/vendor/llmswitch-core/dist/filters/special/request-tool-list-filter.d.ts +0 -11
  651. package/vendor/llmswitch-core/dist/filters/special/request-tool-list-filter.js +0 -322
  652. package/vendor/llmswitch-core/dist/filters/special/request-toolcalls-stringify.d.ts +0 -13
  653. package/vendor/llmswitch-core/dist/filters/special/request-toolcalls-stringify.js +0 -94
  654. package/vendor/llmswitch-core/dist/filters/special/request-tools-normalize.d.ts +0 -11
  655. package/vendor/llmswitch-core/dist/filters/special/request-tools-normalize.js +0 -114
  656. package/vendor/llmswitch-core/dist/filters/special/response-finish-invariants.d.ts +0 -11
  657. package/vendor/llmswitch-core/dist/filters/special/response-finish-invariants.js +0 -30
  658. package/vendor/llmswitch-core/dist/filters/special/response-openai-to-responses-bridge.d.ts +0 -13
  659. package/vendor/llmswitch-core/dist/filters/special/response-openai-to-responses-bridge.js +0 -24
  660. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-blacklist.d.ts +0 -12
  661. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-blacklist.js +0 -63
  662. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-schema-converge.d.ts +0 -13
  663. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-schema-converge.js +0 -63
  664. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-stringify.d.ts +0 -9
  665. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-stringify.js +0 -132
  666. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-whitelist.d.ts +0 -11
  667. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-whitelist.js +0 -56
  668. package/vendor/llmswitch-core/dist/filters/special/response-tool-text-canonicalize.d.ts +0 -13
  669. package/vendor/llmswitch-core/dist/filters/special/response-tool-text-canonicalize.js +0 -16
  670. package/vendor/llmswitch-core/dist/filters/special/tool-filter-hooks.d.ts +0 -19
  671. package/vendor/llmswitch-core/dist/filters/special/tool-filter-hooks.js +0 -394
  672. package/vendor/llmswitch-core/dist/filters/special/tool-post-constraints.d.ts +0 -31
  673. package/vendor/llmswitch-core/dist/filters/special/tool-post-constraints.js +0 -120
  674. package/vendor/llmswitch-core/dist/filters/types.d.ts +0 -68
  675. package/vendor/llmswitch-core/dist/filters/types.js +0 -3
  676. package/vendor/llmswitch-core/dist/filters/utils/fieldmap-loader.d.ts +0 -2
  677. package/vendor/llmswitch-core/dist/filters/utils/fieldmap-loader.js +0 -16
  678. package/vendor/llmswitch-core/dist/filters/utils/snapshot-writer.d.ts +0 -10
  679. package/vendor/llmswitch-core/dist/filters/utils/snapshot-writer.js +0 -85
  680. package/vendor/llmswitch-core/dist/guidance/index.d.ts +0 -3
  681. package/vendor/llmswitch-core/dist/guidance/index.js +0 -299
  682. package/vendor/llmswitch-core/dist/http/sse-response.d.ts +0 -22
  683. package/vendor/llmswitch-core/dist/http/sse-response.js +0 -103
  684. package/vendor/llmswitch-core/dist/index.d.ts +0 -11
  685. package/vendor/llmswitch-core/dist/index.js +0 -11
  686. package/vendor/llmswitch-core/dist/native/router_hotpath_napi.node +0 -0
  687. package/vendor/llmswitch-core/dist/quota/apikey-reset.d.ts +0 -17
  688. package/vendor/llmswitch-core/dist/quota/apikey-reset.js +0 -43
  689. package/vendor/llmswitch-core/dist/quota/index.d.ts +0 -2
  690. package/vendor/llmswitch-core/dist/quota/index.js +0 -1
  691. package/vendor/llmswitch-core/dist/quota/quota-manager.d.ts +0 -44
  692. package/vendor/llmswitch-core/dist/quota/quota-manager.js +0 -463
  693. package/vendor/llmswitch-core/dist/quota/quota-state.d.ts +0 -6
  694. package/vendor/llmswitch-core/dist/quota/quota-state.js +0 -191
  695. package/vendor/llmswitch-core/dist/quota/types.d.ts +0 -62
  696. package/vendor/llmswitch-core/dist/quota/types.js +0 -1
  697. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/auth-utils.d.ts +0 -6
  698. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/auth-utils.js +0 -288
  699. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/claude-code-helpers.d.ts +0 -11
  700. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/claude-code-helpers.js +0 -18
  701. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-defaults.d.ts +0 -5
  702. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-defaults.js +0 -13
  703. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-normalizers.d.ts +0 -4
  704. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-normalizers.js +0 -106
  705. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/profile-builder.d.ts +0 -8
  706. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/profile-builder.js +0 -87
  707. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/provider-normalization.d.ts +0 -44
  708. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/provider-normalization.js +0 -272
  709. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/responses-helpers.d.ts +0 -15
  710. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/responses-helpers.js +0 -65
  711. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/routing-config.d.ts +0 -24
  712. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/routing-config.js +0 -346
  713. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/streaming-helpers.d.ts +0 -19
  714. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/streaming-helpers.js +0 -172
  715. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/utils.d.ts +0 -5
  716. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/utils.js +0 -41
  717. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/web-search-config.d.ts +0 -4
  718. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/web-search-config.js +0 -156
  719. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap.d.ts +0 -2
  720. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap.js +0 -329
  721. package/vendor/llmswitch-core/dist/router/virtual-router/classifier.d.ts +0 -10
  722. package/vendor/llmswitch-core/dist/router/virtual-router/classifier.js +0 -187
  723. package/vendor/llmswitch-core/dist/router/virtual-router/context-advisor.d.ts +0 -23
  724. package/vendor/llmswitch-core/dist/router/virtual-router/context-advisor.js +0 -67
  725. package/vendor/llmswitch-core/dist/router/virtual-router/context-weighted.d.ts +0 -31
  726. package/vendor/llmswitch-core/dist/router/virtual-router/context-weighted.js +0 -54
  727. package/vendor/llmswitch-core/dist/router/virtual-router/default-thinking-keywords.d.ts +0 -1
  728. package/vendor/llmswitch-core/dist/router/virtual-router/default-thinking-keywords.js +0 -13
  729. package/vendor/llmswitch-core/dist/router/virtual-router/engine/antigravity/alias-lease.d.ts +0 -33
  730. package/vendor/llmswitch-core/dist/router/virtual-router/engine/antigravity/alias-lease.js +0 -257
  731. package/vendor/llmswitch-core/dist/router/virtual-router/engine/cooldown-manager.d.ts +0 -34
  732. package/vendor/llmswitch-core/dist/router/virtual-router/engine/cooldown-manager.js +0 -118
  733. package/vendor/llmswitch-core/dist/router/virtual-router/engine/health/index.d.ts +0 -23
  734. package/vendor/llmswitch-core/dist/router/virtual-router/engine/health/index.js +0 -724
  735. package/vendor/llmswitch-core/dist/router/virtual-router/engine/provider-key/parse.d.ts +0 -1
  736. package/vendor/llmswitch-core/dist/router/virtual-router/engine/provider-key/parse.js +0 -1
  737. package/vendor/llmswitch-core/dist/router/virtual-router/engine/route-analytics.d.ts +0 -28
  738. package/vendor/llmswitch-core/dist/router/virtual-router/engine/route-analytics.js +0 -44
  739. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-pools/index.d.ts +0 -13
  740. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-pools/index.js +0 -386
  741. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/keys.d.ts +0 -3
  742. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/keys.js +0 -30
  743. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/metadata.d.ts +0 -6
  744. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/metadata.js +0 -132
  745. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/store.d.ts +0 -10
  746. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/store.js +0 -156
  747. package/vendor/llmswitch-core/dist/router/virtual-router/engine/sticky-session-manager.d.ts +0 -29
  748. package/vendor/llmswitch-core/dist/router/virtual-router/engine/sticky-session-manager.js +0 -55
  749. package/vendor/llmswitch-core/dist/router/virtual-router/engine-health.d.ts +0 -1
  750. package/vendor/llmswitch-core/dist/router/virtual-router/engine-health.js +0 -1
  751. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/config.d.ts +0 -11
  752. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/config.js +0 -108
  753. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/direct-model.d.ts +0 -10
  754. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/direct-model.js +0 -38
  755. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/health.d.ts +0 -13
  756. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/health.js +0 -104
  757. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/helpers.d.ts +0 -16
  758. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/helpers.js +0 -226
  759. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/route-utils.d.ts +0 -19
  760. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/route-utils.js +0 -212
  761. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-core.d.ts +0 -28
  762. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-core.js +0 -112
  763. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-state.d.ts +0 -16
  764. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-state.js +0 -187
  765. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/state-accessors.d.ts +0 -21
  766. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/state-accessors.js +0 -118
  767. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy.d.ts +0 -123
  768. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy.js +0 -245
  769. package/vendor/llmswitch-core/dist/router/virtual-router/engine-logging.d.ts +0 -67
  770. package/vendor/llmswitch-core/dist/router/virtual-router/engine-logging.js +0 -356
  771. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/alias-selection.d.ts +0 -15
  772. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/alias-selection.js +0 -118
  773. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/context-weight-multipliers.d.ts +0 -11
  774. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/context-weight-multipliers.js +0 -23
  775. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/direct-provider-model.d.ts +0 -9
  776. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/direct-provider-model.js +0 -49
  777. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/instruction-target.d.ts +0 -6
  778. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/instruction-target.js +0 -54
  779. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/key-parsing.d.ts +0 -8
  780. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/key-parsing.js +0 -47
  781. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/multimodal-capability.d.ts +0 -3
  782. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/multimodal-capability.js +0 -26
  783. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-directive-parser.d.ts +0 -24
  784. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-directive-parser.js +0 -209
  785. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-directives.d.ts +0 -7
  786. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-directives.js +0 -121
  787. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-orchestration-semantics.d.ts +0 -10
  788. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-orchestration-semantics.js +0 -110
  789. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-semantics.d.ts +0 -8
  790. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-semantics.js +0 -281
  791. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-time-tag-semantics.d.ts +0 -1
  792. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-time-tag-semantics.js +0 -25
  793. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminders-semantics.d.ts +0 -4
  794. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminders-semantics.js +0 -44
  795. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-tool-schema-semantics.d.ts +0 -2
  796. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-tool-schema-semantics.js +0 -62
  797. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governance-semantics.d.ts +0 -49
  798. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governance-semantics.js +0 -552
  799. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governed-filter-semantics.d.ts +0 -9
  800. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governed-filter-semantics.js +0 -64
  801. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.d.ts +0 -5
  802. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.js +0 -163
  803. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-post-governed-normalization-semantics.d.ts +0 -1
  804. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-post-governed-normalization-semantics.js +0 -49
  805. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-servertool-orchestration-semantics.d.ts +0 -30
  806. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-servertool-orchestration-semantics.js +0 -446
  807. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-web-search-intent-semantics.d.ts +0 -1
  808. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-web-search-intent-semantics.js +0 -49
  809. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-request-filter-semantics.d.ts +0 -1
  810. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-request-filter-semantics.js +0 -54
  811. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-compat-action-semantics.d.ts +0 -22
  812. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-compat-action-semantics.js +0 -559
  813. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-deepseek-web-compat.d.ts +0 -17
  814. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-deepseek-web-compat.js +0 -26
  815. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics.d.ts +0 -276
  816. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics.js +0 -1291
  817. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.d.ts +0 -72
  818. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.js +0 -405
  819. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.d.ts +0 -18
  820. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.js +0 -333
  821. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-governance-semantics.d.ts +0 -30
  822. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-governance-semantics.js +0 -202
  823. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-inbound-outbound-semantics.d.ts +0 -22
  824. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-inbound-outbound-semantics.js +0 -426
  825. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics.d.ts +0 -57
  826. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics.js +0 -705
  827. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.d.ts +0 -53
  828. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.js +0 -598
  829. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics.d.ts +0 -147
  830. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics.js +0 -570
  831. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-process-semantics.d.ts +0 -26
  832. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-process-semantics.js +0 -148
  833. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics.d.ts +0 -46
  834. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics.js +0 -755
  835. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-semantic-mappers.d.ts +0 -2
  836. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-semantic-mappers.js +0 -83
  837. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-session-identifiers-semantics.d.ts +0 -11
  838. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-session-identifiers-semantics.js +0 -207
  839. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-target-semantics.d.ts +0 -3
  840. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-target-semantics.js +0 -128
  841. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-analysis.d.ts +0 -57
  842. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-analysis.js +0 -217
  843. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-loader.d.ts +0 -5
  844. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-loader.js +0 -464
  845. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-policy.d.ts +0 -5
  846. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-policy.js +0 -18
  847. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-quota-buckets.d.ts +0 -25
  848. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-quota-buckets.js +0 -85
  849. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath.d.ts +0 -59
  850. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath.js +0 -117
  851. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.d.ts +0 -243
  852. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.js +0 -2594
  853. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-snapshot-hooks.d.ts +0 -3
  854. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-snapshot-hooks.js +0 -109
  855. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-alias-selection-semantics.d.ts +0 -16
  856. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-alias-selection-semantics.js +0 -96
  857. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-engine-proxy.d.ts +0 -16
  858. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-engine-proxy.js +0 -14
  859. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-routing-instructions-semantics.d.ts +0 -3
  860. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-routing-instructions-semantics.js +0 -123
  861. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-actions-semantics.d.ts +0 -6
  862. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-actions-semantics.js +0 -85
  863. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-semantics.d.ts +0 -9
  864. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-semantics.js +0 -70
  865. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-state-semantics.d.ts +0 -2
  866. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-state-semantics.js +0 -76
  867. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/route-utils.d.ts +0 -15
  868. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/route-utils.js +0 -248
  869. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/routing-state-filter.d.ts +0 -4
  870. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/routing-state-filter.js +0 -50
  871. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/selection-deps.d.ts +0 -58
  872. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/selection-deps.js +0 -1
  873. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/sticky-pool.d.ts +0 -11
  874. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/sticky-pool.js +0 -109
  875. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-load-balancing.d.ts +0 -16
  876. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-load-balancing.js +0 -120
  877. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-priority.d.ts +0 -11
  878. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-priority.js +0 -55
  879. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-session-lease.d.ts +0 -10
  880. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-session-lease.js +0 -231
  881. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-target-split.d.ts +0 -4
  882. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-target-split.js +0 -43
  883. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-quota-integration.d.ts +0 -29
  884. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-quota-integration.js +0 -194
  885. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-select.d.ts +0 -22
  886. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-select.js +0 -352
  887. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection.d.ts +0 -3
  888. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection.js +0 -309
  889. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection.d.ts +0 -1
  890. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection.js +0 -1
  891. package/vendor/llmswitch-core/dist/router/virtual-router/engine.d.ts +0 -43
  892. package/vendor/llmswitch-core/dist/router/virtual-router/engine.js +0 -360
  893. package/vendor/llmswitch-core/dist/router/virtual-router/error-center.d.ts +0 -10
  894. package/vendor/llmswitch-core/dist/router/virtual-router/error-center.js +0 -39
  895. package/vendor/llmswitch-core/dist/router/virtual-router/features.d.ts +0 -3
  896. package/vendor/llmswitch-core/dist/router/virtual-router/features.js +0 -124
  897. package/vendor/llmswitch-core/dist/router/virtual-router/health-manager.d.ts +0 -23
  898. package/vendor/llmswitch-core/dist/router/virtual-router/health-manager.js +0 -107
  899. package/vendor/llmswitch-core/dist/router/virtual-router/health-weighted.d.ts +0 -25
  900. package/vendor/llmswitch-core/dist/router/virtual-router/health-weighted.js +0 -63
  901. package/vendor/llmswitch-core/dist/router/virtual-router/load-balancer.d.ts +0 -28
  902. package/vendor/llmswitch-core/dist/router/virtual-router/load-balancer.js +0 -160
  903. package/vendor/llmswitch-core/dist/router/virtual-router/message-utils.d.ts +0 -15
  904. package/vendor/llmswitch-core/dist/router/virtual-router/message-utils.js +0 -235
  905. package/vendor/llmswitch-core/dist/router/virtual-router/pre-command-file-resolver.d.ts +0 -2
  906. package/vendor/llmswitch-core/dist/router/virtual-router/pre-command-file-resolver.js +0 -117
  907. package/vendor/llmswitch-core/dist/router/virtual-router/provider-registry.d.ts +0 -17
  908. package/vendor/llmswitch-core/dist/router/virtual-router/provider-registry.js +0 -145
  909. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/clean.d.ts +0 -3
  910. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/clean.js +0 -34
  911. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/parse.d.ts +0 -6
  912. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/parse.js +0 -24
  913. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/state.d.ts +0 -4
  914. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/state.js +0 -284
  915. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/types.d.ts +0 -74
  916. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/types.js +0 -2
  917. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions.d.ts +0 -5
  918. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions.js +0 -4
  919. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-actions.d.ts +0 -3
  920. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-actions.js +0 -26
  921. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-parser.d.ts +0 -2
  922. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-parser.js +0 -85
  923. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-state-codec.d.ts +0 -3
  924. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-state-codec.js +0 -24
  925. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-actions.d.ts +0 -2
  926. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-actions.js +0 -99
  927. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-parser.d.ts +0 -3
  928. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-parser.js +0 -19
  929. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-state-codec.d.ts +0 -7
  930. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-state-codec.js +0 -121
  931. package/vendor/llmswitch-core/dist/router/virtual-router/sticky-session-store.d.ts +0 -8
  932. package/vendor/llmswitch-core/dist/router/virtual-router/sticky-session-store.js +0 -296
  933. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-file-resolver.d.ts +0 -2
  934. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-file-resolver.js +0 -76
  935. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-stage-template-files.d.ts +0 -12
  936. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-stage-template-files.js +0 -67
  937. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-state-sync.d.ts +0 -17
  938. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-state-sync.js +0 -82
  939. package/vendor/llmswitch-core/dist/router/virtual-router/success-center.d.ts +0 -10
  940. package/vendor/llmswitch-core/dist/router/virtual-router/success-center.js +0 -32
  941. package/vendor/llmswitch-core/dist/router/virtual-router/token-counter.d.ts +0 -2
  942. package/vendor/llmswitch-core/dist/router/virtual-router/token-counter.js +0 -148
  943. package/vendor/llmswitch-core/dist/router/virtual-router/token-estimator.d.ts +0 -2
  944. package/vendor/llmswitch-core/dist/router/virtual-router/token-estimator.js +0 -16
  945. package/vendor/llmswitch-core/dist/router/virtual-router/token-file-scanner.d.ts +0 -24
  946. package/vendor/llmswitch-core/dist/router/virtual-router/token-file-scanner.js +0 -117
  947. package/vendor/llmswitch-core/dist/router/virtual-router/tool-signals.d.ts +0 -19
  948. package/vendor/llmswitch-core/dist/router/virtual-router/tool-signals.js +0 -647
  949. package/vendor/llmswitch-core/dist/router/virtual-router/types.d.ts +0 -681
  950. package/vendor/llmswitch-core/dist/router/virtual-router/types.js +0 -34
  951. package/vendor/llmswitch-core/dist/runtime/user-data-paths.d.ts +0 -5
  952. package/vendor/llmswitch-core/dist/runtime/user-data-paths.js +0 -43
  953. package/vendor/llmswitch-core/dist/servertool/clock/config.d.ts +0 -17
  954. package/vendor/llmswitch-core/dist/servertool/clock/config.js +0 -48
  955. package/vendor/llmswitch-core/dist/servertool/clock/daemon.d.ts +0 -24
  956. package/vendor/llmswitch-core/dist/servertool/clock/daemon.js +0 -207
  957. package/vendor/llmswitch-core/dist/servertool/clock/io.d.ts +0 -2
  958. package/vendor/llmswitch-core/dist/servertool/clock/io.js +0 -14
  959. package/vendor/llmswitch-core/dist/servertool/clock/log.d.ts +0 -3
  960. package/vendor/llmswitch-core/dist/servertool/clock/log.js +0 -13
  961. package/vendor/llmswitch-core/dist/servertool/clock/ntp.d.ts +0 -18
  962. package/vendor/llmswitch-core/dist/servertool/clock/ntp.js +0 -318
  963. package/vendor/llmswitch-core/dist/servertool/clock/paths.d.ts +0 -5
  964. package/vendor/llmswitch-core/dist/servertool/clock/paths.js +0 -28
  965. package/vendor/llmswitch-core/dist/servertool/clock/recurrence.d.ts +0 -7
  966. package/vendor/llmswitch-core/dist/servertool/clock/recurrence.js +0 -248
  967. package/vendor/llmswitch-core/dist/servertool/clock/session-scope.d.ts +0 -3
  968. package/vendor/llmswitch-core/dist/servertool/clock/session-scope.js +0 -41
  969. package/vendor/llmswitch-core/dist/servertool/clock/session-store.d.ts +0 -3
  970. package/vendor/llmswitch-core/dist/servertool/clock/session-store.js +0 -63
  971. package/vendor/llmswitch-core/dist/servertool/clock/state.d.ts +0 -9
  972. package/vendor/llmswitch-core/dist/servertool/clock/state.js +0 -135
  973. package/vendor/llmswitch-core/dist/servertool/clock/task-store.d.ts +0 -5
  974. package/vendor/llmswitch-core/dist/servertool/clock/task-store.js +0 -4
  975. package/vendor/llmswitch-core/dist/servertool/clock/tasks.d.ts +0 -24
  976. package/vendor/llmswitch-core/dist/servertool/clock/tasks.js +0 -595
  977. package/vendor/llmswitch-core/dist/servertool/clock/types.d.ts +0 -98
  978. package/vendor/llmswitch-core/dist/servertool/clock/types.js +0 -1
  979. package/vendor/llmswitch-core/dist/servertool/continue-execution/log.d.ts +0 -3
  980. package/vendor/llmswitch-core/dist/servertool/continue-execution/log.js +0 -13
  981. package/vendor/llmswitch-core/dist/servertool/engine.d.ts +0 -38
  982. package/vendor/llmswitch-core/dist/servertool/engine.js +0 -1660
  983. package/vendor/llmswitch-core/dist/servertool/followup-shadow.d.ts +0 -16
  984. package/vendor/llmswitch-core/dist/servertool/followup-shadow.js +0 -145
  985. package/vendor/llmswitch-core/dist/servertool/handlers/antigravity-thought-signature-bootstrap.d.ts +0 -1
  986. package/vendor/llmswitch-core/dist/servertool/handlers/antigravity-thought-signature-bootstrap.js +0 -225
  987. package/vendor/llmswitch-core/dist/servertool/handlers/apply-patch-guard.d.ts +0 -1
  988. package/vendor/llmswitch-core/dist/servertool/handlers/apply-patch-guard.js +0 -5
  989. package/vendor/llmswitch-core/dist/servertool/handlers/clock-auto.d.ts +0 -1
  990. package/vendor/llmswitch-core/dist/servertool/handlers/clock-auto.js +0 -177
  991. package/vendor/llmswitch-core/dist/servertool/handlers/clock.d.ts +0 -1
  992. package/vendor/llmswitch-core/dist/servertool/handlers/clock.js +0 -544
  993. package/vendor/llmswitch-core/dist/servertool/handlers/compaction-detect.d.ts +0 -1
  994. package/vendor/llmswitch-core/dist/servertool/handlers/compaction-detect.js +0 -1
  995. package/vendor/llmswitch-core/dist/servertool/handlers/continue-execution.d.ts +0 -1
  996. package/vendor/llmswitch-core/dist/servertool/handlers/continue-execution.js +0 -110
  997. package/vendor/llmswitch-core/dist/servertool/handlers/exec-command-guard.d.ts +0 -1
  998. package/vendor/llmswitch-core/dist/servertool/handlers/exec-command-guard.js +0 -10
  999. package/vendor/llmswitch-core/dist/servertool/handlers/followup-message-trimmer.d.ts +0 -16
  1000. package/vendor/llmswitch-core/dist/servertool/handlers/followup-message-trimmer.js +0 -198
  1001. package/vendor/llmswitch-core/dist/servertool/handlers/followup-request-builder.d.ts +0 -25
  1002. package/vendor/llmswitch-core/dist/servertool/handlers/followup-request-builder.js +0 -515
  1003. package/vendor/llmswitch-core/dist/servertool/handlers/followup-sanitize.d.ts +0 -2
  1004. package/vendor/llmswitch-core/dist/servertool/handlers/followup-sanitize.js +0 -7
  1005. package/vendor/llmswitch-core/dist/servertool/handlers/gemini-empty-reply-continue.d.ts +0 -1
  1006. package/vendor/llmswitch-core/dist/servertool/handlers/gemini-empty-reply-continue.js +0 -3
  1007. package/vendor/llmswitch-core/dist/servertool/handlers/iflow-model-error-retry.d.ts +0 -1
  1008. package/vendor/llmswitch-core/dist/servertool/handlers/iflow-model-error-retry.js +0 -92
  1009. package/vendor/llmswitch-core/dist/servertool/handlers/recursive-detection-guard.d.ts +0 -1
  1010. package/vendor/llmswitch-core/dist/servertool/handlers/recursive-detection-guard.js +0 -374
  1011. package/vendor/llmswitch-core/dist/servertool/handlers/review.d.ts +0 -1
  1012. package/vendor/llmswitch-core/dist/servertool/handlers/review.js +0 -181
  1013. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/blocked-report.d.ts +0 -16
  1014. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/blocked-report.js +0 -407
  1015. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/iflow-followup.d.ts +0 -44
  1016. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/iflow-followup.js +0 -816
  1017. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/routing-state.d.ts +0 -28
  1018. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/routing-state.js +0 -123
  1019. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/runtime-utils.d.ts +0 -81
  1020. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/runtime-utils.js +0 -355
  1021. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto.d.ts +0 -1
  1022. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto.js +0 -553
  1023. package/vendor/llmswitch-core/dist/servertool/handlers/vision.d.ts +0 -7
  1024. package/vendor/llmswitch-core/dist/servertool/handlers/vision.js +0 -240
  1025. package/vendor/llmswitch-core/dist/servertool/handlers/web-search.d.ts +0 -7
  1026. package/vendor/llmswitch-core/dist/servertool/handlers/web-search.js +0 -926
  1027. package/vendor/llmswitch-core/dist/servertool/log/progress-file.d.ts +0 -14
  1028. package/vendor/llmswitch-core/dist/servertool/log/progress-file.js +0 -88
  1029. package/vendor/llmswitch-core/dist/servertool/pending-session.d.ts +0 -19
  1030. package/vendor/llmswitch-core/dist/servertool/pending-session.js +0 -99
  1031. package/vendor/llmswitch-core/dist/servertool/pre-command-hooks.d.ts +0 -17
  1032. package/vendor/llmswitch-core/dist/servertool/pre-command-hooks.js +0 -491
  1033. package/vendor/llmswitch-core/dist/servertool/reenter-backend.d.ts +0 -23
  1034. package/vendor/llmswitch-core/dist/servertool/reenter-backend.js +0 -20
  1035. package/vendor/llmswitch-core/dist/servertool/registry.d.ts +0 -35
  1036. package/vendor/llmswitch-core/dist/servertool/registry.js +0 -92
  1037. package/vendor/llmswitch-core/dist/servertool/server-side-tools.d.ts +0 -15
  1038. package/vendor/llmswitch-core/dist/servertool/server-side-tools.js +0 -898
  1039. package/vendor/llmswitch-core/dist/servertool/stop-gateway-context.d.ts +0 -14
  1040. package/vendor/llmswitch-core/dist/servertool/stop-gateway-context.js +0 -167
  1041. package/vendor/llmswitch-core/dist/servertool/stop-message-compare-context.d.ts +0 -24
  1042. package/vendor/llmswitch-core/dist/servertool/stop-message-compare-context.js +0 -133
  1043. package/vendor/llmswitch-core/dist/servertool/strip-servertool-calls.d.ts +0 -2
  1044. package/vendor/llmswitch-core/dist/servertool/strip-servertool-calls.js +0 -75
  1045. package/vendor/llmswitch-core/dist/servertool/types.d.ts +0 -235
  1046. package/vendor/llmswitch-core/dist/servertool/types.js +0 -1
  1047. package/vendor/llmswitch-core/dist/sse/index.d.ts +0 -176
  1048. package/vendor/llmswitch-core/dist/sse/index.js +0 -142
  1049. package/vendor/llmswitch-core/dist/sse/json-to-sse/anthropic-json-to-sse-converter.d.ts +0 -15
  1050. package/vendor/llmswitch-core/dist/sse/json-to-sse/anthropic-json-to-sse-converter.js +0 -112
  1051. package/vendor/llmswitch-core/dist/sse/json-to-sse/chat-json-to-sse-converter.d.ts +0 -80
  1052. package/vendor/llmswitch-core/dist/sse/json-to-sse/chat-json-to-sse-converter.js +0 -300
  1053. package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/chat.d.ts +0 -55
  1054. package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/chat.js +0 -233
  1055. package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/responses.d.ts +0 -103
  1056. package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/responses.js +0 -703
  1057. package/vendor/llmswitch-core/dist/sse/json-to-sse/gemini-json-to-sse-converter.d.ts +0 -15
  1058. package/vendor/llmswitch-core/dist/sse/json-to-sse/gemini-json-to-sse-converter.js +0 -99
  1059. package/vendor/llmswitch-core/dist/sse/json-to-sse/index.d.ts +0 -7
  1060. package/vendor/llmswitch-core/dist/sse/json-to-sse/index.js +0 -9
  1061. package/vendor/llmswitch-core/dist/sse/json-to-sse/responses-json-to-sse-converter.d.ts +0 -80
  1062. package/vendor/llmswitch-core/dist/sse/json-to-sse/responses-json-to-sse-converter.js +0 -322
  1063. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/anthropic-sequencer.d.ts +0 -13
  1064. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/anthropic-sequencer.js +0 -162
  1065. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/chat-sequencer.d.ts +0 -39
  1066. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/chat-sequencer.js +0 -264
  1067. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/gemini-sequencer.d.ts +0 -10
  1068. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/gemini-sequencer.js +0 -95
  1069. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/responses-sequencer.d.ts +0 -40
  1070. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/responses-sequencer.js +0 -293
  1071. package/vendor/llmswitch-core/dist/sse/registry/sse-codec-registry.d.ts +0 -32
  1072. package/vendor/llmswitch-core/dist/sse/registry/sse-codec-registry.js +0 -135
  1073. package/vendor/llmswitch-core/dist/sse/shared/chat-serializer.d.ts +0 -4
  1074. package/vendor/llmswitch-core/dist/sse/shared/chat-serializer.js +0 -40
  1075. package/vendor/llmswitch-core/dist/sse/shared/constants.d.ts +0 -272
  1076. package/vendor/llmswitch-core/dist/sse/shared/constants.js +0 -321
  1077. package/vendor/llmswitch-core/dist/sse/shared/reasoning-dispatcher.d.ts +0 -10
  1078. package/vendor/llmswitch-core/dist/sse/shared/reasoning-dispatcher.js +0 -25
  1079. package/vendor/llmswitch-core/dist/sse/shared/responses-output-normalizer.d.ts +0 -13
  1080. package/vendor/llmswitch-core/dist/sse/shared/responses-output-normalizer.js +0 -47
  1081. package/vendor/llmswitch-core/dist/sse/shared/serializers/anthropic-event-serializer.d.ts +0 -2
  1082. package/vendor/llmswitch-core/dist/sse/shared/serializers/anthropic-event-serializer.js +0 -9
  1083. package/vendor/llmswitch-core/dist/sse/shared/serializers/base-serializer.d.ts +0 -158
  1084. package/vendor/llmswitch-core/dist/sse/shared/serializers/base-serializer.js +0 -210
  1085. package/vendor/llmswitch-core/dist/sse/shared/serializers/chat-event-serializer.d.ts +0 -82
  1086. package/vendor/llmswitch-core/dist/sse/shared/serializers/chat-event-serializer.js +0 -275
  1087. package/vendor/llmswitch-core/dist/sse/shared/serializers/gemini-event-serializer.d.ts +0 -2
  1088. package/vendor/llmswitch-core/dist/sse/shared/serializers/gemini-event-serializer.js +0 -5
  1089. package/vendor/llmswitch-core/dist/sse/shared/serializers/index.d.ts +0 -42
  1090. package/vendor/llmswitch-core/dist/sse/shared/serializers/index.js +0 -56
  1091. package/vendor/llmswitch-core/dist/sse/shared/serializers/responses-event-serializer.d.ts +0 -131
  1092. package/vendor/llmswitch-core/dist/sse/shared/serializers/responses-event-serializer.js +0 -375
  1093. package/vendor/llmswitch-core/dist/sse/shared/serializers/types.d.ts +0 -51
  1094. package/vendor/llmswitch-core/dist/sse/shared/serializers/types.js +0 -4
  1095. package/vendor/llmswitch-core/dist/sse/shared/utils.d.ts +0 -254
  1096. package/vendor/llmswitch-core/dist/sse/shared/utils.js +0 -543
  1097. package/vendor/llmswitch-core/dist/sse/shared/writer.d.ts +0 -127
  1098. package/vendor/llmswitch-core/dist/sse/shared/writer.js +0 -321
  1099. package/vendor/llmswitch-core/dist/sse/sse-to-json/anthropic-sse-to-json-converter.d.ts +0 -20
  1100. package/vendor/llmswitch-core/dist/sse/sse-to-json/anthropic-sse-to-json-converter.js +0 -204
  1101. package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/anthropic-response-builder.d.ts +0 -16
  1102. package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/anthropic-response-builder.js +0 -258
  1103. package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/response-builder.d.ts +0 -177
  1104. package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/response-builder.js +0 -1135
  1105. package/vendor/llmswitch-core/dist/sse/sse-to-json/chat-sse-to-json-converter.d.ts +0 -119
  1106. package/vendor/llmswitch-core/dist/sse/sse-to-json/chat-sse-to-json-converter.js +0 -850
  1107. package/vendor/llmswitch-core/dist/sse/sse-to-json/gemini-sse-to-json-converter.d.ts +0 -14
  1108. package/vendor/llmswitch-core/dist/sse/sse-to-json/gemini-sse-to-json-converter.js +0 -186
  1109. package/vendor/llmswitch-core/dist/sse/sse-to-json/index.d.ts +0 -7
  1110. package/vendor/llmswitch-core/dist/sse/sse-to-json/index.js +0 -9
  1111. package/vendor/llmswitch-core/dist/sse/sse-to-json/parsers/sse-parser.d.ts +0 -73
  1112. package/vendor/llmswitch-core/dist/sse/sse-to-json/parsers/sse-parser.js +0 -434
  1113. package/vendor/llmswitch-core/dist/sse/sse-to-json/responses-sse-to-json-converter.d.ts +0 -61
  1114. package/vendor/llmswitch-core/dist/sse/sse-to-json/responses-sse-to-json-converter.js +0 -306
  1115. package/vendor/llmswitch-core/dist/sse/types/anthropic-types.d.ts +0 -194
  1116. package/vendor/llmswitch-core/dist/sse/types/anthropic-types.js +0 -8
  1117. package/vendor/llmswitch-core/dist/sse/types/chat-types.d.ts +0 -321
  1118. package/vendor/llmswitch-core/dist/sse/types/chat-types.js +0 -33
  1119. package/vendor/llmswitch-core/dist/sse/types/conversion-context.d.ts +0 -214
  1120. package/vendor/llmswitch-core/dist/sse/types/conversion-context.js +0 -20
  1121. package/vendor/llmswitch-core/dist/sse/types/core-interfaces.d.ts +0 -94
  1122. package/vendor/llmswitch-core/dist/sse/types/core-interfaces.js +0 -5
  1123. package/vendor/llmswitch-core/dist/sse/types/gemini-types.d.ts +0 -135
  1124. package/vendor/llmswitch-core/dist/sse/types/gemini-types.js +0 -5
  1125. package/vendor/llmswitch-core/dist/sse/types/index.d.ts +0 -17
  1126. package/vendor/llmswitch-core/dist/sse/types/index.js +0 -9
  1127. package/vendor/llmswitch-core/dist/sse/types/responses-types.d.ts +0 -334
  1128. package/vendor/llmswitch-core/dist/sse/types/responses-types.js +0 -38
  1129. package/vendor/llmswitch-core/dist/sse/types/sse-events.d.ts +0 -181
  1130. package/vendor/llmswitch-core/dist/sse/types/sse-events.js +0 -150
  1131. package/vendor/llmswitch-core/dist/sse/types/stream-state.d.ts +0 -199
  1132. package/vendor/llmswitch-core/dist/sse/types/stream-state.js +0 -44
  1133. package/vendor/llmswitch-core/dist/sse/types/utility-types.d.ts +0 -234
  1134. package/vendor/llmswitch-core/dist/sse/types/utility-types.js +0 -46
  1135. package/vendor/llmswitch-core/dist/telemetry/stats-center.d.ts +0 -82
  1136. package/vendor/llmswitch-core/dist/telemetry/stats-center.js +0 -308
  1137. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/default-actions.d.ts +0 -2
  1138. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/default-actions.js +0 -12
  1139. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/extract-patch.d.ts +0 -2
  1140. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/extract-patch.js +0 -15
  1141. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/index.d.ts +0 -2
  1142. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/index.js +0 -164
  1143. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/structured-builders.d.ts +0 -7
  1144. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/structured-builders.js +0 -85
  1145. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/types.d.ts +0 -54
  1146. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/types.js +0 -1
  1147. package/vendor/llmswitch-core/dist/tools/apply-patch/execution-capturer.d.ts +0 -13
  1148. package/vendor/llmswitch-core/dist/tools/apply-patch/execution-capturer.js +0 -181
  1149. package/vendor/llmswitch-core/dist/tools/apply-patch/json/parse-loose.d.ts +0 -3
  1150. package/vendor/llmswitch-core/dist/tools/apply-patch/json/parse-loose.js +0 -139
  1151. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/context-diff.d.ts +0 -1
  1152. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/context-diff.js +0 -173
  1153. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/git-diff.d.ts +0 -1
  1154. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/git-diff.js +0 -138
  1155. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/looks-like-patch.d.ts +0 -1
  1156. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/looks-like-patch.js +0 -11
  1157. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/normalize.d.ts +0 -3
  1158. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/normalize.js +0 -383
  1159. package/vendor/llmswitch-core/dist/tools/apply-patch/regression-capturer.d.ts +0 -13
  1160. package/vendor/llmswitch-core/dist/tools/apply-patch/regression-capturer.js +0 -113
  1161. package/vendor/llmswitch-core/dist/tools/apply-patch/structured/coercion.d.ts +0 -3
  1162. package/vendor/llmswitch-core/dist/tools/apply-patch/structured/coercion.js +0 -103
  1163. package/vendor/llmswitch-core/dist/tools/apply-patch/structured.d.ts +0 -20
  1164. package/vendor/llmswitch-core/dist/tools/apply-patch/structured.js +0 -537
  1165. package/vendor/llmswitch-core/dist/tools/apply-patch/validation/shared.d.ts +0 -3
  1166. package/vendor/llmswitch-core/dist/tools/apply-patch/validation/shared.js +0 -6
  1167. package/vendor/llmswitch-core/dist/tools/apply-patch/validator.d.ts +0 -8
  1168. package/vendor/llmswitch-core/dist/tools/apply-patch/validator.js +0 -21
  1169. package/vendor/llmswitch-core/dist/tools/apply-patch-structured.d.ts +0 -1
  1170. package/vendor/llmswitch-core/dist/tools/apply-patch-structured.js +0 -1
  1171. package/vendor/llmswitch-core/dist/tools/args-json.d.ts +0 -1
  1172. package/vendor/llmswitch-core/dist/tools/args-json.js +0 -204
  1173. package/vendor/llmswitch-core/dist/tools/exec-command/normalize.d.ts +0 -17
  1174. package/vendor/llmswitch-core/dist/tools/exec-command/normalize.js +0 -116
  1175. package/vendor/llmswitch-core/dist/tools/exec-command/regression-capturer.d.ts +0 -11
  1176. package/vendor/llmswitch-core/dist/tools/exec-command/regression-capturer.js +0 -144
  1177. package/vendor/llmswitch-core/dist/tools/exec-command/validator.d.ts +0 -10
  1178. package/vendor/llmswitch-core/dist/tools/exec-command/validator.js +0 -238
  1179. package/vendor/llmswitch-core/dist/tools/patch-regression-capturer.d.ts +0 -1
  1180. package/vendor/llmswitch-core/dist/tools/patch-regression-capturer.js +0 -1
  1181. package/vendor/llmswitch-core/dist/tools/tool-description-utils.d.ts +0 -5
  1182. package/vendor/llmswitch-core/dist/tools/tool-description-utils.js +0 -50
  1183. package/vendor/llmswitch-core/dist/tools/tool-registry.d.ts +0 -15
  1184. package/vendor/llmswitch-core/dist/tools/tool-registry.js +0 -253
  1185. package/vendor/llmswitch-core/package.json +0 -189
@@ -1,2594 +0,0 @@
1
- import { failNativeRequired, isNativeDisabledByEnv } from './native-router-hotpath-policy.js';
2
- import { loadNativeRouterHotpathBindingForInternalUse } from './native-router-hotpath.js';
3
- function readNativeFunction(name) {
4
- const binding = loadNativeRouterHotpathBindingForInternalUse();
5
- const fn = binding?.[name];
6
- return typeof fn === 'function' ? fn : null;
7
- }
8
- function safeStringify(value) {
9
- try {
10
- return JSON.stringify(value);
11
- }
12
- catch {
13
- return undefined;
14
- }
15
- }
16
- function parseJson(raw) {
17
- try {
18
- return JSON.parse(raw);
19
- }
20
- catch {
21
- return null;
22
- }
23
- }
24
- function parseRecord(raw) {
25
- const parsed = parseJson(raw);
26
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
27
- return null;
28
- }
29
- return parsed;
30
- }
31
- function parseExtractToolCallsOutput(raw) {
32
- const parsed = parseJson(raw);
33
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
34
- return null;
35
- }
36
- const row = parsed;
37
- if (typeof row.cleanedText !== 'string' || !Array.isArray(row.toolCalls)) {
38
- return null;
39
- }
40
- const toolCalls = row.toolCalls.filter((entry) => entry && typeof entry === 'object');
41
- return {
42
- cleanedText: row.cleanedText,
43
- toolCalls
44
- };
45
- }
46
- function parseReasoningItems(raw) {
47
- const parsed = parseJson(raw);
48
- if (!Array.isArray(parsed)) {
49
- return null;
50
- }
51
- const out = [];
52
- for (const entry of parsed) {
53
- if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
54
- return null;
55
- }
56
- const row = entry;
57
- if (row.type !== 'reasoning' || typeof row.content !== 'string') {
58
- return null;
59
- }
60
- out.push({ type: 'reasoning', content: row.content });
61
- }
62
- return out;
63
- }
64
- function parseExtractReasoningSegmentsOutput(raw) {
65
- const parsed = parseJson(raw);
66
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
67
- return null;
68
- }
69
- const row = parsed;
70
- if (typeof row.text !== 'string' || !Array.isArray(row.segments)) {
71
- return null;
72
- }
73
- const segments = row.segments.filter((entry) => typeof entry === 'string');
74
- if (segments.length !== row.segments.length) {
75
- return null;
76
- }
77
- return { text: row.text, segments };
78
- }
79
- function parseNormalizeReasoningOutput(raw) {
80
- const parsed = parseJson(raw);
81
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
82
- return null;
83
- }
84
- const row = parsed;
85
- return { payload: row.payload };
86
- }
87
- function parseToolCallLiteArray(raw) {
88
- const parsed = parseJson(raw);
89
- if (!Array.isArray(parsed)) {
90
- return null;
91
- }
92
- const out = [];
93
- for (const entry of parsed) {
94
- if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
95
- return null;
96
- }
97
- const row = entry;
98
- if (typeof row.name !== 'string' || typeof row.args !== 'string') {
99
- return null;
100
- }
101
- const id = typeof row.id === 'string' && row.id.trim().length ? row.id : undefined;
102
- out.push({ id, name: row.name, args: row.args });
103
- }
104
- return out;
105
- }
106
- function parseArray(raw) {
107
- const parsed = parseJson(raw);
108
- return Array.isArray(parsed) ? parsed : null;
109
- }
110
- function parseToolDefinitionOutput(raw) {
111
- const parsed = parseRecord(raw);
112
- return parsed;
113
- }
114
- function parseResponsesConversationResumeResult(raw) {
115
- const parsed = parseRecord(raw);
116
- if (!parsed) {
117
- return null;
118
- }
119
- const payload = parsed.payload;
120
- const meta = parsed.meta;
121
- if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {
122
- return null;
123
- }
124
- if (!meta || typeof meta !== 'object' || Array.isArray(meta)) {
125
- return null;
126
- }
127
- return {
128
- payload: payload,
129
- meta: meta
130
- };
131
- }
132
- function parseToolDefinitionArray(raw) {
133
- const parsed = parseArray(raw);
134
- if (!parsed)
135
- return null;
136
- const output = [];
137
- for (const entry of parsed) {
138
- if (entry && typeof entry === 'object' && !Array.isArray(entry)) {
139
- output.push(entry);
140
- }
141
- }
142
- return output;
143
- }
144
- function parseString(raw) {
145
- const parsed = parseJson(raw);
146
- return typeof parsed === 'string' ? parsed : null;
147
- }
148
- function parseStringArray(raw) {
149
- const parsed = parseArray(raw);
150
- if (!parsed)
151
- return null;
152
- const out = [];
153
- for (const item of parsed) {
154
- if (typeof item !== "string") {
155
- return null;
156
- }
157
- out.push(item);
158
- }
159
- return out;
160
- }
161
- export function parseLenientJsonishWithNative(value) {
162
- const capability = 'parseLenientJsonishJson';
163
- const fail = (reason) => failNativeRequired(capability, reason);
164
- if (isNativeDisabledByEnv()) {
165
- return fail('native disabled');
166
- }
167
- const fn = readNativeFunction(capability);
168
- if (!fn) {
169
- return fail();
170
- }
171
- const valueJson = safeStringify(value ?? null);
172
- if (!valueJson) {
173
- return fail('json stringify failed');
174
- }
175
- try {
176
- const raw = fn(valueJson);
177
- if (typeof raw !== 'string' || !raw) {
178
- return fail('empty result');
179
- }
180
- const parsed = parseJson(raw);
181
- return parsed === null ? fail('invalid payload') : parsed;
182
- }
183
- catch (error) {
184
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
185
- return fail(reason);
186
- }
187
- }
188
- export function repairArgumentsToStringWithNative(value) {
189
- const capability = 'repairArgumentsToStringJsonishJson';
190
- const fail = (reason) => failNativeRequired(capability, reason);
191
- if (isNativeDisabledByEnv()) {
192
- return fail('native disabled');
193
- }
194
- const fn = readNativeFunction(capability);
195
- if (!fn) {
196
- return fail();
197
- }
198
- const valueJson = safeStringify(value ?? null);
199
- if (!valueJson) {
200
- return fail('json stringify failed');
201
- }
202
- try {
203
- const raw = fn(valueJson);
204
- if (typeof raw !== 'string') {
205
- return fail('invalid payload');
206
- }
207
- return raw;
208
- }
209
- catch (error) {
210
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
211
- return fail(reason);
212
- }
213
- }
214
- export function extractToolCallsFromReasoningTextWithNative(text, idPrefix) {
215
- const capability = 'extractToolCallsFromReasoningTextJson';
216
- const fail = (reason) => failNativeRequired(capability, reason);
217
- if (isNativeDisabledByEnv()) {
218
- return fail('native disabled');
219
- }
220
- const fn = readNativeFunction(capability);
221
- if (!fn) {
222
- return fail();
223
- }
224
- try {
225
- const raw = fn(String(text ?? ''), idPrefix);
226
- if (typeof raw !== 'string' || !raw) {
227
- return fail('empty result');
228
- }
229
- const parsed = parseExtractToolCallsOutput(raw);
230
- return parsed ?? fail('invalid payload');
231
- }
232
- catch (error) {
233
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
234
- return fail(reason);
235
- }
236
- }
237
- export function extractReasoningSegmentsWithNative(source) {
238
- const capability = 'extractReasoningSegmentsJson';
239
- const fail = (reason) => failNativeRequired(capability, reason);
240
- if (isNativeDisabledByEnv()) {
241
- return fail('native disabled');
242
- }
243
- const fn = readNativeFunction(capability);
244
- if (!fn) {
245
- return fail();
246
- }
247
- const payloadJson = safeStringify({ source: String(source ?? '') });
248
- if (!payloadJson) {
249
- return fail('json stringify failed');
250
- }
251
- try {
252
- const raw = fn(payloadJson);
253
- if (typeof raw !== 'string' || !raw) {
254
- return fail('empty result');
255
- }
256
- const parsed = parseExtractReasoningSegmentsOutput(raw);
257
- return parsed ?? fail('invalid payload');
258
- }
259
- catch (error) {
260
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
261
- return fail(reason);
262
- }
263
- }
264
- export function normalizeAssistantTextToToolCallsWithNative(message, options) {
265
- const capability = 'normalizeAssistantTextToToolCallsJson';
266
- const fail = (reason) => failNativeRequired(capability, reason);
267
- if (isNativeDisabledByEnv()) {
268
- return fail('native disabled');
269
- }
270
- const fn = readNativeFunction(capability);
271
- if (!fn) {
272
- return fail();
273
- }
274
- const msgJson = safeStringify(message ?? null);
275
- if (!msgJson) {
276
- return fail('json stringify failed');
277
- }
278
- const optionsJson = options ? safeStringify(options) : undefined;
279
- try {
280
- const raw = fn(msgJson, optionsJson);
281
- if (typeof raw !== 'string' || !raw) {
282
- return fail('empty result');
283
- }
284
- const parsed = parseRecord(raw);
285
- return parsed ?? fail('invalid payload');
286
- }
287
- catch (error) {
288
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
289
- return fail(reason);
290
- }
291
- }
292
- export function normalizeReasoningInChatPayloadWithNative(payload) {
293
- const capability = 'normalizeReasoningInChatPayloadJson';
294
- const fail = (reason) => failNativeRequired(capability, reason);
295
- if (isNativeDisabledByEnv()) {
296
- return fail('native disabled');
297
- }
298
- const fn = readNativeFunction(capability);
299
- if (!fn) {
300
- return fail();
301
- }
302
- const payloadJson = safeStringify({ payload: payload ?? null });
303
- if (!payloadJson) {
304
- return fail('json stringify failed');
305
- }
306
- try {
307
- const raw = fn(payloadJson);
308
- if (typeof raw !== 'string' || !raw) {
309
- return fail('empty result');
310
- }
311
- const parsed = parseNormalizeReasoningOutput(raw);
312
- return parsed ? parsed.payload : fail('invalid payload');
313
- }
314
- catch (error) {
315
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
316
- return fail(reason);
317
- }
318
- }
319
- export function normalizeReasoningInResponsesPayloadWithNative(payload, options) {
320
- const capability = 'normalizeReasoningInResponsesPayloadJson';
321
- const fail = (reason) => failNativeRequired(capability, reason);
322
- if (isNativeDisabledByEnv()) {
323
- return fail('native disabled');
324
- }
325
- const fn = readNativeFunction(capability);
326
- if (!fn) {
327
- return fail();
328
- }
329
- const payloadJson = safeStringify({ payload: payload ?? null, options: options ?? null });
330
- if (!payloadJson) {
331
- return fail('json stringify failed');
332
- }
333
- try {
334
- const raw = fn(payloadJson);
335
- if (typeof raw !== 'string' || !raw) {
336
- return fail('empty result');
337
- }
338
- const parsed = parseNormalizeReasoningOutput(raw);
339
- return parsed ? parsed.payload : fail('invalid payload');
340
- }
341
- catch (error) {
342
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
343
- return fail(reason);
344
- }
345
- }
346
- export function normalizeReasoningInGeminiPayloadWithNative(payload) {
347
- const capability = 'normalizeReasoningInGeminiPayloadJson';
348
- const fail = (reason) => failNativeRequired(capability, reason);
349
- if (isNativeDisabledByEnv()) {
350
- return fail('native disabled');
351
- }
352
- const fn = readNativeFunction(capability);
353
- if (!fn) {
354
- return fail();
355
- }
356
- const payloadJson = safeStringify({ payload: payload ?? null });
357
- if (!payloadJson) {
358
- return fail('json stringify failed');
359
- }
360
- try {
361
- const raw = fn(payloadJson);
362
- if (typeof raw !== 'string' || !raw) {
363
- return fail('empty result');
364
- }
365
- const parsed = parseNormalizeReasoningOutput(raw);
366
- return parsed ? parsed.payload : fail('invalid payload');
367
- }
368
- catch (error) {
369
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
370
- return fail(reason);
371
- }
372
- }
373
- export function normalizeReasoningInAnthropicPayloadWithNative(payload) {
374
- const capability = 'normalizeReasoningInAnthropicPayloadJson';
375
- const fail = (reason) => failNativeRequired(capability, reason);
376
- if (isNativeDisabledByEnv()) {
377
- return fail('native disabled');
378
- }
379
- const fn = readNativeFunction(capability);
380
- if (!fn) {
381
- return fail();
382
- }
383
- const payloadJson = safeStringify({ payload: payload ?? null });
384
- if (!payloadJson) {
385
- return fail('json stringify failed');
386
- }
387
- try {
388
- const raw = fn(payloadJson);
389
- if (typeof raw !== 'string' || !raw) {
390
- return fail('empty result');
391
- }
392
- const parsed = parseNormalizeReasoningOutput(raw);
393
- return parsed ? parsed.payload : fail('invalid payload');
394
- }
395
- catch (error) {
396
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
397
- return fail(reason);
398
- }
399
- }
400
- export function normalizeReasoningInOpenAIPayloadWithNative(payload) {
401
- const capability = 'normalizeReasoningInOpenAIPayloadJson';
402
- const fail = (reason) => failNativeRequired(capability, reason);
403
- if (isNativeDisabledByEnv()) {
404
- return fail('native disabled');
405
- }
406
- const fn = readNativeFunction(capability);
407
- if (!fn) {
408
- return fail();
409
- }
410
- const payloadJson = safeStringify({ payload: payload ?? null });
411
- if (!payloadJson) {
412
- return fail('json stringify failed');
413
- }
414
- try {
415
- const raw = fn(payloadJson);
416
- if (typeof raw !== 'string' || !raw) {
417
- return fail('empty result');
418
- }
419
- const parsed = parseNormalizeReasoningOutput(raw);
420
- return parsed ? parsed.payload : fail('invalid payload');
421
- }
422
- catch (error) {
423
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
424
- return fail(reason);
425
- }
426
- }
427
- export function bridgeToolToChatDefinitionWithNative(tool, options) {
428
- const capability = 'bridgeToolToChatDefinitionJson';
429
- const fail = (reason) => failNativeRequired(capability, reason);
430
- if (isNativeDisabledByEnv()) {
431
- return fail('native disabled');
432
- }
433
- const fn = readNativeFunction(capability);
434
- if (!fn) {
435
- return fail();
436
- }
437
- const payloadJson = safeStringify({ tool, options: options ?? null });
438
- if (!payloadJson) {
439
- return fail('json stringify failed');
440
- }
441
- try {
442
- const raw = fn(payloadJson);
443
- if (typeof raw !== 'string' || !raw) {
444
- return fail('empty result');
445
- }
446
- const parsed = parseToolDefinitionOutput(raw);
447
- return parsed ?? fail('invalid payload');
448
- }
449
- catch (error) {
450
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
451
- return fail(reason);
452
- }
453
- }
454
- export function chatToolToBridgeDefinitionWithNative(tool, options) {
455
- const capability = 'chatToolToBridgeDefinitionJson';
456
- const fail = (reason) => failNativeRequired(capability, reason);
457
- if (isNativeDisabledByEnv()) {
458
- return fail('native disabled');
459
- }
460
- const fn = readNativeFunction(capability);
461
- if (!fn) {
462
- return fail();
463
- }
464
- const payloadJson = safeStringify({ tool, options: options ?? null });
465
- if (!payloadJson) {
466
- return fail('json stringify failed');
467
- }
468
- try {
469
- const raw = fn(payloadJson);
470
- if (typeof raw !== 'string' || !raw) {
471
- return fail('empty result');
472
- }
473
- const parsed = parseToolDefinitionOutput(raw);
474
- return parsed ?? fail('invalid payload');
475
- }
476
- catch (error) {
477
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
478
- return fail(reason);
479
- }
480
- }
481
- export function mapBridgeToolsToChatWithNative(rawTools, options) {
482
- const capability = 'mapBridgeToolsToChatWithOptionsJson';
483
- const fail = (reason) => failNativeRequired(capability, reason);
484
- if (isNativeDisabledByEnv()) {
485
- return fail('native disabled');
486
- }
487
- const fn = readNativeFunction(capability);
488
- if (!fn) {
489
- return fail();
490
- }
491
- const payloadJson = safeStringify({ tools: Array.isArray(rawTools) ? rawTools : [], options: options ?? null });
492
- if (!payloadJson) {
493
- return fail('json stringify failed');
494
- }
495
- try {
496
- const raw = fn(payloadJson);
497
- if (typeof raw !== 'string' || !raw) {
498
- return fail('empty result');
499
- }
500
- const parsed = parseToolDefinitionArray(raw);
501
- return parsed ?? fail('invalid payload');
502
- }
503
- catch (error) {
504
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
505
- return fail(reason);
506
- }
507
- }
508
- export function mapChatToolsToBridgeWithNative(rawTools, options) {
509
- const capability = 'mapChatToolsToBridgeWithOptionsJson';
510
- const fail = (reason) => failNativeRequired(capability, reason);
511
- if (isNativeDisabledByEnv()) {
512
- return fail('native disabled');
513
- }
514
- const fn = readNativeFunction(capability);
515
- if (!fn) {
516
- return fail();
517
- }
518
- const payloadJson = safeStringify({ tools: Array.isArray(rawTools) ? rawTools : [], options: options ?? null });
519
- if (!payloadJson) {
520
- return fail('json stringify failed');
521
- }
522
- try {
523
- const raw = fn(payloadJson);
524
- if (typeof raw !== 'string' || !raw) {
525
- return fail('empty result');
526
- }
527
- const parsed = parseToolDefinitionArray(raw);
528
- return parsed ?? fail('invalid payload');
529
- }
530
- catch (error) {
531
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
532
- return fail(reason);
533
- }
534
- }
535
- export function collectToolCallsFromResponsesWithNative(response) {
536
- const capability = 'collectToolCallsFromResponsesJson';
537
- const fail = (reason) => failNativeRequired(capability, reason);
538
- if (isNativeDisabledByEnv()) {
539
- return fail('native disabled');
540
- }
541
- const fn = readNativeFunction(capability);
542
- if (!fn) {
543
- return fail();
544
- }
545
- const payloadJson = safeStringify(response ?? {});
546
- if (!payloadJson) {
547
- return fail('json stringify failed');
548
- }
549
- try {
550
- const raw = fn(payloadJson);
551
- if (typeof raw !== 'string' || !raw) {
552
- return fail('empty result');
553
- }
554
- const parsed = parseToolDefinitionArray(raw);
555
- return parsed ?? fail('invalid payload');
556
- }
557
- catch (error) {
558
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
559
- return fail(reason);
560
- }
561
- }
562
- export function resolveFinishReasonWithNative(response, toolCalls) {
563
- const capability = 'resolveFinishReasonJson';
564
- const fail = (reason) => failNativeRequired(capability, reason);
565
- if (isNativeDisabledByEnv()) {
566
- return fail('native disabled');
567
- }
568
- const fn = readNativeFunction(capability);
569
- if (!fn) {
570
- return fail();
571
- }
572
- const responseJson = safeStringify(response ?? {});
573
- const toolCallsJson = safeStringify(Array.isArray(toolCalls) ? toolCalls : []);
574
- if (!responseJson || !toolCallsJson) {
575
- return fail('json stringify failed');
576
- }
577
- try {
578
- const raw = fn(responseJson, toolCallsJson);
579
- if (typeof raw !== 'string' || !raw) {
580
- return fail('empty result');
581
- }
582
- return parseString(raw) ?? fail('invalid payload');
583
- }
584
- catch (error) {
585
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
586
- return fail(reason);
587
- }
588
- }
589
- export function buildChatResponseFromResponsesWithNative(payload) {
590
- const capability = 'buildChatResponseFromResponsesJson';
591
- const fail = (reason) => failNativeRequired(capability, reason);
592
- if (isNativeDisabledByEnv()) {
593
- return fail('native disabled');
594
- }
595
- const fn = readNativeFunction(capability);
596
- if (!fn) {
597
- return fail();
598
- }
599
- const payloadJson = safeStringify(payload ?? null);
600
- if (!payloadJson) {
601
- return fail('json stringify failed');
602
- }
603
- try {
604
- const raw = fn(payloadJson);
605
- if (typeof raw !== 'string' || !raw) {
606
- return fail('empty result');
607
- }
608
- return parseRecord(raw) ?? fail('invalid payload');
609
- }
610
- catch (error) {
611
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
612
- return fail(reason);
613
- }
614
- }
615
- export function hasValidThoughtSignatureWithNative(block, options) {
616
- const capability = 'hasValidThoughtSignatureJson';
617
- const fail = (reason) => failNativeRequired(capability, reason);
618
- if (isNativeDisabledByEnv()) {
619
- return fail('native disabled');
620
- }
621
- const fn = readNativeFunction(capability);
622
- if (!fn) {
623
- return fail();
624
- }
625
- const payloadJson = safeStringify({ block: block ?? null, options: options ?? null });
626
- if (!payloadJson) {
627
- return fail('json stringify failed');
628
- }
629
- try {
630
- const raw = fn(payloadJson);
631
- if (typeof raw !== 'string' || !raw) {
632
- return fail('empty result');
633
- }
634
- const parsed = parseJson(raw);
635
- return typeof parsed === 'boolean' ? parsed : fail('invalid payload');
636
- }
637
- catch (error) {
638
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
639
- return fail(reason);
640
- }
641
- }
642
- export function sanitizeThinkingBlockWithNative(block) {
643
- const capability = 'sanitizeThinkingBlockJson';
644
- const fail = (reason) => failNativeRequired(capability, reason);
645
- if (isNativeDisabledByEnv()) {
646
- return fail('native disabled');
647
- }
648
- const fn = readNativeFunction(capability);
649
- if (!fn) {
650
- return fail();
651
- }
652
- const payloadJson = safeStringify({ block: block ?? null });
653
- if (!payloadJson) {
654
- return fail('json stringify failed');
655
- }
656
- try {
657
- const raw = fn(payloadJson);
658
- if (typeof raw !== 'string' || !raw) {
659
- return fail('empty result');
660
- }
661
- const parsed = parseRecord(raw);
662
- return parsed ?? fail('invalid payload');
663
- }
664
- catch (error) {
665
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
666
- return fail(reason);
667
- }
668
- }
669
- export function filterInvalidThinkingBlocksWithNative(messages, options) {
670
- const capability = 'filterInvalidThinkingBlocksJson';
671
- const fail = (reason) => failNativeRequired(capability, reason);
672
- if (isNativeDisabledByEnv()) {
673
- return fail('native disabled');
674
- }
675
- const fn = readNativeFunction(capability);
676
- if (!fn) {
677
- return fail();
678
- }
679
- const payloadJson = safeStringify({ messages: Array.isArray(messages) ? messages : [], options: options ?? null });
680
- if (!payloadJson) {
681
- return fail('json stringify failed');
682
- }
683
- try {
684
- const raw = fn(payloadJson);
685
- if (typeof raw !== 'string' || !raw) {
686
- return fail('empty result');
687
- }
688
- const parsed = parseArray(raw);
689
- return parsed ?? fail('invalid payload');
690
- }
691
- catch (error) {
692
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
693
- return fail(reason);
694
- }
695
- }
696
- export function removeTrailingUnsignedThinkingBlocksWithNative(blocks, options) {
697
- const capability = 'removeTrailingUnsignedThinkingBlocksJson';
698
- const fail = (reason) => failNativeRequired(capability, reason);
699
- if (isNativeDisabledByEnv()) {
700
- return fail('native disabled');
701
- }
702
- const fn = readNativeFunction(capability);
703
- if (!fn) {
704
- return fail();
705
- }
706
- const payloadJson = safeStringify({ blocks: Array.isArray(blocks) ? blocks : [], options: options ?? null });
707
- if (!payloadJson) {
708
- return fail('json stringify failed');
709
- }
710
- try {
711
- const raw = fn(payloadJson);
712
- if (typeof raw !== 'string' || !raw) {
713
- return fail('empty result');
714
- }
715
- const parsed = parseArray(raw);
716
- return parsed ?? fail('invalid payload');
717
- }
718
- catch (error) {
719
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
720
- return fail(reason);
721
- }
722
- }
723
- export function sanitizeReasoningTaggedTextWithNative(text) {
724
- const capability = 'sanitizeReasoningTaggedTextJson';
725
- const fail = (reason) => failNativeRequired(capability, reason);
726
- if (isNativeDisabledByEnv()) {
727
- return fail('native disabled');
728
- }
729
- const fn = readNativeFunction(capability);
730
- if (!fn) {
731
- return fail();
732
- }
733
- try {
734
- const raw = fn(String(text ?? ''));
735
- if (typeof raw !== 'string') {
736
- return fail('invalid payload');
737
- }
738
- return raw;
739
- }
740
- catch (error) {
741
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
742
- return fail(reason);
743
- }
744
- }
745
- export function sanitizeFollowupTextWithNative(rawText) {
746
- const capability = 'sanitizeFollowupTextJson';
747
- const fail = (reason) => failNativeRequired(capability, reason);
748
- if (isNativeDisabledByEnv()) {
749
- return fail('native disabled');
750
- }
751
- const fn = readNativeFunction(capability);
752
- if (!fn) {
753
- return fail();
754
- }
755
- try {
756
- const raw = fn(String(rawText ?? ''));
757
- if (typeof raw !== 'string' || !raw) {
758
- return fail('empty result');
759
- }
760
- const parsed = parseString(raw);
761
- return parsed ?? fail('invalid payload');
762
- }
763
- catch (error) {
764
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
765
- return fail(reason);
766
- }
767
- }
768
- export function ensureBridgeInstructionsWithNative(payload) {
769
- const capability = 'ensureBridgeInstructionsJson';
770
- const fail = (reason) => failNativeRequired(capability, reason);
771
- if (isNativeDisabledByEnv()) {
772
- return fail('native disabled');
773
- }
774
- const fn = readNativeFunction(capability);
775
- if (!fn) {
776
- return fail();
777
- }
778
- const payloadJson = safeStringify(payload ?? {});
779
- if (!payloadJson) {
780
- return fail('json stringify failed');
781
- }
782
- try {
783
- const raw = fn(payloadJson);
784
- if (typeof raw !== 'string' || !raw) {
785
- return fail('empty result');
786
- }
787
- const parsed = parseRecord(raw);
788
- return parsed ?? fail('invalid payload');
789
- }
790
- catch (error) {
791
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
792
- return fail(reason);
793
- }
794
- }
795
- export function repairFindMetaWithNative(script) {
796
- const capability = 'repairFindMetaJson';
797
- const fail = (reason) => failNativeRequired(capability, reason);
798
- if (isNativeDisabledByEnv()) {
799
- return fail('native disabled');
800
- }
801
- const fn = readNativeFunction(capability);
802
- if (!fn) {
803
- return fail();
804
- }
805
- const payloadJson = safeStringify(script ?? '');
806
- if (!payloadJson) {
807
- return fail('json stringify failed');
808
- }
809
- try {
810
- const raw = fn(payloadJson);
811
- if (typeof raw !== 'string' || !raw) {
812
- return fail('empty result');
813
- }
814
- const parsed = parseJson(raw);
815
- return typeof parsed === 'string' ? parsed : fail('invalid payload');
816
- }
817
- catch (error) {
818
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
819
- return fail(reason);
820
- }
821
- }
822
- export function splitCommandStringWithNative(input) {
823
- const capability = 'splitCommandStringJson';
824
- const fail = (reason) => failNativeRequired(capability, reason);
825
- if (isNativeDisabledByEnv()) {
826
- return fail('native disabled');
827
- }
828
- const fn = readNativeFunction(capability);
829
- if (!fn) {
830
- return fail();
831
- }
832
- const payloadJson = safeStringify(input ?? '');
833
- if (!payloadJson) {
834
- return fail('json stringify failed');
835
- }
836
- try {
837
- const raw = fn(payloadJson);
838
- if (typeof raw !== 'string' || !raw) {
839
- return fail('empty result');
840
- }
841
- const parsed = parseStringArray(raw);
842
- return parsed ?? fail('invalid payload');
843
- }
844
- catch (error) {
845
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
846
- return fail(reason);
847
- }
848
- }
849
- export function packShellArgsWithNative(input) {
850
- const capability = 'packShellArgsJson';
851
- const fail = (reason) => failNativeRequired(capability, reason);
852
- if (isNativeDisabledByEnv()) {
853
- return fail('native disabled');
854
- }
855
- const fn = readNativeFunction(capability);
856
- if (!fn) {
857
- return fail();
858
- }
859
- const payloadJson = safeStringify(input ?? {});
860
- if (!payloadJson) {
861
- return fail('json stringify failed');
862
- }
863
- try {
864
- const raw = fn(payloadJson);
865
- if (typeof raw !== 'string' || !raw) {
866
- return fail('empty result');
867
- }
868
- const parsed = parseRecord(raw);
869
- return parsed ?? fail('invalid payload');
870
- }
871
- catch (error) {
872
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
873
- return fail(reason);
874
- }
875
- }
876
- export function flattenByCommaWithNative(items) {
877
- const capability = 'flattenByCommaJson';
878
- const fail = (reason) => failNativeRequired(capability, reason);
879
- if (isNativeDisabledByEnv()) {
880
- return fail('native disabled');
881
- }
882
- const fn = readNativeFunction(capability);
883
- if (!fn) {
884
- return fail();
885
- }
886
- const payloadJson = safeStringify(Array.isArray(items) ? items : []);
887
- if (!payloadJson) {
888
- return fail('json stringify failed');
889
- }
890
- try {
891
- const raw = fn(payloadJson);
892
- if (typeof raw !== 'string' || !raw) {
893
- return fail('empty result');
894
- }
895
- const parsed = parseStringArray(raw);
896
- return parsed ?? fail('invalid payload');
897
- }
898
- catch (error) {
899
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
900
- return fail(reason);
901
- }
902
- }
903
- export function chunkStringWithNative(s, minParts = 3, maxParts = 12, targetChunk = 12) {
904
- const capability = 'chunkStringJson';
905
- const fail = (reason) => failNativeRequired(capability, reason);
906
- if (isNativeDisabledByEnv()) {
907
- return fail('native disabled');
908
- }
909
- const fn = readNativeFunction(capability);
910
- if (!fn) {
911
- return fail();
912
- }
913
- const payloadJson = safeStringify({ s, minParts, maxParts, targetChunk });
914
- if (!payloadJson) {
915
- return fail('json stringify failed');
916
- }
917
- try {
918
- const raw = fn(payloadJson);
919
- if (typeof raw !== 'string' || !raw) {
920
- return fail('empty result');
921
- }
922
- const parsed = parseStringArray(raw);
923
- return parsed ?? fail('invalid payload');
924
- }
925
- catch (error) {
926
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
927
- return fail(reason);
928
- }
929
- }
930
- export function deriveToolCallKeyWithNative(call) {
931
- const capability = 'deriveToolCallKeyJson';
932
- const fail = (reason) => failNativeRequired(capability, reason);
933
- if (isNativeDisabledByEnv()) {
934
- return fail('native disabled');
935
- }
936
- const fn = readNativeFunction(capability);
937
- if (!fn) {
938
- return fail();
939
- }
940
- const callJson = safeStringify(call ?? null);
941
- if (!callJson) {
942
- return fail('json stringify failed');
943
- }
944
- try {
945
- const raw = fn(callJson);
946
- if (typeof raw !== 'string' || !raw) {
947
- return fail('empty result');
948
- }
949
- const parsed = parseJson(raw);
950
- if (parsed === null) {
951
- return null;
952
- }
953
- return typeof parsed === 'string' ? parsed : fail('invalid payload');
954
- }
955
- catch (error) {
956
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
957
- return fail(reason);
958
- }
959
- }
960
- export function normalizeIdValueWithNative(value, forceGenerate = false) {
961
- const capability = 'normalizeIdValueJson';
962
- const fail = (reason) => failNativeRequired(capability, reason);
963
- if (isNativeDisabledByEnv()) {
964
- return fail('native disabled');
965
- }
966
- const fn = readNativeFunction(capability);
967
- if (!fn) {
968
- return fail();
969
- }
970
- const payloadJson = safeStringify({ value, forceGenerate });
971
- if (!payloadJson) {
972
- return fail('json stringify failed');
973
- }
974
- try {
975
- const raw = fn(payloadJson);
976
- if (typeof raw !== 'string' || !raw) {
977
- return fail('empty result');
978
- }
979
- const parsed = parseJson(raw);
980
- return typeof parsed === 'string' ? parsed : fail('invalid payload');
981
- }
982
- catch (error) {
983
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
984
- return fail(reason);
985
- }
986
- }
987
- export function extractToolCallIdWithNative(obj) {
988
- const capability = 'extractToolCallIdJson';
989
- const fail = (reason) => failNativeRequired(capability, reason);
990
- if (isNativeDisabledByEnv()) {
991
- return fail('native disabled');
992
- }
993
- const fn = readNativeFunction(capability);
994
- if (!fn) {
995
- return fail();
996
- }
997
- const payloadJson = safeStringify({ obj: obj ?? null });
998
- if (!payloadJson) {
999
- return fail('json stringify failed');
1000
- }
1001
- try {
1002
- const raw = fn(payloadJson);
1003
- if (typeof raw !== 'string' || !raw) {
1004
- return fail('empty result');
1005
- }
1006
- const parsed = parseJson(raw);
1007
- return typeof parsed === 'string' ? parsed : undefined;
1008
- }
1009
- catch (error) {
1010
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1011
- return fail(reason);
1012
- }
1013
- }
1014
- export function createToolCallIdTransformerWithNative(style) {
1015
- const capability = 'createToolCallIdTransformerJson';
1016
- const fail = (reason) => failNativeRequired(capability, reason);
1017
- if (isNativeDisabledByEnv()) {
1018
- return fail('native disabled');
1019
- }
1020
- const fn = readNativeFunction(capability);
1021
- if (!fn) {
1022
- return fail();
1023
- }
1024
- const payloadJson = safeStringify({ style });
1025
- if (!payloadJson) {
1026
- return fail('json stringify failed');
1027
- }
1028
- try {
1029
- const raw = fn(payloadJson);
1030
- if (typeof raw !== 'string' || !raw) {
1031
- return fail('empty result');
1032
- }
1033
- const parsed = parseRecord(raw);
1034
- return parsed ?? fail('invalid payload');
1035
- }
1036
- catch (error) {
1037
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1038
- return fail(reason);
1039
- }
1040
- }
1041
- export function transformToolCallIdWithNative(state, id) {
1042
- const capability = 'transformToolCallIdJson';
1043
- const fail = (reason) => failNativeRequired(capability, reason);
1044
- if (isNativeDisabledByEnv()) {
1045
- return fail('native disabled');
1046
- }
1047
- const fn = readNativeFunction(capability);
1048
- if (!fn) {
1049
- return fail();
1050
- }
1051
- const payloadJson = safeStringify({ state, id });
1052
- if (!payloadJson) {
1053
- return fail('json stringify failed');
1054
- }
1055
- try {
1056
- const raw = fn(payloadJson);
1057
- if (typeof raw !== 'string' || !raw) {
1058
- return fail('empty result');
1059
- }
1060
- const parsed = parseRecord(raw);
1061
- if (!parsed || typeof parsed.id !== 'string' || !parsed.state || typeof parsed.state !== 'object') {
1062
- return fail('invalid payload');
1063
- }
1064
- return parsed;
1065
- }
1066
- catch (error) {
1067
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1068
- return fail(reason);
1069
- }
1070
- }
1071
- export function enforceToolCallIdStyleWithNative(messages, state) {
1072
- const capability = 'enforceToolCallIdStyleJson';
1073
- const fail = (reason) => failNativeRequired(capability, reason);
1074
- if (isNativeDisabledByEnv()) {
1075
- return fail('native disabled');
1076
- }
1077
- const fn = readNativeFunction(capability);
1078
- if (!fn) {
1079
- return fail();
1080
- }
1081
- const payloadJson = safeStringify({ messages: Array.isArray(messages) ? messages : [], state });
1082
- if (!payloadJson) {
1083
- return fail('json stringify failed');
1084
- }
1085
- try {
1086
- const raw = fn(payloadJson);
1087
- if (typeof raw !== 'string' || !raw) {
1088
- return fail('empty result');
1089
- }
1090
- const parsed = parseRecord(raw);
1091
- if (!parsed || !Array.isArray(parsed.messages) || !parsed.state || typeof parsed.state !== 'object') {
1092
- return fail('invalid payload');
1093
- }
1094
- return parsed;
1095
- }
1096
- catch (error) {
1097
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1098
- return fail(reason);
1099
- }
1100
- }
1101
- export function normalizeResponsesToolCallIdsWithNative(payload) {
1102
- const capability = 'normalizeResponsesToolCallIdsJson';
1103
- const fail = (reason) => failNativeRequired(capability, reason);
1104
- if (isNativeDisabledByEnv()) {
1105
- return fail('native disabled');
1106
- }
1107
- const fn = readNativeFunction(capability);
1108
- if (!fn) {
1109
- return fail();
1110
- }
1111
- const payloadJson = safeStringify(payload ?? null);
1112
- if (!payloadJson) {
1113
- return fail('json stringify failed');
1114
- }
1115
- try {
1116
- const raw = fn(payloadJson);
1117
- if (typeof raw !== 'string' || !raw) {
1118
- return fail('empty result');
1119
- }
1120
- return parseRecord(raw) ?? fail('invalid payload');
1121
- }
1122
- catch (error) {
1123
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1124
- return fail(reason);
1125
- }
1126
- }
1127
- export function resolveToolCallIdStyleWithNative(metadata) {
1128
- const capability = 'resolveToolCallIdStyleJson';
1129
- const fail = (reason) => failNativeRequired(capability, reason);
1130
- if (isNativeDisabledByEnv()) {
1131
- return fail('native disabled');
1132
- }
1133
- const fn = readNativeFunction(capability);
1134
- if (!fn) {
1135
- return fail();
1136
- }
1137
- const metadataJson = safeStringify(metadata ?? null);
1138
- if (!metadataJson) {
1139
- return fail('json stringify failed');
1140
- }
1141
- try {
1142
- const raw = fn(metadataJson);
1143
- if (typeof raw !== 'string' || !raw) {
1144
- return fail('empty result');
1145
- }
1146
- const parsed = parseJson(raw);
1147
- return typeof parsed === 'string' ? parsed : fail('invalid payload');
1148
- }
1149
- catch (error) {
1150
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1151
- return fail(reason);
1152
- }
1153
- }
1154
- export function stripInternalToolingMetadataWithNative(metadata) {
1155
- const capability = 'stripInternalToolingMetadataJson';
1156
- const fail = (reason) => failNativeRequired(capability, reason);
1157
- if (isNativeDisabledByEnv()) {
1158
- return fail('native disabled');
1159
- }
1160
- const fn = readNativeFunction(capability);
1161
- if (!fn) {
1162
- return fail();
1163
- }
1164
- const metadataJson = safeStringify(metadata ?? null);
1165
- if (!metadataJson) {
1166
- return fail('json stringify failed');
1167
- }
1168
- try {
1169
- const raw = fn(metadataJson);
1170
- if (typeof raw !== 'string' || !raw) {
1171
- return fail('empty result');
1172
- }
1173
- return parseRecord(raw) ?? fail('invalid payload');
1174
- }
1175
- catch (error) {
1176
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1177
- return fail(reason);
1178
- }
1179
- }
1180
- export function buildProviderProtocolErrorWithNative(input) {
1181
- const capability = 'buildProviderProtocolErrorJson';
1182
- const fail = (reason) => failNativeRequired(capability, reason);
1183
- if (isNativeDisabledByEnv()) {
1184
- return fail('native disabled');
1185
- }
1186
- const fn = readNativeFunction(capability);
1187
- if (!fn) {
1188
- return fail();
1189
- }
1190
- const payloadJson = safeStringify({
1191
- message: input.message,
1192
- code: input.code,
1193
- protocol: input.protocol,
1194
- providerType: input.providerType,
1195
- category: input.category,
1196
- details: input.details
1197
- });
1198
- if (!payloadJson) {
1199
- return fail('json stringify failed');
1200
- }
1201
- try {
1202
- const raw = fn(payloadJson);
1203
- if (typeof raw !== 'string' || !raw) {
1204
- return fail('empty result');
1205
- }
1206
- const parsed = parseRecord(raw);
1207
- return parsed ?? fail('invalid payload');
1208
- }
1209
- catch (error) {
1210
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1211
- return fail(reason);
1212
- }
1213
- }
1214
- function parseToolCallResult(raw) {
1215
- if (!raw || raw === 'null') {
1216
- return null;
1217
- }
1218
- return parseToolCallLiteArray(raw);
1219
- }
1220
- function callTextMarkupExtractor(capability, payload) {
1221
- const fail = (reason) => failNativeRequired(capability, reason);
1222
- if (isNativeDisabledByEnv()) {
1223
- return fail('native disabled');
1224
- }
1225
- const fn = readNativeFunction(capability);
1226
- if (!fn) {
1227
- return fail();
1228
- }
1229
- const payloadJson = safeStringify(payload ?? null);
1230
- if (!payloadJson) {
1231
- return fail('json stringify failed');
1232
- }
1233
- try {
1234
- const raw = fn(payloadJson);
1235
- if (typeof raw !== 'string') {
1236
- return fail('invalid payload');
1237
- }
1238
- const parsed = parseToolCallResult(raw);
1239
- return parsed ?? null;
1240
- }
1241
- catch (error) {
1242
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1243
- return fail(reason);
1244
- }
1245
- }
1246
- export function extractJsonToolCallsFromTextWithNative(text, options) {
1247
- return callTextMarkupExtractor('extractJsonToolCallsFromTextJson', {
1248
- text: String(text ?? ''),
1249
- options: options ?? null
1250
- });
1251
- }
1252
- export function extractXMLToolCallsFromTextWithNative(text) {
1253
- return callTextMarkupExtractor('extractXmlToolCallsFromTextJson', {
1254
- text: String(text ?? '')
1255
- });
1256
- }
1257
- export function extractSimpleXmlToolsFromTextWithNative(text) {
1258
- return callTextMarkupExtractor('extractSimpleXmlToolsFromTextJson', {
1259
- text: String(text ?? '')
1260
- });
1261
- }
1262
- export function extractParameterXmlToolsFromTextWithNative(text) {
1263
- return callTextMarkupExtractor('extractParameterXmlToolsFromTextJson', {
1264
- text: String(text ?? '')
1265
- });
1266
- }
1267
- export function extractInvokeToolsFromTextWithNative(text) {
1268
- return callTextMarkupExtractor('extractInvokeToolsFromTextJson', {
1269
- text: String(text ?? '')
1270
- });
1271
- }
1272
- export function extractToolNamespaceXmlBlocksFromTextWithNative(text) {
1273
- return callTextMarkupExtractor('extractToolNamespaceXmlBlocksFromTextJson', {
1274
- text: String(text ?? '')
1275
- });
1276
- }
1277
- export function extractApplyPatchCallsFromTextWithNative(text) {
1278
- return callTextMarkupExtractor('extractApplyPatchCallsFromTextJson', {
1279
- text: String(text ?? '')
1280
- });
1281
- }
1282
- export function extractBareExecCommandFromTextWithNative(text) {
1283
- return callTextMarkupExtractor('extractBareExecCommandFromTextJson', {
1284
- text: String(text ?? '')
1285
- });
1286
- }
1287
- export function extractExecuteBlocksFromTextWithNative(text) {
1288
- return callTextMarkupExtractor('extractExecuteBlocksFromTextJson', {
1289
- text: String(text ?? '')
1290
- });
1291
- }
1292
- export function extractExploredListDirectoryCallsFromTextWithNative(text) {
1293
- return callTextMarkupExtractor('extractExploredListDirectoryCallsFromTextJson', {
1294
- text: String(text ?? '')
1295
- });
1296
- }
1297
- export function extractQwenToolCallTokensFromTextWithNative(text) {
1298
- return callTextMarkupExtractor('extractQwenToolCallTokensFromTextJson', {
1299
- text: String(text ?? '')
1300
- });
1301
- }
1302
- export function mergeToolCallsWithNative(existing, additions) {
1303
- const capability = 'mergeToolCallsJson';
1304
- const fail = (reason) => failNativeRequired(capability, reason);
1305
- if (isNativeDisabledByEnv()) {
1306
- return fail('native disabled');
1307
- }
1308
- const fn = readNativeFunction(capability);
1309
- if (!fn) {
1310
- return fail();
1311
- }
1312
- const existingJson = safeStringify(existing ?? []);
1313
- const additionsJson = safeStringify(additions ?? []);
1314
- if (!existingJson || !additionsJson) {
1315
- return fail('json stringify failed');
1316
- }
1317
- try {
1318
- const raw = fn(existingJson, additionsJson);
1319
- if (typeof raw !== 'string' || !raw) {
1320
- return fail('empty result');
1321
- }
1322
- const parsed = parseJson(raw);
1323
- if (!Array.isArray(parsed)) {
1324
- return fail('invalid payload');
1325
- }
1326
- return parsed.filter((entry) => entry && typeof entry === 'object');
1327
- }
1328
- catch (error) {
1329
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1330
- return fail(reason);
1331
- }
1332
- }
1333
- export function mapReasoningContentToResponsesOutputWithNative(reasoningContent) {
1334
- const capability = 'mapReasoningContentToResponsesOutputJson';
1335
- const fail = (reason) => failNativeRequired(capability, reason);
1336
- if (isNativeDisabledByEnv()) {
1337
- return fail('native disabled');
1338
- }
1339
- const fn = readNativeFunction(capability);
1340
- if (!fn) {
1341
- return fail();
1342
- }
1343
- const contentJson = safeStringify(reasoningContent ?? null);
1344
- if (!contentJson) {
1345
- return fail('json stringify failed');
1346
- }
1347
- try {
1348
- const raw = fn(contentJson);
1349
- if (typeof raw !== 'string' || !raw) {
1350
- return fail('empty result');
1351
- }
1352
- const parsed = parseReasoningItems(raw);
1353
- return parsed ?? fail('invalid payload');
1354
- }
1355
- catch (error) {
1356
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1357
- return fail(reason);
1358
- }
1359
- }
1360
- export function validateToolArgumentsWithNative(toolName, args) {
1361
- const capability = 'validateToolArgumentsJson';
1362
- const fail = (reason) => failNativeRequired(capability, reason);
1363
- if (isNativeDisabledByEnv()) {
1364
- return fail('native disabled');
1365
- }
1366
- const fn = readNativeFunction(capability);
1367
- if (!fn) {
1368
- return fail();
1369
- }
1370
- const payloadJson = safeStringify({ toolName, args: args ?? null });
1371
- if (!payloadJson) {
1372
- return fail('json stringify failed');
1373
- }
1374
- try {
1375
- const raw = fn(payloadJson);
1376
- if (typeof raw !== 'string' || !raw) {
1377
- return fail('empty result');
1378
- }
1379
- const parsed = parseRecord(raw);
1380
- if (!parsed || typeof parsed.repaired !== 'string' || typeof parsed.success !== 'boolean') {
1381
- return fail('invalid payload');
1382
- }
1383
- const error = typeof parsed.error === 'string' ? parsed.error : undefined;
1384
- return { repaired: parsed.repaired, success: parsed.success, ...(error ? { error } : {}) };
1385
- }
1386
- catch (error) {
1387
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1388
- return fail(reason);
1389
- }
1390
- }
1391
- export function repairToolCallsWithNative(toolCalls) {
1392
- const capability = 'repairToolCallsJson';
1393
- const fail = (reason) => failNativeRequired(capability, reason);
1394
- if (isNativeDisabledByEnv()) {
1395
- return fail('native disabled');
1396
- }
1397
- const fn = readNativeFunction(capability);
1398
- if (!fn) {
1399
- return fail();
1400
- }
1401
- const payloadJson = safeStringify(Array.isArray(toolCalls) ? toolCalls : []);
1402
- if (!payloadJson) {
1403
- return fail('json stringify failed');
1404
- }
1405
- try {
1406
- const raw = fn(payloadJson);
1407
- if (typeof raw !== 'string' || !raw) {
1408
- return fail('empty result');
1409
- }
1410
- const parsed = parseArray(raw);
1411
- if (!parsed) {
1412
- return fail('invalid payload');
1413
- }
1414
- return parsed.filter((entry) => entry && typeof entry === 'object' && !Array.isArray(entry) && typeof entry.arguments === 'string');
1415
- }
1416
- catch (error) {
1417
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1418
- return fail(reason);
1419
- }
1420
- }
1421
- export function isImagePathWithNative(pathValue) {
1422
- const capability = 'isImagePathJson';
1423
- const fail = (reason) => failNativeRequired(capability, reason);
1424
- if (isNativeDisabledByEnv()) {
1425
- return fail('native disabled');
1426
- }
1427
- const fn = readNativeFunction(capability);
1428
- if (!fn) {
1429
- return fail();
1430
- }
1431
- const pathJson = safeStringify(pathValue ?? null);
1432
- if (!pathJson) {
1433
- return fail('json stringify failed');
1434
- }
1435
- try {
1436
- const raw = fn(pathJson);
1437
- if (typeof raw !== 'string' || !raw) {
1438
- return fail('empty result');
1439
- }
1440
- const parsed = parseJson(raw);
1441
- return typeof parsed === 'boolean' ? parsed : fail('invalid payload');
1442
- }
1443
- catch (error) {
1444
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1445
- return fail(reason);
1446
- }
1447
- }
1448
- export function extractStreamingToolCallsWithNative(input) {
1449
- const capability = 'extractStreamingToolCallsJson';
1450
- const fail = (reason) => failNativeRequired(capability, reason);
1451
- if (isNativeDisabledByEnv()) {
1452
- return fail('native disabled');
1453
- }
1454
- const fn = readNativeFunction(capability);
1455
- if (!fn) {
1456
- return fail();
1457
- }
1458
- const payloadJson = safeStringify(input ?? {});
1459
- if (!payloadJson) {
1460
- return fail('json stringify failed');
1461
- }
1462
- try {
1463
- const raw = fn(payloadJson);
1464
- if (typeof raw !== 'string' || !raw) {
1465
- return fail('empty result');
1466
- }
1467
- const parsed = parseRecord(raw);
1468
- if (!parsed) {
1469
- return fail('invalid payload');
1470
- }
1471
- const buffer = typeof parsed.buffer === 'string' ? parsed.buffer : '';
1472
- const idCounter = typeof parsed.idCounter === 'number' ? parsed.idCounter : input.idCounter;
1473
- const toolCalls = Array.isArray(parsed.toolCalls)
1474
- ? parsed.toolCalls.filter((entry) => entry && typeof entry === 'object' && !Array.isArray(entry))
1475
- .map((entry) => entry)
1476
- : [];
1477
- return { buffer, idCounter, toolCalls };
1478
- }
1479
- catch (error) {
1480
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1481
- return fail(reason);
1482
- }
1483
- }
1484
- export function createStreamingToolExtractorStateWithNative(idPrefix) {
1485
- const capability = 'createStreamingToolExtractorStateJson';
1486
- const fail = (reason) => failNativeRequired(capability, reason);
1487
- if (isNativeDisabledByEnv()) {
1488
- return fail('native disabled');
1489
- }
1490
- const fn = readNativeFunction(capability);
1491
- if (!fn) {
1492
- return fail();
1493
- }
1494
- const payloadJson = safeStringify(idPrefix ? { idPrefix } : {});
1495
- if (!payloadJson) {
1496
- return fail('json stringify failed');
1497
- }
1498
- try {
1499
- const raw = fn(payloadJson);
1500
- if (typeof raw !== 'string' || !raw) {
1501
- return fail('empty result');
1502
- }
1503
- return parseRecord(raw) ?? fail('invalid payload');
1504
- }
1505
- catch (error) {
1506
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1507
- return fail(reason);
1508
- }
1509
- }
1510
- export function resetStreamingToolExtractorStateWithNative(state) {
1511
- const capability = 'resetStreamingToolExtractorStateJson';
1512
- const fail = (reason) => failNativeRequired(capability, reason);
1513
- if (isNativeDisabledByEnv()) {
1514
- return fail('native disabled');
1515
- }
1516
- const fn = readNativeFunction(capability);
1517
- if (!fn) {
1518
- return fail();
1519
- }
1520
- const payloadJson = safeStringify(state ?? {});
1521
- if (!payloadJson) {
1522
- return fail('json stringify failed');
1523
- }
1524
- try {
1525
- const raw = fn(payloadJson);
1526
- if (typeof raw !== 'string' || !raw) {
1527
- return fail('empty result');
1528
- }
1529
- return parseRecord(raw) ?? fail('invalid payload');
1530
- }
1531
- catch (error) {
1532
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1533
- return fail(reason);
1534
- }
1535
- }
1536
- export function feedStreamingToolExtractorWithNative(input) {
1537
- const capability = 'feedStreamingToolExtractorJson';
1538
- const fail = (reason) => failNativeRequired(capability, reason);
1539
- if (isNativeDisabledByEnv()) {
1540
- return fail('native disabled');
1541
- }
1542
- const fn = readNativeFunction(capability);
1543
- if (!fn) {
1544
- return fail();
1545
- }
1546
- const payloadJson = safeStringify(input ?? {});
1547
- if (!payloadJson) {
1548
- return fail('json stringify failed');
1549
- }
1550
- try {
1551
- const raw = fn(payloadJson);
1552
- if (typeof raw !== 'string' || !raw) {
1553
- return fail('empty result');
1554
- }
1555
- const parsed = parseRecord(raw);
1556
- if (!parsed || !parsed.state || typeof parsed.state !== 'object' || Array.isArray(parsed.state)) {
1557
- return fail('invalid payload');
1558
- }
1559
- const toolCalls = Array.isArray(parsed.toolCalls)
1560
- ? parsed.toolCalls.filter((entry) => entry && typeof entry === 'object' && !Array.isArray(entry))
1561
- .map((entry) => entry)
1562
- : [];
1563
- return { state: parsed.state, toolCalls };
1564
- }
1565
- catch (error) {
1566
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1567
- return fail(reason);
1568
- }
1569
- }
1570
- export function isCompactionRequestWithNative(payload) {
1571
- const capability = 'isCompactionRequestJson';
1572
- const fail = (reason) => failNativeRequired(capability, reason);
1573
- if (isNativeDisabledByEnv()) {
1574
- return fail('native disabled');
1575
- }
1576
- const fn = readNativeFunction(capability);
1577
- if (!fn) {
1578
- return fail();
1579
- }
1580
- const payloadJson = safeStringify(payload ?? null);
1581
- if (!payloadJson) {
1582
- return fail('json stringify failed');
1583
- }
1584
- try {
1585
- const raw = fn(payloadJson);
1586
- if (typeof raw !== 'string' || !raw) {
1587
- return fail('empty result');
1588
- }
1589
- const parsed = parseJson(raw);
1590
- return typeof parsed === 'boolean' ? parsed : fail('invalid payload');
1591
- }
1592
- catch (error) {
1593
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1594
- return fail(reason);
1595
- }
1596
- }
1597
- export function encodeMetadataPassthroughWithNative(parameters, prefix, keys) {
1598
- const capability = 'encodeMetadataPassthroughJson';
1599
- const fail = (reason) => failNativeRequired(capability, reason);
1600
- if (isNativeDisabledByEnv()) {
1601
- return fail('native disabled');
1602
- }
1603
- const fn = readNativeFunction(capability);
1604
- if (!fn) {
1605
- return fail();
1606
- }
1607
- const parametersJson = safeStringify(parameters ?? null);
1608
- const keysJson = safeStringify(Array.isArray(keys) ? keys : []);
1609
- if (!parametersJson || !keysJson) {
1610
- return fail('json stringify failed');
1611
- }
1612
- try {
1613
- const raw = fn(parametersJson, String(prefix || ''), keysJson);
1614
- if (typeof raw !== 'string' || !raw) {
1615
- return fail('empty result');
1616
- }
1617
- const parsed = parseJson(raw);
1618
- if (parsed === null) {
1619
- return undefined;
1620
- }
1621
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
1622
- return fail('invalid payload');
1623
- }
1624
- const out = {};
1625
- for (const [key, value] of Object.entries(parsed)) {
1626
- if (typeof key !== 'string' || typeof value !== 'string') {
1627
- return fail('invalid payload');
1628
- }
1629
- out[key] = value;
1630
- }
1631
- return Object.keys(out).length ? out : undefined;
1632
- }
1633
- catch (error) {
1634
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1635
- return fail(reason);
1636
- }
1637
- }
1638
- export function extractMetadataPassthroughWithNative(metadataField, prefix, keys) {
1639
- const capability = 'extractMetadataPassthroughJson';
1640
- const fail = (reason) => failNativeRequired(capability, reason);
1641
- if (isNativeDisabledByEnv()) {
1642
- return fail('native disabled');
1643
- }
1644
- const fn = readNativeFunction(capability);
1645
- if (!fn) {
1646
- return fail();
1647
- }
1648
- const metadataJson = safeStringify(metadataField ?? null);
1649
- const keysJson = safeStringify(Array.isArray(keys) ? keys : []);
1650
- if (!metadataJson || !keysJson) {
1651
- return fail('json stringify failed');
1652
- }
1653
- try {
1654
- const raw = fn(metadataJson, String(prefix || ''), keysJson);
1655
- if (typeof raw !== 'string' || !raw) {
1656
- return fail('empty result');
1657
- }
1658
- const parsed = parseRecord(raw);
1659
- if (!parsed) {
1660
- return fail('invalid payload');
1661
- }
1662
- const metadata = parsed.metadata && typeof parsed.metadata === 'object' && !Array.isArray(parsed.metadata)
1663
- ? parsed.metadata
1664
- : undefined;
1665
- const passthrough = parsed.passthrough && typeof parsed.passthrough === 'object' && !Array.isArray(parsed.passthrough)
1666
- ? parsed.passthrough
1667
- : undefined;
1668
- return {
1669
- ...(metadata ? { metadata } : {}),
1670
- ...(passthrough ? { passthrough } : {})
1671
- };
1672
- }
1673
- catch (error) {
1674
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1675
- return fail(reason);
1676
- }
1677
- }
1678
- export function ensureProtocolStateWithNative(metadata, protocol) {
1679
- const capability = 'ensureProtocolStateJson';
1680
- const fail = (reason) => failNativeRequired(capability, reason);
1681
- if (isNativeDisabledByEnv()) {
1682
- return fail('native disabled');
1683
- }
1684
- const fn = readNativeFunction(capability);
1685
- if (!fn) {
1686
- return fail();
1687
- }
1688
- const metadataJson = safeStringify(metadata ?? {});
1689
- if (!metadataJson) {
1690
- return fail('json stringify failed');
1691
- }
1692
- try {
1693
- const raw = fn(metadataJson, String(protocol ?? ''));
1694
- if (typeof raw !== 'string' || !raw) {
1695
- return fail('empty result');
1696
- }
1697
- const parsed = parseRecord(raw);
1698
- if (!parsed) {
1699
- return fail('invalid payload');
1700
- }
1701
- const metadataOut = parsed.metadata && typeof parsed.metadata === 'object' && !Array.isArray(parsed.metadata)
1702
- ? parsed.metadata
1703
- : undefined;
1704
- const nodeOut = parsed.node && typeof parsed.node === 'object' && !Array.isArray(parsed.node)
1705
- ? parsed.node
1706
- : undefined;
1707
- if (!metadataOut || !nodeOut) {
1708
- return fail('invalid payload');
1709
- }
1710
- return { metadata: metadataOut, node: nodeOut };
1711
- }
1712
- catch (error) {
1713
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1714
- return fail(reason);
1715
- }
1716
- }
1717
- export function getProtocolStateWithNative(metadata, protocol) {
1718
- const capability = 'getProtocolStateJson';
1719
- const fail = (reason) => failNativeRequired(capability, reason);
1720
- if (isNativeDisabledByEnv()) {
1721
- return fail('native disabled');
1722
- }
1723
- const fn = readNativeFunction(capability);
1724
- if (!fn) {
1725
- return fail();
1726
- }
1727
- const metadataJson = safeStringify(metadata ?? null);
1728
- if (!metadataJson) {
1729
- return fail('json stringify failed');
1730
- }
1731
- try {
1732
- const raw = fn(metadataJson, String(protocol ?? ''));
1733
- if (typeof raw !== 'string' || !raw) {
1734
- return fail('empty result');
1735
- }
1736
- const parsed = parseJson(raw);
1737
- if (parsed === null) {
1738
- return undefined;
1739
- }
1740
- return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
1741
- ? parsed
1742
- : fail('invalid payload');
1743
- }
1744
- catch (error) {
1745
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1746
- return fail(reason);
1747
- }
1748
- }
1749
- export function readRuntimeMetadataWithNative(carrier) {
1750
- const capability = 'readRuntimeMetadataJson';
1751
- const fail = (reason) => failNativeRequired(capability, reason);
1752
- if (isNativeDisabledByEnv()) {
1753
- return fail('native disabled');
1754
- }
1755
- const fn = readNativeFunction(capability);
1756
- if (!fn) {
1757
- return fail();
1758
- }
1759
- const carrierJson = safeStringify(carrier ?? null);
1760
- if (!carrierJson) {
1761
- return fail('json stringify failed');
1762
- }
1763
- try {
1764
- const raw = fn(carrierJson);
1765
- if (typeof raw !== 'string' || !raw) {
1766
- return fail('empty result');
1767
- }
1768
- const parsed = parseJson(raw);
1769
- if (parsed === null) {
1770
- return undefined;
1771
- }
1772
- return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
1773
- ? parsed
1774
- : fail('invalid payload');
1775
- }
1776
- catch (error) {
1777
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1778
- return fail(reason);
1779
- }
1780
- }
1781
- export function ensureRuntimeMetadataCarrierWithNative(carrier) {
1782
- const capability = 'ensureRuntimeMetadataJson';
1783
- const fail = (reason) => failNativeRequired(capability, reason);
1784
- if (isNativeDisabledByEnv()) {
1785
- return fail('native disabled');
1786
- }
1787
- const fn = readNativeFunction(capability);
1788
- if (!fn) {
1789
- return fail();
1790
- }
1791
- const carrierJson = safeStringify(carrier);
1792
- if (!carrierJson) {
1793
- return fail('json stringify failed');
1794
- }
1795
- try {
1796
- const raw = fn(carrierJson);
1797
- if (typeof raw !== 'string' || !raw) {
1798
- return fail('empty result');
1799
- }
1800
- const parsed = parseRecord(raw);
1801
- return parsed ?? fail('invalid payload');
1802
- }
1803
- catch (error) {
1804
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1805
- return fail(reason);
1806
- }
1807
- }
1808
- export function cloneRuntimeMetadataWithNative(carrier) {
1809
- const capability = 'cloneRuntimeMetadataJson';
1810
- const fail = (reason) => failNativeRequired(capability, reason);
1811
- if (isNativeDisabledByEnv()) {
1812
- return fail('native disabled');
1813
- }
1814
- const fn = readNativeFunction(capability);
1815
- if (!fn) {
1816
- return fail();
1817
- }
1818
- const carrierJson = safeStringify(carrier ?? null);
1819
- if (!carrierJson) {
1820
- return fail('json stringify failed');
1821
- }
1822
- try {
1823
- const raw = fn(carrierJson);
1824
- if (typeof raw !== 'string' || !raw) {
1825
- return fail('empty result');
1826
- }
1827
- const parsed = parseJson(raw);
1828
- if (parsed === null) {
1829
- return undefined;
1830
- }
1831
- return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
1832
- ? parsed
1833
- : fail('invalid payload');
1834
- }
1835
- catch (error) {
1836
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1837
- return fail(reason);
1838
- }
1839
- }
1840
- export function injectMcpToolsForChatWithNative(tools, discoveredServers) {
1841
- const capability = 'injectMcpToolsForChatJson';
1842
- const fail = (reason) => failNativeRequired(capability, reason);
1843
- if (isNativeDisabledByEnv()) {
1844
- return fail('native disabled');
1845
- }
1846
- const fn = readNativeFunction(capability);
1847
- if (!fn) {
1848
- return fail();
1849
- }
1850
- const toolsJson = safeStringify(Array.isArray(tools) ? tools : []);
1851
- const serversJson = safeStringify(Array.isArray(discoveredServers) ? discoveredServers : []);
1852
- if (!toolsJson || !serversJson) {
1853
- return fail('json stringify failed');
1854
- }
1855
- try {
1856
- const raw = fn(toolsJson, serversJson);
1857
- if (typeof raw !== 'string' || !raw) {
1858
- return fail('empty result');
1859
- }
1860
- const parsed = parseJson(raw);
1861
- return Array.isArray(parsed) ? parsed : fail('invalid payload');
1862
- }
1863
- catch (error) {
1864
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1865
- return fail(reason);
1866
- }
1867
- }
1868
- export function normalizeArgsBySchemaWithNative(input, schema) {
1869
- const capability = 'normalizeArgsBySchemaJson';
1870
- const fail = (reason) => failNativeRequired(capability, reason);
1871
- if (isNativeDisabledByEnv()) {
1872
- return fail('native disabled');
1873
- }
1874
- const fn = readNativeFunction(capability);
1875
- if (!fn) {
1876
- return fail();
1877
- }
1878
- const inputJson = safeStringify(input ?? null);
1879
- const schemaJson = safeStringify(schema ?? null);
1880
- if (!inputJson || !schemaJson) {
1881
- return fail('json stringify failed');
1882
- }
1883
- try {
1884
- const raw = fn(inputJson, schemaJson);
1885
- if (typeof raw !== 'string' || !raw) {
1886
- return fail('empty result');
1887
- }
1888
- const parsed = parseRecord(raw);
1889
- if (!parsed || typeof parsed.ok !== 'boolean') {
1890
- return fail('invalid payload');
1891
- }
1892
- const value = parsed.value && typeof parsed.value === 'object' && !Array.isArray(parsed.value)
1893
- ? parsed.value
1894
- : undefined;
1895
- const errors = Array.isArray(parsed.errors)
1896
- ? parsed.errors.filter((entry) => typeof entry === 'string')
1897
- : undefined;
1898
- return {
1899
- ok: parsed.ok,
1900
- ...(value ? { value } : {}),
1901
- ...(errors && errors.length ? { errors } : {})
1902
- };
1903
- }
1904
- catch (error) {
1905
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1906
- return fail(reason);
1907
- }
1908
- }
1909
- export function normalizeToolsWithNative(tools) {
1910
- const capability = 'normalizeToolsJson';
1911
- const fail = (reason) => failNativeRequired(capability, reason);
1912
- if (isNativeDisabledByEnv()) {
1913
- return fail('native disabled');
1914
- }
1915
- const fn = readNativeFunction(capability);
1916
- if (!fn) {
1917
- return fail();
1918
- }
1919
- const toolsJson = safeStringify(tools ?? null);
1920
- if (!toolsJson) {
1921
- return fail('json stringify failed');
1922
- }
1923
- try {
1924
- const raw = fn(toolsJson);
1925
- if (typeof raw !== 'string' || !raw) {
1926
- return fail('empty result');
1927
- }
1928
- const parsed = parseJson(raw);
1929
- return Array.isArray(parsed) ? parsed : fail('invalid payload');
1930
- }
1931
- catch (error) {
1932
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1933
- return fail(reason);
1934
- }
1935
- }
1936
- export function extractOutputSegmentsWithNative(source, itemsKey = 'output') {
1937
- const capability = 'extractOutputSegmentsJson';
1938
- const fail = (reason) => failNativeRequired(capability, reason);
1939
- if (isNativeDisabledByEnv()) {
1940
- return fail('native disabled');
1941
- }
1942
- const fn = readNativeFunction(capability);
1943
- if (!fn) {
1944
- return fail();
1945
- }
1946
- const sourceJson = safeStringify(source ?? null);
1947
- if (!sourceJson) {
1948
- return fail('json stringify failed');
1949
- }
1950
- try {
1951
- const raw = fn(sourceJson, String(itemsKey || 'output'));
1952
- if (typeof raw !== 'string' || !raw) {
1953
- return fail('empty result');
1954
- }
1955
- const parsed = parseRecord(raw);
1956
- if (!parsed) {
1957
- return fail('invalid payload');
1958
- }
1959
- const textParts = Array.isArray(parsed.textParts)
1960
- ? parsed.textParts.filter((entry) => typeof entry === 'string')
1961
- : [];
1962
- const reasoningParts = Array.isArray(parsed.reasoningParts)
1963
- ? parsed.reasoningParts.filter((entry) => typeof entry === 'string')
1964
- : [];
1965
- return { textParts, reasoningParts };
1966
- }
1967
- catch (error) {
1968
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
1969
- return fail(reason);
1970
- }
1971
- }
1972
- export function normalizeContentPartWithNative(part, reasoningCollector) {
1973
- const capability = 'normalizeOutputContentPartJson';
1974
- const fail = (reason) => failNativeRequired(capability, reason);
1975
- if (isNativeDisabledByEnv()) {
1976
- return fail('native disabled');
1977
- }
1978
- const fn = readNativeFunction(capability);
1979
- if (!fn) {
1980
- return fail();
1981
- }
1982
- const partJson = safeStringify(part ?? null);
1983
- const collectorJson = safeStringify(Array.isArray(reasoningCollector) ? reasoningCollector : []);
1984
- if (!partJson || !collectorJson) {
1985
- return fail('json stringify failed');
1986
- }
1987
- try {
1988
- const raw = fn(partJson, collectorJson);
1989
- if (typeof raw !== 'string' || !raw) {
1990
- return fail('empty result');
1991
- }
1992
- const parsed = parseRecord(raw);
1993
- if (!parsed) {
1994
- return fail('invalid payload');
1995
- }
1996
- const normalized = parsed.normalized === null
1997
- ? null
1998
- : parsed.normalized && typeof parsed.normalized === 'object' && !Array.isArray(parsed.normalized)
1999
- ? parsed.normalized
2000
- : fail('invalid payload');
2001
- const nextCollector = Array.isArray(parsed.reasoningCollector)
2002
- ? parsed.reasoningCollector.filter((entry) => typeof entry === 'string')
2003
- : [];
2004
- return { normalized, reasoningCollector: nextCollector };
2005
- }
2006
- catch (error) {
2007
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2008
- return fail(reason);
2009
- }
2010
- }
2011
- export function normalizeMessageContentPartsWithNative(parts, reasoningCollector) {
2012
- const capability = 'normalizeMessageContentPartsJson';
2013
- const fail = (reason) => failNativeRequired(capability, reason);
2014
- if (isNativeDisabledByEnv()) {
2015
- return fail('native disabled');
2016
- }
2017
- const fn = readNativeFunction(capability);
2018
- if (!fn) {
2019
- return fail();
2020
- }
2021
- const partsJson = safeStringify(parts ?? null);
2022
- const collectorJson = safeStringify(Array.isArray(reasoningCollector) ? reasoningCollector : []);
2023
- if (!partsJson || !collectorJson) {
2024
- return fail('json stringify failed');
2025
- }
2026
- try {
2027
- const raw = fn(partsJson, collectorJson);
2028
- if (typeof raw !== 'string' || !raw) {
2029
- return fail('empty result');
2030
- }
2031
- const parsed = parseRecord(raw);
2032
- if (!parsed) {
2033
- return fail('invalid payload');
2034
- }
2035
- const normalizedParts = Array.isArray(parsed.normalizedParts)
2036
- ? parsed.normalizedParts.filter((entry) => !!entry && typeof entry === 'object' && !Array.isArray(entry))
2037
- : [];
2038
- const reasoningChunks = Array.isArray(parsed.reasoningChunks)
2039
- ? parsed.reasoningChunks.filter((entry) => typeof entry === 'string')
2040
- : [];
2041
- return { normalizedParts, reasoningChunks };
2042
- }
2043
- catch (error) {
2044
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2045
- return fail(reason);
2046
- }
2047
- }
2048
- export function normalizeChatMessageContentWithNative(content) {
2049
- const capability = 'normalizeChatMessageContentJson';
2050
- const fail = (reason) => failNativeRequired(capability, reason);
2051
- if (isNativeDisabledByEnv()) {
2052
- return fail('native disabled');
2053
- }
2054
- const fn = readNativeFunction(capability);
2055
- if (!fn) {
2056
- return fail();
2057
- }
2058
- const contentJson = safeStringify(content ?? null);
2059
- if (!contentJson) {
2060
- return fail('json stringify failed');
2061
- }
2062
- try {
2063
- const raw = fn(contentJson);
2064
- if (typeof raw !== 'string' || !raw) {
2065
- return fail('empty result');
2066
- }
2067
- const parsed = parseRecord(raw);
2068
- if (!parsed) {
2069
- return fail('invalid payload');
2070
- }
2071
- const contentText = typeof parsed.contentText === 'string' ? parsed.contentText : undefined;
2072
- const reasoningText = typeof parsed.reasoningText === 'string' ? parsed.reasoningText : undefined;
2073
- return {
2074
- ...(contentText ? { contentText } : {}),
2075
- ...(reasoningText ? { reasoningText } : {})
2076
- };
2077
- }
2078
- catch (error) {
2079
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2080
- return fail(reason);
2081
- }
2082
- }
2083
- export function normalizeOpenaiMessageWithNative(message, disableShellCoerce) {
2084
- const capability = 'normalizeOpenaiMessageJson';
2085
- const fail = (reason) => failNativeRequired(capability, reason);
2086
- if (isNativeDisabledByEnv()) {
2087
- return fail('native disabled');
2088
- }
2089
- const fn = readNativeFunction(capability);
2090
- if (!fn) {
2091
- return fail();
2092
- }
2093
- const payloadJson = safeStringify(message ?? null);
2094
- if (!payloadJson) {
2095
- return fail('json stringify failed');
2096
- }
2097
- try {
2098
- const raw = fn(payloadJson, Boolean(disableShellCoerce));
2099
- if (typeof raw !== 'string' || !raw) {
2100
- return fail('empty result');
2101
- }
2102
- try {
2103
- return JSON.parse(raw);
2104
- }
2105
- catch {
2106
- return fail('invalid payload');
2107
- }
2108
- }
2109
- catch (error) {
2110
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2111
- return fail(reason);
2112
- }
2113
- }
2114
- export function normalizeOpenaiToolWithNative(tool) {
2115
- const capability = 'normalizeOpenaiToolJson';
2116
- const fail = (reason) => failNativeRequired(capability, reason);
2117
- if (isNativeDisabledByEnv()) {
2118
- return fail('native disabled');
2119
- }
2120
- const fn = readNativeFunction(capability);
2121
- if (!fn) {
2122
- return fail();
2123
- }
2124
- const payloadJson = safeStringify(tool ?? null);
2125
- if (!payloadJson) {
2126
- return fail('json stringify failed');
2127
- }
2128
- try {
2129
- const raw = fn(payloadJson);
2130
- if (typeof raw !== 'string' || !raw) {
2131
- return fail('empty result');
2132
- }
2133
- try {
2134
- return JSON.parse(raw);
2135
- }
2136
- catch {
2137
- return fail('invalid payload');
2138
- }
2139
- }
2140
- catch (error) {
2141
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2142
- return fail(reason);
2143
- }
2144
- }
2145
- export function normalizeOpenaiChatMessagesWithNative(messages) {
2146
- const capability = 'normalizeOpenaiChatMessagesJson';
2147
- const fail = (reason) => failNativeRequired(capability, reason);
2148
- if (isNativeDisabledByEnv()) {
2149
- return fail('native disabled');
2150
- }
2151
- const fn = readNativeFunction(capability);
2152
- if (!fn) {
2153
- return fail();
2154
- }
2155
- const payloadJson = safeStringify(messages ?? null);
2156
- if (!payloadJson) {
2157
- return fail('json stringify failed');
2158
- }
2159
- try {
2160
- const raw = fn(payloadJson);
2161
- if (typeof raw !== 'string' || !raw) {
2162
- return fail('empty result');
2163
- }
2164
- const parsed = parseJson(raw);
2165
- return Array.isArray(parsed) ? parsed : fail('invalid payload');
2166
- }
2167
- catch (error) {
2168
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2169
- return fail(reason);
2170
- }
2171
- }
2172
- export function normalizeOpenaiToolCallWithNative(toolCall, disableShellCoerce) {
2173
- const capability = 'normalizeOpenaiToolCallJson';
2174
- const fail = (reason) => failNativeRequired(capability, reason);
2175
- if (isNativeDisabledByEnv()) {
2176
- return fail('native disabled');
2177
- }
2178
- const fn = readNativeFunction(capability);
2179
- if (!fn) {
2180
- return fail();
2181
- }
2182
- const payloadJson = safeStringify(toolCall ?? null);
2183
- if (!payloadJson) {
2184
- return fail('json stringify failed');
2185
- }
2186
- try {
2187
- const raw = fn(payloadJson, Boolean(disableShellCoerce));
2188
- if (typeof raw !== 'string' || !raw) {
2189
- return fail('empty result');
2190
- }
2191
- try {
2192
- return JSON.parse(raw);
2193
- }
2194
- catch {
2195
- return fail('invalid payload');
2196
- }
2197
- }
2198
- catch (error) {
2199
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2200
- return fail(reason);
2201
- }
2202
- }
2203
- export function prepareGeminiToolsForBridgeWithNative(rawTools, missing) {
2204
- const capability = 'prepareGeminiToolsForBridgeJson';
2205
- const fail = (reason) => failNativeRequired(capability, reason);
2206
- if (isNativeDisabledByEnv()) {
2207
- return fail('native disabled');
2208
- }
2209
- const fn = readNativeFunction(capability);
2210
- if (!fn) {
2211
- return fail();
2212
- }
2213
- const rawToolsJson = safeStringify(rawTools ?? null);
2214
- const missingJson = safeStringify(Array.isArray(missing) ? missing : []);
2215
- if (!rawToolsJson || !missingJson) {
2216
- return fail('json stringify failed');
2217
- }
2218
- try {
2219
- const raw = fn(rawToolsJson, missingJson);
2220
- if (typeof raw !== 'string' || !raw) {
2221
- return fail('empty result');
2222
- }
2223
- const parsed = parseRecord(raw);
2224
- if (!parsed) {
2225
- return fail('invalid payload');
2226
- }
2227
- const defs = Array.isArray(parsed.defs)
2228
- ? parsed.defs.filter((entry) => !!entry && typeof entry === 'object' && !Array.isArray(entry))
2229
- : undefined;
2230
- const nextMissing = Array.isArray(parsed.missing)
2231
- ? parsed.missing.filter((entry) => !!entry && typeof entry === 'object' && !Array.isArray(entry))
2232
- : [];
2233
- return {
2234
- ...(defs && defs.length ? { defs } : {}),
2235
- missing: nextMissing
2236
- };
2237
- }
2238
- catch (error) {
2239
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2240
- return fail(reason);
2241
- }
2242
- }
2243
- export function buildGeminiToolsFromBridgeWithNative(defs, mode = 'default') {
2244
- const capability = 'buildGeminiToolsFromBridgeJson';
2245
- const fail = (reason) => failNativeRequired(capability, reason);
2246
- if (isNativeDisabledByEnv()) {
2247
- return fail('native disabled');
2248
- }
2249
- const fn = readNativeFunction(capability);
2250
- if (!fn) {
2251
- return fail();
2252
- }
2253
- const defsJson = safeStringify(defs ?? null);
2254
- if (!defsJson) {
2255
- return fail('json stringify failed');
2256
- }
2257
- try {
2258
- const raw = fn(defsJson, mode);
2259
- if (typeof raw !== 'string' || !raw) {
2260
- return fail('empty result');
2261
- }
2262
- const parsed = parseJson(raw);
2263
- if (parsed == null) {
2264
- return undefined;
2265
- }
2266
- if (!Array.isArray(parsed)) {
2267
- return fail('invalid payload');
2268
- }
2269
- return parsed.filter((entry) => !!entry && typeof entry === 'object' && !Array.isArray(entry));
2270
- }
2271
- catch (error) {
2272
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2273
- return fail(reason);
2274
- }
2275
- }
2276
- export function pickResponsesPersistedFieldsWithNative(payload) {
2277
- const capability = 'pickResponsesPersistedFieldsJson';
2278
- const fail = (reason) => failNativeRequired(capability, reason);
2279
- if (isNativeDisabledByEnv()) {
2280
- return fail('native disabled');
2281
- }
2282
- const fn = readNativeFunction(capability);
2283
- if (!fn) {
2284
- return fail();
2285
- }
2286
- const payloadJson = safeStringify(payload ?? null);
2287
- if (!payloadJson) {
2288
- return fail('json stringify failed');
2289
- }
2290
- try {
2291
- const raw = fn(payloadJson);
2292
- if (typeof raw !== 'string' || !raw) {
2293
- return fail('empty result');
2294
- }
2295
- const parsed = parseRecord(raw);
2296
- return parsed ?? fail('invalid payload');
2297
- }
2298
- catch (error) {
2299
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2300
- return fail(reason);
2301
- }
2302
- }
2303
- export function convertResponsesOutputToInputItemsWithNative(response) {
2304
- const capability = 'convertResponsesOutputToInputItemsJson';
2305
- const fail = (reason) => failNativeRequired(capability, reason);
2306
- if (isNativeDisabledByEnv()) {
2307
- return fail('native disabled');
2308
- }
2309
- const fn = readNativeFunction(capability);
2310
- if (!fn) {
2311
- return fail();
2312
- }
2313
- const responseJson = safeStringify(response ?? null);
2314
- if (!responseJson) {
2315
- return fail('json stringify failed');
2316
- }
2317
- try {
2318
- const raw = fn(responseJson);
2319
- if (typeof raw !== 'string' || !raw) {
2320
- return fail('empty result');
2321
- }
2322
- const parsed = parseJson(raw);
2323
- if (!Array.isArray(parsed)) {
2324
- return fail('invalid payload');
2325
- }
2326
- return parsed.filter((entry) => !!entry && typeof entry === 'object' && !Array.isArray(entry));
2327
- }
2328
- catch (error) {
2329
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2330
- return fail(reason);
2331
- }
2332
- }
2333
- export function prepareResponsesConversationEntryWithNative(payload, context) {
2334
- const capability = 'prepareResponsesConversationEntryJson';
2335
- const fail = (reason) => failNativeRequired(capability, reason);
2336
- if (isNativeDisabledByEnv()) {
2337
- return fail('native disabled');
2338
- }
2339
- const fn = readNativeFunction(capability);
2340
- if (!fn) {
2341
- return fail();
2342
- }
2343
- const payloadJson = safeStringify(payload ?? null);
2344
- const contextJson = safeStringify(context ?? null);
2345
- if (!payloadJson || !contextJson) {
2346
- return fail('json stringify failed');
2347
- }
2348
- try {
2349
- const raw = fn(payloadJson, contextJson);
2350
- if (typeof raw !== 'string' || !raw) {
2351
- return fail('empty result');
2352
- }
2353
- const parsed = parseRecord(raw);
2354
- if (!parsed) {
2355
- return fail('invalid payload');
2356
- }
2357
- const basePayload = parsed.basePayload;
2358
- const input = parsed.input;
2359
- const tools = parsed.tools;
2360
- if (!basePayload || typeof basePayload !== 'object' || Array.isArray(basePayload) || !Array.isArray(input)) {
2361
- return fail('invalid payload');
2362
- }
2363
- return {
2364
- basePayload: basePayload,
2365
- input: input.filter((entry) => !!entry && typeof entry === 'object' && !Array.isArray(entry)),
2366
- tools: Array.isArray(tools)
2367
- ? tools.filter((entry) => !!entry && typeof entry === 'object' && !Array.isArray(entry))
2368
- : undefined
2369
- };
2370
- }
2371
- catch (error) {
2372
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2373
- return fail(reason);
2374
- }
2375
- }
2376
- export function resumeResponsesConversationPayloadWithNative(entry, responseId, submitPayload, requestId) {
2377
- const capability = 'resumeResponsesConversationPayloadJson';
2378
- const fail = (reason) => failNativeRequired(capability, reason);
2379
- if (isNativeDisabledByEnv()) {
2380
- return fail('native disabled');
2381
- }
2382
- const fn = readNativeFunction(capability);
2383
- if (!fn) {
2384
- return fail();
2385
- }
2386
- const entryJson = safeStringify(entry ?? null);
2387
- const submitPayloadJson = safeStringify(submitPayload ?? null);
2388
- if (!entryJson || !submitPayloadJson) {
2389
- return fail('json stringify failed');
2390
- }
2391
- try {
2392
- const raw = fn(entryJson, String(responseId ?? ''), submitPayloadJson, requestId);
2393
- if (typeof raw !== 'string' || !raw) {
2394
- return fail('empty result');
2395
- }
2396
- const parsed = parseResponsesConversationResumeResult(raw);
2397
- return parsed ?? fail('invalid payload');
2398
- }
2399
- catch (error) {
2400
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2401
- return fail(reason);
2402
- }
2403
- }
2404
- export function enforceChatBudgetWithNative(chat, allowedBytes, systemTextLimit) {
2405
- const capability = 'enforceChatBudgetJson';
2406
- const fail = (reason) => failNativeRequired(capability, reason);
2407
- if (isNativeDisabledByEnv()) {
2408
- return fail('native disabled');
2409
- }
2410
- const fn = readNativeFunction(capability);
2411
- if (!fn) {
2412
- return fail();
2413
- }
2414
- const chatJson = safeStringify(chat ?? null);
2415
- if (!chatJson) {
2416
- return fail('json stringify failed');
2417
- }
2418
- try {
2419
- const raw = fn(chatJson, Number(allowedBytes), Number(systemTextLimit));
2420
- if (typeof raw !== 'string' || !raw) {
2421
- return fail('empty result');
2422
- }
2423
- const parsed = parseJson(raw);
2424
- return parsed ?? fail('invalid payload');
2425
- }
2426
- catch (error) {
2427
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2428
- return fail(reason);
2429
- }
2430
- }
2431
- export function resolveBudgetForModelWithNative(modelId, fallback) {
2432
- const capability = 'resolveBudgetForModelJson';
2433
- const fail = (reason) => failNativeRequired(capability, reason);
2434
- if (isNativeDisabledByEnv()) {
2435
- return fail('native disabled');
2436
- }
2437
- const fn = readNativeFunction(capability);
2438
- if (!fn) {
2439
- return fail();
2440
- }
2441
- const fallbackJson = safeStringify(fallback ?? null);
2442
- if (!fallbackJson) {
2443
- return fail('json stringify failed');
2444
- }
2445
- try {
2446
- const raw = fn(String(modelId ?? ''), fallbackJson);
2447
- if (typeof raw !== 'string' || !raw) {
2448
- return fail('empty result');
2449
- }
2450
- const parsed = parseRecord(raw);
2451
- if (!parsed) {
2452
- return fail('invalid payload');
2453
- }
2454
- const maxBytes = Number(parsed.maxBytes);
2455
- const safetyRatio = Number(parsed.safetyRatio);
2456
- const allowedBytes = Number(parsed.allowedBytes);
2457
- const source = typeof parsed.source === 'string' ? parsed.source : 'unknown';
2458
- if (!Number.isFinite(maxBytes) || !Number.isFinite(safetyRatio) || !Number.isFinite(allowedBytes)) {
2459
- return fail('invalid payload');
2460
- }
2461
- return { maxBytes, safetyRatio, allowedBytes, source };
2462
- }
2463
- catch (error) {
2464
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2465
- return fail(reason);
2466
- }
2467
- }
2468
- export function injectMcpToolsForResponsesWithNative(tools, discoveredServers) {
2469
- const capability = 'injectMcpToolsForResponsesJson';
2470
- const fail = (reason) => failNativeRequired(capability, reason);
2471
- if (isNativeDisabledByEnv()) {
2472
- return fail('native disabled');
2473
- }
2474
- const fn = readNativeFunction(capability);
2475
- if (!fn) {
2476
- return fail();
2477
- }
2478
- const toolsJson = safeStringify(Array.isArray(tools) ? tools : []);
2479
- const serversJson = safeStringify(Array.isArray(discoveredServers) ? discoveredServers : []);
2480
- if (!toolsJson || !serversJson) {
2481
- return fail('json stringify failed');
2482
- }
2483
- try {
2484
- const raw = fn(toolsJson, serversJson);
2485
- if (typeof raw !== 'string' || !raw) {
2486
- return fail('empty result');
2487
- }
2488
- const parsed = parseJson(raw);
2489
- return Array.isArray(parsed) ? parsed : fail('invalid payload');
2490
- }
2491
- catch (error) {
2492
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2493
- return fail(reason);
2494
- }
2495
- }
2496
- export function normalizeFunctionCallIdWithNative(input) {
2497
- const capability = 'normalizeFunctionCallIdJson';
2498
- const fail = (reason) => failNativeRequired(capability, reason);
2499
- if (isNativeDisabledByEnv()) {
2500
- return fail('native disabled');
2501
- }
2502
- const fn = readNativeFunction(capability);
2503
- if (!fn) {
2504
- return fail();
2505
- }
2506
- const inputJson = safeStringify(input ?? {});
2507
- if (!inputJson) {
2508
- return fail('json stringify failed');
2509
- }
2510
- try {
2511
- const raw = fn(inputJson);
2512
- return typeof raw === 'string' && raw ? raw : fail('invalid payload');
2513
- }
2514
- catch (error) {
2515
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2516
- return fail(reason);
2517
- }
2518
- }
2519
- export function normalizeFunctionCallOutputIdWithNative(input) {
2520
- const capability = 'normalizeFunctionCallOutputIdJson';
2521
- const fail = (reason) => failNativeRequired(capability, reason);
2522
- if (isNativeDisabledByEnv()) {
2523
- return fail('native disabled');
2524
- }
2525
- const fn = readNativeFunction(capability);
2526
- if (!fn) {
2527
- return fail();
2528
- }
2529
- const inputJson = safeStringify(input ?? {});
2530
- if (!inputJson) {
2531
- return fail('json stringify failed');
2532
- }
2533
- try {
2534
- const raw = fn(inputJson);
2535
- return typeof raw === 'string' && raw ? raw : fail('invalid payload');
2536
- }
2537
- catch (error) {
2538
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2539
- return fail(reason);
2540
- }
2541
- }
2542
- export function normalizeResponsesCallIdWithNative(input) {
2543
- const capability = 'normalizeResponsesCallIdJson';
2544
- const fail = (reason) => failNativeRequired(capability, reason);
2545
- if (isNativeDisabledByEnv()) {
2546
- return fail('native disabled');
2547
- }
2548
- const fn = readNativeFunction(capability);
2549
- if (!fn) {
2550
- return fail();
2551
- }
2552
- const inputJson = safeStringify(input ?? {});
2553
- if (!inputJson) {
2554
- return fail('json stringify failed');
2555
- }
2556
- try {
2557
- const raw = fn(inputJson);
2558
- return typeof raw === 'string' && raw ? raw : fail('invalid payload');
2559
- }
2560
- catch (error) {
2561
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2562
- return fail(reason);
2563
- }
2564
- }
2565
- export function clampResponsesInputItemIdWithNative(rawValue) {
2566
- const capability = 'clampResponsesInputItemIdJson';
2567
- const fail = (reason) => failNativeRequired(capability, reason);
2568
- if (isNativeDisabledByEnv()) {
2569
- return fail('native disabled');
2570
- }
2571
- const fn = readNativeFunction(capability);
2572
- if (!fn) {
2573
- return fail();
2574
- }
2575
- const rawJson = safeStringify(rawValue ?? null);
2576
- if (!rawJson) {
2577
- return fail('json stringify failed');
2578
- }
2579
- try {
2580
- const raw = fn(rawJson);
2581
- if (typeof raw !== 'string' || !raw) {
2582
- return fail('empty result');
2583
- }
2584
- const parsed = parseJson(raw);
2585
- if (parsed === null) {
2586
- return undefined;
2587
- }
2588
- return typeof parsed === 'string' ? parsed : fail('invalid payload');
2589
- }
2590
- catch (error) {
2591
- const reason = error instanceof Error ? error.message : String(error ?? 'unknown');
2592
- return fail(reason);
2593
- }
2594
- }