@jsonstudio/rcc 0.90.872 → 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/standard-tool-text-harvest.js +10 -2
- package/dist/providers/core/runtime/standard-tool-text-harvest.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 +176 -19
- 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/node-support.js +5 -2
- 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 +269 -12
- 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/monitor/memory-guard.mjs +207 -0
- 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 -130
- 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
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compat Profile Registry — loader and lookup.
|
|
3
|
+
*
|
|
4
|
+
* Parallel implementation (Step A). Loads all profile JSON files from disk,
|
|
5
|
+
* applies extended fields (headerPolicies, policyOverrides), and exposes
|
|
6
|
+
* a typed registry for downstream consumers.
|
|
7
|
+
*
|
|
8
|
+
* This is the THIN SHELL layer. The heavy validation (schema enforcement,
|
|
9
|
+
* action registration checks) will move to Rust per Guard #8.
|
|
10
|
+
* For now, we do minimal structural validation and fail-fast on missing data.
|
|
11
|
+
*/
|
|
12
|
+
import fs from 'node:fs';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
function getProfilesDir() {
|
|
16
|
+
return path.join(getCompatDir(), 'profiles');
|
|
17
|
+
}
|
|
18
|
+
function findPackageRoot(startDir) {
|
|
19
|
+
let current = startDir;
|
|
20
|
+
while (true) {
|
|
21
|
+
if (fs.existsSync(path.join(current, 'package.json'))) {
|
|
22
|
+
return current;
|
|
23
|
+
}
|
|
24
|
+
const parent = path.dirname(current);
|
|
25
|
+
if (parent === current) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
current = parent;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function findCompatDirFromModule() {
|
|
32
|
+
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
33
|
+
const packageRoot = findPackageRoot(moduleDir);
|
|
34
|
+
if (!packageRoot) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const candidates = [
|
|
38
|
+
path.join(packageRoot, 'dist', 'conversion', 'compat'),
|
|
39
|
+
path.join(packageRoot, 'src', 'conversion', 'compat')
|
|
40
|
+
];
|
|
41
|
+
for (const candidate of candidates) {
|
|
42
|
+
if (fs.existsSync(path.join(candidate, 'profiles'))) {
|
|
43
|
+
return candidate;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
function findCompatDirFromCwd() {
|
|
49
|
+
let current = process.cwd();
|
|
50
|
+
while (true) {
|
|
51
|
+
const candidates = [
|
|
52
|
+
path.join(current, 'src', 'conversion', 'compat'),
|
|
53
|
+
path.join(current, 'sharedmodule', 'llmswitch-core', 'src', 'conversion', 'compat'),
|
|
54
|
+
path.join(current, 'dist', 'conversion', 'compat'),
|
|
55
|
+
path.join(current, 'sharedmodule', 'llmswitch-core', 'dist', 'conversion', 'compat')
|
|
56
|
+
];
|
|
57
|
+
for (const candidate of candidates) {
|
|
58
|
+
if (fs.existsSync(path.join(candidate, 'profiles'))) {
|
|
59
|
+
return candidate;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const parent = path.dirname(current);
|
|
63
|
+
if (parent === current) {
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
current = parent;
|
|
67
|
+
}
|
|
68
|
+
throw new Error(`[CompatProfileRegistry] unable to locate compat directory from cwd=${process.cwd()}`);
|
|
69
|
+
}
|
|
70
|
+
function getCompatDir() {
|
|
71
|
+
const fromModule = findCompatDirFromModule();
|
|
72
|
+
if (fromModule) {
|
|
73
|
+
return fromModule;
|
|
74
|
+
}
|
|
75
|
+
return findCompatDirFromCwd();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Load all compat profile JSON files from the profiles directory.
|
|
79
|
+
* Returns a registry with profiles keyed by id.
|
|
80
|
+
*
|
|
81
|
+
* Fails fast on:
|
|
82
|
+
* - Missing or unreadable profiles directory
|
|
83
|
+
* - Invalid JSON in any profile file
|
|
84
|
+
* - Profile missing 'id' or 'protocol' fields
|
|
85
|
+
*/
|
|
86
|
+
export function loadCompatProfileRegistry(profilesDir) {
|
|
87
|
+
const dir = profilesDir ?? getProfilesDir();
|
|
88
|
+
if (!fs.existsSync(dir)) {
|
|
89
|
+
throw new Error(`[CompatProfileRegistry] profiles directory not found: ${dir}`);
|
|
90
|
+
}
|
|
91
|
+
const files = fs.readdirSync(dir).filter(f => f.endsWith('.json'));
|
|
92
|
+
const profiles = new Map();
|
|
93
|
+
for (const file of files) {
|
|
94
|
+
const filePath = path.join(dir, file);
|
|
95
|
+
const raw = fs.readFileSync(filePath, 'utf-8');
|
|
96
|
+
let entry;
|
|
97
|
+
try {
|
|
98
|
+
entry = JSON.parse(raw);
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
throw new Error(`[CompatProfileRegistry] invalid JSON in ${filePath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
102
|
+
}
|
|
103
|
+
if (typeof entry.id !== 'string' || !entry.id.trim()) {
|
|
104
|
+
throw new Error(`[CompatProfileRegistry] profile in ${filePath} is missing required field 'id'`);
|
|
105
|
+
}
|
|
106
|
+
if (typeof entry.protocol !== 'string') {
|
|
107
|
+
throw new Error(`[CompatProfileRegistry] profile "${entry.id}" in ${filePath} has invalid field 'protocol' (must be a string)`);
|
|
108
|
+
}
|
|
109
|
+
const profile = entry;
|
|
110
|
+
if (profiles.has(profile.id)) {
|
|
111
|
+
throw new Error(`[CompatProfileRegistry] duplicate profile id "${profile.id}" in ${filePath} (already loaded from another file)`);
|
|
112
|
+
}
|
|
113
|
+
profiles.set(profile.id, profile);
|
|
114
|
+
}
|
|
115
|
+
// Load provider-resolution-config.json (provider type / outbound / compat profile resolution)
|
|
116
|
+
const compatDir = profilesDir ? path.dirname(dir) : getCompatDir();
|
|
117
|
+
const configPath = path.join(compatDir, 'provider-resolution-config.json');
|
|
118
|
+
let providerResolutionConfig;
|
|
119
|
+
if (fs.existsSync(configPath)) {
|
|
120
|
+
const configRaw = fs.readFileSync(configPath, 'utf-8');
|
|
121
|
+
try {
|
|
122
|
+
providerResolutionConfig = JSON.parse(configRaw);
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
throw new Error(`[CompatProfileRegistry] invalid JSON in ${configPath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return { profiles, providerBlocks: [], providerResolutionConfig };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Look up a profile by id. Throws if not found (fail-fast, no fallback).
|
|
132
|
+
*/
|
|
133
|
+
export function getProfile(registry, profileId) {
|
|
134
|
+
const entry = registry.profiles.get(profileId);
|
|
135
|
+
if (!entry) {
|
|
136
|
+
throw new Error(`[CompatProfileRegistry] profile not found: "${profileId}". ` +
|
|
137
|
+
`Available: ${[...registry.profiles.keys()].join(', ')}`);
|
|
138
|
+
}
|
|
139
|
+
return entry;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get header policy rules for a profile (empty array if none).
|
|
143
|
+
*/
|
|
144
|
+
export function getHeaderPolicies(registry, profileId) {
|
|
145
|
+
const entry = getProfile(registry, profileId);
|
|
146
|
+
return entry.headerPolicies ?? [];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Get policy overrides for a profile (undefined if none).
|
|
150
|
+
*/
|
|
151
|
+
export function getPolicyOverrides(registry, profileId) {
|
|
152
|
+
const entry = getProfile(registry, profileId);
|
|
153
|
+
return entry.policyOverrides;
|
|
154
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compat Profile Registry — type definitions.
|
|
3
|
+
*
|
|
4
|
+
* Parallel implementation (Step A). These types describe the NEW config-driven
|
|
5
|
+
* header policy and policy override structures. They do NOT affect existing
|
|
6
|
+
* runtime code until Step B wires them in.
|
|
7
|
+
*/
|
|
8
|
+
export interface HeaderPolicyWhen {
|
|
9
|
+
/** Match when the provider ID (lowercase) equals this value. */
|
|
10
|
+
providerId?: string;
|
|
11
|
+
/** Match when the provider type (lowercase) contains this substring. */
|
|
12
|
+
providerTypeContains?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface HeaderPolicyRule {
|
|
15
|
+
/** Condition guard — ALL fields must match for the rule to fire. */
|
|
16
|
+
when: HeaderPolicyWhen;
|
|
17
|
+
/** Headers to set only if the key is NOT already present. */
|
|
18
|
+
setIfMissing?: Record<string, string>;
|
|
19
|
+
/** Headers to unconditionally set (overwrite). */
|
|
20
|
+
set?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export interface PolicyPhaseOverride {
|
|
23
|
+
/** When true, policy observation/enforcement is skipped for this profile. */
|
|
24
|
+
skip: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface PolicyOverrideConfig {
|
|
27
|
+
observe?: PolicyPhaseOverride;
|
|
28
|
+
enforce?: PolicyPhaseOverride;
|
|
29
|
+
}
|
|
30
|
+
export interface CompatProfileEntry {
|
|
31
|
+
id: string;
|
|
32
|
+
protocol: string;
|
|
33
|
+
/** Declarative header injection rules evaluated at provider-normalization time. */
|
|
34
|
+
headerPolicies?: HeaderPolicyRule[];
|
|
35
|
+
/** Policy engine overrides evaluated at hub-policy time. */
|
|
36
|
+
policyOverrides?: PolicyOverrideConfig;
|
|
37
|
+
request?: unknown;
|
|
38
|
+
response?: unknown;
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
}
|
|
41
|
+
export interface ProviderCompatBlock {
|
|
42
|
+
/** Provider ID pattern (lowercase exact match). */
|
|
43
|
+
providerId?: string;
|
|
44
|
+
/** Provider type pattern (lowercase substring match). */
|
|
45
|
+
providerTypeContains?: string;
|
|
46
|
+
/** The compatibility profile ID to resolve to. */
|
|
47
|
+
compatibilityProfile: string;
|
|
48
|
+
/** The outbound wire protocol to resolve to. */
|
|
49
|
+
outboundProfile: string;
|
|
50
|
+
}
|
|
51
|
+
export interface CompatProfileRegistry {
|
|
52
|
+
/** All loaded profiles keyed by id. */
|
|
53
|
+
profiles: Map<string, CompatProfileEntry>;
|
|
54
|
+
/** Provider compat blocks for default-profile resolution. */
|
|
55
|
+
providerBlocks: ProviderCompatBlock[];
|
|
56
|
+
/** Config-driven provider type / outbound / default-profile resolution. */
|
|
57
|
+
providerResolutionConfig?: ProviderResolutionConfig;
|
|
58
|
+
}
|
|
59
|
+
export interface TypeKeywordRule {
|
|
60
|
+
keywords: string[];
|
|
61
|
+
providerType: string;
|
|
62
|
+
}
|
|
63
|
+
export interface CompatibilityProfileBlock {
|
|
64
|
+
providerId?: string;
|
|
65
|
+
providerTypeContains?: string;
|
|
66
|
+
compatibilityProfile: string;
|
|
67
|
+
}
|
|
68
|
+
export interface ProviderResolutionConfig {
|
|
69
|
+
typeKeywords: TypeKeywordRule[];
|
|
70
|
+
defaultProviderType: string;
|
|
71
|
+
outboundProfiles: Record<string, string>;
|
|
72
|
+
defaultOutboundProfile: string;
|
|
73
|
+
compatibilityProfileBlocks: CompatibilityProfileBlock[];
|
|
74
|
+
defaultCompatibilityProfile: string;
|
|
75
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compat Profile Registry — type definitions.
|
|
3
|
+
*
|
|
4
|
+
* Parallel implementation (Step A). These types describe the NEW config-driven
|
|
5
|
+
* header policy and policy override structures. They do NOT affect existing
|
|
6
|
+
* runtime code until Step B wires them in.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/anthropic-claude-code.json
CHANGED
|
@@ -4,14 +4,20 @@
|
|
|
4
4
|
"request": {
|
|
5
5
|
"mappings": [
|
|
6
6
|
{ "action": "snapshot", "phase": "compat-pre" },
|
|
7
|
-
{
|
|
8
|
-
"action": "anthropic_claude_code_system_prompt",
|
|
9
|
-
"config": { "preserveExistingSystemAsUserMessage": true }
|
|
10
|
-
},
|
|
7
|
+
{ "action": "anthropic_claude_code_system_prompt", "config": { "preserveExistingSystemAsUserMessage": true } },
|
|
11
8
|
{ "action": "snapshot", "phase": "compat-post" }
|
|
12
9
|
]
|
|
13
10
|
},
|
|
14
|
-
"response": {
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
"response": { "mappings": [] },
|
|
12
|
+
"headerPolicies": [
|
|
13
|
+
{
|
|
14
|
+
"when": { "providerTypeContains": "anthropic" },
|
|
15
|
+
"setIfMissing": {
|
|
16
|
+
"User-Agent": "claude-cli/2.0.76 (external, cli)",
|
|
17
|
+
"X-App": "claude-cli",
|
|
18
|
+
"X-App-Version": "2.0.76",
|
|
19
|
+
"anthropic-beta": "claude-code"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
17
23
|
}
|
|
@@ -4,15 +4,20 @@
|
|
|
4
4
|
"request": {
|
|
5
5
|
"mappings": [
|
|
6
6
|
{ "action": "snapshot", "phase": "compat-pre" },
|
|
7
|
-
{
|
|
8
|
-
"action": "anthropic_claude_code_system_prompt",
|
|
9
|
-
"config": { "preserveExistingSystemAsUserMessage": true }
|
|
10
|
-
},
|
|
7
|
+
{ "action": "anthropic_claude_code_system_prompt", "config": { "preserveExistingSystemAsUserMessage": true } },
|
|
11
8
|
{ "action": "snapshot", "phase": "compat-post" }
|
|
12
9
|
]
|
|
13
10
|
},
|
|
14
|
-
"response": {
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
"response": { "mappings": [] },
|
|
12
|
+
"headerPolicies": [
|
|
13
|
+
{
|
|
14
|
+
"when": { "providerTypeContains": "anthropic" },
|
|
15
|
+
"setIfMissing": {
|
|
16
|
+
"User-Agent": "claude-cli/2.0.76 (external, cli)",
|
|
17
|
+
"X-App": "claude-cli",
|
|
18
|
+
"X-App-Version": "2.0.76",
|
|
19
|
+
"anthropic-beta": "claude-code"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
17
23
|
}
|
|
18
|
-
|
package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-deepseek-web.json
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
"protocol": "openai-chat",
|
|
4
4
|
"request": {
|
|
5
5
|
"mappings": [
|
|
6
|
-
{
|
|
6
|
+
{
|
|
7
|
+
"action": "snapshot",
|
|
8
|
+
"phase": "compat-pre"
|
|
9
|
+
},
|
|
7
10
|
{
|
|
8
11
|
"action": "tool_text_request_guidance",
|
|
9
12
|
"config": {
|
|
@@ -12,13 +15,21 @@
|
|
|
12
15
|
"requireTools": true
|
|
13
16
|
}
|
|
14
17
|
},
|
|
15
|
-
{
|
|
16
|
-
|
|
18
|
+
{
|
|
19
|
+
"action": "deepseek_web_request"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"action": "snapshot",
|
|
23
|
+
"phase": "compat-post"
|
|
24
|
+
}
|
|
17
25
|
]
|
|
18
26
|
},
|
|
19
27
|
"response": {
|
|
20
28
|
"mappings": [
|
|
21
|
-
{
|
|
29
|
+
{
|
|
30
|
+
"action": "snapshot",
|
|
31
|
+
"phase": "compat-pre"
|
|
32
|
+
},
|
|
22
33
|
{
|
|
23
34
|
"action": "deepseek_web_response",
|
|
24
35
|
"config": {
|
|
@@ -32,16 +43,34 @@
|
|
|
32
43
|
},
|
|
33
44
|
"argumentAliases": {
|
|
34
45
|
"exec_command": {
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
"workdir": [
|
|
47
|
+
"workdir",
|
|
48
|
+
"cwd",
|
|
49
|
+
"input.cwd"
|
|
50
|
+
]
|
|
38
51
|
}
|
|
39
52
|
}
|
|
40
53
|
}
|
|
41
54
|
}
|
|
42
55
|
}
|
|
43
56
|
},
|
|
44
|
-
{
|
|
57
|
+
{
|
|
58
|
+
"action": "snapshot",
|
|
59
|
+
"phase": "compat-post"
|
|
60
|
+
}
|
|
45
61
|
]
|
|
62
|
+
},
|
|
63
|
+
"policyOverrides": {
|
|
64
|
+
"observe": {
|
|
65
|
+
"skip": true
|
|
66
|
+
},
|
|
67
|
+
"enforce": {
|
|
68
|
+
"skip": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"sdkBinding": {
|
|
72
|
+
"family": "custom-runtime",
|
|
73
|
+
"supported": false,
|
|
74
|
+
"notes": "Web-account text-tool providers require the existing RouteCodex runtime path."
|
|
46
75
|
}
|
|
47
76
|
}
|
|
@@ -3,20 +3,57 @@
|
|
|
3
3
|
"protocol": "openai-chat",
|
|
4
4
|
"request": {
|
|
5
5
|
"mappings": [
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
6
|
+
{
|
|
7
|
+
"action": "snapshot",
|
|
8
|
+
"phase": "compat-pre"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"action": "dto_unwrap"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"action": "qwen_request_transform"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"action": "snapshot",
|
|
18
|
+
"phase": "compat-post"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"action": "dto_rewrap"
|
|
22
|
+
}
|
|
11
23
|
]
|
|
12
24
|
},
|
|
13
25
|
"response": {
|
|
14
26
|
"mappings": [
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{
|
|
27
|
+
{
|
|
28
|
+
"action": "snapshot",
|
|
29
|
+
"phase": "compat-pre"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"action": "dto_unwrap"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"action": "qwen_response_transform"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"action": "snapshot",
|
|
39
|
+
"phase": "compat-post"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"action": "dto_rewrap"
|
|
43
|
+
}
|
|
20
44
|
]
|
|
21
|
-
}
|
|
45
|
+
},
|
|
46
|
+
"headerPolicies": [
|
|
47
|
+
{
|
|
48
|
+
"when": {
|
|
49
|
+
"providerId": "qwen"
|
|
50
|
+
},
|
|
51
|
+
"setIfMissing": {
|
|
52
|
+
"X-DashScope-UserAgent": "QwenCode/0.14.3 (darwin; arm64)",
|
|
53
|
+
"X-DashScope-CacheControl": "enable",
|
|
54
|
+
"X-DashScope-AuthType": "qwen-oauth",
|
|
55
|
+
"User-Agent": "QwenCode/0.14.3 (darwin; arm64)"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
22
59
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"typeKeywords": [
|
|
3
|
+
{ "keywords": ["anthropic", "claude"], "providerType": "anthropic" },
|
|
4
|
+
{ "keywords": ["responses"], "providerType": "responses" },
|
|
5
|
+
{ "keywords": ["gemini"], "providerType": "gemini" },
|
|
6
|
+
{ "keywords": ["qwen"], "providerType": "qwen" },
|
|
7
|
+
{ "keywords": ["glm"], "providerType": "glm" },
|
|
8
|
+
{ "keywords": ["lmstudio"], "providerType": "lmstudio" }
|
|
9
|
+
],
|
|
10
|
+
"defaultProviderType": "openai",
|
|
11
|
+
"outboundProfiles": {
|
|
12
|
+
"anthropic": "anthropic-messages",
|
|
13
|
+
"responses": "openai-responses",
|
|
14
|
+
"gemini": "gemini-chat"
|
|
15
|
+
},
|
|
16
|
+
"defaultOutboundProfile": "openai-chat",
|
|
17
|
+
"compatibilityProfileBlocks": [
|
|
18
|
+
{ "providerId": "antigravity", "compatibilityProfile": "chat:gemini-cli" },
|
|
19
|
+
{ "providerId": "gemini-cli", "compatibilityProfile": "chat:gemini-cli" },
|
|
20
|
+
{ "providerTypeContains": "antigravity", "compatibilityProfile": "chat:gemini-cli" },
|
|
21
|
+
{ "providerTypeContains": "gemini-cli", "compatibilityProfile": "chat:gemini-cli" }
|
|
22
|
+
],
|
|
23
|
+
"defaultCompatibilityProfile": "compat:passthrough"
|
|
24
|
+
}
|
|
@@ -53,8 +53,11 @@ export async function runHubOutboundConversion(options) {
|
|
|
53
53
|
return payload;
|
|
54
54
|
}
|
|
55
55
|
function maybeCreateStageRecorder(adapterContext, defaultEndpoint) {
|
|
56
|
-
const flag = process.env.ROUTECODEX_HUB_SNAPSHOTS
|
|
57
|
-
|
|
56
|
+
const flag = String(process.env.ROUTECODEX_HUB_SNAPSHOTS ?? process.env.RCC_HUB_SNAPSHOTS ?? '')
|
|
57
|
+
.trim()
|
|
58
|
+
.toLowerCase();
|
|
59
|
+
const enabled = flag === '1' || flag === 'true' || flag === 'yes' || flag === 'on';
|
|
60
|
+
if (!enabled) {
|
|
58
61
|
return undefined;
|
|
59
62
|
}
|
|
60
63
|
const endpoint = defaultEndpoint || adapterContext.entryEndpoint || '/v1/chat/completions';
|
|
@@ -32,7 +32,6 @@ export const PASSTHROUGH_METADATA_PREFIX = 'rcc_passthrough_';
|
|
|
32
32
|
export const PASSTHROUGH_PARAMETERS = ['tool_choice'];
|
|
33
33
|
export const RESPONSES_DROPPED_PARAMETER_KEYS = [
|
|
34
34
|
'prompt_cache_key',
|
|
35
|
-
'response_format',
|
|
36
35
|
'parallel_tool_calls',
|
|
37
36
|
'service_tier',
|
|
38
37
|
'truncation',
|
|
@@ -4,8 +4,15 @@ import { buildAnthropicFromOpenAIChatWithNative } from '../../../../router/virtu
|
|
|
4
4
|
import { encodeMetadataPassthrough } from '../../../metadata-passthrough.js';
|
|
5
5
|
import { isHubStageTimingDetailEnabled, logHubStageTiming } from '../../pipeline/hub-stage-timing.js';
|
|
6
6
|
import { applyEffortBudget, buildAnthropicThinkingFromConfig, mergeAnthropicOutputConfig, mergeAnthropicThinkingConfig, normalizeAnthropicThinkingConfigFromUnknown, resolveConfiguredAnthropicThinkingBudgets, resolveConfiguredAnthropicThinkingConfig } from './anthropic-thinking-config.js';
|
|
7
|
-
import { appendDroppedFieldAudit, appendLossyFieldAudit, hasExplicitEmptyToolsSemantics, isResponsesOrigin, } from './anthropic-semantics-audit.js';
|
|
7
|
+
import { appendDroppedFieldAudit, appendLossyFieldAudit, appendPreservedFieldAudit, appendUnsupportedFieldAudit, hasExplicitEmptyToolsSemantics, isResponsesOrigin, } from './anthropic-semantics-audit.js';
|
|
8
8
|
import { ANTHROPIC_TOP_LEVEL_FIELDS, PASSTHROUGH_METADATA_PREFIX, PASSTHROUGH_PARAMETERS, RESPONSES_DROPPED_PARAMETER_KEYS, sanitizeAnthropicPayload, } from './anthropic-mapper-config.js';
|
|
9
|
+
function getAnthropicSemanticsNode(chat) {
|
|
10
|
+
if (!chat.semantics || typeof chat.semantics !== 'object') {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const node = chat.semantics.anthropic;
|
|
14
|
+
return node && isJsonObject(node) ? node : undefined;
|
|
15
|
+
}
|
|
9
16
|
const TRUTHY = new Set(['1', 'true', 'yes', 'on']);
|
|
10
17
|
const FALSY = new Set(['0', 'false', 'no', 'off']);
|
|
11
18
|
const DEFAULT_HEAVY_INPUT_THRESHOLD = 120_000;
|
|
@@ -78,6 +85,15 @@ function hasAnthropicSystemSemantic(chat) {
|
|
|
78
85
|
return false;
|
|
79
86
|
}
|
|
80
87
|
}
|
|
88
|
+
function hasChatSystemMessage(chat) {
|
|
89
|
+
return Array.isArray(chat.messages)
|
|
90
|
+
&& chat.messages.some((message) => {
|
|
91
|
+
if (!message || typeof message !== 'object') {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return message.role === 'system';
|
|
95
|
+
});
|
|
96
|
+
}
|
|
81
97
|
export function buildAnthropicFormatEnvelopeFromChat(chat, ctx) {
|
|
82
98
|
const requestId = typeof ctx.requestId === 'string' && ctx.requestId.trim().length
|
|
83
99
|
? ctx.requestId
|
|
@@ -107,6 +123,13 @@ export function buildAnthropicFormatEnvelopeFromChat(chat, ctx) {
|
|
|
107
123
|
});
|
|
108
124
|
}
|
|
109
125
|
}
|
|
126
|
+
if (trimmedParameters && Object.prototype.hasOwnProperty.call(trimmedParameters, 'response_format')) {
|
|
127
|
+
appendUnsupportedFieldAudit(chat, {
|
|
128
|
+
field: 'response_format',
|
|
129
|
+
targetProtocol: 'anthropic-messages',
|
|
130
|
+
reason: 'structured_output_not_supported'
|
|
131
|
+
});
|
|
132
|
+
}
|
|
110
133
|
if (trimmedParameters) {
|
|
111
134
|
for (const [key, value] of Object.entries(trimmedParameters)) {
|
|
112
135
|
if (ANTHROPIC_TOP_LEVEL_FIELDS.has(key) || key === 'stop') {
|
|
@@ -117,6 +140,13 @@ export function buildAnthropicFormatEnvelopeFromChat(chat, ctx) {
|
|
|
117
140
|
}
|
|
118
141
|
}
|
|
119
142
|
}
|
|
143
|
+
if (trimmedParameters && Object.prototype.hasOwnProperty.call(trimmedParameters, 'tool_choice')) {
|
|
144
|
+
appendPreservedFieldAudit(chat, {
|
|
145
|
+
field: 'tool_choice',
|
|
146
|
+
targetProtocol: 'anthropic-messages',
|
|
147
|
+
reason: 'preserved_verbatim_top_level'
|
|
148
|
+
});
|
|
149
|
+
}
|
|
120
150
|
const passthroughMetadata = encodeMetadataPassthrough(chat.parameters, {
|
|
121
151
|
prefix: PASSTHROUGH_METADATA_PREFIX,
|
|
122
152
|
keys: PASSTHROUGH_PARAMETERS
|
|
@@ -163,21 +193,38 @@ export function buildAnthropicFormatEnvelopeFromChat(chat, ctx) {
|
|
|
163
193
|
baseRequest.tools = [];
|
|
164
194
|
}
|
|
165
195
|
try {
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
|
|
196
|
+
const anthropicSemantics = getAnthropicSemanticsNode(chat);
|
|
197
|
+
if (!hasChatSystemMessage(chat)) {
|
|
198
|
+
const sysBlocks = anthropicSemantics?.systemBlocks;
|
|
199
|
+
if (Array.isArray(sysBlocks) && sysBlocks.length > 0) {
|
|
200
|
+
baseRequest.system = jsonClone(sysBlocks);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
const sysNode = chat.semantics && typeof chat.semantics === 'object' ? chat.semantics.system : undefined;
|
|
204
|
+
if (sysNode && typeof sysNode === 'object' && !Array.isArray(sysNode) && sysNode.blocks !== undefined) {
|
|
205
|
+
baseRequest.system = jsonClone(sysNode.blocks);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
169
208
|
}
|
|
170
209
|
}
|
|
171
210
|
catch {
|
|
172
211
|
// ignore
|
|
173
212
|
}
|
|
174
213
|
try {
|
|
214
|
+
const anthropicSemantics = getAnthropicSemanticsNode(chat);
|
|
175
215
|
const extras = chat.semantics && typeof chat.semantics === 'object' ? chat.semantics.providerExtras : undefined;
|
|
176
|
-
const mirror =
|
|
177
|
-
if (mirror
|
|
216
|
+
const mirror = anthropicSemantics?.messageContentShape;
|
|
217
|
+
if (mirror !== undefined) {
|
|
178
218
|
baseRequest.__anthropicMirror = jsonClone(mirror);
|
|
179
219
|
}
|
|
180
|
-
|
|
220
|
+
else {
|
|
221
|
+
const legacyMirror = extras && typeof extras === 'object' && !Array.isArray(extras) ? extras.anthropicMirror : undefined;
|
|
222
|
+
if (legacyMirror && typeof legacyMirror === 'object' && !Array.isArray(legacyMirror)) {
|
|
223
|
+
baseRequest.__anthropicMirror = jsonClone(legacyMirror);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const providerMetadata = anthropicSemantics?.providerMetadata ??
|
|
227
|
+
(extras && typeof extras === 'object' && !Array.isArray(extras) ? extras.providerMetadata : undefined);
|
|
181
228
|
if (providerMetadata && typeof providerMetadata === 'object' && !Array.isArray(providerMetadata)) {
|
|
182
229
|
const existing = baseRequest.metadata && isJsonObject(baseRequest.metadata)
|
|
183
230
|
? jsonClone(baseRequest.metadata)
|
|
@@ -2,7 +2,8 @@ import { isJsonObject, jsonClone } from '../../types/json.js';
|
|
|
2
2
|
import { buildOpenAIChatFromAnthropic } from '../../../codecs/anthropic-openai-codec.js';
|
|
3
3
|
import { extractMetadataPassthrough } from '../../../metadata-passthrough.js';
|
|
4
4
|
import { buildAnthropicToolAliasMapWithNative } from '../../../../router/virtual-router/engine-selection/native-chat-process-governance-semantics.js';
|
|
5
|
-
import {
|
|
5
|
+
import { normalizeAnthropicToolAliasMap } from '../../process/chat-process-anthropic-alias.js';
|
|
6
|
+
import { cloneAnthropicSystemBlocks, ensureAnthropicSemanticsNode, ensureSemantics, ensureToolsSemanticsNode, markExplicitEmptyTools } from './anthropic-semantics-audit.js';
|
|
6
7
|
import { collectAnthropicParameters, PASSTHROUGH_METADATA_PREFIX, PASSTHROUGH_PARAMETERS } from './anthropic-mapper-config.js';
|
|
7
8
|
export async function buildAnthropicChatEnvelopeFromPayload(payload, ctx, chatMapper) {
|
|
8
9
|
const missing = [];
|
|
@@ -38,14 +39,22 @@ export async function buildAnthropicChatEnvelopeFromPayload(payload, ctx, chatMa
|
|
|
38
39
|
const systemBlocks = cloneAnthropicSystemBlocks(payload.system);
|
|
39
40
|
if (systemBlocks) {
|
|
40
41
|
semantics.system.blocks = jsonClone(systemBlocks);
|
|
42
|
+
const anthropicNode = ensureAnthropicSemanticsNode(chatEnvelope);
|
|
43
|
+
anthropicNode.systemBlocks = jsonClone(systemBlocks);
|
|
41
44
|
}
|
|
42
45
|
if (payload.tools && Array.isArray(payload.tools) && payload.tools.length === 0) {
|
|
43
46
|
markExplicitEmptyTools(chatEnvelope);
|
|
44
47
|
}
|
|
45
|
-
|
|
48
|
+
if (Array.isArray(payload.tools) && payload.tools.length > 0) {
|
|
49
|
+
const anthropicNode = ensureAnthropicSemanticsNode(chatEnvelope);
|
|
50
|
+
anthropicNode.clientToolsRaw = jsonClone(payload.tools);
|
|
51
|
+
}
|
|
52
|
+
const aliasMap = normalizeAnthropicToolAliasMap(buildAnthropicToolAliasMapWithNative(payload.tools));
|
|
46
53
|
if (aliasMap) {
|
|
47
54
|
const toolsNode = ensureToolsSemanticsNode(chatEnvelope);
|
|
48
55
|
toolsNode.toolNameAliasMap = jsonClone(aliasMap);
|
|
56
|
+
const anthropicNode = ensureAnthropicSemanticsNode(chatEnvelope);
|
|
57
|
+
anthropicNode.toolNameAliasMap = jsonClone(aliasMap);
|
|
49
58
|
}
|
|
50
59
|
if (Array.isArray(payload.messages) && payload.messages.length) {
|
|
51
60
|
const shapes = payload.messages.map((entry) => {
|
|
@@ -66,6 +75,8 @@ export async function buildAnthropicChatEnvelopeFromPayload(payload, ctx, chatMa
|
|
|
66
75
|
});
|
|
67
76
|
const mirrorNode = { messageContentShape: shapes };
|
|
68
77
|
semantics.providerExtras.anthropicMirror = jsonClone(mirrorNode);
|
|
78
|
+
const anthropicNode = ensureAnthropicSemanticsNode(chatEnvelope);
|
|
79
|
+
anthropicNode.messageContentShape = jsonClone(mirrorNode.messageContentShape);
|
|
69
80
|
}
|
|
70
81
|
if (missing.length) {
|
|
71
82
|
metadata.missingFields = Array.isArray(metadata.missingFields)
|
|
@@ -76,6 +87,8 @@ export async function buildAnthropicChatEnvelopeFromPayload(payload, ctx, chatMa
|
|
|
76
87
|
(payload.metadata && isJsonObject(payload.metadata) ? jsonClone(payload.metadata) : undefined);
|
|
77
88
|
if (providerMetadata) {
|
|
78
89
|
semantics.providerExtras.providerMetadata = jsonClone(providerMetadata);
|
|
90
|
+
const anthropicNode = ensureAnthropicSemanticsNode(chatEnvelope);
|
|
91
|
+
anthropicNode.providerMetadata = jsonClone(providerMetadata);
|
|
79
92
|
}
|
|
80
93
|
const mergedParameters = { ...(chatEnvelope.parameters ?? {}) };
|
|
81
94
|
const mergeParameters = (source) => {
|