@fudrouter/fsrouter 0.6.61 → 0.6.63
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/bin/copyJs.js +13 -9
- package/open-sse/AGENTS.md +39 -0
- package/open-sse/config/anthropicHeaders.js +87 -0
- package/open-sse/config/appConstants.js +238 -0
- package/open-sse/config/audioRegistry.js +506 -0
- package/open-sse/config/cliFingerprints.js +304 -0
- package/open-sse/config/codexInstructions.js +119 -0
- package/open-sse/config/codexQuotaScopes.js +42 -0
- package/open-sse/config/constants.js +4 -0
- package/open-sse/config/contextEditing.js +68 -0
- package/open-sse/config/credentialLoader.js +83 -0
- package/open-sse/config/defaultThinkingSignature.js +12 -0
- package/open-sse/config/embeddingRegistry.js +264 -0
- package/open-sse/config/errorConfig.js +96 -0
- package/open-sse/config/freeModelCatalog.data.js +121 -0
- package/open-sse/config/freeModelCatalog.js +90 -0
- package/open-sse/config/freeTierCatalog.js +81 -0
- package/open-sse/config/googleTtsLanguages.js +62 -0
- package/open-sse/config/imageParamDefs.js +360 -0
- package/open-sse/config/imageRegistry.js +493 -0
- package/open-sse/config/kiroConstants.js +268 -0
- package/open-sse/config/mediaConfig.js +27 -0
- package/open-sse/config/mediaServiceKinds.js +71 -0
- package/open-sse/config/models.js +13 -0
- package/open-sse/config/moderationRegistry.js +71 -0
- package/open-sse/config/musicRegistry.js +99 -0
- package/open-sse/config/ocrRegistry.js +61 -0
- package/open-sse/config/ollamaModels.js +19 -0
- package/open-sse/config/providerErrorRules.js +114 -0
- package/open-sse/config/providerFieldStrips.js +35 -0
- package/open-sse/config/providerHeaderProfiles.js +191 -0
- package/open-sse/config/providerModels.js +106 -0
- package/open-sse/config/providerRegistry.js +16 -0
- package/open-sse/config/providers.js +19 -0
- package/open-sse/config/registryUtils.js +106 -0
- package/open-sse/config/rerankRegistry.js +177 -0
- package/open-sse/config/runtimeConfig.js +96 -0
- package/open-sse/config/runway.js +39 -0
- package/open-sse/config/searchRegistry.js +153 -0
- package/open-sse/config/toolCloaking.js +199 -0
- package/open-sse/config/ttsModels.js +129 -0
- package/open-sse/config/videoRegistry.js +207 -0
- package/open-sse/executors/adapta-web.js +435 -0
- package/open-sse/executors/antigravity.js +534 -0
- package/open-sse/executors/antigravityUpstreamError.js +13 -0
- package/open-sse/executors/auggie.js +437 -0
- package/open-sse/executors/azure-openai.js +32 -0
- package/open-sse/executors/azure.js +57 -0
- package/open-sse/executors/base.js +181 -0
- package/open-sse/executors/bedrock.js +633 -0
- package/open-sse/executors/blackbox-web.js +578 -0
- package/open-sse/executors/chatgpt-web.js +2042 -0
- package/open-sse/executors/chipotle.js +357 -0
- package/open-sse/executors/claude-web-with-auto-refresh.js +73 -0
- package/open-sse/executors/claude-web.js +586 -0
- package/open-sse/executors/cliproxyapi.js +296 -0
- package/open-sse/executors/cloudflare-ai.js +46 -0
- package/open-sse/executors/codebuddy-cn.js +40 -0
- package/open-sse/executors/codex.js +1324 -0
- package/open-sse/executors/commandCode.js +558 -0
- package/open-sse/executors/commandcode.js +88 -0
- package/open-sse/executors/copilot-m365-connection.js +176 -0
- package/open-sse/executors/copilot-m365-frames.js +192 -0
- package/open-sse/executors/copilot-m365-web.js +299 -0
- package/open-sse/executors/copilot-web.js +580 -0
- package/open-sse/executors/cursor.js +795 -0
- package/open-sse/executors/deepseek-web-with-auto-refresh.js +150 -0
- package/open-sse/executors/deepseek-web.js +875 -0
- package/open-sse/executors/default.js +430 -0
- package/open-sse/executors/devin-cli.js +351 -0
- package/open-sse/executors/doubao-web.js +550 -0
- package/open-sse/executors/duckduckgo-web.js +629 -0
- package/open-sse/executors/forceResponsesUpstream.js +33 -0
- package/open-sse/executors/gemini-business.js +320 -0
- package/open-sse/executors/gemini-cli.js +89 -0
- package/open-sse/executors/gemini-web.js +297 -0
- package/open-sse/executors/github.js +379 -0
- package/open-sse/executors/gitlab.js +569 -0
- package/open-sse/executors/glm.js +361 -0
- package/open-sse/executors/grok-cli.js +119 -0
- package/open-sse/executors/grok-web.js +345 -0
- package/open-sse/executors/huggingchat.js +467 -0
- package/open-sse/executors/iflow.js +108 -0
- package/open-sse/executors/index.js +78 -0
- package/open-sse/executors/inner-ai.js +527 -0
- package/open-sse/executors/kimchi.js +123 -0
- package/open-sse/executors/kimi-web.js +325 -0
- package/open-sse/executors/kimi.js +97 -0
- package/open-sse/executors/kiro.js +503 -0
- package/open-sse/executors/kiroThinking.js +44 -0
- package/open-sse/executors/lmarena.js +395 -0
- package/open-sse/executors/mimo-free.js +167 -0
- package/open-sse/executors/mimocode.js +392 -0
- package/open-sse/executors/ninerouter.js +155 -0
- package/open-sse/executors/nlpcloud.js +438 -0
- package/open-sse/executors/ollama-local.js +14 -0
- package/open-sse/executors/opencode-go.js +41 -0
- package/open-sse/executors/opencode.js +32 -0
- package/open-sse/executors/perplexity-web.js +581 -0
- package/open-sse/executors/poe-web.js +133 -0
- package/open-sse/executors/pollinations.js +95 -0
- package/open-sse/executors/puter.js +31 -0
- package/open-sse/executors/qoder.js +448 -0
- package/open-sse/executors/qwen-web.js +372 -0
- package/open-sse/executors/qwen.js +129 -0
- package/open-sse/executors/t3-chat-web.js +417 -0
- package/open-sse/executors/theoldllm.js +290 -0
- package/open-sse/executors/trae.js +418 -0
- package/open-sse/executors/v0-vercel-web.js +141 -0
- package/open-sse/executors/venice-web.js +142 -0
- package/open-sse/executors/vertex.js +131 -0
- package/open-sse/executors/vertexMedia.js +236 -0
- package/open-sse/executors/windsurf.js +560 -0
- package/open-sse/executors/xai.js +46 -0
- package/open-sse/executors/xiaomi-tokenplan.js +19 -0
- package/open-sse/executors/yuanbao-web.js +385 -0
- package/open-sse/executors/zed-hosted.js +281 -0
- package/open-sse/executors/zenmux-free.js +247 -0
- package/open-sse/handlers/audioSpeech.js +759 -0
- package/open-sse/handlers/audioTranscription.js +395 -0
- package/open-sse/handlers/audioTranslation.js +181 -0
- package/open-sse/handlers/chatCore/nonStreamingHandler.js +300 -0
- package/open-sse/handlers/chatCore/requestDetail.js +102 -0
- package/open-sse/handlers/chatCore/sseToJsonHandler.js +231 -0
- package/open-sse/handlers/chatCore/streamingHandler.js +95 -0
- package/open-sse/handlers/chatCore.js +404 -0
- package/open-sse/handlers/embeddingProviders/_base.js +4 -0
- package/open-sse/handlers/embeddingProviders/gemini.js +54 -0
- package/open-sse/handlers/embeddingProviders/index.js +23 -0
- package/open-sse/handlers/embeddingProviders/openai.js +39 -0
- package/open-sse/handlers/embeddingProviders/openaiCompatNode.js +13 -0
- package/open-sse/handlers/embeddingsCore.js +126 -0
- package/open-sse/handlers/fetch/index.js +237 -0
- package/open-sse/handlers/imageGenerationCore.js +230 -0
- package/open-sse/handlers/imageProviders/_base.js +31 -0
- package/open-sse/handlers/imageProviders/antigravity.js +73 -0
- package/open-sse/handlers/imageProviders/blackForestLabs.js +63 -0
- package/open-sse/handlers/imageProviders/cloudflareAi.js +207 -0
- package/open-sse/handlers/imageProviders/codex.js +217 -0
- package/open-sse/handlers/imageProviders/comfyui.js +25 -0
- package/open-sse/handlers/imageProviders/falAi.js +62 -0
- package/open-sse/handlers/imageProviders/gemini.js +40 -0
- package/open-sse/handlers/imageProviders/huggingface.js +38 -0
- package/open-sse/handlers/imageProviders/index.js +44 -0
- package/open-sse/handlers/imageProviders/leonardo.js +435 -0
- package/open-sse/handlers/imageProviders/nanobanana.js +79 -0
- package/open-sse/handlers/imageProviders/openai.js +61 -0
- package/open-sse/handlers/imageProviders/runwayml.js +72 -0
- package/open-sse/handlers/imageProviders/sdwebui.js +36 -0
- package/open-sse/handlers/imageProviders/stabilityAi.js +59 -0
- package/open-sse/handlers/imageProviders/weavy.js +222 -0
- package/open-sse/handlers/moderations.js +92 -0
- package/open-sse/handlers/ocr.js +89 -0
- package/open-sse/handlers/rerank.js +223 -0
- package/open-sse/handlers/responseSanitizer/reasoning.js +144 -0
- package/open-sse/handlers/responsesHandler.js +99 -0
- package/open-sse/handlers/search/callers.js +371 -0
- package/open-sse/handlers/search/chatSearch.js +409 -0
- package/open-sse/handlers/search/index.js +201 -0
- package/open-sse/handlers/search/normalizers.js +223 -0
- package/open-sse/handlers/search.js +1056 -0
- package/open-sse/handlers/sseParser.js +469 -0
- package/open-sse/handlers/sttCore.js +193 -0
- package/open-sse/handlers/ttsCore.js +74 -0
- package/open-sse/handlers/ttsProviders/_base.js +39 -0
- package/open-sse/handlers/ttsProviders/edgeTts.js +89 -0
- package/open-sse/handlers/ttsProviders/elevenlabs.js +48 -0
- package/open-sse/handlers/ttsProviders/gemini.js +117 -0
- package/open-sse/handlers/ttsProviders/genericFormats.js +169 -0
- package/open-sse/handlers/ttsProviders/googleTts.js +54 -0
- package/open-sse/handlers/ttsProviders/index.js +50 -0
- package/open-sse/handlers/ttsProviders/localDevice.js +87 -0
- package/open-sse/handlers/ttsProviders/minimax.js +59 -0
- package/open-sse/handlers/ttsProviders/openai.js +30 -0
- package/open-sse/handlers/ttsProviders/openrouter.js +70 -0
- package/open-sse/handlers/usageExtractor.js +93 -0
- package/open-sse/handlers/videoGenerationCore.js +119 -0
- package/open-sse/handlers/videoProviders/index.js +22 -0
- package/open-sse/handlers/videoProviders/leonardo.js +511 -0
- package/open-sse/handlers/videoProviders/weavy.js +198 -0
- package/open-sse/handlers/webFetch.js +200 -0
- package/open-sse/index.js +79 -0
- package/open-sse/mcp-server/audit.js +283 -0
- package/open-sse/mcp-server/catalog.js +184 -0
- package/open-sse/mcp-server/descriptionCompressor.js +175 -0
- package/open-sse/mcp-server/httpAuthContext.js +32 -0
- package/open-sse/mcp-server/httpTransport.js +229 -0
- package/open-sse/mcp-server/index.js +33 -0
- package/open-sse/mcp-server/mcpCallerIdentity.js +21 -0
- package/open-sse/mcp-server/runtimeHeartbeat.js +110 -0
- package/open-sse/mcp-server/schemas/a2a.js +153 -0
- package/open-sse/mcp-server/schemas/audit.js +17 -0
- package/open-sse/mcp-server/schemas/index.js +166 -0
- package/open-sse/mcp-server/schemas/pickFastestModel.js +90 -0
- package/open-sse/mcp-server/schemas/toolDefinition.js +0 -0
- package/open-sse/mcp-server/schemas/toolSearch.js +32 -0
- package/open-sse/mcp-server/schemas/tools.js +1219 -0
- package/open-sse/mcp-server/scopeEnforcement.js +80 -0
- package/open-sse/mcp-server/server.js +1168 -0
- package/open-sse/mcp-server/toolCardinality.js +78 -0
- package/open-sse/mcp-server/toolSearch/catalog.js +66 -0
- package/open-sse/mcp-server/toolSearch/handler.js +20 -0
- package/open-sse/mcp-server/toolSearch/index.js +10 -0
- package/open-sse/mcp-server/toolSearch/register.js +21 -0
- package/open-sse/mcp-server/toolSearch/search.js +55 -0
- package/open-sse/mcp-server/toolSearch/signature.js +67 -0
- package/open-sse/mcp-server/tools/advancedTools.js +893 -0
- package/open-sse/mcp-server/tools/agentSkillTools.js +69 -0
- package/open-sse/mcp-server/tools/compressionTools.js +309 -0
- package/open-sse/mcp-server/tools/gamificationTools.js +134 -0
- package/open-sse/mcp-server/tools/githubSkillTools.js +102 -0
- package/open-sse/mcp-server/tools/memoryTools.js +118 -0
- package/open-sse/mcp-server/tools/notionTools.js +101 -0
- package/open-sse/mcp-server/tools/obsidianTools.js +307 -0
- package/open-sse/mcp-server/tools/pickFastestModel.js +223 -0
- package/open-sse/mcp-server/tools/pluginTools.js +181 -0
- package/open-sse/mcp-server/tools/poolTools.js +139 -0
- package/open-sse/mcp-server/tools/skillTools.js +113 -0
- package/open-sse/package.json +10 -0
- package/open-sse/providers/REGISTRY_TEMPLATE.js +98 -0
- package/open-sse/providers/capabilities.js +293 -0
- package/open-sse/providers/index.js +51 -0
- package/open-sse/providers/models/helpers.js +20 -0
- package/open-sse/providers/models/namePatterns.js +33 -0
- package/open-sse/providers/models/schema.js +40 -0
- package/open-sse/providers/pricing.js +308 -0
- package/open-sse/providers/registry/alicode-intl.js +30 -0
- package/open-sse/providers/registry/alicode.js +31 -0
- package/open-sse/providers/registry/anthropic.js +37 -0
- package/open-sse/providers/registry/antigravity.js +81 -0
- package/open-sse/providers/registry/assemblyai.js +38 -0
- package/open-sse/providers/registry/aws-polly.js +45 -0
- package/open-sse/providers/registry/azure.js +21 -0
- package/open-sse/providers/registry/black-forest-labs.js +32 -0
- package/open-sse/providers/registry/blackbox.js +41 -0
- package/open-sse/providers/registry/brave-search.js +35 -0
- package/open-sse/providers/registry/byteplus.js +35 -0
- package/open-sse/providers/registry/cartesia.js +36 -0
- package/open-sse/providers/registry/cerebras.js +31 -0
- package/open-sse/providers/registry/chutes.js +24 -0
- package/open-sse/providers/registry/claude.js +87 -0
- package/open-sse/providers/registry/cline.js +51 -0
- package/open-sse/providers/registry/clinepass.js +57 -0
- package/open-sse/providers/registry/cloudflare-ai.js +55 -0
- package/open-sse/providers/registry/codebuddy-cn.js +77 -0
- package/open-sse/providers/registry/codex.js +100 -0
- package/open-sse/providers/registry/cohere.js +27 -0
- package/open-sse/providers/registry/comfyui.js +20 -0
- package/open-sse/providers/registry/commandcode.js +43 -0
- package/open-sse/providers/registry/coqui.js +30 -0
- package/open-sse/providers/registry/cursor.js +58 -0
- package/open-sse/providers/registry/deepgram.js +33 -0
- package/open-sse/providers/registry/deepseek.js +51 -0
- package/open-sse/providers/registry/digitalocean.js +92 -0
- package/open-sse/providers/registry/edge-tts.js +24 -0
- package/open-sse/providers/registry/elevenlabs.js +35 -0
- package/open-sse/providers/registry/exa.js +50 -0
- package/open-sse/providers/registry/fal-ai.js +34 -0
- package/open-sse/providers/registry/featherless.js +34 -0
- package/open-sse/providers/registry/firecrawl.js +34 -0
- package/open-sse/providers/registry/fireworks.js +29 -0
- package/open-sse/providers/registry/gemini-cli.js +58 -0
- package/open-sse/providers/registry/gemini.js +83 -0
- package/open-sse/providers/registry/github.js +88 -0
- package/open-sse/providers/registry/gitlab.js +32 -0
- package/open-sse/providers/registry/glm-cn.js +35 -0
- package/open-sse/providers/registry/glm.js +58 -0
- package/open-sse/providers/registry/google-pse.js +35 -0
- package/open-sse/providers/registry/google-tts.js +24 -0
- package/open-sse/providers/registry/grok-cli.js +86 -0
- package/open-sse/providers/registry/grok-web.js +39 -0
- package/open-sse/providers/registry/groq.js +37 -0
- package/open-sse/providers/registry/huggingface.js +34 -0
- package/open-sse/providers/registry/hyperbolic.js +35 -0
- package/open-sse/providers/registry/ibm-bob.js +27 -0
- package/open-sse/providers/registry/iflow.js +52 -0
- package/open-sse/providers/registry/index.js +210 -0
- package/open-sse/providers/registry/inworld.js +36 -0
- package/open-sse/providers/registry/jina-ai.js +42 -0
- package/open-sse/providers/registry/jina-reader.js +34 -0
- package/open-sse/providers/registry/kilocode.js +51 -0
- package/open-sse/providers/registry/kimchi.js +49 -0
- package/open-sse/providers/registry/kimi-coding.js +65 -0
- package/open-sse/providers/registry/kimi.js +56 -0
- package/open-sse/providers/registry/kiro.js +115 -0
- package/open-sse/providers/registry/linkup.js +34 -0
- package/open-sse/providers/registry/local-device.js +24 -0
- package/open-sse/providers/registry/mimo-free.js +24 -0
- package/open-sse/providers/registry/minimax-cn.js +76 -0
- package/open-sse/providers/registry/minimax.js +83 -0
- package/open-sse/providers/registry/mistral.js +34 -0
- package/open-sse/providers/registry/mmf.js +19 -0
- package/open-sse/providers/registry/nanobanana.js +35 -0
- package/open-sse/providers/registry/nebius.js +27 -0
- package/open-sse/providers/registry/nvidia.js +43 -0
- package/open-sse/providers/registry/ollama-local.js +19 -0
- package/open-sse/providers/registry/ollama.js +36 -0
- package/open-sse/providers/registry/openai.js +84 -0
- package/open-sse/providers/registry/opencode-go.js +41 -0
- package/open-sse/providers/registry/opencode.js +25 -0
- package/open-sse/providers/registry/openrouter.js +60 -0
- package/open-sse/providers/registry/perplexity-agent.js +49 -0
- package/open-sse/providers/registry/perplexity-web.js +33 -0
- package/open-sse/providers/registry/perplexity.js +37 -0
- package/open-sse/providers/registry/playht.js +36 -0
- package/open-sse/providers/registry/qoder.js +54 -0
- package/open-sse/providers/registry/qwen.js +33 -0
- package/open-sse/providers/registry/recraft.js +24 -0
- package/open-sse/providers/registry/runwayml.js +30 -0
- package/open-sse/providers/registry/sdwebui.js +20 -0
- package/open-sse/providers/registry/searchapi.js +35 -0
- package/open-sse/providers/registry/searxng.js +35 -0
- package/open-sse/providers/registry/serper.js +35 -0
- package/open-sse/providers/registry/siliconflow.js +39 -0
- package/open-sse/providers/registry/stability-ai.js +31 -0
- package/open-sse/providers/registry/tavily.js +50 -0
- package/open-sse/providers/registry/together.js +31 -0
- package/open-sse/providers/registry/topaz.js +19 -0
- package/open-sse/providers/registry/tortoise.js +30 -0
- package/open-sse/providers/registry/venice.js +56 -0
- package/open-sse/providers/registry/vercel-ai-gateway.js +41 -0
- package/open-sse/providers/registry/vertex-partner.js +29 -0
- package/open-sse/providers/registry/vertex.js +32 -0
- package/open-sse/providers/registry/volcengine-ark.js +35 -0
- package/open-sse/providers/registry/voyage-ai.js +30 -0
- package/open-sse/providers/registry/xai.js +45 -0
- package/open-sse/providers/registry/xiaomi-mimo.js +46 -0
- package/open-sse/providers/registry/xiaomi-tokenplan.js +63 -0
- package/open-sse/providers/registry/youcom.js +35 -0
- package/open-sse/providers/schema.js +76 -0
- package/open-sse/providers/shared.js +74 -0
- package/open-sse/providers/thinkingLevels.js +48 -0
- package/open-sse/rtk/applyFilter.js +15 -0
- package/open-sse/rtk/autodetect.js +111 -0
- package/open-sse/rtk/caveman.js +100 -0
- package/open-sse/rtk/cavemanPrompts.js +78 -0
- package/open-sse/rtk/constants.js +55 -0
- package/open-sse/rtk/filters/buildOutput.js +127 -0
- package/open-sse/rtk/filters/dedupLog.js +44 -0
- package/open-sse/rtk/filters/find.js +50 -0
- package/open-sse/rtk/filters/gitDiff.js +92 -0
- package/open-sse/rtk/filters/gitLog.js +99 -0
- package/open-sse/rtk/filters/gitStatus.js +117 -0
- package/open-sse/rtk/filters/grep.js +48 -0
- package/open-sse/rtk/filters/ls.js +79 -0
- package/open-sse/rtk/filters/readNumbered.js +27 -0
- package/open-sse/rtk/filters/searchList.js +52 -0
- package/open-sse/rtk/filters/smartTruncate.js +15 -0
- package/open-sse/rtk/filters/tree.js +32 -0
- package/open-sse/rtk/headroom.js +215 -0
- package/open-sse/rtk/index.js +155 -0
- package/open-sse/rtk/paleo.js +47 -0
- package/open-sse/rtk/ponytail.js +9 -0
- package/open-sse/rtk/ponytailPrompt.js +52 -0
- package/open-sse/rtk/ponytailPrompts.js +76 -0
- package/open-sse/rtk/pxpipe.js +104 -0
- package/open-sse/rtk/registry.js +38 -0
- package/open-sse/rtk/systemInject.js +98 -0
- package/open-sse/services/accountFallback.js +323 -0
- package/open-sse/services/antigravityHeaders.js +91 -0
- package/open-sse/services/antigravityVersion.js +154 -0
- package/open-sse/services/clinepassModels.js +63 -0
- package/open-sse/services/codexQuotaFetcher.js +312 -0
- package/open-sse/services/codexVerbosity.js +30 -0
- package/open-sse/services/combo/context.js +12 -0
- package/open-sse/services/combo/fingerprintExpansion.js +51 -0
- package/open-sse/services/combo/headroomRanking.js +28 -0
- package/open-sse/services/combo/quotaExhaustionCutoff.js +87 -0
- package/open-sse/services/combo/quotaScoring.js +226 -0
- package/open-sse/services/combo/quotaShareConcurrency.js +25 -0
- package/open-sse/services/combo/quotaShareInflight.js +50 -0
- package/open-sse/services/combo/quotaShareStrategy.js +130 -0
- package/open-sse/services/combo/resolveAutoStrategy.js +231 -0
- package/open-sse/services/combo/responseValidation.js +140 -0
- package/open-sse/services/combo/runtimeUnits.js +195 -0
- package/open-sse/services/combo/sessionStickiness.js +128 -0
- package/open-sse/services/combo/shadowRouting.js +131 -0
- package/open-sse/services/combo/targetExhaustion.js +75 -0
- package/open-sse/services/combo/targetSorters.js +126 -0
- package/open-sse/services/combo/targetTimeoutRunner.js +65 -0
- package/open-sse/services/combo/validateQuality.js +271 -0
- package/open-sse/services/combo.js +571 -0
- package/open-sse/services/comboAgentMiddleware.js +91 -0
- package/open-sse/services/comboConfig.js +153 -0
- package/open-sse/services/comboManifestMetrics.js +10 -0
- package/open-sse/services/comboMetrics.js +278 -0
- package/open-sse/services/compact.js +71 -0
- package/open-sse/services/copilotModels.js +155 -0
- package/open-sse/services/emergencyFallback.js +109 -0
- package/open-sse/services/errorClassifier.js +190 -0
- package/open-sse/services/evalRouting.js +201 -0
- package/open-sse/services/freeWebSearch.js +4 -0
- package/open-sse/services/fusion.js +223 -0
- package/open-sse/services/intentClassifier.js +631 -0
- package/open-sse/services/kimchiModels.js +176 -0
- package/open-sse/services/kiroModels.js +332 -0
- package/open-sse/services/model.js +136 -0
- package/open-sse/services/modelCapabilities.js +5 -0
- package/open-sse/services/modelDeprecation.js +101 -0
- package/open-sse/services/modelFamilyFallback.js +166 -0
- package/open-sse/services/oauthCredentialManager.js +156 -0
- package/open-sse/services/pipeline.js +107 -0
- package/open-sse/services/projectId.js +306 -0
- package/open-sse/services/provider.js +169 -0
- package/open-sse/services/providerCooldownTracker.js +94 -0
- package/open-sse/services/providerDefaultRateLimit.js +11 -0
- package/open-sse/services/proxyAutoSelector.js +24 -0
- package/open-sse/services/qoderModels.js +214 -0
- package/open-sse/services/quotaFetchThrottle.js +103 -0
- package/open-sse/services/quotaMonitor.js +310 -0
- package/open-sse/services/quotaPreflight.js +266 -0
- package/open-sse/services/rateLimitManager/headers.js +56 -0
- package/open-sse/services/rateLimitManager.js +616 -0
- package/open-sse/services/rateLimitSemaphore.js +112 -0
- package/open-sse/services/responsesInputSanitizer.js +99 -0
- package/open-sse/services/slidingWindowLimiter.js +44 -0
- package/open-sse/services/streamRecovery.js +355 -0
- package/open-sse/services/taskAwareRouter.js +227 -0
- package/open-sse/services/taskAwareRouting.js +332 -0
- package/open-sse/services/thinkingBudget.js +247 -0
- package/open-sse/services/tokenRefresh/dedup.js +31 -0
- package/open-sse/services/tokenRefresh/providers.js +624 -0
- package/open-sse/services/tokenRefresh.js +254 -0
- package/open-sse/services/usage/claude.js +147 -0
- package/open-sse/services/usage/codebuddy-cn.js +138 -0
- package/open-sse/services/usage/codex.js +267 -0
- package/open-sse/services/usage/github.js +100 -0
- package/open-sse/services/usage/google.js +241 -0
- package/open-sse/services/usage/grok-cli.js +274 -0
- package/open-sse/services/usage/kiro.js +188 -0
- package/open-sse/services/usage/minimax.js +234 -0
- package/open-sse/services/usage/misc.js +288 -0
- package/open-sse/services/usage/shared.js +70 -0
- package/open-sse/services/usage.js +62 -0
- package/open-sse/services/usageDb.js +2 -0
- package/open-sse/services/webSearchRouting.js +25 -0
- package/open-sse/services/wildcardRouter.js +59 -0
- package/open-sse/shared/clineAuth.js +37 -0
- package/open-sse/shared/machineId.js +19 -0
- package/open-sse/shared/qoder/constants.js +64 -0
- package/open-sse/shared/qoder/cosy.js +175 -0
- package/open-sse/shared/qoder/encoding.js +55 -0
- package/open-sse/transformer/responsesTransformer.js +439 -0
- package/open-sse/transformer/streamToJsonConverter.js +103 -0
- package/open-sse/translator/concerns/chunk.js +11 -0
- package/open-sse/translator/concerns/finishReason.js +63 -0
- package/open-sse/translator/concerns/image.js +124 -0
- package/open-sse/translator/concerns/json.js +5 -0
- package/open-sse/translator/concerns/message.js +7 -0
- package/open-sse/translator/concerns/modality.js +155 -0
- package/open-sse/translator/concerns/paramSupport.js +75 -0
- package/open-sse/translator/concerns/prefetch.js +96 -0
- package/open-sse/translator/concerns/reasoning.js +24 -0
- package/open-sse/translator/concerns/thinking.js +53 -0
- package/open-sse/translator/concerns/thinkingUnified.js +329 -0
- package/open-sse/translator/concerns/toolCall.js +153 -0
- package/open-sse/translator/concerns/usage.js +69 -0
- package/open-sse/translator/formats/claude.js +368 -0
- package/open-sse/translator/formats/gemini.js +380 -0
- package/open-sse/translator/formats/maxTokens.js +34 -0
- package/open-sse/translator/formats/openai.js +134 -0
- package/open-sse/translator/formats/responsesApi.js +141 -0
- package/open-sse/translator/formats.js +36 -0
- package/open-sse/translator/helpers/claudeHelper.js +216 -0
- package/open-sse/translator/helpers/geminiHelper.js +372 -0
- package/open-sse/translator/helpers/imageHelper.js +34 -0
- package/open-sse/translator/helpers/maxTokensHelper.js +27 -0
- package/open-sse/translator/helpers/openaiHelper.js +130 -0
- package/open-sse/translator/helpers/responsesApiHelper.js +139 -0
- package/open-sse/translator/helpers/toolCallHelper.js +148 -0
- package/open-sse/translator/index.js +252 -0
- package/open-sse/translator/request/antigravity-to-openai.js +242 -0
- package/open-sse/translator/request/claude-to-kiro.js +478 -0
- package/open-sse/translator/request/claude-to-openai.js +263 -0
- package/open-sse/translator/request/gemini-to-openai.js +152 -0
- package/open-sse/translator/request/openai-responses.js +385 -0
- package/open-sse/translator/request/openai-to-claude.js +383 -0
- package/open-sse/translator/request/openai-to-commandcode.js +176 -0
- package/open-sse/translator/request/openai-to-cursor.js +185 -0
- package/open-sse/translator/request/openai-to-gemini.js +442 -0
- package/open-sse/translator/request/openai-to-kiro.js +607 -0
- package/open-sse/translator/request/openai-to-kiro.old.js +278 -0
- package/open-sse/translator/request/openai-to-ollama.js +195 -0
- package/open-sse/translator/request/openai-to-vertex.js +42 -0
- package/open-sse/translator/response/claude-to-openai.js +195 -0
- package/open-sse/translator/response/commandcode-to-openai.js +188 -0
- package/open-sse/translator/response/cursor-to-openai.js +30 -0
- package/open-sse/translator/response/gemini-to-openai.js +147 -0
- package/open-sse/translator/response/kiro-to-claude.js +261 -0
- package/open-sse/translator/response/kiro-to-openai.js +160 -0
- package/open-sse/translator/response/ollama-to-openai.js +134 -0
- package/open-sse/translator/response/openai-responses.js +535 -0
- package/open-sse/translator/response/openai-to-antigravity.js +123 -0
- package/open-sse/translator/response/openai-to-claude.js +265 -0
- package/open-sse/translator/schema/blocks.js +43 -0
- package/open-sse/translator/schema/defaults.js +7 -0
- package/open-sse/translator/schema/finishReasons.js +27 -0
- package/open-sse/translator/schema/index.js +8 -0
- package/open-sse/translator/schema/roles.js +16 -0
- package/open-sse/utils/agentGoalPolicy.js +85 -0
- package/open-sse/utils/aiSdkCompat.js +75 -0
- package/open-sse/utils/bypassHandler.js +298 -0
- package/open-sse/utils/cacheControlPolicy.js +189 -0
- package/open-sse/utils/claudeCloaking.js +155 -0
- package/open-sse/utils/claudeHeaderCache.js +70 -0
- package/open-sse/utils/claudeSignature.js +41 -0
- package/open-sse/utils/clientDetector.js +63 -0
- package/open-sse/utils/codebuddySanitizer.js +96 -0
- package/open-sse/utils/composerToolCalls.js +158 -0
- package/open-sse/utils/cors.js +13 -0
- package/open-sse/utils/cursorChecksum.js +149 -0
- package/open-sse/utils/cursorImages.js +224 -0
- package/open-sse/utils/cursorProtobuf.js +904 -0
- package/open-sse/utils/cursorVersionDetector.js +55 -0
- package/open-sse/utils/debugLog.js +14 -0
- package/open-sse/utils/diagnostics.js +143 -0
- package/open-sse/utils/error.js +164 -0
- package/open-sse/utils/estimateSize.js +33 -0
- package/open-sse/utils/finishReason.js +32 -0
- package/open-sse/utils/flattenToolHistory.js +68 -0
- package/open-sse/utils/headers.js +36 -0
- package/open-sse/utils/heapPressure.js +35 -0
- package/open-sse/utils/jsonToSse.js +125 -0
- package/open-sse/utils/keepaliveThreshold.js +40 -0
- package/open-sse/utils/logger.js +104 -0
- package/open-sse/utils/noThinkingAlias.js +74 -0
- package/open-sse/utils/number.js +7 -0
- package/open-sse/utils/ollamaTransform.js +85 -0
- package/open-sse/utils/opencodeHeaders.js +47 -0
- package/open-sse/utils/progressTracker.js +81 -0
- package/open-sse/utils/providerRequestLogging.js +219 -0
- package/open-sse/utils/proxyFetch.js +369 -0
- package/open-sse/utils/reasoningContentInjector.js +79 -0
- package/open-sse/utils/reasoningFields.js +70 -0
- package/open-sse/utils/requestLogger.js +260 -0
- package/open-sse/utils/responsesInputNormalization.js +92 -0
- package/open-sse/utils/responsesStatePolicy.js +52 -0
- package/open-sse/utils/responsesStreamHelpers.js +49 -0
- package/open-sse/utils/sessionManager.js +240 -0
- package/open-sse/utils/sleep.js +6 -0
- package/open-sse/utils/sse.js +14 -0
- package/open-sse/utils/sseConstants.js +23 -0
- package/open-sse/utils/sseHeartbeat.js +104 -0
- package/open-sse/utils/stream.js +517 -0
- package/open-sse/utils/streamFailureFinalization.js +134 -0
- package/open-sse/utils/streamHandler.js +250 -0
- package/open-sse/utils/streamHelpers.js +137 -0
- package/open-sse/utils/textualToolCall.js +104 -0
- package/open-sse/utils/thinkCloseMarker.js +72 -0
- package/open-sse/utils/thinkTagParser.js +146 -0
- package/open-sse/utils/toolCallArguments.js +12 -0
- package/open-sse/utils/toolDeduper.js +49 -0
- package/open-sse/utils/toolSources.js +31 -0
- package/open-sse/utils/upstreamResponseHeaders.js +25 -0
- package/open-sse/utils/urlSanitize.js +15 -0
- package/open-sse/utils/usageTracking.js +347 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: "tortoise",
|
|
3
|
+
alias: "tortoise",
|
|
4
|
+
display: {
|
|
5
|
+
name: "Tortoise TTS",
|
|
6
|
+
icon: "record_voice_over",
|
|
7
|
+
color: "#7C3AED",
|
|
8
|
+
textIcon: "TT",
|
|
9
|
+
website: "https://github.com/neonbjb/tortoise-tts"
|
|
10
|
+
},
|
|
11
|
+
category: "freeTier",
|
|
12
|
+
authType: "none",
|
|
13
|
+
serviceKinds: [
|
|
14
|
+
"tts"
|
|
15
|
+
],
|
|
16
|
+
noAuth: true,
|
|
17
|
+
ttsConfig: {
|
|
18
|
+
baseUrl: "http://localhost:5000/api/tts",
|
|
19
|
+
authType: "none",
|
|
20
|
+
authHeader: "none",
|
|
21
|
+
format: "tortoise",
|
|
22
|
+
models: [
|
|
23
|
+
{
|
|
24
|
+
id: "tortoise-v2",
|
|
25
|
+
name: "Tortoise v2"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
hidden: true
|
|
30
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: "venice",
|
|
3
|
+
priority: 115,
|
|
4
|
+
alias: "venice",
|
|
5
|
+
aliases: [
|
|
6
|
+
"vn",
|
|
7
|
+
],
|
|
8
|
+
uiAlias: "venice",
|
|
9
|
+
display: {
|
|
10
|
+
name: "Venice AI",
|
|
11
|
+
icon: "shield",
|
|
12
|
+
color: "#DC2626",
|
|
13
|
+
textIcon: "VE",
|
|
14
|
+
website: "https://venice.ai",
|
|
15
|
+
notice: {
|
|
16
|
+
text: "OpenAI-compatible. Private inference + uncensored models (Venice Uncensored, GLM, Qwen, DeepSeek, Llama).",
|
|
17
|
+
apiKeyUrl: "https://venice.ai/settings/api",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
category: "apikey",
|
|
21
|
+
transport: {
|
|
22
|
+
baseUrl: "https://api.venice.ai/api/v1/chat/completions",
|
|
23
|
+
validateUrl: "https://api.venice.ai/api/v1/models",
|
|
24
|
+
thinkingFormat: "openai",
|
|
25
|
+
},
|
|
26
|
+
// Curated seed; the full live catalogue (90+ text models) is fetched via
|
|
27
|
+
// modelsFetcher and any other id is accepted via passthroughModels.
|
|
28
|
+
models: [
|
|
29
|
+
{ id: "venice-uncensored-1-2", name: "Venice Uncensored 1.2" },
|
|
30
|
+
{ id: "zai-org-glm-5", name: "GLM-5" },
|
|
31
|
+
{ id: "qwen3-235b-a22b-instruct-2507", name: "Qwen3 235B A22B Instruct" },
|
|
32
|
+
{ id: "qwen3-coder-480b-a35b-instruct-turbo", name: "Qwen3 Coder 480B A35B Turbo" },
|
|
33
|
+
{ id: "qwen3-vl-235b-a22b", name: "Qwen3 VL 235B A22B" },
|
|
34
|
+
{ id: "deepseek-v4-pro", name: "DeepSeek V4 Pro" },
|
|
35
|
+
{ id: "llama-3.3-70b", name: "Llama 3.3 70B" },
|
|
36
|
+
{ id: "hermes-3-llama-3.1-405b", name: "Hermes 3 Llama 3.1 405B" },
|
|
37
|
+
{ id: "mistral-small-3-2-24b-instruct", name: "Mistral Small 3.2 24B" },
|
|
38
|
+
{ id: "text-embedding-3-large", name: "Text Embedding 3 Large", kind: "embedding" },
|
|
39
|
+
{ id: "text-embedding-bge-m3", name: "BGE-M3 Embedding", kind: "embedding" },
|
|
40
|
+
{ id: "text-embedding-qwen3-8b", name: "Qwen3 8B Embedding", kind: "embedding" },
|
|
41
|
+
{ id: "venice-sd35", name: "Venice SD3.5", params: ["n", "size"], kind: "image" },
|
|
42
|
+
{ id: "flux-2-pro", name: "FLUX.2 Pro", params: ["n", "size"], kind: "image" },
|
|
43
|
+
{ id: "gpt-image-2", name: "GPT Image 2 (via Venice)", params: ["n", "size", "quality"], kind: "image" },
|
|
44
|
+
],
|
|
45
|
+
serviceKinds: ["llm", "embedding", "image"],
|
|
46
|
+
embeddingConfig: {
|
|
47
|
+
baseUrl: "https://api.venice.ai/api/v1/embeddings",
|
|
48
|
+
authType: "apikey",
|
|
49
|
+
authHeader: "bearer",
|
|
50
|
+
},
|
|
51
|
+
imageConfig: {
|
|
52
|
+
baseUrl: "https://api.venice.ai/api/v1/images/generations",
|
|
53
|
+
},
|
|
54
|
+
modelsFetcher: { url: "https://api.venice.ai/api/v1/models", type: "openai" },
|
|
55
|
+
passthroughModels: true,
|
|
56
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: "vercel-ai-gateway",
|
|
3
|
+
priority: 160,
|
|
4
|
+
alias: "vercel-ai-gateway",
|
|
5
|
+
aliases: [
|
|
6
|
+
"vercel",
|
|
7
|
+
],
|
|
8
|
+
uiAlias: "vercel",
|
|
9
|
+
display: {
|
|
10
|
+
name: "Vercel AI Gateway",
|
|
11
|
+
icon: "deployed_code",
|
|
12
|
+
color: "#111827",
|
|
13
|
+
textIcon: "VG",
|
|
14
|
+
website: "https://vercel.com/ai-gateway",
|
|
15
|
+
notice: {
|
|
16
|
+
text: "Unified OpenAI-compatible endpoint from Vercel. Use your AI Gateway API key, then pick models with provider/model IDs like anthropic/claude-sonnet-4.6 or openai/gpt-5.4.",
|
|
17
|
+
apiKeyUrl: "https://vercel.com/dashboard/~/ai-gateway",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
category: "apikey",
|
|
21
|
+
transport: {
|
|
22
|
+
baseUrl: "https://ai-gateway.vercel.sh/v1/chat/completions",
|
|
23
|
+
thinkingFormat: "openai",
|
|
24
|
+
retry: {
|
|
25
|
+
"429": 2,
|
|
26
|
+
},
|
|
27
|
+
usage: {
|
|
28
|
+
url: "https://ai-gateway.vercel.sh/v1/credits",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
serviceKinds: ["llm","embedding","image","imageToText","webSearch"],
|
|
32
|
+
embeddingConfig: { baseUrl: "https://ai-gateway.vercel.sh/v1/embeddings" },
|
|
33
|
+
imageConfig: { baseUrl: "https://ai-gateway.vercel.sh/v1/images/generations" },
|
|
34
|
+
searchViaChat: { defaultModel: "openai/gpt-4o-mini", pricingUrl: "https://vercel.com/docs/ai-gateway/pricing" },
|
|
35
|
+
modelsFetcher: { url: "https://ai-gateway.vercel.sh/v1/models", type: "openai" },
|
|
36
|
+
passthroughModels: true,
|
|
37
|
+
features: {
|
|
38
|
+
usage: true,
|
|
39
|
+
usageApikey: true,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: "vertex-partner",
|
|
3
|
+
priority: 260,
|
|
4
|
+
alias: "vertex-partner",
|
|
5
|
+
aliases: [
|
|
6
|
+
"vxp",
|
|
7
|
+
],
|
|
8
|
+
uiAlias: "vxp",
|
|
9
|
+
display: {
|
|
10
|
+
name: "Vertex Partner",
|
|
11
|
+
icon: "cloud",
|
|
12
|
+
color: "#34A853",
|
|
13
|
+
textIcon: "VP",
|
|
14
|
+
website: "https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models",
|
|
15
|
+
notice: {
|
|
16
|
+
apiKeyUrl: "https://console.cloud.google.com/iam-admin/serviceaccounts",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
category: "apikey",
|
|
20
|
+
transport: {
|
|
21
|
+
baseUrl: "https://aiplatform.googleapis.com",
|
|
22
|
+
},
|
|
23
|
+
models: [
|
|
24
|
+
{ id: "deepseek-ai/deepseek-v3.2-maas", name: "DeepSeek V3.2 (Vertex)" },
|
|
25
|
+
{ id: "qwen/qwen3-next-80b-a3b-thinking-maas", name: "Qwen3 Next 80B Thinking (Vertex)" },
|
|
26
|
+
{ id: "qwen/qwen3-next-80b-a3b-instruct-maas", name: "Qwen3 Next 80B Instruct (Vertex)" },
|
|
27
|
+
{ id: "zai-org/glm-5-maas", name: "GLM-5 (Vertex)" },
|
|
28
|
+
],
|
|
29
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: "vertex",
|
|
3
|
+
priority: 40,
|
|
4
|
+
alias: "vertex",
|
|
5
|
+
aliases: [
|
|
6
|
+
"vx",
|
|
7
|
+
],
|
|
8
|
+
uiAlias: "vx",
|
|
9
|
+
display: {
|
|
10
|
+
name: "Vertex AI",
|
|
11
|
+
icon: "cloud",
|
|
12
|
+
color: "#4285F4",
|
|
13
|
+
textIcon: "VX",
|
|
14
|
+
website: "https://cloud.google.com/vertex-ai",
|
|
15
|
+
notice: {
|
|
16
|
+
text: "New Google Cloud accounts get $300 free credits. Requires GCP project + Service Account with Vertex AI API enabled.",
|
|
17
|
+
apiKeyUrl: "https://console.cloud.google.com/iam-admin/serviceaccounts",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
category: "freeTier",
|
|
21
|
+
transport: {
|
|
22
|
+
baseUrl: "https://aiplatform.googleapis.com",
|
|
23
|
+
format: "vertex",
|
|
24
|
+
},
|
|
25
|
+
models: [
|
|
26
|
+
{ id: "gemini-3.1-pro-preview", name: "Gemini 3.1 Pro Preview" },
|
|
27
|
+
{ id: "gemini-3.1-flash-lite-preview", name: "Gemini 3.1 Flash Lite Preview" },
|
|
28
|
+
{ id: "gemini-3-flash-preview", name: "Gemini 3 Flash Preview" },
|
|
29
|
+
{ id: "gemini-2.5-flash", name: "Gemini 2.5 Flash" },
|
|
30
|
+
],
|
|
31
|
+
serviceKinds: ["llm","imageToText"],
|
|
32
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: "volcengine-ark",
|
|
3
|
+
priority: 270,
|
|
4
|
+
alias: "volcengine-ark",
|
|
5
|
+
aliases: [
|
|
6
|
+
"ark",
|
|
7
|
+
],
|
|
8
|
+
uiAlias: "ark",
|
|
9
|
+
display: {
|
|
10
|
+
name: "Volcengine Ark",
|
|
11
|
+
icon: "cloud",
|
|
12
|
+
color: "#1677FF",
|
|
13
|
+
textIcon: "ARK",
|
|
14
|
+
website: "https://ark.cn-beijing.volces.com",
|
|
15
|
+
notice: {
|
|
16
|
+
apiKeyUrl: "https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
category: "apikey",
|
|
20
|
+
transport: {
|
|
21
|
+
baseUrl: "https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",
|
|
22
|
+
headers: {},
|
|
23
|
+
},
|
|
24
|
+
models: [
|
|
25
|
+
{ id: "Doubao-Seed-2.0-Code", name: "Doubao-Seed-2.0-Code" },
|
|
26
|
+
{ id: "Doubao-Seed-2.0-pro", name: "Doubao-Seed-2.0-pro" },
|
|
27
|
+
{ id: "Doubao-Seed-2.0-lite", name: "Doubao-Seed-2.0-lite" },
|
|
28
|
+
{ id: "Doubao-Seed-Code", name: "Doubao-Seed-Code" },
|
|
29
|
+
{ id: "DeepSeek-V4-Flash", name: "DeepSeek-V4-Flash" },
|
|
30
|
+
{ id: "DeepSeek-V4-Pro", name: "DeepSeek-V4-Pro" },
|
|
31
|
+
{ id: "GLM-5.1", name: "GLM-5.1" },
|
|
32
|
+
{ id: "MiniMax-M2.7", name: "MiniMax-M2.7" },
|
|
33
|
+
{ id: "Kimi-K2.6", name: "Kimi-K2.6" },
|
|
34
|
+
],
|
|
35
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: "voyage-ai",
|
|
3
|
+
priority: 40,
|
|
4
|
+
alias: "voyage-ai",
|
|
5
|
+
uiAlias: "voyage",
|
|
6
|
+
display: {
|
|
7
|
+
name: "Voyage AI",
|
|
8
|
+
icon: "data_array",
|
|
9
|
+
color: "#0EA5E9",
|
|
10
|
+
textIcon: "VG",
|
|
11
|
+
website: "https://www.voyageai.com",
|
|
12
|
+
notice: {
|
|
13
|
+
apiKeyUrl: "https://dash.voyageai.com/api-keys",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
category: "apikey",
|
|
17
|
+
authType: "apikey",
|
|
18
|
+
transport: null,
|
|
19
|
+
models: [
|
|
20
|
+
{ id: "voyage-3-large", name: "Voyage 3 Large", kind: "embedding" },
|
|
21
|
+
{ id: "voyage-3.5", name: "Voyage 3.5", kind: "embedding" },
|
|
22
|
+
{ id: "voyage-3.5-lite", name: "Voyage 3.5 Lite", kind: "embedding" },
|
|
23
|
+
{ id: "voyage-code-3", name: "Voyage Code 3", kind: "embedding" },
|
|
24
|
+
{ id: "voyage-finance-2", name: "Voyage Finance 2", kind: "embedding" },
|
|
25
|
+
{ id: "voyage-law-2", name: "Voyage Law 2", kind: "embedding" },
|
|
26
|
+
{ id: "voyage-multilingual-2", name: "Voyage Multilingual 2", kind: "embedding" },
|
|
27
|
+
],
|
|
28
|
+
serviceKinds: ["embedding"],
|
|
29
|
+
embeddingConfig: { baseUrl: "https://api.voyageai.com/v1/embeddings" },
|
|
30
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: "xai",
|
|
3
|
+
priority: 280,
|
|
4
|
+
alias: "xai",
|
|
5
|
+
display: {
|
|
6
|
+
name: "xAI (Grok)",
|
|
7
|
+
icon: "auto_awesome",
|
|
8
|
+
color: "#1DA1F2",
|
|
9
|
+
textIcon: "XA",
|
|
10
|
+
website: "https://x.ai",
|
|
11
|
+
notice: {
|
|
12
|
+
apiKeyUrl: "https://console.x.ai",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
category: "oauth",
|
|
16
|
+
authModes: [
|
|
17
|
+
"oauth",
|
|
18
|
+
"apikey",
|
|
19
|
+
],
|
|
20
|
+
hasOAuth: true,
|
|
21
|
+
transport: {
|
|
22
|
+
baseUrl: "https://api.x.ai/v1/chat/completions",
|
|
23
|
+
validateUrl: "https://api.x.ai/v1/models",
|
|
24
|
+
responsesUrl: "https://api.x.ai/v1/responses",
|
|
25
|
+
clientId: "b1a00492-073a-47ea-816f-4c329264a828",
|
|
26
|
+
tokenUrl: "https://auth.x.ai/oauth2/token",
|
|
27
|
+
refreshUrl: "https://auth.x.ai/oauth2/token",
|
|
28
|
+
},
|
|
29
|
+
models: [
|
|
30
|
+
{ id: "grok-4", name: "Grok 4" },
|
|
31
|
+
{ id: "grok-4.3", name: "Grok 4.3" },
|
|
32
|
+
{ id: "grok-build-0.1", name: "Grok Build 0.1" },
|
|
33
|
+
{ id: "grok-4-fast-reasoning", name: "Grok 4 Fast Reasoning" },
|
|
34
|
+
{ id: "grok-code-fast-1", name: "Grok Code Fast" },
|
|
35
|
+
{ id: "grok-3", name: "Grok 3" },
|
|
36
|
+
{ id: "grok-2-image-1212", name: "Grok 2 Image", params: ["n","response_format"], kind: "image" },
|
|
37
|
+
],
|
|
38
|
+
serviceKinds: ["llm","imageToText","webSearch","image"],
|
|
39
|
+
imageConfig: { baseUrl: "https://api.x.ai/v1/images/generations", bodyFields: ["model","prompt","n","response_format"] },
|
|
40
|
+
searchViaChat: {
|
|
41
|
+
defaultModel: "grok-4.20-reasoning",
|
|
42
|
+
endpoint: "https://api.x.ai/v1/responses",
|
|
43
|
+
pricingUrl: "https://x.ai/api#pricing",
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CLAUDE_API_HEADERS } from "../shared.js";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
id: "xiaomi-mimo",
|
|
5
|
+
priority: 290,
|
|
6
|
+
alias: "xiaomi-mimo",
|
|
7
|
+
aliases: [
|
|
8
|
+
"mimo",
|
|
9
|
+
],
|
|
10
|
+
uiAlias: "mimo",
|
|
11
|
+
display: {
|
|
12
|
+
name: "Xiaomi MiMo",
|
|
13
|
+
icon: "smart_toy",
|
|
14
|
+
color: "#FF6900",
|
|
15
|
+
textIcon: "XM",
|
|
16
|
+
website: "https://xiaomimimo.com",
|
|
17
|
+
notice: {
|
|
18
|
+
apiKeyUrl: "https://xiaomimimo.com",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
category: "apikey",
|
|
22
|
+
transport: {
|
|
23
|
+
baseUrl: "https://api.xiaomimimo.com/v1/chat/completions",
|
|
24
|
+
validateUrl: "https://api.xiaomimimo.com/v1/models",
|
|
25
|
+
},
|
|
26
|
+
// Multi-endpoint: pick the transport matching client sourceFormat to skip translation.
|
|
27
|
+
transports: [
|
|
28
|
+
{
|
|
29
|
+
format: "openai",
|
|
30
|
+
baseUrl: "https://api.xiaomimimo.com/v1/chat/completions",
|
|
31
|
+
auth: { combined: true, header: "Authorization", scheme: "bearer" },
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
format: "claude",
|
|
35
|
+
baseUrl: "https://api.xiaomimimo.com/anthropic/v1/messages",
|
|
36
|
+
headers: { ...CLAUDE_API_HEADERS },
|
|
37
|
+
auth: { combined: true, header: "x-api-key", scheme: "raw" },
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
models: [
|
|
41
|
+
{ id: "mimo-v2.5-pro", name: "MiMo V2.5 Pro" },
|
|
42
|
+
{ id: "mimo-v2.5", name: "MiMo V2.5" },
|
|
43
|
+
{ id: "mimo-v2-omni", name: "MiMo V2 Omni" },
|
|
44
|
+
{ id: "mimo-v2-flash", name: "MiMo V2 Flash" },
|
|
45
|
+
],
|
|
46
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { CLAUDE_API_HEADERS } from "../shared.js";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
id: "xiaomi-tokenplan",
|
|
5
|
+
priority: 300,
|
|
6
|
+
alias: "xiaomi-tokenplan",
|
|
7
|
+
aliases: [
|
|
8
|
+
"xmtp",
|
|
9
|
+
],
|
|
10
|
+
uiAlias: "xmtp",
|
|
11
|
+
display: {
|
|
12
|
+
name: "Xiaomi MiMo (Token Plan)",
|
|
13
|
+
icon: "smart_toy",
|
|
14
|
+
color: "#FF6700",
|
|
15
|
+
textIcon: "XT",
|
|
16
|
+
website: "https://mimo.xiaomi.com",
|
|
17
|
+
notice: {
|
|
18
|
+
text: "Xiaomi MiMo Token Plan subscription (API key starts with tp-). Token Plan keys are cluster-specific — select the region matching your subscription.",
|
|
19
|
+
apiKeyUrl: "https://mimo.xiaomi.com",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
category: "apikey",
|
|
23
|
+
hasProviderSpecificData: true,
|
|
24
|
+
regions: [
|
|
25
|
+
{ id: "sgp", label: "Singapore (新加坡)" },
|
|
26
|
+
{ id: "cn", label: "China (中国大陆)" },
|
|
27
|
+
{ id: "ams", label: "Amsterdam (阿姆斯特丹)" },
|
|
28
|
+
],
|
|
29
|
+
defaultRegion: "sgp",
|
|
30
|
+
transport: {
|
|
31
|
+
baseUrl: "https://token-plan-sgp.xiaomimimo.com/v1/chat/completions",
|
|
32
|
+
regions: {
|
|
33
|
+
sgp: "https://token-plan-sgp.xiaomimimo.com/v1",
|
|
34
|
+
cn: "https://token-plan-cn.xiaomimimo.com/v1",
|
|
35
|
+
ams: "https://token-plan-ams.xiaomimimo.com/v1",
|
|
36
|
+
},
|
|
37
|
+
defaultRegion: "sgp",
|
|
38
|
+
},
|
|
39
|
+
// Multi-endpoint: pick the transport matching client sourceFormat to skip translation.
|
|
40
|
+
// baseUrl omitted — region-dynamic, resolved in the executor's buildUrl.
|
|
41
|
+
transports: [
|
|
42
|
+
{
|
|
43
|
+
format: "openai",
|
|
44
|
+
auth: { combined: true, header: "Authorization", scheme: "bearer" },
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
format: "claude",
|
|
48
|
+
headers: { ...CLAUDE_API_HEADERS },
|
|
49
|
+
auth: { combined: true, header: "x-api-key", scheme: "raw" },
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
models: [
|
|
53
|
+
{ id: "mimo-v2.5-pro", name: "MiMo V2.5 Pro" },
|
|
54
|
+
{ id: "mimo-v2.5-pro-claude", name: "MiMo V2.5 Pro (Claude Native)", targetFormat: "claude", upstreamModelId: "mimo-v2.5-pro" },
|
|
55
|
+
{ id: "mimo-v2.5", name: "MiMo V2.5" },
|
|
56
|
+
{ id: "mimo-v2-pro", name: "MiMo V2 Pro" },
|
|
57
|
+
{ id: "mimo-v2-omni", name: "MiMo V2 Omni" },
|
|
58
|
+
{ id: "mimo-v2-tts", name: "MiMo V2 TTS" },
|
|
59
|
+
{ id: "mimo-v2.5-tts", name: "MiMo V2.5 TTS" },
|
|
60
|
+
{ id: "mimo-v2.5-tts-voiceclone", name: "MiMo V2.5 TTS Voice Clone" },
|
|
61
|
+
{ id: "mimo-v2.5-tts-voicedesign", name: "MiMo V2.5 TTS Voice Design" },
|
|
62
|
+
],
|
|
63
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: "youcom",
|
|
3
|
+
alias: "youcom",
|
|
4
|
+
display: {
|
|
5
|
+
name: "You.com Search",
|
|
6
|
+
icon: "search",
|
|
7
|
+
color: "#7C3AED",
|
|
8
|
+
textIcon: "YC",
|
|
9
|
+
website: "https://you.com",
|
|
10
|
+
notice: {
|
|
11
|
+
apiKeyUrl: "https://api.you.com"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
category: "apikey",
|
|
15
|
+
authType: "apikey",
|
|
16
|
+
serviceKinds: [
|
|
17
|
+
"webSearch"
|
|
18
|
+
],
|
|
19
|
+
searchConfig: {
|
|
20
|
+
baseUrl: "https://ydc-index.io/v1/search",
|
|
21
|
+
method: "GET",
|
|
22
|
+
authType: "apikey",
|
|
23
|
+
authHeader: "x-api-key",
|
|
24
|
+
costPerQuery: 0.005,
|
|
25
|
+
freeMonthlyQuota: 0,
|
|
26
|
+
searchTypes: [
|
|
27
|
+
"web",
|
|
28
|
+
"news"
|
|
29
|
+
],
|
|
30
|
+
defaultMaxResults: 5,
|
|
31
|
+
maxMaxResults: 100,
|
|
32
|
+
timeoutMs: 10000,
|
|
33
|
+
cacheTTLMs: 300000
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Provider transport schema: shared defaults + endpoint defaults + resolver (skeleton, not wired)
|
|
2
|
+
import { DEFAULT_RETRY_CONFIG, FETCH_CONNECT_TIMEOUT_MS } from "../config/runtimeConfig.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* RegistryEntry shape — full contract for registry/{id}.js. See REGISTRY_TEMPLATE.js for a worked example.
|
|
6
|
+
* Only `id` + `category` are strictly required; everything else is optional/derived.
|
|
7
|
+
*
|
|
8
|
+
* @typedef {Object} RegistryEntry
|
|
9
|
+
* @property {string} id Unique provider id (kebab-case). REQUIRED.
|
|
10
|
+
* @property {string} [alias] Short key for PROVIDER_MODELS (defaults to id).
|
|
11
|
+
* @property {string[]}[aliases] Extra lookup tokens resolving to this provider.
|
|
12
|
+
* @property {string} [uiAlias] Token shown in UI badges.
|
|
13
|
+
* @property {string} category "apikey"|"oauth"|"freeTier"|... drives UI grouping. REQUIRED.
|
|
14
|
+
* @property {string} [authType] "apikey"|"oauth" auth hint.
|
|
15
|
+
* @property {string[]}[authModes] Allowed auth modes when provider supports both.
|
|
16
|
+
* @property {boolean} [hasOAuth] Provider exposes an OAuth flow.
|
|
17
|
+
* @property {boolean} [noAuth] Provider needs no credentials (local/free).
|
|
18
|
+
* @property {Object} [display] UI: {name,icon,color,textIcon,website,notice,deprecated,deprecationNotice,kindNotice,mediaPriority}.
|
|
19
|
+
* @property {Object} [transport] Runtime HTTP config (see TransportConfig below). Builds PROVIDERS[id].
|
|
20
|
+
* @property {Object} [oauth] OAuth flow config (see OAuthConfig). Builds PROVIDER_OAUTH[id].
|
|
21
|
+
* @property {Object} [media] Non-LLM services (see MediaConfig). Builds PROVIDER_MEDIA[id].
|
|
22
|
+
* @property {Array} [models] Model list; omit = no model key, [] = explicit empty.
|
|
23
|
+
* @property {Object} [features] Feature flags, e.g. {usage:true}.
|
|
24
|
+
* @property {Object} [thinkingConfig] Reasoning UI: {options:[...],defaultMode}.
|
|
25
|
+
* @property {boolean} [passthroughModels] Forward client model id untouched.
|
|
26
|
+
*
|
|
27
|
+
* TransportConfig: { baseUrl, format, headers, auth, forceStream, urlSuffix, quirks, retry, timeoutMs,
|
|
28
|
+
* executor, clientId, clientSecret, tokenUrl, refreshUrl, usage, cliVersion, apiClient, regions,
|
|
29
|
+
* defaultRegion, modelsFetcher, validateUrl, responsesUrl } — clientId/clientSecret/tokenUrl are
|
|
30
|
+
* injected from `oauth` automatically (single source); declare them in `oauth`, not here.
|
|
31
|
+
*
|
|
32
|
+
* OAuthConfig: { clientId, authorizeUrl, tokenUrl, deviceCodeUrl, refreshUrl, scope|scopes, redirectUri,
|
|
33
|
+
* callbackPath, fixedPort, codeChallengeMethod, extraParams, refresh:{encoding,scope}, refreshLeadMs,
|
|
34
|
+
* userInfoUrl }.
|
|
35
|
+
*
|
|
36
|
+
* MediaConfig: { serviceKinds:[...], ttsConfig, sttConfig, embeddingConfig, imageConfig,
|
|
37
|
+
* searchViaChat:{defaultModel,pricingUrl}, hiddenKinds } — each *Config: {baseUrl,authType,authHeader,
|
|
38
|
+
* format,defaultModel,models:[{id,name,dimensions?}]}.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
// Shared transport defaults — provider only overrides fields that differ.
|
|
42
|
+
// NOTE: runtime (index.js buildTransport) only re-applies `format`; the rest documents the contract
|
|
43
|
+
// and feeds the (currently unwired) resolveProvider(). Adding keys here does NOT change PROVIDERS.
|
|
44
|
+
export const PROVIDER_DEFAULTS = {
|
|
45
|
+
baseUrl: "",
|
|
46
|
+
format: "openai",
|
|
47
|
+
headers: {},
|
|
48
|
+
auth: { header: "Authorization", scheme: "bearer", source: ["accessToken", "apiKey"] },
|
|
49
|
+
forceStream: false,
|
|
50
|
+
urlSuffix: "",
|
|
51
|
+
quirks: {},
|
|
52
|
+
passthroughModels: false,
|
|
53
|
+
retry: DEFAULT_RETRY_CONFIG,
|
|
54
|
+
timeoutMs: FETCH_CONNECT_TIMEOUT_MS,
|
|
55
|
+
executor: "default"
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Default endpoints per format (provider only overrides what differs)
|
|
59
|
+
export const ENDPOINT_DEFAULTS = {
|
|
60
|
+
openai: { chat: "/chat/completions", test: "/models", models: "/models" },
|
|
61
|
+
claude: { chat: "/messages", test: "/models", countTokens: "/messages/count_tokens" },
|
|
62
|
+
gemini: { chat: "/{model}:streamGenerateContent", models: "/models", test: "/models" }
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Deep-merge a provider entry over PROVIDER_DEFAULTS (defensive for missing transport)
|
|
66
|
+
export function resolveProvider(entry) {
|
|
67
|
+
const transport = (entry && entry.transport) || {};
|
|
68
|
+
return {
|
|
69
|
+
...PROVIDER_DEFAULTS,
|
|
70
|
+
...transport,
|
|
71
|
+
headers: { ...PROVIDER_DEFAULTS.headers, ...transport.headers },
|
|
72
|
+
auth: { ...PROVIDER_DEFAULTS.auth, ...transport.auth },
|
|
73
|
+
quirks: { ...PROVIDER_DEFAULTS.quirks, ...transport.quirks },
|
|
74
|
+
retry: { ...PROVIDER_DEFAULTS.retry, ...transport.retry }
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { platform, arch } from "os";
|
|
2
|
+
|
|
3
|
+
// === OS/Arch helpers (Stainless fingerprint) ===
|
|
4
|
+
export function mapStainlessOs() {
|
|
5
|
+
switch (platform()) {
|
|
6
|
+
case "darwin": return "MacOS";
|
|
7
|
+
case "win32": return "Windows";
|
|
8
|
+
case "linux": return "Linux";
|
|
9
|
+
case "freebsd": return "FreeBSD";
|
|
10
|
+
default: return `Other::${platform()}`;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function mapStainlessArch() {
|
|
15
|
+
switch (arch()) {
|
|
16
|
+
case "x64": return "x64";
|
|
17
|
+
case "arm64": return "arm64";
|
|
18
|
+
case "ia32": return "x86";
|
|
19
|
+
default: return `other::${arch()}`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Anthropic API version (single source — reused across claude-format providers/executors)
|
|
24
|
+
export const ANTHROPIC_API_VERSION = "2023-06-01";
|
|
25
|
+
|
|
26
|
+
// Shared Claude-compatible API headers (reused across claude-format providers)
|
|
27
|
+
export const CLAUDE_API_HEADERS = {
|
|
28
|
+
"Anthropic-Version": ANTHROPIC_API_VERSION,
|
|
29
|
+
"Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14"
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// Full Claude CLI fingerprint — required by providers that gate on client identity (e.g. agentrouter)
|
|
33
|
+
export const CLAUDE_CLI_SPOOF_HEADERS = {
|
|
34
|
+
"Anthropic-Version": ANTHROPIC_API_VERSION,
|
|
35
|
+
"Anthropic-Beta": "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advanced-tool-use-2025-11-20,effort-2025-11-24,structured-outputs-2025-12-15,fast-mode-2026-02-01,redact-thinking-2026-02-12,token-efficient-tools-2026-03-28",
|
|
36
|
+
"Anthropic-Dangerous-Direct-Browser-Access": "true",
|
|
37
|
+
"User-Agent": "claude-cli/2.1.92 (external, sdk-cli)",
|
|
38
|
+
"X-App": "cli",
|
|
39
|
+
"X-Stainless-Helper-Method": "stream",
|
|
40
|
+
"X-Stainless-Retry-Count": "0",
|
|
41
|
+
"X-Stainless-Runtime-Version": "v24.14.0",
|
|
42
|
+
"X-Stainless-Package-Version": "0.80.0",
|
|
43
|
+
"X-Stainless-Runtime": "node",
|
|
44
|
+
"X-Stainless-Lang": "js",
|
|
45
|
+
"X-Stainless-Arch": mapStainlessArch(),
|
|
46
|
+
"X-Stainless-Os": mapStainlessOs(),
|
|
47
|
+
"X-Stainless-Timeout": "600"
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Shared baseUrls
|
|
51
|
+
export const KIMI_CODING_BASE_URL = "https://api.kimi.com/coding/v1/messages";
|
|
52
|
+
|
|
53
|
+
// Default base for dynamic compat providers (openai-compatible-* / anthropic-compatible-*) when user gives no baseUrl
|
|
54
|
+
export const OPENAI_COMPAT_BASE = "https://api.openai.com/v1";
|
|
55
|
+
export const ANTHROPIC_COMPAT_BASE = "https://api.anthropic.com/v1";
|
|
56
|
+
|
|
57
|
+
// Official Antigravity IDE Desktop 2.1.1 fingerprint captured from macOS arm64.
|
|
58
|
+
// Keep this static even when 9router runs on Linux: the provider profile is
|
|
59
|
+
// intentionally matching the IDE client, not the server host.
|
|
60
|
+
export const ANTIGRAVITY_IDE_VERSION = "2.1.1";
|
|
61
|
+
export const ANTIGRAVITY_IDE_BASE_URL = "https://cloudcode-pa.googleapis.com";
|
|
62
|
+
export const ANTIGRAVITY_IDE_USER_AGENT = `antigravity/ide/${ANTIGRAVITY_IDE_VERSION} darwin/arm64`;
|
|
63
|
+
|
|
64
|
+
// Antigravity OAuth client credentials (public CLI client — duplicated in usage.js + src/lib/oauth)
|
|
65
|
+
export const ANTIGRAVITY_OAUTH_CLIENT = {
|
|
66
|
+
clientId: "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",
|
|
67
|
+
clientSecret: "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"
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Gemini (Google) OAuth client credentials (public CLI client — shared by gemini, gemini-cli, src/lib/oauth)
|
|
71
|
+
export const GOOGLE_OAUTH_CLIENT = {
|
|
72
|
+
clientId: "681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",
|
|
73
|
+
clientSecret: "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"
|
|
74
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Resolve valid thinking levels per model — drives UI level picker (suffix "model(level)").
|
|
2
|
+
// Reuses capabilities.js (thinkingFormat/canDisable) so this file only maps format→levels (DRY).
|
|
3
|
+
import { getCapabilitiesForModel } from "./capabilities.js";
|
|
4
|
+
import { matchPattern } from "./pricing.js";
|
|
5
|
+
|
|
6
|
+
// Shared level sets (deduped) — verified against provider docs + wire in thinkingUnified.applyFormat.
|
|
7
|
+
const L = {
|
|
8
|
+
base: ["none", "low", "medium", "high"], // qwen, step, hunyuan, gemini-budget
|
|
9
|
+
onOff: ["none", "thinking"], // zai (binary), minimax (adaptive)
|
|
10
|
+
openai: ["none", "minimal", "low", "medium", "high", "xhigh"], // GPT-5.x / o-series (no "max")
|
|
11
|
+
levelMax: ["none", "low", "medium", "high", "max"], // claude-adaptive, kimi
|
|
12
|
+
budgetX: ["none", "low", "medium", "high", "xhigh", "max"], // claude-budget
|
|
13
|
+
gemini: ["minimal", "low", "medium", "high"], // gemini-3 thinkingLevel (no disable)
|
|
14
|
+
hiMax: ["none", "high", "max"], // deepseek (low/med→high, xhigh→max)
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// thinkingFormat → valid selectable levels (source of truth for UI options).
|
|
18
|
+
const FORMAT_LEVELS = {
|
|
19
|
+
openai: L.openai,
|
|
20
|
+
"claude-adaptive": L.levelMax,
|
|
21
|
+
"claude-budget": L.budgetX,
|
|
22
|
+
"gemini-level": L.gemini,
|
|
23
|
+
"gemini-budget": L.base,
|
|
24
|
+
zai: L.onOff,
|
|
25
|
+
qwen: L.base,
|
|
26
|
+
kimi: L.levelMax,
|
|
27
|
+
deepseek: L.hiMax,
|
|
28
|
+
minimax: L.onOff,
|
|
29
|
+
hunyuan: L.base,
|
|
30
|
+
step: L.base,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// Model-name pattern overrides (glob, first match wins) — more precise than format default.
|
|
34
|
+
const PATTERN_THINKING = [
|
|
35
|
+
// gpt-5.6-sol accepts max (maps to xhigh on wire); live probe rejected ultra.
|
|
36
|
+
{ pattern: "*gpt-5.6-sol*", levels: ["none", "minimal", "low", "medium", "high", "xhigh", "max"] },
|
|
37
|
+
{ pattern: "*codex*", levels: ["low", "medium", "high", "xhigh"] }, // codex cannot disable thinking
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
// Returns valid thinking levels for a model, or null when the model has no reasoning.
|
|
41
|
+
export function getThinkingLevels(provider, model) {
|
|
42
|
+
const caps = getCapabilitiesForModel(provider, model);
|
|
43
|
+
if (!caps.reasoning) return null;
|
|
44
|
+
const hit = PATTERN_THINKING.find((p) => matchPattern(p.pattern, model));
|
|
45
|
+
let levels = hit?.levels || FORMAT_LEVELS[caps.thinkingFormat] || L.base;
|
|
46
|
+
if (caps.thinkingCanDisable === false) levels = levels.filter((l) => l !== "none");
|
|
47
|
+
return levels;
|
|
48
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Port of apply_filter (rtk/src/cmds/system/pipe_cmd.rs) — catch_unwind equivalent
|
|
2
|
+
// On panic/error: passthrough raw output + warn to stderr
|
|
3
|
+
export function safeApply(fn, text) {
|
|
4
|
+
if (typeof fn !== "function") return text;
|
|
5
|
+
try {
|
|
6
|
+
const out = fn(text);
|
|
7
|
+
if (typeof out !== "string") return text;
|
|
8
|
+
return out;
|
|
9
|
+
} catch (err) {
|
|
10
|
+
// Rust: eprintln!("[rtk] warning: filter panicked — passing through raw output")
|
|
11
|
+
const name = fn.filterName || fn.name || "anonymous";
|
|
12
|
+
console.warn(`[rtk] warning: filter '${name}' panicked — passing through raw output: ${err?.message || err}`);
|
|
13
|
+
return text;
|
|
14
|
+
}
|
|
15
|
+
}
|