aicodeswitch 3.0.5 → 3.0.6

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.
@@ -84,7 +84,7 @@ Error generating stack: `+a.message+`
84
84
  `),(g=t.onStdout)==null||g.call(t,`子进程已创建 (PID: ${S.data.pid})
85
85
  `),(y=t.onStdout)==null||y.call(t,`等待 npm 输出...
86
86
 
87
- `);break;case"stdout":(x=t.onStdout)==null||x.call(t,S.data);break;case"stderr":(v=t.onStderr)==null||v.call(t,S.data);break;case"close":console.log("[API Client] 安装完成:",S.data),(b=t.onClose)==null||b.call(t,S.data.code,S.data.success),setTimeout(()=>{a==null||a.close()},1e3);break;case"error":console.error("[API Client] 安装错误:",S.data),(w=t.onError)==null||w.call(t,S.data);break}}catch(S){console.error("[API Client] 解析消息失败:",S,d.data)}},a.onclose=d=>{var f;console.log("[API Client] WebSocket 连接关闭:",d.code,d.reason),d.wasClean||(f=t.onError)==null||f.call(t,"连接意外关闭")},a.onerror=d=>{var f;console.error("[API Client] WebSocket 错误:",d),(f=t.onError)==null||f.call(t,"WebSocket 连接错误")};const o=()=>{console.log("[API Client] 清理 WebSocket 连接"),a&&(a.close(),a=null)},l=d=>{a&&a.readyState===WebSocket.OPEN?(a.send(JSON.stringify({type:"input",data:d})),console.log("[API Client] 发送输入:",d.slice(0,10))):console.warn("[API Client] WebSocket 未连接,无法发送输入")},s=o;return s.sendInput=l,s}};var Sn=(e=>(e.AUTH_TOKEN="authorization",e.API_KEY="x-api-key",e.G_API_KEY="x-goog-api-key",e.AUTO="auto",e))(Sn||{});const In={minimax:{name:"Minimax",description:"国内优秀的大模型 https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://api.minimaxi.com/anthropic",models:"MiniMax-M2.1"},{name:"Coding Plan Codex",sourceType:"openai-chat",apiUrl:"https://api.minimaxi.com/v1",models:"codex-MiniMax-M2.1"}]},glm:{name:"GLM",description:"国内优秀的大模型 https://www.bigmodel.cn/glm-coding?ic=5AH7ATEZSC",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://open.bigmodel.cn/api/anthropic",models:"glm-4.7, glm-4.5-air",modelLimits:{"glm-4.7":131072,"glm-4.5-air":98304}}]},kimi:{name:"Kimi",description:"国内优秀大模型 https://www.kimi.ai/",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://api.kimi.com/coding"}]},doubao:{name:"火山方舟(豆包)",description:"字节旗下大模型平台。Coding Plan一次性支持GLM、Kimi-K2、Deepseek多个国产模型 https://volcengine.com/L/RcHlm6yxj0w/ 邀请码:Y58X463P",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://ark.cn-beijing.volces.com/api/coding",models:"ark-code-latest"},{name:"Coding Plan Codex",sourceType:"openai-responses",apiUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",models:"ark-code-latest"},{name:"付费API兼容Claude Code",sourceType:"claude-code",apiUrl:"https://ark.cn-beijing.volces.com/api/compatible",models:"doubao-seed-code-preview-251028"},{name:"付费API兼容Codex",sourceType:"openai-responses",apiUrl:"https://ark.cn-beijing.volces.com/api/v3",models:"doubao-seed-code-preview-251028"}]},qwen:{name:"阿里云百炼(千问)",description:"国内优秀大模型 https://help.aliyun.com/zh/model-studio/coding-plan",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://coding.dashscope.aliyuncs.com/apps/anthropic",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"Coding Plan Codex",sourceType:"openai-chat",apiUrl:"https://coding.dashscope.aliyuncs.com/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"付费API兼容Codex",sourceType:"openai-responses",apiUrl:"https://dashscope.aliyuncs.com/api/v2/apps/protocols/compatible-mode/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus, kimi-k2.5, glm-4.7, MiniMax-M2.1"}]},aicodewith:{name:"AICodeWith",description:"稳定的第三方中转 https://aicodewith.com/login?tab=register&invitation=QCA74W",services:[{name:"claudecode",sourceType:"claude-code",apiUrl:"https://api.aicodewith.com"},{name:"codex",sourceType:"openai-responses",apiUrl:"https://api.aicodewith.com/chatgpt"}]},openai:{name:"OpenAI",description:"OpenAI 官方 API https://platform.openai.com",services:[{name:"GPT",sourceType:"openai-responses",apiUrl:"https://api.openai.com"}],is_oversea:!0},anthropic:{name:"Anthropic",description:"Anthropic 官方 API https://www.anthropic.com",services:[{name:"Claude",sourceType:"claude-code",apiUrl:"https://api.anthropic.com"}],is_oversea:!0},google:{name:"Google AI",description:"Google AI 官方 API",services:[{name:"Gemini",sourceType:"gemini",apiUrl:"https://generativelanguage.googleapis.com"}],is_oversea:!0},openrouter:{name:"OpenRouter",description:"一站式 AI 模型路由平台 https://openrouter.ai",services:[{name:"Claude Code专属接口",sourceType:"claude-code",apiUrl:"https://openrouter.ai/api",models:"anthropic/claude-opus-4.6, anthropic/claude-opus-4.5, anthropic/claude-sonnet-4.5, anthropic/claude-haiku-4.5",authType:Sn.AUTH_TOKEN},{name:"通用接口",sourceType:"openai-chat",apiUrl:"https://openrouter.ai/api/v1/chat/completions",models:"anthropic/claude-opus-4.5, anthropic/claude-sonnet-4.5, anthropic/claude-haiku-4.5, openai/gpt-5.2-codex, openai/gpt-5.2-chat, openai/gpt-5.2-pro, openai/gpt-5.2, openai/gpt-5.1-codex-max, google/gemini-3-flash-preview, google/gemini-3-pro-preview"}],is_oversea:!0}},Yu={"claude-code":"Claude Code",codex:"Codex"},Gu={"claude-code":"Claude Code","claude-chat":"Claude Chat","openai-responses":"OpenAI Responses","openai-chat":"OpenAI Chat","deepseek-reasoning-chat":"DeepSeek Reasoning Chat",gemini:"Gemini"},y3={"openai-chat":"填写完整的接口地址,如:https://api.openai.com/v1/chat/completions","openai-responses":"只填写 base 地址(含/v1),如:https://api.openai.com/v1","claude-chat":"填写完整的接口地址,如:https://api.anthropic.com/v1/messages","claude-code":"只填写 base 地址,如:https://api.anthropic.com","deepseek-reasoning-chat":"推理类模型,填写完整的接口地址,如:https://api.deepseek.com/v1/chat/completions",gemini:"只填写 base 地址,如:https://generativelanguage.googleapis.com"},G1={[Sn.AUTO]:"自动",[Sn.AUTH_TOKEN]:"AUTH_TOKEN",[Sn.API_KEY]:"API_KEY",[Sn.G_API_KEY]:"GOOGLE_API_KEY"},x3={[Sn.AUTO]:"根据数据源类型自动判断:Claude 相关类型使用 x-api-key header,OpenAI 相关类型使用 Authorization: Bearer header,Gemini 使用 x-goog-api-key header",[Sn.AUTH_TOKEN]:"使用 Authorization: Bearer <token> 进行认证(对应 Claude Code 的 ANTHROPIC_AUTH_TOKEN,以及OpenAI的所有请求)",[Sn.API_KEY]:"使用 x-api-key: <token> 进行认证(对应 Claude Code 的 ANTHROPIC_API_KEY)",[Sn.G_API_KEY]:"使用 x-goog-api-key: <token> 进行认证(对应 Google Gemini API)"},b3=`#### 🚀 智谱 GLM Coding Plan
87
+ `);break;case"stdout":(x=t.onStdout)==null||x.call(t,S.data);break;case"stderr":(v=t.onStderr)==null||v.call(t,S.data);break;case"close":console.log("[API Client] 安装完成:",S.data),(b=t.onClose)==null||b.call(t,S.data.code,S.data.success),setTimeout(()=>{a==null||a.close()},1e3);break;case"error":console.error("[API Client] 安装错误:",S.data),(w=t.onError)==null||w.call(t,S.data);break}}catch(S){console.error("[API Client] 解析消息失败:",S,d.data)}},a.onclose=d=>{var f;console.log("[API Client] WebSocket 连接关闭:",d.code,d.reason),d.wasClean||(f=t.onError)==null||f.call(t,"连接意外关闭")},a.onerror=d=>{var f;console.error("[API Client] WebSocket 错误:",d),(f=t.onError)==null||f.call(t,"WebSocket 连接错误")};const o=()=>{console.log("[API Client] 清理 WebSocket 连接"),a&&(a.close(),a=null)},l=d=>{a&&a.readyState===WebSocket.OPEN?(a.send(JSON.stringify({type:"input",data:d})),console.log("[API Client] 发送输入:",d.slice(0,10))):console.warn("[API Client] WebSocket 未连接,无法发送输入")},s=o;return s.sendInput=l,s}};var Sn=(e=>(e.AUTH_TOKEN="authorization",e.API_KEY="x-api-key",e.G_API_KEY="x-goog-api-key",e.AUTO="auto",e))(Sn||{});const In={minimax:{name:"Minimax",description:"国内优秀的大模型 https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://api.minimaxi.com/anthropic",models:"MiniMax-M2.5"},{name:"Coding Plan Codex",sourceType:"openai-chat",apiUrl:"https://api.minimaxi.com/v1",models:"codex-MiniMax-M2.1, codex-MiniMax-M2.5"}]},glm:{name:"GLM",description:"国内优秀的大模型 https://www.bigmodel.cn/glm-coding?ic=5AH7ATEZSC",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://open.bigmodel.cn/api/anthropic",models:"glm-4.7, glm-4.5-air",modelLimits:{"glm-4.7":131072,"glm-4.5-air":98304}}]},kimi:{name:"Kimi",description:"国内优秀大模型 https://www.kimi.ai/",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://api.kimi.com/coding"}]},doubao:{name:"火山方舟(豆包)",description:"字节旗下大模型平台。Coding Plan一次性支持GLM、Kimi-K2、Deepseek多个国产模型 https://volcengine.com/L/RcHlm6yxj0w/ 邀请码:Y58X463P",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://ark.cn-beijing.volces.com/api/coding",models:"ark-code-latest"},{name:"Coding Plan Codex",sourceType:"openai-responses",apiUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",models:"ark-code-latest"},{name:"付费API兼容Claude Code",sourceType:"claude-code",apiUrl:"https://ark.cn-beijing.volces.com/api/compatible",models:"doubao-seed-code-preview-251028"},{name:"付费API兼容Codex",sourceType:"openai-responses",apiUrl:"https://ark.cn-beijing.volces.com/api/v3",models:"doubao-seed-code-preview-251028"}]},qwen:{name:"阿里云百炼(千问)",description:"国内优秀大模型 https://help.aliyun.com/zh/model-studio/coding-plan",services:[{name:"Coding Plan Claude Code",sourceType:"claude-code",apiUrl:"https://coding.dashscope.aliyuncs.com/apps/anthropic",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"Coding Plan Codex",sourceType:"openai-chat",apiUrl:"https://coding.dashscope.aliyuncs.com/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"付费API兼容Codex",sourceType:"openai-responses",apiUrl:"https://dashscope.aliyuncs.com/api/v2/apps/protocols/compatible-mode/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus, kimi-k2.5, glm-4.7, MiniMax-M2.1"}]},aicodewith:{name:"AICodeWith",description:"稳定的第三方中转 https://aicodewith.com/login?tab=register&invitation=QCA74W",services:[{name:"claudecode",sourceType:"claude-code",apiUrl:"https://api.aicodewith.com"},{name:"codex",sourceType:"openai-responses",apiUrl:"https://api.aicodewith.com/chatgpt"}]},openai:{name:"OpenAI",description:"OpenAI 官方 API https://platform.openai.com",services:[{name:"GPT",sourceType:"openai-responses",apiUrl:"https://api.openai.com"}],is_oversea:!0},anthropic:{name:"Anthropic",description:"Anthropic 官方 API https://www.anthropic.com",services:[{name:"Claude",sourceType:"claude-code",apiUrl:"https://api.anthropic.com"}],is_oversea:!0},google:{name:"Google AI",description:"Google AI 官方 API",services:[{name:"Gemini",sourceType:"gemini",apiUrl:"https://generativelanguage.googleapis.com"}],is_oversea:!0},openrouter:{name:"OpenRouter",description:"一站式 AI 模型路由平台 https://openrouter.ai",services:[{name:"Claude Code专属接口",sourceType:"claude-code",apiUrl:"https://openrouter.ai/api",models:"anthropic/claude-opus-4.6, anthropic/claude-opus-4.5, anthropic/claude-sonnet-4.5, anthropic/claude-haiku-4.5",authType:Sn.AUTH_TOKEN},{name:"通用接口",sourceType:"openai-chat",apiUrl:"https://openrouter.ai/api/v1/chat/completions",models:"anthropic/claude-opus-4.5, anthropic/claude-sonnet-4.5, anthropic/claude-haiku-4.5, openai/gpt-5.2-codex, openai/gpt-5.2-chat, openai/gpt-5.2-pro, openai/gpt-5.2, openai/gpt-5.1-codex-max, google/gemini-3-flash-preview, google/gemini-3-pro-preview"}],is_oversea:!0}},Yu={"claude-code":"Claude Code",codex:"Codex"},Gu={"claude-code":"Claude Code","claude-chat":"Claude Chat","openai-responses":"OpenAI Responses","openai-chat":"OpenAI Chat","deepseek-reasoning-chat":"DeepSeek Reasoning Chat",gemini:"Gemini"},y3={"openai-chat":"填写完整的接口地址,如:https://api.openai.com/v1/chat/completions","openai-responses":"只填写 base 地址(含/v1),如:https://api.openai.com/v1","claude-chat":"填写完整的接口地址,如:https://api.anthropic.com/v1/messages","claude-code":"只填写 base 地址,如:https://api.anthropic.com","deepseek-reasoning-chat":"推理类模型,填写完整的接口地址,如:https://api.deepseek.com/v1/chat/completions",gemini:"只填写 base 地址,如:https://generativelanguage.googleapis.com"},G1={[Sn.AUTO]:"自动",[Sn.AUTH_TOKEN]:"AUTH_TOKEN",[Sn.API_KEY]:"API_KEY",[Sn.G_API_KEY]:"GOOGLE_API_KEY"},x3={[Sn.AUTO]:"根据数据源类型自动判断:Claude 相关类型使用 x-api-key header,OpenAI 相关类型使用 Authorization: Bearer header,Gemini 使用 x-goog-api-key header",[Sn.AUTH_TOKEN]:"使用 Authorization: Bearer <token> 进行认证(对应 Claude Code 的 ANTHROPIC_AUTH_TOKEN,以及OpenAI的所有请求)",[Sn.API_KEY]:"使用 x-api-key: <token> 进行认证(对应 Claude Code 的 ANTHROPIC_API_KEY)",[Sn.G_API_KEY]:"使用 x-goog-api-key: <token> 进行认证(对应 Google Gemini API)"},b3=`#### 🚀 智谱 GLM Coding Plan
88
88
 
89
89
  > 价格便宜,国内速度快,支持多工具(Claude Code等 20+ 大编程工具),而且其中的GLM-4.7是目前国内最强编程模型。适合对模型有一定要求,同时又无法获取国外模型的朋友入手。
90
90
  >
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>AI Code Switch</title>
7
- <script type="module" crossorigin src="./assets/index-DYkQE3fV.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-itoCE7yt.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="./assets/index-BFZeqM0H.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicodeswitch",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "A tool to help you manage AI programming tools to access large language models locally. It allows your Claude Code, Codex and other tools to no longer be limited to official models.",
5
5
  "author": "tangshuang",
6
6
  "license": "GPL-3.0",