@mars-sea/dsh-commandcode-provider 0.2.0 → 0.2.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 +19 -0
- package/README.md +11 -8
- package/README.zh-CN.md +11 -8
- package/lib/client.js +666 -10
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +10 -11
- package/lib/index.js +18 -68
- package/lib/index.js.map +1 -1
- package/package.json +23 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ 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.2.2] - 2026-08-16
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **A dedicated "Command Code" settings page** (Settings → **Command Code**, a top-level nav entry at the same level as General / Models / Plugins) where you can configure the provider **entirely from the web UI**: an **API-key field** (write-only, stored through the dsh credentials service under the `COMMANDCODE_API_KEY` reference the plugin resolves, with a configured/unconfigured badge) plus the **API base URL**, **working directory**, and **request/stream timeouts** (written to the `llm-commandcode` settings namespace, effective on the next request — no restart). The browser half registers a `settings.section` entry (`id: commandcode`) from the bundle's client plugin; the controller is covered by new unit tests in `tests/settings.test.ts`.
|
|
12
|
+
- **The working-directory field is now genuinely optional in the settings page**: the page reads the Host process cwd (`host.describe().cwd`) and shows it as the field's placeholder, so a blank field visibly resolves to the process working directory — nothing to configure unless you want to pin a specific path. The page hints this in both languages.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **The API key could not actually be configured from the Models page for this provider.** The Models page renders an unknown-adapter-family card for `commandcode` and disables its editor (submit is blocked when `layout === 'unknown'`), so the card's key field could not save. The new dedicated settings page is the working surface for the key (and the connection knobs); the Models card remains as a status/reflection of the provider.
|
|
17
|
+
|
|
18
|
+
## [0.2.1] - 2026-08-16
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **`KNOWN_EFFORTS` advertised reasoning-effort levels for ten models that carry none in the official command-code@1.26.0 model table.** The 0.2.0 snapshot added `claude-haiku-4-5-20251001`, `moonshotai/Kimi-K2.5`, `moonshotai/Kimi-K2.6`, `moonshotai/Kimi-K2.7-Code-Highspeed`, `MiniMaxAI/MiniMax-M2.5`, `xiaomi/mimo-v2.5`, `xiaomi/mimo-v2.5-pro`, `tencent/Hy3`, `tencent/hy3-paid`, and `meta/muse-spark-1.2-contributor` with effort arrays, but the CLI's authoritative `ZA` table (dist/cli.mjs) defines **no `reasoningEfforts`** for any of them — the picker was offering a selector the Provider API won't honor, and the adapter would send `reasoning_effort` for models that don't support it. The snapshot is now exactly the 26 models the `ZA` table marks with efforts (re-verified 2026-08-16 against command-code@1.26.0).
|
|
23
|
+
- **`KNOWN_THINKING_MODELS` included three non-reasoning models and missed three reasoning ones.** `zai-org/GLM-5`, `zai-org/GLM-5.1`, and `zai-org/GLM-5.2-Fast` are `reasoning:false` in the `ZA` table and "Text input"-only in the official registry — they were wrongly labeled as thinking automatically. Conversely `moonshotai/Kimi-K2.7-Code-Highspeed`, `tencent/hy3-paid`, and `meta/muse-spark-1.2-contributor` are `reasoning:!0` without effort levels and now belong. (The set is a data snapshot only — it is not surfaced in the picker's compact description.)
|
|
24
|
+
- **DeepSeek V4 Pro's 75%-off deal is time-limited, not permanent.** The official pricing page retires it on **2026-08-16 16:00 UTC** when DeepSeek replaces the flat rate with peak/off-peak pricing. `KNOWN_DEALS['deepseek/deepseek-v4-pro']` now carries `expiresAt: '2026-08-16T15:59:59.999Z'`, so the picker stops showing the discount the moment it lapses — even in an un-updated plugin.
|
|
25
|
+
|
|
7
26
|
## [0.2.0] - 2026-08-16
|
|
8
27
|
|
|
9
28
|
### Fixed
|
package/README.md
CHANGED
|
@@ -14,9 +14,10 @@ Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harnes
|
|
|
14
14
|
|
|
15
15
|
- A **plugin bundle** installable into any dsh profile with `dsh plugin add` (npm package with a `dsh.bundle` layer).
|
|
16
16
|
- A **`commandcode` provider route** registered on the `llm` service, selectable in the model picker, with the **live model catalog** fetched from `GET {apiBase}/provider/v1/models` (cached at `~/.commandcode/models-cache.json`).
|
|
17
|
-
- A **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
17
|
+
- A **dedicated "Command Code" settings page** (Settings → **Command Code**, a top-level nav entry at the same level as General / Models / Plugins) with an **API-key field** plus the connection knobs (API base, working directory, request/stream timeouts). The key is stored through the dsh credentials service — the same seam the Models page uses — and connection fields land in the `llm-commandcode` settings section, so a change reaches the very next request with no restart.
|
|
18
|
+
- A **Models-page card** ("Command Code") that reflects the provider's presence (the Models page's generic card disables its editor for unknown adapter families, so configure the key on the dedicated page above).
|
|
19
|
+
- **API key resolution** in this order: `config.apiKey` → credential reference `apiKeyEnv` (the Command Code settings page writes it, default `COMMANDCODE_API_KEY`) → the launching environment → the official Command Code CLI auth file (`~/.commandcode/auth.json`, written by `command-code login`).
|
|
20
|
+
- **Reasoning-effort support** for the models Command Code's catalog marks as such (e.g. `claude-opus-5`, `gpt-5.5`, `deepseek/deepseek-v4-pro`, `google/gemini-3.7-flash`, …) via `KNOWN_EFFORTS`, matching the official command-code@1.26.0 bundled model table. Reasoning models without selectable effort levels (e.g. `MiniMaxAI/MiniMax-M3`, `moonshotai/Kimi-K3`, `moonshotai/Kimi-K2.5`) still think — Command Code drives their reasoning depth automatically, exactly like the official CLI.
|
|
20
21
|
- **Plan-tier annotation in the model picker**: every Command Code model is tagged with the minimum plan that includes it (`KNOWN_PLANS`, synced from the [official plan pages](https://commandcode.ai/docs/plans/go)) — **Go** (33 models), **GOAT** (+3), **Pro** (+14), or **Provider/Max** (+5: Claude Opus/Fable, Fugu Ultra). The picker's `description` leads with the plan label, e.g. *"Go · 50% off · Image · 1M"*, *"Pro · Image · 1M"*, so you know which plan a model needs before switching — no more 403 `MODEL_NOT_IN_PLAN` surprises. **The list itself is sorted by plan tier** (`compareByPlan()`): Go models first, then GOAT, Pro, Provider/Max, alphabetical within each tier — the models your plan can actually use lead the picker.
|
|
21
22
|
- **Deal and free-model annotations**: active discounts (`75% off`, `50% off`, `98% off`, `99% off`) and the `FREE` badge (Laguna S 2.1) show next to the plan tier (`KNOWN_DEALS`, synced from the [official pricing page](https://commandcode.ai/docs/resources/pricing-limits#deals)). **Expiry-aware**: each deal records its official end date and is hidden the moment it passes — an un-updated plugin never shows a lapsed discount as if it were live (only Gemini 3.7 Flash's 50% off is time-limited, through December 31, 2026; the rest are permanent).
|
|
22
23
|
- **Image + context markers**: the picker shows `Image` for Vision-capable models and the context window in human form (`1M`, `256K`, `262K`); text-only models show neither — plan tier plus context is enough.
|
|
@@ -31,7 +32,7 @@ npm i -g command-code@latest
|
|
|
31
32
|
cmd login # macOS/Linux; native Windows: cmdc login
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
`cmd login` opens a browser to authenticate; on success the key is written to `~/.commandcode/auth.json` — this plugin picks it up automatically (last-resort fallback). Alternatively create an API key in the browser ([Command Code Studio](https://commandcode.ai/studio/auth/cli)) and paste it into the
|
|
35
|
+
`cmd login` opens a browser to authenticate; on success the key is written to `~/.commandcode/auth.json` — this plugin picks it up automatically (last-resort fallback). Alternatively create an API key in the browser ([Command Code Studio](https://commandcode.ai/studio/auth/cli)) and paste it into **Settings → Command Code** (the dedicated page's API-key field), or `export COMMANDCODE_API_KEY="user_..."`.
|
|
35
36
|
|
|
36
37
|
## Install
|
|
37
38
|
|
|
@@ -47,7 +48,7 @@ dsh plugin --profile web add @mars-sea/dsh-commandcode-provider
|
|
|
47
48
|
|
|
48
49
|
```sh
|
|
49
50
|
# Pin a release tag (recommended — readable and immutable)
|
|
50
|
-
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#v0.1
|
|
51
|
+
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#v0.2.1
|
|
51
52
|
# Or pin any exact commit by its SHA
|
|
52
53
|
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#<full-commit-sha>
|
|
53
54
|
```
|
|
@@ -107,7 +108,7 @@ dsh plugin --profile web update @mars-sea/dsh-commandcode-provider
|
|
|
107
108
|
# From GitHub pinned to a tag: point at the new tag
|
|
108
109
|
# (no need to uninstall first — pnpm swaps the pinned revision in place,
|
|
109
110
|
# and the bundle layer is re-read from the installed package on next boot)
|
|
110
|
-
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#v0.1
|
|
111
|
+
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#v0.2.1
|
|
111
112
|
|
|
112
113
|
# From a local checkout: pull the new code, rebuild, restart
|
|
113
114
|
git -C /path/to/dsh-commandcode-provider pull
|
|
@@ -131,7 +132,7 @@ Then restart the web app (`dsh web`, or restart the service). Verify the running
|
|
|
131
132
|
|
|
132
133
|
## Verify it works
|
|
133
134
|
|
|
134
|
-
After restart, in the web UI: **Settings → Models** shows a **Command Code** card; the model picker lists the live catalog under **commandcode** (54 models at the time of writing). Send a message with a model your plan includes — the default `deepseek/deepseek-v4-flash` works on entry-level plans; open-weight models (DeepSeek/Qwen/Kimi/MiniMax) generally do, while frontier models (Claude/GPT/Gemini/Grok) may require Pro/Max plans or on-demand usage (see FAQ).
|
|
135
|
+
After restart, in the web UI: **Settings → Command Code** shows the dedicated page — enter your API key there and click **Save** (the badge flips to 已配置/Configured once the Host holds it). **Settings → Models** shows a **Command Code** card; the model picker lists the live catalog under **commandcode** (54 models at the time of writing). Send a message with a model your plan includes — the default `deepseek/deepseek-v4-flash` works on entry-level plans; open-weight models (DeepSeek/Qwen/Kimi/MiniMax) generally do, while frontier models (Claude/GPT/Gemini/Grok) may require Pro/Max plans or on-demand usage (see FAQ).
|
|
135
136
|
|
|
136
137
|
## Usage dashboard
|
|
137
138
|
|
|
@@ -166,7 +167,9 @@ Each endpoint degrades independently: a temporary failure of one (e.g. the credi
|
|
|
166
167
|
|
|
167
168
|
## Configure
|
|
168
169
|
|
|
169
|
-
|
|
170
|
+
**Settings → Command Code** is the primary surface: an **API-key** field (stored in `$DSH_HOME/.credentials.yaml` via the credentials service; the field is write-only and reports whether a key is configured), plus **API base URL**, **working directory**, and the **request/stream timeout** fields — all written to the `llm-commandcode` section and applied to the next request. The model catalog is browsable without a key. The **working directory** is optional: leave it blank and the field's placeholder shows the process cwd it resolves to (it defaults to the dsh process's working directory, so there is nothing to configure unless you want to pin a specific path).
|
|
171
|
+
|
|
172
|
+
The same knobs live in the `llm-commandcode` section of `$DSH_HOME/settings.yaml` (overrides the bundle defaults per request, no restart needed):
|
|
170
173
|
|
|
171
174
|
```yaml
|
|
172
175
|
llm-commandcode:
|
package/README.zh-CN.md
CHANGED
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
- **插件包**:可通过 `dsh plugin add` 安装到任意 dsh 配置(npm 包,带 `dsh.bundle` 层)。
|
|
16
16
|
- **`commandcode` provider 路由**:注册在 `llm` 服务上,可在模型选择器中选择,并带 **实时模型目录**(从 `GET {apiBase}/provider/v1/models` 拉取,缓存于 `~/.commandcode/models-cache.json`)。
|
|
17
|
-
-
|
|
18
|
-
- **
|
|
19
|
-
-
|
|
17
|
+
- **专属"Command Code"设置页**(设置 → **Command Code**,与通用/模型/插件同级导航项),带 **API key 输入框** 以及连接参数(API 地址、工作目录、请求/流超时)。密钥通过 dsh 凭据服务存储(与 Models 页同一套机制);连接参数写入 `llm-commandcode` 设置段,改动对下一次请求即刻生效,无需重启。
|
|
18
|
+
- **Models 页面卡片**("Command Code"):反映该 provider 的存在(Models 页对未知适配器家族的通用卡片会禁用其编辑,因此请在专属设置页配置密钥)。
|
|
19
|
+
- **API key 解析顺序**:`config.apiKey` → 凭据引用 `apiKeyEnv`(Command Code 设置页写入,默认 `COMMANDCODE_API_KEY`)→ 启动环境变量 → 官方 Command Code CLI 认证文件(`~/.commandcode/auth.json`,由 `command-code login` 写入)。
|
|
20
|
+
- **推理强度(reasoning-effort)支持**:针对 Command Code 目录中标为推理模型的模型(如 `claude-opus-5`、`gpt-5.5`、`deepseek/deepseek-v4-pro`、`google/gemini-3.7-flash` 等),通过 `KNOWN_EFFORTS` 实现,与官方 command-code@1.26.0 内置模型表一致。没有可选推理档位但仍支持思考的模型(如 `MiniMaxAI/MiniMax-M3`、`moonshotai/Kimi-K3`、`moonshotai/Kimi-K2.5`)同样会思考——由 Command Code 自动控制推理深度,与官方 CLI 行为完全一致。
|
|
20
21
|
- **模型选择器标注套餐档位**:每个 Command Code 模型都标注了包含它的最低套餐(`KNOWN_PLANS`,与[官方套餐页](https://commandcode.ai/docs/plans/go)同步)——**Go**(33 个)、**GOAT**(+3)、**Pro**(+14)、**Provider/Max**(+5:Claude Opus/Fable、Fugu Ultra)。选择器的 `description` 以套餐标签开头,例如 *"Go · 50% off · Image · 1M"*、*"Pro · Image · 1M"*,切换前即可知道该模型需要什么套餐——不再等到第一次请求才收到 403 `MODEL_NOT_IN_PLAN`。**列表本身也按套餐排序**(`compareByPlan()`):Go 模型在最前,随后 GOAT、Pro、Provider/Max,档内按字母序——你当前套餐能用的模型总是排在列表最前面。
|
|
21
22
|
- **折扣与免费标注**:活动折扣(`75% off`、`50% off`、`98% off`、`99% off`)与 `FREE` 徽章(Laguna S 2.1)会显示在套餐旁(`KNOWN_DEALS`,与[官方定价页](https://commandcode.ai/docs/resources/pricing-limits#deals)同步)。**到期感知**:每个折扣记录官方结束日期,一旦过期立即隐藏——插件未更新时也不会把已失效的折扣当成仍在生效(只有 Gemini 3.7 Flash 的 50% off 限时,至 2026 年 12 月 31 日;其余为永久)。
|
|
22
23
|
- **Image 与上下文标注**:支持视觉的模型显示 `Image`,并显示人类可读的上下文长度(`1M`、`256K`、`262K`);纯文本模型两者都不显示——套餐 + 上下文已足够。
|
|
@@ -31,7 +32,7 @@ npm i -g command-code@latest
|
|
|
31
32
|
cmd login # macOS/Linux;Windows 原生版:cmdc login
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
`cmd login` 会打开浏览器进行认证;成功后 key 写入 `~/.commandcode/auth.json`——本插件会自动读取(最后兜底)。也可以直接在浏览器创建 API key([Command Code Studio](https://commandcode.ai/studio/auth/cli))并粘贴到
|
|
35
|
+
`cmd login` 会打开浏览器进行认证;成功后 key 写入 `~/.commandcode/auth.json`——本插件会自动读取(最后兜底)。也可以直接在浏览器创建 API key([Command Code Studio](https://commandcode.ai/studio/auth/cli))并粘贴到 **设置 → Command Code** 专属页面的 API key 输入框,或者 `export COMMANDCODE_API_KEY="user_..."`。
|
|
35
36
|
|
|
36
37
|
## 安装
|
|
37
38
|
|
|
@@ -47,7 +48,7 @@ dsh plugin --profile web add @mars-sea/dsh-commandcode-provider
|
|
|
47
48
|
|
|
48
49
|
```sh
|
|
49
50
|
# 推荐:锁定发布 tag(可读、不可变)
|
|
50
|
-
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#v0.1
|
|
51
|
+
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#v0.2.1
|
|
51
52
|
# 或按完整 commit SHA 锁定任意提交
|
|
52
53
|
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#<完整-commit-sha>
|
|
53
54
|
```
|
|
@@ -106,7 +107,7 @@ dsh plugin --profile web update @mars-sea/dsh-commandcode-provider
|
|
|
106
107
|
|
|
107
108
|
# 从 GitHub 按 tag 安装:指向新 tag
|
|
108
109
|
# (无需先卸载——pnpm 会就地替换固定的版本,下次启动时 bundle 层会从新安装的包重新读取)
|
|
109
|
-
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#v0.1
|
|
110
|
+
dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider#v0.2.1
|
|
110
111
|
|
|
111
112
|
# 从本地检出安装:拉取新代码、重新构建、重启
|
|
112
113
|
git -C /path/to/dsh-commandcode-provider pull
|
|
@@ -130,7 +131,7 @@ dsh web
|
|
|
130
131
|
|
|
131
132
|
## 验证是否生效
|
|
132
133
|
|
|
133
|
-
重启后,在 Web UI 中:**设置 → Models** 会显示 **Command Code** 卡片;模型选择器会在 **commandcode** 下列出实时目录(撰写本文时有 54 个模型)。发送一条消息,选择你套餐中包含的模型——默认的 `deepseek/deepseek-v4-flash` 适用于入门级套餐;开放权重模型(DeepSeek/Qwen/Kimi/MiniMax)通常都可用,而前沿模型(Claude/GPT/Gemini/Grok)可能需要 Pro/Max 套餐或按需计费(见 FAQ)。
|
|
134
|
+
重启后,在 Web UI 中:**设置 → Command Code** 显示专属页面——在那里填入 API key 并点击**保存**(徽章变为"已配置"即表示 Host 已存储)。**设置 → Models** 会显示 **Command Code** 卡片;模型选择器会在 **commandcode** 下列出实时目录(撰写本文时有 54 个模型)。发送一条消息,选择你套餐中包含的模型——默认的 `deepseek/deepseek-v4-flash` 适用于入门级套餐;开放权重模型(DeepSeek/Qwen/Kimi/MiniMax)通常都可用,而前沿模型(Claude/GPT/Gemini/Grok)可能需要 Pro/Max 套餐或按需计费(见 FAQ)。
|
|
134
135
|
|
|
135
136
|
## 用量面板
|
|
136
137
|
|
|
@@ -165,7 +166,9 @@ dsh web
|
|
|
165
166
|
|
|
166
167
|
## 配置
|
|
167
168
|
|
|
168
|
-
Command Code
|
|
169
|
+
**设置 → Command Code** 是主要配置入口:**API key** 输入框(通过凭据服务存储在 `$DSH_HOME/.credentials.yaml`,只写不回显,并显示是否已配置),以及 **API 地址**、**工作目录**、**请求/流超时**字段——全部写入 `llm-commandcode` 设置段,对下一次请求即刻生效。没有 key 也可以浏览模型目录。**工作目录可选**:留空即可——占位符会显示它实际使用的进程工作目录(默认就是 dsh 进程的 cwd,除非你想固定某个路径,否则无需配置)。
|
|
170
|
+
|
|
171
|
+
同一组选项也位于 `$DSH_HOME/settings.yaml` 的 `llm-commandcode` 一节(按请求覆盖 bundle 默认值,无需重启):
|
|
169
172
|
|
|
170
173
|
```yaml
|
|
171
174
|
llm-commandcode:
|