1 line
69 KiB
JSON
1 line
69 KiB
JSON
{"repo": "bandersnatch0x/cc-switch-web", "files": {"src/config/claudeProviderPresets.ts": {"7fee95f505cd4504ca059d1db7b5023d24146dde": {"t": 1785595984.0556002, "n": 17608, "h": "708c62eae7bd6937", "c": "/**\n * 预设供应商配置模板\n */\nimport { ProviderCategory } from \"../types\";\n\nexport interface TemplateValueConfig {\n label: string;\n placeholder: string;\n defaultValue?: string;\n editorValue: string;\n}\n\n/**\n * 预设供应商的视觉主题配置\n */\nexport interface PresetTheme {\n /** 图标类型:'claude' | 'codex' | 'gemini' | 'generic' */\n icon?: \"claude\" | \"codex\" | \"gemini\" | \"generic\";\n /** 背景色(选中状态),支持 Tailwind 类名或 hex 颜色 */\n backgroundColor?: string;\n /** 文字色(选中状态),支持 Tailwind 类名或 hex 颜色 */\n textColor?: string;\n}\n\nexport interface ProviderPreset {\n name: string;\n websiteUrl: string;\n // 新增:第三方/聚合等可单独配置获取 API Key 的链接\n apiKeyUrl?: string;\n settingsConfig: object;\n isOfficial?: boolean; // 标识是否为官方预设\n isPartner?: boolean; // 标识是否为商业合作伙伴\n partnerPromotionKey?: string; // 合作伙伴促销信息的 i18n key\n category?: ProviderCategory; // 新增:分类\n // 新增:指定该预设所使用的 API Key 字段名(默认 ANTHROPIC_AUTH_TOKEN)\n apiKeyField?: \"ANTHROPIC_AUTH_TOKEN\" | \"ANTHROPIC_API_KEY\";\n // 新增:模板变量定义,用于动态替换配置中的值\n templateValues?: Record<string, TemplateValueConfig>; // editorValue 存储编辑器中的实时输入值\n // 新增:请求地址候选列表(用于地址管理/测速)\n endpointCandidates?: string[];\n // 新增:视觉主题配置\n theme?: PresetTheme;\n}\n\nexport const providerPresets: ProviderPreset[] = [\n {\n name: \"Claude Official\",\n websiteUrl: \"https://www.anthropic.com/claude-code\",\n settingsConfig: {\n env: {},\n },\n isOfficial: true, // 明确标识为官方预设\n category: \"official\",\n theme: {\n icon: \"claude\",\n backgroundColor: \"#D97757\",\n textColor: \"#FFFFFF\",\n },\n },\n {\n name: \"DeepSeek\",\n websiteUrl: \"https://platform.deepseek.com\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.deepseek.com/anthropic\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n ANTHROPIC_MODEL: \"deepseek-chat\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"deepseek-chat\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"deepseek-chat\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"deepseek-chat\",\n },\n },\n category: \"cn_official\",\n },\n {\n name: \"Zhipu GLM\",\n websiteUrl: \"https://open.bigmodel.cn\",\n apiKeyUrl: \"https://www.bigmodel.cn/claude-code?ic=RRVJPB5SII\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://open.bigmodel.cn/api/anthropic\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n API_TIMEOUT_MS: \"3000000\",\n CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: \"1\",\n ANTHROPIC_MODEL: \"glm-4.7\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"glm-4.5-air\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"glm-4.7\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"glm-4.7\",\n },\n },\n category: \"cn_official\",\n isPartner: true, // 合作伙伴\n partnerPromotionKey: \"zhipu\", // 促销信息 i18n key\n },\n {\n name: \"Z.ai GLM\",\n websiteUrl: \"https://z.ai\",\n apiKeyUrl: \"https://z.ai/subscribe?ic=8JVLJQFSKB\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.z.ai/api/anthropic\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n ANTHROPIC_MODEL: \"glm-4.6\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"glm-4.5-air\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"glm-4.6\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"glm-4.6\",\n },\n },\n category: \"cn_official\",\n isPartner: true, // 合作伙伴\n partnerPromotionKey: \"zhipu\", // 促销信息 i18n key\n },\n {\n name: \"Qwen Coder\",\n websiteUrl: \"https://bailian.console.aliyun.com\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://dashscope.aliyuncs.com/apps/anthropic\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n ANTHROPIC_MODEL: \"qwen-max\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"qwen-max\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"qwen-max\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"qwen-max\",\n },\n },\n category: \"cn_official\",\n },\n {\n name: \"Kimi k2\",\n websiteUrl: \"https://platform.moonshot.cn/console\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.moonshot.cn/anthropic\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n ANTHROPIC_MODEL: \"kimi-k2-thinking\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"kimi-k2-thinking\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"kimi-k2-thinking\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"kimi-k2-thinking\",\n },\n },\n category: \"cn_official\",\n },\n {\n name: \"Kimi For Coding\",\n websiteUrl: \"https://www.kimi.com/coding/docs/\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.kimi.com/coding/\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n ANTHROPIC_MODEL: \"kimi-for-coding\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"kimi-for-coding\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"kimi-for-coding\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"kimi-for-coding\",\n },\n },\n category: \"cn_official\",\n },\n {\n name: \"ModelScope\",\n websiteUrl: \"https://modelscope.cn\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api-inference.modelscope.cn\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n ANTHROPIC_MODEL: \"ZhipuAI/GLM-4.6\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"ZhipuAI/GLM-4.6\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"ZhipuAI/GLM-4.6\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"ZhipuAI/GLM-4.6\",\n },\n },\n category: \"aggregator\",\n },\n {\n name: \"KAT-Coder\",\n websiteUrl: \"https://console.streamlake.ai\",\n apiKeyUrl: \"https://console.streamlake.ai/console/api-key\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL:\n \"https://vanchin.streamlake.ai/api/gateway/v1/endpoints/${ENDPOINT_ID}/claude-code-proxy\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n ANTHROPIC_MODEL: \"KAT-Coder-Pro V1\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"KAT-Coder-Air V1\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"KAT-Coder-Pro V1\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"KAT-Coder-Pro V1\",\n },\n },\n category: \"cn_official\",\n templateValues: {\n ENDPOINT_ID: {\n label: \"Vanchin Endpoint ID\",\n placeholder: \"ep-xxx-xxx\",\n defaultValue: \"\",\n editorValue: \"\",\n },\n },\n },\n {\n name: \"Longcat\",\n websiteUrl: \"https://longcat.chat/platform\",\n apiKeyUrl: \"https://longcat.chat/platform/api_keys\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.longcat.chat/anthropic\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n ANTHROPIC_MODEL: \"LongCat-Flash-Chat\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"LongCat-Flash-Chat\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"LongCat-Flash-Chat\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"LongCat-Flash-Chat\",\n CLAUDE_CODE_MAX_OUTPUT_TOKENS: \"6000\",\n CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1,\n },\n },\n category: \"cn_official\",\n },\n {\n name: \"MiniMax\",\n websiteUrl: \"https://platform.minimaxi.com\",\n apiKeyUrl: \"https://platform.minimaxi.com/user-center/basic-information\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.minimaxi.com/anthropic\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n API_TIMEOUT_MS: \"3000000\",\n CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1,\n ANTHROPIC_MODEL: \"MiniMax-M2.1\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"MiniMax-M2.1\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"MiniMax-M2.1\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"MiniMax-M2.1\",\n },\n },\n category: \"cn_official\",\n },\n {\n name: \"DouBaoSeed\",\n websiteUrl: \"https://www.volcengine.com/product/doubao\",\n apiKeyUrl: \"https://www.volcengine.com/product/doubao\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://ark.cn-beijing.volces.com/api/coding\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n API_TIMEOUT_MS: \"3000000\",\n ANTHROPIC_MODEL: \"doubao-seed-code-preview-latest\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"doubao-seed-code-preview-latest\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"doubao-seed-code-preview-latest\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"doubao-seed-code-preview-latest\",\n },\n },\n category: \"cn_official\",\n },\n {\n name: \"BaiLing\",\n websiteUrl: \"https://alipaytbox.yuque.com/sxs0ba/ling/get_started\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.tbox.cn/api/anthropic\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n ANTHROPIC_MODEL: \"Ling-1T\",\n ANTHROPIC_DEFAULT_HAIKU_MODEL: \"Ling-1T\",\n ANTHROPIC_DEFAULT_SONNET_MODEL: \"Ling-1T\",\n ANTHROPIC_DEFAULT_OPUS_MODEL: \"Ling-1T\",\n },\n },\n category: \"cn_official\",\n },\n {\n name: \"AiHubMix\",\n websiteUrl: \"https://aihubmix.com\",\n apiKeyUrl: \"https://aihubmix.com\",\n // 说明:该供应商使用 ANTHROPIC_API_KEY(而非 ANTHROPIC_AUTH_TOKEN)\n apiKeyField: \"ANTHROPIC_API_KEY\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://aihubmix.com\",\n ANTHROPIC_API_KEY: \"\",\n },\n },\n // 请求地址候选(用于地址管理/测速),用户可自行选择/覆盖\n endpointCandidates: [\"https://aihubmix.com\", \"https://api.aihubmix.com\"],\n category: \"aggregator\",\n },\n {\n name: \"DMXAPI\",\n websiteUrl: \"https://www.dmxapi.cn\",\n apiKeyUrl: \"https://www.dmxapi.cn\",\n // 说明:该供应商使用 ANTHROPIC_API_KEY(而非 ANTHROPIC_AUTH_TOKEN)\n apiKeyField: \"ANTHROPIC_API_KEY\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://www.dmxapi.cn\",\n ANTHROPIC_API_KEY: \"\",\n },\n },\n // 请求地址候选(用于地址管理/测速),用户可自行选择/覆盖\n endpointCandidates: [\"https://www.dmxapi.cn\"],\n category: \"aggregator\",\n },\n {\n name: \"OpenRouter\",\n websiteUrl: \"https://openrouter.ai\",\n apiKeyUrl: \"https://openrouter.ai/keys\",\n apiKeyField: \"ANTHROPIC_API_KEY\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://openrouter.ai/api\",\n ANTHROPIC_API_KEY: \"\",\n },\n },\n category: \"aggregator\",\n },\n {\n name: \"PackyCode\",\n websiteUrl: \"https://www.packyapi.com\",\n apiKeyUrl: \"https://www.packyapi.com/register?aff=cc-switch\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://www.packyapi.com\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n // 请求地址候选(用于地址管理/测速)\n endpointCandidates: [\n \"https://www.packyapi.com\",\n \"https://api-slb.packyapi.com\",\n ],\n category: \"third_party\",\n isPartner: true, // 合作伙伴\n partnerPromotionKey: \"packycode\", // 促销信息 i18n key\n },\n {\n name: \"88code\",\n websiteUrl: \"https://www.88code.ai\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://www.88code.ai/api\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://www.88code.ai/api\"],\n category: \"third_party\",\n },\n {\n name: \"AICodeMirror\",\n websiteUrl: \"https://www.aicodemirror.com\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.aicodemirror.com/api/claudecode\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://api.aicodemirror.com/api/claudecode\"],\n category: \"third_party\",\n },\n {\n name: \"AIMZ\",\n websiteUrl: \"https://mzlone.top\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://mzlone.top\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://mzlone.top\"],\n category: \"third_party\",\n },\n {\n name: \"Anyrouter\",\n websiteUrl: \"https://anyrouter.top\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://anyrouter.top\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://anyrouter.top\"],\n category: \"third_party\",\n },\n {\n name: \"CCFly\",\n websiteUrl: \"https://ccfly.online\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://apic.cikew.site/api\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://apic.cikew.site/api\"],\n category: \"third_party\",\n },\n {\n name: \"ClaudeCN\",\n websiteUrl: \"https://claudecn.top\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://claudecn.top\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://claudecn.top\"],\n category: \"third_party\",\n },\n {\n name: \"ClaudePro\",\n websiteUrl: \"https://pro.aipor.cc\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://pro.aipor.cc/api\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://pro.aipor.cc/api\"],\n category: \"third_party\",\n },\n {\n name: \"CodeCli\",\n websiteUrl: \"https://code-cli.cn\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://code-cli.cn/api/claudecode\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://code-cli.cn/api/claudecode\"],\n category: \"third_party\",\n },\n {\n name: \"EasyChat\",\n websiteUrl: \"https://easychat.site\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://server.easychat.site\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://server.easychat.site\"],\n category: \"third_party\",\n },\n {\n name: \"FastCode\",\n websiteUrl: \"https://api.timebackward.com\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.timebackward.com\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://api.timebackward.com\"],\n category: \"third_party\",\n },\n {\n name: \"FoxCode\",\n websiteUrl: \"https://foxcode.rjj.cc\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://code.newcli.com/claude/aws\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://code.newcli.com/claude/aws\"],\n category: \"third_party\",\n },\n {\n name: \"GalaxyCode\",\n websiteUrl: \"https://nf.video\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://relay.nf.video\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://relay.nf.video\"],\n category: \"third_party\",\n },\n {\n name: \"HuggingCode\",\n websiteUrl: \"https://huggingcode.cc\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://huggingcode.cc\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://huggingcode.cc\"],\n category: \"third_party\",\n },\n {\n name: \"JikeAI\",\n websiteUrl: \"https://magic666.top\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://magic666.top\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://magic666.top\"],\n category: \"third_party\",\n },\n {\n name: \"LinkAPI\",\n websiteUrl: \"https://linkapi.ai\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.linkapi.ai\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://api.linkapi.ai\"],\n category: \"third_party\",\n },\n {\n name: \"MikuCode\",\n websiteUrl: \"https://mikucode.xyz\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://mikucode.xyz\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://mikucode.xyz\"],\n category: \"third_party\",\n },\n {\n name: \"OCC\",\n websiteUrl: \"https://www.openclaudecode.cn\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://www.openclaudecode.cn\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://www.openclaudecode.cn\"],\n category: \"third_party\",\n },\n {\n name: \"SSSAiCode\",\n websiteUrl: \"https://www.sssaicode.com\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://claude3.sssaicode.com/api\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://claude3.sssaicode.com/api\"],\n category: \"third_party\",\n },\n {\n name: \"YesCode\",\n websiteUrl: \"https://co.yes.vg\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://co.yes.vg\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://co.yes.vg\"],\n category: \"third_party\",\n },\n {\n name: \"cubence\",\n websiteUrl: \"https://cubence.com\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api-dmit.cubence.com\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://api-dmit.cubence.com\"],\n category: \"third_party\",\n },\n {\n name: \"duckcoding\",\n websiteUrl: \"https://duckcoding.com\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://jp.duckcoding.com\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://jp.duckcoding.com\"],\n category: \"third_party\",\n },\n {\n name: \"ikuncode\",\n websiteUrl: \"https://api.ikuncode.cc\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.ikuncode.cc\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://api.ikuncode.cc\"],\n category: \"third_party\",\n },\n {\n name: \"privnode\",\n websiteUrl: \"https://privnode.com\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://privnode.com\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://privnode.com\"],\n category: \"third_party\",\n },\n {\n name: \"uucode\",\n websiteUrl: \"https://www.uucode.org\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://api.uucode.org\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://api.uucode.org\"],\n category: \"third_party\",\n },\n {\n name: \"xyai\",\n websiteUrl: \"https://new.xychatai.com\",\n settingsConfig: {\n env: {\n ANTHROPIC_BASE_URL: \"https://new.xychatai.com/claude_api\",\n ANTHROPIC_AUTH_TOKEN: \"\",\n },\n },\n endpointCandidates: [\"https://new.xychatai.com/claude_api\"],\n category: \"third_party\",\n },\n];\n"}}, "docs/release-note-v3.6.0-zh.md": {"7fee95f505cd4504ca059d1db7b5023d24146dde": {"t": 1785596015.6062322, "n": 5100, "h": "f8c65d4a0a40a53e", "c": "# CC Switch v3.6.0\n\n> 全栈架构重构,增强配置同步与数据保护\n\n**[English Version →](../release-note-v3.6.0.md)**\n\n---\n\n## 新增功能\n\n### 编辑模式与供应商管理\n\n- **供应商复制功能** - 一键快速复制现有供应商配置,轻松创建变体配置\n- **手动排序功能** - 通过拖拽对供应商进行重新排序,带有视觉推送效果动画\n- **编辑模式切换** - 显示/隐藏拖拽手柄,优化编辑体验\n\n### 自定义端点管理\n\n- **多端点配置** - 支持聚合类供应商的多 API 端点配置\n- **端点输入可见性** - 为所有非官方供应商自动显示端点字段\n\n### 自定义配置目录(云同步)\n\n- **自定义存储位置** - 自定义 CC Switch 的配置存储目录\n- **云同步支持** - 指定到云同步文件夹(Dropbox、OneDrive、iCloud Drive、坚果云等)即可实现跨设备配置自动同步\n- **独立管理** - 通过 Tauri Store 管理,更好的隔离性和可靠性\n\n### 使用量查询增强\n\n- **自动刷新间隔** - 配置定时自动使用量查询,支持自定义间隔时间\n- **测试脚本 API** - 在执行前验证 JavaScript 使用量查询脚本\n- **增强模板系统** - 自定义空白模板,支持 access token 和 user ID 参数\n\n### 配置目录切换(WSL 支持)\n\n- **目录变更自动同步** - 切换 Claude/Codex 配置目录(如 WSL 环境)时,自动同步当前供应商到新目录,无需手动操作\n- **后置同步工具** - 统一的 `postChangeSync.ts` 工具,优雅处理错误而不阻塞主流程\n- **导入配置自动同步** - 配置导入后自动同步,确保立即生效\n- **智能冲突解决** - 区分\"完全成功\"和\"部分成功\"状态,提供精确的用户反馈\n\n### 配置编辑器改进\n\n- **JSON 格式化按钮** - 配置编辑器中一键 JSON 格式化\n- **实时 TOML 验证** - Codex 配置的实时语法验证,带有错误高亮\n\n### 编辑时加载 Live 配置\n\n- **保护手动修改** - 编辑当前激活的供应商时,优先显示来自 live 文件的实际生效配置\n- **双源策略** - 活动供应商自动从 live 配置加载,非活动供应商从 SSOT 加载\n\n### Claude 配置数据结构增强\n\n- **细粒度模型配置** - 从双键系统升级到四键系统,以匹配官方最新数据结构\n - 新增字段:`ANTHROPIC_DEFAULT_HAIKU_MODEL`、`ANTHROPIC_DEFAULT_SONNET_MODEL`、`ANTHROPIC_DEFAULT_OPUS_MODEL`、`ANTHROPIC_MODEL`\n - 替换旧版 `ANTHROPIC_SMALL_FAST_MODEL`,支持自动迁移\n - 后端在首次读写时自动规范化旧配置,带有智能回退链\n - UI 从 2 个模型输入字段扩展到 4 个,具有智能默认值\n- **ANTHROPIC_API_KEY 支持** - 供应商现可使用 `ANTHROPIC_API_KEY` 字段(除 `ANTHROPIC_AUTH_TOKEN` 外)\n- **模板变量系统** - 支持动态配置替换(如 KAT-Coder 的 `ENDPOINT_ID` 参数)\n- **端点候选列表** - 预定义端点列表,用于速度测试和端点管理\n- **视觉主题配置** - 供应商卡片自定义图标和颜色\n\n### 供应商模型更新\n\n- **Kimi k2** - 更新到最新的 `kimi-k2-thinking` 模型\n\n### 新增供应商预设\n\n新增 5 个供应商预设:\n\n- **DMXAPI** - 多模型聚合服务\n- **Azure Codex** - 微软 Azure OpenAI 端点\n- **AnyRouter** - API 路由服务\n- **AiHubMix** - AI 模型集合\n- **MiniMax** - 国产 AI 模型提供商\n\n### 合作伙伴推广机制\n\n- 支持生态合作伙伴推广(智谱 GLM Z.ai)\n- README 中集成赞助商横幅\n\n---\n\n## 改进优化\n\n### 配置与同步\n\n- **统一错误处理** - 后端全面使用 AppError 与国际化错误消息\n- **修复 apiKeyUrl 优先级** - 修正 API key URL 解析的优先级顺序\n- **修复 MCP 同步问题** - 解决同步到另一端功能失效的问题\n- **导入配置同步** - 修复配置导入后的同步问题\n- **配置错误处理** - 配置错误时强制退出,防止静默回退和数据丢失\n\n### UI/UX 增强\n\n- **独特的供应商图标** - 每个供应商卡片现在都有独特的图标和颜色识别\n- **统一边框系统** - 所有组件采用一致的边框设计\n- **拖拽交互** - 推送效果动画和改进的拖拽手柄图标\n- **增强视觉反馈** - 更好的当前供应商视觉指示\n- **对话框标准化** - 统一的对话框尺寸和布局一致性\n- **表单改进** - 优化模型占位符,简化供应商提示,分类特定提示\n- **使用量内联显示** - 使用量信息移至启用按钮旁边,更好地利用空间\n\n### 完整国际化\n\n- **错误消息国际化** - 所有后端错误消息支持中英文\n- **托盘菜单国际化** - 系统托盘菜单完全国际化\n- **UI 组件国际化** - 所有面向用户的组件 100% 覆盖\n\n---\n\n## Bug 修复\n\n### 配置管理\n\n- 修复 `apiKeyUrl` 优先级问题\n- 修复 MCP 同步到另一端功能失效\n- 修复配置导入后的同步问题\n- 修复 Codex API Key 自动同步\n- 修复端点速度测试功能\n- 修复供应商复制插入位置(现在插入到原供应商旁边)\n- 修复编辑模式下自定义端点保留问题\n- 防止配置错误时的静默回退和数据丢失\n\n### 使用量查询\n\n- 修复自动查询间隔时间问题\n- 确保刷新按钮点击时显示加载动画\n\n### UI 问题\n\n- 修复名称冲突错误(`get_init_error` 命令)\n- 修复保存成功后语言设置回滚\n- 修复语言切换状态重置(依赖循环)\n- 修复编辑模式按钮对齐\n\n### 启动问题\n\n- 配置错误时强制退出(不再静默回退)\n- 消除导致初始化错误的代码重复\n\n---\n\n## 架构重构\n\n### 后端(Rust)- 5 阶段重构\n\n1. **阶段 1**:统一错误处理(`AppError` + 国际化错误消息)\n2. **阶段 2**:命令层按领域拆分(`commands/{provider,mcp,config,settings,plugin,misc}.rs`)\n3. **阶段 3**:集成测试和事务机制(配置快照 + 失败回滚)\n4. **阶段 4**:提取 Service 层(`services/{provider,mcp,config,speedtest}.rs`)\n5. **阶段 5**:并发优化(`RwLock` 替代 `Mutex`,作用域 guard 避免死锁)\n\n### 前端(React + TypeScript)- 4 阶段重构\n\n1. **阶段 1**:测试基础设施(vitest + MSW + @testing-library/react)\n2. **阶段 2**:提取自定义 hooks(`useProviderActions`、`useMcpActions`、`useSettings`、`useImportExport` 等)\n3. **阶段 3**:组件拆分和业务逻辑提取\n4. **阶段 4**:代码清理和格式化统一\n\n### 测试体系\n\n- **Hooks 单元测试** - 所有自定义 hooks 100% 覆盖\n- **集成测试** - 关键流程覆盖(App、SettingsDialog、MCP 面板)\n- **MSW 模拟** - 后端 API 模拟确保测试独立性\n- **测试基础设施** - vitest + MSW + @testing-library/react\n\n### 代码质量\n\n- **统一参数格式** - 所有 Tauri 命令迁移到 camelCase(Tauri 2 规范)\n- **语义清晰** - `AppType` 重命名为 `AppId` 以获得更好的语义\n- **集中解析** - 使用 `FromStr` trait 统一 `app` 参数解析\n- **DRY 违规清理** - 消除整个代码库中的代码重复\n- **死代码移除** - 移除未使用的 `missing_param` 辅助函数、废弃的 `tauri-api.ts`、冗余的 `KimiModelSelector`\n\n---\n\n## 内部优化(用户无感知)\n\n### 移除遗留迁移逻辑\n\nv3.6.0 移除了 v1 配置自动迁移和副本文件扫描逻辑:\n\n- **影响**:提升启动性能,代码更简洁\n- **兼容性**:v2 格式配置完全兼容,无需任何操作\n- **注意**:从 v3.1.0 或更早版本升级的用户,请先升级到 v3.2.x 或 v3.5.x 进行一次性迁移,然后再升级到 v3.6.0\n\n### 命令参数标准化\n\n后端统一使用 `app` 参数(取值:`claude` 或 `codex`):\n\n- **影响**:代码更规范,错误提示更友好\n- **兼容性**:前端已完全适配,用户无需关心此变更\n\n---\n\n## 依赖更新\n\n- 更新到 **Tauri 2.8.x**\n- 更新到 **TailwindCSS 4.x**\n- 更新到 **TanStack Query v5.90.x**\n- 保持 **React 18.2.x** 和 **TypeScript 5.3.x**\n\n---\n\n## 安装方式\n\n### macOS\n\n**通过 Homebrew 安装(推荐):**\n\n```bash\nbrew tap farion1231/ccswitch\nbrew install --cask cc-switch\n```\n\n**手动下载:**\n\n- 从下方 [Assets](#assets) 下载 `CC-Switch-v3.6.0-macOS.zip`\n\n> **注意**:由于作者没有苹果开发者账号,首次打开可能出现\"未知开发者\"警告。请前往\"系统设置\" → \"隐私与安全性\" → 点击\"仍要打开\"\n\n### Windows\n\n- **安装包**:`CC-Switch-v3.6.0-Windows.msi`\n- **便携版**:`CC-Switch-v3.6.0-Windows-Portable.zip`\n\n### Linux\n\n- **AppImage**:`CC-Switch-v3.6.0-Linux.AppImage`\n- **Debian**:`CC-Switch-v3.6.0-Linux.deb`\n\n---\n\n## 文档\n\n- [中文文档](https://github.com/farion1231/cc-switch/blob/main/README_ZH.md)\n- [English Documentation](https://github.com/farion1231/cc-switch/blob/main/README.md)\n- [完整更新日志](https://github.com/farion1231/cc-switch/blob/main/CHANGELOG.md)\n\n---\n\n## 致谢\n\n特别感谢**智谱 AI** 通过 GLM CODING PLAN 赞助本项目!\n\n---\n\n**完整变更记录**: https://github.com/farion1231/cc-switch/compare/v3.5.1...v3.6.0\n"}}, "docs/release-note-v3.6.0-en.md": {"7fee95f505cd4504ca059d1db7b5023d24146dde": {"t": 1785596018.3599226, "n": 10076, "h": "8256bea8a8a949d6", "c": "## Major architecture refactoring with enhanced config sync and data protection\n\n**[中文更新说明 Chinese Documentation →](https://github.com/farion1231/cc-switch/blob/main/docs/release-note-v3.6.0-zh.md)**\n\n---\n\n## What's New\n\n### Edit Mode & Provider Management\n\n- **Provider Duplication** - Quickly duplicate existing provider configurations to create variants with one click\n- **Manual Sorting** - Drag and drop to reorder providers, with visual push effect animations. Thanks to @ZyphrZero\n- **Edit Mode Toggle** - Show/hide drag handles to optimize editing experience\n\n### Custom Endpoint Management\n\n- **Multi-Endpoint Configuration** - Support for aggregator providers with multiple API endpoints\n- **Endpoint Input Visibility** - Shows endpoint field for all non-official providers automatically\n\n### Usage Query Enhancements\n\n- **Auto-Refresh Interval** - Configure periodic automatic usage queries with customizable intervals\n- **Test Script API** - Validate JavaScript usage query scripts before execution\n- **Enhanced Templates** - Custom blank templates with access token and user ID parameter support\n Thanks to @Sirhexs\n\n### Custom Configuration Directory (Cloud Sync)\n\n- **Customizable Storage Location** - Customize CC Switch's configuration storage directory\n- **Cloud Sync Support** - Point to cloud sync folders (Dropbox, OneDrive, iCloud Drive, etc.) to enable automatic config synchronization across devices\n- **Independent Management** - Managed via Tauri Store for better isolation and reliability\n Thanks to @ZyphrZero\n\n### Configuration Directory Switching (WSL Support)\n\n- **Auto-Sync on Directory Change** - When switching Claude/Codex config directories (e.g., WSL environment), automatically sync current provider to the new directory without manual operation\n- **Post-Change Sync Utility** - Unified `postChangeSync.ts` utility for graceful error handling without blocking main flow\n- **Import Config Auto-Sync** - Automatically sync after config import to ensure immediate effectiveness\n- **Smart Conflict Resolution** - Distinguishes \"fully successful\" and \"partially successful\" states for precise user feedback\n\n### Configuration Editor Improvements\n\n- **JSON Format Button** - One-click JSON formatting in configuration editors\n- **Real-Time TOML Validation** - Live syntax validation for Codex configuration with error highlighting\n\n### Load Live Config When Editing\n\n- **Protect Manual Modifications** - When editing the currently active provider, prioritize displaying the actual effective configuration from live files\n- **Dual-Source Strategy** - Automatically loads from live config for active provider, SSOT for inactive ones\n\n### Claude Configuration Data Structure Enhancements\n\n- **Granular Model Configuration** - Migrated from dual-key to quad-key system for better model tier differentiation\n - New fields: `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_MODEL`\n - Replaces legacy `ANTHROPIC_SMALL_FAST_MODEL` with automatic migration\n - Backend normalizes old configs on first read/write with smart fallback chain\n - UI expanded from 2 to 4 model input fields with intelligent defaults\n- **ANTHROPIC_API_KEY Support** - Providers can now use `ANTHROPIC_API_KEY` field in addition to `ANTHROPIC_AUTH_TOKEN`\n- **Template Variable System** - Support for dynamic configuration replacement (e.g., KAT-Coder's `ENDPOINT_ID` parameter)\n- **Endpoint Candidates** - Predefined endpoint list for speed testing and endpoint management\n- **Visual Theme Configuration** - Custom icons and colors for provider cards\n\n### Updated Provider Models\n\n- **Kimi k2** - Updated to latest `kimi-k2-thinking` model\n\n### New Provider Presets\n\nAdded 5 new provider presets:\n\n- **DMXAPI** - Multi-model aggregation service\n- **Azure Codex** - Microsoft Azure OpenAI endpoint\n- **AnyRouter** - None-profit routing service\n- **AiHubMix** - Multi-model aggregation service\n- **MiniMax** - Open source AI model provider\n\n### Partner Promotion Mechanism\n\n- Support for ecosystem partner promotion (Zhipu GLM Z.ai)\n- Sponsored banner integration in README\n\n---\n\n## Improvements\n\n### Configuration & Sync\n\n- **Unified Error Handling** - AppError with internationalized error messages throughout backend\n- **Fixed apiKeyUrl Priority** - Correct priority order for API key URL resolution\n- **Fixed MCP Sync Issues** - Resolved sync-to-other-side functionality failures\n- **Import Config Sync** - Fixed sync issues after configuration import\n- **Config Error Handling** - Force exit on config error to prevent silent fallback and data loss\n\n### UI/UX Enhancements\n\n- **Unique Provider Icons** - Each provider card now has unique icons and color identification\n- **Unified Border System** - Consistent border design across all components\n- **Drag Interaction** - Push effect animation and improved drag handle icons\n- **Enhanced Visual Feedback** - Better current provider visual indication\n- **Dialog Standardization** - Unified dialog sizes and layout consistency\n- **Form Improvements** - Optimized model placeholders, simplified provider hints, category-specific hints\n- **Usage Display Inline** - Usage info moved next to enable button for better space utilization\n\n### Complete Internationalization\n\n- **Error Messages i18n** - All backend error messages support Chinese/English\n- **Tray Menu i18n** - System tray menu fully internationalized\n- **UI Components i18n** - 100% coverage across all user-facing components\n\n---\n\n## Bug Fixes\n\n### Configuration Management\n\n- Fixed `apiKeyUrl` priority issue\n- Fixed MCP sync-to-other-side functionality failure\n- Fixed sync issues after config import\n- Fixed Codex API Key auto-sync\n- Fixed endpoint speed test functionality\n- Fixed provider duplicate insertion position (now inserts next to original)\n- Fixed custom endpoint preservation in edit mode\n- Prevent silent fallback and data loss on config error\n\n### Usage Query\n\n- Fixed auto-query interval timing issue\n- Ensured refresh button shows loading animation on click\n\n### UI Issues\n\n- Fixed name collision error (`get_init_error` command)\n- Fixed language setting rollback after successful save\n- Fixed language switch state reset (dependency cycle)\n- Fixed edit mode button alignment\n\n### Startup Issues\n\n- Force exit on config error (no silent fallback)\n- Eliminated code duplication causing initialization errors\n\n---\n\n## Architecture Refactoring\n\n### Backend (Rust) - 5 Phase Refactoring\n\n1. **Phase 1**: Unified error handling (`AppError` + i18n error messages)\n2. **Phase 2**: Command layer split by domain (`commands/{provider,mcp,config,settings,plugin,misc}.rs`)\n3. **Phase 3**: Integration tests and transaction mechanism (config snapshot + failure rollback)\n4. **Phase 4**: Extracted Service layer (`services/{provider,mcp,config,speedtest}.rs`)\n5. **Phase 5**: Concurrency optimization (`RwLock` instead of `Mutex`, scoped guard to avoid deadlock)\n\n### Frontend (React + TypeScript) - 4 Stage Refactoring\n\n1. **Stage 1**: Test infrastructure (vitest + MSW + @testing-library/react)\n2. **Stage 2**: Extracted custom hooks (`useProviderActions`, `useMcpActions`, `useSettings`, `useImportExport`, etc.)\n3. **Stage 3**: Component splitting and business logic extraction\n4. **Stage 4**: Code cleanup and formatting unification\n\n### Testing System\n\n- **Hooks Unit Tests** - 100% coverage for all custom hooks\n- **Integration Tests** - Coverage for key processes (App, SettingsDialog, MCP Panel)\n- **MSW Mocking** - Backend API mocking to ensure test independence\n- **Test Infrastructure** - vitest + MSW + @testing-library/react\n\n### Code Quality\n\n- **Unified Parameter Format** - All Tauri commands migrated to camelCase (Tauri 2 specification)\n- **Semantic Clarity** - `AppType` renamed to `AppId` for better semantics\n- **Centralized Parsing** - Unified `app` parameter parsing with `FromStr` trait\n- **DRY Violations Cleanup** - Eliminated code duplication throughout codebase\n- **Dead Code Removal** - Removed unused `missing_param` helper, deprecated `tauri-api.ts`, redundant `KimiModelSelector`\n\n---\n\n## Internal Optimizations (User Transparent)\n\n### Removed Legacy Migration Logic\n\nv3.6.0 removed v1 config auto-migration and copy file scanning logic:\n\n- **Impact**: Improved startup performance, cleaner codebase\n- **Compatibility**: v2 format configs fully compatible, no action required\n- **Note**: Users upgrading from v3.1.0 or earlier should first upgrade to v3.2.x or v3.5.x for one-time migration, then upgrade to v3.6.0\n\n### Command Parameter Standardization\n\nBackend unified to use `app` parameter (values: `claude` or `codex`):\n\n- **Impact**: More standardized code, friendlier error prompts\n- **Compatibility**: Frontend fully adapted, users don't need to care about this change\n\n---\n\n## Dependencies\n\n- Updated to **Tauri 2.8.x**\n- Updated to **TailwindCSS 4.x**\n- Updated to **TanStack Query v5.90.x**\n- Maintained **React 18.2.x** and **TypeScript 5.3.x**\n\n---\n\n## Installation\n\n### macOS\n\n**Via Homebrew (Recommended):**\n\n```bash\nbrew tap farion1231/ccswitch\nbrew install --cask cc-switch\n```\n\n**Manual Download:**\n\n- Download `CC-Switch-v3.6.0-macOS.zip` from [Assets](#assets) below\n\n> **Note**: Due to lack of Apple Developer account, you may see \"unidentified developer\" warning. Go to System Settings → Privacy & Security → Click \"Open Anyway\"\n\n### Windows\n\n- **Installer**: `CC-Switch-v3.6.0-Windows.msi`\n- **Portable**: `CC-Switch-v3.6.0-Windows-Portable.zip`\n\n### Linux\n\n- **AppImage**: `CC-Switch-v3.6.0-Linux.AppImage`\n- **Debian**: `CC-Switch-v3.6.0-Linux.deb`\n\n---\n\n## Documentation\n\n- [中文文档 (Chinese)](https://github.com/farion1231/cc-switch/blob/main/README_ZH.md)\n- [English Documentation](https://github.com/farion1231/cc-switch/blob/main/README.md)\n- [完整更新日志 (Full Changelog)](https://github.com/farion1231/cc-switch/blob/main/CHANGELOG.md)\n\n---\n\n## Acknowledgments\n\nSpecial thanks to **Zhipu AI** for sponsoring this project with their GLM CODING PLAN!\n\n---\n\n**Full Changelog**: https://github.com/farion1231/cc-switch/compare/v3.5.1...v3.6.0\n"}}, "docs/release-note-v3.6.1-zh.md": {"7fee95f505cd4504ca059d1db7b5023d24146dde": {"t": 1785596018.4399717, "n": 7879, "h": "3488759d2bbad334", "c": "# CC Switch v3.6.1\n\n> 稳定性提升与用户体验优化(基于 v3.6.0)\n\n**[English Version →](../release-note-v3.6.1.md)**\n\n---\n\n## 📦 v3.6.1 新增内容 (2025-11-10)\n\n本次更新主要聚焦于**用户体验优化**和**配置解析健壮性**,修复了多个关键 Bug,并增强了用量查询系统。\n\n### ✨ 新增功能\n\n#### 用量查询系统增强\n\n- **凭证解耦** - 用量查询可使用独立的 API Key 和 Base URL,不再依赖供应商配置\n - 支持不同的查询端点和认证方式\n - 根据模板类型自动显示对应的凭证输入框\n - General 模板:API Key + Base URL\n - NewAPI 模板:Base URL + Access Token + User ID\n - Custom 模板:完全自定义\n- **UI 组件升级** - 使用 shadcn/ui Switch 替代原生 checkbox,体验更现代\n- **表单统一化** - 统一使用 shadcn/ui 输入组件,样式与应用保持一致\n- **密码显示切换** - 添加查看/隐藏密码功能(API Key、Access Token)\n\n#### 表单验证基础设施\n\n- **通用 Schema 库** - 新增 JSON/TOML 通用验证器,减少重复代码\n - `jsonConfigSchema`:通用 JSON 对象验证器\n - `tomlConfigSchema`:通用 TOML 格式验证器\n - `mcpJsonConfigSchema`:MCP 专用 JSON 验证器\n- **MCP 条件字段验证** - 严格的类型检查\n - stdio 类型强制要求 `command` 字段\n - http 类型强制要求 `url` 字段\n\n#### 合作伙伴集成\n\n- **PackyCode** - 新增官方合作伙伴\n - 添加到 Claude 和 Codex 供应商预设\n - 支持 10% 折扣优惠(促销信息集成)\n - 新增 Logo 和合作伙伴标识\n\n---\n\n### 🔧 改进优化\n\n#### 用户体验\n\n- **拖拽排序同步** - 托盘菜单顺序实时同步拖拽排序结果\n- **错误通知增强** - 切换供应商失败时显示可复制的错误信息\n- **移除误导性占位符** - 删除模型输入框的示例文本,避免用户混淆\n- **Base URL 自动填充** - 所有非官方供应商类别自动填充 Base URL 输入框\n\n#### 配置解析\n\n- **中文引号规范化** - 自动处理 IME 输入的全角引号,防止 TOML 解析错误\n - 支持中文引号(\" \" ' ')自动转换为 ASCII 引号\n - 在 TOML 输入处理器中应用\n - Textarea 组件禁用浏览器自动纠正\n- **自定义字段保留** - 编辑 Codex MCP TOML 配置时保留未知字段\n - 支持 timeout_ms、retry_count 等扩展字段\n - 向前兼容未来的 MCP 协议扩展\n\n---\n\n### 🐛 Bug 修复\n\n#### 关键修复\n\n- **修复用量脚本面板白屏崩溃** - FormLabel 组件缺少 FormField context 导致整个应用崩溃\n - 替换为独立的 Label 组件\n - 根本原因:FormLabel 内部调用 useFormField() hook 需要 FormFieldContext\n- **修复中文输入法引号解析失败** - IME 输入的全角引号导致 TOML 解析错误\n - 新增 textNormalization 工具函数\n - 在解析前自动规范化引号\n- **修复拖拽排序托盘不同步** (#179) - 拖拽排序后托盘菜单顺序未更新\n - 在排序完成后自动调用 updateTrayMenu\n - 确保 UI 和托盘菜单保持一致\n- **修复 MCP 自定义字段丢失** - 编辑 Codex MCP 配置时自定义字段被静默丢弃\n - 使用 spread 操作符保留所有字段\n - normalizeServerConfig 中保留未知字段\n\n#### 稳定性改进\n\n- **错误隔离** - 托盘菜单更新失败不再影响主操作流程\n - 将托盘更新错误与主操作解耦\n - 主操作成功但托盘更新失败时给出警告\n- **安全模式匹配** - 替换 `unwrap()` 为安全的 pattern matching\n - 避免 panic 导致应用崩溃\n - 托盘菜单事件处理使用 match 模式\n- **导入配置分类** - 从默认配置导入时自动设置 category 为 `custom`\n - 避免导入的配置被误认为官方预设\n - 提供更清晰的配置来源标识\n\n---\n\n### 📊 技术统计\n\n```\n提交数: 17 commits\n代码变更: 31 个文件\n - 新增: 1,163 行\n - 删除: 811 行\n - 净增长: +352 行\n贡献者: Jason (16), ZyphrZero (1)\n```\n\n**按模块分类**:\n- UI/用户界面:3 commits\n- 用量查询系统:3 commits\n- 配置解析:2 commits\n- 表单验证:1 commit\n- 其他改进:8 commits\n\n---\n\n### 📥 安装方式\n\n#### macOS\n\n**通过 Homebrew 安装(推荐):**\n\n```bash\nbrew tap farion1231/ccswitch\nbrew install --cask cc-switch\n```\n\n**手动下载:**\n\n- 从下方 [Assets](#assets) 下载 `CC-Switch-v3.6.1-macOS.zip`\n\n> **注意**:由于作者没有苹果开发者账号,首次打开可能出现\"未知开发者\"警告。请前往\"系统设置\" → \"隐私与安全性\" → 点击\"仍要打开\"\n\n#### Windows\n\n- **安装包**:`CC-Switch-v3.6.1-Windows.msi`\n- **便携版**:`CC-Switch-v3.6.1-Windows-Portable.zip`\n\n#### Linux\n\n- **AppImage**:`CC-Switch-v3.6.1-Linux.AppImage`\n- **Debian**:`CC-Switch-v3.6.1-Linux.deb`\n\n---\n\n### 📚 文档\n\n- [中文文档](https://github.com/farion1231/cc-switch/blob/main/README_ZH.md)\n- [English Documentation](https://github.com/farion1231/cc-switch/blob/main/README.md)\n- [完整更新日志](https://github.com/farion1231/cc-switch/blob/main/CHANGELOG.md)\n\n---\n\n### 🙏 致谢\n\n特别感谢:\n- **智谱 AI** - 通过 GLM CODING PLAN 赞助本项目\n- **PackyCode** - 新加入的官方合作伙伴\n- **ZyphrZero** - 贡献托盘菜单同步修复 (#179)\n\n---\n\n**完整变更记录**: https://github.com/farion1231/cc-switch/compare/v3.6.0...v3.6.1\n\n---\n---\n\n## 📜 v3.6.0 完整功能回顾\n\n> 以下内容来自 v3.6.0 (2025-11-07),帮助您了解完整的功能集\n\n<details>\n<summary><b>点击展开 v3.6.0 的详细内容 →</b></summary>\n\n## 新增功能\n\n### 编辑模式与供应商管理\n\n- **供应商复制功能** - 一键快速复制现有供应商配置,轻松创建变体配置\n- **手动排序功能** - 通过拖拽对供应商进行重新排序,带有视觉推送效果动画\n- **编辑模式切换** - 显示/隐藏拖拽手柄,优化编辑体验\n\n### 自定义端点管理\n\n- **多端点配置** - 支持聚合类供应商的多 API 端点配置\n- **端点输入可见性** - 为所有非官方供应商自动显示端点字段\n\n### 自定义配置目录(云同步)\n\n- **自定义存储位置** - 自定义 CC Switch 的配置存储目录\n- **云同步支持** - 指定到云同步文件夹(Dropbox、OneDrive、iCloud Drive、坚果云等)即可实现跨设备配置自动同步\n- **独立管理** - 通过 Tauri Store 管理,更好的隔离性和可靠性\n\n### 使用量查询增强\n\n- **自动刷新间隔** - 配置定时自动使用量查询,支持自定义间隔时间\n- **测试脚本 API** - 在执行前验证 JavaScript 使用量查询脚本\n- **增强模板系统** - 自定义空白模板,支持 access token 和 user ID 参数\n\n### 配置目录切换(WSL 支持)\n\n- **目录变更自动同步** - 切换 Claude/Codex 配置目录(如 WSL 环境)时,自动同步当前供应商到新目录,无需手动操作\n- **后置同步工具** - 统一的 `postChangeSync.ts` 工具,优雅处理错误而不阻塞主流程\n- **导入配置自动同步** - 配置导入后自动同步,确保立即生效\n- **智能冲突解决** - 区分\"完全成功\"和\"部分成功\"状态,提供精确的用户反馈\n\n### 配置编辑器改进\n\n- **JSON 格式化按钮** - 配置编辑器中一键 JSON 格式化\n- **实时 TOML 验证** - Codex 配置的实时语法验证,带有错误高亮\n\n### 编辑时加载 Live 配置\n\n- **保护手动修改** - 编辑当前激活的供应商时,优先显示来自 live 文件的实际生效配置\n- **双源策略** - 活动供应商自动从 live 配置加载,非活动供应商从 SSOT 加载\n\n### Claude 配置数据结构增强\n\n- **细粒度模型配置** - 从双键系统升级到四键系统,以匹配官方最新数据结构\n - 新增字段:`ANTHROPIC_DEFAULT_HAIKU_MODEL`、`ANTHROPIC_DEFAULT_SONNET_MODEL`、`ANTHROPIC_DEFAULT_OPUS_MODEL`、`ANTHROPIC_MODEL`\n - 替换旧版 `ANTHROPIC_SMALL_FAST_MODEL`,支持自动迁移\n - 后端在首次读写时自动规范化旧配置,带有智能回退链\n - UI 从 2 个模型输入字段扩展到 4 个,具有智能默认值\n- **ANTHROPIC_API_KEY 支持** - 供应商现可使用 `ANTHROPIC_API_KEY` 字段(除 `ANTHROPIC_AUTH_TOKEN` 外)\n- **模板变量系统** - 支持动态配置替换(如 KAT-Coder 的 `ENDPOINT_ID` 参数)\n- **端点候选列表** - 预定义端点列表,用于速度测试和端点管理\n- **视觉主题配置** - 供应商卡片自定义图标和颜色\n\n### 供应商模型更新\n\n- **Kimi k2** - 更新到最新的 `kimi-k2-thinking` 模型\n\n### 新增供应商预设\n\n新增 5 个供应商预设:\n\n- **DMXAPI** - 多模型聚合服务\n- **Azure Codex** - 微软 Azure OpenAI 端点\n- **AnyRouter** - API 路由服务\n- **AiHubMix** - AI 模型集合\n- **MiniMax** - 国产 AI 模型提供商\n\n### 合作伙伴推广机制\n\n- 支持生态合作伙伴推广(智谱 GLM Z.ai)\n- README 中集成赞助商横幅\n\n---\n\n## 改进优化\n\n### 配置与同步\n\n- **统一错误处理** - 后端全面使用 AppError 与国际化错误消息\n- **修复 apiKeyUrl 优先级** - 修正 API key URL 解析的优先级顺序\n- **修复 MCP 同步问题** - 解决同步到另一端功能失效的问题\n- **导入配置同步** - 修复配置导入后的同步问题\n- **配置错误处理** - 配置错误时强制退出,防止静默回退和数据丢失\n\n### UI/UX 增强\n\n- **独特的供应商图标** - 每个供应商卡片现在都有独特的图标和颜色识别\n- **统一边框系统** - 所有组件采用一致的边框设计\n- **拖拽交互** - 推送效果动画和改进的拖拽手柄图标\n- **增强视觉反馈** - 更好的当前供应商视觉指示\n- **对话框标准化** - 统一的对话框尺寸和布局一致性\n- **表单改进** - 优化模型占位符,简化供应商提示,分类特定提示\n- **使用量内联显示** - 使用量信息移至启用按钮旁边,更好地利用空间\n\n### 完整国际化\n\n- **错误消息国际化** - 所有后端错误消息支持中英文\n- **托盘菜单国际化** - 系统托盘菜单完全国际化\n- **UI 组件国际化** - 所有面向用户的组件 100% 覆盖\n\n---\n\n## Bug 修复\n\n### 配置管理\n\n- 修复 `apiKeyUrl` 优先级问题\n- 修复 MCP 同步到另一端功能失效\n- 修复配置导入后的同步问题\n- 修复 Codex API Key 自动同步\n- 修复端点速度测试功能\n- 修复供应商复制插入位置(现在插入到原供应商旁边)\n- 修复编辑模式下自定义端点保留问题\n- 防止配置错误时的静默回退和数据丢失\n\n### 使用量查询\n\n- 修复自动查询间隔时间问题\n- 确保刷新按钮点击时显示加载动画\n\n### UI 问题\n\n- 修复名称冲突错误(`get_init_error` 命令)\n- 修复保存成功后语言设置回滚\n- 修复语言切换状态重置(依赖循环)\n- 修复编辑模式按钮对齐\n\n### 启动问题\n\n- 配置错误时强制退出(不再静默回退)\n- 消除导致初始化错误的代码重复\n\n---\n\n## 架构重构\n\n### 后端(Rust)- 5 阶段重构\n\n1. **阶段 1**:统一错误处理(`AppError` + 国际化错误消息)\n2. **阶段 2**:命令层按领域拆分(`commands/{provider,mcp,config,settings,plugin,misc}.rs`)\n3. **阶段 3**:集成测试和事务机制(配置快照 + 失败回滚)\n4. **阶段 4**:提取 Service 层(`services/{provider,mcp,config,speedtest}.rs`)\n5. **阶段 5**:并发优化(`RwLock` 替代 `Mutex`,作用域 guard 避免死锁)\n\n### 前端(React + TypeScript)- 4 阶段重构\n\n1. **阶段 1**:测试基础设施(vitest + MSW + @testing-library/react)\n2. **阶段 2**:提取自定义 hooks(`useProviderActions`、`useMcpActions`、`useSettings`、`useImportExport` 等)\n3. **阶段 3**:组件拆分和业务逻辑提取\n4. **阶段 4**:代码清理和格式化统一\n\n### 测试体系\n\n- **Hooks 单元测试** - 所有自定义 hooks 100% 覆盖\n- **集成测试** - 关键流程覆盖(App、SettingsDialog、MCP 面板)\n- **MSW 模拟** - 后端 API 模拟确保测试独立性\n- **测试基础设施** - vitest + MSW + @testing-library/react\n\n### 代码质量\n\n- **统一参数格式** - 所有 Tauri 命令迁移到 camelCase(Tauri 2 规范)\n- **语义清晰** - `AppType` 重命名为 `AppId` 以获得更好的语义\n- **集中解析** - 使用 `FromStr` trait 统一 `app` 参数解析\n- **DRY 违规清理** - 消除整个代码库中的代码重复\n- **死代码移除** - 移除未使用的 `missing_param` 辅助函数、废弃的 `tauri-api.ts`、冗余的 `KimiModelSelector`\n\n---\n\n## 内部优化(用户无感知)\n\n### 移除遗留迁移逻辑\n\nv3.6.0 移除了 v1 配置自动迁移和副本文件扫描逻辑:\n\n- **影响**:提升启动性能,代码更简洁\n- **兼容性**:v2 格式配置完全兼容,无需任何操作\n- **注意**:从 v3.1.0 或更早版本升级的用户,请先升级到 v3.2.x 或 v3.5.x 进行一次性迁移,然后再升级到 v3.6.0\n\n### 命令参数标准化\n\n后端统一使用 `app` 参数(取值:`claude` 或 `codex`):\n\n- **影响**:代码更规范,错误提示更友好\n- **兼容性**:前端已完全适配,用户无需关心此变更\n\n---\n\n## 依赖更新\n\n- 更新到 **Tauri 2.8.x**\n- 更新到 **TailwindCSS 4.x**\n- 更新到 **TanStack Query v5.90.x**\n- 保持 **React 18.2.x** 和 **TypeScript 5.3.x**\n\n</details>\n\n---\n\n## 🌟 关于 CC Switch\n\nCC Switch 是一个跨平台桌面应用,用于管理和切换 Claude Code 与 Codex 的不同供应商配置。基于 Tauri 2.0 + React 18 + TypeScript 构建,支持 Windows、macOS、Linux。\n\n**核心特性**:\n- 🔄 一键切换多个 AI 供应商\n- 📦 支持 Claude Code 和 Codex 双应用\n- 🎨 现代化 UI,完整的中英文国际化\n- 🔐 本地存储,数据安全可靠\n- ☁️ 支持云同步配置\n- 🧩 MCP 服务器统一管理\n\n---\n\n**项目地址**: https://github.com/farion1231/cc-switch\n"}}, "docs/release-note-v3.6.1-en.md": {"7fee95f505cd4504ca059d1db7b5023d24146dde": {"t": 1785596019.9809458, "n": 15603, "h": "ef450bad432dd80e", "c": "# CC Switch v3.6.1\n\n> Stability improvements and user experience optimization (based on v3.6.0)\n\n**[中文更新说明 Chinese Documentation →](https://github.com/farion1231/cc-switch/blob/main/docs/release-note-v3.6.1-zh.md)**\n\n---\n\n## 📦 What's New in v3.6.1 (2025-11-10)\n\nThis release focuses on **user experience optimization** and **configuration parsing robustness**, fixing several critical bugs and enhancing the usage query system.\n\n### ✨ New Features\n\n#### Usage Query System Enhancements\n\n- **Credential Decoupling** - Usage queries can now use independent API Key and Base URL, no longer dependent on provider configuration\n - Support for different query endpoints and authentication methods\n - Automatically displays credential input fields based on template type\n - General template: API Key + Base URL\n - NewAPI template: Base URL + Access Token + User ID\n - Custom template: Fully customizable\n- **UI Component Upgrade** - Replaced native checkbox with shadcn/ui Switch component for modern experience\n- **Form Unification** - Unified use of shadcn/ui Input components, consistent styling with the application\n- **Password Visibility Toggle** - Added show/hide password functionality (API Key, Access Token)\n\n#### Form Validation Infrastructure\n\n- **Common Schema Library** - New JSON/TOML generic validators to reduce code duplication\n - `jsonConfigSchema`: Generic JSON object validator\n - `tomlConfigSchema`: Generic TOML format validator\n - `mcpJsonConfigSchema`: MCP-specific JSON validator\n- **MCP Conditional Field Validation** - Strict type checking\n - stdio type requires `command` field\n - http type requires `url` field\n\n#### Partner Integration\n\n- **PackyCode** - New official partner\n - Added to Claude and Codex provider presets\n - 10% discount promotion support\n - New logo and partner identification\n\n---\n\n### 🔧 Improvements\n\n#### User Experience\n\n- **Drag Sort Sync** - Tray menu order now syncs with drag-and-drop sorting in real-time\n- **Enhanced Error Notifications** - Provider switch failures now display copyable error messages\n- **Removed Misleading Placeholders** - Deleted example text from model input fields to avoid user confusion\n- **Auto-fill Base URL** - All non-official provider categories automatically populate the Base URL input field\n\n#### Configuration Parsing\n\n- **CJK Quote Normalization** - Automatically handles IME-input fullwidth quotes to prevent TOML parsing errors\n - Supports automatic conversion of Chinese quotes (\" \" ' ') to ASCII quotes\n - Applied in TOML input handlers\n - Disabled browser auto-correction in Textarea component\n- **Preserve Custom Fields** - Editing Codex MCP TOML configuration now preserves unknown fields\n - Supports extension fields like timeout_ms, retry_count\n - Forward compatibility with future MCP protocol extensions\n\n---\n\n### 🐛 Bug Fixes\n\n#### Critical Fixes\n\n- **Fixed usage script panel white screen crash** - FormLabel component missing FormField context caused entire app to crash\n - Replaced with standalone Label component\n - Root cause: FormLabel internally calls useFormField() hook which requires FormFieldContext\n- **Fixed CJK input quote parsing failure** - IME-input fullwidth quotes caused TOML parsing errors\n - Added textNormalization utility function\n - Automatically normalizes quotes before parsing\n- **Fixed drag sort tray desync** (#179) - Tray menu order not updated after drag-and-drop sorting\n - Automatically calls updateTrayMenu after sorting completes\n - Ensures UI and tray menu stay consistent\n- **Fixed MCP custom field loss** - Custom fields silently dropped when editing Codex MCP configuration\n - Uses spread operator to retain all fields\n - Preserves unknown fields in normalizeServerConfig\n\n#### Stability Improvements\n\n- **Error Isolation** - Tray menu update failures no longer affect main operations\n - Decoupled tray update errors from main operations\n - Provides warning when main operation succeeds but tray update fails\n- **Safe Pattern Matching** - Replaced `unwrap()` with safe pattern matching\n - Avoids panic-induced app crashes\n - Tray menu event handling uses match patterns\n- **Import Config Classification** - Importing from default config now automatically sets category to `custom`\n - Avoids imported configs being mistaken for official presets\n - Provides clearer configuration source identification\n\n---\n\n### 📊 Technical Statistics\n\n```\nCommits: 17 commits\nCode Changes: 31 files\n - Additions: 1,163 lines\n - Deletions: 811 lines\n - Net Growth: +352 lines\nContributors: Jason (16), ZyphrZero (1)\n```\n\n**By Module**:\n- UI/User Interface: 3 commits\n- Usage Query System: 3 commits\n- Configuration Parsing: 2 commits\n- Form Validation: 1 commit\n- Other Improvements: 8 commits\n\n---\n\n### 📥 Installation\n\n#### macOS\n\n**Via Homebrew (Recommended):**\n\n```bash\nbrew tap farion1231/ccswitch\nbrew install --cask cc-switch\n```\n\n**Manual Download:**\n\n- Download `CC-Switch-v3.6.1-macOS.zip` from [Assets](#assets) below\n\n> **Note**: Due to lack of Apple Developer account, you may see \"unidentified developer\" warning. Go to System Settings → Privacy & Security → Click \"Open Anyway\"\n\n#### Windows\n\n- **Installer**: `CC-Switch-v3.6.1-Windows.msi`\n- **Portable**: `CC-Switch-v3.6.1-Windows-Portable.zip`\n\n#### Linux\n\n- **AppImage**: `CC-Switch-v3.6.1-Linux.AppImage`\n- **Debian**: `CC-Switch-v3.6.1-Linux.deb`\n\n---\n\n### 📚 Documentation\n\n- [中文文档 (Chinese)](https://github.com/farion1231/cc-switch/blob/main/README_ZH.md)\n- [English Documentation](https://github.com/farion1231/cc-switch/blob/main/README.md)\n- [完整更新日志 (Full Changelog)](https://github.com/farion1231/cc-switch/blob/main/CHANGELOG.md)\n\n---\n\n### 🙏 Acknowledgments\n\nSpecial thanks to:\n- **Zhipu AI** - For sponsoring this project with GLM CODING PLAN\n- **PackyCode** - New official partner\n- **ZyphrZero** - For contributing tray menu sync fix (#179)\n\n---\n\n**Full Changelog**: https://github.com/farion1231/cc-switch/compare/v3.6.0...v3.6.1\n\n---\n---\n\n## 📜 v3.6.0 Complete Feature Review\n\n> Content below is from v3.6.0 (2025-11-07), helping you understand the complete feature set\n\n<details>\n<summary><b>Click to expand v3.6.0 detailed content →</b></summary>\n\n## What's New\n\n### Edit Mode & Provider Management\n\n- **Provider Duplication** - Quickly duplicate existing provider configurations to create variants with one click\n- **Manual Sorting** - Drag and drop to reorder providers, with visual push effect animations. Thanks to @ZyphrZero\n- **Edit Mode Toggle** - Show/hide drag handles to optimize editing experience\n\n### Custom Endpoint Management\n\n- **Multi-Endpoint Configuration** - Support for aggregator providers with multiple API endpoints\n- **Endpoint Input Visibility** - Shows endpoint field for all non-official providers automatically\n\n### Usage Query Enhancements\n\n- **Auto-Refresh Interval** - Configure periodic automatic usage queries with customizable intervals\n- **Test Script API** - Validate JavaScript usage query scripts before execution\n- **Enhanced Templates** - Custom blank templates with access token and user ID parameter support\n Thanks to @Sirhexs\n\n### Custom Configuration Directory (Cloud Sync)\n\n- **Customizable Storage Location** - Customize CC Switch's configuration storage directory\n- **Cloud Sync Support** - Point to cloud sync folders (Dropbox, OneDrive, iCloud Drive, etc.) to enable automatic config synchronization across devices\n- **Independent Management** - Managed via Tauri Store for better isolation and reliability\n Thanks to @ZyphrZero\n\n### Configuration Directory Switching (WSL Support)\n\n- **Auto-Sync on Directory Change** - When switching Claude/Codex config directories (e.g., WSL environment), automatically sync current provider to the new directory without manual operation\n- **Post-Change Sync Utility** - Unified `postChangeSync.ts` utility for graceful error handling without blocking main flow\n- **Import Config Auto-Sync** - Automatically sync after config import to ensure immediate effectiveness\n- **Smart Conflict Resolution** - Distinguishes \"fully successful\" and \"partially successful\" states for precise user feedback\n\n### Configuration Editor Improvements\n\n- **JSON Format Button** - One-click JSON formatting in configuration editors\n- **Real-Time TOML Validation** - Live syntax validation for Codex configuration with error highlighting\n\n### Load Live Config When Editing\n\n- **Protect Manual Modifications** - When editing the currently active provider, prioritize displaying the actual effective configuration from live files\n- **Dual-Source Strategy** - Automatically loads from live config for active provider, SSOT for inactive ones\n\n### Claude Configuration Data Structure Enhancements\n\n- **Granular Model Configuration** - Migrated from dual-key to quad-key system for better model tier differentiation\n - New fields: `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_MODEL`\n - Replaces legacy `ANTHROPIC_SMALL_FAST_MODEL` with automatic migration\n - Backend normalizes old configs on first read/write with smart fallback chain\n - UI expanded from 2 to 4 model input fields with intelligent defaults\n- **ANTHROPIC_API_KEY Support** - Providers can now use `ANTHROPIC_API_KEY` field in addition to `ANTHROPIC_AUTH_TOKEN`\n- **Template Variable System** - Support for dynamic configuration replacement (e.g., KAT-Coder's `ENDPOINT_ID` parameter)\n- **Endpoint Candidates** - Predefined endpoint list for speed testing and endpoint management\n- **Visual Theme Configuration** - Custom icons and colors for provider cards\n\n### Updated Provider Models\n\n- **Kimi k2** - Updated to latest `kimi-k2-thinking` model\n\n### New Provider Presets\n\nAdded 5 new provider presets:\n\n- **DMXAPI** - Multi-model aggregation service\n- **Azure Codex** - Microsoft Azure OpenAI endpoint\n- **AnyRouter** - None-profit routing service\n- **AiHubMix** - Multi-model aggregation service\n- **MiniMax** - Open source AI model provider\n\n### Partner Promotion Mechanism\n\n- Support for ecosystem partner promotion (Zhipu GLM Z.ai)\n- Sponsored banner integration in README\n\n---\n\n## Improvements\n\n### Configuration & Sync\n\n- **Unified Error Handling** - AppError with internationalized error messages throughout backend\n- **Fixed apiKeyUrl Priority** - Correct priority order for API key URL resolution\n- **Fixed MCP Sync Issues** - Resolved sync-to-other-side functionality failures\n- **Import Config Sync** - Fixed sync issues after configuration import\n- **Config Error Handling** - Force exit on config error to prevent silent fallback and data loss\n\n### UI/UX Enhancements\n\n- **Unique Provider Icons** - Each provider card now has unique icons and color identification\n- **Unified Border System** - Consistent border design across all components\n- **Drag Interaction** - Push effect animation and improved drag handle icons\n- **Enhanced Visual Feedback** - Better current provider visual indication\n- **Dialog Standardization** - Unified dialog sizes and layout consistency\n- **Form Improvements** - Optimized model placeholders, simplified provider hints, category-specific hints\n- **Usage Display Inline** - Usage info moved next to enable button for better space utilization\n\n### Complete Internationalization\n\n- **Error Messages i18n** - All backend error messages support Chinese/English\n- **Tray Menu i18n** - System tray menu fully internationalized\n- **UI Components i18n** - 100% coverage across all user-facing components\n\n---\n\n## Bug Fixes\n\n### Configuration Management\n\n- Fixed `apiKeyUrl` priority issue\n- Fixed MCP sync-to-other-side functionality failure\n- Fixed sync issues after config import\n- Fixed Codex API Key auto-sync\n- Fixed endpoint speed test functionality\n- Fixed provider duplicate insertion position (now inserts next to original)\n- Fixed custom endpoint preservation in edit mode\n- Prevent silent fallback and data loss on config error\n\n### Usage Query\n\n- Fixed auto-query interval timing issue\n- Ensured refresh button shows loading animation on click\n\n### UI Issues\n\n- Fixed name collision error (`get_init_error` command)\n- Fixed language setting rollback after successful save\n- Fixed language switch state reset (dependency cycle)\n- Fixed edit mode button alignment\n\n### Startup Issues\n\n- Force exit on config error (no silent fallback)\n- Eliminated code duplication causing initialization errors\n\n---\n\n## Architecture Refactoring\n\n### Backend (Rust) - 5 Phase Refactoring\n\n1. **Phase 1**: Unified error handling (`AppError` + i18n error messages)\n2. **Phase 2**: Command layer split by domain (`commands/{provider,mcp,config,settings,plugin,misc}.rs`)\n3. **Phase 3**: Integration tests and transaction mechanism (config snapshot + failure rollback)\n4. **Phase 4**: Extracted Service layer (`services/{provider,mcp,config,speedtest}.rs`)\n5. **Phase 5**: Concurrency optimization (`RwLock` instead of `Mutex`, scoped guard to avoid deadlock)\n\n### Frontend (React + TypeScript) - 4 Stage Refactoring\n\n1. **Stage 1**: Test infrastructure (vitest + MSW + @testing-library/react)\n2. **Stage 2**: Extracted custom hooks (`useProviderActions`, `useMcpActions`, `useSettings`, `useImportExport`, etc.)\n3. **Stage 3**: Component splitting and business logic extraction\n4. **Stage 4**: Code cleanup and formatting unification\n\n### Testing System\n\n- **Hooks Unit Tests** - 100% coverage for all custom hooks\n- **Integration Tests** - Coverage for key processes (App, SettingsDialog, MCP Panel)\n- **MSW Mocking** - Backend API mocking to ensure test independence\n- **Test Infrastructure** - vitest + MSW + @testing-library/react\n\n### Code Quality\n\n- **Unified Parameter Format** - All Tauri commands migrated to camelCase (Tauri 2 specification)\n- **Semantic Clarity** - `AppType` renamed to `AppId` for better semantics\n- **Centralized Parsing** - Unified `app` parameter parsing with `FromStr` trait\n- **DRY Violations Cleanup** - Eliminated code duplication throughout codebase\n- **Dead Code Removal** - Removed unused `missing_param` helper, deprecated `tauri-api.ts`, redundant `KimiModelSelector`\n\n---\n\n## Internal Optimizations (User Transparent)\n\n### Removed Legacy Migration Logic\n\nv3.6.0 removed v1 config auto-migration and copy file scanning logic:\n\n- **Impact**: Improved startup performance, cleaner codebase\n- **Compatibility**: v2 format configs fully compatible, no action required\n- **Note**: Users upgrading from v3.1.0 or earlier should first upgrade to v3.2.x or v3.5.x for one-time migration, then upgrade to v3.6.0\n\n### Command Parameter Standardization\n\nBackend unified to use `app` parameter (values: `claude` or `codex`):\n\n- **Impact**: More standardized code, friendlier error prompts\n- **Compatibility**: Frontend fully adapted, users don't need to care about this change\n\n---\n\n## Dependencies\n\n- Updated to **Tauri 2.8.x**\n- Updated to **TailwindCSS 4.x**\n- Updated to **TanStack Query v5.90.x**\n- Maintained **React 18.2.x** and **TypeScript 5.3.x**\n\n</details>\n\n---\n\n## 🌟 About CC Switch\n\nCC Switch is a cross-platform desktop application for managing and switching between different provider configurations for Claude Code and Codex. Built with Tauri 2.0 + React 18 + TypeScript, supporting Windows, macOS, and Linux.\n\n**Core Features**:\n- 🔄 One-click switching between multiple AI providers\n- 📦 Support for both Claude Code and Codex applications\n- 🎨 Modern UI with complete Chinese/English internationalization\n- 🔐 Local storage, secure and reliable data\n- ☁️ Support for cloud sync configurations\n- 🧩 Unified MCP server management\n\n---\n\n**Project Repository**: https://github.com/farion1231/cc-switch\n"}}}} |