dsh-web-search-plugin 0.5.1 → 0.6.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,36 @@
4
4
 
5
5
  ## [未发布]
6
6
 
7
+ ## [0.6.1] - 2026-11-10
8
+
9
+ ### 文档
10
+
11
+ - 插件详情页通过 `locale/zh.json` 和 `locale/en.json` 的 `meta.detail` 按界面语言展示独立介绍,包含随包提供的双语功能示意图、配置步骤、费用说明及帮助入口;旧版 Host 继续使用 README。
12
+
13
+ ### 兼容性
14
+
15
+ - 接纳 DSH `0.2.2-rc.1` 与 `0.2.2-alpha.3`,扩展 Cordis / Schemastery peer 范围,同时保留已有旧版范围。
16
+ - 为插件搜索接缝补齐 `ready(llmProvider)`,按当前引擎检查凭据是否配置,保留 Tavily keyless 与 SearXNG 的免密钥模式;就绪检查不请求搜索端点、不读取托管 API key 的明文。
17
+ - DeepSeek Messages 的就绪检查使用本次模型路由和搜索端点判断账号令牌;账号凭据缺失时可使用 API key,账号读取失败时按实际调用行为报告未就绪。
18
+ - 补充所有 REST 引擎、凭据来源回退、密钥动态更新及 DeepSeek 账号路由的回归检查;更新中英文运行要求和验证边界。
19
+
20
+ ## [0.6.0] - 2026-10-20
21
+
22
+ ### 新增
23
+
24
+ - “设置 → 网页搜索”保留一个入口,页面分为“搜索引擎”和“网页抓取”,统一暂存、保存和放弃修改。
25
+ - 新增 DeepSeek Search API 搜索选项,复用 DSH `0.2.1-rc.2` 的官方提供方,无辅助模型轮次;现有第三方引擎和 DeepSeek Messages 搜索继续保留。
26
+ - 网页抓取可独立选择本地 HTTP(默认)或官方 DeepSeek Fetch API;不自动联动搜索与抓取,也不自动回退到付费接口。
27
+ - 新版 Search / Fetch 共用官方 `web-deepseek-api` 的密钥引用和基础地址,与旧 Messages 参数分别保存;不提供这套配置的 Host 禁用新版 API 选项。
28
+
29
+ ### 变更
30
+
31
+ - 四个 DSH peer 范围显式接纳 `0.2.1-rc.2`,保留 `0.2.0-rc.2`;包版本与 User-Agent 更新为 `0.6.0`。
32
+ - DeepSeek Messages 搜索显式关闭辅助思考,与 rc.2 官方行为一致。
33
+ - 跨配置区域保存时先保存引擎和 API 参数,再以同一 `web` mutation 提交所修改的提供方选择;各区域使用各自 revision,失败保留草稿并提示可能已有部分设置保存。
34
+ - 保持原有安装默认值和用户选择,新增 API 由用户主动选择;不迁移旧 Messages 端点或模型配置。
35
+ - 下拉选项使用“DeepSeek Messages 搜索(默认)”与“DeepSeek Search API”,标明默认项,不附加推荐标记。
36
+
7
37
  ## [0.5.1] - 2026-10-10
8
38
 
9
39
  ### 新增
package/README.md CHANGED
@@ -2,20 +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. Choose from **nine providers** and manage engines, API keys, and search options in **Settings → Web search**.
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.
6
6
 
7
7
  ## Why use this plugin?
8
8
 
9
- - **Avoid an extra DeepSeek model call for search.** 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.)
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
- - **Return to built-in search with one switch.** Turn off the entire `dsh-web-search-plugin` bundle in the sidebar's **Plugins** page to remove its search overrides and restore Harness's built-in DeepSeek search under the standard profile configuration. See [Disable or uninstall](#disable-or-uninstall).
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.
13
13
 
14
- **The default engine is still DeepSeek (official).** To avoid the extra official search model call, select a third-party engine in the settings card after installation and save your changes. Selecting DeepSeek (official) uses the official search API and may incur model invocation charges.
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.
15
15
 
16
16
  ## Supported providers
17
17
 
18
- - **DeepSeek (official, 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.
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
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.
20
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.
21
22
  - **Serper** — Google results via `POST /search`, using the `X-API-KEY` header (credential name: `SERPER_API_KEY`).
@@ -29,8 +30,10 @@ For DuckDuckGo results, choose a SearXNG instance that aggregates DuckDuckGo. Du
29
30
 
30
31
  ## Requirements
31
32
 
32
- - DeepSeek Harness `0.2.0-rc.2` or a compatible `0.2.x` release
33
- - 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
+ - New Search / Fetch options require the Host's `web` and `web-deepseek-api` configuration namespaces. The `0.2.0-rc.2` and `0.2.1-rc.2` peer ranges remain supported; unavailable API options are disabled.
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.
34
37
  - pnpm, used by `dsh plugin` to install the plugin into a profile
35
38
 
36
39
  ## Installation
@@ -44,22 +47,37 @@ dsh plugin --profile web add dsh-web-search-plugin
44
47
  After installation, configure the plugin in the Harness Web UI:
45
48
 
46
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.
47
- 2. Choose a search engine. For direct API search without an extra DeepSeek model call, select Tavily, Brave, Serper, SerpApi, Exa, SearXNG, Scavio, or Firecrawl.
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.
48
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.
49
- 4. Adjust the result limit and other options, then click **Save**. The next search uses the saved engine and settings.
52
+ 4. Under **Web retrieval**, independently select local HTTP (default) or DeepSeek Fetch API.
53
+ 5. Adjust parameters and click **Save** at the bottom. Unsaved changes remain drafts; the next operation uses the saved settings.
50
54
 
51
55
  > For installation from a local source checkout, including Windows cross-drive considerations, see [Development → Local installation and verification](#local-installation-and-verification).
52
56
 
53
57
  ## Configuration
54
58
 
55
- For normal use, configure the plugin in **Settings → Web search**. The card shows options for the selected engine and saves ordinary settings to the current profile's `dsh-web-search-plugin` configuration. The tables below describe the underlying configuration, including advanced fields hidden from the card; not every field is shown at once.
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.
60
+
61
+ ### New Search API and web retrieval
62
+
63
+ 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.
64
+
65
+ 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.
66
+
67
+ 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.
68
+
69
+ 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.
70
+
71
+ Save writes credentials, then engine/API parameters, then the edited search/retrieval selections in a single `web` mutation. Each namespace has its own revision: this is not a transaction across namespaces. A later refusal leaves accepted writes in place, reports possible partial saving, and retains the draft for review and retry. Editing is locked during saving; Discard never writes settings.
72
+
73
+ The tables below describe the original nine plugin backends; new Search API configuration is described above.
56
74
 
57
75
  ### General settings
58
76
 
59
77
  | Key | Default | Meaning and scope |
60
78
  |---|---|---|
61
79
  | `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 |
62
- | `maxResults` | `8` | Maximum returned sources for all engines, 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 |
80
+ | `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 |
63
81
 
64
82
  ### Keys and credential references
65
83
 
@@ -110,7 +128,7 @@ Clearing a text input or using “Restore default” in the card normally remove
110
128
  </thead>
111
129
  <tbody>
112
130
  <tr>
113
- <td rowspan="4"><strong>DeepSeek (official)</strong></td>
131
+ <td rowspan="4"><strong>DeepSeek Messages search</strong></td>
114
132
  <td><code>deepseekModel</code></td>
115
133
  <td><code>deepseek-flash</code></td>
116
134
  <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>
@@ -190,7 +208,7 @@ The startup environment variable `DSH_WEB_SEARCH_PROVIDER=dsh-web-search` select
190
208
 
191
209
  ## Quotas
192
210
 
193
- - **DeepSeek (official)**: No quota bar. Search still makes a model request, with usage subject to your account or API billing.
211
+ - **DeepSeek Messages search**: No quota bar. Search still makes a model request, with usage subject to your account or API billing.
194
212
  - **Tavily keyless**: No quota bar; access is free and rate-limited.
195
213
  - **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.
196
214
  - **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/).
@@ -198,15 +216,15 @@ The startup environment variable `DSH_WEB_SEARCH_PROVIDER=dsh-web-search` select
198
216
 
199
217
  ## Disable or uninstall
200
218
 
201
- ### Switch to DeepSeek (official) first
219
+ ### Switch to DeepSeek Messages search first
202
220
 
203
- If you only want to use official search again, select **DeepSeek (official)** 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.
221
+ 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.
204
222
 
205
223
  ### Disable and restore built-in search
206
224
 
207
225
  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.
208
226
 
209
- Open **Plugins** in the sidebar and turn off the **entire `dsh-web-search-plugin` bundle**. Under the standard Harness profile configuration, this removes the bundle's search-provider override and its override disabling the built-in DeepSeek plugin, restoring built-in search without uninstalling the package. You can turn the bundle back on later.
227
+ 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.
210
228
 
211
229
  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.
212
230
 
@@ -220,11 +238,11 @@ To remove the installed package as well, run:
220
238
  dsh plugin --profile web remove dsh-web-search-plugin
221
239
  ```
222
240
 
223
- The same checks for manually added overrides apply after uninstallation. If you explicitly selected `dsh-web-search`, remove that override to use the profile default, or set `web.searchProvider` back to `deepseek-official`.
241
+ The same checks for manually added overrides apply after uninstallation. Explicit `web` and `web-deepseek-api` settings survive disabling or uninstalling the bundle. To restore standard profile defaults, review and remove saved search/retrieval overrides. Re-enable the built-in `web-search-deepseek` before restoring Messages search; retrieval can return to `http`.
224
242
 
225
243
  ## How it works
226
244
 
227
- 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`). Switching internal engines does not require changing `web.searchProvider`. 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.
245
+ 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.
228
246
 
229
247
  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.
230
248
 
@@ -255,6 +273,16 @@ cordis.patch.yml Bundle patch: adds Host entry, sets searchProvider, disables
255
273
 
256
274
  ## Development
257
275
 
276
+ ### Host compatibility checks
277
+
278
+ 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`.
279
+
280
+ ```powershell
281
+ node test/host-compatibility.mjs "<disposable-fixture-directory>"
282
+ ```
283
+
284
+ 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.
285
+
258
286
  ### Local installation and verification
259
287
 
260
288
  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:
@@ -284,7 +312,7 @@ dsh plugin --profile web install
284
312
 
285
313
  `file:` is a snapshot: after source changes, copy the files again with robocopy, run `install`, and restart DSH. If you change the package's `files` field, pnpm may consider the snapshot unchanged and skip the update; remove `node_modules/dsh-web-search-plugin` before reinstalling in that case.
286
314
 
287
- Use `dsh --profile web --dump-config` to verify that the composition tree includes `dsh-web-search-plugin` and that `web.searchProvider` is `dsh-web-search`.
315
+ Use `dsh --profile web --dump-config` to verify that the composition tree includes `dsh-web-search-plugin`. `web.searchProvider` is `dsh-web-search` for the original engines or `deepseek-search-api` for the new API; independently verify `web.fetchProvider` is `http` or the explicitly selected Fetch provider.
288
316
 
289
317
  ### Syntax checks
290
318
 
@@ -295,7 +323,7 @@ npm test
295
323
 
296
324
  The client bundle must retain the `window.__ModuleLoader__.load({ id, factory })` wire format: it is loaded by `dsh-client-modules`, not a bundler. It must export both `apply` and `inject` (`slots`, `locale`, `remote`, `remote.credentials`, `configForms`).
297
325
 
298
- The configuration card is hosted in **Settings → Web search** (`settings.section`, `id: "web-search"`). Its data comes from `ctx.configForms.get("dsh-web-search-plugin")`, and registration is conditional through `configForms.whileServed([namespace], register)`. When the Host does not serve this namespace, the card is not registered.
326
+ The configuration card is hosted in **Settings → Web search** (`settings.section`, `id: "web-search"`). It combines the public ConfigForms for `dsh-web-search-plugin`, `web`, and `web-deepseek-api`. Registration follows the plugin namespace through `configForms.whileServed([namespace], register)`; absent API configuration disables only the new choices. No Host-module imports are added to the client bundle.
299
327
 
300
328
  The plugin does not show configuration on the plugin detail page (`plugins.bundle.config`).
301
329
 
@@ -310,6 +338,12 @@ locale/zh.json {"meta": {"title": "网页搜索", "description": "…"}}
310
338
 
311
339
  Settings card text comes from the `zh` and `en` dictionaries in `lib/client.js`. Keep their keys aligned when editing them.
312
340
 
341
+ ### Plugin detail pages
342
+
343
+ 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.
344
+
345
+ 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.
346
+
313
347
  ## Publishing
314
348
 
315
349
  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,20 +2,21 @@
2
2
 
3
3
  [English](./README.md) | 中文
4
4
 
5
- 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)的 Agent 提供更多联网搜索选择,沿用 Harness 原有的 `web_search` 工具。内置 **9 个搜索后端**,在 **设置 → 网页搜索** 的卡片中统一管理搜索引擎、API key 和搜索选项。
5
+ 为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)的 Agent 提供更多联网搜索选择,沿用 Harness 原有的 `web_search` 工具。在 **设置 → 网页搜索** 一个入口中,分为 **搜索引擎**(10 个选项)和 **网页抓取**(本地 HTTP 或 DeepSeek Fetch API),独立选择后统一保存。
6
6
 
7
7
  ## 为什么使用本插件?
8
8
 
9
- - **减少搜索时额外的 DeepSeek 模型调用。** 8 个第三方后端直接请求搜索 API,不经过 DeepSeek 官方的模型搜索接口,因此不会产生该次搜索请求额外的 DeepSeek 模型 token 消耗。(对话本身和模型读取搜索结果仍会消耗 token,搜索服务也可能单独收取费用或扣除额度。)
9
+ - **减少搜索时额外的 DeepSeek 模型调用。** 新版 DeepSeek Search API 和 8 个第三方后端直接请求搜索 API,不经过 DeepSeek 官方的模型搜索接口,因此不会产生该次搜索请求额外的 DeepSeek 模型 token 消耗。(对话本身和模型读取搜索结果仍会消耗 token,搜索服务也可能单独收取费用或扣除额度。)
10
10
  - **在设置卡片中完成配置。** 在 **设置 → 网页搜索** 中切换引擎、填写密钥、调整结果数量,保存后下一次搜索即可生效,无需重启插件或编辑 YAML。
11
11
  - **按需求选择搜索服务。** 可以通过 Serper 获取 Google 结果,使用 Exa 进行语义搜索,或接入自建 SearXNG。Tavily 的 keyless 模式无需账号和 API key,方便先体验。
12
- - **一键恢复内置搜索。** 在侧栏的 **插件** 页面关闭整个 `dsh-web-search-plugin` 组合包,即可撤销它的搜索配置覆盖,在标准 Profile 配置下恢复 Harness 内置的 DeepSeek 搜索。详见[停用或卸载](#停用或卸载)。
12
+ - **保留已有引擎与设置。** Messages 和第三方引擎继续可用,搜索与抓取独立选择;移除已保存的提供方覆盖前,请参考[停用或卸载](#停用或卸载)。
13
13
 
14
- **默认引擎仍为 DeepSeek(官方)。** 若要避免官方搜索额外的模型调用,安装后需要在设置卡片中选择第三方引擎并保存。选择 DeepSeek(官方)时,会使用官方搜索 API,可能产生模型调用费用。
14
+ **默认引擎仍为 DeepSeek Messages 搜索。** 若要避免官方搜索额外的模型调用,安装后可在设置卡片中选择 **DeepSeek Search API** 或第三方引擎并保存。选择 DeepSeek Messages 搜索时,会使用官方搜索 API,可能产生模型调用费用。
15
15
 
16
16
  ## 支持的搜索后端
17
17
 
18
- - **DeepSeek(官方,默认)** — 使用 DeepSeek 的 Anthropic 兼容 Messages API,原生搜索工具类型为 `web_search_20250305`,支持账号令牌或 `DEEPSEEK_API_KEY`。每次搜索会发起模型请求,可能产生模型调用费用。
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
20
  - **Tavily** — `keyless`(免费、限流、无需账号)或 `keyed`(`TAVILY_API_KEY`,Bearer token)。keyed 会在设置卡显示额度进度条。
20
21
  - **Brave Search** — `GET https://api.search.brave.com/res/v1/web/search`,请求头 `X-Subscription-Token`(凭据名 `BRAVE_API_KEY`)。一次搜索就是一次 HTTP 请求,不走模型轮次;设置卡按响应头展示 Capacity / 月配额。
21
22
  - **Serper** — Google 结果(`POST /search`,头 `X-API-KEY`,凭据名 `SERPER_API_KEY`)。
@@ -29,8 +30,10 @@
29
30
 
30
31
  ## 运行要求
31
32
 
32
- - DeepSeek Harness `0.2.0-rc.2` 或兼容的 `0.2.x` 版本
33
- - Node.js `^22.19.0` 或 `>=24.0.0`
33
+ - 已在 DeepSeek Harness `0.2.2-rc.1`、`0.2.2-alpha.3` 和旧版 `0.2.1-rc.5` 的实际依赖上进行隔离验证,覆盖打包安装、Host 搜索接缝、配置切换与凭据就绪判断;供应商 HTTP 使用模拟响应,不代表真实账号联网或桌面设置页端到端验证。
34
+ - 新版 Search / Fetch 需要 Host 提供 `web` 与 `web-deepseek-api` 配置;保留 `0.2.0-rc.2`、`0.2.1-rc.2` 依赖范围,不可用的新版 API 选项会禁用。
35
+ - DSH `0.2.2` 的 RC / alpha 要求 Node.js `>=24.9.0`;插件在旧版 Host 上保留 Node.js `^22.19.0` 或 `>=24.0.0` 的运行范围。
36
+ - 支持工具就绪检查的 Host 会在缺少所需凭据时隐藏插件搜索工具;Tavily keyless 与 SearXNG 无需密钥。DeepSeek Messages 按本次模型路由判断账号令牌与 API key,不使用上一轮路由预判,也不联网校验密钥有效性。
34
37
  - pnpm,用于通过 `dsh plugin` 把插件装进 profile
35
38
 
36
39
  ## 安装
@@ -44,22 +47,37 @@ dsh plugin --profile web add dsh-web-search-plugin
44
47
  安装后,在 Harness Web 界面中完成配置:
45
48
 
46
49
  1. 打开 **设置 → 网页搜索**,找到本插件的设置卡片。侧栏的 **插件** 页面负责启用或停用组合包,引擎参数在设置卡片中配置。
47
- 2. 选择搜索引擎。若要直接调用搜索 API、避免额外的 DeepSeek 模型调用,可选 Tavily、Brave、Serper、SerpApi、Exa、SearXNG、Scavio 或 Firecrawl。
50
+ 2. 选择搜索引擎。若要直接调用搜索 API、避免额外的 DeepSeek 模型调用,可选 DeepSeek Search API、Tavily、Brave、Serper、SerpApi、Exa、SearXNG、Scavio 或 Firecrawl。
48
51
  3. 按需填写所选引擎的 API key,需要密钥的引擎会显示「获取 API key ↗」,点击即可打开官方控制台。Tavily 免 key 使用时选择 `keyless`;SearXNG 填写已启用 JSON 搜索的实例地址,这两种免 key 方式不显示密钥获取链接。已有凭据可以复用,例如 Brave 的 `BRAVE_API_KEY`。
49
- 4. 调整返回结果数量等选项,点击 **保存**。下一次搜索会使用保存后的引擎与配置。
52
+ 4. 在 **网页抓取** 中选择本地 HTTP(默认)或 DeepSeek Fetch API。更换搜索引擎不会更改抓取方式。
53
+ 5. 调整参数并点击页面底部的 **保存**;保存前只修改草稿,下一次操作使用已保存配置。
50
54
 
51
55
  > 从源码仓库本地安装(含 Windows 跨盘注意事项)见 [开发 → 本地安装与验证](#本地安装与验证)。
52
56
 
53
57
  ## 配置
54
58
 
55
- 日常使用在 **设置 → 网页搜索** 的卡片中配置即可。卡片按当前引擎显示相关选项,普通设置保存到当前 Profile 的 `dsh-web-search-plugin` 配置中。下表是底层配置参考,包含卡片中隐藏的高级字段,并非所有字段都会同时显示。
59
+ 日常使用在 **设置 → 网页搜索** 的卡片中配置即可。原有引擎参数保存在当前 Profile 的 `dsh-web-search-plugin`,新版 API 参数保存在 `web-deepseek-api`,提供方选择保存在 `web`。下表包含卡片中隐藏的高级字段,并非所有字段都会同时显示。
60
+
61
+ ### 新版 Search API 与网页抓取
62
+
63
+ 页面复用官方提供方,不重复注册 Search / Fetch。选择新版搜索会将 `web.searchProvider` 设为 `deepseek-search-api`;切回原有引擎则恢复 `dsh-web-search`,并保存本插件的 `provider`。`web.fetchProvider` 独立选择 `http` 或 `deepseek-fetch-api`。已有自定义抓取提供方会显示并保留,除非用户主动更改。
64
+
65
+ 新版 Search 和 Fetch 共用 `web-deepseek-api` 命名空间中的 `apiKeyEnv`(默认 `DEEPSEEK_API_KEY`)、`baseURL`(默认 `https://api.deepseek.com/v1/tools`)和凭据。两者同时启用时只显示一份 API 配置;旧 Messages 地址、模型和密钥配置独立保留。`count` 只控制新版搜索的结果数,不是请求次数或费用上限。官方高级配置 `sendOriginalQuestion` 默认开启,搜索时会发送经规整且最多 128 字符的触发问题;可在官方配置中关闭,本页面保留该值。
66
+
67
+ 推荐组合为 **DeepSeek Search API + 本地 HTTP**。Search 不发起辅助模型请求;本地 HTTP 从运行 DSH 的设备直接访问目标网站,不调用收费 Fetch API。DeepSeek Fetch 是可选的远端 Markdown 抓取,不保证能读取所有网站;本地 HTTP 不执行页面 JavaScript。工具结果交给主模型后仍占用会话 token。没有自动切换引擎或付费抓取兜底。
68
+
69
+ [官方计费说明](https://api-docs.deepseek.com/zh-cn/guides/search/#计费):Search / Fetch 均按成功且产生结果的请求收费;价格请以官方文档为准。界面不将估算金额当作实际账单。
70
+
71
+ 一次保存会先写凭据,再写引擎和 API 参数,最后用一个 `web` mutation 提交本次修改的搜索/抓取选择。每个命名空间有独立 revision,跨命名空间不是事务;若后续步骤失败,已接受的写入不会自动回滚,页面会提示可能部分保存并保留草稿以便重试。保存期间锁定编辑,放弃修改不触发写入。
72
+
73
+ 下面的配置表描述本插件原有九个后端;新版 Search 的配置位置如上。
56
74
 
57
75
  ### 通用配置
58
76
 
59
77
  | 键 | 默认值 | 含义与范围 |
60
78
  |---|---|---|
61
79
  | `provider` | `deepseek-official` | 当前搜索引擎:`deepseek-official`、`tavily`、`brave`、`serper`、`serpapi`、`exa`、`searxng`、`scavio` 或 `firecrawl`。一次请求只使用所选引擎,不会在失败后自动切换到其他引擎;未知值会回退到 DeepSeek 官方引擎 |
62
- | `maxResults` | `8` | 所有引擎的返回源数量上限,范围 1–20,同时受调用方 `request.maxResults` 上限约束。SearXNG 和 Scavio 不发送请求级数量参数,只在收到响应并按 URL 去重后截取;实际可返回的数量取决于上游结果 |
80
+ | `maxResults` | `8` | 本插件原有九个后端的返回源数量上限(不含独立的新版 Search API),范围 1–20,同时受调用方 `request.maxResults` 上限约束。SearXNG 和 Scavio 不发送请求级数量参数,只在收到响应并按 URL 去重后截取;实际可返回的数量取决于上游结果 |
63
81
 
64
82
  ### 密钥与凭据引用
65
83
 
@@ -110,7 +128,7 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
110
128
  </thead>
111
129
  <tbody>
112
130
  <tr>
113
- <td rowspan="4"><strong>DeepSeek(官方)</strong></td>
131
+ <td rowspan="4"><strong>DeepSeek Messages 搜索</strong></td>
114
132
  <td><code>deepseekModel</code></td>
115
133
  <td><code>deepseek-flash</code></td>
116
134
  <td>仅 DeepSeek 搜索请求使用的模型名,不会修改会话的聊天模型;需由目标端点支持</td>
@@ -190,7 +208,7 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
190
208
 
191
209
  ## 额度
192
210
 
193
- - **DeepSeek(官方)**:不展示额度条。仍会发起模型搜索请求,用量按所用账号或 API 的计费规则处理。
211
+ - **DeepSeek Messages 搜索**:不展示额度条。仍会发起模型搜索请求,用量按所用账号或 API 的计费规则处理。
194
212
  - **Tavily keyless**:不展示额度条,免费且有限流。
195
213
  - **Tavily keyed**:搜索时请求 `include_usage`,在内存中累加当前凭据的 credits。Host 定时调用 `GET /usage`,设置卡也可手动刷新;手动刷新之间至少间隔 10 秒,自动对账不受此限制。用 `account.current_plan` / `plan_limit` 做限额,用量取当前凭据的本地累计与远端的较大值;换 key 时清空旧账户用量并立即重新对账。旧 Tavily 额度不再持久化到磁盘。
196
214
  - **Brave**:没有 usage / 花费接口。控制台 **Capacity** 就是响应头里的每秒窗口(例如 50 次/秒)。月限额 `0` 表示不限请求次数,不是额度用完。计费 credits 只能看 [Brave API 控制台](https://api-dashboard.search.brave.com/)。
@@ -198,15 +216,15 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
198
216
 
199
217
  ## 停用或卸载
200
218
 
201
- ### 优先切换到 DeepSeek(官方)
219
+ ### 优先切换到 DeepSeek Messages 搜索
202
220
 
203
- 如果只是想重新使用官方搜索,在 **设置 → 网页搜索** 中选择 **DeepSeek(官方)** 并保存即可,无需关闭或卸载本插件。下一次搜索会使用本插件接入的官方搜索 API,仍可能产生模型调用费用。
221
+ 如果只是想重新使用官方搜索,在 **设置 → 网页搜索** 中选择 **DeepSeek Messages 搜索** 并保存即可,无需关闭或卸载本插件。下一次搜索会使用本插件接入的官方搜索 API,仍可能产生模型调用费用。
204
222
 
205
223
  ### 停用并恢复内置搜索
206
224
 
207
225
  若希望停用本插件、恢复 Harness 原装的搜索插件,再执行以下操作。切换到本插件中的 DeepSeek 引擎与恢复原装插件是两种不同操作。
208
226
 
209
- 打开侧栏 **插件** 页面,关闭 **整个 `dsh-web-search-plugin` 组合包的开关**。在标准 Harness Profile 配置下,这会撤销组合包对搜索提供方的覆盖,以及禁用内置 DeepSeek 插件的覆盖,恢复官方自带的搜索,无需卸载安装包;之后也可以重新打开组合包。
227
+ 打开侧栏 **插件** 页面,关闭 **整个 `dsh-web-search-plugin` 组合包的开关**。这会撤销该组合层,并重新启用内置 Messages 搜索插件。本页面显式保存的提供方选择仍保留在 Profile 中:需检查 `web.searchProvider` 与 `web.fetchProvider`,移除覆盖才能完整恢复 Profile 默认值;之后也可以重新打开组合包。
210
228
 
211
229
  请使用组合包的总开关:仅关闭包内某个组件,其他配置覆盖仍会保留。启用配置热更新的 Profile 会立即应用改动,否则需要重启 Harness。
212
230
 
@@ -220,11 +238,11 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
220
238
  dsh plugin --profile web remove dsh-web-search-plugin
221
239
  ```
222
240
 
223
- 卸载后同样需要检查单独添加的覆盖。若曾显式选用 `dsh-web-search`,可移除该覆盖以使用 Profile 默认值,或将 `web.searchProvider` 改回 `deepseek-official`。
241
+ 卸载后同样需要检查单独添加的覆盖。显式保存的 `web` 和 `web-deepseek-api` 设置不会随组合包停用或卸载而自动删除。若要完全恢复标准 Profile 默认值,需要检查并移除手动选择的搜索/抓取覆盖;恢复 Messages 搜索时应先重新启用内置 `web-search-deepseek`,抓取可设回 `http`。
224
242
 
225
243
  ## 工作方式
226
244
 
227
- 本插件通过 `ctx.web` 注册一个稳定 id 为 `dsh-web-search` 的 `WebSearchProvider`,遵循与官方 `@deepseek-ai/dsh-web-search-deepseek` 相同的提供方约定(`inject: ['web']` 和 `ctx.web.registerSearchProvider`)。切换内部引擎无需改动 `web.searchProvider`。各引擎结果规范化为 `WebSearchResult`(可选 `content` 和 `sources[]`),按 URL 去重。全部配置字段声明为 `volatile()`,保存后无需重启插件即可读取新配置。
245
+ 本插件通过 `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()`,保存后无需重启插件即可读取新配置。
228
246
 
229
247
  本包是 **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` 只写入依赖,插件不会挂载。
230
248
 
@@ -255,6 +273,16 @@ cordis.patch.yml Bundle patch:插入 Host 行、设 searchProvider、禁用
255
273
 
256
274
  ## 开发
257
275
 
276
+ ### Host 兼容性验证
277
+
278
+ `test/host-compatibility.mjs` 可对独立临时目录运行。该目录必须有标记为 `private: true` 的 `package.json`,安装本插件的本地 `.tgz` 及目标版本的 DSH Web、Settings、Credentials、Launch Environment、LLM、Cordis 和 Schemastery 依赖;安装时启用 `--strict-peer-deps --ignore-scripts`。
279
+
280
+ ```powershell
281
+ node test/host-compatibility.mjs "<临时验证目录>"
282
+ ```
283
+
284
+ 脚本使用真实 Cordis/Web 模块和打包后的插件,模拟凭据服务与供应商 HTTP,检查加载、搜索、结果上限、取消、配置切换、免密钥模式、凭据更新、账号路由及卸载。它不使用现有 DSH profile,不验证真实供应商或浏览器布局。
285
+
258
286
  ### 本地安装与验证
259
287
 
260
288
  改源码后本机验证,把仓库装进某个 profile(以 `web` 为例)。**同盘**可以直接用相对路径:
@@ -284,7 +312,7 @@ dsh plugin --profile web install
284
312
 
285
313
  `file:` 是快照:改完仓库后要再 robocopy + `install` 并重启 DSH。改了 `package.json` 的 `files` 字段时,pnpm 可能认为快照未变化而跳过更新,需要先删掉 `node_modules/dsh-web-search-plugin` 再装。
286
314
 
287
- 用 `dsh --profile web --dump-config` 确认:组成树里应有 `dsh-web-search-plugin` 行,且 `web.searchProvider` 为 `dsh-web-search`。
315
+ 用 `dsh --profile web --dump-config` 确认组成树中包含 `dsh-web-search-plugin`。原有引擎对应 `web.searchProvider: dsh-web-search`,新版搜索对应 `deepseek-search-api`;另行核对 `web.fetchProvider` 为 `http` 或主动选择的抓取提供方。
288
316
 
289
317
  ### 语法检查
290
318
 
@@ -295,7 +323,7 @@ npm test
295
323
 
296
324
  客户端 bundle 必须保持 `window.__ModuleLoader__.load({ id, factory })` 线格式 — 由 `dsh-client-modules` 加载,不是打包器。必须同时导出 `apply` 和 `inject`(`slots`、`locale`、`remote`、`remote.credentials`、`configForms`)。
297
325
 
298
- 配置卡片的宿主就是**设置 → 网页搜索**(`settings.section`,`id: "web-search"`),数据来自 `ctx.configForms.get("dsh-web-search-plugin")`,并通过 `configForms.whileServed([namespace], register)` 条件注册:Host 未下发该命名空间时不留痕迹。
326
+ 配置卡片的宿主就是**设置 → 网页搜索**(`settings.section`,`id: "web-search"`),组合 `dsh-web-search-plugin`、`web` 与 `web-deepseek-api` 的公共 ConfigForms。页面通过 `configForms.whileServed([namespace], register)` 跟随插件命名空间,Host 未提供新版 API 配置时只禁用对应选项;客户端不新增 Host 模块导入。
299
327
 
300
328
  本插件不在插件详情页(`plugins.bundle.config`)显示配置。
301
329
 
@@ -310,6 +338,12 @@ locale/zh.json {"meta": {"title": "网页搜索", "description": "…"}}
310
338
 
311
339
  卡片内的文案由 `lib/client.js` 的 `zh` / `en` 两份字典提供,改动时须保持键名对齐。
312
340
 
341
+ ### 插件详情页
342
+
343
+ 支持 `meta.detail` 的 DSH 会根据界面语言读取 `locale/zh.json` 或 `locale/en.json` 指定的 `assets/detail/*.md`,并加载文档旁的本地图片。完整 README 保留为使用与开发参考;未提供详情文档的语言按 Host 语言链回退,旧版 Host 继续读取 README。
344
+
345
+ 详情文档中的图片相对于该文档解析。更新详情时,请保持 `meta.detail` 目标及图片路径有效,并通过 `npm pack --dry-run --json` 确认 Markdown 和图片均在安装包内。
346
+
313
347
  ## 发布
314
348
 
315
349
  发布由 GitHub Actions(`.github/workflows/publish.yml`)自动完成:**推送与 `package.json` 版本一致的 `v*` 标签**会带 provenance 发到 npm。向 `main` 的普通推送不会发布。
@@ -0,0 +1,30 @@
1
+ # Web search
2
+
3
+ Give your DeepSeek Harness agent more ways to search the web through the familiar `web_search` tool. Choose search and retrieval 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 default**: DeepSeek Messages search, using an account token or API key.
11
+ - **Try without a key**: choose Tavily `keyless`, or a SearXNG instance with JSON output enabled. Public services may apply rate limits.
12
+
13
+ ## Get started in three steps
14
+
15
+ 1. Enable the plugin and open **Settings → Web search**.
16
+ 2. Choose a search engine and supply credentials when needed. Under **Web retrieval**, independently choose local HTTP (the default) or DeepSeek Fetch API.
17
+ 3. Click **Save**. The next search or retrieval uses the saved settings.
18
+
19
+ The default search engine is **DeepSeek Messages search**. Switch engines and save to call a search API directly. New API options are available only when the Host provides the required configuration.
20
+
21
+ ## Costs and credentials
22
+
23
+ Direct search API calls do not make an additional DeepSeek search model request, but the search service may charge separately. Your conversation and the model reading search results still consume tokens. DeepSeek Messages search makes a model request and may incur model charges. Check the provider's terms for DeepSeek Fetch API charges.
24
+
25
+ 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.
26
+
27
+ ## Guides and feedback
28
+
29
+ - [Full guide](https://github.com/X-C1811/dsh-web-search-plugin/blob/main/README.md)
30
+ - [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 retrieval independently</title><desc id="desc">Configure both in Settings → Web search. Saved settings apply to the next operation. 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 retrieval 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="65" 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="91" y="160" font-size="22" font-weight="600">Search engine</text><text x="56" y="191" font-size="15" fill="#607480">10 options · credentials when needed</text>
12
+ <rect x="56" y="214" width="390" height="38" rx="9" fill="#eef5ff"/><text x="72" y="239" font-size="17" fill="#245fa3">Direct search API</text>
13
+ <text x="56" y="291" font-size="17" >DeepSeek Messages search (default)</text>
14
+ <circle cx="523" 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="549" y="160" font-size="22" font-weight="600">Web retrieval</text><text x="514" y="191" font-size="15" fill="#607480">Independent of your search engine</text>
16
+ <rect x="514" y="214" width="390" height="38" rx="9" fill="#eaf8f2"/><text x="530" y="239" font-size="17" fill="#087b6d">Local HTTP (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="15" fill="#48626e">Saved settings apply to the next operation</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="65" 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="91" y="160" font-size="22" font-weight="600">搜索引擎</text><text x="56" y="191" font-size="15" fill="#607480">10 个选项 · 按需填写凭据</text>
12
+ <rect x="56" y="214" width="390" height="38" rx="9" fill="#eef5ff"/><text x="72" y="239" font-size="17" fill="#245fa3">直接调用搜索 API</text>
13
+ <text x="56" y="291" font-size="17" >DeepSeek Messages 搜索(默认)</text>
14
+ <circle cx="523" 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="549" y="160" font-size="22" font-weight="600">网页抓取</text><text x="514" y="191" font-size="15" fill="#607480">独立于搜索引擎</text>
16
+ <rect x="514" y="214" width="390" height="38" rx="9" fill="#eaf8f2"/><text x="530" y="239" font-size="17" fill="#087b6d">本地 HTTP(默认)</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,30 @@
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 Messages 搜索,支持账号令牌或 API key。
11
+ - **先体验免密钥搜索**:Tavily 选择 `keyless`,或使用支持 JSON 输出的 SearXNG 实例。公共服务可能限流。
12
+
13
+ ## 三步开始
14
+
15
+ 1. 启用本插件,打开 **设置 → 网页搜索**。
16
+ 2. 选择搜索引擎,按需填写凭据;在 **网页抓取** 中独立选择本地 HTTP(默认)或 DeepSeek Fetch API。
17
+ 3. 点击 **保存**,下一次搜索或抓取使用已保存的设置。
18
+
19
+ 默认搜索引擎为 **DeepSeek Messages 搜索**。若要直接调用搜索 API,请主动切换引擎并保存;需要新版 API 的选项只在 Host 提供相应配置时可用。
20
+
21
+ ## 费用与凭据
22
+
23
+ 直接调用搜索 API 不会额外发起 DeepSeek 搜索模型请求,但搜索服务可能单独计费;对话及模型读取结果仍消耗 token。DeepSeek Messages 搜索会发起模型请求,可能产生相应费用。DeepSeek Fetch API 的服务费用以供应商说明为准。
24
+
25
+ 需要密钥的引擎可通过设置页的入口获取 API key,填写后保存。插件沿用 DSH 凭据管理;免密钥模式不代表服务无限额。
26
+
27
+ ## 使用说明与反馈
28
+
29
+ - [完整中文说明](https://github.com/X-C1811/dsh-web-search-plugin/blob/main/README.zh.md)
30
+ - [报告问题](https://github.com/X-C1811/dsh-web-search-plugin/issues)
package/cordis.patch.yml CHANGED
@@ -8,6 +8,9 @@
8
8
  # profile's own cordis.patch.yml still wins if it later overrides `web`. The
9
9
  # seam id is `dsh-web-search`; the backend (DeepSeek / Tavily / Brave) is the
10
10
  # plugin's own `provider` setting.
11
+ # The settings page can independently override searchProvider to
12
+ # deepseek-search-api and fetchProvider to deepseek-fetch-api on rc.2 Hosts.
13
+ # Keep these defaults for existing profiles; API choices are opt-in.
11
14
  - id: web
12
15
  name: '@deepseek-ai/dsh-web'
13
16
  config: