@jsonstudio/rcc 0.90.876 → 0.90.1270
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/README.md +5 -6
- package/configsamples/provider-default/ali-coding-plan/config.v2.json +6 -1
- package/configsamples/provider-default/antigravity/config.v2.json +6 -1
- package/configsamples/provider-default/ark-coding-plan/config.v2.json +7 -2
- package/configsamples/provider-default/crs/config.v2.json +6 -1
- package/configsamples/provider-default/deepseek-web/config.v2.json +6 -1
- package/configsamples/provider-default/gemini/config.v2.json +6 -1
- package/configsamples/provider-default/gemini-cli/config.v2.json +6 -1
- package/configsamples/provider-default/gemini-native/config.v2.json +6 -1
- package/configsamples/provider-default/glm/config.v2.json +7 -2
- package/configsamples/provider-default/glm-anthropic/config.v2.json +6 -1
- package/configsamples/provider-default/kimi/config.v2.json +7 -2
- package/configsamples/provider-default/lmstudio/config.v2.json +6 -1
- package/configsamples/provider-default/lmstudio-proxy/config.v2.json +6 -1
- package/configsamples/provider-default/manifest.json +0 -1
- package/configsamples/provider-default/meituan/config.v2.json +6 -1
- package/configsamples/provider-default/mimo/config.v2.json +7 -2
- package/configsamples/provider-default/modelscope/config.v2.json +7 -2
- package/configsamples/provider-default/my-openai/config.v2.json +6 -1
- package/configsamples/provider-default/nvidia/config.v2.json +7 -2
- package/configsamples/provider-default/opencode-zen-free/config.v2.json +6 -1
- package/configsamples/provider-default/openrouter/config.v2.json +6 -1
- package/configsamples/provider-default/qwen/config.v2.json +11 -1
- package/configsamples/provider-default/tab/config.v2.json +6 -1
- package/configsamples/provider-default/tabglm/config.v2.json +7 -2
- package/dist/build-info.js +2 -2
- package/dist/build-info.js.map +1 -1
- package/dist/cli/commands/camoufox.js +44 -3
- package/dist/cli/commands/camoufox.js.map +1 -1
- package/dist/cli/commands/config.js +2 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/heartbeat.js +82 -27
- package/dist/cli/commands/heartbeat.js.map +1 -1
- package/dist/cli/commands/init.js +1 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/launcher/utils.js +37 -24
- package/dist/cli/commands/launcher/utils.js.map +1 -1
- package/dist/cli/commands/launcher-kernel.js +6 -3
- package/dist/cli/commands/launcher-kernel.js.map +1 -1
- package/dist/cli/commands/restart.js +102 -31
- package/dist/cli/commands/restart.js.map +1 -1
- package/dist/cli/commands/start-types.d.ts +1 -0
- package/dist/cli/commands/start-utils.d.ts +1 -0
- package/dist/cli/commands/start-utils.js +3 -0
- package/dist/cli/commands/start-utils.js.map +1 -1
- package/dist/cli/commands/start.js +217 -51
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.js +48 -9
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/config/bootstrap-provider-templates.js +1 -1
- package/dist/cli/config/bootstrap-provider-templates.js.map +1 -1
- package/dist/cli/config/init-provider-catalog.js +3 -50
- package/dist/cli/config/init-provider-catalog.js.map +1 -1
- package/dist/cli/config/init-v2-builder.js +0 -1
- package/dist/cli/config/init-v2-builder.js.map +1 -1
- package/dist/cli/guardian/client.js +40 -18
- package/dist/cli/guardian/client.js.map +1 -1
- package/dist/cli/server/port-utils.d.ts +5 -0
- package/dist/cli/server/port-utils.js +45 -31
- package/dist/cli/server/port-utils.js.map +1 -1
- package/dist/commands/camoufox-fp.js +1 -1
- package/dist/commands/camoufox-fp.js.map +1 -1
- package/dist/commands/oauth.js +48 -64
- package/dist/commands/oauth.js.map +1 -1
- package/dist/commands/provider-update-maintenance.js +4 -4
- package/dist/commands/provider-update-maintenance.js.map +1 -1
- package/dist/commands/token-daemon.js +38 -10
- package/dist/commands/token-daemon.js.map +1 -1
- package/dist/commands/validate.js +31 -3
- package/dist/commands/validate.js.map +1 -1
- package/dist/config/provider-v2-loader.d.ts +5 -2
- package/dist/config/provider-v2-loader.js +80 -26
- package/dist/config/provider-v2-loader.js.map +1 -1
- package/dist/config/routecodex-config-loader.d.ts +1 -0
- package/dist/config/routecodex-config-loader.js +18 -207
- package/dist/config/routecodex-config-loader.js.map +1 -1
- package/dist/config/virtual-router-builder.d.ts +3 -2
- package/dist/config/virtual-router-builder.js +4 -214
- package/dist/config/virtual-router-builder.js.map +1 -1
- package/dist/constants/index.d.ts +2 -3
- package/dist/constants/index.js +2 -4
- package/dist/constants/index.js.map +1 -1
- package/dist/error-handling/route-error-hub.js +1 -0
- package/dist/error-handling/route-error-hub.js.map +1 -1
- package/dist/index.js +98 -21
- package/dist/index.js.map +1 -1
- package/dist/manager/modules/quota/antigravity-quota-manager.d.ts +1 -1
- package/dist/manager/modules/quota/antigravity-quota-manager.js +21 -12
- package/dist/manager/modules/quota/antigravity-quota-manager.js.map +1 -1
- package/dist/manager/modules/quota/antigravity-quota-runtime.d.ts +1 -1
- package/dist/manager/modules/quota/antigravity-quota-runtime.js +32 -45
- package/dist/manager/modules/quota/antigravity-quota-runtime.js.map +1 -1
- package/dist/manager/modules/quota/provider-key-normalization.js +10 -1
- package/dist/manager/modules/quota/provider-key-normalization.js.map +1 -1
- package/dist/manager/modules/quota/provider-quota-daemon.d.ts +2 -1
- package/dist/manager/modules/quota/provider-quota-daemon.error-helpers.d.ts +1 -1
- package/dist/manager/modules/quota/provider-quota-daemon.error-helpers.js +22 -12
- package/dist/manager/modules/quota/provider-quota-daemon.error-helpers.js.map +1 -1
- package/dist/manager/modules/quota/provider-quota-daemon.events.js +69 -33
- package/dist/manager/modules/quota/provider-quota-daemon.events.js.map +1 -1
- package/dist/manager/modules/quota/provider-quota-daemon.js +47 -35
- package/dist/manager/modules/quota/provider-quota-daemon.js.map +1 -1
- package/dist/manager/storage/file-store.js +3 -0
- package/dist/manager/storage/file-store.js.map +1 -1
- package/dist/modules/llmswitch/bridge/antigravity-signature.js +58 -20
- package/dist/modules/llmswitch/bridge/antigravity-signature.js.map +1 -1
- package/dist/modules/llmswitch/bridge/index.d.ts +1 -1
- package/dist/modules/llmswitch/bridge/index.js +1 -1
- package/dist/modules/llmswitch/bridge/index.js.map +1 -1
- package/dist/modules/llmswitch/bridge/runtime-integrations.d.ts +22 -16
- package/dist/modules/llmswitch/bridge/runtime-integrations.js +89 -30
- package/dist/modules/llmswitch/bridge/runtime-integrations.js.map +1 -1
- package/dist/modules/llmswitch/bridge/snapshot-recorder-runtime.js +10 -9
- package/dist/modules/llmswitch/bridge/snapshot-recorder-runtime.js.map +1 -1
- package/dist/modules/llmswitch/bridge/snapshot-recorder.js +3 -0
- package/dist/modules/llmswitch/bridge/snapshot-recorder.js.map +1 -1
- package/dist/modules/llmswitch/bridge/state-integrations.d.ts +1 -0
- package/dist/modules/llmswitch/bridge/state-integrations.js +263 -51
- package/dist/modules/llmswitch/bridge/state-integrations.js.map +1 -1
- package/dist/modules/llmswitch/bridge.d.ts +2 -2
- package/dist/modules/llmswitch/bridge.js +2 -2
- package/dist/modules/llmswitch/bridge.js.map +1 -1
- package/dist/provider-sdk/provider-add-template.d.ts +1 -1
- package/dist/provider-sdk/provider-add-template.js.map +1 -1
- package/dist/provider-sdk/provider-runtime-inference.js +48 -13
- package/dist/provider-sdk/provider-runtime-inference.js.map +1 -1
- package/dist/providers/auth/deepseek-account-token-acquirer.d.ts +24 -0
- package/dist/providers/auth/deepseek-account-token-acquirer.js +42 -13
- package/dist/providers/auth/deepseek-account-token-acquirer.js.map +1 -1
- package/dist/providers/auth/oauth-auth.js +12 -5
- package/dist/providers/auth/oauth-auth.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle/path-resolver.d.ts +0 -1
- package/dist/providers/auth/oauth-lifecycle/path-resolver.js +10 -9
- package/dist/providers/auth/oauth-lifecycle/path-resolver.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle/token-helpers.js +0 -1
- package/dist/providers/auth/oauth-lifecycle/token-helpers.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle/token-io.js +18 -8
- package/dist/providers/auth/oauth-lifecycle/token-io.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle.d.ts +5 -0
- package/dist/providers/auth/oauth-lifecycle.js +370 -353
- package/dist/providers/auth/oauth-lifecycle.js.map +1 -1
- package/dist/providers/auth/oauth-repair-env.js +0 -26
- package/dist/providers/auth/oauth-repair-env.js.map +1 -1
- package/dist/providers/auth/qwen-userinfo-helper.d.ts +11 -0
- package/dist/providers/auth/qwen-userinfo-helper.js +85 -13
- package/dist/providers/auth/qwen-userinfo-helper.js.map +1 -1
- package/dist/providers/auth/token-refresh/token-state.js +1 -4
- package/dist/providers/auth/token-refresh/token-state.js.map +1 -1
- package/dist/providers/auth/token-scanner/index.d.ts +1 -1
- package/dist/providers/auth/token-scanner/index.js +2 -2
- package/dist/providers/auth/token-storage/token-file-resolver.js +0 -3
- package/dist/providers/auth/token-storage/token-file-resolver.js.map +1 -1
- package/dist/providers/auth/token-storage/token-persistence.js +10 -3
- package/dist/providers/auth/token-storage/token-persistence.js.map +1 -1
- package/dist/providers/auth/tokenfile-auth.d.ts +0 -1
- package/dist/providers/auth/tokenfile-auth.js +23 -30
- package/dist/providers/auth/tokenfile-auth.js.map +1 -1
- package/dist/providers/core/api/provider-config.d.ts +1 -1
- package/dist/providers/core/api/provider-types.d.ts +2 -1
- package/dist/providers/core/config/camoufox-actions.js +23 -15
- package/dist/providers/core/config/camoufox-actions.js.map +1 -1
- package/dist/providers/core/config/camoufox-launcher.js +235 -121
- package/dist/providers/core/config/camoufox-launcher.js.map +1 -1
- package/dist/providers/core/config/oauth-flows.js +23 -1
- package/dist/providers/core/config/oauth-flows.js.map +1 -1
- package/dist/providers/core/config/provider-oauth-configs.js +2 -93
- package/dist/providers/core/config/provider-oauth-configs.js.map +1 -1
- package/dist/providers/core/config/service-profiles.d.ts +0 -1
- package/dist/providers/core/config/service-profiles.js +23 -66
- package/dist/providers/core/config/service-profiles.js.map +1 -1
- package/dist/providers/core/runtime/base-provider-runtime-helpers.js +4 -1
- package/dist/providers/core/runtime/base-provider-runtime-helpers.js.map +1 -1
- package/dist/providers/core/runtime/base-provider.js +21 -11
- package/dist/providers/core/runtime/base-provider.js.map +1 -1
- package/dist/providers/core/runtime/deepseek-http-provider-helpers.d.ts +1 -0
- package/dist/providers/core/runtime/deepseek-http-provider-helpers.js +28 -0
- package/dist/providers/core/runtime/deepseek-http-provider-helpers.js.map +1 -1
- package/dist/providers/core/runtime/deepseek-http-provider.d.ts +0 -2
- package/dist/providers/core/runtime/deepseek-http-provider.js +3 -33
- package/dist/providers/core/runtime/deepseek-http-provider.js.map +1 -1
- package/dist/providers/core/runtime/http-request-executor.d.ts +1 -0
- package/dist/providers/core/runtime/http-request-executor.js +131 -47
- package/dist/providers/core/runtime/http-request-executor.js.map +1 -1
- package/dist/providers/core/runtime/http-transport-provider.d.ts +5 -5
- package/dist/providers/core/runtime/http-transport-provider.js +97 -38
- package/dist/providers/core/runtime/http-transport-provider.js.map +1 -1
- package/dist/providers/core/runtime/openai-responses-sdk-transport.js +2 -1
- package/dist/providers/core/runtime/openai-responses-sdk-transport.js.map +1 -1
- package/dist/providers/core/runtime/provider-error-classifier.js +19 -126
- package/dist/providers/core/runtime/provider-error-classifier.js.map +1 -1
- package/dist/providers/core/runtime/provider-factory-helpers.d.ts +1 -0
- package/dist/providers/core/runtime/provider-factory-helpers.js +8 -12
- package/dist/providers/core/runtime/provider-factory-helpers.js.map +1 -1
- package/dist/providers/core/runtime/provider-factory.js +2 -9
- package/dist/providers/core/runtime/provider-factory.js.map +1 -1
- package/dist/providers/core/runtime/provider-failure-policy.d.ts +135 -0
- package/dist/providers/core/runtime/provider-failure-policy.js +685 -0
- package/dist/providers/core/runtime/provider-failure-policy.js.map +1 -0
- package/dist/providers/core/runtime/provider-family-profile-utils.d.ts +0 -10
- package/dist/providers/core/runtime/provider-family-profile-utils.js +0 -28
- package/dist/providers/core/runtime/provider-family-profile-utils.js.map +1 -1
- package/dist/providers/core/runtime/provider-http-executor-utils.js +40 -1
- package/dist/providers/core/runtime/provider-http-executor-utils.js.map +1 -1
- package/dist/providers/core/runtime/provider-request-header-orchestrator.d.ts +0 -2
- package/dist/providers/core/runtime/provider-request-header-orchestrator.js +35 -8
- package/dist/providers/core/runtime/provider-request-header-orchestrator.js.map +1 -1
- package/dist/providers/core/runtime/provider-response-postprocessor.js +3 -23
- package/dist/providers/core/runtime/provider-response-postprocessor.js.map +1 -1
- package/dist/providers/core/runtime/provider-runtime-utils.js +4 -1
- package/dist/providers/core/runtime/provider-runtime-utils.js.map +1 -1
- package/dist/providers/core/runtime/provider-startup-tasks.js +18 -2
- package/dist/providers/core/runtime/provider-startup-tasks.js.map +1 -1
- package/dist/providers/core/runtime/responses-provider-helpers.d.ts +1 -0
- package/dist/providers/core/runtime/responses-provider-helpers.js +11 -12
- package/dist/providers/core/runtime/responses-provider-helpers.js.map +1 -1
- package/dist/providers/core/runtime/responses-provider.js +15 -10
- package/dist/providers/core/runtime/responses-provider.js.map +1 -1
- package/dist/providers/core/runtime/transport/auth-provider-factory.d.ts +0 -1
- package/dist/providers/core/runtime/transport/auth-provider-factory.js +1 -15
- package/dist/providers/core/runtime/transport/auth-provider-factory.js.map +1 -1
- package/dist/providers/core/runtime/transport/index.d.ts +0 -1
- package/dist/providers/core/runtime/transport/index.js +0 -1
- package/dist/providers/core/runtime/transport/index.js.map +1 -1
- package/dist/providers/core/runtime/transport/oauth-recovery-handler.d.ts +2 -0
- package/dist/providers/core/runtime/transport/oauth-recovery-handler.js +76 -5
- package/dist/providers/core/runtime/transport/oauth-recovery-handler.js.map +1 -1
- package/dist/providers/core/runtime/transport/request-header-builder.d.ts +0 -1
- package/dist/providers/core/runtime/transport/request-header-builder.js +1 -7
- package/dist/providers/core/runtime/transport/request-header-builder.js.map +1 -1
- package/dist/providers/core/runtime/transport/runtime-detector.d.ts +0 -2
- package/dist/providers/core/runtime/transport/runtime-detector.js +0 -20
- package/dist/providers/core/runtime/transport/runtime-detector.js.map +1 -1
- package/dist/providers/core/runtime/transport/session-header-utils.d.ts +6 -0
- package/dist/providers/core/runtime/transport/session-header-utils.js +61 -2
- package/dist/providers/core/runtime/transport/session-header-utils.js.map +1 -1
- package/dist/providers/core/runtime/vercel-ai-sdk/anthropic-sdk-request-exec.js +2 -1
- package/dist/providers/core/runtime/vercel-ai-sdk/anthropic-sdk-request-exec.js.map +1 -1
- package/dist/providers/core/runtime/vercel-ai-sdk/openai-sdk-transport.js +2 -1
- package/dist/providers/core/runtime/vercel-ai-sdk/openai-sdk-transport.js.map +1 -1
- package/dist/providers/core/strategies/oauth-auth-code-flow.d.ts +1 -4
- package/dist/providers/core/strategies/oauth-auth-code-flow.js +26 -84
- package/dist/providers/core/strategies/oauth-auth-code-flow.js.map +1 -1
- package/dist/providers/core/strategies/oauth-device-flow.d.ts +2 -0
- package/dist/providers/core/strategies/oauth-device-flow.js +43 -8
- package/dist/providers/core/strategies/oauth-device-flow.js.map +1 -1
- package/dist/providers/core/utils/http-client.d.ts +7 -5
- package/dist/providers/core/utils/http-client.js +108 -33
- package/dist/providers/core/utils/http-client.js.map +1 -1
- package/dist/providers/core/utils/provider-error-reporter.d.ts +2 -2
- package/dist/providers/core/utils/provider-error-reporter.js +9 -85
- package/dist/providers/core/utils/provider-error-reporter.js.map +1 -1
- package/dist/providers/core/utils/provider-type-utils.js +1 -3
- package/dist/providers/core/utils/provider-type-utils.js.map +1 -1
- package/dist/providers/core/utils/qwen-client-fingerprint.d.ts +15 -0
- package/dist/providers/core/utils/qwen-client-fingerprint.js +47 -0
- package/dist/providers/core/utils/qwen-client-fingerprint.js.map +1 -0
- package/dist/providers/core/utils/snapshot-writer.d.ts +3 -0
- package/dist/providers/core/utils/snapshot-writer.js +385 -26
- package/dist/providers/core/utils/snapshot-writer.js.map +1 -1
- package/dist/providers/profile/families/qwen-profile.js +285 -22
- package/dist/providers/profile/families/qwen-profile.js.map +1 -1
- package/dist/providers/profile/profile-registry.js +0 -2
- package/dist/providers/profile/profile-registry.js.map +1 -1
- package/dist/providers/profile/provider-directory.js +0 -1
- package/dist/providers/profile/provider-directory.js.map +1 -1
- package/dist/providers/profile/provider-profile-loader.js +1 -1
- package/dist/providers/profile/provider-profile-loader.js.map +1 -1
- package/dist/server/handlers/chat-handler.js +6 -5
- package/dist/server/handlers/chat-handler.js.map +1 -1
- package/dist/server/handlers/config-admin-handler.js +44 -69
- package/dist/server/handlers/config-admin-handler.js.map +1 -1
- package/dist/server/handlers/handler-response-utils.js +190 -27
- package/dist/server/handlers/handler-response-utils.js.map +1 -1
- package/dist/server/handlers/handler-utils.d.ts +3 -0
- package/dist/server/handlers/handler-utils.js +72 -0
- package/dist/server/handlers/handler-utils.js.map +1 -1
- package/dist/server/handlers/images-handler.js +7 -7
- package/dist/server/handlers/images-handler.js.map +1 -1
- package/dist/server/handlers/messages-handler.js +6 -5
- package/dist/server/handlers/messages-handler.js.map +1 -1
- package/dist/server/handlers/responses-handler.js +32 -14
- package/dist/server/handlers/responses-handler.js.map +1 -1
- package/dist/server/handlers/sse-dispatcher.js +55 -13
- package/dist/server/handlers/sse-dispatcher.js.map +1 -1
- package/dist/server/handlers/types.d.ts +12 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-handler.js +5 -2
- package/dist/server/runtime/http-server/daemon-admin/auth-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/control-handler.js +62 -18
- package/dist/server/runtime/http-server/daemon-admin/control-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler-utils.js +1 -1
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler-utils.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler.js +9 -9
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-routing-utils.js +36 -10
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-routing-utils.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/providers-handler.js +11 -11
- package/dist/server/runtime/http-server/daemon-admin/providers-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/quota-handler.js +49 -8
- package/dist/server/runtime/http-server/daemon-admin/quota-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin-routes.d.ts +1 -0
- package/dist/server/runtime/http-server/daemon-admin-routes.js +46 -0
- package/dist/server/runtime/http-server/daemon-admin-routes.js.map +1 -1
- package/dist/server/runtime/http-server/executor/client-injection-flow.js +2 -0
- package/dist/server/runtime/http-server/executor/client-injection-flow.js.map +1 -1
- package/dist/server/runtime/http-server/executor/log-rollup.d.ts +38 -0
- package/dist/server/runtime/http-server/executor/log-rollup.js +775 -0
- package/dist/server/runtime/http-server/executor/log-rollup.js.map +1 -0
- package/dist/server/runtime/http-server/executor/provider-response-converter.js +654 -281
- package/dist/server/runtime/http-server/executor/provider-response-converter.js.map +1 -1
- package/dist/server/runtime/http-server/executor/provider-response-utils.js +34 -3
- package/dist/server/runtime/http-server/executor/provider-response-utils.js.map +1 -1
- package/dist/server/runtime/http-server/executor/provider-runtime-resolver.js +14 -68
- package/dist/server/runtime/http-server/executor/provider-runtime-resolver.js.map +1 -1
- package/dist/server/runtime/http-server/executor/request-executor-core-utils.js +26 -2
- package/dist/server/runtime/http-server/executor/request-executor-core-utils.js.map +1 -1
- package/dist/server/runtime/http-server/executor/request-retry-helpers.js +20 -2
- package/dist/server/runtime/http-server/executor/request-retry-helpers.js.map +1 -1
- package/dist/server/runtime/http-server/executor/servertool-adapter-context.d.ts +10 -0
- package/dist/server/runtime/http-server/executor/servertool-adapter-context.js +120 -0
- package/dist/server/runtime/http-server/executor/servertool-adapter-context.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-dispatch.d.ts +35 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-dispatch.js +101 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-dispatch.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-error.d.ts +46 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-error.js +127 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-error.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-metadata.d.ts +7 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-metadata.js +186 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-metadata.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-request-normalizer.d.ts +2 -0
- package/dist/server/runtime/http-server/executor/servertool-request-normalizer.js +56 -0
- package/dist/server/runtime/http-server/executor/servertool-request-normalizer.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-response-normalizer.d.ts +8 -0
- package/dist/server/runtime/http-server/executor/servertool-response-normalizer.js +31 -0
- package/dist/server/runtime/http-server/executor/servertool-response-normalizer.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-runtime-log.d.ts +8 -0
- package/dist/server/runtime/http-server/executor/servertool-runtime-log.js +33 -0
- package/dist/server/runtime/http-server/executor/servertool-runtime-log.js.map +1 -0
- package/dist/server/runtime/http-server/executor/sse-error-handler.js +37 -0
- package/dist/server/runtime/http-server/executor/sse-error-handler.js.map +1 -1
- package/dist/server/runtime/http-server/executor/usage-aggregator.js +32 -2
- package/dist/server/runtime/http-server/executor/usage-aggregator.js.map +1 -1
- package/dist/server/runtime/http-server/executor/usage-logger.d.ts +12 -0
- package/dist/server/runtime/http-server/executor/usage-logger.js +56 -1
- package/dist/server/runtime/http-server/executor/usage-logger.js.map +1 -1
- package/dist/server/runtime/http-server/executor-metadata.d.ts +15 -0
- package/dist/server/runtime/http-server/executor-metadata.js +60 -18
- package/dist/server/runtime/http-server/executor-metadata.js.map +1 -1
- package/dist/server/runtime/http-server/executor-provider.d.ts +2 -0
- package/dist/server/runtime/http-server/executor-provider.js +88 -205
- package/dist/server/runtime/http-server/executor-provider.js.map +1 -1
- package/dist/server/runtime/http-server/executor-response.js +30 -149
- package/dist/server/runtime/http-server/executor-response.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-bootstrap.js +53 -17
- package/dist/server/runtime/http-server/http-server-bootstrap.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-legacy-pipeline.js +28 -1
- package/dist/server/runtime/http-server/http-server-legacy-pipeline.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-lifecycle.js +17 -4
- package/dist/server/runtime/http-server/http-server-lifecycle.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-runtime-providers.js +42 -13
- package/dist/server/runtime/http-server/http-server-runtime-providers.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-runtime-setup.js +40 -2
- package/dist/server/runtime/http-server/http-server-runtime-setup.js.map +1 -1
- package/dist/server/runtime/http-server/hub-shadow-compare.js +8 -4
- package/dist/server/runtime/http-server/hub-shadow-compare.js.map +1 -1
- package/dist/server/runtime/http-server/managed-process-probe.js +30 -4
- package/dist/server/runtime/http-server/managed-process-probe.js.map +1 -1
- package/dist/server/runtime/http-server/middleware.js +32 -4
- package/dist/server/runtime/http-server/middleware.js.map +1 -1
- package/dist/server/runtime/http-server/provider-traffic-governor.d.ts +45 -1
- package/dist/server/runtime/http-server/provider-traffic-governor.js +697 -111
- package/dist/server/runtime/http-server/provider-traffic-governor.js.map +1 -1
- package/dist/server/runtime/http-server/provider-utils.js +2 -6
- package/dist/server/runtime/http-server/provider-utils.js.map +1 -1
- package/dist/server/runtime/http-server/request-activity-tracker.d.ts +4 -0
- package/dist/server/runtime/http-server/request-activity-tracker.js +54 -11
- package/dist/server/runtime/http-server/request-activity-tracker.js.map +1 -1
- package/dist/server/runtime/http-server/request-executor.d.ts +247 -0
- package/dist/server/runtime/http-server/request-executor.js +2444 -334
- package/dist/server/runtime/http-server/request-executor.js.map +1 -1
- package/dist/server/runtime/http-server/routes.js +59 -16
- package/dist/server/runtime/http-server/routes.js.map +1 -1
- package/dist/server/runtime/http-server/runtime-manager.js +0 -15
- package/dist/server/runtime/http-server/runtime-manager.js.map +1 -1
- package/dist/server/runtime/http-server/session-client-registry-utils.js +46 -10
- package/dist/server/runtime/http-server/session-client-registry-utils.js.map +1 -1
- package/dist/server/runtime/http-server/session-client-registry.js +22 -4
- package/dist/server/runtime/http-server/session-client-registry.js.map +1 -1
- package/dist/server/runtime/http-server/session-client-routes.js +40 -18
- package/dist/server/runtime/http-server/session-client-routes.js.map +1 -1
- package/dist/server/runtime/http-server/session-dir.js +35 -2
- package/dist/server/runtime/http-server/session-dir.js.map +1 -1
- package/dist/server/runtime/http-server/session-scope-resolution.js +38 -9
- package/dist/server/runtime/http-server/session-scope-resolution.js.map +1 -1
- package/dist/server/runtime/http-server/session-storage-cleanup.js +64 -27
- package/dist/server/runtime/http-server/session-storage-cleanup.js.map +1 -1
- package/dist/server/runtime/http-server/stats-manager.d.ts +5 -0
- package/dist/server/runtime/http-server/stats-manager.js +138 -6
- package/dist/server/runtime/http-server/stats-manager.js.map +1 -1
- package/dist/server/runtime/http-server/tmux-injection-history.js +30 -4
- package/dist/server/runtime/http-server/tmux-injection-history.js.map +1 -1
- package/dist/server/runtime/http-server/tmux-session-probe.d.ts +3 -1
- package/dist/server/runtime/http-server/tmux-session-probe.js +198 -9
- package/dist/server/runtime/http-server/tmux-session-probe.js.map +1 -1
- package/dist/server/utils/client-connection-state.d.ts +1 -0
- package/dist/server/utils/client-connection-state.js +45 -5
- package/dist/server/utils/client-connection-state.js.map +1 -1
- package/dist/server/utils/finish-reason.js +61 -2
- package/dist/server/utils/finish-reason.js.map +1 -1
- package/dist/server/utils/http-error-mapper.d.ts +4 -0
- package/dist/server/utils/http-error-mapper.js +31 -6
- package/dist/server/utils/http-error-mapper.js.map +1 -1
- package/dist/server/utils/stage-logger.js +42 -13
- package/dist/server/utils/stage-logger.js.map +1 -1
- package/dist/server-lifecycle/port-utils.js +6 -2
- package/dist/server-lifecycle/port-utils.js.map +1 -1
- package/dist/token-daemon/index.js +44 -15
- package/dist/token-daemon/index.js.map +1 -1
- package/dist/token-daemon/leader-lock.js +65 -7
- package/dist/token-daemon/leader-lock.js.map +1 -1
- package/dist/token-daemon/provider-registry.js +1 -1
- package/dist/token-daemon/provider-registry.js.map +1 -1
- package/dist/token-daemon/server-utils.d.ts +11 -0
- package/dist/token-daemon/server-utils.js +71 -18
- package/dist/token-daemon/server-utils.js.map +1 -1
- package/dist/token-daemon/token-daemon.d.ts +0 -1
- package/dist/token-daemon/token-daemon.js +81 -63
- package/dist/token-daemon/token-daemon.js.map +1 -1
- package/dist/token-daemon/token-types.d.ts +1 -1
- package/dist/token-daemon/token-types.js +0 -1
- package/dist/token-daemon/token-types.js.map +1 -1
- package/dist/token-daemon/token-utils.js +4 -2
- package/dist/token-daemon/token-utils.js.map +1 -1
- package/dist/tools/provider-update/fetch-models.js +1 -5
- package/dist/tools/provider-update/fetch-models.js.map +1 -1
- package/dist/utils/error-handler-registry.js +50 -13
- package/dist/utils/error-handler-registry.js.map +1 -1
- package/dist/utils/errorsamples.d.ts +3 -1
- package/dist/utils/errorsamples.js +198 -14
- package/dist/utils/errorsamples.js.map +1 -1
- package/dist/utils/http-health-probe.d.ts +42 -0
- package/dist/utils/http-health-probe.js +231 -0
- package/dist/utils/http-health-probe.js.map +1 -0
- package/dist/utils/managed-server-pids.js +2 -2
- package/dist/utils/managed-server-pids.js.map +1 -1
- package/dist/utils/module-config-reader.js +11 -1
- package/dist/utils/module-config-reader.js.map +1 -1
- package/dist/utils/runtime-package-root.d.ts +2 -0
- package/dist/utils/runtime-package-root.js +47 -0
- package/dist/utils/runtime-package-root.js.map +1 -0
- package/dist/utils/snapshot-local-disk-gate.d.ts +3 -0
- package/dist/utils/snapshot-local-disk-gate.js +50 -0
- package/dist/utils/snapshot-local-disk-gate.js.map +1 -0
- package/dist/utils/snapshot-payload-guard.d.ts +1 -0
- package/dist/utils/snapshot-payload-guard.js +234 -0
- package/dist/utils/snapshot-payload-guard.js.map +1 -0
- package/dist/utils/snapshot-request-retention.d.ts +3 -0
- package/dist/utils/snapshot-request-retention.js +128 -0
- package/dist/utils/snapshot-request-retention.js.map +1 -0
- package/dist/utils/snapshot-stage-policy.d.ts +3 -0
- package/dist/utils/snapshot-stage-policy.js +111 -0
- package/dist/utils/snapshot-stage-policy.js.map +1 -0
- package/dist/utils/snapshot-writer.js +124 -127
- package/dist/utils/snapshot-writer.js.map +1 -1
- package/docs/CHAT_PROCESS_PROTOCOL_AND_PIPELINE.md +4 -0
- package/docs/CONFIG_ARCHITECTURE.md +2 -2
- package/docs/INSTALLATION_AND_QUICKSTART.md +5 -5
- package/docs/OAUTH.md +2 -5
- package/docs/PORTS.md +1 -1
- package/docs/PROVIDERS_BUILTIN.md +1 -5
- package/docs/PROVIDER_TYPES.md +1 -1
- package/docs/agent-routing/10-runtime-ssot-routing.md +4 -0
- package/docs/agent-routing/20-build-test-release-routing.md +2 -2
- package/docs/agent-routing/30-servertool-lifecycle-routing.md +2 -0
- package/docs/agent-routing/40-task-memory-routing.md +22 -2
- package/docs/audit/286.1-provider-failure-policy-audit.md +341 -0
- package/docs/audits/2026-04-26-fallback-silent-failure-audit.md +119 -0
- package/docs/audits/2026-04-27-provider-failure-policy-ssot-audit.md +153 -0
- package/docs/chat-process-continuation-state-contract.md +196 -0
- package/docs/chat-semantic-expansion-plan.md +2 -0
- package/docs/daemon-admin-api-design.md +9 -9
- package/docs/design/provider-failure-policy-ssot.md +215 -0
- package/docs/design/reasoning-stop-lifecycle.md +90 -0
- package/docs/design/servertool-unified-skeleton.md +202 -0
- package/docs/design/websearch-servertool-orchestration.md +190 -0
- package/docs/error-handling-v2.md +120 -11
- package/docs/protocol-compatibility-matrix.md +147 -0
- package/docs/providers/provider-composite-design.md +4 -5
- package/docs/providers/provider-composite-testing.md +1 -1
- package/docs/providers/provider-type-only-migration.md +2 -15
- package/docs/refactoring/compatibility-v2-architecture-design.md +1 -3
- package/docs/refactoring/host-164.3-responsibility-migration.md +0 -1
- package/docs/routing-instructions.md +42 -1
- package/docs/stop-message-auto.md +0 -1
- package/docs/token-refresh-daemon-plan.md +14 -14
- package/docs/v2-architecture/IMPLEMENTATION-ROADMAP.md +1 -1
- package/docs/v2-architecture/PROVIDER-V2-CHANGESET-RELEASE-CHECKLIST.md +1 -9
- package/docs/v2-architecture/PROVIDER-V2-LAYERING-ADR-DRAFT.md +3 -4
- package/docs/v2-architecture/PROVIDER-V2-MIGRATION-MATRIX-DRAFT.md +4 -15
- package/docs/v2-architecture/PROVIDER-V2-PHASED-MIGRATION-ROLLBACK-DRAFT.md +4 -5
- package/docs/v2-architecture/PROVIDER-V2-PROFILE-API-REGISTRY-DRAFT.md +4 -4
- package/docs/v2-architecture/PROVIDER-V2-REFACTOR-OVERVIEW-DRAFT.md +1 -2
- package/docs/v2-architecture/PROVIDER-V2-VERIFICATION-MATRIX-DRAFT.md +2 -2
- package/node_modules/@jsonstudio/llms/dist/config-unified/unified-config.js +36 -10
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/deepseek-web-request.js +7 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/deepseek-web-response.js +2 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/antigravity-session-signature.js +33 -17
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/header-policies.d.ts +20 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/header-policies.js +79 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/policy-overrides.d.ts +16 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/policy-overrides.js +27 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/provider-resolver.d.ts +26 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/provider-resolver.js +59 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/registry.d.ts +35 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/registry.js +154 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/types.d.ts +75 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/types.js +8 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/anthropic-claude-code.json +13 -7
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-claude-code.json +13 -8
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-deepseek-web.json +37 -8
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-qwen.json +48 -11
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/compat-passthrough.json +6 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/provider-resolution-config.json +24 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper-config.js +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper-from-chat.js +54 -7
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper-to-chat.js +15 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-semantics-audit.d.ts +11 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-semantics-audit.js +16 -30
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper-config.js +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper-from-chat.js +15 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapping-audit.d.ts +10 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapping-audit.js +9 -30
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/protocol-mapping-audit.d.ts +43 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/protocol-mapping-audit.js +148 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper-from-chat.js +16 -6
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper-helpers.d.ts +2 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper-helpers.js +65 -3
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper-to-chat.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-types.d.ts +14 -154
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-chat-process-request-utils.d.ts +6 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-chat-process-request-utils.js +83 -3
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-chat-process-entry.js +6 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-request-stage-inbound.d.ts +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-request-stage-inbound.js +9 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-request-stage-provider-payload.js +132 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-request-stage.js +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-heavy-input-fastpath.d.ts +4 -22
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-heavy-input-fastpath.js +109 -139
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-max-tokens-policy.js +40 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-route-and-outbound.d.ts +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-route-and-outbound.js +19 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline.d.ts +0 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline.js +45 -43
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/route-aware-responses-continuation.d.ts +10 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/route-aware-responses-continuation.js +143 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.js +37 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/semantic-lift.js +14 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.d.ts +3 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.js +22 -11
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/chat-process-semantics-bridge.js +59 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.js +3 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.js +2 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.d.ts +2 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.js +53 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage2_finalize/index.js +4 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.js +16 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/policy/policy-engine.js +14 -4
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-anthropic-alias.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-anthropic-alias.js +29 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-pending-tool-sync.js +38 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-request-sanitizer.js +164 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/provider-response.js +27 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/response-mappers.d.ts +9 -3
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/response-mappers.js +8 -7
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/response-runtime-anthropic.js +20 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/snapshot-recorder.js +1 -247
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/types/chat-envelope.d.ts +84 -4
- package/node_modules/@jsonstudio/llms/dist/conversion/pipeline/codecs/v2/responses-openai-pipeline.js +26 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge/response-payload.js +10 -9
- package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge/utils.js +20 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge.js +88 -4
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils-core.js +5 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils-openai-request.js +55 -14
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils-tool-schema.js +1 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils.js +38 -15
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/openai-message-normalize.js +45 -6
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-conversation-store.d.ts +15 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-conversation-store.js +157 -13
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-reasoning-registry.d.ts +8 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-reasoning-registry.js +103 -9
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-response-utils.js +10 -10
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-filter-pipeline.js +59 -9
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-governor-guards.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-governor-guards.js +54 -43
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-governor.js +62 -8
- package/node_modules/@jsonstudio/llms/dist/conversion/snapshot-utils.js +121 -8
- package/node_modules/@jsonstudio/llms/dist/filters/engine.js +64 -6
- package/node_modules/@jsonstudio/llms/dist/filters/special/request-tool-list-filter.js +32 -11
- package/node_modules/@jsonstudio/llms/dist/filters/special/request-toolcalls-stringify.js +26 -1
- package/node_modules/@jsonstudio/llms/dist/filters/special/request-tools-normalize.js +46 -7
- package/node_modules/@jsonstudio/llms/dist/filters/special/response-tool-arguments-blacklist.js +10 -1
- package/node_modules/@jsonstudio/llms/dist/filters/special/response-tool-arguments-schema-converge.js +10 -1
- package/node_modules/@jsonstudio/llms/dist/filters/special/response-tool-arguments-stringify.js +30 -5
- package/node_modules/@jsonstudio/llms/dist/filters/special/response-tool-arguments-whitelist.js +10 -1
- package/node_modules/@jsonstudio/llms/dist/filters/special/tool-filter-hooks.js +16 -14
- package/node_modules/@jsonstudio/llms/dist/filters/utils/snapshot-writer.js +47 -5
- package/node_modules/@jsonstudio/llms/dist/guidance/index.js +16 -2
- package/node_modules/@jsonstudio/llms/dist/http/sse-response.js +42 -6
- package/node_modules/@jsonstudio/llms/dist/native/router_hotpath_napi.node +0 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/auth-utils.js +33 -31
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/provider-normalization.d.ts +6 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/provider-normalization.js +78 -98
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/responses-helpers.js +22 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/routing-config.js +56 -3
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/streaming-helpers.js +19 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap.js +62 -293
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/classifier.js +11 -82
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/antigravity/alias-lease.js +42 -15
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/cooldown-manager.js +55 -3
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/health/index.js +66 -15
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/routing-pools/index.js +44 -8
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/routing-state/keys.d.ts +7 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/routing-state/keys.js +65 -21
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/routing-state/store.js +19 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/sticky-session-manager.d.ts +9 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/sticky-session-manager.js +139 -4
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-logging.js +2 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-semantics.js +68 -59
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-governance-semantics.js +156 -157
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.js +31 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-servertool-orchestration-semantics.js +94 -95
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-compat-action-semantics.d.ts +0 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-compat-action-semantics.js +0 -7
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-parsers.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-parsers.js +203 -305
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-tools-post.js +35 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-tools-request.js +2 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-types.d.ts +2 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.js +173 -154
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.js +106 -57
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-inbound-outbound-semantics.js +122 -114
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics-builders.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics-metadata-policy.js +100 -86
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics-passthrough.js +52 -33
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics-protocol.js +79 -62
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics-parsers.js +50 -33
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics-types.d.ts +2 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics-parsers.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics-parsers.js +161 -177
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics-outbound-tools.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics-outbound-tools.js +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics-parsers.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics-parsers.js +231 -286
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-router-hotpath-analysis.js +143 -164
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-router-hotpath-required-exports.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-router-hotpath-required-exports.js +8 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics-reasoning.js +57 -28
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics-responses.d.ts +8 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics-responses.js +76 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-virtual-router-bootstrap-providers.d.ts +24 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-virtual-router-bootstrap-providers.js +78 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-virtual-router-bootstrap-routing.d.ts +17 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-virtual-router-bootstrap-routing.js +72 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/route-utils.js +9 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/tier-selection-select.js +11 -5
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine.js +4 -39
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/features.js +199 -31
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/health-manager.js +7 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/load-balancer.d.ts +3 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/load-balancer.js +47 -3
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/native-error.d.ts +11 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/native-error.js +71 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/provider-registry.js +81 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/provider-runtime-ingress.d.ts +24 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/provider-runtime-ingress.js +139 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/routing-instructions/parse.js +21 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/routing-instructions/state.js +46 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/routing-instructions/types.d.ts +7 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/routing-stop-message-state-codec.js +30 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/sticky-session-store.js +44 -15
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/stop-message-state-sync.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/stop-message-state-sync.js +10 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/success-center.js +39 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/tool-signals.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/tool-signals.js +25 -24
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/types.d.ts +3 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/engine.js +255 -71
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/clock.js +20 -2
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/followup-request-builder.js +120 -85
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/memory-appender.d.ts +6 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/memory-appender.js +42 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-only-continue.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-stop-guard.js +630 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-stop-state.d.ts +24 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-stop-state.js +606 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-stop.js +292 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/{iflow-followup.d.ts → ai-followup.d.ts} +3 -3
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/{iflow-followup.js → ai-followup.js} +76 -81
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/config.d.ts +1 -2
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/config.js +2 -6
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/runtime-utils.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/runtime-utils.js +51 -11
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto.js +5 -4
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/web-search-auto-trigger.d.ts +9 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/web-search-auto-trigger.js +91 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/web-search.js +1 -131
- package/node_modules/@jsonstudio/llms/dist/servertool/heartbeat/session-store.js +49 -18
- package/node_modules/@jsonstudio/llms/dist/servertool/registry.js +3 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/server-side-tools.d.ts +2 -2
- package/node_modules/@jsonstudio/llms/dist/servertool/server-side-tools.js +14 -10
- package/node_modules/@jsonstudio/llms/dist/servertool/strip-servertool-calls.js +2 -3
- package/node_modules/@jsonstudio/llms/dist/servertool/types.d.ts +11 -1
- package/node_modules/@jsonstudio/llms/dist/sse/json-to-sse/chat-json-to-sse-converter.js +26 -1
- package/node_modules/@jsonstudio/llms/dist/sse/json-to-sse/event-generators/chat.d.ts +2 -2
- package/node_modules/@jsonstudio/llms/dist/sse/json-to-sse/event-generators/chat.js +38 -3
- package/node_modules/@jsonstudio/llms/dist/sse/json-to-sse/sequencers/chat-sequencer.js +6 -3
- package/node_modules/@jsonstudio/llms/dist/sse/shared/chat-serializer.js +27 -3
- package/node_modules/@jsonstudio/llms/dist/sse/shared/constants.d.ts +6 -6
- package/node_modules/@jsonstudio/llms/dist/sse/shared/constants.js +3 -3
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/anthropic-sse-to-json-converter.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/anthropic-sse-to-json-converter.js +36 -1
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/builders/anthropic-response-builder.js +6 -20
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/builders/response-builder.d.ts +3 -0
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/builders/response-builder.js +125 -42
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/chat-sse-to-json-converter.js +59 -10
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/parsers/sse-parser.js +2 -0
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/responses-sse-to-json-converter.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/responses-sse-to-json-converter.js +71 -2
- package/node_modules/@jsonstudio/llms/dist/sse/types/chat-types.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/sse/types/chat-types.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/sse/types/conversion-context.js +2 -2
- package/node_modules/@jsonstudio/llms/dist/sse/types/index.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/sse/types/responses-types.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/sse/types/responses-types.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/telemetry/stats-center.js +34 -12
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/patch-text/fuzzy-match.d.ts +14 -0
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/patch-text/fuzzy-match.js +174 -0
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/patch-text/normalize.js +148 -0
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/structured.js +31 -2
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/validator.js +121 -4
- package/node_modules/@jsonstudio/llms/dist/tools/exec-command/normalize.d.ts +4 -1
- package/node_modules/@jsonstudio/llms/dist/tools/exec-command/normalize.js +31 -16
- package/node_modules/@jsonstudio/llms/dist/tools/exec-command/validator.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/tools/exec-command/validator.js +3 -1
- package/node_modules/@jsonstudio/llms/dist/tools/tool-registry.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/tools/tool-registry.js +5 -27
- package/node_modules/@jsonstudio/llms/package.json +1 -1
- package/package.json +6 -7
- package/scripts/ci/repo-sanity.mjs +1 -0
- package/scripts/ci/silent-failure-audit.mjs +112 -70
- package/scripts/cleanup-stale-server-pids.mjs +0 -6
- package/scripts/ensure-cli-command-shim.mjs +49 -15
- package/scripts/ensure-cli-executable.mjs +1 -1
- package/scripts/install-global.sh +7 -6
- package/scripts/install-release-snapshot.mjs +232 -0
- package/scripts/install-release.sh +30 -24
- package/scripts/link-global-llms-local.mjs +1 -2
- package/scripts/pack-mode.mjs +0 -4
- package/scripts/pack-rcc.mjs +17 -58
- package/scripts/run-bg.sh +0 -6
- package/scripts/run-fg-gtimeout.sh +0 -6
- package/scripts/tests/antigravity-codex-sample-pipeline-compare.mjs +1 -1
- package/scripts/tests/blackbox-rcc-vs-routecodex-antigravity.mjs +60 -39
- package/scripts/verify-install-e2e.mjs +64 -26
- package/configsamples/provider-default/qwenchat/config.v2.json +0 -53
- package/dist/providers/auth/iflow-cookie-auth.d.ts +0 -27
- package/dist/providers/auth/iflow-cookie-auth.js +0 -207
- package/dist/providers/auth/iflow-cookie-auth.js.map +0 -1
- package/dist/providers/auth/iflow-userinfo-helper.d.ts +0 -32
- package/dist/providers/auth/iflow-userinfo-helper.js +0 -81
- package/dist/providers/auth/iflow-userinfo-helper.js.map +0 -1
- package/dist/providers/core/runtime/iflow-http-provider.d.ts +0 -13
- package/dist/providers/core/runtime/iflow-http-provider.js +0 -22
- package/dist/providers/core/runtime/iflow-http-provider.js.map +0 -1
- package/dist/providers/core/runtime/provider-iflow-business-error-utils.d.ts +0 -15
- package/dist/providers/core/runtime/provider-iflow-business-error-utils.js +0 -49
- package/dist/providers/core/runtime/provider-iflow-business-error-utils.js.map +0 -1
- package/dist/providers/core/runtime/qwenchat-http-provider-helpers.d.ts +0 -89
- package/dist/providers/core/runtime/qwenchat-http-provider-helpers.js +0 -1698
- package/dist/providers/core/runtime/qwenchat-http-provider-helpers.js.map +0 -1
- package/dist/providers/core/runtime/qwenchat-http-provider.d.ts +0 -9
- package/dist/providers/core/runtime/qwenchat-http-provider.js +0 -78
- package/dist/providers/core/runtime/qwenchat-http-provider.js.map +0 -1
- package/dist/providers/core/runtime/standard-tool-text-request-transform.d.ts +0 -13
- package/dist/providers/core/runtime/standard-tool-text-request-transform.js +0 -138
- package/dist/providers/core/runtime/standard-tool-text-request-transform.js.map +0 -1
- package/dist/providers/core/runtime/transport/iflow-signer.d.ts +0 -12
- package/dist/providers/core/runtime/transport/iflow-signer.js +0 -63
- package/dist/providers/core/runtime/transport/iflow-signer.js.map +0 -1
- package/dist/providers/profile/families/iflow-profile.d.ts +0 -2
- package/dist/providers/profile/families/iflow-profile.js +0 -384
- package/dist/providers/profile/families/iflow-profile.js.map +0 -1
- package/docs/mapping-tables/iflow-to-openai.json +0 -215
- package/docs/mapping-tables/openai-to-iflow.json +0 -227
- package/docs/multi-token-auth-guide.md +0 -66
- package/docs/oauth-authentication-guide.md +0 -172
- package/docs/oauth-iflow-implementation.md +0 -157
- package/docs/release-iflow-400-gate.md +0 -58
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-cli-defaults.d.ts +0 -10
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-cli-defaults.js +0 -31
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.d.ts +0 -7
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.js +0 -25
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.d.ts +0 -12
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.js +0 -46
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-native-compat.d.ts +0 -6
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-native-compat.js +0 -36
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-response-body-unwrap.d.ts +0 -9
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-response-body-unwrap.js +0 -25
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-tool-text-fallback.d.ts +0 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-tool-text-fallback.js +0 -29
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-web-search.d.ts +0 -18
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-web-search.js +0 -49
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/qwenchat-web-request.d.ts +0 -3
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/qwenchat-web-request.js +0 -62
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-iflow.json +0 -353
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-qwenchat-web.json +0 -47
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-health.d.ts +0 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-health.js +0 -1
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/iflow-model-error-retry.js +0 -92
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/review.js +0 -202
- package/scripts/publish-rcc.mjs +0 -81
- /package/node_modules/@jsonstudio/llms/dist/servertool/handlers/{iflow-model-error-retry.d.ts → reasoning-stop-guard.d.ts} +0 -0
- /package/node_modules/@jsonstudio/llms/dist/servertool/handlers/{review.d.ts → reasoning-stop.d.ts} +0 -0
|
@@ -1,55 +1,46 @@
|
|
|
1
1
|
import { VirtualRouterError, VirtualRouterErrorCode } from './types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { DEFAULT_LOAD_BALANCING } from './bootstrap/config-defaults.js';
|
|
3
3
|
import { asRecord } from './bootstrap/utils.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { normalizeWebSearch, validateWebSearchRouting } from './bootstrap/web-search-config.js';
|
|
4
|
+
import { bootstrapRoutingWithNative } from './engine-selection/native-virtual-router-bootstrap-routing.js';
|
|
5
|
+
import { bootstrapProviderProfilesWithNative, bootstrapProvidersWithNative } from './engine-selection/native-virtual-router-bootstrap-providers.js';
|
|
6
|
+
import { isNativeDisabledByEnv, makeNativeRequiredError } from './engine-selection/native-router-hotpath-policy.js';
|
|
7
|
+
import { loadNativeRouterHotpathBinding } from './engine-selection/native-router-hotpath-loader.js';
|
|
8
|
+
import { parseVirtualRouterNativeError } from './native-error.js';
|
|
10
9
|
export function bootstrapVirtualRouterConfig(input) {
|
|
11
10
|
const section = extractVirtualRouterSection(input);
|
|
12
11
|
const providersSource = asRecord(section.providers);
|
|
13
12
|
if (!Object.keys(providersSource).length) {
|
|
14
13
|
throw new VirtualRouterError('Virtual Router requires at least one provider in configuration', VirtualRouterErrorCode.CONFIG_ERROR);
|
|
15
14
|
}
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const { profiles: providerProfiles, targetRuntime } = buildProviderProfiles(expandedTargetKeys, runtimeEntries);
|
|
39
|
-
const classifier = normalizeClassifier(section.classifier);
|
|
40
|
-
const loadBalancing = section.loadBalancing ?? DEFAULT_LOAD_BALANCING;
|
|
41
|
-
const health = section.health ?? DEFAULT_HEALTH;
|
|
42
|
-
const contextRouting = section.contextRouting ?? DEFAULT_CONTEXT_ROUTING;
|
|
15
|
+
const providersBootstrap = bootstrapProvidersWithNative({ providersSource });
|
|
16
|
+
const { runtimeEntries, aliasIndex, modelIndex } = providersBootstrap;
|
|
17
|
+
const routingBootstrap = bootstrapRoutingWithNative({
|
|
18
|
+
routingSource: section.routing,
|
|
19
|
+
aliasIndex,
|
|
20
|
+
modelIndex
|
|
21
|
+
});
|
|
22
|
+
const routingSource = routingBootstrap.routingSource;
|
|
23
|
+
const routing = routingBootstrap.routing;
|
|
24
|
+
const providerProfilesBootstrap = bootstrapProviderProfilesWithNative({
|
|
25
|
+
routedTargetKeys: routingBootstrap.targetKeys,
|
|
26
|
+
aliasIndex,
|
|
27
|
+
modelIndex,
|
|
28
|
+
runtimeEntries
|
|
29
|
+
});
|
|
30
|
+
const providerProfiles = providerProfilesBootstrap.profiles;
|
|
31
|
+
const targetRuntime = providerProfilesBootstrap.targetRuntime;
|
|
32
|
+
const configMeta = bootstrapConfigMetaWithNative(section, routingSource);
|
|
33
|
+
const loadBalancing = configMeta.loadBalancing ?? DEFAULT_LOAD_BALANCING;
|
|
43
34
|
const config = {
|
|
44
35
|
routing,
|
|
45
36
|
providers: providerProfiles,
|
|
46
|
-
classifier,
|
|
37
|
+
classifier: configMeta.classifier,
|
|
47
38
|
loadBalancing,
|
|
48
|
-
health,
|
|
49
|
-
contextRouting,
|
|
50
|
-
...(webSearch ? { webSearch } : {}),
|
|
51
|
-
...(execCommandGuard ? { execCommandGuard } : {}),
|
|
52
|
-
...(clock ? { clock } : {})
|
|
39
|
+
...(configMeta.health ? { health: configMeta.health } : {}),
|
|
40
|
+
contextRouting: configMeta.contextRouting,
|
|
41
|
+
...(configMeta.webSearch ? { webSearch: configMeta.webSearch } : {}),
|
|
42
|
+
...(configMeta.execCommandGuard ? { execCommandGuard: configMeta.execCommandGuard } : {}),
|
|
43
|
+
...(configMeta.clock ? { clock: configMeta.clock } : {})
|
|
53
44
|
};
|
|
54
45
|
return {
|
|
55
46
|
config,
|
|
@@ -64,271 +55,49 @@ function extractVirtualRouterSection(input) {
|
|
|
64
55
|
const section = root.virtualrouter && typeof root.virtualrouter === 'object' ? asRecord(root.virtualrouter) : root;
|
|
65
56
|
const providers = asRecord(section.providers ?? root.providers);
|
|
66
57
|
const routing = asRecord(section.routing ?? root.routing);
|
|
67
|
-
const classifier =
|
|
68
|
-
const loadBalancing =
|
|
69
|
-
const health =
|
|
70
|
-
const contextRouting =
|
|
58
|
+
const classifier = section.classifier ?? root.classifier;
|
|
59
|
+
const loadBalancing = section.loadBalancing ?? root.loadBalancing;
|
|
60
|
+
const health = section.health ?? root.health;
|
|
61
|
+
const contextRouting = section.contextRouting ?? root.contextRouting;
|
|
71
62
|
const webSearch = section.webSearch ?? root.webSearch;
|
|
72
63
|
const execCommandGuard = section.execCommandGuard ?? root.execCommandGuard;
|
|
73
64
|
const clock = section.clock ?? root.clock;
|
|
74
65
|
return { providers, routing, classifier, loadBalancing, health, contextRouting, webSearch, execCommandGuard, clock };
|
|
75
66
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const modelIndex = new Map();
|
|
80
|
-
for (const [providerId, providerRaw] of Object.entries(providers)) {
|
|
81
|
-
const normalizedProvider = normalizeProvider(providerId, providerRaw);
|
|
82
|
-
modelIndex.set(providerId, collectProviderModels(providerRaw, normalizedProvider));
|
|
83
|
-
const authEntries = extractProviderAuthEntries(providerId, providerRaw);
|
|
84
|
-
if (!authEntries.length) {
|
|
85
|
-
throw new VirtualRouterError(`Provider ${providerId} requires at least one auth entry`, VirtualRouterErrorCode.CONFIG_ERROR);
|
|
86
|
-
}
|
|
87
|
-
aliasIndex.set(providerId, authEntries.map((entry) => entry.keyAlias));
|
|
88
|
-
for (const entry of authEntries) {
|
|
89
|
-
const runtimeKey = buildRuntimeKey(providerId, entry.keyAlias);
|
|
90
|
-
const runtimeAuth = {
|
|
91
|
-
type: entry.auth.type,
|
|
92
|
-
rawType: entry.auth.rawType,
|
|
93
|
-
oauthProviderId: entry.auth.oauthProviderId,
|
|
94
|
-
secretRef: entry.auth.secretRef,
|
|
95
|
-
value: entry.auth.value,
|
|
96
|
-
tokenFile: entry.auth.tokenFile,
|
|
97
|
-
tokenUrl: entry.auth.tokenUrl,
|
|
98
|
-
deviceCodeUrl: entry.auth.deviceCodeUrl,
|
|
99
|
-
clientId: entry.auth.clientId,
|
|
100
|
-
clientSecret: entry.auth.clientSecret,
|
|
101
|
-
scopes: entry.auth.scopes && entry.auth.scopes.length ? [...entry.auth.scopes] : undefined,
|
|
102
|
-
authorizationUrl: entry.auth.authorizationUrl,
|
|
103
|
-
userInfoUrl: entry.auth.userInfoUrl,
|
|
104
|
-
refreshUrl: entry.auth.refreshUrl
|
|
105
|
-
};
|
|
106
|
-
if (!runtimeAuth.tokenFile && (runtimeAuth.rawType?.includes('oauth') || runtimeAuth.type === 'oauth')) {
|
|
107
|
-
runtimeAuth.tokenFile = entry.keyAlias;
|
|
108
|
-
}
|
|
109
|
-
if (runtimeAuth.type === 'apiKey' && !runtimeAuth.secretRef) {
|
|
110
|
-
runtimeAuth.secretRef = `${providerId}.${entry.keyAlias}`;
|
|
111
|
-
}
|
|
112
|
-
runtimeEntries[runtimeKey] = {
|
|
113
|
-
runtimeKey,
|
|
114
|
-
providerId,
|
|
115
|
-
keyAlias: entry.keyAlias,
|
|
116
|
-
providerType: normalizedProvider.providerType,
|
|
117
|
-
endpoint: normalizedProvider.endpoint,
|
|
118
|
-
headers: normalizedProvider.headers,
|
|
119
|
-
auth: runtimeAuth,
|
|
120
|
-
...(normalizedProvider.enabled !== undefined ? { enabled: normalizedProvider.enabled } : {}),
|
|
121
|
-
outboundProfile: normalizedProvider.outboundProfile,
|
|
122
|
-
compatibilityProfile: normalizedProvider.compatibilityProfile,
|
|
123
|
-
processMode: normalizedProvider.processMode,
|
|
124
|
-
responsesConfig: normalizedProvider.responsesConfig,
|
|
125
|
-
streaming: normalizedProvider.streaming,
|
|
126
|
-
modelStreaming: normalizedProvider.modelStreaming,
|
|
127
|
-
modelOutputTokens: normalizedProvider.modelOutputTokens,
|
|
128
|
-
defaultOutputTokens: normalizedProvider.defaultOutputTokens,
|
|
129
|
-
modelContextTokens: normalizedProvider.modelContextTokens,
|
|
130
|
-
defaultContextTokens: normalizedProvider.defaultContextTokens,
|
|
131
|
-
modelAnthropicThinkingConfig: normalizedProvider.modelAnthropicThinkingConfig,
|
|
132
|
-
defaultAnthropicThinkingConfig: normalizedProvider.defaultAnthropicThinkingConfig,
|
|
133
|
-
modelAnthropicThinking: normalizedProvider.modelAnthropicThinking,
|
|
134
|
-
defaultAnthropicThinking: normalizedProvider.defaultAnthropicThinking,
|
|
135
|
-
modelAnthropicThinkingBudgets: normalizedProvider.modelAnthropicThinkingBudgets,
|
|
136
|
-
defaultAnthropicThinkingBudgets: normalizedProvider.defaultAnthropicThinkingBudgets,
|
|
137
|
-
...(normalizedProvider.deepseek ? { deepseek: normalizedProvider.deepseek } : {}),
|
|
138
|
-
...(normalizedProvider.serverToolsDisabled ? { serverToolsDisabled: true } : {}),
|
|
139
|
-
...(normalizedProvider.modelCapabilities ? { modelCapabilities: normalizedProvider.modelCapabilities } : {})
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return { runtimeEntries, aliasIndex, modelIndex };
|
|
144
|
-
}
|
|
145
|
-
function collectProviderModels(providerRaw, _normalizedProvider) {
|
|
146
|
-
const rawModelsNode = providerRaw.models;
|
|
147
|
-
const modelsDeclared = rawModelsNode !== undefined;
|
|
148
|
-
const collected = new Set();
|
|
149
|
-
if (Array.isArray(rawModelsNode)) {
|
|
150
|
-
for (const model of rawModelsNode) {
|
|
151
|
-
if (!model || typeof model !== 'object') {
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
const modelObj = model;
|
|
155
|
-
const modelId = typeof modelObj.id === 'string' ? modelObj.id.trim() : '';
|
|
156
|
-
if (modelId) {
|
|
157
|
-
collected.add(modelId);
|
|
158
|
-
}
|
|
159
|
-
const aliasesNode = Array.isArray(modelObj.aliases)
|
|
160
|
-
? modelObj.aliases
|
|
161
|
-
: [];
|
|
162
|
-
for (const alias of aliasesNode) {
|
|
163
|
-
if (typeof alias !== 'string') {
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
const normalizedAlias = alias.trim();
|
|
167
|
-
if (normalizedAlias) {
|
|
168
|
-
collected.add(normalizedAlias);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
const modelsNode = asRecord(rawModelsNode);
|
|
175
|
-
for (const [modelName, modelConfigRaw] of Object.entries(modelsNode)) {
|
|
176
|
-
const normalizedModelName = typeof modelName === 'string' ? modelName.trim() : '';
|
|
177
|
-
if (normalizedModelName) {
|
|
178
|
-
collected.add(normalizedModelName);
|
|
179
|
-
}
|
|
180
|
-
const modelConfig = asRecord(modelConfigRaw);
|
|
181
|
-
const aliasesNode = Array.isArray(modelConfig.aliases)
|
|
182
|
-
? modelConfig.aliases
|
|
183
|
-
: [];
|
|
184
|
-
for (const alias of aliasesNode) {
|
|
185
|
-
if (typeof alias !== 'string') {
|
|
186
|
-
continue;
|
|
187
|
-
}
|
|
188
|
-
const normalizedAlias = alias.trim();
|
|
189
|
-
if (normalizedAlias) {
|
|
190
|
-
collected.add(normalizedAlias);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
67
|
+
function requireNativeBootstrapConfigFunction(exportName) {
|
|
68
|
+
if (isNativeDisabledByEnv()) {
|
|
69
|
+
throw makeNativeRequiredError(exportName, 'native disabled');
|
|
194
70
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return {
|
|
200
|
-
longContextThresholdTokens: typeof normalized.longContextThresholdTokens === 'number'
|
|
201
|
-
? normalized.longContextThresholdTokens
|
|
202
|
-
: DEFAULT_CLASSIFIER.longContextThresholdTokens,
|
|
203
|
-
thinkingKeywords: normalizeStringArray(normalized.thinkingKeywords, DEFAULT_CLASSIFIER.thinkingKeywords),
|
|
204
|
-
codingKeywords: normalizeStringArray(normalized.codingKeywords, DEFAULT_CLASSIFIER.codingKeywords),
|
|
205
|
-
backgroundKeywords: normalizeStringArray(normalized.backgroundKeywords, DEFAULT_CLASSIFIER.backgroundKeywords)
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function normalizeStringArray(value, fallback) {
|
|
209
|
-
if (!Array.isArray(value)) {
|
|
210
|
-
return [...fallback];
|
|
71
|
+
const binding = loadNativeRouterHotpathBinding();
|
|
72
|
+
const fn = binding?.[exportName];
|
|
73
|
+
if (typeof fn !== 'function') {
|
|
74
|
+
throw makeNativeRequiredError(exportName);
|
|
211
75
|
}
|
|
212
|
-
|
|
213
|
-
return normalized.length ? normalized : [...fallback];
|
|
76
|
+
return fn;
|
|
214
77
|
}
|
|
215
|
-
function
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const weightsRaw = asRecord(record.weights);
|
|
221
|
-
const weightsEntries = {};
|
|
222
|
-
for (const [key, value] of Object.entries(weightsRaw)) {
|
|
223
|
-
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
224
|
-
weightsEntries[key] = value;
|
|
225
|
-
}
|
|
78
|
+
function bootstrapConfigMetaWithNative(section, routingSource) {
|
|
79
|
+
const fn = requireNativeBootstrapConfigFunction('bootstrapVirtualRouterConfigMetaJson');
|
|
80
|
+
let raw;
|
|
81
|
+
try {
|
|
82
|
+
raw = fn(JSON.stringify(section), JSON.stringify(routingSource));
|
|
226
83
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
? { recoverToBestOnRetry: healthWeightedRaw.recoverToBestOnRetry }
|
|
233
|
-
: {}),
|
|
234
|
-
...(typeof healthWeightedRaw.baseWeight === 'number' && Number.isFinite(healthWeightedRaw.baseWeight)
|
|
235
|
-
? { baseWeight: healthWeightedRaw.baseWeight }
|
|
236
|
-
: {}),
|
|
237
|
-
...(typeof healthWeightedRaw.minMultiplier === 'number' && Number.isFinite(healthWeightedRaw.minMultiplier)
|
|
238
|
-
? { minMultiplier: healthWeightedRaw.minMultiplier }
|
|
239
|
-
: {}),
|
|
240
|
-
...(typeof healthWeightedRaw.beta === 'number' && Number.isFinite(healthWeightedRaw.beta)
|
|
241
|
-
? { beta: healthWeightedRaw.beta }
|
|
242
|
-
: {}),
|
|
243
|
-
...(typeof healthWeightedRaw.halfLifeMs === 'number' && Number.isFinite(healthWeightedRaw.halfLifeMs)
|
|
244
|
-
? { halfLifeMs: healthWeightedRaw.halfLifeMs }
|
|
245
|
-
: {})
|
|
246
|
-
}
|
|
247
|
-
: undefined;
|
|
248
|
-
const contextWeightedRaw = asRecord(record.contextWeighted);
|
|
249
|
-
const contextWeighted = Object.keys(contextWeightedRaw).length > 0
|
|
250
|
-
? {
|
|
251
|
-
...(typeof contextWeightedRaw.enabled === 'boolean' ? { enabled: contextWeightedRaw.enabled } : {}),
|
|
252
|
-
...(typeof contextWeightedRaw.clientCapTokens === 'number' && Number.isFinite(contextWeightedRaw.clientCapTokens)
|
|
253
|
-
? { clientCapTokens: contextWeightedRaw.clientCapTokens }
|
|
254
|
-
: {}),
|
|
255
|
-
...(typeof contextWeightedRaw.gamma === 'number' && Number.isFinite(contextWeightedRaw.gamma)
|
|
256
|
-
? { gamma: contextWeightedRaw.gamma }
|
|
257
|
-
: {}),
|
|
258
|
-
...(typeof contextWeightedRaw.maxMultiplier === 'number' && Number.isFinite(contextWeightedRaw.maxMultiplier)
|
|
259
|
-
? { maxMultiplier: contextWeightedRaw.maxMultiplier }
|
|
260
|
-
: {})
|
|
261
|
-
}
|
|
262
|
-
: undefined;
|
|
263
|
-
const aliasSelection = normalizeAliasSelection(record.aliasSelection);
|
|
264
|
-
const hasNonStrategyConfig = Object.keys(weightsEntries).length > 0 ||
|
|
265
|
-
Boolean(healthWeighted) ||
|
|
266
|
-
Boolean(contextWeighted) ||
|
|
267
|
-
Boolean(aliasSelection);
|
|
268
|
-
if (!strategyRaw && !hasNonStrategyConfig) {
|
|
269
|
-
return undefined;
|
|
84
|
+
catch (error) {
|
|
85
|
+
const virtualRouterError = parseVirtualRouterNativeError(error);
|
|
86
|
+
if (virtualRouterError)
|
|
87
|
+
throw virtualRouterError;
|
|
88
|
+
throw error;
|
|
270
89
|
}
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
...(Object.keys(weightsEntries).length ? { weights: weightsEntries } : {}),
|
|
275
|
-
...(aliasSelection ? { aliasSelection } : {}),
|
|
276
|
-
...(healthWeighted ? { healthWeighted } : {}),
|
|
277
|
-
...(contextWeighted ? { contextWeighted } : {})
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
function normalizeAliasSelection(raw) {
|
|
281
|
-
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
282
|
-
return undefined;
|
|
90
|
+
const returnedVirtualRouterError = parseVirtualRouterNativeError(raw);
|
|
91
|
+
if (returnedVirtualRouterError) {
|
|
92
|
+
throw returnedVirtualRouterError;
|
|
283
93
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
const defaultStrategy = coerceAliasSelectionStrategy(record.defaultStrategy);
|
|
287
|
-
const sessionLeaseCooldownMs = typeof record.sessionLeaseCooldownMs === 'number' && Number.isFinite(record.sessionLeaseCooldownMs)
|
|
288
|
-
? Math.max(0, Math.floor(record.sessionLeaseCooldownMs))
|
|
289
|
-
: typeof record.sessionLease_cooldown_ms === 'number' &&
|
|
290
|
-
Number.isFinite(record.sessionLease_cooldown_ms)
|
|
291
|
-
? Math.max(0, Math.floor(record.sessionLease_cooldown_ms))
|
|
292
|
-
: undefined;
|
|
293
|
-
const antigravitySessionBindingRaw = typeof record.antigravitySessionBinding === 'string'
|
|
294
|
-
? record.antigravitySessionBinding.trim().toLowerCase()
|
|
295
|
-
: typeof record.antigravity_session_binding === 'string'
|
|
296
|
-
? String(record.antigravity_session_binding).trim().toLowerCase()
|
|
297
|
-
: '';
|
|
298
|
-
const antigravitySessionBinding = antigravitySessionBindingRaw === 'strict'
|
|
299
|
-
? 'strict'
|
|
300
|
-
: antigravitySessionBindingRaw === 'lease'
|
|
301
|
-
? 'lease'
|
|
302
|
-
: undefined;
|
|
303
|
-
const providersRaw = asRecord(record.providers);
|
|
304
|
-
const providers = {};
|
|
305
|
-
for (const [providerId, value] of Object.entries(providersRaw)) {
|
|
306
|
-
const strategy = coerceAliasSelectionStrategy(value);
|
|
307
|
-
if (strategy) {
|
|
308
|
-
providers[providerId] = strategy;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
const out = {
|
|
312
|
-
...(enabled !== undefined ? { enabled } : {}),
|
|
313
|
-
...(defaultStrategy ? { defaultStrategy } : {}),
|
|
314
|
-
...(sessionLeaseCooldownMs !== undefined ? { sessionLeaseCooldownMs } : {}),
|
|
315
|
-
...(antigravitySessionBinding ? { antigravitySessionBinding } : {}),
|
|
316
|
-
...(Object.keys(providers).length ? { providers } : {})
|
|
317
|
-
};
|
|
318
|
-
return Object.keys(out).length ? out : undefined;
|
|
319
|
-
}
|
|
320
|
-
function coerceAliasSelectionStrategy(value) {
|
|
321
|
-
if (typeof value !== 'string') {
|
|
322
|
-
return undefined;
|
|
94
|
+
if (typeof raw !== 'string' || !raw) {
|
|
95
|
+
throw new VirtualRouterError('Virtual router native config bootstrap returned empty payload', VirtualRouterErrorCode.CONFIG_ERROR);
|
|
323
96
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
return undefined;
|
|
97
|
+
try {
|
|
98
|
+
return JSON.parse(raw);
|
|
327
99
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
if (normalized === 'sticky-queue' || normalized === 'sticky_queue' || normalized === 'stickyqueue') {
|
|
331
|
-
return 'sticky-queue';
|
|
100
|
+
catch {
|
|
101
|
+
throw new VirtualRouterError('Virtual router native config bootstrap returned invalid payload', VirtualRouterErrorCode.CONFIG_ERROR);
|
|
332
102
|
}
|
|
333
|
-
return undefined;
|
|
334
103
|
}
|
|
@@ -10,25 +10,24 @@ export class RoutingClassifier {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
classify(features) {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const serverToolRequired = features.metadata?.serverToolRequired === true;
|
|
13
|
+
const latestMessageFromUser = features.latestMessageFromUser === true;
|
|
14
|
+
const lastToolCategory = latestMessageFromUser ? undefined : features.lastAssistantToolCategory;
|
|
16
15
|
const webSearchContinuation = lastToolCategory === 'websearch';
|
|
17
16
|
const localToolContinuation = lastToolCategory === 'read' ||
|
|
18
17
|
lastToolCategory === 'write' ||
|
|
19
18
|
lastToolCategory === 'search' ||
|
|
20
19
|
lastToolCategory === 'other';
|
|
21
|
-
const webSearchFromIntent = !localToolContinuation && webSearchIntent;
|
|
22
|
-
const webSearchDeclaredOrRequired = !localToolContinuation && serverToolRequired;
|
|
23
20
|
const reachedLongContext = features.estimatedTokens >= (this.config.longContextThresholdTokens ?? DEFAULT_LONG_CONTEXT_THRESHOLD);
|
|
24
|
-
const
|
|
21
|
+
const hasToolActivity = features.hasTools || (!latestMessageFromUser && features.hasToolCallResponses);
|
|
25
22
|
const thinkingContinuation = lastToolCategory === 'read';
|
|
23
|
+
// Jason 规则:当前轮是用户输入时始终优先 thinking,
|
|
24
|
+
// 但不再引用历史 last-tool continuation 影响本轮判断。
|
|
25
|
+
// (tools 仍可作为并行诊断信号,避免“thinking 与 tools 冲突”)
|
|
26
26
|
const thinkingFromUser = latestMessageFromUser;
|
|
27
27
|
const thinkingFromRead = !thinkingFromUser && thinkingContinuation;
|
|
28
28
|
const codingContinuation = lastToolCategory === 'write';
|
|
29
29
|
const searchContinuation = lastToolCategory === 'search';
|
|
30
30
|
const toolsContinuation = lastToolCategory === 'other';
|
|
31
|
-
const hasToolActivity = features.hasTools || features.hasToolCallResponses;
|
|
32
31
|
const hasRemoteVideoAttachment = features.hasVideoAttachment === true && features.hasRemoteVideoAttachment === true;
|
|
33
32
|
const evaluationMap = {
|
|
34
33
|
video: {
|
|
@@ -52,18 +51,11 @@ export class RoutingClassifier {
|
|
|
52
51
|
reason: 'coding:last-tool-write'
|
|
53
52
|
},
|
|
54
53
|
web_search: {
|
|
55
|
-
// web_search
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
webSearchDeclaredOrRequired ||
|
|
61
|
-
webSearchFromIntent,
|
|
62
|
-
reason: webSearchContinuation
|
|
63
|
-
? 'web_search:last-tool-websearch'
|
|
64
|
-
: webSearchDeclaredOrRequired && serverToolRequired
|
|
65
|
-
? 'web_search:servertool-required'
|
|
66
|
-
: 'web_search:intent-keyword'
|
|
54
|
+
// web_search 路由只允许由显式 web_search 工具链续写命中。
|
|
55
|
+
// 不再因为用户“想联网搜索”或 serverToolRequired 自动切到 web_search,
|
|
56
|
+
// 以避免产生隐式联网流量;首次显式工具请求仍走 tools 路由。
|
|
57
|
+
triggered: !localToolContinuation && webSearchContinuation,
|
|
58
|
+
reason: 'web_search:last-tool-websearch'
|
|
67
59
|
},
|
|
68
60
|
search: {
|
|
69
61
|
// search 路由:仅在上一轮 assistant 使用 search 类工具时继续命中,
|
|
@@ -121,69 +113,6 @@ export class RoutingClassifier {
|
|
|
121
113
|
return index >= 0 ? index : ROUTE_PRIORITY.length;
|
|
122
114
|
}
|
|
123
115
|
}
|
|
124
|
-
function detectWebSearchIntent(text) {
|
|
125
|
-
if (!text || !text.trim()) {
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
const normalized = text.toLowerCase();
|
|
129
|
-
if (isNegativeWebSearchContext(normalized, text)) {
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
const directKeywords = [
|
|
133
|
-
'web search',
|
|
134
|
-
'web_search',
|
|
135
|
-
'websearch',
|
|
136
|
-
'search the web',
|
|
137
|
-
'internet search',
|
|
138
|
-
'搜索网页',
|
|
139
|
-
'联网搜索',
|
|
140
|
-
'上网搜索',
|
|
141
|
-
'上网查',
|
|
142
|
-
'网上搜',
|
|
143
|
-
'谷歌搜索',
|
|
144
|
-
'google search'
|
|
145
|
-
];
|
|
146
|
-
if (directKeywords.some((keyword) => normalized.includes(keyword))) {
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
const enVerb = ['search', 'find', 'lookup', 'look up', 'google'];
|
|
150
|
-
const enNoun = ['web', 'internet', 'online', 'google', 'bing'];
|
|
151
|
-
const hasEnVerb = enVerb.some((keyword) => normalized.includes(keyword));
|
|
152
|
-
const hasEnNoun = enNoun.some((keyword) => normalized.includes(keyword));
|
|
153
|
-
if (hasEnVerb && hasEnNoun) {
|
|
154
|
-
return true;
|
|
155
|
-
}
|
|
156
|
-
const zhVerb = ['搜索', '查找', '搜', '上网查', '上网搜', '联网查', '联网搜'];
|
|
157
|
-
const zhNoun = ['网络', '联网', '网页', '网上', '互联网', '谷歌', '百度'];
|
|
158
|
-
const hasZhVerb = zhVerb.some((keyword) => text.includes(keyword));
|
|
159
|
-
const hasZhNoun = zhNoun.some((keyword) => text.includes(keyword));
|
|
160
|
-
if ((text.includes('上网') || text.includes('联网')) && (text.includes('搜') || text.includes('查'))) {
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
if (hasZhVerb && hasZhNoun) {
|
|
164
|
-
return true;
|
|
165
|
-
}
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
function isNegativeWebSearchContext(normalized, originalText) {
|
|
169
|
-
const englishPatterns = [
|
|
170
|
-
/prefer\s+resources?\s+over\s+web[\s_-]?search/u,
|
|
171
|
-
/prefer[\s\S]{0,40}web[\s_-]?search/u,
|
|
172
|
-
/do\s+not[\s\S]{0,20}web[\s_-]?search/u,
|
|
173
|
-
/don't[\s\S]{0,20}web[\s_-]?search/u,
|
|
174
|
-
/without[\s\S]{0,20}web[\s_-]?search/u,
|
|
175
|
-
/cannot[\s\S]{0,20}web[\s_-]?search/u
|
|
176
|
-
];
|
|
177
|
-
if (englishPatterns.some((pattern) => pattern.test(normalized))) {
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
const chinesePatterns = [
|
|
181
|
-
/不能.{0,20}(上网|联网|web[_ -]?search|搜索网页)/u,
|
|
182
|
-
/不要.{0,20}(上网|联网|web[_ -]?search|搜索网页)/u,
|
|
183
|
-
/避免.{0,20}(上网|联网|web[_ -]?search|搜索网页)/u
|
|
184
|
-
];
|
|
185
|
-
return chinesePatterns.some((pattern) => pattern.test(originalText));
|
|
186
|
-
}
|
|
187
116
|
function normalizeList(source, fallback) {
|
|
188
117
|
if (!source || source.length === 0) {
|
|
189
118
|
return fallback;
|
package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/antigravity/alias-lease.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { resolveRccPath, resolveRccPathForRead } from '../../../../runtime/user-data-paths.js';
|
|
4
|
+
function formatUnknownError(error) {
|
|
5
|
+
if (error instanceof Error) {
|
|
6
|
+
return error.stack || `${error.name}: ${error.message}`;
|
|
7
|
+
}
|
|
8
|
+
try {
|
|
9
|
+
return JSON.stringify(error);
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return String(error);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function logAliasLeaseNonBlockingError(stage, error, details) {
|
|
16
|
+
try {
|
|
17
|
+
const suffix = details && Object.keys(details).length > 0 ? ` details=${JSON.stringify(details)}` : '';
|
|
18
|
+
console.warn(`[alias-lease] ${stage} failed (non-blocking): ${formatUnknownError(error)}${suffix}`);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
void 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
4
24
|
export function resolveAntigravityAliasReuseCooldownMs(config) {
|
|
5
25
|
const cfg = config.loadBalancing?.aliasSelection?.sessionLeaseCooldownMs;
|
|
6
26
|
if (typeof cfg === 'number' && Number.isFinite(cfg)) {
|
|
@@ -17,7 +37,8 @@ function resolveAntigravityLeaseScope(providerRegistry, providerKey) {
|
|
|
17
37
|
}
|
|
18
38
|
return null;
|
|
19
39
|
}
|
|
20
|
-
catch {
|
|
40
|
+
catch (resolveScopeError) {
|
|
41
|
+
logAliasLeaseNonBlockingError('resolveAntigravityLeaseScope', resolveScopeError, { providerKey });
|
|
21
42
|
return null;
|
|
22
43
|
}
|
|
23
44
|
}
|
|
@@ -53,7 +74,8 @@ function resolveAntigravityAliasLeasePersistWritePath() {
|
|
|
53
74
|
}
|
|
54
75
|
return resolveRccPath('state', 'antigravity-alias-leases.json');
|
|
55
76
|
}
|
|
56
|
-
catch {
|
|
77
|
+
catch (resolveWritePathError) {
|
|
78
|
+
logAliasLeaseNonBlockingError('resolveAntigravityAliasLeasePersistWritePath', resolveWritePathError);
|
|
57
79
|
return null;
|
|
58
80
|
}
|
|
59
81
|
}
|
|
@@ -66,7 +88,8 @@ function resolveAntigravityAliasLeasePersistReadPath() {
|
|
|
66
88
|
const resolved = resolveRccPathForRead('state', 'antigravity-alias-leases.json');
|
|
67
89
|
return fs.existsSync(resolved) ? resolved : writePath;
|
|
68
90
|
}
|
|
69
|
-
catch {
|
|
91
|
+
catch (resolveReadPathError) {
|
|
92
|
+
logAliasLeaseNonBlockingError('resolveAntigravityAliasLeasePersistReadPath', resolveReadPathError);
|
|
70
93
|
return null;
|
|
71
94
|
}
|
|
72
95
|
}
|
|
@@ -80,7 +103,8 @@ export function hydrateAntigravityAliasLeaseStoreIfNeeded(options) {
|
|
|
80
103
|
try {
|
|
81
104
|
stat = fs.statSync(filePath);
|
|
82
105
|
}
|
|
83
|
-
catch {
|
|
106
|
+
catch (statError) {
|
|
107
|
+
logAliasLeaseNonBlockingError('hydrateAntigravityAliasLeaseStoreIfNeeded.statSync', statError, { filePath });
|
|
84
108
|
options.persistence.loadedOnce = true;
|
|
85
109
|
options.persistence.loadedMtimeMs = null;
|
|
86
110
|
return;
|
|
@@ -93,7 +117,8 @@ export function hydrateAntigravityAliasLeaseStoreIfNeeded(options) {
|
|
|
93
117
|
try {
|
|
94
118
|
parsed = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
95
119
|
}
|
|
96
|
-
catch {
|
|
120
|
+
catch (readError) {
|
|
121
|
+
logAliasLeaseNonBlockingError('hydrateAntigravityAliasLeaseStoreIfNeeded.readParse', readError, { filePath });
|
|
97
122
|
options.persistence.loadedOnce = true;
|
|
98
123
|
options.persistence.loadedMtimeMs = mtimeMs;
|
|
99
124
|
return;
|
|
@@ -152,8 +177,8 @@ function flushAntigravityAliasLeaseStoreSync(options) {
|
|
|
152
177
|
try {
|
|
153
178
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
154
179
|
}
|
|
155
|
-
catch {
|
|
156
|
-
|
|
180
|
+
catch (mkdirError) {
|
|
181
|
+
logAliasLeaseNonBlockingError('flushAntigravityAliasLeaseStoreSync.mkdirSync', mkdirError, { filePath });
|
|
157
182
|
}
|
|
158
183
|
const now = Date.now();
|
|
159
184
|
const cooldownMs = options.aliasReuseCooldownMs;
|
|
@@ -177,12 +202,12 @@ function flushAntigravityAliasLeaseStoreSync(options) {
|
|
|
177
202
|
options.persistence.loadedOnce = true;
|
|
178
203
|
options.persistence.loadedMtimeMs = mtimeMs;
|
|
179
204
|
}
|
|
180
|
-
catch {
|
|
181
|
-
|
|
205
|
+
catch (statError) {
|
|
206
|
+
logAliasLeaseNonBlockingError('flushAntigravityAliasLeaseStoreSync.statSync', statError, { filePath });
|
|
182
207
|
}
|
|
183
208
|
}
|
|
184
|
-
catch {
|
|
185
|
-
|
|
209
|
+
catch (flushError) {
|
|
210
|
+
logAliasLeaseNonBlockingError('flushAntigravityAliasLeaseStoreSync.writeRename', flushError, { filePath });
|
|
186
211
|
}
|
|
187
212
|
}
|
|
188
213
|
function scheduleAntigravityAliasLeaseStoreFlush(options) {
|
|
@@ -211,8 +236,8 @@ export function recordAntigravitySessionLease(options) {
|
|
|
211
236
|
}
|
|
212
237
|
}
|
|
213
238
|
}
|
|
214
|
-
catch {
|
|
215
|
-
|
|
239
|
+
catch (metadataError) {
|
|
240
|
+
logAliasLeaseNonBlockingError('recordAntigravitySessionLease.metadataOverrideParse', metadataError);
|
|
216
241
|
}
|
|
217
242
|
const sessionKey = options.sessionKey;
|
|
218
243
|
if (!sessionKey) {
|
|
@@ -251,7 +276,9 @@ export function recordAntigravitySessionLease(options) {
|
|
|
251
276
|
prev: existing?.sessionKey ?? null
|
|
252
277
|
});
|
|
253
278
|
}
|
|
254
|
-
catch {
|
|
255
|
-
|
|
279
|
+
catch (debugLogError) {
|
|
280
|
+
logAliasLeaseNonBlockingError('recordAntigravitySessionLease.debugLog', debugLogError, {
|
|
281
|
+
runtimeKey
|
|
282
|
+
});
|
|
256
283
|
}
|
|
257
284
|
}
|