@jsonstudio/rcc 0.89.1205 โ 0.89.1457
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 +53 -1412
- package/configsamples/config.json +426 -0
- package/configsamples/config.reference.json +58 -0
- package/configsamples/provider/crs/config.v1.json +46 -0
- package/configsamples/provider/glm/config.v1.json +81 -0
- package/configsamples/provider/glm-anthropic/config.v1.json +45 -0
- package/configsamples/provider/iflow/config.v1.json +74 -0
- package/configsamples/provider/kimi/config.v1.json +41 -0
- package/configsamples/provider/lmstudio/config.v1.json +101 -0
- package/configsamples/provider/mimo/config.v1.json +35 -0
- package/configsamples/provider/modelscope/config.v1.json +96 -0
- package/configsamples/provider/qwen/config.v1.json +38 -0
- package/configsamples/provider/tab/config.v1.json +50 -0
- package/configsamples/provider/tabglm/config.v1.json +49 -0
- package/dist/build-info.js +2 -2
- package/dist/cli/commands/code.js +12 -6
- package/dist/cli/commands/code.js.map +1 -1
- package/dist/cli/commands/config.d.ts +2 -1
- package/dist/cli/commands/config.js +77 -103
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/examples.js +6 -6
- package/dist/cli/commands/examples.js.map +1 -1
- package/dist/cli/commands/init.d.ts +28 -0
- package/dist/cli/commands/init.js +94 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/port.js +10 -2
- package/dist/cli/commands/port.js.map +1 -1
- package/dist/cli/commands/restart.js +5 -2
- package/dist/cli/commands/restart.js.map +1 -1
- package/dist/cli/commands/start.js +25 -22
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.js +1 -0
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/stop.js +1 -0
- package/dist/cli/commands/stop.js.map +1 -1
- package/dist/cli/config/bundled-docs.d.ts +20 -0
- package/dist/cli/config/bundled-docs.js +91 -0
- package/dist/cli/config/bundled-docs.js.map +1 -0
- package/dist/cli/config/init-config.d.ts +37 -0
- package/dist/cli/config/init-config.js +212 -0
- package/dist/cli/config/init-config.js.map +1 -0
- package/dist/cli/config/init-provider-catalog.d.ts +8 -0
- package/dist/cli/config/init-provider-catalog.js +187 -0
- package/dist/cli/config/init-provider-catalog.js.map +1 -0
- package/dist/cli/register/init-command.d.ts +3 -0
- package/dist/cli/register/init-command.js +5 -0
- package/dist/cli/register/init-command.js.map +1 -0
- package/dist/cli.js +28 -3
- package/dist/cli.js.map +1 -1
- package/dist/client/gemini/gemini-protocol-client.js +2 -1
- package/dist/client/gemini/gemini-protocol-client.js.map +1 -1
- package/dist/client/gemini-cli/gemini-cli-protocol-client.js +40 -16
- package/dist/client/gemini-cli/gemini-cli-protocol-client.js.map +1 -1
- package/dist/client/openai/chat-protocol-client.js +2 -1
- package/dist/client/openai/chat-protocol-client.js.map +1 -1
- package/dist/client/responses/responses-protocol-client.js +2 -1
- package/dist/client/responses/responses-protocol-client.js.map +1 -1
- package/dist/config/risk-control-config.d.ts +94 -0
- package/dist/config/risk-control-config.js +196 -0
- package/dist/config/risk-control-config.js.map +1 -0
- package/dist/constants/index.d.ts +6 -0
- package/dist/constants/index.js +13 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/docs/daemon-admin-ui.html +2113 -190
- package/dist/error-handling/quiet-error-handling-center.js +46 -8
- package/dist/error-handling/quiet-error-handling-center.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/manager/modules/health/index.d.ts +1 -1
- package/dist/manager/modules/quota/antigravity-quota-manager.d.ts +70 -0
- package/dist/manager/modules/quota/antigravity-quota-manager.js +442 -0
- package/dist/manager/modules/quota/antigravity-quota-manager.js.map +1 -0
- package/dist/manager/modules/quota/index.d.ts +3 -127
- package/dist/manager/modules/quota/index.js +2 -1093
- package/dist/manager/modules/quota/index.js.map +1 -1
- package/dist/manager/modules/quota/provider-key-normalization.d.ts +3 -0
- package/dist/manager/modules/quota/provider-key-normalization.js +155 -0
- package/dist/manager/modules/quota/provider-key-normalization.js.map +1 -0
- package/dist/manager/modules/quota/provider-quota-daemon.cooldown.d.ts +9 -0
- package/dist/manager/modules/quota/provider-quota-daemon.cooldown.js +115 -0
- package/dist/manager/modules/quota/provider-quota-daemon.cooldown.js.map +1 -0
- package/dist/manager/modules/quota/provider-quota-daemon.d.ts +77 -0
- package/dist/manager/modules/quota/provider-quota-daemon.events.d.ts +12 -0
- package/dist/manager/modules/quota/provider-quota-daemon.events.js +239 -0
- package/dist/manager/modules/quota/provider-quota-daemon.events.js.map +1 -0
- package/dist/manager/modules/quota/provider-quota-daemon.js +404 -0
- package/dist/manager/modules/quota/provider-quota-daemon.js.map +1 -0
- package/dist/manager/modules/quota/provider-quota-daemon.model-backoff.d.ts +11 -0
- package/dist/manager/modules/quota/provider-quota-daemon.model-backoff.js +192 -0
- package/dist/manager/modules/quota/provider-quota-daemon.model-backoff.js.map +1 -0
- package/dist/manager/modules/quota/provider-quota-daemon.snapshot.d.ts +8 -0
- package/dist/manager/modules/quota/provider-quota-daemon.snapshot.js +96 -0
- package/dist/manager/modules/quota/provider-quota-daemon.snapshot.js.map +1 -0
- package/dist/manager/modules/quota/provider-quota-daemon.view.d.ts +19 -0
- package/dist/manager/modules/quota/provider-quota-daemon.view.js +37 -0
- package/dist/manager/modules/quota/provider-quota-daemon.view.js.map +1 -0
- package/dist/manager/modules/routing/index.d.ts +1 -0
- package/dist/manager/modules/routing/index.js +11 -25
- package/dist/manager/modules/routing/index.js.map +1 -1
- package/dist/manager/quota/provider-quota-center.d.ts +2 -0
- package/dist/manager/quota/provider-quota-center.js +80 -82
- package/dist/manager/quota/provider-quota-center.js.map +1 -1
- package/dist/modules/llmswitch/bridge.d.ts +16 -18
- package/dist/modules/llmswitch/bridge.js +293 -94
- package/dist/modules/llmswitch/bridge.js.map +1 -1
- package/dist/modules/llmswitch/core-loader.d.ts +4 -2
- package/dist/modules/llmswitch/core-loader.js +32 -20
- package/dist/modules/llmswitch/core-loader.js.map +1 -1
- package/dist/modules/pipeline/utils/colored-logger.js +3 -2
- package/dist/modules/pipeline/utils/colored-logger.js.map +1 -1
- package/dist/modules/pipeline/utils/debug-logger.js +1 -1
- package/dist/modules/pipeline/utils/debug-logger.js.map +1 -1
- package/dist/providers/auth/antigravity-userinfo-helper.d.ts +2 -1
- package/dist/providers/auth/antigravity-userinfo-helper.js +25 -4
- package/dist/providers/auth/antigravity-userinfo-helper.js.map +1 -1
- package/dist/providers/auth/iflow-cookie-auth.js +0 -2
- package/dist/providers/auth/iflow-cookie-auth.js.map +1 -1
- package/dist/providers/auth/oauth-lifecycle.js +2 -23
- package/dist/providers/auth/oauth-lifecycle.js.map +1 -1
- package/dist/providers/auth/tokenfile-auth.d.ts +2 -0
- package/dist/providers/auth/tokenfile-auth.js +33 -1
- package/dist/providers/auth/tokenfile-auth.js.map +1 -1
- package/dist/providers/core/config/camoufox-launcher.d.ts +5 -0
- package/dist/providers/core/config/camoufox-launcher.js +40 -4
- package/dist/providers/core/config/camoufox-launcher.js.map +1 -1
- package/dist/providers/core/config/service-profiles.js +7 -18
- package/dist/providers/core/config/service-profiles.js.map +1 -1
- package/dist/providers/core/runtime/antigravity-quota-client.js +6 -3
- package/dist/providers/core/runtime/antigravity-quota-client.js.map +1 -1
- package/dist/providers/core/runtime/base-provider.d.ts +2 -7
- package/dist/providers/core/runtime/base-provider.js +84 -165
- package/dist/providers/core/runtime/base-provider.js.map +1 -1
- package/dist/providers/core/runtime/gemini-cli-http-provider.d.ts +7 -0
- package/dist/providers/core/runtime/gemini-cli-http-provider.js +368 -97
- package/dist/providers/core/runtime/gemini-cli-http-provider.js.map +1 -1
- package/dist/providers/core/runtime/http-request-executor.d.ts +3 -0
- package/dist/providers/core/runtime/http-request-executor.js +110 -38
- package/dist/providers/core/runtime/http-request-executor.js.map +1 -1
- package/dist/providers/core/runtime/http-transport-provider.d.ts +17 -0
- package/dist/providers/core/runtime/http-transport-provider.js +165 -16
- package/dist/providers/core/runtime/http-transport-provider.js.map +1 -1
- package/dist/providers/core/runtime/provider-error-classifier.js +10 -0
- package/dist/providers/core/runtime/provider-error-classifier.js.map +1 -1
- package/dist/providers/core/runtime/provider-factory.js +7 -5
- package/dist/providers/core/runtime/provider-factory.js.map +1 -1
- package/dist/providers/core/runtime/provider-runtime-metadata.d.ts +6 -0
- package/dist/providers/core/runtime/provider-runtime-metadata.js.map +1 -1
- package/dist/providers/core/runtime/rate-limit-manager.d.ts +1 -12
- package/dist/providers/core/runtime/rate-limit-manager.js +4 -77
- package/dist/providers/core/runtime/rate-limit-manager.js.map +1 -1
- package/dist/providers/core/runtime/responses-provider.d.ts +1 -7
- package/dist/providers/core/runtime/responses-provider.js +12 -93
- package/dist/providers/core/runtime/responses-provider.js.map +1 -1
- package/dist/providers/core/strategies/oauth-auth-code-flow.js +12 -8
- package/dist/providers/core/strategies/oauth-auth-code-flow.js.map +1 -1
- package/dist/providers/core/utils/http-client.js +36 -46
- package/dist/providers/core/utils/http-client.js.map +1 -1
- package/dist/providers/core/utils/provider-error-logger.d.ts +1 -1
- package/dist/providers/core/utils/provider-error-reporter.d.ts +3 -1
- package/dist/providers/core/utils/provider-error-reporter.js +3 -0
- package/dist/providers/core/utils/provider-error-reporter.js.map +1 -1
- package/dist/providers/core/utils/snapshot-writer.js +1 -4
- package/dist/providers/core/utils/snapshot-writer.js.map +1 -1
- package/dist/providers/mock/mock-provider-runtime.js +57 -27
- package/dist/providers/mock/mock-provider-runtime.js.map +1 -1
- package/dist/scripts/camoufox/launch-auth.mjs +193 -58
- package/dist/server/handlers/handler-utils.js +8 -3
- package/dist/server/handlers/handler-utils.js.map +1 -1
- package/dist/server/handlers/responses-handler.js +1 -1
- package/dist/server/handlers/responses-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/auth-handler.d.ts +2 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-handler.js +103 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-handler.js.map +1 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-session.d.ts +5 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-session.js +77 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-session.js.map +1 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-store.d.ts +18 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-store.js +89 -0
- package/dist/server/runtime/http-server/daemon-admin/auth-store.js.map +1 -0
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler.js +1 -2
- package/dist/server/runtime/http-server/daemon-admin/credentials-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/providers-handler.js +226 -24
- 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 +47 -8
- package/dist/server/runtime/http-server/daemon-admin/quota-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/restart-handler.js +1 -1
- package/dist/server/runtime/http-server/daemon-admin/restart-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/stats-handler.js +1 -1
- package/dist/server/runtime/http-server/daemon-admin/stats-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin/status-handler.js +68 -4
- package/dist/server/runtime/http-server/daemon-admin/status-handler.js.map +1 -1
- package/dist/server/runtime/http-server/daemon-admin-routes.d.ts +3 -4
- package/dist/server/runtime/http-server/daemon-admin-routes.js +9 -14
- package/dist/server/runtime/http-server/daemon-admin-routes.js.map +1 -1
- package/dist/server/runtime/http-server/executor-metadata.js +1 -1
- package/dist/server/runtime/http-server/executor-metadata.js.map +1 -1
- package/dist/server/runtime/http-server/executor-response.js +0 -16
- package/dist/server/runtime/http-server/executor-response.js.map +1 -1
- package/dist/server/runtime/http-server/hub-shadow-compare.js +110 -34
- package/dist/server/runtime/http-server/hub-shadow-compare.js.map +1 -1
- package/dist/server/runtime/http-server/index.d.ts +5 -3
- package/dist/server/runtime/http-server/index.js +281 -136
- package/dist/server/runtime/http-server/index.js.map +1 -1
- package/dist/server/runtime/http-server/middleware.js +19 -1
- package/dist/server/runtime/http-server/middleware.js.map +1 -1
- package/dist/server/runtime/http-server/request-executor.js +59 -24
- package/dist/server/runtime/http-server/request-executor.js.map +1 -1
- package/dist/server/runtime/http-server/routes.js +12 -3
- package/dist/server/runtime/http-server/routes.js.map +1 -1
- package/dist/server/runtime/http-server/session-dir.d.ts +2 -0
- package/dist/server/runtime/http-server/session-dir.js +59 -0
- package/dist/server/runtime/http-server/session-dir.js.map +1 -0
- package/dist/server/runtime/http-server/types.d.ts +0 -4
- package/dist/server/utils/utf8-chunk-buffer.js +6 -3
- package/dist/server/utils/utf8-chunk-buffer.js.map +1 -1
- package/dist/server/utils/warmup-storm-tracker.js +1 -1
- package/dist/server/utils/warmup-storm-tracker.js.map +1 -1
- package/dist/server-factory.d.ts +6 -28
- package/dist/server-factory.js +8 -93
- package/dist/server-factory.js.map +1 -1
- package/dist/token-daemon/index.js +2 -2
- package/dist/token-daemon/index.js.map +1 -1
- package/dist/token-daemon/provider-registry.js +0 -1
- package/dist/token-daemon/provider-registry.js.map +1 -1
- package/dist/token-daemon/server-utils.js +8 -9
- package/dist/token-daemon/server-utils.js.map +1 -1
- package/dist/token-daemon/token-utils.js +1 -1
- package/dist/token-daemon/token-utils.js.map +1 -1
- package/dist/tools/semantic-replay.js +2 -2
- package/dist/tools/semantic-replay.js.map +1 -1
- package/dist/tools/stats-request-events.d.ts +1 -1
- package/dist/tools/stats-usage.js +6 -3
- package/dist/tools/stats-usage.js.map +1 -1
- package/dist/utils/llms-engine-shadow.d.ts +19 -0
- package/dist/utils/llms-engine-shadow.js +209 -0
- package/dist/utils/llms-engine-shadow.js.map +1 -0
- package/dist/utils/runtime-versions.js +2 -1
- package/dist/utils/runtime-versions.js.map +1 -1
- package/dist/utils/strip-internal-keys.d.ts +12 -0
- package/dist/utils/strip-internal-keys.js +28 -0
- package/dist/utils/strip-internal-keys.js.map +1 -0
- package/docs/ARCHITECTURE.md +402 -0
- package/docs/CHAT_PROCESS_PROTOCOL_AND_PIPELINE.md +221 -0
- package/docs/CODEX_AND_CLAUDE_CODE.md +69 -0
- package/docs/CONFIG_ARCHITECTURE.md +517 -0
- package/docs/ERROR_HANDLING_AUDIT.md +0 -0
- package/docs/GCLI2API_PARITY_GAPS.md +98 -0
- package/docs/INSTALLATION_AND_QUICKSTART.md +74 -0
- package/docs/INSTRUCTION_MARKUP.md +89 -0
- package/docs/MODULE_ENHANCEMENT_SYSTEM.md +666 -0
- package/docs/PORTS.md +36 -0
- package/docs/PROVIDERS_BUILTIN.md +111 -0
- package/docs/PROVIDER_TYPES.md +55 -0
- package/docs/SERVERTOOL_CLOCK_DESIGN.md +233 -0
- package/docs/USAGE_HANDLING_ANALYSIS.md +335 -0
- package/docs/USER_CONFIG_PARSER_CHANGES.md +175 -0
- package/docs/V3_INBOUND_OUTBOUND_DESIGN.md +86 -0
- package/docs/VIRTUAL_ROUTER_PRIORITY_AND_HEALTH.md +125 -0
- package/docs/anthropic-request-golden-samples.md +50 -0
- package/docs/antigravity-gemini-format-cleanup.md +102 -0
- package/docs/antigravity-routing-contract.md +31 -0
- package/docs/ccr-alignment-enhancetool.md +105 -0
- package/docs/chat-glm-500-analysis.md +79 -0
- package/docs/chat-request-golden-samples.md +42 -0
- package/docs/chat-semantic-expansion-plan.md +84 -0
- package/docs/cli-command-inventory.md +76 -0
- package/docs/codex-samples-replay.md +50 -0
- package/docs/daemon-admin-api-design.md +350 -0
- package/docs/daemon-admin-module-structure.md +169 -0
- package/docs/daemon-admin-ui.html +3394 -0
- package/docs/debug-system-design.md +734 -0
- package/docs/debugging/gemini-sse-root-cause.md +52 -0
- package/docs/debugging/sse_encoding_failure_analysis.md +53 -0
- package/docs/dry-run/README.md +721 -0
- package/docs/error-handling-v2.md +92 -0
- package/docs/exec-command-guard-policy.example.v1.json +42 -0
- package/docs/fixes/gemini-protocol-mapping.md +57 -0
- package/docs/fixes/oauth-portal-timing-fix.md +202 -0
- package/docs/fixes/web-search-hop3-fix.md +265 -0
- package/docs/glm-api-reference.md +390 -0
- package/docs/glm-chat-completions.md +1779 -0
- package/docs/glm-history-inline-images.md +44 -0
- package/docs/golden-ci-library.md +66 -0
- package/docs/lmstudio-dry-run-summary.md +203 -0
- package/docs/lmstudio-tool-calling.md +214 -0
- package/docs/mapping-tables/anthropic-to-openai.json +290 -0
- package/docs/mapping-tables/iflow-to-openai.json +215 -0
- package/docs/mapping-tables/openai-passthrough.json +190 -0
- package/docs/mapping-tables/openai-to-iflow.json +227 -0
- package/docs/monitoring/Design.md +61 -0
- package/docs/multi-token-auth-guide.md +66 -0
- package/docs/oauth-authentication-guide.md +168 -0
- package/docs/oauth-iflow-implementation.md +153 -0
- package/docs/pipeline-routing-report.md +209 -0
- package/docs/plans/manager-daemon/PLAN.md +86 -0
- package/docs/plans/provider-config-v2-plan.md +176 -0
- package/docs/plans/provider-runtime-manager-plan.md +209 -0
- package/docs/plans/transparent-429-failover.md +89 -0
- package/docs/plans/unified-hub-framework-v1.md +245 -0
- package/docs/provider-config-v2-ui-design.md +181 -0
- package/docs/provider-quota-design.md +129 -0
- package/docs/providers/gemini-provider.md +62 -0
- package/docs/providers/lmstudio-v2-migration-report.md +102 -0
- package/docs/providers/provider-composite-design.md +142 -0
- package/docs/providers/provider-composite-testing.md +98 -0
- package/docs/providers/provider-type-only-migration.md +111 -0
- package/docs/rccx-wasm-migration.md +74 -0
- package/docs/refactoring/architecture-comparison-diagram.md +140 -0
- package/docs/refactoring/compatibility-v2-architecture-design.md +738 -0
- package/docs/refactoring/workflow-compatibility-refactoring-design.md +361 -0
- package/docs/reports/routing-classification-report.json +24 -0
- package/docs/reports/routing-classification-report.md +18 -0
- package/docs/reports/thinking-keywords-report.json +19 -0
- package/docs/responses/README.md +156 -0
- package/docs/responses-generic-provider.md +86 -0
- package/docs/responses-passthrough-provider-design.md +202 -0
- package/docs/routing-awrr-health-weighted-round-robin.md +179 -0
- package/docs/routing-instructions.md +393 -0
- package/docs/servertool-framework.md +65 -0
- package/docs/stop-message-auto.md +225 -0
- package/docs/streaming-flow.html +30 -0
- package/docs/streaming-flow.md +182 -0
- package/docs/token-daemon-preview.html +490 -0
- package/docs/token-refresh-daemon-plan.md +269 -0
- package/docs/transformation-tables/Gemini-FinishReason/345/256/214/346/225/264/350/275/254/346/215/242/350/241/250.json +233 -0
- package/docs/transformation-tables/README.md +225 -0
- package/docs/transformation-tables/claude-code-router-anthropic-to-gemini.json +283 -0
- package/docs/transformation-tables/claude-code-router-anthropic-to-openai.json +208 -0
- package/docs/transformation-tables/claude-code-router-openai-to-anthropic.json +261 -0
- package/docs/transformation-tables/claude-code-router-openai-to-gemini.json +208 -0
- package/docs/transformation-tables/claude-code-router-openai-to-lmstudio.json +182 -0
- package/docs/transformation-tables/claude-code-router-openai-to-ollama.json +250 -0
- package/docs/transformation-tables/claude-code-router-openai-to-textgenwebui.json +295 -0
- package/docs/transformation-tables/claude-code-router-provider-conversions.json +193 -0
- package/docs/transformation-tables//345/256/214/346/225/264/347/232/204/345/267/245/345/205/267/346/211/247/350/241/214/346/265/201/347/250/213/350/275/254/346/215/242/350/241/250.json +299 -0
- package/docs/transformation-tables//345/257/271/350/257/235/345/216/206/345/217/262/347/273/264/346/212/244/345/210/206/346/236/220.md +134 -0
- package/docs/transformation-tables//345/267/245/345/205/267/350/260/203/347/224/250/346/250/241/345/274/217/345/210/206/346/236/220.md +158 -0
- package/docs/transformation-tables//347/212/266/346/200/201/347/256/241/347/220/206/351/234/200/346/261/202/345/210/206/346/236/220.md +175 -0
- package/docs/transformation-tables//351/235/231/346/200/201/350/241/250vs/345/212/250/346/200/201/345/210/206/346/236/220.md +189 -0
- package/docs/transformation-tables//351/235/231/346/200/201/350/241/250/345/207/206/347/241/256/346/200/247/350/257/204/344/274/260.md +179 -0
- package/docs/transformation-tables//351/235/236/346/265/201/345/274/217/345/234/272/346/231/257/345/210/206/346/236/220.md +189 -0
- package/docs/v2-architecture/IMPLEMENTATION-ROADMAP.md +367 -0
- package/docs/v2-architecture/OPTIMIZED-DESIGN.md +827 -0
- package/docs/v2-architecture/PRERUN-CONNECTION-DESIGN.md +716 -0
- package/docs/v2-architecture/README.md +549 -0
- package/docs/verification/modelscope-verify.md +59 -0
- package/docs/verified-configs/README.md +60 -0
- package/docs/verified-configs/v0.45.0/README.md +244 -0
- package/docs/verified-configs/v0.45.0/lmstudio-5521-gpt-oss-20b-mlx.json +135 -0
- package/docs/verified-configs/v0.45.0/merged-config.5521.json +1205 -0
- package/docs/verified-configs/v0.45.0/merged-config.qwen-5522.json +1559 -0
- package/docs/verified-configs/v0.45.0/qwen-5522-qwen3-coder-plus-final.json +221 -0
- package/docs/verified-configs/v0.45.0/qwen-5522-qwen3-coder-plus-fixed.json +242 -0
- package/docs/verified-configs/v0.45.0/qwen-5522-qwen3-coder-plus.json +242 -0
- package/docs/web-search-service-design.md +322 -0
- package/package.json +26 -15
- package/scripts/build-core.mjs +3 -1
- package/scripts/camoufox/launch-auth.mjs +193 -58
- package/scripts/ci/repo-sanity.mjs +138 -0
- package/scripts/mock-provider/run-regressions.mjs +157 -1
- package/scripts/monitor-diff.mjs +126 -0
- package/scripts/pack-mode.mjs +19 -1
- package/scripts/pack-rcc.mjs +63 -0
- package/scripts/run-bg.sh +0 -14
- package/scripts/tests/ci-jest.mjs +119 -0
- package/scripts/tools-dev/responses-debug-client/README.md +23 -0
- package/scripts/tools-dev/responses-debug-client/payloads/poem.json +13 -0
- package/scripts/tools-dev/responses-debug-client/payloads/sample-no-tools.json +98 -0
- package/scripts/tools-dev/responses-debug-client/payloads/text.json +13 -0
- package/scripts/tools-dev/responses-debug-client/payloads/tool.json +27 -0
- package/scripts/tools-dev/responses-debug-client/run.mjs +65 -0
- package/scripts/tools-dev/responses-debug-client/src/index.ts +281 -0
- package/scripts/tools-dev/run-llmswitch-chat.mjs +53 -0
- package/scripts/tools-dev/server-tools-dev/run-web-fetch.mjs +65 -0
- package/scripts/unified-hub-shadow-compare.mjs +33 -13
- package/scripts/vendor-core.mjs +13 -3
- package/scripts/verify-e2e-toolcall.mjs +115 -26
- package/dist/modules/llmswitch/pipeline-registry.d.ts +0 -57
- package/dist/modules/llmswitch/pipeline-registry.js +0 -229
- package/dist/modules/llmswitch/pipeline-registry.js.map +0 -1
- package/dist/server/RouteCodexServer.d.ts +0 -13
- package/dist/server/RouteCodexServer.js +0 -25
- package/dist/server/RouteCodexServer.js.map +0 -1
- package/dist/v2/conversion/hub/snapshot-recorder.d.ts +0 -12
- package/dist/v2/conversion/hub/snapshot-recorder.js +0 -22
- package/dist/v2/conversion/hub/snapshot-recorder.js.map +0 -1
- package/scripts/test-fc-responses.mjs +0 -66
- package/scripts/test-guidance.mjs +0 -100
- package/scripts/test-iflow-web-search.mjs +0 -141
- package/scripts/test-iflow.mjs +0 -379
- package/scripts/test-tool-exec.mjs +0 -26
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# ้ๆตๅผๅบๆฏไธ็Claude Code Routerๅๆ
|
|
2
|
+
|
|
3
|
+
## ้ๅฝ่ฐ็จ็ไฝ็ฝฎ
|
|
4
|
+
|
|
5
|
+
### 1. **ๅทฅๅ
ท่ฐ็จๅ็้ๅฝ**๏ผไธป่ฆไฝ็ฝฎ๏ผ
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// ไฝ็ฝฎ1๏ผๅทฅๅ
ท่ฐ็จๅฎๆๅ็้ๅฝ๏ผindex.ts:243-250๏ผ
|
|
9
|
+
if (data.event === 'message_delta' && toolMessages.length) {
|
|
10
|
+
// ๅฐๅทฅๅ
ท่ฐ็จๆทปๅ ๅฐๆถๆฏๅๅฒ
|
|
11
|
+
req.body.messages.push({
|
|
12
|
+
role: 'assistant',
|
|
13
|
+
content: assistantMessages
|
|
14
|
+
})
|
|
15
|
+
req.body.messages.push({
|
|
16
|
+
role: 'user',
|
|
17
|
+
content: toolMessages
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
// ๐ด ้ๅฝ่ฐ็จ๏ผ้ๆฐๅ้่ฏทๆฑๅฐๅไธไธชAPI
|
|
21
|
+
const response = await fetch(`http://127.0.0.1:${config.PORT}/v1/messages`, {
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers: {
|
|
24
|
+
'x-api-key': config.APIKEY,
|
|
25
|
+
'content-type': 'application/json',
|
|
26
|
+
},
|
|
27
|
+
body: JSON.stringify(req.body), // ๅ
ๅซๅทฅๅ
ท็ปๆ็ๆดๆฐๅ่ฏทๆฑ
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. **ๅพๅๅๆAgent็้ๅฝ**๏ผๆฌก่ฆไฝ็ฝฎ๏ผ
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// ไฝ็ฝฎ2๏ผๅพๅๅๆๅทฅๅ
ท็้ๅฝ่ฐ็จ๏ผimage.agent.ts:132-154๏ผ
|
|
36
|
+
const agentResponse = await fetch(`http://127.0.0.1:${context.config.PORT}/v1/messages`, {
|
|
37
|
+
method: "POST",
|
|
38
|
+
body: JSON.stringify({
|
|
39
|
+
model: context.config.Router.image,
|
|
40
|
+
system: [{ /* ๅพๅๅๆ็system prompt */ }],
|
|
41
|
+
messages: [
|
|
42
|
+
{
|
|
43
|
+
role: 'user',
|
|
44
|
+
content: imageMessages, // ไป็ผๅญไธญ่ทๅ็ๅพๅๆฐๆฎ
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
stream: false, // ๐ด ้ๆตๅผ่ฐ็จ
|
|
48
|
+
}),
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## ้ๆตๅผๅบๆฏไธ็็ถๆ็ฎก็้ๆฑ
|
|
53
|
+
|
|
54
|
+
### 1. **ๅพๅ็ผๅญ็ฎก็**๏ผไธป่ฆ้ๆฑ๏ผ
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
// ๅพๅ็ผๅญ๏ผๅบไบ่ฏทๆฑID
|
|
58
|
+
imageCache.storeImage(`${req.id}_Image#${imgId}`, msg.source);
|
|
59
|
+
|
|
60
|
+
// ๅพๅๆฃ็ดข๏ผๅทฅๅ
ท่ฐ็จๆถไป็ผๅญ่ทๅ
|
|
61
|
+
const image = imageCache.getImage(`${context.req.id}_Image#${imgId}`);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**ไธบไปไน้่ฆ็ผๅญ๏ผ**
|
|
65
|
+
- ๅพๅๅ
ๅฎน่ขซๆฟๆขไธบๅ ไฝ็ฌฆ `[Image #1]`
|
|
66
|
+
- ๅทฅๅ
ท่ฐ็จๆถ้่ฆ้ๆฐ่ทๅๅๅงๅพๅๆฐๆฎ
|
|
67
|
+
- ็ผๅญ้ฎๅบไบ่ฏทๆฑID็กฎไฟ้็ฆป
|
|
68
|
+
|
|
69
|
+
### 2. **ๅทฅๅ
ท่ฐ็จๅๆฐ็ป่ฃ
**๏ผๆฌก่ฆ้ๆฑ๏ผ
|
|
70
|
+
|
|
71
|
+
ๅจ้ๆตๅผๅบๆฏไธ๏ผๅทฅๅ
ท่ฐ็จๅๆฐๆฏๅฎๆด็๏ผไธ้่ฆ่ทจไบไปถ็ดฏ็งฏ๏ผ
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
// ้ๆตๅผ๏ผๅทฅๅ
ทๅๆฐๆฏๅฎๆด็ๅฏน่ฑก
|
|
75
|
+
{
|
|
76
|
+
"name": "analyzeImage",
|
|
77
|
+
"input": {
|
|
78
|
+
"imageId": ["1", "2"],
|
|
79
|
+
"task": "ๆ่ฟฐ่ฟๅผ ๅพ็"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 3. **้ๅฝ่ฐ็จ็ไธไธๆ็ปดๆค**๏ผๅ
ณ้ฎ้ๆฑ๏ผ
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// ้ๅฝ่ฐ็จๅ๏ผๆดๆฐๆถๆฏๅๅฒ
|
|
88
|
+
req.body.messages.push({
|
|
89
|
+
role: 'assistant',
|
|
90
|
+
content: assistantMessages // ๅทฅๅ
ท่ฐ็จ
|
|
91
|
+
})
|
|
92
|
+
req.body.messages.push({
|
|
93
|
+
role: 'user',
|
|
94
|
+
content: toolMessages // ๅทฅๅ
ท็ปๆ
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
// ้ๅฝ่ฐ็จ๏ผๅ้ๆดๆฐๅ็ๅฎๆดๅฏน่ฏๅๅฒ
|
|
98
|
+
const response = await fetch(`http://127.0.0.1:${config.PORT}/v1/messages`, {
|
|
99
|
+
body: JSON.stringify(req.body) // ๅ
ๅซๅฎๆดๅฏน่ฏๅๅฒ
|
|
100
|
+
})
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## ้ๆตๅผๅบๆฏ็็ฎๅๅๆ
|
|
104
|
+
|
|
105
|
+
### ็ถๆ็ฎก็็็ๅฎ้ๆฑ๏ผไฟฎๆญฃๅ๏ผ
|
|
106
|
+
|
|
107
|
+
#### 1. **ๅพๅ็ผๅญ็ฎก็**๏ผ20%๏ผ
|
|
108
|
+
- ่ฏทๆฑ็บงๅซ็ๅพๅ็ผๅญ
|
|
109
|
+
- ๅพๅID็ๆๅๆฃ็ดข
|
|
110
|
+
- ็ผๅญๆธ
็
|
|
111
|
+
|
|
112
|
+
#### 2. **้ๅฝ่ฐ็จๅ่ฐ**๏ผ15%๏ผ
|
|
113
|
+
- ๆถๆฏๅๅฒๆดๆฐ
|
|
114
|
+
- ๅทฅๅ
ท็ปๆๆๅ
ฅ
|
|
115
|
+
- ้ๅฝ่ฐ็จ่งฆๅ
|
|
116
|
+
|
|
117
|
+
#### 3. **ๅทฅๅ
ทๆง่ก็ถๆ**๏ผ5%๏ผ
|
|
118
|
+
- ๅฝๅๆง่ก็ๅทฅๅ
ทไฟกๆฏ
|
|
119
|
+
- ๅทฅๅ
ท็ปๆๆถ้
|
|
120
|
+
|
|
121
|
+
## ้ๆฐ่ฏไผฐ๏ผ้ๆ่กจ vs ๅจๆๅค็
|
|
122
|
+
|
|
123
|
+
### ้ๆ่กจ่ฝ่งฃๅณ็๏ผๆๅๅฐ80-85%๏ผ๏ผ
|
|
124
|
+
|
|
125
|
+
1. **ๅบ็กๅ่ฎฎ่ฝฌๆข** โ
|
|
126
|
+
- ๆจกๅๆ ๅฐ
|
|
127
|
+
- ๅๆฐ่ฝฌๆข
|
|
128
|
+
- ๆถๆฏ็ปๆ่ฝฌๆข
|
|
129
|
+
|
|
130
|
+
2. **ๅทฅๅ
ทๅฎไน่ฝฌๆข** โ
|
|
131
|
+
- ๅทฅๅ
ทschema่ฝฌๆข
|
|
132
|
+
- ๅๆฐๆ ผๅผ่ฝฌๆข
|
|
133
|
+
|
|
134
|
+
3. **้่ฏฏ็ ๆ ๅฐ** โ
|
|
135
|
+
- ๆ ๅ้่ฏฏๅๅบ่ฝฌๆข
|
|
136
|
+
|
|
137
|
+
4. **ๅๅบๆ ผๅผ่ฝฌๆข** โ
|
|
138
|
+
- ้ๆตๅผๅๅบ็ปๆ่ฝฌๆข
|
|
139
|
+
- ๅทฅๅ
ท็ปๆๆ ผๅผ่ฝฌๆข
|
|
140
|
+
|
|
141
|
+
### ้่ฆๅจๆๅค็็๏ผ้ไฝๅฐ15-20%๏ผ๏ผ
|
|
142
|
+
|
|
143
|
+
1. **ๅพๅ็ผๅญ้ป่พ**๏ผ10%๏ผ
|
|
144
|
+
- ๅพๅID็ๆ๏ผ`${req.id}_Image#${imgId}`
|
|
145
|
+
- ๅพๅๅ
ๅฎนๆฟๆข๏ผ`[Image #${imgId}]`
|
|
146
|
+
- ็ผๅญๆฃ็ดข้ป่พ
|
|
147
|
+
|
|
148
|
+
2. **้ๅฝ่ฐ็จๅ่ฐ**๏ผ5%๏ผ
|
|
149
|
+
- ๆถๆฏๅๅฒๆดๆฐ
|
|
150
|
+
- ๅทฅๅ
ท็ปๆๆๅ
ฅ
|
|
151
|
+
- ้ๅฝ่งฆๅ้ป่พ
|
|
152
|
+
|
|
153
|
+
3. **ๅทฅๅ
ทๆง่ก**๏ผ5%๏ผ
|
|
154
|
+
- ๅทฅๅ
ท่ฐ็จๆง่ก
|
|
155
|
+
- ็ปๆๆ ผๅผๅ
|
|
156
|
+
|
|
157
|
+
## ้ๆตๅผๅบๆฏ็็นๆฎๅค็
|
|
158
|
+
|
|
159
|
+
### 1. **็ฎๅ็ๅทฅๅ
ท่ฐ็จๆต็จ**
|
|
160
|
+
```
|
|
161
|
+
่ฏทๆฑๆฅๆถ โ ๅทฅๅ
ทๆฃๆต โ ๅทฅๅ
ทๆง่ก โ ็ปๆๆๅ
ฅ โ ้ๅฝ่ฐ็จ โ ๅๅบ่ฟๅ
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 2. **ๆ ้ๆตๅค็็ถๆ**
|
|
165
|
+
- ไธ้่ฆ่ทจไบไปถ็็ถๆ็ปดๆค
|
|
166
|
+
- ไธ้่ฆSSEไบไปถ่งฃๆ
|
|
167
|
+
- ๅทฅๅ
ทๅๆฐๆฏๅฎๆด็JSONๅฏน่ฑก
|
|
168
|
+
|
|
169
|
+
### 3. **้ๅฝ่ฐ็จๆฏไธป่ฆๅคๆๅบฆ**
|
|
170
|
+
- ๅๆฌกHTTP่ฏทๆฑๅฏ่ฝ่งฆๅๅคๆฌกๅ
้จ้ๅฝ่ฐ็จ
|
|
171
|
+
- ๆฏๆฌก้ๅฝ้ฝ้่ฆๆดๆฐๆถๆฏๅๅฒ
|
|
172
|
+
- ้่ฆ้ฟๅ
ๆ ้้ๅฝ
|
|
173
|
+
|
|
174
|
+
## ็ป่ฎบ
|
|
175
|
+
|
|
176
|
+
ๅจ**้ๆตๅผๅบๆฏ**ไธ๏ผ
|
|
177
|
+
|
|
178
|
+
1. **้ๆ่กจ่ฝ่งฃๅณ80-85%็้ฎ้ข**๏ผไธป่ฆๆฏๅ่ฎฎ่ฝฌๆข
|
|
179
|
+
2. **ๅช้่ฆ15-20%็ๅจๆๅค็**๏ผไธป่ฆๆฏ๏ผ
|
|
180
|
+
- ๅพๅ็ผๅญ็ฎก็
|
|
181
|
+
- ้ๅฝ่ฐ็จๅ่ฐ
|
|
182
|
+
- ๅทฅๅ
ทๆง่ก้ป่พ
|
|
183
|
+
|
|
184
|
+
3. **้ๅฝ่ฐ็จๆฏไธป่ฆๅคๆๅบฆๆฅๆบ**๏ผ
|
|
185
|
+
- ๅทฅๅ
ท่ฐ็จๅฎๆๅ๏ผ้่ฆ้ๅฝ่ฐ็จๅไธAPI
|
|
186
|
+
- ้่ฆ็ปดๆคๅฎๆด็ๅฏน่ฏๅๅฒ
|
|
187
|
+
- ้่ฆๆญฃ็กฎๅค็ๅทฅๅ
ท็ปๆ็ๆๅ
ฅ
|
|
188
|
+
|
|
189
|
+
่ฟๆฏๆตๅผๅบๆฏ็ฎๅๅพๅค๏ผ็ถๆ็ฎก็้ๆฑๅคงๅคง้ไฝ๏ผ
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
# V2 Architecture Implementation Roadmap
|
|
2
|
+
|
|
3
|
+
## ๐ Overview
|
|
4
|
+
|
|
5
|
+
This roadmap outlines the implementation plan for V2 pipeline architecture with the following key phases:
|
|
6
|
+
|
|
7
|
+
1. **V2 Basic Architecture** - Core virtual pipeline components
|
|
8
|
+
2. **Dynamic Connection System** - Runtime module connection
|
|
9
|
+
3. **V1/V2 Migration System** - Gradual switching mechanism
|
|
10
|
+
4. **ProviderComposite (3.5)** - Internalize compatibility into Provider with protocol guards, type-only providers
|
|
11
|
+
5. **Configuration & Validation** - Migration tools and validation
|
|
12
|
+
6. **Testing & Optimization** - Comprehensive testing and performance tuning
|
|
13
|
+
|
|
14
|
+
## ๐ Phase 1: V2 Basic Architecture (3-4 days)
|
|
15
|
+
|
|
16
|
+
### 1.1 Core Module Registry Implementation
|
|
17
|
+
**Files**: `src/modules/pipeline/v2/core/module-registry.ts`
|
|
18
|
+
|
|
19
|
+
**Tasks**:
|
|
20
|
+
- [ ] Implement V2ModuleRegistry with factory pattern
|
|
21
|
+
- [ ] Add instance caching and lifecycle management
|
|
22
|
+
- [ ] Implement lazy loading and cleanup mechanisms
|
|
23
|
+
- [ ] Add module type validation and error handling
|
|
24
|
+
|
|
25
|
+
**Acceptance Criteria**:
|
|
26
|
+
- Module types can be registered and retrieved
|
|
27
|
+
- Instances are created on-demand with proper caching
|
|
28
|
+
- Memory management prevents leaks
|
|
29
|
+
- Comprehensive error handling and logging
|
|
30
|
+
|
|
31
|
+
### 1.2 Static Instance Pool Implementation
|
|
32
|
+
**Files**: `src/modules/pipeline/v2/core/static-instance-pool.ts`
|
|
33
|
+
|
|
34
|
+
**Tasks**:
|
|
35
|
+
- [ ] Implement StaticInstancePool for multi-configuration modules
|
|
36
|
+
- [ ] Add configuration hashing and deduplication
|
|
37
|
+
- [ ] Implement preload mechanism based on route analysis
|
|
38
|
+
- [ ] Add instance health monitoring and recycling
|
|
39
|
+
|
|
40
|
+
**Acceptance Criteria**:
|
|
41
|
+
- Multiple configurations per module type supported
|
|
42
|
+
- Same configurations share instances (deduplication)
|
|
43
|
+
- Preload works based on route table analysis
|
|
44
|
+
- Idle instances are properly cleaned up
|
|
45
|
+
|
|
46
|
+
### 1.3 Dynamic Router Implementation
|
|
47
|
+
**Files**: `src/modules/pipeline/v2/core/dynamic-router.ts`
|
|
48
|
+
|
|
49
|
+
**Tasks**:
|
|
50
|
+
- [ ] Implement DynamicRouter with request pattern matching
|
|
51
|
+
- [ ] Add route priority mechanisms (fail fast on unmatched routes)
|
|
52
|
+
- [ ] Implement module chain building logic
|
|
53
|
+
- [ ] Add request routing performance optimization
|
|
54
|
+
|
|
55
|
+
**Acceptance Criteria**:
|
|
56
|
+
- Requests are correctly routed based on patterns
|
|
57
|
+
- Route priorities are respected
|
|
58
|
+
- Fail fast on unmatched routes (no fallback)
|
|
59
|
+
- Performance meets benchmarks
|
|
60
|
+
|
|
61
|
+
### 1.4 Virtual Module Chain Implementation
|
|
62
|
+
**Files**: `src/modules/pipeline/v2/core/virtual-module-chain.ts`
|
|
63
|
+
|
|
64
|
+
**Tasks**:
|
|
65
|
+
- [ ] Implement VirtualModuleChain for temporary connections
|
|
66
|
+
- [ ] Add VirtualModuleConnection for lightweight linking
|
|
67
|
+
- [ ] Implement chain execution and cleanup
|
|
68
|
+
- [ ] Add connection state management
|
|
69
|
+
|
|
70
|
+
**Acceptance Criteria**:
|
|
71
|
+
- Module chains can be built and executed
|
|
72
|
+
- Connections are established and cleaned properly
|
|
73
|
+
- Chain execution follows module order
|
|
74
|
+
- Resources are properly released after execution
|
|
75
|
+
|
|
76
|
+
## ๐ Phase 2: Dynamic Connection System (2-3 days)
|
|
77
|
+
|
|
78
|
+
### 2.1 Dynamic Connector Implementation
|
|
79
|
+
**Files**: `src/modules/pipeline/v2/core/dynamic-connector.ts`
|
|
80
|
+
|
|
81
|
+
**Tasks**:
|
|
82
|
+
- [ ] Implement DynamicConnector for runtime connections
|
|
83
|
+
- [ ] Add connection establishment and teardown
|
|
84
|
+
- [ ] Implement error handling and recovery
|
|
85
|
+
- [ ] Add connection monitoring and metrics
|
|
86
|
+
|
|
87
|
+
**Acceptance Criteria**:
|
|
88
|
+
- Dynamic connections are established on-demand
|
|
89
|
+
- Connections are properly torn down after execution
|
|
90
|
+
- Connection errors are handled gracefully
|
|
91
|
+
- Performance metrics are collected
|
|
92
|
+
|
|
93
|
+
### 2.2 Connection State Management
|
|
94
|
+
**Files**: `src/modules/pipeline/v2/core/module-connection.ts`
|
|
95
|
+
|
|
96
|
+
**Tasks**:
|
|
97
|
+
- [ ] Implement ModuleConnection and InstanceConnection
|
|
98
|
+
- [ ] Add connection health monitoring
|
|
99
|
+
- [ ] Implement connection lifecycle callbacks
|
|
100
|
+
- [ ] Add connection metadata and debugging support
|
|
101
|
+
|
|
102
|
+
**Acceptance Criteria**:
|
|
103
|
+
- Connection states are properly tracked
|
|
104
|
+
- Health monitoring works correctly
|
|
105
|
+
- Lifecycle callbacks fire appropriately
|
|
106
|
+
- Debugging information is available
|
|
107
|
+
|
|
108
|
+
### 2.3 Hybrid Router Implementation
|
|
109
|
+
**Files**: `src/modules/pipeline/v2/core/hybrid-router.ts`
|
|
110
|
+
|
|
111
|
+
**Tasks**:
|
|
112
|
+
- [ ] Implement HybridDynamicRouter with static instance integration
|
|
113
|
+
- [ ] Add configuration resolution with conditional selection (fail fast on unmatched conditions)
|
|
114
|
+
- [ ] Implement module chain building from static pool
|
|
115
|
+
- [ ] Add request processing with connection management
|
|
116
|
+
|
|
117
|
+
**Acceptance Criteria**:
|
|
118
|
+
- Static instances are properly utilized
|
|
119
|
+
- Configurations are resolved correctly
|
|
120
|
+
- Module chains use static instances efficiently
|
|
121
|
+
- Request processing maintains performance
|
|
122
|
+
|
|
123
|
+
## ๐ Phase 3: V1/V2 Migration System (2-3 days)
|
|
124
|
+
|
|
125
|
+
### 3.1 V2 Pipeline Assembler Implementation
|
|
126
|
+
**Files**: `src/modules/pipeline/v2/config/v2-pipeline-assembler.ts`
|
|
127
|
+
|
|
128
|
+
**Tasks**:
|
|
129
|
+
- [ ] Implement V2PipelineAssembler with simplified logic
|
|
130
|
+
- [ ] Add configuration validation and instance verification
|
|
131
|
+
- [ ] Implement prerun route validation
|
|
132
|
+
- [ ] Add data flow simulation and validation
|
|
133
|
+
|
|
134
|
+
**Acceptance Criteria**:
|
|
135
|
+
- V2 configurations are properly validated
|
|
136
|
+
- Static instances are verified before use
|
|
137
|
+
- Prerun validation catches configuration issues
|
|
138
|
+
- Data flow simulation works correctly
|
|
139
|
+
|
|
140
|
+
### 3.2 V1 Configuration Migration
|
|
141
|
+
**Files**: `src/modules/pipeline/v2/config/v1-migrator.ts`
|
|
142
|
+
|
|
143
|
+
**Tasks**:
|
|
144
|
+
- [ ] Implement V1ToV2Migrator for automatic conversion
|
|
145
|
+
- [ ] Add route table conversion from V1 format
|
|
146
|
+
- [ ] Implement provider and compatibility config extraction
|
|
147
|
+
- [ ] Add migration report generation
|
|
148
|
+
|
|
149
|
+
**Acceptance Criteria**:
|
|
150
|
+
- V1 configurations convert to V2 format correctly
|
|
151
|
+
- Route tables maintain V1 behavior in V2
|
|
152
|
+
- All required module types are extracted
|
|
153
|
+
- Migration reports are comprehensive
|
|
154
|
+
|
|
155
|
+
### 3.3 Mode Switch Implementation
|
|
156
|
+
**Files**: `src/core/v1-v2-switch.ts`
|
|
157
|
+
|
|
158
|
+
**Tasks**:
|
|
159
|
+
- [ ] Implement V1V2ModeSwitch with gradual switching
|
|
160
|
+
- [ ] Add compatibility validation before switch
|
|
161
|
+
- [ ] Implement traffic shifting mechanism
|
|
162
|
+
- [ ] Add manual rollback workflow and structured error logging
|
|
163
|
+
|
|
164
|
+
**Acceptance Criteria**:
|
|
165
|
+
- Modes can be switched without service interruption
|
|
166
|
+
- Compatibility validation prevents breaking changes
|
|
167
|
+
- Traffic can be shifted gradually
|
|
168
|
+
- No auto recovery; errors surface immediately with full context
|
|
169
|
+
|
|
170
|
+
## โ๏ธ Phase 4: Configuration & Validation (1-2 days)
|
|
171
|
+
|
|
172
|
+
### 3.5 ProviderComposite & Type-only Providers
|
|
173
|
+
**Files**: `src/providers/core/composite/*`, `src/providers/core/runtime/*`, `docs/providers/*`
|
|
174
|
+
|
|
175
|
+
**Tasks**:
|
|
176
|
+
- [x] Internalize compatibility into Provider (ProviderComposite)
|
|
177
|
+
- [x] Add protocol guards and minimal shape checks (Fail Fast)
|
|
178
|
+
- [x] OpenAI-family aggregator (glm/lmstudio/iflow reuse; qwen safe path)
|
|
179
|
+
- [x] Factory protocol-first selection; normalize legacy providerType
|
|
180
|
+
- [x] Docs for design/testing/migration
|
|
181
|
+
|
|
182
|
+
**Acceptance Criteria**:
|
|
183
|
+
- Pipeline no longer needs explicit compatibility nodes
|
|
184
|
+
- Provider reads runtime metadata and enforces protocol guards
|
|
185
|
+
- SSE boundary respected (ProviderโHost JSON only)
|
|
186
|
+
- Legacy configs run with warnings; brand handled via providerId/extensions
|
|
187
|
+
|
|
188
|
+
### 4.1 Configuration Schema Implementation
|
|
189
|
+
**Files**: `src/config/v2-config-schema.ts`
|
|
190
|
+
|
|
191
|
+
**Tasks**:
|
|
192
|
+
- [ ] Implement V2SystemConfig interface
|
|
193
|
+
- [ ] Add RouteDefinition and ModuleSpecification types
|
|
194
|
+
- [ ] Implement configuration validation rules
|
|
195
|
+
- [ ] Add schema documentation and examples
|
|
196
|
+
|
|
197
|
+
**Acceptance Criteria**:
|
|
198
|
+
- V2 configuration schema is complete
|
|
199
|
+
- Validation rules prevent invalid configurations
|
|
200
|
+
- Documentation is clear and comprehensive
|
|
201
|
+
- Examples cover common use cases
|
|
202
|
+
|
|
203
|
+
### 4.2 Configuration Library Implementation
|
|
204
|
+
**Files**: `src/config/v2-config-library.ts`
|
|
205
|
+
|
|
206
|
+
**Tasks**:
|
|
207
|
+
- [ ] Implement V2ConfigLibrary with predefined configurations
|
|
208
|
+
- [ ] Add provider, compatibility, and llmSwitch configs
|
|
209
|
+
- [ ] Implement configuration lookup and resolution
|
|
210
|
+
- [ ] Add configuration validation and defaults
|
|
211
|
+
|
|
212
|
+
**Acceptance Criteria**:
|
|
213
|
+
- Predefined configurations cover all providers
|
|
214
|
+
- Configuration lookup is efficient and reliable
|
|
215
|
+
- Validation catches configuration errors
|
|
216
|
+
- Default values are sensible
|
|
217
|
+
|
|
218
|
+
### 4.3 Prerun Validation Tools
|
|
219
|
+
**Files**: `src/tools/pre-run-validator.ts`
|
|
220
|
+
|
|
221
|
+
**Tasks**:
|
|
222
|
+
- [ ] Implement PreRunValidator for comprehensive testing
|
|
223
|
+
- [ ] Add route validation and data flow testing
|
|
224
|
+
- [ ] Implement performance validation
|
|
225
|
+
- [ ] Add detailed validation reporting
|
|
226
|
+
|
|
227
|
+
**Acceptance Criteria**:
|
|
228
|
+
- All routes can be validated before switching
|
|
229
|
+
- Data flow validation catches compatibility issues
|
|
230
|
+
- Performance validation meets requirements
|
|
231
|
+
- Validation reports are detailed and actionable
|
|
232
|
+
|
|
233
|
+
### 4.4 Warmup Manager Implementation
|
|
234
|
+
**Files**: `src/modules/pipeline/v2/core/warmup-manager.ts`
|
|
235
|
+
|
|
236
|
+
**Tasks**:
|
|
237
|
+
- [ ] Implement WarmupManager with intelligent preloading
|
|
238
|
+
- [ ] Add priority-based instance loading
|
|
239
|
+
- [ ] Implement instance validation and health checks
|
|
240
|
+
- [ ] Add warmup metrics and reporting
|
|
241
|
+
|
|
242
|
+
**Acceptance Criteria**:
|
|
243
|
+
- System startup is optimized with warmup
|
|
244
|
+
- Critical modules are loaded first
|
|
245
|
+
- Instance health is verified during warmup
|
|
246
|
+
- Warmup reports show startup status
|
|
247
|
+
|
|
248
|
+
## ๐งช Phase 5: Testing & Optimization (2-3 days)
|
|
249
|
+
|
|
250
|
+
### 5.1 Unit Testing
|
|
251
|
+
**Tasks**:
|
|
252
|
+
- [ ] Write unit tests for all V2 components
|
|
253
|
+
- [ ] Test configuration migration and validation
|
|
254
|
+
- [ ] Test dynamic connection and routing
|
|
255
|
+
- [ ] Test mode switching and compatibility
|
|
256
|
+
|
|
257
|
+
**Acceptance Criteria**:
|
|
258
|
+
- Unit test coverage > 90%
|
|
259
|
+
- All critical paths are tested
|
|
260
|
+
- Edge cases are handled correctly
|
|
261
|
+
- Tests run reliably in CI/CD
|
|
262
|
+
|
|
263
|
+
### 5.2 Integration Testing
|
|
264
|
+
**Tasks**:
|
|
265
|
+
- [ ] Test V1/V2 mode switching end-to-end
|
|
266
|
+
- [ ] Test configuration migration with real configs
|
|
267
|
+
- [ ] Test dynamic routing with various request types
|
|
268
|
+
- [ ] Test performance under load
|
|
269
|
+
|
|
270
|
+
**Acceptance Criteria**:
|
|
271
|
+
- Mode switching works without issues
|
|
272
|
+
- Configuration migration preserves behavior
|
|
273
|
+
- Dynamic routing performs correctly
|
|
274
|
+
- System meets performance requirements
|
|
275
|
+
|
|
276
|
+
### 5.3 Performance Testing
|
|
277
|
+
**Tasks**:
|
|
278
|
+
- [ ] Benchmark V1 vs V2 performance
|
|
279
|
+
- [ ] Test connection establishment overhead
|
|
280
|
+
- [ ] Measure memory usage with static pools
|
|
281
|
+
- [ ] Optimize bottlenecks identified in testing
|
|
282
|
+
|
|
283
|
+
**Acceptance Criteria**:
|
|
284
|
+
- V2 performance matches or exceeds V1
|
|
285
|
+
- Connection overhead is minimal
|
|
286
|
+
- Memory usage is efficient
|
|
287
|
+
- No performance regressions
|
|
288
|
+
|
|
289
|
+
### 5.4 Documentation and Examples
|
|
290
|
+
**Tasks**:
|
|
291
|
+
- [ ] Write comprehensive API documentation
|
|
292
|
+
- [ ] Create migration guide and examples
|
|
293
|
+
- [ ] Document configuration options
|
|
294
|
+
- [ ] Create troubleshooting guide
|
|
295
|
+
|
|
296
|
+
**Acceptance Criteria**:
|
|
297
|
+
- Documentation is complete and accurate
|
|
298
|
+
- Migration guide is easy to follow
|
|
299
|
+
- Examples cover common scenarios
|
|
300
|
+
- Troubleshooting guide is helpful
|
|
301
|
+
|
|
302
|
+
## ๐ Success Metrics
|
|
303
|
+
|
|
304
|
+
### Functional Metrics
|
|
305
|
+
- [ ] All V1 configurations successfully migrate to V2
|
|
306
|
+
- [ ] V2 routing produces identical results to V1
|
|
307
|
+
- [ ] Mode switching completes without service interruption
|
|
308
|
+
- [ ] Prerun validation catches all configuration issues
|
|
309
|
+
|
|
310
|
+
### Performance Metrics
|
|
311
|
+
- [ ] V2 response time โค V1 response time + 5ms
|
|
312
|
+
- [ ] Connection establishment time < 1ms
|
|
313
|
+
- [ ] Memory usage increase < 20%
|
|
314
|
+
- [ ] Warmup completion time < 30 seconds
|
|
315
|
+
|
|
316
|
+
### Quality Metrics
|
|
317
|
+
- [ ] Unit test coverage > 90%
|
|
318
|
+
- [ ] Integration test success rate = 100%
|
|
319
|
+
- [ ] Zero critical bugs in production
|
|
320
|
+
- [ ] Documentation completeness score > 95%
|
|
321
|
+
- [ ] No fallback logic anywhere in V2 codebase (Fail Fast validation)
|
|
322
|
+
- [ ] All tool processing goes through llmswitch-core only
|
|
323
|
+
- [ ] Configuration validation passes 100% (no hardcoded values)
|
|
324
|
+
|
|
325
|
+
### "No Fallback" Validation Checklist
|
|
326
|
+
- [ ] RouteTable has no fallbackStrategies
|
|
327
|
+
- [ ] ModuleSpecification has no fallback property
|
|
328
|
+
- [ ] HybridRouter throws errors on condition mismatch (no fallback resolution)
|
|
329
|
+
- [ ] Error handling logs and metrics only (no auto recovery)
|
|
330
|
+
- [ ] Mode switching requires explicit operator action
|
|
331
|
+
- [ ] All configuration uses env vars with defaults (no hardcoded URLs/keys)
|
|
332
|
+
- [ ] Instance pool validation rejects invalid configs immediately
|
|
333
|
+
|
|
334
|
+
## ๐จ Risk Mitigation
|
|
335
|
+
|
|
336
|
+
### Technical Risks
|
|
337
|
+
| Risk | Probability | Impact | Mitigation |
|
|
338
|
+
|------|-------------|--------|------------|
|
|
339
|
+
| Performance regression | Medium | High | Comprehensive benchmarking and optimization |
|
|
340
|
+
| Memory leaks | Low | High | Rigorous testing and monitoring |
|
|
341
|
+
| Configuration migration issues | Medium | High | Extensive validation and rollback mechanism |
|
|
342
|
+
| Dynamic connection failures | Low | Medium | Robust error handling and retry logic |
|
|
343
|
+
|
|
344
|
+
### Operational Risks
|
|
345
|
+
| Risk | Probability | Impact | Mitigation |
|
|
346
|
+
|------|-------------|--------|------------|
|
|
347
|
+
| Service disruption during switch | Low | High | Gradual switching with rollback capability |
|
|
348
|
+
| Compatibility issues | Medium | Medium | Extensive prerun validation and testing |
|
|
349
|
+
| Increased complexity | High | Low | Comprehensive documentation and training |
|
|
350
|
+
|
|
351
|
+
## ๐
Timeline
|
|
352
|
+
|
|
353
|
+
| Phase | Duration | Start Date | End Date | Dependencies |
|
|
354
|
+
|-------|----------|-------------|-----------|--------------|
|
|
355
|
+
| Phase 1: V2 Basic Architecture | 3-4 days | Day 1 | Day 4 | None |
|
|
356
|
+
| Phase 2: Dynamic Connection System | 2-3 days | Day 5 | Day 7 | Phase 1 |
|
|
357
|
+
| Phase 3: V1/V2 Migration System | 2-3 days | Day 8 | Day 10 | Phase 1, 2 |
|
|
358
|
+
| Phase 4: Configuration & Validation | 1-2 days | Day 11 | Day 12 | Phase 3 |
|
|
359
|
+
| Phase 5: Testing & Optimization | 2-3 days | Day 13 | Day 15 | All previous phases |
|
|
360
|
+
|
|
361
|
+
**Total Duration**: 15 days
|
|
362
|
+
**Buffer Time**: 3 days (for unforeseen issues)
|
|
363
|
+
**Target Completion**: 18 days
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
*This roadmap serves as the implementation guide for V2 architecture. All phases should be completed sequentially with proper testing and validation at each stage.*
|