@maricgeer/dsh-websearch 0.1.3 → 0.2.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/README.en.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # dsh-websearch
2
2
 
3
+ > **Document split**: the plugin page shows [docs/plugin-page.en.md](docs/plugin-page.en.md) (named by the locale `meta.detail`; a Chinese UI reads [docs/plugin-page.zh.md](docs/plugin-page.zh.md)); this README is for development, installation and acceptance.
4
+ >
3
5
  > **Language authority**: This file mirrors `README.md` (Chinese), which is the factual source of truth; when the two disagree, the Chinese file wins.
4
- > Version line: from **v0.1.0** (ADR-0020). Internal dev numbers 0.2.0–0.9.0 are archived history — see CHANGELOG.
6
+ > Version line: from v0.1.0 (ADR-0020); **v0.2.0 = the DNS resilience layer** (ADR-0022 — a major architecture subsystem, the 0.2.x bump per ADR-0020). Internal dev numbers 0.2.0–0.9.0 are archived history — see CHANGELOG.
5
7
 
6
- `dsh-websearch` is an out-of-tree unified web-search management plugin for [deepseek-harness](https://github.com/) (`dsh`): zero host modification. It consolidates multiple search providers into one standard plugin with a user-configurable priority chain, full high-availability degradation, a multi-API-key pool, unified web_fetch takeover, and a settings-page GUI.
8
+ `dsh-websearch` is an out-of-tree unified web-search management plugin for deepseek-harness (`dsh`): zero host modification. It consolidates multiple search providers into one standard plugin with a user-configurable priority chain, full high-availability degradation, a multi-API-key pool, unified web_fetch takeover, and a settings-page GUI.
7
9
 
8
10
  **Member admission bar** (ADR-0017): high availability + a free tier + multi-API-key support + upstream-aligned feature implementation.
9
11
 
@@ -17,13 +19,15 @@
17
19
 
18
20
  ## Quick start
19
21
 
20
- > ⚠️ **Known upstream host issue (not this plugin)**: host `dsh` **0.1.6-alpha.2** has a host-side tool-scheduling defect — every tool call (including shell/web_search) crashes with `TOOL_RUNTIME_SCHEDULER.prepare`, reproducible in a plugin-free environment. Avoid that host version (use 0.1.5-rc.x / 0.1.6-alpha.1 / 0.1.7-alpha.x) or wait for the upstream fix. See the drill matrix in [docs/upgrade.md](docs/upgrade.md).
22
+ > ⚠️ **Known upstream host issues (not this plugin)** — see **[docs/known-upstream-issues.md](docs/known-upstream-issues.md)** (in Chinese; symptoms/affected versions/workarounds/self-check commands):
23
+ > 1. `dsh` **0.1.6-alpha.2**: every tool call crashes with `TOOL_RUNTIME_SCHEDULER.prepare` — avoid that version (use 0.1.5-rc.x / 0.1.6-alpha.1 / 0.1.7+).
24
+ > 2. `dsh` **0.1.7-alpha.2/rc.1 (half-fixed in rc.2)**: with tsx source launches the host logs `Plugin metadata … TypeError: Cannot assign to read only property 'stack'` at startup — npm-installed / built-output users are unaffected; source-launch users can use the [fork fix branch](https://github.com/GeerMrc/deepseek-harness/tree/fix/readonly-stack-rc2).
21
25
 
22
- Prereqs: host `dsh` >= 0.1.5-rc.1 (peer range `>=0.1.5-rc.1 <0.1.8 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2`, S32 full span — each rehearsed pre-release pinned explicitly), node >= 22.19.
26
+ Prereqs: host `dsh` >= 0.1.5-rc.1 (peer range `>=0.1.5-rc.1 <0.1.8 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.2-rc.5 || >=0.2.0 <0.3.0` (S32/S33/S38/S41 full span — each rehearsed pre-release pinned explicitly, except that 0.2.2-rc.5 has so far only been exercised for install and the takeover switch, its search and fetch leg still to do; the range is guarded under both semver semantics by `tests/peer-range.spec.ts`; the 0.1.8 stable line stays excluded. The host compatibility gate admits 0.2.x pre-releases through `includePrerelease`, so an explicit pin records "rehearsed" rather than gating admission — see ADR-0027)), node >= 22.19.
23
27
 
24
28
  ```sh
25
29
  # 1. Pack (repo root)
26
- pnpm install && pnpm run build && npm pack # produces dsh-websearch-<version>.tgz
30
+ pnpm install && pnpm run build && node scripts/pack.mjs # dual tarballs: bare dsh-websearch-<ver>.tgz (profile installs) + scoped (npm)
27
31
 
28
32
  # 2. Install into the web profile (install-driven takeover, ADR-0013)
29
33
  dsh plugin --profile web add /path/to/dsh-websearch-<version>.tgz
@@ -34,14 +38,14 @@ dsh --profile web --dump-config
34
38
  # dsh-websearch insert row appears
35
39
  ```
36
40
 
37
- **Install-driven takeover**: the plugin ships a `cordis.patch.yml` pinning `searchProvider: dshws-chain` and `fetchProvider: dshws-fetch-gate` — `plugin add` takes over in one command; `plugin remove` fully restores (zero dump diff). No user-layer patch needed.
41
+ **Install-driven takeover**: the plugin ships a `cordis.patch.yml` pinning `searchProvider: dshws-chain` and `fetchProvider: dshws-fetch-gate`, and hides the built-in "Web search and fetch" settings page while it is enabled (ADR-0024) — `plugin add` takes over in one command; disabling or uninstalling the plugin restores the composition and that page (measured on 0.2.2-rc.5 through the Plugins-page switch; a command-line uninstall was measured separately on rc.5). No user-layer patch needed. A `web` selection saved separately in the user layer is mostly not removed when the plugin is disabled and is not removed on uninstall; see the FAQ.
38
42
 
39
43
  **Uninstall**: `dsh plugin --profile web remove dsh-websearch`. Known residue (honest disclosure): settings defaults and preset directories are not cleaned by remove (harmless; user-authored same-name directories are never overwritten).
40
44
 
41
45
 
42
46
  ## Install, upgrade, and notes
43
47
 
44
- **Install** (peer range as above — covers the 0.1.5-rc line, the 0.1.6 and 0.1.7 pre-release lines, and future 0.1.6/0.1.7 stables, capped below 0.1.8):
48
+ **Install** (peer range as above — covers the 0.1.5-rc line, the 0.1.6/0.1.7 pre-release and stable lines, the 0.2.0-rc line, 0.2.2-rc.5, and 0.2.x stables; 0.1.8 and 0.3.x excluded):
45
49
 
46
50
  Option 1 (npm registry, recommended):
47
51
 
@@ -56,14 +60,16 @@ dsh plugin --profile web add @maricgeer/dsh-websearch
56
60
  dsh plugin --profile web add <dsh-websearch-tarball>
57
61
  # Option 2: pack from source
58
62
  git clone https://github.com/GeerMrc/dsh-websearch.git && cd dsh-websearch
59
- pnpm install && pnpm run build && npm pack # produces dsh-websearch-<ver>.tgz
63
+ pnpm install && pnpm run build && node scripts/pack.mjs # dual tarballs into dist-artifacts/
60
64
  # Option 3: a file: tarball dependency in the profile package.json + pnpm install
61
65
  ```
62
66
 
63
- Installing takes over web_search / web_fetch (bundle-pinned install order, last writer wins); uninstalling restores the host defaults. Reload the page after swapping the package (the client bundle is served from `/plugins/*?rev=` runtime routes).
67
+ Installing takes over web_search / web_fetch (bundle-pinned install order, last writer wins) and hides the built-in "Web search and fetch" settings page while the plugin is enabled (ADR-0024); uninstalling restores the host defaults and that page. A `web` selection saved separately in the user layer is not removed by uninstall; see the FAQ. Reload the page after swapping the package (the client bundle is served from `/plugins/*?rev=` runtime routes).
64
68
 
65
69
  **Upgrade**: full rehearsal manual at [docs/upgrade.md](docs/upgrade.md) (pack → swap → dump diff → GUI smoke → search → degradation). Same-version swaps are skipped — bump the version first for preview installs.
66
70
 
71
+ **CI / release** (from v0.2.0; OIDC and the consistency gate from ADR-0026): pushes and PRs to master run the full gate plus the release rehearsal (typecheck/lint/test/i18n/build on a node 22/24 matrix; pack both tarballs and check their contents). Pushing a `v*` tag is the release confirmation point: the pipeline runs the full gate and `scripts/check-release.mjs` (tag, package.json, CHANGELOG and `USER_AGENT` agree; the tag points at a commit on master) before publishing — dual-name tarballs attach to the GitHub Release and the scoped package publishes to npmjs.org through OIDC trusted publishing, with no long-lived token. The local release steps are in [docs/release-runbook.md](docs/release-runbook.md).
72
+
67
73
  **Notes**:
68
74
  - Key values never reach the client; the settings badge shows integer counts only (refs whitelisted to the five members, blocking cross-credential probing).
69
75
  - After a host upgrade swaps the serving worktree, run `pnpm install && pnpm run build` in that worktree first so the profile links (symlink healing) resolve complete `lib/` outputs.
@@ -97,6 +103,7 @@ After install, Web UI "Settings → Web Search":
97
103
  - **Search chain / Web Fetch chain**: two independently orderable chains (ADR-0019), effective on the next search.
98
104
  - **Advanced fold**: fallback selector, timeout budget, DeepSeek maxUses, unified language/region (ADR-0015).
99
105
  - **Provenance badge** (ADR-0010): session tool rows show `[served-by: <member-id>]`.
106
+ - **DNS resilience card** (v0.2.0, ADR-0022): member-card-style header with an on/off Switch; mode (auto/on/off), DoH preset (auto/CN/global/custom nodes), probe method (TCP/TLS), live detection status with evidence, and the Inspect resolution trace — see the section below.
100
107
 
101
108
  ## Chain semantics (ADR-0002 / ADR-0014)
102
109
 
@@ -114,6 +121,17 @@ After install, Web UI "Settings → Web Search":
114
121
  - **Takeover OFF**: the gate falls back to a built-in http fetch (official-behavior-equivalent stand-in; the pinned patch means the official provider instance is never selected).
115
122
  - The two-state toggle is hot in GUI and settings (next agent / next call).
116
123
 
124
+ ## DNS resilience layer (v0.2.0, ADR-0022)
125
+
126
+ Process-level resolution high availability under side-router/controlled networks (applies to all upstream requests of this plugin; other processes untouched):
127
+
128
+ - **Automatic detection** (default `mode: auto`): a startup canary cross-checks member domains and enables DoH on poisoning evidence (e.g. 198.18.0.0/15 fake-ips); clean networks see zero behavior change (zero hits uninstall the patch).
129
+ - **DoH encrypted resolution**: bypasses transparent port-53 interception; regional preset pools (AliDNS/DNSPod for CN, Cloudflare/Google/Quad9 globally) with bootstrap auto-selection (RTT ranked).
130
+ - **Egress probing** (`dns.probe.method`): TCP-443 or TLS-Hello (SNI-carrying; default tcp) probes IP reachability, filtering CDN-rotation-stale unreachable IPs — the empirically effective measure on (SNI, IP) tuple-filtered networks.
131
+ - **Multi-level degradation**: DoH total failure falls back to system resolution exactly once; connect-level failures retry once after a fresh resolve, then degrade to the next member (no key-budget burn).
132
+ - **Privacy red lines**: hostnames in logs/traces are sanitized (non-member hosts hashed + last two labels); an active proxy environment suspends the layer (system path).
133
+ - Chain-log `[dshws-dns]` / `[dshws-chain] connect-flap` lines carry a 4-hex run key for concurrent-run attribution.
134
+
117
135
  ## Configuration reference (`dsh-websearch` section of cordis.yml)
118
136
 
119
137
  > Sole source of truth = the `src/config.ts` schema; this is a common-fields excerpt. All fields are hot (next search). GUI writes share the schema.
@@ -156,12 +174,15 @@ Combination constraints (fail-loud: on 0.1.5/0.1.6 hosts the settings validate h
156
174
  - **Official web_fetch errors under a proxy**: host SSRF hard protection × TUN fake-ip (not a plugin bug). Enable `fetchTakeover` to route through the cloud extract chain.
157
175
  - **Where did Perplexity go**: removed (ADR-0017 — no free API key tier available, fails the admission bar). Residual `perplexity:` sections in stored settings.yaml are harmless (schema passthrough); feel free to clean manually.
158
176
  - **AnySearch vertical tag/params not implemented**: pending a key probe (registered S22).
159
- - **Idle web-search-deepseek card on the host settings page**: inert after takeover (its key field is a single-value write to `DEEPSEEK_API_KEY`) — known behavior; do not configure multi-keys there.
177
+ - **Where the built-in "Web search and fetch" page went**: it is hidden while the plugin is enabled and "Settings → Web Search" takes over (ADR-0024); it comes back when the plugin is disabled or uninstalled. An escape hatch by design: writing `- id: ui-settings-web-search` with `disabled: false` into the profile's `cordis.patch.yml` forces the built-in page to show (the same approach as dsh-subagent-plus; measured working on 0.2.2-rc.5).
178
+ - **The built-in page shows "not loaded" after the plugin is disabled**: in 0.2.0 and earlier the built-in page was visible. A provider of this plugin selected and saved there lives in the user layer, outranks the bundle layer, and dangles once the plugin is off (`web_search` fails with `WEB_PROVIDER_CONFIGURED_MISSING`). While the plugin is enabled and detects the choice, a notice card at the top of the Web Search settings page clears it with one click ("Clear pinned selection"); after the plugin is disabled, picking the providers again on the restored built-in page and saving clears it too (the automatic choice for search plus the local direct fetch is the default); deleting `searchProvider` and `fetchProvider` (both together) from the `web` row of the profile's `cordis.patch.yml` and restarting the host works as well. An automatic handover at disable time is unreliable on rc.5: the host teardown runs inside an HMR transaction and its write is refused, and the client watch is usually unloaded before the event arrives (2 of 13 switches survived, 1 write succeeded); see the [session-41 record](docs/sessions/2026-11-23-session-41.md).
160
179
  - **Upgrades**: see [docs/upgrade.md](docs/upgrade.md).
161
180
 
162
181
  ## More docs
182
+ - [docs/patterns.md](docs/patterns.md) — plugin-page intro-card and swap-verification patterns (PC1–PC3, reusable)
183
+ - [docs/known-upstream-issues.md](docs/known-upstream-issues.md) — known upstream DSH issues register (zh; symptoms/workarounds/self-checks, incl. the fork fix-branch usage)
163
184
 
164
185
  - Architecture: [docs/00-architecture.md](docs/00-architecture.md)
165
- - Decision records: [docs/decisions/](docs/decisions/) (ADR-0001..0020)
186
+ - Decision records: [docs/decisions/](docs/decisions/) (ADR-0001..0027)
166
187
  - Upgrade rehearsal manual: [docs/upgrade.md](docs/upgrade.md)
167
188
  - Governance board: [docs/STATUS.md](docs/STATUS.md)
package/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # dsh-websearch
2
2
 
3
+ > **文档分工**:插件页显示的用户文档是 [docs/plugin-page.zh.md](docs/plugin-page.zh.md)(由 locale `meta.detail` 指定,英文环境读 [docs/plugin-page.en.md](docs/plugin-page.en.md));本 README 面向开发、安装与验收。
4
+ >
3
5
  > **语言权威声明**:本文件为中文事实正本;`README.en.md` 为英文镜像,两文件不一致时以本文件为准。
4
- > 版本线:**v0.1.0** 起(ADR-0020)。内部开发编号 0.2.0–0.9.0 归历史档,见 CHANGELOG。
6
+ > 版本线:v0.1.0 起(ADR-0020);**v0.2.0 = DNS 韧性层 + 上游对齐二轮收口**(ADR-0022;含四工具上游对齐修复与质量批——单一版本发布)。内部开发编号 0.2.0–0.9.0 归历史档,见 CHANGELOG。
5
7
 
6
- `dsh-websearch` 是 [deepseek-harness](https://github.com/)(`dsh`)的**外挂式统一网页搜索管理插件**:零内核侵入,把多家搜索供应商收编进一个标准插件,提供用户可配置的优先级链、完整高可用降级、多 API key 池、统一 web_fetch 接管,以及 Web 设置页管理 GUI。
8
+ `dsh-websearch` 是 deepseek-harness(`dsh`)的**外挂式统一网页搜索管理插件**:零内核侵入,把多家搜索供应商收编进一个标准插件,提供用户可配置的优先级链、完整高可用降级、多 API key 池、统一 web_fetch 接管,以及 Web 设置页管理 GUI。
7
9
 
8
10
  **成员准入标准**(ADR-0017):高可用 + 有免费额度 + 支持多 API key + 功能实现对齐上游官方 API。
9
11
 
@@ -17,13 +19,15 @@
17
19
 
18
20
  ## 快速开始
19
21
 
20
- > ⚠️ **已知上游宿主问题(非本插件缺陷)**:`dsh` **0.1.6-alpha.2** 宿主自身工具调度缺陷——任意工具调用(含 shell/web_search)崩溃 `TOOL_RUNTIME_SCHEDULER.prepare`,无插件净环境可复现。请避开该宿主版本(用 0.1.5-rc.x / 0.1.6-alpha.1 / 0.1.7-alpha.x),或等上游修复。详见 [docs/upgrade.md](docs/upgrade.md) 三线矩阵。
22
+ > ⚠️ **已知上游宿主问题(非本插件缺陷)**,详见 **[docs/known-upstream-issues.md](docs/known-upstream-issues.md)**(现象/影响版本/规避/自查命令,照做即可):
23
+ > 1. `dsh` **0.1.6-alpha.2**:任意工具调用崩溃 `TOOL_RUNTIME_SCHEDULER.prepare`——避开该版本(用 0.1.5-rc.x / 0.1.6-alpha.1 / 0.1.7+)。
24
+ > 2. `dsh` **0.1.7-alpha.2/rc.1(rc.2 半修)**:tsx 源码启动下宿主启动期报 `Plugin metadata … TypeError: Cannot assign to read only property 'stack'`——npm 安装/构建产物用户不受影响;源码启动用户可用 [fork 修复分支](https://github.com/GeerMrc/deepseek-harness/tree/fix/readonly-stack-rc2)。
21
25
 
22
- 前置:宿主 `dsh` ≥ 0.1.5-rc.1(peer 域 `>=0.1.5-rc.1 <0.1.8 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2`,S32 全跨度——显式钉已演练预发布版)、node ≥ 22.19。
26
+ 前置:宿主 `dsh` ≥ 0.1.5-rc.1(peer 域 `>=0.1.5-rc.1 <0.1.8 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.2-rc.5 || >=0.2.0 <0.3.0`(S32/S33/S38/S41 全跨度——显式钉的是已演练的预发布版,范围由 `tests/peer-range.spec.ts` 按两种 semver 语义守护;0.1.8 稳定线未演练仍排除。其中 0.2.2-rc.5 只做完了装入与接管开关的实测,搜索与抓取的功能腿待做。宿主兼容门按 `includePrerelease` 放行 0.2.x 预发布,显式钉是「已演练」的记录而非过门条件,见 ADR-0027))、node ≥ 22.19。
23
27
 
24
28
  ```sh
25
29
  # 1. 打包(仓库根)
26
- pnpm install && pnpm run build && npm pack # 产出 dsh-websearch-<version>.tgz
30
+ pnpm install && pnpm run build && node scripts/pack.mjs # 双名 tarball:裸名 dsh-websearch-<ver>.tgz(profile 安装)+ scoped(npm)
27
31
 
28
32
  # 2. 安装进 web profile(装即接管,ADR-0013)
29
33
  dsh plugin --profile web add /path/to/dsh-websearch-<version>.tgz
@@ -34,13 +38,13 @@ dsh --profile web --dump-config
34
38
  # dsh-websearch insert 行出现
35
39
  ```
36
40
 
37
- **装即接管**:插件随包 `cordis.patch.yml` 钉 `searchProvider: dshws-chain` + `fetchProvider: dshws-fetch-gate`——`plugin add` 单命令即接管,`plugin remove` 单命令完整复原(dump diff 零输出)。无需手写用户层 patch。
41
+ **装即接管**:插件随包 `cordis.patch.yml` 钉 `searchProvider: dshws-chain` + `fetchProvider: dshws-fetch-gate`,并在启用期间隐藏官方「网页搜索与获取」设置页(ADR-0024)——`plugin add` 单命令即接管;关闭或卸载即复原组合,官方设置页随之恢复(0.2.2-rc.5 上经插件页开关实测;命令行卸载在 rc.5 上另行实测)。无需手写用户层 patch。用户层里另行保存过的 `web` 选择多数不随关闭清除、不随卸载清除,见 FAQ。
38
42
 
39
43
  **卸载**:`dsh plugin --profile web remove dsh-websearch`。已知残留(诚实披露):settings 默认值与预设目录不随 remove 清理(无害,用户自撰同名目录永不覆写)。
40
44
 
41
45
  ## 安装、升级与注意事项
42
46
 
43
- **安装**(宿主 peer 域见上——覆盖 0.1.5-rc 线、0.1.6 与 0.1.7 预发布线及未来 0.1.6/0.1.7 稳定版,上限 0.1.8):
47
+ **安装**(宿主 peer 域见上——覆盖 0.1.5-rc 线、0.1.6 与 0.1.7 预发布线及未来 0.1.6/0.1.7 稳定版、0.2.0-rc 线、0.2.2-rc.5 与 0.2.x 稳定版;0.1.8 与 0.3.x 不在域内):
44
48
 
45
49
  方式一(npm registry,推荐):
46
50
 
@@ -55,13 +59,15 @@ dsh plugin --profile web add @maricgeer/dsh-websearch
55
59
  dsh plugin --profile web add <dsh-websearch-tarball>
56
60
  # 方式二:从源码自行打包
57
61
  git clone https://github.com/GeerMrc/dsh-websearch.git && cd dsh-websearch
58
- pnpm install && pnpm run build && npm pack # 产出 dsh-websearch-<ver>.tgz
62
+ pnpm install && pnpm run build && node scripts/pack.mjs # 双名 tarball 入 dist-artifacts/
59
63
  # 方式三:profile package.json 依赖 file: 指向 tarball 后 pnpm install
60
64
  ```
61
65
 
62
- 安装即接管 web_search / web_fetch(bundle 钉扎安装序,后写者赢);卸载自动复原宿主默认。换包后浏览器整页刷新(client 走 `/plugins/*?rev=` 运行时路由)。
66
+ 安装即接管 web_search / web_fetch(bundle 钉扎安装序,后写者赢),并在启用期间隐藏官方「网页搜索与获取」设置页(ADR-0024);卸载自动复原宿主默认与该页面。用户层另行保存的 `web` 选择不随卸载清除,见 FAQ。换包后浏览器整页刷新(client 走 `/plugins/*?rev=` 运行时路由)。
63
67
 
64
- **升级**:完整演练手册见 [docs/upgrade.md](docs/upgrade.md)(打包→换包→dump 对照→GUI 冒烟→搜索→降级六步)。同版本号换包会被跳过——预览场景先 bump 版本。
68
+ **升级**:完整演练手册见 [docs/upgrade.md](docs/upgrade.md)(打包→换包→dump 对照→GUI 冒烟→搜索→降级六步 + 发版前上游对齐确认)。同版本号换包会被跳过——预览场景先 bump 版本。
69
+
70
+ **CI/发布**(v0.2.0 起;OIDC 与一致性门自 ADR-0026 起):master 推送与 PR 跑全量门禁加发布预演(typecheck/lint/test/i18n/build,node 22/24 矩阵;打包并校验 tarball 内容)。推送 `v*` 标签即发布确认点:流水线先跑全量门与 `scripts/check-release.mjs`(tag、package.json、CHANGELOG、`USER_AGENT` 四处版本一致,tag 指向 master 上的提交),再发布——双名 tarball 附 GitHub Release,scoped 包经 OIDC trusted publishing 发布到 npmjs.org,不使用长期 token。本地发版步骤见 [docs/release-runbook.md](docs/release-runbook.md)。
65
71
 
66
72
  **注意事项**:
67
73
  - key 值永不下发客户端;设置页徽标只显示整数计数(refs 白名单限定五成员,防跨凭据探测)。
@@ -96,6 +102,7 @@ key 一律走宿主 credentials 服务(credential-ref = 环境变量名),*
96
102
  - **搜索链 / Web Fetch 链**:双链独立排序(ADR-0019),启停即时生效(下一次搜索)。
97
103
  - **详细配置折叠区**:兜底搜索选择器、超时预算、DeepSeek maxUses、统一语言/区域(ADR-0015)。
98
104
  - **溯源徽标**(ADR-0010):会话工具行显示 `[served-by: <成员id>]`,模型可据实引用来源。
105
+ - **DNS 韧性卡**(v0.2.0,ADR-0022):成员卡同构头部(启停 Switch),模式(自动/开启/关闭)、DoH 预设(自动/国内/海外/自定义节点)、探测方式(TCP/TLS)、检测状态与证据、Inspect 最近解析 trace;详见下节。
99
106
 
100
107
  ## 链语义(ADR-0002 / ADR-0014)
101
108
 
@@ -113,6 +120,17 @@ key 一律走宿主 credentials 服务(credential-ref = 环境变量名),*
113
120
  - **接管关**:gate 回落内置 http 直抓(官方行为等价近似;patch 钉死下官方 provider 实例永不被选)。
114
121
  - 两态开关在 GUI 与 settings 热生效(下一个 agent / 下一次调用)。
115
122
 
123
+ ## DNS 韧性层(v0.2.0,ADR-0022)
124
+
125
+ 旁路由/受控网络下的进程级解析高可用(对本插件的全部上游请求生效;不影响插件外进程):
126
+
127
+ - **自动检测**(默认 `mode: auto`):启动金丝雀对成员域名做双路对照,命中投毒证据(如 198.18.0.0/15 fake-ip)自动启用 DoH;干净网络零行为变化(零命中即卸载补丁)。
128
+ - **DoH 加密解析**:绕开 53 端口透明拦截;区域预设池(国内 AliDNS/DNSPod,海外 Cloudflare/Google/Quad9)+ bootstrap 自动选点(RTT 排序)。
129
+ - **出口预检**(`dns.probe.method`):TCP-443 或 TLS-Hello(带 SNI,默认 tcp)探测 IP 可达性,过滤 CDN 轮换滞后的不可达 IP——(SNI, IP) 元组过滤网络的实测有效项。
130
+ - **多级降级**:DoH 全灭回退系统解析恰一次;连接级失败 fresh 解析后重试一次即降级下一成员(不烧 key 额度)。
131
+ - **隐私红线**:日志/trace 的主机名脱敏(非成员域名哈希+末两标);代理环境变量在位时自动暂停(走系统路径)。
132
+ - 链路日志 `[dshws-dns]`/`[dshws-chain] connect-flap` 行含 4-hex 运行键,可并行归属。
133
+
116
134
  ## 配置参考(cordis.yml `dsh-websearch` 节)
117
135
 
118
136
  > 唯一正本 = `src/config.ts` schema;此处摘录常用面。全字段热生效(下一次搜索)。GUI 写入与 cordis.yml 同 schema。
@@ -152,15 +170,21 @@ dsh-websearch:
152
170
 
153
171
  ## FAQ / 已知行为
154
172
 
173
+ - **官方桌面端(Electron app)能用本插件吗**:能。桌面端与 web 端共用 `~/.dsh`(key/会话/工作区直接共享),插件按 profile 隔离需各自安装:桌面端用 app 内置命令装 `'/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh' plugin --profile desktop add @maricgeer/dsh-websearch`(装完重启 app)。**app 自动更新后插件可能失效/拒装——这是预期行为**(更新会替换捆绑运行时:宿主兼容门按 `includePrerelease` 放行 0.2.x 预发布,插件不会被拒装,但上游改了接口时插件可能失效):自查 `'<同上 launcher>' plugin --profile desktop add @maricgeer/dsh-websearch` 重装即可;仍失败说明需要等插件适配新版(见 [known-upstream-issues](docs/known-upstream-issues.md) 与 [desktop-adoption](docs/desktop-adoption.md))。
155
174
  - **官方 web_fetch 在代理环境报错**:宿主 SSRF 硬防护 × TUN fake-ip 所致(非本插件 bug)。开 `fetchTakeover` 走云端 extract 链即绕开。
156
175
  - **Perplexity 哪去了**:已移除(ADR-0017——无免费额度可申请,不满足准入标准)。存量 settings.yaml 的 `perplexity:` 残节无害(schema 透传),可手动清理。
157
176
  - **AnySearch 垂直面 tag/params 未实现**:待 key 探针(S22 登记)。
158
- - **宿主设置页闲置的 web-search-deepseek 配置卡**:接管后不生效仍在(其 key 保存为对 `DEEPSEEK_API_KEY` 的单值写入点)——已知行为,勿在那里配置多 key。
177
+ - **官方「网页搜索与获取」设置页去哪了**:插件启用期间它被隐藏,由「设置 → 网页搜索」接管(ADR-0024);关闭或卸载插件后自动恢复。设计上的逃生口:在 profile 的 `cordis.patch.yml` 写 `- id: ui-settings-web-search` 与 `disabled: false` 可强制显示官方页(与 dsh-subagent-plus 的做法一致;0.2.2-rc.5 上实测可用)。
178
+ - **关闭插件后官方页显示「未加载」**:0.2.0 及更早版本里官方页可见,若在其中把提供方选定为本插件成员并保存,该选择写在用户层,优先于组合包层,关闭插件后成为悬空引用(`web_search` 报 `WEB_PROVIDER_CONFIGURED_MISSING`)。插件启用期间检测到该选择时,「网页搜索」设置页顶部会出现提示卡,点「清除钉值」一键清除;关闭插件后在恢复出来的官方页重新选择并保存也可清除(选「自动选择」加「本机直接获取」即回到默认);还可以删除 profile `cordis.patch.yml` 里 `web` 行的 `searchProvider` 与 `fetchProvider`(两个一起删)后重启宿主。关闭时的自动交还在 rc.5 上不可靠:宿主 teardown 运行在 HMR 事务内、写入被拒,客户端守卫多数在事件送达前被卸载(13 次里 2 次存活,1 次写入成功),实测见 [session-41 记录](docs/sessions/2026-11-23-session-41.md)。
159
179
  - **升级**:见 [docs/upgrade.md](docs/upgrade.md)。
160
180
 
161
181
  ## 更多文档
182
+ - [docs/patterns.md](docs/patterns.md) — 插件页介绍卡与换装验证范本(PC1–PC3,跨版本复用)
183
+ - [docs/known-upstream-issues.md](docs/known-upstream-issues.md) —— 已知上游 DSH 问题登记表(现象/规避/自查命令,含 fork 修复分支用法)
184
+ - [docs/desktop-adoption.md](docs/desktop-adoption.md) —— 官方桌面端全貌与采用实测(ADR-0023)
185
+ - [docs/upstream-sync-sop.md](docs/upstream-sync-sop.md) —— 随官方上游(npm 线 + 桌面端)迭代的同步 SOP(监测/决策/守卫重放/双端验证/发版联动)
162
186
 
163
187
  - 架构正本:[docs/00-architecture.md](docs/00-architecture.md)
164
- - 决策记录:[docs/decisions/](docs/decisions/)(ADR-0001..0020)
188
+ - 决策记录:[docs/decisions/](docs/decisions/)(ADR-0001..0027)
165
189
  - 升级演练手册:[docs/upgrade.md](docs/upgrade.md)
166
190
  - 治理看板:[docs/STATUS.md](docs/STATUS.md)
package/cordis.patch.yml CHANGED
@@ -1,3 +1,14 @@
1
+ # Bundle layer for dsh-websearch (ADR-0013, ADR-0024). Disabling or uninstalling
2
+ # the bundle in the Plugins page removes this whole layer, so every override
3
+ # below is derived state: the official rows return with their config intact.
4
+ #
5
+ # Takeover: pin the seam's selection to this plugin's chain and gate, and hide
6
+ # the official "web search and fetch" settings page, a pure edit surface that
7
+ # would otherwise let users select another provider while this plugin is on.
8
+ # Runtime rows are intentionally NOT disabled: web, web-fetch-http,
9
+ # web-deepseek-api, tool-web and the preset rows must stay up so the official
10
+ # providers take over as soon as this bundle is off. Entries carry no `name`
11
+ # guard on purpose: a mismatched guard makes the host skip the entry silently.
1
12
  - insert:
2
13
  - id: dsh-websearch
3
14
  name: dsh-websearch
@@ -7,3 +18,5 @@
7
18
  fetchProvider: dshws-fetch-gate
8
19
  - id: web-search-deepseek
9
20
  disabled: true
21
+ - id: ui-settings-web-search
22
+ disabled: true
@@ -0,0 +1,20 @@
1
+ # dsh-websearch (multi-provider web search)
2
+
3
+ > A multi-provider search chain taking over DSH's web search and fetch: Tavily, Exa, Firecrawl and AnySearch degrade in your order, DeepSeek backs up for pay, and each provider rotates several keys.
4
+
5
+ ## What it does
6
+
7
+ - **High-availability failover**: a failed member is skipped for the next; key pools rotate within a provider first; the search fails only when all have
8
+ - **Unified settings**: one language, region and domain allow/block list for every member; the tool row names the member that served it
9
+ - **DNS resilience**: encrypted resolution on restricted networks; healthy networks untouched
10
+ - **Install and take over**: enabled, it replaces the built-in "Web search and fetch"; disabled, the built-ins take back over and your settings are kept
11
+
12
+ ## Settings
13
+
14
+ Settings → Web Search: API keys on the member cards (stored locally only), drag to reorder the chain, toggles for web_fetch takeover and DNS; changes apply from the next search.
15
+
16
+ ## Off and compatibility
17
+
18
+ **The list switch hands back to the built-ins and restores on re-enable**; the detail page's "enable component" switch only deactivates the plugin itself (a state with no settings entry — switch it back on there). Compatible with DSH 0.1.5-rc.1 through 0.2.x (0.2.2-rc.5 included).
19
+
20
+ Issues and releases: https://github.com/GeerMrc/dsh-websearch
@@ -0,0 +1,20 @@
1
+ # dsh-websearch(多源网页搜索)
2
+
3
+ > 多源搜索链接管 DSH 的网页搜索与获取:Tavily、Exa、Firecrawl、AnySearch 按你排的顺序自动降级,DeepSeek 付费兜底,每家可配多把 key 轮换。
4
+
5
+ ## 它做什么
6
+
7
+ - **高可用降级**:成员失败自动换下一个;多 key 池先同家换 key 再降级,全部失败才报错
8
+ - **统一配置**:语言、区域、域名黑白名单一处设置、全成员生效;工具行标注实际服务的成员
9
+ - **DNS 韧性**:受限网络自动加密解析,正常网络零改动
10
+ - **装即接管**:启用即接管官方「网页搜索与获取」,关闭即交回官方、设置保留
11
+
12
+ ## 设置与使用
13
+
14
+ 设置 → 网页搜索:成员卡填 API key(只存本机)、拖动排序搜索链、web_fetch 接管与 DNS 开关;改动从下一次搜索起生效。
15
+
16
+ ## 关闭与兼容
17
+
18
+ **列表开关 = 官方接管、重新启用即恢复**;详情页「启用组件」开关只停用本体(留下无设置入口的状态,回详情页打开即恢复)。兼容 DSH 0.1.5-rc.1 至 0.2.x(含 0.2.2-rc.5)。
19
+
20
+ 问题反馈与版本发布:https://github.com/GeerMrc/dsh-websearch