dsh-web-search-plugin 0.6.0 → 0.7.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 CHANGED
@@ -4,6 +4,57 @@
4
4
 
5
5
  ## [未发布]
6
6
 
7
+ ## [0.7.1] - 2026-11-18
8
+
9
+ ### 变更
10
+
11
+ - 组合层禁用内置的「网页搜索与获取」设置页(`ui-settings-web-search`)。该页与本插件页面编辑同一对 `web` / `web-deepseek-api` 接缝,同时保留两个入口会让用户重复配置,也会让插件列表出现两个同名条目;插件启用时只保留本插件一个入口。关闭或卸载整个组合包会撤销该行,内置页面随之恢复。
12
+ - 搜索提供方补充 `title` 与中英 `description`,provider 选择器不再显示裸 ID `dsh-web-search`。
13
+ - 计费方式选项对齐官方措辞:自动 / 已登录的 DeepSeek 账号 / DeepSeek API Key,并按当前选择显示对应说明(需要先登录 DeepSeek 账号、使用「模型」页配置的 API Key)。
14
+ - 指南链接文案改为「网页搜索与获取指南」。
15
+ - 包版本与 User-Agent 更新为 `0.7.1`。
16
+
17
+ ## [0.7.0] - 2026-11-18
18
+
19
+ ### 破坏性变更
20
+
21
+ - 默认搜索提供方由 DeepSeek Messages 搜索改为 **DeepSeek Search API**,与 DSH `0.2.2` 自带的「网页搜索与获取」页一致;组合包默认把 `web.searchProvider` 设为 `deepseek-search-api`。
22
+ - 该默认需要 Host 提供 `web-deepseek-api`(DSH `0.2.1-rc.2` 起),因此移除 `0.2.0-rc.2` 的 peer 范围,保留 `0.2.1-rc.2`、`0.2.2-alpha.3`、`0.2.2-rc.4`。需要旧版搜索的 Profile 在卡片中选择 **DeepSeek(旧版)** 即可。
23
+
24
+ ### 新增
25
+
26
+ - 设置卡新增「计费方式」下拉(自动 / 账号 / API Key,默认自动),写入官方 `searchBilling` / `fetchBilling`,说明文字与官方一致:跟随当前会话的 DeepSeek 账号或 API Key;会话用其他模型时,优先用 API Key,没有则用已登录账号。
27
+ - 搜索与获取两个区块分别显示各自能力的计费方式;旧版 Host 没有该字段时不显示该行。
28
+
29
+ ### 修复
30
+
31
+ - 修复 DSH `0.2.2-rc.2` 及以上「DeepSeek Search API / Fetch API」配置区保存失败:官方把 `apiKey` / `apiKeyEnv` / `baseURL` 换成按能力拆分的字段后,插件继续写旧字段会被 `dsh-settings` 拒绝(`Config field "apiKey" is not volatile`)。
32
+ - 卡片按 Host 实际提供的 schema 自动切换:新版写 `searchApiKeyEnv` / `fetchApiKeyEnv` 与 `searchBaseURL` / `fetchBaseURL`,旧版继续写 `apiKeyEnv` / `baseURL`;新版不再渲染没有对应槽位的字面 API Key 行。
33
+
34
+ ### 变更
35
+
36
+ - 术语与说明文字对齐官方页面:网页搜索提供方 / 网页获取提供方、DeepSeek(旧版)、本机直接获取、单次请求最多搜索次数;补充「本机直接获取」的能力边界与 Fetch API 的计费说明。
37
+ - 提供方下拉下方改为显示当前选中提供方的一句话说明,DuckDuckGo 提示只在选择 SearXNG 时出现。
38
+ - 旧版 DeepSeek 的「模型」「最大 token」收进「高级设置」折叠区。
39
+ - 包版本与 User-Agent 更新为 `0.7.0`。
40
+
41
+ ### 兼容性
42
+
43
+ - 在 `0.2.2-rc.4`、`0.2.2-rc.3`、`0.2.2-rc.1`、`0.2.2-alpha.3` 的真实依赖上验证打包安装、Host 搜索接缝、配置切换与凭据就绪判断;新增客户端用例覆盖新旧两套 `web-deepseek-api` schema 的字段映射与计费行显隐。
44
+
45
+ ## [0.6.1] - 2026-11-10
46
+
47
+ ### 文档
48
+
49
+ - 插件详情页通过 `locale/zh.json` 和 `locale/en.json` 的 `meta.detail` 按界面语言展示独立介绍,包含随包提供的双语功能示意图、配置步骤、费用说明及帮助入口;旧版 Host 继续使用 README。
50
+
51
+ ### 兼容性
52
+
53
+ - 接纳 DSH `0.2.2-rc.1` 与 `0.2.2-alpha.3`,扩展 Cordis / Schemastery peer 范围,同时保留已有旧版范围。
54
+ - 为插件搜索接缝补齐 `ready(llmProvider)`,按当前引擎检查凭据是否配置,保留 Tavily keyless 与 SearXNG 的免密钥模式;就绪检查不请求搜索端点、不读取托管 API key 的明文。
55
+ - DeepSeek Messages 的就绪检查使用本次模型路由和搜索端点判断账号令牌;账号凭据缺失时可使用 API key,账号读取失败时按实际调用行为报告未就绪。
56
+ - 补充所有 REST 引擎、凭据来源回退、密钥动态更新及 DeepSeek 账号路由的回归检查;更新中英文运行要求和验证边界。
57
+
7
58
  ## [0.6.0] - 2026-10-20
8
59
 
9
60
  ### 新增
package/README.md CHANGED
@@ -2,21 +2,21 @@
2
2
 
3
3
  English | [中文](./README.zh.md)
4
4
 
5
- A web search plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) that gives your agent more search options through Harness's existing `web_search` tool. **Settings → Web search** contains two independent sections: **Search engines** (ten choices) and **Web retrieval** (local HTTP or DeepSeek Fetch API), with one Save action.
5
+ A web search plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) that gives your agent more search options through Harness's existing `web_search` tool. **Settings → Web search** contains two independent sections: **Web search provider** (ten choices) and **Web fetch provider** (local fetch or DeepSeek Fetch API), with one Save action.
6
6
 
7
7
  ## Why use this plugin?
8
8
 
9
9
  - **Avoid an extra DeepSeek model call for search.** DeepSeek Search API and the eight third-party backends call search APIs directly instead of DeepSeek's official model-backed search endpoint. This avoids the additional DeepSeek model token usage for that search request. (Your conversation and the model's processing of search results still use tokens, and search providers may charge their own fees or credits.)
10
10
  - **Configure everything in a settings card.** Switch engines, enter keys, and adjust result limits in **Settings → Web search**, then save. Changes take effect on the next search without restarting the plugin or editing YAML.
11
11
  - **Choose the search service that fits your needs.** Use Google results through Serper, semantic search through Exa, or a self-hosted SearXNG instance. Tavily's keyless mode lets you try search without an account or API key.
12
- - **Keep existing engines and settings.** Messages search and third-party engines remain available. Search and retrieval are selected independently; see [Disable or uninstall](#disable-or-uninstall) before removing saved provider overrides.
12
+ - **Keep existing engines and settings.** Legacy Messages search and third-party engines remain available. Search and fetch are selected independently; see [Disable or uninstall](#disable-or-uninstall) before removing saved provider overrides.
13
13
 
14
- **The default engine is still DeepSeek Messages search.** To avoid the extra official search model call, select **DeepSeek Search API** or a third-party engine in the settings card after installation and save your changes. Selecting DeepSeek Messages search uses the official search API and may incur model invocation charges.
14
+ **The default search provider is DeepSeek Search API**, matching the Harness default: it reuses the in-box `deepseek-search-api` and adds no auxiliary model call. To use legacy search instead, select **DeepSeek (legacy)** in the card; it sends an extra Messages request and may incur model invocation charges.
15
15
 
16
16
  ## Supported providers
17
17
 
18
18
  - **DeepSeek Search API** — Reuses rc.2's official `deepseek-search-api`. Direct `/v1/tools/search` requests without an auxiliary model turn. Its `count` is 1–50 (default 10), further bounded by the calling tool; it does not use this plugin's `maxResults`.
19
- - **DeepSeek Messages search (installation default)** — Uses DeepSeek's Anthropic-compatible Messages API with the native search tool type `web_search_20250305`. Supports account tokens or `DEEPSEEK_API_KEY`. Each search sends a model request and may incur model invocation charges.
19
+ - **DeepSeek (legacy)** — Uses DeepSeek's Anthropic-compatible Messages API with the native search tool type `web_search_20250305`. Models on the account route use the signed-in account; every other request uses `DEEPSEEK_API_KEY`. Each search sends a model request and may incur model invocation charges.
20
20
  - **Tavily** — Supports `keyless` access (free, rate-limited, no account required) or `keyed` access (`TAVILY_API_KEY`, Bearer token). The settings card shows a quota bar in keyed mode.
21
21
  - **Brave Search** — Calls `GET https://api.search.brave.com/res/v1/web/search` with the `X-Subscription-Token` header (credential name: `BRAVE_API_KEY`). Each search is one HTTP request and does not consume a model turn. The settings card displays Capacity and monthly quota from response headers.
22
22
  - **Serper** — Google results via `POST /search`, using the `X-API-KEY` header (credential name: `SERPER_API_KEY`).
@@ -30,8 +30,10 @@ For DuckDuckGo results, choose a SearXNG instance that aggregates DuckDuckGo. Du
30
30
 
31
31
  ## Requirements
32
32
 
33
- - Verified with DeepSeek Harness `0.2.1-rc.2`. New Search / Fetch options require the Host's `web` and `web-deepseek-api` configuration namespaces. Compatible `0.2.0-rc.2` Hosts retain existing engines; unavailable API options are disabled.
34
- - Node.js `^22.19.0` or `>=24.0.0`
33
+ - Isolated checks use the actual dependencies of DeepSeek Harness `0.2.2-rc.1`, `0.2.2-alpha.3`, and older `0.2.1-rc.5`, covering packed installation, the Host web seam, configuration changes, and credential readiness. Supplier HTTP responses are mocked; this does not verify live accounts or the Desktop settings UI end to end.
34
+ - The default DeepSeek Search API needs the Host's `web` and `web-deepseek-api` layers (DSH `0.2.1-rc.2` and later). Peer ranges cover `0.2.1-rc.2`, `0.2.2-alpha.3`, and `0.2.2-rc.4` and later; pick another engine when the layer is absent.
35
+ - DSH `0.2.2` RC / alpha requires Node.js `>=24.9.0`. The plugin retains Node.js `^22.19.0` or `>=24.0.0` for older Hosts.
36
+ - Hosts with tool readiness checks hide the plugin's search tool when required credentials are missing. Tavily keyless and SearXNG remain usable without a key. DeepSeek Messages checks account credentials against the pending model route, rather than the preceding request's route; readiness does not validate keys over the network.
35
37
  - pnpm, used by `dsh plugin` to install the plugin into a profile
36
38
 
37
39
  ## Installation
@@ -47,7 +49,7 @@ After installation, configure the plugin in the Harness Web UI:
47
49
  1. Open **Settings → Web search** and find the plugin's settings card. The sidebar's **Plugins** page controls whether the bundle is enabled; engine settings live in this card.
48
50
  2. Choose a search engine. For direct API search without an extra DeepSeek model call, select DeepSeek Search API, Tavily, Brave, Serper, SerpApi, Exa, SearXNG, Scavio, or Firecrawl.
49
51
  3. Enter the engine's API key if required. Engines that require a key show “Get API key ↗”, which opens the official dashboard. For Tavily without a key, choose `keyless`; for SearXNG, set an instance URL with JSON search enabled. These two keyless options do not show a key dashboard link. Existing credentials can be reused, such as `BRAVE_API_KEY` for Brave.
50
- 4. Under **Web retrieval**, independently select local HTTP (default) or DeepSeek Fetch API.
52
+ 4. Under **Web fetch provider**, independently select local fetch (default) or DeepSeek Fetch API.
51
53
  5. Adjust parameters and click **Save** at the bottom. Unsaved changes remain drafts; the next operation uses the saved settings.
52
54
 
53
55
  > For installation from a local source checkout, including Windows cross-drive considerations, see [Development → Local installation and verification](#local-installation-and-verification).
@@ -56,13 +58,17 @@ After installation, configure the plugin in the Harness Web UI:
56
58
 
57
59
  For normal use, configure the plugin in **Settings → Web search**. The card shows options for the selected engine and retrieval method. Existing engine settings use `dsh-web-search-plugin`; new API settings use `web-deepseek-api`, and provider selection uses `web` in the current profile. The tables below include advanced fields hidden from the card.
58
60
 
59
- ### New Search API and web retrieval
61
+ ### New Search API and web fetch
60
62
 
61
- The page reuses the official providers rather than registering duplicate implementations. Selecting the new Search API sets `web.searchProvider: deepseek-search-api`. Selecting an existing engine restores `dsh-web-search` and saves the plugin's `provider`. Retrieval independently selects `web.fetchProvider: http` or `deepseek-fetch-api`. Existing custom fetch providers are shown and preserved until explicitly changed.
63
+ The page reuses the official providers rather than registering duplicate implementations. The installation default already sets `web.searchProvider: deepseek-search-api`. Selecting an engine this bundle serves restores `dsh-web-search` and saves the plugin's `provider`. Fetch independently selects `web.fetchProvider: http` or `deepseek-fetch-api`. Existing custom fetch providers are shown and preserved until explicitly changed.
62
64
 
63
- Search API and Fetch API share the official `web-deepseek-api` namespace: `apiKeyEnv` (default `DEEPSEEK_API_KEY`), `baseURL` (default `https://api.deepseek.com/v1/tools`), and the credential. Only one API configuration is shown when both are selected. Messages endpoint/model/key settings remain separate. API `count` controls returned results, not requests or spending. The official advanced `sendOriginalQuestion` setting defaults to true: search sends the triggering question with whitespace normalized and at most 128 characters. It can be disabled in the official configuration; this page preserves it.
65
+ From DSH `0.2.2-rc.2`, `web-deepseek-api` splits the credential and endpoint per capability. The card's **Credential reference** and **Base URL** rows write `searchApiKeyEnv` / `fetchApiKeyEnv` and `searchBaseURL` / `fetchBaseURL`; older Hosts still receive `apiKeyEnv` / `baseURL`. The card follows the schema the Host actually serves and never writes a field it lacks.
64
66
 
65
- Recommended: **DeepSeek Search API + local HTTP**. Search avoids an auxiliary model call. Local HTTP requests the target from the device running DSH without calling paid Fetch. DeepSeek Fetch is optional remote Markdown retrieval; it does not guarantee access to every site. Local HTTP does not execute JavaScript. Tool results still consume main-conversation tokens. No automatic engine or paid retrieval fallback occurs.
67
+ **Billing** maps to the official `searchBilling` / `fetchBilling` (`Automatic` / `Account` / `API key`, default Automatic) with the official explanation: it follows the conversation's DeepSeek account or API key, prefers the API key when the conversation uses another model, and falls back to the signed-in account. Older Hosts have no such field, so the row is hidden there.
68
+
69
+ API `count` controls returned results, not requests or spending. The official advanced `sendOriginalQuestion` setting defaults to true: search sends the triggering question with whitespace normalized and at most 128 characters. It can be disabled in the official configuration; this page preserves it.
70
+
71
+ Recommended and installed default: **DeepSeek Search API + local fetch**. Search avoids an auxiliary model call. Local fetch requests the target from the device running DSH without calling paid Fetch; it reaches intranet and local addresses but runs no JavaScript and cannot read PDFs. DeepSeek Fetch is optional remote Markdown retrieval, cannot reach the intranet or this machine, and does not guarantee access to every site. Tool results still consume main-conversation tokens. No automatic engine or paid fetch fallback occurs.
66
72
 
67
73
  See [official billing](https://api-docs.deepseek.com/zh-cn/guides/search/#计费) for current successful-request prices and conditions. Estimated costs are not presented as an actual bill.
68
74
 
@@ -74,7 +80,7 @@ The tables below describe the original nine plugin backends; new Search API conf
74
80
 
75
81
  | Key | Default | Meaning and scope |
76
82
  |---|---|---|
77
- | `provider` | `deepseek-official` | Active engine: `deepseek-official`, `tavily`, `brave`, `serper`, `serpapi`, `exa`, `searxng`, `scavio`, or `firecrawl`. Each request uses only the selected engine, with no automatic failover to another engine on error. Unknown values fall back to official DeepSeek |
83
+ | `provider` | `deepseek-search-api` | Active backend: `deepseek-search-api` (default; reuses the in-box provider, so `web.searchProvider` matches), `deepseek-official` (legacy Messages), `tavily`, `brave`, `serper`, `serpapi`, `exa`, `searxng`, `scavio`, or `firecrawl`. Each request uses only the selected backend, with no automatic failover on error. Unknown values fall back to legacy DeepSeek |
78
84
  | `maxResults` | `8` | Maximum returned sources for the original nine plugin backends (excluding the independent new Search API), from 1–20, also capped by the caller's `request.maxResults`. SearXNG and Scavio send no request-level count parameter; their results are truncated after retrieval and URL deduplication. The upstream response determines how many results are actually available |
79
85
 
80
86
  ### Keys and credential references
@@ -126,7 +132,7 @@ Clearing a text input or using “Restore default” in the card normally remove
126
132
  </thead>
127
133
  <tbody>
128
134
  <tr>
129
- <td rowspan="4"><strong>DeepSeek Messages search</strong></td>
135
+ <td rowspan="4"><strong>DeepSeek (legacy)</strong></td>
130
136
  <td><code>deepseekModel</code></td>
131
137
  <td><code>deepseek-flash</code></td>
132
138
  <td>Model used only for the DeepSeek search request; does not change the conversation's chat model. Must be supported by the target endpoint</td>
@@ -139,7 +145,7 @@ Clearing a text input or using “Restore default” in the card normally remove
139
145
  <tr>
140
146
  <td><code>deepseekMaxTokens</code></td>
141
147
  <td><code>4096</code></td>
142
- <td>Maximum generated tokens for one DeepSeek Messages search request, a positive integer; not a conversation-wide token limit</td>
148
+ <td>Maximum generated tokens for one legacy DeepSeek search request, a positive integer; not a conversation-wide token limit; shown under Advanced settings</td>
143
149
  </tr>
144
150
  <tr>
145
151
  <td><code>deepseekMaxUses</code></td>
@@ -206,7 +212,7 @@ The startup environment variable `DSH_WEB_SEARCH_PROVIDER=dsh-web-search` select
206
212
 
207
213
  ## Quotas
208
214
 
209
- - **DeepSeek Messages search**: No quota bar. Search still makes a model request, with usage subject to your account or API billing.
215
+ - **DeepSeek (legacy)**: No quota bar. Search still makes a model request, with usage subject to your account or API billing.
210
216
  - **Tavily keyless**: No quota bar; access is free and rate-limited.
211
217
  - **Tavily keyed**: Requests `include_usage` during searches and accumulates credits for the current credential in memory. The Host periodically calls `GET /usage`, and the settings card supports manual refresh. Manual refreshes must be at least 10 seconds apart; automatic reconciliation is not subject to this limit. The quota comes from `account.current_plan` / `plan_limit`; usage is the larger of the local total for the current credential and the remote value. Changing keys clears the previous account's usage and triggers immediate reconciliation. Tavily quota data is no longer persisted to disk.
212
218
  - **Brave**: No usage/spending endpoint. Dashboard **Capacity** represents the per-second window from response headers (for example, 50 requests/second). A monthly limit of `0` means unlimited requests, not an exhausted quota. Billing credits are available only in the [Brave API dashboard](https://api-dashboard.search.brave.com/).
@@ -214,15 +220,15 @@ The startup environment variable `DSH_WEB_SEARCH_PROVIDER=dsh-web-search` select
214
220
 
215
221
  ## Disable or uninstall
216
222
 
217
- ### Switch to DeepSeek Messages search first
223
+ ### Switch back to legacy DeepSeek search
218
224
 
219
- If you only want to use official search again, select **DeepSeek Messages search** in **Settings → Web search** and save. There is no need to disable or uninstall this plugin. The next search uses the official search API through this plugin and may still incur model invocation charges.
225
+ The installation default is already the official Search API, matching DSH's own page. To use legacy Messages search, select **DeepSeek (legacy)** in **Settings → Web search** and save. There is no need to disable or uninstall this plugin. It sends an extra Messages model request and may incur model invocation charges.
220
226
 
221
227
  ### Disable and restore built-in search
222
228
 
223
229
  Use the following steps when you want to stop using this plugin and restore Harness's original search plugin. Selecting this plugin's DeepSeek engine and restoring the original plugin are separate operations.
224
230
 
225
- Open **Plugins** in the sidebar and turn off the **entire `dsh-web-search-plugin` bundle**. This removes its composition layer and re-enables the built-in Messages search plugin. Explicit provider settings saved through this page remain in the profile: review `web.searchProvider` and `web.fetchProvider` and remove the overrides to restore profile defaults. You can turn the bundle back on later.
231
+ Open **Plugins** in the sidebar and turn off the **entire `dsh-web-search-plugin` bundle**. This removes its composition layer and re-enables the built-in Messages search plugin and the built-in Web search & fetch settings page. Explicit provider settings saved through this page remain in the profile: review `web.searchProvider` and `web.fetchProvider` and remove the overrides to restore profile defaults. You can turn the bundle back on later.
226
232
 
227
233
  Use the bundle's main switch: disabling only an individual component inside the bundle leaves its other configuration overrides in place. Profiles with configuration hot reload apply the change immediately; otherwise, restart Harness.
228
234
 
@@ -242,7 +248,7 @@ The same checks for manually added overrides apply after uninstallation. Explici
242
248
 
243
249
  The plugin registers a single `WebSearchProvider` with the stable ID `dsh-web-search` through `ctx.web`, following the same provider contract as `@deepseek-ai/dsh-web-search-deepseek` (`inject: ['web']` and `ctx.web.registerSearchProvider`). The original nine engines share this provider; selecting the new Search API switches to the official provider, independently of retrieval. Results are normalized to `WebSearchResult` (optional `content` and `sources[]`) and deduplicated by URL. All configuration fields use `volatile()`, so saved settings are read without restarting the plugin.
244
250
 
245
- This package is a **bundle**. The `dsh.bundle.patch` declaration points to `cordis.patch.yml`, which adds the Host entry, selects `dsh-web-search`, and disables the built-in `web-search-deepseek` Host plugin while the bundle is enabled. The plugin's internal `deepseek-official` engine option is distinct from its registered `dsh-web-search` ID. Disabling the entire bundle removes this patch layer; disabling only its Host entry does not. Without a bundle declaration, `dsh plugin add` only adds the dependency and does not mount the plugin.
251
+ This package is a **bundle**. The `dsh.bundle.patch` declaration points to `cordis.patch.yml`, which adds the Host entry, selects `deepseek-search-api` as the default search provider (matching the Harness default), and disables both the built-in `web-search-deepseek` Host plugin and the `ui-settings-web-search` settings page while the bundle is enabled. That page edits the same `web` / `web-deepseek-api` seams as this plugin, so keeping both would leave two entry points for one configuration. Selecting any backend this bundle serves switches `web.searchProvider` to `dsh-web-search`; the plugin's internal `deepseek-official` backend option is distinct from that registered ID. Disabling the entire bundle removes this patch layer; disabling only its Host entry does not. Without a bundle declaration, `dsh plugin add` only adds the dependency and does not mount the plugin.
246
252
 
247
253
  - **DeepSeek** — Calls `POST {deepseekBaseURL}/messages` with the `web_search_20250305` tool. If the session uses the official DeepSeek account route (provider: `deepseek-account`) and the account service allows the endpoint, the request uses an account token in `x-dsh-auth-token`. Otherwise, it falls back to an API key (`x-api-key` / `authorization: Bearer`, credential name: `DEEPSEEK_API_KEY`). When a session initiator is available, a redacted request is recorded as the session event `web/deepseek-search-llm-request` before dispatch.
248
254
  - **REST backends (Tavily / Brave / Serper / SerpApi / Exa / SearXNG / Scavio / Firecrawl)** — Driven by a static metadata table (`lib/providers.js`) and a shared backend (`lib/rest.js`). Table rows define the request method, path, query field names, authentication (`bearer` / `header` / `none` / `query`), fixed parameters, and response shape. REST backends do not append custom session events.
@@ -271,6 +277,16 @@ cordis.patch.yml Bundle patch: adds Host entry, sets searchProvider, disables
271
277
 
272
278
  ## Development
273
279
 
280
+ ### Host compatibility checks
281
+
282
+ Run `test/host-compatibility.mjs` against a disposable directory with a `private: true` package manifest. Install the plugin's local `.tgz` and the target Host's Web, Settings, Credentials, Launch Environment, LLM, Cordis and Schemastery dependencies using `--strict-peer-deps --ignore-scripts`.
283
+
284
+ ```powershell
285
+ node test/host-compatibility.mjs "<disposable-fixture-directory>"
286
+ ```
287
+
288
+ The script uses real Cordis/Web modules and the packed plugin with fake credential services and supplier HTTP. It checks loading, search, result limits, cancellation, configuration changes, keyless modes, credential updates, account routing and disposal. It does not use an existing DSH profile or verify live suppliers or browser layout.
289
+
274
290
  ### Local installation and verification
275
291
 
276
292
  After editing the source, install the checkout into a profile (using `web` as the example) for local verification. If the checkout and profile are on the **same drive**, you can use a relative path:
@@ -326,6 +342,12 @@ locale/zh.json {"meta": {"title": "网页搜索", "description": "…"}}
326
342
 
327
343
  Settings card text comes from the `zh` and `en` dictionaries in `lib/client.js`. Keep their keys aligned when editing them.
328
344
 
345
+ ### Plugin detail pages
346
+
347
+ DSH versions that support `meta.detail` select `assets/detail/*.md` through `locale/zh.json` or `locale/en.json` using the interface language, with images loaded from the installed package. The full README remains the usage and development reference. Other languages follow the Host language fallback chain; older Hosts continue to use the README.
348
+
349
+ Image paths are relative to the detail document. When updating these pages, keep the `meta.detail` targets and image paths valid, and use `npm pack --dry-run --json` to confirm that both Markdown and images are included.
350
+
329
351
  ## Publishing
330
352
 
331
353
  GitHub Actions (`.github/workflows/publish.yml`) handles publishing automatically. **Pushing a `v*` tag that matches the version in `package.json`** publishes to npm with provenance. Ordinary pushes to `main` do not publish a package.
package/README.zh.md CHANGED
@@ -2,21 +2,22 @@
2
2
 
3
3
  [English](./README.md) | 中文
4
4
 
5
- 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)的 Agent 提供更多联网搜索选择,沿用 Harness 原有的 `web_search` 工具。在 **设置 → 网页搜索** 一个入口中,分为 **搜索引擎**(10 个选项)和 **网页抓取**(本地 HTTP 或 DeepSeek Fetch API),独立选择后统一保存。
5
+ 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)的 Agent 提供更多联网搜索选择,沿用 Harness 原有的 `web_search` 工具。在 **设置 → 网页搜索** 一个入口中,分为 **网页搜索提供方**(10 个选项)和 **网页获取提供方**(本机直接获取 或 DeepSeek Fetch API),独立选择后统一保存。
6
6
 
7
7
  ## 为什么使用本插件?
8
8
 
9
9
  - **减少搜索时额外的 DeepSeek 模型调用。** 新版 DeepSeek Search API 和 8 个第三方后端直接请求搜索 API,不经过 DeepSeek 官方的模型搜索接口,因此不会产生该次搜索请求额外的 DeepSeek 模型 token 消耗。(对话本身和模型读取搜索结果仍会消耗 token,搜索服务也可能单独收取费用或扣除额度。)
10
- - **在设置卡片中完成配置。** 在 **设置 → 网页搜索** 中切换引擎、填写密钥、调整结果数量,保存后下一次搜索即可生效,无需重启插件或编辑 YAML。
10
+ - **在设置卡片中完成配置。** 在 **设置 → 网页搜索** 中切换搜索与获取提供方、填写密钥、调整结果数量,保存后下一次搜索即可生效,无需重启插件或编辑 YAML。
11
11
  - **按需求选择搜索服务。** 可以通过 Serper 获取 Google 结果,使用 Exa 进行语义搜索,或接入自建 SearXNG。Tavily 的 keyless 模式无需账号和 API key,方便先体验。
12
- - **保留已有引擎与设置。** Messages 和第三方引擎继续可用,搜索与抓取独立选择;移除已保存的提供方覆盖前,请参考[停用或卸载](#停用或卸载)。
12
+ - **对齐官方配置项。** 提供方名称、说明文字和默认值与 DSH 自带的 **网页搜索与获取** 页面一致:默认使用 DeepSeek Search API,抓取默认由本机直接获取。
13
+ - **保留已有引擎与设置。** 旧版 Messages 和第三方引擎继续可用,搜索与获取独立选择;移除已保存的提供方覆盖前,请参考[停用或卸载](#停用或卸载)。
13
14
 
14
- **默认引擎仍为 DeepSeek Messages 搜索。** 若要避免官方搜索额外的模型调用,安装后可在设置卡片中选择 **DeepSeek Search API** 或第三方引擎并保存。选择 DeepSeek Messages 搜索时,会使用官方搜索 API,可能产生模型调用费用。
15
+ **默认搜索提供方为 DeepSeek Search API**(与 DSH 默认一致),即复用官方 `deepseek-search-api`,不产生搜索时的辅助模型调用。若要用旧版搜索,可在卡片中选择 **DeepSeek(旧版)**;它会发起额外 Messages 模型请求,可能产生模型调用费用。
15
16
 
16
17
  ## 支持的搜索后端
17
18
 
18
- - **DeepSeek Search API** — 复用 DSH rc.2 的官方 `deepseek-search-api`,直接请求 `/v1/tools/search`,无辅助模型轮次。结果数使用官方 `count`(1–50,默认 10)并受调用工具上限约束,不读取本插件的 `maxResults`。
19
- - **DeepSeek Messages 搜索(安装默认)** — 使用 DeepSeek 的 Anthropic 兼容 Messages API,原生搜索工具类型为 `web_search_20250305`,支持账号令牌或 `DEEPSEEK_API_KEY`。每次搜索会发起模型请求,可能产生模型调用费用。
19
+ - **DeepSeek Search API(安装默认)** — 复用 DSH 官方 `deepseek-search-api`,直接请求 `/v1/tools/search`,无辅助模型轮次。结果数使用官方 `count`(1–50,默认 10),计费方由官方 `searchBilling`(自动 / 账号 / API Key,默认自动)决定。不读取本插件的 `maxResults`。
20
+ - **DeepSeek(旧版)** — 使用 DeepSeek 的 Anthropic 兼容 Messages API,原生搜索工具类型为 `web_search_20250305`,账号模型发起的请求用已登录账号,其他请求用 `DEEPSEEK_API_KEY`。每次搜索会发起模型请求,可能产生模型调用费用。
20
21
  - **Tavily** — `keyless`(免费、限流、无需账号)或 `keyed`(`TAVILY_API_KEY`,Bearer token)。keyed 会在设置卡显示额度进度条。
21
22
  - **Brave Search** — `GET https://api.search.brave.com/res/v1/web/search`,请求头 `X-Subscription-Token`(凭据名 `BRAVE_API_KEY`)。一次搜索就是一次 HTTP 请求,不走模型轮次;设置卡按响应头展示 Capacity / 月配额。
22
23
  - **Serper** — Google 结果(`POST /search`,头 `X-API-KEY`,凭据名 `SERPER_API_KEY`)。
@@ -30,8 +31,10 @@
30
31
 
31
32
  ## 运行要求
32
33
 
33
- - 已验证 DeepSeek Harness `0.2.1-rc.2`。新版 Search / Fetch 需要 Host 提供 `web` 与 `web-deepseek-api` 配置;兼容的 `0.2.0-rc.2` Host 可继续使用原有引擎,不可用的新版 API 选项会禁用。
34
- - Node.js `^22.19.0` 或 `>=24.0.0`
34
+ - 已在 DeepSeek Harness `0.2.2-rc.4`、`0.2.2-rc.3`、`0.2.2-rc.1`、`0.2.2-alpha.3` 和旧版 `0.2.1-rc.5` 的实际依赖上进行隔离验证,覆盖打包安装、Host 搜索接缝、配置切换与凭据就绪判断;供应商 HTTP 使用模拟响应,不代表真实账号联网或桌面设置页端到端验证。
35
+ - 默认的 DeepSeek Search API 需要 Host 提供 `web` 与 `web-deepseek-api` 配置(DSH `0.2.1-rc.2` 起)。依赖范围为 `0.2.1-rc.2`、`0.2.2-alpha.3` 与 `0.2.2-rc.4` 及以上;缺少该层时应改选其他引擎。
36
+ - DSH `0.2.2` 的 RC / alpha 要求 Node.js `>=24.9.0`;插件在旧版 Host 上保留 Node.js `^22.19.0` 或 `>=24.0.0` 的运行范围。
37
+ - 支持工具就绪检查的 Host 会在缺少所需凭据时隐藏插件搜索工具;Tavily keyless 与 SearXNG 无需密钥。DeepSeek(旧版)按本次模型路由判断账号令牌与 API key,不使用上一轮路由预判,也不联网校验密钥有效性。
35
38
  - pnpm,用于通过 `dsh plugin` 把插件装进 profile
36
39
 
37
40
  ## 安装
@@ -45,9 +48,9 @@ dsh plugin --profile web add dsh-web-search-plugin
45
48
  安装后,在 Harness Web 界面中完成配置:
46
49
 
47
50
  1. 打开 **设置 → 网页搜索**,找到本插件的设置卡片。侧栏的 **插件** 页面负责启用或停用组合包,引擎参数在设置卡片中配置。
48
- 2. 选择搜索引擎。若要直接调用搜索 API、避免额外的 DeepSeek 模型调用,可选 DeepSeek Search API、Tavily、Brave、Serper、SerpApi、Exa、SearXNG、Scavio 或 Firecrawl。
51
+ 2. 选择网页搜索提供方。默认是 DeepSeek Search API;也可选 DeepSeek(旧版)、Tavily、Brave、Serper、SerpApi、Exa、SearXNG、Scavio 或 Firecrawl。
49
52
  3. 按需填写所选引擎的 API key,需要密钥的引擎会显示「获取 API key ↗」,点击即可打开官方控制台。Tavily 免 key 使用时选择 `keyless`;SearXNG 填写已启用 JSON 搜索的实例地址,这两种免 key 方式不显示密钥获取链接。已有凭据可以复用,例如 Brave 的 `BRAVE_API_KEY`。
50
- 4. 在 **网页抓取** 中选择本地 HTTP(默认)或 DeepSeek Fetch API。更换搜索引擎不会更改抓取方式。
53
+ 4. 在 **网页获取提供方** 中选择本机直接获取(默认)或 DeepSeek Fetch API。更换搜索提供方不会更改获取方式。
51
54
  5. 调整参数并点击页面底部的 **保存**;保存前只修改草稿,下一次操作使用已保存配置。
52
55
 
53
56
  > 从源码仓库本地安装(含 Windows 跨盘注意事项)见 [开发 → 本地安装与验证](#本地安装与验证)。
@@ -56,13 +59,17 @@ dsh plugin --profile web add dsh-web-search-plugin
56
59
 
57
60
  日常使用在 **设置 → 网页搜索** 的卡片中配置即可。原有引擎参数保存在当前 Profile 的 `dsh-web-search-plugin`,新版 API 参数保存在 `web-deepseek-api`,提供方选择保存在 `web`。下表包含卡片中隐藏的高级字段,并非所有字段都会同时显示。
58
61
 
59
- ### 新版 Search API 与网页抓取
62
+ ### 新版 Search API 与网页获取
60
63
 
61
- 页面复用官方提供方,不重复注册 Search / Fetch。选择新版搜索会将 `web.searchProvider` 设为 `deepseek-search-api`;切回原有引擎则恢复 `dsh-web-search`,并保存本插件的 `provider`。`web.fetchProvider` 独立选择 `http` 或 `deepseek-fetch-api`。已有自定义抓取提供方会显示并保留,除非用户主动更改。
64
+ 页面复用官方提供方,不重复注册 Search / Fetch。安装默认的 `web.searchProvider` 即 `deepseek-search-api`;切回本插件提供的引擎时恢复 `dsh-web-search`,并保存本插件的 `provider`。`web.fetchProvider` 独立选择 `http` 或 `deepseek-fetch-api`。已有自定义获取提供方会显示并保留,除非用户主动更改。
62
65
 
63
- 新版 Search 和 Fetch 共用 `web-deepseek-api` 命名空间中的 `apiKeyEnv`(默认 `DEEPSEEK_API_KEY`)、`baseURL`(默认 `https://api.deepseek.com/v1/tools`)和凭据。两者同时启用时只显示一份 API 配置;旧 Messages 地址、模型和密钥配置独立保留。`count` 只控制新版搜索的结果数,不是请求次数或费用上限。官方高级配置 `sendOriginalQuestion` 默认开启,搜索时会发送经规整且最多 128 字符的触发问题;可在官方配置中关闭,本页面保留该值。
66
+ `web-deepseek-api` 在 DSH `0.2.2-rc.2` 起把凭据与地址拆成按能力分开的字段。卡片的「凭据引用名」和「基础地址」会同时写入 `searchApiKeyEnv` / `fetchApiKeyEnv` 与 `searchBaseURL` / `fetchBaseURL`;更早的 Host 仍写 `apiKeyEnv` / `baseURL`。卡片按 Host 实际提供的 schema 自动切换,不会向不存在的字段写入。
64
67
 
65
- 推荐组合为 **DeepSeek Search API + 本地 HTTP**。Search 不发起辅助模型请求;本地 HTTP 从运行 DSH 的设备直接访问目标网站,不调用收费 Fetch API。DeepSeek Fetch 是可选的远端 Markdown 抓取,不保证能读取所有网站;本地 HTTP 不执行页面 JavaScript。工具结果交给主模型后仍占用会话 token。没有自动切换引擎或付费抓取兜底。
68
+ 「计费方式」对应官方 `searchBilling` / `fetchBilling`(自动 / 账号 / API Key,默认自动),说明文字与官方页面一致:跟随当前会话的 DeepSeek 账号或 API Key;会话用其他模型时,优先用 API Key,没有则用已登录账号。旧版 Host 没有这两个字段,卡片不显示该行。
69
+
70
+ `count` 只控制新版搜索的结果数,不是请求次数或费用上限。官方高级配置 `sendOriginalQuestion` 默认开启,搜索时会发送经规整且最多 128 字符的触发问题;可在官方配置中关闭,本页面保留该值。
71
+
72
+ 推荐组合为 **DeepSeek Search API + 本机直接获取**,也就是安装默认值。Search 不发起辅助模型请求;本机直接获取从运行 DSH 的设备访问目标网站,不调用收费 Fetch API,可访问内网和本机但不能执行页面 JavaScript,也不支持 PDF。DeepSeek Fetch 是可选的远端 Markdown 抓取,无法访问内网和本机,不保证能读取所有网站。工具结果交给主模型后仍占用会话 token。没有自动切换引擎或付费获取兜底。
66
73
 
67
74
  [官方计费说明](https://api-docs.deepseek.com/zh-cn/guides/search/#计费):Search / Fetch 均按成功且产生结果的请求收费;价格请以官方文档为准。界面不将估算金额当作实际账单。
68
75
 
@@ -74,7 +81,7 @@ dsh plugin --profile web add dsh-web-search-plugin
74
81
 
75
82
  | 键 | 默认值 | 含义与范围 |
76
83
  |---|---|---|
77
- | `provider` | `deepseek-official` | 当前搜索引擎:`deepseek-official`、`tavily`、`brave`、`serper`、`serpapi`、`exa`、`searxng`、`scavio` 或 `firecrawl`。一次请求只使用所选引擎,不会在失败后自动切换到其他引擎;未知值会回退到 DeepSeek 官方引擎 |
84
+ | `provider` | `deepseek-search-api` | 当前搜索提供方:`deepseek-search-api`(默认,复用官方提供方,此时 `web.searchProvider` 也是它)、`deepseek-official`(旧版 Messages)、`tavily`、`brave`、`serper`、`serpapi`、`exa`、`searxng`、`scavio` 或 `firecrawl`。一次请求只使用所选后端,不会在失败后自动切换到其他后端;未知值会回退到 DeepSeek(旧版) |
78
85
  | `maxResults` | `8` | 本插件原有九个后端的返回源数量上限(不含独立的新版 Search API),范围 1–20,同时受调用方 `request.maxResults` 上限约束。SearXNG 和 Scavio 不发送请求级数量参数,只在收到响应并按 URL 去重后截取;实际可返回的数量取决于上游结果 |
79
86
 
80
87
  ### 密钥与凭据引用
@@ -126,10 +133,10 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
126
133
  </thead>
127
134
  <tbody>
128
135
  <tr>
129
- <td rowspan="4"><strong>DeepSeek Messages 搜索</strong></td>
136
+ <td rowspan="4"><strong>DeepSeek(旧版)</strong></td>
130
137
  <td><code>deepseekModel</code></td>
131
138
  <td><code>deepseek-flash</code></td>
132
- <td>仅 DeepSeek 搜索请求使用的模型名,不会修改会话的聊天模型;需由目标端点支持</td>
139
+ <td>仅 DeepSeek(旧版)搜索请求使用的模型名,不会修改会话的聊天模型;需由目标端点支持;设置卡收在「高级设置」中</td>
133
140
  </tr>
134
141
  <tr>
135
142
  <td><code>deepseekApiVersion</code></td>
@@ -139,12 +146,12 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
139
146
  <tr>
140
147
  <td><code>deepseekMaxTokens</code></td>
141
148
  <td><code>4096</code></td>
142
- <td>单次 DeepSeek Messages 搜索请求的生成 token 上限,正整数;不是整个对话的 token 上限</td>
149
+ <td>单次 DeepSeek(旧版)搜索请求的生成 token 上限,正整数;不是整个对话的 token 上限;设置卡收在「高级设置」中</td>
143
150
  </tr>
144
151
  <tr>
145
152
  <td><code>deepseekMaxUses</code></td>
146
153
  <td><code>5</code></td>
147
- <td>单次 DeepSeek Messages 请求中原生 <code>web_search</code> 工具的最大使用次数,正整数;不是引擎重试次数或结果数量</td>
154
+ <td>单次 DeepSeek(旧版)请求允许的服务端搜索次数上限,须为正整数,默认 5;不是引擎重试次数或结果数量</td>
148
155
  </tr>
149
156
  <tr>
150
157
  <td rowspan="4"><strong>Tavily</strong></td>
@@ -206,7 +213,7 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
206
213
 
207
214
  ## 额度
208
215
 
209
- - **DeepSeek Messages 搜索**:不展示额度条。仍会发起模型搜索请求,用量按所用账号或 API 的计费规则处理。
216
+ - **DeepSeek(旧版)**:不展示额度条。仍会发起模型搜索请求,用量按所用账号或 API 的计费规则处理。
210
217
  - **Tavily keyless**:不展示额度条,免费且有限流。
211
218
  - **Tavily keyed**:搜索时请求 `include_usage`,在内存中累加当前凭据的 credits。Host 定时调用 `GET /usage`,设置卡也可手动刷新;手动刷新之间至少间隔 10 秒,自动对账不受此限制。用 `account.current_plan` / `plan_limit` 做限额,用量取当前凭据的本地累计与远端的较大值;换 key 时清空旧账户用量并立即重新对账。旧 Tavily 额度不再持久化到磁盘。
212
219
  - **Brave**:没有 usage / 花费接口。控制台 **Capacity** 就是响应头里的每秒窗口(例如 50 次/秒)。月限额 `0` 表示不限请求次数,不是额度用完。计费 credits 只能看 [Brave API 控制台](https://api-dashboard.search.brave.com/)。
@@ -214,19 +221,19 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
214
221
 
215
222
  ## 停用或卸载
216
223
 
217
- ### 优先切换到 DeepSeek Messages 搜索
224
+ ### 切换回旧版 DeepSeek 搜索
218
225
 
219
- 如果只是想重新使用官方搜索,在 **设置 → 网页搜索** 中选择 **DeepSeek Messages 搜索** 并保存即可,无需关闭或卸载本插件。下一次搜索会使用本插件接入的官方搜索 API,仍可能产生模型调用费用。
226
+ 安装默认已是官方 Search API,与 DSH 自带页面一致。若要用旧版 Messages 搜索,在 **设置 → 网页搜索** 中选择 **DeepSeek(旧版)** 并保存即可,无需关闭或卸载本插件。它会额外发起 Messages 模型请求,可能产生模型调用费用。
220
227
 
221
228
  ### 停用并恢复内置搜索
222
229
 
223
- 若希望停用本插件、恢复 Harness 原装的搜索插件,再执行以下操作。切换到本插件中的 DeepSeek 引擎与恢复原装插件是两种不同操作。
230
+ 若希望停用本插件、恢复 Harness 原装的搜索插件与「网页搜索与获取」设置页,再执行以下操作。切换到本插件中的 DeepSeek 引擎与恢复原装插件是两种不同操作。
224
231
 
225
- 打开侧栏 **插件** 页面,关闭 **整个 `dsh-web-search-plugin` 组合包的开关**。这会撤销该组合层,并重新启用内置 Messages 搜索插件。本页面显式保存的提供方选择仍保留在 Profile 中:需检查 `web.searchProvider` 与 `web.fetchProvider`,移除覆盖才能完整恢复 Profile 默认值;之后也可以重新打开组合包。
232
+ 打开侧栏 **插件** 页面,关闭 **整个 `dsh-web-search-plugin` 组合包的开关**。这会撤销该组合层,并重新启用内置 Messages 搜索插件与内置「网页搜索与获取」设置页。本页面显式保存的提供方选择仍保留在 Profile 中:需检查 `web.searchProvider` 与 `web.fetchProvider`,移除覆盖才能完整恢复 Profile 默认值;之后也可以重新打开组合包。
226
233
 
227
234
  请使用组合包的总开关:仅关闭包内某个组件,其他配置覆盖仍会保留。启用配置热更新的 Profile 会立即应用改动,否则需要重启 Harness。
228
235
 
229
- 如果曾手工设置 `web.searchProvider: dsh-web-search`、`DSH_WEB_SEARCH_PROVIDER=dsh-web-search`,或另行禁用内置 DeepSeek 插件,还需移除或恢复这些覆盖。组合包开关不会撤销你单独添加的配置。
236
+ 组合包默认把 `web.searchProvider` 设为 `deepseek-search-api`(官方默认)。如果曾手工改成 `dsh-web-search`、设置 `DSH_WEB_SEARCH_PROVIDER=dsh-web-search`,或另行禁用内置 DeepSeek 插件,还需移除或恢复这些覆盖。组合包开关不会撤销你单独添加的配置。
230
237
 
231
238
  ### 卸载安装包
232
239
 
@@ -242,7 +249,7 @@ dsh plugin --profile web remove dsh-web-search-plugin
242
249
 
243
250
  本插件通过 `ctx.web` 注册一个稳定 id 为 `dsh-web-search` 的 `WebSearchProvider`,遵循与官方 `@deepseek-ai/dsh-web-search-deepseek` 相同的提供方约定(`inject: ['web']` 和 `ctx.web.registerSearchProvider`)。原有九个引擎由该提供方内部调度;选择新版 Search API 时设置卡改用官方提供方,并独立设置抓取提供方。各引擎结果规范化为 `WebSearchResult`(可选 `content` 和 `sources[]`),按 URL 去重。全部配置字段声明为 `volatile()`,保存后无需重启插件即可读取新配置。
244
251
 
245
- 本包是 **bundle**:`dsh.bundle.patch` 声明指向 `cordis.patch.yml`,组合包启用时会插入 Host 行、选用 `dsh-web-search`,并禁用内置 `web-search-deepseek` Host 插件。本插件的内部 `deepseek-official` 引擎选项与其注册的 `dsh-web-search` id 不同。关闭整个组合包会移除这一补丁层,仅关闭其中的 Host 行则不会。没有 bundle 声明时,`dsh plugin add` 只写入依赖,插件不会挂载。
252
+ 本包是 **bundle**:`dsh.bundle.patch` 声明指向 `cordis.patch.yml`,组合包启用时会插入 Host 行、把默认搜索提供方设为 `deepseek-search-api`,并禁用内置的 `web-search-deepseek` Host 插件与 `ui-settings-web-search` 设置页——后者与本插件页面配置同一对 `web` / `web-deepseek-api` 接缝,保留两个入口只会造成重复配置。本插件的内部 `deepseek-official` 引擎选项与其注册的 `dsh-web-search` id 不同。关闭整个组合包会移除这一补丁层,仅关闭其中的 Host 行则不会。没有 bundle 声明时,`dsh plugin add` 只写入依赖,插件不会挂载。
246
253
 
247
254
  - **DeepSeek** — `POST {deepseekBaseURL}/messages`,工具 `web_search_20250305`。会话运行在 DeepSeek 官方账号路由(provider 为 `deepseek-account`)且账号服务允许该端点时,用账号令牌发 `x-dsh-auth-token`;否则回落到 API key(`x-api-key` / `authorization: Bearer`,凭据名 `DEEPSEEK_API_KEY`)。有会话发起者时,在派发前把脱敏请求记录为会话事件 `web/deepseek-search-llm-request`。
248
255
  - **纯 REST 类(Tavily / Brave / Serper / SerpApi / Exa / SearXNG / Scavio / Firecrawl)** — 由静态元数据表(`lib/providers.js`)+ 通用后端(`lib/rest.js`)驱动。请求方法 / 路径 / 查询字段名 / 鉴权(bearer / header / none / query)/ 固定参数 / 响应形态由表中的行决定。REST 后端不追加自定义会话事件。
@@ -271,6 +278,16 @@ cordis.patch.yml Bundle patch:插入 Host 行、设 searchProvider、禁用
271
278
 
272
279
  ## 开发
273
280
 
281
+ ### Host 兼容性验证
282
+
283
+ `test/host-compatibility.mjs` 可对独立临时目录运行。该目录必须有标记为 `private: true` 的 `package.json`,安装本插件的本地 `.tgz` 及目标版本的 DSH Web、Settings、Credentials、Launch Environment、LLM、Cordis 和 Schemastery 依赖;安装时启用 `--strict-peer-deps --ignore-scripts`。
284
+
285
+ ```powershell
286
+ node test/host-compatibility.mjs "<临时验证目录>"
287
+ ```
288
+
289
+ 脚本使用真实 Cordis/Web 模块和打包后的插件,模拟凭据服务与供应商 HTTP,检查加载、搜索、结果上限、取消、配置切换、免密钥模式、凭据更新、账号路由及卸载。它不使用现有 DSH profile,不验证真实供应商或浏览器布局。
290
+
274
291
  ### 本地安装与验证
275
292
 
276
293
  改源码后本机验证,把仓库装进某个 profile(以 `web` 为例)。**同盘**可以直接用相对路径:
@@ -326,6 +343,12 @@ locale/zh.json {"meta": {"title": "网页搜索", "description": "…"}}
326
343
 
327
344
  卡片内的文案由 `lib/client.js` 的 `zh` / `en` 两份字典提供,改动时须保持键名对齐。
328
345
 
346
+ ### 插件详情页
347
+
348
+ 支持 `meta.detail` 的 DSH 会根据界面语言读取 `locale/zh.json` 或 `locale/en.json` 指定的 `assets/detail/*.md`,并加载文档旁的本地图片。完整 README 保留为使用与开发参考;未提供详情文档的语言按 Host 语言链回退,旧版 Host 继续读取 README。
349
+
350
+ 详情文档中的图片相对于该文档解析。更新详情时,请保持 `meta.detail` 目标及图片路径有效,并通过 `npm pack --dry-run --json` 确认 Markdown 和图片均在安装包内。
351
+
329
352
  ## 发布
330
353
 
331
354
  发布由 GitHub Actions(`.github/workflows/publish.yml`)自动完成:**推送与 `package.json` 版本一致的 `v*` 标签**会带 provenance 发到 npm。向 `main` 的普通推送不会发布。
@@ -0,0 +1,31 @@
1
+ # Web search & fetch
2
+
3
+ Give your DeepSeek Harness agent more ways to search the web through the familiar `web_search` tool. Choose the web search provider and the web fetch method independently, then save both in one settings page.
4
+
5
+ ![Diagram of independent search and retrieval settings](./images/overview.en.png)
6
+
7
+ ## Choose how to search
8
+
9
+ - **Call a search API directly**: DeepSeek Search API, Tavily, Brave Search, Serper, SerpApi, Exa, SearXNG, Scavio, or Firecrawl.
10
+ - **Keep the official default**: DeepSeek Search API, ready after install with no auxiliary model call per search.
11
+ - **Use legacy search instead**: DeepSeek (legacy), where models on the account route use the signed-in account and every other request uses the API key.
12
+ - **Try without a key**: choose Tavily `keyless`, or a SearXNG instance with JSON output enabled. Public services may apply rate limits.
13
+
14
+ ## Get started in three steps
15
+
16
+ 1. Enable the plugin and open **Settings → Web search**.
17
+ 2. Choose a web search provider and supply credentials when needed. Under **Web fetch provider**, independently choose local fetch (the default) or DeepSeek Fetch API.
18
+ 3. Click **Save**. The next search or retrieval uses the saved settings.
19
+
20
+ The default search provider is **DeepSeek Search API**, matching DSH's own page. Billing for both new and legacy DeepSeek can be Automatic, Account, or API key. New API options are available only when the Host provides the required configuration.
21
+
22
+ ## Costs and credentials
23
+
24
+ Direct search API calls do not make an additional DeepSeek search model request, but the search service charges separately, paid by the account or API key chosen under Billing. Your conversation and the model reading search results still consume tokens. DeepSeek (legacy) makes a model request and may incur model charges. Local fetch is free and reaches the intranet and this machine, but runs no JavaScript and cannot read PDFs. Check the provider's terms for DeepSeek Fetch API charges.
25
+
26
+ Engines that require a key provide an API key link in settings. Enter your key and save; the plugin uses DSH credential management. Keyless access still has service limits.
27
+
28
+ ## Guides and feedback
29
+
30
+ - [Full guide](https://github.com/X-C1811/dsh-web-search-plugin/blob/main/README.md)
31
+ - [Report an issue](https://github.com/X-C1811/dsh-web-search-plugin/issues)
@@ -0,0 +1,20 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="960" height="460" viewBox="0 0 960 460" role="img" aria-labelledby="title desc" lang="en">
2
+ <title id="title">Choose search and fetch independently</title><desc id="desc">Configure both in Settings → Web search. Saved settings apply to the next search or fetch. Feature diagram · not a screenshot</desc>
3
+ <defs><linearGradient id="bg" x2="1" y2="1"><stop stop-color="#f1f8ff"/><stop offset="1" stop-color="#ecfaf4"/></linearGradient><linearGradient id="accent" x2="1" y2="1"><stop stop-color="#2563eb"/><stop offset="1" stop-color="#0d9488"/></linearGradient></defs>
4
+ <rect width="960" height="460" rx="24" fill="url(#bg)"/>
5
+ <g font-family="Segoe UI, Microsoft YaHei, Noto Sans CJK SC, sans-serif" fill="#163b46">
6
+ <rect x="32" y="32" width="7" height="54" rx="3.5" fill="url(#accent)"/>
7
+ <text x="56" y="57" font-size="28" font-weight="700">Choose search and fetch independently</text><text x="56" y="85" font-size="16" fill="#506a75">Configure both in Settings → Web search</text>
8
+ <rect x="32" y="116" width="438" height="210" rx="18" fill="#fff" stroke="#d8e6ec"/>
9
+ <rect x="490" y="116" width="438" height="210" rx="18" fill="#fff" stroke="#d8e6ec"/>
10
+ <circle cx="71" cy="153" r="15" fill="#e8f1ff"/><text x="65" y="159" font-size="16" text-anchor="middle" font-weight="700" fill="#2563eb">1</text>
11
+ <text x="96" y="160" font-size="22" font-weight="600">Web search provider</text><text x="56" y="191" font-size="15" fill="#607480">10 options · credentials when needed</text>
12
+ <rect x="46" y="214" width="400" height="38" rx="9" fill="#eef5ff"/><text x="56" y="239" font-size="17" fill="#245fa3">DeepSeek Search API (default)</text>
13
+ <text x="56" y="291" font-size="17" >DeepSeek (legacy)</text>
14
+ <circle cx="529" cy="153" r="15" fill="#e4f7ef"/><text x="523" y="159" font-size="16" text-anchor="middle" font-weight="700" fill="#0d8477">2</text>
15
+ <text x="554" y="160" font-size="22" font-weight="600">Web fetch provider</text><text x="514" y="191" font-size="15" fill="#607480">Independent of the search provider</text>
16
+ <rect x="504" y="214" width="400" height="38" rx="9" fill="#eaf8f2"/><text x="514" y="239" font-size="17" fill="#087b6d">Local fetch (default)</text><text x="514" y="291" font-size="17" >DeepSeek Fetch API</text>
17
+ <path d="M251 326v21h458v-21M480 347v16" fill="none" stroke="#91b6b8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
18
+ <rect x="414" y="363" width="132" height="44" rx="12" fill="url(#accent)"/><text x="480" y="391" font-size="18" fill="#fff" text-anchor="middle" font-weight="600">Save</text>
19
+ <text x="564" y="390" font-size="14" fill="#48626e">Saved settings apply to the next search or fetch</text><text x="32" y="435" font-size="12" fill="#617d87">Feature diagram · not a screenshot</text>
20
+ </g></svg>
@@ -0,0 +1,20 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="960" height="460" viewBox="0 0 960 460" role="img" aria-labelledby="title desc" lang="zh">
2
+ <title id="title">网页搜索与获取,各自选择</title><desc id="desc">在「设置 → 网页搜索」中配置,统一保存. 下一次搜索或获取使用已保存的设置. 功能示意 · 非实际界面截图</desc>
3
+ <defs><linearGradient id="bg" x2="1" y2="1"><stop stop-color="#f1f8ff"/><stop offset="1" stop-color="#ecfaf4"/></linearGradient><linearGradient id="accent" x2="1" y2="1"><stop stop-color="#2563eb"/><stop offset="1" stop-color="#0d9488"/></linearGradient></defs>
4
+ <rect width="960" height="460" rx="24" fill="url(#bg)"/>
5
+ <g font-family="Microsoft YaHei, sans-serif" fill="#163b46">
6
+ <rect x="32" y="32" width="7" height="54" rx="3.5" fill="url(#accent)"/>
7
+ <text x="56" y="57" font-size="28" font-weight="700">网页搜索与获取,各自选择</text><text x="56" y="85" font-size="16" fill="#506a75">在「设置 → 网页搜索」中配置,统一保存</text>
8
+ <rect x="32" y="116" width="438" height="210" rx="18" fill="#fff" stroke="#d8e6ec"/>
9
+ <rect x="490" y="116" width="438" height="210" rx="18" fill="#fff" stroke="#d8e6ec"/>
10
+ <circle cx="71" cy="153" r="15" fill="#e8f1ff"/><text x="65" y="159" font-size="16" text-anchor="middle" font-weight="700" fill="#2563eb">1</text>
11
+ <text x="96" y="160" font-size="22" font-weight="600">网页搜索提供方</text><text x="56" y="191" font-size="15" fill="#607480">10 个选项 · 按需填写凭据</text>
12
+ <rect x="46" y="214" width="400" height="38" rx="9" fill="#eef5ff"/><text x="56" y="239" font-size="17" fill="#245fa3">DeepSeek Search API(默认)</text>
13
+ <text x="56" y="291" font-size="17" >DeepSeek(旧版)</text>
14
+ <circle cx="529" cy="153" r="15" fill="#e4f7ef"/><text x="523" y="159" font-size="16" text-anchor="middle" font-weight="700" fill="#0d8477">2</text>
15
+ <text x="554" y="160" font-size="22" font-weight="600">网页获取提供方</text><text x="514" y="191" font-size="15" fill="#607480">独立于搜索提供方</text>
16
+ <rect x="504" y="214" width="400" height="38" rx="9" fill="#eaf8f2"/><text x="514" y="239" font-size="17" fill="#087b6d">本机直接获取(默认)</text><text x="514" y="291" font-size="17" >DeepSeek Fetch API</text>
17
+ <path d="M251 326v21h458v-21M480 347v16" fill="none" stroke="#91b6b8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
18
+ <rect x="414" y="363" width="132" height="44" rx="12" fill="url(#accent)"/><text x="480" y="391" font-size="18" fill="#fff" text-anchor="middle" font-weight="600">保存</text>
19
+ <text x="564" y="390" font-size="15" fill="#48626e">下一次搜索或获取使用已保存的设置</text><text x="32" y="435" font-size="12" fill="#617d87">功能示意 · 非实际界面截图</text>
20
+ </g></svg>
@@ -0,0 +1,31 @@
1
+ # 网页搜索与获取
2
+
3
+ 为 DeepSeek Harness 的 Agent 提供更多联网搜索选择,沿用熟悉的 `web_search` 工具。网页搜索提供方与网页获取方式独立选择,在一个设置页面中统一保存。
4
+
5
+ ![搜索与抓取独立配置示意图](./images/overview.zh.png)
6
+
7
+ ## 选择适合你的搜索方式
8
+
9
+ - **直接调用搜索 API**:DeepSeek Search API、Tavily、Brave Search、Serper、SerpApi、Exa、SearXNG、Scavio、Firecrawl。
10
+ - **保持官方默认**:DeepSeek Search API,安装后即用,不产生搜索时的辅助模型调用。
11
+ - **改用旧版搜索**:DeepSeek(旧版),账号模型发起的请求用已登录账号,其他请求用 API key。
12
+ - **先体验免密钥搜索**:Tavily 选择 `keyless`,或使用支持 JSON 输出的 SearXNG 实例。公共服务可能限流。
13
+
14
+ ## 三步开始
15
+
16
+ 1. 启用本插件,打开 **设置 → 网页搜索**。
17
+ 2. 选择网页搜索提供方,按需填写凭据;在 **网页获取提供方** 中独立选择本机直接获取(默认)或 DeepSeek Fetch API。
18
+ 3. 点击 **保存**,下一次搜索或抓取使用已保存的设置。
19
+
20
+ 默认搜索提供方为 **DeepSeek Search API**,与 DSH 自带页面一致。新版 API 与旧版搜索的「计费方式」都可选自动、账号或 API Key;需要新版 API 的选项只在 Host 提供相应配置时可用。
21
+
22
+ ## 费用与凭据
23
+
24
+ 直接调用搜索 API 不会额外发起 DeepSeek 搜索模型请求,但搜索服务可能单独计费,由「计费方式」选定的账号或 API Key 支付;对话及模型读取结果仍消耗 token。DeepSeek(旧版)会发起模型请求,可能产生相应费用。本机直接获取免费,可访问内网和本机,但不支持需要 JavaScript 或登录的页面和 PDF;DeepSeek Fetch API 的费用以供应商说明为准。
25
+
26
+ 需要密钥的引擎可通过设置页的入口获取 API key,填写后保存。插件沿用 DSH 凭据管理;免密钥模式不代表服务无限额。
27
+
28
+ ## 使用说明与反馈
29
+
30
+ - [完整中文说明](https://github.com/X-C1811/dsh-web-search-plugin/blob/main/README.zh.md)
31
+ - [报告问题](https://github.com/X-C1811/dsh-web-search-plugin/issues)