@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.
- package/dist/build-info.js +2 -2
- package/dist/cli/commands/codex.js +37 -7
- package/dist/cli/commands/codex.js.map +1 -1
- package/dist/cli/commands/launcher/types.d.ts +1 -0
- package/dist/cli/commands/launcher-kernel.js +69 -90
- package/dist/cli/commands/launcher-kernel.js.map +1 -1
- package/dist/modules/llmswitch/bridge/module-loader.js +2 -2
- package/dist/modules/llmswitch/bridge/module-loader.js.map +1 -1
- package/dist/modules/llmswitch/bridge/quota-manager.js +1 -1
- package/dist/modules/llmswitch/bridge/quota-manager.js.map +1 -1
- package/dist/modules/llmswitch/bridge/runtime-integrations.d.ts +1 -1
- package/dist/modules/llmswitch/bridge/runtime-integrations.js.map +1 -1
- package/dist/modules/llmswitch/bridge.d.ts +5 -5
- package/dist/modules/llmswitch/bridge.js.map +1 -1
- package/dist/modules/llmswitch/core-loader.js +35 -24
- package/dist/modules/llmswitch/core-loader.js.map +1 -1
- package/dist/server/runtime/http-server/executor/provider-response-converter.js +133 -2
- package/dist/server/runtime/http-server/executor/provider-response-converter.js.map +1 -1
- package/dist/server/runtime/http-server/executor-response.js +62 -1
- package/dist/server/runtime/http-server/executor-response.js.map +1 -1
- package/dist/server/runtime/http-server/session-client-route-utils.js +38 -5
- package/dist/server/runtime/http-server/session-client-route-utils.js.map +1 -1
- package/package.json +7 -8
- package/scripts/analyze-thinking-keywords.mjs +1 -1
- package/scripts/ensure-llmswitch-mode.mjs +5 -63
- package/scripts/install-global.sh +0 -46
- package/scripts/install-release.sh +4 -38
- package/scripts/install-verify.mjs +6 -25
- package/scripts/pack-mode.mjs +16 -39
- package/scripts/pack-rcc.mjs +4 -63
- package/scripts/publish-rcc.mjs +4 -59
- package/scripts/snapshot-inspect.mjs +24 -5
- package/scripts/tests/blackbox-rcc-vs-routecodex-antigravity.mjs +2 -2
- package/scripts/vendor-core.mjs +30 -9
- package/vendor/llmswitch-core/README.md +271 -0
- package/vendor/llmswitch-core/dist/bridge/routecodex-adapter.d.ts +74 -0
- package/vendor/llmswitch-core/dist/bridge/routecodex-adapter.js +229 -0
- package/vendor/llmswitch-core/dist/config-unified/enhanced-path-resolver.d.ts +5 -0
- package/vendor/llmswitch-core/dist/config-unified/enhanced-path-resolver.js +46 -0
- package/vendor/llmswitch-core/dist/config-unified/unified-config.d.ts +26 -0
- package/vendor/llmswitch-core/dist/config-unified/unified-config.js +231 -0
- package/vendor/llmswitch-core/dist/conversion/args-mapping.d.ts +18 -0
- package/vendor/llmswitch-core/dist/conversion/args-mapping.js +8 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-actions.d.ts +39 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-actions.js +82 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-id-utils.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-id-utils.js +13 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-instructions.d.ts +1 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-instructions.js +17 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-message-utils.d.ts +23 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-message-utils.js +45 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-metadata.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-metadata.js +5 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-policies.d.ts +18 -0
- package/vendor/llmswitch-core/dist/conversion/bridge-policies.js +11 -0
- package/vendor/llmswitch-core/dist/conversion/codec-registry.d.ts +10 -0
- package/vendor/llmswitch-core/dist/conversion/codec-registry.js +37 -0
- package/vendor/llmswitch-core/dist/conversion/codecs/anthropic-openai-codec.d.ts +22 -0
- package/vendor/llmswitch-core/dist/conversion/codecs/anthropic-openai-codec.js +52 -0
- package/vendor/llmswitch-core/dist/conversion/codecs/gemini-openai-codec.d.ts +17 -0
- package/vendor/llmswitch-core/dist/conversion/codecs/gemini-openai-codec.js +85 -0
- package/vendor/llmswitch-core/dist/conversion/codecs/openai-openai-codec.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/codecs/openai-openai-codec.js +54 -0
- package/vendor/llmswitch-core/dist/conversion/codecs/responses-openai-codec.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/codecs/responses-openai-codec.js +66 -0
- package/vendor/llmswitch-core/dist/conversion/compaction-detect.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/compaction-detect.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-system-prompt.d.ts +4 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-system-prompt.js +42 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-user-id.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/anthropic-claude-code-user-id.js +30 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-cache.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-cache.js +8 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-prepare.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/antigravity-thought-signature-prepare.js +26 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/apply-patch-fixer.d.ts +1 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/apply-patch-fixer.js +30 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/auto-thinking.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/auto-thinking.js +26 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/claude-thinking-tools.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/claude-thinking-tools.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-request.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-request.js +62 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-response.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/deepseek-web-response.js +114 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/field-mapping.d.ts +14 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/field-mapping.js +155 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-cli-request.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-cli-request.js +27 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-web-search.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/gemini-web-search.js +24 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-history-image-trim.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-history-image-trim.js +54 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-image-content.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-image-content.js +54 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-native-compat.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-native-compat.js +34 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-tool-extraction.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-tool-extraction.js +35 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-vision-prompt.d.ts +11 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-vision-prompt.js +104 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-web-search.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/glm-web-search.js +30 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/harvest-tool-calls-from-text.d.ts +15 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/harvest-tool-calls-from-text.js +124 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-cli-defaults.d.ts +10 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-cli-defaults.js +31 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.js +25 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.js +46 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-native-compat.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-native-compat.js +36 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-response-body-unwrap.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-response-body-unwrap.js +25 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-tool-text-fallback.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-tool-text-fallback.js +29 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-web-search.d.ts +18 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/iflow-web-search.js +49 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/index.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/index.js +2 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-fc-ids.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-fc-ids.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-input-stringify.d.ts +14 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/lmstudio-responses-input-stringify.js +125 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/normalize-tool-call-ids.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/normalize-tool-call-ids.js +10 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/qwen-transform.d.ts +4 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/qwen-transform.js +40 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/request-rules.d.ts +24 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/request-rules.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/response-blacklist.d.ts +10 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/response-blacklist.js +10 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/response-normalize.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/response-normalize.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/response-validate.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/response-validate.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/snapshot.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/snapshot.js +21 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/strip-orphan-function-calls-tag.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/strip-orphan-function-calls-tag.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-schema.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-schema.js +91 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-text-request-guidance.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/tool-text-request-guidance.js +7 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/universal-shape-filter.d.ts +57 -0
- package/vendor/llmswitch-core/dist/conversion/compat/actions/universal-shape-filter.js +14 -0
- package/vendor/llmswitch-core/dist/conversion/compat/antigravity-session-signature.d.ts +86 -0
- package/vendor/llmswitch-core/dist/conversion/compat/antigravity-session-signature.js +1143 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/anthropic-claude-code.json +17 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-claude-code.json +18 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-deepseek-web.json +47 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-gemini-cli.json +23 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-gemini.json +31 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-glm.json +405 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-iflow.json +353 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-lmstudio.json +80 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/chat-qwen.json +22 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/responses-c4m.json +45 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/responses-crs.json +15 -0
- package/vendor/llmswitch-core/dist/conversion/compat/profiles/responses-output2choices-test.json +12 -0
- package/vendor/llmswitch-core/dist/conversion/config/config-manager.d.ts +212 -0
- package/vendor/llmswitch-core/dist/conversion/config/config-manager.js +310 -0
- package/vendor/llmswitch-core/dist/conversion/config/sample-config.json +314 -0
- package/vendor/llmswitch-core/dist/conversion/config/version-switch.json +150 -0
- package/vendor/llmswitch-core/dist/conversion/hub/config/types.d.ts +26 -0
- package/vendor/llmswitch-core/dist/conversion/hub/config/types.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/core/detour-registry.d.ts +11 -0
- package/vendor/llmswitch-core/dist/conversion/hub/core/detour-registry.js +23 -0
- package/vendor/llmswitch-core/dist/conversion/hub/core/hub-context.d.ts +23 -0
- package/vendor/llmswitch-core/dist/conversion/hub/core/hub-context.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/core/index.d.ts +4 -0
- package/vendor/llmswitch-core/dist/conversion/hub/core/index.js +3 -0
- package/vendor/llmswitch-core/dist/conversion/hub/core/stage-driver.d.ts +30 -0
- package/vendor/llmswitch-core/dist/conversion/hub/core/stage-driver.js +33 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/anthropic-format-adapter.d.ts +16 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/anthropic-format-adapter.js +42 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/chat-format-adapter.d.ts +17 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/chat-format-adapter.js +42 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/gemini-format-adapter.d.ts +16 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/gemini-format-adapter.js +42 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/index.d.ts +21 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/index.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/responses-format-adapter.d.ts +19 -0
- package/vendor/llmswitch-core/dist/conversion/hub/format-adapters/responses-format-adapter.js +42 -0
- package/vendor/llmswitch-core/dist/conversion/hub/hub-feature.d.ts +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/hub-feature.js +26 -0
- package/vendor/llmswitch-core/dist/conversion/hub/node-support.d.ts +19 -0
- package/vendor/llmswitch-core/dist/conversion/hub/node-support.js +136 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/operation-table-runner.d.ts +18 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/operation-table-runner.js +162 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper.js +503 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/archive/chat-mapper.archive.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/archive/chat-mapper.archive.js +409 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/chat-mapper.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/chat-mapper.js +350 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper.js +1540 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.d.ts +21 -0
- package/vendor/llmswitch-core/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.js +491 -0
- package/vendor/llmswitch-core/dist/conversion/hub/ops/operations.d.ts +19 -0
- package/vendor/llmswitch-core/dist/conversion/hub/ops/operations.js +7 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-engine.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-engine.js +13 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-pipeline-executor.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-pipeline-executor.js +46 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-resolver.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-resolver.js +14 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-store.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-profile-store.js +94 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-types.d.ts +175 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/compat-types.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/native-adapter-context.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/compat/native-adapter-context.js +40 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-pipeline.d.ts +111 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-pipeline.js +1927 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-stage-timing.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/hub-stage-timing.js +211 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/session-identifiers.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/session-identifiers.js +16 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage1_format_parse/index.d.ts +10 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage1_format_parse/index.js +236 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.d.ts +24 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.js +132 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/semantic-lift.d.ts +14 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/semantic-lift.js +24 -0
- 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
- 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
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-capture-orchestration.d.ts +16 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-capture-orchestration.js +29 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-factories.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/context-factories.js +19 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/index.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/index.js +22 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.js +28 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-diagnostics.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-diagnostics.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-snapshot.d.ts +10 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/tool-output-snapshot.js +12 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/context-merge.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/context-merge.js +30 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/index.d.ts +18 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage1_semantic_map/index.js +84 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage2_format_build/index.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage2_format_build/index.js +12 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.d.ts +14 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_outbound/req_outbound_stage3_compat/index.js +45 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage1_tool_governance/index.d.ts +16 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage1_tool_governance/index.js +62 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage2_route_select/index.d.ts +17 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/req_process/req_process_stage2_route_select/index.js +35 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/index.d.ts +17 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/index.js +243 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/stream-json-sniffer.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage1_sse_decode/stream-json-sniffer.js +81 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage2_format_parse/index.d.ts +10 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage2_format_parse/index.js +50 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage3_semantic_map/index.d.ts +13 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_inbound/resp_inbound_stage3_semantic_map/index.js +25 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/chat-process-semantics-bridge.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/chat-process-semantics-bridge.js +17 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.js +103 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.d.ts +13 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.js +30 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage2_sse_stream/index.d.ts +17 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage2_sse_stream/index.js +35 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.d.ts +16 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.js +52 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage2_finalize/index.d.ts +19 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage2_finalize/index.js +40 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.d.ts +44 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.js +88 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/utils.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/stages/utils.js +27 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/target-utils.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipeline/target-utils.js +26 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipelines/inbound.d.ts +22 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipelines/inbound.js +66 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipelines/outbound.d.ts +22 -0
- package/vendor/llmswitch-core/dist/conversion/hub/pipelines/outbound.js +59 -0
- package/vendor/llmswitch-core/dist/conversion/hub/policy/policy-engine.d.ts +48 -0
- package/vendor/llmswitch-core/dist/conversion/hub/policy/policy-engine.js +269 -0
- package/vendor/llmswitch-core/dist/conversion/hub/policy/protocol-spec.d.ts +75 -0
- package/vendor/llmswitch-core/dist/conversion/hub/policy/protocol-spec.js +27 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-anthropic-alias.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-anthropic-alias.js +36 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directive-parser.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directive-parser.js +56 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directives.d.ts +24 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-directives.js +98 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-directives.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-directives.js +42 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-finalize.d.ts +14 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-finalize.js +10 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-messages.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-messages.js +10 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-orchestration.d.ts +30 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-orchestration.js +68 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-time-tag.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminder-time-tag.js +18 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminders.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-reminders.js +104 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tool-schemas.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tool-schemas.js +280 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tools.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-clock-tools.js +41 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-continue-execution.d.ts +11 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-continue-execution.js +83 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-context.d.ts +15 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-context.js +7 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-finalize.d.ts +16 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-finalize.js +11 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-orchestration.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governance-orchestration.js +49 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-control-ops.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-control-ops.js +5 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-filter-call.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-filter-call.js +18 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-merge.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-governed-merge.js +11 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-media.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-media.js +108 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-node-result.d.ts +23 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-node-result.js +24 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-pending-tool-sync.d.ts +14 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-pending-tool-sync.js +52 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-post-governed-normalization.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-post-governed-normalization.js +16 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-review.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-review.js +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-servertool-orchestration.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-servertool-orchestration.js +22 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-session-usage.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-session-usage.js +147 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-tool-normalization.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-tool-normalization.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-intent.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-intent.js +13 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-tool-schema.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search-tool-schema.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process-web-search.js +26 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process.d.ts +15 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/chat-process.js +27 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/client-inject-readiness.d.ts +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/process/client-inject-readiness.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/hub/registry.d.ts +28 -0
- package/vendor/llmswitch-core/dist/conversion/hub/registry.js +101 -0
- package/vendor/llmswitch-core/dist/conversion/hub/response/chat-response-utils.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/hub/response/chat-response-utils.js +8 -0
- package/vendor/llmswitch-core/dist/conversion/hub/response/provider-response.d.ts +51 -0
- package/vendor/llmswitch-core/dist/conversion/hub/response/provider-response.js +529 -0
- package/vendor/llmswitch-core/dist/conversion/hub/response/response-mappers.d.ts +24 -0
- package/vendor/llmswitch-core/dist/conversion/hub/response/response-mappers.js +73 -0
- package/vendor/llmswitch-core/dist/conversion/hub/response/response-runtime.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/hub/response/response-runtime.js +758 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/anthropic-mapper.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/anthropic-mapper.js +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/chat-mapper.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/chat-mapper.js +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/gemini-mapper.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/gemini-mapper.js +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/index.d.ts +4 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/index.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/responses-mapper.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/semantic-mappers/responses-mapper.js +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/snapshot-recorder.d.ts +13 -0
- package/vendor/llmswitch-core/dist/conversion/hub/snapshot-recorder.js +38 -0
- package/vendor/llmswitch-core/dist/conversion/hub/standardized-bridge.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/hub/standardized-bridge.js +16 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/engine.d.ts +24 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/engine.js +118 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/index.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/index.js +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/rules.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/rules.js +80 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/types.d.ts +38 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-governance/types.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-session-compat.d.ts +26 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-session-compat.js +86 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-surface/tool-surface-engine.d.ts +18 -0
- package/vendor/llmswitch-core/dist/conversion/hub/tool-surface/tool-surface-engine.js +574 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/chat-envelope.d.ts +79 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/chat-envelope.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/chat-schema.d.ts +112 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/chat-schema.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/errors.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/errors.js +13 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/format-envelope.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/format-envelope.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/index.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/index.js +6 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/json.d.ts +9 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/json.js +9 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/node.d.ts +31 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/node.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/standardized.d.ts +99 -0
- package/vendor/llmswitch-core/dist/conversion/hub/types/standardized.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/index.d.ts +33 -0
- package/vendor/llmswitch-core/dist/conversion/index.js +33 -0
- package/vendor/llmswitch-core/dist/conversion/jsonish.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/jsonish.js +20 -0
- package/vendor/llmswitch-core/dist/conversion/mcp-injection.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/mcp-injection.js +7 -0
- package/vendor/llmswitch-core/dist/conversion/media.d.ts +1 -0
- package/vendor/llmswitch-core/dist/conversion/media.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/metadata-passthrough.d.ts +11 -0
- package/vendor/llmswitch-core/dist/conversion/metadata-passthrough.js +20 -0
- package/vendor/llmswitch-core/dist/conversion/payload-budget.d.ts +13 -0
- package/vendor/llmswitch-core/dist/conversion/payload-budget.js +47 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/anthropic-openai-pipeline.d.ts +11 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/anthropic-openai-pipeline.js +104 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/openai-openai-pipeline.d.ts +15 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/openai-openai-pipeline.js +176 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/responses-openai-pipeline.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/responses-openai-pipeline.js +212 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/shared/openai-chat-helpers.d.ts +13 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/codecs/v2/shared/openai-chat-helpers.js +34 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/adapter-context.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/adapter-context.js +18 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/protocol-hooks.d.ts +67 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/hooks/protocol-hooks.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/index.d.ts +35 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/index.js +103 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/meta/meta-bag.d.ts +20 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/meta/meta-bag.js +81 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/schema/canonical-chat.d.ts +18 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/schema/canonical-chat.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/schema/index.d.ts +1 -0
- package/vendor/llmswitch-core/dist/conversion/pipeline/schema/index.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/protocol-field-allowlists.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/protocol-field-allowlists.js +9 -0
- package/vendor/llmswitch-core/dist/conversion/protocol-state.d.ts +4 -0
- package/vendor/llmswitch-core/dist/conversion/protocol-state.js +27 -0
- package/vendor/llmswitch-core/dist/conversion/provider-protocol-error.d.ts +17 -0
- package/vendor/llmswitch-core/dist/conversion/provider-protocol-error.js +25 -0
- package/vendor/llmswitch-core/dist/conversion/responses/responses-host-policy.d.ts +6 -0
- package/vendor/llmswitch-core/dist/conversion/responses/responses-host-policy.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/response-payload.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/response-payload.js +190 -0
- package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/types.d.ts +35 -0
- package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge/types.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge.d.ts +15 -0
- package/vendor/llmswitch-core/dist/conversion/responses/responses-openai-bridge.js +475 -0
- package/vendor/llmswitch-core/dist/conversion/runtime-metadata.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/runtime-metadata.js +31 -0
- package/vendor/llmswitch-core/dist/conversion/schema-validator.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/schema-validator.js +67 -0
- package/vendor/llmswitch-core/dist/conversion/shared/anthropic-message-utils.d.ts +22 -0
- package/vendor/llmswitch-core/dist/conversion/shared/anthropic-message-utils.js +1416 -0
- package/vendor/llmswitch-core/dist/conversion/shared/chat-envelope-validator.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/shared/chat-envelope-validator.js +4 -0
- package/vendor/llmswitch-core/dist/conversion/shared/chat-output-normalizer.d.ts +4 -0
- package/vendor/llmswitch-core/dist/conversion/shared/chat-output-normalizer.js +10 -0
- package/vendor/llmswitch-core/dist/conversion/shared/chat-request-filters.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/shared/chat-request-filters.js +63 -0
- package/vendor/llmswitch-core/dist/conversion/shared/gemini-tool-utils.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/shared/gemini-tool-utils.js +20 -0
- package/vendor/llmswitch-core/dist/conversion/shared/openai-finalizer.d.ts +8 -0
- package/vendor/llmswitch-core/dist/conversion/shared/openai-finalizer.js +22 -0
- package/vendor/llmswitch-core/dist/conversion/shared/openai-message-normalize.d.ts +1 -0
- package/vendor/llmswitch-core/dist/conversion/shared/openai-message-normalize.js +151 -0
- package/vendor/llmswitch-core/dist/conversion/shared/output-content-normalizer.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/shared/output-content-normalizer.js +26 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-mapping.d.ts +5 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-mapping.js +7 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-normalizer.d.ts +25 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-normalizer.js +114 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-normalizer.d.ts +12 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-normalizer.js +22 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-parser.d.ts +10 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-tool-parser.js +11 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-utils.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/shared/reasoning-utils.js +19 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-conversation-store.d.ts +35 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-conversation-store.js +195 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-output-builder.d.ts +13 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-output-builder.js +32 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-reasoning-registry.d.ts +24 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-reasoning-registry.js +185 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-request-adapter.d.ts +7 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-request-adapter.js +14 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-response-utils.d.ts +3 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-response-utils.js +254 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-tool-utils.d.ts +14 -0
- package/vendor/llmswitch-core/dist/conversion/shared/responses-tool-utils.js +102 -0
- package/vendor/llmswitch-core/dist/conversion/shared/streaming-text-extractor.d.ts +19 -0
- package/vendor/llmswitch-core/dist/conversion/shared/streaming-text-extractor.js +39 -0
- package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer/normalize.d.ts +2 -0
- package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer/normalize.js +116 -0
- package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer.d.ts +4 -0
- package/vendor/llmswitch-core/dist/conversion/shared/text-markup-normalizer.js +3 -0
- package/vendor/llmswitch-core/dist/conversion/shared/thought-signature-validator.d.ts +52 -0
- package/vendor/llmswitch-core/dist/conversion/shared/thought-signature-validator.js +58 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-argument-repairer.d.ts +39 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-argument-repairer.js +53 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-call-id-manager.d.ts +109 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-call-id-manager.js +202 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-call-utils.d.ts +11 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-call-utils.js +14 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-filter-pipeline.d.ts +21 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-filter-pipeline.js +171 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-governor.d.ts +29 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-governor.js +694 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-harvester.d.ts +31 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-harvester.js +23 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-mapping.d.ts +19 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tool-mapping.js +65 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tooling.d.ts +29 -0
- package/vendor/llmswitch-core/dist/conversion/shared/tooling.js +57 -0
- package/vendor/llmswitch-core/dist/conversion/snapshot-utils.d.ts +31 -0
- package/vendor/llmswitch-core/dist/conversion/snapshot-utils.js +49 -0
- package/vendor/llmswitch-core/dist/conversion/types/bridge-message-types.d.ts +41 -0
- package/vendor/llmswitch-core/dist/conversion/types/bridge-message-types.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/types/text-markup-normalizer.d.ts +13 -0
- package/vendor/llmswitch-core/dist/conversion/types/text-markup-normalizer.js +1 -0
- package/vendor/llmswitch-core/dist/conversion/types.d.ts +33 -0
- package/vendor/llmswitch-core/dist/conversion/types.js +1 -0
- package/vendor/llmswitch-core/dist/filters/builtin/add-fields-filter.d.ts +8 -0
- package/vendor/llmswitch-core/dist/filters/builtin/add-fields-filter.js +16 -0
- package/vendor/llmswitch-core/dist/filters/builtin/blacklist-filter.d.ts +8 -0
- package/vendor/llmswitch-core/dist/filters/builtin/blacklist-filter.js +19 -0
- package/vendor/llmswitch-core/dist/filters/builtin/whitelist-filter.d.ts +8 -0
- package/vendor/llmswitch-core/dist/filters/builtin/whitelist-filter.js +19 -0
- package/vendor/llmswitch-core/dist/filters/config/openai-openai.fieldmap.json +18 -0
- package/vendor/llmswitch-core/dist/filters/engine.d.ts +16 -0
- package/vendor/llmswitch-core/dist/filters/engine.js +167 -0
- package/vendor/llmswitch-core/dist/filters/index.d.ts +18 -0
- package/vendor/llmswitch-core/dist/filters/index.js +22 -0
- package/vendor/llmswitch-core/dist/filters/special/request-tool-choice-policy.d.ts +11 -0
- package/vendor/llmswitch-core/dist/filters/special/request-tool-choice-policy.js +29 -0
- package/vendor/llmswitch-core/dist/filters/special/request-tool-list-filter.d.ts +11 -0
- package/vendor/llmswitch-core/dist/filters/special/request-tool-list-filter.js +322 -0
- package/vendor/llmswitch-core/dist/filters/special/request-toolcalls-stringify.d.ts +13 -0
- package/vendor/llmswitch-core/dist/filters/special/request-toolcalls-stringify.js +94 -0
- package/vendor/llmswitch-core/dist/filters/special/request-tools-normalize.d.ts +11 -0
- package/vendor/llmswitch-core/dist/filters/special/request-tools-normalize.js +114 -0
- package/vendor/llmswitch-core/dist/filters/special/response-finish-invariants.d.ts +11 -0
- package/vendor/llmswitch-core/dist/filters/special/response-finish-invariants.js +30 -0
- package/vendor/llmswitch-core/dist/filters/special/response-openai-to-responses-bridge.d.ts +13 -0
- package/vendor/llmswitch-core/dist/filters/special/response-openai-to-responses-bridge.js +24 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-blacklist.d.ts +12 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-blacklist.js +63 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-schema-converge.d.ts +13 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-schema-converge.js +63 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-stringify.d.ts +9 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-stringify.js +132 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-whitelist.d.ts +11 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-arguments-whitelist.js +56 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-text-canonicalize.d.ts +13 -0
- package/vendor/llmswitch-core/dist/filters/special/response-tool-text-canonicalize.js +16 -0
- package/vendor/llmswitch-core/dist/filters/special/tool-filter-hooks.d.ts +19 -0
- package/vendor/llmswitch-core/dist/filters/special/tool-filter-hooks.js +394 -0
- package/vendor/llmswitch-core/dist/filters/special/tool-post-constraints.d.ts +31 -0
- package/vendor/llmswitch-core/dist/filters/special/tool-post-constraints.js +120 -0
- package/vendor/llmswitch-core/dist/filters/types.d.ts +68 -0
- package/vendor/llmswitch-core/dist/filters/types.js +3 -0
- package/vendor/llmswitch-core/dist/filters/utils/fieldmap-loader.d.ts +2 -0
- package/vendor/llmswitch-core/dist/filters/utils/fieldmap-loader.js +16 -0
- package/vendor/llmswitch-core/dist/filters/utils/snapshot-writer.d.ts +10 -0
- package/vendor/llmswitch-core/dist/filters/utils/snapshot-writer.js +85 -0
- package/vendor/llmswitch-core/dist/guidance/index.d.ts +3 -0
- package/vendor/llmswitch-core/dist/guidance/index.js +299 -0
- package/vendor/llmswitch-core/dist/http/sse-response.d.ts +22 -0
- package/vendor/llmswitch-core/dist/http/sse-response.js +103 -0
- package/vendor/llmswitch-core/dist/index.d.ts +11 -0
- package/vendor/llmswitch-core/dist/index.js +11 -0
- package/vendor/llmswitch-core/dist/native/router_hotpath_napi.node +0 -0
- package/vendor/llmswitch-core/dist/quota/apikey-reset.d.ts +17 -0
- package/vendor/llmswitch-core/dist/quota/apikey-reset.js +43 -0
- package/vendor/llmswitch-core/dist/quota/index.d.ts +2 -0
- package/vendor/llmswitch-core/dist/quota/index.js +1 -0
- package/vendor/llmswitch-core/dist/quota/quota-manager.d.ts +44 -0
- package/vendor/llmswitch-core/dist/quota/quota-manager.js +463 -0
- package/vendor/llmswitch-core/dist/quota/quota-state.d.ts +6 -0
- package/vendor/llmswitch-core/dist/quota/quota-state.js +191 -0
- package/vendor/llmswitch-core/dist/quota/types.d.ts +62 -0
- package/vendor/llmswitch-core/dist/quota/types.js +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/auth-utils.d.ts +6 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/auth-utils.js +288 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/claude-code-helpers.d.ts +11 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/claude-code-helpers.js +18 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-defaults.d.ts +5 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-defaults.js +13 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-normalizers.d.ts +4 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/config-normalizers.js +106 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/profile-builder.d.ts +8 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/profile-builder.js +87 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/provider-normalization.d.ts +44 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/provider-normalization.js +272 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/responses-helpers.d.ts +15 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/responses-helpers.js +65 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/routing-config.d.ts +24 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/routing-config.js +346 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/streaming-helpers.d.ts +19 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/streaming-helpers.js +172 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/utils.d.ts +5 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/utils.js +41 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/web-search-config.d.ts +4 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap/web-search-config.js +156 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/bootstrap.js +329 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/classifier.d.ts +10 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/classifier.js +187 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/context-advisor.d.ts +23 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/context-advisor.js +67 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/context-weighted.d.ts +31 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/context-weighted.js +54 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/default-thinking-keywords.d.ts +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/default-thinking-keywords.js +13 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/antigravity/alias-lease.d.ts +33 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/antigravity/alias-lease.js +257 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/cooldown-manager.d.ts +34 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/cooldown-manager.js +118 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/health/index.d.ts +23 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/health/index.js +724 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/provider-key/parse.d.ts +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/provider-key/parse.js +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/route-analytics.d.ts +28 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/route-analytics.js +44 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-pools/index.d.ts +13 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-pools/index.js +386 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/keys.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/keys.js +30 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/metadata.d.ts +6 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/metadata.js +132 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/store.d.ts +10 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/routing-state/store.js +156 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/sticky-session-manager.d.ts +29 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine/sticky-session-manager.js +55 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-health.d.ts +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-health.js +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/config.d.ts +11 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/config.js +108 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/direct-model.d.ts +10 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/direct-model.js +38 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/health.d.ts +13 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/health.js +104 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/helpers.d.ts +16 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/helpers.js +226 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/route-utils.d.ts +19 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/route-utils.js +212 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-core.d.ts +28 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-core.js +112 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-state.d.ts +16 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/selection-state.js +187 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/state-accessors.d.ts +21 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy/state-accessors.js +118 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy.d.ts +123 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-legacy.js +245 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-logging.d.ts +67 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-logging.js +356 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/alias-selection.d.ts +15 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/alias-selection.js +118 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/context-weight-multipliers.d.ts +11 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/context-weight-multipliers.js +23 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/direct-provider-model.d.ts +9 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/direct-provider-model.js +49 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/instruction-target.d.ts +6 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/instruction-target.js +54 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/key-parsing.d.ts +8 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/key-parsing.js +47 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/multimodal-capability.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/multimodal-capability.js +26 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-directive-parser.d.ts +24 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-directive-parser.js +209 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-directives.d.ts +7 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-directives.js +121 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-orchestration-semantics.d.ts +10 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-orchestration-semantics.js +110 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-semantics.d.ts +8 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-semantics.js +281 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-time-tag-semantics.d.ts +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-time-tag-semantics.js +25 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminders-semantics.d.ts +4 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminders-semantics.js +44 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-tool-schema-semantics.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-clock-tool-schema-semantics.js +62 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governance-semantics.d.ts +49 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governance-semantics.js +552 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governed-filter-semantics.d.ts +9 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-governed-filter-semantics.js +64 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.d.ts +5 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.js +163 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-post-governed-normalization-semantics.d.ts +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-post-governed-normalization-semantics.js +49 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-servertool-orchestration-semantics.d.ts +30 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-servertool-orchestration-semantics.js +446 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-web-search-intent-semantics.d.ts +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-process-web-search-intent-semantics.js +49 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-request-filter-semantics.d.ts +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-chat-request-filter-semantics.js +54 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-compat-action-semantics.d.ts +22 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-compat-action-semantics.js +559 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-deepseek-web-compat.d.ts +17 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-deepseek-web-compat.js +26 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics.d.ts +276 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics.js +1291 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.d.ts +72 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.js +405 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.d.ts +18 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.js +333 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-governance-semantics.d.ts +30 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-governance-semantics.js +202 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-inbound-outbound-semantics.d.ts +22 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-inbound-outbound-semantics.js +426 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics.d.ts +57 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics.js +705 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.d.ts +53 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.js +598 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics.d.ts +147 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics.js +570 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-process-semantics.d.ts +26 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-process-semantics.js +148 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics.d.ts +46 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics.js +755 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-semantic-mappers.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-semantic-mappers.js +83 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-session-identifiers-semantics.d.ts +11 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-session-identifiers-semantics.js +207 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-target-semantics.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-hub-pipeline-target-semantics.js +128 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-analysis.d.ts +57 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-analysis.js +217 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-loader.d.ts +5 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-loader.js +464 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-policy.d.ts +5 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-policy.js +18 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-quota-buckets.d.ts +25 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath-quota-buckets.js +85 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath.d.ts +59 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-router-hotpath.js +117 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.d.ts +243 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.js +2594 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-snapshot-hooks.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-snapshot-hooks.js +109 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-alias-selection-semantics.d.ts +16 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-alias-selection-semantics.js +96 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-engine-proxy.d.ts +16 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-engine-proxy.js +14 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-routing-instructions-semantics.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-routing-instructions-semantics.js +123 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-actions-semantics.d.ts +6 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-actions-semantics.js +85 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-semantics.d.ts +9 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-semantics.js +70 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-state-semantics.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/native-virtual-router-stop-message-state-semantics.js +76 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/route-utils.d.ts +15 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/route-utils.js +248 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/routing-state-filter.d.ts +4 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/routing-state-filter.js +50 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/selection-deps.d.ts +58 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/selection-deps.js +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/sticky-pool.d.ts +11 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/sticky-pool.js +109 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-load-balancing.d.ts +16 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-load-balancing.js +120 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-priority.d.ts +11 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-priority.js +55 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-session-lease.d.ts +10 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-session-lease.js +231 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-target-split.d.ts +4 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-antigravity-target-split.js +43 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-quota-integration.d.ts +29 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-quota-integration.js +194 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-select.d.ts +22 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection-select.js +352 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection/tier-selection.js +309 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection.d.ts +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine-selection.js +1 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine.d.ts +43 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/engine.js +360 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/error-center.d.ts +10 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/error-center.js +39 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/features.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/features.js +124 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/health-manager.d.ts +23 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/health-manager.js +107 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/health-weighted.d.ts +25 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/health-weighted.js +63 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/load-balancer.d.ts +28 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/load-balancer.js +160 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/message-utils.d.ts +15 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/message-utils.js +235 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/pre-command-file-resolver.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/pre-command-file-resolver.js +117 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/provider-registry.d.ts +17 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/provider-registry.js +145 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/clean.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/clean.js +34 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/parse.d.ts +6 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/parse.js +24 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/state.d.ts +4 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/state.js +284 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/types.d.ts +74 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions/types.js +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions.d.ts +5 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-instructions.js +4 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-actions.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-actions.js +26 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-parser.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-parser.js +85 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-state-codec.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-pre-command-state-codec.js +24 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-actions.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-actions.js +99 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-parser.d.ts +3 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-parser.js +19 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-state-codec.d.ts +7 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/routing-stop-message-state-codec.js +121 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/sticky-session-store.d.ts +8 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/sticky-session-store.js +296 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-file-resolver.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-file-resolver.js +76 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-stage-template-files.d.ts +12 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-stage-template-files.js +67 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-state-sync.d.ts +17 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/stop-message-state-sync.js +82 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/success-center.d.ts +10 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/success-center.js +32 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/token-counter.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/token-counter.js +148 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/token-estimator.d.ts +2 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/token-estimator.js +16 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/token-file-scanner.d.ts +24 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/token-file-scanner.js +117 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/tool-signals.d.ts +19 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/tool-signals.js +647 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/types.d.ts +681 -0
- package/vendor/llmswitch-core/dist/router/virtual-router/types.js +34 -0
- package/vendor/llmswitch-core/dist/runtime/user-data-paths.d.ts +5 -0
- package/vendor/llmswitch-core/dist/runtime/user-data-paths.js +43 -0
- package/vendor/llmswitch-core/dist/servertool/clock/config.d.ts +17 -0
- package/vendor/llmswitch-core/dist/servertool/clock/config.js +48 -0
- package/vendor/llmswitch-core/dist/servertool/clock/daemon.d.ts +24 -0
- package/vendor/llmswitch-core/dist/servertool/clock/daemon.js +207 -0
- package/vendor/llmswitch-core/dist/servertool/clock/io.d.ts +2 -0
- package/vendor/llmswitch-core/dist/servertool/clock/io.js +14 -0
- package/vendor/llmswitch-core/dist/servertool/clock/log.d.ts +3 -0
- package/vendor/llmswitch-core/dist/servertool/clock/log.js +13 -0
- package/vendor/llmswitch-core/dist/servertool/clock/ntp.d.ts +18 -0
- package/vendor/llmswitch-core/dist/servertool/clock/ntp.js +318 -0
- package/vendor/llmswitch-core/dist/servertool/clock/paths.d.ts +5 -0
- package/vendor/llmswitch-core/dist/servertool/clock/paths.js +28 -0
- package/vendor/llmswitch-core/dist/servertool/clock/recurrence.d.ts +7 -0
- package/vendor/llmswitch-core/dist/servertool/clock/recurrence.js +248 -0
- package/vendor/llmswitch-core/dist/servertool/clock/session-scope.d.ts +3 -0
- package/vendor/llmswitch-core/dist/servertool/clock/session-scope.js +41 -0
- package/vendor/llmswitch-core/dist/servertool/clock/session-store.d.ts +3 -0
- package/vendor/llmswitch-core/dist/servertool/clock/session-store.js +63 -0
- package/vendor/llmswitch-core/dist/servertool/clock/state.d.ts +9 -0
- package/vendor/llmswitch-core/dist/servertool/clock/state.js +135 -0
- package/vendor/llmswitch-core/dist/servertool/clock/task-store.d.ts +5 -0
- package/vendor/llmswitch-core/dist/servertool/clock/task-store.js +4 -0
- package/vendor/llmswitch-core/dist/servertool/clock/tasks.d.ts +24 -0
- package/vendor/llmswitch-core/dist/servertool/clock/tasks.js +595 -0
- package/vendor/llmswitch-core/dist/servertool/clock/types.d.ts +98 -0
- package/vendor/llmswitch-core/dist/servertool/clock/types.js +1 -0
- package/vendor/llmswitch-core/dist/servertool/continue-execution/log.d.ts +3 -0
- package/vendor/llmswitch-core/dist/servertool/continue-execution/log.js +13 -0
- package/vendor/llmswitch-core/dist/servertool/engine.d.ts +38 -0
- package/vendor/llmswitch-core/dist/servertool/engine.js +1660 -0
- package/vendor/llmswitch-core/dist/servertool/followup-shadow.d.ts +16 -0
- package/vendor/llmswitch-core/dist/servertool/followup-shadow.js +145 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/antigravity-thought-signature-bootstrap.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/antigravity-thought-signature-bootstrap.js +225 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/apply-patch-guard.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/apply-patch-guard.js +5 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/clock-auto.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/clock-auto.js +177 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/clock.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/clock.js +544 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/compaction-detect.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/compaction-detect.js +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/continue-execution.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/continue-execution.js +110 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/exec-command-guard.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/exec-command-guard.js +10 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/followup-message-trimmer.d.ts +16 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/followup-message-trimmer.js +198 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/followup-request-builder.d.ts +25 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/followup-request-builder.js +515 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/followup-sanitize.d.ts +2 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/followup-sanitize.js +7 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/gemini-empty-reply-continue.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/gemini-empty-reply-continue.js +3 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/iflow-model-error-retry.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/iflow-model-error-retry.js +92 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/recursive-detection-guard.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/recursive-detection-guard.js +374 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/review.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/review.js +181 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/blocked-report.d.ts +16 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/blocked-report.js +407 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/iflow-followup.d.ts +44 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/iflow-followup.js +816 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/routing-state.d.ts +28 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/routing-state.js +123 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/runtime-utils.d.ts +81 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto/runtime-utils.js +355 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto.d.ts +1 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/stop-message-auto.js +553 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/vision.d.ts +7 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/vision.js +240 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/web-search.d.ts +7 -0
- package/vendor/llmswitch-core/dist/servertool/handlers/web-search.js +926 -0
- package/vendor/llmswitch-core/dist/servertool/log/progress-file.d.ts +14 -0
- package/vendor/llmswitch-core/dist/servertool/log/progress-file.js +88 -0
- package/vendor/llmswitch-core/dist/servertool/pending-session.d.ts +19 -0
- package/vendor/llmswitch-core/dist/servertool/pending-session.js +99 -0
- package/vendor/llmswitch-core/dist/servertool/pre-command-hooks.d.ts +17 -0
- package/vendor/llmswitch-core/dist/servertool/pre-command-hooks.js +491 -0
- package/vendor/llmswitch-core/dist/servertool/reenter-backend.d.ts +23 -0
- package/vendor/llmswitch-core/dist/servertool/reenter-backend.js +20 -0
- package/vendor/llmswitch-core/dist/servertool/registry.d.ts +35 -0
- package/vendor/llmswitch-core/dist/servertool/registry.js +92 -0
- package/vendor/llmswitch-core/dist/servertool/server-side-tools.d.ts +15 -0
- package/vendor/llmswitch-core/dist/servertool/server-side-tools.js +898 -0
- package/vendor/llmswitch-core/dist/servertool/stop-gateway-context.d.ts +14 -0
- package/vendor/llmswitch-core/dist/servertool/stop-gateway-context.js +167 -0
- package/vendor/llmswitch-core/dist/servertool/stop-message-compare-context.d.ts +24 -0
- package/vendor/llmswitch-core/dist/servertool/stop-message-compare-context.js +133 -0
- package/vendor/llmswitch-core/dist/servertool/strip-servertool-calls.d.ts +2 -0
- package/vendor/llmswitch-core/dist/servertool/strip-servertool-calls.js +75 -0
- package/vendor/llmswitch-core/dist/servertool/types.d.ts +235 -0
- package/vendor/llmswitch-core/dist/servertool/types.js +1 -0
- package/vendor/llmswitch-core/dist/sse/index.d.ts +176 -0
- package/vendor/llmswitch-core/dist/sse/index.js +142 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/anthropic-json-to-sse-converter.d.ts +15 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/anthropic-json-to-sse-converter.js +112 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/chat-json-to-sse-converter.d.ts +80 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/chat-json-to-sse-converter.js +300 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/chat.d.ts +55 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/chat.js +233 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/responses.d.ts +103 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/event-generators/responses.js +703 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/gemini-json-to-sse-converter.d.ts +15 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/gemini-json-to-sse-converter.js +99 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/index.d.ts +7 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/index.js +9 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/responses-json-to-sse-converter.d.ts +80 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/responses-json-to-sse-converter.js +322 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/anthropic-sequencer.d.ts +13 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/anthropic-sequencer.js +162 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/chat-sequencer.d.ts +39 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/chat-sequencer.js +264 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/gemini-sequencer.d.ts +10 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/gemini-sequencer.js +95 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/responses-sequencer.d.ts +40 -0
- package/vendor/llmswitch-core/dist/sse/json-to-sse/sequencers/responses-sequencer.js +293 -0
- package/vendor/llmswitch-core/dist/sse/registry/sse-codec-registry.d.ts +32 -0
- package/vendor/llmswitch-core/dist/sse/registry/sse-codec-registry.js +135 -0
- package/vendor/llmswitch-core/dist/sse/shared/chat-serializer.d.ts +4 -0
- package/vendor/llmswitch-core/dist/sse/shared/chat-serializer.js +40 -0
- package/vendor/llmswitch-core/dist/sse/shared/constants.d.ts +272 -0
- package/vendor/llmswitch-core/dist/sse/shared/constants.js +321 -0
- package/vendor/llmswitch-core/dist/sse/shared/reasoning-dispatcher.d.ts +10 -0
- package/vendor/llmswitch-core/dist/sse/shared/reasoning-dispatcher.js +25 -0
- package/vendor/llmswitch-core/dist/sse/shared/responses-output-normalizer.d.ts +13 -0
- package/vendor/llmswitch-core/dist/sse/shared/responses-output-normalizer.js +47 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/anthropic-event-serializer.d.ts +2 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/anthropic-event-serializer.js +9 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/base-serializer.d.ts +158 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/base-serializer.js +210 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/chat-event-serializer.d.ts +82 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/chat-event-serializer.js +275 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/gemini-event-serializer.d.ts +2 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/gemini-event-serializer.js +5 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/index.d.ts +42 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/index.js +56 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/responses-event-serializer.d.ts +131 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/responses-event-serializer.js +375 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/types.d.ts +51 -0
- package/vendor/llmswitch-core/dist/sse/shared/serializers/types.js +4 -0
- package/vendor/llmswitch-core/dist/sse/shared/utils.d.ts +254 -0
- package/vendor/llmswitch-core/dist/sse/shared/utils.js +543 -0
- package/vendor/llmswitch-core/dist/sse/shared/writer.d.ts +127 -0
- package/vendor/llmswitch-core/dist/sse/shared/writer.js +321 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/anthropic-sse-to-json-converter.d.ts +20 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/anthropic-sse-to-json-converter.js +204 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/anthropic-response-builder.d.ts +16 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/anthropic-response-builder.js +258 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/response-builder.d.ts +177 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/builders/response-builder.js +1135 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/chat-sse-to-json-converter.d.ts +119 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/chat-sse-to-json-converter.js +850 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/gemini-sse-to-json-converter.d.ts +14 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/gemini-sse-to-json-converter.js +186 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/index.d.ts +7 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/index.js +9 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/parsers/sse-parser.d.ts +73 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/parsers/sse-parser.js +434 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/responses-sse-to-json-converter.d.ts +61 -0
- package/vendor/llmswitch-core/dist/sse/sse-to-json/responses-sse-to-json-converter.js +306 -0
- package/vendor/llmswitch-core/dist/sse/types/anthropic-types.d.ts +194 -0
- package/vendor/llmswitch-core/dist/sse/types/anthropic-types.js +8 -0
- package/vendor/llmswitch-core/dist/sse/types/chat-types.d.ts +321 -0
- package/vendor/llmswitch-core/dist/sse/types/chat-types.js +33 -0
- package/vendor/llmswitch-core/dist/sse/types/conversion-context.d.ts +214 -0
- package/vendor/llmswitch-core/dist/sse/types/conversion-context.js +20 -0
- package/vendor/llmswitch-core/dist/sse/types/core-interfaces.d.ts +94 -0
- package/vendor/llmswitch-core/dist/sse/types/core-interfaces.js +5 -0
- package/vendor/llmswitch-core/dist/sse/types/gemini-types.d.ts +135 -0
- package/vendor/llmswitch-core/dist/sse/types/gemini-types.js +5 -0
- package/vendor/llmswitch-core/dist/sse/types/index.d.ts +17 -0
- package/vendor/llmswitch-core/dist/sse/types/index.js +9 -0
- package/vendor/llmswitch-core/dist/sse/types/responses-types.d.ts +334 -0
- package/vendor/llmswitch-core/dist/sse/types/responses-types.js +38 -0
- package/vendor/llmswitch-core/dist/sse/types/sse-events.d.ts +181 -0
- package/vendor/llmswitch-core/dist/sse/types/sse-events.js +150 -0
- package/vendor/llmswitch-core/dist/sse/types/stream-state.d.ts +199 -0
- package/vendor/llmswitch-core/dist/sse/types/stream-state.js +44 -0
- package/vendor/llmswitch-core/dist/sse/types/utility-types.d.ts +234 -0
- package/vendor/llmswitch-core/dist/sse/types/utility-types.js +46 -0
- package/vendor/llmswitch-core/dist/telemetry/stats-center.d.ts +82 -0
- package/vendor/llmswitch-core/dist/telemetry/stats-center.js +308 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/default-actions.d.ts +2 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/default-actions.js +12 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/extract-patch.d.ts +2 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/extract-patch.js +15 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/index.d.ts +2 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/index.js +164 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/structured-builders.d.ts +7 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/structured-builders.js +85 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/types.d.ts +54 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/args-normalizer/types.js +1 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/execution-capturer.d.ts +13 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/execution-capturer.js +181 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/json/parse-loose.d.ts +3 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/json/parse-loose.js +139 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/context-diff.d.ts +1 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/context-diff.js +173 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/git-diff.d.ts +1 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/git-diff.js +138 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/looks-like-patch.d.ts +1 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/looks-like-patch.js +11 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/normalize.d.ts +3 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/patch-text/normalize.js +383 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/regression-capturer.d.ts +13 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/regression-capturer.js +113 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/structured/coercion.d.ts +3 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/structured/coercion.js +103 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/structured.d.ts +20 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/structured.js +537 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/validation/shared.d.ts +3 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/validation/shared.js +6 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/validator.d.ts +8 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch/validator.js +21 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch-structured.d.ts +1 -0
- package/vendor/llmswitch-core/dist/tools/apply-patch-structured.js +1 -0
- package/vendor/llmswitch-core/dist/tools/args-json.d.ts +1 -0
- package/vendor/llmswitch-core/dist/tools/args-json.js +204 -0
- package/vendor/llmswitch-core/dist/tools/exec-command/normalize.d.ts +17 -0
- package/vendor/llmswitch-core/dist/tools/exec-command/normalize.js +116 -0
- package/vendor/llmswitch-core/dist/tools/exec-command/regression-capturer.d.ts +11 -0
- package/vendor/llmswitch-core/dist/tools/exec-command/regression-capturer.js +144 -0
- package/vendor/llmswitch-core/dist/tools/exec-command/validator.d.ts +10 -0
- package/vendor/llmswitch-core/dist/tools/exec-command/validator.js +238 -0
- package/vendor/llmswitch-core/dist/tools/patch-regression-capturer.d.ts +1 -0
- package/vendor/llmswitch-core/dist/tools/patch-regression-capturer.js +1 -0
- package/vendor/llmswitch-core/dist/tools/tool-description-utils.d.ts +5 -0
- package/vendor/llmswitch-core/dist/tools/tool-description-utils.js +50 -0
- package/vendor/llmswitch-core/dist/tools/tool-registry.d.ts +15 -0
- package/vendor/llmswitch-core/dist/tools/tool-registry.js +253 -0
- package/vendor/llmswitch-core/package.json +189 -0
- package/scripts/link-llmswitch.mjs +0 -56
|
@@ -0,0 +1,898 @@
|
|
|
1
|
+
import { getServerToolHandler, listAutoServerToolHooks } from './registry.js';
|
|
2
|
+
import { ProviderProtocolError } from '../conversion/provider-protocol-error.js';
|
|
3
|
+
import { executeWebSearchBackendPlan } from './handlers/web-search.js';
|
|
4
|
+
import { executeVisionBackendPlan } from './handlers/vision.js';
|
|
5
|
+
import './handlers/iflow-model-error-retry.js';
|
|
6
|
+
import './handlers/antigravity-thought-signature-bootstrap.js';
|
|
7
|
+
import './handlers/stop-message-auto.js';
|
|
8
|
+
import './handlers/clock.js';
|
|
9
|
+
import './handlers/clock-auto.js';
|
|
10
|
+
import './handlers/exec-command-guard.js';
|
|
11
|
+
import './handlers/apply-patch-guard.js';
|
|
12
|
+
import './handlers/continue-execution.js';
|
|
13
|
+
import './handlers/review.js';
|
|
14
|
+
import { runPreCommandHooks } from './pre-command-hooks.js';
|
|
15
|
+
import { readRuntimeMetadata } from '../conversion/runtime-metadata.js';
|
|
16
|
+
import { loadRoutingInstructionStateSync } from '../router/virtual-router/sticky-session-store.js';
|
|
17
|
+
function traceAutoHook(options, event) {
|
|
18
|
+
try {
|
|
19
|
+
options.onAutoHookTrace?.(event);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// best-effort trace callback
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const OPTIONAL_PRIMARY_HOOK_ORDER = ['clock_auto', 'stop_message_auto'];
|
|
26
|
+
const MANDATORY_HOOK_ORDER = [];
|
|
27
|
+
let fallbackToolCallIdSeq = 0;
|
|
28
|
+
function ensureToolCallId(record) {
|
|
29
|
+
const existing = typeof record.id === 'string' ? String(record.id).trim() : '';
|
|
30
|
+
if (existing) {
|
|
31
|
+
return existing;
|
|
32
|
+
}
|
|
33
|
+
fallbackToolCallIdSeq += 1;
|
|
34
|
+
const generated = `call_servertool_fallback_${Date.now()}_${fallbackToolCallIdSeq}`;
|
|
35
|
+
record.id = generated;
|
|
36
|
+
return generated;
|
|
37
|
+
}
|
|
38
|
+
function buildAutoHookQueues(hooks) {
|
|
39
|
+
const hookById = new Map();
|
|
40
|
+
for (const hook of hooks) {
|
|
41
|
+
if (!hook || typeof hook.id !== 'string') {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
hookById.set(hook.id, hook);
|
|
45
|
+
}
|
|
46
|
+
const consumed = new Set();
|
|
47
|
+
const optionalQueue = [];
|
|
48
|
+
for (const hook of hooks) {
|
|
49
|
+
if (hook.phase !== 'pre') {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (consumed.has(hook.id)) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
optionalQueue.push(hook);
|
|
56
|
+
consumed.add(hook.id);
|
|
57
|
+
}
|
|
58
|
+
for (const id of OPTIONAL_PRIMARY_HOOK_ORDER) {
|
|
59
|
+
const hook = hookById.get(id);
|
|
60
|
+
if (!hook || consumed.has(hook.id)) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
optionalQueue.push(hook);
|
|
64
|
+
consumed.add(hook.id);
|
|
65
|
+
}
|
|
66
|
+
for (const hook of hooks) {
|
|
67
|
+
if (consumed.has(hook.id)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
optionalQueue.push(hook);
|
|
71
|
+
consumed.add(hook.id);
|
|
72
|
+
}
|
|
73
|
+
const mandatoryQueue = [];
|
|
74
|
+
const mandatorySeen = new Set();
|
|
75
|
+
for (const id of MANDATORY_HOOK_ORDER) {
|
|
76
|
+
const hook = hookById.get(id);
|
|
77
|
+
if (!hook || mandatorySeen.has(hook.id)) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
mandatoryQueue.push(hook);
|
|
81
|
+
mandatorySeen.add(hook.id);
|
|
82
|
+
}
|
|
83
|
+
return { optionalQueue, mandatoryQueue };
|
|
84
|
+
}
|
|
85
|
+
// Extract tool calls from messages array (for Responses API and tool_governance stage)
|
|
86
|
+
function extractToolCallsFromMessagesArray(chatResponse) {
|
|
87
|
+
const messages = getArray(chatResponse.messages);
|
|
88
|
+
const calls = [];
|
|
89
|
+
for (const msg of messages) {
|
|
90
|
+
const msgObj = asObject(msg);
|
|
91
|
+
if (!msgObj)
|
|
92
|
+
continue;
|
|
93
|
+
const role = msgObj.role;
|
|
94
|
+
if (role !== 'assistant')
|
|
95
|
+
continue;
|
|
96
|
+
const toolCalls = getArray(msgObj.tool_calls);
|
|
97
|
+
for (const raw of toolCalls) {
|
|
98
|
+
const tc = asObject(raw);
|
|
99
|
+
if (!tc)
|
|
100
|
+
continue;
|
|
101
|
+
const id = ensureToolCallId(tc);
|
|
102
|
+
const fn = asObject(tc.function) ??
|
|
103
|
+
asObject(tc.functionCall) ??
|
|
104
|
+
asObject(tc.function_call);
|
|
105
|
+
const name = fn && typeof fn.name === 'string' && fn.name.trim() ? fn.name.trim() : '';
|
|
106
|
+
const rawArgs = (fn ? fn.arguments : undefined) ??
|
|
107
|
+
(fn ? fn.args : undefined) ??
|
|
108
|
+
(fn ? fn.input : undefined) ??
|
|
109
|
+
tc.arguments ??
|
|
110
|
+
tc.args ??
|
|
111
|
+
tc.input;
|
|
112
|
+
let args = '';
|
|
113
|
+
if (typeof rawArgs === 'string') {
|
|
114
|
+
args = rawArgs;
|
|
115
|
+
}
|
|
116
|
+
else if (rawArgs && typeof rawArgs === 'object') {
|
|
117
|
+
try {
|
|
118
|
+
args = JSON.stringify(rawArgs);
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
args = '';
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else if (rawArgs !== undefined && rawArgs !== null) {
|
|
125
|
+
args = String(rawArgs);
|
|
126
|
+
}
|
|
127
|
+
calls.push({ id, name, arguments: args });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return calls;
|
|
131
|
+
}
|
|
132
|
+
function normalizeFilterTokenSet(values) {
|
|
133
|
+
if (!Array.isArray(values) || values.length === 0) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
const normalized = new Set();
|
|
137
|
+
for (const raw of values) {
|
|
138
|
+
if (typeof raw !== 'string') {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const value = raw.trim().toLowerCase();
|
|
142
|
+
if (!value) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
normalized.add(value);
|
|
146
|
+
}
|
|
147
|
+
return normalized.size > 0 ? normalized : null;
|
|
148
|
+
}
|
|
149
|
+
function isNameIncluded(name, includeSet, excludeSet) {
|
|
150
|
+
const normalized = normalizeServerToolCallName(name);
|
|
151
|
+
if (includeSet && !includeSet.has(normalized)) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
if (excludeSet && excludeSet.has(normalized)) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
function normalizeServerToolCallName(name) {
|
|
160
|
+
const normalized = name.trim().toLowerCase();
|
|
161
|
+
if (normalized === 'websearch' || normalized === 'web-search') {
|
|
162
|
+
return 'web_search';
|
|
163
|
+
}
|
|
164
|
+
return normalized;
|
|
165
|
+
}
|
|
166
|
+
function readText(value) {
|
|
167
|
+
return typeof value === 'string' && value.trim() ? value.trim() : '';
|
|
168
|
+
}
|
|
169
|
+
function resolveStickyKeyFromAdapterContext(record) {
|
|
170
|
+
const runtime = readRuntimeMetadata(record);
|
|
171
|
+
const metadata = record.metadata && typeof record.metadata === 'object' && !Array.isArray(record.metadata)
|
|
172
|
+
? record.metadata
|
|
173
|
+
: undefined;
|
|
174
|
+
const explicitScope = readText(runtime?.stopMessageClientInjectSessionScope) ||
|
|
175
|
+
readText(runtime?.stopMessageClientInjectScope) ||
|
|
176
|
+
readText(record.stopMessageClientInjectSessionScope) ||
|
|
177
|
+
readText(record.stopMessageClientInjectScope);
|
|
178
|
+
if (explicitScope &&
|
|
179
|
+
(explicitScope.startsWith('tmux:') ||
|
|
180
|
+
explicitScope.startsWith('session:') ||
|
|
181
|
+
explicitScope.startsWith('conversation:'))) {
|
|
182
|
+
return explicitScope;
|
|
183
|
+
}
|
|
184
|
+
const tmuxSessionId = readText(record.clientTmuxSessionId) ||
|
|
185
|
+
readText(record.client_tmux_session_id) ||
|
|
186
|
+
readText(record.tmuxSessionId) ||
|
|
187
|
+
readText(record.tmux_session_id) ||
|
|
188
|
+
readText(runtime?.clientTmuxSessionId) ||
|
|
189
|
+
readText(runtime?.client_tmux_session_id) ||
|
|
190
|
+
readText(runtime?.tmuxSessionId) ||
|
|
191
|
+
readText(runtime?.tmux_session_id) ||
|
|
192
|
+
readText(metadata?.clientTmuxSessionId) ||
|
|
193
|
+
readText(metadata?.client_tmux_session_id) ||
|
|
194
|
+
readText(metadata?.tmuxSessionId) ||
|
|
195
|
+
readText(metadata?.tmux_session_id);
|
|
196
|
+
if (tmuxSessionId) {
|
|
197
|
+
return `tmux:${tmuxSessionId}`;
|
|
198
|
+
}
|
|
199
|
+
const sessionId = readText(record.sessionId) ||
|
|
200
|
+
readText(record.session_id) ||
|
|
201
|
+
readText(runtime?.sessionId) ||
|
|
202
|
+
readText(runtime?.session_id) ||
|
|
203
|
+
readText(metadata?.sessionId) ||
|
|
204
|
+
readText(metadata?.session_id);
|
|
205
|
+
if (sessionId) {
|
|
206
|
+
return `session:${sessionId}`;
|
|
207
|
+
}
|
|
208
|
+
const conversationId = readText(record.conversationId) ||
|
|
209
|
+
readText(record.conversation_id) ||
|
|
210
|
+
readText(runtime?.conversationId) ||
|
|
211
|
+
readText(runtime?.conversation_id) ||
|
|
212
|
+
readText(metadata?.conversationId) ||
|
|
213
|
+
readText(metadata?.conversation_id);
|
|
214
|
+
if (conversationId) {
|
|
215
|
+
return `conversation:${conversationId}`;
|
|
216
|
+
}
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
219
|
+
function extractToolCallsFromMessage(message) {
|
|
220
|
+
const toolCalls = getArray(message.tool_calls);
|
|
221
|
+
const out = [];
|
|
222
|
+
for (const raw of toolCalls) {
|
|
223
|
+
const tc = asObject(raw);
|
|
224
|
+
if (!tc)
|
|
225
|
+
continue;
|
|
226
|
+
const id = ensureToolCallId(tc);
|
|
227
|
+
const fn = asObject(tc.function) ??
|
|
228
|
+
asObject(tc.functionCall) ??
|
|
229
|
+
asObject(tc.function_call);
|
|
230
|
+
const name = fn && typeof fn.name === 'string' && String(fn.name).trim()
|
|
231
|
+
? normalizeServerToolCallName(String(fn.name))
|
|
232
|
+
: '';
|
|
233
|
+
const rawArgs = (fn ? fn.arguments : undefined) ??
|
|
234
|
+
(fn ? fn.args : undefined) ??
|
|
235
|
+
(fn ? fn.input : undefined) ??
|
|
236
|
+
tc.arguments ??
|
|
237
|
+
tc.args ??
|
|
238
|
+
tc.input;
|
|
239
|
+
let args = '';
|
|
240
|
+
if (typeof rawArgs === 'string') {
|
|
241
|
+
args = rawArgs;
|
|
242
|
+
}
|
|
243
|
+
else if (rawArgs && typeof rawArgs === 'object') {
|
|
244
|
+
try {
|
|
245
|
+
args = JSON.stringify(rawArgs);
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
args = '';
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else if (rawArgs !== undefined && rawArgs !== null) {
|
|
252
|
+
args = String(rawArgs);
|
|
253
|
+
}
|
|
254
|
+
if (!name)
|
|
255
|
+
continue;
|
|
256
|
+
out.push({ raw: tc, parsed: { id, name, arguments: args } });
|
|
257
|
+
}
|
|
258
|
+
return out;
|
|
259
|
+
}
|
|
260
|
+
function buildAssistantToolCallMessage(toolCalls) {
|
|
261
|
+
const calls = toolCalls.map((tc) => ({
|
|
262
|
+
id: tc.id,
|
|
263
|
+
type: 'function',
|
|
264
|
+
function: {
|
|
265
|
+
name: tc.name,
|
|
266
|
+
arguments: tc.arguments
|
|
267
|
+
}
|
|
268
|
+
}));
|
|
269
|
+
return { role: 'assistant', content: null, tool_calls: calls };
|
|
270
|
+
}
|
|
271
|
+
function appendToolOutput(base, toolCallId, name, content) {
|
|
272
|
+
const outputs = Array.isArray(base.tool_outputs) ? base.tool_outputs : [];
|
|
273
|
+
outputs.push({ tool_call_id: toolCallId, name, content });
|
|
274
|
+
base.tool_outputs = outputs;
|
|
275
|
+
}
|
|
276
|
+
function buildToolMessagesFromOutputs(base, allowIds) {
|
|
277
|
+
const outputs = Array.isArray(base.tool_outputs) ? base.tool_outputs : [];
|
|
278
|
+
const out = [];
|
|
279
|
+
for (const entry of outputs) {
|
|
280
|
+
if (!entry || typeof entry !== 'object')
|
|
281
|
+
continue;
|
|
282
|
+
const toolCallId = typeof entry.tool_call_id === 'string' ? String(entry.tool_call_id) : '';
|
|
283
|
+
if (!toolCallId || !allowIds.has(toolCallId))
|
|
284
|
+
continue;
|
|
285
|
+
const name = typeof entry.name === 'string' && String(entry.name).trim()
|
|
286
|
+
? String(entry.name).trim()
|
|
287
|
+
: 'tool';
|
|
288
|
+
const content = typeof entry.content === 'string' ? String(entry.content) : JSON.stringify(entry.content ?? {});
|
|
289
|
+
out.push({ role: 'tool', tool_call_id: toolCallId, name, content });
|
|
290
|
+
}
|
|
291
|
+
return out;
|
|
292
|
+
}
|
|
293
|
+
function stripToolOutputs(base) {
|
|
294
|
+
try {
|
|
295
|
+
delete base.tool_outputs;
|
|
296
|
+
}
|
|
297
|
+
catch {
|
|
298
|
+
/* ignore */
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function replaceJsonObjectInPlace(target, next) {
|
|
302
|
+
try {
|
|
303
|
+
for (const key of Object.keys(target)) {
|
|
304
|
+
delete target[key];
|
|
305
|
+
}
|
|
306
|
+
for (const [k, v] of Object.entries(next)) {
|
|
307
|
+
target[k] = v;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
// ignore
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function patchToolCallArgumentsById(chatResponse, toolCallId, argumentsText) {
|
|
315
|
+
if (!toolCallId || typeof argumentsText !== 'string') {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const choices = getArray(chatResponse.choices);
|
|
319
|
+
for (const choice of choices) {
|
|
320
|
+
const choiceObj = asObject(choice);
|
|
321
|
+
if (!choiceObj)
|
|
322
|
+
continue;
|
|
323
|
+
const message = asObject(choiceObj.message);
|
|
324
|
+
if (!message)
|
|
325
|
+
continue;
|
|
326
|
+
const toolCalls = getArray(message.tool_calls);
|
|
327
|
+
for (const toolCall of toolCalls) {
|
|
328
|
+
const record = asObject(toolCall);
|
|
329
|
+
if (!record)
|
|
330
|
+
continue;
|
|
331
|
+
const id = typeof record.id === 'string' ? String(record.id).trim() : '';
|
|
332
|
+
if (!id || id !== toolCallId) {
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
const fn = asObject(record.function);
|
|
336
|
+
if (fn) {
|
|
337
|
+
fn.arguments = argumentsText;
|
|
338
|
+
}
|
|
339
|
+
const fnCamel = asObject(record.functionCall);
|
|
340
|
+
if (fnCamel) {
|
|
341
|
+
fnCamel.arguments = argumentsText;
|
|
342
|
+
}
|
|
343
|
+
const fnSnake = asObject(record.function_call);
|
|
344
|
+
if (fnSnake) {
|
|
345
|
+
fnSnake.arguments = argumentsText;
|
|
346
|
+
}
|
|
347
|
+
if (Object.prototype.hasOwnProperty.call(record, 'arguments')) {
|
|
348
|
+
record.arguments = argumentsText;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function filterOutExecutedToolCalls(chatResponse, executedIds) {
|
|
354
|
+
const choices = getArray(chatResponse.choices);
|
|
355
|
+
for (const choice of choices) {
|
|
356
|
+
const choiceObj = asObject(choice);
|
|
357
|
+
if (!choiceObj)
|
|
358
|
+
continue;
|
|
359
|
+
const message = asObject(choiceObj.message);
|
|
360
|
+
if (!message)
|
|
361
|
+
continue;
|
|
362
|
+
const toolCalls = getArray(message.tool_calls);
|
|
363
|
+
if (!toolCalls.length)
|
|
364
|
+
continue;
|
|
365
|
+
const next = toolCalls.filter((tc) => {
|
|
366
|
+
if (!tc || typeof tc !== 'object' || Array.isArray(tc))
|
|
367
|
+
return true;
|
|
368
|
+
const id = typeof tc.id === 'string' ? String(tc.id).trim() : '';
|
|
369
|
+
if (!id)
|
|
370
|
+
return true;
|
|
371
|
+
return !executedIds.has(id);
|
|
372
|
+
});
|
|
373
|
+
message.tool_calls = next;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
export async function runServerSideToolEngine(options) {
|
|
377
|
+
const base = asObject(options.chatResponse);
|
|
378
|
+
if (!base) {
|
|
379
|
+
return { mode: 'passthrough', finalChatResponse: options.chatResponse };
|
|
380
|
+
}
|
|
381
|
+
let toolCalls = extractToolCalls(base);
|
|
382
|
+
// Fallback: Responses API and tool_governance stage use messages array instead of choices
|
|
383
|
+
if (toolCalls.length === 0) {
|
|
384
|
+
toolCalls = extractToolCallsFromMessagesArray(base);
|
|
385
|
+
}
|
|
386
|
+
if (isClientDisconnected(options.adapterContext) && toolCalls.length > 0) {
|
|
387
|
+
// When client is already disconnected, skip executing explicit tool_call servertools.
|
|
388
|
+
// Auto hooks (e.g. stop_message_auto) still need to run to keep session state consistent.
|
|
389
|
+
return { mode: 'passthrough', finalChatResponse: base };
|
|
390
|
+
}
|
|
391
|
+
const contextBase = {
|
|
392
|
+
base,
|
|
393
|
+
toolCalls,
|
|
394
|
+
adapterContext: options.adapterContext,
|
|
395
|
+
requestId: options.requestId,
|
|
396
|
+
entryEndpoint: options.entryEndpoint,
|
|
397
|
+
providerProtocol: options.providerProtocol,
|
|
398
|
+
capabilities: {
|
|
399
|
+
reenterPipeline: typeof options.reenterPipeline === 'function',
|
|
400
|
+
providerInvoker: typeof options.providerInvoker === 'function'
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
const includeToolCallNames = normalizeFilterTokenSet(options.includeToolCallHandlerNames);
|
|
404
|
+
const excludeToolCallNames = normalizeFilterTokenSet(options.excludeToolCallHandlerNames);
|
|
405
|
+
const includeAutoHookIds = normalizeFilterTokenSet(options.includeAutoHookIds);
|
|
406
|
+
const excludeAutoHookIds = normalizeFilterTokenSet(options.excludeAutoHookIds);
|
|
407
|
+
// Tool-call servertools: execute all executable servertool calls first, then decide:
|
|
408
|
+
// - if only servertools were present -> followup via reenter (existing behavior)
|
|
409
|
+
// - if mixed (servertool + client tools) -> persist servertool results, return remaining tool_calls to client
|
|
410
|
+
const executedToolCalls = [];
|
|
411
|
+
const executedIds = new Set();
|
|
412
|
+
const baseForExecution = cloneJson(base);
|
|
413
|
+
const executedFlowIds = [];
|
|
414
|
+
let lastExecution;
|
|
415
|
+
const attemptedToolCallsByMessage = [];
|
|
416
|
+
const runtimeMetadata = readRuntimeMetadata(options.adapterContext);
|
|
417
|
+
const runtimePreCommandState = (() => {
|
|
418
|
+
const stickyKey = resolveStickyKeyFromAdapterContext(options.adapterContext);
|
|
419
|
+
if (!stickyKey) {
|
|
420
|
+
return undefined;
|
|
421
|
+
}
|
|
422
|
+
try {
|
|
423
|
+
return loadRoutingInstructionStateSync(stickyKey) ?? undefined;
|
|
424
|
+
}
|
|
425
|
+
catch {
|
|
426
|
+
return undefined;
|
|
427
|
+
}
|
|
428
|
+
})();
|
|
429
|
+
const choices = getArray(base.choices);
|
|
430
|
+
for (const choice of choices) {
|
|
431
|
+
const choiceObj = asObject(choice);
|
|
432
|
+
if (!choiceObj)
|
|
433
|
+
continue;
|
|
434
|
+
const message = asObject(choiceObj.message);
|
|
435
|
+
if (!message)
|
|
436
|
+
continue;
|
|
437
|
+
attemptedToolCallsByMessage.push(...extractToolCallsFromMessage(message));
|
|
438
|
+
}
|
|
439
|
+
if (options.disableToolCallHandlers !== true) {
|
|
440
|
+
for (const { parsed: toolCall } of attemptedToolCallsByMessage) {
|
|
441
|
+
if (!isNameIncluded(toolCall.name, includeToolCallNames, excludeToolCallNames)) {
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
const preHookResult = runPreCommandHooks({
|
|
445
|
+
requestId: options.requestId,
|
|
446
|
+
entryEndpoint: options.entryEndpoint,
|
|
447
|
+
providerProtocol: options.providerProtocol,
|
|
448
|
+
toolName: toolCall.name,
|
|
449
|
+
toolCallId: toolCall.id,
|
|
450
|
+
toolArguments: toolCall.arguments,
|
|
451
|
+
preCommandState: runtimePreCommandState
|
|
452
|
+
});
|
|
453
|
+
for (const trace of preHookResult.traces) {
|
|
454
|
+
traceAutoHook(options, trace);
|
|
455
|
+
}
|
|
456
|
+
if (preHookResult.changed && preHookResult.toolArguments !== toolCall.arguments) {
|
|
457
|
+
toolCall.arguments = preHookResult.toolArguments;
|
|
458
|
+
patchToolCallArgumentsById(base, toolCall.id, preHookResult.toolArguments);
|
|
459
|
+
patchToolCallArgumentsById(baseForExecution, toolCall.id, preHookResult.toolArguments);
|
|
460
|
+
}
|
|
461
|
+
const entry = getServerToolHandler(toolCall.name);
|
|
462
|
+
if (!entry || entry.trigger !== 'tool_call') {
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
const ctx = { ...contextBase, base: baseForExecution, toolCall };
|
|
466
|
+
let planned = null;
|
|
467
|
+
let lastErr;
|
|
468
|
+
for (let attempt = 1; attempt <= 2; attempt += 1) {
|
|
469
|
+
try {
|
|
470
|
+
planned = await runHandler(entry.handler, ctx);
|
|
471
|
+
lastErr = undefined;
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
catch (err) {
|
|
475
|
+
lastErr = err;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
const result = planned ? await materializePlannedResult(planned, options) : null;
|
|
479
|
+
if (result) {
|
|
480
|
+
replaceJsonObjectInPlace(baseForExecution, cloneJson(result.chatResponse));
|
|
481
|
+
executedToolCalls.push(toolCall);
|
|
482
|
+
executedIds.add(toolCall.id);
|
|
483
|
+
if (result.execution?.flowId && typeof result.execution.flowId === 'string' && result.execution.flowId.trim()) {
|
|
484
|
+
executedFlowIds.push(result.execution.flowId.trim());
|
|
485
|
+
}
|
|
486
|
+
lastExecution = result.execution;
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
if (lastErr) {
|
|
490
|
+
// Handler failed: report tool error as a tool_output, but do not crash the whole pipeline.
|
|
491
|
+
const message = lastErr instanceof Error ? lastErr.message : String(lastErr ?? 'unknown');
|
|
492
|
+
appendToolOutput(baseForExecution, toolCall.id, toolCall.name, JSON.stringify({ ok: false, tool: toolCall.name, message, retryable: true }));
|
|
493
|
+
// Treat failed servertool calls as executed so we can emit followup with error tool_outputs.
|
|
494
|
+
executedToolCalls.push(toolCall);
|
|
495
|
+
executedIds.add(toolCall.id);
|
|
496
|
+
executedFlowIds.push(`${toolCall.name}_error`);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
if (executedToolCalls.length > 0) {
|
|
501
|
+
const clientResponse = cloneJson(base);
|
|
502
|
+
filterOutExecutedToolCalls(clientResponse, executedIds);
|
|
503
|
+
stripToolOutputs(clientResponse);
|
|
504
|
+
// Determine whether any non-executed tool_calls remain (client tools).
|
|
505
|
+
const remainingToolCalls = [];
|
|
506
|
+
const remainingChoices = getArray(clientResponse.choices);
|
|
507
|
+
for (const choice of remainingChoices) {
|
|
508
|
+
const choiceObj = asObject(choice);
|
|
509
|
+
if (!choiceObj)
|
|
510
|
+
continue;
|
|
511
|
+
const message = asObject(choiceObj.message);
|
|
512
|
+
if (!message)
|
|
513
|
+
continue;
|
|
514
|
+
const toolCallsArr = getArray(message.tool_calls);
|
|
515
|
+
for (const tc of toolCallsArr) {
|
|
516
|
+
if (!tc || typeof tc !== 'object' || Array.isArray(tc))
|
|
517
|
+
continue;
|
|
518
|
+
const id = typeof tc.id === 'string' ? String(tc.id).trim() : '';
|
|
519
|
+
if (id)
|
|
520
|
+
remainingToolCalls.push(id);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
if (remainingToolCalls.length > 0) {
|
|
524
|
+
const sessionId = options.adapterContext && typeof options.adapterContext.sessionId === 'string'
|
|
525
|
+
? String(options.adapterContext.sessionId).trim()
|
|
526
|
+
: '';
|
|
527
|
+
const allowIds = new Set(executedToolCalls.map((t) => t.id));
|
|
528
|
+
const injectionMessages = [
|
|
529
|
+
buildAssistantToolCallMessage(executedToolCalls),
|
|
530
|
+
...buildToolMessagesFromOutputs(baseForExecution, allowIds)
|
|
531
|
+
];
|
|
532
|
+
return {
|
|
533
|
+
mode: 'tool_flow',
|
|
534
|
+
finalChatResponse: clientResponse,
|
|
535
|
+
execution: { flowId: 'servertool_mixed' },
|
|
536
|
+
...(sessionId && injectionMessages.length
|
|
537
|
+
? {
|
|
538
|
+
pendingInjection: {
|
|
539
|
+
sessionId,
|
|
540
|
+
afterToolCallIds: remainingToolCalls,
|
|
541
|
+
messages: injectionMessages
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
: {})
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
// Servertool-only: keep tool_outputs and ask orchestration layer to followup/reenter.
|
|
548
|
+
const genericFollowup = {
|
|
549
|
+
requestIdSuffix: ':servertool_followup',
|
|
550
|
+
injection: {
|
|
551
|
+
ops: [
|
|
552
|
+
{ op: 'append_assistant_message', required: true },
|
|
553
|
+
{ op: 'append_tool_messages_from_tool_outputs', required: true }
|
|
554
|
+
]
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
const followup = executedToolCalls.length === 1 && lastExecution?.followup ? lastExecution.followup : genericFollowup;
|
|
558
|
+
const flowId = executedToolCalls.length === 1
|
|
559
|
+
? (lastExecution?.flowId ?? executedFlowIds[0] ?? executedToolCalls[0].name)
|
|
560
|
+
: 'servertool_multi';
|
|
561
|
+
return {
|
|
562
|
+
mode: 'tool_flow',
|
|
563
|
+
finalChatResponse: baseForExecution,
|
|
564
|
+
execution: {
|
|
565
|
+
...(lastExecution && executedToolCalls.length === 1 ? lastExecution : { flowId }),
|
|
566
|
+
flowId,
|
|
567
|
+
followup
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
const autoHookExecutionList = listAutoServerToolHooks();
|
|
572
|
+
const filteredAutoHooks = autoHookExecutionList.filter((hook) => isNameIncluded(hook.id, includeAutoHookIds, excludeAutoHookIds));
|
|
573
|
+
const { optionalQueue, mandatoryQueue } = buildAutoHookQueues(filteredAutoHooks);
|
|
574
|
+
const optionalResult = await runAutoHookQueue({
|
|
575
|
+
queueName: 'A_optional',
|
|
576
|
+
hooks: optionalQueue,
|
|
577
|
+
options,
|
|
578
|
+
contextBase: contextBase
|
|
579
|
+
});
|
|
580
|
+
if (optionalResult) {
|
|
581
|
+
return {
|
|
582
|
+
mode: 'tool_flow',
|
|
583
|
+
finalChatResponse: optionalResult.chatResponse,
|
|
584
|
+
execution: optionalResult.execution
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
const mandatoryResult = await runAutoHookQueue({
|
|
588
|
+
queueName: 'B_mandatory',
|
|
589
|
+
hooks: mandatoryQueue,
|
|
590
|
+
options,
|
|
591
|
+
contextBase: contextBase
|
|
592
|
+
});
|
|
593
|
+
if (mandatoryResult) {
|
|
594
|
+
return {
|
|
595
|
+
mode: 'tool_flow',
|
|
596
|
+
finalChatResponse: mandatoryResult.chatResponse,
|
|
597
|
+
execution: mandatoryResult.execution
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
return { mode: 'passthrough', finalChatResponse: base };
|
|
601
|
+
}
|
|
602
|
+
async function runAutoHookQueue(options) {
|
|
603
|
+
const queueTotal = options.hooks.length;
|
|
604
|
+
for (let idx = 0; idx < options.hooks.length; idx += 1) {
|
|
605
|
+
const hook = options.hooks[idx];
|
|
606
|
+
const traceBase = {
|
|
607
|
+
hookId: hook.id,
|
|
608
|
+
phase: hook.phase,
|
|
609
|
+
priority: hook.priority,
|
|
610
|
+
queue: options.queueName,
|
|
611
|
+
queueIndex: idx + 1,
|
|
612
|
+
queueTotal
|
|
613
|
+
};
|
|
614
|
+
let planned = null;
|
|
615
|
+
try {
|
|
616
|
+
planned = await runHandler(hook.handler, options.contextBase);
|
|
617
|
+
}
|
|
618
|
+
catch (error) {
|
|
619
|
+
const message = error instanceof Error ? error.message : String(error ?? 'unknown');
|
|
620
|
+
traceAutoHook(options.options, {
|
|
621
|
+
...traceBase,
|
|
622
|
+
result: 'error',
|
|
623
|
+
reason: message
|
|
624
|
+
});
|
|
625
|
+
throw error;
|
|
626
|
+
}
|
|
627
|
+
if (!planned) {
|
|
628
|
+
traceAutoHook(options.options, {
|
|
629
|
+
...traceBase,
|
|
630
|
+
result: 'miss',
|
|
631
|
+
reason: 'predicate_false'
|
|
632
|
+
});
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
const result = await materializePlannedResult(planned, options.options);
|
|
636
|
+
if (result) {
|
|
637
|
+
const flowId = result.execution && typeof result.execution.flowId === 'string' && result.execution.flowId.trim()
|
|
638
|
+
? result.execution.flowId.trim()
|
|
639
|
+
: undefined;
|
|
640
|
+
traceAutoHook(options.options, {
|
|
641
|
+
...traceBase,
|
|
642
|
+
result: 'match',
|
|
643
|
+
reason: flowId ? 'matched' : 'matched_without_flow',
|
|
644
|
+
...(flowId ? { flowId } : {})
|
|
645
|
+
});
|
|
646
|
+
return result;
|
|
647
|
+
}
|
|
648
|
+
traceAutoHook(options.options, {
|
|
649
|
+
...traceBase,
|
|
650
|
+
result: 'miss',
|
|
651
|
+
reason: 'empty_materialized_result'
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
return null;
|
|
655
|
+
}
|
|
656
|
+
async function runHandler(handler, ctx) {
|
|
657
|
+
try {
|
|
658
|
+
return await handler(ctx);
|
|
659
|
+
}
|
|
660
|
+
catch (error) {
|
|
661
|
+
const toolName = ctx && ctx.toolCall && typeof ctx.toolCall.name === 'string' && ctx.toolCall.name.trim()
|
|
662
|
+
? ctx.toolCall.name.trim()
|
|
663
|
+
: 'auto';
|
|
664
|
+
const message = error instanceof Error ? error.message : String(error ?? 'unknown');
|
|
665
|
+
const wrapped = new ProviderProtocolError(`[servertool] handler failed: ${toolName}: ${message}`, {
|
|
666
|
+
code: 'SERVERTOOL_HANDLER_FAILED',
|
|
667
|
+
category: 'INTERNAL_ERROR',
|
|
668
|
+
details: {
|
|
669
|
+
toolName,
|
|
670
|
+
requestId: ctx.requestId,
|
|
671
|
+
entryEndpoint: ctx.entryEndpoint,
|
|
672
|
+
providerProtocol: ctx.providerProtocol,
|
|
673
|
+
error: message
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
wrapped.status = 500;
|
|
677
|
+
wrapped.cause = error;
|
|
678
|
+
throw wrapped;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
async function materializePlannedResult(planned, options) {
|
|
682
|
+
if (planned && typeof planned === 'object' && !Array.isArray(planned) && typeof planned.finalize === 'function') {
|
|
683
|
+
const plan = planned;
|
|
684
|
+
const backendResult = plan.backend ? await executeBackendPlan(plan.backend, options) : undefined;
|
|
685
|
+
return await plan.finalize({ ...(backendResult ? { backendResult } : {}) });
|
|
686
|
+
}
|
|
687
|
+
return planned;
|
|
688
|
+
}
|
|
689
|
+
async function executeBackendPlan(plan, options) {
|
|
690
|
+
if (!plan)
|
|
691
|
+
return undefined;
|
|
692
|
+
if (plan.kind === 'vision_analysis') {
|
|
693
|
+
if (!options.reenterPipeline)
|
|
694
|
+
return undefined;
|
|
695
|
+
return await executeVisionBackendPlan({ plan, options });
|
|
696
|
+
}
|
|
697
|
+
if (plan.kind === 'web_search') {
|
|
698
|
+
return await executeWebSearchBackendPlan({ plan, options });
|
|
699
|
+
}
|
|
700
|
+
return undefined;
|
|
701
|
+
}
|
|
702
|
+
export function extractToolCalls(chatResponse) {
|
|
703
|
+
const choices = getArray(chatResponse.choices);
|
|
704
|
+
const calls = [];
|
|
705
|
+
for (const choice of choices) {
|
|
706
|
+
const choiceObj = asObject(choice);
|
|
707
|
+
if (!choiceObj)
|
|
708
|
+
continue;
|
|
709
|
+
const message = asObject(choiceObj.message);
|
|
710
|
+
if (!message)
|
|
711
|
+
continue;
|
|
712
|
+
const toolCalls = getArray(message.tool_calls);
|
|
713
|
+
for (const raw of toolCalls) {
|
|
714
|
+
const tc = asObject(raw);
|
|
715
|
+
if (!tc)
|
|
716
|
+
continue;
|
|
717
|
+
const id = ensureToolCallId(tc);
|
|
718
|
+
const fn = asObject(tc.function) ??
|
|
719
|
+
asObject(tc.functionCall) ??
|
|
720
|
+
asObject(tc.function_call);
|
|
721
|
+
const name = fn && typeof fn.name === 'string' && fn.name.trim() ? fn.name.trim() : '';
|
|
722
|
+
const rawArgs = (fn ? fn.arguments : undefined) ??
|
|
723
|
+
(fn ? fn.args : undefined) ??
|
|
724
|
+
(fn ? fn.input : undefined) ??
|
|
725
|
+
tc.arguments ??
|
|
726
|
+
tc.args ??
|
|
727
|
+
tc.input;
|
|
728
|
+
let args = '';
|
|
729
|
+
if (typeof rawArgs === 'string') {
|
|
730
|
+
args = rawArgs;
|
|
731
|
+
}
|
|
732
|
+
else if (rawArgs && typeof rawArgs === 'object') {
|
|
733
|
+
try {
|
|
734
|
+
args = JSON.stringify(rawArgs);
|
|
735
|
+
}
|
|
736
|
+
catch {
|
|
737
|
+
args = '';
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
else if (rawArgs !== undefined && rawArgs !== null) {
|
|
741
|
+
args = String(rawArgs);
|
|
742
|
+
}
|
|
743
|
+
if (!name)
|
|
744
|
+
continue;
|
|
745
|
+
calls.push({ id, name, arguments: args });
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
return calls;
|
|
749
|
+
}
|
|
750
|
+
function asObject(value) {
|
|
751
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : null;
|
|
752
|
+
}
|
|
753
|
+
function getArray(value) {
|
|
754
|
+
return Array.isArray(value) ? value : [];
|
|
755
|
+
}
|
|
756
|
+
export function cloneJson(value) {
|
|
757
|
+
return JSON.parse(JSON.stringify(value));
|
|
758
|
+
}
|
|
759
|
+
function isClientDisconnected(adapterContext) {
|
|
760
|
+
if (!adapterContext || typeof adapterContext !== 'object') {
|
|
761
|
+
return false;
|
|
762
|
+
}
|
|
763
|
+
const state = adapterContext.clientConnectionState;
|
|
764
|
+
if (state && typeof state === 'object' && !Array.isArray(state)) {
|
|
765
|
+
const disconnected = state.disconnected;
|
|
766
|
+
if (disconnected === true) {
|
|
767
|
+
return true;
|
|
768
|
+
}
|
|
769
|
+
if (typeof disconnected === 'string' && disconnected.trim().toLowerCase() === 'true') {
|
|
770
|
+
return true;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
const raw = adapterContext.clientDisconnected;
|
|
774
|
+
if (raw === true) {
|
|
775
|
+
return true;
|
|
776
|
+
}
|
|
777
|
+
if (typeof raw === 'string' && raw.trim().toLowerCase() === 'true') {
|
|
778
|
+
return true;
|
|
779
|
+
}
|
|
780
|
+
return false;
|
|
781
|
+
}
|
|
782
|
+
export function extractTextFromChatLike(payload) {
|
|
783
|
+
let current = payload;
|
|
784
|
+
const visited = new Set();
|
|
785
|
+
while (current && typeof current === 'object' && !Array.isArray(current) && !visited.has(current)) {
|
|
786
|
+
visited.add(current);
|
|
787
|
+
if (Array.isArray(current.choices) || Array.isArray(current.output)) {
|
|
788
|
+
break;
|
|
789
|
+
}
|
|
790
|
+
const data = current.data;
|
|
791
|
+
if (data && typeof data === 'object' && !Array.isArray(data)) {
|
|
792
|
+
current = data;
|
|
793
|
+
continue;
|
|
794
|
+
}
|
|
795
|
+
const response = current.response;
|
|
796
|
+
if (response && typeof response === 'object' && !Array.isArray(response)) {
|
|
797
|
+
current = response;
|
|
798
|
+
continue;
|
|
799
|
+
}
|
|
800
|
+
break;
|
|
801
|
+
}
|
|
802
|
+
const choices = getArray(current.choices);
|
|
803
|
+
if (!choices.length)
|
|
804
|
+
return '';
|
|
805
|
+
const first = asObject(choices[0]);
|
|
806
|
+
if (!first)
|
|
807
|
+
return '';
|
|
808
|
+
const message = asObject(first.message);
|
|
809
|
+
if (!message)
|
|
810
|
+
return '';
|
|
811
|
+
const content = message.content;
|
|
812
|
+
if (typeof content === 'string')
|
|
813
|
+
return content.trim();
|
|
814
|
+
const parts = getArray(content);
|
|
815
|
+
const texts = [];
|
|
816
|
+
for (const part of parts) {
|
|
817
|
+
if (typeof part === 'string') {
|
|
818
|
+
texts.push(part);
|
|
819
|
+
}
|
|
820
|
+
else if (part && typeof part === 'object') {
|
|
821
|
+
const record = part;
|
|
822
|
+
if (typeof record.text === 'string') {
|
|
823
|
+
texts.push(record.text);
|
|
824
|
+
}
|
|
825
|
+
else if (typeof record.content === 'string') {
|
|
826
|
+
texts.push(record.content);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
const joinedFromChoices = texts.join('\n').trim();
|
|
831
|
+
if (joinedFromChoices) {
|
|
832
|
+
return joinedFromChoices;
|
|
833
|
+
}
|
|
834
|
+
const output = current.output;
|
|
835
|
+
if (Array.isArray(output)) {
|
|
836
|
+
const altTexts = [];
|
|
837
|
+
for (const entry of output) {
|
|
838
|
+
if (!entry || typeof entry !== 'object')
|
|
839
|
+
continue;
|
|
840
|
+
const blocks = entry.content;
|
|
841
|
+
const blockArray = Array.isArray(blocks) ? blocks : [];
|
|
842
|
+
for (const block of blockArray) {
|
|
843
|
+
if (!block || typeof block !== 'object')
|
|
844
|
+
continue;
|
|
845
|
+
const record = block;
|
|
846
|
+
if (typeof record.text === 'string') {
|
|
847
|
+
altTexts.push(record.text);
|
|
848
|
+
}
|
|
849
|
+
else if (typeof record.output_text === 'string') {
|
|
850
|
+
altTexts.push(record.output_text);
|
|
851
|
+
}
|
|
852
|
+
else if (typeof record.content === 'string') {
|
|
853
|
+
altTexts.push(record.content);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
const joined = altTexts.join('\n').trim();
|
|
858
|
+
if (joined) {
|
|
859
|
+
return joined;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
const webSearchRaw = current.web_search ??
|
|
863
|
+
payload.web_search;
|
|
864
|
+
if (Array.isArray(webSearchRaw) && webSearchRaw.length > 0) {
|
|
865
|
+
const items = webSearchRaw
|
|
866
|
+
.filter((entry) => !!entry && typeof entry === 'object' && !Array.isArray(entry))
|
|
867
|
+
.slice(0, 5);
|
|
868
|
+
const lines = [];
|
|
869
|
+
items.forEach((item, index) => {
|
|
870
|
+
const idx = (typeof item.refer === 'string' && item.refer.trim()) || String(index + 1);
|
|
871
|
+
const title = typeof item.title === 'string' && item.title.trim() ? item.title.trim() : '';
|
|
872
|
+
const media = typeof item.media === 'string' && item.media.trim() ? item.media.trim() : '';
|
|
873
|
+
const date = typeof item.publish_date === 'string' && item.publish_date.trim() ? item.publish_date.trim() : '';
|
|
874
|
+
const contentText = typeof item.content === 'string' && item.content.trim() ? item.content.trim() : '';
|
|
875
|
+
const link = typeof item.link === 'string' && item.link.trim() ? item.link.trim() : '';
|
|
876
|
+
const headerParts = [];
|
|
877
|
+
if (title)
|
|
878
|
+
headerParts.push(title);
|
|
879
|
+
if (media)
|
|
880
|
+
headerParts.push(media);
|
|
881
|
+
if (date)
|
|
882
|
+
headerParts.push(date);
|
|
883
|
+
const header = headerParts.length ? headerParts.join(' · ') : undefined;
|
|
884
|
+
const segments = [];
|
|
885
|
+
segments.push(`【${idx}】${header ?? '搜索结果'}`);
|
|
886
|
+
if (contentText)
|
|
887
|
+
segments.push(contentText);
|
|
888
|
+
if (link)
|
|
889
|
+
segments.push(link);
|
|
890
|
+
lines.push(segments.join('\n'));
|
|
891
|
+
});
|
|
892
|
+
const combined = lines.join('\n\n').trim();
|
|
893
|
+
if (combined) {
|
|
894
|
+
return combined;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
return '';
|
|
898
|
+
}
|