@jsonstudio/rcc 0.90.352 → 0.90.367

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 (1071) hide show
  1. package/dist/build-info.js +2 -2
  2. package/dist/cli/commands/codex.js +37 -7
  3. package/dist/cli/commands/codex.js.map +1 -1
  4. package/dist/cli/commands/launcher/types.d.ts +1 -0
  5. package/dist/cli/commands/launcher-kernel.js +69 -90
  6. package/dist/cli/commands/launcher-kernel.js.map +1 -1
  7. package/dist/modules/llmswitch/bridge/module-loader.js +2 -2
  8. package/dist/modules/llmswitch/bridge/module-loader.js.map +1 -1
  9. package/dist/modules/llmswitch/bridge/quota-manager.js +1 -1
  10. package/dist/modules/llmswitch/bridge/quota-manager.js.map +1 -1
  11. package/dist/modules/llmswitch/bridge/runtime-integrations.d.ts +1 -1
  12. package/dist/modules/llmswitch/bridge/runtime-integrations.js.map +1 -1
  13. package/dist/modules/llmswitch/bridge.d.ts +5 -5
  14. package/dist/modules/llmswitch/bridge.js.map +1 -1
  15. package/dist/modules/llmswitch/core-loader.js +35 -24
  16. package/dist/modules/llmswitch/core-loader.js.map +1 -1
  17. package/dist/server/runtime/http-server/executor/provider-response-converter.js +133 -2
  18. package/dist/server/runtime/http-server/executor/provider-response-converter.js.map +1 -1
  19. package/dist/server/runtime/http-server/executor-response.js +62 -1
  20. package/dist/server/runtime/http-server/executor-response.js.map +1 -1
  21. package/dist/server/runtime/http-server/session-client-route-utils.js +38 -5
  22. package/dist/server/runtime/http-server/session-client-route-utils.js.map +1 -1
  23. package/package.json +7 -8
  24. package/scripts/analyze-thinking-keywords.mjs +1 -1
  25. package/scripts/ensure-llmswitch-mode.mjs +5 -63
  26. package/scripts/install-global.sh +0 -46
  27. package/scripts/install-release.sh +4 -38
  28. package/scripts/install-verify.mjs +6 -25
  29. package/scripts/pack-mode.mjs +16 -39
  30. package/scripts/pack-rcc.mjs +4 -63
  31. package/scripts/publish-rcc.mjs +4 -59
  32. package/scripts/snapshot-inspect.mjs +24 -5
  33. package/scripts/tests/blackbox-rcc-vs-routecodex-antigravity.mjs +2 -2
  34. package/scripts/vendor-core.mjs +30 -9
  35. package/vendor/llmswitch-core/README.md +271 -0
  36. package/vendor/llmswitch-core/dist/bridge/routecodex-adapter.d.ts +74 -0
  37. package/vendor/llmswitch-core/dist/bridge/routecodex-adapter.js +229 -0
  38. package/vendor/llmswitch-core/dist/config-unified/enhanced-path-resolver.d.ts +5 -0
  39. package/vendor/llmswitch-core/dist/config-unified/enhanced-path-resolver.js +46 -0
  40. package/vendor/llmswitch-core/dist/config-unified/unified-config.d.ts +26 -0
  41. package/vendor/llmswitch-core/dist/config-unified/unified-config.js +231 -0
  42. package/vendor/llmswitch-core/dist/conversion/args-mapping.d.ts +18 -0
  43. package/vendor/llmswitch-core/dist/conversion/args-mapping.js +8 -0
  44. package/vendor/llmswitch-core/dist/conversion/bridge-actions.d.ts +39 -0
  45. package/vendor/llmswitch-core/dist/conversion/bridge-actions.js +82 -0
  46. package/vendor/llmswitch-core/dist/conversion/bridge-id-utils.d.ts +9 -0
  47. package/vendor/llmswitch-core/dist/conversion/bridge-id-utils.js +13 -0
  48. package/vendor/llmswitch-core/dist/conversion/bridge-instructions.d.ts +1 -0
  49. package/vendor/llmswitch-core/dist/conversion/bridge-instructions.js +17 -0
  50. package/vendor/llmswitch-core/dist/conversion/bridge-message-utils.d.ts +23 -0
  51. package/vendor/llmswitch-core/dist/conversion/bridge-message-utils.js +45 -0
  52. package/vendor/llmswitch-core/dist/conversion/bridge-metadata.d.ts +2 -0
  53. package/vendor/llmswitch-core/dist/conversion/bridge-metadata.js +5 -0
  54. package/vendor/llmswitch-core/dist/conversion/bridge-policies.d.ts +18 -0
  55. package/vendor/llmswitch-core/dist/conversion/bridge-policies.js +11 -0
  56. package/vendor/llmswitch-core/dist/conversion/codec-registry.d.ts +10 -0
  57. package/vendor/llmswitch-core/dist/conversion/codec-registry.js +37 -0
  58. package/vendor/llmswitch-core/dist/conversion/codecs/anthropic-openai-codec.d.ts +22 -0
  59. package/vendor/llmswitch-core/dist/conversion/codecs/anthropic-openai-codec.js +52 -0
  60. package/vendor/llmswitch-core/dist/conversion/codecs/gemini-openai-codec.d.ts +17 -0
  61. package/vendor/llmswitch-core/dist/conversion/codecs/gemini-openai-codec.js +85 -0
  62. package/vendor/llmswitch-core/dist/conversion/codecs/openai-openai-codec.d.ts +12 -0
  63. package/vendor/llmswitch-core/dist/conversion/codecs/openai-openai-codec.js +54 -0
  64. package/vendor/llmswitch-core/dist/conversion/codecs/responses-openai-codec.d.ts +12 -0
  65. package/vendor/llmswitch-core/dist/conversion/codecs/responses-openai-codec.js +66 -0
  66. package/vendor/llmswitch-core/dist/conversion/compaction-detect.d.ts +2 -0
  67. package/vendor/llmswitch-core/dist/conversion/compaction-detect.js +4 -0
  68. package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-system-prompt.d.ts +4 -0
  69. package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-system-prompt.js +42 -0
  70. package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-user-id.d.ts +3 -0
  71. package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-user-id.js +30 -0
  72. package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-cache.d.ts +3 -0
  73. package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-cache.js +8 -0
  74. package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-prepare.d.ts +3 -0
  75. package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-prepare.js +26 -0
  76. package/vendor/llmswitch-core/dist/conversion/compat/actions/apply-patch-fixer.d.ts +1 -0
  77. package/vendor/llmswitch-core/dist/conversion/compat/actions/apply-patch-fixer.js +30 -0
  78. package/vendor/llmswitch-core/dist/conversion/compat/actions/auto-thinking.d.ts +6 -0
  79. package/vendor/llmswitch-core/dist/conversion/compat/actions/auto-thinking.js +26 -0
  80. package/vendor/llmswitch-core/dist/conversion/compat/actions/claude-thinking-tools.d.ts +2 -0
  81. package/vendor/llmswitch-core/dist/conversion/compat/actions/claude-thinking-tools.js +4 -0
  82. package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-request.d.ts +3 -0
  83. package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-request.js +62 -0
  84. package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-response.d.ts +12 -0
  85. package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-response.js +114 -0
  86. package/vendor/llmswitch-core/dist/conversion/compat/actions/field-mapping.d.ts +14 -0
  87. package/vendor/llmswitch-core/dist/conversion/compat/actions/field-mapping.js +155 -0
  88. package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-cli-request.d.ts +5 -0
  89. package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-cli-request.js +27 -0
  90. package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-web-search.d.ts +3 -0
  91. package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-web-search.js +24 -0
  92. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-history-image-trim.d.ts +2 -0
  93. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-history-image-trim.js +54 -0
  94. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-image-content.d.ts +2 -0
  95. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-image-content.js +54 -0
  96. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-native-compat.d.ts +6 -0
  97. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-native-compat.js +34 -0
  98. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-tool-extraction.d.ts +3 -0
  99. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-tool-extraction.js +35 -0
  100. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-vision-prompt.d.ts +11 -0
  101. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-vision-prompt.js +104 -0
  102. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-web-search.d.ts +2 -0
  103. package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-web-search.js +30 -0
  104. package/vendor/llmswitch-core/dist/conversion/compat/actions/harvest-tool-calls-from-text.d.ts +15 -0
  105. package/vendor/llmswitch-core/dist/conversion/compat/actions/harvest-tool-calls-from-text.js +124 -0
  106. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-cli-defaults.d.ts +10 -0
  107. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-cli-defaults.js +31 -0
  108. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.d.ts +7 -0
  109. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.js +25 -0
  110. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.d.ts +12 -0
  111. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.js +46 -0
  112. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-native-compat.d.ts +6 -0
  113. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-native-compat.js +36 -0
  114. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-response-body-unwrap.d.ts +9 -0
  115. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-response-body-unwrap.js +25 -0
  116. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-tool-text-fallback.d.ts +5 -0
  117. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-tool-text-fallback.js +29 -0
  118. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-web-search.d.ts +18 -0
  119. package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-web-search.js +49 -0
  120. package/vendor/llmswitch-core/dist/conversion/compat/actions/index.d.ts +2 -0
  121. package/vendor/llmswitch-core/dist/conversion/compat/actions/index.js +2 -0
  122. package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-fc-ids.d.ts +2 -0
  123. package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-fc-ids.js +4 -0
  124. package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-input-stringify.d.ts +14 -0
  125. package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-input-stringify.js +125 -0
  126. package/vendor/llmswitch-core/dist/conversion/compat/actions/normalize-tool-call-ids.d.ts +2 -0
  127. package/vendor/llmswitch-core/dist/conversion/compat/actions/normalize-tool-call-ids.js +10 -0
  128. package/vendor/llmswitch-core/dist/conversion/compat/actions/qwen-transform.d.ts +4 -0
  129. package/vendor/llmswitch-core/dist/conversion/compat/actions/qwen-transform.js +40 -0
  130. package/vendor/llmswitch-core/dist/conversion/compat/actions/request-rules.d.ts +24 -0
  131. package/vendor/llmswitch-core/dist/conversion/compat/actions/request-rules.js +4 -0
  132. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-blacklist.d.ts +10 -0
  133. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-blacklist.js +10 -0
  134. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-normalize.d.ts +5 -0
  135. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-normalize.js +4 -0
  136. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-validate.d.ts +5 -0
  137. package/vendor/llmswitch-core/dist/conversion/compat/actions/response-validate.js +4 -0
  138. package/vendor/llmswitch-core/dist/conversion/compat/actions/snapshot.d.ts +8 -0
  139. package/vendor/llmswitch-core/dist/conversion/compat/actions/snapshot.js +21 -0
  140. package/vendor/llmswitch-core/dist/conversion/compat/actions/strip-orphan-function-calls-tag.d.ts +2 -0
  141. package/vendor/llmswitch-core/dist/conversion/compat/actions/strip-orphan-function-calls-tag.js +4 -0
  142. package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-schema.d.ts +6 -0
  143. package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-schema.js +91 -0
  144. package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-text-request-guidance.d.ts +9 -0
  145. package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-text-request-guidance.js +7 -0
  146. package/vendor/llmswitch-core/dist/conversion/compat/actions/universal-shape-filter.d.ts +57 -0
  147. package/vendor/llmswitch-core/dist/conversion/compat/actions/universal-shape-filter.js +14 -0
  148. package/vendor/llmswitch-core/dist/conversion/compat/antigravity-session-signature.d.ts +86 -0
  149. package/vendor/llmswitch-core/dist/conversion/compat/antigravity-session-signature.js +1143 -0
  150. package/vendor/llmswitch-core/dist/conversion/compat/profiles/anthropic-claude-code.json +17 -0
  151. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-claude-code.json +18 -0
  152. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-deepseek-web.json +47 -0
  153. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-gemini-cli.json +23 -0
  154. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-gemini.json +31 -0
  155. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-glm.json +405 -0
  156. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-iflow.json +353 -0
  157. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-lmstudio.json +80 -0
  158. package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-qwen.json +22 -0
  159. package/vendor/llmswitch-core/dist/conversion/compat/profiles/responses-c4m.json +45 -0
  160. package/vendor/llmswitch-core/dist/conversion/compat/profiles/responses-crs.json +15 -0
  161. package/vendor/llmswitch-core/dist/conversion/compat/profiles/responses-output2choices-test.json +12 -0
  162. package/vendor/llmswitch-core/dist/conversion/config/config-manager.d.ts +212 -0
  163. package/vendor/llmswitch-core/dist/conversion/config/config-manager.js +310 -0
  164. package/vendor/llmswitch-core/dist/conversion/config/sample-config.json +314 -0
  165. package/vendor/llmswitch-core/dist/conversion/config/version-switch.json +150 -0
  166. package/vendor/llmswitch-core/dist/conversion/hub/config/types.d.ts +26 -0
  167. package/vendor/llmswitch-core/dist/conversion/hub/config/types.js +1 -0
  168. package/vendor/llmswitch-core/dist/conversion/hub/core/detour-registry.d.ts +11 -0
  169. package/vendor/llmswitch-core/dist/conversion/hub/core/detour-registry.js +23 -0
  170. package/vendor/llmswitch-core/dist/conversion/hub/core/hub-context.d.ts +23 -0
  171. package/vendor/llmswitch-core/dist/conversion/hub/core/hub-context.js +1 -0
  172. package/vendor/llmswitch-core/dist/conversion/hub/core/index.d.ts +4 -0
  173. package/vendor/llmswitch-core/dist/conversion/hub/core/index.js +3 -0
  174. package/vendor/llmswitch-core/dist/conversion/hub/core/stage-driver.d.ts +30 -0
  175. package/vendor/llmswitch-core/dist/conversion/hub/core/stage-driver.js +33 -0
  176. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/anthropic-format-adapter.d.ts +16 -0
  177. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/anthropic-format-adapter.js +42 -0
  178. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/chat-format-adapter.d.ts +17 -0
  179. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/chat-format-adapter.js +42 -0
  180. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/gemini-format-adapter.d.ts +16 -0
  181. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/gemini-format-adapter.js +42 -0
  182. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/index.d.ts +21 -0
  183. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/index.js +4 -0
  184. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/responses-format-adapter.d.ts +19 -0
  185. package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/responses-format-adapter.js +42 -0
  186. package/vendor/llmswitch-core/dist/conversion/hub/hub-feature.d.ts +1 -0
  187. package/vendor/llmswitch-core/dist/conversion/hub/hub-feature.js +26 -0
  188. package/vendor/llmswitch-core/dist/conversion/hub/node-support.d.ts +19 -0
  189. package/vendor/llmswitch-core/dist/conversion/hub/node-support.js +136 -0
  190. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/operation-table-runner.d.ts +18 -0
  191. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/operation-table-runner.js +162 -0
  192. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper.d.ts +8 -0
  193. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper.js +503 -0
  194. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/archive/chat-mapper.archive.d.ts +8 -0
  195. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/archive/chat-mapper.archive.js +409 -0
  196. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/chat-mapper.d.ts +8 -0
  197. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/chat-mapper.js +350 -0
  198. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper.d.ts +7 -0
  199. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper.js +1540 -0
  200. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.d.ts +21 -0
  201. package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.js +491 -0
  202. package/vendor/llmswitch-core/dist/conversion/hub/ops/operations.d.ts +19 -0
  203. package/vendor/llmswitch-core/dist/conversion/hub/ops/operations.js +7 -0
  204. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-engine.d.ts +9 -0
  205. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-engine.js +13 -0
  206. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-pipeline-executor.d.ts +9 -0
  207. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-pipeline-executor.js +46 -0
  208. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-resolver.d.ts +2 -0
  209. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-resolver.js +14 -0
  210. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-store.d.ts +2 -0
  211. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-store.js +94 -0
  212. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-types.d.ts +175 -0
  213. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-types.js +1 -0
  214. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/native-adapter-context.d.ts +3 -0
  215. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/native-adapter-context.js +40 -0
  216. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-pipeline.d.ts +111 -0
  217. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-pipeline.js +1927 -0
  218. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-stage-timing.d.ts +8 -0
  219. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-stage-timing.js +211 -0
  220. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/session-identifiers.d.ts +9 -0
  221. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/session-identifiers.js +16 -0
  222. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage1_format_parse/index.d.ts +10 -0
  223. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage1_format_parse/index.js +236 -0
  224. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.d.ts +24 -0
  225. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.js +132 -0
  226. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/semantic-lift.d.ts +14 -0
  227. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/semantic-lift.js +24 -0
  228. 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 +2 -0
  229. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/archive/shell-like-tool-call-normalization-fallback.js +157 -0
  230. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-capture-orchestration.d.ts +16 -0
  231. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-capture-orchestration.js +29 -0
  232. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-factories.d.ts +5 -0
  233. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-factories.js +19 -0
  234. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/index.d.ts +6 -0
  235. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/index.js +22 -0
  236. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.d.ts +8 -0
  237. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.js +28 -0
  238. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-diagnostics.d.ts +2 -0
  239. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-diagnostics.js +4 -0
  240. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-snapshot.d.ts +10 -0
  241. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-snapshot.js +12 -0
  242. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/context-merge.d.ts +3 -0
  243. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/context-merge.js +30 -0
  244. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/index.d.ts +18 -0
  245. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/index.js +84 -0
  246. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage2_format_build/index.d.ts +8 -0
  247. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage2_format_build/index.js +12 -0
  248. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.d.ts +14 -0
  249. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.js +45 -0
  250. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage1_tool_governance/index.d.ts +16 -0
  251. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage1_tool_governance/index.js +62 -0
  252. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage2_route_select/index.d.ts +17 -0
  253. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage2_route_select/index.js +35 -0
  254. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/index.d.ts +17 -0
  255. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/index.js +243 -0
  256. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/stream-json-sniffer.d.ts +3 -0
  257. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/stream-json-sniffer.js +81 -0
  258. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage2_format_parse/index.d.ts +10 -0
  259. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage2_format_parse/index.js +50 -0
  260. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage3_semantic_map/index.d.ts +13 -0
  261. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage3_semantic_map/index.js +25 -0
  262. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/chat-process-semantics-bridge.d.ts +6 -0
  263. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/chat-process-semantics-bridge.js +17 -0
  264. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.d.ts +9 -0
  265. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.js +103 -0
  266. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.d.ts +13 -0
  267. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.js +30 -0
  268. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage2_sse_stream/index.d.ts +17 -0
  269. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage2_sse_stream/index.js +35 -0
  270. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.d.ts +16 -0
  271. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.js +52 -0
  272. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage2_finalize/index.d.ts +19 -0
  273. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage2_finalize/index.js +40 -0
  274. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.d.ts +44 -0
  275. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.js +88 -0
  276. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/utils.d.ts +2 -0
  277. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/utils.js +27 -0
  278. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/target-utils.d.ts +5 -0
  279. package/vendor/llmswitch-core/dist/conversion/hub/pipeline/target-utils.js +26 -0
  280. package/vendor/llmswitch-core/dist/conversion/hub/pipelines/inbound.d.ts +22 -0
  281. package/vendor/llmswitch-core/dist/conversion/hub/pipelines/inbound.js +66 -0
  282. package/vendor/llmswitch-core/dist/conversion/hub/pipelines/outbound.d.ts +22 -0
  283. package/vendor/llmswitch-core/dist/conversion/hub/pipelines/outbound.js +59 -0
  284. package/vendor/llmswitch-core/dist/conversion/hub/policy/policy-engine.d.ts +48 -0
  285. package/vendor/llmswitch-core/dist/conversion/hub/policy/policy-engine.js +269 -0
  286. package/vendor/llmswitch-core/dist/conversion/hub/policy/protocol-spec.d.ts +75 -0
  287. package/vendor/llmswitch-core/dist/conversion/hub/policy/protocol-spec.js +27 -0
  288. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-anthropic-alias.d.ts +2 -0
  289. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-anthropic-alias.js +36 -0
  290. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directive-parser.d.ts +5 -0
  291. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directive-parser.js +56 -0
  292. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directives.d.ts +24 -0
  293. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directives.js +98 -0
  294. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-directives.d.ts +8 -0
  295. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-directives.js +42 -0
  296. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-finalize.d.ts +14 -0
  297. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-finalize.js +10 -0
  298. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-messages.d.ts +5 -0
  299. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-messages.js +10 -0
  300. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-orchestration.d.ts +30 -0
  301. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-orchestration.js +68 -0
  302. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-time-tag.d.ts +9 -0
  303. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-time-tag.js +18 -0
  304. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminders.d.ts +2 -0
  305. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminders.js +104 -0
  306. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tool-schemas.d.ts +3 -0
  307. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tool-schemas.js +280 -0
  308. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tools.d.ts +6 -0
  309. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tools.js +41 -0
  310. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-continue-execution.d.ts +11 -0
  311. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-continue-execution.js +83 -0
  312. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-context.d.ts +15 -0
  313. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-context.js +7 -0
  314. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-finalize.d.ts +16 -0
  315. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-finalize.js +11 -0
  316. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-orchestration.d.ts +9 -0
  317. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-orchestration.js +49 -0
  318. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-control-ops.d.ts +8 -0
  319. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-control-ops.js +5 -0
  320. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-filter-call.d.ts +12 -0
  321. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-filter-call.js +18 -0
  322. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-merge.d.ts +8 -0
  323. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-merge.js +11 -0
  324. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-media.d.ts +5 -0
  325. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-media.js +108 -0
  326. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-node-result.d.ts +23 -0
  327. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-node-result.js +24 -0
  328. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-pending-tool-sync.d.ts +14 -0
  329. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-pending-tool-sync.js +52 -0
  330. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-post-governed-normalization.d.ts +8 -0
  331. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-post-governed-normalization.js +16 -0
  332. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-review.d.ts +2 -0
  333. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-review.js +8 -0
  334. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-servertool-orchestration.d.ts +8 -0
  335. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-servertool-orchestration.js +22 -0
  336. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-session-usage.d.ts +7 -0
  337. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-session-usage.js +147 -0
  338. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-tool-normalization.d.ts +2 -0
  339. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-tool-normalization.js +4 -0
  340. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-intent.d.ts +12 -0
  341. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-intent.js +13 -0
  342. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-tool-schema.d.ts +3 -0
  343. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-tool-schema.js +4 -0
  344. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search.d.ts +8 -0
  345. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search.js +26 -0
  346. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process.d.ts +15 -0
  347. package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process.js +27 -0
  348. package/vendor/llmswitch-core/dist/conversion/hub/process/client-inject-readiness.d.ts +1 -0
  349. package/vendor/llmswitch-core/dist/conversion/hub/process/client-inject-readiness.js +4 -0
  350. package/vendor/llmswitch-core/dist/conversion/hub/registry.d.ts +28 -0
  351. package/vendor/llmswitch-core/dist/conversion/hub/registry.js +101 -0
  352. package/vendor/llmswitch-core/dist/conversion/hub/response/chat-response-utils.d.ts +6 -0
  353. package/vendor/llmswitch-core/dist/conversion/hub/response/chat-response-utils.js +8 -0
  354. package/vendor/llmswitch-core/dist/conversion/hub/response/provider-response.d.ts +51 -0
  355. package/vendor/llmswitch-core/dist/conversion/hub/response/provider-response.js +529 -0
  356. package/vendor/llmswitch-core/dist/conversion/hub/response/response-mappers.d.ts +24 -0
  357. package/vendor/llmswitch-core/dist/conversion/hub/response/response-mappers.js +73 -0
  358. package/vendor/llmswitch-core/dist/conversion/hub/response/response-runtime.d.ts +9 -0
  359. package/vendor/llmswitch-core/dist/conversion/hub/response/response-runtime.js +758 -0
  360. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/anthropic-mapper.d.ts +2 -0
  361. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/anthropic-mapper.js +2 -0
  362. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/chat-mapper.d.ts +2 -0
  363. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/chat-mapper.js +2 -0
  364. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/gemini-mapper.d.ts +2 -0
  365. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/gemini-mapper.js +2 -0
  366. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/index.d.ts +4 -0
  367. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/index.js +4 -0
  368. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/responses-mapper.d.ts +2 -0
  369. package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/responses-mapper.js +2 -0
  370. package/vendor/llmswitch-core/dist/conversion/hub/snapshot-recorder.d.ts +13 -0
  371. package/vendor/llmswitch-core/dist/conversion/hub/snapshot-recorder.js +38 -0
  372. package/vendor/llmswitch-core/dist/conversion/hub/standardized-bridge.d.ts +12 -0
  373. package/vendor/llmswitch-core/dist/conversion/hub/standardized-bridge.js +16 -0
  374. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/engine.d.ts +24 -0
  375. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/engine.js +118 -0
  376. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/index.d.ts +3 -0
  377. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/index.js +2 -0
  378. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/rules.d.ts +2 -0
  379. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/rules.js +80 -0
  380. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/types.d.ts +38 -0
  381. package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/types.js +1 -0
  382. package/vendor/llmswitch-core/dist/conversion/hub/tool-session-compat.d.ts +26 -0
  383. package/vendor/llmswitch-core/dist/conversion/hub/tool-session-compat.js +86 -0
  384. package/vendor/llmswitch-core/dist/conversion/hub/tool-surface/tool-surface-engine.d.ts +18 -0
  385. package/vendor/llmswitch-core/dist/conversion/hub/tool-surface/tool-surface-engine.js +574 -0
  386. package/vendor/llmswitch-core/dist/conversion/hub/types/chat-envelope.d.ts +79 -0
  387. package/vendor/llmswitch-core/dist/conversion/hub/types/chat-envelope.js +1 -0
  388. package/vendor/llmswitch-core/dist/conversion/hub/types/chat-schema.d.ts +112 -0
  389. package/vendor/llmswitch-core/dist/conversion/hub/types/chat-schema.js +1 -0
  390. package/vendor/llmswitch-core/dist/conversion/hub/types/errors.d.ts +5 -0
  391. package/vendor/llmswitch-core/dist/conversion/hub/types/errors.js +13 -0
  392. package/vendor/llmswitch-core/dist/conversion/hub/types/format-envelope.d.ts +7 -0
  393. package/vendor/llmswitch-core/dist/conversion/hub/types/format-envelope.js +1 -0
  394. package/vendor/llmswitch-core/dist/conversion/hub/types/index.d.ts +6 -0
  395. package/vendor/llmswitch-core/dist/conversion/hub/types/index.js +6 -0
  396. package/vendor/llmswitch-core/dist/conversion/hub/types/json.d.ts +9 -0
  397. package/vendor/llmswitch-core/dist/conversion/hub/types/json.js +9 -0
  398. package/vendor/llmswitch-core/dist/conversion/hub/types/node.d.ts +31 -0
  399. package/vendor/llmswitch-core/dist/conversion/hub/types/node.js +1 -0
  400. package/vendor/llmswitch-core/dist/conversion/hub/types/standardized.d.ts +99 -0
  401. package/vendor/llmswitch-core/dist/conversion/hub/types/standardized.js +1 -0
  402. package/vendor/llmswitch-core/dist/conversion/index.d.ts +33 -0
  403. package/vendor/llmswitch-core/dist/conversion/index.js +33 -0
  404. package/vendor/llmswitch-core/dist/conversion/jsonish.d.ts +3 -0
  405. package/vendor/llmswitch-core/dist/conversion/jsonish.js +20 -0
  406. package/vendor/llmswitch-core/dist/conversion/mcp-injection.d.ts +2 -0
  407. package/vendor/llmswitch-core/dist/conversion/mcp-injection.js +7 -0
  408. package/vendor/llmswitch-core/dist/conversion/media.d.ts +1 -0
  409. package/vendor/llmswitch-core/dist/conversion/media.js +4 -0
  410. package/vendor/llmswitch-core/dist/conversion/metadata-passthrough.d.ts +11 -0
  411. package/vendor/llmswitch-core/dist/conversion/metadata-passthrough.js +20 -0
  412. package/vendor/llmswitch-core/dist/conversion/payload-budget.d.ts +13 -0
  413. package/vendor/llmswitch-core/dist/conversion/payload-budget.js +47 -0
  414. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/anthropic-openai-pipeline.d.ts +11 -0
  415. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/anthropic-openai-pipeline.js +104 -0
  416. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/openai-openai-pipeline.d.ts +15 -0
  417. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/openai-openai-pipeline.js +176 -0
  418. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/responses-openai-pipeline.d.ts +12 -0
  419. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/responses-openai-pipeline.js +212 -0
  420. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/shared/openai-chat-helpers.d.ts +13 -0
  421. package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/shared/openai-chat-helpers.js +34 -0
  422. package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/adapter-context.d.ts +7 -0
  423. package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/adapter-context.js +18 -0
  424. package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/protocol-hooks.d.ts +67 -0
  425. package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/protocol-hooks.js +1 -0
  426. package/vendor/llmswitch-core/dist/conversion/pipeline/index.d.ts +35 -0
  427. package/vendor/llmswitch-core/dist/conversion/pipeline/index.js +103 -0
  428. package/vendor/llmswitch-core/dist/conversion/pipeline/meta/meta-bag.d.ts +20 -0
  429. package/vendor/llmswitch-core/dist/conversion/pipeline/meta/meta-bag.js +81 -0
  430. package/vendor/llmswitch-core/dist/conversion/pipeline/schema/canonical-chat.d.ts +18 -0
  431. package/vendor/llmswitch-core/dist/conversion/pipeline/schema/canonical-chat.js +1 -0
  432. package/vendor/llmswitch-core/dist/conversion/pipeline/schema/index.d.ts +1 -0
  433. package/vendor/llmswitch-core/dist/conversion/pipeline/schema/index.js +1 -0
  434. package/vendor/llmswitch-core/dist/conversion/protocol-field-allowlists.d.ts +7 -0
  435. package/vendor/llmswitch-core/dist/conversion/protocol-field-allowlists.js +9 -0
  436. package/vendor/llmswitch-core/dist/conversion/protocol-state.d.ts +4 -0
  437. package/vendor/llmswitch-core/dist/conversion/protocol-state.js +27 -0
  438. package/vendor/llmswitch-core/dist/conversion/provider-protocol-error.d.ts +17 -0
  439. package/vendor/llmswitch-core/dist/conversion/provider-protocol-error.js +25 -0
  440. package/vendor/llmswitch-core/dist/conversion/responses/responses-host-policy.d.ts +6 -0
  441. package/vendor/llmswitch-core/dist/conversion/responses/responses-host-policy.js +4 -0
  442. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/response-payload.d.ts +3 -0
  443. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/response-payload.js +190 -0
  444. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/types.d.ts +35 -0
  445. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/types.js +1 -0
  446. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge.d.ts +15 -0
  447. package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge.js +475 -0
  448. package/vendor/llmswitch-core/dist/conversion/runtime-metadata.d.ts +7 -0
  449. package/vendor/llmswitch-core/dist/conversion/runtime-metadata.js +31 -0
  450. package/vendor/llmswitch-core/dist/conversion/schema-validator.d.ts +7 -0
  451. package/vendor/llmswitch-core/dist/conversion/schema-validator.js +67 -0
  452. package/vendor/llmswitch-core/dist/conversion/shared/anthropic-message-utils.d.ts +22 -0
  453. package/vendor/llmswitch-core/dist/conversion/shared/anthropic-message-utils.js +1416 -0
  454. package/vendor/llmswitch-core/dist/conversion/shared/chat-envelope-validator.d.ts +8 -0
  455. package/vendor/llmswitch-core/dist/conversion/shared/chat-envelope-validator.js +4 -0
  456. package/vendor/llmswitch-core/dist/conversion/shared/chat-output-normalizer.d.ts +4 -0
  457. package/vendor/llmswitch-core/dist/conversion/shared/chat-output-normalizer.js +10 -0
  458. package/vendor/llmswitch-core/dist/conversion/shared/chat-request-filters.d.ts +8 -0
  459. package/vendor/llmswitch-core/dist/conversion/shared/chat-request-filters.js +63 -0
  460. package/vendor/llmswitch-core/dist/conversion/shared/gemini-tool-utils.d.ts +7 -0
  461. package/vendor/llmswitch-core/dist/conversion/shared/gemini-tool-utils.js +20 -0
  462. package/vendor/llmswitch-core/dist/conversion/shared/openai-finalizer.d.ts +8 -0
  463. package/vendor/llmswitch-core/dist/conversion/shared/openai-finalizer.js +22 -0
  464. package/vendor/llmswitch-core/dist/conversion/shared/openai-message-normalize.d.ts +1 -0
  465. package/vendor/llmswitch-core/dist/conversion/shared/openai-message-normalize.js +151 -0
  466. package/vendor/llmswitch-core/dist/conversion/shared/output-content-normalizer.d.ts +12 -0
  467. package/vendor/llmswitch-core/dist/conversion/shared/output-content-normalizer.js +26 -0
  468. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-mapping.d.ts +5 -0
  469. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-mapping.js +7 -0
  470. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-normalizer.d.ts +25 -0
  471. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-normalizer.js +114 -0
  472. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-normalizer.d.ts +12 -0
  473. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-normalizer.js +22 -0
  474. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-parser.d.ts +10 -0
  475. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-parser.js +11 -0
  476. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-utils.d.ts +2 -0
  477. package/vendor/llmswitch-core/dist/conversion/shared/reasoning-utils.js +19 -0
  478. package/vendor/llmswitch-core/dist/conversion/shared/responses-conversation-store.d.ts +35 -0
  479. package/vendor/llmswitch-core/dist/conversion/shared/responses-conversation-store.js +195 -0
  480. package/vendor/llmswitch-core/dist/conversion/shared/responses-output-builder.d.ts +13 -0
  481. package/vendor/llmswitch-core/dist/conversion/shared/responses-output-builder.js +32 -0
  482. package/vendor/llmswitch-core/dist/conversion/shared/responses-reasoning-registry.d.ts +24 -0
  483. package/vendor/llmswitch-core/dist/conversion/shared/responses-reasoning-registry.js +185 -0
  484. package/vendor/llmswitch-core/dist/conversion/shared/responses-request-adapter.d.ts +7 -0
  485. package/vendor/llmswitch-core/dist/conversion/shared/responses-request-adapter.js +14 -0
  486. package/vendor/llmswitch-core/dist/conversion/shared/responses-response-utils.d.ts +3 -0
  487. package/vendor/llmswitch-core/dist/conversion/shared/responses-response-utils.js +254 -0
  488. package/vendor/llmswitch-core/dist/conversion/shared/responses-tool-utils.d.ts +14 -0
  489. package/vendor/llmswitch-core/dist/conversion/shared/responses-tool-utils.js +102 -0
  490. package/vendor/llmswitch-core/dist/conversion/shared/streaming-text-extractor.d.ts +19 -0
  491. package/vendor/llmswitch-core/dist/conversion/shared/streaming-text-extractor.js +39 -0
  492. package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer/normalize.d.ts +2 -0
  493. package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer/normalize.js +116 -0
  494. package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer.d.ts +4 -0
  495. package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer.js +3 -0
  496. package/vendor/llmswitch-core/dist/conversion/shared/thought-signature-validator.d.ts +52 -0
  497. package/vendor/llmswitch-core/dist/conversion/shared/thought-signature-validator.js +58 -0
  498. package/vendor/llmswitch-core/dist/conversion/shared/tool-argument-repairer.d.ts +39 -0
  499. package/vendor/llmswitch-core/dist/conversion/shared/tool-argument-repairer.js +53 -0
  500. package/vendor/llmswitch-core/dist/conversion/shared/tool-call-id-manager.d.ts +109 -0
  501. package/vendor/llmswitch-core/dist/conversion/shared/tool-call-id-manager.js +202 -0
  502. package/vendor/llmswitch-core/dist/conversion/shared/tool-call-utils.d.ts +11 -0
  503. package/vendor/llmswitch-core/dist/conversion/shared/tool-call-utils.js +14 -0
  504. package/vendor/llmswitch-core/dist/conversion/shared/tool-filter-pipeline.d.ts +21 -0
  505. package/vendor/llmswitch-core/dist/conversion/shared/tool-filter-pipeline.js +171 -0
  506. package/vendor/llmswitch-core/dist/conversion/shared/tool-governor.d.ts +29 -0
  507. package/vendor/llmswitch-core/dist/conversion/shared/tool-governor.js +694 -0
  508. package/vendor/llmswitch-core/dist/conversion/shared/tool-harvester.d.ts +31 -0
  509. package/vendor/llmswitch-core/dist/conversion/shared/tool-harvester.js +23 -0
  510. package/vendor/llmswitch-core/dist/conversion/shared/tool-mapping.d.ts +19 -0
  511. package/vendor/llmswitch-core/dist/conversion/shared/tool-mapping.js +65 -0
  512. package/vendor/llmswitch-core/dist/conversion/shared/tooling.d.ts +29 -0
  513. package/vendor/llmswitch-core/dist/conversion/shared/tooling.js +57 -0
  514. package/vendor/llmswitch-core/dist/conversion/snapshot-utils.d.ts +31 -0
  515. package/vendor/llmswitch-core/dist/conversion/snapshot-utils.js +49 -0
  516. package/vendor/llmswitch-core/dist/conversion/types/bridge-message-types.d.ts +41 -0
  517. package/vendor/llmswitch-core/dist/conversion/types/bridge-message-types.js +1 -0
  518. package/vendor/llmswitch-core/dist/conversion/types/text-markup-normalizer.d.ts +13 -0
  519. package/vendor/llmswitch-core/dist/conversion/types/text-markup-normalizer.js +1 -0
  520. package/vendor/llmswitch-core/dist/conversion/types.d.ts +33 -0
  521. package/vendor/llmswitch-core/dist/conversion/types.js +1 -0
  522. package/vendor/llmswitch-core/dist/filters/builtin/add-fields-filter.d.ts +8 -0
  523. package/vendor/llmswitch-core/dist/filters/builtin/add-fields-filter.js +16 -0
  524. package/vendor/llmswitch-core/dist/filters/builtin/blacklist-filter.d.ts +8 -0
  525. package/vendor/llmswitch-core/dist/filters/builtin/blacklist-filter.js +19 -0
  526. package/vendor/llmswitch-core/dist/filters/builtin/whitelist-filter.d.ts +8 -0
  527. package/vendor/llmswitch-core/dist/filters/builtin/whitelist-filter.js +19 -0
  528. package/vendor/llmswitch-core/dist/filters/config/openai-openai.fieldmap.json +18 -0
  529. package/vendor/llmswitch-core/dist/filters/engine.d.ts +16 -0
  530. package/vendor/llmswitch-core/dist/filters/engine.js +167 -0
  531. package/vendor/llmswitch-core/dist/filters/index.d.ts +18 -0
  532. package/vendor/llmswitch-core/dist/filters/index.js +22 -0
  533. package/vendor/llmswitch-core/dist/filters/special/request-tool-choice-policy.d.ts +11 -0
  534. package/vendor/llmswitch-core/dist/filters/special/request-tool-choice-policy.js +29 -0
  535. package/vendor/llmswitch-core/dist/filters/special/request-tool-list-filter.d.ts +11 -0
  536. package/vendor/llmswitch-core/dist/filters/special/request-tool-list-filter.js +322 -0
  537. package/vendor/llmswitch-core/dist/filters/special/request-toolcalls-stringify.d.ts +13 -0
  538. package/vendor/llmswitch-core/dist/filters/special/request-toolcalls-stringify.js +94 -0
  539. package/vendor/llmswitch-core/dist/filters/special/request-tools-normalize.d.ts +11 -0
  540. package/vendor/llmswitch-core/dist/filters/special/request-tools-normalize.js +114 -0
  541. package/vendor/llmswitch-core/dist/filters/special/response-finish-invariants.d.ts +11 -0
  542. package/vendor/llmswitch-core/dist/filters/special/response-finish-invariants.js +30 -0
  543. package/vendor/llmswitch-core/dist/filters/special/response-openai-to-responses-bridge.d.ts +13 -0
  544. package/vendor/llmswitch-core/dist/filters/special/response-openai-to-responses-bridge.js +24 -0
  545. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-blacklist.d.ts +12 -0
  546. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-blacklist.js +63 -0
  547. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-schema-converge.d.ts +13 -0
  548. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-schema-converge.js +63 -0
  549. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-stringify.d.ts +9 -0
  550. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-stringify.js +132 -0
  551. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-whitelist.d.ts +11 -0
  552. package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-whitelist.js +56 -0
  553. package/vendor/llmswitch-core/dist/filters/special/response-tool-text-canonicalize.d.ts +13 -0
  554. package/vendor/llmswitch-core/dist/filters/special/response-tool-text-canonicalize.js +16 -0
  555. package/vendor/llmswitch-core/dist/filters/special/tool-filter-hooks.d.ts +19 -0
  556. package/vendor/llmswitch-core/dist/filters/special/tool-filter-hooks.js +394 -0
  557. package/vendor/llmswitch-core/dist/filters/special/tool-post-constraints.d.ts +31 -0
  558. package/vendor/llmswitch-core/dist/filters/special/tool-post-constraints.js +120 -0
  559. package/vendor/llmswitch-core/dist/filters/types.d.ts +68 -0
  560. package/vendor/llmswitch-core/dist/filters/types.js +3 -0
  561. package/vendor/llmswitch-core/dist/filters/utils/fieldmap-loader.d.ts +2 -0
  562. package/vendor/llmswitch-core/dist/filters/utils/fieldmap-loader.js +16 -0
  563. package/vendor/llmswitch-core/dist/filters/utils/snapshot-writer.d.ts +10 -0
  564. package/vendor/llmswitch-core/dist/filters/utils/snapshot-writer.js +85 -0
  565. package/vendor/llmswitch-core/dist/guidance/index.d.ts +3 -0
  566. package/vendor/llmswitch-core/dist/guidance/index.js +299 -0
  567. package/vendor/llmswitch-core/dist/http/sse-response.d.ts +22 -0
  568. package/vendor/llmswitch-core/dist/http/sse-response.js +103 -0
  569. package/vendor/llmswitch-core/dist/index.d.ts +11 -0
  570. package/vendor/llmswitch-core/dist/index.js +11 -0
  571. package/vendor/llmswitch-core/dist/native/router_hotpath_napi.node +0 -0
  572. package/vendor/llmswitch-core/dist/quota/apikey-reset.d.ts +17 -0
  573. package/vendor/llmswitch-core/dist/quota/apikey-reset.js +43 -0
  574. package/vendor/llmswitch-core/dist/quota/index.d.ts +2 -0
  575. package/vendor/llmswitch-core/dist/quota/index.js +1 -0
  576. package/vendor/llmswitch-core/dist/quota/quota-manager.d.ts +44 -0
  577. package/vendor/llmswitch-core/dist/quota/quota-manager.js +463 -0
  578. package/vendor/llmswitch-core/dist/quota/quota-state.d.ts +6 -0
  579. package/vendor/llmswitch-core/dist/quota/quota-state.js +191 -0
  580. package/vendor/llmswitch-core/dist/quota/types.d.ts +62 -0
  581. package/vendor/llmswitch-core/dist/quota/types.js +1 -0
  582. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/auth-utils.d.ts +6 -0
  583. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/auth-utils.js +288 -0
  584. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/claude-code-helpers.d.ts +11 -0
  585. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/claude-code-helpers.js +18 -0
  586. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-defaults.d.ts +5 -0
  587. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-defaults.js +13 -0
  588. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-normalizers.d.ts +4 -0
  589. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-normalizers.js +106 -0
  590. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/profile-builder.d.ts +8 -0
  591. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/profile-builder.js +87 -0
  592. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/provider-normalization.d.ts +44 -0
  593. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/provider-normalization.js +272 -0
  594. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/responses-helpers.d.ts +15 -0
  595. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/responses-helpers.js +65 -0
  596. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/routing-config.d.ts +24 -0
  597. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/routing-config.js +346 -0
  598. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/streaming-helpers.d.ts +19 -0
  599. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/streaming-helpers.js +172 -0
  600. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/utils.d.ts +5 -0
  601. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/utils.js +41 -0
  602. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/web-search-config.d.ts +4 -0
  603. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/web-search-config.js +156 -0
  604. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap.d.ts +2 -0
  605. package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap.js +329 -0
  606. package/vendor/llmswitch-core/dist/router/virtual-router/classifier.d.ts +10 -0
  607. package/vendor/llmswitch-core/dist/router/virtual-router/classifier.js +187 -0
  608. package/vendor/llmswitch-core/dist/router/virtual-router/context-advisor.d.ts +23 -0
  609. package/vendor/llmswitch-core/dist/router/virtual-router/context-advisor.js +67 -0
  610. package/vendor/llmswitch-core/dist/router/virtual-router/context-weighted.d.ts +31 -0
  611. package/vendor/llmswitch-core/dist/router/virtual-router/context-weighted.js +54 -0
  612. package/vendor/llmswitch-core/dist/router/virtual-router/default-thinking-keywords.d.ts +1 -0
  613. package/vendor/llmswitch-core/dist/router/virtual-router/default-thinking-keywords.js +13 -0
  614. package/vendor/llmswitch-core/dist/router/virtual-router/engine/antigravity/alias-lease.d.ts +33 -0
  615. package/vendor/llmswitch-core/dist/router/virtual-router/engine/antigravity/alias-lease.js +257 -0
  616. package/vendor/llmswitch-core/dist/router/virtual-router/engine/cooldown-manager.d.ts +34 -0
  617. package/vendor/llmswitch-core/dist/router/virtual-router/engine/cooldown-manager.js +118 -0
  618. package/vendor/llmswitch-core/dist/router/virtual-router/engine/health/index.d.ts +23 -0
  619. package/vendor/llmswitch-core/dist/router/virtual-router/engine/health/index.js +724 -0
  620. package/vendor/llmswitch-core/dist/router/virtual-router/engine/provider-key/parse.d.ts +1 -0
  621. package/vendor/llmswitch-core/dist/router/virtual-router/engine/provider-key/parse.js +1 -0
  622. package/vendor/llmswitch-core/dist/router/virtual-router/engine/route-analytics.d.ts +28 -0
  623. package/vendor/llmswitch-core/dist/router/virtual-router/engine/route-analytics.js +44 -0
  624. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-pools/index.d.ts +13 -0
  625. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-pools/index.js +386 -0
  626. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/keys.d.ts +3 -0
  627. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/keys.js +30 -0
  628. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/metadata.d.ts +6 -0
  629. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/metadata.js +132 -0
  630. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/store.d.ts +10 -0
  631. package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/store.js +156 -0
  632. package/vendor/llmswitch-core/dist/router/virtual-router/engine/sticky-session-manager.d.ts +29 -0
  633. package/vendor/llmswitch-core/dist/router/virtual-router/engine/sticky-session-manager.js +55 -0
  634. package/vendor/llmswitch-core/dist/router/virtual-router/engine-health.d.ts +1 -0
  635. package/vendor/llmswitch-core/dist/router/virtual-router/engine-health.js +1 -0
  636. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/config.d.ts +11 -0
  637. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/config.js +108 -0
  638. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/direct-model.d.ts +10 -0
  639. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/direct-model.js +38 -0
  640. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/health.d.ts +13 -0
  641. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/health.js +104 -0
  642. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/helpers.d.ts +16 -0
  643. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/helpers.js +226 -0
  644. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/route-utils.d.ts +19 -0
  645. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/route-utils.js +212 -0
  646. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-core.d.ts +28 -0
  647. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-core.js +112 -0
  648. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-state.d.ts +16 -0
  649. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-state.js +187 -0
  650. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/state-accessors.d.ts +21 -0
  651. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/state-accessors.js +118 -0
  652. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy.d.ts +123 -0
  653. package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy.js +245 -0
  654. package/vendor/llmswitch-core/dist/router/virtual-router/engine-logging.d.ts +67 -0
  655. package/vendor/llmswitch-core/dist/router/virtual-router/engine-logging.js +356 -0
  656. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/alias-selection.d.ts +15 -0
  657. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/alias-selection.js +118 -0
  658. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/context-weight-multipliers.d.ts +11 -0
  659. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/context-weight-multipliers.js +23 -0
  660. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/direct-provider-model.d.ts +9 -0
  661. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/direct-provider-model.js +49 -0
  662. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/instruction-target.d.ts +6 -0
  663. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/instruction-target.js +54 -0
  664. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/key-parsing.d.ts +8 -0
  665. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/key-parsing.js +47 -0
  666. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/multimodal-capability.d.ts +3 -0
  667. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/multimodal-capability.js +26 -0
  668. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-directive-parser.d.ts +24 -0
  669. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-directive-parser.js +209 -0
  670. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-directives.d.ts +7 -0
  671. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-directives.js +121 -0
  672. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-orchestration-semantics.d.ts +10 -0
  673. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-orchestration-semantics.js +110 -0
  674. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-semantics.d.ts +8 -0
  675. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-semantics.js +281 -0
  676. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-time-tag-semantics.d.ts +1 -0
  677. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-time-tag-semantics.js +25 -0
  678. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminders-semantics.d.ts +4 -0
  679. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminders-semantics.js +44 -0
  680. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-tool-schema-semantics.d.ts +2 -0
  681. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-tool-schema-semantics.js +62 -0
  682. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governance-semantics.d.ts +49 -0
  683. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governance-semantics.js +552 -0
  684. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governed-filter-semantics.d.ts +9 -0
  685. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governed-filter-semantics.js +64 -0
  686. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.d.ts +5 -0
  687. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.js +163 -0
  688. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-post-governed-normalization-semantics.d.ts +1 -0
  689. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-post-governed-normalization-semantics.js +49 -0
  690. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-servertool-orchestration-semantics.d.ts +30 -0
  691. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-servertool-orchestration-semantics.js +446 -0
  692. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-web-search-intent-semantics.d.ts +1 -0
  693. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-web-search-intent-semantics.js +49 -0
  694. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-request-filter-semantics.d.ts +1 -0
  695. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-request-filter-semantics.js +54 -0
  696. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-compat-action-semantics.d.ts +22 -0
  697. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-compat-action-semantics.js +559 -0
  698. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-deepseek-web-compat.d.ts +17 -0
  699. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-deepseek-web-compat.js +26 -0
  700. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics.d.ts +276 -0
  701. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics.js +1291 -0
  702. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.d.ts +72 -0
  703. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.js +405 -0
  704. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.d.ts +18 -0
  705. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.js +333 -0
  706. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-governance-semantics.d.ts +30 -0
  707. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-governance-semantics.js +202 -0
  708. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-inbound-outbound-semantics.d.ts +22 -0
  709. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-inbound-outbound-semantics.js +426 -0
  710. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics.d.ts +57 -0
  711. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics.js +705 -0
  712. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.d.ts +53 -0
  713. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.js +598 -0
  714. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics.d.ts +147 -0
  715. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics.js +570 -0
  716. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-process-semantics.d.ts +26 -0
  717. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-process-semantics.js +148 -0
  718. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics.d.ts +46 -0
  719. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics.js +755 -0
  720. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-semantic-mappers.d.ts +2 -0
  721. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-semantic-mappers.js +83 -0
  722. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-session-identifiers-semantics.d.ts +11 -0
  723. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-session-identifiers-semantics.js +207 -0
  724. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-target-semantics.d.ts +3 -0
  725. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-target-semantics.js +128 -0
  726. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-analysis.d.ts +57 -0
  727. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-analysis.js +217 -0
  728. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-loader.d.ts +5 -0
  729. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-loader.js +464 -0
  730. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-policy.d.ts +5 -0
  731. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-policy.js +18 -0
  732. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-quota-buckets.d.ts +25 -0
  733. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-quota-buckets.js +85 -0
  734. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath.d.ts +59 -0
  735. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath.js +117 -0
  736. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.d.ts +243 -0
  737. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.js +2594 -0
  738. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-snapshot-hooks.d.ts +3 -0
  739. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-snapshot-hooks.js +109 -0
  740. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-alias-selection-semantics.d.ts +16 -0
  741. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-alias-selection-semantics.js +96 -0
  742. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-engine-proxy.d.ts +16 -0
  743. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-engine-proxy.js +14 -0
  744. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-routing-instructions-semantics.d.ts +3 -0
  745. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-routing-instructions-semantics.js +123 -0
  746. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-actions-semantics.d.ts +6 -0
  747. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-actions-semantics.js +85 -0
  748. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-semantics.d.ts +9 -0
  749. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-semantics.js +70 -0
  750. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-state-semantics.d.ts +2 -0
  751. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-state-semantics.js +76 -0
  752. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/route-utils.d.ts +15 -0
  753. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/route-utils.js +248 -0
  754. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/routing-state-filter.d.ts +4 -0
  755. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/routing-state-filter.js +50 -0
  756. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/selection-deps.d.ts +58 -0
  757. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/selection-deps.js +1 -0
  758. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/sticky-pool.d.ts +11 -0
  759. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/sticky-pool.js +109 -0
  760. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-load-balancing.d.ts +16 -0
  761. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-load-balancing.js +120 -0
  762. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-priority.d.ts +11 -0
  763. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-priority.js +55 -0
  764. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-session-lease.d.ts +10 -0
  765. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-session-lease.js +231 -0
  766. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-target-split.d.ts +4 -0
  767. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-target-split.js +43 -0
  768. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-quota-integration.d.ts +29 -0
  769. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-quota-integration.js +194 -0
  770. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-select.d.ts +22 -0
  771. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-select.js +352 -0
  772. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection.d.ts +3 -0
  773. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection.js +309 -0
  774. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection.d.ts +1 -0
  775. package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection.js +1 -0
  776. package/vendor/llmswitch-core/dist/router/virtual-router/engine.d.ts +43 -0
  777. package/vendor/llmswitch-core/dist/router/virtual-router/engine.js +360 -0
  778. package/vendor/llmswitch-core/dist/router/virtual-router/error-center.d.ts +10 -0
  779. package/vendor/llmswitch-core/dist/router/virtual-router/error-center.js +39 -0
  780. package/vendor/llmswitch-core/dist/router/virtual-router/features.d.ts +3 -0
  781. package/vendor/llmswitch-core/dist/router/virtual-router/features.js +124 -0
  782. package/vendor/llmswitch-core/dist/router/virtual-router/health-manager.d.ts +23 -0
  783. package/vendor/llmswitch-core/dist/router/virtual-router/health-manager.js +107 -0
  784. package/vendor/llmswitch-core/dist/router/virtual-router/health-weighted.d.ts +25 -0
  785. package/vendor/llmswitch-core/dist/router/virtual-router/health-weighted.js +63 -0
  786. package/vendor/llmswitch-core/dist/router/virtual-router/load-balancer.d.ts +28 -0
  787. package/vendor/llmswitch-core/dist/router/virtual-router/load-balancer.js +160 -0
  788. package/vendor/llmswitch-core/dist/router/virtual-router/message-utils.d.ts +15 -0
  789. package/vendor/llmswitch-core/dist/router/virtual-router/message-utils.js +235 -0
  790. package/vendor/llmswitch-core/dist/router/virtual-router/pre-command-file-resolver.d.ts +2 -0
  791. package/vendor/llmswitch-core/dist/router/virtual-router/pre-command-file-resolver.js +117 -0
  792. package/vendor/llmswitch-core/dist/router/virtual-router/provider-registry.d.ts +17 -0
  793. package/vendor/llmswitch-core/dist/router/virtual-router/provider-registry.js +145 -0
  794. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/clean.d.ts +3 -0
  795. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/clean.js +34 -0
  796. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/parse.d.ts +6 -0
  797. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/parse.js +24 -0
  798. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/state.d.ts +4 -0
  799. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/state.js +284 -0
  800. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/types.d.ts +74 -0
  801. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/types.js +2 -0
  802. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions.d.ts +5 -0
  803. package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions.js +4 -0
  804. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-actions.d.ts +3 -0
  805. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-actions.js +26 -0
  806. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-parser.d.ts +2 -0
  807. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-parser.js +85 -0
  808. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-state-codec.d.ts +3 -0
  809. package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-state-codec.js +24 -0
  810. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-actions.d.ts +2 -0
  811. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-actions.js +99 -0
  812. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-parser.d.ts +3 -0
  813. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-parser.js +19 -0
  814. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-state-codec.d.ts +7 -0
  815. package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-state-codec.js +121 -0
  816. package/vendor/llmswitch-core/dist/router/virtual-router/sticky-session-store.d.ts +8 -0
  817. package/vendor/llmswitch-core/dist/router/virtual-router/sticky-session-store.js +296 -0
  818. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-file-resolver.d.ts +2 -0
  819. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-file-resolver.js +76 -0
  820. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-stage-template-files.d.ts +12 -0
  821. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-stage-template-files.js +67 -0
  822. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-state-sync.d.ts +17 -0
  823. package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-state-sync.js +82 -0
  824. package/vendor/llmswitch-core/dist/router/virtual-router/success-center.d.ts +10 -0
  825. package/vendor/llmswitch-core/dist/router/virtual-router/success-center.js +32 -0
  826. package/vendor/llmswitch-core/dist/router/virtual-router/token-counter.d.ts +2 -0
  827. package/vendor/llmswitch-core/dist/router/virtual-router/token-counter.js +148 -0
  828. package/vendor/llmswitch-core/dist/router/virtual-router/token-estimator.d.ts +2 -0
  829. package/vendor/llmswitch-core/dist/router/virtual-router/token-estimator.js +16 -0
  830. package/vendor/llmswitch-core/dist/router/virtual-router/token-file-scanner.d.ts +24 -0
  831. package/vendor/llmswitch-core/dist/router/virtual-router/token-file-scanner.js +117 -0
  832. package/vendor/llmswitch-core/dist/router/virtual-router/tool-signals.d.ts +19 -0
  833. package/vendor/llmswitch-core/dist/router/virtual-router/tool-signals.js +647 -0
  834. package/vendor/llmswitch-core/dist/router/virtual-router/types.d.ts +681 -0
  835. package/vendor/llmswitch-core/dist/router/virtual-router/types.js +34 -0
  836. package/vendor/llmswitch-core/dist/runtime/user-data-paths.d.ts +5 -0
  837. package/vendor/llmswitch-core/dist/runtime/user-data-paths.js +43 -0
  838. package/vendor/llmswitch-core/dist/servertool/clock/config.d.ts +17 -0
  839. package/vendor/llmswitch-core/dist/servertool/clock/config.js +48 -0
  840. package/vendor/llmswitch-core/dist/servertool/clock/daemon.d.ts +24 -0
  841. package/vendor/llmswitch-core/dist/servertool/clock/daemon.js +207 -0
  842. package/vendor/llmswitch-core/dist/servertool/clock/io.d.ts +2 -0
  843. package/vendor/llmswitch-core/dist/servertool/clock/io.js +14 -0
  844. package/vendor/llmswitch-core/dist/servertool/clock/log.d.ts +3 -0
  845. package/vendor/llmswitch-core/dist/servertool/clock/log.js +13 -0
  846. package/vendor/llmswitch-core/dist/servertool/clock/ntp.d.ts +18 -0
  847. package/vendor/llmswitch-core/dist/servertool/clock/ntp.js +318 -0
  848. package/vendor/llmswitch-core/dist/servertool/clock/paths.d.ts +5 -0
  849. package/vendor/llmswitch-core/dist/servertool/clock/paths.js +28 -0
  850. package/vendor/llmswitch-core/dist/servertool/clock/recurrence.d.ts +7 -0
  851. package/vendor/llmswitch-core/dist/servertool/clock/recurrence.js +248 -0
  852. package/vendor/llmswitch-core/dist/servertool/clock/session-scope.d.ts +3 -0
  853. package/vendor/llmswitch-core/dist/servertool/clock/session-scope.js +41 -0
  854. package/vendor/llmswitch-core/dist/servertool/clock/session-store.d.ts +3 -0
  855. package/vendor/llmswitch-core/dist/servertool/clock/session-store.js +63 -0
  856. package/vendor/llmswitch-core/dist/servertool/clock/state.d.ts +9 -0
  857. package/vendor/llmswitch-core/dist/servertool/clock/state.js +135 -0
  858. package/vendor/llmswitch-core/dist/servertool/clock/task-store.d.ts +5 -0
  859. package/vendor/llmswitch-core/dist/servertool/clock/task-store.js +4 -0
  860. package/vendor/llmswitch-core/dist/servertool/clock/tasks.d.ts +24 -0
  861. package/vendor/llmswitch-core/dist/servertool/clock/tasks.js +595 -0
  862. package/vendor/llmswitch-core/dist/servertool/clock/types.d.ts +98 -0
  863. package/vendor/llmswitch-core/dist/servertool/clock/types.js +1 -0
  864. package/vendor/llmswitch-core/dist/servertool/continue-execution/log.d.ts +3 -0
  865. package/vendor/llmswitch-core/dist/servertool/continue-execution/log.js +13 -0
  866. package/vendor/llmswitch-core/dist/servertool/engine.d.ts +38 -0
  867. package/vendor/llmswitch-core/dist/servertool/engine.js +1660 -0
  868. package/vendor/llmswitch-core/dist/servertool/followup-shadow.d.ts +16 -0
  869. package/vendor/llmswitch-core/dist/servertool/followup-shadow.js +145 -0
  870. package/vendor/llmswitch-core/dist/servertool/handlers/antigravity-thought-signature-bootstrap.d.ts +1 -0
  871. package/vendor/llmswitch-core/dist/servertool/handlers/antigravity-thought-signature-bootstrap.js +225 -0
  872. package/vendor/llmswitch-core/dist/servertool/handlers/apply-patch-guard.d.ts +1 -0
  873. package/vendor/llmswitch-core/dist/servertool/handlers/apply-patch-guard.js +5 -0
  874. package/vendor/llmswitch-core/dist/servertool/handlers/clock-auto.d.ts +1 -0
  875. package/vendor/llmswitch-core/dist/servertool/handlers/clock-auto.js +177 -0
  876. package/vendor/llmswitch-core/dist/servertool/handlers/clock.d.ts +1 -0
  877. package/vendor/llmswitch-core/dist/servertool/handlers/clock.js +544 -0
  878. package/vendor/llmswitch-core/dist/servertool/handlers/compaction-detect.d.ts +1 -0
  879. package/vendor/llmswitch-core/dist/servertool/handlers/compaction-detect.js +1 -0
  880. package/vendor/llmswitch-core/dist/servertool/handlers/continue-execution.d.ts +1 -0
  881. package/vendor/llmswitch-core/dist/servertool/handlers/continue-execution.js +110 -0
  882. package/vendor/llmswitch-core/dist/servertool/handlers/exec-command-guard.d.ts +1 -0
  883. package/vendor/llmswitch-core/dist/servertool/handlers/exec-command-guard.js +10 -0
  884. package/vendor/llmswitch-core/dist/servertool/handlers/followup-message-trimmer.d.ts +16 -0
  885. package/vendor/llmswitch-core/dist/servertool/handlers/followup-message-trimmer.js +198 -0
  886. package/vendor/llmswitch-core/dist/servertool/handlers/followup-request-builder.d.ts +25 -0
  887. package/vendor/llmswitch-core/dist/servertool/handlers/followup-request-builder.js +515 -0
  888. package/vendor/llmswitch-core/dist/servertool/handlers/followup-sanitize.d.ts +2 -0
  889. package/vendor/llmswitch-core/dist/servertool/handlers/followup-sanitize.js +7 -0
  890. package/vendor/llmswitch-core/dist/servertool/handlers/gemini-empty-reply-continue.d.ts +1 -0
  891. package/vendor/llmswitch-core/dist/servertool/handlers/gemini-empty-reply-continue.js +3 -0
  892. package/vendor/llmswitch-core/dist/servertool/handlers/iflow-model-error-retry.d.ts +1 -0
  893. package/vendor/llmswitch-core/dist/servertool/handlers/iflow-model-error-retry.js +92 -0
  894. package/vendor/llmswitch-core/dist/servertool/handlers/recursive-detection-guard.d.ts +1 -0
  895. package/vendor/llmswitch-core/dist/servertool/handlers/recursive-detection-guard.js +374 -0
  896. package/vendor/llmswitch-core/dist/servertool/handlers/review.d.ts +1 -0
  897. package/vendor/llmswitch-core/dist/servertool/handlers/review.js +181 -0
  898. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/blocked-report.d.ts +16 -0
  899. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/blocked-report.js +407 -0
  900. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/iflow-followup.d.ts +44 -0
  901. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/iflow-followup.js +816 -0
  902. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/routing-state.d.ts +28 -0
  903. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/routing-state.js +123 -0
  904. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/runtime-utils.d.ts +81 -0
  905. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/runtime-utils.js +355 -0
  906. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto.d.ts +1 -0
  907. package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto.js +553 -0
  908. package/vendor/llmswitch-core/dist/servertool/handlers/vision.d.ts +7 -0
  909. package/vendor/llmswitch-core/dist/servertool/handlers/vision.js +240 -0
  910. package/vendor/llmswitch-core/dist/servertool/handlers/web-search.d.ts +7 -0
  911. package/vendor/llmswitch-core/dist/servertool/handlers/web-search.js +926 -0
  912. package/vendor/llmswitch-core/dist/servertool/log/progress-file.d.ts +14 -0
  913. package/vendor/llmswitch-core/dist/servertool/log/progress-file.js +88 -0
  914. package/vendor/llmswitch-core/dist/servertool/pending-session.d.ts +19 -0
  915. package/vendor/llmswitch-core/dist/servertool/pending-session.js +99 -0
  916. package/vendor/llmswitch-core/dist/servertool/pre-command-hooks.d.ts +17 -0
  917. package/vendor/llmswitch-core/dist/servertool/pre-command-hooks.js +491 -0
  918. package/vendor/llmswitch-core/dist/servertool/reenter-backend.d.ts +23 -0
  919. package/vendor/llmswitch-core/dist/servertool/reenter-backend.js +20 -0
  920. package/vendor/llmswitch-core/dist/servertool/registry.d.ts +35 -0
  921. package/vendor/llmswitch-core/dist/servertool/registry.js +92 -0
  922. package/vendor/llmswitch-core/dist/servertool/server-side-tools.d.ts +15 -0
  923. package/vendor/llmswitch-core/dist/servertool/server-side-tools.js +898 -0
  924. package/vendor/llmswitch-core/dist/servertool/stop-gateway-context.d.ts +14 -0
  925. package/vendor/llmswitch-core/dist/servertool/stop-gateway-context.js +167 -0
  926. package/vendor/llmswitch-core/dist/servertool/stop-message-compare-context.d.ts +24 -0
  927. package/vendor/llmswitch-core/dist/servertool/stop-message-compare-context.js +133 -0
  928. package/vendor/llmswitch-core/dist/servertool/strip-servertool-calls.d.ts +2 -0
  929. package/vendor/llmswitch-core/dist/servertool/strip-servertool-calls.js +75 -0
  930. package/vendor/llmswitch-core/dist/servertool/types.d.ts +235 -0
  931. package/vendor/llmswitch-core/dist/servertool/types.js +1 -0
  932. package/vendor/llmswitch-core/dist/sse/index.d.ts +176 -0
  933. package/vendor/llmswitch-core/dist/sse/index.js +142 -0
  934. package/vendor/llmswitch-core/dist/sse/json-to-sse/anthropic-json-to-sse-converter.d.ts +15 -0
  935. package/vendor/llmswitch-core/dist/sse/json-to-sse/anthropic-json-to-sse-converter.js +112 -0
  936. package/vendor/llmswitch-core/dist/sse/json-to-sse/chat-json-to-sse-converter.d.ts +80 -0
  937. package/vendor/llmswitch-core/dist/sse/json-to-sse/chat-json-to-sse-converter.js +300 -0
  938. package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/chat.d.ts +55 -0
  939. package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/chat.js +233 -0
  940. package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/responses.d.ts +103 -0
  941. package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/responses.js +703 -0
  942. package/vendor/llmswitch-core/dist/sse/json-to-sse/gemini-json-to-sse-converter.d.ts +15 -0
  943. package/vendor/llmswitch-core/dist/sse/json-to-sse/gemini-json-to-sse-converter.js +99 -0
  944. package/vendor/llmswitch-core/dist/sse/json-to-sse/index.d.ts +7 -0
  945. package/vendor/llmswitch-core/dist/sse/json-to-sse/index.js +9 -0
  946. package/vendor/llmswitch-core/dist/sse/json-to-sse/responses-json-to-sse-converter.d.ts +80 -0
  947. package/vendor/llmswitch-core/dist/sse/json-to-sse/responses-json-to-sse-converter.js +322 -0
  948. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/anthropic-sequencer.d.ts +13 -0
  949. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/anthropic-sequencer.js +162 -0
  950. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/chat-sequencer.d.ts +39 -0
  951. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/chat-sequencer.js +264 -0
  952. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/gemini-sequencer.d.ts +10 -0
  953. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/gemini-sequencer.js +95 -0
  954. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/responses-sequencer.d.ts +40 -0
  955. package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/responses-sequencer.js +293 -0
  956. package/vendor/llmswitch-core/dist/sse/registry/sse-codec-registry.d.ts +32 -0
  957. package/vendor/llmswitch-core/dist/sse/registry/sse-codec-registry.js +135 -0
  958. package/vendor/llmswitch-core/dist/sse/shared/chat-serializer.d.ts +4 -0
  959. package/vendor/llmswitch-core/dist/sse/shared/chat-serializer.js +40 -0
  960. package/vendor/llmswitch-core/dist/sse/shared/constants.d.ts +272 -0
  961. package/vendor/llmswitch-core/dist/sse/shared/constants.js +321 -0
  962. package/vendor/llmswitch-core/dist/sse/shared/reasoning-dispatcher.d.ts +10 -0
  963. package/vendor/llmswitch-core/dist/sse/shared/reasoning-dispatcher.js +25 -0
  964. package/vendor/llmswitch-core/dist/sse/shared/responses-output-normalizer.d.ts +13 -0
  965. package/vendor/llmswitch-core/dist/sse/shared/responses-output-normalizer.js +47 -0
  966. package/vendor/llmswitch-core/dist/sse/shared/serializers/anthropic-event-serializer.d.ts +2 -0
  967. package/vendor/llmswitch-core/dist/sse/shared/serializers/anthropic-event-serializer.js +9 -0
  968. package/vendor/llmswitch-core/dist/sse/shared/serializers/base-serializer.d.ts +158 -0
  969. package/vendor/llmswitch-core/dist/sse/shared/serializers/base-serializer.js +210 -0
  970. package/vendor/llmswitch-core/dist/sse/shared/serializers/chat-event-serializer.d.ts +82 -0
  971. package/vendor/llmswitch-core/dist/sse/shared/serializers/chat-event-serializer.js +275 -0
  972. package/vendor/llmswitch-core/dist/sse/shared/serializers/gemini-event-serializer.d.ts +2 -0
  973. package/vendor/llmswitch-core/dist/sse/shared/serializers/gemini-event-serializer.js +5 -0
  974. package/vendor/llmswitch-core/dist/sse/shared/serializers/index.d.ts +42 -0
  975. package/vendor/llmswitch-core/dist/sse/shared/serializers/index.js +56 -0
  976. package/vendor/llmswitch-core/dist/sse/shared/serializers/responses-event-serializer.d.ts +131 -0
  977. package/vendor/llmswitch-core/dist/sse/shared/serializers/responses-event-serializer.js +375 -0
  978. package/vendor/llmswitch-core/dist/sse/shared/serializers/types.d.ts +51 -0
  979. package/vendor/llmswitch-core/dist/sse/shared/serializers/types.js +4 -0
  980. package/vendor/llmswitch-core/dist/sse/shared/utils.d.ts +254 -0
  981. package/vendor/llmswitch-core/dist/sse/shared/utils.js +543 -0
  982. package/vendor/llmswitch-core/dist/sse/shared/writer.d.ts +127 -0
  983. package/vendor/llmswitch-core/dist/sse/shared/writer.js +321 -0
  984. package/vendor/llmswitch-core/dist/sse/sse-to-json/anthropic-sse-to-json-converter.d.ts +20 -0
  985. package/vendor/llmswitch-core/dist/sse/sse-to-json/anthropic-sse-to-json-converter.js +204 -0
  986. package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/anthropic-response-builder.d.ts +16 -0
  987. package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/anthropic-response-builder.js +258 -0
  988. package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/response-builder.d.ts +177 -0
  989. package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/response-builder.js +1135 -0
  990. package/vendor/llmswitch-core/dist/sse/sse-to-json/chat-sse-to-json-converter.d.ts +119 -0
  991. package/vendor/llmswitch-core/dist/sse/sse-to-json/chat-sse-to-json-converter.js +850 -0
  992. package/vendor/llmswitch-core/dist/sse/sse-to-json/gemini-sse-to-json-converter.d.ts +14 -0
  993. package/vendor/llmswitch-core/dist/sse/sse-to-json/gemini-sse-to-json-converter.js +186 -0
  994. package/vendor/llmswitch-core/dist/sse/sse-to-json/index.d.ts +7 -0
  995. package/vendor/llmswitch-core/dist/sse/sse-to-json/index.js +9 -0
  996. package/vendor/llmswitch-core/dist/sse/sse-to-json/parsers/sse-parser.d.ts +73 -0
  997. package/vendor/llmswitch-core/dist/sse/sse-to-json/parsers/sse-parser.js +434 -0
  998. package/vendor/llmswitch-core/dist/sse/sse-to-json/responses-sse-to-json-converter.d.ts +61 -0
  999. package/vendor/llmswitch-core/dist/sse/sse-to-json/responses-sse-to-json-converter.js +306 -0
  1000. package/vendor/llmswitch-core/dist/sse/types/anthropic-types.d.ts +194 -0
  1001. package/vendor/llmswitch-core/dist/sse/types/anthropic-types.js +8 -0
  1002. package/vendor/llmswitch-core/dist/sse/types/chat-types.d.ts +321 -0
  1003. package/vendor/llmswitch-core/dist/sse/types/chat-types.js +33 -0
  1004. package/vendor/llmswitch-core/dist/sse/types/conversion-context.d.ts +214 -0
  1005. package/vendor/llmswitch-core/dist/sse/types/conversion-context.js +20 -0
  1006. package/vendor/llmswitch-core/dist/sse/types/core-interfaces.d.ts +94 -0
  1007. package/vendor/llmswitch-core/dist/sse/types/core-interfaces.js +5 -0
  1008. package/vendor/llmswitch-core/dist/sse/types/gemini-types.d.ts +135 -0
  1009. package/vendor/llmswitch-core/dist/sse/types/gemini-types.js +5 -0
  1010. package/vendor/llmswitch-core/dist/sse/types/index.d.ts +17 -0
  1011. package/vendor/llmswitch-core/dist/sse/types/index.js +9 -0
  1012. package/vendor/llmswitch-core/dist/sse/types/responses-types.d.ts +334 -0
  1013. package/vendor/llmswitch-core/dist/sse/types/responses-types.js +38 -0
  1014. package/vendor/llmswitch-core/dist/sse/types/sse-events.d.ts +181 -0
  1015. package/vendor/llmswitch-core/dist/sse/types/sse-events.js +150 -0
  1016. package/vendor/llmswitch-core/dist/sse/types/stream-state.d.ts +199 -0
  1017. package/vendor/llmswitch-core/dist/sse/types/stream-state.js +44 -0
  1018. package/vendor/llmswitch-core/dist/sse/types/utility-types.d.ts +234 -0
  1019. package/vendor/llmswitch-core/dist/sse/types/utility-types.js +46 -0
  1020. package/vendor/llmswitch-core/dist/telemetry/stats-center.d.ts +82 -0
  1021. package/vendor/llmswitch-core/dist/telemetry/stats-center.js +308 -0
  1022. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/default-actions.d.ts +2 -0
  1023. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/default-actions.js +12 -0
  1024. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/extract-patch.d.ts +2 -0
  1025. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/extract-patch.js +15 -0
  1026. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/index.d.ts +2 -0
  1027. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/index.js +164 -0
  1028. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/structured-builders.d.ts +7 -0
  1029. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/structured-builders.js +85 -0
  1030. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/types.d.ts +54 -0
  1031. package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/types.js +1 -0
  1032. package/vendor/llmswitch-core/dist/tools/apply-patch/execution-capturer.d.ts +13 -0
  1033. package/vendor/llmswitch-core/dist/tools/apply-patch/execution-capturer.js +181 -0
  1034. package/vendor/llmswitch-core/dist/tools/apply-patch/json/parse-loose.d.ts +3 -0
  1035. package/vendor/llmswitch-core/dist/tools/apply-patch/json/parse-loose.js +139 -0
  1036. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/context-diff.d.ts +1 -0
  1037. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/context-diff.js +173 -0
  1038. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/git-diff.d.ts +1 -0
  1039. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/git-diff.js +138 -0
  1040. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/looks-like-patch.d.ts +1 -0
  1041. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/looks-like-patch.js +11 -0
  1042. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/normalize.d.ts +3 -0
  1043. package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/normalize.js +383 -0
  1044. package/vendor/llmswitch-core/dist/tools/apply-patch/regression-capturer.d.ts +13 -0
  1045. package/vendor/llmswitch-core/dist/tools/apply-patch/regression-capturer.js +113 -0
  1046. package/vendor/llmswitch-core/dist/tools/apply-patch/structured/coercion.d.ts +3 -0
  1047. package/vendor/llmswitch-core/dist/tools/apply-patch/structured/coercion.js +103 -0
  1048. package/vendor/llmswitch-core/dist/tools/apply-patch/structured.d.ts +20 -0
  1049. package/vendor/llmswitch-core/dist/tools/apply-patch/structured.js +537 -0
  1050. package/vendor/llmswitch-core/dist/tools/apply-patch/validation/shared.d.ts +3 -0
  1051. package/vendor/llmswitch-core/dist/tools/apply-patch/validation/shared.js +6 -0
  1052. package/vendor/llmswitch-core/dist/tools/apply-patch/validator.d.ts +8 -0
  1053. package/vendor/llmswitch-core/dist/tools/apply-patch/validator.js +21 -0
  1054. package/vendor/llmswitch-core/dist/tools/apply-patch-structured.d.ts +1 -0
  1055. package/vendor/llmswitch-core/dist/tools/apply-patch-structured.js +1 -0
  1056. package/vendor/llmswitch-core/dist/tools/args-json.d.ts +1 -0
  1057. package/vendor/llmswitch-core/dist/tools/args-json.js +204 -0
  1058. package/vendor/llmswitch-core/dist/tools/exec-command/normalize.d.ts +17 -0
  1059. package/vendor/llmswitch-core/dist/tools/exec-command/normalize.js +116 -0
  1060. package/vendor/llmswitch-core/dist/tools/exec-command/regression-capturer.d.ts +11 -0
  1061. package/vendor/llmswitch-core/dist/tools/exec-command/regression-capturer.js +144 -0
  1062. package/vendor/llmswitch-core/dist/tools/exec-command/validator.d.ts +10 -0
  1063. package/vendor/llmswitch-core/dist/tools/exec-command/validator.js +238 -0
  1064. package/vendor/llmswitch-core/dist/tools/patch-regression-capturer.d.ts +1 -0
  1065. package/vendor/llmswitch-core/dist/tools/patch-regression-capturer.js +1 -0
  1066. package/vendor/llmswitch-core/dist/tools/tool-description-utils.d.ts +5 -0
  1067. package/vendor/llmswitch-core/dist/tools/tool-description-utils.js +50 -0
  1068. package/vendor/llmswitch-core/dist/tools/tool-registry.d.ts +15 -0
  1069. package/vendor/llmswitch-core/dist/tools/tool-registry.js +253 -0
  1070. package/vendor/llmswitch-core/package.json +189 -0
  1071. package/scripts/link-llmswitch.mjs +0 -56
@@ -0,0 +1,234 @@
1
+ /**
2
+ * 工具类型定义
3
+ * 提供JSON↔SSE双向转换中常用的工具类型和辅助函数
4
+ */
5
+ import type { JsonObject, JsonValue } from './core-interfaces.js';
6
+ export type ProtocolType = 'chat' | 'responses';
7
+ export type ConversionDirection = 'json_to_sse' | 'sse_to_json';
8
+ export interface EventTypeMap {
9
+ chat: {
10
+ SSE_EVENT: 'chat_chunk' | 'chat.done' | 'error' | 'ping';
11
+ JSON_TYPE: 'ChatCompletionChunk' | 'ChatCompletionResponse';
12
+ };
13
+ responses: {
14
+ SSE_EVENT: 'response.created' | 'response.in_progress' | 'response.completed' | 'response.required_action' | 'response.done' | 'response.output_item.added' | 'response.output_item.done' | 'response.content_part.added' | 'response.content_part.done' | 'response.output_text.delta' | 'response.output_text.done' | 'response.reasoning_text.delta' | 'response.reasoning_text.done' | 'response.function_call_arguments.delta' | 'response.function_call_arguments.done';
15
+ JSON_TYPE: 'ResponsesResponse' | 'ResponsesRequest';
16
+ };
17
+ }
18
+ export interface GenericConverter<TProtocol extends ProtocolType, TDirection extends ConversionDirection> {
19
+ protocol: TProtocol;
20
+ direction: TDirection;
21
+ convert(input: unknown, options: JsonObject): Promise<unknown>;
22
+ validate?(input: unknown): boolean;
23
+ getStats?(): JsonObject;
24
+ }
25
+ export interface UnifiedConversionOptions {
26
+ requestId: string;
27
+ model: string;
28
+ protocol: ProtocolType;
29
+ direction: ConversionDirection;
30
+ timeoutMs?: number;
31
+ enableHeartbeat?: boolean;
32
+ heartbeatIntervalMs?: number;
33
+ validationMode?: 'none' | 'basic' | 'strict';
34
+ debugMode?: boolean;
35
+ onError?: (error: Error) => void;
36
+ onComplete?: () => void;
37
+ }
38
+ export interface UnifiedEventStream extends AsyncIterable<unknown> {
39
+ protocol: ProtocolType;
40
+ direction: ConversionDirection;
41
+ requestId: string;
42
+ getStats(): JsonObject;
43
+ getConfig(): JsonObject;
44
+ pause?(): void;
45
+ resume?(): void;
46
+ complete(): void;
47
+ abort(error?: Error): void;
48
+ on?(event: 'error', handler: (error: Error) => void): this;
49
+ on?(event: 'complete', handler: () => void): this;
50
+ on?(event: 'timeout', handler: () => void): this;
51
+ on?(event: 'stats', handler: (stats: JsonObject) => void): this;
52
+ }
53
+ export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
54
+ export type RequireKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;
55
+ export type JsonType<TProtocol extends ProtocolType> = TProtocol extends 'chat' ? ChatJsonType : TProtocol extends 'responses' ? ResponsesJsonType : never;
56
+ export type SseEventType<TProtocol extends ProtocolType> = TProtocol extends 'chat' ? ChatSseEventType : TProtocol extends 'responses' ? ResponsesSseEventType : never;
57
+ export interface ChatJsonType {
58
+ id: string;
59
+ object: 'chat.completion' | 'chat.completion.chunk';
60
+ created: number;
61
+ model: string;
62
+ choices: unknown[];
63
+ usage?: JsonObject;
64
+ }
65
+ export type ChatSseEventType = 'chat_chunk' | 'chat.done' | 'error' | 'ping';
66
+ export interface ResponsesJsonType {
67
+ id: string;
68
+ object: 'response';
69
+ created_at: number;
70
+ model: string;
71
+ status: string;
72
+ output: unknown[];
73
+ usage?: JsonObject;
74
+ }
75
+ export type ResponsesSseEventType = 'response.created' | 'response.in_progress' | 'response.completed' | 'response.required_action' | 'response.done' | 'response.output_item.added' | 'response.output_item.done' | 'response.content_part.added' | 'response.content_part.done' | 'response.output_text.delta' | 'response.output_text.done' | 'response.reasoning_text.delta' | 'response.reasoning_text.done' | 'response.function_call_arguments.delta' | 'response.function_call_arguments.done';
76
+ export interface ConversionResult<TSuccess = unknown, TError = Error> {
77
+ success: boolean;
78
+ data?: TSuccess;
79
+ error?: TError;
80
+ metadata?: {
81
+ duration: number;
82
+ eventsProcessed: number;
83
+ bytesProcessed: number;
84
+ protocol: ProtocolType;
85
+ direction: ConversionDirection;
86
+ };
87
+ }
88
+ export type AsyncConversionResult<TSuccess = unknown, TError = Error> = Promise<ConversionResult<TSuccess, TError>>;
89
+ export interface ConverterFactory {
90
+ createJsonToSseConverter<TProtocol extends ProtocolType>(protocol: TProtocol, options: UnifiedConversionOptions): GenericConverter<TProtocol, 'json_to_sse'>;
91
+ createSseToJsonConverter<TProtocol extends ProtocolType>(protocol: TProtocol, options: UnifiedConversionOptions): GenericConverter<TProtocol, 'sse_to_json'>;
92
+ }
93
+ export interface ConverterRegistry {
94
+ register<TProtocol extends ProtocolType, TDirection extends ConversionDirection>(protocol: TProtocol, direction: TDirection, converter: GenericConverter<TProtocol, TDirection>): void;
95
+ get<TProtocol extends ProtocolType, TDirection extends ConversionDirection>(protocol: TProtocol, direction: TDirection): GenericConverter<TProtocol, TDirection> | undefined;
96
+ list(): Array<{
97
+ protocol: ProtocolType;
98
+ direction: ConversionDirection;
99
+ converter: GenericConverter<ProtocolType, ConversionDirection>;
100
+ }>;
101
+ }
102
+ export interface Validator<T> {
103
+ validate(input: T): ValidationResult;
104
+ isValid(input: T): boolean;
105
+ getErrors(input: T): string[];
106
+ }
107
+ export interface ValidationResult {
108
+ isValid: boolean;
109
+ errors: ValidationError[];
110
+ warnings: ValidationWarning[];
111
+ }
112
+ export interface ValidationError {
113
+ code: string;
114
+ message: string;
115
+ path: string;
116
+ value?: JsonValue;
117
+ }
118
+ export interface ValidationWarning {
119
+ code: string;
120
+ message: string;
121
+ path: string;
122
+ value?: JsonValue;
123
+ }
124
+ export interface Serializer<T> {
125
+ serialize(input: T): string;
126
+ deserialize(input: string): T;
127
+ isValid(input: string): boolean;
128
+ }
129
+ export interface Cache<K, V> {
130
+ get(key: K): V | undefined;
131
+ set(key: K, value: V): void;
132
+ has(key: K): boolean;
133
+ delete(key: K): boolean;
134
+ clear(): void;
135
+ size: number;
136
+ }
137
+ export interface MetricsCollector {
138
+ incrementCounter(name: string, tags?: Record<string, string>): void;
139
+ recordHistogram(name: string, value: number, tags?: Record<string, string>): void;
140
+ setGauge(name: string, value: number, tags?: Record<string, string>): void;
141
+ recordTimer(name: string, duration: number, tags?: Record<string, string>): void;
142
+ getMetrics(): Record<string, unknown>;
143
+ }
144
+ type LoggerMetadata = Record<string, unknown>;
145
+ export interface Logger {
146
+ debug(message: string, meta?: LoggerMetadata): void;
147
+ info(message: string, meta?: LoggerMetadata): void;
148
+ warn(message: string, meta?: LoggerMetadata): void;
149
+ error(message: string, error?: Error, meta?: LoggerMetadata): void;
150
+ child(meta: LoggerMetadata): Logger;
151
+ }
152
+ export interface RetryConfig {
153
+ maxAttempts: number;
154
+ initialDelayMs: number;
155
+ maxDelayMs: number;
156
+ backoffMultiplier: number;
157
+ jitter: boolean;
158
+ retryableErrors: string[];
159
+ }
160
+ export interface CircuitBreakerConfig {
161
+ failureThreshold: number;
162
+ recoveryTimeoutMs: number;
163
+ monitoringPeriodMs: number;
164
+ expectedRecoveryTimeMs: number;
165
+ }
166
+ export interface RateLimitConfig {
167
+ windowMs: number;
168
+ maxRequests: number;
169
+ burstSize?: number;
170
+ strategy: 'sliding_window' | 'fixed_window' | 'token_bucket';
171
+ }
172
+ export interface HealthCheck {
173
+ isHealthy(): Promise<boolean>;
174
+ getStatus(): HealthStatus;
175
+ onHealthChange(callback: (status: HealthStatus) => void): void;
176
+ }
177
+ export interface HealthStatus {
178
+ healthy: boolean;
179
+ timestamp: number;
180
+ details?: Record<string, unknown>;
181
+ }
182
+ type LifecycleContext = Record<string, unknown>;
183
+ export interface LifecycleHooks {
184
+ beforeConversion?: (context: LifecycleContext) => Promise<void>;
185
+ afterConversion?: (context: LifecycleContext, result: unknown) => Promise<void>;
186
+ onError?: (context: LifecycleContext, error: Error) => Promise<void>;
187
+ onTimeout?: (context: LifecycleContext) => Promise<void>;
188
+ onRetry?: (context: LifecycleContext, attempt: number) => Promise<void>;
189
+ }
190
+ export interface Middleware {
191
+ name: string;
192
+ priority: number;
193
+ beforeConversion?: (context: LifecycleContext) => Promise<void>;
194
+ afterConversion?: (context: LifecycleContext, result: unknown) => Promise<void>;
195
+ onError?: (context: LifecycleContext, error: Error) => Promise<void>;
196
+ }
197
+ export interface Plugin {
198
+ name: string;
199
+ version: string;
200
+ initialize(context: LifecycleContext): Promise<void>;
201
+ destroy(): Promise<void>;
202
+ getMiddlewares(): Middleware[];
203
+ getHooks(): LifecycleHooks;
204
+ }
205
+ export interface ConfigMerger {
206
+ merge<T>(base: T, override: Partial<T>): T;
207
+ validate<T>(config: T): ValidationResult;
208
+ normalize<T>(config: T): T;
209
+ }
210
+ export interface EnvironmentParser {
211
+ getString(key: string, defaultValue?: string): string;
212
+ getNumber(key: string, defaultValue?: number): number;
213
+ getBoolean(key: string, defaultValue?: boolean): boolean;
214
+ getArray(key: string, delimiter?: string): string[];
215
+ getObject(key: string): JsonObject;
216
+ }
217
+ export declare const TypeGuards: {
218
+ isString: (value: unknown) => value is string;
219
+ isNumber: (value: unknown) => value is number;
220
+ isBoolean: (value: unknown) => value is boolean;
221
+ isObject: (value: unknown) => value is JsonObject;
222
+ isArray: (value: unknown) => value is JsonValue[];
223
+ isFunction: (value: unknown) => value is (...args: unknown[]) => unknown;
224
+ isDate: (value: unknown) => value is Date;
225
+ isNull: (value: unknown) => value is null;
226
+ isUndefined: (value: unknown) => value is undefined;
227
+ isNullOrUndefined: (value: unknown) => value is null | undefined;
228
+ };
229
+ export declare const AsyncUtils: {
230
+ delay: (ms: number) => Promise<void>;
231
+ timeout: <T>(promise: Promise<T>, ms: number) => Promise<T>;
232
+ retry: <T>(fn: () => Promise<T>, config: RetryConfig) => Promise<T>;
233
+ };
234
+ export {};
@@ -0,0 +1,46 @@
1
+ /**
2
+ * 工具类型定义
3
+ * 提供JSON↔SSE双向转换中常用的工具类型和辅助函数
4
+ */
5
+ // 类型守卫工具函数
6
+ export const TypeGuards = {
7
+ isString: (value) => typeof value === 'string',
8
+ isNumber: (value) => typeof value === 'number' && !Number.isNaN(value),
9
+ isBoolean: (value) => typeof value === 'boolean',
10
+ isObject: (value) => value !== null && typeof value === 'object' && !Array.isArray(value),
11
+ isArray: (value) => Array.isArray(value),
12
+ isFunction: (value) => typeof value === 'function',
13
+ isDate: (value) => value instanceof Date,
14
+ isNull: (value) => value === null,
15
+ isUndefined: (value) => value === undefined,
16
+ isNullOrUndefined: (value) => value === null || value === undefined
17
+ };
18
+ // 异步工具函数
19
+ export const AsyncUtils = {
20
+ delay: (ms) => new Promise(resolve => setTimeout(resolve, ms)),
21
+ timeout: (promise, ms) => {
22
+ return Promise.race([
23
+ promise,
24
+ new Promise((_, reject) => setTimeout(() => reject(new Error(`Operation timed out after ${ms}ms`)), ms))
25
+ ]);
26
+ },
27
+ retry: async (fn, config) => {
28
+ let lastError;
29
+ for (let attempt = 1; attempt <= config.maxAttempts; attempt++) {
30
+ try {
31
+ return await fn();
32
+ }
33
+ catch (error) {
34
+ const normalizedError = error instanceof Error ? error : new Error(String(error));
35
+ lastError = normalizedError;
36
+ if (!config.retryableErrors.includes(normalizedError.name) || attempt === config.maxAttempts) {
37
+ throw normalizedError;
38
+ }
39
+ const delay = Math.min(config.initialDelayMs * Math.pow(config.backoffMultiplier, attempt - 1), config.maxDelayMs);
40
+ const jitter = config.jitter ? Math.random() * delay * 0.1 : 0;
41
+ await AsyncUtils.delay(delay + jitter);
42
+ }
43
+ }
44
+ throw lastError ?? new Error('Operation failed after retry attempts');
45
+ }
46
+ };
@@ -0,0 +1,82 @@
1
+ export interface VirtualRouterHitEvent {
2
+ requestId: string;
3
+ timestamp: number;
4
+ entryEndpoint: string;
5
+ routeName: string;
6
+ pool: string;
7
+ providerKey: string;
8
+ runtimeKey?: string;
9
+ providerType?: string;
10
+ modelId?: string;
11
+ reason?: string;
12
+ requestTokens?: number;
13
+ selectionPenalty?: number;
14
+ stopMessageActive?: boolean;
15
+ stopMessageMode?: 'on' | 'off' | 'auto' | 'unset';
16
+ stopMessageRemaining?: number;
17
+ }
18
+ export interface ProviderUsageEvent {
19
+ requestId: string;
20
+ timestamp: number;
21
+ providerKey: string;
22
+ runtimeKey?: string;
23
+ providerType: string;
24
+ modelId?: string;
25
+ routeName?: string;
26
+ entryEndpoint?: string;
27
+ success: boolean;
28
+ latencyMs: number;
29
+ promptTokens?: number;
30
+ completionTokens?: number;
31
+ totalTokens?: number;
32
+ }
33
+ export interface RouterStatsBucket {
34
+ requestCount: number;
35
+ poolHitCount: Record<string, number>;
36
+ routeHitCount: Record<string, number>;
37
+ providerHitCount: Record<string, number>;
38
+ reasonHitCount: Record<string, number>;
39
+ penaltyHitCount: Record<string, number>;
40
+ stopMessageActiveCount: number;
41
+ }
42
+ export interface RouterStatsSnapshot {
43
+ global: RouterStatsBucket;
44
+ byEntryEndpoint: Record<string, RouterStatsBucket>;
45
+ }
46
+ export interface ProviderStatsBucket {
47
+ requestCount: number;
48
+ successCount: number;
49
+ errorCount: number;
50
+ latencySumMs: number;
51
+ minLatencyMs: number;
52
+ maxLatencyMs: number;
53
+ usage: {
54
+ promptTokens: number;
55
+ completionTokens: number;
56
+ totalTokens: number;
57
+ };
58
+ }
59
+ export interface ProviderStatsSnapshot {
60
+ global: ProviderStatsBucket;
61
+ byProviderKey: Record<string, ProviderStatsBucket>;
62
+ byRoute: Record<string, ProviderStatsBucket>;
63
+ byEntryEndpoint: Record<string, ProviderStatsBucket>;
64
+ }
65
+ export interface StatsSnapshot {
66
+ router: RouterStatsSnapshot;
67
+ providers: ProviderStatsSnapshot;
68
+ }
69
+ export interface StatsCenterOptions {
70
+ enable?: boolean;
71
+ autoPrintOnExit?: boolean;
72
+ persistPath?: string | null;
73
+ }
74
+ export interface StatsCenter {
75
+ recordVirtualRouterHit(ev: VirtualRouterHitEvent): void;
76
+ recordProviderUsage(ev: ProviderUsageEvent): void;
77
+ getSnapshot(): StatsSnapshot;
78
+ flushToDisk(): Promise<void>;
79
+ reset(): void;
80
+ }
81
+ export declare function initStatsCenter(options?: StatsCenterOptions): StatsCenter;
82
+ export declare function getStatsCenter(): StatsCenter;
@@ -0,0 +1,308 @@
1
+ import path from 'node:path';
2
+ import fs from 'node:fs/promises';
3
+ import { resolveRccPath } from '../runtime/user-data-paths.js';
4
+ function createEmptyRouterBucket() {
5
+ return {
6
+ requestCount: 0,
7
+ poolHitCount: {},
8
+ routeHitCount: {},
9
+ providerHitCount: {},
10
+ reasonHitCount: {},
11
+ penaltyHitCount: {},
12
+ stopMessageActiveCount: 0
13
+ };
14
+ }
15
+ function createEmptyProviderBucket() {
16
+ return {
17
+ requestCount: 0,
18
+ successCount: 0,
19
+ errorCount: 0,
20
+ latencySumMs: 0,
21
+ minLatencyMs: Number.POSITIVE_INFINITY,
22
+ maxLatencyMs: 0,
23
+ usage: {
24
+ promptTokens: 0,
25
+ completionTokens: 0,
26
+ totalTokens: 0
27
+ }
28
+ };
29
+ }
30
+ function createEmptySnapshot() {
31
+ return {
32
+ router: {
33
+ global: createEmptyRouterBucket(),
34
+ byEntryEndpoint: {}
35
+ },
36
+ providers: {
37
+ global: createEmptyProviderBucket(),
38
+ byProviderKey: {},
39
+ byRoute: {},
40
+ byEntryEndpoint: {}
41
+ }
42
+ };
43
+ }
44
+ class NoopStatsCenter {
45
+ recordVirtualRouterHit() { }
46
+ recordProviderUsage() { }
47
+ getSnapshot() { return createEmptySnapshot(); }
48
+ async flushToDisk() { }
49
+ reset() { }
50
+ }
51
+ class DefaultStatsCenter {
52
+ snapshot = createEmptySnapshot();
53
+ dirty = false;
54
+ flushInFlight = false;
55
+ persistPath;
56
+ constructor(persistPath) {
57
+ if (persistPath === null) {
58
+ this.persistPath = null;
59
+ }
60
+ else if (typeof persistPath === 'string' && persistPath.trim().length) {
61
+ this.persistPath = persistPath.trim();
62
+ }
63
+ else {
64
+ const base = resolveRccPath('stats');
65
+ this.persistPath = path.join(base, 'stats.json');
66
+ }
67
+ }
68
+ recordVirtualRouterHit(ev) {
69
+ if (!ev || !ev.routeName || !ev.providerKey) {
70
+ return;
71
+ }
72
+ const snap = this.snapshot;
73
+ this.applyRouterHitToBucket(snap.router.global, ev);
74
+ const entryKey = ev.entryEndpoint || 'unknown';
75
+ if (!snap.router.byEntryEndpoint[entryKey]) {
76
+ snap.router.byEntryEndpoint[entryKey] = createEmptyRouterBucket();
77
+ }
78
+ this.applyRouterHitToBucket(snap.router.byEntryEndpoint[entryKey], ev);
79
+ this.dirty = true;
80
+ }
81
+ recordProviderUsage(ev) {
82
+ if (!ev || !ev.providerKey || !ev.providerType) {
83
+ return;
84
+ }
85
+ const snap = this.snapshot;
86
+ this.applyProviderUsageToBucket(snap.providers.global, ev);
87
+ const providerKey = ev.providerKey;
88
+ if (!snap.providers.byProviderKey[providerKey]) {
89
+ snap.providers.byProviderKey[providerKey] = createEmptyProviderBucket();
90
+ }
91
+ this.applyProviderUsageToBucket(snap.providers.byProviderKey[providerKey], ev);
92
+ const routeKey = ev.routeName || 'unknown';
93
+ if (!snap.providers.byRoute[routeKey]) {
94
+ snap.providers.byRoute[routeKey] = createEmptyProviderBucket();
95
+ }
96
+ this.applyProviderUsageToBucket(snap.providers.byRoute[routeKey], ev);
97
+ const entryKey = ev.entryEndpoint || 'unknown';
98
+ if (!snap.providers.byEntryEndpoint[entryKey]) {
99
+ snap.providers.byEntryEndpoint[entryKey] = createEmptyProviderBucket();
100
+ }
101
+ this.applyProviderUsageToBucket(snap.providers.byEntryEndpoint[entryKey], ev);
102
+ this.dirty = true;
103
+ }
104
+ getSnapshot() {
105
+ return this.snapshot;
106
+ }
107
+ reset() {
108
+ this.snapshot = createEmptySnapshot();
109
+ this.dirty = false;
110
+ }
111
+ async flushToDisk() {
112
+ if (!this.persistPath || !this.dirty || this.flushInFlight) {
113
+ return;
114
+ }
115
+ this.flushInFlight = true;
116
+ try {
117
+ const dir = path.dirname(this.persistPath);
118
+ await fs.mkdir(dir, { recursive: true });
119
+ const payload = JSON.stringify(this.snapshot, null, 2);
120
+ await fs.writeFile(this.persistPath, payload, 'utf-8');
121
+ this.dirty = false;
122
+ }
123
+ catch {
124
+ // ignore persistence errors
125
+ }
126
+ finally {
127
+ this.flushInFlight = false;
128
+ }
129
+ }
130
+ applyRouterHitToBucket(bucket, ev) {
131
+ bucket.requestCount += 1;
132
+ if (ev.pool) {
133
+ bucket.poolHitCount[ev.pool] = (bucket.poolHitCount[ev.pool] || 0) + 1;
134
+ }
135
+ if (ev.routeName) {
136
+ bucket.routeHitCount[ev.routeName] = (bucket.routeHitCount[ev.routeName] || 0) + 1;
137
+ }
138
+ if (ev.providerKey) {
139
+ bucket.providerHitCount[ev.providerKey] = (bucket.providerHitCount[ev.providerKey] || 0) + 1;
140
+ }
141
+ if (typeof ev.reason === 'string' && ev.reason.trim()) {
142
+ const reason = ev.reason.trim();
143
+ bucket.reasonHitCount[reason] = (bucket.reasonHitCount[reason] || 0) + 1;
144
+ }
145
+ if (typeof ev.selectionPenalty === 'number' && Number.isFinite(ev.selectionPenalty) && ev.selectionPenalty > 0) {
146
+ const key = String(Math.floor(ev.selectionPenalty));
147
+ bucket.penaltyHitCount[key] = (bucket.penaltyHitCount[key] || 0) + 1;
148
+ }
149
+ if (ev.stopMessageActive === true) {
150
+ bucket.stopMessageActiveCount += 1;
151
+ }
152
+ }
153
+ applyProviderUsageToBucket(bucket, ev) {
154
+ bucket.requestCount += 1;
155
+ if (ev.success) {
156
+ bucket.successCount += 1;
157
+ }
158
+ else {
159
+ bucket.errorCount += 1;
160
+ }
161
+ if (Number.isFinite(ev.latencyMs) && ev.latencyMs >= 0) {
162
+ bucket.latencySumMs += ev.latencyMs;
163
+ if (ev.latencyMs < bucket.minLatencyMs) {
164
+ bucket.minLatencyMs = ev.latencyMs;
165
+ }
166
+ if (ev.latencyMs > bucket.maxLatencyMs) {
167
+ bucket.maxLatencyMs = ev.latencyMs;
168
+ }
169
+ }
170
+ if (typeof ev.promptTokens === 'number' && Number.isFinite(ev.promptTokens)) {
171
+ bucket.usage.promptTokens += Math.max(0, ev.promptTokens);
172
+ }
173
+ if (typeof ev.completionTokens === 'number' && Number.isFinite(ev.completionTokens)) {
174
+ bucket.usage.completionTokens += Math.max(0, ev.completionTokens);
175
+ }
176
+ if (typeof ev.totalTokens === 'number' && Number.isFinite(ev.totalTokens)) {
177
+ bucket.usage.totalTokens += Math.max(0, ev.totalTokens);
178
+ }
179
+ else {
180
+ const derivedTotal = (typeof ev.promptTokens === 'number' ? Math.max(0, ev.promptTokens) : 0) +
181
+ (typeof ev.completionTokens === 'number' ? Math.max(0, ev.completionTokens) : 0);
182
+ bucket.usage.totalTokens += derivedTotal;
183
+ }
184
+ }
185
+ }
186
+ let instance = null;
187
+ function resolveEnableFlag(defaultValue) {
188
+ const raw = process.env.ROUTECODEX_STATS;
189
+ if (!raw)
190
+ return defaultValue;
191
+ const normalized = raw.trim().toLowerCase();
192
+ if (['1', 'true', 'yes', 'on'].includes(normalized))
193
+ return true;
194
+ if (['0', 'false', 'no', 'off'].includes(normalized))
195
+ return false;
196
+ return defaultValue;
197
+ }
198
+ function printStatsToConsole(snapshot) {
199
+ const router = snapshot.router;
200
+ const providers = snapshot.providers;
201
+ const totalRequests = router.global.requestCount;
202
+ const poolEntries = Object.entries(router.global.poolHitCount);
203
+ const providerEntries = Object.entries(router.global.providerHitCount);
204
+ const reasonEntries = Object.entries(router.global.reasonHitCount);
205
+ // Router summary
206
+ // eslint-disable-next-line no-console
207
+ console.log('[stats] Virtual Router:');
208
+ // eslint-disable-next-line no-console
209
+ console.log(` total requests: ${totalRequests}`);
210
+ if (poolEntries.length) {
211
+ // eslint-disable-next-line no-console
212
+ console.log(' pools:');
213
+ for (const [pool, count] of poolEntries) {
214
+ const ratio = totalRequests > 0 ? (count / totalRequests) * 100 : 0;
215
+ // eslint-disable-next-line no-console
216
+ console.log(` ${pool}: ${count} (${ratio.toFixed(2)}%)`);
217
+ }
218
+ }
219
+ if (providerEntries.length) {
220
+ // eslint-disable-next-line no-console
221
+ console.log(' top providers:');
222
+ const sorted = providerEntries.sort((a, b) => b[1] - a[1]).slice(0, 5);
223
+ for (const [providerKey, count] of sorted) {
224
+ // eslint-disable-next-line no-console
225
+ console.log(` ${providerKey}: ${count}`);
226
+ }
227
+ }
228
+ if (reasonEntries.length) {
229
+ // eslint-disable-next-line no-console
230
+ console.log(' top reasons:');
231
+ const sortedReasons = reasonEntries.sort((a, b) => b[1] - a[1]).slice(0, 5);
232
+ for (const [reason, count] of sortedReasons) {
233
+ // eslint-disable-next-line no-console
234
+ console.log(` ${reason}: ${count}`);
235
+ }
236
+ }
237
+ if (router.global.stopMessageActiveCount > 0) {
238
+ // eslint-disable-next-line no-console
239
+ console.log(` stopMessage-active hits: ${router.global.stopMessageActiveCount}`);
240
+ }
241
+ const globalProvider = providers.global;
242
+ const totalProviderRequests = globalProvider.requestCount;
243
+ const avgLatency = globalProvider.successCount > 0 ? globalProvider.latencySumMs / globalProvider.successCount : 0;
244
+ // Provider summary
245
+ // eslint-disable-next-line no-console
246
+ console.log('\n[stats] Providers:');
247
+ // eslint-disable-next-line no-console
248
+ console.log(` total requests : ${totalProviderRequests} (success=${globalProvider.successCount}, error=${globalProvider.errorCount})`);
249
+ // eslint-disable-next-line no-console
250
+ console.log(` avg latency : ${avgLatency.toFixed(1)} ms`);
251
+ // eslint-disable-next-line no-console
252
+ console.log(` total tokens : prompt=${globalProvider.usage.promptTokens} completion=${globalProvider.usage.completionTokens} total=${globalProvider.usage.totalTokens}`);
253
+ }
254
+ export function initStatsCenter(options) {
255
+ if (instance) {
256
+ return instance;
257
+ }
258
+ const enabled = resolveEnableFlag(options?.enable ?? true);
259
+ if (!enabled) {
260
+ instance = new NoopStatsCenter();
261
+ return instance;
262
+ }
263
+ const center = new DefaultStatsCenter(options?.persistPath);
264
+ instance = center;
265
+ const autoPrint = options?.autoPrintOnExit !== false;
266
+ if (autoPrint && typeof process !== 'undefined' && typeof process.on === 'function') {
267
+ const handler = async () => {
268
+ try {
269
+ await center.flushToDisk();
270
+ }
271
+ catch {
272
+ // ignore
273
+ }
274
+ try {
275
+ const snapshot = center.getSnapshot();
276
+ printStatsToConsole(snapshot);
277
+ }
278
+ catch {
279
+ // ignore
280
+ }
281
+ };
282
+ try {
283
+ process.once('beforeExit', handler);
284
+ }
285
+ catch {
286
+ // ignore
287
+ }
288
+ try {
289
+ process.once('SIGINT', handler);
290
+ }
291
+ catch {
292
+ // ignore
293
+ }
294
+ try {
295
+ process.once('SIGTERM', handler);
296
+ }
297
+ catch {
298
+ // ignore
299
+ }
300
+ }
301
+ return instance;
302
+ }
303
+ export function getStatsCenter() {
304
+ if (!instance) {
305
+ return initStatsCenter();
306
+ }
307
+ return instance;
308
+ }
@@ -0,0 +1,2 @@
1
+ import type { ApplyPatchNormalizeAction } from './types.js';
2
+ export declare const DEFAULT_APPLY_PATCH_NORMALIZE_ACTIONS: ApplyPatchNormalizeAction[];
@@ -0,0 +1,12 @@
1
+ export const DEFAULT_APPLY_PATCH_NORMALIZE_ACTIONS = [
2
+ { action: 'raw_non_json_patch' },
3
+ { action: 'json_container_patch_fallback' },
4
+ { action: 'record_text_fields', fields: ['patch'] },
5
+ { action: 'record_conflict_patch', patchField: 'patch', fileFields: ['file', 'path', 'filepath', 'filename'] },
6
+ { action: 'record_text_fields', fields: ['diff', 'patchText', 'body', 'input', 'instructions', 'command'] },
7
+ { action: 'record_raw_envelope', field: '_raw', parseJson: true, maxDepth: 3 },
8
+ { action: 'record_structured_payload' },
9
+ { action: 'array_structured_payload' },
10
+ { action: 'raw_string_patch' },
11
+ { action: 'invalid_json_guard' }
12
+ ];
@@ -0,0 +1,2 @@
1
+ import type { ApplyPatchExtraction } from './types.js';
2
+ export declare function extractNormalizedPatch(value: string | undefined | null): ApplyPatchExtraction;