dsh-volcengine-provider 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/docs/arkcli-contract.md +1 -1
- package/docs/changelog.md +12 -0
- package/docs/client-model-thinking-preview.png +0 -0
- package/docs/client-settings-preview-dark.png +0 -0
- package/docs/client-settings-preview-empty.png +0 -0
- package/docs/client-settings-preview-mobile-dark.png +0 -0
- package/docs/client-settings-preview-models.png +0 -0
- package/docs/client-settings-preview.png +0 -0
- package/docs/development.md +1 -0
- package/docs/model-capabilities.md +54 -14
- package/docs/model-management.md +6 -2
- package/docs/model-thinking-audit.md +54 -9
- package/docs/usage.md +7 -1
- package/docs/validation.md +17 -2
- package/lib/ark-adapter.mjs +26 -5
- package/lib/browser-bridge/win32/rundll32.exe +0 -0
- package/lib/catalog-snapshot.json +1 -1
- package/lib/catalog.mjs +72 -3
- package/lib/client.js +156 -34
- package/lib/consumption-rates.json +86 -0
- package/lib/messages-payload.mjs +15 -3
- package/lib/state.mjs +9 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -58,11 +58,11 @@ Agent Plan 与 Coding Plan 各有独立的启用开关、账号选择、模型
|
|
|
58
58
|
|
|
59
59
|
从官方套餐目录同步可用模型清单,按账号和套餐分别保存。能力参数依据官方 Plan Pi 文档和官方目录固化,显式匹配别名与版本,旧缓存默认值随快照更新,手动覆盖保留;来源与冲突见[能力参数](docs/model-capabilities.md)。每个模型可独立启停,目录刷新不清空设置;Auto/未知模型保守标记。
|
|
60
60
|
|
|
61
|
-
设置页和模型选择器使用友好名称,原始调用 ID
|
|
61
|
+
设置页和模型选择器使用友好名称,原始调用 ID 可在模型技术详情中查看。模型卡片在名称旁展示消耗倍率与限时折扣,并汇总视觉、思考、上下文和输出能力;倍率来源与 Coding Plan 的参考语义见[能力参数](docs/model-capabilities.md#消耗倍率)。查看[模型卡片预览](docs/client-settings-preview-models.png)与[模型与思考配置预览](docs/client-model-thinking-preview.png)。
|
|
62
62
|
|
|
63
63
|
### 调整模型参数
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
按账号、套餐和模型管理图片输入、工具调用、上下文长度、默认输出 token、温度及思考档位,支持恢复目录默认值。图片覆盖只影响本地能力声明;工具调用关闭时保留历史记录,但不再允许新的工具调用。当前通道不支持直接传入音频或视频。思考方式与官方资料中的差异见[思考参数核对表](docs/model-thinking-audit.md)。
|
|
66
66
|
|
|
67
67
|
单次请求显式填写的参数优先。温度在启用思考时可能被传输层忽略,最终 token 数还受思考预算与上下文约束。详见[模型管理](docs/model-management.md)。
|
|
68
68
|
|
|
@@ -72,7 +72,7 @@ Coding Plan 展示剩余百分比;Agent Plan 同时展示 AFP 已用量、上
|
|
|
72
72
|
|
|
73
73
|
## 使用条件
|
|
74
74
|
|
|
75
|
-
- **DSH Core**:`0.2.1-rc.
|
|
75
|
+
- **DSH Core**:`0.2.1-rc.5`。
|
|
76
76
|
- **Node.js**:`>=22.19.0`。
|
|
77
77
|
- **ArkCli**:当前按 `1.0.37` 命令契约适配;网页登录仅开放已核验的 Windows ArkCli `1.0.37`,其他平台/版本在登录前拒绝。
|
|
78
78
|
- **Chrome**:网页登录需已安装 Google Chrome;插件的 `playwright-core` 依赖负责独立临时窗口,不下载浏览器。
|
package/docs/arkcli-contract.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## 版本与证据
|
|
4
4
|
|
|
5
|
-
目标 DSH Core 为 **0.2.1-rc.
|
|
5
|
+
目标 DSH Core 为 **0.2.1-rc.5**;ArkCli 命令契约对照 **@volcengine/ark-cli 1.0.37** 的帮助、随包官方 Skills 与官方仓库文档。帮助、raw API 的 `--dry-run` 和 Windows 同设备真实登录已核验;真实额度和推理调用尚未执行。网页登录的启动器拦截契约仅对 Windows ArkCli 1.0.37 核验,其他平台/版本在登录前拒绝。
|
|
6
6
|
|
|
7
7
|
## OAuth
|
|
8
8
|
|
package/docs/changelog.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
[返回主页](../README.md)
|
|
4
4
|
|
|
5
|
+
## 0.2.9
|
|
6
|
+
|
|
7
|
+
- 适配 DSH Core `0.2.1-rc.5`,继续复用公开 `PiAiAdapter` 与 `@earendil-works/pi-ai@1.1.0`。
|
|
8
|
+
- 重建设置页的视觉层级:独立套餐卡片、紧凑额度网格、清晰的页头与开关;模型改为卡片式布局,保留原有账号、参数、额度和异步保护。
|
|
9
|
+
- 模型名称旁新增消耗倍率与限时折扣标识,并展示视觉、思考、上下文和输出标签;倍率按官方资料与活动时间解析,不进入 Core 请求配置。
|
|
10
|
+
- 深浅色、390px 窄屏与窄内容栏通过真实 React/Chrome 离线验证,四组主题令牌组合的文字对比度均达到 WCAG AA。
|
|
11
|
+
|
|
12
|
+
## 0.2.8
|
|
13
|
+
|
|
14
|
+
- 新增按账号、套餐和模型分别勾选图片输入与工具调用的设置,可逐项恢复继承,并区分模型原生模态与当前传输能力。
|
|
15
|
+
- 复核官方模型能力资料,记录多模态、思考控制与来源冲突。
|
|
16
|
+
|
|
5
17
|
## 0.2.7
|
|
6
18
|
|
|
7
19
|
- 重新整理设置页的信息层级,突出套餐额度、重置时间与管理操作。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/development.md
CHANGED
|
@@ -84,6 +84,7 @@ git push origin v<version>
|
|
|
84
84
|
|
|
85
85
|
- [Host 验证脚本](../scripts/host-smoke.mjs):`DSH_TEST_HOST_ROOT` 指向目标 Core 的 `dsh` 目录,ASAR 使用对应 Electron 的 Node 模式。
|
|
86
86
|
- [逐模型思考验证](../scripts/model-thinking-smoke.mjs):使用同一目标 Core 与 SDK,覆盖两套餐的声明默认、原生档、关闭、未强制及动态 Auto,HTTP 全部由本地替身响应。
|
|
87
|
+
- [模型能力验证](../scripts/model-capabilities-smoke.mjs):使用同一目标 Core 与 SDK,验证两套餐的图片能力声明、工具选择和已准备请求的隔离;使用临时状态、假凭据与 HTTP 替身。
|
|
87
88
|
- [浏览器验证脚本](../scripts/browser-smoke.cjs):使用既有 Playwright、Chrome 与目标前端资产;RPC 为假数据,HTTP(S) 请求被阻断。
|
|
88
89
|
- [同设备浏览器离线验证](../scripts/test-oauth-browser.mjs):构建后运行,使用真实独立 Chrome 和本地拦截的官方页面/CLI 回调,验证自动关窗;可在宿主 DEBUG/PWDEBUG 开启时核验 Worker 日志隔离。
|
|
89
90
|
- [真实登录验收](../scripts/test-oauth-live.mjs):仅在明确同意真实登录后传 `--confirm-real-login`,用户在独立窗口手动授权;临时保存 CLI 身份和绑定,结束后清理,不安装插件、不调用推理或额度接口。
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# 固化模型参数与来源
|
|
2
2
|
|
|
3
|
-
核验日期:2026-10-27
|
|
3
|
+
核验日期:2026-10-28(2026-10-27 首次核验,本次按官方原文复核并补充模态边界、来源冲突与实际开放档位的区分)。此表是插件采用的配置快照,不是推理边界实测。模型清单仍从所选账号的 ArkCli Plan 查询;上下文、输出和当前传输可表达的输入模态从本文件列明的一手资料固化,不在拉取清单时逐模型查询详情。
|
|
4
4
|
|
|
5
5
|
## 来源优先级
|
|
6
6
|
|
|
7
7
|
1. [Agent Plan Pi 接入](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-pi.md)、[Coding Plan Pi 接入](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-ai-pi.md)中的明确整数,分别按套餐采用。
|
|
8
8
|
2. 对应套餐的[Agent 概览](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-plan-overview.md)、[Coding 概览](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-plan-overview.md)。
|
|
9
9
|
3. 官方文档明确指向的 `dsh-volcengine-plugin@0.8.4` [Plan 目录](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json)补缺失整数、别名。其官方来源链见 [DeepSeek Harness 接入文档](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-deepseek-harness.md#configure-via-plugin)。参考文件 SHA-256:`9d921b7a989af72c49ee69ad61d9ab4fc1863af6fc7c4f1c6c6b04968716a9ad`。
|
|
10
|
-
4. 目标 Core `0.2.1-rc.
|
|
10
|
+
4. 目标 Core `0.2.1-rc.5` 消费的 `@earendil-works/pi-ai@1.1.0` [发行元数据](https://registry.npmjs.org/@earendil-works/pi-ai/1.1.0)、[类型契约](https://unpkg.com/@earendil-works/pi-ai@1.1.0/dist/types.d.ts)与[模型源](https://github.com/earendil-works/pi/tree/main/packages/ai)。类型契约限定 `Model.input` 只含 `text`、`image`,并规定 `thinkingLevelMap` 的 `null` 表示该思考档位不受支持。其他 Provider 的原厂参数仅用于交叉核对,不覆盖更窄的 Plan 配置。旧 `@mariozechner/pi-ai` 不能冒充目标消费版本。
|
|
11
11
|
|
|
12
12
|
同一 Pi 示例同时使用 `256000`、`262144`、`393216`、`1048576` 和 `1049000`,因此不做统一的“K 乘 1000/1024”转换。
|
|
13
13
|
|
|
@@ -30,20 +30,58 @@
|
|
|
30
30
|
| DeepSeek V4 Pro GA | 1048576 | 393216 | 393216 | text | 两套 Plan Pi,不从 V4.1 推导视觉能力 |
|
|
31
31
|
| DeepSeek V4 Flash GA | 1048576 | 393216 | 393216 | text | 两套 Plan Pi |
|
|
32
32
|
| Kimi K3 | 1048576 | 128000 | 65536 | text、image | 分别采用 Agent/Coding Pi;Coding 是保守示例配置 |
|
|
33
|
-
| Kimi K2.7 Code | 262144 | 32768 | 32768 | text、image | Pi 未列;官方 Plan
|
|
33
|
+
| Kimi K2.7 Code | 262144 | 32768 | 32768 | text、image | Pi 未列;官方 Plan 插件精确整数,两套套餐概览均记 256k/32k |
|
|
34
34
|
| MiniMax M3 | 1048576 | 131072 | 131072 | Agent: text;Coding: text、image | 官方 Plan 插件补容量;Coding 概览明确视觉,Agent 视觉未单独核实 |
|
|
35
35
|
| ark-code-latest | 256000 | 32000 | 32000 | text | 官方插件的账号选择路由配置,不代表固定模型的真实边界 |
|
|
36
36
|
|
|
37
37
|
`auto` 是动态路由,没有已核实的统一容量/模态/档位,不能等同 `ark-code-latest`。若清单返回 `auto`,仍采用标有“能力未核实”的保守回退,而不伪造为 1M。真正未知的未来版本也保留回退。
|
|
38
38
|
|
|
39
|
+
### 模型层模态与当前传输边界
|
|
40
|
+
|
|
41
|
+
上表“输入”列是当前传输可表达的模态子集,不是模型能力的完整声明。官方模型页与 Plan 目录另有音频、视频输入声明:
|
|
42
|
+
|
|
43
|
+
| 模型 | 官方声明的额外输入模态 | 来源 |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| Doubao Seed 2.1 Lite、Doubao Seed 2.0 Mini | audio | 官方 Plan 目录 `input` |
|
|
46
|
+
| Doubao Seed Evolving、2.1 Pro、2.1 Lite、2.0 Mini | video | 官方 Plan 目录 `input` |
|
|
47
|
+
| DeepSeek V4.1 Flash、V4.1 Flash Economy | video | 官方 Plan 目录 `input`;V4.1 专页写方舟支持视频理解 |
|
|
48
|
+
| Kimi K3、Kimi K2.8 Preview、Kimi K2.7 Code | video | 官方 Plan 目录 `input`;Coding 概览写 K2.7 Code“支持文本、图片与视频输入” |
|
|
49
|
+
| Kimi K3.1 Pro | video | 方舟模型页写“支持文本、图片和视频输入”;该模型不在 0.8.4 版官方 Plan 目录中 |
|
|
50
|
+
| GLM 5.3 Flash | video | 官方 Plan 目录 `input` |
|
|
51
|
+
| GLM 5.3、DeepSeek V4 Pro GA、DeepSeek V4 Flash GA | 无额外声明,目录 `input` 仅 text | 官方 Plan 目录 |
|
|
52
|
+
|
|
53
|
+
当前传输无法表达这些模态:`@earendil-works/pi-ai@1.1.0` 的 `Model.input` 只允许 `text` 与 `image`,[Messages 接口](https://ark.volcengine.com/region:cn-beijing/docs/messages-api.md)没有音频、视频内容块,[DSH 接入文档](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-deepseek-harness.md#configure-manually)也只让在模型上写 `input: [text, image]`。因此快照只声明 text/image 是传输边界下的子集,不代表模型不支持音频或视频;官方目录与模型页的 audio/video 声明单独记录,不据此改动快照声明。
|
|
54
|
+
|
|
39
55
|
### 明确保留的冲突
|
|
40
56
|
|
|
41
57
|
- Coding Kimi K3:Pi 明确为 `65536`;Coding 概览为 `128k`、官方插件为 `131072`。本次选择较保守且整数明确的 Pi 配置,不宣称已实测服务端硬上限。
|
|
42
|
-
- Economy
|
|
58
|
+
- Economy 上下文:两套 Plan Pi 为 `1049000`,两套套餐概览同写 `1049k`;官方插件目录为 `1048576`。按对应 Plan Pi 选值,不将两个数默认为相等。
|
|
43
59
|
- Kimi K2.8 输出:当前两套 Plan Pi 为 `1048576`,旧官方插件为 `131072`;采用当前套餐接入文档。
|
|
44
60
|
- Doubao 2.1/Evolving 输出:Pi 为 `256000`,官方插件为 `262144`;Mini 则是 `128000` 与 `131072`。逐字段按上述优先级保留,不统一二进制化。
|
|
45
61
|
- GLM 输出:Pi 为 `128000`,官方插件/原厂 pi-ai 为 `131072`;采用套餐 Pi。
|
|
46
|
-
- MiniMax M3
|
|
62
|
+
- MiniMax M3 模态:Coding 概览写“支持多模态视觉理解”,官方 Plan 目录在 Agent 与 Coding 两段的 `input` 都只有 `text`。按来源优先级 Coding 采用 text/image、Agent 保持 text;两个官方来源的冲突保留,不把目录的 text 单独解释为模型无视觉能力。
|
|
63
|
+
- 官方 Plan 目录含两套套餐概览未列的条目(如 `doubao-seed-2.1-turbo`、`doubao-seed-2.0-lite`)。默认快照参考套餐概览与 Pi 文档,不因旧目录条目自动补入;实际清单以所选账号的 ArkCli 返回为准。目录另定义的 `deepseek-latest`、`minimax-latest`、`kimi-latest` 别名在 Coding Pi 的 Model Name 清单中亦未列出,未核实精确对应关系前不并入 `aliases`。
|
|
64
|
+
|
|
65
|
+
## 消耗倍率
|
|
66
|
+
|
|
67
|
+
核验日期:2026-10-30。设置页的倍率来自[套餐内 AFP 抵扣规则](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-afp-credits-billing-rules)与[Agent/Coding Plan 指定模型抵扣系数限时折扣活动](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-model-discount)。文本模型的输入与输出系数相同;AFP 公式为 `(输入 token × 输入系数 + 输出 token × 输出系数) / 10000`。本地快照只保存常规值和带起止时间的折扣,读取设置页时判断活动是否有效,不把限时值永久固化为常规值。
|
|
68
|
+
|
|
69
|
+
| 模型 | 常规倍率 | 限时倍率与结束时间(UTC+8) |
|
|
70
|
+
|---|---:|---|
|
|
71
|
+
| Doubao Seed 2.0 Mini | 0.25 | — |
|
|
72
|
+
| DeepSeek V4 Flash、Doubao Seed 2.1 Lite、GLM 5.3 Flash | 0.5 | — |
|
|
73
|
+
| DeepSeek V4.1 Flash Economy | 2 | 1,至 2026-12-30 23:59:59 |
|
|
74
|
+
| DeepSeek V4.1 Flash | 2.5 | 1.25,至 2026-12-30 23:59:59 |
|
|
75
|
+
| Doubao Seed Evolving、2.1 Pro、MiniMax M3 | 2.5 | — |
|
|
76
|
+
| Kimi K3.1 Pro | 7 | 3.5,至 2026-11-09 23:59:59 |
|
|
77
|
+
| Kimi K2.7 Code、GLM 5.3 | 4.5 | — |
|
|
78
|
+
| Kimi K2.8 Preview | 8 | 4.8,至 2026-12-14 23:59:59 |
|
|
79
|
+
| Kimi K3 | 10 | 5 折活动已于 2026-10-25 结束,当前展示常规值 |
|
|
80
|
+
| DeepSeek V4 Pro | 5.5 | — |
|
|
81
|
+
|
|
82
|
+
- Agent Plan 的标识直接表示上述 AFP 抵扣系数。Coding Plan 界面沿用上述模型系数作相对消耗参考,但额度接口只给百分比,不能用该标识推算固定调用次数或 AFP 绝对量。
|
|
83
|
+
- AFP 规则页与活动页的展示更新时间可能不同;Kimi K3 在活动页列明的 5 折窗口已经结束,本地快照不记录任何折扣起止时间,直接展示常规值 10,不继续沿用规则页残留的“限时 5”文案。
|
|
84
|
+
- `auto`、`ark-code-latest` 和未知版本没有固定目标模型,不显示倍率。精确 ID 与两套套餐的别名映射保存在 `src/consumption-rates.json`;该元数据只用于设置页,不进入 Core 模型描述或请求载荷。
|
|
47
85
|
|
|
48
86
|
## 显示名称
|
|
49
87
|
|
|
@@ -57,23 +95,25 @@ Plan 使用 `anthropic-messages`,原生档位字段为 `output_config.effort`
|
|
|
57
95
|
|
|
58
96
|
| 模型 | 独立思考强度 / 其他状态 | 插件继承默认 | 默认关闭入口 | Messages 原生模式 |
|
|
59
97
|
|---|---|---|---|---|
|
|
60
|
-
| Doubao Evolving、2.1 Pro、2.1 Lite | low/medium/high
|
|
61
|
-
| Doubao 2.0 Mini 260428 | low/medium/high
|
|
62
|
-
| DeepSeek V4.1 Flash / Economy 261017 | low/high/max
|
|
63
|
-
| DeepSeek V4 Pro / Flash GA | low/high/max
|
|
64
|
-
| Kimi K3.1 Pro | low/high/max
|
|
98
|
+
| Doubao Evolving、2.1 Pro、2.1 Lite | low/medium/high(官方另有 minimal 不思考、none→minimal;本地只开放三档) | high | 提供 | enabled + effort |
|
|
99
|
+
| Doubao 2.0 Mini 260428 | low/medium/high(官方另有 minimal 不思考、none→minimal;本地只开放三档) | medium | 提供 | enabled + effort |
|
|
100
|
+
| DeepSeek V4.1 Flash / Economy 261017 | low/high/max(官方 minimal→low;本地未开放 minimal) | high | 提供 | adaptive + effort |
|
|
101
|
+
| DeepSeek V4 Pro / Flash GA | low/high/max(官方 none/minimal→关闭;本地用关闭入口表达) | high | 提供 | enabled + effort |
|
|
102
|
+
| Kimi K3.1 Pro | low/high/max;常驻思考,只开放三档 | max | 不提供 | enabled + effort |
|
|
65
103
|
| Kimi K3 | low/high/max;常驻思考 | 服务端默认,官方未列档位默认 | 不提供 | enabled + effort |
|
|
66
104
|
| Kimi K2.8 Preview | low/high/max | 服务端默认,官方未列 | 不提供,关闭未单列 | enabled + effort |
|
|
67
|
-
| Kimi K2.7 Code |
|
|
105
|
+
| Kimi K2.7 Code | 思考已确认(Coding 概览;Agent 侧未确认),可调独立档未列 | 服务端默认 | 不提供,关闭未单列 | server-default |
|
|
68
106
|
| GLM 5.3 | low/high/max;常驻思考 | 服务端默认;原厂为 max,火山未单列 | 不提供 | enabled + effort |
|
|
69
107
|
| GLM 5.3 Flash | low/high/max;常驻思考 | max,依据 Platform 260828;Plan backend260901 未另列 | 不提供 | enabled + effort |
|
|
70
|
-
| MiniMax M3 | low/medium/high | medium,官方 Plan 目录 | 不提供;官方 off→minimal 不单独证明完全关闭 | enabled + effort |
|
|
108
|
+
| MiniMax M3 | low/medium/high(官方目录 off→minimal;本地不开放 off) | medium,官方 Plan 目录 | 不提供;官方 off→minimal 不单独证明完全关闭 | enabled + effort |
|
|
71
109
|
| Auto / ark-code-latest | 动态目标,无固定统一档位 | 服务端默认 | 不提供统一保证 | server-default |
|
|
72
110
|
|
|
111
|
+
该列前半为项目实际开放的思考强度,括号内为官方折叠规则。官方折叠描述服务端如何处理收到的值,不增加本地开放的档位;逐档位的 wire 取值见[本地实际开放档位](<model-thinking-audit.md#本地实际开放档位与-wire-取值>)。
|
|
112
|
+
|
|
73
113
|
- 模型级请求载荷适配将 Core 档位选择与最终 `thinking.type` 分开:V4.1 两款采用专页要求的 adaptive,其余已知可调模型采用 enabled;二者均使用 `output_config.effort`,不附带 Claude 预算/显示字段。关闭请求使用 disabled;未指定且官方默认未列时不补 effort。server-default 不注入思考控制。
|
|
74
114
|
- [官方插件 0.8.4 transport](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js)通用地把 adaptive 改为 enabled,与 [V4.1 专页](https://ark.volcengine.com/region:cn-beijing/docs/deepseek-v4-1-flash.md#reasoning-effort)“adaptive 才使 effort 生效”冲突;项目采用模型专页优先,不统一改写 V4.1。
|
|
75
|
-
-
|
|
76
|
-
- 旧用户显式预算覆盖保留为兼容模式,与模型原生 effort 分开;Core 的 minimal=1024 预算仍开启思考,不等价于 Doubao
|
|
115
|
+
- 兼容别名不增加独立强度;官方折叠规则描述服务端对传入值的处理,不是项目开放的档位集合。具体折叠与本地开放档位的对应按[逐模型规则](<model-thinking-audit.md#兼容别名折叠>)与[本地实际开放档位](<model-thinking-audit.md#本地实际开放档位与-wire-取值>)处理。
|
|
116
|
+
- 旧用户显式预算覆盖保留为兼容模式,与模型原生 effort 分开;Core 的 minimal=1024 预算仍开启思考,不等价于 Doubao 官方折叠里的 minimal 不思考。`reasoningEfforts:false` 仅表示不提供可调档,不表示模型无思考或强制关闭。
|
|
77
117
|
|
|
78
118
|
## 缓存与用户覆盖
|
|
79
119
|
|
package/docs/model-management.md
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
contextWindow: 131072,
|
|
15
15
|
maxTokens: 8192,
|
|
16
16
|
temperature: 0.5,
|
|
17
|
+
imageInput: true,
|
|
18
|
+
toolsEnabled: false,
|
|
17
19
|
reasoningEfforts: { off: null, low: 'low', high: 'high' },
|
|
18
20
|
defaultReasoning: 'low',
|
|
19
21
|
forceAdaptiveThinking: true
|
|
@@ -29,6 +31,8 @@
|
|
|
29
31
|
|
|
30
32
|
参数校验:正安全整数 contextWindow/maxTokens,maxTokens 不得超过有效 contextWindow;temperature 为 0 到 1 的有限数;forceAdaptiveThinking 为布尔值。预算模式只接受 off/minimal/low/medium/high,非 off 的映射值必须与档位同名、off 为 null,避免底层将 xhigh/max 折叠为 high 而产生虚假档位。原生 effort 模式按声明的映射值发送:`off:null` 才是真正关闭,`off:"low"` 等非空字符串是用户自定义原生档位别名,仍按该值开启思考;后者可用于常驻思考模型。拒绝未知字段、非法模型 ID、数组和敏感凭据字段。设置不会创建目录里不存在的模型。
|
|
31
33
|
|
|
34
|
+
`imageInput` 与 `toolsEnabled` 是可选布尔覆盖,省略时继承目录声明与现有工具默认策略;版本 1、2 的旧状态仍可读取。图片开启会向 Core 声明图片输入,但不会改变服务端模型能力;音频、视频不在当前 Core/SDK 消息模型内。工具调用关闭后,带工具声明的请求指定 `tool_choice: none`,不含工具时不发送该字段;历史消息保留。0.2.7 会因新增字段拒绝加载整份状态;回退前须在新版逐项恢复继承并保存,若已回退需先回到新版处理。
|
|
35
|
+
|
|
32
36
|
## 固化能力与缓存
|
|
33
37
|
|
|
34
38
|
能力参数采用[来源核验快照](model-capabilities.md),模型清单仍由账号 Plan 查询。显式 `aliases` 连接已核实的控制面 ID、调用别名和文档名称,不根据字符串去日期或改标点猜版本;`aliases` 不是 Core 字段,进入适配器前剥离。
|
|
@@ -50,7 +54,7 @@
|
|
|
50
54
|
{ id, name, enabled, capabilityUnverified, settings, defaults, effective }
|
|
51
55
|
```
|
|
52
56
|
|
|
53
|
-
其中 defaults/effective 含 contextWindow、maxTokens、reasoningEfforts、defaultReasoning(无默认时为 null)、forceAdaptiveThinking,temperature 可省略。根字段另有 messagesThinkingMode、canDisableThinking、capabilityStatus 和可选 capabilityNote;它们不进入 Core 模型描述。settings 是原始覆盖值,settingsWarning 表示需修复的兼容配置。count 仍为完整目录数量。
|
|
57
|
+
其中 defaults/effective 含 contextWindow、maxTokens、imageInput、toolsEnabled、reasoningEfforts、defaultReasoning(无默认时为 null)、forceAdaptiveThinking,temperature 可省略。根字段另有 messagesThinkingMode、canDisableThinking、capabilityStatus 和可选 capabilityNote;它们不进入 Core 模型描述。settings 是原始覆盖值,settingsWarning 表示需修复的兼容配置。count 仍为完整目录数量。
|
|
54
58
|
|
|
55
59
|
## 路由与请求
|
|
56
60
|
|
|
@@ -64,6 +68,6 @@
|
|
|
64
68
|
|
|
65
69
|
## 界面与验证
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
两张套餐卡片提供独立启用复选框,账号选择与启用状态分开。模型列表提供逐模型开关、参数编辑和恢复默认。图片输入与工具调用使用复选框调整,并可分别恢复继承;参数空值表示继承;思考默认可选继承、不强制或有效档位;模式可选继承、原生 effort、固定预算。说明温度在启用思考时可能被传输层忽略,输出 token 还受思考预算和上下文约束。
|
|
68
72
|
|
|
69
73
|
验收覆盖:旧状态迁移、关闭后账号保留、开关隔离、设置持久化/重置/刷新保留、非法参数拒绝、未知模型不再触发默认 low 错误、请求覆盖优先级、已准备请求不随设置变化、实际 Core 与假 HTTP 字段验证。真实 OAuth 的独立验收见[验证记录](validation.md);模型管理脚本不验证真实推理、Plan 上限或服务端思考参数效果。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 模型思考档位与 Messages 适配依据
|
|
2
2
|
|
|
3
|
-
核验日期:2026-10-27
|
|
3
|
+
核验日期:2026-10-28(2026-10-27 首次核验,本次按官方原文复核并区分官方折叠规则与本地开放档位)。本文记录火山方舟 Provider 的模型思考能力、默认参数与模型级 Messages 适配约定。上下文、输出整数及当前输入模态配置见[能力快照来源](<model-capabilities.md>)。
|
|
4
4
|
|
|
5
5
|
## 参数语义与来源层级
|
|
6
6
|
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
- **模型官方默认**与**渠道默认**分开:原厂默认不自动成为火山 Plan 默认。渠道未单列默认时,除表中明确采用的模型级规则外,插件省略 effort、继承服务端默认,不统一填 low。
|
|
9
9
|
- **Messages mode**是项目最终请求约定,不把所有通用字段枚举解释成每款模型的逐值保证。`enabled-effort` 使用 `thinking.type=enabled` 与 `output_config.effort`;`adaptive-effort` 使用 `adaptive` 与同一 effort 字段;`server-default` 不注入思考控制字段。
|
|
10
10
|
- 思考字段的证据优先级:**A** 为对应精确版本的火山模型专页/深度思考表;**B** 为火山对应 Plan 文档;**C** 为官方插件固定版本的目录与传输实现;**D** 为模型原厂资料。通用 Messages 文档提供字段契约,逐模型专页约束优先于通用适配。该顺序不替换[容量字段的来源优先级](<model-capabilities.md#来源优先级>)。
|
|
11
|
+
- **官方折叠规则**与**本地开放档位**是两件事:官方表描述服务端把收到的 effort 值折到哪一档;本项目只开放 `thinkingLevelMap` 显式映射的 Core 档位。`@earendil-works/pi-ai@1.1.0` 的类型契约写明 “Missing keys use provider defaults. null marks a level as unsupported”,映射为 `null` 的档位不发送 wire 值。因此官方折叠中的 `none`、`minimal`、`medium`、`xhigh` 等取值不构成项目开放的档位;两者对照见[本地实际开放档位](<model-thinking-audit.md#本地实际开放档位与-wire-取值>)。
|
|
11
12
|
|
|
12
13
|
## 逐模型参数表
|
|
13
14
|
|
|
14
|
-
两套餐共用下表的思考语义;请求 ID 仍使用各自目录的 `output_name`。`sourceURL`
|
|
15
|
+
两套餐共用下表的思考语义;请求 ID 仍使用各自目录的 `output_name`。`sourceURL` 列的编号链接到官方原文,不以模型族名称补齐未声明字段。“独立 effort 状态”列记录官方声明的状态,括号与附注区分本地实际开放档位,后者逐条列在[本地实际开放档位](<model-thinking-audit.md#本地实际开放档位与-wire-取值>)。
|
|
15
16
|
|
|
16
17
|
| 模型 / 能力对应版本 | 独立 effort 状态 | 模型官方默认 / 渠道说明 | 插件继承默认 | 能否关闭 / 默认关闭入口 | 项目 Messages mode | sourceURL / 层级 | 剩余精确缺项 |
|
|
17
18
|
|---|---|---|---|---|---|---|---|
|
|
@@ -23,10 +24,10 @@
|
|
|
23
24
|
| DeepSeek V4.1 Flash Economy / `261017` | `low/high/max`;关闭另列 | 火山 `high`;默认开启 | `high` | 可以;提供关闭;`minimal` 不是关闭 | `adaptive-effort` | [DE](https://ark.volcengine.com/models/deepseek-v4-1-flash-economy.md)、[DS](https://ark.volcengine.com/region:cn-beijing/docs/deepseek-v4-1-flash.md#reasoning-effort)、[T](https://ark.volcengine.com/region:cn-beijing/docs/deep-thinking.md):A | 同标准版的 transport 冲突;Economy 有显式同参声明 |
|
|
24
25
|
| DeepSeek V4 Pro GA / `260813` | `low/high/max`;关闭另列 | 火山 `high`;默认开启 | `high` | 可以;提供关闭 | `enabled-effort` | [VP](https://ark.volcengine.com/models/deepseek-v4-pro-ga.md)、[T](https://ark.volcengine.com/region:cn-beijing/docs/deep-thinking.md)、[P](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json)、[X](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js):A/C | Plan 别名下 enabled/adaptive 逐值处理未单列 |
|
|
25
26
|
| DeepSeek V4 Flash GA / `260731` | `low/high/max`;关闭另列 | 火山 `high`;默认开启 | `high` | 可以;提供关闭 | `enabled-effort` | [VF](https://ark.volcengine.com/models/deepseek-v4-flash-ga.md)、[T](https://ark.volcengine.com/region:cn-beijing/docs/deep-thinking.md)、[P](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json)、[X](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js):A/C | backend `260801` 与请求版本 `260731` 的对应不由公开 sourceModelIds 单独证明 |
|
|
26
|
-
| Kimi K3.1 Pro / `261024` | `low/high/max
|
|
27
|
+
| Kimi K3.1 Pro / `261024` | `low/high/max`,只开放三档 | 火山 `max`;常驻思考 | `max` | 不可关闭;不提供关闭 | `enabled-effort` | [K1](https://ark.volcengine.com/models/kimi-k3-1-pro.md)、[T](https://ark.volcengine.com/region:cn-beijing/docs/deep-thinking.md)、[M](https://ark.volcengine.com/region:cn-beijing/docs/messages-api.md):A;[X](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js):C | 深度思考表的 none/minimal 关闭与模型页的三档常驻互斥,见《Kimi K3.1 Pro 的官方原始冲突》;Plan 版本 `261024` 下 thinking.type 各值的处理未单列 |
|
|
27
28
|
| Kimi K3 / `260701` | `low/high/max` | 火山 Plan 默认开启;effort 默认未列 | 服务端默认 | 不可关闭;不提供关闭 | `enabled-effort`;省略未指定的 effort | [P](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json)、[AP](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-plan-overview.md)、[CP](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-plan-overview.md)、[X](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js):B/C | 默认档位、三档之外的完整折叠规则未列 |
|
|
28
29
|
| Kimi K2.8 Preview / `260901` | `low/high/max` | 官方 Plan 目录未列 effort 默认 | 服务端默认 | 是否可关闭未列;不默认提供关闭 | `enabled-effort`;省略未指定的 effort | [P](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json)、[CP](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-plan-overview.md)、[X](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js):B/C | 默认、关闭语义、三档之外折叠与逐模型模式声明未列 |
|
|
29
|
-
| Kimi K2.7 Code / `260601` |
|
|
30
|
+
| Kimi K2.7 Code / `260601` | Coding 概览确认思考,Agent 侧未确认;可调独立 effort 未列 | effort 默认未列 | 服务端默认 | 关闭控制未列;不默认提供关闭 | `server-default` | [CP](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-plan-overview.md)、[KR](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-model-release.md)、[P](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json):B/C | Agent 套餐的思考能力无可用一手声明;可调档位、默认、关闭、逐模型 Messages 控制未列 |
|
|
30
31
|
| GLM 5.3 / backend `260801` | `low/high/max` | 原厂 `max`;火山 Plan 未单列 effort 默认 | 服务端默认 | 不可关闭;不提供关闭 | `enabled-effort`;省略未指定的 effort | [G](https://docs.bigmodel.cn/cn/guide/models/text/glm-5.3.md):D;[P](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json)、[AP](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-plan-overview.md)、[CP](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-plan-overview.md)、[X](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js):B/C | 火山该 backend 的默认、兼容别名折叠、逐模型 Messages 示例未列 |
|
|
31
32
|
| GLM 5.3 Flash / Platform `260828`、Plan backend `260901` | `low/high/max` | 火山 Platform `260828` 默认 `max`;Plan `260901` 未独立列默认 | `max`,采用 Platform 对应能力声明 | 不可关闭;不提供关闭 | `enabled-effort` | [GF](https://ark.volcengine.com/models/glm-5-3-flash.md)、[T](https://ark.volcengine.com/region:cn-beijing/docs/deep-thinking.md):A;[P](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json)、[X](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js):C | 两个版本标识的默认/折叠没有逐字段等价声明;保留来源版本 |
|
|
32
33
|
| MiniMax M3 / `minimax-m3-modelhub` | `low/medium/high` | 官方 Plan 目录 `medium` | `medium` | 官方 `off→minimal` 仅为编码声明,未直接保证完全关闭;不默认提供关闭 | `enabled-effort` | [P](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json)、[X](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js):C | `minimal` 的模型级完整语义、关闭行为、其他 effort 折叠及单独 Messages 文档未列 |
|
|
@@ -35,12 +36,14 @@
|
|
|
35
36
|
|
|
36
37
|
## 兼容别名折叠
|
|
37
38
|
|
|
39
|
+
下表是官方服务端对传入 effort 值的折叠规则,描述请求侧取值如何被归并;它不等于项目开放给用户的档位。项目实际可选项与 wire 取值见[本地实际开放档位](<model-thinking-audit.md#本地实际开放档位与-wire-取值>)。
|
|
40
|
+
|
|
38
41
|
| 模型范围 | 官方折叠规则 | 项目含义 |
|
|
39
42
|
|---|---|---|
|
|
40
|
-
| Doubao Evolving、2.1 Pro/Lite `260915`、2.0 Mini `260428` | `none→minimal`;`minimal` 不思考;`xhigh/max→high` | low/medium/high 是三个思考强度;minimal 是独立关闭状态,预算 1024
|
|
41
|
-
| DeepSeek V4.1 Flash / Economy `261017` | `minimal→low`、`medium/xhigh→high`、`ultra→max`;Chat/Responses 的 `none` 关闭 | Messages 专页只列 low/high/max;关闭单独通过 `thinking.type=disabled`
|
|
43
|
+
| Doubao Evolving、2.1 Pro/Lite `260915`、2.0 Mini `260428` | `none→minimal`;`minimal` 不思考;`xhigh/max→high` | low/medium/high 是三个思考强度;minimal 是独立关闭状态,预算 1024 不是它的等价实现;本地只开放 low/medium/high,关闭走 `thinking.type=disabled` |
|
|
44
|
+
| DeepSeek V4.1 Flash / Economy `261017` | `minimal→low`、`medium/xhigh→high`、`ultra→max`;Chat/Responses 的 `none` 关闭 | Messages 专页只列 low/high/max;关闭单独通过 `thinking.type=disabled` 表达;本地未开放 minimal 档位,映射为 `null` 即不发送该 wire 值 |
|
|
42
45
|
| DeepSeek V4 Pro GA `260813`、Flash GA `260731` | `none/minimal→关闭`、`medium→low`、`xhigh→high` | minimal 不增加第四个思考强度;关闭使用独立入口 |
|
|
43
|
-
| Kimi K3.1 Pro `261024` |
|
|
46
|
+
| Kimi K3.1 Pro `261024` | 深度思考表:`none/minimal→关闭思考`、`low→low`、`medium/high→high`、`xhigh/max→max`;模型页:只有 low/high/max 三档且不可关闭 | 两份官方原文互斥;本地只开放 low/high/max,不提供关闭入口,见《Kimi K3.1 Pro 的官方原始冲突》 |
|
|
44
47
|
| GLM 5.3 Flash Platform `260828` | `none/minimal/low→low`、`medium/high→high`、`xhigh/max→max` | 不提供 off;官方 Plan 目录 `260901` 的六个输入键不能解释成六种独立强度 |
|
|
45
48
|
| GLM 5.3 原厂 | 普通原厂 API 只接受 low/high/max;原厂 Coding Plan 有七输入折叠 | 原厂 Coding Plan 与火山 Coding Plan 不同,不将其折叠直接写成火山保证 |
|
|
46
49
|
| Kimi K3、K2.8 Preview | 官方目录只有 low/high/max 同名映射 | 不套用 K3.1 的折叠 |
|
|
@@ -48,6 +51,46 @@
|
|
|
48
51
|
|
|
49
52
|
规则来源:[火山深度思考表 T](https://ark.volcengine.com/region:cn-beijing/docs/deep-thinking.md#fc5eac89)、[V4.1 模型专页 DS](https://ark.volcengine.com/region:cn-beijing/docs/deepseek-v4-1-flash.md#reasoning-effort)、[官方 Plan 目录 P](https://unpkg.com/dsh-volcengine-plugin@0.8.4/plan-models.json)、[智谱原厂思考说明](https://docs.bigmodel.cn/cn/guide/capabilities/thinking)。
|
|
50
53
|
|
|
54
|
+
### 本地实际开放档位与 wire 取值
|
|
55
|
+
|
|
56
|
+
下表是继承快照时的默认档位集合,由 `thinkingLevelMap` 决定:只有显式映射的 Core 档位会被发送,映射为 `null` 的档位按 pi-ai 契约不受支持。用户显式自定义映射时,以其有效映射为准。
|
|
57
|
+
|
|
58
|
+
| 模型 | Core 可选档位 | `output_config.effort` 取值 | 关闭方式 |
|
|
59
|
+
|---|---|---|---|
|
|
60
|
+
| Doubao Evolving、2.1 Pro、2.1 Lite、2.0 Mini | off、low、medium、high | low、medium、high 原值 | `thinking.type=disabled` |
|
|
61
|
+
| DeepSeek V4.1 Flash / Economy | off、low、high、max | low、high、max 原值 | `thinking.type=disabled` |
|
|
62
|
+
| DeepSeek V4 Pro / Flash GA | off、low、high、max | low、high、max 原值 | `thinking.type=disabled` |
|
|
63
|
+
| Kimi K3.1 Pro | low、high、max | low、high、max 原值 | 无关闭入口 |
|
|
64
|
+
| Kimi K3、Kimi K2.8 Preview | low、high、max | low、high、max 原值 | 无关闭入口 |
|
|
65
|
+
| GLM 5.3、GLM 5.3 Flash | low、high、max | low、high、max 原值 | 无关闭入口 |
|
|
66
|
+
| MiniMax M3 | low、medium、high | low、medium、high 原值 | 无关闭入口 |
|
|
67
|
+
| Kimi K2.7 Code | 无 | 不发送 | 不适用 |
|
|
68
|
+
| ark-code-latest / Auto | 无 | 不发送 | 不适用 |
|
|
69
|
+
|
|
70
|
+
默认快照没有开放 `minimal`:官方折叠把它折到 `low`(V4.1)或视为不思考(Doubao),两种都不是独立思考强度,因此默认配置不提供该 Core 档位。用户可按有效性规则自定义映射;官方目录的 `off→minimal` 编码本身不构成 MiniMax M3 的关闭入口。
|
|
71
|
+
|
|
72
|
+
### Kimi K3.1 Pro 的官方原始冲突
|
|
73
|
+
|
|
74
|
+
[深度思考表 T](https://ark.volcengine.com/region:cn-beijing/docs/deep-thinking.md#fc5eac89) 的 `kimi-k3-1-pro-261024` 行原文为:
|
|
75
|
+
|
|
76
|
+
> 传入 `none` / `minimal`:将关闭思考
|
|
77
|
+
> 始终开启思考,不使用 **thinking** 参数。
|
|
78
|
+
> 传入 `low`:将映射为 `low`;传入 `medium` / `high`:将映射为 `high`;传入 `xhigh` / `max`:将映射为 `max`
|
|
79
|
+
|
|
80
|
+
[Kimi K3.1 Pro 模型页](https://ark.volcengine.com/models/kimi-k3-1-pro.md)写:
|
|
81
|
+
|
|
82
|
+
> 具备1M上下文与三档思考强度
|
|
83
|
+
> 思考常驻,通过 reasoning_effort 在 low / high / max 之间调节即可
|
|
84
|
+
> 思考模式能关吗?不能,思考常驻是旗舰模型的刻意设计
|
|
85
|
+
|
|
86
|
+
两份官方原文互斥:深度思考表给出 none/minimal 的关闭路径,模型页只承认 low/high/max 且不可关闭。项目按模型页的实际档位收口,只开放 low/high/max、不提供关闭入口;深度思考表的 none/minimal 关闭路径作为未采信的官方冲突保留,不据此推断 wire 值,也不因此改写容量与模态结论。
|
|
87
|
+
|
|
88
|
+
### `thinking.type` 适用性未确认的模型
|
|
89
|
+
|
|
90
|
+
[深度思考表 T](https://ark.volcengine.com/region:cn-beijing/docs/deep-thinking.md)的“支持模型”清单列出可传 `thinking.type` 的条目,含 doubao 家族(`doubao-seed-evolving`、`doubao-seed-2-1-pro-260915`、`doubao-seed-2-1-lite-260915`、`doubao-seed-2-0-mini-260428`)、`glm-5-3-flash-260828`、`deepseek-v4-1-flash-261017`、`deepseek-v4-1-flash-economy-261017`、`deepseek-v4-pro-ga-260813`、`deepseek-v4-flash-ga-260731`,以及只在平台直推的若干版本。
|
|
91
|
+
|
|
92
|
+
清单未包含 `kimi-k3-1-pro-261024`、`glm-5-3-260801`、`kimi-k3-260701`、`kimi-k2-8-260901`、`minimax-m3-modelhub`,而这五款在快照中仍按 `enabled + effort` 发送 `thinking.type`。可依据的只有[官方插件 transport](https://unpkg.com/dsh-volcengine-plugin@0.8.4/transport.js)通用改写为 `enabled` 的 C 级实现;深度思考表对 K3.1 Pro 同时写有“不使用 thinking 参数”。因此这五款的 `thinking.type` 适用性标为未确认;档位、容量与模态结论不受影响,是否改用其他传输方式需进一步核验。
|
|
93
|
+
|
|
51
94
|
## Messages 字段与模型级模式
|
|
52
95
|
|
|
53
96
|
[Messages API M](https://ark.volcengine.com/region:cn-beijing/docs/messages-api.md)将 effort 定义为 `output_config.effort`,并明确把支持模型、默认取值、兼容映射及与 `thinking.type` 的关系链接到[深度思考表 T](https://ark.volcengine.com/region:cn-beijing/docs/deep-thinking.md)。因此该模型表是字段文档指定的依据,已明确的能力不依赖实际请求才成立。
|
|
@@ -89,13 +132,13 @@ thinking: { type: 'enabled' }
|
|
|
89
132
|
- **DeepSeek GA**:Pro 官方 Plan sourceModelIds 明列 `deepseek-v4-pro-ga-260801` 与 `deepseek-v4-pro-ga-260813`;Flash 官方目录只明列 `deepseek-v4-flash-ga-260731`。当前控制面与请求 ID 的精确对应由显式 aliases 维护,不通过删日期匹配其他版本。
|
|
90
133
|
- **K3.1 Pro**:火山模型页与深度表的默认 max 对应 `261024`;Plan 请求名称与平台直推名称分属渠道命名空间,不能将平台日期 ID 说明当作 Plan `output_name` 无效的依据。
|
|
91
134
|
- **GLM 5.3 Flash**:Platform 模型页和深度表对应 `260828`;官方 Plan 目录来源 ID 为 `260901`。项目采用 max 的模型默认,并同时保留 Plan 未独立给出该默认与折叠表的事实。非 Flash GLM 5.3 只有原厂默认 max、没有火山单列默认,故继承服务端。
|
|
92
|
-
- **K3 / K2.8**:三档清单不是默认档位证据,默认保持服务端继承。K2.7
|
|
135
|
+
- **K3 / K2.8**:三档清单不是默认档位证据,默认保持服务端继承。K2.7 的思考能力只在 Coding 套餐有一手声明,[Coding 概览](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-plan-overview.md)写“支持文本、图片与视频输入,思考模式,对话与 Agent 任务”,[Agent 概览](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-plan-overview.md)未声明其思考能力,官方 Plan 目录也没有该模型的 `reasoningEfforts`;Agent 侧的思考能力因此记为未知。两套餐都不声明可调档位,这与非思考模型不同。
|
|
93
136
|
- **MiniMax M3**:精确来源 ID 的官方 Plan 目录确认三档和默认 medium;目录中的 off 编码不足以单独证明完全关闭。两套餐当前概览标“即将下线”,固定版本目录仍标 Published;发行快照不代表实时生命周期。
|
|
94
137
|
- **动态路由**:`ark-code-latest` 是账号选择路由,控制台可选择 Auto;Auto 是智能调度模式,不是同一固定模型的另一个名字。官方示例 256000/32000 及不同输入模态配置均不能作为所有目标的固定能力。
|
|
95
138
|
|
|
96
139
|
## 容量、模态与验证状态
|
|
97
140
|
|
|
98
|
-
容量采用[能力快照来源](<model-capabilities.md>)中的逐套餐整数;原生思考模式不改变这些字段。V4.1 的 Chat/Responses 128K 是请求输出默认,不替代 Plan 的 393216 配置。模型页和官方目录中的视频/音频能力与当前 Messages 可表达的 text/image
|
|
141
|
+
容量采用[能力快照来源](<model-capabilities.md>)中的逐套餐整数;原生思考模式不改变这些字段。V4.1 的 Chat/Responses 128K 是请求输出默认,不替代 Plan 的 393216 配置。模型页和官方目录中的视频/音频能力与当前 Messages 可表达的 text/image 范围分别记录,逐模型的额外模态与传输边界见[模型层模态与当前传输边界](<model-capabilities.md#模型层模态与当前传输边界>);MiniMax Coding 的视觉声明不自动补成 Agent 的已核实范围,且其 Coding 侧视觉与官方 Plan 目录的 text-only 条目构成来源冲突,已在能力文档的冲突表保留。
|
|
99
142
|
|
|
100
143
|
本次审计已核对官方能力声明、来源冲突与项目适配约定;真实 Plan 请求、边界容量及具体模式的线上接受性未实测。离线回归验证字段生成、覆盖优先级与模式隔离,不代替线上验证;这一状态不改变表中已获文档确认的档位、默认及开关结论。
|
|
101
144
|
|
|
@@ -110,3 +153,5 @@ thinking: { type: 'enabled' }
|
|
|
110
153
|
| AP / CP | [Agent Plan 概览](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-plan-overview.md)、[Coding Plan 概览](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-plan-overview.md):渠道范围、模型限制与生命周期 |
|
|
111
154
|
| G | [智谱 GLM 5.3](https://docs.bigmodel.cn/cn/guide/models/text/glm-5.3.md):原厂三档、常驻与默认;不替代火山渠道默认 |
|
|
112
155
|
| R | [Coding Pi 模型配置](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-ai-pi.md#3a775131):账号路由与 Auto 的关系 |
|
|
156
|
+
| K1 | [Kimi K3.1 Pro 模型页](https://ark.volcengine.com/models/kimi-k3-1-pro.md):三档思考强度、常驻不可关闭、输入模态与工具调用;与深度思考表冲突时并列保留 |
|
|
157
|
+
| PI | [pi-ai 1.1.0 类型契约](https://unpkg.com/@earendil-works/pi-ai@1.1.0/dist/types.d.ts)与[Anthropic Messages 适配实现](https://unpkg.com/@earendil-works/pi-ai@1.1.0/dist/api/anthropic-messages.js):`Model.input` 模态集合、`thinkingLevelMap` 的 `null` 语义、请求侧 `thinking` 与 `output_config` 组装 |
|
package/docs/usage.md
CHANGED
|
@@ -85,9 +85,15 @@ IAM SK: VOLC_SECRETKEY
|
|
|
85
85
|
|
|
86
86
|
模型列表中的开关只影响该账号、该套餐里的这个模型。停用后从模型选择器中移除,但仍保留参数,便于稍后重新启用。拉取目录不会清空这些设置。
|
|
87
87
|
|
|
88
|
+
模型名称旁的 `×` 标识是官方模型抵扣系数;带“限时”的标识只在官方活动时间范围内显示折扣值,结束后恢复常规倍率。Agent Plan 按 AFP 输入/输出抵扣系数解释;Coding Plan 仅用作相对消耗参考,不据此推算固定调用次数。动态路由和未知模型不显示虚构倍率,详见[消耗倍率](model-capabilities.md#消耗倍率)。
|
|
89
|
+
|
|
88
90
|
## 模型参数
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
展开模型参数,可以覆盖图片输入、工具调用、上下文长度、默认输出 token、温度、思考档位映射、默认档位和思考模式。图片与工具使用复选框启用或禁用;手动调整后可分别恢复目录默认,保存时仅清除对应能力的覆盖。继承读取目录默认,而不是此前保存的自定义值。数值留空表示继承。恢复默认会清除该模型全部覆盖值并恢复启用,停用模型的按钮会明确显示 **恢复默认并启用**。设置按账号、套餐、模型保存,切换账号不会套用另一账号的参数。
|
|
93
|
+
|
|
94
|
+
- 图片输入只调整 DSH 对模型的能力声明。手动启用并不能让服务端支持未提供的图片能力;如果模型不支持图片,请求可能失败。
|
|
95
|
+
- 禁用工具调用时保留已有对话和工具结果,新的请求禁止模型发起工具调用。当前 DSH 通道只支持文本与图片输入;音频、视频的模型原生能力见[能力参数](model-capabilities.md),不能仅靠开关启用。
|
|
96
|
+
- 保存过图片或工具覆盖后,回退到 0.2.7 会使旧版无法加载整份账号状态,账号和路由也会暂不可用。回退前,请在新版的各账号、套餐及模型中分别将这两项恢复继承并保存;若已回退,需先回到新版处理。
|
|
91
97
|
|
|
92
98
|
- 上下文和输出 token 为正整数,输出值不能大于上下文;温度范围为 0 到 1。只缩小上下文、输出仍继承时,继承输出会被约束到有效上下文。
|
|
93
99
|
- 默认思考继承各模型已声明默认,或明确选择服务端默认/某个可用档位;未公开默认值的模型不自动选 low。常驻思考模型不提供关闭选项。
|
package/docs/validation.md
CHANGED
|
@@ -2,10 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## 目标与范围
|
|
4
4
|
|
|
5
|
-
- 实际目标 **DSH Core 0.2.1-rc.
|
|
5
|
+
- 实际目标 **DSH Core 0.2.1-rc.5**;兼容声明不扩展到未测试版本。
|
|
6
6
|
- ArkCli **1.0.37** 的命令帮助、随包官方 Skills、raw action 注册及无网络预览。
|
|
7
7
|
- 单元业务测试使用假凭据、假 CLI 与外部网络替身;真实本地桥 IPC、原生进程和独立账号 OAuth 验收另列,均使用临时目录。
|
|
8
8
|
|
|
9
|
+
## 0.2.9 Core 适配、设置页与消耗倍率
|
|
10
|
+
|
|
11
|
+
- 从桌面 `app.asar` 的产品与各包 manifest 核对实际 Core / llm / llm-pi-ai / credentials / launch-environment / typert-protocol 为 `0.2.1-rc.5`,其消费的 pi-ai 仍为 `1.1.0`;插件 peer 声明同步到 rc.5,没有改写宿主安装。
|
|
12
|
+
- 真实 rc.5 隔离 Host 加载通过,覆盖 Core Schema、RPC、双路由、模型目录、路由失败保留和 dispose;模型管理、逐模型思考与能力矩阵使用同一真实 Core/SDK 和假 HTTP,未调用真实推理。
|
|
13
|
+
- 设置页参考 Our Free Model 2.7.1 的卡片与标签信息层级,保留本插件原有账号、双套餐、额度、模型参数和异步保护。真实 React/Chrome 离线验证名称旁倍率、限时标记、能力标签、模型开关与参数、额度分组、登录路径、390px 窄屏和窄内容栏;HTTP(S) 全部阻断,RPC 为假数据。
|
|
14
|
+
- 深浅色 ×(宿主实色 secondary 令牌 / 缺失令牌)四组对比度审计均通过 WCAG AA。首次审计发现按钮/开关主题过渡中间色与折扣小字对比不足,已去除相关颜色过渡并修正文字透明度后复验通过。
|
|
15
|
+
- 倍率依据[官方 AFP 抵扣规则](https://ark.volcengine.com/region:cn-beijing/docs/agent-plan-personal-afp-credits-billing-rules)与[共享折扣活动](https://ark.volcengine.com/region:cn-beijing/docs/coding-plan-personal-model-discount)固化,逐模型来源和 Kimi K3 活动结束冲突见[能力参数](model-capabilities.md#消耗倍率)。测试覆盖两套套餐别名、活动开始前/截止/结束后、未知与动态路由无倍率,以及倍率元数据不进入 Core 配置;Coding 仅作相对消耗参考,未实测线上计费。
|
|
16
|
+
|
|
17
|
+
## 0.2.8 模型能力覆盖
|
|
18
|
+
|
|
19
|
+
- 对照两套 Plan 的 Pi 文档、套餐概览、官方插件目录及目标 Core/SDK 契约复核模型参数与输入模态;官方音视频能力与当前文本/图片传输边界、思考字段的资料冲突分别见[能力参数](model-capabilities.md)和[思考参数审计](model-thinking-audit.md)。未进行真实账号推理。
|
|
20
|
+
- 使用真实目标 Core 和 SDK、假凭据与离线 HTTP 替身验证两套餐的图片能力声明、工具调用选择及已准备请求隔离;服务端违规返回工具调用时的拦截由隔离测试验证。
|
|
21
|
+
- 尚未实测方舟服务端对工具禁用请求或图片输入的接受情况,也未以真实网络回放服务端违约工具事件。旧版回退结果依据源码分析,未进行端到端回退测试。
|
|
22
|
+
- 使用 React/Chrome 离线验证复选框勾选、分别恢复继承、未知默认的未定态以及 390px 窄屏与深浅色;RPC 为假数据。
|
|
23
|
+
|
|
9
24
|
## 0.2.7 设置页额度展示调整
|
|
10
25
|
|
|
11
26
|
- 使用真实 React/Chrome 与假 RPC 数据离线验证账号、模型操作、额度分组及实时倒计时;覆盖深浅色、390px 视口、768px 视口及宽窗口中的 390px 内容栏。
|
|
@@ -48,7 +63,7 @@ node --test test/*.test.mjs
|
|
|
48
63
|
- HMAC 签名测试使用独立 OpenSSL 推导的固定向量,不只比较实现自身的两次输出。
|
|
49
64
|
- 构建生成 Host 模块与返回导出对象的惰性 Client 工厂;不新增安装构建依赖。
|
|
50
65
|
|
|
51
|
-
当前结果:**
|
|
66
|
+
当前结果:**363 项 JavaScript 测试、11 项 Python 归档测试通过**,50 个 JavaScript 源文件语法/边界检查通过,构建包含 19 个模块/Client 产物及 3 个浏览器桥辅助文件。模型管理测试覆盖旧状态迁移、套餐/模型开关、逐模型参数、请求默认值及适配器生命周期;发布测试覆盖 OIDC 身份、版本与渠道、归档校验(含 `catalog-snapshot.json` 与 `consumption-rates.json` 必需项)、registry 错误分类及发布后完整性检查。
|
|
52
67
|
|
|
53
68
|
### 实际 Core 隔离加载
|
|
54
69
|
|
package/lib/ark-adapter.mjs
CHANGED
|
@@ -23,13 +23,24 @@ function abortOnReturn(iterator, cancellation) {
|
|
|
23
23
|
return iterator;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/** 工具被逐模型关闭时,服务端返回的任何工具调用块都视为违约。 */
|
|
27
|
+
function carriesToolCall(chunk) {
|
|
28
|
+
if (!chunk || typeof chunk !== 'object') return false;
|
|
29
|
+
if (chunk.type === 'tool-call-delta') return true;
|
|
30
|
+
if (chunk.type === 'block-start') return chunk.blockType === 'tool-call';
|
|
31
|
+
if (chunk.type === 'block-end') return chunk.block?.type === 'tool-call';
|
|
32
|
+
return chunk.type === 'finish' && chunk.reason?.kind === 'tool-calls';
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
/**
|
|
27
36
|
* Build an isolated public PiAiAdapter composition for one route generation.
|
|
28
37
|
* deps supplies LlmAdapter, LlmError, PiAiAdapter, InMemoryCredentialStore,
|
|
29
38
|
* anthropicMessagesApi and optionally the Core's public resolveRetryPolicy.
|
|
30
39
|
* config.providers is the plain profilesFor result. factsByProvider is a
|
|
31
|
-
* Map<route, Map<exactModelId, row>>;
|
|
32
|
-
* row.canDisableThinking
|
|
40
|
+
* Map<route, Map<exactModelId, row>>; row.messagesThinkingMode,
|
|
41
|
+
* row.canDisableThinking and row.effective.toolsEnabled enter request
|
|
42
|
+
* controls. The tool switch is per model: false asks the API for
|
|
43
|
+
* tool_choice none and blocks any tool call the server returns anyway. resolveApiKey(route) is the
|
|
33
44
|
* sole credential source; the attachment hooks use PiAiAdapterOptions shapes.
|
|
34
45
|
* The returned LlmAdapter also exposes idempotent dispose().
|
|
35
46
|
*/
|
|
@@ -86,6 +97,10 @@ export function createArkAdapter(deps, config) {
|
|
|
86
97
|
seen.add(entry.id);
|
|
87
98
|
const fact = facts.get(entry.id);
|
|
88
99
|
if (!object(fact)) invalid();
|
|
100
|
+
if (fact.effective !== undefined && !object(fact.effective)) invalid();
|
|
101
|
+
if (fact.effective?.toolsEnabled !== undefined && typeof fact.effective.toolsEnabled !== 'boolean') invalid();
|
|
102
|
+
// 目录里缺少该开关的旧数据按开启处理。
|
|
103
|
+
const toolsEnabled = fact.effective?.toolsEnabled ?? true;
|
|
89
104
|
const mode = fact.messagesThinkingMode ?? 'server-default';
|
|
90
105
|
if (!MODES.has(mode) || (fact.canDisableThinking != null && typeof fact.canDisableThinking !== 'boolean')) invalid();
|
|
91
106
|
if (entry.api !== undefined && entry.api !== input.api) invalid();
|
|
@@ -146,7 +161,8 @@ export function createArkAdapter(deps, config) {
|
|
|
146
161
|
supportsOff: reasoning && Object.hasOwn(effort, 'off'),
|
|
147
162
|
offWire: reasoning ? effort.off : undefined,
|
|
148
163
|
offCarrier: reasoning ? Object.keys(effort).find(level => level !== 'off') : undefined,
|
|
149
|
-
forceAdaptiveThinking: compat.forceAdaptiveThinking
|
|
164
|
+
forceAdaptiveThinking: compat.forceAdaptiveThinking,
|
|
165
|
+
toolsEnabled
|
|
150
166
|
});
|
|
151
167
|
}
|
|
152
168
|
specifications.set(route, { profile, models, controls, configuredMaxTokens });
|
|
@@ -169,7 +185,8 @@ export function createArkAdapter(deps, config) {
|
|
|
169
185
|
const profiles = new Map();
|
|
170
186
|
for (const [route, spec] of specifications) {
|
|
171
187
|
const optionsFor = (options, model) => messagesStreamOptions(options, {
|
|
172
|
-
...spec.controls.get(model.id), reasoningEffort: control?.reasoningEffort
|
|
188
|
+
...spec.controls.get(model.id), reasoningEffort: control?.reasoningEffort,
|
|
189
|
+
toolsEnabled: control?.toolsEnabled ?? spec.controls.get(model.id).toolsEnabled
|
|
173
190
|
});
|
|
174
191
|
profiles.set(route, {
|
|
175
192
|
...spec.profile,
|
|
@@ -224,7 +241,7 @@ export function createArkAdapter(deps, config) {
|
|
|
224
241
|
async prepareCall(provider, model, signal) {
|
|
225
242
|
ensureLive(); const spec = own(provider, model);
|
|
226
243
|
if (signal?.aborted) fail('方舟请求已取消', 'ABORTED');
|
|
227
|
-
const control = { reasoningEffort: undefined };
|
|
244
|
+
const control = { reasoningEffort: undefined, toolsEnabled: spec.controls.get(model).toolsEnabled };
|
|
228
245
|
const key = { value: undefined };
|
|
229
246
|
const callDelegate = delegate(control, key);
|
|
230
247
|
const prepared = await callDelegate.prepareCall(provider, model, signal);
|
|
@@ -258,6 +275,10 @@ export function createArkAdapter(deps, config) {
|
|
|
258
275
|
: options.reasoningEffort,
|
|
259
276
|
signal: requestSignal
|
|
260
277
|
})) {
|
|
278
|
+
// 关闭工具调用时不得向上游释放任何完整或增量工具调用。
|
|
279
|
+
if (control.toolsEnabled === false && carriesToolCall(chunk)) {
|
|
280
|
+
fail('该模型已关闭工具调用,但服务端仍返回了工具调用', 'TOOL_CALL_DISABLED');
|
|
281
|
+
}
|
|
261
282
|
if (chunk.type === 'finish' && chunk.reason?.failure) {
|
|
262
283
|
yield { ...chunk, reason: { ...chunk.reason, failure: { ...chunk.reason.failure, message: redact(chunk.reason.failure.message, key.value) } } };
|
|
263
284
|
} else yield chunk;
|
|
Binary file
|
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
"messagesThinkingMode": "server-default",
|
|
368
368
|
"canDisableThinking": null,
|
|
369
369
|
"capabilityStatus": "partial",
|
|
370
|
-
"capabilityNote": "
|
|
370
|
+
"capabilityNote": "该套餐的思考能力与控制尚未单独确认;保持服务端默认。",
|
|
371
371
|
"aliases": [
|
|
372
372
|
"kimi-k2-7-code-260601"
|
|
373
373
|
],
|
package/lib/catalog.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { assertModelId, assertPlan, LABELS, ROUTES, BUDGET_THINKING_LEVELS } from './state.mjs';
|
|
3
3
|
export const snapshot = JSON.parse(await readFile(new URL('./catalog-snapshot.json', import.meta.url), 'utf8'));
|
|
4
|
+
export const consumptionRates = JSON.parse(await readFile(new URL('./consumption-rates.json', import.meta.url), 'utf8'));
|
|
4
5
|
const modelId = /^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,199}$/;
|
|
5
6
|
function validateModelRows(rows) {
|
|
6
7
|
if (!Array.isArray(rows) || rows.length > 1000) throw new Error('本地模型缓存格式错误');
|
|
@@ -19,6 +20,33 @@ function snapshotModel(plan, id) {
|
|
|
19
20
|
if (typeof id !== 'string') return undefined;
|
|
20
21
|
return snapshot[plan].models.find(model => model.id === id || model.aliases?.includes(id));
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Resolve the official model deduction coefficient for display only.
|
|
26
|
+
* Discount windows are evaluated at read time so an expired promotion never
|
|
27
|
+
* remains presented as the current rate. Unknown and account-routed models
|
|
28
|
+
* deliberately return null instead of inheriting a target model's rate.
|
|
29
|
+
*/
|
|
30
|
+
export function resolveConsumption(plan, id, now = Date.now()) {
|
|
31
|
+
assertPlan(plan);
|
|
32
|
+
const pinned = snapshotModel(plan, id);
|
|
33
|
+
const candidates = new Set([id, pinned?.id, ...(pinned?.aliases ?? [])].filter(Boolean));
|
|
34
|
+
const entry = Object.values(consumptionRates.models).find(row => row.ids.some(value => candidates.has(value)));
|
|
35
|
+
if (!entry) return null;
|
|
36
|
+
const discount = entry.discount;
|
|
37
|
+
const startsAt = discount ? Date.parse(discount.startsAt) : NaN;
|
|
38
|
+
const endsAt = discount ? Date.parse(discount.endsAt) : NaN;
|
|
39
|
+
const discounted = Boolean(discount && Number.isFinite(startsAt) && Number.isFinite(endsAt)
|
|
40
|
+
&& Number.isFinite(now) && now >= startsAt && now <= endsAt);
|
|
41
|
+
return {
|
|
42
|
+
plan,
|
|
43
|
+
multiplier: discounted ? discount.multiplier : entry.multiplier,
|
|
44
|
+
regularMultiplier: entry.multiplier,
|
|
45
|
+
discounted,
|
|
46
|
+
...(discounted ? { discountEndsAt: discount.endsAt } : {})
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
22
50
|
function pinnedCapabilities(model) {
|
|
23
51
|
const { aliases: _aliases, ...capabilities } = structuredClone(model);
|
|
24
52
|
return capabilities;
|
|
@@ -33,12 +61,40 @@ function fallbackCapabilities(id) {
|
|
|
33
61
|
capabilityNote: dynamic ? '智能调度的能力随目标模型变化,未声明统一思考档位。' : '该精确版本尚无固化能力资料,采用保守配置。'
|
|
34
62
|
};
|
|
35
63
|
}
|
|
64
|
+
// Core 只支持文本与图片两种输入模态;目录声明的其它模态(含音视频)不被接受。
|
|
65
|
+
const CORE_INPUT_MODALITIES = ['text', 'image'];
|
|
66
|
+
// 目录没有声明输入模态时沿用既有 fallback:只接文本。
|
|
67
|
+
const FALLBACK_INPUT = ['text'];
|
|
68
|
+
/**
|
|
69
|
+
* 检查目录声明的输入模态。
|
|
70
|
+
* 缺失按既有 fallback 处理;非数组、含重复或含未支持模态一律判为无效:
|
|
71
|
+
* 不能悄悄退化成纯文本,否则损坏的目录会被伪装成可用路由。
|
|
72
|
+
* 调用方自行决定是报错(路由构建)还是只作提示(设置页)。
|
|
73
|
+
*/
|
|
74
|
+
function inspectInput(modalities) {
|
|
75
|
+
if (modalities === undefined) return { input: [...FALLBACK_INPUT] };
|
|
76
|
+
if (!Array.isArray(modalities) || !modalities.length) return { error: '模型目录的输入模态格式错误' };
|
|
77
|
+
const seen = new Set();
|
|
78
|
+
for (const value of modalities) {
|
|
79
|
+
if (typeof value !== 'string' || !CORE_INPUT_MODALITIES.includes(value)) return { error: '模型目录的输入模态不受支持' };
|
|
80
|
+
if (seen.has(value)) return { error: '模型目录的输入模态包含重复项' };
|
|
81
|
+
seen.add(value);
|
|
82
|
+
}
|
|
83
|
+
return { input: [...modalities] };
|
|
84
|
+
}
|
|
36
85
|
function coreCapabilities(model) {
|
|
37
86
|
const {
|
|
38
87
|
aliases: _aliases, capabilityUnverified: _unverified, defaultReasoning: _default,
|
|
39
88
|
messagesThinkingMode: _mode, canDisableThinking: _disable,
|
|
40
|
-
capabilityStatus: _status, capabilityNote: _note,
|
|
89
|
+
capabilityStatus: _status, capabilityNote: _note,
|
|
90
|
+
toolsEnabled: _tools, imageInput: _image, ...capabilities
|
|
41
91
|
} = model;
|
|
92
|
+
if ('input' in capabilities) {
|
|
93
|
+
const checked = inspectInput(capabilities.input);
|
|
94
|
+
// 路由构建阶段直接拒绝:坏目录不得被当成纯文本模型注册。
|
|
95
|
+
if (checked.error) throw new Error(`${checked.error}:${model.id ?? '未知模型'}`);
|
|
96
|
+
capabilities.input = checked.input;
|
|
97
|
+
}
|
|
42
98
|
return capabilities;
|
|
43
99
|
}
|
|
44
100
|
function displayName(id, candidate, pinned) {
|
|
@@ -114,7 +170,9 @@ export function modelDefaults(plan, model) {
|
|
|
114
170
|
const forceAdaptiveThinking = typeof model?.compat?.forceAdaptiveThinking === 'boolean'
|
|
115
171
|
? model.compat.forceAdaptiveThinking
|
|
116
172
|
: typeof base.compat?.forceAdaptiveThinking === 'boolean' ? base.compat.forceAdaptiveThinking : false;
|
|
117
|
-
|
|
173
|
+
// 图片输入取模型实际声明的模态;工具开关默认开启,保持既有工具行为不变。
|
|
174
|
+
const imageInput = Array.isArray(model?.input) && model.input.includes('image');
|
|
175
|
+
return { contextWindow, maxTokens, reasoningEfforts: efforts, defaultReasoning: defaultReasoningFor(efforts, model?.defaultReasoning), forceAdaptiveThinking, imageInput, toolsEnabled: true };
|
|
118
176
|
}
|
|
119
177
|
|
|
120
178
|
/** 目录默认与用户覆盖合并后的有效参数。 */
|
|
@@ -127,6 +185,8 @@ export function effectiveModel(defaults, settings = {}) {
|
|
|
127
185
|
if (settings.forceAdaptiveThinking !== undefined) effective.forceAdaptiveThinking = settings.forceAdaptiveThinking;
|
|
128
186
|
if (settings.forceAdaptiveThinking === false && settings.reasoningEfforts === undefined) effective.reasoningEfforts = inheritedBudgetMap(effective.reasoningEfforts);
|
|
129
187
|
if (settings.temperature !== undefined) effective.temperature = settings.temperature;
|
|
188
|
+
if (settings.imageInput !== undefined) effective.imageInput = settings.imageInput;
|
|
189
|
+
if (settings.toolsEnabled !== undefined) effective.toolsEnabled = settings.toolsEnabled;
|
|
130
190
|
effective.defaultReasoning = defaultReasoningFor(effective.reasoningEfforts, settings.defaultReasoning === undefined ? defaults.defaultReasoning : settings.defaultReasoning);
|
|
131
191
|
return effective;
|
|
132
192
|
}
|
|
@@ -165,6 +225,10 @@ export function getModelRows(state, accountId, plan) {
|
|
|
165
225
|
const defaults = modelDefaults(plan, model);
|
|
166
226
|
const effective = effectiveModel(defaults, settings);
|
|
167
227
|
const warnings = [];
|
|
228
|
+
// 目录声明的输入模态无效时设置页仍可读,但路由构建会拒绝该目录。
|
|
229
|
+
const declaredInput = inspectInput(model.input);
|
|
230
|
+
if (declaredInput.error) warnings.push(`${declaredInput.error}:该目录会导致路由更新失败;若已有可用路由会予以保留,请重新拉取模型目录。`);
|
|
231
|
+
if (settings.imageInput === true && defaults.imageInput === false) warnings.push('已强制开启图片输入:目录未声明该模型支持图片,请先确认服务端能力。');
|
|
168
232
|
if (model.canDisableThinking === false && effective.reasoningEfforts?.off === null) {
|
|
169
233
|
const { off: _off, ...levels } = effective.reasoningEfforts;
|
|
170
234
|
effective.reasoningEfforts = Object.keys(levels).length ? levels : false;
|
|
@@ -180,6 +244,7 @@ export function getModelRows(state, accountId, plan) {
|
|
|
180
244
|
return {
|
|
181
245
|
id: model.id,
|
|
182
246
|
name: typeof model.name === 'string' && model.name ? model.name : model.id,
|
|
247
|
+
consumption: resolveConsumption(plan, model.id),
|
|
183
248
|
enabled: settings.enabled !== false,
|
|
184
249
|
capabilityUnverified: model.capabilityUnverified === true,
|
|
185
250
|
messagesThinkingMode: model.messagesThinkingMode ?? 'server-default',
|
|
@@ -203,10 +268,14 @@ export function providerProfile(plan, models) {
|
|
|
203
268
|
|
|
204
269
|
/** 把有效参数写回 Core 的模型描述;只写 Core 认识的字段。 */
|
|
205
270
|
function coreModel(model, row) {
|
|
271
|
+
// 目录声明的输入模态在此之前已被校验;畸形目录不会走到这里。
|
|
206
272
|
if (!row) return coreCapabilities(model);
|
|
207
273
|
const compat = { ...(model.compat ?? {}) };
|
|
208
274
|
if (typeof row.effective.forceAdaptiveThinking === 'boolean') compat.forceAdaptiveThinking = row.effective.forceAdaptiveThinking;
|
|
209
|
-
|
|
275
|
+
// 目录声明有效时,Core 的输入模态由图片开关决定:text 或 text+image。
|
|
276
|
+
const input = row.effective.imageInput ? ['text', 'image'] : ['text'];
|
|
277
|
+
// 工具开关只经 factsByProvider 的行传给适配器,不作为 Core 字段下发。
|
|
278
|
+
return { ...coreCapabilities(model), input, contextWindow: row.effective.contextWindow, maxTokens: row.effective.maxTokens, reasoningEfforts: row.effective.reasoningEfforts, compat };
|
|
210
279
|
}
|
|
211
280
|
|
|
212
281
|
export function profilesFor(state) {
|
package/lib/client.js
CHANGED
|
@@ -264,6 +264,22 @@ body[data-ds-dark-theme] .vcp-settings{color-scheme:dark}
|
|
|
264
264
|
@media(max-width:420px){.vcp-settings{padding:2px 0 20px}.vcp-card{padding:12px}.vcp-plan-workspace{padding:0}.vcp-plan{padding:12px}.vcp-header{flex-wrap:wrap}.vcp-header>.vcp-actions{width:100%;justify-content:space-between}.vcp-heading{gap:8px}.vcp-heading>.vcp-actions{width:100%}.vcp-actions .vcp-button{flex:1 1 auto}.vcp-account-body{padding:12px 0 0}.vcp-section{padding-top:12px}.vcp-quota-reset{flex-direction:column}.vcp-plan-account{flex-basis:100%}}
|
|
265
265
|
@container vcp (max-width:680px){.vcp-fields,.vcp-fields-three{grid-template-columns:1fr}}
|
|
266
266
|
@container vcp (max-width:420px){.vcp-settings{padding:2px 0 20px}.vcp-plan{padding:12px}.vcp-header{flex-wrap:wrap}.vcp-header>.vcp-actions{width:100%;justify-content:space-between}.vcp-heading>.vcp-actions{width:100%}.vcp-actions .vcp-button{flex:1 1 auto}.vcp-account-body{padding:12px 0 0}.vcp-quota-reset{flex-direction:column}.vcp-plan-account{flex-basis:100%}}
|
|
267
|
+
|
|
268
|
+
/* Provider workspace: independent plan cards, compact quotas and model badges. */
|
|
269
|
+
.vcp-settings{max-width:1080px;padding:4px 2px 32px;gap:16px;-webkit-font-smoothing:antialiased}
|
|
270
|
+
.vcp-content{gap:16px}.vcp-hero{position:relative;overflow:hidden;padding:20px 22px;border:1px solid var(--dsw-alias-border-l3,rgba(128,128,128,.2));border-radius:18px;background:linear-gradient(145deg,color-mix(in srgb,var(--dsw-alias-brand-primary,#2563eb) 8%,var(--dsw-alias-bg-layer-1,#fff)),var(--dsw-alias-bg-layer-1,#fff) 58%);box-shadow:0 8px 28px rgba(15,23,42,.05)}
|
|
271
|
+
.vcp-brand-mark{display:flex;align-items:center;justify-content:center;flex:none;width:42px;height:42px;border-radius:13px;background:var(--dsw-alias-brand-primary,#2563eb);color:var(--dsw-alias-label-primary-foreground,#fff);font-size:20px;font-weight:750;box-shadow:0 6px 16px color-mix(in srgb,var(--dsw-alias-brand-primary,#2563eb) 24%,transparent)}
|
|
272
|
+
.vcp-hero-subtitle{margin:5px 0 0;max-width:64ch;font-size:12px;line-height:1.6;color:var(--dsw-alias-label-secondary,inherit)}.vcp-eyebrow{margin-bottom:3px;font-size:10px;font-weight:700;letter-spacing:.09em;color:var(--dsw-alias-label-secondary,inherit)}
|
|
273
|
+
.vcp-plan-workspace{gap:14px;padding:0;border:0;background:transparent;overflow:visible;align-items:start}.vcp-plan{gap:14px;padding:18px;border:1px solid var(--dsw-alias-border-l3,rgba(128,128,128,.2));border-radius:16px;background:var(--dsw-alias-bg-layer-1,Canvas);box-shadow:0 3px 14px rgba(15,23,42,.035)}.vcp-plan-setup{align-items:stretch}.vcp-plan-account{flex-basis:100%}.vcp-plan-toggle{display:inline-flex;align-items:center;gap:7px;min-height:28px;font-size:11px;font-weight:600;white-space:nowrap;cursor:pointer}
|
|
274
|
+
.vcp-switch-input{appearance:none;-webkit-appearance:none;position:relative;flex:none;width:34px;height:20px;margin:0;border:1px solid var(--dsw-alias-border-l3,rgba(128,128,128,.35));border-radius:999px;background:var(--dsw-alias-bg-layer-2,rgba(128,128,128,.12));color:var(--dsw-alias-label-primary,#1f2937);cursor:pointer}.vcp-switch-input::after{content:'';position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:currentColor;box-shadow:0 1px 3px rgba(0,0,0,.2)}.vcp-switch-input:checked{border-color:var(--dsw-alias-brand-primary,#2563eb);background:var(--dsw-alias-brand-primary,#2563eb);color:var(--dsw-alias-label-primary-foreground,#fff)}.vcp-switch-input:checked::after{transform:translateX(14px)}body[data-ds-dark-theme] .vcp-switch-input:checked{color:#11161e}.vcp-switch-input:disabled{opacity:.55;cursor:not-allowed}
|
|
275
|
+
.vcp-status-chip{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border:1px solid var(--dsw-alias-border-l4,rgba(128,128,128,.18));border-radius:999px;font-size:10.5px;line-height:1.6;white-space:nowrap;color:var(--dsw-alias-label-secondary,inherit);background:var(--dsw-alias-interactive-bg-hover,rgba(128,128,128,.06))}.vcp-status-chip::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}.vcp-status-chip[data-tone=success]{color:var(--dsw-alias-state-success-primary,#15803d);border-color:color-mix(in srgb,currentColor 30%,transparent);background:color-mix(in srgb,currentColor 8%,transparent)}.vcp-status-chip[data-tone=warn]{color:var(--dsw-alias-state-warn-primary,#b45309);border-color:color-mix(in srgb,currentColor 30%,transparent);background:color-mix(in srgb,currentColor 8%,transparent)}
|
|
276
|
+
.vcp-quota{grid-template-columns:1fr;gap:8px}.vcp-quota-group{grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:8px}.vcp-quota-group-title{grid-column:1/-1}.vcp-quota-window{padding:10px;border:1px solid var(--dsw-alias-border-l4,rgba(128,128,128,.12));background:var(--dsw-alias-interactive-bg-hover,rgba(128,128,128,.045))}.vcp-quota-track{height:6px}.vcp-quota-percent{font-size:18px}.vcp-quota-meta{font-size:11px}.vcp-section{gap:8px;padding-top:12px}
|
|
277
|
+
.vcp-model-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:10px;margin-top:10px}.vcp-model{position:relative;display:flex;flex-direction:column;gap:10px;min-width:0;padding:13px;border:1px solid var(--dsw-alias-border-l3,rgba(128,128,128,.18));border-radius:12px;background:var(--dsw-alias-bg-layer-2,rgba(128,128,128,.035));box-shadow:inset 0 1px 0 rgba(255,255,255,.035)}.vcp-model:first-child{border-top:1px solid var(--dsw-alias-border-l3,rgba(128,128,128,.18))}.vcp-model[data-disabled=true]{opacity:.66}.vcp-model-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-width:0}.vcp-model-toggle{display:flex;align-items:flex-start;gap:9px;flex:1 1 auto;min-width:0;cursor:pointer}.vcp-model-toggle .vcp-switch-input{margin-top:1px}.vcp-model-heading{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0;font-size:13px;line-height:1.45}.vcp-model-name{font-size:13.5px;font-weight:650;overflow-wrap:anywhere}.vcp-model-tags{display:flex;gap:5px;flex-wrap:wrap}.vcp-model-tag{display:inline-flex;align-items:center;padding:2px 7px;border:1px solid var(--dsw-alias-border-l4,rgba(128,128,128,.16));border-radius:999px;font-size:10px;line-height:1.55;white-space:nowrap;color:var(--dsw-alias-label-secondary,inherit);background:var(--dsw-alias-interactive-bg-hover,rgba(128,128,128,.04))}.vcp-model-tag[data-tone=accent]{color:var(--dsw-alias-brand-primary,#2563eb);border-color:color-mix(in srgb,currentColor 25%,transparent);background:color-mix(in srgb,currentColor 6%,transparent)}.vcp-model-tag[data-tone=warn]{color:var(--dsw-alias-state-warn-primary,#b45309)}
|
|
278
|
+
.vcp-rate-badge{display:inline-flex;align-items:center;gap:4px;padding:1px 7px;border:1px solid color-mix(in srgb,var(--dsw-alias-brand-primary,#2563eb) 35%,transparent);border-radius:999px;background:color-mix(in srgb,var(--dsw-alias-brand-primary,#2563eb) 8%,transparent);color:var(--dsw-alias-brand-primary,#2563eb);font-size:10.5px;font-weight:750;line-height:1.6;white-space:nowrap;font-variant-numeric:tabular-nums}.vcp-rate-badge small{font-size:8.5px;font-weight:650;opacity:1}.vcp-rate-badge[data-discount=true]{color:var(--dsw-alias-state-success-primary,#15803d);border-color:color-mix(in srgb,currentColor 35%,transparent);background:color-mix(in srgb,currentColor 9%,transparent)}
|
|
279
|
+
.vcp-model-actions{display:flex;justify-content:flex-end;gap:7px;flex-wrap:wrap;margin-top:auto}.vcp-model-actions .vcp-button{min-height:29px;padding:4px 10px;font-size:11px}.vcp-model .vcp-details{padding-top:2px;border-top:1px solid var(--dsw-alias-border-l4,rgba(128,128,128,.12))}.vcp-model .vcp-details>summary{min-height:25px;padding:3px 0;font-size:11px}.vcp-account-panel{border-radius:16px;padding:16px 18px}.vcp-button{transition:border-color .15s ease,box-shadow .15s ease}.vcp-button-primary{border-color:var(--dsw-alias-brand-primary,#2563eb)}
|
|
280
|
+
@media(max-width:680px){.vcp-hero{padding:16px}.vcp-plan{padding:15px}.vcp-model-list{grid-template-columns:1fr}}
|
|
281
|
+
@media(max-width:420px){.vcp-plan{padding:12px}.vcp-brand-mark{width:36px;height:36px;border-radius:11px;font-size:17px}.vcp-hero .vcp-header-copy{flex:1 1 calc(100% - 52px)}.vcp-hero-subtitle{font-size:11px}.vcp-model-head{flex-direction:column}.vcp-model-head>.vcp-chip-row{padding-left:43px}.vcp-quota{grid-template-columns:1fr}}
|
|
282
|
+
@media(prefers-reduced-motion:reduce){.vcp-settings *{scroll-behavior:auto!important;transition:none!important}}
|
|
267
283
|
`;
|
|
268
284
|
|
|
269
285
|
function installStyles() {
|
|
@@ -302,6 +318,30 @@ function StatusChip({ tone = 'muted', children }) {
|
|
|
302
318
|
return h('span', { className: 'vcp-status-chip', 'data-tone': tone }, children);
|
|
303
319
|
}
|
|
304
320
|
|
|
321
|
+
function ModelTag({ tone = 'muted', title, children }) {
|
|
322
|
+
return h('span', { className: 'vcp-model-tag', 'data-tone': tone, title }, children);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function formatRate(value) {
|
|
326
|
+
return Number.isFinite(value) ? String(Math.round(value * 100) / 100) : '';
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function ConsumptionBadge({ plan, consumption }) {
|
|
330
|
+
const rate = formatRate(consumption?.multiplier);
|
|
331
|
+
if (!rate) return null;
|
|
332
|
+
const regular = formatRate(consumption.regularMultiplier);
|
|
333
|
+
const discount = consumption.discounted
|
|
334
|
+
? `限时折扣至 ${formatTime(consumption.discountEndsAt)},常规倍率 ${regular}×。`
|
|
335
|
+
: '当前按常规倍率展示。';
|
|
336
|
+
const title = plan === 'agent-plan'
|
|
337
|
+
? `Agent Plan AFP 输入/输出抵扣系数均为 ${rate}。${discount}`
|
|
338
|
+
: `以官方 Agent Plan AFP 系数作相对消耗参考 ${rate}×;Coding Plan 不以此换算固定调用次数或 AFP 绝对量。${discount}`;
|
|
339
|
+
return h('span', {
|
|
340
|
+
className: 'vcp-rate-badge', 'data-discount': consumption.discounted ? 'true' : 'false',
|
|
341
|
+
title, 'aria-label': `消耗倍率 ${rate} 倍${consumption.discounted ? ',限时折扣' : ''}`
|
|
342
|
+
}, `${rate}×`, consumption.discounted ? h('small', null, '限时') : null);
|
|
343
|
+
}
|
|
344
|
+
|
|
305
345
|
// ── 纯函数小工具 ─────────────────────────────────────────────────────────────
|
|
306
346
|
|
|
307
347
|
/**
|
|
@@ -421,6 +461,19 @@ function formatPercent(value) {
|
|
|
421
461
|
return Number.isFinite(rounded) ? String(rounded) : '0';
|
|
422
462
|
}
|
|
423
463
|
|
|
464
|
+
function formatTokenCount(value) {
|
|
465
|
+
if (!Number.isFinite(value) || value <= 0) return '未知';
|
|
466
|
+
if (value >= 1024 * 1024) {
|
|
467
|
+
const amount = value / (1024 * 1024);
|
|
468
|
+
return `${Number.isInteger(amount) ? amount : amount.toFixed(1)}M`;
|
|
469
|
+
}
|
|
470
|
+
if (value >= 1024) {
|
|
471
|
+
const amount = value / 1024;
|
|
472
|
+
return `${Number.isInteger(amount) ? amount : amount.toFixed(1)}K`;
|
|
473
|
+
}
|
|
474
|
+
return String(value);
|
|
475
|
+
}
|
|
476
|
+
|
|
424
477
|
/**
|
|
425
478
|
* 归一化登录状态。
|
|
426
479
|
*
|
|
@@ -614,6 +667,8 @@ function describeModelSettings(model) {
|
|
|
614
667
|
if (Number.isFinite(settings.contextWindow)) parts.push(`上下文长度 ${settings.contextWindow}`);
|
|
615
668
|
if (Number.isFinite(settings.maxTokens)) parts.push(`最大输出 ${settings.maxTokens}`);
|
|
616
669
|
if (Number.isFinite(settings.temperature)) parts.push(`温度 ${settings.temperature}`);
|
|
670
|
+
if (Object.hasOwn(settings, 'imageInput')) parts.push(`图片输入 ${settings.imageInput ? '启用' : '禁用'}`);
|
|
671
|
+
if (Object.hasOwn(settings, 'toolsEnabled')) parts.push(`工具调用 ${settings.toolsEnabled ? '启用' : '禁用'}`);
|
|
617
672
|
if (Object.hasOwn(settings, 'reasoningEfforts')) parts.push(`思考档位 ${effortSummary(settings.reasoningEfforts)}`);
|
|
618
673
|
if (Object.hasOwn(settings, 'defaultReasoning')) parts.push(`默认档位 ${settings.defaultReasoning === null ? '不强制' : String(settings.defaultReasoning)}`);
|
|
619
674
|
if (Object.hasOwn(settings, 'forceAdaptiveThinking')) parts.push(settings.forceAdaptiveThinking ? '原生 effort 模式' : '固定预算模式');
|
|
@@ -633,6 +688,8 @@ function describeEffective(model) {
|
|
|
633
688
|
if (Number.isFinite(effective.contextWindow)) parts.push(`上下文长度 ${effective.contextWindow}`);
|
|
634
689
|
if (Number.isFinite(effective.maxTokens)) parts.push(`最大输出 ${effective.maxTokens}`);
|
|
635
690
|
if (Number.isFinite(effective.temperature)) parts.push(`温度 ${effective.temperature}`);
|
|
691
|
+
if (typeof effective.imageInput === 'boolean') parts.push(`图片输入 ${effective.imageInput ? '启用' : '禁用'}`);
|
|
692
|
+
if (typeof effective.toolsEnabled === 'boolean') parts.push(`工具调用 ${effective.toolsEnabled ? '启用' : '禁用'}`);
|
|
636
693
|
if (Object.hasOwn(effective, 'reasoningEfforts')) parts.push(`思考档位 ${effortSummary(effective.reasoningEfforts)}`);
|
|
637
694
|
if (Object.hasOwn(effective, 'defaultReasoning')) parts.push(`默认档位 ${effective.defaultReasoning === null ? '不强制' : String(effective.defaultReasoning)}`);
|
|
638
695
|
if (effective.reasoningEfforts === false) parts.push('思考控制按模型默认');
|
|
@@ -670,6 +727,8 @@ function modelDraftFrom(model) {
|
|
|
670
727
|
contextWindow: settings.contextWindow === undefined ? '' : String(settings.contextWindow),
|
|
671
728
|
maxTokens: settings.maxTokens === undefined ? '' : String(settings.maxTokens),
|
|
672
729
|
temperature: settings.temperature === undefined ? '' : String(settings.temperature),
|
|
730
|
+
imageInput: settings.imageInput === undefined ? 'inherit' : settings.imageInput ? 'true' : 'false',
|
|
731
|
+
toolsEnabled: settings.toolsEnabled === undefined ? 'inherit' : settings.toolsEnabled ? 'true' : 'false',
|
|
673
732
|
effortsMode,
|
|
674
733
|
effortsText,
|
|
675
734
|
defaultReasoning,
|
|
@@ -746,6 +805,12 @@ function parseModelSettings(draft, model) {
|
|
|
746
805
|
else settings.temperature = value;
|
|
747
806
|
}
|
|
748
807
|
|
|
808
|
+
for (const key of ['imageInput', 'toolsEnabled']) {
|
|
809
|
+
const value = draft?.[key] ?? 'inherit';
|
|
810
|
+
if (value === 'true') settings[key] = true;
|
|
811
|
+
else if (value === 'false') settings[key] = false;
|
|
812
|
+
}
|
|
813
|
+
|
|
749
814
|
const effortsMode = draft?.effortsMode ?? 'inherit';
|
|
750
815
|
// 生效中的档位映射:自定义映射用草稿里的值,继承时用目录里的有效值。
|
|
751
816
|
let effortsMap = null;
|
|
@@ -953,6 +1018,30 @@ function ModelSettingsEditor({ model, draft, error, disabled, onChange, onSave,
|
|
|
953
1018
|
'aria-label': label, placeholder: '留空表示继承目录默认', autoComplete: 'off', spellCheck: false,
|
|
954
1019
|
onChange: (event) => onChange({ [key]: event.target.value })
|
|
955
1020
|
}));
|
|
1021
|
+
const capabilityCheckbox = (key, label) => {
|
|
1022
|
+
const mode = draft?.[key] ?? 'inherit';
|
|
1023
|
+
const inherited = model?.defaults?.[key];
|
|
1024
|
+
const unknown = mode === 'inherit' && typeof inherited !== 'boolean';
|
|
1025
|
+
return h('input', {
|
|
1026
|
+
type: 'checkbox', checked: mode === 'inherit' ? inherited === true : mode === 'true', disabled,
|
|
1027
|
+
'aria-label': label, 'aria-checked': unknown ? 'mixed' : undefined,
|
|
1028
|
+
ref: (element) => { if (element) element.indeterminate = unknown; },
|
|
1029
|
+
style: { width: 18, height: 18, margin: 0, flex: '0 0 auto', accentColor: 'var(--dsw-alias-brand-primary, Highlight)' },
|
|
1030
|
+
onChange: (event) => onChange({ [key]: event.target.checked ? 'true' : 'false' })
|
|
1031
|
+
});
|
|
1032
|
+
};
|
|
1033
|
+
const capabilityStatus = (key) => {
|
|
1034
|
+
const mode = draft?.[key] ?? 'inherit';
|
|
1035
|
+
if (mode !== 'inherit') return `已覆盖 · ${mode === 'true' ? '启用' : '禁用'}`;
|
|
1036
|
+
const inherited = model?.defaults?.[key];
|
|
1037
|
+
return `继承 · 目录默认:${typeof inherited === 'boolean' ? (inherited ? '启用' : '禁用') : '未知'}`;
|
|
1038
|
+
};
|
|
1039
|
+
const restoreCapability = (key, label) => (draft?.[key] ?? 'inherit') === 'inherit' ? null : h('button', {
|
|
1040
|
+
type: 'button', style: { ...style.btn, flex: '0 0 auto' }, disabled,
|
|
1041
|
+
'aria-label': label, onClick: () => onChange({ [key]: 'inherit' })
|
|
1042
|
+
}, '恢复继承');
|
|
1043
|
+
const checkboxLabel = (key, label, text) => h('label', { className: 'vcp-plan-toggle' },
|
|
1044
|
+
capabilityCheckbox(key, label), h('span', null, text));
|
|
956
1045
|
return h('div', { className: 'vcp-editor' },
|
|
957
1046
|
h('div', { style: { fontWeight: 650, fontSize: 13 } }, `模型参数:${model?.name || model?.id}`),
|
|
958
1047
|
h('div', { className: 'vcp-fields vcp-fields-three' },
|
|
@@ -960,6 +1049,29 @@ function ModelSettingsEditor({ model, draft, error, disabled, onChange, onSave,
|
|
|
960
1049
|
numberField('maxTokens', MODEL_FIELD_LABELS.maxTokens),
|
|
961
1050
|
numberField('temperature', MODEL_FIELD_LABELS.temperature)),
|
|
962
1051
|
h('p', { style: style.muted }, TEMPERATURE_HINT),
|
|
1052
|
+
h('section', { className: 'vcp-section', 'aria-label': '模型输入与工具调用' },
|
|
1053
|
+
h('div', { className: 'vcp-actions' },
|
|
1054
|
+
h('strong', { style: { fontSize: 13 } }, '输入类型'),
|
|
1055
|
+
h('label', { className: 'vcp-plan-toggle' },
|
|
1056
|
+
h('input', {
|
|
1057
|
+
type: 'checkbox', checked: true, disabled: true, 'aria-label': '文本输入(固定开启)',
|
|
1058
|
+
style: { width: 18, height: 18, margin: 0, flex: '0 0 auto', accentColor: 'var(--dsw-alias-brand-primary, Highlight)' }
|
|
1059
|
+
}),
|
|
1060
|
+
h('span', null, '文本')),
|
|
1061
|
+
checkboxLabel('imageInput', '图片输入', '图片')),
|
|
1062
|
+
h('div', { className: 'vcp-actions' },
|
|
1063
|
+
h('span', { style: style.chip }, capabilityStatus('imageInput')),
|
|
1064
|
+
restoreCapability('imageInput', '恢复图片输入默认')),
|
|
1065
|
+
h('div', { className: 'vcp-actions' },
|
|
1066
|
+
checkboxLabel('toolsEnabled', '工具调用', '工具调用'),
|
|
1067
|
+
h('span', { style: style.chip }, capabilityStatus('toolsEnabled')),
|
|
1068
|
+
restoreCapability('toolsEnabled', '恢复工具调用默认')),
|
|
1069
|
+
draft?.imageInput === 'true'
|
|
1070
|
+
? h('p', { style: style.warn }, '强制启用图片输入仅是本地能力声明,服务端可能仍不支持图片。') : null,
|
|
1071
|
+
draft?.toolsEnabled === 'false'
|
|
1072
|
+
? h('p', { style: style.muted }, '禁用后模型不能发起新工具调用;历史消息中的工具调用回放保留。') : null,
|
|
1073
|
+
h('p', { style: style.muted }, '音频 / 视频:本 DSH 通道不可用,不提供能力覆盖开关。'),
|
|
1074
|
+
h('p', { style: style.muted }, '独立 JSON Schema 结构化输出:本 DSH 通道暂不可用,不提供配置开关。')),
|
|
963
1075
|
h('label', { style: stackedField },
|
|
964
1076
|
h('span', { style: style.label }, '思考档位映射 reasoningEfforts'),
|
|
965
1077
|
h('select', {
|
|
@@ -1017,36 +1129,43 @@ function ModelSettingsEditor({ model, draft, error, disabled, onChange, onSave,
|
|
|
1017
1129
|
* @param {object} props 组件属性
|
|
1018
1130
|
* @returns {object} 元素树
|
|
1019
1131
|
*/
|
|
1020
|
-
function ModelRow({ model, disabled, routingError, editor, draftError, onToggle, onOpenEditor, onCloseEditor, onChangeDraft, onSave, onReset }) {
|
|
1132
|
+
function ModelRow({ plan, model, disabled, routingError, editor, draftError, onToggle, onOpenEditor, onCloseEditor, onChangeDraft, onSave, onReset }) {
|
|
1021
1133
|
const enabled = model?.enabled !== false;
|
|
1022
1134
|
const editing = editor?.modelId === model?.id;
|
|
1023
|
-
const
|
|
1135
|
+
const effectiveSummary = describeEffective(model);
|
|
1136
|
+
const values = model?.effective ?? model?.defaults ?? {};
|
|
1024
1137
|
const capabilityLabel = ({ dynamic: '动态路由', partial: '部分参数未公开', unknown: '参数待确认' })[model?.capabilityStatus]
|
|
1025
1138
|
|| (model?.capabilityUnverified ? '参数待确认' : '');
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
h('span', { className: 'vcp-model-name', title: model?.id }, model?.name || model?.id)
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1139
|
+
const thinkingLabel = model?.canDisableThinking === false ? '常驻思考' : values.reasoningEfforts ? '可调思考' : '思考按默认';
|
|
1140
|
+
return h('article', { className: 'vcp-model', 'data-disabled': enabled ? 'false' : 'true' },
|
|
1141
|
+
h('div', { className: 'vcp-model-head' },
|
|
1142
|
+
h('label', { className: 'vcp-model-toggle' },
|
|
1143
|
+
h('input', {
|
|
1144
|
+
className: 'vcp-switch-input', type: 'checkbox', checked: enabled, disabled,
|
|
1145
|
+
'aria-label': `启用模型 ${model?.id ?? ''}`,
|
|
1146
|
+
onChange: (event) => onToggle(model, Boolean(event.target.checked))
|
|
1147
|
+
}),
|
|
1148
|
+
h('span', { className: 'vcp-model-heading' },
|
|
1149
|
+
h('span', { className: 'vcp-model-name', title: model?.id }, model?.name || model?.id),
|
|
1150
|
+
h(ConsumptionBadge, { plan, consumption: model?.consumption }))),
|
|
1151
|
+
h('span', { className: 'vcp-chip-row' },
|
|
1152
|
+
capabilityLabel ? h('span', { style: style.chip }, capabilityLabel) : null,
|
|
1153
|
+
enabled ? null : h('span', { style: style.chip }, '已停用'))),
|
|
1154
|
+
h('div', { className: 'vcp-model-tags' },
|
|
1155
|
+
h(ModelTag, { tone: values.imageInput ? 'accent' : 'muted' }, values.imageInput ? '视觉' : '纯文本'),
|
|
1156
|
+
h(ModelTag, { tone: values.reasoningEfforts ? 'accent' : 'muted' }, thinkingLabel),
|
|
1157
|
+
h(ModelTag, { title: `上下文长度 ${values.contextWindow ?? '未知'} token` }, `上下文 ${formatTokenCount(values.contextWindow)}`),
|
|
1158
|
+
h(ModelTag, { title: `最大输出 ${values.maxTokens ?? '未知'} token` }, `输出 ${formatTokenCount(values.maxTokens)}`),
|
|
1159
|
+
values.toolsEnabled === false ? h(ModelTag, { tone: 'warn' }, '工具已停用') : null),
|
|
1160
|
+
h('div', { className: 'vcp-model-actions' },
|
|
1161
|
+
h('button', { type: 'button', style: style.btn, disabled, 'aria-label': `模型参数 ${model?.id ?? ''}`, onClick: () => (editing ? onCloseEditor() : onOpenEditor(model)) }, editing ? '收起参数' : '参数'),
|
|
1162
|
+
h('button', { type: 'button', style: style.btn, disabled, 'aria-label': `恢复默认 ${model?.id ?? ''}`, title: '清除全部参数覆盖并恢复模型启用状态', onClick: () => onReset(model) }, enabled ? '恢复默认' : '恢复默认并启用')),
|
|
1044
1163
|
h('details', { className: 'vcp-details' },
|
|
1045
1164
|
h('summary', { style: style.summary }, '模型技术标识与参数详情'),
|
|
1046
1165
|
h('div', { className: 'vcp-model-meta' },
|
|
1047
1166
|
h('p', { className: 'vcp-model-id', style: style.muted }, `调用 ID:${model?.id ?? ''}`),
|
|
1048
1167
|
h('p', { style: style.muted }, `当前参数:${describeModelSettings(model)}`),
|
|
1049
|
-
|
|
1168
|
+
effectiveSummary ? h('p', { style: routingError ? style.warn : style.muted }, `${routingError ? '已保存配置(路由尚未生效)' : '生效值'}:${effectiveSummary}`) : null,
|
|
1050
1169
|
model?.capabilityNote ? h('p', { style: style.muted }, model.capabilityNote) : null)),
|
|
1051
1170
|
model?.settingsWarning ? h('p', { role: 'alert', style: style.warn }, model.settingsWarning) : null,
|
|
1052
1171
|
editing
|
|
@@ -1158,22 +1277,23 @@ function PlanCard({ plan, snapshot, rawQuota, busy, quotaBusy, onSelect, onModel
|
|
|
1158
1277
|
|
|
1159
1278
|
return h('section', { className: 'vcp-plan vcp-card', 'data-section': plan === 'agent-plan' ? '02' : '03', 'aria-label': PLAN_TITLES[plan] },
|
|
1160
1279
|
h(SectionHeading, {
|
|
1280
|
+
eyebrow: plan === 'agent-plan' ? 'AGENT PLAN' : 'CODING PLAN',
|
|
1161
1281
|
title: plan === 'agent-plan' ? 'Agent 套餐' : '编程套餐',
|
|
1162
|
-
action: h(
|
|
1282
|
+
action: h('div', { className: 'vcp-actions' },
|
|
1283
|
+
h(StatusChip, { tone: planTone }, planState),
|
|
1284
|
+
h('label', { className: 'vcp-plan-toggle', title: '停用后保留账号选择与模型参数' },
|
|
1285
|
+
h('input', {
|
|
1286
|
+
className: 'vcp-switch-input', type: 'checkbox', checked: providerEnabled, disabled,
|
|
1287
|
+
'aria-label': `启用${PLAN_TITLES[plan]}`,
|
|
1288
|
+
onChange: (event) => onToggleProvider(plan, Boolean(event.target.checked))
|
|
1289
|
+
}),
|
|
1290
|
+
h('span', null, '启用')))
|
|
1163
1291
|
}),
|
|
1164
1292
|
snapshot?.routingError ? h('p', { style: style.muted }, `所选账号:${account ? accountName(account) : '未选择'}`) : null,
|
|
1165
1293
|
snapshot?.routingError ? h(Notice, { tone: 'warn', role: 'alert' }, appliedAccount === undefined
|
|
1166
1294
|
? '实际生效账号暂不可确认,请排除路由错误后重试。'
|
|
1167
1295
|
: appliedAccount ? `实际生效账号:${accountName(appliedAccount)}(${appliedAccount.id}),路由更新尚未完成。` : '该套餐当前没有已生效的模型路由。') : null,
|
|
1168
1296
|
h('div', { className: 'vcp-plan-setup' },
|
|
1169
|
-
h('label', { className: 'vcp-plan-toggle' },
|
|
1170
|
-
h('input', {
|
|
1171
|
-
type: 'checkbox', checked: providerEnabled, disabled,
|
|
1172
|
-
'aria-label': `启用${PLAN_TITLES[plan]}`,
|
|
1173
|
-
style: { width: 18, height: 18, margin: 0, accentColor: 'var(--dsw-alias-brand-primary, Highlight)' },
|
|
1174
|
-
onChange: (event) => onToggleProvider(plan, Boolean(event.target.checked))
|
|
1175
|
-
}),
|
|
1176
|
-
h('span', null, '启用套餐')),
|
|
1177
1297
|
h('label', { className: 'vcp-plan-account', style: style.field },
|
|
1178
1298
|
h('span', { style: style.label }, '使用账号'),
|
|
1179
1299
|
h('select', {
|
|
@@ -1228,7 +1348,7 @@ function PlanCard({ plan, snapshot, rawQuota, busy, quotaBusy, onSelect, onModel
|
|
|
1228
1348
|
h('div', { className: 'vcp-model-list' },
|
|
1229
1349
|
models.map((model, index) => h(ModelRow, {
|
|
1230
1350
|
key: model?.id ?? `model-${index}`,
|
|
1231
|
-
model, disabled, routingError: snapshot?.routingError, editor, draftError,
|
|
1351
|
+
plan, model, disabled, routingError: snapshot?.routingError, editor, draftError,
|
|
1232
1352
|
onToggle: (item, enabled) => onToggleModel(plan, activeId, item.id, enabled),
|
|
1233
1353
|
onOpenEditor: openEditor,
|
|
1234
1354
|
onCloseEditor: closeEditor,
|
|
@@ -1786,9 +1906,11 @@ function VolcengineProviderSection({ client }) {
|
|
|
1786
1906
|
: snapshot ? `${snapshot.accounts?.length ?? 0} 个账号 · 2 个套餐` : '等待连接';
|
|
1787
1907
|
|
|
1788
1908
|
return h('div', { className: 'vcp-settings', style: style.root },
|
|
1789
|
-
h('header', { className: 'vcp-header' },
|
|
1909
|
+
h('header', { className: 'vcp-header vcp-hero' },
|
|
1910
|
+
h('div', { className: 'vcp-brand-mark', 'aria-hidden': 'true' }, '火'),
|
|
1790
1911
|
h('div', { className: 'vcp-header-copy' },
|
|
1791
|
-
h('h2', { style: style.title }, '火山方舟 Provider')
|
|
1912
|
+
h('h2', { style: style.title }, '火山方舟 Provider'),
|
|
1913
|
+
h('p', { className: 'vcp-hero-subtitle' }, '国内个人版 Agent Plan 与 Coding Plan,集中管理账号、模型与套餐额度。')),
|
|
1792
1914
|
h('div', { className: 'vcp-actions' },
|
|
1793
1915
|
h('span', { role: 'status', style: style.chip }, headerStatus),
|
|
1794
1916
|
h('button', { type: 'button', style: style.btn, disabled: busyAccount || loading, onClick: () => { void refresh(); } }, loading ? '正在刷新状态…' : '刷新状态'))),
|
|
@@ -1806,7 +1928,7 @@ function VolcengineProviderSection({ client }) {
|
|
|
1806
1928
|
!snapshot
|
|
1807
1929
|
? (loading ? h('p', { role: 'status', style: style.muted }, '正在读取方舟账号状态…') : null)
|
|
1808
1930
|
: h('div', { className: 'vcp-content', 'data-empty': !(snapshot.accounts?.length) },
|
|
1809
|
-
h('div', { className: 'vcp-plans vcp-plan-workspace
|
|
1931
|
+
h('div', { className: 'vcp-plans vcp-plan-workspace' },
|
|
1810
1932
|
h(PlanCard, {
|
|
1811
1933
|
plan: 'agent-plan', snapshot, rawQuota: quotas['agent-plan'], busy: planBusy, quotaBusy: Boolean(quotaBusy['agent-plan']),
|
|
1812
1934
|
onSelect: selectAccount, onModels: pullModels, onQuota: pullQuota,
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"verifiedAt": "2026-10-30",
|
|
4
|
+
"models": {
|
|
5
|
+
"doubao-seed-evolving": {
|
|
6
|
+
"ids": ["doubao-seed-evolving"],
|
|
7
|
+
"multiplier": 2.5
|
|
8
|
+
},
|
|
9
|
+
"doubao-seed-2.1-pro": {
|
|
10
|
+
"ids": ["doubao-seed-2-1-pro-260915", "doubao-seed-2-1-pro"],
|
|
11
|
+
"multiplier": 2.5
|
|
12
|
+
},
|
|
13
|
+
"doubao-seed-2.1-lite": {
|
|
14
|
+
"ids": ["doubao-seed-2-1-lite-260915", "doubao-seed-2-1-lite"],
|
|
15
|
+
"multiplier": 0.5
|
|
16
|
+
},
|
|
17
|
+
"doubao-seed-2.0-mini": {
|
|
18
|
+
"ids": ["doubao-seed-2-0-mini-260428", "doubao-seed-2-0-mini"],
|
|
19
|
+
"multiplier": 0.25
|
|
20
|
+
},
|
|
21
|
+
"kimi-k3.1-pro": {
|
|
22
|
+
"ids": ["kimi-k3-1-pro-261024", "kimi-k3.1-pro"],
|
|
23
|
+
"multiplier": 7,
|
|
24
|
+
"discount": {
|
|
25
|
+
"multiplier": 3.5,
|
|
26
|
+
"startsAt": "2026-10-24T00:00:00+08:00",
|
|
27
|
+
"endsAt": "2026-11-09T23:59:59+08:00"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"deepseek-v4.1-flash": {
|
|
31
|
+
"ids": ["deepseek-v4-1-flash-261017", "deepseek-v4-1-flash"],
|
|
32
|
+
"multiplier": 2.5,
|
|
33
|
+
"discount": {
|
|
34
|
+
"multiplier": 1.25,
|
|
35
|
+
"startsAt": "2026-09-15T00:00:00+08:00",
|
|
36
|
+
"endsAt": "2026-12-30T23:59:59+08:00"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"deepseek-v4.1-flash-economy": {
|
|
40
|
+
"ids": ["deepseek-v4-1-flash-economy-261017", "deepseek-v4-1-flash-economy"],
|
|
41
|
+
"multiplier": 2,
|
|
42
|
+
"discount": {
|
|
43
|
+
"multiplier": 1,
|
|
44
|
+
"startsAt": "2026-10-20T00:00:00+08:00",
|
|
45
|
+
"endsAt": "2026-12-30T23:59:59+08:00"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"kimi-k2.8-preview": {
|
|
49
|
+
"ids": ["kimi-k2-8-preview"],
|
|
50
|
+
"multiplier": 8,
|
|
51
|
+
"discount": {
|
|
52
|
+
"multiplier": 4.8,
|
|
53
|
+
"startsAt": "2026-09-17T00:00:00+08:00",
|
|
54
|
+
"endsAt": "2026-12-14T23:59:59+08:00"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"glm-5.3-flash": {
|
|
58
|
+
"ids": ["glm-5-3-flash-260828", "glm-5-3-flash"],
|
|
59
|
+
"multiplier": 0.5
|
|
60
|
+
},
|
|
61
|
+
"glm-5.3": {
|
|
62
|
+
"ids": ["glm-5.3"],
|
|
63
|
+
"multiplier": 4.5
|
|
64
|
+
},
|
|
65
|
+
"deepseek-v4-pro": {
|
|
66
|
+
"ids": ["deepseek-v4-pro-ga-260813", "deepseek-v4-pro"],
|
|
67
|
+
"multiplier": 5.5
|
|
68
|
+
},
|
|
69
|
+
"deepseek-v4-flash": {
|
|
70
|
+
"ids": ["deepseek-v4-flash-ga-260731", "deepseek-v4-flash"],
|
|
71
|
+
"multiplier": 0.5
|
|
72
|
+
},
|
|
73
|
+
"kimi-k3": {
|
|
74
|
+
"ids": ["kimi-k3"],
|
|
75
|
+
"multiplier": 10
|
|
76
|
+
},
|
|
77
|
+
"kimi-k2.7-code": {
|
|
78
|
+
"ids": ["kimi-k2.7-code"],
|
|
79
|
+
"multiplier": 4.5
|
|
80
|
+
},
|
|
81
|
+
"minimax-m3": {
|
|
82
|
+
"ids": ["minimax-m3"],
|
|
83
|
+
"multiplier": 2.5
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
package/lib/messages-payload.mjs
CHANGED
|
@@ -10,6 +10,18 @@ function withoutEffort(payload) {
|
|
|
10
10
|
return result;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* 逐模型关闭工具调用时,服务端只接受 tools 非空搭配 tool_choice:none。
|
|
15
|
+
* 没有工具声明时不发送 tool_choice,工具声明与历史保持原样。
|
|
16
|
+
*/
|
|
17
|
+
function withToolChoice(payload, toolsEnabled) {
|
|
18
|
+
if (toolsEnabled !== false) return payload;
|
|
19
|
+
const result = { ...payload };
|
|
20
|
+
if (Array.isArray(result.tools) && result.tools.length) result.tool_choice = { type: 'none' };
|
|
21
|
+
else delete result.tool_choice;
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
|
|
13
25
|
/** Normalize only request-level controls; replay blocks and signatures stay SDK-owned. */
|
|
14
26
|
export function messagesPayload(payload, control = {}) {
|
|
15
27
|
const mode = control.messagesThinkingMode ?? 'server-default';
|
|
@@ -18,7 +30,7 @@ export function messagesPayload(payload, control = {}) {
|
|
|
18
30
|
if (effort === undefined || effort === null) {
|
|
19
31
|
const result = withoutEffort(payload);
|
|
20
32
|
delete result.thinking;
|
|
21
|
-
return result;
|
|
33
|
+
return withToolChoice(result, control.toolsEnabled);
|
|
22
34
|
}
|
|
23
35
|
const mappedOff = effort === 'off' && typeof control.offWire === 'string';
|
|
24
36
|
if (effort === 'off' && !mappedOff) {
|
|
@@ -27,7 +39,7 @@ export function messagesPayload(payload, control = {}) {
|
|
|
27
39
|
error.code = 'UNSUPPORTED_REASONING_EFFORT';
|
|
28
40
|
throw error;
|
|
29
41
|
}
|
|
30
|
-
return { ...withoutEffort(payload), thinking: { type: 'disabled' } };
|
|
42
|
+
return withToolChoice({ ...withoutEffort(payload), thinking: { type: 'disabled' } }, control.toolsEnabled);
|
|
31
43
|
}
|
|
32
44
|
const result = { ...payload };
|
|
33
45
|
if (mappedOff) result.output_config = { ...payload.output_config, effort: control.offWire };
|
|
@@ -41,7 +53,7 @@ export function messagesPayload(payload, control = {}) {
|
|
|
41
53
|
// A fixed-budget override intentionally keeps the SDK's enabled + budget shape.
|
|
42
54
|
if (Object.keys(thinking).length) result.thinking = thinking;
|
|
43
55
|
else delete result.thinking;
|
|
44
|
-
return result;
|
|
56
|
+
return withToolChoice(result, control.toolsEnabled);
|
|
45
57
|
}
|
|
46
58
|
|
|
47
59
|
/** Compose the SDK callback, without replacing fetch globally or serializing history. */
|
package/lib/state.mjs
CHANGED
|
@@ -9,7 +9,9 @@ export const LABELS = { 'agent-plan': '火山方舟 · Agent 套餐', 'coding-pl
|
|
|
9
9
|
// Core(pi-ai)已声明的思考档位,模型设置只接受这些键。
|
|
10
10
|
export const CORE_THINKING_LEVELS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
11
11
|
// 逐模型覆盖允许出现的字段;其余字段一律拒绝(含任何凭据字段)。
|
|
12
|
-
export const MODEL_SETTING_FIELDS = ['enabled', 'contextWindow', 'maxTokens', 'temperature', 'reasoningEfforts', 'defaultReasoning', 'forceAdaptiveThinking'];
|
|
12
|
+
export const MODEL_SETTING_FIELDS = ['enabled', 'contextWindow', 'maxTokens', 'temperature', 'reasoningEfforts', 'defaultReasoning', 'forceAdaptiveThinking', 'imageInput', 'toolsEnabled'];
|
|
13
|
+
// 图片输入与工具开关只接受布尔值;不给出时保持缺省,由目录默认值继承。
|
|
14
|
+
export const MODEL_SETTING_BOOLEAN_FIELDS = ['imageInput', 'toolsEnabled'];
|
|
13
15
|
// 预算模式(未开启自适应思考)下 Core 只消费档位键:xhigh/max 会被折叠为 high,映射值也不再上线。
|
|
14
16
|
export const BUDGET_THINKING_LEVELS = ['off', 'minimal', 'low', 'medium', 'high'];
|
|
15
17
|
const idPattern = /^[a-z][a-z0-9-]{0,63}$/;
|
|
@@ -113,6 +115,12 @@ export function normalizeModelSettings(input) {
|
|
|
113
115
|
if (typeof input.forceAdaptiveThinking !== 'boolean') throw new Error('forceAdaptiveThinking 必须是布尔值');
|
|
114
116
|
settings.forceAdaptiveThinking = input.forceAdaptiveThinking;
|
|
115
117
|
}
|
|
118
|
+
// 图片输入与工具开关:只接受布尔值;缺省不落盘,由目录默认值继承。
|
|
119
|
+
for (const key of MODEL_SETTING_BOOLEAN_FIELDS) {
|
|
120
|
+
if (!(key in input)) continue;
|
|
121
|
+
if (typeof input[key] !== 'boolean') throw new Error(`${key} 必须是布尔值`);
|
|
122
|
+
settings[key] = input[key];
|
|
123
|
+
}
|
|
116
124
|
if ('reasoningEfforts' in input) settings.reasoningEfforts = normalizeReasoningEfforts(input.reasoningEfforts);
|
|
117
125
|
if ('defaultReasoning' in input) {
|
|
118
126
|
const value = input.defaultReasoning;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-volcengine-provider",
|
|
3
3
|
"displayName": "火山方舟 Provider",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.9",
|
|
5
5
|
"description": "火山方舟 Agent Plan 与 Coding Plan:OAuth 登录、账号、模型与额度管理。",
|
|
6
6
|
"repository": {"type": "git", "url": "git+https://github.com/KouzakiUmi/dsh-volcengine-provider.git"},
|
|
7
7
|
"homepage": "https://github.com/KouzakiUmi/dsh-volcengine-provider#readme",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@deepseek-ai/cordis": "^4.0.5",
|
|
21
21
|
"@deepseek-ai/schemastery": "^3.18.4",
|
|
22
|
-
"@deepseek-ai/dsh-llm": "0.2.1-rc.
|
|
23
|
-
"@deepseek-ai/dsh-llm-pi-ai": "0.2.1-rc.
|
|
22
|
+
"@deepseek-ai/dsh-llm": "0.2.1-rc.5",
|
|
23
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.2.1-rc.5",
|
|
24
24
|
"@earendil-works/pi-ai": "1.1.0",
|
|
25
|
-
"@deepseek-ai/dsh-credentials": "0.2.1-rc.
|
|
26
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.1-rc.
|
|
27
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.
|
|
25
|
+
"@deepseek-ai/dsh-credentials": "0.2.1-rc.5",
|
|
26
|
+
"@deepseek-ai/dsh-launch-environment": "0.2.1-rc.5",
|
|
27
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.5"
|
|
28
28
|
},
|
|
29
29
|
"dsh": {
|
|
30
30
|
"bundle": {"patch": "./cordis.patch.yml"},
|