dsh-web-search-plugin 0.7.1 → 0.8.0
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 +31 -0
- package/README.md +22 -22
- package/README.zh.md +27 -27
- package/assets/detail/en.md +4 -4
- package/assets/detail/images/overview.en.svg +3 -3
- package/assets/detail/images/overview.zh.svg +3 -3
- package/assets/detail/zh.md +4 -4
- package/cordis.patch.yml +22 -19
- package/lib/client.js +132 -22
- package/lib/deepseek.js +22 -13
- package/lib/index.js +16 -8
- package/lib/shared.js +1 -1
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,37 @@
|
|
|
4
4
|
|
|
5
5
|
## [未发布]
|
|
6
6
|
|
|
7
|
+
## [0.8.0] - 2026-11-19
|
|
8
|
+
|
|
9
|
+
### 新增
|
|
10
|
+
|
|
11
|
+
- 新增「跟随会话模型」(默认):组合层不再固定 `web.searchProvider`,由 DSH `0.2.2-rc.5` 按模型路由选择。DeepSeek 模型请求使用内置 `deepseek-official` 服务端搜索(搜索不按次收费,每次搜索额外消耗模型 token);其他模型以及无模型请求的搜索使用 `deepseek-search-api`。
|
|
12
|
+
- 卡片提供该选项;只有 Host 组合了内置提供方时才显示,否则提示用户先固定一个引擎。
|
|
13
|
+
- 卡片的 DeepSeek 端点、模型、token 上限与搜索次数现在直接读写内置 `web-search-deepseek` 命名空间,不再维护第二份配置或镜像。
|
|
14
|
+
|
|
15
|
+
### 破坏性变更
|
|
16
|
+
|
|
17
|
+
- peer 下限收到 `0.2.2-rc.5`:不再支持 `0.2.1-rc.2`、`0.2.2-alpha.3` 与 `0.2.2-rc.4`。这些 Host 没有按路由选择搜索提供方的能力,未固定 `searchProvider` 时会以 `WEB_PROVIDER_AMBIGUOUS` 失败。
|
|
18
|
+
- 「DeepSeek 服务端搜索」改为固定内置 `deepseek-official`,不再走本插件自己的 Messages 后端。旧配置(`web.searchProvider: dsh-web-search` 且 `provider: deepseek-official`)仍由兼容后端继续服务,下一次在卡片保存时自动迁移到内置 id;插件命名空间里的 DeepSeek 参数会在迁移时带入 `web-search-deepseek`。
|
|
19
|
+
- 组合层不再禁用内置 `web-search-deepseek`(跟随模式与服务端搜索都需要它注册 `deepseek-official`)。内置「网页搜索与获取」设置页仍保持禁用,配置入口仍是本插件卡片。
|
|
20
|
+
- 默认搜索提供方由固定 `deepseek-search-api` 改为跟随会话模型。需要保持旧行为时,在卡片选择 **DeepSeek Search API**。
|
|
21
|
+
|
|
22
|
+
### 修复
|
|
23
|
+
|
|
24
|
+
- 卡片的 DeepSeek 高级字段(模型、API 版本、token 上限、搜索次数)写入 prefixed 字段,而 Host 只读取无前缀字段,导致这些设置不影响实际搜索。现在 `readSection` 同时读取两套字段,prefixed 优先、旧字段兜底。
|
|
25
|
+
- DeepSeek 服务端搜索把请求携带的模型路由(`llmProvider`)传给账号令牌解析。DSH `0.2.2-rc.5` 起由 Host 在搜索请求上下发该字段,账号路由的搜索不再回退到「最近一次会话路由」而改用 API Key,与 `ready()` 的就绪判断保持一致。
|
|
26
|
+
- DeepSeek Messages 结果映射优先采用结果项自带的 `snippet`,citation 摘要仅作兜底,与官方 `0.2.2-rc.5` 提供方一致;带自身摘要的结果不再丢失正文。
|
|
27
|
+
|
|
28
|
+
### 变更
|
|
29
|
+
|
|
30
|
+
- 文案跟随官方 `0.2.2-rc.5`:`DeepSeek(旧版)` 改为 `DeepSeek 服务端搜索` / `DeepSeek server-side search`,说明由「速度较慢」改为「搜索不按次收费,每次搜索都会额外消耗模型 token」。同步卡片、插件详情、语言包与 README。
|
|
31
|
+
|
|
32
|
+
### 兼容性
|
|
33
|
+
|
|
34
|
+
- 在 `0.2.2-rc.5` 的真实依赖(`dsh-web`、`dsh-web-deepseek-api`、`dsh-web-search-deepseek`、`cordis 4.1.0`、`schemastery 3.19.0`)上验证:打包安装、Host 搜索接缝、`searchReady(llmProvider)`、携带 `llmProvider` 的搜索、Messages 后端、fetch 接缝,以及未固定提供方时 DeepSeek 路由走 `/messages`、其他路由走 `/v1/tools/search`。
|
|
35
|
+
- 新增回归用例覆盖路由透传、结果项 `snippet` 优先、跟随模式的写入分组、镜像与退出跟随。
|
|
36
|
+
- 包版本与 User-Agent 更新为 `0.8.0`。
|
|
37
|
+
|
|
7
38
|
## [0.7.1] - 2026-11-18
|
|
8
39
|
|
|
9
40
|
### 变更
|
package/README.md
CHANGED
|
@@ -6,17 +6,17 @@ A web search plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepse
|
|
|
6
6
|
|
|
7
7
|
## Why use this plugin?
|
|
8
8
|
|
|
9
|
-
- **Avoid an extra DeepSeek model call
|
|
9
|
+
- **Avoid an extra DeepSeek model call when you pick a direct engine.** 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.**
|
|
12
|
+
- **Keep existing engines and settings.** DeepSeek server-side search (Messages) 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
|
|
14
|
+
**The default is to follow the conversation model**, matching DSH `0.2.2-rc.5`: no search provider is pinned, and the Host picks one per model route. DeepSeek model requests use **DeepSeek server-side search** (`deepseek-official`: no per-search charge, but each search sends a Messages request and spends model tokens); every other model and searches outside a model request use **DeepSeek Search API** (`deepseek-search-api`: billed per search, no auxiliary model turn). Pin any engine in the card to apply it to every model.
|
|
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
|
|
19
|
+
- **DeepSeek server-side search** — 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: there is no per-search charge, but it 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,10 +30,10 @@ For DuckDuckGo results, choose a SearXNG instance that aggregates DuckDuckGo. Du
|
|
|
30
30
|
|
|
31
31
|
## Requirements
|
|
32
32
|
|
|
33
|
-
- Isolated checks use the actual dependencies of DeepSeek Harness `0.2.2-rc.
|
|
34
|
-
-
|
|
35
|
-
- DSH `0.2.2` RC
|
|
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
|
|
33
|
+
- Isolated checks use the actual dependencies of DeepSeek Harness `0.2.2-rc.5`, covering packed installation, the Host web seam, configuration changes, follow-mode selection, and credential readiness. Earlier release candidates are no longer supported. Supplier HTTP responses are mocked; this does not verify live accounts or the Desktop settings UI end to end.
|
|
34
|
+
- Peer ranges require `0.2.2-rc.5` and later. `0.2.1-rc.2`, `0.2.2-alpha.3`, and `0.2.2-rc.4` cannot select a search provider by model route, so follow mode cannot work there.
|
|
35
|
+
- DSH `0.2.2` RC requires Node.js `>=24.9.0`. The plugin itself still declares `^22.19.0` or `>=24.0.0`.
|
|
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 server-side search reads the route the search request carries (`llmProvider`); readiness does not validate keys over the network.
|
|
37
37
|
- pnpm, used by `dsh plugin` to install the plugin into a profile
|
|
38
38
|
|
|
39
39
|
## Installation
|
|
@@ -47,7 +47,7 @@ dsh plugin --profile web add dsh-web-search-plugin
|
|
|
47
47
|
After installation, configure the plugin in the Harness Web UI:
|
|
48
48
|
|
|
49
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.
|
|
50
|
-
2. Choose a search engine.
|
|
50
|
+
2. Choose a search engine. The default is **follow the conversation model**; you can also pin DeepSeek Search API, DeepSeek server-side search, Tavily, Brave, Serper, SerpApi, Exa, SearXNG, Scavio, or Firecrawl.
|
|
51
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.
|
|
52
52
|
4. Under **Web fetch provider**, independently select local fetch (default) or DeepSeek Fetch API.
|
|
53
53
|
5. Adjust parameters and click **Save** at the bottom. Unsaved changes remain drafts; the next operation uses the saved settings.
|
|
@@ -60,7 +60,7 @@ For normal use, configure the plugin in **Settings → Web search**. The card sh
|
|
|
60
60
|
|
|
61
61
|
### New Search API and web fetch
|
|
62
62
|
|
|
63
|
-
The page reuses the official providers rather than registering duplicate implementations. The installation default
|
|
63
|
+
The page reuses the official providers rather than registering duplicate implementations. The installation default leaves `web.searchProvider` unset (follow the conversation model). Selecting a third-party engine this bundle serves sets `dsh-web-search`; DeepSeek server-side search sets the in-box `deepseek-official`; DeepSeek Search API sets `deepseek-search-api`; each also saves this plugin's `provider`. Fetch independently selects `web.fetchProvider: http` or `deepseek-fetch-api`. Existing custom fetch providers are shown and preserved until explicitly changed.
|
|
64
64
|
|
|
65
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.
|
|
66
66
|
|
|
@@ -74,14 +74,14 @@ See [official billing](https://api-docs.deepseek.com/zh-cn/guides/search/#计费
|
|
|
74
74
|
|
|
75
75
|
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.
|
|
76
76
|
|
|
77
|
-
The tables below describe the
|
|
77
|
+
The tables below describe the backends this plugin dispatches; official Search API configuration is described above.
|
|
78
78
|
|
|
79
79
|
### General settings
|
|
80
80
|
|
|
81
81
|
| Key | Default | Meaning and scope |
|
|
82
82
|
|---|---|---|
|
|
83
|
-
| `provider` | `deepseek-search-api` |
|
|
84
|
-
| `maxResults` | `8` | Maximum returned sources for
|
|
83
|
+
| `provider` | `deepseek-search-api` | The card's engine choice. **Follow the conversation model** writes `deepseek-official` and leaves the actual selection to the Host per model route; a pinned engine is `deepseek-search-api` (reuses the in-box provider), `deepseek-official` (server-side search), `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 DeepSeek server-side search |
|
|
84
|
+
| `maxResults` | `8` | Maximum returned sources for this plugin's backends (excluding the official 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 |
|
|
85
85
|
|
|
86
86
|
### Keys and credential references
|
|
87
87
|
|
|
@@ -132,7 +132,7 @@ Clearing a text input or using “Restore default” in the card normally remove
|
|
|
132
132
|
</thead>
|
|
133
133
|
<tbody>
|
|
134
134
|
<tr>
|
|
135
|
-
<td rowspan="4"><strong>DeepSeek
|
|
135
|
+
<td rowspan="4"><strong>DeepSeek server-side search</strong></td>
|
|
136
136
|
<td><code>deepseekModel</code></td>
|
|
137
137
|
<td><code>deepseek-flash</code></td>
|
|
138
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>
|
|
@@ -145,7 +145,7 @@ Clearing a text input or using “Restore default” in the card normally remove
|
|
|
145
145
|
<tr>
|
|
146
146
|
<td><code>deepseekMaxTokens</code></td>
|
|
147
147
|
<td><code>4096</code></td>
|
|
148
|
-
<td>Maximum generated tokens for one
|
|
148
|
+
<td>Maximum generated tokens for one DeepSeek server-side search request, a positive integer; not a conversation-wide token limit; shown under Advanced settings</td>
|
|
149
149
|
</tr>
|
|
150
150
|
<tr>
|
|
151
151
|
<td><code>deepseekMaxUses</code></td>
|
|
@@ -212,7 +212,7 @@ The startup environment variable `DSH_WEB_SEARCH_PROVIDER=dsh-web-search` select
|
|
|
212
212
|
|
|
213
213
|
## Quotas
|
|
214
214
|
|
|
215
|
-
- **DeepSeek
|
|
215
|
+
- **DeepSeek server-side search**: No quota bar. Search still makes a model request, with usage subject to your account or API billing.
|
|
216
216
|
- **Tavily keyless**: No quota bar; access is free and rate-limited.
|
|
217
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.
|
|
218
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/).
|
|
@@ -220,15 +220,15 @@ The startup environment variable `DSH_WEB_SEARCH_PROVIDER=dsh-web-search` select
|
|
|
220
220
|
|
|
221
221
|
## Disable or uninstall
|
|
222
222
|
|
|
223
|
-
###
|
|
223
|
+
### Pin DeepSeek server-side search
|
|
224
224
|
|
|
225
|
-
The
|
|
225
|
+
The default follows the conversation model, so DeepSeek models already use server-side search while other models use DeepSeek Search API. To make **every model** use server-side search, select **DeepSeek server-side search** in **Settings → Web search** and save. That pins `web.searchProvider` to the in-box `deepseek-official`, so all models run through the in-box provider; the card writes its endpoint, model, and limits straight into `web-search-deepseek`. It sends an extra Messages model request: there is no per-search charge, but it may incur model invocation charges.
|
|
226
226
|
|
|
227
227
|
### Disable and restore built-in search
|
|
228
228
|
|
|
229
|
-
Use the following steps when you want to stop using this plugin and
|
|
229
|
+
Use the following steps when you want to stop using this plugin and return to Harness's own search surfaces. Pinning this plugin's DeepSeek engine and removing the plugin are separate operations.
|
|
230
230
|
|
|
231
|
-
Open **Plugins** in the sidebar and turn off the **entire `dsh-web-search-plugin` bundle**. This removes its composition layer and
|
|
231
|
+
Open **Plugins** in the sidebar and turn off the **entire `dsh-web-search-plugin` bundle**. This removes its composition layer and restores the built-in Web search & fetch settings page; the built-in DeepSeek search provider stays registered either way. 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.
|
|
232
232
|
|
|
233
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.
|
|
234
234
|
|
|
@@ -246,9 +246,9 @@ The same checks for manually added overrides apply after uninstallation. Explici
|
|
|
246
246
|
|
|
247
247
|
## How it works
|
|
248
248
|
|
|
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
|
|
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 eight third-party engines share this provider; DeepSeek server-side search runs through the in-box `deepseek-official` provider, with this plugin only owning its parameters and migration. 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.
|
|
250
250
|
|
|
251
|
-
This package is a **bundle**. The `dsh.bundle.patch` declaration points to `cordis.patch.yml`, which adds the Host entry,
|
|
251
|
+
This package is a **bundle**. The `dsh.bundle.patch` declaration points to `cordis.patch.yml`, which adds the Host entry, leaves `web.searchProvider` unset (follow the conversation model), and disables 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. The in-box `web-search-deepseek` provider stays registered: follow mode and DeepSeek server-side search run through it, and this plugin's `deepseek-official` engine value only survives for migrating old pins. 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.
|
|
252
252
|
|
|
253
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.
|
|
254
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.
|
package/README.zh.md
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
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 自带的 **网页搜索与获取**
|
|
13
|
-
- **保留已有引擎与设置。**
|
|
12
|
+
- **对齐官方配置项。** 提供方名称、说明文字和默认值与 DSH 自带的 **网页搜索与获取** 页面一致:默认跟随会话模型,抓取默认由本机直接获取。
|
|
13
|
+
- **保留已有引擎与设置。** DeepSeek 服务端搜索(Messages)和第三方引擎继续可用,搜索与获取独立选择;移除已保存的提供方覆盖前,请参考[停用或卸载](#停用或卸载)。
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
**默认跟随会话模型**(与 DSH `0.2.2-rc.5` 默认一致):不固定搜索提供方,由 Host 按模型路由选择。DeepSeek 模型请求使用 **DeepSeek 服务端搜索**(`deepseek-official`,搜索不按次收费,但每次会发起一轮 Messages 请求、消耗模型 token);其他模型以及不来自模型请求的搜索使用 **DeepSeek Search API**(`deepseek-search-api`,按次计费,无辅助模型轮次)。也可在卡片中固定任一引擎,固定后对所有模型生效。
|
|
16
16
|
|
|
17
17
|
## 支持的搜索后端
|
|
18
18
|
|
|
19
|
-
- **DeepSeek Search API
|
|
20
|
-
- **DeepSeek
|
|
19
|
+
- **DeepSeek Search API(非 DeepSeek 模型的默认)** — 复用 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`。每次搜索会发起模型请求:搜索不按次收费,但可能产生模型调用费用。
|
|
21
21
|
- **Tavily** — `keyless`(免费、限流、无需账号)或 `keyed`(`TAVILY_API_KEY`,Bearer token)。keyed 会在设置卡显示额度进度条。
|
|
22
22
|
- **Brave Search** — `GET https://api.search.brave.com/res/v1/web/search`,请求头 `X-Subscription-Token`(凭据名 `BRAVE_API_KEY`)。一次搜索就是一次 HTTP 请求,不走模型轮次;设置卡按响应头展示 Capacity / 月配额。
|
|
23
23
|
- **Serper** — Google 结果(`POST /search`,头 `X-API-KEY`,凭据名 `SERPER_API_KEY`)。
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
|
|
32
32
|
## 运行要求
|
|
33
33
|
|
|
34
|
-
- 已在 DeepSeek Harness `0.2.2-rc.
|
|
35
|
-
-
|
|
36
|
-
- DSH `0.2.2` 的 RC
|
|
37
|
-
- 支持工具就绪检查的 Host 会在缺少所需凭据时隐藏插件搜索工具;Tavily keyless 与 SearXNG 无需密钥。DeepSeek
|
|
34
|
+
- 已在 DeepSeek Harness `0.2.2-rc.5` 的实际依赖上验证打包安装、Host 搜索接缝、配置切换、跟随模式的路由选择与凭据就绪判断;更早的 RC 不再受支持。供应商 HTTP 使用模拟响应,不代表真实账号联网或桌面设置页端到端验证。
|
|
35
|
+
- 依赖范围为 `0.2.2-rc.5` 及以上;`0.2.1-rc.2`、`0.2.2-alpha.3` 与 `0.2.2-rc.4` 没有按模型路由选择搜索提供方的能力,无法支持跟随模式。
|
|
36
|
+
- DSH `0.2.2` 的 RC 要求 Node.js `>=24.9.0`;插件本身仍声明 `^22.19.0` 或 `>=24.0.0` 的运行范围。
|
|
37
|
+
- 支持工具就绪检查的 Host 会在缺少所需凭据时隐藏插件搜索工具;Tavily keyless 与 SearXNG 无需密钥。DeepSeek 服务端搜索按请求携带的模型路由(`llmProvider`)判断账号令牌与 API key,不联网校验密钥有效性。
|
|
38
38
|
- pnpm,用于通过 `dsh plugin` 把插件装进 profile
|
|
39
39
|
|
|
40
40
|
## 安装
|
|
@@ -48,7 +48,7 @@ dsh plugin --profile web add dsh-web-search-plugin
|
|
|
48
48
|
安装后,在 Harness Web 界面中完成配置:
|
|
49
49
|
|
|
50
50
|
1. 打开 **设置 → 网页搜索**,找到本插件的设置卡片。侧栏的 **插件** 页面负责启用或停用组合包,引擎参数在设置卡片中配置。
|
|
51
|
-
2.
|
|
51
|
+
2. 选择网页搜索提供方。默认是**跟随会话模型**;也可固定 DeepSeek Search API、DeepSeek 服务端搜索、Tavily、Brave、Serper、SerpApi、Exa、SearXNG、Scavio 或 Firecrawl。
|
|
52
52
|
3. 按需填写所选引擎的 API key,需要密钥的引擎会显示「获取 API key ↗」,点击即可打开官方控制台。Tavily 免 key 使用时选择 `keyless`;SearXNG 填写已启用 JSON 搜索的实例地址,这两种免 key 方式不显示密钥获取链接。已有凭据可以复用,例如 Brave 的 `BRAVE_API_KEY`。
|
|
53
53
|
4. 在 **网页获取提供方** 中选择本机直接获取(默认)或 DeepSeek Fetch API。更换搜索提供方不会更改获取方式。
|
|
54
54
|
5. 调整参数并点击页面底部的 **保存**;保存前只修改草稿,下一次操作使用已保存配置。
|
|
@@ -61,7 +61,7 @@ dsh plugin --profile web add dsh-web-search-plugin
|
|
|
61
61
|
|
|
62
62
|
### 新版 Search API 与网页获取
|
|
63
63
|
|
|
64
|
-
页面复用官方提供方,不重复注册 Search / Fetch
|
|
64
|
+
页面复用官方提供方,不重复注册 Search / Fetch。安装默认不固定 `web.searchProvider`(跟随会话模型);选择本插件的第三方引擎时设为 `dsh-web-search`,选择 DeepSeek 服务端搜索时设为内置 `deepseek-official`,选择 DeepSeek Search API 时设为 `deepseek-search-api`,同时保存本插件的 `provider`。`web.fetchProvider` 独立选择 `http` 或 `deepseek-fetch-api`。已有自定义获取提供方会显示并保留,除非用户主动更改。
|
|
65
65
|
|
|
66
66
|
`web-deepseek-api` 在 DSH `0.2.2-rc.2` 起把凭据与地址拆成按能力分开的字段。卡片的「凭据引用名」和「基础地址」会同时写入 `searchApiKeyEnv` / `fetchApiKeyEnv` 与 `searchBaseURL` / `fetchBaseURL`;更早的 Host 仍写 `apiKeyEnv` / `baseURL`。卡片按 Host 实际提供的 schema 自动切换,不会向不存在的字段写入。
|
|
67
67
|
|
|
@@ -69,20 +69,20 @@ dsh plugin --profile web add dsh-web-search-plugin
|
|
|
69
69
|
|
|
70
70
|
`count` 只控制新版搜索的结果数,不是请求次数或费用上限。官方高级配置 `sendOriginalQuestion` 默认开启,搜索时会发送经规整且最多 128 字符的触发问题;可在官方配置中关闭,本页面保留该值。
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
默认组合为 **跟随会话模型 + 本机直接获取**。DeepSeek 模型的搜索走服务端搜索,其他模型走 Search API;本机直接获取从运行 DSH 的设备访问目标网站,不调用收费 Fetch API,可访问内网和本机但不能执行页面 JavaScript,也不支持 PDF。DeepSeek Fetch 是可选的远端 Markdown 抓取,无法访问内网和本机,不保证能读取所有网站。工具结果交给主模型后仍占用会话 token。没有自动切换引擎或付费获取兜底。
|
|
73
73
|
|
|
74
74
|
[官方计费说明](https://api-docs.deepseek.com/zh-cn/guides/search/#计费):Search / Fetch 均按成功且产生结果的请求收费;价格请以官方文档为准。界面不将估算金额当作实际账单。
|
|
75
75
|
|
|
76
76
|
一次保存会先写凭据,再写引擎和 API 参数,最后用一个 `web` mutation 提交本次修改的搜索/抓取选择。每个命名空间有独立 revision,跨命名空间不是事务;若后续步骤失败,已接受的写入不会自动回滚,页面会提示可能部分保存并保留草稿以便重试。保存期间锁定编辑,放弃修改不触发写入。
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
下面的配置表描述本插件调度的后端;官方 Search API 的配置位置如上。
|
|
79
79
|
|
|
80
80
|
### 通用配置
|
|
81
81
|
|
|
82
82
|
| 键 | 默认值 | 含义与范围 |
|
|
83
83
|
|---|---|---|
|
|
84
|
-
| `provider` | `deepseek-search-api` |
|
|
85
|
-
| `maxResults` | `8` |
|
|
84
|
+
| `provider` | `deepseek-search-api` | 卡片上的引擎选择。**跟随会话模型**时写入 `deepseek-official`,实际选择由 Host 按模型路由决定;固定引擎时取 `deepseek-search-api`(复用官方提供方)、`deepseek-official`(DeepSeek 服务端搜索)、`tavily`、`brave`、`serper`、`serpapi`、`exa`、`searxng`、`scavio` 或 `firecrawl`。一次请求只使用所选后端,不会在失败后自动切换到其他后端;未知值会回退到 DeepSeek 服务端搜索 |
|
|
85
|
+
| `maxResults` | `8` | 本插件后端的返回源数量上限(不含官方 Search API),范围 1–20,同时受调用方 `request.maxResults` 上限约束。SearXNG 和 Scavio 不发送请求级数量参数,只在收到响应并按 URL 去重后截取;实际可返回的数量取决于上游结果 |
|
|
86
86
|
|
|
87
87
|
### 密钥与凭据引用
|
|
88
88
|
|
|
@@ -133,10 +133,10 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
|
|
|
133
133
|
</thead>
|
|
134
134
|
<tbody>
|
|
135
135
|
<tr>
|
|
136
|
-
<td rowspan="4"><strong>DeepSeek
|
|
136
|
+
<td rowspan="4"><strong>DeepSeek 服务端搜索</strong></td>
|
|
137
137
|
<td><code>deepseekModel</code></td>
|
|
138
138
|
<td><code>deepseek-flash</code></td>
|
|
139
|
-
<td>仅 DeepSeek
|
|
139
|
+
<td>仅 DeepSeek 服务端搜索搜索请求使用的模型名,不会修改会话的聊天模型;需由目标端点支持;设置卡收在「高级设置」中</td>
|
|
140
140
|
</tr>
|
|
141
141
|
<tr>
|
|
142
142
|
<td><code>deepseekApiVersion</code></td>
|
|
@@ -146,12 +146,12 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
|
|
|
146
146
|
<tr>
|
|
147
147
|
<td><code>deepseekMaxTokens</code></td>
|
|
148
148
|
<td><code>4096</code></td>
|
|
149
|
-
<td>单次 DeepSeek
|
|
149
|
+
<td>单次 DeepSeek 服务端搜索搜索请求的生成 token 上限,正整数;不是整个对话的 token 上限;设置卡收在「高级设置」中</td>
|
|
150
150
|
</tr>
|
|
151
151
|
<tr>
|
|
152
152
|
<td><code>deepseekMaxUses</code></td>
|
|
153
153
|
<td><code>5</code></td>
|
|
154
|
-
<td>单次 DeepSeek
|
|
154
|
+
<td>单次 DeepSeek 服务端搜索请求允许的服务端搜索次数上限,须为正整数,默认 5;不是引擎重试次数或结果数量</td>
|
|
155
155
|
</tr>
|
|
156
156
|
<tr>
|
|
157
157
|
<td rowspan="4"><strong>Tavily</strong></td>
|
|
@@ -213,7 +213,7 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
|
|
|
213
213
|
|
|
214
214
|
## 额度
|
|
215
215
|
|
|
216
|
-
- **DeepSeek
|
|
216
|
+
- **DeepSeek 服务端搜索**:不展示额度条。仍会发起模型搜索请求,用量按所用账号或 API 的计费规则处理。
|
|
217
217
|
- **Tavily keyless**:不展示额度条,免费且有限流。
|
|
218
218
|
- **Tavily keyed**:搜索时请求 `include_usage`,在内存中累加当前凭据的 credits。Host 定时调用 `GET /usage`,设置卡也可手动刷新;手动刷新之间至少间隔 10 秒,自动对账不受此限制。用 `account.current_plan` / `plan_limit` 做限额,用量取当前凭据的本地累计与远端的较大值;换 key 时清空旧账户用量并立即重新对账。旧 Tavily 额度不再持久化到磁盘。
|
|
219
219
|
- **Brave**:没有 usage / 花费接口。控制台 **Capacity** 就是响应头里的每秒窗口(例如 50 次/秒)。月限额 `0` 表示不限请求次数,不是额度用完。计费 credits 只能看 [Brave API 控制台](https://api-dashboard.search.brave.com/)。
|
|
@@ -221,19 +221,19 @@ DeepSeek 官方账号会话(provider 为 `deepseek-account`)会优先尝试
|
|
|
221
221
|
|
|
222
222
|
## 停用或卸载
|
|
223
223
|
|
|
224
|
-
###
|
|
224
|
+
### 固定为 DeepSeek 服务端搜索
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
默认跟随会话模型,DeepSeek 模型已经使用服务端搜索;其他模型走 DeepSeek Search API。若希望**所有模型**都使用服务端搜索,在 **设置 → 网页搜索** 中选择 **DeepSeek 服务端搜索** 并保存。这会把 `web.searchProvider` 固定为内置的 `deepseek-official`,所有模型都走内置 DeepSeek 提供方;它会额外发起 Messages 模型请求:搜索不按次收费,但可能产生模型调用费用。卡片里的 DeepSeek 端点、模型与次数直接写入该提供方的 `web-search-deepseek` 配置。
|
|
227
227
|
|
|
228
228
|
### 停用并恢复内置搜索
|
|
229
229
|
|
|
230
230
|
若希望停用本插件、恢复 Harness 原装的搜索插件与「网页搜索与获取」设置页,再执行以下操作。切换到本插件中的 DeepSeek 引擎与恢复原装插件是两种不同操作。
|
|
231
231
|
|
|
232
|
-
打开侧栏 **插件** 页面,关闭 **整个 `dsh-web-search-plugin`
|
|
232
|
+
打开侧栏 **插件** 页面,关闭 **整个 `dsh-web-search-plugin` 组合包的开关**。这会撤销该组合层,并恢复内置「网页搜索与获取」设置页(内置 DeepSeek 提供方由组合包保持注册,不受影响)。本页面显式保存的提供方选择仍保留在 Profile 中:需检查 `web.searchProvider` 与 `web.fetchProvider`,移除覆盖才能完整恢复 Profile 默认值;之后也可以重新打开组合包。
|
|
233
233
|
|
|
234
234
|
请使用组合包的总开关:仅关闭包内某个组件,其他配置覆盖仍会保留。启用配置热更新的 Profile 会立即应用改动,否则需要重启 Harness。
|
|
235
235
|
|
|
236
|
-
|
|
236
|
+
组合包不固定 `web.searchProvider`,默认跟随会话模型。如果曾手工改成 `dsh-web-search`、设置 `DSH_WEB_SEARCH_PROVIDER=dsh-web-search`,或另行禁用内置 DeepSeek 插件,还需移除或恢复这些覆盖。组合包开关不会撤销你单独添加的配置。
|
|
237
237
|
|
|
238
238
|
### 卸载安装包
|
|
239
239
|
|
|
@@ -247,9 +247,9 @@ dsh plugin --profile web remove dsh-web-search-plugin
|
|
|
247
247
|
|
|
248
248
|
## 工作方式
|
|
249
249
|
|
|
250
|
-
本插件通过 `ctx.web` 注册一个稳定 id 为 `dsh-web-search` 的 `WebSearchProvider`,遵循与官方 `@deepseek-ai/dsh-web-search-deepseek` 相同的提供方约定(`inject: ['web']` 和 `ctx.web.registerSearchProvider
|
|
250
|
+
本插件通过 `ctx.web` 注册一个稳定 id 为 `dsh-web-search` 的 `WebSearchProvider`,遵循与官方 `@deepseek-ai/dsh-web-search-deepseek` 相同的提供方约定(`inject: ['web']` 和 `ctx.web.registerSearchProvider`)。八个第三方引擎由该提供方内部调度;DeepSeek 服务端搜索由内置 `deepseek-official` 提供方执行,本插件只负责它的参数与迁移。各引擎结果规范化为 `WebSearchResult`(可选 `content` 和 `sources[]`),按 URL 去重。全部配置字段声明为 `volatile()`,保存后无需重启插件即可读取新配置。
|
|
251
251
|
|
|
252
|
-
本包是 **bundle**:`dsh.bundle.patch` 声明指向 `cordis.patch.yml`,组合包启用时会插入 Host
|
|
252
|
+
本包是 **bundle**:`dsh.bundle.patch` 声明指向 `cordis.patch.yml`,组合包启用时会插入 Host 行、不固定搜索提供方(默认跟随会话模型),并禁用内置的 `ui-settings-web-search` 设置页——该页与本插件页面配置同一对 `web` / `web-deepseek-api` 接缝,保留两个入口只会造成重复配置。内置 `web-search-deepseek` 保持注册,跟随模式与「DeepSeek 服务端搜索」由它执行;本插件的 `deepseek-official` 引擎值仅用于旧配置迁移。关闭整个组合包会移除这一补丁层,仅关闭其中的 Host 行则不会。没有 bundle 声明时,`dsh plugin add` 只写入依赖,插件不会挂载。
|
|
253
253
|
|
|
254
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`。
|
|
255
255
|
- **纯 REST 类(Tavily / Brave / Serper / SerpApi / Exa / SearXNG / Scavio / Firecrawl)** — 由静态元数据表(`lib/providers.js`)+ 通用后端(`lib/rest.js`)驱动。请求方法 / 路径 / 查询字段名 / 鉴权(bearer / header / none / query)/ 固定参数 / 响应形态由表中的行决定。REST 后端不追加自定义会话事件。
|
|
@@ -273,7 +273,7 @@ lib/shared.js 中止 / 凭据解析辅助
|
|
|
273
273
|
lib/client.js 浏览器 bundle:设置分区 + 引擎切换 + 官方 key 跳转 + 额度条
|
|
274
274
|
locale/en.json 插件列表页 / 详情页的英文标题与描述
|
|
275
275
|
locale/zh.json 同上,中文
|
|
276
|
-
cordis.patch.yml Bundle patch:插入 Host
|
|
276
|
+
cordis.patch.yml Bundle patch:插入 Host 行、不固定 searchProvider、禁用内置设置页
|
|
277
277
|
```
|
|
278
278
|
|
|
279
279
|
## 开发
|
package/assets/detail/en.md
CHANGED
|
@@ -7,8 +7,8 @@ Give your DeepSeek Harness agent more ways to search the web through the familia
|
|
|
7
7
|
## Choose how to search
|
|
8
8
|
|
|
9
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
|
|
11
|
-
- **
|
|
10
|
+
- **Keep the official default (recommended)**: follow the conversation model. DeepSeek models use server-side search and every other model uses DeepSeek Search API, ready after install.
|
|
11
|
+
- **Pin server-side search**: every model uses DeepSeek server-side search, where models on the account route use the signed-in account and every other request uses the API key.
|
|
12
12
|
- **Try without a key**: choose Tavily `keyless`, or a SearXNG instance with JSON output enabled. Public services may apply rate limits.
|
|
13
13
|
|
|
14
14
|
## Get started in three steps
|
|
@@ -17,11 +17,11 @@ Give your DeepSeek Harness agent more ways to search the web through the familia
|
|
|
17
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
18
|
3. Click **Save**. The next search or retrieval uses the saved settings.
|
|
19
19
|
|
|
20
|
-
The default search
|
|
20
|
+
The default **follows the conversation model**, matching DSH `0.2.2-rc.5`: DeepSeek models use server-side search (no per-search charge, model tokens apply) and every other model uses DeepSeek Search API (billed per search). You can also pin any engine in the card. Billing for both Search API and server-side DeepSeek can be Automatic, Account, or API key. New API options are available only when the Host provides the required configuration.
|
|
21
21
|
|
|
22
22
|
## Costs and credentials
|
|
23
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
|
|
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 server-side search makes a model request: there is no per-search charge, but it 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
25
|
|
|
26
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
27
|
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
<rect x="32" y="116" width="438" height="210" rx="18" fill="#fff" stroke="#d8e6ec"/>
|
|
9
9
|
<rect x="490" y="116" width="438" height="210" rx="18" fill="#fff" stroke="#d8e6ec"/>
|
|
10
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">
|
|
12
|
-
<rect x="46" y="214" width="400" height="38" rx="9" fill="#eef5ff"/><text x="56" y="239" font-size="17" fill="#245fa3">
|
|
13
|
-
<text x="56" y="291" font-size="17" >
|
|
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">11 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">Follow the conversation model (default)</text>
|
|
13
|
+
<text x="56" y="291" font-size="17" >Search API / server-side search / 8 engines</text>
|
|
14
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
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
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>
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
<rect x="32" y="116" width="438" height="210" rx="18" fill="#fff" stroke="#d8e6ec"/>
|
|
9
9
|
<rect x="490" y="116" width="438" height="210" rx="18" fill="#fff" stroke="#d8e6ec"/>
|
|
10
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">
|
|
12
|
-
<rect x="46" y="214" width="400" height="38" rx="9" fill="#eef5ff"/><text x="56" y="239" font-size="17" fill="#245fa3"
|
|
13
|
-
<text x="56" y="291" font-size="17" >
|
|
11
|
+
<text x="96" y="160" font-size="22" font-weight="600">网页搜索提供方</text><text x="56" y="191" font-size="15" fill="#607480">11 个选项 · 按需填写凭据</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">跟随会话模型(默认)</text>
|
|
13
|
+
<text x="56" y="291" font-size="17" >Search API / 服务端搜索 / 8 个引擎</text>
|
|
14
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
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
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>
|
package/assets/detail/zh.md
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
## 选择适合你的搜索方式
|
|
8
8
|
|
|
9
9
|
- **直接调用搜索 API**:DeepSeek Search API、Tavily、Brave Search、Serper、SerpApi、Exa、SearXNG、Scavio、Firecrawl。
|
|
10
|
-
-
|
|
11
|
-
-
|
|
10
|
+
- **保持官方默认(推荐)**:跟随会话模型。DeepSeek 模型用服务端搜索,其他模型用 DeepSeek Search API,安装后即用。
|
|
11
|
+
- **固定为服务端搜索**:所有模型都使用 DeepSeek 服务端搜索,账号模型发起的请求用已登录账号,其他请求用 API key。
|
|
12
12
|
- **先体验免密钥搜索**:Tavily 选择 `keyless`,或使用支持 JSON 输出的 SearXNG 实例。公共服务可能限流。
|
|
13
13
|
|
|
14
14
|
## 三步开始
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
2. 选择网页搜索提供方,按需填写凭据;在 **网页获取提供方** 中独立选择本机直接获取(默认)或 DeepSeek Fetch API。
|
|
18
18
|
3. 点击 **保存**,下一次搜索或抓取使用已保存的设置。
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
默认**跟随会话模型**,与 DSH `0.2.2-rc.5` 自带页面一致:DeepSeek 模型用服务端搜索(不按次收费,消耗模型 token),其他模型用 DeepSeek Search API(按次计费)。也可在卡片中固定任一引擎。新版 API 与服务端搜索的「计费方式」都可选自动、账号或 API Key;需要新版 API 的选项只在 Host 提供相应配置时可用。
|
|
21
21
|
|
|
22
22
|
## 费用与凭据
|
|
23
23
|
|
|
24
|
-
直接调用搜索 API 不会额外发起 DeepSeek 搜索模型请求,但搜索服务可能单独计费,由「计费方式」选定的账号或 API Key 支付;对话及模型读取结果仍消耗 token。DeepSeek
|
|
24
|
+
直接调用搜索 API 不会额外发起 DeepSeek 搜索模型请求,但搜索服务可能单独计费,由「计费方式」选定的账号或 API Key 支付;对话及模型读取结果仍消耗 token。DeepSeek 服务端搜索会发起模型请求:搜索不按次收费,但可能产生相应的模型调用费用。本机直接获取免费,可访问内网和本机,但不支持需要 JavaScript 或登录的页面和 PDF;DeepSeek Fetch API 的费用以供应商说明为准。
|
|
25
25
|
|
|
26
26
|
需要密钥的引擎可通过设置页的入口获取 API key,填写后保存。插件沿用 DSH 凭据管理;免密钥模式不代表服务无限额。
|
|
27
27
|
|
package/cordis.patch.yml
CHANGED
|
@@ -3,31 +3,34 @@
|
|
|
3
3
|
# installs the package as a plain library: no loader row, no Host apply, no
|
|
4
4
|
# `/plugins/<name>/client.js`.
|
|
5
5
|
#
|
|
6
|
-
# `
|
|
7
|
-
#
|
|
8
|
-
#
|
|
6
|
+
# `fetchProvider` is restated in full because a Cordis patch replaces the
|
|
7
|
+
# targeted row's whole `config`. The profile's own cordis.patch.yml still wins
|
|
8
|
+
# if it later overrides `web`.
|
|
9
9
|
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
# `
|
|
17
|
-
#
|
|
18
|
-
#
|
|
10
|
+
# `searchProvider` is deliberately left unset. Harness `0.2.2-rc.5` then routes
|
|
11
|
+
# each search by the model request it serves: DeepSeek routes use the in-box
|
|
12
|
+
# `deepseek-official` server-side search (no per-search charge), every other
|
|
13
|
+
# route and searches outside a model request use `deepseek-search-api`. This is
|
|
14
|
+
# the card's "follow the conversation model" default, and it matches the
|
|
15
|
+
# official page. Selecting any engine this bundle serves (server-side search,
|
|
16
|
+
# Tavily, Brave, Serper, …) pins `searchProvider` to `dsh-web-search` and leaves
|
|
17
|
+
# the backend to the plugin's `provider` setting; selecting DeepSeek Search API
|
|
18
|
+
# pins it to `deepseek-search-api`.
|
|
19
19
|
- id: web
|
|
20
20
|
name: '@deepseek-ai/dsh-web'
|
|
21
21
|
config:
|
|
22
|
-
searchProvider: deepseek-search-api
|
|
23
22
|
fetchProvider: http
|
|
24
23
|
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
# Keep the in-box DeepSeek search plugin registered: "follow the conversation
|
|
25
|
+
# model" leaves `web.searchProvider` unset, and Harness `0.2.2-rc.5` then routes
|
|
26
|
+
# DeepSeek model requests to this provider (`deepseek-official`) and every other
|
|
27
|
+
# route to `deepseek-search-api`. The card's DeepSeek rows read and write the
|
|
28
|
+
# `web-search-deepseek` namespace directly, and the in-box settings page stays
|
|
29
|
+
# disabled below, so this bundle still owns the only configuration surface.
|
|
30
|
+
#
|
|
31
|
+
# Disabling this row would leave the unset selection with two usable providers
|
|
32
|
+
# (`dsh-web-search` and `deepseek-search-api`) and every search would fail with
|
|
33
|
+
# `WEB_PROVIDER_AMBIGUOUS`.
|
|
31
34
|
|
|
32
35
|
# Disable the in-box "Web search & fetch" settings page. Its two seams (`web`
|
|
33
36
|
# and `web-deepseek-api`) are exactly what this bundle's own page edits, and
|
package/lib/client.js
CHANGED
|
@@ -32,6 +32,22 @@ window.__ModuleLoader__.load({
|
|
|
32
32
|
const API_NS = "web-deepseek-api";
|
|
33
33
|
const API_SEARCH = "deepseek-search-api";
|
|
34
34
|
const API_FETCH = "deepseek-fetch-api";
|
|
35
|
+
/**
|
|
36
|
+
* Card value for "follow the conversation model": leaves `web.searchProvider`
|
|
37
|
+
* unset, so Harness `0.2.2-rc.5` routes DeepSeek model requests to the in-box
|
|
38
|
+
* `deepseek-official` provider and every other route to `deepseek-search-api`.
|
|
39
|
+
*/
|
|
40
|
+
const AUTO = "__auto__";
|
|
41
|
+
/** The in-box DeepSeek provider's settings namespace; the card's DeepSeek rows read and write it. */
|
|
42
|
+
const LEGACY_NS = "web-search-deepseek";
|
|
43
|
+
/** Card fields bound to the in-box provider's keys. */
|
|
44
|
+
const LEGACY_FIELDS = {
|
|
45
|
+
deepseekApiKeyEnv: "apiKeyEnv",
|
|
46
|
+
deepseekBaseURL: "baseURL",
|
|
47
|
+
deepseekModel: "model",
|
|
48
|
+
deepseekMaxTokens: "maxTokens",
|
|
49
|
+
deepseekMaxUses: "maxUses"
|
|
50
|
+
};
|
|
35
51
|
const API_FIELDS = { webApiKey: "apiKey", webApiKeyEnv: "apiKeyEnv", webApiBaseURL: "baseURL", webApiCount: "count" };
|
|
36
52
|
/**
|
|
37
53
|
* The same card fields against the per-capability `web-deepseek-api`
|
|
@@ -63,15 +79,17 @@ window.__ModuleLoader__.load({
|
|
|
63
79
|
* previously accepted namespaces are not rolled back over concurrent edits.
|
|
64
80
|
*/
|
|
65
81
|
function combinedScope(forms) {
|
|
66
|
-
const plugin = forms.get(NS), web = forms.get("web"), api = forms.get(API_NS);
|
|
82
|
+
const plugin = forms.get(NS), web = forms.get("web"), api = forms.get(API_NS), legacy = forms.get(LEGACY_NS);
|
|
67
83
|
/** Namespace keys one card field addresses on the schema in force. */
|
|
68
84
|
const apiKeys = (field, split) => split
|
|
69
85
|
? API_FIELDS_SPLIT[field] ?? []
|
|
70
86
|
: API_FIELDS[field] === void 0 ? [] : [API_FIELDS[field]];
|
|
71
87
|
const apiFieldNames = (split) => Object.keys(split ? API_FIELDS_SPLIT : API_FIELDS);
|
|
72
|
-
const merge = (p, w, a, split) => {
|
|
88
|
+
const merge = (p, w, a, split, following) => {
|
|
73
89
|
const value = { ...p, fetchProvider: w?.fetchProvider ?? "http" };
|
|
74
|
-
if (
|
|
90
|
+
if (following) value.provider = AUTO;
|
|
91
|
+
else if (w?.searchProvider === "deepseek-official") value.provider = "deepseek-official";
|
|
92
|
+
else if (w?.searchProvider === API_SEARCH) value.provider = API_SEARCH;
|
|
75
93
|
for (const field of apiFieldNames(split)) {
|
|
76
94
|
for (const key of apiKeys(field, split)) {
|
|
77
95
|
if (a === void 0 || !Object.hasOwn(a, key)) continue;
|
|
@@ -81,36 +99,74 @@ window.__ModuleLoader__.load({
|
|
|
81
99
|
}
|
|
82
100
|
return value;
|
|
83
101
|
};
|
|
84
|
-
const mergeUser = (p, w, a, split) => {
|
|
102
|
+
const mergeUser = (p, w, a, split, following) => {
|
|
85
103
|
const user = { ...p.user };
|
|
86
104
|
for (const field of apiFieldNames(split)) {
|
|
87
105
|
const key = apiKeys(field, split).find((candidate) => Object.hasOwn(a.user ?? {}, candidate));
|
|
88
106
|
if (key !== void 0) user[field] = a.user[key];
|
|
89
107
|
}
|
|
90
108
|
if (Object.hasOwn(w.user ?? {}, "fetchProvider")) user.fetchProvider = w.user.fetchProvider;
|
|
91
|
-
if (
|
|
109
|
+
if (following) user.provider = AUTO;
|
|
110
|
+
else if (w.user?.searchProvider === API_SEARCH) user.provider = API_SEARCH;
|
|
92
111
|
return user;
|
|
93
112
|
};
|
|
94
113
|
return {
|
|
95
114
|
getSnapshot() {
|
|
96
115
|
const p = plugin.getSnapshot(), w = web.getSnapshot(), a = api.getSnapshot();
|
|
116
|
+
const l = legacy.getSnapshot();
|
|
97
117
|
const split = splitApiSchema(a);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
118
|
+
const autoAvailable = l.status === "ready";
|
|
119
|
+
const following = autoAvailable && w.status === "ready" && w.value?.searchProvider === void 0;
|
|
120
|
+
// DeepSeek rows belong to the in-box provider's namespace. A user value
|
|
121
|
+
// there wins; a value this card previously stored on its own namespace
|
|
122
|
+
// stays visible until the next save carries it over.
|
|
123
|
+
const overlay = (target, layer) => {
|
|
124
|
+
if (!autoAvailable) return target;
|
|
125
|
+
const next = { ...target };
|
|
126
|
+
for (const [field, key] of Object.entries(LEGACY_FIELDS)) {
|
|
127
|
+
const alias = SUPPLIER_CONFIG_ALIASES[field];
|
|
128
|
+
const declared = next[field] !== void 0 ? next[field] : alias !== void 0 ? next[alias] : void 0;
|
|
129
|
+
if (layer === "user") {
|
|
130
|
+
if (Object.hasOwn(l.user ?? {}, key)) next[field] = l.user[key];
|
|
131
|
+
} else if (layer === "base") {
|
|
132
|
+
next[field] = l.base?.[key];
|
|
133
|
+
} else if (Object.hasOwn(l.user ?? {}, key)) {
|
|
134
|
+
next[field] = l.value?.[key];
|
|
135
|
+
} else if (declared === void 0) {
|
|
136
|
+
next[field] = l.value?.[key];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return next;
|
|
140
|
+
};
|
|
141
|
+
return { ...p, value: overlay(merge(p.value, w.value, a.value, split, following), "value"),
|
|
142
|
+
base: overlay(merge(p.base, w.base, a.base, split, false), "base"),
|
|
143
|
+
user: overlay(mergeUser(p, w, a, split, following), "user"),
|
|
144
|
+
revision: { plugin: p.revision, api: a.revision, web: w.revision, legacy: l.revision },
|
|
101
145
|
apiAvailable: a.status === "ready" && w.status === "ready",
|
|
102
146
|
apiWritable: a.writable && w.writable,
|
|
103
147
|
apiSplit: split,
|
|
104
148
|
selectionAvailable: w.status === "ready", selectionWritable: w.writable,
|
|
149
|
+
autoAvailable, following,
|
|
150
|
+
autoMissing: w.status === "ready" && !autoAvailable
|
|
151
|
+
&& (w.value?.searchProvider === void 0 || w.value?.searchProvider === "deepseek-official"),
|
|
105
152
|
searchProvider: w.value?.searchProvider };
|
|
106
153
|
},
|
|
107
154
|
subscribe(listener) {
|
|
108
|
-
const stops = [plugin, web, api].map(scope => scope.subscribe(listener));
|
|
155
|
+
const stops = [plugin, web, api, legacy].map(scope => scope.subscribe(listener));
|
|
109
156
|
return () => stops.forEach(stop => stop());
|
|
110
157
|
},
|
|
111
158
|
async mutate(ops, revisions) {
|
|
112
159
|
const split = splitApiSchema(api.getSnapshot());
|
|
113
|
-
const groups = { plugin: [], api: [], web: [] };
|
|
160
|
+
const groups = { plugin: [], api: [], legacy: [], web: [] };
|
|
161
|
+
const legacySnapshot = legacy.getSnapshot();
|
|
162
|
+
const legacyReady = legacySnapshot.status === "ready";
|
|
163
|
+
const current = plugin.getSnapshot().value ?? {};
|
|
164
|
+
const webProvider = web.getSnapshot().value?.searchProvider;
|
|
165
|
+
const arrivingAuto = ops.some(op => op.path[0] === "provider" && op.op === "set" && op.value === AUTO);
|
|
166
|
+
// A profile pinned to this plugin's id with the Messages backend predates
|
|
167
|
+
// the in-box pin; the next save moves it onto `deepseek-official`.
|
|
168
|
+
const migrating = arrivingAuto
|
|
169
|
+
|| (current.provider === "deepseek-official" && webProvider === "dsh-web-search");
|
|
114
170
|
for (const op of ops) {
|
|
115
171
|
const field = op.path[0];
|
|
116
172
|
const keys = apiKeys(field, split);
|
|
@@ -118,30 +174,68 @@ window.__ModuleLoader__.load({
|
|
|
118
174
|
for (const key of keys) groups.api.push({ ...op, path: [key] });
|
|
119
175
|
} else if (field === "fetchProvider") groups.web.push(op);
|
|
120
176
|
else if (field === "provider") {
|
|
177
|
+
if (op.op === "set" && op.value === AUTO) continue;
|
|
121
178
|
if (op.op === "set" && op.value === API_SEARCH) groups.web.push({ op: "set", path: ["searchProvider"], value: API_SEARCH });
|
|
179
|
+
else if (op.op === "set" && op.value === "deepseek-official") groups.web.push({ op: "set", path: ["searchProvider"], value: "deepseek-official" });
|
|
122
180
|
else {
|
|
123
181
|
groups.plugin.push(op);
|
|
124
182
|
groups.web.push({ op: "set", path: ["searchProvider"], value: "dsh-web-search" });
|
|
125
183
|
}
|
|
184
|
+
} else if (LEGACY_FIELDS[field] !== void 0) {
|
|
185
|
+
groups.legacy.push({ ...op, path: [LEGACY_FIELDS[field]] });
|
|
126
186
|
} else groups.plugin.push(op);
|
|
127
187
|
}
|
|
188
|
+
if (arrivingAuto) groups.plugin.push({ op: "set", path: ["provider"], value: "deepseek-official" });
|
|
189
|
+
if (arrivingAuto && !groups.web.some(op => op.path[0] === "searchProvider")) {
|
|
190
|
+
groups.web.push({ op: "unset", path: ["searchProvider"] });
|
|
191
|
+
}
|
|
192
|
+
if (!arrivingAuto && migrating && !groups.web.some(op => op.path[0] === "searchProvider")) {
|
|
193
|
+
groups.web.push({ op: "set", path: ["searchProvider"], value: "deepseek-official" });
|
|
194
|
+
}
|
|
195
|
+
const seed = legacyReady && (arrivingAuto || migrating || groups.legacy.length > 0);
|
|
196
|
+
if (seed) {
|
|
197
|
+
// The card owns these rows now: carry over values this profile still
|
|
198
|
+
// stores on the plugin namespace, and leave the in-box defaults alone
|
|
199
|
+
// for anything nobody set.
|
|
200
|
+
const pluginUser = plugin.getSnapshot().user ?? {};
|
|
201
|
+
for (const [field, key] of Object.entries(LEGACY_FIELDS)) {
|
|
202
|
+
if (groups.legacy.some(op => op.path[0] === key)) continue;
|
|
203
|
+
if (Object.hasOwn(legacySnapshot.user ?? {}, key)) continue;
|
|
204
|
+
const alias = SUPPLIER_CONFIG_ALIASES[field];
|
|
205
|
+
const declared = Object.hasOwn(pluginUser, field) || (alias !== void 0 && Object.hasOwn(pluginUser, alias));
|
|
206
|
+
if (!declared) continue;
|
|
207
|
+
const value = pluginUser[field] ?? (alias !== void 0 ? pluginUser[alias] : void 0);
|
|
208
|
+
groups.legacy.push(value === void 0 || value === null || value === ""
|
|
209
|
+
? { op: "unset", path: [key] }
|
|
210
|
+
: { op: "set", path: [key], value });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
128
213
|
if (groups.web.some(op => op.op === "set" && [API_SEARCH, API_FETCH].includes(op.value)) && api.getSnapshot().status !== "ready") return false;
|
|
129
|
-
for (const [name, scope] of [["plugin", plugin], ["api", api], ["web", web]]) {
|
|
214
|
+
for (const [name, scope] of [["plugin", plugin], ["api", api], ["legacy", legacy], ["web", web]]) {
|
|
130
215
|
if (groups[name].length && (scope.getSnapshot().status !== "ready" || !scope.getSnapshot().writable)) return false;
|
|
131
216
|
}
|
|
132
|
-
for (const [name, scope] of [["plugin", plugin], ["api", api], ["web", web]]) {
|
|
217
|
+
for (const [name, scope] of [["plugin", plugin], ["api", api], ["legacy", legacy], ["web", web]]) {
|
|
133
218
|
if (groups[name].length && await scope.mutate(groups[name], revisions[name]) !== true) return false;
|
|
134
219
|
}
|
|
135
220
|
return true;
|
|
136
221
|
},
|
|
137
222
|
canWrite(plan) {
|
|
138
223
|
const split = splitApiSchema(api.getSnapshot());
|
|
224
|
+
const legacySnapshot = legacy.getSnapshot();
|
|
225
|
+
const legacyWritable = legacySnapshot.status === "ready" && legacySnapshot.writable;
|
|
226
|
+
const pinnedLegacy = plugin.getSnapshot().value?.provider === "deepseek-official"
|
|
227
|
+
&& web.getSnapshot().value?.searchProvider === "dsh-web-search";
|
|
139
228
|
return plan.every(item => {
|
|
140
229
|
const field = item.field;
|
|
141
|
-
|
|
230
|
+
const value = item.op?.value;
|
|
231
|
+
if ([API_SEARCH, API_FETCH].includes(value) && (api.getSnapshot().status !== "ready" || !api.getSnapshot().writable)) return false;
|
|
232
|
+
if (LEGACY_FIELDS[field] !== void 0) return legacyWritable;
|
|
142
233
|
const scope = apiKeys(field, split).length > 0 ? api : field === "fetchProvider" ? web : plugin;
|
|
143
|
-
|
|
234
|
+
const writable = scope.getSnapshot().status === "ready" && scope.getSnapshot().writable
|
|
144
235
|
&& (field !== "provider" || (web.getSnapshot().status === "ready" && web.getSnapshot().writable));
|
|
236
|
+
if (!writable) return false;
|
|
237
|
+
const movesDeepSeek = field === "provider" && item.op?.op === "set" && (value === AUTO || value === "deepseek-official");
|
|
238
|
+
return (!movesDeepSeek && !pinnedLegacy) || legacyWritable;
|
|
145
239
|
});
|
|
146
240
|
}
|
|
147
241
|
};
|
|
@@ -281,7 +375,10 @@ window.__ModuleLoader__.load({
|
|
|
281
375
|
provider: "Web search provider",
|
|
282
376
|
providerTavily: "Tavily",
|
|
283
377
|
providerBrave: "Brave Search",
|
|
284
|
-
providerDeepseek: "DeepSeek
|
|
378
|
+
providerDeepseek: "DeepSeek server-side search",
|
|
379
|
+
providerAuto: "Follow the conversation model",
|
|
380
|
+
providerAutoHint: "DeepSeek model requests use DeepSeek server-side search (no per-search charge, extra model tokens); every other model uses DeepSeek Search API. Picking an engine above pins it for every model.",
|
|
381
|
+
deepseekOwnedHint: "These rows belong to the in-box DeepSeek provider: it runs DeepSeek model requests in follow mode, and every model when server-side search is pinned.",
|
|
285
382
|
providerApi: "DeepSeek Search API",
|
|
286
383
|
searchHeading: "Web search",
|
|
287
384
|
fetchHeading: "Web fetch",
|
|
@@ -291,7 +388,7 @@ window.__ModuleLoader__.load({
|
|
|
291
388
|
fetchOther: "Current custom provider: ",
|
|
292
389
|
fetchHttpHint: "Free, and reaches your intranet and this machine. Cannot render pages that need JavaScript or a sign-in, and cannot read PDFs. Returned content still uses conversation tokens.",
|
|
293
390
|
apiHint: "Direct API requests, without an auxiliary model call. Reading results still uses conversation tokens.",
|
|
294
|
-
providerDeepseekHint: "
|
|
391
|
+
providerDeepseekHint: "No per-search charge, but every search uses extra model tokens. Requires a DeepSeek account or API key.",
|
|
295
392
|
providerApiHint: "Costs money, paid by the account or API key chosen under Billing.",
|
|
296
393
|
providerFetchApiHint: "Cannot reach your intranet or this machine. Costs money, paid by the account or API key chosen under Billing.",
|
|
297
394
|
providerSearxngHint: "DuckDuckGo has no official search API. Point SearXNG at an instance that includes DuckDuckGo (most public ones do), or self-host one.",
|
|
@@ -314,6 +411,7 @@ window.__ModuleLoader__.load({
|
|
|
314
411
|
apiShared: "Uses the DeepSeek API configuration in the search section above.",
|
|
315
412
|
apiUnavailable: "The Host must serve web and web-deepseek-api to enable the new APIs (DSH 0.2.1-rc.2 or compatible).",
|
|
316
413
|
searchInactive: "Another search provider is selected in the Host. Choose an engine here to use this page's configuration.",
|
|
414
|
+
autoUnavailable: "The Host does not compose the in-box DeepSeek provider, so neither follow mode nor DeepSeek server-side search can run. Choose an engine here so searches keep working.",
|
|
317
415
|
partialFailed: "Save failed; some settings may already have been saved. Your draft is retained. Review and retry.",
|
|
318
416
|
mode: "Auth mode",
|
|
319
417
|
modeKeyless: "Keyless (free, rate-limited)",
|
|
@@ -408,7 +506,10 @@ window.__ModuleLoader__.load({
|
|
|
408
506
|
provider: "网页搜索提供方",
|
|
409
507
|
providerTavily: "Tavily",
|
|
410
508
|
providerBrave: "Brave Search",
|
|
411
|
-
providerDeepseek: "DeepSeek
|
|
509
|
+
providerDeepseek: "DeepSeek 服务端搜索",
|
|
510
|
+
providerAuto: "跟随会话模型",
|
|
511
|
+
providerAutoHint: "DeepSeek 模型的请求使用 DeepSeek 服务端搜索(搜索不按次收费,会额外消耗模型 token);其他模型使用 DeepSeek Search API。选择上面的任一引擎会固定给所有模型使用。",
|
|
512
|
+
deepseekOwnedHint: "以下参数属于内置 DeepSeek 提供方:跟随会话模型时它执行 DeepSeek 模型的搜索;固定为服务端搜索时所有模型都由它执行。",
|
|
412
513
|
providerApi: "DeepSeek Search API",
|
|
413
514
|
searchHeading: "网页搜索",
|
|
414
515
|
fetchHeading: "网页获取",
|
|
@@ -418,7 +519,7 @@ window.__ModuleLoader__.load({
|
|
|
418
519
|
fetchOther: "当前自定义提供方:",
|
|
419
520
|
fetchHttpHint: "免费,可访问内网和本机。不支持需要 JavaScript 或登录的页面,也不支持 PDF。返回内容仍占用主会话 token。",
|
|
420
521
|
apiHint: "直接请求 API,不调用辅助模型。主模型阅读结果仍消耗 token。",
|
|
421
|
-
providerDeepseekHint: "
|
|
522
|
+
providerDeepseekHint: "搜索不按次收费,每次搜索都会额外消耗模型 token。需要 DeepSeek 账号或 API Key。",
|
|
422
523
|
providerApiHint: "会产生费用,由「计费方式」选定的账号或 API Key 支付。",
|
|
423
524
|
providerFetchApiHint: "无法访问内网和本机。会产生费用,由「计费方式」选定的账号或 API Key 支付。",
|
|
424
525
|
providerSearxngHint: "DuckDuckGo 没有官方搜索 API。请把 SearXNG 指向一个聚合了 DuckDuckGo 的实例(多数公共实例都有),或自建一个。",
|
|
@@ -441,6 +542,7 @@ window.__ModuleLoader__.load({
|
|
|
441
542
|
apiShared: "使用上方网页搜索区域中的 DeepSeek API 配置。",
|
|
442
543
|
apiUnavailable: "新版 API 需要 Host 提供 web 与 web-deepseek-api 配置(DSH 0.2.1-rc.2 或兼容版本)。",
|
|
443
544
|
searchInactive: "Host 当前选择了其他搜索提供方;请在此选择搜索引擎以启用本页面的配置。",
|
|
545
|
+
autoUnavailable: "Host 未组合内置 DeepSeek 提供方,跟随会话模型与 DeepSeek 服务端搜索都无法运行;请在此选择一个引擎,否则搜索会失败。",
|
|
444
546
|
partialFailed: "保存失败,部分设置可能已保存。草稿已保留,请核对后重试。",
|
|
445
547
|
mode: "认证模式",
|
|
446
548
|
modeKeyless: "Keyless(免费、限流)",
|
|
@@ -682,6 +784,9 @@ window.__ModuleLoader__.load({
|
|
|
682
784
|
apiSplit: snapshot.apiSplit === true,
|
|
683
785
|
selectionAvailable: snapshot.selectionAvailable,
|
|
684
786
|
selectionWritable: snapshot.selectionWritable,
|
|
787
|
+
autoAvailable: snapshot.autoAvailable === true,
|
|
788
|
+
following: snapshot.following === true,
|
|
789
|
+
autoMissing: snapshot.autoMissing === true,
|
|
685
790
|
searchInactive: snapshot.searchProvider && !["dsh-web-search", API_SEARCH].includes(snapshot.searchProvider),
|
|
686
791
|
toastKey: this.toastKey
|
|
687
792
|
};
|
|
@@ -1302,17 +1407,19 @@ window.__ModuleLoader__.load({
|
|
|
1302
1407
|
const { t, state, actions } = props;
|
|
1303
1408
|
if (!state.available) return null;
|
|
1304
1409
|
const disabled = !state.writable || state.saving;
|
|
1305
|
-
const
|
|
1410
|
+
const auto = state.provider.text === AUTO && state.autoAvailable === true;
|
|
1411
|
+
const provider = auto ? AUTO : state.provider.text === API_SEARCH || state.provider.text === "tavily" || state.provider.text === "brave" || state.provider.text === "deepseek-official" || builtinRest(state.provider.text) !== void 0 ? state.provider.text : "deepseek-official";
|
|
1306
1412
|
const apiSearch = provider === API_SEARCH;
|
|
1307
1413
|
const fetchProvider = state.fetchProvider.text || "http";
|
|
1308
1414
|
const apiFetch = fetchProvider === API_FETCH;
|
|
1309
1415
|
const brave = provider === "brave";
|
|
1310
|
-
const deepseek = provider === "deepseek-official";
|
|
1416
|
+
const deepseek = provider === "deepseek-official" || auto;
|
|
1311
1417
|
const tavily = provider === "tavily";
|
|
1312
1418
|
const restMeta = builtinRest(provider);
|
|
1313
1419
|
const keyed = state.tavilyMode.text === "keyed";
|
|
1314
1420
|
/** One line under the selector describing the provider in force. */
|
|
1315
|
-
const providerHint =
|
|
1421
|
+
const providerHint = auto ? t("providerAutoHint")
|
|
1422
|
+
: provider === API_SEARCH ? t("providerApiHint")
|
|
1316
1423
|
: provider === "deepseek-official" ? t("providerDeepseekHint")
|
|
1317
1424
|
: provider === "searxng" ? t("providerSearxngHint")
|
|
1318
1425
|
: "";
|
|
@@ -1387,11 +1494,13 @@ window.__ModuleLoader__.load({
|
|
|
1387
1494
|
!state.writable ? react.createElement("p", { className: "dshws_field_hint", style: { padding: "8px 0 0" } }, t("readOnly")) : null,
|
|
1388
1495
|
react.createElement("h3", { className: "dshws_section_title" }, t("searchHeading")),
|
|
1389
1496
|
state.searchInactive ? react.createElement("p", { className: "dshws_field_hint" }, t("searchInactive")) : null,
|
|
1497
|
+
state.autoMissing ? react.createElement("p", { className: "dshws_field_hint" }, t("autoUnavailable")) : null,
|
|
1390
1498
|
!state.apiAvailable ? react.createElement("p", { className: "dshws_field_hint" }, t("apiUnavailable")) : null,
|
|
1391
1499
|
pair(
|
|
1392
1500
|
row("provider", t("provider"), null, selectInput({ id: "ws-provider", value: provider, disabled: disabled || !state.selectionWritable, onChange: (e) => actions.edit("provider", e.target.value), children: [
|
|
1501
|
+
...(state.autoAvailable === true ? [react.createElement("option", { value: AUTO, key: AUTO }, t("providerAuto"))] : []),
|
|
1393
1502
|
react.createElement("option", { value: API_SEARCH, key: API_SEARCH, disabled: !state.apiAvailable || !state.apiWritable }, t("providerApi")),
|
|
1394
|
-
react.createElement("option", { value: "deepseek-official", key: "deepseek-official" }, t("providerDeepseek")),
|
|
1503
|
+
react.createElement("option", { value: "deepseek-official", key: "deepseek-official", disabled: state.autoAvailable !== true }, t("providerDeepseek")),
|
|
1395
1504
|
react.createElement("option", { value: "tavily", key: "tavily" }, t("providerTavily")),
|
|
1396
1505
|
react.createElement("option", { value: "brave", key: "brave" }, t("providerBrave")),
|
|
1397
1506
|
...BUILTIN_REST_PROVIDERS.map((entry) => react.createElement("option", { value: entry.id, key: entry.id }, entry.name)),
|
|
@@ -1408,6 +1517,7 @@ window.__ModuleLoader__.load({
|
|
|
1408
1517
|
apiSearch && state.apiSplit ? billingRow("webApiSearchBilling") : null,
|
|
1409
1518
|
react.createElement(QuotaCard, { t, provider, keyed }),
|
|
1410
1519
|
keyConsoleLink(t, provider, restMeta, keyed),
|
|
1520
|
+
deepseek ? react.createElement("p", { className: "dshws_field_hint" }, t("deepseekOwnedHint")) : null,
|
|
1411
1521
|
deepseek ? pair(
|
|
1412
1522
|
fieldRow(t("apiKey"), keyHint, secretInput({ id: "ws-deepseek-key", value: state.deepseekApiKey.text, disabled: disabled || !state.apiKeyWritable, placeholder: state.apiKeyConfigured ? t("apiKeySet") : t("apiKeyUnset"), onChange: (e) => actions.edit(DEEPSEEK_API_KEY_FIELD, e.target.value) })),
|
|
1413
1523
|
row("deepseekApiKeyEnv", t("deepseekApiKeyEnv"), t("deepseekApiKeyEnvHint"), textInput({ id: "ws-deepseek-keyref", value: state.deepseekApiKeyEnv.text, disabled, onChange: (e) => actions.edit("deepseekApiKeyEnv", e.target.value) }))
|
package/lib/deepseek.js
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* and returns structured `web_search_tool_result` blocks; absence of those
|
|
5
5
|
* blocks is an error rather than a prose-scraping fallback.
|
|
6
6
|
*
|
|
7
|
-
* This
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* search provider
|
|
11
|
-
*
|
|
7
|
+
* This backend is a compatibility path, not the default: the card's DeepSeek
|
|
8
|
+
* server-side search pins the in-box `deepseek-official` provider, and follow
|
|
9
|
+
* mode routes DeepSeek requests there too. It still serves profiles pinned to
|
|
10
|
+
* `dsh-web-search` with `provider: "deepseek-official"` from releases before
|
|
11
|
+
* `0.8.0`; the next card save moves them onto the in-box pin.
|
|
12
12
|
*
|
|
13
13
|
* Authentication follows the official provider: a search started from a
|
|
14
14
|
* DeepSeek-account session authenticates with the account token
|
|
@@ -43,8 +43,8 @@ const DEFAULT_MAX_USES = 5;
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Build a `url → cited_text` map from `text` blocks' `citations[]` (the snippet
|
|
46
|
-
* source for
|
|
47
|
-
*
|
|
46
|
+
* source for a `web_search_result` item that carries no excerpt of its own;
|
|
47
|
+
* the excerpt then lives in a separate `text` block's citation).
|
|
48
48
|
*/
|
|
49
49
|
function citationSnippets(blocks) {
|
|
50
50
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -55,7 +55,10 @@ function citationSnippets(blocks) {
|
|
|
55
55
|
return map;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Map an Anthropic Messages response to a normalized search result. A result
|
|
60
|
+
* item's own `snippet` wins; the citation excerpt for its `url` is the fallback.
|
|
61
|
+
*/
|
|
59
62
|
function mapAnthropicResponse(response, maxResults) {
|
|
60
63
|
const blocks = response.content ?? [];
|
|
61
64
|
const resultBlocks = blocks.filter((block) => block.type === "web_search_tool_result");
|
|
@@ -66,7 +69,8 @@ function mapAnthropicResponse(response, maxResults) {
|
|
|
66
69
|
for (const block of resultBlocks) for (const item of block.content ?? []) {
|
|
67
70
|
if (item.type !== "web_search_result" || typeof item.url !== "string" || item.url.length === 0 || seen.has(item.url)) continue;
|
|
68
71
|
seen.add(item.url);
|
|
69
|
-
const
|
|
72
|
+
const own = typeof item.snippet === "string" && item.snippet.length > 0 ? item.snippet : void 0;
|
|
73
|
+
const snippet = own ?? snippets.get(item.url);
|
|
70
74
|
sources.push({
|
|
71
75
|
url: item.url,
|
|
72
76
|
...typeof item.title === "string" && item.title.length > 0 ? { title: item.title } : {},
|
|
@@ -115,10 +119,13 @@ export class DeepSeekSearchProvider {
|
|
|
115
119
|
throwIfSearchAborted(signal);
|
|
116
120
|
const endpoint = `${options.baseURL.replace(/\/+$/u, "")}/messages`;
|
|
117
121
|
// An account-authorized search spends account quota and must not need a
|
|
118
|
-
// stored API key; every other search resolves `DEEPSEEK_API_KEY`.
|
|
122
|
+
// stored API key; every other search resolves `DEEPSEEK_API_KEY`. The
|
|
123
|
+
// request names the route that serves this search (`llmProvider`), so the
|
|
124
|
+
// decision matches the readiness check instead of guessing the session's
|
|
125
|
+
// latest route.
|
|
119
126
|
let accountToken;
|
|
120
127
|
try {
|
|
121
|
-
accountToken = await abortable(Promise.resolve().then(() => options.resolveAccountToken?.(endpoint)), signal);
|
|
128
|
+
accountToken = await abortable(Promise.resolve().then(() => options.resolveAccountToken?.(endpoint, request.llmProvider)), signal);
|
|
122
129
|
} catch (error) {
|
|
123
130
|
if (signal?.aborted === true || isAbortError(error)) throw searchAborted(signal, error);
|
|
124
131
|
throw new WebError(`DeepSeek account token resolution failed: ${String(error)}`, "WEB_PROVIDER_ERROR", { cause: error });
|
|
@@ -203,8 +210,10 @@ export function resolveDeepseekOptions(ctx, config) {
|
|
|
203
210
|
literal: config.deepseekApiKey,
|
|
204
211
|
envName: config.deepseekApiKeyEnv ?? DEEPSEEK_DEFAULT_API_KEY_ENV
|
|
205
212
|
}),
|
|
206
|
-
// Only a DeepSeek-account
|
|
207
|
-
//
|
|
213
|
+
// Only a DeepSeek-account route may spend account quota; every other
|
|
214
|
+
// route falls back to the API key resolved above. The search passes the
|
|
215
|
+
// route that serves it; older hosts name no route, so the session's latest
|
|
216
|
+
// one stands in.
|
|
208
217
|
resolveAccountToken: async (endpoint, llmProvider = ctx.get("agents")?.currentInitiator()?.session.requestContext()?.provider) => {
|
|
209
218
|
if (llmProvider !== ACCOUNT_PROVIDER) return void 0;
|
|
210
219
|
return await ctx.get("deepseekAccount")?.resolveToken(endpoint);
|
package/lib/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Web-search provider plugin for the DeepSeek Harness web capability seam
|
|
3
3
|
* (`ctx.web`). Registers a single `WebSearchProvider` under the stable id
|
|
4
|
-
* `dsh-web-search` and dispatches each search to one of
|
|
5
|
-
* according to the `provider` setting — so switching backends does
|
|
6
|
-
* not require a `web.searchProvider` patch change.
|
|
4
|
+
* `dsh-web-search` and dispatches each search to one of the eight third-party
|
|
5
|
+
* backends according to the `provider` setting — so switching backends does
|
|
6
|
+
* not require a `web.searchProvider` patch change. DeepSeek server-side search
|
|
7
|
+
* and follow mode are served by the in-box `deepseek-official` provider; the
|
|
8
|
+
* `deepseek-official` branch here only keeps profiles pinned to this id from
|
|
9
|
+
* releases before `0.8.0` working until their next card save.
|
|
7
10
|
*
|
|
8
11
|
* Tavily supports `keyless` (free, rate-limited) and `keyed` modes. Brave
|
|
9
12
|
* always needs a subscription token (`BRAVE_API_KEY` by default). DeepSeek
|
|
10
13
|
* uses the Anthropic-compatible Messages API native `web_search_20250305`
|
|
11
|
-
* tool and authenticates with an account token or `DEEPSEEK_API_KEY
|
|
12
|
-
* in-box `web-search-deepseek` host plugin is disabled by the bundle patch).
|
|
14
|
+
* tool and authenticates with an account token or `DEEPSEEK_API_KEY`.
|
|
13
15
|
*
|
|
14
16
|
* DeepSeek records a secret-free model request as a session event before
|
|
15
17
|
* dispatch; the REST backends do not write custom session events.
|
|
@@ -71,7 +73,7 @@ const Config = z.object({
|
|
|
71
73
|
/**
|
|
72
74
|
* Active backend. `deepseek-search-api` (default) leaves search to the
|
|
73
75
|
* in-box `web-deepseek-api` provider, matching the Harness default;
|
|
74
|
-
* `deepseek-official` is the
|
|
76
|
+
* `deepseek-official` is the DeepSeek server-side (Messages) backend, and `tavily`,
|
|
75
77
|
* `brave`, `serper`, `serpapi`, `exa`, `searxng`, `scavio`, `firecrawl`
|
|
76
78
|
* are served by this plugin.
|
|
77
79
|
*/
|
|
@@ -165,8 +167,8 @@ class PluginSearchProvider {
|
|
|
165
167
|
title = "网页搜索(本插件)";
|
|
166
168
|
/** What this provider covers, for pickers that render a description. */
|
|
167
169
|
description = {
|
|
168
|
-
en: "DeepSeek
|
|
169
|
-
zh: "支持 DeepSeek
|
|
170
|
+
en: "DeepSeek server-side search plus Tavily, Brave, Serper, SerpApi, Exa, SearXNG, Scavio and Firecrawl, configured on this plugin's web search page.",
|
|
171
|
+
zh: "支持 DeepSeek 服务端搜索与 Tavily、Brave、Serper、SerpApi、Exa、SearXNG、Scavio、Firecrawl,在本插件的网页搜索设置页配置。"
|
|
170
172
|
};
|
|
171
173
|
|
|
172
174
|
constructor(resolveOptions, usage) {
|
|
@@ -336,6 +338,12 @@ function readSection(config) {
|
|
|
336
338
|
deepseekApiKey: config.deepseekApiKey.get(),
|
|
337
339
|
deepseekApiKeyEnv: config.deepseekApiKeyEnv.get(),
|
|
338
340
|
deepseekBaseURL: config.deepseekBaseURL.get(),
|
|
341
|
+
// Prefixed fields win in `resolveSupplierConfig`; the unprefixed names
|
|
342
|
+
// below stay as the fallback older profiles wrote.
|
|
343
|
+
deepseekModel: config.deepseekModel.get(),
|
|
344
|
+
deepseekApiVersion: config.deepseekApiVersion.get(),
|
|
345
|
+
deepseekMaxTokens: config.deepseekMaxTokens.get(),
|
|
346
|
+
deepseekMaxUses: config.deepseekMaxUses.get(),
|
|
339
347
|
model: config.model.get(),
|
|
340
348
|
apiVersion: config.apiVersion.get(),
|
|
341
349
|
maxTokens: config.maxTokens.get(),
|
package/lib/shared.js
CHANGED
|
@@ -7,7 +7,7 @@ import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
|
|
|
7
7
|
import { WebError } from "@deepseek-ai/dsh-web";
|
|
8
8
|
|
|
9
9
|
/** Attribution header sent on every request. */
|
|
10
|
-
export const USER_AGENT = "dsh-web-search-plugin/0.
|
|
10
|
+
export const USER_AGENT = "dsh-web-search-plugin/0.8.0";
|
|
11
11
|
/** Shared cap: Tavily `max_results` and Brave `count` both accept 1..20. */
|
|
12
12
|
export const MAX_RESULTS_CAP = 20;
|
|
13
13
|
|
package/locale/en.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Web search & fetch",
|
|
4
|
-
"description": "Web search providers and web fetch in one page:
|
|
4
|
+
"description": "Web search providers and web fetch in one page: follow the conversation model (default), DeepSeek Search API, DeepSeek server-side search, eight third-party engines, local fetch and optional DeepSeek Fetch API.",
|
|
5
5
|
"detail": "assets/detail/en.md"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/locale/zh.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "网页搜索与获取",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "在一个页面独立配置网页搜索提供方与网页获取:跟随会话模型(默认)、DeepSeek Search API、DeepSeek 服务端搜索、8 个第三方引擎、本机直接获取和可选 DeepSeek Fetch API。",
|
|
5
5
|
"detail": "assets/detail/zh.md"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-web-search-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Web search and retrieval settings for DeepSeek Harness: DeepSeek Search API, Messages, eight search backends, local HTTP and DeepSeek Fetch API",
|
|
5
5
|
"icon": "./assets/icon.svg",
|
|
6
6
|
"keywords": [
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
"undici": "^6.21.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@deepseek-ai/dsh-web": "^0.2.
|
|
67
|
-
"@deepseek-ai/dsh-credentials": "^0.2.
|
|
68
|
-
"@deepseek-ai/dsh-settings": "^0.2.
|
|
69
|
-
"@deepseek-ai/dsh-launch-environment": "^0.2.
|
|
70
|
-
"@deepseek-ai/schemastery": "~3.
|
|
71
|
-
"@deepseek-ai/cordis": "~4.
|
|
66
|
+
"@deepseek-ai/dsh-web": "^0.2.2-rc.5",
|
|
67
|
+
"@deepseek-ai/dsh-credentials": "^0.2.2-rc.5",
|
|
68
|
+
"@deepseek-ai/dsh-settings": "^0.2.2-rc.5",
|
|
69
|
+
"@deepseek-ai/dsh-launch-environment": "^0.2.2-rc.5",
|
|
70
|
+
"@deepseek-ai/schemastery": "~3.19.0",
|
|
71
|
+
"@deepseek-ai/cordis": "~4.1.0"
|
|
72
72
|
},
|
|
73
73
|
"license": "MIT",
|
|
74
74
|
"repository": {
|