@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
|
@@ -56,13 +56,93 @@ export interface AdapterContext {
|
|
|
56
56
|
responsesResume?: JsonObject;
|
|
57
57
|
[key: string]: JsonValue;
|
|
58
58
|
}
|
|
59
|
+
export type ChatContinuationStickyScope = 'request_chain' | 'session' | 'conversation' | 'request';
|
|
60
|
+
export type ChatContinuationStateOrigin = 'openai-responses' | 'openai-chat' | 'anthropic-messages' | 'gemini-chat' | 'servertool-followup' | 'tool-loop' | 'unknown';
|
|
61
|
+
export interface ChatContinuationPointer extends JsonObject {
|
|
62
|
+
protocol?: string;
|
|
63
|
+
requestId?: string;
|
|
64
|
+
responseId?: string;
|
|
65
|
+
previousResponseId?: string;
|
|
66
|
+
turnId?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface ChatToolContinuation extends JsonObject {
|
|
69
|
+
mode?: 'required_action' | 'submit_tool_outputs' | 'tool_calls' | 'tool_outputs' | 'servertool_followup';
|
|
70
|
+
pendingToolCallIds?: string[];
|
|
71
|
+
submittedToolCallIds?: string[];
|
|
72
|
+
resumeOutputs?: JsonValue[];
|
|
73
|
+
}
|
|
74
|
+
export interface ChatContinuationSemantics extends JsonObject {
|
|
75
|
+
chainId?: string;
|
|
76
|
+
previousTurnId?: string;
|
|
77
|
+
resumeFrom?: ChatContinuationPointer;
|
|
78
|
+
stickyScope?: ChatContinuationStickyScope;
|
|
79
|
+
stateOrigin?: ChatContinuationStateOrigin | string;
|
|
80
|
+
restored?: boolean;
|
|
81
|
+
toolContinuation?: ChatToolContinuation;
|
|
82
|
+
protocolHints?: JsonObject;
|
|
83
|
+
}
|
|
84
|
+
export type ChatProtocolMappingDisposition = 'preserved' | 'lossy' | 'dropped' | 'unsupported';
|
|
85
|
+
export interface ChatProtocolMappingAuditEntry extends JsonObject {
|
|
86
|
+
field: string;
|
|
87
|
+
disposition: ChatProtocolMappingDisposition;
|
|
88
|
+
reason: string;
|
|
89
|
+
sourceProtocol?: string;
|
|
90
|
+
targetProtocol?: string;
|
|
91
|
+
source?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ChatSemanticAudit extends JsonObject {
|
|
94
|
+
protocolMapping?: {
|
|
95
|
+
preserved?: ChatProtocolMappingAuditEntry[];
|
|
96
|
+
lossy?: ChatProtocolMappingAuditEntry[];
|
|
97
|
+
dropped?: ChatProtocolMappingAuditEntry[];
|
|
98
|
+
unsupported?: ChatProtocolMappingAuditEntry[];
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export interface ChatToolSemantics extends JsonObject {
|
|
102
|
+
explicitEmpty?: boolean;
|
|
103
|
+
clientToolsRaw?: JsonValue[];
|
|
104
|
+
toolNameAliasMap?: JsonObject;
|
|
105
|
+
toolAliasMap?: JsonObject;
|
|
106
|
+
}
|
|
107
|
+
export interface ChatResponsesSemantics extends JsonObject {
|
|
108
|
+
context?: JsonObject;
|
|
109
|
+
resume?: JsonObject;
|
|
110
|
+
requestParameters?: JsonObject;
|
|
111
|
+
responseFormat?: JsonValue;
|
|
112
|
+
include?: JsonValue[];
|
|
113
|
+
store?: boolean;
|
|
114
|
+
promptCacheKey?: string;
|
|
115
|
+
toolChoice?: JsonValue;
|
|
116
|
+
parallelToolCalls?: boolean;
|
|
117
|
+
reasoning?: JsonValue;
|
|
118
|
+
text?: JsonValue;
|
|
119
|
+
serviceTier?: JsonValue;
|
|
120
|
+
truncation?: JsonValue;
|
|
121
|
+
modalities?: JsonValue;
|
|
122
|
+
}
|
|
123
|
+
export interface ChatAnthropicSemantics extends JsonObject {
|
|
124
|
+
systemBlocks?: JsonValue[];
|
|
125
|
+
toolNameAliasMap?: JsonObject;
|
|
126
|
+
clientToolsRaw?: JsonValue[];
|
|
127
|
+
messageContentShape?: JsonValue;
|
|
128
|
+
providerMetadata?: JsonObject;
|
|
129
|
+
}
|
|
130
|
+
export interface ChatGeminiSemantics extends JsonObject {
|
|
131
|
+
systemInstruction?: JsonValue;
|
|
132
|
+
safetySettings?: JsonValue;
|
|
133
|
+
generationConfig?: JsonObject;
|
|
134
|
+
toolConfig?: JsonObject;
|
|
135
|
+
providerMetadata?: JsonObject;
|
|
136
|
+
}
|
|
59
137
|
export interface ChatSemantics extends JsonObject {
|
|
138
|
+
continuation?: ChatContinuationSemantics;
|
|
60
139
|
session?: JsonObject;
|
|
61
140
|
system?: JsonObject;
|
|
62
|
-
tools?:
|
|
63
|
-
responses?:
|
|
64
|
-
anthropic?:
|
|
65
|
-
gemini?:
|
|
141
|
+
tools?: ChatToolSemantics;
|
|
142
|
+
responses?: ChatResponsesSemantics;
|
|
143
|
+
anthropic?: ChatAnthropicSemantics;
|
|
144
|
+
gemini?: ChatGeminiSemantics;
|
|
145
|
+
audit?: ChatSemanticAudit;
|
|
66
146
|
providerExtras?: JsonObject;
|
|
67
147
|
}
|
|
68
148
|
export interface ChatEnvelope {
|
|
@@ -7,6 +7,26 @@ import { chatEnvelopeToStandardizedWithNative } from '../../../../router/virtual
|
|
|
7
7
|
import { standardizedToChatEnvelopeWithNative } from '../../../../router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics.js';
|
|
8
8
|
const DEFAULT_RESPONSES_ENDPOINT = '/v1/responses';
|
|
9
9
|
const RESPONSES_PROTOCOL = 'openai-responses';
|
|
10
|
+
function formatUnknownError(error) {
|
|
11
|
+
if (error instanceof Error) {
|
|
12
|
+
return error.stack || `${error.name}: ${error.message}`;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
return JSON.stringify(error);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return String(error);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function logResponsesOpenAiPipelineNonBlocking(stage, error, details = {}) {
|
|
22
|
+
try {
|
|
23
|
+
const detailSuffix = Object.keys(details).length ? ` details=${JSON.stringify(details)}` : '';
|
|
24
|
+
console.warn(`[responses-openai-pipeline] ${stage} failed (non-blocking): ${formatUnknownError(error)}${detailSuffix}`);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// Never throw from non-blocking logging.
|
|
28
|
+
}
|
|
29
|
+
}
|
|
10
30
|
function assertJsonObject(value, stage) {
|
|
11
31
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
12
32
|
throw new Error(`Responses pipeline codec requires JSON payload at ${stage}`);
|
|
@@ -109,7 +129,12 @@ function captureToolResults(payload) {
|
|
|
109
129
|
try {
|
|
110
130
|
output = JSON.stringify(rawOut);
|
|
111
131
|
}
|
|
112
|
-
catch {
|
|
132
|
+
catch (error) {
|
|
133
|
+
logResponsesOpenAiPipelineNonBlocking('capture_tool_results.stringify_output', error, {
|
|
134
|
+
itemType: t,
|
|
135
|
+
toolCallId: typeof tool_call_id === 'string' ? tool_call_id : undefined
|
|
136
|
+
});
|
|
137
|
+
}
|
|
113
138
|
}
|
|
114
139
|
results.push({ tool_call_id, output });
|
|
115
140
|
}
|
|
@@ -2,7 +2,7 @@ import { evaluateResponsesHostPolicy } from '../responses-host-policy.js';
|
|
|
2
2
|
import { normalizeMessageReasoningTools } from '../../shared/reasoning-tool-normalizer.js';
|
|
3
3
|
import { createBridgeActionState, runBridgeActionPipeline } from '../../bridge-actions.js';
|
|
4
4
|
import { resolveBridgePolicy, resolvePolicyActions } from '../../bridge-policies.js';
|
|
5
|
-
import {
|
|
5
|
+
import { consumeResponsesPayloadSnapshotByAliases, consumeResponsesPassthroughByAliases } from '../../shared/responses-reasoning-registry.js';
|
|
6
6
|
import { stripInternalToolingMetadata } from '../../shared/responses-tool-utils.js';
|
|
7
7
|
import { ProviderProtocolError } from '../../provider-protocol-error.js';
|
|
8
8
|
import { buildResponsesPayloadFromChatWithNative, normalizeResponsesToolCallArgumentsForClientWithNative } from '../../../router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics.js';
|
|
@@ -35,17 +35,18 @@ function unwrapData(value) {
|
|
|
35
35
|
}
|
|
36
36
|
return current;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function resolveSnapshotLookupKeys(response, context) {
|
|
39
|
+
const keys = [];
|
|
39
40
|
if (typeof response?.request_id === 'string') {
|
|
40
|
-
|
|
41
|
+
keys.push(response.request_id);
|
|
41
42
|
}
|
|
42
43
|
if (typeof context?.requestId === 'string') {
|
|
43
|
-
|
|
44
|
+
keys.push(context.requestId);
|
|
44
45
|
}
|
|
45
46
|
if (typeof response?.id === 'string') {
|
|
46
|
-
|
|
47
|
+
keys.push(response.id);
|
|
47
48
|
}
|
|
48
|
-
return
|
|
49
|
+
return Array.from(new Set(keys.map((value) => value.trim()).filter((value) => value.length > 0)));
|
|
49
50
|
}
|
|
50
51
|
function shouldStripHostManagedFields(context) {
|
|
51
52
|
const result = evaluateResponsesHostPolicy(context, typeof context?.targetProtocol === 'string' ? context?.targetProtocol : undefined);
|
|
@@ -73,9 +74,9 @@ export function buildResponsesPayloadFromChat(payload, context) {
|
|
|
73
74
|
if (response.object === 'response' && Array.isArray(response.output)) {
|
|
74
75
|
return response;
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
-
const snapshotPayload =
|
|
78
|
-
const passthroughPayload =
|
|
77
|
+
const snapshotLookupKeys = resolveSnapshotLookupKeys(response, context);
|
|
78
|
+
const snapshotPayload = snapshotLookupKeys.length ? consumeResponsesPayloadSnapshotByAliases(snapshotLookupKeys) : undefined;
|
|
79
|
+
const passthroughPayload = snapshotLookupKeys.length ? consumeResponsesPassthroughByAliases(snapshotLookupKeys) : undefined;
|
|
79
80
|
const sourceForRetention = (passthroughPayload && typeof passthroughPayload === 'object' ? passthroughPayload : undefined) ??
|
|
80
81
|
readInlineRetentionPayload(response, '__responses_passthrough') ??
|
|
81
82
|
(snapshotPayload && typeof snapshotPayload === 'object' ? snapshotPayload : undefined) ??
|
package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge/utils.js
CHANGED
|
@@ -91,6 +91,25 @@ export function sanitizeCapturedResponsesInput(input) {
|
|
|
91
91
|
return input;
|
|
92
92
|
}
|
|
93
93
|
const acceptedCallIds = new Set();
|
|
94
|
+
let sawFunctionCalls = false;
|
|
95
|
+
for (const entry of input) {
|
|
96
|
+
if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const type = typeof entry.type === 'string' ? String(entry.type).trim().toLowerCase() : '';
|
|
100
|
+
if (type !== 'function_call') {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
sawFunctionCalls = true;
|
|
104
|
+
const sanitizedName = sanitizeResponsesFunctionName(entry.name);
|
|
105
|
+
if (!sanitizedName) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const callId = typeof entry.call_id === 'string' ? String(entry.call_id).trim() : '';
|
|
109
|
+
if (callId) {
|
|
110
|
+
acceptedCallIds.add(callId);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
94
113
|
const out = [];
|
|
95
114
|
for (const entry of input) {
|
|
96
115
|
if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
|
|
@@ -106,16 +125,12 @@ export function sanitizeCapturedResponsesInput(input) {
|
|
|
106
125
|
const next = rawName === sanitizedName
|
|
107
126
|
? entry
|
|
108
127
|
: { ...entry, name: sanitizedName };
|
|
109
|
-
const callId = typeof next.call_id === 'string' ? String(next.call_id).trim() : '';
|
|
110
|
-
if (callId) {
|
|
111
|
-
acceptedCallIds.add(callId);
|
|
112
|
-
}
|
|
113
128
|
out.push(next);
|
|
114
129
|
continue;
|
|
115
130
|
}
|
|
116
131
|
if (type === 'function_call_output') {
|
|
117
132
|
const callId = typeof entry.call_id === 'string' ? String(entry.call_id).trim() : '';
|
|
118
|
-
if (!callId || !acceptedCallIds.has(callId)) {
|
|
133
|
+
if (!callId || (sawFunctionCalls && !acceptedCallIds.has(callId))) {
|
|
119
134
|
continue;
|
|
120
135
|
}
|
|
121
136
|
}
|
|
@@ -10,7 +10,7 @@ import { appendLocalImageBlockOnLatestUserInputWithNative, buildBridgeHistoryWit
|
|
|
10
10
|
// --- Utilities (ported strictly) ---
|
|
11
11
|
import { resolveBridgePolicy, resolvePolicyActions } from '../bridge-policies.js';
|
|
12
12
|
import { logHubStageTiming } from '../hub/pipeline/hub-stage-timing.js';
|
|
13
|
-
import { RESPONSES_TOOL_PASSTHROUGH_KEYS, buildSlimBridgeDecisionMetadata, buildSlimResponsesBridgeContext, collectResponsesRequestParameters, extractMetadataExtraFields, pickObjectFields, sanitizeCapturedResponsesInput, stripToolControlFieldsFromContextMetadata, stripToolControlFieldsFromParameterObject, unwrapData } from './responses-openai-bridge/utils.js';
|
|
13
|
+
import { RESPONSES_TOOL_PASSTHROUGH_KEYS, RESPONSES_REQUEST_PARAMETER_KEYS, buildSlimBridgeDecisionMetadata, buildSlimResponsesBridgeContext, collectResponsesRequestParameters, extractMetadataExtraFields, pickObjectFields, sanitizeCapturedResponsesInput, stripToolControlFieldsFromContextMetadata, stripToolControlFieldsFromParameterObject, unwrapData } from './responses-openai-bridge/utils.js';
|
|
14
14
|
function readCapturedToolResults(context) {
|
|
15
15
|
const raw = context.__captured_tool_results;
|
|
16
16
|
return Array.isArray(raw)
|
|
@@ -80,6 +80,52 @@ function filterResponsesInboundActionsByPayloadHints(actions, messages) {
|
|
|
80
80
|
return !toolOnlyActions.has(name);
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
+
function readPreviousResponseIdFromChatSemantics(chat) {
|
|
84
|
+
const semantics = chat?.semantics && typeof chat.semantics === 'object' && !Array.isArray(chat.semantics)
|
|
85
|
+
? chat.semantics
|
|
86
|
+
: undefined;
|
|
87
|
+
if (!semantics) {
|
|
88
|
+
return '';
|
|
89
|
+
}
|
|
90
|
+
const continuation = semantics.continuation && typeof semantics.continuation === 'object' && !Array.isArray(semantics.continuation)
|
|
91
|
+
? semantics.continuation
|
|
92
|
+
: undefined;
|
|
93
|
+
const resumeFrom = continuation?.resumeFrom && typeof continuation.resumeFrom === 'object' && !Array.isArray(continuation.resumeFrom)
|
|
94
|
+
? continuation.resumeFrom
|
|
95
|
+
: undefined;
|
|
96
|
+
const responses = semantics.responses && typeof semantics.responses === 'object' && !Array.isArray(semantics.responses)
|
|
97
|
+
? semantics.responses
|
|
98
|
+
: undefined;
|
|
99
|
+
const responsesResume = responses?.resume && typeof responses.resume === 'object' && !Array.isArray(responses.resume)
|
|
100
|
+
? responses.resume
|
|
101
|
+
: undefined;
|
|
102
|
+
const candidates = [
|
|
103
|
+
resumeFrom?.previousResponseId,
|
|
104
|
+
responsesResume?.restoredFromResponseId,
|
|
105
|
+
resumeFrom?.responseId
|
|
106
|
+
];
|
|
107
|
+
for (const candidate of candidates) {
|
|
108
|
+
if (typeof candidate === 'string' && candidate.trim().length > 0) {
|
|
109
|
+
return candidate.trim();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return '';
|
|
113
|
+
}
|
|
114
|
+
function readResumeDeltaInputFromChatSemantics(chat) {
|
|
115
|
+
const semantics = chat?.semantics && typeof chat.semantics === 'object' && !Array.isArray(chat.semantics)
|
|
116
|
+
? chat.semantics
|
|
117
|
+
: undefined;
|
|
118
|
+
const responses = semantics?.responses && typeof semantics.responses === 'object' && !Array.isArray(semantics.responses)
|
|
119
|
+
? semantics.responses
|
|
120
|
+
: undefined;
|
|
121
|
+
const responsesResume = responses?.resume && typeof responses.resume === 'object' && !Array.isArray(responses.resume)
|
|
122
|
+
? responses.resume
|
|
123
|
+
: undefined;
|
|
124
|
+
const deltaInput = responsesResume?.deltaInput;
|
|
125
|
+
return Array.isArray(deltaInput)
|
|
126
|
+
? jsonClone(deltaInput)
|
|
127
|
+
: undefined;
|
|
128
|
+
}
|
|
83
129
|
export function captureResponsesContext(payload, dto) {
|
|
84
130
|
const preservedInput = Array.isArray(payload.input)
|
|
85
131
|
? payload.input
|
|
@@ -249,11 +295,20 @@ export function buildResponsesRequestFromChat(payload, ctx, extras) {
|
|
|
249
295
|
requestMetadata: buildSlimBridgeDecisionMetadata(requestMetadata),
|
|
250
296
|
envelopeMetadata: buildSlimBridgeDecisionMetadata(envelopeMetadata),
|
|
251
297
|
bridgeMetadata: buildSlimBridgeDecisionMetadata(bridgeMetadata),
|
|
252
|
-
extraBridgeHistory: extras?.bridgeHistory
|
|
298
|
+
extraBridgeHistory: extras?.bridgeHistory,
|
|
299
|
+
requestSemantics: chat?.semantics && typeof chat.semantics === 'object' && !Array.isArray(chat.semantics)
|
|
300
|
+
? chat.semantics
|
|
301
|
+
: undefined
|
|
253
302
|
});
|
|
254
303
|
const forceWebSearch = bridgeDecisions.forceWebSearch === true;
|
|
255
304
|
const toolCallIdStyle = bridgeDecisions.toolCallIdStyle;
|
|
256
305
|
const historySeed = bridgeDecisions.historySeed;
|
|
306
|
+
const previousResponseId = typeof bridgeDecisions.previousResponseId === 'string' && bridgeDecisions.previousResponseId.trim().length > 0
|
|
307
|
+
? bridgeDecisions.previousResponseId.trim()
|
|
308
|
+
: readPreviousResponseIdFromChatSemantics(chat);
|
|
309
|
+
const resumedDeltaInput = previousResponseId.length > 0
|
|
310
|
+
? readResumeDeltaInputFromChatSemantics(chat)
|
|
311
|
+
: undefined;
|
|
257
312
|
// tools: 反向映射为 ResponsesToolDefinition 形状
|
|
258
313
|
const chatTools = Array.isArray(chat.tools) ? chat.tools : [];
|
|
259
314
|
const responsesToolsFromChat = mapChatToolsToBridge(chatTools, {
|
|
@@ -278,7 +333,7 @@ export function buildResponsesRequestFromChat(payload, ctx, extras) {
|
|
|
278
333
|
}
|
|
279
334
|
}
|
|
280
335
|
}
|
|
281
|
-
const history = historySeed ??
|
|
336
|
+
const history = (previousResponseId ? undefined : historySeed) ??
|
|
282
337
|
buildBridgeHistoryWithNative({
|
|
283
338
|
messages,
|
|
284
339
|
tools: Array.isArray(out.tools) ? out.tools : undefined
|
|
@@ -289,13 +344,22 @@ export function buildResponsesRequestFromChat(payload, ctx, extras) {
|
|
|
289
344
|
}
|
|
290
345
|
const { input, combinedSystemInstruction, originalSystemMessages } = history;
|
|
291
346
|
// 不追加 metadata,以便 roundtrip 与原始 payload 对齐;系统提示直接写入 instructions。
|
|
347
|
+
const inputForUpstream = previousResponseId.length > 0 && Array.isArray(resumedDeltaInput)
|
|
348
|
+
? resumedDeltaInput
|
|
349
|
+
: input;
|
|
350
|
+
if (callIdTransformer) {
|
|
351
|
+
enforceToolCallIdStyle(inputForUpstream, callIdTransformer);
|
|
352
|
+
}
|
|
292
353
|
const upstreamInput = filterBridgeInputForUpstreamWithNative({
|
|
293
|
-
input,
|
|
354
|
+
input: inputForUpstream,
|
|
294
355
|
allowToolCallId: toolCallIdStyle === 'preserve'
|
|
295
356
|
}).input;
|
|
296
357
|
if (upstreamInput.length) {
|
|
297
358
|
out.input = upstreamInput;
|
|
298
359
|
}
|
|
360
|
+
if (previousResponseId.length > 0) {
|
|
361
|
+
out.previous_response_id = previousResponseId;
|
|
362
|
+
}
|
|
299
363
|
const streamFromChat = typeof chat.stream === 'boolean' ? chat.stream : undefined;
|
|
300
364
|
const streamFromParameters = chat?.parameters && typeof chat.parameters?.stream === 'boolean'
|
|
301
365
|
? chat.parameters.stream
|
|
@@ -348,6 +412,26 @@ export function buildResponsesRequestFromChat(payload, ctx, extras) {
|
|
|
348
412
|
});
|
|
349
413
|
Object.assign(out, preparedEnvelope.request);
|
|
350
414
|
delete out.parameters;
|
|
415
|
+
const retainedParameters = {
|
|
416
|
+
...(contextParameters ?? {}),
|
|
417
|
+
...(chat.parameters && typeof chat.parameters === 'object' && !Array.isArray(chat.parameters)
|
|
418
|
+
? chat.parameters
|
|
419
|
+
: {})
|
|
420
|
+
};
|
|
421
|
+
for (const key of RESPONSES_REQUEST_PARAMETER_KEYS) {
|
|
422
|
+
if (out[key] !== undefined || retainedParameters[key] === undefined) {
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
out[key] = jsonClone(retainedParameters[key]);
|
|
426
|
+
}
|
|
427
|
+
if (out.stream === undefined) {
|
|
428
|
+
const retainedStream = streamFromChat ??
|
|
429
|
+
streamFromParameters ??
|
|
430
|
+
(typeof ctx?.stream === 'boolean' ? ctx.stream : undefined);
|
|
431
|
+
if (retainedStream !== undefined) {
|
|
432
|
+
out.stream = retainedStream;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
351
435
|
ensureBridgeInstructions(out);
|
|
352
436
|
return { request: out, originalSystemMessages };
|
|
353
437
|
}
|
package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils-core.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ProviderProtocolError } from '../provider-protocol-error.js';
|
|
2
|
-
const ANTHROPIC_TOOL_NAME_ALIASES = new Map(
|
|
2
|
+
const ANTHROPIC_TOOL_NAME_ALIASES = new Map([
|
|
3
|
+
['bash', 'shell_command'],
|
|
4
|
+
['shell', 'shell_command'],
|
|
5
|
+
['terminal', 'shell_command'],
|
|
6
|
+
]);
|
|
3
7
|
const CANONICAL_TO_ANTHROPIC_TOOL_NAMES = new Map([['shell_command', 'Bash']]);
|
|
4
8
|
export function isObject(v) {
|
|
5
9
|
return !!v && typeof v === 'object' && !Array.isArray(v);
|
|
@@ -3,7 +3,7 @@ import { ProviderProtocolError } from '../provider-protocol-error.js';
|
|
|
3
3
|
import { jsonClone } from '../hub/types/json.js';
|
|
4
4
|
import { logHubStageTiming } from '../hub/pipeline/hub-stage-timing.js';
|
|
5
5
|
import { parseLenientJsonishWithNative } from '../../router/virtual-router/engine-selection/native-shared-conversion-semantics.js';
|
|
6
|
-
import { isObject, normalizeShellLikeToolInput,
|
|
6
|
+
import { flattenAnthropicText, isObject, normalizeShellLikeToolInput, requireTrimmedString, sanitizeToolUseId } from './anthropic-message-utils-core.js';
|
|
7
7
|
import { normalizeAnthropicToolChoice } from './anthropic-message-utils-openai-response.js';
|
|
8
8
|
const ANTHROPIC_TOP_LEVEL_FIELDS = new Set([
|
|
9
9
|
'model',
|
|
@@ -21,6 +21,30 @@ const ANTHROPIC_TOP_LEVEL_FIELDS = new Set([
|
|
|
21
21
|
'tool_choice',
|
|
22
22
|
'thinking'
|
|
23
23
|
]);
|
|
24
|
+
const EMPTY_TOOL_RESULT_FALLBACK = '[RouteCodex] Tool output was empty; execution status unknown.';
|
|
25
|
+
const UNIFIED_EXEC_CAP_WARNING_RE = /^warning:\s*the maximum number of unified exec processes you can keep open is \d+\s+and you currently have \d+\s+processes open\.[\s\S]*automatic pruning of old processes\s*$/i;
|
|
26
|
+
function hasVisibleText(value) {
|
|
27
|
+
return typeof value === 'string' && value.trim().length > 0;
|
|
28
|
+
}
|
|
29
|
+
function isInternalUnifiedExecCapacityWarning(value) {
|
|
30
|
+
return typeof value === 'string' && UNIFIED_EXEC_CAP_WARNING_RE.test(value.trim());
|
|
31
|
+
}
|
|
32
|
+
function sanitizeUserVisibleText(value) {
|
|
33
|
+
if (!hasVisibleText(value)) {
|
|
34
|
+
return '';
|
|
35
|
+
}
|
|
36
|
+
if (isInternalUnifiedExecCapacityWarning(value)) {
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
return String(value);
|
|
40
|
+
}
|
|
41
|
+
function normalizeToolResultText(value) {
|
|
42
|
+
const sanitized = sanitizeUserVisibleText(value);
|
|
43
|
+
if (!hasVisibleText(sanitized)) {
|
|
44
|
+
return EMPTY_TOOL_RESULT_FALLBACK;
|
|
45
|
+
}
|
|
46
|
+
return sanitized;
|
|
47
|
+
}
|
|
24
48
|
export function buildAnthropicRequestFromOpenAIChat(chatReq, options) {
|
|
25
49
|
const requestBody = isObject(chatReq) ? chatReq : {};
|
|
26
50
|
const requestId = typeof options?.requestId === 'string' && options.requestId.trim().length
|
|
@@ -75,9 +99,8 @@ export function buildAnthropicRequestFromOpenAIChat(chatReq, options) {
|
|
|
75
99
|
});
|
|
76
100
|
const systemBlocks = [];
|
|
77
101
|
const pushSystemBlock = (text) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
systemBlocks.push({ type: 'text', text: trimmed });
|
|
102
|
+
if (hasVisibleText(text))
|
|
103
|
+
systemBlocks.push({ type: 'text', text });
|
|
81
104
|
};
|
|
82
105
|
try {
|
|
83
106
|
const sys = requestBody.system;
|
|
@@ -85,7 +108,15 @@ export function buildAnthropicRequestFromOpenAIChat(chatReq, options) {
|
|
|
85
108
|
if (!val)
|
|
86
109
|
return;
|
|
87
110
|
if (typeof val === 'string') {
|
|
88
|
-
|
|
111
|
+
if (!hasVisibleText(val)) {
|
|
112
|
+
throw new ProviderProtocolError('Anthropic bridge constraint violated: top-level system must contain text', {
|
|
113
|
+
code: 'MALFORMED_REQUEST',
|
|
114
|
+
protocol: 'anthropic-messages',
|
|
115
|
+
providerType: 'anthropic',
|
|
116
|
+
details: { context: 'top-level system' }
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
pushSystemBlock(val);
|
|
89
120
|
return;
|
|
90
121
|
}
|
|
91
122
|
if (Array.isArray(val)) {
|
|
@@ -94,7 +125,16 @@ export function buildAnthropicRequestFromOpenAIChat(chatReq, options) {
|
|
|
94
125
|
return;
|
|
95
126
|
}
|
|
96
127
|
if (typeof val === 'object') {
|
|
97
|
-
|
|
128
|
+
const text = flattenAnthropicText(val);
|
|
129
|
+
if (!hasVisibleText(text)) {
|
|
130
|
+
throw new ProviderProtocolError('Anthropic bridge constraint violated: top-level system must contain text', {
|
|
131
|
+
code: 'MALFORMED_REQUEST',
|
|
132
|
+
protocol: 'anthropic-messages',
|
|
133
|
+
providerType: 'anthropic',
|
|
134
|
+
details: { context: 'top-level system' }
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
pushSystemBlock(text);
|
|
98
138
|
return;
|
|
99
139
|
}
|
|
100
140
|
throw new ProviderProtocolError('Anthropic bridge constraint violated: unsupported system payload type', {
|
|
@@ -121,9 +161,10 @@ export function buildAnthropicRequestFromOpenAIChat(chatReq, options) {
|
|
|
121
161
|
mirrorIndex += 1;
|
|
122
162
|
}
|
|
123
163
|
const contentNode = m.content;
|
|
124
|
-
const text = collectText(contentNode)
|
|
164
|
+
const text = sanitizeUserVisibleText(collectText(contentNode));
|
|
165
|
+
const hasText = hasVisibleText(text);
|
|
125
166
|
if (role === 'system') {
|
|
126
|
-
if (!
|
|
167
|
+
if (!hasText) {
|
|
127
168
|
throw new ProviderProtocolError('Anthropic bridge constraint violated: Chat system message must contain text', {
|
|
128
169
|
code: 'MALFORMED_REQUEST',
|
|
129
170
|
protocol: 'anthropic-messages',
|
|
@@ -146,7 +187,7 @@ export function buildAnthropicRequestFromOpenAIChat(chatReq, options) {
|
|
|
146
187
|
}
|
|
147
188
|
const block = {
|
|
148
189
|
type: 'tool_result',
|
|
149
|
-
content: text
|
|
190
|
+
content: normalizeToolResultText(text)
|
|
150
191
|
};
|
|
151
192
|
block.tool_use_id = toolCallId;
|
|
152
193
|
messages.push({
|
|
@@ -169,7 +210,7 @@ export function buildAnthropicRequestFromOpenAIChat(chatReq, options) {
|
|
|
169
210
|
});
|
|
170
211
|
continue;
|
|
171
212
|
}
|
|
172
|
-
if (t === 'image_url') {
|
|
213
|
+
if (t === 'image_url' || t === 'input_image') {
|
|
173
214
|
let url = '';
|
|
174
215
|
const imageUrl = node.image_url;
|
|
175
216
|
if (typeof imageUrl === 'string') {
|
|
@@ -206,16 +247,16 @@ export function buildAnthropicRequestFromOpenAIChat(chatReq, options) {
|
|
|
206
247
|
}
|
|
207
248
|
}
|
|
208
249
|
}
|
|
209
|
-
if (
|
|
250
|
+
if (hasText) {
|
|
210
251
|
blocks.push({ type: 'text', text });
|
|
211
252
|
}
|
|
212
253
|
if (role === 'assistant') {
|
|
213
254
|
const reasoningText = typeof m.reasoning_content === 'string'
|
|
214
|
-
? String(m.reasoning_content)
|
|
255
|
+
? String(m.reasoning_content)
|
|
215
256
|
: typeof m.reasoning === 'string'
|
|
216
|
-
? String(m.reasoning)
|
|
257
|
+
? String(m.reasoning)
|
|
217
258
|
: '';
|
|
218
|
-
if (reasoningText
|
|
259
|
+
if (hasVisibleText(reasoningText)) {
|
|
219
260
|
blocks.push({ type: 'thinking', text: reasoningText });
|
|
220
261
|
}
|
|
221
262
|
}
|
package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils-tool-schema.js
CHANGED
|
@@ -10,8 +10,7 @@ const ANTHROPIC_STABLE_TOOL_SCHEMA_NAMES = new Set([
|
|
|
10
10
|
'view_image',
|
|
11
11
|
'web_search',
|
|
12
12
|
'clock',
|
|
13
|
-
'continue_execution'
|
|
14
|
-
'review'
|
|
13
|
+
'continue_execution'
|
|
15
14
|
]);
|
|
16
15
|
const ANTHROPIC_STABLE_TOOL_SCHEMA_KEYS = new Map([
|
|
17
16
|
['exec_command', new Set(['cmd', 'command', 'workdir', 'justification', 'login', 'max_output_tokens', 'sandbox_permissions', 'shell', 'yield_time_ms', 'tty', 'prefix_rule'])],
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createBridgeActionState, runBridgeActionPipeline } from '../bridge-actions.js';
|
|
2
2
|
import { resolveBridgePolicy, resolvePolicyActions } from '../bridge-policies.js';
|
|
3
|
+
import { ProviderProtocolError } from '../provider-protocol-error.js';
|
|
3
4
|
import { normalizeChatMessageContent } from './chat-output-normalizer.js';
|
|
4
5
|
import { jsonClone } from '../hub/types/json.js';
|
|
5
6
|
import { mapAnthropicToolsToChat } from './anthropic-message-utils-tool-schema.js';
|
|
6
7
|
import { coerceAnthropicAliasRecord } from './anthropic-message-utils-openai-response.js';
|
|
7
|
-
import { flattenAnthropicText, isObject, normalizeAnthropicToolName, normalizeToolResultContent,
|
|
8
|
+
import { flattenAnthropicText, isObject, normalizeAnthropicToolName, normalizeToolResultContent, requireTrimmedString, safeJson } from './anthropic-message-utils-core.js';
|
|
8
9
|
export { denormalizeAnthropicToolName, normalizeAnthropicToolName } from './anthropic-message-utils-core.js';
|
|
9
10
|
export { mapAnthropicToolsToChat, mapChatToolsToAnthropicTools } from './anthropic-message-utils-tool-schema.js';
|
|
10
11
|
export { buildAnthropicFromOpenAIChat } from './anthropic-message-utils-openai-response.js';
|
|
@@ -54,6 +55,21 @@ function invertAnthropicAliasMap(source) {
|
|
|
54
55
|
}
|
|
55
56
|
return Object.keys(inverted).length ? inverted : undefined;
|
|
56
57
|
}
|
|
58
|
+
function hasVisibleText(value) {
|
|
59
|
+
return typeof value === 'string' && value.trim().length > 0;
|
|
60
|
+
}
|
|
61
|
+
function requireAnthropicTextPreserveWhitespace(block, context) {
|
|
62
|
+
const text = flattenAnthropicText(block);
|
|
63
|
+
if (!hasVisibleText(text)) {
|
|
64
|
+
throw new ProviderProtocolError(`Anthropic bridge constraint violated: ${context} must contain text`, {
|
|
65
|
+
code: 'MALFORMED_REQUEST',
|
|
66
|
+
protocol: 'anthropic-messages',
|
|
67
|
+
providerType: 'anthropic',
|
|
68
|
+
details: { context }
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return text;
|
|
72
|
+
}
|
|
57
73
|
export function buildOpenAIChatFromAnthropic(payload, options) {
|
|
58
74
|
const newMessages = [];
|
|
59
75
|
const body = isObject(payload) ? payload : {};
|
|
@@ -87,7 +103,7 @@ export function buildOpenAIChatFromAnthropic(payload, options) {
|
|
|
87
103
|
? [rawSystem]
|
|
88
104
|
: [];
|
|
89
105
|
for (const block of systemBlocks) {
|
|
90
|
-
const text =
|
|
106
|
+
const text = requireAnthropicTextPreserveWhitespace(block, 'system entry');
|
|
91
107
|
newMessages.push({ role: 'system', content: text });
|
|
92
108
|
}
|
|
93
109
|
const msgs = Array.isArray(body.messages) ? body.messages : [];
|
|
@@ -98,14 +114,17 @@ export function buildOpenAIChatFromAnthropic(payload, options) {
|
|
|
98
114
|
const content = m.content;
|
|
99
115
|
if (!Array.isArray(content)) {
|
|
100
116
|
const text = flattenAnthropicText(content);
|
|
101
|
-
if (text) {
|
|
117
|
+
if (hasVisibleText(text)) {
|
|
102
118
|
const normalized = normalizeChatMessageContent(text);
|
|
119
|
+
const reasoningText = typeof normalized.reasoningText === 'string' && normalized.reasoningText.trim().length
|
|
120
|
+
? normalized.reasoningText
|
|
121
|
+
: undefined;
|
|
103
122
|
const message = {
|
|
104
123
|
role,
|
|
105
|
-
content: normalized.contentText ?? text
|
|
124
|
+
content: reasoningText ? (normalized.contentText ?? text) : text
|
|
106
125
|
};
|
|
107
|
-
if (
|
|
108
|
-
message.reasoning_content =
|
|
126
|
+
if (reasoningText) {
|
|
127
|
+
message.reasoning_content = reasoningText;
|
|
109
128
|
}
|
|
110
129
|
newMessages.push(message);
|
|
111
130
|
}
|
|
@@ -121,13 +140,13 @@ export function buildOpenAIChatFromAnthropic(payload, options) {
|
|
|
121
140
|
continue;
|
|
122
141
|
const t = String(block.type || '').toLowerCase();
|
|
123
142
|
if (t === 'text' && typeof block.text === 'string') {
|
|
124
|
-
const s = block.text
|
|
125
|
-
if (s)
|
|
143
|
+
const s = String(block.text);
|
|
144
|
+
if (hasVisibleText(s))
|
|
126
145
|
textParts.push(s);
|
|
127
146
|
}
|
|
128
147
|
else if (t === 'thinking' || t === 'reasoning') {
|
|
129
|
-
const thinkingText = flattenAnthropicText(block)
|
|
130
|
-
if (thinkingText) {
|
|
148
|
+
const thinkingText = flattenAnthropicText(block);
|
|
149
|
+
if (hasVisibleText(thinkingText)) {
|
|
131
150
|
reasoningParts.push(thinkingText);
|
|
132
151
|
}
|
|
133
152
|
}
|
|
@@ -177,22 +196,26 @@ export function buildOpenAIChatFromAnthropic(payload, options) {
|
|
|
177
196
|
toolResults.push({ role: 'tool', tool_call_id: callId, content: contentStr });
|
|
178
197
|
}
|
|
179
198
|
}
|
|
180
|
-
const combinedText = textParts.join('
|
|
199
|
+
const combinedText = textParts.join('');
|
|
181
200
|
const normalized = normalizeChatMessageContent(combinedText);
|
|
182
201
|
const hasRawText = typeof combinedText === 'string' && combinedText.trim().length > 0;
|
|
183
202
|
const mergedReasoning = [...reasoningParts];
|
|
184
203
|
if (typeof normalized.reasoningText === 'string' && normalized.reasoningText.trim().length) {
|
|
185
|
-
mergedReasoning.push(normalized.reasoningText
|
|
204
|
+
mergedReasoning.push(normalized.reasoningText);
|
|
186
205
|
}
|
|
187
206
|
const hasText = typeof normalized.contentText === 'string' && normalized.contentText.length > 0;
|
|
188
207
|
const hasReasoning = mergedReasoning.length > 0;
|
|
189
208
|
if (hasText || hasRawText || toolCalls.length > 0 || hasReasoning || imageBlocks.length > 0) {
|
|
190
|
-
let contentNode =
|
|
209
|
+
let contentNode = hasReasoning
|
|
210
|
+
? ((hasText ? normalized.contentText : undefined) ?? combinedText ?? '')
|
|
211
|
+
: (combinedText ?? '');
|
|
191
212
|
if (imageBlocks.length > 0) {
|
|
192
213
|
const blocks = [];
|
|
193
|
-
const textPayload =
|
|
214
|
+
const textPayload = hasReasoning
|
|
215
|
+
? ((hasText ? normalized.contentText : undefined) ?? combinedText ?? '')
|
|
216
|
+
: (combinedText ?? '');
|
|
194
217
|
if (typeof textPayload === 'string' && textPayload.trim().length) {
|
|
195
|
-
blocks.push({ type: 'text', text: textPayload
|
|
218
|
+
blocks.push({ type: 'text', text: textPayload });
|
|
196
219
|
}
|
|
197
220
|
for (const img of imageBlocks) {
|
|
198
221
|
blocks.push(jsonClone(img));
|