@jsonstudio/rcc 0.90.872 → 0.90.1270
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -6
- package/configsamples/provider-default/ali-coding-plan/config.v2.json +6 -1
- package/configsamples/provider-default/antigravity/config.v2.json +6 -1
- package/configsamples/provider-default/ark-coding-plan/config.v2.json +7 -2
- package/configsamples/provider-default/crs/config.v2.json +6 -1
- package/configsamples/provider-default/deepseek-web/config.v2.json +6 -1
- package/configsamples/provider-default/gemini/config.v2.json +6 -1
- package/configsamples/provider-default/gemini-cli/config.v2.json +6 -1
- package/configsamples/provider-default/gemini-native/config.v2.json +6 -1
- package/configsamples/provider-default/glm/config.v2.json +7 -2
- package/configsamples/provider-default/glm-anthropic/config.v2.json +6 -1
- package/configsamples/provider-default/kimi/config.v2.json +7 -2
- package/configsamples/provider-default/lmstudio/config.v2.json +6 -1
- package/configsamples/provider-default/lmstudio-proxy/config.v2.json +6 -1
- package/configsamples/provider-default/manifest.json +0 -1
- package/configsamples/provider-default/meituan/config.v2.json +6 -1
- package/configsamples/provider-default/mimo/config.v2.json +7 -2
- package/configsamples/provider-default/modelscope/config.v2.json +7 -2
- package/configsamples/provider-default/my-openai/config.v2.json +6 -1
- package/configsamples/provider-default/nvidia/config.v2.json +7 -2
- package/configsamples/provider-default/opencode-zen-free/config.v2.json +6 -1
- package/configsamples/provider-default/openrouter/config.v2.json +6 -1
- package/configsamples/provider-default/qwen/config.v2.json +11 -1
- package/configsamples/provider-default/tab/config.v2.json +6 -1
- package/configsamples/provider-default/tabglm/config.v2.json +7 -2
- package/dist/build-info.js +2 -2
- package/dist/build-info.js.map +1 -1
- package/dist/cli/commands/camoufox.js +44 -3
- package/dist/cli/commands/camoufox.js.map +1 -1
- package/dist/cli/commands/config.js +2 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/heartbeat.js +82 -27
- package/dist/cli/commands/heartbeat.js.map +1 -1
- package/dist/cli/commands/init.js +1 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/launcher/utils.js +37 -24
- package/dist/cli/commands/launcher/utils.js.map +1 -1
- package/dist/cli/commands/launcher-kernel.js +6 -3
- package/dist/cli/commands/launcher-kernel.js.map +1 -1
- package/dist/cli/commands/restart.js +102 -31
- package/dist/cli/commands/restart.js.map +1 -1
- package/dist/cli/commands/start-types.d.ts +1 -0
- package/dist/cli/commands/start-utils.d.ts +1 -0
- package/dist/cli/commands/start-utils.js +3 -0
- package/dist/cli/commands/start-utils.js.map +1 -1
- package/dist/cli/commands/start.js +217 -51
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.js +48 -9
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/config/bootstrap-provider-templates.js +1 -1
- package/dist/cli/config/bootstrap-provider-templates.js.map +1 -1
- package/dist/cli/config/init-provider-catalog.js +3 -50
- package/dist/cli/config/init-provider-catalog.js.map +1 -1
- package/dist/cli/config/init-v2-builder.js +0 -1
- package/dist/cli/config/init-v2-builder.js.map +1 -1
- package/dist/cli/guardian/client.js +40 -18
- package/dist/cli/guardian/client.js.map +1 -1
- package/dist/cli/server/port-utils.d.ts +5 -0
- package/dist/cli/server/port-utils.js +45 -31
- package/dist/cli/server/port-utils.js.map +1 -1
- package/dist/commands/camoufox-fp.js +1 -1
- package/dist/commands/camoufox-fp.js.map +1 -1
- package/dist/commands/oauth.js +48 -64
- package/dist/commands/oauth.js.map +1 -1
- package/dist/commands/provider-update-maintenance.js +4 -4
- package/dist/commands/provider-update-maintenance.js.map +1 -1
- package/dist/commands/token-daemon.js +38 -10
- package/dist/commands/token-daemon.js.map +1 -1
- package/dist/commands/validate.js +31 -3
- package/dist/commands/validate.js.map +1 -1
- package/dist/config/provider-v2-loader.d.ts +5 -2
- package/dist/config/provider-v2-loader.js +80 -26
- package/dist/config/provider-v2-loader.js.map +1 -1
- package/dist/config/routecodex-config-loader.d.ts +1 -0
- package/dist/config/routecodex-config-loader.js +18 -207
- package/dist/config/routecodex-config-loader.js.map +1 -1
- package/dist/config/virtual-router-builder.d.ts +3 -2
- package/dist/config/virtual-router-builder.js +4 -214
- package/dist/config/virtual-router-builder.js.map +1 -1
- package/dist/constants/index.d.ts +2 -3
- package/dist/constants/index.js +2 -4
- package/dist/constants/index.js.map +1 -1
- package/dist/error-handling/route-error-hub.js +1 -0
- package/dist/error-handling/route-error-hub.js.map +1 -1
- package/dist/index.js +98 -21
- package/dist/index.js.map +1 -1
- package/dist/manager/modules/quota/antigravity-quota-manager.d.ts +1 -1
- package/dist/manager/modules/quota/antigravity-quota-manager.js +21 -12
- package/dist/manager/modules/quota/antigravity-quota-manager.js.map +1 -1
- package/dist/manager/modules/quota/antigravity-quota-runtime.d.ts +1 -1
- package/dist/manager/modules/quota/antigravity-quota-runtime.js +32 -45
- package/dist/manager/modules/quota/antigravity-quota-runtime.js.map +1 -1
- package/dist/manager/modules/quota/provider-key-normalization.js +10 -1
- package/dist/manager/modules/quota/provider-key-normalization.js.map +1 -1
- package/dist/manager/modules/quota/provider-quota-daemon.d.ts +2 -1
- package/dist/manager/modules/quota/provider-quota-daemon.error-helpers.d.ts +1 -1
- package/dist/manager/modules/quota/provider-quota-daemon.error-helpers.js +22 -12
- package/dist/manager/modules/quota/provider-quota-daemon.error-helpers.js.map +1 -1
- package/dist/manager/modules/quota/provider-quota-daemon.events.js +69 -33
- package/dist/manager/modules/quota/provider-quota-daemon.events.js.map +1 -1
- package/dist/manager/modules/quota/provider-quota-daemon.js +47 -35
- package/dist/manager/modules/quota/provider-quota-daemon.js.map +1 -1
- package/dist/manager/storage/file-store.js +3 -0
- package/dist/manager/storage/file-store.js.map +1 -1
- package/dist/modules/llmswitch/bridge/antigravity-signature.js +58 -20
- package/dist/modules/llmswitch/bridge/antigravity-signature.js.map +1 -1
- package/dist/modules/llmswitch/bridge/index.d.ts +1 -1
- package/dist/modules/llmswitch/bridge/index.js +1 -1
- package/dist/modules/llmswitch/bridge/index.js.map +1 -1
- package/dist/modules/llmswitch/bridge/runtime-integrations.d.ts +22 -16
- package/dist/modules/llmswitch/bridge/runtime-integrations.js +89 -30
- package/dist/modules/llmswitch/bridge/runtime-integrations.js.map +1 -1
- package/dist/modules/llmswitch/bridge/snapshot-recorder-runtime.js +10 -9
- package/dist/modules/llmswitch/bridge/snapshot-recorder-runtime.js.map +1 -1
- package/dist/modules/llmswitch/bridge/snapshot-recorder.js +3 -0
- package/dist/modules/llmswitch/bridge/snapshot-recorder.js.map +1 -1
- package/dist/modules/llmswitch/bridge/state-integrations.d.ts +1 -0
- package/dist/modules/llmswitch/bridge/state-integrations.js +263 -51
- package/dist/modules/llmswitch/bridge/state-integrations.js.map +1 -1
- package/dist/modules/llmswitch/bridge.d.ts +2 -2
- package/dist/modules/llmswitch/bridge.js +2 -2
- package/dist/modules/llmswitch/bridge.js.map +1 -1
- package/dist/provider-sdk/provider-add-template.d.ts +1 -1
- package/dist/provider-sdk/provider-add-template.js.map +1 -1
- package/dist/provider-sdk/provider-runtime-inference.js +48 -13
- package/dist/provider-sdk/provider-runtime-inference.js.map +1 -1
- package/dist/providers/auth/deepseek-account-token-acquirer.d.ts +24 -0
- package/dist/providers/auth/deepseek-account-token-acquirer.js +42 -13
- package/dist/providers/auth/deepseek-account-token-acquirer.js.map +1 -1
- package/dist/providers/auth/oauth-auth.js +12 -5
- package/dist/providers/auth/oauth-auth.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle/path-resolver.d.ts +0 -1
- package/dist/providers/auth/oauth-lifecycle/path-resolver.js +10 -9
- package/dist/providers/auth/oauth-lifecycle/path-resolver.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle/token-helpers.js +0 -1
- package/dist/providers/auth/oauth-lifecycle/token-helpers.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle/token-io.js +18 -8
- package/dist/providers/auth/oauth-lifecycle/token-io.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle.d.ts +5 -0
- package/dist/providers/auth/oauth-lifecycle.js +370 -353
- package/dist/providers/auth/oauth-lifecycle.js.map +1 -1
- package/dist/providers/auth/oauth-repair-env.js +0 -26
- package/dist/providers/auth/oauth-repair-env.js.map +1 -1
- package/dist/providers/auth/qwen-userinfo-helper.d.ts +11 -0
- package/dist/providers/auth/qwen-userinfo-helper.js +85 -13
- package/dist/providers/auth/qwen-userinfo-helper.js.map +1 -1
- package/dist/providers/auth/token-refresh/token-state.js +1 -4
- package/dist/providers/auth/token-refresh/token-state.js.map +1 -1
- package/dist/providers/auth/token-scanner/index.d.ts +1 -1
- package/dist/providers/auth/token-scanner/index.js +2 -2
- package/dist/providers/auth/token-storage/token-file-resolver.js +0 -3
- package/dist/providers/auth/token-storage/token-file-resolver.js.map +1 -1
- package/dist/providers/auth/token-storage/token-persistence.js +10 -3
- package/dist/providers/auth/token-storage/token-persistence.js.map +1 -1
- package/dist/providers/auth/tokenfile-auth.d.ts +0 -1
- package/dist/providers/auth/tokenfile-auth.js +23 -30
- package/dist/providers/auth/tokenfile-auth.js.map +1 -1
- package/dist/providers/core/api/provider-config.d.ts +1 -1
- package/dist/providers/core/api/provider-types.d.ts +2 -1
- package/dist/providers/core/config/camoufox-actions.js +23 -15
- package/dist/providers/core/config/camoufox-actions.js.map +1 -1
- package/dist/providers/core/config/camoufox-launcher.js +235 -121
- package/dist/providers/core/config/camoufox-launcher.js.map +1 -1
- package/dist/providers/core/config/oauth-flows.js +23 -1
- package/dist/providers/core/config/oauth-flows.js.map +1 -1
- package/dist/providers/core/config/provider-oauth-configs.js +2 -93
- package/dist/providers/core/config/provider-oauth-configs.js.map +1 -1
- package/dist/providers/core/config/service-profiles.d.ts +0 -1
- package/dist/providers/core/config/service-profiles.js +23 -66
- package/dist/providers/core/config/service-profiles.js.map +1 -1
- package/dist/providers/core/runtime/base-provider-runtime-helpers.js +4 -1
- package/dist/providers/core/runtime/base-provider-runtime-helpers.js.map +1 -1
- package/dist/providers/core/runtime/base-provider.js +21 -11
- package/dist/providers/core/runtime/base-provider.js.map +1 -1
- package/dist/providers/core/runtime/deepseek-http-provider-helpers.d.ts +1 -0
- package/dist/providers/core/runtime/deepseek-http-provider-helpers.js +28 -0
- package/dist/providers/core/runtime/deepseek-http-provider-helpers.js.map +1 -1
- package/dist/providers/core/runtime/deepseek-http-provider.d.ts +0 -2
- package/dist/providers/core/runtime/deepseek-http-provider.js +3 -33
- package/dist/providers/core/runtime/deepseek-http-provider.js.map +1 -1
- package/dist/providers/core/runtime/http-request-executor.d.ts +1 -0
- package/dist/providers/core/runtime/http-request-executor.js +131 -47
- package/dist/providers/core/runtime/http-request-executor.js.map +1 -1
- package/dist/providers/core/runtime/http-transport-provider.d.ts +5 -5
- package/dist/providers/core/runtime/http-transport-provider.js +97 -38
- package/dist/providers/core/runtime/http-transport-provider.js.map +1 -1
- package/dist/providers/core/runtime/openai-responses-sdk-transport.js +2 -1
- package/dist/providers/core/runtime/openai-responses-sdk-transport.js.map +1 -1
- package/dist/providers/core/runtime/provider-error-classifier.js +19 -126
- package/dist/providers/core/runtime/provider-error-classifier.js.map +1 -1
- package/dist/providers/core/runtime/provider-factory-helpers.d.ts +1 -0
- package/dist/providers/core/runtime/provider-factory-helpers.js +8 -12
- package/dist/providers/core/runtime/provider-factory-helpers.js.map +1 -1
- package/dist/providers/core/runtime/provider-factory.js +2 -9
- package/dist/providers/core/runtime/provider-factory.js.map +1 -1
- package/dist/providers/core/runtime/provider-failure-policy.d.ts +135 -0
- package/dist/providers/core/runtime/provider-failure-policy.js +685 -0
- package/dist/providers/core/runtime/provider-failure-policy.js.map +1 -0
- package/dist/providers/core/runtime/provider-family-profile-utils.d.ts +0 -10
- package/dist/providers/core/runtime/provider-family-profile-utils.js +0 -28
- package/dist/providers/core/runtime/provider-family-profile-utils.js.map +1 -1
- package/dist/providers/core/runtime/provider-http-executor-utils.js +40 -1
- package/dist/providers/core/runtime/provider-http-executor-utils.js.map +1 -1
- package/dist/providers/core/runtime/provider-request-header-orchestrator.d.ts +0 -2
- package/dist/providers/core/runtime/provider-request-header-orchestrator.js +35 -8
- package/dist/providers/core/runtime/provider-request-header-orchestrator.js.map +1 -1
- package/dist/providers/core/runtime/provider-response-postprocessor.js +3 -23
- package/dist/providers/core/runtime/provider-response-postprocessor.js.map +1 -1
- package/dist/providers/core/runtime/provider-runtime-utils.js +4 -1
- package/dist/providers/core/runtime/provider-runtime-utils.js.map +1 -1
- package/dist/providers/core/runtime/provider-startup-tasks.js +18 -2
- package/dist/providers/core/runtime/provider-startup-tasks.js.map +1 -1
- package/dist/providers/core/runtime/responses-provider-helpers.d.ts +1 -0
- package/dist/providers/core/runtime/responses-provider-helpers.js +11 -12
- package/dist/providers/core/runtime/responses-provider-helpers.js.map +1 -1
- package/dist/providers/core/runtime/responses-provider.js +15 -10
- package/dist/providers/core/runtime/responses-provider.js.map +1 -1
- package/dist/providers/core/runtime/standard-tool-text-harvest.js +10 -2
- package/dist/providers/core/runtime/standard-tool-text-harvest.js.map +1 -1
- package/dist/providers/core/runtime/transport/auth-provider-factory.d.ts +0 -1
- package/dist/providers/core/runtime/transport/auth-provider-factory.js +1 -15
- package/dist/providers/core/runtime/transport/auth-provider-factory.js.map +1 -1
- package/dist/providers/core/runtime/transport/index.d.ts +0 -1
- package/dist/providers/core/runtime/transport/index.js +0 -1
- package/dist/providers/core/runtime/transport/index.js.map +1 -1
- package/dist/providers/core/runtime/transport/oauth-recovery-handler.d.ts +2 -0
- package/dist/providers/core/runtime/transport/oauth-recovery-handler.js +76 -5
- package/dist/providers/core/runtime/transport/oauth-recovery-handler.js.map +1 -1
- package/dist/providers/core/runtime/transport/request-header-builder.d.ts +0 -1
- package/dist/providers/core/runtime/transport/request-header-builder.js +1 -7
- package/dist/providers/core/runtime/transport/request-header-builder.js.map +1 -1
- package/dist/providers/core/runtime/transport/runtime-detector.d.ts +0 -2
- package/dist/providers/core/runtime/transport/runtime-detector.js +0 -20
- package/dist/providers/core/runtime/transport/runtime-detector.js.map +1 -1
- package/dist/providers/core/runtime/transport/session-header-utils.d.ts +6 -0
- package/dist/providers/core/runtime/transport/session-header-utils.js +61 -2
- package/dist/providers/core/runtime/transport/session-header-utils.js.map +1 -1
- package/dist/providers/core/runtime/vercel-ai-sdk/anthropic-sdk-request-exec.js +2 -1
- package/dist/providers/core/runtime/vercel-ai-sdk/anthropic-sdk-request-exec.js.map +1 -1
- package/dist/providers/core/runtime/vercel-ai-sdk/openai-sdk-transport.js +2 -1
- package/dist/providers/core/runtime/vercel-ai-sdk/openai-sdk-transport.js.map +1 -1
- package/dist/providers/core/strategies/oauth-auth-code-flow.d.ts +1 -4
- package/dist/providers/core/strategies/oauth-auth-code-flow.js +26 -84
- package/dist/providers/core/strategies/oauth-auth-code-flow.js.map +1 -1
- package/dist/providers/core/strategies/oauth-device-flow.d.ts +2 -0
- package/dist/providers/core/strategies/oauth-device-flow.js +43 -8
- package/dist/providers/core/strategies/oauth-device-flow.js.map +1 -1
- package/dist/providers/core/utils/http-client.d.ts +7 -5
- package/dist/providers/core/utils/http-client.js +108 -33
- package/dist/providers/core/utils/http-client.js.map +1 -1
- package/dist/providers/core/utils/provider-error-reporter.d.ts +2 -2
- package/dist/providers/core/utils/provider-error-reporter.js +9 -85
- package/dist/providers/core/utils/provider-error-reporter.js.map +1 -1
- package/dist/providers/core/utils/provider-type-utils.js +1 -3
- package/dist/providers/core/utils/provider-type-utils.js.map +1 -1
- package/dist/providers/core/utils/qwen-client-fingerprint.d.ts +15 -0
- package/dist/providers/core/utils/qwen-client-fingerprint.js +47 -0
- package/dist/providers/core/utils/qwen-client-fingerprint.js.map +1 -0
- package/dist/providers/core/utils/snapshot-writer.d.ts +3 -0
- package/dist/providers/core/utils/snapshot-writer.js +385 -26
- package/dist/providers/core/utils/snapshot-writer.js.map +1 -1
- package/dist/providers/profile/families/qwen-profile.js +285 -22
- package/dist/providers/profile/families/qwen-profile.js.map +1 -1
- package/dist/providers/profile/profile-registry.js +0 -2
- package/dist/providers/profile/profile-registry.js.map +1 -1
- package/dist/providers/profile/provider-directory.js +0 -1
- package/dist/providers/profile/provider-directory.js.map +1 -1
- package/dist/providers/profile/provider-profile-loader.js +1 -1
- package/dist/providers/profile/provider-profile-loader.js.map +1 -1
- package/dist/server/handlers/chat-handler.js +6 -5
- package/dist/server/handlers/chat-handler.js.map +1 -1
- package/dist/server/handlers/config-admin-handler.js +44 -69
- package/dist/server/handlers/config-admin-handler.js.map +1 -1
- package/dist/server/handlers/handler-response-utils.js +190 -27
- package/dist/server/handlers/handler-response-utils.js.map +1 -1
- package/dist/server/handlers/handler-utils.d.ts +3 -0
- package/dist/server/handlers/handler-utils.js +72 -0
- package/dist/server/handlers/handler-utils.js.map +1 -1
- package/dist/server/handlers/images-handler.js +7 -7
- package/dist/server/handlers/images-handler.js.map +1 -1
- package/dist/server/handlers/messages-handler.js +6 -5
- package/dist/server/handlers/messages-handler.js.map +1 -1
- package/dist/server/handlers/responses-handler.js +32 -14
- package/dist/server/handlers/responses-handler.js.map +1 -1
- package/dist/server/handlers/sse-dispatcher.js +55 -13
- package/dist/server/handlers/sse-dispatcher.js.map +1 -1
- package/dist/server/handlers/types.d.ts +12 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-handler.js +5 -2
- package/dist/server/runtime/http-server/daemon-admin/auth-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/control-handler.js +62 -18
- package/dist/server/runtime/http-server/daemon-admin/control-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler-utils.js +1 -1
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler-utils.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler.js +9 -9
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-routing-utils.js +36 -10
- package/dist/server/runtime/http-server/daemon-admin/providers-handler-routing-utils.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/providers-handler.js +11 -11
- package/dist/server/runtime/http-server/daemon-admin/providers-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/quota-handler.js +49 -8
- package/dist/server/runtime/http-server/daemon-admin/quota-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin-routes.d.ts +1 -0
- package/dist/server/runtime/http-server/daemon-admin-routes.js +46 -0
- package/dist/server/runtime/http-server/daemon-admin-routes.js.map +1 -1
- package/dist/server/runtime/http-server/executor/client-injection-flow.js +2 -0
- package/dist/server/runtime/http-server/executor/client-injection-flow.js.map +1 -1
- package/dist/server/runtime/http-server/executor/log-rollup.d.ts +38 -0
- package/dist/server/runtime/http-server/executor/log-rollup.js +775 -0
- package/dist/server/runtime/http-server/executor/log-rollup.js.map +1 -0
- package/dist/server/runtime/http-server/executor/provider-response-converter.js +654 -281
- package/dist/server/runtime/http-server/executor/provider-response-converter.js.map +1 -1
- package/dist/server/runtime/http-server/executor/provider-response-utils.js +34 -3
- package/dist/server/runtime/http-server/executor/provider-response-utils.js.map +1 -1
- package/dist/server/runtime/http-server/executor/provider-runtime-resolver.js +14 -68
- package/dist/server/runtime/http-server/executor/provider-runtime-resolver.js.map +1 -1
- package/dist/server/runtime/http-server/executor/request-executor-core-utils.js +26 -2
- package/dist/server/runtime/http-server/executor/request-executor-core-utils.js.map +1 -1
- package/dist/server/runtime/http-server/executor/request-retry-helpers.js +20 -2
- package/dist/server/runtime/http-server/executor/request-retry-helpers.js.map +1 -1
- package/dist/server/runtime/http-server/executor/servertool-adapter-context.d.ts +10 -0
- package/dist/server/runtime/http-server/executor/servertool-adapter-context.js +120 -0
- package/dist/server/runtime/http-server/executor/servertool-adapter-context.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-dispatch.d.ts +35 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-dispatch.js +101 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-dispatch.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-error.d.ts +46 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-error.js +127 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-error.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-metadata.d.ts +7 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-metadata.js +186 -0
- package/dist/server/runtime/http-server/executor/servertool-followup-metadata.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-request-normalizer.d.ts +2 -0
- package/dist/server/runtime/http-server/executor/servertool-request-normalizer.js +56 -0
- package/dist/server/runtime/http-server/executor/servertool-request-normalizer.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-response-normalizer.d.ts +8 -0
- package/dist/server/runtime/http-server/executor/servertool-response-normalizer.js +31 -0
- package/dist/server/runtime/http-server/executor/servertool-response-normalizer.js.map +1 -0
- package/dist/server/runtime/http-server/executor/servertool-runtime-log.d.ts +8 -0
- package/dist/server/runtime/http-server/executor/servertool-runtime-log.js +33 -0
- package/dist/server/runtime/http-server/executor/servertool-runtime-log.js.map +1 -0
- package/dist/server/runtime/http-server/executor/sse-error-handler.js +37 -0
- package/dist/server/runtime/http-server/executor/sse-error-handler.js.map +1 -1
- package/dist/server/runtime/http-server/executor/usage-aggregator.js +32 -2
- package/dist/server/runtime/http-server/executor/usage-aggregator.js.map +1 -1
- package/dist/server/runtime/http-server/executor/usage-logger.d.ts +12 -0
- package/dist/server/runtime/http-server/executor/usage-logger.js +56 -1
- package/dist/server/runtime/http-server/executor/usage-logger.js.map +1 -1
- package/dist/server/runtime/http-server/executor-metadata.d.ts +15 -0
- package/dist/server/runtime/http-server/executor-metadata.js +60 -18
- package/dist/server/runtime/http-server/executor-metadata.js.map +1 -1
- package/dist/server/runtime/http-server/executor-provider.d.ts +2 -0
- package/dist/server/runtime/http-server/executor-provider.js +88 -205
- package/dist/server/runtime/http-server/executor-provider.js.map +1 -1
- package/dist/server/runtime/http-server/executor-response.js +30 -149
- package/dist/server/runtime/http-server/executor-response.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-bootstrap.js +53 -17
- package/dist/server/runtime/http-server/http-server-bootstrap.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-legacy-pipeline.js +28 -1
- package/dist/server/runtime/http-server/http-server-legacy-pipeline.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-lifecycle.js +17 -4
- package/dist/server/runtime/http-server/http-server-lifecycle.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-runtime-providers.js +42 -13
- package/dist/server/runtime/http-server/http-server-runtime-providers.js.map +1 -1
- package/dist/server/runtime/http-server/http-server-runtime-setup.js +40 -2
- package/dist/server/runtime/http-server/http-server-runtime-setup.js.map +1 -1
- package/dist/server/runtime/http-server/hub-shadow-compare.js +8 -4
- package/dist/server/runtime/http-server/hub-shadow-compare.js.map +1 -1
- package/dist/server/runtime/http-server/managed-process-probe.js +30 -4
- package/dist/server/runtime/http-server/managed-process-probe.js.map +1 -1
- package/dist/server/runtime/http-server/middleware.js +32 -4
- package/dist/server/runtime/http-server/middleware.js.map +1 -1
- package/dist/server/runtime/http-server/provider-traffic-governor.d.ts +45 -1
- package/dist/server/runtime/http-server/provider-traffic-governor.js +697 -111
- package/dist/server/runtime/http-server/provider-traffic-governor.js.map +1 -1
- package/dist/server/runtime/http-server/provider-utils.js +2 -6
- package/dist/server/runtime/http-server/provider-utils.js.map +1 -1
- package/dist/server/runtime/http-server/request-activity-tracker.d.ts +4 -0
- package/dist/server/runtime/http-server/request-activity-tracker.js +54 -11
- package/dist/server/runtime/http-server/request-activity-tracker.js.map +1 -1
- package/dist/server/runtime/http-server/request-executor.d.ts +247 -0
- package/dist/server/runtime/http-server/request-executor.js +2444 -334
- package/dist/server/runtime/http-server/request-executor.js.map +1 -1
- package/dist/server/runtime/http-server/routes.js +59 -16
- package/dist/server/runtime/http-server/routes.js.map +1 -1
- package/dist/server/runtime/http-server/runtime-manager.js +0 -15
- package/dist/server/runtime/http-server/runtime-manager.js.map +1 -1
- package/dist/server/runtime/http-server/session-client-registry-utils.js +46 -10
- package/dist/server/runtime/http-server/session-client-registry-utils.js.map +1 -1
- package/dist/server/runtime/http-server/session-client-registry.js +22 -4
- package/dist/server/runtime/http-server/session-client-registry.js.map +1 -1
- package/dist/server/runtime/http-server/session-client-routes.js +40 -18
- package/dist/server/runtime/http-server/session-client-routes.js.map +1 -1
- package/dist/server/runtime/http-server/session-dir.js +35 -2
- package/dist/server/runtime/http-server/session-dir.js.map +1 -1
- package/dist/server/runtime/http-server/session-scope-resolution.js +38 -9
- package/dist/server/runtime/http-server/session-scope-resolution.js.map +1 -1
- package/dist/server/runtime/http-server/session-storage-cleanup.js +64 -27
- package/dist/server/runtime/http-server/session-storage-cleanup.js.map +1 -1
- package/dist/server/runtime/http-server/stats-manager.d.ts +5 -0
- package/dist/server/runtime/http-server/stats-manager.js +138 -6
- package/dist/server/runtime/http-server/stats-manager.js.map +1 -1
- package/dist/server/runtime/http-server/tmux-injection-history.js +30 -4
- package/dist/server/runtime/http-server/tmux-injection-history.js.map +1 -1
- package/dist/server/runtime/http-server/tmux-session-probe.d.ts +3 -1
- package/dist/server/runtime/http-server/tmux-session-probe.js +198 -9
- package/dist/server/runtime/http-server/tmux-session-probe.js.map +1 -1
- package/dist/server/utils/client-connection-state.d.ts +1 -0
- package/dist/server/utils/client-connection-state.js +45 -5
- package/dist/server/utils/client-connection-state.js.map +1 -1
- package/dist/server/utils/finish-reason.js +61 -2
- package/dist/server/utils/finish-reason.js.map +1 -1
- package/dist/server/utils/http-error-mapper.d.ts +4 -0
- package/dist/server/utils/http-error-mapper.js +31 -6
- package/dist/server/utils/http-error-mapper.js.map +1 -1
- package/dist/server/utils/stage-logger.js +42 -13
- package/dist/server/utils/stage-logger.js.map +1 -1
- package/dist/server-lifecycle/port-utils.js +6 -2
- package/dist/server-lifecycle/port-utils.js.map +1 -1
- package/dist/token-daemon/index.js +44 -15
- package/dist/token-daemon/index.js.map +1 -1
- package/dist/token-daemon/leader-lock.js +65 -7
- package/dist/token-daemon/leader-lock.js.map +1 -1
- package/dist/token-daemon/provider-registry.js +1 -1
- package/dist/token-daemon/provider-registry.js.map +1 -1
- package/dist/token-daemon/server-utils.d.ts +11 -0
- package/dist/token-daemon/server-utils.js +71 -18
- package/dist/token-daemon/server-utils.js.map +1 -1
- package/dist/token-daemon/token-daemon.d.ts +0 -1
- package/dist/token-daemon/token-daemon.js +81 -63
- package/dist/token-daemon/token-daemon.js.map +1 -1
- package/dist/token-daemon/token-types.d.ts +1 -1
- package/dist/token-daemon/token-types.js +0 -1
- package/dist/token-daemon/token-types.js.map +1 -1
- package/dist/token-daemon/token-utils.js +4 -2
- package/dist/token-daemon/token-utils.js.map +1 -1
- package/dist/tools/provider-update/fetch-models.js +1 -5
- package/dist/tools/provider-update/fetch-models.js.map +1 -1
- package/dist/utils/error-handler-registry.js +50 -13
- package/dist/utils/error-handler-registry.js.map +1 -1
- package/dist/utils/errorsamples.d.ts +3 -1
- package/dist/utils/errorsamples.js +198 -14
- package/dist/utils/errorsamples.js.map +1 -1
- package/dist/utils/http-health-probe.d.ts +42 -0
- package/dist/utils/http-health-probe.js +231 -0
- package/dist/utils/http-health-probe.js.map +1 -0
- package/dist/utils/managed-server-pids.js +2 -2
- package/dist/utils/managed-server-pids.js.map +1 -1
- package/dist/utils/module-config-reader.js +11 -1
- package/dist/utils/module-config-reader.js.map +1 -1
- package/dist/utils/runtime-package-root.d.ts +2 -0
- package/dist/utils/runtime-package-root.js +47 -0
- package/dist/utils/runtime-package-root.js.map +1 -0
- package/dist/utils/snapshot-local-disk-gate.d.ts +3 -0
- package/dist/utils/snapshot-local-disk-gate.js +50 -0
- package/dist/utils/snapshot-local-disk-gate.js.map +1 -0
- package/dist/utils/snapshot-payload-guard.d.ts +1 -0
- package/dist/utils/snapshot-payload-guard.js +234 -0
- package/dist/utils/snapshot-payload-guard.js.map +1 -0
- package/dist/utils/snapshot-request-retention.d.ts +3 -0
- package/dist/utils/snapshot-request-retention.js +128 -0
- package/dist/utils/snapshot-request-retention.js.map +1 -0
- package/dist/utils/snapshot-stage-policy.d.ts +3 -0
- package/dist/utils/snapshot-stage-policy.js +111 -0
- package/dist/utils/snapshot-stage-policy.js.map +1 -0
- package/dist/utils/snapshot-writer.js +176 -19
- package/dist/utils/snapshot-writer.js.map +1 -1
- package/docs/CHAT_PROCESS_PROTOCOL_AND_PIPELINE.md +4 -0
- package/docs/CONFIG_ARCHITECTURE.md +2 -2
- package/docs/INSTALLATION_AND_QUICKSTART.md +5 -5
- package/docs/OAUTH.md +2 -5
- package/docs/PORTS.md +1 -1
- package/docs/PROVIDERS_BUILTIN.md +1 -5
- package/docs/PROVIDER_TYPES.md +1 -1
- package/docs/agent-routing/10-runtime-ssot-routing.md +4 -0
- package/docs/agent-routing/20-build-test-release-routing.md +2 -2
- package/docs/agent-routing/30-servertool-lifecycle-routing.md +2 -0
- package/docs/agent-routing/40-task-memory-routing.md +22 -2
- package/docs/audit/286.1-provider-failure-policy-audit.md +341 -0
- package/docs/audits/2026-04-26-fallback-silent-failure-audit.md +119 -0
- package/docs/audits/2026-04-27-provider-failure-policy-ssot-audit.md +153 -0
- package/docs/chat-process-continuation-state-contract.md +196 -0
- package/docs/chat-semantic-expansion-plan.md +2 -0
- package/docs/daemon-admin-api-design.md +9 -9
- package/docs/design/provider-failure-policy-ssot.md +215 -0
- package/docs/design/reasoning-stop-lifecycle.md +90 -0
- package/docs/design/servertool-unified-skeleton.md +202 -0
- package/docs/design/websearch-servertool-orchestration.md +190 -0
- package/docs/error-handling-v2.md +120 -11
- package/docs/protocol-compatibility-matrix.md +147 -0
- package/docs/providers/provider-composite-design.md +4 -5
- package/docs/providers/provider-composite-testing.md +1 -1
- package/docs/providers/provider-type-only-migration.md +2 -15
- package/docs/refactoring/compatibility-v2-architecture-design.md +1 -3
- package/docs/refactoring/host-164.3-responsibility-migration.md +0 -1
- package/docs/routing-instructions.md +42 -1
- package/docs/stop-message-auto.md +0 -1
- package/docs/token-refresh-daemon-plan.md +14 -14
- package/docs/v2-architecture/IMPLEMENTATION-ROADMAP.md +1 -1
- package/docs/v2-architecture/PROVIDER-V2-CHANGESET-RELEASE-CHECKLIST.md +1 -9
- package/docs/v2-architecture/PROVIDER-V2-LAYERING-ADR-DRAFT.md +3 -4
- package/docs/v2-architecture/PROVIDER-V2-MIGRATION-MATRIX-DRAFT.md +4 -15
- package/docs/v2-architecture/PROVIDER-V2-PHASED-MIGRATION-ROLLBACK-DRAFT.md +4 -5
- package/docs/v2-architecture/PROVIDER-V2-PROFILE-API-REGISTRY-DRAFT.md +4 -4
- package/docs/v2-architecture/PROVIDER-V2-REFACTOR-OVERVIEW-DRAFT.md +1 -2
- package/docs/v2-architecture/PROVIDER-V2-VERIFICATION-MATRIX-DRAFT.md +2 -2
- package/node_modules/@jsonstudio/llms/dist/config-unified/unified-config.js +36 -10
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/deepseek-web-request.js +7 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/deepseek-web-response.js +2 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/antigravity-session-signature.js +33 -17
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/header-policies.d.ts +20 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/header-policies.js +79 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/policy-overrides.d.ts +16 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/policy-overrides.js +27 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/provider-resolver.d.ts +26 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/provider-resolver.js +59 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/registry.d.ts +35 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/registry.js +154 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/types.d.ts +75 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profile-registry/types.js +8 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/anthropic-claude-code.json +13 -7
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-claude-code.json +13 -8
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-deepseek-web.json +37 -8
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-qwen.json +48 -11
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/compat-passthrough.json +6 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/provider-resolution-config.json +24 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/node-support.js +5 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper-config.js +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper-from-chat.js +54 -7
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-mapper-to-chat.js +15 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-semantics-audit.d.ts +11 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/anthropic-semantics-audit.js +16 -30
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper-config.js +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapper-from-chat.js +15 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapping-audit.d.ts +10 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/gemini-mapping-audit.js +9 -30
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/protocol-mapping-audit.d.ts +43 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/protocol-mapping-audit.js +148 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper-from-chat.js +16 -6
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper-helpers.d.ts +2 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper-helpers.js +65 -3
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper-to-chat.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/operation-table/semantic-mappers/responses-mapper.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/compat/compat-types.d.ts +14 -154
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-chat-process-request-utils.d.ts +6 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-chat-process-request-utils.js +83 -3
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-chat-process-entry.js +6 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-request-stage-inbound.d.ts +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-request-stage-inbound.js +9 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-request-stage-provider-payload.js +132 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-execute-request-stage.js +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-heavy-input-fastpath.d.ts +4 -22
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-heavy-input-fastpath.js +109 -139
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-max-tokens-policy.js +40 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-route-and-outbound.d.ts +0 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline-route-and-outbound.js +19 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline.d.ts +0 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/hub-pipeline.js +45 -43
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/route-aware-responses-continuation.d.ts +10 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/route-aware-responses-continuation.js +143 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/index.js +37 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage2_semantic_map/semantic-lift.js +14 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.d.ts +3 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/req_inbound/req_inbound_stage3_context_capture/responses-context-snapshot.js +22 -11
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/chat-process-semantics-bridge.js +59 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/client-remap-protocol-switch.js +3 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_outbound/resp_outbound_stage1_client_remap/index.js +2 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.d.ts +2 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage1_tool_governance/index.js +53 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage2_finalize/index.js +4 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/pipeline/stages/resp_process/resp_process_stage3_servertool_orchestration/index.js +16 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/policy/policy-engine.js +14 -4
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-anthropic-alias.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-anthropic-alias.js +29 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-pending-tool-sync.js +38 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-request-sanitizer.js +164 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/provider-response.js +27 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/response-mappers.d.ts +9 -3
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/response-mappers.js +8 -7
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/response/response-runtime-anthropic.js +20 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/snapshot-recorder.js +1 -247
- package/node_modules/@jsonstudio/llms/dist/conversion/hub/types/chat-envelope.d.ts +84 -4
- package/node_modules/@jsonstudio/llms/dist/conversion/pipeline/codecs/v2/responses-openai-pipeline.js +26 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge/response-payload.js +10 -9
- package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge/utils.js +20 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/responses/responses-openai-bridge.js +88 -4
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils-core.js +5 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils-openai-request.js +55 -14
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils-tool-schema.js +1 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/anthropic-message-utils.js +38 -15
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/openai-message-normalize.js +45 -6
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-conversation-store.d.ts +15 -0
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-conversation-store.js +157 -13
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-reasoning-registry.d.ts +8 -2
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-reasoning-registry.js +103 -9
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/responses-response-utils.js +10 -10
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-filter-pipeline.js +59 -9
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-governor-guards.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-governor-guards.js +54 -43
- package/node_modules/@jsonstudio/llms/dist/conversion/shared/tool-governor.js +62 -8
- package/node_modules/@jsonstudio/llms/dist/conversion/snapshot-utils.js +269 -12
- package/node_modules/@jsonstudio/llms/dist/filters/engine.js +64 -6
- package/node_modules/@jsonstudio/llms/dist/filters/special/request-tool-list-filter.js +32 -11
- package/node_modules/@jsonstudio/llms/dist/filters/special/request-toolcalls-stringify.js +26 -1
- package/node_modules/@jsonstudio/llms/dist/filters/special/request-tools-normalize.js +46 -7
- package/node_modules/@jsonstudio/llms/dist/filters/special/response-tool-arguments-blacklist.js +10 -1
- package/node_modules/@jsonstudio/llms/dist/filters/special/response-tool-arguments-schema-converge.js +10 -1
- package/node_modules/@jsonstudio/llms/dist/filters/special/response-tool-arguments-stringify.js +30 -5
- package/node_modules/@jsonstudio/llms/dist/filters/special/response-tool-arguments-whitelist.js +10 -1
- package/node_modules/@jsonstudio/llms/dist/filters/special/tool-filter-hooks.js +16 -14
- package/node_modules/@jsonstudio/llms/dist/filters/utils/snapshot-writer.js +47 -5
- package/node_modules/@jsonstudio/llms/dist/guidance/index.js +16 -2
- package/node_modules/@jsonstudio/llms/dist/http/sse-response.js +42 -6
- package/node_modules/@jsonstudio/llms/dist/native/router_hotpath_napi.node +0 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/auth-utils.js +33 -31
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/provider-normalization.d.ts +6 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/provider-normalization.js +78 -98
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/responses-helpers.js +22 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/routing-config.js +56 -3
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap/streaming-helpers.js +19 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/bootstrap.js +62 -293
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/classifier.js +11 -82
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/antigravity/alias-lease.js +42 -15
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/cooldown-manager.js +55 -3
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/health/index.js +66 -15
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/routing-pools/index.js +44 -8
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/routing-state/keys.d.ts +7 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/routing-state/keys.js +65 -21
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/routing-state/store.js +19 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/sticky-session-manager.d.ts +9 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine/sticky-session-manager.js +139 -4
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-logging.js +2 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-clock-reminder-semantics.js +68 -59
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-governance-semantics.js +156 -157
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-node-result-semantics.js +31 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-chat-process-servertool-orchestration-semantics.js +94 -95
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-compat-action-semantics.d.ts +0 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-compat-action-semantics.js +0 -7
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-parsers.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-parsers.js +203 -305
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-tools-post.js +35 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-tools-request.js +2 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-action-semantics-types.d.ts +2 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-bridge-policy-semantics.js +173 -154
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.js +106 -57
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-inbound-outbound-semantics.js +122 -114
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics-builders.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics-metadata-policy.js +100 -86
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics-passthrough.js +52 -33
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics-protocol.js +79 -62
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-orchestration-semantics.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics-parsers.js +50 -33
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics-types.d.ts +2 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics-parsers.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-req-outbound-semantics-parsers.js +161 -177
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics-outbound-tools.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics-outbound-tools.js +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics-parsers.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics-parsers.js +231 -286
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-router-hotpath-analysis.js +143 -164
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-router-hotpath-required-exports.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-router-hotpath-required-exports.js +8 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics-reasoning.js +57 -28
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics-responses.d.ts +8 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics-responses.js +76 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-shared-conversion-semantics.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-virtual-router-bootstrap-providers.d.ts +24 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-virtual-router-bootstrap-providers.js +78 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-virtual-router-bootstrap-routing.d.ts +17 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/native-virtual-router-bootstrap-routing.js +72 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/route-utils.js +9 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-selection/tier-selection-select.js +11 -5
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine.js +4 -39
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/features.js +199 -31
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/health-manager.js +7 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/load-balancer.d.ts +3 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/load-balancer.js +47 -3
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/native-error.d.ts +11 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/native-error.js +71 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/provider-registry.js +81 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/provider-runtime-ingress.d.ts +24 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/provider-runtime-ingress.js +139 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/routing-instructions/parse.js +21 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/routing-instructions/state.js +46 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/routing-instructions/types.d.ts +7 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/routing-stop-message-state-codec.js +30 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/sticky-session-store.js +44 -15
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/stop-message-state-sync.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/stop-message-state-sync.js +10 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/success-center.js +39 -2
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/tool-signals.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/tool-signals.js +25 -24
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/types.d.ts +3 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/engine.js +255 -71
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/clock.js +20 -2
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/followup-request-builder.js +120 -85
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/memory-appender.d.ts +6 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/memory-appender.js +42 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-only-continue.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-stop-guard.js +630 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-stop-state.d.ts +24 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-stop-state.js +606 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/reasoning-stop.js +292 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/{iflow-followup.d.ts → ai-followup.d.ts} +3 -3
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/{iflow-followup.js → ai-followup.js} +76 -81
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/config.d.ts +1 -2
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/config.js +2 -6
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/runtime-utils.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto/runtime-utils.js +51 -11
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/stop-message-auto.js +5 -4
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/web-search-auto-trigger.d.ts +9 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/web-search-auto-trigger.js +91 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/web-search.js +1 -131
- package/node_modules/@jsonstudio/llms/dist/servertool/heartbeat/session-store.js +49 -18
- package/node_modules/@jsonstudio/llms/dist/servertool/registry.js +3 -0
- package/node_modules/@jsonstudio/llms/dist/servertool/server-side-tools.d.ts +2 -2
- package/node_modules/@jsonstudio/llms/dist/servertool/server-side-tools.js +14 -10
- package/node_modules/@jsonstudio/llms/dist/servertool/strip-servertool-calls.js +2 -3
- package/node_modules/@jsonstudio/llms/dist/servertool/types.d.ts +11 -1
- package/node_modules/@jsonstudio/llms/dist/sse/json-to-sse/chat-json-to-sse-converter.js +26 -1
- package/node_modules/@jsonstudio/llms/dist/sse/json-to-sse/event-generators/chat.d.ts +2 -2
- package/node_modules/@jsonstudio/llms/dist/sse/json-to-sse/event-generators/chat.js +38 -3
- package/node_modules/@jsonstudio/llms/dist/sse/json-to-sse/sequencers/chat-sequencer.js +6 -3
- package/node_modules/@jsonstudio/llms/dist/sse/shared/chat-serializer.js +27 -3
- package/node_modules/@jsonstudio/llms/dist/sse/shared/constants.d.ts +6 -6
- package/node_modules/@jsonstudio/llms/dist/sse/shared/constants.js +3 -3
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/anthropic-sse-to-json-converter.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/anthropic-sse-to-json-converter.js +36 -1
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/builders/anthropic-response-builder.js +6 -20
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/builders/response-builder.d.ts +3 -0
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/builders/response-builder.js +125 -42
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/chat-sse-to-json-converter.js +59 -10
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/parsers/sse-parser.js +2 -0
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/responses-sse-to-json-converter.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/sse/sse-to-json/responses-sse-to-json-converter.js +71 -2
- package/node_modules/@jsonstudio/llms/dist/sse/types/chat-types.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/sse/types/chat-types.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/sse/types/conversion-context.js +2 -2
- package/node_modules/@jsonstudio/llms/dist/sse/types/index.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/sse/types/responses-types.d.ts +1 -1
- package/node_modules/@jsonstudio/llms/dist/sse/types/responses-types.js +1 -1
- package/node_modules/@jsonstudio/llms/dist/telemetry/stats-center.js +34 -12
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/patch-text/fuzzy-match.d.ts +14 -0
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/patch-text/fuzzy-match.js +174 -0
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/patch-text/normalize.js +148 -0
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/structured.js +31 -2
- package/node_modules/@jsonstudio/llms/dist/tools/apply-patch/validator.js +121 -4
- package/node_modules/@jsonstudio/llms/dist/tools/exec-command/normalize.d.ts +4 -1
- package/node_modules/@jsonstudio/llms/dist/tools/exec-command/normalize.js +31 -16
- package/node_modules/@jsonstudio/llms/dist/tools/exec-command/validator.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/tools/exec-command/validator.js +3 -1
- package/node_modules/@jsonstudio/llms/dist/tools/tool-registry.d.ts +1 -0
- package/node_modules/@jsonstudio/llms/dist/tools/tool-registry.js +5 -27
- package/node_modules/@jsonstudio/llms/package.json +1 -1
- package/package.json +6 -7
- package/scripts/ci/repo-sanity.mjs +1 -0
- package/scripts/ci/silent-failure-audit.mjs +112 -70
- package/scripts/cleanup-stale-server-pids.mjs +0 -6
- package/scripts/ensure-cli-command-shim.mjs +49 -15
- package/scripts/ensure-cli-executable.mjs +1 -1
- package/scripts/install-global.sh +7 -6
- package/scripts/install-release-snapshot.mjs +232 -0
- package/scripts/install-release.sh +30 -24
- package/scripts/link-global-llms-local.mjs +1 -2
- package/scripts/monitor/memory-guard.mjs +207 -0
- package/scripts/pack-mode.mjs +0 -4
- package/scripts/pack-rcc.mjs +17 -58
- package/scripts/run-bg.sh +0 -6
- package/scripts/run-fg-gtimeout.sh +0 -6
- package/scripts/tests/antigravity-codex-sample-pipeline-compare.mjs +1 -1
- package/scripts/tests/blackbox-rcc-vs-routecodex-antigravity.mjs +60 -39
- package/scripts/verify-install-e2e.mjs +64 -26
- package/configsamples/provider-default/qwenchat/config.v2.json +0 -53
- package/dist/providers/auth/iflow-cookie-auth.d.ts +0 -27
- package/dist/providers/auth/iflow-cookie-auth.js +0 -207
- package/dist/providers/auth/iflow-cookie-auth.js.map +0 -1
- package/dist/providers/auth/iflow-userinfo-helper.d.ts +0 -32
- package/dist/providers/auth/iflow-userinfo-helper.js +0 -81
- package/dist/providers/auth/iflow-userinfo-helper.js.map +0 -1
- package/dist/providers/core/runtime/iflow-http-provider.d.ts +0 -13
- package/dist/providers/core/runtime/iflow-http-provider.js +0 -22
- package/dist/providers/core/runtime/iflow-http-provider.js.map +0 -1
- package/dist/providers/core/runtime/provider-iflow-business-error-utils.d.ts +0 -15
- package/dist/providers/core/runtime/provider-iflow-business-error-utils.js +0 -49
- package/dist/providers/core/runtime/provider-iflow-business-error-utils.js.map +0 -1
- package/dist/providers/core/runtime/qwenchat-http-provider-helpers.d.ts +0 -89
- package/dist/providers/core/runtime/qwenchat-http-provider-helpers.js +0 -1698
- package/dist/providers/core/runtime/qwenchat-http-provider-helpers.js.map +0 -1
- package/dist/providers/core/runtime/qwenchat-http-provider.d.ts +0 -9
- package/dist/providers/core/runtime/qwenchat-http-provider.js +0 -78
- package/dist/providers/core/runtime/qwenchat-http-provider.js.map +0 -1
- package/dist/providers/core/runtime/standard-tool-text-request-transform.d.ts +0 -13
- package/dist/providers/core/runtime/standard-tool-text-request-transform.js +0 -130
- package/dist/providers/core/runtime/standard-tool-text-request-transform.js.map +0 -1
- package/dist/providers/core/runtime/transport/iflow-signer.d.ts +0 -12
- package/dist/providers/core/runtime/transport/iflow-signer.js +0 -63
- package/dist/providers/core/runtime/transport/iflow-signer.js.map +0 -1
- package/dist/providers/profile/families/iflow-profile.d.ts +0 -2
- package/dist/providers/profile/families/iflow-profile.js +0 -384
- package/dist/providers/profile/families/iflow-profile.js.map +0 -1
- package/docs/mapping-tables/iflow-to-openai.json +0 -215
- package/docs/mapping-tables/openai-to-iflow.json +0 -227
- package/docs/multi-token-auth-guide.md +0 -66
- package/docs/oauth-authentication-guide.md +0 -172
- package/docs/oauth-iflow-implementation.md +0 -157
- package/docs/release-iflow-400-gate.md +0 -58
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-cli-defaults.d.ts +0 -10
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-cli-defaults.js +0 -31
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.d.ts +0 -7
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-history-media-placeholder.js +0 -25
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.d.ts +0 -12
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-kimi-thinking-reasoning-fill.js +0 -46
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-native-compat.d.ts +0 -6
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-native-compat.js +0 -36
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-response-body-unwrap.d.ts +0 -9
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-response-body-unwrap.js +0 -25
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-tool-text-fallback.d.ts +0 -5
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-tool-text-fallback.js +0 -29
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-web-search.d.ts +0 -18
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/iflow-web-search.js +0 -49
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/qwenchat-web-request.d.ts +0 -3
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/actions/qwenchat-web-request.js +0 -62
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-iflow.json +0 -353
- package/node_modules/@jsonstudio/llms/dist/conversion/compat/profiles/chat-qwenchat-web.json +0 -47
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-health.d.ts +0 -1
- package/node_modules/@jsonstudio/llms/dist/router/virtual-router/engine-health.js +0 -1
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/iflow-model-error-retry.js +0 -92
- package/node_modules/@jsonstudio/llms/dist/servertool/handlers/review.js +0 -202
- package/scripts/publish-rcc.mjs +0 -81
- /package/node_modules/@jsonstudio/llms/dist/servertool/handlers/{iflow-model-error-retry.d.ts → reasoning-stop-guard.d.ts} +0 -0
- /package/node_modules/@jsonstudio/llms/dist/servertool/handlers/{review.d.ts → reasoning-stop.d.ts} +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { materializeLatestResponsesContinuationByScope, resumeLatestResponsesContinuationByScope } from '../../shared/responses-conversation-store.js';
|
|
2
|
+
import { extractSessionIdentifiersFromMetadata } from './session-identifiers.js';
|
|
3
|
+
import { buildChatRequestFromResponses, captureResponsesContext } from '../../shared/responses-request-adapter.js';
|
|
4
|
+
function asRecord(value) {
|
|
5
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
function readText(value) {
|
|
11
|
+
if (typeof value !== 'string') {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const trimmed = value.trim();
|
|
15
|
+
return trimmed || undefined;
|
|
16
|
+
}
|
|
17
|
+
function hasExplicitPreviousResponseId(rawRequest) {
|
|
18
|
+
return Boolean(readText(rawRequest.previous_response_id));
|
|
19
|
+
}
|
|
20
|
+
function cloneSemantics(request) {
|
|
21
|
+
const semantics = request.semantics;
|
|
22
|
+
return asRecord(semantics) ? { ...semantics } : {};
|
|
23
|
+
}
|
|
24
|
+
export function resolveRouteAwareResponsesContinuation(args) {
|
|
25
|
+
if (args.entryProtocol !== 'openai-responses') {
|
|
26
|
+
return args.request;
|
|
27
|
+
}
|
|
28
|
+
const rawRequestRecord = asRecord(args.rawRequest);
|
|
29
|
+
if (!rawRequestRecord || hasExplicitPreviousResponseId(args.rawRequest)) {
|
|
30
|
+
return args.request;
|
|
31
|
+
}
|
|
32
|
+
if (!Array.isArray(rawRequestRecord.input) || rawRequestRecord.input.length === 0) {
|
|
33
|
+
return args.request;
|
|
34
|
+
}
|
|
35
|
+
const { sessionId, conversationId } = extractSessionIdentifiersFromMetadata(args.normalizedMetadata);
|
|
36
|
+
if (!sessionId && !conversationId) {
|
|
37
|
+
return args.request;
|
|
38
|
+
}
|
|
39
|
+
if (args.outboundProtocol !== 'openai-responses') {
|
|
40
|
+
const materialized = materializeLatestResponsesContinuationByScope({
|
|
41
|
+
payload: rawRequestRecord,
|
|
42
|
+
sessionId,
|
|
43
|
+
conversationId,
|
|
44
|
+
requestId: args.requestId
|
|
45
|
+
});
|
|
46
|
+
const materializedPayload = asRecord(materialized?.payload);
|
|
47
|
+
if (!materializedPayload) {
|
|
48
|
+
return args.request;
|
|
49
|
+
}
|
|
50
|
+
const context = captureResponsesContext(materializedPayload, {
|
|
51
|
+
route: { requestId: args.requestId }
|
|
52
|
+
});
|
|
53
|
+
const rebuilt = buildChatRequestFromResponses(materializedPayload, context).request;
|
|
54
|
+
const rebuiltMessages = Array.isArray(rebuilt.messages)
|
|
55
|
+
? rebuilt.messages
|
|
56
|
+
: undefined;
|
|
57
|
+
if (!rebuiltMessages?.length) {
|
|
58
|
+
return args.request;
|
|
59
|
+
}
|
|
60
|
+
const currentModel = typeof args.request.model === 'string' ? args.request.model : undefined;
|
|
61
|
+
const rebuiltModel = typeof rebuilt.model === 'string' ? rebuilt.model : undefined;
|
|
62
|
+
const nextModel = currentModel ?? rebuiltModel;
|
|
63
|
+
if (!nextModel) {
|
|
64
|
+
return args.request;
|
|
65
|
+
}
|
|
66
|
+
const nextSemantics = cloneSemantics(args.request);
|
|
67
|
+
const currentResponses = asRecord(nextSemantics.responses);
|
|
68
|
+
const currentResume = asRecord(currentResponses?.resume);
|
|
69
|
+
nextSemantics.responses = {
|
|
70
|
+
...(currentResponses ?? {}),
|
|
71
|
+
resume: {
|
|
72
|
+
...(currentResume ?? {}),
|
|
73
|
+
...(asRecord(materialized?.meta) ?? {}),
|
|
74
|
+
...(sessionId ? { sessionId } : {}),
|
|
75
|
+
...(conversationId ? { conversationId } : {})
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
...args.request,
|
|
80
|
+
// Preserve the already route-selected model; do not let stored responses payload
|
|
81
|
+
// restore the original client model before provider payload build.
|
|
82
|
+
model: nextModel,
|
|
83
|
+
messages: rebuiltMessages,
|
|
84
|
+
...(Array.isArray(rebuilt.tools) ? { tools: rebuilt.tools } : {}),
|
|
85
|
+
semantics: nextSemantics
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const restored = resumeLatestResponsesContinuationByScope({
|
|
89
|
+
payload: rawRequestRecord,
|
|
90
|
+
sessionId,
|
|
91
|
+
conversationId,
|
|
92
|
+
requestId: args.requestId
|
|
93
|
+
});
|
|
94
|
+
const restoredPayload = asRecord(restored?.payload);
|
|
95
|
+
const restoredMeta = asRecord(restored?.meta);
|
|
96
|
+
const restoredFromResponseId = readText(restoredMeta?.restoredFromResponseId)
|
|
97
|
+
?? readText(restoredPayload?.previous_response_id);
|
|
98
|
+
const previousRequestId = readText(restoredMeta?.previousRequestId);
|
|
99
|
+
const deltaInput = Array.isArray(restoredPayload?.input)
|
|
100
|
+
? restoredPayload?.input
|
|
101
|
+
: undefined;
|
|
102
|
+
if (!restoredFromResponseId || !deltaInput) {
|
|
103
|
+
return args.request;
|
|
104
|
+
}
|
|
105
|
+
const nextSemantics = cloneSemantics(args.request);
|
|
106
|
+
const currentResponses = asRecord(nextSemantics.responses);
|
|
107
|
+
const currentResume = asRecord(currentResponses?.resume);
|
|
108
|
+
nextSemantics.responses = {
|
|
109
|
+
...(currentResponses ?? {}),
|
|
110
|
+
resume: {
|
|
111
|
+
...(currentResume ?? {}),
|
|
112
|
+
...(restoredMeta ?? {}),
|
|
113
|
+
deltaInput
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const currentContinuation = asRecord(nextSemantics.continuation);
|
|
117
|
+
const currentResumeFrom = asRecord(currentContinuation?.resumeFrom);
|
|
118
|
+
nextSemantics.continuation = {
|
|
119
|
+
...(currentContinuation ?? {}),
|
|
120
|
+
...(previousRequestId
|
|
121
|
+
? {
|
|
122
|
+
chainId: readText(currentContinuation?.chainId) ?? previousRequestId,
|
|
123
|
+
stickyScope: readText(currentContinuation?.stickyScope) ?? 'request_chain',
|
|
124
|
+
stateOrigin: readText(currentContinuation?.stateOrigin) ?? 'openai-responses',
|
|
125
|
+
restored: true
|
|
126
|
+
}
|
|
127
|
+
: {}),
|
|
128
|
+
resumeFrom: {
|
|
129
|
+
...(currentResumeFrom ?? {}),
|
|
130
|
+
protocol: readText(currentResumeFrom?.protocol) ?? 'openai-responses',
|
|
131
|
+
...(previousRequestId
|
|
132
|
+
? {
|
|
133
|
+
requestId: readText(currentResumeFrom?.requestId) ?? previousRequestId
|
|
134
|
+
}
|
|
135
|
+
: {}),
|
|
136
|
+
previousResponseId: restoredFromResponseId
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
...args.request,
|
|
141
|
+
semantics: nextSemantics
|
|
142
|
+
};
|
|
143
|
+
}
|
|
@@ -6,6 +6,8 @@ import { validateChatEnvelopeWithNative } from "../../../../../../router/virtual
|
|
|
6
6
|
import { chatEnvelopeToStandardizedWithNative } from "../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.js";
|
|
7
7
|
import { normalizeReqInboundShellLikeToolCallsWithNative } from "../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics-tools.js";
|
|
8
8
|
import { fixApplyPatchToolCallsWithNative } from "../../../../../../router/virtual-router/engine-selection/native-compat-action-semantics.js";
|
|
9
|
+
import { applyAnthropicToolAliasSemantics, normalizeAnthropicToolAliasMap } from "../../../../process/chat-process-anthropic-alias.js";
|
|
10
|
+
import { buildAnthropicToolAliasMapWithNative } from "../../../../../../router/virtual-router/engine-selection/native-chat-process-governance-semantics.js";
|
|
9
11
|
import { isHubStageTimingDetailEnabled, logHubStageTiming, } from "../../../hub-stage-timing.js";
|
|
10
12
|
function buildSlimResponsesContextForSemantics(context) {
|
|
11
13
|
if (!context || typeof context !== "object" || Array.isArray(context)) {
|
|
@@ -133,6 +135,41 @@ export async function runReqInboundStage2SemanticMap(options) {
|
|
|
133
135
|
requestId: options.adapterContext.requestId,
|
|
134
136
|
});
|
|
135
137
|
logHubStageTiming(requestId, "req_inbound.stage2_to_standardized", "completed", { elapsedMs: Date.now() - stdStart });
|
|
138
|
+
applyAnthropicToolAliasSemantics(standardizedRequest, options.adapterContext.entryEndpoint);
|
|
139
|
+
if (typeof options.adapterContext.entryEndpoint === "string" &&
|
|
140
|
+
options.adapterContext.entryEndpoint.trim().toLowerCase().includes("/v1/messages")) {
|
|
141
|
+
const semantics = isJsonObject(standardizedRequest.semantics)
|
|
142
|
+
? standardizedRequest.semantics
|
|
143
|
+
: {};
|
|
144
|
+
const toolsNode = isJsonObject(semantics.tools)
|
|
145
|
+
? semantics.tools
|
|
146
|
+
: {};
|
|
147
|
+
const normalizedExistingAliasMap = normalizeAnthropicToolAliasMap(isJsonObject(toolsNode.toolNameAliasMap)
|
|
148
|
+
? toolsNode.toolNameAliasMap
|
|
149
|
+
: undefined);
|
|
150
|
+
if (normalizedExistingAliasMap) {
|
|
151
|
+
toolsNode.toolNameAliasMap = normalizedExistingAliasMap;
|
|
152
|
+
standardizedRequest.semantics = {
|
|
153
|
+
...semantics,
|
|
154
|
+
tools: toolsNode,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
const hasAliasMap = isJsonObject(toolsNode.toolNameAliasMap) ||
|
|
158
|
+
isJsonObject(toolsNode.toolAliasMap);
|
|
159
|
+
const rawTools = Array.isArray(options.formatEnvelope.payload?.tools)
|
|
160
|
+
? options.formatEnvelope.payload.tools
|
|
161
|
+
: undefined;
|
|
162
|
+
if (!hasAliasMap && rawTools && rawTools.length > 0) {
|
|
163
|
+
const aliasMap = normalizeAnthropicToolAliasMap(buildAnthropicToolAliasMapWithNative(rawTools));
|
|
164
|
+
if (aliasMap && Object.keys(aliasMap).length > 0) {
|
|
165
|
+
toolsNode.toolNameAliasMap = aliasMap;
|
|
166
|
+
standardizedRequest.semantics = {
|
|
167
|
+
...semantics,
|
|
168
|
+
tools: toolsNode,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
136
173
|
// Ensure responses semantics (context) survive into standardized request for VirtualRouter parsing.
|
|
137
174
|
if (chatEnvelope.semantics && typeof chatEnvelope.semantics === "object") {
|
|
138
175
|
const envelopeSemantics = chatEnvelope.semantics;
|
|
@@ -2,12 +2,24 @@ import { isJsonObject } from '../../../../types/json.js';
|
|
|
2
2
|
import { applyReqInboundSemanticLiftWithNative, mapReqInboundResumeToolOutputsDetailedWithNative } from '../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.js';
|
|
3
3
|
export function liftReqInboundSemantics(options) {
|
|
4
4
|
const normalizedResponsesResume = options.responsesResume && isJsonObject(options.responsesResume) ? options.responsesResume : undefined;
|
|
5
|
+
const formatRecord = options.formatEnvelope;
|
|
6
|
+
const protocol = typeof options.formatEnvelope.protocol === 'string' && options.formatEnvelope.protocol.trim().length
|
|
7
|
+
? options.formatEnvelope.protocol
|
|
8
|
+
: typeof formatRecord.format === 'string' && String(formatRecord.format).trim().length
|
|
9
|
+
? String(formatRecord.format)
|
|
10
|
+
: options.adapterContext.providerProtocol;
|
|
5
11
|
const lifted = applyReqInboundSemanticLiftWithNative({
|
|
6
12
|
chatEnvelope: options.chatEnvelope,
|
|
7
13
|
payload: options.formatEnvelope.payload,
|
|
8
|
-
protocol
|
|
14
|
+
protocol,
|
|
9
15
|
entryEndpoint: options.adapterContext.entryEndpoint,
|
|
10
|
-
responsesResume: normalizedResponsesResume
|
|
16
|
+
responsesResume: normalizedResponsesResume,
|
|
17
|
+
sessionId: typeof options.adapterContext.sessionId === 'string'
|
|
18
|
+
? String(options.adapterContext.sessionId)
|
|
19
|
+
: undefined,
|
|
20
|
+
conversationId: typeof options.adapterContext.conversationId === 'string'
|
|
21
|
+
? String(options.adapterContext.conversationId)
|
|
22
|
+
: undefined
|
|
11
23
|
});
|
|
12
24
|
replaceEnvelope(options.chatEnvelope, lifted);
|
|
13
25
|
}
|
|
@@ -5,4 +5,7 @@ export interface ResponsesContextCaptureOptions {
|
|
|
5
5
|
rawRequest: JsonObject;
|
|
6
6
|
adapterContext: AdapterContext;
|
|
7
7
|
}
|
|
8
|
+
export declare function persistResponsesConversationRequestContext(options: ResponsesContextCaptureOptions & {
|
|
9
|
+
context: ResponsesRequestContext;
|
|
10
|
+
}): void;
|
|
8
11
|
export declare function captureResponsesContextSnapshot(options: ResponsesContextCaptureOptions): ResponsesRequestContext;
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import { captureResponsesRequestContext } from '../../../../../shared/responses-conversation-store.js';
|
|
2
2
|
import { captureReqInboundResponsesContextSnapshotWithNative } from '../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.js';
|
|
3
|
+
function readNormalizedToken(value) {
|
|
4
|
+
if (typeof value !== 'string') {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const trimmed = value.trim();
|
|
8
|
+
return trimmed || undefined;
|
|
9
|
+
}
|
|
10
|
+
export function persistResponsesConversationRequestContext(options) {
|
|
11
|
+
const requestId = readNormalizedToken(options.adapterContext.requestId);
|
|
12
|
+
if (!requestId) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
// captureResponsesRequestContext already best-effort wraps store failures.
|
|
16
|
+
captureResponsesRequestContext({
|
|
17
|
+
requestId,
|
|
18
|
+
payload: options.rawRequest,
|
|
19
|
+
context: options.context,
|
|
20
|
+
sessionId: readNormalizedToken(options.adapterContext.sessionId),
|
|
21
|
+
conversationId: readNormalizedToken(options.adapterContext.conversationId)
|
|
22
|
+
});
|
|
23
|
+
}
|
|
3
24
|
export function captureResponsesContextSnapshot(options) {
|
|
4
25
|
const context = captureReqInboundResponsesContextSnapshotWithNative({
|
|
5
26
|
rawRequest: options.rawRequest,
|
|
@@ -13,16 +34,6 @@ export function captureResponsesContextSnapshot(options) {
|
|
|
13
34
|
// - the tool loop is a client-protocol behavior (/v1/responses), independent of providerProtocol;
|
|
14
35
|
// - providers must remain transport-only;
|
|
15
36
|
// - the host may later enhance requestId with providerKey/model for logging, which is handled via rebind.
|
|
16
|
-
|
|
17
|
-
? options.adapterContext.requestId
|
|
18
|
-
: undefined;
|
|
19
|
-
if (requestId) {
|
|
20
|
-
// captureResponsesRequestContext already best-effort wraps store failures.
|
|
21
|
-
captureResponsesRequestContext({
|
|
22
|
-
requestId,
|
|
23
|
-
payload: options.rawRequest,
|
|
24
|
-
context: context
|
|
25
|
-
});
|
|
26
|
-
}
|
|
37
|
+
persistResponsesConversationRequestContext({ ...options, context });
|
|
27
38
|
return context;
|
|
28
39
|
}
|
|
@@ -1,17 +1,74 @@
|
|
|
1
1
|
import { resolveAliasMapFromRespSemanticsWithNative, resolveClientToolsRawFromRespSemanticsWithNative, normalizeAliasMapWithNative, resolveClientToolsRawWithNative } from '../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics.js';
|
|
2
|
+
import { buildAnthropicToolAliasMapWithNative } from '../../../../../../router/virtual-router/engine-selection/native-chat-process-governance-semantics.js';
|
|
2
3
|
// Three-stage contract:
|
|
3
4
|
// inbound -> chat_process -> outbound
|
|
4
5
|
// This module is the outbound-side bridge that consumes chat_process semantics
|
|
5
6
|
// and remaps client-facing tool semantics without mutating chat_process internals.
|
|
6
7
|
export function resolveAliasMapFromSemantics(semantics) {
|
|
7
|
-
|
|
8
|
+
const nativeResolved = resolveAliasMapFromRespSemanticsWithNative(semantics);
|
|
9
|
+
if (nativeResolved && Object.keys(nativeResolved).length > 0) {
|
|
10
|
+
return finalizeAliasMap(nativeResolved);
|
|
11
|
+
}
|
|
12
|
+
const toolsNode = asJsonRecord(semantics?.tools);
|
|
13
|
+
const anthropicNode = asJsonRecord(semantics?.anthropic);
|
|
14
|
+
const directCandidates = [
|
|
15
|
+
toolsNode?.toolNameAliasMap,
|
|
16
|
+
toolsNode?.toolAliasMap,
|
|
17
|
+
anthropicNode?.toolNameAliasMap,
|
|
18
|
+
anthropicNode?.toolAliasMap
|
|
19
|
+
];
|
|
20
|
+
for (const candidate of directCandidates) {
|
|
21
|
+
const normalized = normalizeAliasMap(candidate);
|
|
22
|
+
if (normalized && Object.keys(normalized).length > 0) {
|
|
23
|
+
return finalizeAliasMap(normalized);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const rawCandidates = [
|
|
27
|
+
anthropicNode?.clientToolsRaw,
|
|
28
|
+
toolsNode?.clientToolsRaw,
|
|
29
|
+
resolveClientToolsRawFromSemantics(semantics)
|
|
30
|
+
];
|
|
31
|
+
for (const candidate of rawCandidates) {
|
|
32
|
+
const built = buildAnthropicToolAliasMapWithNative(candidate);
|
|
33
|
+
const normalized = normalizeAliasMap(built);
|
|
34
|
+
if (normalized && Object.keys(normalized).length > 0) {
|
|
35
|
+
return finalizeAliasMap(normalized);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
8
39
|
}
|
|
9
40
|
export function normalizeAliasMap(candidate) {
|
|
10
41
|
return normalizeAliasMapWithNative(candidate);
|
|
11
42
|
}
|
|
12
43
|
export function resolveClientToolsRawFromSemantics(semantics) {
|
|
13
|
-
|
|
44
|
+
const nativeResolved = resolveClientToolsRawFromRespSemanticsWithNative(semantics);
|
|
45
|
+
if (nativeResolved && nativeResolved.length > 0) {
|
|
46
|
+
return nativeResolved;
|
|
47
|
+
}
|
|
48
|
+
const toolsNode = asJsonRecord(semantics?.tools);
|
|
49
|
+
const anthropicNode = asJsonRecord(semantics?.anthropic);
|
|
50
|
+
return (resolveClientToolsRaw(toolsNode?.clientToolsRaw) ??
|
|
51
|
+
resolveClientToolsRaw(anthropicNode?.clientToolsRaw));
|
|
14
52
|
}
|
|
15
53
|
export function resolveClientToolsRaw(candidate) {
|
|
16
54
|
return resolveClientToolsRawWithNative(candidate);
|
|
17
55
|
}
|
|
56
|
+
function asJsonRecord(value) {
|
|
57
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
58
|
+
? value
|
|
59
|
+
: undefined;
|
|
60
|
+
}
|
|
61
|
+
function finalizeAliasMap(aliasMap) {
|
|
62
|
+
const next = { ...aliasMap };
|
|
63
|
+
const shellAlias = next.shell_command ??
|
|
64
|
+
next.exec_command ??
|
|
65
|
+
next.shell ??
|
|
66
|
+
next.bash;
|
|
67
|
+
if (typeof shellAlias === 'string' && shellAlias.trim().length > 0) {
|
|
68
|
+
next.shell_command = next.shell_command ?? shellAlias;
|
|
69
|
+
next.exec_command = next.exec_command ?? shellAlias;
|
|
70
|
+
next.shell = next.shell ?? shellAlias;
|
|
71
|
+
next.bash = next.bash ?? shellAlias;
|
|
72
|
+
}
|
|
73
|
+
return next;
|
|
74
|
+
}
|
|
@@ -5,5 +5,6 @@ export interface ClientRemapProtocolSwitchOptions {
|
|
|
5
5
|
clientProtocol: ClientProtocol;
|
|
6
6
|
requestId: string;
|
|
7
7
|
requestSemantics?: JsonObject;
|
|
8
|
+
responseSemantics?: JsonObject;
|
|
8
9
|
}
|
|
9
10
|
export declare function buildClientPayloadForProtocol(options: ClientRemapProtocolSwitchOptions): JsonObject;
|
|
@@ -3,6 +3,7 @@ import { normalizeArgsBySchema } from '../../../../../args-mapping.js';
|
|
|
3
3
|
import { normalizeResponsesToolCallIds } from '../../../../../shared/responses-tool-utils.js';
|
|
4
4
|
import { isShellToolName } from '../../../../../../tools/tool-description-utils.js';
|
|
5
5
|
import { applyClientPassthroughPatchWithNative, buildResponsesPayloadFromChatWithNative } from '../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-resp-semantics.js';
|
|
6
|
+
import { normalizeOpenaiChatReasoningOutboundWithNative } from '../../../../../../router/virtual-router/engine-selection/native-hub-pipeline-edge-stage-semantics.js';
|
|
6
7
|
import { resolveAliasMapFromSemantics, resolveClientToolsRawFromSemantics } from './chat-process-semantics-bridge.js';
|
|
7
8
|
function asRecord(value) {
|
|
8
9
|
return value && typeof value === 'object' && !Array.isArray(value)
|
|
@@ -283,7 +284,7 @@ export function buildClientPayloadForProtocol(options) {
|
|
|
283
284
|
let clientPayload;
|
|
284
285
|
const toolsRaw = resolveClientToolsRawFromSemantics(options.requestSemantics);
|
|
285
286
|
if (options.clientProtocol === 'openai-chat') {
|
|
286
|
-
clientPayload = options.payload;
|
|
287
|
+
clientPayload = normalizeOpenaiChatReasoningOutboundWithNative(options.payload);
|
|
287
288
|
}
|
|
288
289
|
else if (options.clientProtocol === 'anthropic-messages') {
|
|
289
290
|
clientPayload = buildAnthropicResponseFromChat(options.payload, {
|
|
@@ -293,6 +294,7 @@ export function buildClientPayloadForProtocol(options) {
|
|
|
293
294
|
else {
|
|
294
295
|
clientPayload = buildResponsesPayloadFromChatWithNative(options.payload, {
|
|
295
296
|
requestId: options.requestId,
|
|
297
|
+
responseSemantics: options.responseSemantics,
|
|
296
298
|
...(toolsRaw ? { toolsRaw } : {})
|
|
297
299
|
});
|
|
298
300
|
}
|
|
@@ -8,6 +8,7 @@ export interface RespOutboundStage1ClientRemapOptions {
|
|
|
8
8
|
requestId: string;
|
|
9
9
|
adapterContext?: AdapterContext;
|
|
10
10
|
requestSemantics?: JsonObject;
|
|
11
|
+
responseSemantics?: JsonObject;
|
|
11
12
|
stageRecorder?: StageRecorder;
|
|
12
13
|
}
|
|
13
14
|
export declare function runRespOutboundStage1ClientRemap(options: RespOutboundStage1ClientRemapOptions): JsonObject;
|
|
@@ -18,7 +18,8 @@ export function runRespOutboundStage1ClientRemap(options) {
|
|
|
18
18
|
payload: options.payload,
|
|
19
19
|
clientProtocol,
|
|
20
20
|
requestId: options.requestId,
|
|
21
|
-
requestSemantics: options.requestSemantics
|
|
21
|
+
requestSemantics: options.requestSemantics,
|
|
22
|
+
responseSemantics: options.responseSemantics
|
|
22
23
|
});
|
|
23
24
|
logHubStageTiming(options.requestId, 'resp_outbound.stage1_build_client_payload', 'completed', {
|
|
24
25
|
elapsedMs: Date.now() - buildStart,
|
|
@@ -7,6 +7,8 @@ export interface RespProcessStage1ToolGovernanceOptions {
|
|
|
7
7
|
entryEndpoint: string;
|
|
8
8
|
requestId: string;
|
|
9
9
|
clientProtocol: ClientProtocol;
|
|
10
|
+
requestSemantics?: JsonObject;
|
|
11
|
+
adapterContext?: Record<string, unknown>;
|
|
10
12
|
stageRecorder?: StageRecorder;
|
|
11
13
|
}
|
|
12
14
|
export interface RespProcessStage1ToolGovernanceResult {
|
|
@@ -2,11 +2,63 @@ import { runChatResponseToolFilters } from '../../../../../shared/tool-filter-pi
|
|
|
2
2
|
import { recordStage } from '../../../stages/utils.js';
|
|
3
3
|
import { isHubStageTimingDetailEnabled, logHubStageTiming } from '../../../hub-stage-timing.js';
|
|
4
4
|
import { applyRespProcessToolGovernanceWithNative, prepareRespProcessToolGovernancePayloadWithNative } from '../../../../../../router/virtual-router/engine-selection/native-chat-process-governance-semantics.js';
|
|
5
|
+
function asRecord(value) {
|
|
6
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
7
|
+
? value
|
|
8
|
+
: undefined;
|
|
9
|
+
}
|
|
10
|
+
function collectToolNamesFromCandidate(candidate, out) {
|
|
11
|
+
if (!Array.isArray(candidate)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
for (const tool of candidate) {
|
|
15
|
+
if (typeof tool === 'string') {
|
|
16
|
+
const name = tool.trim();
|
|
17
|
+
if (name) {
|
|
18
|
+
out.add(name);
|
|
19
|
+
}
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const row = asRecord(tool);
|
|
23
|
+
const functionBag = asRecord(row?.function);
|
|
24
|
+
const name = (typeof functionBag?.name === 'string' ? functionBag.name.trim() : '')
|
|
25
|
+
|| (typeof row?.name === 'string' ? row.name.trim() : '');
|
|
26
|
+
if (name) {
|
|
27
|
+
out.add(name);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function resolveRequestedToolNames(options) {
|
|
32
|
+
const names = new Set();
|
|
33
|
+
const requestSemantics = asRecord(options.requestSemantics);
|
|
34
|
+
const semanticsTools = asRecord(requestSemantics?.tools);
|
|
35
|
+
collectToolNamesFromCandidate(requestSemantics?.tools, names);
|
|
36
|
+
collectToolNamesFromCandidate(semanticsTools?.clientToolsRaw, names);
|
|
37
|
+
collectToolNamesFromCandidate(semanticsTools?.baselineTools, names);
|
|
38
|
+
const capturedChatRequest = asRecord(options.adapterContext?.capturedChatRequest);
|
|
39
|
+
collectToolNamesFromCandidate(capturedChatRequest?.tools, names);
|
|
40
|
+
return Array.from(names);
|
|
41
|
+
}
|
|
42
|
+
function attachRequestedToolNames(payload, requestedToolNames) {
|
|
43
|
+
if (!requestedToolNames.length) {
|
|
44
|
+
return payload;
|
|
45
|
+
}
|
|
46
|
+
const governance = asRecord(payload.__rcc_tool_governance) ?? {};
|
|
47
|
+
return {
|
|
48
|
+
...payload,
|
|
49
|
+
__rcc_tool_governance: {
|
|
50
|
+
...governance,
|
|
51
|
+
requestedToolNames
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
5
55
|
export async function runRespProcessStage1ToolGovernance(options) {
|
|
6
56
|
const forceDetailLog = isHubStageTimingDetailEnabled();
|
|
57
|
+
const requestedToolNames = resolveRequestedToolNames(options);
|
|
58
|
+
const governancePayload = attachRequestedToolNames(options.payload, requestedToolNames);
|
|
7
59
|
logHubStageTiming(options.requestId, 'resp_process.stage1_prepare_native', 'start');
|
|
8
60
|
const prepareStart = Date.now();
|
|
9
|
-
const preparedNative = prepareRespProcessToolGovernancePayloadWithNative(
|
|
61
|
+
const preparedNative = prepareRespProcessToolGovernancePayloadWithNative(governancePayload);
|
|
10
62
|
const preparedPayload = preparedNative.preparedPayload;
|
|
11
63
|
logHubStageTiming(options.requestId, 'resp_process.stage1_prepare_native', 'completed', {
|
|
12
64
|
elapsedMs: Date.now() - prepareStart,
|
|
@@ -15,8 +15,11 @@ export async function runRespProcessStage2Finalize(options) {
|
|
|
15
15
|
requestId: options.requestId
|
|
16
16
|
}));
|
|
17
17
|
// Strip executed servertool calls before returning to client (single source of truth).
|
|
18
|
+
// This must also run for internal servertool followups: reasoning.stop/review/clock
|
|
19
|
+
// handlers append tool_outputs first, and skipping this strip leaks consumed internal
|
|
20
|
+
// tool_calls into client required_action/output surfaces.
|
|
18
21
|
const stripSource = options.originalPayload ?? options.payload;
|
|
19
|
-
if (
|
|
22
|
+
if (stripSource && typeof stripSource === 'object') {
|
|
20
23
|
finalized = filterOutExecutedServerToolCalls(finalized, stripSource);
|
|
21
24
|
}
|
|
22
25
|
logHubStageTiming(options.requestId, 'resp_process.stage2_native_finalize', 'completed', {
|
|
@@ -29,6 +29,7 @@ export interface RespProcessStage3ServerToolOrchestrationOptions {
|
|
|
29
29
|
requestId: string;
|
|
30
30
|
entryEndpoint: string;
|
|
31
31
|
providerProtocol: ProviderProtocol;
|
|
32
|
+
allowFollowup?: boolean;
|
|
32
33
|
stageRecorder?: StageRecorder;
|
|
33
34
|
providerInvoker?: ProviderInvoker;
|
|
34
35
|
reenterPipeline?: ReenterPipeline;
|
|
@@ -4,6 +4,22 @@ import { recordStage } from '../../../stages/utils.js';
|
|
|
4
4
|
import { isHubStageTimingDetailEnabled, logHubStageTiming } from '../../../hub-stage-timing.js';
|
|
5
5
|
export async function runRespProcessStage3ServerToolOrchestration(options) {
|
|
6
6
|
const forceDetailLog = isHubStageTimingDetailEnabled();
|
|
7
|
+
const runtimeMeta = options.adapterContext &&
|
|
8
|
+
typeof options.adapterContext === 'object' &&
|
|
9
|
+
!Array.isArray(options.adapterContext)
|
|
10
|
+
? options.adapterContext.__rt
|
|
11
|
+
: undefined;
|
|
12
|
+
if (runtimeMeta?.serverToolFollowup === true && options.allowFollowup !== true) {
|
|
13
|
+
recordStage(options.stageRecorder, 'chat_process.resp.stage5.servertool_orchestration', {
|
|
14
|
+
executed: false,
|
|
15
|
+
skipReason: 'followup_bypass',
|
|
16
|
+
inputShape: detectProviderResponseShapeWithNative(options.payload)
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
payload: options.payload,
|
|
20
|
+
executed: false
|
|
21
|
+
};
|
|
22
|
+
}
|
|
7
23
|
const hasServerToolSupport = Boolean(options.providerInvoker) || Boolean(options.reenterPipeline) || Boolean(options.clientInjectDispatch);
|
|
8
24
|
const inputShape = detectProviderResponseShapeWithNative(options.payload);
|
|
9
25
|
if (!hasServerToolSupport) {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { resolveHubProtocolSpec } from './protocol-spec.js';
|
|
2
2
|
import { normalizeProviderProtocolTokenWithNative } from '../../../router/virtual-router/engine-selection/native-hub-pipeline-req-inbound-semantics.js';
|
|
3
|
+
import { loadCompatProfileRegistry, getPolicyOverrides } from '../../compat/profile-registry/registry.js';
|
|
4
|
+
import { shouldSkipPolicy } from '../../compat/profile-registry/policy-overrides.js';
|
|
5
|
+
// Load compat registry at module level for config-driven policy overrides
|
|
6
|
+
const policyCompatRegistry = loadCompatProfileRegistry();
|
|
3
7
|
let hubPolicyRuntime = undefined;
|
|
4
8
|
export function setHubPolicyRuntimePolicy(policy) {
|
|
5
9
|
hubPolicyRuntime = policy;
|
|
@@ -212,8 +216,11 @@ export function recordHubPolicyObservation(options) {
|
|
|
212
216
|
return;
|
|
213
217
|
}
|
|
214
218
|
const compatibilityProfile = typeof options.compatibilityProfile === 'string' ? options.compatibilityProfile.trim().toLowerCase() : '';
|
|
215
|
-
if (compatibilityProfile
|
|
216
|
-
|
|
219
|
+
if (compatibilityProfile) {
|
|
220
|
+
const overrides = getPolicyOverrides(policyCompatRegistry, compatibilityProfile);
|
|
221
|
+
if (shouldSkipPolicy(overrides, 'observe')) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
217
224
|
}
|
|
218
225
|
if (!shouldSample(effectivePolicy?.sampleRate)) {
|
|
219
226
|
return;
|
|
@@ -247,8 +254,11 @@ export function applyHubProviderOutboundPolicy(options) {
|
|
|
247
254
|
}
|
|
248
255
|
const normalizedProviderProtocol = normalizeHubProviderProtocol(options.providerProtocol);
|
|
249
256
|
const compatibilityProfile = typeof options.compatibilityProfile === 'string' ? options.compatibilityProfile.trim().toLowerCase() : '';
|
|
250
|
-
if (compatibilityProfile
|
|
251
|
-
|
|
257
|
+
if (compatibilityProfile) {
|
|
258
|
+
const overrides = getPolicyOverrides(policyCompatRegistry, compatibilityProfile);
|
|
259
|
+
if (shouldSkipPolicy(overrides, 'enforce')) {
|
|
260
|
+
return options.payload;
|
|
261
|
+
}
|
|
252
262
|
}
|
|
253
263
|
const result = applyProviderOutboundPolicy(normalizedProviderProtocol, options.payload);
|
|
254
264
|
if (!result.changed) {
|
package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-anthropic-alias.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { StandardizedRequest } from '../types/standardized.js';
|
|
2
|
+
export declare function normalizeAnthropicToolAliasMap(aliasMap?: Record<string, unknown>): Record<string, string> | undefined;
|
|
2
3
|
export declare function applyAnthropicToolAliasSemantics(request: StandardizedRequest, entryEndpoint: string): StandardizedRequest;
|
package/node_modules/@jsonstudio/llms/dist/conversion/hub/process/chat-process-anthropic-alias.js
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import { isJsonObject } from '../types/json.js';
|
|
2
2
|
import { buildAnthropicToolAliasMapWithNative } from '../../../router/virtual-router/engine-selection/native-chat-process-governance-semantics.js';
|
|
3
|
+
export function normalizeAnthropicToolAliasMap(aliasMap) {
|
|
4
|
+
if (!aliasMap || typeof aliasMap !== 'object') {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const next = {};
|
|
8
|
+
for (const [key, value] of Object.entries(aliasMap)) {
|
|
9
|
+
if (typeof key !== 'string' || typeof value !== 'string') {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
const normalizedKey = key.trim().toLowerCase();
|
|
13
|
+
const normalizedValue = value.trim();
|
|
14
|
+
if (!normalizedKey || !normalizedValue) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
next[normalizedKey] = normalizedValue;
|
|
18
|
+
}
|
|
19
|
+
const shellAlias = next.shell_command ??
|
|
20
|
+
next.bash ??
|
|
21
|
+
next.shell ??
|
|
22
|
+
next.exec_command;
|
|
23
|
+
if (shellAlias) {
|
|
24
|
+
next.shell_command = shellAlias;
|
|
25
|
+
next.bash = shellAlias;
|
|
26
|
+
next.shell = shellAlias;
|
|
27
|
+
next.exec_command = shellAlias;
|
|
28
|
+
}
|
|
29
|
+
return Object.keys(next).length > 0 ? next : undefined;
|
|
30
|
+
}
|
|
3
31
|
export function applyAnthropicToolAliasSemantics(request, entryEndpoint) {
|
|
4
32
|
try {
|
|
5
33
|
const endpoint = typeof entryEndpoint === 'string' ? entryEndpoint.trim().toLowerCase() : '';
|
|
@@ -18,7 +46,7 @@ export function applyAnthropicToolAliasSemantics(request, entryEndpoint) {
|
|
|
18
46
|
const sourceTools = Array.isArray(semanticsTools.clientToolsRaw) && semanticsTools.clientToolsRaw.length
|
|
19
47
|
? semanticsTools.clientToolsRaw
|
|
20
48
|
: request.tools;
|
|
21
|
-
const aliasMap = buildAnthropicToolAliasMapWithNative(sourceTools);
|
|
49
|
+
const aliasMap = normalizeAnthropicToolAliasMap(buildAnthropicToolAliasMapWithNative(sourceTools));
|
|
22
50
|
if (aliasMap) {
|
|
23
51
|
semanticsTools.toolNameAliasMap = aliasMap;
|
|
24
52
|
}
|