@mars-sea/dsh-commandcode-provider 0.10.0-alpha.3 → 0.10.0-alpha.4

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,6 +4,15 @@ 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.10.0-alpha.4] - 2026-09-01
8
+
9
+ > **Alpha channel for dsh 0.1.2-alpha.2.** This release requires **dsh 0.1.2-alpha.2 or later** and is published under the `alpha` npm tag, so `@latest` stays on 0.9.1 for older Harness releases. Install it explicitly with `@alpha`.
10
+
11
+ ### Added
12
+
13
+ - **Command Code web search through the dsh `web_search` tool.** When the profile mounts the web stack (`@deepseek-ai/dsh-web` + `@deepseek-ai/dsh-tool-web`), this plugin now registers a `commandcode` search provider on `ctx.web` that calls the Command Code Provider API's `/alpha/web-search` endpoint. It reuses the **same API key and base URL as chat**, so dsh's web search needs no separate search key, endpoint, or model configuration — the existing `COMMANDCODE_API_KEY` (or the CLI auth file) works as-is. Results map to the dsh `WebSearchSource` shape; `numResults` clamps to the Command Code range (1–10, default 5). The provider is registered only when the web service is present, so this remains a chat-only plugin in profiles without it.
14
+ - **A "Serve dsh web search with Command Code" toggle in the settings page (`webSearch`, default on).** The Command Code settings page now lets you choose whether the model-facing `web_search` tool is backed by Command Code or by dsh's shipped DeepSeek search. The toggle writes the web seam's selected search provider at boot and on every settings change, so it takes effect on the next search — no restart, no hand-editing `cordis.patch.yml`. Turning it off falls back to the DeepSeek backend.
15
+
7
16
  ## [0.10.0-alpha.3] - 2026-09-01
8
17
 
9
18
  > **Alpha channel for dsh 0.1.2-alpha.2.** This release requires **dsh 0.1.2-alpha.2 or later** and is published under the `alpha` npm tag, so `@latest` stays on 0.9.1 for older Harness releases. Install it explicitly with `@alpha`.
package/README.md CHANGED
@@ -26,6 +26,7 @@ Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harnes
26
26
  - **Plan-aware picker** — models above your subscription tier are hidden by default (toggleable).
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
+ - **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).
29
30
 
30
31
  See [Screenshots](#screenshots) below for what the UI looks like.
31
32
 
@@ -133,6 +134,18 @@ llm-commandcode:
133
134
  streamIdleTimeoutMs: 300000 # default 300s
134
135
  ```
135
136
 
137
+ ## Web search
138
+
139
+ 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
+
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.
142
+
143
+ - 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.
145
+ - `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
+
147
+ > 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.
148
+
136
149
  ## Notes & limitations
137
150
 
138
151
  - **Image input is model-gated** — only Vision models accept images; text-only models refuse them.
package/README.zh-CN.md CHANGED
@@ -26,6 +26,7 @@
26
26
  - **按套餐过滤**:默认隐藏超出订阅套餐的模型,可一键关闭。
27
27
  - **推理强度支持**:支持推理强度的模型可在选择器中选择档位。
28
28
  - **图片输入**:Vision 模型支持发送图片。
29
+ - **联网搜索**:dsh 的 `web_search` 工具由 Command Code Provider API(`/alpha/web-search`)承载,复用聊天同一个 key 与端点,无需单独配置搜索 key 或地址。详见[联网搜索](#联网搜索)。
29
30
 
30
31
  ## 安装
31
32
 
@@ -131,6 +132,18 @@ llm-commandcode:
131
132
  streamIdleTimeoutMs: 300000 # 默认 300s
132
133
  ```
133
134
 
135
+ ## 联网搜索
136
+
137
+ 当你的 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
+
139
+ **默认开启。** 插件的 **设置 → Command Code** 页里有一个「用 Command Code 承载联网搜索」开关(`webSearch`,默认开)。开启时插件会自动把 `commandcode` 选为当前搜索后端;关闭则回退到 dsh 自带的 DeepSeek 搜索。该开关在**下一次搜索时生效**,无需重启。
140
+
141
+ - 该 provider 仅在 web 服务存在时以 `commandcode` 注册进 `ctx.web`;没有它,本插件仍是纯聊天插件。
142
+ - 开关通过启动时与每次设置变更时在 web 接缝里选中 `commandcode` 来实现。若你想更稳妥地固定,可设置 `searchProvider: commandcode`(或 `$DSH_WEB_SEARCH_PROVIDER=commandcode`);即使本插件的运行时选中不可用,该配置仍然生效。
143
+ - dsh 工具的 `numResults` 会被收敛到 Command Code 的取值范围(1–10,默认 5);结果映射为 dsh 的 `WebSearchSource` 结构(`url`/`title`/`snippet`)。
144
+
145
+ > 这里直接使用 Command Code Provider API(与官方 CLI 内置的 `web_search` 相同),因此与 DeepSeek 原生搜索后端不同。
146
+
134
147
  ## 注意事项与限制
135
148
 
136
149
  - **图片输入按模型能力限制**:仅 Vision 模型接受图片,纯文本模型会直接拒绝。
package/lib/client.js CHANGED
@@ -302,6 +302,7 @@ window.__ModuleLoader__.load({
302
302
  max: MAX_TIMEOUT_MS
303
303
  }),
304
304
  booleanField$1("filterModelsByPlan"),
305
+ booleanField$1("webSearch"),
305
306
  textField("activeAccount")
306
307
  ];
307
308
  /** Whether two model-id lists are equal as sets (order-insensitive). */
@@ -431,6 +432,7 @@ window.__ModuleLoader__.load({
431
432
  requestTimeoutMs: this.field("requestTimeoutMs"),
432
433
  streamIdleTimeoutMs: this.field("streamIdleTimeoutMs"),
433
434
  filterModelsByPlan: this.field("filterModelsByPlan"),
435
+ webSearch: this.field("webSearch"),
434
436
  activeAccount: this.field("activeAccount"),
435
437
  accounts,
436
438
  accountsRemoving: [...this.removedRefs],
@@ -1631,7 +1633,7 @@ window.__ModuleLoader__.load({
1631
1633
  };
1632
1634
  //#endregion
1633
1635
  //#region package.json
1634
- var version = "0.10.0-alpha.3";
1636
+ var version = "0.10.0-alpha.4";
1635
1637
  var repository = {
1636
1638
  "type": "git",
1637
1639
  "url": "git+https://github.com/Mars-Sea/dsh-commandcode-provider.git"
@@ -1822,7 +1824,8 @@ window.__ModuleLoader__.load({
1822
1824
  "workingDir",
1823
1825
  "requestTimeoutMs",
1824
1826
  "streamIdleTimeoutMs",
1825
- "filterModelsByPlan"
1827
+ "filterModelsByPlan",
1828
+ "webSearch"
1826
1829
  ];
1827
1830
  /** One labelled field row in the page body. */
1828
1831
  function Field({ id, label, hint, state, disabled, numeric, placeholder, onEdit, onReset, t }) {
@@ -1969,6 +1972,17 @@ window.__ModuleLoader__.load({
1969
1972
  onEdit: (text) => onEdit("filterModelsByPlan", text),
1970
1973
  onReset: () => onReset("filterModelsByPlan"),
1971
1974
  t
1975
+ }),
1976
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleField, {
1977
+ id: "cc-web-search",
1978
+ label: t("webSearch"),
1979
+ hint: t("webSearchHint"),
1980
+ state: state.webSearch,
1981
+ disabled,
1982
+ defaultChecked: true,
1983
+ onEdit: (text) => onEdit("webSearch", text),
1984
+ onReset: () => onReset("webSearch"),
1985
+ t
1972
1986
  })
1973
1987
  ]
1974
1988
  }) : null,
@@ -3342,6 +3356,8 @@ window.__ModuleLoader__.load({
3342
3356
  advancedInvalid: "高级设置中有未填好的数字,请展开修正后再保存。",
3343
3357
  filterModelsByPlan: "隐藏套餐外模型",
3344
3358
  filterModelsByPlanHint: "开启后,模型选择器只列出当前套餐可用的模型;账户持有按需余额时会显示全部。",
3359
+ webSearch: "用 Command Code 承载联网搜索",
3360
+ webSearchHint: "开启后,dsh 的 web_search 工具由 Command Code 承担(复用同一个 API key 与地址);关闭则回退到 dsh 自带的 DeepSeek 搜索。",
3345
3361
  accountsTitle: "多账户轮换",
3346
3362
  accountsHint: "当前账户达到用量限额(429)或密钥失效(401)时,请求自动切换到下一个账户;全部耗尽时会提示最早的重置时间。",
3347
3363
  accountAdd: "添加账户",
@@ -3462,6 +3478,8 @@ window.__ModuleLoader__.load({
3462
3478
  advancedInvalid: "A number in Advanced settings is not ready to save; expand to fix it.",
3463
3479
  filterModelsByPlan: "Hide out-of-plan models",
3464
3480
  filterModelsByPlanHint: "When on, the model picker lists only models your subscription includes; any on-demand credit balance shows the full catalog.",
3481
+ webSearch: "Serve dsh web search with Command Code",
3482
+ webSearchHint: "When on, the model-facing web_search tool is backed by Command Code (same API key and base URL as chat). Off falls back to the shipped DeepSeek search.",
3465
3483
  accountsTitle: "Account rotation",
3466
3484
  accountsHint: "When the active account hits its usage limit (429) or its key fails (401), requests switch to the next account; when every account is exhausted the error names the earliest window reset.",
3467
3485
  accountAdd: "Add account",