@mars-sea/dsh-commandcode-provider 0.10.1 → 0.10.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 CHANGED
@@ -4,7 +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
- ## [Unreleased]
7
+ ## [0.10.3] - 2026-09-10
8
+
9
+ ### Changed
10
+
11
+ - **Synced with the official command-code@1.53.0 CLI** (2026-09-10: "Add new deepseek/deepseek-v4.1-flash model"). `COMMAND_CODE_CLI_VERSION` is now `1.53.0`. The only catalog change is the new DeepSeek V4.1 Flash (Go-tier, Vision, 1M context, selectable `low` / `high` / `max` reasoning efforts, same hourly schedule as the other DeepSeek models: $0.15/$0.60 off-peak, $0.30/$1.20 peak, 01–04 & 06–10 UTC Mon–Fri). Wire protocol, endpoints, subscription plan maps, every other plan tier, and every deal are unchanged; `gpt-6-astra` remains a CLI/pricing/docs-only model (absent from the public Provider catalog, as before) and was deliberately kept.
12
+ - **DeepSeek V4.1 Flash is now selectable** — a Go-tier Vision model (1M context) with the `Peak`/`Half` hourly marker and the `Image` badge in the picker.
13
+ - **Synced with the official command-code@1.52.0 CLI** (2026-09-10). `COMMAND_CODE_CLI_VERSION` is now `1.52.0`. Upstream moved 1.51.3 → 1.52.0 the same day; the CLI changelog page still stops at 1.51.0, so the snapshot was read from the bundled model table. The only catalog change is the new free `inclusionai/ling-3.0-flash-sante:free` (Ling 3.0 Flash Sante, 262K context, text-only, automatic reasoning, 100 requests/day). Wire protocol, endpoints, effort map, subscription plan maps, peak/off-peak membership and schedule, and every other deal are unchanged; `gpt-6-astra` remains a CLI/pricing/docs-only model (absent from the public Provider catalog, as before) and was deliberately kept.
14
+ - **Ling 3.0 Flash Sante is now selectable** — a free Go-tier model on every plan (262K context, text-only, reasons automatically), shown with the `FREE` badge at the top of the picker. It succeeds the retired `inclusionai/ling-3.0-flash-free` promo.
15
+ - **Synced with the official command-code@1.51.3 CLI** (2026-09-09). `COMMAND_CODE_CLI_VERSION` is now `1.51.3`. Upstream moved 1.50.0 → 1.50.1 (CLI-local changes only: stable process title, UNIX-socket idle/working/blocked status) → 1.51.0 (briefly added DeepSeek V4.1 Flash Beta behind a 2026-09-10 expiry gate) → 1.51.2 (removed the beta model from the bundle entirely, so no snapshot entry is needed) → 1.51.3 (see below). Re-verified against the official sources: wire protocol (both the `/alpha/generate` CLI transport and the `/provider/v1/chat/completions` Provider transport), endpoints, auth flow, model catalog, plan tiers, subscription plan maps, and deals are all identical to 1.50.0; the peak/off-peak *hours* are unchanged, but the same page now also restricts them to weekdays — see Fixed. There is no CLI changelog entry for 1.51.1–1.51.3 yet, so the 1.51.3 snapshot was read from the bundled model table.
16
+ - **MiniMax M3 now offers selectable reasoning effort** (`low` / `medium` / `high`). The official 1.51.3 bundle gave the model effort levels where it previously let Command Code choose the depth automatically, so the picker's effort selector now lists them (its hidden free sibling gained the same set in the bundle).
17
+ - **The "Visible models" card is now "Model allowlist".** The label and hint on the settings page (zh/en) and in both READMEs say what the card does — checked models are the only ones the picker lists, and checking nothing shows everything — instead of relying on the word "visible". The stored `visibleModels` config key is unchanged, so existing allowlists keep working with no migration.
18
+ - **Per-release compatibility now covers dsh `0.1.5-alpha.1`.** `dsh.compatibility.dshReleases` declares it `compatible` alongside `0.1.2-rc.1`, `0.1.3-alpha.1` and `0.1.3-alpha.2`, so the DSH STORE can list the plugin for the current Harness release.
19
+ - **The build config uses the current tsdown option shape** (`outExtensions` and `deps.neverBundle` instead of the removed `outExtension` / `external`). The external set is byte-for-byte the same list as before, so the published `lib/` output is unchanged in behavior; the change only silences the deprecated-option path on current tsdown.
20
+
21
+ ### Fixed
22
+
23
+ - **The usage report no longer prints a raw success-rate float.** `/commandcode` and the settings page's Account usage card rendered the upstream value verbatim, so a rate of `99.965552876334` showed up as a wall of digits. Both the Host command and the browser card now round to at most two decimals and trim trailing zeros — `99.97`, `100`, `97.6` — through one shared formatting rule on each side.
24
+ - **DeepSeek peak/off-peak pricing now follows the official weekday rule.** Peak rates (01:00–04:00 and 06:00–10:00 UTC, full price) apply **Monday to Friday only** — Saturday and Sunday are charged completely off-peak for all 24 hours. The picker previously derived `Peak`/`Half` from the UTC hour alone, so it showed `Peak` on weekend mornings when the model actually billed at half price. Peak hours are now 35 per week (7 per weekday, 0 on weekends).
25
+ - **DeepSeek V4 Flash Fast no longer shows a bogus `Peak`/`Half` marker.** Its official pricing row is flat ($0.28/$0.56/$0.07) with no `timeOfDay` block, so it is not billed by the hour; the picker now shows just `Go · 1M`. The hourly-priced set is DeepSeek V4 Pro, V4 Flash, V4 Flash Vision (exp), and — from command-code@1.53.0 — V4.1 Flash. The upstream snapshot procedure was tightened to read the pricing page's embedded model JSON instead of the rendered rows, whose annotations sit one row off when flattened to text.
26
+
27
+ ## [0.10.2] - 2026-09-08
28
+
29
+ ### Added
30
+
31
+ - **Searchable model-editor dropdowns with tier grouping and stale-id cleanup.** The routing-rule editor and the Visible models filter share one dropdown: a search box filters the 60+ model catalog by id/display-name substring, entries group under plan-tier headings (FREE → Go → GOAT → Pro → Provider/Max, mirroring the picker order), and selected models retired upstream render flagged instead of silently vanishing — the Visible models card offers a one-click cleanup that never auto-drops (an empty catalog from a fetch failure must not wipe the list).
32
+
33
+ ### Fixed
34
+
35
+ - **Turning the web-search toggle off no longer silences other search plugins** ([#26](https://github.com/Mars-Sea/dsh-commandcode-provider/issues/26)). Disabling `webSearch` used to force the web seam back to the factory `deepseek-official` backend, so a sibling search plugin (e.g. modsearch) stayed dead even with Command Code search off. The plugin now remembers the backend it displaced when taking over and hands the selection back to it on toggle-off — and on unload, so disabling the plugin no longer leaves a stale `commandcode` pin that fails every search with `WEB_PROVIDER_CONFIGURED_MISSING`.
36
+ - **DSH STORE relisting.** Declare per-release compatibility for the latest DSH versions (`dsh.compatibility.dshReleases`: 0.1.2-rc.1, 0.1.3-alpha.1, 0.1.3-alpha.2 all `compatible`) so the catalog can restore the listing, and vendor the built runtime files (`lib/index.js`, `lib/index.d.ts`, `lib/client.js`) in git so the store review resolves the package entry points from the fixed commit.
37
+ - **A partially landed settings save no longer duplicates routing rules on retry.** When the rules write landed but a later write failed, the retry re-persisted staged additions a second time. Staged removals are now matched by row content (stored ids shift after any write), landed additions are dropped from staging, and the write dedupes by content — mirroring the existing account-staging behavior. A throwing settings write also counts as a failed (not dropped) save.
38
+ - **A stream whose final event lacks its trailing newline no longer emits a duplicate `finish`.**
39
+ - **Corrupt billing facts fail open.** A non-finite plan-tier weight no longer hides models, and sub-1K context windows render raw instead of `"0K"`.
40
+ - **The loopback login's body cap is now measured in wire bytes** (multibyte bodies previously passed ~1.5–2× the limit), and over-limit requests never process their partial body.
41
+ - **The zh `/commandcode` command no longer shows English for empty/error states.**
42
+
43
+ ### Changed
44
+
45
+ - **The usage report fetches faster.** `getUsage()` still reads whoami first (the subscriptions query needs its org id) but now fetches usage/credits/subscriptions in parallel instead of serially, and the four endpoint parsers plus the total-failure classifier are module-level functions.
46
+ - **`stream()` internals are now module-level.** The CLI/OpenAI body builders, the pre-stream connect attempt, the block assembler, and both transport event handlers take explicit parameters instead of closing over `stream()` locals — same wire behavior, pinned by the existing 80+ adapter tests. (The two message converters stay separate: their wire shapes are irreconcilable by design.)
47
+ - **The settings page's model catalog is now unfiltered.** The `commandcode/models` Remote serves the full catalog instead of the plan-filtered picker list, so a routing rule can target a model the picker hides (e.g. route a GOAT-only model to the GOAT account from a Go-plan view). The visible-models filter shares the same full-catalog candidate list. Each entry also carries its plan-tier key so the editor dropdowns can group under tier headings.
8
48
 
9
49
  ## [0.10.1] - 2026-09-07
10
50
 
package/README.md CHANGED
@@ -23,7 +23,7 @@ Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harnes
23
23
  - **Multi-account rotation** — when one account hits its usage limit, requests switch to the next account automatically. See [Account rotation](#account-rotation).
24
24
  - **Flexible API key setup** — via the settings page, an environment variable, or the official CLI login file.
25
25
  - **Model-picker annotations** — minimum plan, active deal or `FREE` badge, peak/off-peak state, image support, and context window; free models listed first.
26
- - **Plan-aware picker** — models above your subscription tier are hidden by default (toggleable).
26
+ - **Plan-aware picker** — models above your subscription tier are hidden by default (toggleable); an optional **Model allowlist** keeps only your favorites in the picker.
27
27
  - **Reasoning-effort support** — models with selectable reasoning effort levels expose them in the picker.
28
28
  - **Image input** — Vision-capable models accept images.
29
29
  - **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).
@@ -95,6 +95,7 @@ With several Command Code subscriptions, the plugin **switches to the next accou
95
95
  - **Setup** — use the **Account rotation** card at Settings → **Command Code** to add accounts with a label and API key; the top-level key always serves first as the `default` account.
96
96
  - **Manual switching** — the **Active account** dropdown pins a preferred account; if it is exhausted, requests fall back to other accounts and return once its window resets.
97
97
  - **Route models to accounts** — the **Route models to accounts** card picks catalog models (multi-select, fetched from the live catalog) and routes them to an account. A request whose model is in a rule serves from that account while it is usable; an exhausted or invalid routed account falls back to the normal rotation. Rules match in list order — the first hit wins.
98
+ - **Show only favorite models** — the **Model allowlist** card keeps only the checked models in the model picker; unchecked shows all (the default).
98
99
  - **Status** — the **Account usage** card and `/commandcode` report per-account state.
99
100
 
100
101
  The equivalent YAML (`$DSH_HOME/settings.yaml` or composition config):
@@ -116,6 +117,9 @@ llm-commandcode:
116
117
  - models:
117
118
  - tencent/hy4-preview
118
119
  account: default
120
+ visibleModels: # optional: show only these models in pickers (catalog model ids); unset shows all
121
+ - deepseek/deepseek-v4-pro
122
+ - tencent/hy4-preview
119
123
  ```
120
124
 
121
125
  ## Configure
@@ -138,10 +142,10 @@ llm-commandcode:
138
142
 
139
143
  When your deployment's dsh shell mounts the web capability (`@deepseek-ai/dsh-web` + `@deepseek-ai/dsh-tool-web`), the model's `web_search` tool is served by this plugin's `commandcode` search provider — it calls the Command Code Provider API's `/alpha/web-search` endpoint with the **same API key and base URL** as chat. You do not configure a separate search key, endpoint, or model.
140
144
 
141
- **On by default.** The plugin's **Settings → Command Code** page has a *"Serve dsh web search with Command Code"* toggle (`webSearch`, default on). When on, the plugin selects `commandcode` as the active search backend automatically; turn it off to fall back to dsh's shipped DeepSeek search. The toggle takes effect on the next search — no restart needed.
145
+ **On by default.** The plugin's **Settings → Command Code** page has a *"Serve dsh web search with Command Code"* toggle (`webSearch`, default on). When on, the plugin selects `commandcode` as the active search backend automatically; turn it off to hand the selection back to whichever backend was there before (a sibling search plugin such as modsearch keeps working — it is never forced back to dsh's shipped DeepSeek search). The toggle takes effect on the next search — no restart needed.
142
146
 
143
147
  - The provider registers as `commandcode` on `ctx.web` only when the web service is present; without it this stays a chat-only plugin.
144
- - The toggle works by selecting `commandcode` in the web seam at boot and on every settings change. If you'd rather pin it durably, set `searchProvider: commandcode` (or `$DSH_WEB_SEARCH_PROVIDER=commandcode`); that remains effective even if this plugin's runtime selection is unavailable.
148
+ - The toggle works by selecting `commandcode` in the web seam at boot and on every settings change, remembering the backend it displaced; turning the toggle off (or unloading the plugin) restores that backend. If you'd rather pin it durably, set `searchProvider: commandcode` (or `$DSH_WEB_SEARCH_PROVIDER=commandcode`); that remains effective even if this plugin's runtime selection is unavailable.
145
149
  - `numResults` from the dsh tool is clamped to the Command Code range (1–10, default 5); results map to the dsh `WebSearchSource` shape (`url`/`title`/`snippet`).
146
150
 
147
151
  > This reuses the Command Code Provider API directly (like the official CLI's built-in `web_search`), so it is distinct from a DeepSeek-native search backend.
package/README.zh-CN.md CHANGED
@@ -23,7 +23,7 @@
23
23
  - **多账户轮换**:一个账户用量打满后,请求自动切换到下一个账户。详见[多账户轮换](#多账户轮换)。
24
24
  - **key 配置灵活**:设置页填写、环境变量或官方 CLI 登录文件均可。
25
25
  - **模型选择器标注**:每个模型标注最低套餐、折扣/FREE 徽章、峰谷时段、图片支持与上下文长度,免费模型置顶。
26
- - **按套餐过滤**:默认隐藏超出订阅套餐的模型,可一键关闭。
26
+ - **按套餐过滤**:默认隐藏超出订阅套餐的模型,可一键关闭;「模型白名单」可进一步只保留常用模型。
27
27
  - **推理强度支持**:支持推理强度的模型可在选择器中选择档位。
28
28
  - **图片输入**:Vision 模型支持发送图片。
29
29
  - **联网搜索**:dsh 的 `web_search` 工具由 Command Code Provider API(`/alpha/web-search`)承载,复用聊天同一个 key 与端点,无需单独配置搜索 key 或地址。详见[联网搜索](#联网搜索)。
@@ -93,6 +93,7 @@ cmd login # macOS/Linux;Windows 原生版:cmdc login
93
93
  - **配置**:在 **设置 → Command Code** 的「多账户轮换」卡片添加账户并填写备注名与 API key;顶层 key 始终是第一顺位的 `default` 账户。
94
94
  - **手动切换**:卡片上的「当前使用账户」下拉框可指定优先账户;所选账户耗尽时自动回落到其他账户,窗口重置后自动恢复。
95
95
  - **按模型切换账户**:在「按模型切换账户」卡片从实时模型目录**多选**模型并固定到某个账户。请求的模型在规则列表中且该账户可用时使用该账户;账户耗尽或密钥失效时自动回落到常规轮换。规则按列表顺序匹配,第一条命中生效。
96
+ - **只显示常用模型**:在「模型白名单」卡片勾选要保留的模型,模型选择器只列出这些;不勾选则显示全部(默认行为不变)。
96
97
  - **状态展示**:「账户用量」卡片与 `/commandcode` 均按账户分别显示状态。
97
98
 
98
99
  等价的 YAML(`$DSH_HOME/settings.yaml` 或组合配置):
@@ -114,6 +115,9 @@ llm-commandcode:
114
115
  - models:
115
116
  - tencent/hy4-preview
116
117
  account: default
118
+ visibleModels: # 可选:只在选择器中显示这些模型(目录模型 id),不填显示全部
119
+ - deepseek/deepseek-v4-pro
120
+ - tencent/hy4-preview
117
121
  ```
118
122
 
119
123
  ## 配置
@@ -136,10 +140,10 @@ llm-commandcode:
136
140
 
137
141
  当你的 dsh 部署加载了 web 能力(`@deepseek-ai/dsh-web` + `@deepseek-ai/dsh-tool-web`)时,模型所用的 `web_search` 工具会由本插件的 `commandcode` 搜索 provider 承载——它用**与聊天相同的 API key 与 base URL** 调用 Command Code Provider API 的 `/alpha/web-search` 端点。你无需另外配置搜索 key、端点或模型。
138
142
 
139
- **默认开启。** 插件的 **设置 → Command Code** 页里有一个「用 Command Code 承载联网搜索」开关(`webSearch`,默认开)。开启时插件会自动把 `commandcode` 选为当前搜索后端;关闭则回退到 dsh 自带的 DeepSeek 搜索。该开关在**下一次搜索时生效**,无需重启。
143
+ **默认开启。** 插件的 **设置 → Command Code** 页里有一个「用 Command Code 承载联网搜索」开关(`webSearch`,默认开)。开启时插件会自动把 `commandcode` 选为当前搜索后端;关闭则把选择权交还给之前的后端(比如 modsearch 等其他搜索插件可继续工作——不会被强制回退到 dsh 自带的 DeepSeek 搜索)。该开关在**下一次搜索时生效**,无需重启。
140
144
 
141
145
  - 该 provider 仅在 web 服务存在时以 `commandcode` 注册进 `ctx.web`;没有它,本插件仍是纯聊天插件。
142
- - 开关通过启动时与每次设置变更时在 web 接缝里选中 `commandcode` 来实现。若你想更稳妥地固定,可设置 `searchProvider: commandcode`(或 `$DSH_WEB_SEARCH_PROVIDER=commandcode`);即使本插件的运行时选中不可用,该配置仍然生效。
146
+ - 开关通过启动时与每次设置变更时在 web 接缝里选中 `commandcode` 来实现,同时记住被顶掉的后端;关闭开关(或卸载插件)时会恢复那个后端。若你想更稳妥地固定,可设置 `searchProvider: commandcode`(或 `$DSH_WEB_SEARCH_PROVIDER=commandcode`);即使本插件的运行时选中不可用,该配置仍然生效。
143
147
  - dsh 工具的 `numResults` 会被收敛到 Command Code 的取值范围(1–10,默认 5);结果映射为 dsh 的 `WebSearchSource` 结构(`url`/`title`/`snippet`)。
144
148
 
145
149
  > 这里直接使用 Command Code Provider API(与官方 CLI 内置的 `web_search` 相同),因此与 DeepSeek 原生搜索后端不同。