@mars-sea/dsh-commandcode-provider 0.14.0 → 0.14.1
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 +36 -0
- package/README.md +18 -16
- package/README.zh-CN.md +6 -6
- package/lib/client.js +1 -1
- package/lib/index.d.ts +21 -5
- package/lib/index.js +103 -27
- package/lib/index.js.map +1 -1
- package/package.json +42 -41
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,42 @@ 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]
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- 同步 Command Code CLI `1.82.5` → `1.84.0`:请求版本标识(`x-command-code-version`)随之上调。这是**纯请求头同步**,不伴随运行时行为变更。官方日志两版共 8 条:`1.83.0`(2026-10-16)7 条**全部为 FEAT(新功能)**,集中在 CLI 的 mods 扩展体系——`panes`/`widgets`/`toasts`、mods 热重载、权限应答、会话记录脱敏、按请求路由模型、注入面 `{cmd.state,cmd.store,cmd.clock,cmd.model,cmd.prompt}` 与子代理类型、`/mods` 命令与 `cmd mods inspect`、`--safe-mode`(安全模式)、`hooks.transformTextDelta`、`cmd.process.spawn`、`cmd.ui.override`,另有一条「Planning and Implementation models follow the live model catalog」;`1.84.0` 仅 1 条,新增 `/statusline`。**四类关切(推理强度/ZDR/套餐与定价/协议)在官方条目中零命中**,且新增的 `/mods` 与 `/statusline` 都是本地 TUI(终端界面)命令而不是 API 路径,因此插件侧的协议面与数据面本身没有跟着变化。
|
|
12
|
+
|
|
13
|
+
- **产物级对照:`1.82.5` 与 `1.84.0` 的能力数据逐项相等。**两版 CLI 产物的模型注册表 100 条、efforts(推理档位)66 条、subscriptions(订阅表)9 条、ZDR 例外 24 条逐项相同,内嵌 `catalogVersion` 两版同为 `d6177bab…`;端点主机集合与自定义请求头集合零差异,因此版本号之外没有任何需要跟随的改动——`1.82.4` → `1.82.5` 那一轮把实时目录结果折回内嵌快照之后,`1.84.0` 没有再动这份快照。该结论来自产物级静态比对:官方日志的 8 条覆盖不到数据面,只有逐项比对才能排除"日志没写但数据动了"。
|
|
14
|
+
|
|
15
|
+
- 实时目录漂移与快照同步(`?view=client` 101 条,`catalogVersion` `e6fe850d…`;默认视图 93 条):`KNOWN_PLANS` 92 → 93、`KNOWN_EFFORTS` 64 → 65,两处新增的都是 `reflection/beam:free`(免费预览、Go 档、仅文本、五档 `low`/`medium`/`high`/`xhigh`/`max`);`KNOWN_NON_ZDR_MODELS` 24 → 25,撤出 `meituan/LongCat-2.0:free`、补入 `meituan/LongCat-2.0` 与 `reflection/beam:free`(目录对付费 id 判 `zdr:false`、对被撤下的 `:free` 行改判 `zdr:true`,属同一位置的改名而非覆盖变化);`KNOWN_DEALS` 6 → 7,新增 `reflection/beam:free` 免费促销。`KNOWN_IMAGE_MODELS` 保持 70 条不变——新模型只支持文本输入。目录 `catalogVersion` 由 `d6177bab…` 推进到 `e6fe850d…`,与产物内嵌快照之间的差距继续拉大,再次印证第七章第 9 条:内嵌快照发布后约两天即过期,同步一律以实时目录为准。
|
|
16
|
+
|
|
17
|
+
- 三张 id 表与 ZDR 例外表的收录口径本轮写进[《决策记录》第七章第 12 条](docs/决策记录.md#七上游快照同步边界):`KNOWN_PLANS`/`KNOWN_EFFORTS`/`KNOWN_IMAGE_MODELS` 只收**默认目录视图**(`GET /provider/v1/models`,本轮 93 个 id)里的 id,该视图不返回 `hidden` 字段、也没有隐藏行,8 个 `hidden:true` 行只存在于 `?view=client`,故天然不进入这三张表;`KNOWN_NON_ZDR_MODELS` 收 **artifact 排除集与 `?view=client` 目录 `zdr:false` 行的并集**(单源不完整,`reflection/beam:free` 就是只有目录侧提名的一例)。本轮 `reflection/beam:free` 在默认视图可见,因此 92 → 93 与口径自洽,不需要任何"CLI 注册表未认的行例外收录"式说明。
|
|
18
|
+
|
|
19
|
+
- 价格表与输出上限表重新生成:`deepseek-v4.1-flash` 与 `glm-5.3-flash` 两行的每月额度由 Go $10/GOAT $100/Pro $100 下调为 **Go $10/GOAT $80/Pro $90**,两行的费率不变(前者 $0.15/$0.6/$0.003,后者 $0.15/$0.5/$0.03)。`MODEL_OUTPUT_TOKEN_LIMITS` 新增 3 行(`deepseek/deepseek-v4-flash-fast` 384 000、`Qwen/Qwen3.8-Max-0902` 131 072、`tencent/hy3-paid` 128 000),写入数 75 → **78**。`reflection/beam:free` 按页面发布的字面零价,不进价格表。
|
|
20
|
+
|
|
21
|
+
- 复核**无变化**的项:峰谷计价仍是 5 个 DeepSeek 模型、窗口 `01–04 & 06–10 UTC, Mon–Fri` 与本地常量逐值一致;订阅条目与每月额度零变化;`reflection/beam:free` 支持图像输入这一点未被目录宣告,图像能力表保持 70 条;effort 词汇表仍是 `off|low|medium|high|xhigh|max`。
|
|
22
|
+
|
|
23
|
+
- **证据边界**:本轮 `scripts/` 巡检工具的状态为 `incomplete`、`readyToApply=false`、`protocol=not-verified`;唯一一条 error 是 `reflection/beam:free: absent from CLI registry`——该模型只出现在两个目录视图里,`1.84.0` 产物注册表完全不认它,因此 `KNOWN_EFFORTS` 与 `KNOWN_NON_ZDR_MODELS` 里这一行属**目录侧单源证据**(与 `1.82.4` 时 `stealth/cat-jam:free` 的处境相同)。16 个数据源全部返回 HTTP 200。**未做**:真实账号登录、付费生成、浏览器渲染验证,也没有在真实账号上验证价格与订阅额度的页面读数;`?view=client` 与定价页均为公开数据采集。
|
|
24
|
+
|
|
25
|
+
## [0.14.1] - 2026-10-18
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- **DSH 兼容矩阵反转为两引擎向下兼容 `0.2.0-rc.2 || 0.2.1-rc.2`**,撤销 `[0.14.0]` 的单一引擎收敛。官方 npm `latest` 至今仍指向 `0.2.0-rc.2`(2026-10-18 复核),`0.2.1-rc.2` 挂在 `next` 上,而宿主准入判定只读 `engines.dsh`——只声明 rc.2 会让走官方默认安装路径的用户被直接拒绝(插件行被预检禁用、作为 bundle 被静默跳过、`dsh plugin add` 在 pnpm 之前就拒绝,机制见[《决策记录》第八章第12条](docs/决策记录.md#八dsh-引擎兼容范围与验证边界))。`engines.dsh`、`dsh.compatibility.dsh`、15 个 `@deepseek-ai/dsh-*` 对等依赖与 19 个开发依赖同批回到析取式,`dsh.compatibility.dshReleases` 回到**两条记录**;两条记录**都是 RC**,alpha(早期测试版)通道不保留——自 `0.2.1-alpha.5` 之后没有新的已验证版本。每个分支仍必须是裸版本号,`0.2.0-rc.1`/`0.2.1-rc.1`/`0.3.0-alpha.1` 等相邻未验证版本继续被拒。`react ^18.2.0` 不变;`@deepseek-ai/cordis` 与 `@deepseek-ai/schemastery` 由 rc.2 轮次的单分支 `~4.0.5`/`~3.18.5` 恢复为**按引擎配对的析取式** `~4.0.4 || ~4.0.5`/`~3.18.4 || ~3.18.5`——两代引擎的配对不同(`0.2.0-rc.2` 随 cordis `~4.0.4`/schemastery `~3.18.4` 发布,`0.2.1-rc.2` 随正式版 `4.0.5`/`3.18.5` 发布),单分支解析不到旧引擎的配对,只适用于单引擎矩阵。反转理由、判据与 PR #93 的评审结论见[《决策记录》第八章第14条](docs/决策记录.md#八dsh-引擎兼容范围与验证边界)。
|
|
30
|
+
|
|
31
|
+
- **网页搜索的选择写入同时支持两种引擎形状。**rc.2 继续走官方易变写入面(`ctx.settings.update()`/`replace()`,写入 profile 的易变字段由 loader 原地提交,且不夺取他人显式选择、写后读回校验);pre-rc.2 引擎(含 `0.2.0-rc.2`)既没有该易变引用也没有 `web` 的设置行,选择是实例自有字段 `searchProviderId`,改为直写该字段,沿用既有「记住被顶掉的后端、只归还自己拿走的」语义——该值只存在于内存,随实例结束失效,且看不到用户层的他人显式选择。形状按每次观察解析,一个构建同时服务两个引擎;`tests/web-search.test.ts` 新增旧形状用例。
|
|
32
|
+
|
|
33
|
+
- **升级审计工具同步双引擎。**`.agents/skills/dsh-release-upgrade/` 的 `SKILL.md` 维护策略改为「官方默认安装版本(npm `latest`)必须可用 + 通道最新,不保留 alpha 通道」,与声明面口径一致;`scripts/collect.py` 的隐式 baseline 由「`package.json` 必须恰好一条 `dshReleases`」改为取其中 **semver 最大**者(升级审计总是从最新已验证引擎出发),并把实际选用值打到 stderr,`--baseline` 显式覆盖优先、空记录仍退出 2。技能单测 5/5 通过(新增 4 项:单条/两条取值、semver 排序、空记录报错、CLI 空清单退出 2)。
|
|
34
|
+
|
|
35
|
+
- 文档同步:两份 README、[对接说明](docs/对接说明.md)、[引擎兼容](docs/agent-reference/engine-compatibility.md)、[账号与重试](docs/agent-reference/accounts-and-retry.md)、[模型成本与性能分析](docs/模型成本与性能分析.md)、[决策记录](docs/决策记录.md)与[提交历史](docs/提交历史.md)。**验证**(本机静态与合成依赖):`npm run test:engine` 退出码 0,矩阵 **2/2**——关键行 `host compatibility preflight admits this plugin on dsh 0.2.0-rc.2` 与 `... on dsh 0.2.1-rc.2`,末行 `engine-load smoke passed on all 2 declared-compatible engines (0.2.0-rc.2, 0.2.1-rc.2)`;`npm run test:install` 退出码 0(pnpm `10.34.5`),输出 `isolated install passed with pnpm 10.34.5 (dsh 0.2.0-rc.2)` 与 `(dsh 0.2.1-rc.2)`。Cordis/Schemastery 改回析取式后**已重跑**,两次矩阵同为 **2/2**——一个引擎全绿不算通过,沿[《决策记录》第八章第2条](docs/决策记录.md#八dsh-引擎兼容范围与验证边界)。**未做**:真实浏览器渲染、真实账号登录、付费生成、跨平台与长期稳定性;真实引擎内的网络响应与凭据为合成依赖。**真实旧引擎(`0.2.0-rc.2`)上的端到端搜索选择写入未验证**——`test:engine` 只证明插件在该引擎上加载并通过宿主准入,不驱动 `webSearch` 开关,旧形状由单元级替身覆盖。
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- 修掉 `[0.14.0]` 引入的「按官方默认方式安装 dsh 的用户装不上本插件」:`0.2.0-rc.2` 仍是 npm `latest`(官方默认安装路径会跑的版本),本版本重新声明它。
|
|
40
|
+
|
|
41
|
+
- 补齐 `[0.14.0]` 漏改的两处引擎记录表述:[客户端与设置](docs/agent-reference/client-and-settings.md)与[仓库地图](docs/agent-reference/repository-map.md)此前写的 `dshReleases` 条数与当时的单引擎声明不一致,现按两条 RC 记录写明。
|
|
42
|
+
|
|
7
43
|
## [0.14.0] - 2026-10-18
|
|
8
44
|
|
|
9
45
|
### Added
|
package/README.md
CHANGED
|
@@ -37,17 +37,19 @@ See [Screenshots](#screenshots) below for what the UI looks like.
|
|
|
37
37
|
|
|
38
38
|
## Install
|
|
39
39
|
|
|
40
|
-
This release supports **dsh 0.2.1-rc.2
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`
|
|
50
|
-
|
|
40
|
+
This release supports **dsh 0.2.0-rc.2 and 0.2.1-rc.2** — two verified engines, both on the RC
|
|
41
|
+
(release-candidate) channel. `0.2.0-rc.2` is what npm `latest` still points at (re-checked
|
|
42
|
+
2026-10-18), so it is the engine an official default install runs; `0.2.1-rc.2` ships on the `next`
|
|
43
|
+
tag. The peer range and the compatibility records name both as exact versions, and no alpha release
|
|
44
|
+
is retained: nothing has been verified since `0.2.1-alpha.5`. `@deepseek-ai/cordis` /
|
|
45
|
+
`@deepseek-ai/schemastery` carry the paired disjunction `~4.0.4 || ~4.0.5` / `~3.18.4 || ~3.18.5`,
|
|
46
|
+
because the two engines pair differently (`0.2.0-rc.2` needs cordis `~4.0.4` and schemastery
|
|
47
|
+
`~3.18.4`, `0.2.1-rc.2` ships `4.0.5` / `3.18.5`) and one branch cannot resolve both. Note that
|
|
48
|
+
**dsh 0.2.1-rc.2 reads
|
|
49
|
+
`engines.dsh` alone** when it decides whether a plugin is compatible; the dsh peer ranges are
|
|
50
|
+
consulted only when that field is absent, so a build that declares the wrong `engines.dsh` is refused
|
|
51
|
+
outright there — while on `0.2.0-rc.2` the peer ranges are what decides. A profile on
|
|
52
|
+
`0.2.1-alpha.5` or any earlier release must upgrade its engine before installing this build:
|
|
51
53
|
|
|
52
54
|
```sh
|
|
53
55
|
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@latest
|
|
@@ -74,14 +76,14 @@ dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.15
|
|
|
74
76
|
|
|
75
77
|
The same applies to every profile you install into, including the terminal UI below.
|
|
76
78
|
|
|
77
|
-
Fresh pnpm 10 marketplace generations are supported directly. Every Harness package is declared by the plugin as a Host peer, so the active dsh profile remains their owner; do not add a separate dependency for any of them. The `@deepseek-ai/dsh-*` packages all declare
|
|
79
|
+
Fresh pnpm 10 marketplace generations are supported directly. Every Harness package is declared by the plugin as a Host peer, so the active dsh profile remains their owner; do not add a separate dependency for any of them. The `@deepseek-ai/dsh-*` packages all declare the same exact-version disjunction `0.2.0-rc.2 || 0.2.1-rc.2`; `@deepseek-ai/cordis` and `@deepseek-ai/schemastery` carry the paired disjunctions `~4.0.4 || ~4.0.5` and `~3.18.4 || ~3.18.5` instead, because publishing an engine rewrites both to the version that shipped alongside it and the two retained engines were published against different pairs. Upstream removed the `@deepseek-ai/dsh-invariants` package in `0.2.1-alpha.1`, so the plugin no longer declares it.
|
|
78
80
|
|
|
79
81
|
## Updating
|
|
80
82
|
|
|
81
83
|
Update with the same tag you installed with:
|
|
82
84
|
|
|
83
85
|
```sh
|
|
84
|
-
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest # dsh 0.2.1-rc.2
|
|
86
|
+
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest # dsh 0.2.0-rc.2 / 0.2.1-rc.2
|
|
85
87
|
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 # older dsh (0.5.0 line, unmaintained)
|
|
86
88
|
```
|
|
87
89
|
|
|
@@ -160,7 +162,7 @@ cmd login # writes ~/.commandcode/auth.json
|
|
|
160
162
|
cwd: !!js process.cwd()
|
|
161
163
|
```
|
|
162
164
|
|
|
163
|
-
**Engine version.** The plugin is maintained against **
|
|
165
|
+
**Engine version.** The plugin is maintained against **two verified engines: dsh `0.2.0-rc.2` and dsh `0.2.1-rc.2`**. Its `@deepseek-ai/dsh-*` peers use the exact-version disjunction `0.2.0-rc.2 || 0.2.1-rc.2`, while `@deepseek-ai/cordis` and `@deepseek-ai/schemastery` use the paired disjunctions `~4.0.4 || ~4.0.5` and `~3.18.4 || ~3.18.5` — one branch per engine, because `0.2.0-rc.2` was published against cordis `~4.0.4` / schemastery `~3.18.4` and `0.2.1-rc.2` against the stable `4.0.5` / `3.18.5`. Compatibility records contain exactly these two engines — both RC, with no alpha channel, because nothing has been verified since `0.2.1-alpha.5`. `0.2.0-rc.2` is retained deliberately even though it is the older of the two: it is still what npm `latest` resolves to, so a build that dropped it would be refused by the host's `engines.dsh` admission on every default install. Every declared branch must stay a bare version, so unverified neighbours (`0.2.0-rc.1`, `0.2.1-rc.1`, `0.3.0-alpha.1`) are still rejected. Both `npm run test:engine` and `npm run test:install` verify every declared engine in turn rather than one of them, and `test:engine` also calls that engine's own `evaluatePluginCompatibility` on the published manifest — from alpha.4 on, that verdict reads `engines.dsh` alone, so a wrong engine declaration fails there instead of only at install time. See [Install](#install) for older engines.
|
|
164
166
|
|
|
165
167
|
## Usage dashboard
|
|
166
168
|
|
|
@@ -258,10 +260,10 @@ On the CLI transport (`/alpha/generate`), a new image can make Command Code's re
|
|
|
258
260
|
|
|
259
261
|
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.
|
|
260
262
|
|
|
261
|
-
**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. On dsh 0.2.1-rc.2 this uses the official volatile-settings write path, so the change is committed into the running `web` entry in place rather than by remounting it. **When the official Web search settings already pin another backend, this toggle has no effect** — that explicit choice wins.
|
|
263
|
+
**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. On dsh 0.2.1-rc.2 this uses the official volatile-settings write path, so the change is committed into the running `web` entry in place rather than by remounting it; on 0.2.0-rc.2 the engine instead keeps its selection in an instance field with no settings surface, which the plugin assigns directly (memory-only, gone with the instance). **When the official Web search settings already pin another backend, this toggle has no effect** — that explicit choice wins; on 0.2.0-rc.2 there is no such settings row, so no pin can be seen and the toggle always takes over.
|
|
262
264
|
|
|
263
265
|
- The provider registers as `commandcode` on `ctx.web` only when the web service is present; without it this stays a chat-only plugin.
|
|
264
|
-
- The toggle selects `commandcode` through the engine's volatile-settings write path — the same `web.searchProvider` field the official **Web search** card's *Use the new Web Search API* switch writes (that switch also writes `fetchProvider`). The plugin **defers to an explicit choice already present in the user layer**: when the Web search settings pin another backend, it keeps `commandcode` registered but unselected and reports that state (the toggle's hint, plus a host log line) instead of overwriting it; it takes over only while nothing else pins the field, remembers the backend it displaced, and restores it when the toggle goes off or the plugin unloads. If you would rather pin the choice durably, set `searchProvider: commandcode` (or `$DSH_WEB_SEARCH_PROVIDER=commandcode`); that keeps working even if the runtime selection cannot be committed.
|
|
266
|
+
- The toggle selects `commandcode` through the engine's volatile-settings write path on `0.2.1-rc.2` — the same `web.searchProvider` field the official **Web search** card's *Use the new Web Search API* switch writes (that switch also writes `fetchProvider`). The plugin **defers to an explicit choice already present in the user layer**: when the Web search settings pin another backend, it keeps `commandcode` registered but unselected and reports that state (the toggle's hint, plus a host log line) instead of overwriting it; it takes over only while nothing else pins the field, remembers the backend it displaced, and restores it when the toggle goes off or the plugin unloads. On `0.2.0-rc.2` (and the alphas) the engine has neither that reference nor a `web` settings row, so the selection is its own `searchProviderId` field: the plugin assigns it in memory under the same "remember what we displaced, hand back only what we took" rule, and no other writer's pin is observable there. If you would rather pin the choice durably, set `searchProvider: commandcode` (or `$DSH_WEB_SEARCH_PROVIDER=commandcode`); that keeps working even if the runtime selection cannot be committed.
|
|
265
267
|
- `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`).
|
|
266
268
|
|
|
267
269
|
> 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
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
## 安装
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
本版本支持 **dsh 0.2.0-rc.2 与 0.2.1-rc.2 两个已验证引擎**,两者都在 RC(候选发布版)通道上。`0.2.0-rc.2` 至今仍是 npm `latest` 指向的版本(2026-10-18 复核),也就是官方默认安装会跑的那一版;`0.2.1-rc.2` 挂在 `next` 标签上。peer(对等依赖)范围与兼容记录把两者都写成精确版本;alpha(早期测试版)通道不保留——自 `0.2.1-alpha.5` 之后没有新的已验证版本。`@deepseek-ai/cordis` 与 `@deepseek-ai/schemastery` 写成按引擎配对的析取式 `~4.0.4 || ~4.0.5`/`~3.18.4 || ~3.18.5`——两代引擎的配对不同(`0.2.0-rc.2` 需要 cordis `~4.0.4` 与 schemastery `~3.18.4`,`0.2.1-rc.2` 随 `4.0.5`/`3.18.5` 发布),单分支覆盖不了两代。注意 **dsh 0.2.1-rc.2 判定插件兼容性时只读 `engines.dsh`**,dsh 对等依赖范围仅在该字段缺失时才被参考,因此 `engines.dsh` 声明错误会被它直接拒绝;而在 `0.2.0-rc.2` 上起作用的正是对等依赖范围。使用 `0.2.1-alpha.5` 或更早版本的配置需先升级引擎,再安装本构建:
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
41
|
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@latest
|
|
@@ -57,14 +57,14 @@ dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.15
|
|
|
57
57
|
|
|
58
58
|
这一点对每个 profile 都成立,包括下面的终端界面。
|
|
59
59
|
|
|
60
|
-
插件可直接在 pnpm 10 的全新插件市场 generation 中安装。所有 Harness 包都由插件声明为 Host peer,由当前 dsh profile 统一管理,不要另行添加 dependency。其中 `@deepseek-ai/dsh-*`
|
|
60
|
+
插件可直接在 pnpm 10 的全新插件市场 generation 中安装。所有 Harness 包都由插件声明为 Host peer,由当前 dsh profile 统一管理,不要另行添加 dependency。其中 `@deepseek-ai/dsh-*` 全部声明同一个精确版本析取式 `0.2.0-rc.2 || 0.2.1-rc.2`;`@deepseek-ai/cordis` 与 `@deepseek-ai/schemastery` 则写成按引擎配对的析取式 `~4.0.4 || ~4.0.5` 与 `~3.18.4 || ~3.18.5`——上游每次发引擎都会把这两个包重写成随引擎发布的版本,而两个保留引擎发布时的配对不同,单分支覆盖不了两代。上游曾在 `0.2.1-alpha.1` 删除 `@deepseek-ai/dsh-invariants` 这个包,因此插件不再声明它。
|
|
61
61
|
|
|
62
62
|
## 更新
|
|
63
63
|
|
|
64
64
|
用与安装时相同的 tag 更新:
|
|
65
65
|
|
|
66
66
|
```sh
|
|
67
|
-
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest # dsh 0.2.1-rc.2
|
|
67
|
+
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest # dsh 0.2.0-rc.2 / 0.2.1-rc.2
|
|
68
68
|
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 # 更早的 dsh(0.5.0 线,不再维护)
|
|
69
69
|
```
|
|
70
70
|
|
|
@@ -143,7 +143,7 @@ cmd login # 写入 ~/.commandcode/auth.json
|
|
|
143
143
|
cwd: !!js process.cwd()
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
**引擎版本要求。**
|
|
146
|
+
**引擎版本要求。** 插件维护**两个已验证引擎:dsh `0.2.0-rc.2` 与 dsh `0.2.1-rc.2`**。`@deepseek-ai/dsh-*` 的 peer(对等依赖)为精确版本析取式 `0.2.0-rc.2 || 0.2.1-rc.2`;`@deepseek-ai/cordis` 与 `@deepseek-ai/schemastery` 使用按引擎配对的析取式 `~4.0.4 || ~4.0.5` 与 `~3.18.4 || ~3.18.5`——每个分支对应一代引擎的配对:`0.2.0-rc.2` 随 cordis `~4.0.4`/schemastery `~3.18.4` 发布,`0.2.1-rc.2` 随正式版 `4.0.5`/`3.18.5` 发布。兼容记录恰好包含这两个引擎——**两条都是 RC,不含 alpha 通道**,因为自 `0.2.1-alpha.5` 之后没有新的已验证版本。`0.2.0-rc.2` 虽然更旧,但被有意保留:它仍是 npm `latest` 解析到的版本,去掉它会让跑默认安装的宿主用 `engines.dsh` 准入直接拒绝本插件。每个分支仍必须是裸版本号,`0.2.0-rc.1`、`0.2.1-rc.1`、`0.3.0-alpha.1` 等未验证的邻近版本继续被拒。`npm run test:engine` 与 `npm run test:install` 对每个已声明引擎各跑一遍而不是只跑其中一个,前者还会用该引擎自己的 `evaluatePluginCompatibility` 对发布清单求值——自 alpha.4 起该判定只读 `engines.dsh`,因此引擎声明写错会在这一步失败,而不是拖到安装时才暴露。旧引擎安装说明见[安装](#安装)。
|
|
147
147
|
|
|
148
148
|
## 用量面板
|
|
149
149
|
|
|
@@ -241,10 +241,10 @@ llm-commandcode:
|
|
|
241
241
|
|
|
242
242
|
当你的 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、端点或模型。
|
|
243
243
|
|
|
244
|
-
**默认开启。** 插件的 **设置 → Command Code** 页里有一个「用 Command Code 承载联网搜索」开关(`webSearch`,默认开)。开启时插件会自动把 `commandcode` 选为当前搜索后端;关闭则把选择权交还给之前的后端(比如 modsearch 等其他搜索插件可继续工作——不会被强制回退到 dsh 自带的 DeepSeek 搜索)。该开关在**下一次搜索时生效**,无需重启;在 dsh 0.2.1-rc.2 上它走官方易变设置写入路径,改动原地提交进运行中的 `web`
|
|
244
|
+
**默认开启。** 插件的 **设置 → Command Code** 页里有一个「用 Command Code 承载联网搜索」开关(`webSearch`,默认开)。开启时插件会自动把 `commandcode` 选为当前搜索后端;关闭则把选择权交还给之前的后端(比如 modsearch 等其他搜索插件可继续工作——不会被强制回退到 dsh 自带的 DeepSeek 搜索)。该开关在**下一次搜索时生效**,无需重启;在 dsh 0.2.1-rc.2 上它走官方易变设置写入路径,改动原地提交进运行中的 `web` 条目,而不是重挂载该条目;在 0.2.0-rc.2 上引擎把选择放在一个没有设置面的实例字段里,插件直接赋值(只存在于内存,随实例结束失效)。**若官方「网页搜索」设置里已显式选择其他后端,本开关不生效**——那个显式选择优先;0.2.0-rc.2 上没有这一设置行,看不到他人的 pin,因此开关总是接管。
|
|
245
245
|
|
|
246
246
|
- 该 provider 仅在 web 服务存在时以 `commandcode` 注册进 `ctx.web`;没有它,本插件仍是纯聊天插件。
|
|
247
|
-
-
|
|
247
|
+
- 开关在 `0.2.1-rc.2` 上通过引擎的易变设置写入路径选中 `commandcode`(写的就是官方「Web 搜索」卡片里「启用新版 Web 搜索 API」开关所用的同一个 `web.searchProvider` 字段,该开关还会一并写 `fetchProvider`)。插件**尊重用户层已有的显式选择**:当「网页搜索」设置已 pin 其他后端时,它让 `commandcode` 保持已注册但未被选中,并把这一状态报出来(开关的提示文案,外加一行宿主日志),而不是覆盖对方;只有在没人 pin 该字段时才接管,并记住被顶掉的后端,在关闭开关或卸载插件时恢复。`0.2.0-rc.2`(以及各 alpha)既没有该易变引用也没有 `web` 的设置行,选择是引擎自己的 `searchProviderId` 实例字段:插件按同一套「记住被顶掉的后端、只归还自己拿走的」规则直写内存,也看不到其他写者的 pin。若你想更稳妥地固定,可设置 `searchProvider: commandcode`(或 `$DSH_WEB_SEARCH_PROVIDER=commandcode`);即使运行时选择无法提交,该配置仍然生效。
|
|
248
248
|
- dsh 工具的 `numResults` 会被收敛到 Command Code 的取值范围(1–10,默认 5);结果映射为 dsh 的 `WebSearchSource` 结构(`url`/`title`/`snippet`)。
|
|
249
249
|
|
|
250
250
|
> 这里直接使用 Command Code Provider API(与官方 CLI 内置的 `web_search` 相同),因此与 DeepSeek 原生搜索后端不同。
|
package/lib/client.js
CHANGED
|
@@ -3702,7 +3702,7 @@ window.__ModuleLoader__.load({
|
|
|
3702
3702
|
}
|
|
3703
3703
|
//#endregion
|
|
3704
3704
|
//#region package.json
|
|
3705
|
-
var version = "0.14.
|
|
3705
|
+
var version = "0.14.1";
|
|
3706
3706
|
var repository = {
|
|
3707
3707
|
"type": "git",
|
|
3708
3708
|
"url": "git+https://github.com/Mars-Sea/dsh-commandcode-provider.git"
|
package/lib/index.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ type CommandCodeProtocol = 'cli' | 'openai' | 'messages';
|
|
|
61
61
|
declare const DEFAULT_MAX_OUTPUT_TOKENS = 131072;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/adapter.d.ts
|
|
64
|
-
declare const COMMAND_CODE_CLI_VERSION = "1.
|
|
64
|
+
declare const COMMAND_CODE_CLI_VERSION = "1.84.0";
|
|
65
65
|
declare const DEFAULT_API_BASE = "https://api.commandcode.ai";
|
|
66
66
|
/**
|
|
67
67
|
* The output budget this bundle asks for, and the ceiling it will never exceed.
|
|
@@ -1073,9 +1073,13 @@ declare const KNOWN_IMAGE_MODELS: ReadonlySet<string>;
|
|
|
1073
1073
|
* what the current CLI says.
|
|
1074
1074
|
*
|
|
1075
1075
|
* 1.82.4 then reversed 1.74.1's removal of `meituan/LongCat-2.0:free` and added
|
|
1076
|
-
* the `stealth/cat-jam:free` preview, taking this set to 24 members
|
|
1077
|
-
*
|
|
1078
|
-
*
|
|
1076
|
+
* the `stealth/cat-jam:free` preview, taking this set to 24 members. The 1.84.0
|
|
1077
|
+
* sync (2026-10-16) moves it to 25 with no verdict flip: LongCat's exclusion
|
|
1078
|
+
* followed its rename to the paid id, and the free `reflection/beam:free`
|
|
1079
|
+
* preview joined on catalog evidence alone. The authoritative membership is the
|
|
1080
|
+
* UNION of the artifact's exclusion set and the catalog's `zdr:false` list —
|
|
1081
|
+
* neither source alone is complete, which is why this set is not simply "what
|
|
1082
|
+
* the CLI says".
|
|
1079
1083
|
*/
|
|
1080
1084
|
declare const KNOWN_NON_ZDR_MODELS: ReadonlySet<string>;
|
|
1081
1085
|
/**
|
|
@@ -2003,7 +2007,7 @@ interface CommandCodeSearchSelection {
|
|
|
2003
2007
|
declare function commandCodeSearchSelection(): CommandCodeSearchSelection;
|
|
2004
2008
|
/** Dependencies {@link createCommandCodeSearchSelection} resolves per call. */
|
|
2005
2009
|
interface WebSearchSelectionDeps {
|
|
2006
|
-
/** The running `web` service whose
|
|
2010
|
+
/** The running `web` service whose selection field backs the degraded write. */
|
|
2007
2011
|
web: WebRuntime;
|
|
2008
2012
|
/** Host settings service, resolved per use because it may activate after `web`. */
|
|
2009
2013
|
settings: () => WebSelectionSettings | undefined;
|
|
@@ -2037,6 +2041,18 @@ interface WebSearchSelectionHandle {
|
|
|
2037
2041
|
* it first and falls back to the reference only when settings is unavailable or
|
|
2038
2042
|
* refuses (see `volatileWrite`).
|
|
2039
2043
|
*
|
|
2044
|
+
* ## Two engine shapes
|
|
2045
|
+
*
|
|
2046
|
+
* Everything above describes an rc.2+ runtime, where the selection is a
|
|
2047
|
+
* reference. PRE-rc.2 engines (0.2.0-rc.2 and the 0.2.1 alphas) have neither
|
|
2048
|
+
* that reference nor a settings row for `web`: there the selection is the
|
|
2049
|
+
* private instance field `searchProviderId`, memory-only by nature. Those
|
|
2050
|
+
* engines therefore run the degraded path BY CONSTRUCTION — no profile write
|
|
2051
|
+
* exists for it and the user layer is unreadable, so a foreign pin cannot be
|
|
2052
|
+
* seen and the takeover/restore semantics are the ones this plugin shipped
|
|
2053
|
+
* before rc.2: remember the displaced backend, hand back only what we took. The
|
|
2054
|
+
* shape is resolved per observation, so one build serves both.
|
|
2055
|
+
*
|
|
2040
2056
|
* ## Two writers, one field
|
|
2041
2057
|
*
|
|
2042
2058
|
* The shipped web-search settings page writes `web.searchProvider` too
|
package/lib/index.js
CHANGED
|
@@ -103,7 +103,7 @@ const PLAN_ORDER = Object.fromEntries(PLAN_TIER_ORDER.map((tier, index) => [tier
|
|
|
103
103
|
* subscription-plan labels, deals, and hourly (peak/off-peak) pricing.
|
|
104
104
|
*
|
|
105
105
|
* Everything here is synced from official sources — the command-code CLI
|
|
106
|
-
* bundle's model table (`dist/cli.mjs`, re-verified at command-code@1.
|
|
106
|
+
* bundle's model table (`dist/cli.mjs`, re-verified at command-code@1.84.0) and
|
|
107
107
|
* the official plan/pricing/model docs; see the dsh-commandcode-upstream skill
|
|
108
108
|
* for the extraction procedures. Keeping the snapshot in its own module
|
|
109
109
|
* confines those frequent sync diffs here: src/adapter.ts holds only the stable
|
|
@@ -315,6 +315,13 @@ const KNOWN_EFFORTS = {
|
|
|
315
315
|
"medium",
|
|
316
316
|
"high"
|
|
317
317
|
],
|
|
318
|
+
"reflection/beam:free": [
|
|
319
|
+
"low",
|
|
320
|
+
"medium",
|
|
321
|
+
"high",
|
|
322
|
+
"xhigh",
|
|
323
|
+
"max"
|
|
324
|
+
],
|
|
318
325
|
"sakana/fugu-ultra": ["high", "xhigh"],
|
|
319
326
|
"stepfun/Step-5-Preview": [
|
|
320
327
|
"low",
|
|
@@ -622,9 +629,13 @@ const KNOWN_IMAGE_MODELS = /* @__PURE__ */ new Set([
|
|
|
622
629
|
* what the current CLI says.
|
|
623
630
|
*
|
|
624
631
|
* 1.82.4 then reversed 1.74.1's removal of `meituan/LongCat-2.0:free` and added
|
|
625
|
-
* the `stealth/cat-jam:free` preview, taking this set to 24 members
|
|
626
|
-
*
|
|
627
|
-
*
|
|
632
|
+
* the `stealth/cat-jam:free` preview, taking this set to 24 members. The 1.84.0
|
|
633
|
+
* sync (2026-10-16) moves it to 25 with no verdict flip: LongCat's exclusion
|
|
634
|
+
* followed its rename to the paid id, and the free `reflection/beam:free`
|
|
635
|
+
* preview joined on catalog evidence alone. The authoritative membership is the
|
|
636
|
+
* UNION of the artifact's exclusion set and the catalog's `zdr:false` list —
|
|
637
|
+
* neither source alone is complete, which is why this set is not simply "what
|
|
638
|
+
* the CLI says".
|
|
628
639
|
*/
|
|
629
640
|
const KNOWN_NON_ZDR_MODELS = /* @__PURE__ */ new Set([
|
|
630
641
|
"MiniMaxAI/MiniMax-M3",
|
|
@@ -636,9 +647,10 @@ const KNOWN_NON_ZDR_MODELS = /* @__PURE__ */ new Set([
|
|
|
636
647
|
"meta/muse-spark-1.3",
|
|
637
648
|
"meta/muse-spark-1.3-contributor",
|
|
638
649
|
"meta/muse-wonder-1.0",
|
|
639
|
-
"meituan/LongCat-2.0
|
|
650
|
+
"meituan/LongCat-2.0",
|
|
640
651
|
"minimax/minimax-m3-free",
|
|
641
652
|
"poolside/laguna-s-2.1-free",
|
|
653
|
+
"reflection/beam:free",
|
|
642
654
|
"sakana/fugu-ultra",
|
|
643
655
|
"stealth/glyph-cluster:free",
|
|
644
656
|
"stealth/cat-jam:free",
|
|
@@ -792,6 +804,7 @@ const MODEL_OUTPUT_TOKEN_LIMITS = /* @__PURE__ */ new Map([
|
|
|
792
804
|
["claude-sonnet-5", 128e3],
|
|
793
805
|
["claude-sonnet-5-5", 128e3],
|
|
794
806
|
["deepseek/deepseek-v4-flash", 393216],
|
|
807
|
+
["deepseek/deepseek-v4-flash-fast", 384e3],
|
|
795
808
|
["deepseek/deepseek-v4-flash-vision-exp", 393216],
|
|
796
809
|
["deepseek/deepseek-v4-pro", 393216],
|
|
797
810
|
["google/gemini-3.1-flash-lite", 65536],
|
|
@@ -835,11 +848,13 @@ const MODEL_OUTPUT_TOKEN_LIMITS = /* @__PURE__ */ new Map([
|
|
|
835
848
|
["Qwen/Qwen3.7-Plus", 131072],
|
|
836
849
|
["Qwen/Qwen3.8-Flash", 131072],
|
|
837
850
|
["Qwen/Qwen3.8-Max", 131072],
|
|
851
|
+
["Qwen/Qwen3.8-Max-0902", 131072],
|
|
838
852
|
["Qwen/Qwen3.8-Omni-Flash", 131072],
|
|
839
853
|
["sakana/fugu-ultra", 1e6],
|
|
840
854
|
["stepfun/Step-3.5-Flash", 256e3],
|
|
841
855
|
["stepfun/Step-3.7-Flash", 256e3],
|
|
842
856
|
["stepfun/Step-5-Preview", 65536],
|
|
857
|
+
["tencent/hy3-paid", 128e3],
|
|
843
858
|
["thinkingmachines/inkling", 65536],
|
|
844
859
|
["xai/grok-4.5", 5e5],
|
|
845
860
|
["xai/grok-4.6", 5e5],
|
|
@@ -923,6 +938,7 @@ const KNOWN_PLANS = {
|
|
|
923
938
|
"nvidia/nemotron-3-ultra-550b-a55b": "go",
|
|
924
939
|
"nvidia/nemotron-3.5-super-vl": "go",
|
|
925
940
|
"poolside/laguna-s-2.1-free": "go",
|
|
941
|
+
"reflection/beam:free": "go",
|
|
926
942
|
"stepfun/Step-3.5-Flash": "go",
|
|
927
943
|
"stepfun/Step-3.7-Flash": "go",
|
|
928
944
|
"stepfun/Step-5-Preview": "go",
|
|
@@ -1119,6 +1135,10 @@ const KNOWN_DEALS = {
|
|
|
1119
1135
|
label: "FREE",
|
|
1120
1136
|
free: true
|
|
1121
1137
|
},
|
|
1138
|
+
"reflection/beam:free": {
|
|
1139
|
+
label: "FREE",
|
|
1140
|
+
free: true
|
|
1141
|
+
},
|
|
1122
1142
|
"stealth/cat-jam:free": {
|
|
1123
1143
|
label: "FREE",
|
|
1124
1144
|
free: true
|
|
@@ -1563,8 +1583,8 @@ const MODEL_PRICE_ROWS = [
|
|
|
1563
1583
|
],
|
|
1564
1584
|
allowance: {
|
|
1565
1585
|
go: 10,
|
|
1566
|
-
goat:
|
|
1567
|
-
pro:
|
|
1586
|
+
goat: 80,
|
|
1587
|
+
pro: 90
|
|
1568
1588
|
}
|
|
1569
1589
|
},
|
|
1570
1590
|
{
|
|
@@ -1764,8 +1784,8 @@ const MODEL_PRICE_ROWS = [
|
|
|
1764
1784
|
],
|
|
1765
1785
|
allowance: {
|
|
1766
1786
|
go: 10,
|
|
1767
|
-
goat:
|
|
1768
|
-
pro:
|
|
1787
|
+
goat: 80,
|
|
1788
|
+
pro: 90
|
|
1769
1789
|
}
|
|
1770
1790
|
},
|
|
1771
1791
|
{
|
|
@@ -6278,7 +6298,7 @@ var GatewayFacts = class {
|
|
|
6278
6298
|
* per-request options thunk and an API-key resolver from the plugin entry
|
|
6279
6299
|
* (src/index.ts), so a settings change reaches the very next request.
|
|
6280
6300
|
*/
|
|
6281
|
-
const COMMAND_CODE_CLI_VERSION = "1.
|
|
6301
|
+
const COMMAND_CODE_CLI_VERSION = "1.84.0";
|
|
6282
6302
|
const DEFAULT_API_BASE = "https://api.commandcode.ai";
|
|
6283
6303
|
/**
|
|
6284
6304
|
* The output budget this bundle asks for, and the ceiling it will never exceed.
|
|
@@ -10464,10 +10484,13 @@ function unwrapVolatileConfig(config) {
|
|
|
10464
10484
|
* the model-facing `web_search` tool needs no separate configuration.
|
|
10465
10485
|
*
|
|
10466
10486
|
* The second half of this module is the SELECTION seam: which registered search
|
|
10467
|
-
* backend `ctx.web` actually runs.
|
|
10468
|
-
*
|
|
10469
|
-
*
|
|
10470
|
-
*
|
|
10487
|
+
* backend `ctx.web` actually runs. That seam has TWO engine shapes, and both are
|
|
10488
|
+
* supported. dsh 0.2.1-rc.2 turned the choice into a per-call `Volatile` field of
|
|
10489
|
+
* the `web` profile entry, so it is changed through the host settings service
|
|
10490
|
+
* rather than by assigning a runtime field. Engines up to and including
|
|
10491
|
+
* 0.2.1-alpha.4 kept it in the private instance field `searchProviderId`, which
|
|
10492
|
+
* has no settings surface and can only be assigned in memory — see
|
|
10493
|
+
* {@link createCommandCodeSearchSelection}.
|
|
10471
10494
|
*
|
|
10472
10495
|
* @module dsh-commandcode-provider/web-search
|
|
10473
10496
|
*/
|
|
@@ -10530,6 +10553,29 @@ function selectionRow(settings) {
|
|
|
10530
10553
|
function searchProviderRef(web) {
|
|
10531
10554
|
return member(member(web, "config"), "searchProvider");
|
|
10532
10555
|
}
|
|
10556
|
+
/**
|
|
10557
|
+
* The pre-rc.2 instance field, or `undefined` when this runtime does not carry
|
|
10558
|
+
* it.
|
|
10559
|
+
*
|
|
10560
|
+
* An OWN property is the discriminator, not a value test: a runtime of the
|
|
10561
|
+
* reference shape never has `searchProviderId` at all, so the two shapes cannot
|
|
10562
|
+
* both answer and neither needs to be preferred over the other.
|
|
10563
|
+
*/
|
|
10564
|
+
function legacySearchField(web) {
|
|
10565
|
+
if (!Object.prototype.hasOwnProperty.call(web, "searchProviderId")) return void 0;
|
|
10566
|
+
const shaped = web;
|
|
10567
|
+
return {
|
|
10568
|
+
read: () => text(shaped.searchProviderId),
|
|
10569
|
+
write: (value) => {
|
|
10570
|
+
try {
|
|
10571
|
+
shaped.searchProviderId = value;
|
|
10572
|
+
return true;
|
|
10573
|
+
} catch {
|
|
10574
|
+
return false;
|
|
10575
|
+
}
|
|
10576
|
+
}
|
|
10577
|
+
};
|
|
10578
|
+
}
|
|
10533
10579
|
/** Observe the live selection; `undefined` when nothing can be observed. */
|
|
10534
10580
|
function readView(deps) {
|
|
10535
10581
|
const settings = deps.settings();
|
|
@@ -10547,16 +10593,26 @@ function readView(deps) {
|
|
|
10547
10593
|
}
|
|
10548
10594
|
}
|
|
10549
10595
|
const ref = searchProviderRef(deps.web);
|
|
10550
|
-
if (
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10596
|
+
if (isVolatileRef(ref)) {
|
|
10597
|
+
let current;
|
|
10598
|
+
try {
|
|
10599
|
+
current = ref.get();
|
|
10600
|
+
} catch {
|
|
10601
|
+
return;
|
|
10602
|
+
}
|
|
10603
|
+
if (current !== void 0 && typeof current !== "string") return void 0;
|
|
10604
|
+
return {
|
|
10605
|
+
configured: current,
|
|
10606
|
+
pinned: void 0,
|
|
10607
|
+
base: void 0,
|
|
10608
|
+
user: {},
|
|
10609
|
+
persistent: false
|
|
10610
|
+
};
|
|
10556
10611
|
}
|
|
10557
|
-
|
|
10612
|
+
const legacy = legacySearchField(deps.web);
|
|
10613
|
+
if (legacy === void 0) return void 0;
|
|
10558
10614
|
return {
|
|
10559
|
-
configured:
|
|
10615
|
+
configured: legacy.read(),
|
|
10560
10616
|
pinned: void 0,
|
|
10561
10617
|
base: void 0,
|
|
10562
10618
|
user: {},
|
|
@@ -10579,6 +10635,18 @@ function readView(deps) {
|
|
|
10579
10635
|
* it first and falls back to the reference only when settings is unavailable or
|
|
10580
10636
|
* refuses (see `volatileWrite`).
|
|
10581
10637
|
*
|
|
10638
|
+
* ## Two engine shapes
|
|
10639
|
+
*
|
|
10640
|
+
* Everything above describes an rc.2+ runtime, where the selection is a
|
|
10641
|
+
* reference. PRE-rc.2 engines (0.2.0-rc.2 and the 0.2.1 alphas) have neither
|
|
10642
|
+
* that reference nor a settings row for `web`: there the selection is the
|
|
10643
|
+
* private instance field `searchProviderId`, memory-only by nature. Those
|
|
10644
|
+
* engines therefore run the degraded path BY CONSTRUCTION — no profile write
|
|
10645
|
+
* exists for it and the user layer is unreadable, so a foreign pin cannot be
|
|
10646
|
+
* seen and the takeover/restore semantics are the ones this plugin shipped
|
|
10647
|
+
* before rc.2: remember the displaced backend, hand back only what we took. The
|
|
10648
|
+
* shape is resolved per observation, so one build serves both.
|
|
10649
|
+
*
|
|
10582
10650
|
* ## Two writers, one field
|
|
10583
10651
|
*
|
|
10584
10652
|
* The shipped web-search settings page writes `web.searchProvider` too
|
|
@@ -10612,11 +10680,19 @@ function createCommandCodeSearchSelection(deps) {
|
|
|
10612
10680
|
deps.logger.info(message);
|
|
10613
10681
|
} catch {}
|
|
10614
10682
|
};
|
|
10615
|
-
/**
|
|
10683
|
+
/**
|
|
10684
|
+
* Commit the selection in memory; the last resort before giving up.
|
|
10685
|
+
*
|
|
10686
|
+
* The volatile reference is tried first because on an rc.2+ runtime that is
|
|
10687
|
+
* what `search()` reads. A PRE-rc.2 runtime carries no reference at all, and
|
|
10688
|
+
* there the private instance field IS the seam — the fallback is a different
|
|
10689
|
+
* engine shape, not a second-best copy of the same write.
|
|
10690
|
+
*/
|
|
10616
10691
|
const memoryWrite = (value) => {
|
|
10617
|
-
|
|
10618
|
-
if (
|
|
10619
|
-
|
|
10692
|
+
if (volatileWrite(searchProviderRef(deps.web), value)) return true;
|
|
10693
|
+
if (legacySearchField(deps.web)?.write(value) === true) return true;
|
|
10694
|
+
warn("llm-commandcode: web search selection could not be applied (settings refused the write and the running web runtime is not writable); the provider stays registered but unselected");
|
|
10695
|
+
return false;
|
|
10620
10696
|
};
|
|
10621
10697
|
/** Run one intent against a FRESH observation; never throws. */
|
|
10622
10698
|
const perform = async (intent) => {
|
|
@@ -10716,7 +10792,7 @@ function createCommandCodeSearchSelection(deps) {
|
|
|
10716
10792
|
}
|
|
10717
10793
|
state.foreign = void 0;
|
|
10718
10794
|
if (view.configured === "commandcode") {
|
|
10719
|
-
state.owner = view.pinned ===
|
|
10795
|
+
state.owner = view.pinned === "commandcode" || !view.persistent && state.owner;
|
|
10720
10796
|
state.preexisting = !state.owner;
|
|
10721
10797
|
if (state.owner && state.displaced === void 0) state.displaced = view.base;
|
|
10722
10798
|
return;
|