@mars-sea/dsh-commandcode-provider 0.12.9 → 0.13.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 +41 -0
- package/README.md +11 -9
- package/README.zh-CN.md +6 -5
- package/lib/client.js +1201 -87
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +81 -8
- package/lib/index.js +733 -124
- package/lib/index.js.map +1 -1
- package/package.json +38 -38
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,47 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.13.0] - 2026-10-14
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- 问题 #79:设置页可打开模型分析,按最近会话或本地日期查看历史词元、按当前价重算的成本、响应/首词元耗时、输出速度、失败/重试/取消及样本覆盖;读取持久化历史并去除分支继承用量。提供固定工作量的模型价格试算与客观能力,不自动推荐或打质量分。 页面以核心指标总览、历史用量/价格试算两个页签及可展开明细呈现,支持明暗主题与窄屏,避免同屏宽表和无标签数字串。缺失用量和计时保持未知,读取上限和部分结果明确展示,完整时间范围才折算 30 天成本;统计口径见 [实现说明](docs/模型成本与性能分析.md)。
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- 引擎兼容收敛为 `0.2.0-rc.2 || 0.2.1-alpha.2`:只维护官方最新已验证的 RC(候选发布版)与 alpha(早期测试版),每条通道一版;移除 `0.2.1-alpha.1`。兼容声明、锁文件、两版本验证矩阵与升级说明同步,配套 Cordis、Schemastery 范围不变。旧 alpha 配置需先升级引擎。
|
|
16
|
+
- 同步 Command Code CLI `1.81.0` → `1.82.1`:请求版本标识(`x-command-code-version`)随之上调。上游 `1.82.0` 的公开变更是新增 Gemini Argon、模型拒绝(refusal)后不再自动重发同一提示,以及 `!` bash 模式(bash mode)的命令与输出能到达 agent;`1.82.1` **没有官方日志条目**,结论来自产物级静态比对——逐字符比对两版 `dist/cli.mjs`,扣除死代码后只有版本字符串与语言引导界面(`LanguageOnboarding`/`needsLanguageOnboarding`/`isLocale` 及「Choose a language / 选择语言」整块)被删除两处差异。两处都在 CLI 交互层,**不改变 Provider API 的 wire 协议**,因此适配器运行时代码零改动。
|
|
17
|
+
- 新增模型 `google/gemini-4-argon`(Gemini 4 Argon,Google):1M 上下文,支持图像输入,三档推理强度(`low`/`medium`/`high`),最低套餐 **Pro**(Go/Go v1/GOAT 均为 false),定价 $2/$10/$0.1(输入/输出/缓存读,每百万词元)。它**不在** ZDR 排除集内,也不属于峰谷计价或 thinking-only 模型。能力快照(推理档位、图像能力、套餐分层)与价格表同步收录;`KNOWN_PLANS` 累计分层由 54/64/78/86/88 变为 54/64/79/87/89。
|
|
18
|
+
- 重新生成模型价格表:补入 `google/gemini-4-argon` 一行(额度 Go $6/GOAT $20/Pro $20),并修正 `deepseek-v4.1-flash` 的每月额度 `$10/$60/$70` → `$10/$100/$100`(官网已上调,与单价无关)。同时重新生成输出上限表,补入 `google/gemini-4-argon`(32768,取自 models.dev 的 google 官方行),写入数由 76 变为 77。
|
|
19
|
+
- 同步 Command Code CLI `1.79.2` → `1.81.0`:请求版本标识(`x-command-code-version`)随之上调。上游 `1.80.0` 的公开变更是 Mods Hub/ModApi、新增 Muse Wonder 与两处修复;`1.81.0` 新增脚本优先工具调用(codemode,含 QuickJS 沙箱),属 CLI 自身工具层,**不改变 Provider API 的 wire 协议**。逐字段比对两版产物(模型注册表、effort 映射、ZDR 例外集、订阅表、端点、请求头、环境变量、流式事件类型)确认数据面零差异,因此本轮不改动适配器运行时代码。
|
|
20
|
+
- 新增模型 `meta/muse-wonder-1.0`(Muse Wonder,Meta):1M 上下文,支持图像与文件输入,四档推理强度(`low`/`medium`/`high`/`xhigh`),最低套餐 **Max**,定价 $4/$20/$0.2(输入/输出/缓存读,每百万词元)。该模型被上游 CLI 列入零数据保留(ZDR)排除集,因此开启 ZDR 时对其请求会以 422 `cmd_zdr_no_providers` 被拒。能力快照(推理档位、图像能力、套餐分层、ZDR 例外)与价格表同步收录。
|
|
21
|
+
- 重新生成模型输出上限表:补入 `claude-haiku-5-5`(128000)与 `meta/muse-wonder-1.0`(131072)。生成器同时删除了三行,其中 `inclusionai/ling-3.0-flash-sante:free`(32768)仍在官方目录、仍为 Go 档免费模型,因此改用 `MANUAL_CEILINGS` 固定,避免重新生成时把活跃模型的上限退回默认 131072;两个已退役的 stealth 预览(Pixel Canary、Space Bunny Alpha)保持删除——它们已不在 `KNOWN_PLANS`,任何表都不再命名。
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- 问题 #76:账号接口收到 HTTP 200 后的正文读取超时或中断不再被混同为 JSON 格式异常。错误详情分别显示读取、解析与顶层结构问题,并仅保留经过筛选的异常标识和内容类型/编码;不回显响应正文或原异常消息。设置页、用量面板和命令提示同步调整,报告协议与账号轮换行为不变。此修复解决已复现的诊断缺陷,反馈者实际链路的根因仍待验证。
|
|
26
|
+
|
|
27
|
+
## [0.12.10] - 2026-10-10
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- **引擎兼容范围增加 `0.2.1-alpha.2`,业务代码零改动。** 15 个 `@deepseek-ai/dsh-*` peer 的析取由 `0.2.0-rc.2 || 0.2.1-alpha.1` 扩为 `0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2`,`dsh.compatibility.dsh`、`engines.dsh`、`devDependencies`、`package-lock.json` 与 `dsh.compatibility.dshReleases` 同批同步;既有两个分支保留,`@deepseek-ai/cordis`(`~4.0.4 || ~4.0.5-alpha.1`)与 `@deepseek-ai/schemastery`(`~3.18.4 || ~3.18.5-alpha.1`)不用改——alpha.2 与 alpha.1 同批发布的正是这两个版本。逐文件对比 alpha.1 → alpha.2 的公开源码后确认无需改代码:`RequestMessage`/`GenerateOptions`/`ContentBlock`/`LlmError` 结构未变,Agent 事件、设置、凭据、附件与 Typert 严格描述符未变,五个客户端插槽的声明与 Web 预置模块表也未变。
|
|
32
|
+
- alpha.2 有三处宿主内部行为变化,插件按现有接口继续工作,边界已记入参考文档:模型调用准备新增可选回调 `prepareCall(config, signal?, configure?)`(普通适配器不必调用)、请求准备完成后会刷新运行时上下文、代理卸载改为先停流再排空事件。上游 `idleWatchdog` 那处「挂起读取也能按期结束」的修复**不覆盖**插件自己的读流实现,因此本轮按同一目标单独补齐(见下方 Fixed)。
|
|
33
|
+
- `npm run test:install` 改为**逐引擎矩阵**:每个已声明兼容版本各建一个全新的 pnpm 10.34.5 generation,安装时把该版本的必需 Harness peer 一起钉死,再断言锁文件解析出的 `@deepseek-ai/dsh-llm` 恰好是目标版本。此前单次安装只会命中范围里最新的那个分支,全绿并不能证明另外两个引擎装得上。
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- **读取卡住的响应不再拖住收束。** 读循环每次读取改用一个「唤醒闸门」:空闲期限到期与调用者取消都先解开闸门,再尽力取消底层读取。此前只有 `reader.cancel()` 能把挂起的 `read()` 唤醒,遇到被包装或被垫片替换、既不结算读取也不响应取消的响应体时,空闲期限、调用者取消和消费方 `return()` 三条路径会一起卡死——期限到了不报错,取消也不返回。现在闸门自己结束等待:调用者取消原样传播(归类 `aborted`),否则以既有 `TIMEOUT` 失败;被放弃的读取结果丢弃,其迟到拒绝就地吞掉(真实读取器在释放锁时会以 `Invalid state: Releasing reader` 拒绝挂起的读取),读取锁仍只释放一次。`tests/adapter.test.ts` 新增三个用例固定这三种收束。
|
|
38
|
+
|
|
39
|
+
### 已知边界
|
|
40
|
+
|
|
41
|
+
- 真实引擎检查通过的是发布入口加载、静态具名导入、客户端 `require()` 种子、易变设置契约与 22 个流终态场景;浏览器实际渲染、真实账号请求、卸载期间最终事件排空与长期运行仍需实际环境验收。
|
|
42
|
+
|
|
43
|
+
### 刻意未采纳
|
|
44
|
+
|
|
45
|
+
- `systemPromptUpdate: 'in-history'`(历史内系统提示替换)与原生工具延迟激活语义:插件继续用前导系统提示与 `addition-only`(仅新增)工具声明,每次请求发送完整活跃工具列表。能力标记与实际 wire 行为必须一致,未实现前不宣告。
|
|
46
|
+
- 新版 `prepareCall` 的可选准备回调:它是给需要注入辅助调用元数据的场景用的,本适配器不使用第三参数即可保持既有行为。
|
|
47
|
+
|
|
7
48
|
## [0.12.9] - 2026-10-09
|
|
8
49
|
|
|
9
50
|
### Changed
|
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harnes
|
|
|
18
18
|
|
|
19
19
|
- **Plugin bundle** — install into any dsh profile with `dsh plugin add`; registers a `commandcode` provider route with a live model catalog.
|
|
20
20
|
- **Dedicated settings page** — one account list (keys, sign-in, live quota, dedicated models), model visibility, privacy switches, and connection options.
|
|
21
|
+
- **Model analysis** — open from Settings to inspect tokens, estimated cost, response timing and failures/retries by recent sessions or date range, including closed sessions with inherited fork usage excluded. Compare fixed-workload prices and objective capabilities without automatic recommendations or quality scores. Missing data and scan limits remain visible; complete date ranges can be extrapolated to 30 days. Estimates use current prices and are not invoices. See [scope and limitations](docs/模型成本与性能分析.md).
|
|
21
22
|
- **Works in the terminal too** — the same install serves a [dsh-TUI](#terminal-ui-dsh-tui) profile, with its own **`/settings` → Command Code** page for the API key and the model controls.
|
|
22
23
|
- **Models-page key card** — the **Settings → Models → Command Code** card carries the key status, a paste field, and the sign-in button inline.
|
|
23
24
|
- **In-browser sign-in for keys** — start the official authorization flow (the same one `cmd login` runs) from the settings page; the approved key lands in the local credential service automatically. Manual paste remains the fallback.
|
|
@@ -35,11 +36,12 @@ See [Screenshots](#screenshots) below for what the UI looks like.
|
|
|
35
36
|
|
|
36
37
|
## Install
|
|
37
38
|
|
|
38
|
-
This release supports **dsh 0.2.0-rc.2 and dsh 0.2.1-alpha.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
This release supports **dsh 0.2.0-rc.2 (RC) and dsh 0.2.1-alpha.2 (alpha)**.
|
|
40
|
+
The compatibility policy keeps the latest verified official release candidate
|
|
41
|
+
and alpha release, one per channel. These match npm's `latest` and `alpha` tags
|
|
42
|
+
as checked on 2026-10-11. The peer range and compatibility records name only
|
|
43
|
+
these two exact versions. A profile on `0.2.1-alpha.1` must upgrade its engine
|
|
44
|
+
before installing this build:
|
|
43
45
|
|
|
44
46
|
```sh
|
|
45
47
|
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@latest
|
|
@@ -66,14 +68,14 @@ dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.15
|
|
|
66
68
|
|
|
67
69
|
The same applies to every profile you install into, including the terminal UI below.
|
|
68
70
|
|
|
69
|
-
Fresh pnpm 10 marketplace generations are supported directly. Every Harness package
|
|
71
|
+
Fresh pnpm 10 marketplace generations are supported directly. Every Harness package is declared by the plugin as a Host peer, so the active dsh profile remains their owner; do not add a separate dependency for any of them. The `@deepseek-ai/dsh-*` packages share one exact-version disjunction; `@deepseek-ai/cordis` and `@deepseek-ai/schemastery` carry the paired ranges `~4.0.4 || ~4.0.5-alpha.1` and `~3.18.4 || ~3.18.5-alpha.1` instead, because publishing an engine rewrites both to the version that shipped alongside it. Upstream removed the `@deepseek-ai/dsh-invariants` package in `0.2.1-alpha.1`, so the plugin no longer declares it.
|
|
70
72
|
|
|
71
73
|
## Updating
|
|
72
74
|
|
|
73
75
|
Update with the same tag you installed with:
|
|
74
76
|
|
|
75
77
|
```sh
|
|
76
|
-
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest # dsh 0.2.0-rc.2 or 0.2.1-alpha.
|
|
78
|
+
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest # dsh 0.2.0-rc.2 or 0.2.1-alpha.2
|
|
77
79
|
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 # older dsh (0.5.0 line, unmaintained)
|
|
78
80
|
```
|
|
79
81
|
|
|
@@ -147,7 +149,7 @@ cmd login # writes ~/.commandcode/auth.json
|
|
|
147
149
|
cwd: !!js process.cwd()
|
|
148
150
|
```
|
|
149
151
|
|
|
150
|
-
**Engine version.** The plugin is maintained against
|
|
152
|
+
**Engine version.** The plugin is maintained against two engines: **dsh 0.2.0-rc.2** and **dsh 0.2.1-alpha.2**. Its `@deepseek-ai/dsh-*` peers use `0.2.0-rc.2 || 0.2.1-alpha.2`, while `@deepseek-ai/cordis` and `@deepseek-ai/schemastery` retain their engine-paired ranges `~4.0.4 || ~4.0.5-alpha.1` and `~3.18.4 || ~3.18.5-alpha.1`. Compatibility records contain exactly these two engines. Each channel upgrade replaces its previous version after verification; it does not accumulate supported releases or admit unverified neighbours. Both `npm run test:engine` and `npm run test:install` check each retained version. See [Install](#install) for older engines.
|
|
151
153
|
|
|
152
154
|
## Usage dashboard
|
|
153
155
|
|
|
@@ -234,7 +236,7 @@ Command Code can serve a request only through upstreams that retain no prompts o
|
|
|
234
236
|
|
|
235
237
|
**Off by default.** Turn it on with the *"Zero data retention (ZDR)"* toggle (`zdr`) in the Privacy & security card, or in your profile config. How this plugin implements it:
|
|
236
238
|
|
|
237
|
-
- The header is sent on **every chat request** while ZDR is on. The plugin maintains an informational exception list (`KNOWN_NON_ZDR_MODELS`, synced from the official CLI —
|
|
239
|
+
- The header is sent on **every chat request** while ZDR is on. The plugin maintains an informational exception list (`KNOWN_NON_ZDR_MODELS`, synced from the official CLI — 22 models as of 2026-10-14, e.g. `xai/grok-4.5`, `stealth/glyph-cluster:free`, `stepfun/Step-3.7-Flash`, `meta/muse-wonder-1.0`). A model without an available ZDR upstream fails with `422 cmd_zdr_no_providers`; the request is never retried without the header.
|
|
238
240
|
- If a refusal still happens (coverage churn, or no ZDR upstream with spare capacity at that moment), the error names the cause and how to turn ZDR off, instead of surfacing as a bare HTTP 422.
|
|
239
241
|
- **ZDR usually costs more**: capacity is limited and billed at each upstream's pass-through rates, and which upstream serves a request can change per request. The session-cost readout keeps quoting the ordinary catalog rates; the real per-request price shows in Command Code's Studio usage page.
|
|
240
242
|
- Works on every plan; plan credits meter ZDR requests at the plan's default allowance.
|
package/README.zh-CN.md
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
- **插件包**:一条 `dsh plugin add` 命令安装到任意 dsh 配置,注册 `commandcode` provider 路由,带实时模型目录。
|
|
20
20
|
- **专属设置页**:统一的账户列表(密钥、网页登录、实时额度、专用模型)、模型显示、隐私开关与连接参数。
|
|
21
|
+
- **模型分析**:从设置页打开,按最近会话或日期查看历史词元、估算成本、响应速度与失败/重试,比较固定工作量在其他可见模型上的价格和客观能力。包含已关闭会话、去除分支继承用量,显示缺失数据和读取覆盖;完整时间范围可折算 30 天成本。不自动推荐、不评价任务质量。金额按当前价重算,不是账单;[统计口径与限制](docs/模型成本与性能分析.md)。
|
|
21
22
|
- **终端界面同样可用**:同一次安装即可服务 [dsh-TUI](#终端界面dsh-tui) 配置,终端里有自己的 **`/settings` → Command Code** 页面来填 key 和调模型。
|
|
22
23
|
- **Models 页快捷卡片**:**设置 → Models → Command Code** 卡片内直接显示 key 状态、粘贴输入框和登录按钮。
|
|
23
24
|
- **浏览器内登录获取 key**:设置页一键发起官方授权(与 `cmd login` 同一流程),完成后密钥自动写入本机凭据服务,无需手动创建或粘贴;不可用时随时退回手动粘贴。
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
|
|
34
35
|
## 安装
|
|
35
36
|
|
|
36
|
-
本版本**只支持 dsh 0.2.0-rc.2
|
|
37
|
+
本版本**只支持 dsh 0.2.0-rc.2(RC,候选发布版)与 dsh 0.2.1-alpha.2(alpha,早期测试版)**。维护策略为每条通道只保留官方最新且经过验证的一个版本;2026-10-11 核对时分别对应 npm 的 `latest` 与 `alpha` 发布标签。对等依赖范围和兼容记录只列这两个精确版本。使用 `0.2.1-alpha.1` 的配置需先升级引擎,再安装本构建:
|
|
37
38
|
|
|
38
39
|
```sh
|
|
39
40
|
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@latest
|
|
@@ -55,14 +56,14 @@ dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.15
|
|
|
55
56
|
|
|
56
57
|
这一点对每个 profile 都成立,包括下面的终端界面。
|
|
57
58
|
|
|
58
|
-
插件可直接在 pnpm 10 的全新插件市场 generation 中安装。所有 Harness
|
|
59
|
+
插件可直接在 pnpm 10 的全新插件市场 generation 中安装。所有 Harness 包都由插件声明为 Host peer,由当前 dsh profile 统一管理,不要另行添加 dependency。其中 `@deepseek-ai/dsh-*` 共用同一个精确版本析取;`@deepseek-ai/cordis` 与 `@deepseek-ai/schemastery` 则分别写成配对范围 `~4.0.4 || ~4.0.5-alpha.1` 与 `~3.18.4 || ~3.18.5-alpha.1`——上游每次发引擎都会把这两个包重写成随引擎发布的版本。上游曾在 `0.2.1-alpha.1` 删除 `@deepseek-ai/dsh-invariants` 这个包,因此插件不再声明它。
|
|
59
60
|
|
|
60
61
|
## 更新
|
|
61
62
|
|
|
62
63
|
用与安装时相同的 tag 更新:
|
|
63
64
|
|
|
64
65
|
```sh
|
|
65
|
-
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest # dsh 0.2.0-rc.2 或 0.2.1-alpha.
|
|
66
|
+
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest # dsh 0.2.0-rc.2 或 0.2.1-alpha.2
|
|
66
67
|
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 # 更早的 dsh(0.5.0 线,不再维护)
|
|
67
68
|
```
|
|
68
69
|
|
|
@@ -136,7 +137,7 @@ cmd login # 写入 ~/.commandcode/auth.json
|
|
|
136
137
|
cwd: !!js process.cwd()
|
|
137
138
|
```
|
|
138
139
|
|
|
139
|
-
**引擎版本要求。**
|
|
140
|
+
**引擎版本要求。** 插件维护两个引擎:**dsh 0.2.0-rc.2** 与 **dsh 0.2.1-alpha.2**。`@deepseek-ai/dsh-*` 对等依赖为 `0.2.0-rc.2 || 0.2.1-alpha.2`;`@deepseek-ai/cordis` 与 `@deepseek-ai/schemastery` 仍使用随引擎配对的范围 `~4.0.4 || ~4.0.5-alpha.1` 与 `~3.18.4 || ~3.18.5-alpha.1`。兼容记录恰好包含两个版本,同通道升级验证后替换旧版,不累加已支持版本、不放行未验证的邻近版本。`npm run test:engine` 与 `npm run test:install` 均逐版本验证。旧引擎安装说明见[安装](#安装)。
|
|
140
141
|
|
|
141
142
|
## 用量面板
|
|
142
143
|
|
|
@@ -223,7 +224,7 @@ Command Code 可以让请求只经由「不留存提示词与回复、也不用
|
|
|
223
224
|
|
|
224
225
|
**默认关闭。** 在「隐私与安全」卡片里打开「零数据保留(ZDR)」(`zdr`),或写进 profile 配置。本插件的实现方式:
|
|
225
226
|
|
|
226
|
-
- 开启后,**每次聊天请求**都会带上 ZDR 请求头。插件仍维护官方 CLI 的例外名单(`KNOWN_NON_ZDR_MODELS`,截至 2026-10-
|
|
227
|
+
- 开启后,**每次聊天请求**都会带上 ZDR 请求头。插件仍维护官方 CLI 的例外名单(`KNOWN_NON_ZDR_MODELS`,截至 2026-10-14 共 22 个模型,例如 `xai/grok-4.5`、`stealth/glyph-cluster:free`、`stepfun/Step-3.7-Flash`、`meta/muse-wonder-1.0`)供查询。没有可用 ZDR 上游时,服务端返回 `422 cmd_zdr_no_providers`;插件不会去掉请求头重试。
|
|
227
228
|
- 万一仍被拒绝(名单过期,或那一刻没有空闲的 ZDR 上游容量),错误信息会说明原因并给出关闭 ZDR 的办法,而不是抛出一个光秃秃的 HTTP 422。
|
|
228
229
|
- **ZDR 通常更贵**:容量有限,按各上游实价透传计费,且每次请求落在哪个上游可能不同。会话费用读数仍按常规目录价估算;真实单价见 Command Code Studio 的用量页。
|
|
229
230
|
- 各套餐均可使用;ZDR 请求按套餐的默认额度(而非提升额度)计量。
|