@mars-sea/dsh-commandcode-provider 0.11.0 → 0.11.2
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 +25 -0
- package/README.md +6 -5
- package/README.zh-CN.md +6 -5
- package/lib/client.js +181 -188
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +64 -2
- package/lib/index.js +401 -21
- package/lib/index.js.map +1 -1
- package/package.json +42 -38
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,31 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.11.2] - 2026-09-15
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- **A pre-release engine smoke test** (`npm run test:engine`, [#43](https://github.com/Mars-Sea/dsh-commandcode-provider/issues/43)). It installs the newest release `package.json` declares compatible, stages this checkout's published surface in a scratch tree whose peers ARE that engine's, and imports the bundle there — the only check that can see a bundle which cannot link against the engine it will run on, because a `link:`-installed profile resolves the plugin's peers from the plugin's own `node_modules` instead. It also audits every static named import, the client bundle's `require()` calls, and the request-image policy the engine exposes (including that `LlmError` carries the offload count back).
|
|
13
|
+
- **Session images are now priced the way the upstream that serves them charges for them.** The plugin declares request-image pricing to the harness's token meter, so an image occurrence is charged its family's published visual-token count — Anthropic's one-token-per-750-pixels rule, OpenAI's 512-px tiles, Gemini's 768-px crops, DeepSeek's token grid — read off the model's catalog id, with the most expensive of those rules as the conservative estimate for the families whose accounting we cannot tell apart (Qwen, MiniMax, xAI, moonshot and friends). Without it the meter fell back to a structural estimate that charged a handful of tokens for a full screenshot, so an image-heavy session under-reported the context it was carrying and could walk into its own context window. Offloaded images and text-only routes are priced as the placeholder text the model actually receives. These are context estimates, not invoices: a completed request's own usage stays authoritative.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- **The declared Harness range now admits every release the manifest supports.** A caret on a prerelease (`^0.1.2-rc.1`) can only ever resolve to `0.1.2-rc.1`, because semver admits a prerelease only inside the same `major.minor.patch` tuple — so a fresh generation installed a second, older copy of the Harness beside the running engine instead of pairing with it. The peer range is now an exact-version disjunction covering `0.1.2-rc.1` through `0.1.6-alpha.1`, repeated verbatim in `dsh.compatibility.dsh` and `engines.dsh`, and `dsh.compatibility.dshReleases` records `0.1.6-alpha.1` as compatible so the catalog keeps listing the plugin for the current release.
|
|
18
|
+
- **Request images now travel as request versions instead of the stored originals.** An attachment is kept normalized at the size admission accepted; every provider request now asks the attachment service for the version encoded to this route's target — a 1568-px long edge (Anthropic's ceiling, inside the high-detail band of the OpenAI and Gemini tile schemes) and at most 1 MiB per image — and that version is cached by the service and reused across occurrences. Measured on a 3600x2400 screenshot: the harness-normalized original was 2508x1672 at 2.4 MiB, and what reached the wire was 1568x1045 at 0.7 MiB, a 3.4x cut in the base64 that every subsequent request in the session re-sends — which is what pushes a long vision session toward the gateway's undocumented ~50 MB body cap. The request-image budget still accounts the stored size, so the safety margin it computes is unchanged (and conservative).
|
|
19
|
+
- **The plans & quota panel now follows the harness language.** Its copy was English on every harness by construction; both the sidebar card and the dashboard now read in the active language (`panel.commandcode` is a registered locale namespace binding the two panel slots' `t` seat, and every label, state word and the card's tooltip is composed through it). Switching the harness language re-renders the panel immediately. The composer session-cost estimate remains English by construction.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- **The plugin loads on dsh `0.1.6-alpha.1` again** ([#43](https://github.com/Mars-Sea/dsh-commandcode-provider/issues/43)). dsh-llm 0.1.6 removed `offloadRequestImagesWithPolicy`, which the adapter imported by name, so the built bundle failed at ESM link time and the host half never instantiated: no `commandcode` route, no settings page, no panel — and 0.1.6 reports an optional plugin's failure far more quietly than 0.1.5 did. The request-image policy is now reached through a namespace import and selected at runtime, so one build serves both engine generations. On 0.1.2–0.1.5 nothing changes: the adapter still projects its own history under the same 32 MiB / 60-image budget. On 0.1.6 the offload set belongs to the session surface: the adapter renders the surface's durable `offloaded` marks as placeholder text, and an over-budget history fails with `IMAGE_OFFLOAD_REQUIRED` + the count to offload, which the default `dsh-compaction-image-offload` plugin records as one `image/offload` event before retrying. An omission therefore survives session restore and fork, and the token meter stops counting evicted images as context. A 413 asks for the stricter rung's shortfall through the same channel; when nothing is left to offload, the existing bilingual request-size diagnosis stands.
|
|
24
|
+
- **The plans & quota dashboard can be closed again** ([#41](https://github.com/Mars-Sea/dsh-commandcode-provider/issues/41)). Opening it from the sidebar card replaces the conversation in the center column, and there was no way back: the card only re-selected the same panel, so the session stayed unreachable until the whole page was reloaded. The dashboard header now carries a **×** button (its tooltip and accessible name say "Back to the conversation") that returns to the conversation (`ctx.layout.selectPanel(null)`) without changing the current session; on a layout whose panel selection predates that `null` form it falls back to ui-conversation's reserved `main` seat.
|
|
25
|
+
|
|
26
|
+
### Removed
|
|
27
|
+
- **The client-side image-gate error rewrite, which could never fire.** The plugin used to wrap the legacy `connection.api.sessions` face so a `model-unavailable` "does not accept image input" rejection came back friendlier. That face is gone (model selection moved to the remote in 0.1.2), and the rejection it looked for is not the one this harness raises: the real guard runs on the SEND path as `session/attachment-invalid` with `reason: MODEL_DOES_NOT_SUPPORT_IMAGES`, and the conversation UI already renders it in the active language ("当前模型不支持图片,请切换支持图片的模型" / "The current model does not support images; switch to a model that does"). So the wrapper, its tests and its two dictionary strings are gone rather than retargeted — a second copy of a message the harness already localizes would only be able to drift from it.
|
|
28
|
+
|
|
29
|
+
## [0.11.1] - 2026-09-15
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- **The sidebar plans & quota card is now off by default, with a switch to show it** ([#42](https://github.com/Mars-Sea/dsh-commandcode-provider/issues/42)). The card used to render unconditionally at the bottom of the sidebar. It is now opt-in: **Settings → Command Code → Advanced** carries a *"Show the quota card in the sidebar"* toggle (`showSidebarQuota`, default off). While hidden the card renders nothing at all — no card in the expanded sidebar and no icon in the 56px rail — and starts no background usage poll, so an unused panel costs nothing. The dashboard behind the card stays registered; with the card hidden it simply has no trigger. Saving the switch on shows the card again immediately, with no restart; an unsaved edit never moves it.
|
|
33
|
+
|
|
9
34
|
## [0.11.0] - 2026-09-15
|
|
10
35
|
|
|
11
36
|
### Added
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harnes
|
|
|
27
27
|
- **Plan-aware picker** — models above your subscription tier are hidden by default (toggleable); an optional **Model allowlist** keeps only your favorites in the picker.
|
|
28
28
|
- **Reasoning-effort support** — models with selectable reasoning effort levels expose them in the picker.
|
|
29
29
|
- **Image input** — Vision-capable models accept images.
|
|
30
|
-
- **Plans & quota panel** —
|
|
30
|
+
- **Plans & quota panel** — an optional Command Code card at the bottom of the sidebar (directly above Settings) shows the serving account's plan and its 5-hour and weekly windows; clicking it opens a dashboard with the billing period, both windows as progress bars with reset times, monthly credit consumption, and the purchased/free balances. The dashboard's **×** button hands the center column back to your conversation (the current session is untouched). **Off by default** — turn on *"Show the quota card in the sidebar"* under **Settings → Command Code → Advanced** to show it, and the same switch hides it again (a hidden card draws nothing at all and runs no background usage poll); the change lands as soon as you save. The panel follows your harness language (中文 / English) and needs dsh 0.1.5 (rc.1) or newer.
|
|
31
31
|
- **Session cost estimate** — published-rate estimates (`≈`) beside the composer token counter and in its usage dialog, using each request's model, request time and context tier from durable session history. Model switches and viewing the session later do not reprice earlier requests. Mixed-provider or unpriced usage shows a labeled subtotal (`≥`); missing history or wholly unpriceable usage stays hidden. These are estimates from the installed price snapshot, not provider invoices. Also English on every harness language.
|
|
32
32
|
- **Web search** — the dsh `web_search` tool is backed by the Command Code Provider API (`/alpha/web-search`) with the same key/endpoint as chat, so no separate search key or base URL is needed. See [Web search](#web-search).
|
|
33
33
|
|
|
@@ -54,7 +54,7 @@ Pick the release line that matches your DeepSeek Harness version:
|
|
|
54
54
|
**pnpm 11 holds back new releases.** Its `minimumReleaseAge` defaults to 1440 minutes, so a version published less than a day ago is skipped and `@latest` resolves to the *previous* release — silently, with a success exit code. To install a release from the last 24 hours, name it exactly:
|
|
55
55
|
|
|
56
56
|
```sh
|
|
57
|
-
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.
|
|
57
|
+
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.1
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
The same applies to every profile you install into, including the terminal UI below.
|
|
@@ -73,7 +73,7 @@ dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 #
|
|
|
73
73
|
Each profile updates separately — the terminal UI owns its own plugin list (see below):
|
|
74
74
|
|
|
75
75
|
```sh
|
|
76
|
-
dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.11.
|
|
76
|
+
dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.11.1
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
To move to a version published less than 24 hours ago, name it exactly as in Install above; pnpm 11's age gate resolves `@latest` to the previous release instead.
|
|
@@ -102,7 +102,7 @@ After restart, enter your API key in **Settings → Command Code** and save; **S
|
|
|
102
102
|
The plugin also works under a terminal front door. **Each dsh profile owns its own plugin list**, so the web install above does not reach the terminal — add the plugin to the `dsh-tui` profile as well:
|
|
103
103
|
|
|
104
104
|
```sh
|
|
105
|
-
dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.11.
|
|
105
|
+
dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.11.1
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
Pin the exact version here. For the first 24 hours after a release, a bare package name (or `@latest`) is silently resolved to the previous one: the install succeeds, but the profile gets the older build — which is how a fresh terminal install ends up with no **`/settings` → Command Code** page and no `commandcode` models at all.
|
|
@@ -188,7 +188,7 @@ llm-commandcode:
|
|
|
188
188
|
|
|
189
189
|
## Configure
|
|
190
190
|
|
|
191
|
-
**Settings → Command Code** covers the API key, API base URL, working directory, and request/stream timeouts; once a key is saved, a live **Account usage** card appears at the top of the page.
|
|
191
|
+
**Settings → Command Code** covers the API key, API base URL, working directory, and request/stream timeouts; once a key is saved, a live **Account usage** card appears at the top of the page. The **Advanced** card holds the toggles — hide out-of-plan models, serve web search with Command Code, and show the quota card in the sidebar (off by default).
|
|
192
192
|
|
|
193
193
|
The same options live in `$DSH_HOME/settings.yaml` (changes apply immediately, no restart):
|
|
194
194
|
|
|
@@ -200,6 +200,7 @@ llm-commandcode:
|
|
|
200
200
|
modelsCachePath: ~/.commandcode/models-cache.json
|
|
201
201
|
requestTimeoutMs: 60000 # default 60s
|
|
202
202
|
streamIdleTimeoutMs: 300000 # default 300s
|
|
203
|
+
showSidebarQuota: true # optional: show the plans & quota card in the sidebar (default off)
|
|
203
204
|
```
|
|
204
205
|
|
|
205
206
|
## Web search
|
package/README.zh-CN.md
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
- **按套餐过滤**:默认隐藏超出订阅套餐的模型,可一键关闭;「模型白名单」可进一步只保留常用模型。
|
|
28
28
|
- **推理强度支持**:支持推理强度的模型可在选择器中选择档位。
|
|
29
29
|
- **图片输入**:Vision 模型支持发送图片。
|
|
30
|
-
-
|
|
30
|
+
- **套餐与配额面板**:可选的 Command Code 卡片位于侧边栏底部(Settings 正上方),显示当前服务账号的套餐与 5 小时 / 每周两个配额窗口;点击后在中间栏打开面板,包含计费周期、两个窗口的进度条与重置时间、月度额度消耗,以及已购买 / 赠送余额。面板右上角的 **×** 按钮可随时把中间栏交还给会话(不会切换当前会话)。**默认关闭**——在 **设置 → Command Code → 高级设置** 中打开「在侧边栏显示额度卡片」即可显示,同一开关也能随时隐藏(隐藏时左侧不渲染任何内容,也不会为其后台刷新用量)。面板文案跟随 Harness 显示语言(中文 / English),需要 dsh 0.1.5(rc.1)或更高版本。
|
|
31
31
|
- **会话费用估算**:在输入框下方的 token 计数旁及用量对话框中显示估算金额(`≈`),根据持久化历史中每次请求的模型、请求时间和上下文阶梯分别计价。切换模型或稍后查看不会重新定价之前的请求。混合供应商或缺少费率时显示已定价部分的小计(`≥`);缺少历史事实或完全无法定价时不显示金额。结果基于插件内的价格快照,不等同于供应商账单。同样固定为英文。
|
|
32
32
|
- **联网搜索**:dsh 的 `web_search` 工具由 Command Code Provider API(`/alpha/web-search`)承载,复用聊天同一个 key 与端点,无需单独配置搜索 key 或地址。详见[联网搜索](#联网搜索)。
|
|
33
33
|
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
**pnpm 11 会拦下刚发布的新版本。** 它的 `minimumReleaseAge` 默认为 1440 分钟,发布不足一天的版本会被跳过,`@latest` 解析到**上一个**版本 —— 而且是静默的,命令照样以成功退出。想装 24 小时内发布的版本,必须写精确版本号:
|
|
53
53
|
|
|
54
54
|
```sh
|
|
55
|
-
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.
|
|
55
|
+
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.1
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
这一点对每个 profile 都成立,包括下面的终端界面。
|
|
@@ -71,7 +71,7 @@ dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 #
|
|
|
71
71
|
每个 profile 各自更新 —— 终端界面有独立的插件列表(见下文):
|
|
72
72
|
|
|
73
73
|
```sh
|
|
74
|
-
dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.11.
|
|
74
|
+
dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.11.1
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
要更新到发布不足 24 小时的版本,和上面的安装一样写精确版本号;pnpm 11 的年龄门禁会把 `@latest` 解析成上一个版本。
|
|
@@ -100,7 +100,7 @@ cmd login # macOS/Linux;Windows 原生版:cmdc login
|
|
|
100
100
|
插件同样支持终端前端。**每个 dsh profile 有独立的插件列表**,所以上面那条 Web 安装命令不会装到终端里 —— 还要把插件装进 `dsh-tui` profile:
|
|
101
101
|
|
|
102
102
|
```sh
|
|
103
|
-
dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.11.
|
|
103
|
+
dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.11.1
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
这里请写精确版本号。新版本发布后的 24 小时内,只写包名(或 `@latest`)会被静默解析到上一个版本 —— 安装命令照样成功,但 profile 里拿到的是旧版本,结果就是全新的终端安装里既没有 **`/settings` → Command Code** 页面,也看不到任何 `commandcode` 模型。
|
|
@@ -186,7 +186,7 @@ llm-commandcode:
|
|
|
186
186
|
|
|
187
187
|
## 配置
|
|
188
188
|
|
|
189
|
-
**设置 → Command Code** 可配置 API key、API 地址、工作目录与请求/流超时;配置好 key
|
|
189
|
+
**设置 → Command Code** 可配置 API key、API 地址、工作目录与请求/流超时;配置好 key 后,页面顶部会显示实时「账户用量」卡片。**高级设置**卡片里集中了各个开关:隐藏套餐外模型、用 Command Code 承载联网搜索,以及在侧边栏显示额度卡片(默认关闭)。
|
|
190
190
|
|
|
191
191
|
同一组选项也位于 `$DSH_HOME/settings.yaml`(修改即刻生效,无需重启):
|
|
192
192
|
|
|
@@ -198,6 +198,7 @@ llm-commandcode:
|
|
|
198
198
|
modelsCachePath: ~/.commandcode/models-cache.json
|
|
199
199
|
requestTimeoutMs: 60000 # 默认 60s
|
|
200
200
|
streamIdleTimeoutMs: 300000 # 默认 300s
|
|
201
|
+
showSidebarQuota: true # 可选:在侧边栏显示套餐与配额卡片(默认关闭)
|
|
201
202
|
```
|
|
202
203
|
|
|
203
204
|
## 联网搜索
|