openclaw-cn-termux 0.1.9-beta.8 → 0.2.0
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/CHANGELOG.md +18 -0
- package/README.md +83 -19
- package/dist/agents/model-auth.js +1 -0
- package/dist/agents/model-compat.js +1 -1
- package/dist/agents/models-config.providers.js +32 -0
- package/dist/agents/openai-models-discovery.js +82 -0
- package/dist/build-info.json +3 -3
- package/dist/commands/auth-choice-options.js +75 -60
- package/dist/commands/auth-choice.apply.api-providers.js +541 -126
- package/dist/commands/auth-choice.apply.minimax.js +57 -27
- package/dist/commands/auth-choice.apply.volcengine.js +61 -36
- package/dist/commands/configure.gateway-auth.js +13 -1
- package/dist/commands/onboard-auth.config-core.js +61 -0
- package/dist/commands/onboard-auth.credentials.js +11 -0
- package/dist/commands/onboard-auth.js +3 -3
- package/dist/commands/onboard-auth.models.js +32 -0
- package/dist/control-ui/assets/{index-2qR33b5y.js → index-CObyKZDx.js} +1 -1
- package/dist/control-ui/assets/{index-2qR33b5y.js.map → index-CObyKZDx.js.map} +1 -1
- package/dist/control-ui/assets/index-wLSqyTVo.css +1 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/gateway/server-http.js +7 -0
- package/dist/infra/tailnet.js +2 -2
- package/docs/_layouts/default.html +5 -5
- package/docs/aidlux-installation.md +610 -0
- package/docs/docs.json +1 -0
- package/docs/faq.md +437 -0
- package/docs/install/ansible.md +9 -7
- package/docs/install/docker-quick.md +34 -14
- package/docs/install/docker.md +108 -69
- package/docs/install/index.md +2 -2
- package/docs/installation.md +738 -0
- package/docs/providers/ephone.md +154 -0
- package/docs/tools/creating-skills.md +362 -25
- package/docs/troubleshooting.md +439 -0
- package/docs/zh-CN/install/index.md +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/dingtalk-connector/package.json +2 -2
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +2 -2
- package/extensions/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +2 -2
- package/extensions/imessage/package.json +1 -1
- package/extensions/line/package.json +2 -2
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +6 -0
- package/extensions/matrix/package.json +2 -2
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +2 -2
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +2 -2
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +2 -2
- package/extensions/open-prose/package.json +1 -1
- package/extensions/openclaw-weixin/package.json +2 -2
- package/extensions/qqbot/package.json +2 -2
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/wecom-connector/package.json +2 -2
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +2 -2
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +2 -2
- package/package.json +4 -3
- package/dist/control-ui/assets/index-B7ob0C0r.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Docs: https://clawd.org.cn/
|
|
4
4
|
|
|
5
|
+
## 0.2.0
|
|
6
|
+
|
|
7
|
+
### 新增功能
|
|
8
|
+
|
|
9
|
+
- **新增 ePhone AI 模型供应商**:在模型配置向导中新增 [ePhone AI](https://platform.ephone.ai) 聚合平台,置顶为默认推荐供应商。兼容 OpenAI 协议(`https://api.ephone.ai/v1`),预设 claude-sonnet-4-6、claude-opus-4-6、MiniMax-M2.7、gpt-5.4、kimi-k2.5 五个可选模型,同时支持手动输入任意模型 ID。配置文档:https://clawd.org.cn/providers/ephone.html
|
|
10
|
+
|
|
11
|
+
- **模型配置向导支持动态模型发现**:配置模型供应商时,自动从供应商 API(`/v1/models`)获取可用模型列表并展示在选择界面中。支持的供应商:ePhone AI、MiniMax、Moonshot(国际/.cn)、DeepSeek、阿里云百炼(DashScope)、硅基流动(SiliconFlow)、火山引擎(ARK + Coding Plan)、Z.AI(智谱)、小米 MiMo。API 不可达时自动降级到静态模型列表
|
|
12
|
+
|
|
13
|
+
- **重新排列供应商选择顺序**:配置向导中供应商列表按区域分组:国内模型厂商(MiniMax、Moonshot、DeepSeek、阿里云百炼、硅基流动、火山引擎、Z.AI、小米、通义千问)优先展示,国际厂商和通用选项排在后面
|
|
14
|
+
|
|
15
|
+
- **修复多个供应商配置后多余的模型选择步骤**:Moonshot、Z.AI、小米、火山引擎、MiniMax 等供应商在配置流程中已内置模型选择,但之前配置完成后仍会弹出通用的 `promptModelAllowlist` 步骤。现已将这些供应商加入 early-return 列表,避免重复选择
|
|
16
|
+
|
|
17
|
+
### bug修复
|
|
18
|
+
|
|
19
|
+
- **修复 Windows 全局安装后 CLI 启动报 `Cannot find package 'strip-ansi'`**(#538):上游依赖 `@mariozechner/pi-coding-agent` 的 `bash-executor.js` 中直接 `import stripAnsi from "strip-ansi"`,但未将 `strip-ansi` 声明为 `dependencies`(幽灵依赖)。pnpm 工作区下因提升机制可正常解析,但通过 `npm install -g openclaw-cn` 全局安装时 npm 的扁平化 `node_modules` 不会安装未声明的传递依赖,导致运行时 `ERR_MODULE_NOT_FOUND`。修复方案:在 `package.json` 中将 `strip-ansi` 添加为直接依赖,确保全局安装时始终可用。感谢 @bolong2016 🙏
|
|
20
|
+
- **修复对话页面输入区渐变产生深色蒙层**(#537):`.chat-compose` 的背景渐变使用 CSS `transparent`(等同于 `rgba(0,0,0,0)` 即透明黑色),浏览器在 sRGB 空间从透明黑色插值到浅色背景时会经过半透明灰色,产生可见的深色条带覆盖对话内容。修复方案:新增 `--bg-transparent` / `--bg-content-transparent` CSS 变量(与背景色同色但 alpha 为 0),替换所有渐变中的 `transparent` 关键字,确保插值始终在同一色相内过渡。感谢 @hyydmmhy 🙏
|
|
21
|
+
- **修复 Tailscale 直连网关时 WebSocket 断开 (1006)**(#527):当网关配置 `bind: "tailnet"` 绑定到 Tailscale IP(如 `100.x.x.x`)时,浏览器访问控制台页面后 WebSocket 升级请求的 Origin 为 Tailscale IP,但 `isValidWebSocketOrigin()` 的 CSWSH 白名单仅包含 localhost/127.x/\*.ts.net,导致返回 403 + socket.destroy(),浏览器收到 1006 异常关闭。修复方案:在 Origin 白名单中新增 Tailscale IP 范围(100.64.0.0/10 IPv4 + fd7a:115c:a1e0::/48 IPv6)。感谢 @crossgg 🙏
|
|
22
|
+
|
|
5
23
|
## 0.1.9
|
|
6
24
|
|
|
7
25
|
### 文档
|
package/README.md
CHANGED
|
@@ -21,6 +21,19 @@
|
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
+
## 💎 赞助商
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
<a href="https://platform.ephone.ai">
|
|
28
|
+
<img src="https://platform.ephone.ai/logo-e.png" alt="ePhone AI" height="48">
|
|
29
|
+
</a>
|
|
30
|
+
</p>
|
|
31
|
+
<p align="center">
|
|
32
|
+
<a href="https://platform.ephone.ai"><b>ePhone AI</b></a> — 统一接入,极速集成;支持 Claude、GPT 等主流模型
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
24
37
|
## ✨ 特性
|
|
25
38
|
|
|
26
39
|
- **📱 Termux + AidLux 优化** — 专为 Android Termux 和 AidLux 环境设计,移动端也能运行 AI 助手
|
|
@@ -33,33 +46,41 @@
|
|
|
33
46
|
|
|
34
47
|
## 🚀 快速开始
|
|
35
48
|
|
|
36
|
-
**环境要求:** Node.js ≥ 22
|
|
49
|
+
**环境要求:** Node.js ≥ 22
|
|
50
|
+
|
|
51
|
+
### 一键安装(推荐)
|
|
52
|
+
|
|
53
|
+
**macOS / Linux:**
|
|
37
54
|
|
|
38
55
|
```bash
|
|
39
|
-
|
|
40
|
-
|
|
56
|
+
curl -fsSL https://clawd.org.cn/install.sh | bash
|
|
57
|
+
```
|
|
41
58
|
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
**Termux(推荐在 Termux 中通过 proot-distro 运行 Ubuntu):**
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
curl -fsSL https://raw.githubusercontent.com/byteuser1977/termux-install-openclaw/main/scripts/install-ubuntu.sh | bash
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**AidLux:**
|
|
44
66
|
|
|
45
|
-
|
|
46
|
-
openclaw-
|
|
67
|
+
```bash
|
|
68
|
+
curl -fsSL https://raw.githubusercontent.com/byteuser1977/termux-install-openclaw/main/scripts/install-aidlux.sh | bash
|
|
47
69
|
```
|
|
48
70
|
|
|
49
|
-
|
|
71
|
+
安装脚本会自动处理 Node 检测、安装和初始配置。
|
|
50
72
|
|
|
51
|
-
### npm
|
|
73
|
+
### npm 安装
|
|
52
74
|
|
|
53
75
|
```bash
|
|
54
76
|
npm install -g openclaw-cn-termux@latest
|
|
55
|
-
|
|
56
|
-
pnpm add -g openclaw-cn-termux@latest
|
|
77
|
+
openclaw-termux onboard --install-daemon
|
|
57
78
|
```
|
|
58
79
|
|
|
59
80
|
### 从源码构建
|
|
60
81
|
|
|
61
82
|
```bash
|
|
62
|
-
git clone https://github.com/
|
|
83
|
+
git clone https://github.com/byteuser977/openclaw-cn-termux.git
|
|
63
84
|
cd openclaw-cn-termux
|
|
64
85
|
|
|
65
86
|
pnpm install
|
|
@@ -69,9 +90,40 @@ pnpm build
|
|
|
69
90
|
pnpm openclaw-termux onboard --install-daemon
|
|
70
91
|
```
|
|
71
92
|
|
|
93
|
+
### Termux/AidLux 移动端安装
|
|
94
|
+
|
|
95
|
+
本项目专为 Android Termux 和 AidLux 环境优化,已将所有 GitHub 依赖构建为 npm 包,国内用户可使用淘宝镜像源快速安装。
|
|
96
|
+
|
|
97
|
+
**一键安装(推荐):**
|
|
98
|
+
|
|
99
|
+
| 环境 | 一键安装命令 |
|
|
100
|
+
| ------ | -------------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| Termux | `curl -fsSL https://raw.githubusercontent.com/byteuser1977/termux-install-openclaw/main/scripts/install-ubuntu.sh \| bash` |
|
|
102
|
+
| AidLux | `curl -fsSL https://raw.githubusercontent.com/byteuser1977/termux-install-openclaw/main/scripts/install-aidlux.sh \| bash` |
|
|
103
|
+
|
|
104
|
+
**手动安装步骤:**
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# 1. 安装 Node.js 22+
|
|
108
|
+
pkg update && pkg install nodejs
|
|
109
|
+
|
|
110
|
+
# 2. 使用淘宝镜像安装(国内推荐)
|
|
111
|
+
npm install -g openclaw-cn-termux@latest --registry=https://registry.npmmirror.com
|
|
112
|
+
|
|
113
|
+
# 3. 运行初始配置
|
|
114
|
+
openclaw-termux onboard
|
|
115
|
+
|
|
116
|
+
# 4. 启动网关
|
|
117
|
+
openclaw-termux gateway run
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
详细文档:[Termux 完整安装手册](https://clawd.org.cn/docs/installation) · [AidLux 安装手册](https://clawd.org.cn/docs/aidlux-installation)
|
|
121
|
+
|
|
72
122
|
## 🔧 配置
|
|
73
123
|
|
|
74
|
-
|
|
124
|
+
配置文件位于 `~/.openclaw/` 目录(桌面端)或 `~/.openclaw-cn-termux/` 目录(Termux)。
|
|
125
|
+
|
|
126
|
+
最小配置示例:
|
|
75
127
|
|
|
76
128
|
```json
|
|
77
129
|
{
|
|
@@ -81,14 +133,26 @@ pnpm openclaw-termux onboard --install-daemon
|
|
|
81
133
|
}
|
|
82
134
|
```
|
|
83
135
|
|
|
84
|
-
|
|
136
|
+
详细配置请参考:[网关配置文档](https://clawd.org.cn/docs/gateway/configuration)
|
|
85
137
|
|
|
86
|
-
|
|
138
|
+
## 📚 文档
|
|
87
139
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
140
|
+
详细安装和配置文档:`https://clawd.org.cn/docs/`
|
|
141
|
+
|
|
142
|
+
### 常用文档链接
|
|
143
|
+
|
|
144
|
+
| 文档 | 说明 |
|
|
145
|
+
| ----------------------------------------------------------- | ------------------------ |
|
|
146
|
+
| [快速入门](https://clawd.org.cn/docs/start/getting-started) | 首次使用指南 |
|
|
147
|
+
| [安装脚本详解](https://clawd.org.cn/docs/install/installer) | install.sh 参数和自动化 |
|
|
148
|
+
| [Node.js 安装](https://clawd.org.cn/docs/install/node) | PATH 问题排查 |
|
|
149
|
+
| [npm/pnpm 安装](https://clawd.org.cn/docs/install) | npm/pnpm 方式安装 |
|
|
150
|
+
| [从源码构建](https://clawd.org.cn/docs/install) | 开发者构建指南 |
|
|
151
|
+
| [更新 OpenClaw](https://clawd.org.cn/docs/install/updating) | 更新和回滚策略 |
|
|
152
|
+
| [卸载](https://clawd.org.cn/docs/install/uninstall) | 完全卸载指南 |
|
|
153
|
+
| [网关配置](https://clawd.org.cn/docs/gateway/configuration) | 网关配置参考 |
|
|
154
|
+
| [渠道配置](https://clawd.org.cn/docs/channels) | WhatsApp/Telegram 等配置 |
|
|
155
|
+
| [技能扩展](https://clawd.org.cn/docs/tools/skills) | 技能系统说明 |
|
|
92
156
|
|
|
93
157
|
## 🔄 版本同步
|
|
94
158
|
|
|
@@ -226,6 +226,7 @@ export function resolveEnvApiKey(provider) {
|
|
|
226
226
|
venice: "VENICE_API_KEY",
|
|
227
227
|
mistral: "MISTRAL_API_KEY",
|
|
228
228
|
opencode: "OPENCODE_API_KEY",
|
|
229
|
+
ephone: "EPHONE_API_KEY",
|
|
229
230
|
// 新增:OpenAI兼容供应商环境变量映射
|
|
230
231
|
siliconflow: "SILICONFLOW_API_KEY",
|
|
231
232
|
dashscope: "DASHSCOPE_API_KEY",
|
|
@@ -4,7 +4,7 @@ function isOpenAiCompletionsModel(model) {
|
|
|
4
4
|
/**
|
|
5
5
|
* Ensures the model has an `input` field to prevent crashes in upstream SDK.
|
|
6
6
|
* The SDK uses `model.input.includes("image")` without null checking.
|
|
7
|
-
* @see https://github.com/
|
|
7
|
+
* @see https://github.com/byteuser977/openclaw-cn-termux/issues/32
|
|
8
8
|
*/
|
|
9
9
|
function ensureModelInput(model) {
|
|
10
10
|
if (model.input && Array.isArray(model.input))
|
|
@@ -60,6 +60,16 @@ const OLLAMA_DEFAULT_COST = {
|
|
|
60
60
|
cacheRead: 0,
|
|
61
61
|
cacheWrite: 0,
|
|
62
62
|
};
|
|
63
|
+
const EPHONE_BASE_URL = "https://api.ephone.ai/v1";
|
|
64
|
+
const EPHONE_DEFAULT_MODEL_ID = "claude-sonnet-4-6";
|
|
65
|
+
const EPHONE_DEFAULT_CONTEXT_WINDOW = 200000;
|
|
66
|
+
const EPHONE_DEFAULT_MAX_TOKENS = 8192;
|
|
67
|
+
const EPHONE_DEFAULT_COST = {
|
|
68
|
+
input: 0,
|
|
69
|
+
output: 0,
|
|
70
|
+
cacheRead: 0,
|
|
71
|
+
cacheWrite: 0,
|
|
72
|
+
};
|
|
63
73
|
// 新增:OpenAI兼容供应商(硅基流动、阿里云百炼、DeepSeek)默认配置
|
|
64
74
|
const SILICONFLOW_BASE_URL = "https://api.siliconflow.cn/v1";
|
|
65
75
|
// 采用在中文环境中更常见且可用的Qwen 2.5指令模型作为默认
|
|
@@ -427,6 +437,23 @@ export function buildXiaomiProvider() {
|
|
|
427
437
|
],
|
|
428
438
|
};
|
|
429
439
|
}
|
|
440
|
+
function buildEphoneProvider() {
|
|
441
|
+
return {
|
|
442
|
+
baseUrl: EPHONE_BASE_URL,
|
|
443
|
+
api: "openai-completions",
|
|
444
|
+
models: [
|
|
445
|
+
{
|
|
446
|
+
id: EPHONE_DEFAULT_MODEL_ID,
|
|
447
|
+
name: "Claude Sonnet 4.6",
|
|
448
|
+
reasoning: false,
|
|
449
|
+
input: ["text"],
|
|
450
|
+
cost: EPHONE_DEFAULT_COST,
|
|
451
|
+
contextWindow: EPHONE_DEFAULT_CONTEXT_WINDOW,
|
|
452
|
+
maxTokens: EPHONE_DEFAULT_MAX_TOKENS,
|
|
453
|
+
},
|
|
454
|
+
],
|
|
455
|
+
};
|
|
456
|
+
}
|
|
430
457
|
function buildSiliconflowProvider() {
|
|
431
458
|
return {
|
|
432
459
|
baseUrl: SILICONFLOW_BASE_URL,
|
|
@@ -570,6 +597,11 @@ export async function resolveImplicitProviders(params) {
|
|
|
570
597
|
if (veniceKey) {
|
|
571
598
|
providers.venice = { ...(await buildVeniceProvider()), apiKey: veniceKey };
|
|
572
599
|
}
|
|
600
|
+
const ephoneKey = resolveEnvApiKeyVarName("ephone") ??
|
|
601
|
+
resolveApiKeyFromProfiles({ provider: "ephone", store: authStore });
|
|
602
|
+
if (ephoneKey) {
|
|
603
|
+
providers.ephone = { ...buildEphoneProvider(), apiKey: ephoneKey };
|
|
604
|
+
}
|
|
573
605
|
const siliconKey = resolveEnvApiKeyVarName("siliconflow") ??
|
|
574
606
|
resolveApiKeyFromProfiles({ provider: "siliconflow", store: authStore });
|
|
575
607
|
if (siliconKey) {
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const DEFAULT_TIMEOUT_MS = 8_000;
|
|
2
|
+
const DEFAULT_CONTEXT_WINDOW = 128_000;
|
|
3
|
+
const DEFAULT_MAX_TOKENS = 8192;
|
|
4
|
+
const ZERO_COST = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
|
|
5
|
+
/**
|
|
6
|
+
* Fetch available models from any OpenAI-compatible `/v1/models` endpoint.
|
|
7
|
+
* Returns null on failure so callers can fall back to static lists.
|
|
8
|
+
*/
|
|
9
|
+
export async function discoverOpenAICompatibleModels(params) {
|
|
10
|
+
if (process.env.VITEST === "true" || process.env.NODE_ENV === "test") {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const { baseUrl, apiKey, timeoutMs = DEFAULT_TIMEOUT_MS, filter } = params;
|
|
14
|
+
const url = baseUrl.replace(/\/+$/, "");
|
|
15
|
+
const modelsUrl = url.endsWith("/models") ? url : `${url}/models`;
|
|
16
|
+
try {
|
|
17
|
+
const headers = { Accept: "application/json" };
|
|
18
|
+
if (apiKey?.trim()) {
|
|
19
|
+
headers.Authorization = `Bearer ${apiKey.trim()}`;
|
|
20
|
+
}
|
|
21
|
+
const response = await fetch(modelsUrl, {
|
|
22
|
+
method: "GET",
|
|
23
|
+
headers,
|
|
24
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
25
|
+
});
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const body = (await response.json());
|
|
30
|
+
const data = body?.data;
|
|
31
|
+
if (!Array.isArray(data) || data.length === 0) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const seen = new Set();
|
|
35
|
+
const models = [];
|
|
36
|
+
for (const entry of data) {
|
|
37
|
+
const id = typeof entry?.id === "string" ? entry.id.trim() : "";
|
|
38
|
+
if (!id || seen.has(id))
|
|
39
|
+
continue;
|
|
40
|
+
if (filter && !filter(entry))
|
|
41
|
+
continue;
|
|
42
|
+
seen.add(id);
|
|
43
|
+
models.push({
|
|
44
|
+
id,
|
|
45
|
+
name: id,
|
|
46
|
+
reasoning: false,
|
|
47
|
+
input: ["text"],
|
|
48
|
+
cost: ZERO_COST,
|
|
49
|
+
contextWindow: DEFAULT_CONTEXT_WINDOW,
|
|
50
|
+
maxTokens: DEFAULT_MAX_TOKENS,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return models.length > 0 ? models : null;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Build select options from discovered models for the configure wizard.
|
|
61
|
+
* Prepends pinned models at the top (preserving order), appends a "custom" entry.
|
|
62
|
+
*/
|
|
63
|
+
export function buildDiscoveredModelOptions(params) {
|
|
64
|
+
const { discovered, pinnedIds = [], customLabel = "手动输入模型 ID" } = params;
|
|
65
|
+
const idSet = new Set(discovered.map((m) => m.id));
|
|
66
|
+
const options = [];
|
|
67
|
+
const added = new Set();
|
|
68
|
+
for (const id of pinnedIds) {
|
|
69
|
+
if (idSet.has(id) && !added.has(id)) {
|
|
70
|
+
added.add(id);
|
|
71
|
+
options.push({ value: id, label: id });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
for (const model of discovered) {
|
|
75
|
+
if (!added.has(model.id)) {
|
|
76
|
+
added.add(model.id);
|
|
77
|
+
options.push({ value: model.id, label: model.id });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
options.push({ value: "custom", label: customLabel });
|
|
81
|
+
return options;
|
|
82
|
+
}
|
package/dist/build-info.json
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
const AUTH_CHOICE_GROUP_DEFS = [
|
|
2
|
+
// ── 赞助商(始终第一)──
|
|
2
3
|
{
|
|
3
|
-
value: "
|
|
4
|
-
label: "
|
|
5
|
-
hint: "
|
|
6
|
-
choices: ["
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
value: "anthropic",
|
|
10
|
-
label: "Anthropic",
|
|
11
|
-
hint: "setup-token + API key",
|
|
12
|
-
choices: ["token", "apiKey"],
|
|
4
|
+
value: "ephone",
|
|
5
|
+
label: "ePhone AI",
|
|
6
|
+
hint: "支持Claude等主流模型,官方优惠",
|
|
7
|
+
choices: ["ephone-api-key"],
|
|
13
8
|
},
|
|
9
|
+
// ── 国内模型厂商 ──
|
|
14
10
|
{
|
|
15
11
|
value: "minimax",
|
|
16
12
|
label: "MiniMax",
|
|
17
|
-
hint: "M2.5
|
|
13
|
+
hint: "M2.5(推荐)",
|
|
18
14
|
choices: ["minimax-portal", "minimax-api-key"],
|
|
19
15
|
},
|
|
20
16
|
{
|
|
@@ -29,40 +25,71 @@ const AUTH_CHOICE_GROUP_DEFS = [
|
|
|
29
25
|
],
|
|
30
26
|
},
|
|
31
27
|
{
|
|
32
|
-
value: "
|
|
33
|
-
label: "
|
|
34
|
-
hint: "
|
|
35
|
-
choices: ["
|
|
28
|
+
value: "deepseek",
|
|
29
|
+
label: "DeepSeek",
|
|
30
|
+
hint: "OpenAI兼容 · API key",
|
|
31
|
+
choices: ["deepseek-api-key"],
|
|
36
32
|
},
|
|
37
33
|
{
|
|
38
|
-
value: "
|
|
39
|
-
label: "
|
|
40
|
-
hint: "
|
|
41
|
-
choices: ["
|
|
34
|
+
value: "dashscope",
|
|
35
|
+
label: "阿里云百炼 (DashScope)",
|
|
36
|
+
hint: "OpenAI兼容 · API key",
|
|
37
|
+
choices: ["dashscope-api-key", "dashscope-coding-plan-api-key"],
|
|
42
38
|
},
|
|
43
39
|
{
|
|
44
|
-
value: "
|
|
45
|
-
label: "
|
|
46
|
-
hint: "
|
|
47
|
-
choices: ["
|
|
40
|
+
value: "siliconflow",
|
|
41
|
+
label: "硅基流动 (SiliconFlow)",
|
|
42
|
+
hint: "OpenAI兼容 · API key",
|
|
43
|
+
choices: ["siliconflow-api-key"],
|
|
48
44
|
},
|
|
49
45
|
{
|
|
50
|
-
value: "
|
|
51
|
-
label: "
|
|
46
|
+
value: "volcengine",
|
|
47
|
+
label: "火山引擎 (VolcanoEngine)",
|
|
48
|
+
hint: "ARK API key + Coding Plan",
|
|
49
|
+
choices: ["volcengine-api-key", "volcengine-coding-plan-api-key"],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: "zai",
|
|
53
|
+
label: "Z.AI (GLM-5)",
|
|
52
54
|
hint: "API key",
|
|
53
|
-
choices: ["
|
|
55
|
+
choices: ["zai-api-key"],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: "xiaomi",
|
|
59
|
+
label: "Xiaomi (MiMo)",
|
|
60
|
+
hint: "API key",
|
|
61
|
+
choices: ["xiaomi-api-key"],
|
|
54
62
|
},
|
|
55
63
|
{
|
|
56
64
|
value: "qwen",
|
|
57
|
-
label: "Qwen",
|
|
65
|
+
label: "Qwen (通义千问)",
|
|
58
66
|
hint: "OAuth",
|
|
59
67
|
choices: ["qwen-portal"],
|
|
60
68
|
},
|
|
69
|
+
// ── 国际厂商 ──
|
|
61
70
|
{
|
|
62
|
-
value: "
|
|
63
|
-
label: "
|
|
71
|
+
value: "openai",
|
|
72
|
+
label: "OpenAI",
|
|
73
|
+
hint: "Codex OAuth + API key",
|
|
74
|
+
choices: ["openai-codex", "openai-api-key"],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
value: "anthropic",
|
|
78
|
+
label: "Anthropic",
|
|
79
|
+
hint: "setup-token + API key",
|
|
80
|
+
choices: ["token", "apiKey"],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: "google",
|
|
84
|
+
label: "Google",
|
|
85
|
+
hint: "Gemini API key + OAuth",
|
|
86
|
+
choices: ["gemini-api-key", "google-antigravity", "google-gemini-cli"],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
value: "openrouter",
|
|
90
|
+
label: "OpenRouter",
|
|
64
91
|
hint: "API key",
|
|
65
|
-
choices: ["
|
|
92
|
+
choices: ["openrouter-api-key"],
|
|
66
93
|
},
|
|
67
94
|
{
|
|
68
95
|
value: "copilot",
|
|
@@ -70,6 +97,19 @@ const AUTH_CHOICE_GROUP_DEFS = [
|
|
|
70
97
|
hint: "GitHub + local proxy",
|
|
71
98
|
choices: ["github-copilot", "copilot-proxy"],
|
|
72
99
|
},
|
|
100
|
+
// ── 通用 / 其他 ──
|
|
101
|
+
{
|
|
102
|
+
value: "ollama",
|
|
103
|
+
label: "Ollama (本地)",
|
|
104
|
+
hint: "本地运行的 Ollama 服务",
|
|
105
|
+
choices: ["ollama-local"],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
value: "custom",
|
|
109
|
+
label: "自定义模型 (兼容 OpenAI/Anthropic)",
|
|
110
|
+
hint: "Bring your own model",
|
|
111
|
+
choices: ["custom-provider-api-key"],
|
|
112
|
+
},
|
|
73
113
|
{
|
|
74
114
|
value: "ai-gateway",
|
|
75
115
|
label: "Vercel AI Gateway",
|
|
@@ -82,12 +122,6 @@ const AUTH_CHOICE_GROUP_DEFS = [
|
|
|
82
122
|
hint: "API key",
|
|
83
123
|
choices: ["opencode-zen"],
|
|
84
124
|
},
|
|
85
|
-
{
|
|
86
|
-
value: "xiaomi",
|
|
87
|
-
label: "Xiaomi",
|
|
88
|
-
hint: "API key",
|
|
89
|
-
choices: ["xiaomi-api-key"],
|
|
90
|
-
},
|
|
91
125
|
{
|
|
92
126
|
value: "synthetic",
|
|
93
127
|
label: "Synthetic",
|
|
@@ -106,34 +140,15 @@ const AUTH_CHOICE_GROUP_DEFS = [
|
|
|
106
140
|
hint: "Account ID + Gateway ID + API key",
|
|
107
141
|
choices: ["cloudflare-ai-gateway-api-key"],
|
|
108
142
|
},
|
|
109
|
-
{
|
|
110
|
-
value: "siliconflow",
|
|
111
|
-
label: "硅基流动 (SiliconFlow)",
|
|
112
|
-
hint: "OpenAI兼容 · API key",
|
|
113
|
-
choices: ["siliconflow-api-key"],
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
value: "dashscope",
|
|
117
|
-
label: "阿里云百炼 (DashScope)",
|
|
118
|
-
hint: "OpenAI兼容 · API key",
|
|
119
|
-
choices: ["dashscope-api-key", "dashscope-coding-plan-api-key"],
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
value: "deepseek",
|
|
123
|
-
label: "DeepSeek",
|
|
124
|
-
hint: "OpenAI兼容 · API key",
|
|
125
|
-
choices: ["deepseek-api-key"],
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
value: "volcengine",
|
|
129
|
-
label: "火山引擎 (VolcanoEngine)",
|
|
130
|
-
hint: "ARK API key + Coding Plan",
|
|
131
|
-
choices: ["volcengine-api-key", "volcengine-coding-plan-api-key"],
|
|
132
|
-
},
|
|
133
143
|
];
|
|
134
144
|
export function buildAuthChoiceOptions(params) {
|
|
135
145
|
void params.store;
|
|
136
146
|
const options = [];
|
|
147
|
+
options.push({
|
|
148
|
+
value: "ephone-api-key",
|
|
149
|
+
label: "ePhone AI API key",
|
|
150
|
+
hint: "模型聚合平台 · 支持 Claude / GPT / MiniMax 等",
|
|
151
|
+
});
|
|
137
152
|
options.push({
|
|
138
153
|
value: "token",
|
|
139
154
|
label: "Anthropic token (paste setup-token)",
|