@jayyuen66/dsh-scrapling 0.1.9 → 0.1.11

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
@@ -6,6 +6,36 @@
6
6
  标准六类之外的小节(本仓的 `Boundaries` 收各版本的验证范围与能力边界,即哪些平台/档位真跑过、
7
7
  哪些只到本地夹具为止)。
8
8
 
9
+ ## 0.1.11
10
+
11
+ Scrapling 钉版抬到 `0.5.1`;MCP 接入支持宿主 mcpManager 动态注册;宿主开发基线抬到 `0.2.2-rc.2`,支持窗口收到 `^0.2.2-rc.1`。
12
+
13
+ ### Changed
14
+
15
+ - **Scrapling 钉版抬到 `0.5.1`**:`py/runtime-requirements.txt` 的 scrapling 由 `0.5` 抬到 `0.5.1`(wheel 哈希重算,传递依赖地板已满足);契约探针与 sidecar 端到端在 0.5.1 上取证通过(调用面零违规、零静默丢弃)。`bridge.py` 的版本闸 `>=0.5,<0.6` 不变。
16
+ - **MCP 动态注册**:`mcp` 模式起好自有 HTTP server 后、`official-mcp` 模式启用时,探测宿主 `ctx.get("mcpManager")` 并动态注册(streamable-http / stdio),注册项随插件生命周期撤除;取不到 mcpManager(CLI/headless 无此服务)或注册失败(重名等)时回退既有接入方式(手配 dsh-mcp-client / setup 产 patch)。`MCP_SERVER_VERSION` 同步到包版本。
17
+ - **宿主开发基线抬到 `0.2.2-rc.2`**:`devDependencies` 整组 `@deepseek-ai/dsh-*` 抬到 `0.2.2-rc.2`;rc.2 新增的 `@deepseek-ai/dsh-error` 作为 devDependency 直接钉到 `0.2.2-rc.2` —— 它是 `dsh-llm` / `dsh-jobs` / `dsh-subprocess` 的字面 peer,本仓 `autoInstallPeers: false`,不显式声明就装不进来,`dsh-llm` 的 `HarnessError` 类型会解析失败。
18
+ - **MCP 客户端默认钉版抬到 `0.2.2-rc.2`**:`@deepseek-ai/dsh-mcp-client` 对宿主各包的 peer 是逐字同版,rc.2 宿主上装 rc.1 客户端会被宿主按 peer 不匹配拒绝装载;`setup` 打印的安装命令与 `official-mcp` 的安装提示随开发基线走到 rc.2。放行名单同时保留 `0.2.2-rc.1`(窗口内仍停在 rc.1 的宿主)与 `next`,`doctor` 三档都认。
19
+ - **支持窗口收到 `^0.2.2-rc.1`**:`engines.dsh` 与 `@deepseek-ai/dsh*` peer 由 `^0.2.1-rc.5 || ^0.2.2-alpha.3` 改为 `^0.2.2-rc.1`(单条 0.2.2 线);`@deepseek-ai/schemastery` peer 由 `^3.18.5 || ^3.18.6-alpha.1` 收到 `^3.19.0`。devDependencies 仍精确钉版。
20
+
21
+ ## 0.1.10
22
+
23
+ 真机验收(dsh 宿主 0.2.2-rc.1,标准/PTC/极简/创造四种 Agent 预设 × native/mcp/official-mcp 三种集成模式)发现的两处功能缺陷与两处排障缺口:登录态存取在目录缺失时的失败形态,与宿主侧 DNS 停摆时抓取全部挂到工具超时的形态。工具与设置界面不变。
24
+
25
+ ### Fixed
26
+
27
+ - **登录态存取自动创建 `sessionStateDir` 目录**:部署配了 `sessionStateDir` 但目录不存在时,`scrapling_session_state_save` 此前以 `STATE_FAILED: state file does not exist` 失败——那是 Playwright `save_state` 不创建父目录、而 `FileNotFoundError` 被统一映射成给 load 路径写的「文件不存在」那句。现在 save 路径先按 `downloads/` 的同一待遇自建目录;目录在创建之后仍不可用(竞态、权限)时报 `state directory is not usable`,与 load 路径「文件还没存过」分开说。
28
+ - **DNS 解析加超时**:宿主侧 URL 闸门对每个抓取目标做 DNS 解析,此前没有超时——系统解析器间歇停摆时(国内网络环境实测复现),并行的抓取会全部挂到宿主的工具超时(默认 120 秒)而看不出成因。现在单次解析 5 秒到点按 `resolve-failed` 拒绝,错误消息带超时说明,调用方可立刻重试;底层的 lookup 不可中止,到点后仍在后台跑完只是不再等它。
29
+
30
+ ### Changed
31
+
32
+ - **设置卡的「保存被宿主拒绝」补上常见成因**:宿主的写接口只回布尔,卡片此前只显示「保存被宿主拒绝了」。补充的文案点名两类真实成因:条目配置被部署 patch 或命令行 overlay 压制(写下的值会在下次启动被覆盖回,宿主因此拒绝),或值没有通过 schema 校验。
33
+ - **`setup --status --profile` 同时读条目里的 `dataDir`**:此前只读 `pythonBin`,`packs` 与 `state` 恒报 CLI 默认目录上的状态——非默认 dataDir 部署下「宿主装没装」会答错对象。现在这两项跟随 profile 声明的目录,条目未写 `dataDir` 时才回落默认。
34
+
35
+ ### Boundaries
36
+
37
+ - README「已知边界」补两条实测:`maxPages` 只收敛收页数、发现层请求量由部署侧礼貌性旋钮控制(一次 `maxPages=3` 的爬取实测发出约 680 个请求);重资源站点在浏览器支路可能等不到 `load` 事件(默认 30 秒页面超时),用 `waitSelector` 或 `disableResources` 缓解。
38
+
9
39
  ## 0.1.9
10
40
 
11
41
  修复 0.1.8 引入的 web 启动隐患:设置卡组件收回 `client.js` 内联,移除对 `@jayyuen66/dsh-plugin-shared/client` 的模块表外置与 `cordis.patch.yml` 里的 shared 供应行。工具与设置界面不变。
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  <a href="https://github.com/JayYuen666/dsh-scrapling/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/JayYuen666/dsh-scrapling/ci.yml?branch=main&style=flat-square&label=ci" alt="ci" /></a>
13
13
  <img src="https://img.shields.io/badge/license-MIT-4c1?style=flat-square" alt="MIT" />
14
14
  <img src="https://img.shields.io/badge/node-%3E%3D24.9-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
15
- <img src="https://img.shields.io/badge/dsh-%5E0.2.1--rc.5-658EFF?style=flat-square" alt="dsh" />
15
+ <img src="https://img.shields.io/badge/dsh-%5E0.2.2--rc.1-658EFF?style=flat-square" alt="dsh" />
16
16
  <a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/powered_by_dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white" alt="powered by dsh" /></a>
17
17
  </p>
18
18
 
@@ -31,23 +31,27 @@
31
31
 
32
32
  ## <img src="https://api.iconify.design/lucide/file-text.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Contents
33
33
 
34
- - [What it does](#what-it-does)
35
- - [Install](#install)
34
+ - [ Contents](#-contents)
35
+ - [ What it does](#-what-it-does)
36
+ - [ Install](#-install)
37
+ - [ Shared version floor](#-shared-version-floor)
36
38
  - [Runtime packs (macOS arm64)](#runtime-packs-macos-arm64)
37
- - [Verify it is live](#verify-it-is-live)
38
- - [What it does not provide](#what-it-does-not-provide)
39
- - [Enabling it in dsh](#enabling-it-in-dsh)
40
- - [The tools](#the-tools)
41
- - [Replacing the built-in fetch and search](#replacing-the-built-in-fetch-and-search)
42
- - [MCP mode](#mcp-mode)
43
- - [Settings](#settings)
44
- - [Proxies](#proxies)
45
- - [Security](#security)
46
- - [Data and privacy](#data-and-privacy)
47
- - [Known boundaries](#known-boundaries)
48
- - [FAQ](#faq)
49
- - [Development](#development)
50
- - [License](#license)
39
+ - [ Verify it is live](#-verify-it-is-live)
40
+ - [ What it does not provide](#-what-it-does-not-provide)
41
+ - [ Enabling it in dsh](#-enabling-it-in-dsh)
42
+ - [ The tools](#-the-tools)
43
+ - [Render or static](#render-or-static)
44
+ - [ Replacing the built-in fetch and search](#-replacing-the-built-in-fetch-and-search)
45
+ - [ MCP mode](#-mcp-mode)
46
+ - [ `setup --mode` and `doctor`](#-setup---mode-and-doctor)
47
+ - [ Settings](#-settings)
48
+ - [ Proxies](#-proxies)
49
+ - [ Security](#-security)
50
+ - [ Data and privacy](#-data-and-privacy)
51
+ - [ Known boundaries](#-known-boundaries)
52
+ - [ FAQ](#-faq)
53
+ - [ Development](#-development)
54
+ - [ License](#-license)
51
55
 
52
56
  ## <img src="https://api.iconify.design/lucide/shield.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> What it does
53
57
 
@@ -76,7 +80,7 @@ dsh plugin --profile web add @jayyuen66/dsh-scrapling
76
80
  Remove with `dsh plugin --profile web remove @jayyuen66/dsh-scrapling`. The package is on the public npm registry, so installation needs no credentials and no scoped-registry line.
77
81
 
78
82
  - **Requires Node.js `>= 24.9`.** This is an ESM-only package, and the build entry points (`build-client.ts`, `build-host.ts`, `build-cli.ts`) are executed by `node` directly, so the floor has to sit where TypeScript type stripping is on by default (Node 22.18 up). The number itself is the host floor: `0.2.2` hosts declare Node `>= 24.9.0`, and a host below it never starts.
79
- - **Requires host `dsh` at the `0.2.1-rc.5` or `0.2.2-alpha.3` line.** The requirement the host actually reads is `engines.dsh` (`^0.2.1-rc.5 || ^0.2.2-alpha.3`), and it decides alone; a host on a later line is refused and needs the explicit risk grant `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk`. The support window rolls: this package is verified against every released host version inside the window at publish time and re-verified once the window moves, so the version number in this bullet is not a standing promise.
83
+ - **Requires host `dsh` at the `0.2.2-rc.1` line or later.** The requirement the host actually reads is `engines.dsh` (`^0.2.2-rc.1`), and it decides alone; a host on a later line is refused and needs the explicit risk grant `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk`. The support window rolls: this package is verified against every released host version inside the window at publish time and re-verified once the window moves, so the version number in this bullet is not a standing promise.
80
84
  - **Requires Python 3.14+ with Scrapling installed** — named by `pythonBin`, or found by the fixed chain in `lib/runtime.ts` (managed runtime under `dataDir/runtime`, then the repository's `_env/.venv`, then `PATH`). In an installed package the `_env/.venv` leg does not exist, so after `setup --feature core --apply` the interpreter is that managed Python and otherwise the `python3` on your `PATH` (`python` on Windows); whichever one is chosen is logged at load time, and a missing Scrapling reports an error carrying the install line to copy.
81
85
 
82
86
  ```sh
@@ -108,9 +112,9 @@ dsh-scrapling setup --status
108
112
  - `search`, `media`, `mcp` and `adaptive-redis` all ride on `core`'s venv: `mcp` brings the official `scrapling-mcp` server (the pinned `mcp` package; its tool set is the upstream's, not this plugin's) that `official-mcp` mode needs, and `adaptive-redis` brings the `redis` client behind `adaptiveStorage: redis`. Every pack is installable; the settings card reports each as `ready`, `missing`, `corrupt` or `installing`.
109
113
  - `--feature` is a dry run by default; `--apply` writes. `--repair` re-installs without touching user data, and `--uninstall <pack> [--purge]` removes runtime files; only `--purge` removes `elements_storage.db` and `downloads/`.
110
114
  - `--offline <dir>` installs with no network at all: `<dir>` must hold the Python archive named exactly as the manifest URL's last segment (browser and `curl -O` both keep `cpython-3.14.9+…-install_only.tar.gz`, and the percent-encoded spelling is accepted too) plus a `wheels/` directory with one wheel per pinned requirement - `pip download --only-binary=:all: --require-hashes -r py/runtime-requirements.txt -d <dir>/wheels` produces it. The hash check on the Python archive is the same one the networked path runs, and pip is invoked with `--no-index`; a missing archive or wheelhouse fails as `INSTALL_OFFLINE_ASSETS` instead of silently going online.
111
- - `setup --status` prints one JSON document: `dataDir`, `profile`, `runtime`, `packs` and `state`. With `--profile <dir>` it reads that profile's `cordis.patch.yml` and resolves the interpreter from this package's `pythonBin` (the setting the host actually uses); without it, `profile.path` is `null`, a note says the profile was not read, and `runtime` falls back to the CLI's own chain (managed runtime → repo `_env/.venv` → PATH `python3`). Pass `--profile` whenever you compare the card's interpreter with what `--status` reports.
115
+ - `setup --status` prints one JSON document: `dataDir`, `profile`, `runtime`, `packs` and `state`. With `--profile <dir>` it reads that profile's `cordis.patch.yml`, resolves the interpreter from this package's `pythonBin` and the data directory from `dataDir` (the two settings the host actually uses); `packs` and `state` are then reported for that directory — when the entry carries no `dataDir`, both fall back to the CLI's own default. Without `--profile`, `profile.path` is `null`, a note says the profile was not read, and `runtime` falls back to the CLI's own chain (managed runtime → repo `_env/.venv` → PATH `python3`). Pass `--profile` whenever you compare the card's interpreter with what `--status` reports.
112
116
  - The settings card can start the same install/repair/cancel actions through the `scraplingRuntime` remote when the profile has both a remote surface and a jobs backend; otherwise it prints the CLI command.
113
- - `integrationMode` is deployment-only; `setup --mode` prints or writes the client entry for the two MCP shapes and `doctor` checks a profile against it — see [MCP mode](#mcp-mode). `official-mcp` starts `scrapling-mcp` from the managed venv, which the `mcp` pack provisions (`setup --feature mcp --apply`).
117
+ - `integrationMode` is deployment-only; on a host that exposes `mcpManager` (the rc.2 web bundle) the MCP server is registered dynamically at load, while `setup --mode` prints or writes the client entry for CLI/headless profiles and `doctor` checks a profile against it — see [MCP mode](#mcp-mode). `official-mcp` starts `scrapling-mcp` from the managed venv, which the `mcp` pack provisions (`setup --feature mcp --apply`).
114
118
  - Only **macOS arm64** is verified. Windows, Linux and macOS x64 are blocked (B1/B2): every pack reports `blocked` and the installer refuses rather than guessing an asset path.
115
119
 
116
120
  ## <img src="https://api.iconify.design/lucide/circle-check.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Verify it is live
@@ -126,7 +130,7 @@ dsh-scrapling setup --status
126
130
  - **It is not a search engine.** Discovery runs in the Python sidecar against one of six backends (`searchBackend`: `auto` / `tavily` / `bing` / `brave` / `serper` / `duckduckgo` / `searxng`); Scrapling's own `google_search` option only sets a referer header. Each backend needs its own setting (`tavilyApiKey`, `braveApiKey`, `serperApiKey`, `searxngEndpoint`) — a backend that is selected but not configured reports `SEARCH_AUTH` instead of silently switching to another one.
127
131
  - **The npm tarball bundles no interpreter or browser.** They come from your machine or from the optional CLI installer, which downloads the verified macOS arm64 set into `dataDir/runtime`; missing pieces remove the matching tools instead of being fetched at load time.
128
132
  - **It adds no HTTP route on the host side.** The settings card is a host config form and this package exposes no `/api` surface. The one socket that really listens is the MCP server under `integrationMode: mcp`, bound to `127.0.0.1` (`http://127.0.0.1:<mcpPort>/mcp`): any other path gets 404, a declared body over 1 MiB gets 413, a request without `Content-Length` gets 411, and the bearer token is read only from `DSH_SCRAPLING_MCP_TOKEN` — with no token set, startup prints a stderr notice that the endpoint is unauthenticated and reachable from any local process.
129
- - **It adds no dsh subcommand.** The package's own `dsh-scrapling` CLI manages runtime packs, plus the two halves of the MCP hookup: `setup --mode native|mcp|official-mcp` generates the client entry and, with `--apply`, writes it to `<dataDir>/mcp/<mode>.patch.yml` (the profile itself is never touched), while `doctor --mode` compares that entry against the profile's `cordis.patch.yml` item by item. Given `--profile`, `setup --status` reads `pythonBin` from that same file.
133
+ - **It adds no dsh subcommand.** The package's own `dsh-scrapling` CLI manages runtime packs, plus the manual half of the MCP hookup for profiles without `mcpManager`: `setup --mode native|mcp|official-mcp` generates the client entry and, with `--apply`, writes it to `<dataDir>/mcp/<mode>.patch.yml` (the profile itself is never touched), while `doctor --mode` compares that entry against the profile's `cordis.patch.yml` item by item. Given `--profile`, `setup --status` reads `pythonBin` and `dataDir` from that same file.
130
134
 
131
135
  ## <img src="https://api.iconify.design/lucide/plug.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Enabling it in dsh
132
136
 
@@ -195,7 +199,7 @@ One consequence to know: `dsh-web`'s fetch body is a **closed** union of `html |
195
199
  |---|---|
196
200
  | `native` (default) | the `scrapling_*` tools listed above |
197
201
  | `mcp` | no native tools; the plugin serves the same tool table over MCP |
198
- | `official-mcp` | no native tools and no server from this plugin; `setup` only generates the `dsh-mcp-client` entry for the official `scrapling-mcp`, which runs in its own process, with its own sessions, and **without this plugin's URL guard** |
202
+ | `official-mcp` | no native tools and no server from this plugin; on a host that exposes `mcpManager` it registers the official `scrapling-mcp` dynamically, otherwise `setup` generates the `dsh-mcp-client` entry for it - it runs in its own process, with its own sessions, and **without this plugin's URL guard** |
199
203
 
200
204
  In `mcp` mode the server runs inside the plugin's own host process and calls the same sidecar, so the URL guard, sessions, jobs and adaptive storage are the same ones the native tools use — there is no second implementation to drift.
201
205
 
@@ -227,12 +231,12 @@ In `mcp` mode the server runs inside the plugin's own host process and calls the
227
231
  | `scrapling_screenshot` | `screenshot` |
228
232
  | — (`ctx.web` only) | `search` |
229
233
 
230
- Connecting dsh needs `@deepseek-ai/dsh-mcp-client`, which this plugin deliberately does not depend on. Pin the build that matches the current host — npm `latest` is older than the host's own line and the host rejects the mismatch:
234
+ On a host that exposes the `mcpManager` service (the rc.2 web/desktop bundle) the plugin registers its server there at load: no `dsh-mcp-client` install and no profile entry are needed, and `mcpPort` alone decides the endpoint. The manual entry below is for CLI/headless profiles, where that service is absent. If an upgraded profile still carries the manual entry, remove it when relying on dynamic registration - otherwise the manager refuses the duplicate server name and the old entry keeps serving.
235
+
236
+ Connecting dsh needs `@deepseek-ai/dsh-mcp-client`, which this plugin deliberately does not depend on. Pin the exact build matching the host version - npm `latest` is older than the host's own line, and the client's peer versions are literal, so one prerelease off installs but never activates. `0.2.2-rc.2` is the default; a host still on rc.1 takes `0.2.2-rc.1`, and `next` tracks the official beta line:
231
237
 
232
238
  ```bash
233
- dsh plugin --profile <name> add @deepseek-ai/dsh-mcp-client@0.2.2-rc.1
234
- # host on the 0.2.2-alpha.3 line: @deepseek-ai/dsh-mcp-client@0.2.2-alpha.3
235
- # host on the 0.2.1-rc.5 line: @deepseek-ai/dsh-mcp-client@0.2.1-rc.5
239
+ dsh plugin --profile <name> add @deepseek-ai/dsh-mcp-client@0.2.2-rc.2
236
240
  ```
237
241
 
238
242
  Then add one entry to that profile's `cordis.patch.yml` — this is exactly what `dsh-scrapling setup --mode mcp` prints, so you can also let the CLI write it (drop `headers` when no token is configured):
@@ -265,9 +269,9 @@ dsh-scrapling setup --mode native --apply # a file that deliberately contain
265
269
  dsh-scrapling doctor --mode mcp --profile <profileDir>
266
270
  ```
267
271
 
268
- `doctor` reads what the profile actually says - `cordis.patch.yml` plus that profile's `package.json` - and prints one line per problem: two entries under `serverName: scrapling`, this plugin's entry next to an official `stdio` one, entries that do not match the mode, an entry whose port disagrees with `--port`, a profile without `@deepseek-ai/dsh-mcp-client` or with it pinned to something other than `0.2.2-rc.1` / `0.2.2-alpha.3` / `0.2.1-rc.5` / `next`, and an official entry while `officialMcpEnabled` is off. Exit `0` is "consistent", `1` names at least one problem, `2` is a bad argument. `integrationMode` itself is a plugin setting the CLI cannot read, so `--mode` is the claim being checked and has to match the deployment.
272
+ `doctor` reads what the profile actually says - `cordis.patch.yml` plus that profile's `package.json` - and prints one line per problem: two entries under `serverName: scrapling`, this plugin's entry next to an official `stdio` one, entries that do not match the mode, an entry whose port disagrees with `--port`, a profile without `@deepseek-ai/dsh-mcp-client` or with it pinned to something other than `0.2.2-rc.2` / `0.2.2-rc.1` / `next`, and an official entry while `officialMcpEnabled` is off. Exit `0` is "consistent", `1` names at least one problem, `2` is a bad argument. `integrationMode` itself is a plugin setting the CLI cannot read, so `--mode` is the claim being checked and has to match the deployment.
269
273
 
270
- `official-mcp` asks for two separate statements before it produces anything: `officialMcpEnabled: true` in the profile and `--accept-risk` on the command line; missing either one prints `OFFICIAL_MCP_DISABLED` / `RISK_NOT_ACCEPTED` and writes nothing. The entry it generates starts `<dataDir>/runtime/venv/bin/scrapling-mcp`, so run `setup --feature mcp --apply` first - see [Runtime packs](#runtime-packs-macos-arm64). When that binary is missing, `setup` prints a line saying so.
274
+ `setup` for `official-mcp` asks for two separate statements before it writes anything: `officialMcpEnabled: true` in the profile and `--accept-risk` on the command line; missing either one prints `OFFICIAL_MCP_DISABLED` / `RISK_NOT_ACCEPTED` and writes nothing. At load time the host-side path is gated by `officialMcpEnabled` alone: a host exposing `mcpManager` registers the managed `scrapling-mcp` directly, while the `setup`-generated `dsh-mcp-client` entry is the fallback for CLI/headless profiles. Either path starts `<dataDir>/runtime/venv/bin/scrapling-mcp`, so run `setup --feature mcp --apply` first - see [Runtime packs](#runtime-packs-macos-arm64). When that binary is missing, `setup` prints a line saying so.
271
275
 
272
276
  ## <img src="https://api.iconify.design/lucide/sliders-horizontal.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Settings
273
277
 
@@ -390,7 +394,9 @@ Registered honestly, one entry per class.
390
394
  - **Runtime packs are verified on macOS arm64 only.** Windows, Linux and macOS x64 report every pack as `blocked`; the installer refuses rather than guessing an asset path (B1/B2).
391
395
  - **The `adaptive-redis` pack is a client, not a storage engine.** Upstream ships only `SQLiteStorageSystem`; the Redis backend here is this plugin's `py/redis_storage.py`, a `StorageSystemMixin` subclass keyed by registered domain. Enabling it changes where fingerprints live, so treat it as a deployment decision, not a per-call switch. The plugin's own MCP server is separate — it runs in-process and needs no pack.
392
396
  - **Shopify crawl mode walks the store's JSON API.** `mode=shopify` uses the store's `/collections.json` and each collection's `/products.json` (upstream's `ShopifySpider`) and yields one row per variant — `name` (product + variant, minus `Default Title`), `price`, `sku`, `stock` (`null` when available, `0` when not), `identifier`, `brand`, `category`, `image_url`, `url`, `barcode`, `old_price`, `description`. It never scrapes product HTML, and it obeys the same URL gate, robots setting, delay and concurrency knobs as the other crawl modes. Verified against a local fixture store; a real Shopify store has not been exercised (B11).
393
- - **`official-mcp` generates configuration only.** `integrationMode=official-mcp` registers no native tool and starts no server from this plugin; `setup --mode official-mcp --accept-risk` produces the `dsh-mcp-client` entry for the official server, whose binary comes from the `mcp` pack (B10 is the risk decision that entry stands on).
397
+ - **`maxPages` caps the pages collected, not the requests the spider makes.** The link discovery layer keeps requesting queued pages (one measured `maxPages=3` crawl issued about 680 requests while collecting 3). Politeness toward the target site is governed by the deployment knobs: `crawlRespectRobots`, `crawlDownloadDelayMs`, `crawlConcurrentRequests`, `crawlAutothrottle`.
398
+ - **Heavy pages can keep the browser path from ever settling.** When resources stay in flight past the default 30-second page timeout, `scrapling_session_fetch` / `scrapling_render` fail while a static fetch of the same URL succeeds. Mitigations: `waitSelector` (wait for a key element) or `disableResources` (block images and fonts), both per-call parameters the model can pass.
399
+ - **`official-mcp` connects the upstream server.** `integrationMode=official-mcp` registers no native tool and starts no server from this plugin; on a host that exposes `mcpManager` (the rc.2 web bundle) the managed `scrapling-mcp` is registered dynamically, and where that service is absent (CLI/headless) `setup --mode official-mcp --accept-risk` produces the `dsh-mcp-client` entry instead. The binary comes from the `mcp` pack (B10 is the risk decision that entry stands on).
394
400
 
395
401
  ## <img src="https://api.iconify.design/lucide/circle-help.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> FAQ
396
402
 
package/README.zh-CN.md CHANGED
@@ -12,7 +12,7 @@
12
12
  <a href="https://github.com/JayYuen666/dsh-scrapling/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/JayYuen666/dsh-scrapling/ci.yml?branch=main&style=flat-square&label=ci" alt="ci" /></a>
13
13
  <img src="https://img.shields.io/badge/license-MIT-4c1?style=flat-square" alt="MIT" />
14
14
  <img src="https://img.shields.io/badge/node-%3E%3D24.9-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
15
- <img src="https://img.shields.io/badge/dsh-%5E0.2.1--rc.5-658EFF?style=flat-square" alt="dsh" />
15
+ <img src="https://img.shields.io/badge/dsh-%5E0.2.2--rc.1-658EFF?style=flat-square" alt="dsh" />
16
16
  <a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/powered_by_dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white" alt="powered by dsh" /></a>
17
17
  </p>
18
18
 
@@ -31,23 +31,27 @@
31
31
 
32
32
  ## <img src="https://api.iconify.design/lucide/file-text.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 目录
33
33
 
34
- - [它做什么](#它做什么)
35
- - [安装](#安装)
34
+ - [ 目录](#-目录)
35
+ - [ 它做什么](#-它做什么)
36
+ - [ 安装](#-安装)
37
+ - [ shared 的版本下限](#-shared-的版本下限)
36
38
  - [运行时能力包(macOS arm64)](#运行时能力包macos-arm64)
37
- - [确认它真的在工作](#确认它真的在工作)
38
- - [它不提供什么](#它不提供什么)
39
- - [在 dsh 里启用](#在-dsh-里启用)
40
- - [工具一览](#工具一览)
41
- - [替代内置的抓取与搜索](#替代内置的抓取与搜索)
42
- - [MCP 模式](#mcp-模式)
43
- - [设置项](#设置项)
44
- - [代理](#代理)
45
- - [安全说明](#安全说明)
46
- - [数据与隐私](#数据与隐私)
47
- - [已知边界](#已知边界)
48
- - [常见问题](#常见问题)
49
- - [开发](#开发)
50
- - [许可证](#许可证)
39
+ - [ 确认它真的在工作](#-确认它真的在工作)
40
+ - [ 它不提供什么](#-它不提供什么)
41
+ - [ 在 dsh 里启用](#-在-dsh-里启用)
42
+ - [ 工具一览](#-工具一览)
43
+ - [渲染还是静态](#渲染还是静态)
44
+ - [ 替代内置的抓取与搜索](#-替代内置的抓取与搜索)
45
+ - [ MCP 模式](#-mcp-模式)
46
+ - [ `setup --mode` 与 `doctor`](#-setup---mode-与-doctor)
47
+ - [ 设置项](#-设置项)
48
+ - [ 代理](#-代理)
49
+ - [ 安全说明](#-安全说明)
50
+ - [ 数据与隐私](#-数据与隐私)
51
+ - [ 已知边界](#-已知边界)
52
+ - [ 常见问题](#-常见问题)
53
+ - [ 开发](#-开发)
54
+ - [ 许可证](#-许可证)
51
55
 
52
56
  ## <img src="https://api.iconify.design/lucide/shield.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 它做什么
53
57
 
@@ -76,7 +80,7 @@ dsh plugin --profile web add @jayyuen66/dsh-scrapling
76
80
  卸载用 `dsh plugin --profile web remove @jayyuen66/dsh-scrapling`。包在公共 npm registry 上,安装不需要凭据,也不需要 scoped-registry 配置行。
77
81
 
78
82
  - **需要 Node.js `>= 24.9`。** 本包是 ESM-only,且构建入口(`build-client.ts`、`build-host.ts`、`build-cli.ts`)由 `node` 直接执行,所以下限必须落在 TypeScript 类型剥离默认开启的那批版本上(Node 22.18 起)。数字本身取自宿主:`0.2.2` 系列宿主声明 Node `>= 24.9.0`,低于它的宿主根本起不来。
79
- - **需要宿主 `dsh` 处在 `0.2.1-rc.5` 或 `0.2.2-alpha.3` 版本线。** 宿主真正读的是 `engines.dsh`(`^0.2.1-rc.5 || ^0.2.2-alpha.3`),且它**单独决定**;更新版本线的宿主会被拒,需要显式风险授权 `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk`。支持窗口是滚动的:本包在发布时把窗口内的每个已发布宿主版本逐版取证,窗口滚动后重新取证,不把这一句里的版本号当长期承诺。
83
+ - **需要宿主 `dsh` 处在 `0.2.2-rc.1` 或更新的 `0.2.2` 版本线。** 宿主真正读的是 `engines.dsh`(`^0.2.2-rc.1`),且它**单独决定**;更新版本线的宿主会被拒,需要显式风险授权 `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk`。支持窗口是滚动的:本包在发布时把窗口内的每个已发布宿主版本逐版取证,窗口滚动后重新取证,不把这一句里的版本号当长期承诺。
80
84
  - **需要 Python 3.14+ 且装好 Scrapling** —— 由 `pythonBin` 指定,或按 `lib/runtime.ts` 的固定链找到:`dataDir/runtime` 下的托管 runtime → 仓内 `_env/.venv` → `PATH`。装出去的包里没有 `_env/.venv` 这一档,所以跑过 `setup --feature core --apply` 的机器用的是那支托管解释器,没装过就是你 `PATH` 上的 `python3`(Windows 上是 `python`);选中哪一支会在装载时写进日志,缺 Scrapling 时报错里带着可直接照抄的安装命令。
81
85
 
82
86
  ```sh
@@ -108,9 +112,9 @@ dsh-scrapling setup --status
108
112
  - `search`、`media`、`mcp` 与 `adaptive-redis` 都以 `core` 的 venv 为载体:`mcp` 带来 `official-mcp` 模式要的官方 `scrapling-mcp` server(随钉住的 `mcp` 包进来;它的工具集由上游决定,不是本插件的能力),`adaptive-redis` 带来 `adaptiveStorage: redis` 背后的 `redis` 客户端。六个包都可安装;设置卡把每个包报成 `ready`、`missing`、`corrupt` 或 `installing`。
109
113
  - `--feature` 默认 dry-run;`--apply` 才写到磁盘。`--repair` 重装且不碰用户数据;`--uninstall <包> [--purge]` 删运行时文件,只有 `--purge` 才连 `elements_storage.db` 与 `downloads/` 一起删。
110
114
  - `--offline <目录>` 全程不联网:`<目录>` 里要有 Python 归档(文件名与清单 URL 的最后一段一致,浏览器与 `curl -O` 写到磁盘的 `cpython-3.14.9+…-install_only.tar.gz` 可用,百分号转义那种写法也认),以及一个 `wheels/` 目录(每条钉版一枚 wheel,可用 `pip download --only-binary=:all: --require-hashes -r py/runtime-requirements.txt -d <目录>/wheels` 生成)。Python 归档的哈希校验与联网路径一致,pip 带 `--no-index`;缺归档或缺 wheelhouse 时报 `INSTALL_OFFLINE_ASSETS`,不会悄悄退回联网。
111
- - `setup --status` 打印一份 JSON:`dataDir`、`profile`、`runtime`、`packs` 与 `state`。带 `--profile <目录>` 时读该 profile 的 `cordis.patch.yml`,按本包条目里的 `pythonBin`(宿主真正在用的那个设置)解析解释器;不带时 `profile.path` 为 `null`,输出里有一句说明没读 profile,`runtime` 回落到 CLI 自己的链(托管 runtime → 仓内 `_env/.venv` → PATH `python3`)。要拿 `--status` 和设置卡上的解释器对照,就带上 `--profile`。
115
+ - `setup --status` 打印一份 JSON:`dataDir`、`profile`、`runtime`、`packs` 与 `state`。带 `--profile <目录>` 时读该 profile 的 `cordis.patch.yml`,按本包条目里的 `pythonBin` 与 `dataDir`(宿主真正在用的那两个设置)解析解释器,`packs` 与 `state` 也改报那份目录——条目里没写 `dataDir` 时这两项回落 CLI 自己的默认目录;不带 `--profile` 时 `profile.path` 为 `null`,输出里有一句说明没读 profile,`runtime` 回落到 CLI 自己的链(托管 runtime → 仓内 `_env/.venv` → PATH `python3`)。要拿 `--status` 和设置卡上的解释器对照,就带上 `--profile`。
112
116
  - profile 同时有远程读取接口与作业后端时,设置卡能经 `scraplingRuntime` 发起同一套安装/修复/取消;否则显示可照抄的 CLI 命令。
113
- - `integrationMode` 只在部署配置里;`setup --mode` 负责打印或写出两种 MCP 接法的客户端条目,`doctor` 用来核对一份 profile —— 见 [MCP 模式](#mcp-模式)。`official-mcp` 起的是托管 venv 里的 `scrapling-mcp`,由 `mcp` 能力包装进去(`setup --feature mcp --apply`)。
117
+ - `integrationMode` 只在部署配置里;宿主有 `mcpManager`(rc.2 的 web 组合包)时,MCP server 在装载时自动动态注册;`setup --mode` 负责为没有该服务的 CLI/headless profile 打印或写出客户端条目,`doctor` 用来核对一份 profile —— 见 [MCP 模式](#mcp-模式)。`official-mcp` 起的是托管 venv 里的 `scrapling-mcp`,由 `mcp` 能力包装进去(`setup --feature mcp --apply`)。
114
118
  - 只验证了 **macOS arm64**。Windows、Linux 与 macOS x64 是 blocked(B1/B2):所有包都报 `blocked`,安装器直接拒绝,不猜资产路径。
115
119
 
116
120
  ## <img src="https://api.iconify.design/lucide/circle-check.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 确认它真的在工作
@@ -126,7 +130,7 @@ dsh-scrapling setup --status
126
130
  - **它不是搜索引擎。** 检索由 Python sidecar 走六条后端之一(`searchBackend`:`auto` / `tavily` / `bing` / `brave` / `serper` / `duckduckgo` / `searxng`);Scrapling 自己的 `google_search` 选项只是加一个 Google referer 头。每条后端都要自己的配置(`tavilyApiKey`、`braveApiKey`、`serperApiKey`、`searxngEndpoint`)—— 选中却没配的后端报 `SEARCH_AUTH`,不会静默换到别的后端。
127
131
  - **npm tarball 里没有解释器与浏览器。** 它们来自你的机器,或来自可选的 CLI 安装器 —— 后者把已验证的 macOS arm64 资产装进 `dataDir/runtime`;装载时缺什么就少注册什么,不会临时去下载。
128
132
  - **它不在宿主侧新增 HTTP 路由。** 设置卡是宿主的配置表单,本包没有自己的 `/api` 面。唯一真会 listen 的是 `integrationMode: mcp` 下那个 MCP server,只绑 `127.0.0.1`(`http://127.0.0.1:<mcpPort>/mcp`):非 `/mcp` 路径回 404,声明超过 1 MiB 的正文回 413、不带 `Content-Length` 的回 411,Bearer token 只从环境变量 `DSH_SCRAPLING_MCP_TOKEN` 读,没设时启动会往 stderr 打一条「无鉴权、本机任意进程可调」的告知。
129
- - **它不加 dsh 子命令。** 本包自己的 `dsh-scrapling` CLI 管运行时能力包,另外管 MCP 接法的两件事:`setup --mode native|mcp|official-mcp` 生成客户端条目、带 `--apply` 时写到 `<dataDir>/mcp/<模式>.patch.yml`(profile 本体一个字不改),`doctor --mode` 拿那份条目与 profile 的 `cordis.patch.yml` 逐条核对。`setup --status` 给了 `--profile` 时读的也是那份文件里的 `pythonBin`。
133
+ - **它不加 dsh 子命令。** 本包自己的 `dsh-scrapling` CLI 管运行时能力包,另外管没有 `mcpManager` 的 profile 上那半套手工 MCP 接法:`setup --mode native|mcp|official-mcp` 生成客户端条目、带 `--apply` 时写到 `<dataDir>/mcp/<模式>.patch.yml`(profile 本体一个字不改),`doctor --mode` 拿那份条目与 profile 的 `cordis.patch.yml` 逐条核对。`setup --status` 给了 `--profile` 时读的也是那份文件里的 `pythonBin` 与 `dataDir`。
130
134
 
131
135
  ## <img src="https://api.iconify.design/lucide/plug.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 在 dsh 里启用
132
136
 
@@ -195,7 +199,7 @@ dsh-scrapling setup --status
195
199
  |---|---|
196
200
  | `native`(默认) | 上面列出的 `scrapling_*` 工具 |
197
201
  | `mcp` | 不注册原生工具;把同一份工具表端成 MCP server |
198
- | `official-mcp` | 既不注册原生工具,也不起本插件的 server;`setup` 只生成官方 `scrapling-mcp` 的 `dsh-mcp-client` 条目 —— 它跑在自己的进程与会话里,**不经本插件的 URL 闸门** |
202
+ | `official-mcp` | 既不注册原生工具,也不起本插件的 server;宿主有 `mcpManager` 时它动态注册官方 `scrapling-mcp`,没有时由 `setup` 生成官方 `scrapling-mcp` 的 `dsh-mcp-client` 条目 —— 它跑在自己的进程与会话里,**不经本插件的 URL 闸门** |
199
203
 
200
204
  `mcp` 模式的 server 跑在插件自己的宿主进程里,调的还是同一个 sidecar,所以 URL 闸门、会话、作业与 adaptive 存储都是原生工具那一份 —— 不存在第二套实现可以漂移。
201
205
 
@@ -227,12 +231,12 @@ dsh-scrapling setup --status
227
231
  | `scrapling_screenshot` | `screenshot` |
228
232
  | —(只在 `ctx.web`) | `search` |
229
233
 
230
- 要接进 dsh 需要 `@deepseek-ai/dsh-mcp-client`,本插件刻意不依赖它。装与当期宿主同一条线的版本 —— npm 的 `latest` 比宿主还旧,宿主对不匹配的对端是直接拒绝:
234
+ 宿主有 `mcpManager` 服务时(rc.2 的 web/桌面组合包),插件在装载时把自己的 server 注册进去:不用装 `dsh-mcp-client`,也不用往 profile 加条目,只有 `mcpPort` 决定端点。下面的手工条目是给没有该服务的 CLI/headless profile 用的。升级上来的 profile 若还留着那条手工条目,切到动态注册时请把它删掉 —— 否则 manager 会因重名拒绝动态注册,实际仍由旧条目提供服务。
235
+
236
+ 要接进 dsh 需要 `@deepseek-ai/dsh-mcp-client`,本插件刻意不依赖它。装与宿主**逐版**相同的那一支 —— npm 的 `latest` 比宿主还旧,而客户端对宿主各包的 peer 是逐字同版,差一个预发布就会「装得上、永不生效」。默认是 `0.2.2-rc.2`;仍停在 rc.1 的宿主装 `0.2.2-rc.1`,`next` 跟官方 beta 线:
231
237
 
232
238
  ```bash
233
- dsh plugin --profile <名> add @deepseek-ai/dsh-mcp-client@0.2.2-rc.1
234
- # 宿主在 0.2.2-alpha.3 线时改用 @deepseek-ai/dsh-mcp-client@0.2.2-alpha.3
235
- # 宿主在 0.2.1-rc.5 线时改用 @deepseek-ai/dsh-mcp-client@0.2.1-rc.5
239
+ dsh plugin --profile <名> add @deepseek-ai/dsh-mcp-client@0.2.2-rc.2
236
240
  ```
237
241
 
238
242
  再往那个 profile 的 `cordis.patch.yml` 加一条(没配 token 就不写 `headers`):
@@ -265,9 +269,9 @@ dsh-scrapling setup --mode native --apply # 写出的文件里一条条目
265
269
  dsh-scrapling doctor --mode mcp --profile <profileDir>
266
270
  ```
267
271
 
268
- `doctor` 读的是 profile 自己写下的东西 —— `cordis.patch.yml` 加那份 `package.json` —— 每处问题打一行:`serverName: scrapling` 下有两条例目、本插件的条目与官方 `stdio` 那条并存、条目类型与模式不符、条目的端口与 `--port` 说的不一致、profile 里没有 `@deepseek-ai/dsh-mcp-client` 或它钉的不是 `0.2.2-rc.1` / `0.2.2-alpha.3` / `0.2.1-rc.5` / `next`、以及 `officialMcpEnabled` 关着却留着官方条目。退 `0` 是一致,`1` 是至少点出一处,`2` 是参数不对。`integrationMode` 本身是插件设置,CLI 读不到,所以 `--mode` 就是被核对的那一句声明,它必须和部署配置说的是同一件事。
272
+ `doctor` 读的是 profile 自己写下的东西 —— `cordis.patch.yml` 加那份 `package.json` —— 每处问题打一行:`serverName: scrapling` 下有两条例目、本插件的条目与官方 `stdio` 那条并存、条目类型与模式不符、条目的端口与 `--port` 说的不一致、profile 里没有 `@deepseek-ai/dsh-mcp-client` 或它钉的不是 `0.2.2-rc.2` / `0.2.2-rc.1` / `next`、以及 `officialMcpEnabled` 关着却留着官方条目。退 `0` 是一致,`1` 是至少点出一处,`2` 是参数不对。`integrationMode` 本身是插件设置,CLI 读不到,所以 `--mode` 就是被核对的那一句声明,它必须和部署配置说的是同一件事。
269
273
 
270
- `official-mcp` 要两处分开表态才会产出:profile 里的 `officialMcpEnabled: true`,以及命令行的 `--accept-risk`;缺任何一处只打 `OFFICIAL_MCP_DISABLED` / `RISK_NOT_ACCEPTED`,一个字节都不写。它生成的条目起的是 `<dataDir>/runtime/venv/bin/scrapling-mcp`,所以要先跑 `setup --feature mcp --apply` —— 见[运行时能力包](#运行时能力包macos-arm64)。那枚二进制不存在时,`setup` 会额外打一行说明这条条目现在起不来。
274
+ `setup` 生成 `official-mcp` 条目要两处分开表态:profile 里的 `officialMcpEnabled: true`,以及命令行的 `--accept-risk`;缺任何一处只打 `OFFICIAL_MCP_DISABLED` / `RISK_NOT_ACCEPTED`,一个字节都不写。装载时的宿主侧路径只由 `officialMcpEnabled` 决定:有 `mcpManager` 的宿主直接动态注册托管的 `scrapling-mcp`,`setup` 生成的 `dsh-mcp-client` 条目则留给没有该服务的 CLI/headless profile。两条路径起的都是 `<dataDir>/runtime/venv/bin/scrapling-mcp`,所以要先跑 `setup --feature mcp --apply` —— 见[运行时能力包](#运行时能力包macos-arm64)。那枚二进制不存在时,`setup` 会额外打一行说明这条条目现在起不来。
271
275
 
272
276
  ## <img src="https://api.iconify.design/lucide/sliders-horizontal.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 设置项
273
277
 
@@ -390,7 +394,9 @@ dsh-scrapling doctor --mode mcp --profile <profileDir>
390
394
  - **运行时能力包只在 macOS arm64 上验证过。** Windows、Linux 与 macOS x64 的所有包都报 `blocked`;安装器直接拒绝,不猜资产路径(B1/B2)。
391
395
  - **`adaptive-redis` 包是客户端,不是存储引擎。** 上游只发 `SQLiteStorageSystem`;这里的 Redis 后端是本插件的 `py/redis_storage.py`,一个按注册域分桶的 `StorageSystemMixin` 子类。启用它改变的是指纹存哪儿,属于部署决定而不是逐次开关。本插件自己的 MCP server 是另一件事 —— 它跑在宿主进程内,不需要能力包。
392
396
  - **Shopify 爬虫模式走店铺的 JSON 接口。** `mode=shopify` 用店铺的 `/collections.json` 与每个集合的 `/products.json`(上游的 `ShopifySpider`),按变体出行 —— `name`(商品名 + 变体名,`Default Title` 不拼)、`price`、`sku`、`stock`(有货为 `null`、缺货为 `0`)、`identifier`、`brand`、`category`、`image_url`、`url`、`barcode`、`old_price`、`description`。它不抓商品 HTML,URL 闸门、robots、间隔与并发与其他爬虫模式同一批旋钮。已在本地测试数据店上验证;真实 Shopify 店铺未跑过(B11)。
393
- - **`official-mcp` 只生成配置。** `integrationMode=official-mcp` 不注册原生工具、也不起本插件的 server;`setup --mode official-mcp --accept-risk` 交回官方 server 的 `dsh-mcp-client` 条目,而它指向的那枚二进制由 `mcp` 能力包提供(B10 就是这条条目背后那次风险确认)。
397
+ - **`maxPages` 收敛的是收进结果的页数,不是爬虫发出的请求量。** 链接发现层会继续请求队列里的页面(实测一次 `maxPages=3` 的爬取发出了约 680 个请求,收页 3)。对目标站点的礼貌性由部署侧旋钮控制:`crawlRespectRobots`、`crawlDownloadDelayMs`、`crawlConcurrentRequests`、`crawlAutothrottle`。
398
+ - **重资源站点在浏览器支路上可能等不到 `load` 事件。** 默认页面超时 30 秒内一直有资源在途时,`scrapling_session_fetch` / `scrapling_render` 以抓取失败收场,而同一 URL的静态抓取正常。缓解:`waitSelector`(等到关键元素出现)或 `disableResources`(拦截图片与字体),两者都是模型可按次传的参数。
399
+ - **`official-mcp` 接的是上游 server。** `integrationMode=official-mcp` 不注册原生工具、也不起本插件的 server;宿主有 `mcpManager`(rc.2 的 web 组合包)时动态注册托管的 `scrapling-mcp`,没有该服务(CLI/headless)时改由 `setup --mode official-mcp --accept-risk` 交回 `dsh-mcp-client` 条目。那枚二进制由 `mcp` 能力包提供(B10 就是这条条目背后那次风险确认)。
394
400
 
395
401
  ## <img src="https://api.iconify.design/lucide/circle-help.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 常见问题
396
402