@mars-sea/dsh-commandcode-provider 0.12.1 → 0.12.3
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 +58 -1
- package/README.md +5 -1
- package/README.zh-CN.md +6 -1
- package/lib/client.js +5854 -5032
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +368 -177
- package/lib/index.js +4577 -3664
- package/lib/index.js.map +1 -1
- package/package.json +40 -40
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,63 @@ 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.12.3] - 2026-10-03
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- DeepSeek V4 系列新增 `off` 思考档,与官方 command-code@1.73.3 对齐:`deepseek-v4-pro`、`deepseek-v4-flash`、`deepseek-v4-flash-vision-exp`、`deepseek-v4.1-flash`、`deepseek-v4.1-flash-fast` 的可选档位里现在有 `off`,可以真正关闭思考。判定依据是快照本身——官方 CLI 的请求体只要 effort 非空字符串就原样下发,所以 `off` 是靠 `reasoning_effort:"off"` 这个字段本身生效的,省略字段反而做不到;因此仅当模型快照列出 `off` 时透传,未列出的模型(Claude 全系,以及始终三档的 `deepseek-v4-flash-fast`)继续保持原有行为:把 `off` 当作"未请求思考强度"而丢弃。
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- 同步官方 command-code@1.74.1:请求头 `x-command-code-version` 升至 `1.74.1`;Space Bunny Alpha 增加 `max` 档(官方 1.73.4),成为四档模型;零数据保留例外名单移除 `meituan/LongCat-2.0`(官方已不再把它列入任何 ZDR 排除集合,名单由 23 项减为 22 项)。
|
|
16
|
+
|
|
17
|
+
### Removed
|
|
18
|
+
|
|
19
|
+
- 移除 `stealth/pixel-canary` 的全部快照条目(思考档、Vision、最低套餐、免费促销)。官方已于 2026-10-01 结束该隐身预览:CLI 用 `hidden` 标记把它从模型选择器隐藏,模型也已从 `/provider/v1/models` 与定价页撤下,继续展示只会给出一个调不通的选项。它仍保留在零数据保留例外名单里——官方 CLI 的 ZDR 集合至今仍列着它,`supportsZeroDataRetention()` 对老会话里残留的 id 依然要说实话。
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- 固定单次调用的连接、账号定义和目录路由,避免设置切换期间混用网关事实;隔离各网关账号状态与探测,统一目录刷新发布权,保留失败前有效事实,并发已有更低上限时仍可完成本次唯一降档重试。用量展示使用同一来源及恢复后的健康事实。
|
|
24
|
+
|
|
25
|
+
- 统一设置保存与即时账号操作的写入顺序,普通字段和模型选择整批提交;默认密钥引用变化时停止或提示核对,避免迟到保存恢复已清密钥或写入错误引用。区分配置、密钥和状态刷新结果,保留新草稿并提供只刷新状态的重试;插件销毁停止未发操作,取消继承固定账号真正恢复自动轮换。
|
|
26
|
+
|
|
27
|
+
- 集中单次流响应收束:取消后停止缓冲正文、工具和成功结束,保留已解析用量;协议最终标记后忽略多余内容,底层取消不返回也能释放本地读取。保留正文截断行为及 OpenAI 尾部失败规则,并增加真实宿主终止装配验证。
|
|
28
|
+
|
|
29
|
+
- 网页登录在收到授权地址后自动打开新页面,每次尝试只打开一次;保留手动链接,避免浏览器拦截自动打开后无法继续授权。
|
|
30
|
+
|
|
31
|
+
- 将两种新增账号方式收进宿主开通过程:设置页离开或观察流断开后取消,已开始的凭据写入结束后再补偿;命名失败保留已登录账号,清理失败持久显示并由用户重试。
|
|
32
|
+
|
|
33
|
+
- 修复持续集成里"隔离安装"检查在 npm 10 下必然失败:`npm pack --json` 在 npm 10 仍会触发本项目的 `prepare`(`tsdown`),其彩色横幅打在 stdout 上、排在 JSON 之前,脚本直接 `JSON.parse(stdout)` 就抛 `Unexpected token 'ℹ'` 并中断该步骤。改为跳过 JSON 之前的噪声再解析,并接受数组与键值对象两种形状;两个打包校验脚本共用同一套解析,新增 6 条用例(含噪声中的方括号、无 JSON 时报错、噪声超上限停止扫描)。本地 npm 11 不触发 `prepare`,所以只在持续集成暴露。
|
|
34
|
+
|
|
35
|
+
## [0.12.2] - 2026-10-01
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
|
|
39
|
+
- 支持 Go 套餐官方每模型月度额度;零值保留为零,缺失值不推算,额度不改变接口访问权限。
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- **上游同步:command-code@1.72.1 → 1.73.0。** 已按 npm `latest` tarball(提取前做 sha512 校验)、`/provider/v1/models`、定价页内嵌 availability、CLI 注册表的 effort/ZDR/套餐表与渲染后 changelog 重新核对。**本次只有版本常量变化**:目录仍是同样 86 个模型,`KNOWN_EFFORTS`、`KNOWN_PLANS`、`KNOWN_IMAGE_MODELS`、`KNOWN_THINKING_MODELS`、`KNOWN_PEAK_PRICING`、`KNOWN_NON_ZDR_MODELS`(23 项)与 `KNOWN_SUBSCRIPTION_PLANS` 全部零差异,因此没有任何快照被改动。1.73.0 实际带来的是云沙箱 RPC 层——新增 `/alpha/sandbox/input`、`/alpha/sandbox/transcript` 两个 alpha 端点,以及 `--experimental --rpc` 下的一个 JSON-RPC dispatcher(`turn/start`、`turn/steer`、`turn/interrupt`、`modelAndEffort`),本插件从不调用。适配器真正使用的通道与 1.72.1 完全一致:`/alpha/generate` 调用点、`/provider/v1/*` 端点全集、以及所有请求头(`x-command-code-version`、`x-cmd-zdr` 等)均无增删。其前的 1.72.2 → 1.72.4 是 `IMP` 修复串;1.72.0 的用户可见新增是 `cmd mods enable|disable <name>` 与 `/rc`(从 Telegram/Discord 远程控制会话)。注意官方 changelog 页当时最新仍为 1.72.4——npm 先于网页发布,该版本自身条目尚未渲染。
|
|
44
|
+
|
|
45
|
+
- **`/alpha/generate` 补齐官方客户端的两个请求字段。** `permissionMode` 现在发送 `"standard"`(CLI 内部默认值是 `"default"`,但其 `toWirePermissionMode()` 会在上线前把缺省/默认归一化为 `"standard"`,且该值经真实服务探测确认为合法枚举成员),`x-taste-learning` 由 `"true"` 改为 `"false"`(取自一个独立第三方 Command Code 集成的观测值,未对真实服务做过效果验证)。两者都只是请求形状对齐:`permissionMode` 已在 issue #64 评审的"根因边界"一节用同一传输测过并排除为缓存回归的成因;`x-taste-learning` 的新值同样未经实测确认会改变任何响应。未改变运行时行为。
|
|
46
|
+
|
|
47
|
+
- **账号卡片与侧边栏统计的"当前使用"徽章,现在与实际请求路由共用同一套自愈判断。** `resolveKey()`(真实请求路径)对显式选中的账号有专门的复活探测:一次 429 留下的 `unknown` 标记,会在下一次真实请求时按 60 秒节流主动探测其真实窗口,发现没超限就立刻恢复。但展示路径此前直接调用裸 `selectActiveAccount()`——一个纯同步过滤函数,从不探测——而清除 `unknown` 标记的唯一途径就是 `resolveKey()` 内部的探测。结果是:只要用户没有实际发消息,一个早已可复活的标记会一直显示"已切换"。现在把两段探测逻辑抽成共享私有方法 `reviveExplicit()` / `probeAllMarked()`,并新增 `pool.activeAccount()` 供展示层复用(issue #51 的后续报告)。`activeAccount()` 与 `resolveKey()` 的刻意差异:不消耗 `tried` 预算、不区分具体模型、全部账号不可用时返回 `undefined` 而非抛错。反馈中另一半"选的是有额度账号却突然 400、会话中断"是否同一根因仍待真实零余额账号复现,不在本次修复范围。
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
- 限制错误响应正文的时间与大小,避免错误请求永久挂起;登录回调后的验证继续受总期限与取消约束。
|
|
52
|
+
- 修复 OpenAI 独立尾部用量丢失,以及 Messages 部分用量覆盖输入/缓存统计和过早终止。
|
|
53
|
+
- 价格同步遇到未知套餐额度或交叉校验失败时停止生成与写入,避免删除完整旧快照中的额度。
|
|
54
|
+
- 秒制超时设置保留毫秒精度;超时建议只提供高于当前值且在页面上限内的期限。
|
|
55
|
+
- 保存期间的新草稿不再被成功回调清除;移除账户先原子提交关联配置,再清理凭据,清理失败可跨页面刷新重试。
|
|
56
|
+
- 冷生成使用同网关的磁盘目录计算模型输出上限,不额外联网;DSH 对等依赖改用精确版本以匹配单一宿主支持约定。
|
|
57
|
+
- 移除按单次请求提示词大小动态收紧 `max_tokens` 的客户端预判(`requestContextBudget()`):该机制会随对话变长把实际发送的输出预算越压越小,是长对话"输出被提前截断"的直接原因;现场 A/B 实测确认,去掉预判后真正超窗口的请求仍能被上游拒绝原文正确识别为超出上下文窗口并走既有压缩重试,不需要客户端预先猜测(issue #74,一并回退了 issue #73 为同一机制加的空响应改判分支)。
|
|
58
|
+
- 设置页 RPC 报错不再可能显示为 `[object Object]`:跨进程边界丢失 `Error` 原型链时,改为读取错误对象里的 `message` 字段(issue #74)。
|
|
59
|
+
|
|
60
|
+
- 网页显示终端覆盖后的有效模型选择;保存时一次更新白名单与覆盖,显示全部处理继承隐藏项,冲突保留草稿。终端保存显式选择,避免清除覆盖后重新继承相反值。
|
|
61
|
+
- 页面及用量面板辅助字号至少 12px;重试次数错误说明与 0~50 次限制一致。通用 HTTP 失败显示中文说明和诊断码,避免回显上游正文。
|
|
62
|
+
- 移除发布包中无对应文件的 `./src/*` 子路径;持续集成加入真实宿主加载、隔离安装和实际打包入口校验,打包检查不再额外运行准备脚本。
|
|
63
|
+
|
|
7
64
|
## [0.12.1] - 2026-09-30
|
|
8
65
|
|
|
9
66
|
### Added
|
|
@@ -57,7 +114,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
57
114
|
checked against their registry-published sha512 digests (`pi-ai` 0.87.1, `command-code` 1.68.0, both
|
|
58
115
|
matching) rather than taken on trust, and `command-code` 1.68.0 separately shows the CLI marks only its own
|
|
59
116
|
system section and never touches this endpoint — which is why the CLI-route cache regressions in
|
|
60
|
-
[docs/issue-64-cache-review.md](
|
|
117
|
+
[docs/issue-64-cache-review.md](docs/issue-64-cache-review.md) say nothing about this one. **This could
|
|
61
118
|
not be confirmed against a live Command Code response** — the account had no remaining quota — so the
|
|
62
119
|
claim that the gateway honours the field rests on the official provider depending on it for its own cost
|
|
63
120
|
display, not on a measured `cache_read_input_tokens`. The downside is bounded either way: a gateway that
|
package/README.md
CHANGED
|
@@ -144,7 +144,7 @@ cmd login # writes ~/.commandcode/auth.json
|
|
|
144
144
|
cwd: !!js process.cwd()
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
**Engine version.** The plugin is maintained against exactly one engine: **dsh 0.2.0-rc.2**. Its `@deepseek-ai/dsh-*`
|
|
147
|
+
**Engine version.** The plugin is maintained against exactly one engine: **dsh 0.2.0-rc.2**. Its `@deepseek-ai/dsh-*` peers use the exact version `0.2.0-rc.2`, and `dsh.compatibility.dshReleases` records that single release. Adjacent prereleases and stable patch versions have not been verified. On an older engine the settings page, the message envelope, or the request-image budget will not line up — install the last release that supported your engine (see [Install](#install)) instead of forcing this one.
|
|
148
148
|
|
|
149
149
|
## Usage dashboard
|
|
150
150
|
|
|
@@ -301,3 +301,7 @@ MIT — see [LICENSE](./LICENSE). Portions ported from [pi-commandcode-provider]
|
|
|
301
301
|
**Settings page** — the account list with live quota, model visibility, privacy switches and connection options:
|
|
302
302
|
|
|
303
303
|
<img src="assets/screenshots/settings-page.png" alt="Command Code settings page with the account usage card" width="640">
|
|
304
|
+
|
|
305
|
+
### Package entry points
|
|
306
|
+
|
|
307
|
+
The package exports the plugin root, `/client`, `/locale/*.json`, and `/package.json`. Source remains in the repository; the unpackaged `./src/*` export was removed. `npm run test:pack` checks declared entry points against the actual packed file list.
|
package/README.zh-CN.md
CHANGED
|
@@ -136,7 +136,7 @@ cmd login # 写入 ~/.commandcode/auth.json
|
|
|
136
136
|
cwd: !!js process.cwd()
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
**引擎版本要求。** 插件只针对一个引擎维护:**dsh 0.2.0-rc.2**。它的 `@deepseek-ai/dsh-*`
|
|
139
|
+
**引擎版本要求。** 插件只针对一个引擎维护:**dsh 0.2.0-rc.2**。它的 `@deepseek-ai/dsh-*` 对等依赖使用精确版本 `0.2.0-rc.2`,`dsh.compatibility.dshReleases` 也只记录这一个版本。相邻预发布版与稳定补丁版尚未验证。在更早的引擎上,设置页、消息封装或请求图片预算总有一处对不上——请改装支持你所用引擎的最后一个版本,而不是硬装这一个。
|
|
140
140
|
|
|
141
141
|
## 用量面板
|
|
142
142
|
|
|
@@ -292,3 +292,8 @@ MIT —— 见 [LICENSE](./LICENSE)。部分内容移植自 [pi-commandcode-prov
|
|
|
292
292
|
**设置页** —— 带实时额度的账户列表、模型显示、隐私开关与连接参数:
|
|
293
293
|
|
|
294
294
|
<img src="assets/screenshots/settings-page.png" alt="Command Code 设置页面(含账户用量卡片)" width="640">
|
|
295
|
+
|
|
296
|
+
### 发布入口
|
|
297
|
+
|
|
298
|
+
发布包提供插件根入口、`/client` 网页入口、`/locale/*.json` 语言包及 `/package.json` 元数据。
|
|
299
|
+
源码只保存在仓库中;未发布的 `./src/*` 不再列入导出声明。`npm run test:pack` 根据实际打包文件核对入口。
|