dsh-web-search-plugin 0.5.0 → 0.6.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 CHANGED
@@ -4,6 +4,40 @@
4
4
 
5
5
  ## [未发布]
6
6
 
7
+ ## [0.6.0] - 2026-10-20
8
+
9
+ ### 新增
10
+
11
+ - “设置 → 网页搜索”保留一个入口,页面分为“搜索引擎”和“网页抓取”,统一暂存、保存和放弃修改。
12
+ - 新增 DeepSeek Search API 搜索选项,复用 DSH `0.2.1-rc.2` 的官方提供方,无辅助模型轮次;现有第三方引擎和 DeepSeek Messages 搜索继续保留。
13
+ - 网页抓取可独立选择本地 HTTP(默认)或官方 DeepSeek Fetch API;不自动联动搜索与抓取,也不自动回退到付费接口。
14
+ - 新版 Search / Fetch 共用官方 `web-deepseek-api` 的密钥引用和基础地址,与旧 Messages 参数分别保存;不提供这套配置的 Host 禁用新版 API 选项。
15
+
16
+ ### 变更
17
+
18
+ - 四个 DSH peer 范围显式接纳 `0.2.1-rc.2`,保留 `0.2.0-rc.2`;包版本与 User-Agent 更新为 `0.6.0`。
19
+ - DeepSeek Messages 搜索显式关闭辅助思考,与 rc.2 官方行为一致。
20
+ - 跨配置区域保存时先保存引擎和 API 参数,再以同一 `web` mutation 提交所修改的提供方选择;各区域使用各自 revision,失败保留草稿并提示可能已有部分设置保存。
21
+ - 保持原有安装默认值和用户选择,新增 API 由用户主动选择;不迁移旧 Messages 端点或模型配置。
22
+ - 下拉选项使用“DeepSeek Messages 搜索(默认)”与“DeepSeek Search API”,标明默认项,不附加推荐标记。
23
+
24
+ ## [0.5.1] - 2026-10-10
25
+
26
+ ### 新增
27
+
28
+ - 自定义网页搜索图标:采用与官方图标协调的蓝绿渐变和地球放大镜造型,通过包元数据提供给插件列表、详情及包含的组件。
29
+
30
+ ### 变更
31
+
32
+ - DeepSeek 官方搜索默认模型更新为 `deepseek-flash`,同步 Host 配置、后端回退、设置卡和中英文 README;保留用户显式配置的模型名。
33
+ - 供应商专用配置统一增加前缀:Tavily 使用 `tavily*`,DeepSeek 搜索选项使用 `deepseek*`,Brave 使用 `brave*`;Scavio 的地区与语言选项独立为 `scavioCountry`、`scavioSearchLang`。通用的 `provider`、`maxResults` 保持不变。
34
+ - 保留旧字段兼容读取;新字段优先,包括显式空字符串和 `false`。设置卡保存新名称,恢复默认时处理当前 Profile 的旧别名,并保留另一引擎依赖的旧共享地区或语言值。
35
+ - 设置卡隐藏 API 协议版本输入框,保留 `deepseekApiVersion` 高级配置与旧 `apiVersion` 兼容。
36
+
37
+ ### 文档
38
+
39
+ - README 提供英文主版与独立中文版,补充插件优势、设置卡配置步骤和配置范围;优先建议在卡片中选择 DeepSeek(官方),需要恢复 Harness 内置插件时再关闭整个组合包。
40
+
7
41
  ## [0.5.0] - 2026-10-09
8
42
 
9
43
  ### 新增
@@ -12,7 +46,7 @@
12
46
  - DeepSeek 后端支持账号令牌认证:会话 provider 为 `deepseek-account` 时通过 `deepseekAccount.resolveToken()` 获取令牌并以 `x-dsh-auth-token` 发送,未授权时回落到 `DEEPSEEK_API_KEY`。
13
47
  - 有会话发起者时,DeepSeek 搜索在派发前记录脱敏请求到会话事件 `web/deepseek-search-llm-request`,与官方 provider 行为一致。
14
48
  - 插件列表页与详情页的标题、描述随界面语言切换:`locale/en.json` 与 `locale/zh.json`,经 `"./locale/*.json"` 导出(与官方 bundle 同一机制)。卡片内文案由 `lib/client.js` 的 `zh` / `en` 字典提供。
15
- - README 面向开源使用者整理:删除仅适用于本机的排查笔记与旧个人包迁移章节,修正与实现脱节的仓库布局与安装说明。
49
+ - README 整理:修正与实现脱节的仓库布局与安装说明。
16
50
 
17
51
  ### 移除
18
52
 
package/README.md CHANGED
@@ -1,207 +1,338 @@
1
1
  # dsh-web-search-plugin
2
2
 
3
- 面向 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) web 能力接缝(`ctx.web`)的统一网页搜索插件,内置 **DeepSeek(官方,默认)/ Tavily / [Brave Search](https://brave.com/search/api/) / Serper / SerpApi / Exa / SearXNG / Scavio / Firecrawl 九个后端**。本包只向接缝注册 **一个** `WebSearchProvider`,稳定 id 为 `dsh-web-search`。在 **设置 → 网页搜索** 里切换引擎即可,不必再改 `web.searchProvider`。
4
-
5
- - **DeepSeek(官方,默认)** — 走 DeepSeek 的 Anthropic 兼容 Messages API(原生 `web_search_20250305` 工具,支持账号令牌或 `DEEPSEEK_API_KEY`),一次搜索消耗一个模型轮次。
6
- - **Tavily** — `keyless`(免费、限流、无需账号)或 `keyed`(`TAVILY_API_KEY`,Bearer token)。keyed 会在设置卡显示额度进度条。
7
- - **Brave Search** — `GET https://api.search.brave.com/res/v1/web/search`,请求头 `X-Subscription-Token`(凭据名 `BRAVE_API_KEY`)。一次搜索就是一次 HTTP 请求,不走模型轮次;设置卡按响应头展示 Capacity / 月配额。
8
- - **Serper** — Google 结果(`POST /search`,头 `X-API-KEY`,凭据名 `SERPER_API_KEY`)。
9
- - **SerpApi** — `GET /search.json`,key 走 query(`api_key=`),凭据名 `SERPAPI_API_KEY`。
10
- - **Exa** — 语义/神经搜索(`POST /search`,Bearer,凭据名 `EXA_API_KEY`),请求 `contents.highlights` 作为结果摘要。
11
- - **SearXNG** — 自建/协议免 key 的元搜索(`GET /search?format=json`),可填自托管实例地址;实例须启用 JSON 输出。
12
- - **Scavio** — Google SERP(`POST /api/v2/google`,Bearer,凭据名 `SCAVIO_API_KEY`),响应与 SerpApi 同构。
13
- - **Firecrawl** — 网页搜索(`POST /v2/search`,Bearer,凭据名 `FIRECRAWL_API_KEY`),`sources: ["web"]`;当前请求没有启用整页抓取。
14
- - **DuckDuckGo** — 无官方搜索 API,不提供独立后端;下拉中以禁用项提示:选 SearXNG 并指向聚合了 DuckDuckGo 的实例即可。
15
- - **官方 key 跳转** — 需要 key 的内置 provider 在设置卡带「获取 API key ↗」一键跳官方控制台;免 key 的(SearXNG / Tavily keyless)不渲染。
16
- - **会话事件** — 有会话发起者时,DeepSeek 在派发前记录脱敏模型请求到 `web/deepseek-search-llm-request`;REST 后端不追加自定义事件。
17
-
18
- ## 特性
19
-
20
- - 与官方 `@deepseek-ai/dsh-web-search-deepseek` 相同的提供方约定:`inject: ['web']` + 全`volatile()` 配置字段 + `ctx.web.registerSearchProvider`。
21
- - 自定义配置卡片位于 **设置 → 网页搜索**。
22
- - **默认引擎为 DeepSeek(官方)**:新装 / 未显式改动时,搜索直接走 `deepseek-official`,不再依赖 keyless 的 Tavily。
23
- - **9 个后端**中,8 个纯 REST 后端由**静态元数据表 + 通用后端**驱动;只有 DeepSeek 官方走模型轮次。新增内置 REST 引擎还需同步配置字段和客户端引擎列表。
24
- - Tavily keyless 无需密钥即可用;Brave 需要订阅 token(若本机已有 `BRAVE_API_KEY` 凭据,可直接复用)。
25
- - Tavily keyed / Brave 在设置卡展示额度进度条(DeepSeek 官方与 Tavily keyless / 其余 REST 后端不展示)。
26
- - 各引擎结果都规范化为接缝的 `WebSearchResult`(可选 `content` + `sources[]`),按 URL 去重。
27
- - 配置由当前 Profile 的插件配置保存,全部字段声明为 `volatile()`:改引擎或端点后无需重启插件即可生效。
28
- - 插件列表页与详情页的标题、描述随界面语言切换(`locale/*.json`);卡片内文案自带中英字典。
29
- - 错误映射为 `WEB_PROVIDER_ERROR` / `WEB_ABORTED` / `WEB_PROVIDER_CREDENTIAL_MISSING`。
30
-
31
- ## 运行要求
32
-
33
- - DeepSeek Harness `0.2.0-rc.2` 或兼容的 `0.2.x` 版本
34
- - Node.js `^22.19.0` 或 `>=24.0.0`
35
- - pnpm,用于通过 `dsh plugin` 把插件装进 profile
36
-
37
- ## 安装
38
-
39
- 本包是 **bundle**:`dsh.bundle.patch` + `cordis.patch.yml` 会插入 Host 行、把 `web.searchProvider` 设为 `dsh-web-search`,并禁用内置 `web-search-deepseek` Host 插件,使此 profile 的 DeepSeek 搜索由本插件统一配置。本插件注册到接缝的 id 是 `dsh-web-search`;`deepseek-official` 是内部引擎选项,和内置插件注册的 id 不同。没有 bundle 声明时,`dsh plugin add` 只写入依赖,插件不会挂载。
40
-
41
- ### 从 npm 安装
3
+ English | [中文](./README.zh.md)
4
+
5
+ A web search plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH) that gives your agent more search options through Harness's existing `web_search` tool. **Settings → Web search** contains two independent sections: **Search engines** (ten choices) and **Web retrieval** (local HTTP or DeepSeek Fetch API), with one Save action.
6
+
7
+ ## Why use this plugin?
8
+
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
+ - **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
+ - **Choose the search service that fits your needs.** Use Google results through Serper, semantic search through Exa, or a self-hosted SearXNG instance. Tavily's keyless mode lets you try search without an account or API key.
12
+ - **Keep existing engines and settings.** Messages search and third-party engines remain available. Search and retrieval are selected independently; see [Disable or uninstall](#disable-or-uninstall) before removing saved provider overrides.
13
+
14
+ **The default engine is still DeepSeek Messages search.** To avoid the extra official search model call, select **DeepSeek Search API** or a third-party engine in the settings card after installation and save your changes. Selecting DeepSeek Messages search uses the official search API and may incur model invocation charges.
15
+
16
+ ## Supported providers
17
+
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.
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
+ - **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
+ - **Serper** — Google results via `POST /search`, using the `X-API-KEY` header (credential name: `SERPER_API_KEY`).
23
+ - **SerpApi** — Calls `GET /search.json` with the key in the query string (`api_key=`; credential name: `SERPAPI_API_KEY`).
24
+ - **Exa** — Semantic/neural search via `POST /search` with Bearer authentication (credential name: `EXA_API_KEY`). Requests `contents.highlights` for result summaries.
25
+ - **SearXNG** — Metasearch with no API key required by the protocol. Calls `GET /search?format=json` and supports a self-hosted instance URL. The instance must enable JSON output.
26
+ - **Scavio** — Google SERP via `POST /api/v2/google` with Bearer authentication (credential name: `SCAVIO_API_KEY`). Uses the same response structure as SerpApi.
27
+ - **Firecrawl** — Web search via `POST /v2/search` with Bearer authentication (credential name: `FIRECRAWL_API_KEY`) and `sources: ["web"]`. Full-page scraping is not enabled in the current request.
28
+
29
+ For DuckDuckGo results, choose a SearXNG instance that aggregates DuckDuckGo. DuckDuckGo appears only as a disabled hint in the engine selector.
30
+
31
+ ## Requirements
32
+
33
+ - Verified with DeepSeek Harness `0.2.1-rc.2`. New Search / Fetch options require the Host's `web` and `web-deepseek-api` configuration namespaces. Compatible `0.2.0-rc.2` Hosts retain existing engines; unavailable API options are disabled.
34
+ - Node.js `^22.19.0` or `>=24.0.0`
35
+ - pnpm, used by `dsh plugin` to install the plugin into a profile
36
+
37
+ ## Installation
38
+
39
+ ### Install from npm
42
40
 
43
41
  ```powershell
44
42
  dsh plugin --profile web add dsh-web-search-plugin
45
43
  ```
46
44
 
47
- > 从源码仓库本地安装(含 Windows 跨盘注意事项)见 [开发 → 本地安装与验证](#本地安装与验证)。
45
+ After installation, configure the plugin in the Harness Web UI:
46
+
47
+ 1. Open **Settings → Web search** and find the plugin's settings card. The sidebar's **Plugins** page controls whether the bundle is enabled; engine settings live in this card.
48
+ 2. Choose a search engine. For direct API search without an extra DeepSeek model call, select DeepSeek Search API, Tavily, Brave, Serper, SerpApi, Exa, SearXNG, Scavio, or Firecrawl.
49
+ 3. Enter the engine's API key if required. Engines that require a key show “Get API key ↗”, which opens the official dashboard. For Tavily without a key, choose `keyless`; for SearXNG, set an instance URL with JSON search enabled. These two keyless options do not show a key dashboard link. Existing credentials can be reused, such as `BRAVE_API_KEY` for Brave.
50
+ 4. Under **Web retrieval**, independently select local HTTP (default) or DeepSeek Fetch API.
51
+ 5. Adjust parameters and click **Save** at the bottom. Unsaved changes remain drafts; the next operation uses the saved settings.
52
+
53
+ > For installation from a local source checkout, including Windows cross-drive considerations, see [Development → Local installation and verification](#local-installation-and-verification).
54
+
55
+ ## Configuration
56
+
57
+ For normal use, configure the plugin in **Settings → Web search**. The card shows options for the selected engine and retrieval method. Existing engine settings use `dsh-web-search-plugin`; new API settings use `web-deepseek-api`, and provider selection uses `web` in the current profile. The tables below include advanced fields hidden from the card.
58
+
59
+ ### New Search API and web retrieval
60
+
61
+ The page reuses the official providers rather than registering duplicate implementations. Selecting the new Search API sets `web.searchProvider: deepseek-search-api`. Selecting an existing engine restores `dsh-web-search` and saves the plugin's `provider`. Retrieval independently selects `web.fetchProvider: http` or `deepseek-fetch-api`. Existing custom fetch providers are shown and preserved until explicitly changed.
48
62
 
49
- ## 配置
63
+ Search API and Fetch API share the official `web-deepseek-api` namespace: `apiKeyEnv` (default `DEEPSEEK_API_KEY`), `baseURL` (default `https://api.deepseek.com/v1/tools`), and the credential. Only one API configuration is shown when both are selected. Messages endpoint/model/key settings remain separate. API `count` controls returned results, not requests or spending. The official advanced `sendOriginalQuestion` setting defaults to true: search sends the triggering question with whitespace normalized and at most 128 characters. It can be disabled in the official configuration; this page preserves it.
50
64
 
51
- 设置卡编辑的是 `dsh-web-search-plugin` 命名空间。设置卡中的 API key 输入框把密钥写入凭据服务;若直接在插件配置中填写 `*ApiKey` 字段,则该字面量保存在插件配置中。建议使用设置卡或凭据引用名,避免在配置文件中保存密钥。
65
+ Recommended: **DeepSeek Search API + local HTTP**. Search avoids an auxiliary model call. Local HTTP requests the target from the device running DSH without calling paid Fetch. DeepSeek Fetch is optional remote Markdown retrieval; it does not guarantee access to every site. Local HTTP does not execute JavaScript. Tool results still consume main-conversation tokens. No automatic engine or paid retrieval fallback occurs.
52
66
 
53
- | 键 | 默认值 | 含义 |
67
+ See [official billing](https://api-docs.deepseek.com/zh-cn/guides/search/#计费) for current successful-request prices and conditions. Estimated costs are not presented as an actual bill.
68
+
69
+ 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.
70
+
71
+ The tables below describe the original nine plugin backends; new Search API configuration is described above.
72
+
73
+ ### General settings
74
+
75
+ | Key | Default | Meaning and scope |
54
76
  |---|---|---|
55
- | `provider` | `deepseek-official` | `tavily`、`brave`、`deepseek-official`、`serper`、`serpapi`、`exa`、`searxng`、`scavio` 或 `firecrawl` |
56
- | `mode` | `keyless` | 仅 Tavily:`keyless` 或 `keyed` |
57
- | `apiKey` | — | Tavily API key 配置字面量;设置卡的 key 输入框写入凭据服务 |
58
- | `apiKeyEnv` | `TAVILY_API_KEY` | keyed Tavily 使用的凭据/环境变量名 |
59
- | `baseURL` | 空 | Tavily REST 基址;留空时依次使用 `TAVILY_BASE_URL` 和 `https://api.tavily.com`,再拼 `/search` |
60
- | `maxResults` | `8` | 插件返回的源数量上限,与调用方的 `request.maxResults` 取较小值。设置卡为 1–20 下拉;SearXNG 不支持请求级数量参数,只在收到结果后截取 |
61
- | `searchDepth` | `basic` | 仅 Tavily:`basic` 或 `advanced` |
62
- | `includeAnswer` | `true` | 仅 Tavily:请求生成摘要,写入结果 `content` |
63
- | `topic` | `general` | 仅 Tavily:`general` 或 `news` |
64
- | `deepseekApiKey` | — | DeepSeek API key 配置字面量;设置卡的 key 输入框写入凭据服务 |
65
- | `deepseekApiKeyEnv` | `DEEPSEEK_API_KEY` | DeepSeek 使用的凭据/环境变量名 |
66
- | `deepseekBaseURL` | 空 | DeepSeek Anthropic 兼容 Messages 基址;留空时依次使用 `DEEPSEEK_SEARCH_BASE_URL` 和 `https://api.deepseek.com/anthropic/v1`,再拼 `/messages` |
67
- | `model` | `deepseek-v4-flash` | Anthropic 格式模型名 |
68
- | `apiVersion` | `2023-06-01` | `anthropic-version` 请求头 |
69
- | `maxTokens` | `4096` | Messages 请求生成 token 上限 |
70
- | `maxUses` | `5` | 每次请求 `web_search` 工具的最大调用次数 |
71
- | `braveApiKey` | — | Brave 订阅 token 配置字面量;设置卡的 key 输入框写入凭据服务 |
72
- | `braveApiKeyEnv` | `BRAVE_API_KEY` | Brave 使用的凭据/环境变量名 |
73
- | `braveBaseURL` | `https://api.search.brave.com/res/v1/web/search` | Brave 网页搜索接口 |
74
- | `country` | — | Brave 的 `country`(ISO 两位码,如 `cn`);留空使用 Brave 默认 |
75
- | `searchLang` | — | Brave 的 `search_lang`(如 `zh-hans`);留空使用 Brave 默认 |
76
- | `freshness` | — | Brave 的 `freshness`:`pd` / `pw` / `pm` / `py` |
77
- | `proxy` | — | Brave 使用的 HTTP(S) 代理覆盖;留空继承 DSH 的全局 `HTTP_PROXY` / `HTTPS_PROXY` / `ALL_PROXY` / `NO_PROXY` 策略 |
78
- | `serperApiKey` / `serperApiKeyEnv` / `serperBaseURL` | — / `SERPER_API_KEY` / `https://google.serper.dev` | Serper 的配置字面量 key / 凭据引用名 / REST 基址 |
79
- | `serpapiApiKey` / `serpapiApiKeyEnv` / `serpapiBaseURL` | — / `SERPAPI_API_KEY` / `https://serpapi.com` | SerpApi 的配置字面量 key / 凭据引用名 / REST 基址 |
80
- | `exaApiKey` / `exaApiKeyEnv` / `exaBaseURL` | — / `EXA_API_KEY` / `https://api.exa.ai` | Exa 的配置字面量 key / 凭据引用名 / REST 基址 |
81
- | `searxngBaseURL` | `https://searx.be` | SearXNG 实例基址;可改为自托管地址 |
82
- | `scavioApiKey` / `scavioApiKeyEnv` / `scavioBaseURL` | — / `SCAVIO_API_KEY` / `https://api.scavio.dev` | Scavio 的配置字面量 key / 凭据引用名 / REST 基址 |
83
- | `firecrawlApiKey` / `firecrawlApiKeyEnv` / `firecrawlBaseURL` | — / `FIRECRAWL_API_KEY` / `https://api.firecrawl.dev` | Firecrawl 的配置字面量 key / 凭据引用名 / REST 基址 |
84
-
85
- ## 未纳入的服务
86
-
87
- 以下服务**不内置**(在引擎下拉中不会出现,也不提供后端):
88
-
89
- | 服务 | 不做的原因 |
90
- |---|---|
91
- | **TinyFish** | 免费额度极小(每分钟 5 次);其 Search + Fetch 形态超出"纯 REST 搜索"边界,仅搜索部分价值低 |
92
- | **Google CSE** | 官方已对新用户关闭注册,并将于 2027-01-01 停用 |
93
- | **SERPJET** | 官网当前不可访问,暂不接入 |
94
- | **DuckDuckGo** | 无官方搜索 API(HTML/社区库抓取不符合元数据表"纯 REST"边界)。下拉中有禁用提示,指引经 SearXNG 使用 |
95
-
96
- 环境变量:启动时 `DSH_WEB_SEARCH_PROVIDER=dsh-web-search` 会选中本接缝 id。`baseURL` 留空时,Tavily 基址回退 `TAVILY_BASE_URL`;`deepseekBaseURL` 留空时回退 `DEEPSEEK_SEARCH_BASE_URL`。
97
-
98
- ## 额度
99
-
100
- - **Tavily keyless / DeepSeek 官方**:不展示额度条。前者是免费限流、没有账户配额;后者按次扣费、没有月度限额。
101
- - **Tavily keyed**:搜索时请求 `include_usage`,在内存中累加当前凭据的 credits。Host 定时调用 `GET /usage`,设置卡也可手动刷新;手动刷新之间至少间隔 10 秒,自动对账不受此限制。用 `account.current_plan` / `plan_limit` 做限额,用量取当前凭据的本地累计与远端的较大值;换 key 时清空旧账户用量并立即重新对账。旧 Tavily 额度不再持久化到磁盘。
102
- - **Brave**:没有 usage / 花费接口。控制台 **Capacity** 就是响应头里的每秒窗口(例如 50 次/秒)。月限额 `0` 表示不限请求次数,不是额度用完。计费 credits 只能看 [Brave API 控制台](https://api-dashboard.search.brave.com/)。
103
- - 浏览器只读 `GET /dsh-web-search/usage`(不直打上游)。进度条:剩余超过 20% 为绿色,不超过 20% 为黄色,不超过 10% 为红色。
104
-
105
- ## 卸载
106
-
107
- 若要改用 DSH 内置的 DeepSeek host 插件,先卸载本插件及其 bundle patch:
77
+ | `provider` | `deepseek-official` | Active engine: `deepseek-official`, `tavily`, `brave`, `serper`, `serpapi`, `exa`, `searxng`, `scavio`, or `firecrawl`. Each request uses only the selected engine, with no automatic failover to another engine on error. Unknown values fall back to official DeepSeek |
78
+ | `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 |
108
79
 
109
- ```powershell
110
- dsh plugin --profile web remove dsh-web-search-plugin
111
- ```
80
+ ### Keys and credential references
81
+
82
+ **The card's “API Key” input differs from the literal configuration fields below.** When you enter and save a new key, the card writes it under the current engine's credential reference rather than storing the plaintext key in plugin configuration. It also sets the corresponding literal field to an empty string so an old configuration key cannot override the new credential. Leaving the input blank preserves the existing key; it does not delete it. Use Harness's credential management capabilities to delete a credential.
112
83
 
113
- 随后检查 profile 中实际生效的 `web.searchProvider`;若曾手工覆盖为 `dsh-web-search`,将该覆盖改回 `deepseek-official`。
84
+ | Engine | Literal configuration field | Credential reference field | Default reference |
85
+ |---|---|---|---|
86
+ | DeepSeek (API key authentication) | `deepseekApiKey` | `deepseekApiKeyEnv` | `DEEPSEEK_API_KEY` |
87
+ | Tavily (`keyed` only) | `tavilyApiKey` | `tavilyApiKeyEnv` | `TAVILY_API_KEY` |
88
+ | Brave | `braveApiKey` | `braveApiKeyEnv` | `BRAVE_API_KEY` |
89
+ | Serper | `serperApiKey` | `serperApiKeyEnv` | `SERPER_API_KEY` |
90
+ | SerpApi | `serpapiApiKey` | `serpapiApiKeyEnv` | `SERPAPI_API_KEY` |
91
+ | Exa | `exaApiKey` | `exaApiKeyEnv` | `EXA_API_KEY` |
92
+ | Scavio | `scavioApiKey` | `scavioApiKeyEnv` | `SCAVIO_API_KEY` |
93
+ | Firecrawl | `firecrawlApiKey` | `firecrawlApiKeyEnv` | `FIRECRAWL_API_KEY` |
114
94
 
115
- ## 工作方式
95
+ All literal fields default to an empty string. A manually configured nonempty literal key takes priority. Otherwise, the plugin resolves the reference through **the credentials service → the Harness launching environment → process environment variables**, in that order. `*ApiKeyEnv` holds a reference name, not the key itself; the card requires names matching `[A-Za-z_][A-Za-z0-9_]*`.
116
96
 
117
- - **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`。
118
- - **纯 REST 类(Tavily / Brave / Serper / SerpApi / Exa / SearXNG / Scavio / Firecrawl)** — 由静态元数据表(`lib/providers.js`)+ 通用后端(`lib/rest.js`)驱动。请求方法 / 路径 / 查询字段名 / 鉴权(bearer / header / none / query)/ 固定参数 / 响应形态由表中的行决定。
119
- - **Tavily** — `POST {baseURL}/search`。keyless 发送 `x-tavily-access-mode: keyless`;keyed 发送 `authorization: Bearer <key>`,并带 `include_usage` 回传 credits。
120
- - **Brave** — `GET {braveBaseURL}?q=&count=`,请求头 `x-subscription-token`。不向 session 追加自定义事件。
121
- - **其余六种 REST 引擎** — 按各自表的 `method` / `auth` / `params` 约定请求。
122
- - 非 2xx 映射为 `WEB_PROVIDER_ERROR`;调用方取消映射为 `WEB_ABORTED`。
97
+ Official DeepSeek account sessions (provider: `deepseek-account`) first try an account token authorized for the endpoint by the account service. If no token is obtained, search uses the API key path above. Tavily `keyless` and SearXNG search requests require no API key. Configuring a Tavily key does not automatically select `keyed`; choose that mode explicitly. The current SearXNG backend has no instance-token or custom authentication-header setting.
123
98
 
124
- ## 仓库布局
99
+ Credential writes and profile configuration saves happen in separate steps. Failed saves retain the draft, but successfully written credentials are not automatically rolled back. Prefer the card for everyday key management to avoid storing plaintext literals in configuration files.
125
100
 
101
+ ### Endpoints
102
+
103
+ The table lists the addresses used when no custom endpoint or environment override is provided. Normally, you do not need to enter an endpoint. Tavily and DeepSeek also support endpoint overrides through the launching environment.
104
+
105
+ | Key | Default address | Address rules |
106
+ |---|---|---|
107
+ | `deepseekBaseURL` | `https://api.deepseek.com/anthropic/v1` | DeepSeek Anthropic-compatible Messages base: nonempty configuration → `DEEPSEEK_SEARCH_BASE_URL` in the launching environment → default address; appends `/messages` |
108
+ | `tavilyBaseURL` | `https://api.tavily.com` | Tavily base: nonempty configuration → `TAVILY_BASE_URL` in the launching environment → default address; appends `/search` |
109
+ | `braveBaseURL` | `https://api.search.brave.com/res/v1/web/search` | Full web search endpoint; no path is appended |
110
+ | `serperBaseURL` | `https://google.serper.dev` | Appends `/search` |
111
+ | `serpapiBaseURL` | `https://serpapi.com` | Appends `/search.json` |
112
+ | `exaBaseURL` | `https://api.exa.ai` | Appends `/search` |
113
+ | `searxngBaseURL` | `https://searx.be` | Appends `/search?format=json` with the search query; the instance must allow JSON search. The default address is not guaranteed to work; a self-hosted instance can be used |
114
+ | `scavioBaseURL` | `https://api.scavio.dev` | Appends `/api/v2/google` |
115
+ | `firecrawlBaseURL` | `https://api.firecrawl.dev` | Appends `/v2/search` |
116
+
117
+ Changing an engine's address does not change its request method, authentication, or response parsing. Custom endpoints must implement the corresponding engine's protocol; replacing a URL alone cannot connect an arbitrary search API. Except for Brave, omit the automatically appended paths listed above when entering a base URL. Engines other than Tavily and DeepSeek fall back to their built-in address when the effective address setting is empty, with no additional dedicated environment variable fallback.
118
+
119
+ Clearing a text input or using “Restore default” in the card normally removes the current profile's override and uses the inherited or default value. This differs from manually writing an empty string into configuration. Endpoint fallbacks are evaluated against the effective configuration value.
120
+
121
+ ### Provider-specific options
122
+
123
+ <table>
124
+ <thead>
125
+ <tr><th>Provider</th><th>Key</th><th>Default</th><th>Meaning and scope</th></tr>
126
+ </thead>
127
+ <tbody>
128
+ <tr>
129
+ <td rowspan="4"><strong>DeepSeek Messages search</strong></td>
130
+ <td><code>deepseekModel</code></td>
131
+ <td><code>deepseek-flash</code></td>
132
+ <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>
133
+ </tr>
134
+ <tr>
135
+ <td><code>deepseekApiVersion</code></td>
136
+ <td><code>2023-06-01</code></td>
137
+ <td>Value of the <code>anthropic-version</code> header. Hidden from the settings card and retained as advanced configuration; normally leave at the default</td>
138
+ </tr>
139
+ <tr>
140
+ <td><code>deepseekMaxTokens</code></td>
141
+ <td><code>4096</code></td>
142
+ <td>Maximum generated tokens for one DeepSeek Messages search request, a positive integer; not a conversation-wide token limit</td>
143
+ </tr>
144
+ <tr>
145
+ <td><code>deepseekMaxUses</code></td>
146
+ <td><code>5</code></td>
147
+ <td>Maximum native <code>web_search</code> tool uses within one DeepSeek Messages request, a positive integer; not an engine retry count or result count</td>
148
+ </tr>
149
+ <tr>
150
+ <td rowspan="4"><strong>Tavily</strong></td>
151
+ <td><code>tavilyMode</code></td>
152
+ <td><code>keyless</code></td>
153
+ <td>Tavily only: keyless access (<code>keyless</code>) or API key access (<code>keyed</code>); does not control authentication for other engines</td>
154
+ </tr>
155
+ <tr>
156
+ <td><code>tavilySearchDepth</code></td>
157
+ <td><code>basic</code></td>
158
+ <td>Tavily only: <code>basic</code> or <code>advanced</code>, sent as <code>search_depth</code></td>
159
+ </tr>
160
+ <tr>
161
+ <td><code>tavilyIncludeAnswer</code></td>
162
+ <td><code>true</code></td>
163
+ <td>Tavily only: requests <code>include_answer: true</code> when enabled. The current shared REST backend omits the parameter when disabled; if upstream still returns an answer, it can still become result <code>content</code>. This does not guarantee removal of all answer text</td>
164
+ </tr>
165
+ <tr>
166
+ <td><code>tavilyTopic</code></td>
167
+ <td><code>general</code></td>
168
+ <td>Tavily only: <code>general</code> or <code>news</code></td>
169
+ </tr>
170
+ <tr>
171
+ <td rowspan="4"><strong>Brave</strong></td>
172
+ <td><code>braveCountry</code></td>
173
+ <td>Empty string</td>
174
+ <td>Brave only: sent as <code>country</code> (two-letter country code, such as <code>cn</code>); omitted when the effective value is empty</td>
175
+ </tr>
176
+ <tr>
177
+ <td><code>braveSearchLang</code></td>
178
+ <td>Empty string</td>
179
+ <td>Brave only: sent as <code>search_lang</code> (such as <code>zh-hans</code>); omitted when the effective value is empty</td>
180
+ </tr>
181
+ <tr>
182
+ <td><code>braveFreshness</code></td>
183
+ <td>Empty string</td>
184
+ <td>Brave only: <code>pd</code> / <code>pw</code> / <code>pm</code> / <code>py</code> for the past day / week / month / year. Empty means no time filter</td>
185
+ </tr>
186
+ <tr>
187
+ <td><code>braveProxy</code></td>
188
+ <td>Empty string</td>
189
+ <td>Explicit HTTP(S) proxy override for Brave only. If empty, no separate proxy is set and Harness's global network policy applies. Other engines do not use this field</td>
190
+ </tr>
191
+ <tr>
192
+ <td rowspan="2"><strong>Scavio</strong></td>
193
+ <td><code>scavioCountry</code></td>
194
+ <td>Empty string</td>
195
+ <td>Scavio only: sent as <code>gl</code>, using a country/region code accepted by that service; omitted when the effective value is empty</td>
196
+ </tr>
197
+ <tr>
198
+ <td><code>scavioSearchLang</code></td>
199
+ <td>Empty string</td>
200
+ <td>Scavio only: sent as <code>hl</code>, using a language code accepted by that service; omitted when the effective value is empty. New settings are independent of Brave</td>
201
+ </tr>
202
+ </tbody>
203
+ </table>
204
+
205
+ The startup environment variable `DSH_WEB_SEARCH_PROVIDER=dsh-web-search` selects Harness's registered search provider ID, not this plugin's `provider` engine option. Installing the bundle normally selects the provider already, so this variable is not required.
206
+
207
+ ## Quotas
208
+
209
+ - **DeepSeek Messages search**: No quota bar. Search still makes a model request, with usage subject to your account or API billing.
210
+ - **Tavily keyless**: No quota bar; access is free and rate-limited.
211
+ - **Tavily keyed**: Requests `include_usage` during searches and accumulates credits for the current credential in memory. The Host periodically calls `GET /usage`, and the settings card supports manual refresh. Manual refreshes must be at least 10 seconds apart; automatic reconciliation is not subject to this limit. The quota comes from `account.current_plan` / `plan_limit`; usage is the larger of the local total for the current credential and the remote value. Changing keys clears the previous account's usage and triggers immediate reconciliation. Tavily quota data is no longer persisted to disk.
212
+ - **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/).
213
+ - The browser reads only `GET /dsh-web-search/usage` and does not call upstream services directly. Quota bars are green when more than 20% remains, yellow at 20% or less, and red at 10% or less.
214
+
215
+ ## Disable or uninstall
216
+
217
+ ### Switch to DeepSeek Messages search first
218
+
219
+ If you only want to use official search again, select **DeepSeek Messages search** in **Settings → Web search** and save. There is no need to disable or uninstall this plugin. The next search uses the official search API through this plugin and may still incur model invocation charges.
220
+
221
+ ### Disable and restore built-in search
222
+
223
+ Use the following steps when you want to stop using this plugin and restore Harness's original search plugin. Selecting this plugin's DeepSeek engine and restoring the original plugin are separate operations.
224
+
225
+ Open **Plugins** in the sidebar and turn off the **entire `dsh-web-search-plugin` bundle**. This removes its composition layer and re-enables the built-in Messages search plugin. Explicit provider settings saved through this page remain in the profile: review `web.searchProvider` and `web.fetchProvider` and remove the overrides to restore profile defaults. You can turn the bundle back on later.
226
+
227
+ Use the bundle's main switch: disabling only an individual component inside the bundle leaves its other configuration overrides in place. Profiles with configuration hot reload apply the change immediately; otherwise, restart Harness.
228
+
229
+ If you manually set `web.searchProvider: dsh-web-search`, `DSH_WEB_SEARCH_PROVIDER=dsh-web-search`, or a separate override disabling the built-in DeepSeek plugin, also remove or revert those overrides. The bundle switch does not undo settings you added separately.
230
+
231
+ ### Uninstall the package
232
+
233
+ To remove the installed package as well, run:
234
+
235
+ ```powershell
236
+ dsh plugin --profile web remove dsh-web-search-plugin
126
237
  ```
127
- lib/index.js Host 插件:volatile Config、按元数据分发提供方、额度路由
128
- lib/providers.js 静态元数据表:8 个 REST provider(另加 deepseek.js 的 DeepSeek,共9 个后端)的请求/鉴权/响应/官方跳转(纯数据,无定制代码)
129
- lib/rest.js 通用 REST 后端:按元数据驱动请求构造与响应规范化(含 Tavily / Brave 的额度与限流 hook)
130
- lib/deepseek.js DeepSeek 后端(Anthropic Messages + web_search_20250305 + 账号令牌)
131
- lib/tavily.js Tavily 专用后端与选项解析(当前分发使用 rest 通用后端)
132
- lib/brave.js Brave 专用后端与选项解析(当前分发使用 rest 通用后端)
133
- lib/usage.js Tavily/Brave 用量本地缓存与 /usage 对账
134
- lib/shared.js 中止 / 凭据解析辅助
135
- lib/client.js 浏览器 bundle:设置分区 + 引擎切换 + 官方 key 跳转 + 额度条
136
- locale/en.json 插件列表页 / 详情页的英文标题与描述
137
- locale/zh.json 同上,中文
138
- cordis.patch.yml Bundle patch:插入 Host 行、设 searchProvider、禁用内置 deepseek
238
+
239
+ 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`.
240
+
241
+ ## How it works
242
+
243
+ The plugin registers a single `WebSearchProvider` with the stable ID `dsh-web-search` through `ctx.web`, following the same provider contract as `@deepseek-ai/dsh-web-search-deepseek` (`inject: ['web']` and `ctx.web.registerSearchProvider`). The original nine engines share this provider; selecting the new Search API switches to the official provider, independently of retrieval. Results are normalized to `WebSearchResult` (optional `content` and `sources[]`) and deduplicated by URL. All configuration fields use `volatile()`, so saved settings are read without restarting the plugin.
244
+
245
+ This package is a **bundle**. The `dsh.bundle.patch` declaration points to `cordis.patch.yml`, which adds the Host entry, selects `dsh-web-search`, and disables the built-in `web-search-deepseek` Host plugin while the bundle is enabled. The plugin's internal `deepseek-official` engine option is distinct from its registered `dsh-web-search` ID. Disabling the entire bundle removes this patch layer; disabling only its Host entry does not. Without a bundle declaration, `dsh plugin add` only adds the dependency and does not mount the plugin.
246
+
247
+ - **DeepSeek** — Calls `POST {deepseekBaseURL}/messages` with the `web_search_20250305` tool. If the session uses the official DeepSeek account route (provider: `deepseek-account`) and the account service allows the endpoint, the request uses an account token in `x-dsh-auth-token`. Otherwise, it falls back to an API key (`x-api-key` / `authorization: Bearer`, credential name: `DEEPSEEK_API_KEY`). When a session initiator is available, a redacted request is recorded as the session event `web/deepseek-search-llm-request` before dispatch.
248
+ - **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.
249
+ - **Tavily** — Calls `POST {tavilyBaseURL}/search`. Keyless mode sends `x-tavily-access-mode: keyless`; keyed mode sends `authorization: Bearer <key>` and requests `include_usage` for credits.
250
+ - **Brave** — Calls `GET {braveBaseURL}?q=&count=` with the `x-subscription-token` header. Does not append custom session events.
251
+ - **The other six REST engines** — Follow their metadata entries' `method`, `auth`, and `params` definitions.
252
+ - Non-2xx responses map to `WEB_PROVIDER_ERROR`; caller cancellation maps to `WEB_ABORTED`; missing credentials map to `WEB_PROVIDER_CREDENTIAL_MISSING`.
253
+
254
+ ## Repository layout
255
+
256
+ ```text
257
+ lib/config.js Supplier field naming and legacy configuration resolution
258
+ lib/index.js Host plugin: volatile Config, metadata-based provider dispatch, quota routes
259
+ lib/deepseek.js DeepSeek backend: Anthropic Messages, web_search_20250305, account tokens
260
+ lib/providers.js Static metadata: requests/auth/responses/API key links for 8 REST providers (plus DeepSeek in deepseek.js, for 9 backends total)
261
+ lib/rest.js Shared REST backend: metadata-driven requests and response normalization, including Tavily/Brave quota and rate-limit hooks
262
+ lib/tavily.js Dedicated Tavily backend and option parsing (current dispatch uses the shared REST backend)
263
+ lib/brave.js Dedicated Brave backend and option parsing (current dispatch uses the shared REST backend)
264
+ lib/usage.js Local Tavily/Brave usage cache and /usage reconciliation
265
+ lib/shared.js Cancellation and credential resolution helpers
266
+ lib/client.js Browser bundle: settings section, engine switching, API key links, quota bars
267
+ locale/en.json English titles and descriptions for plugin list/detail pages
268
+ locale/zh.json Chinese titles and descriptions for the same pages
269
+ cordis.patch.yml Bundle patch: adds Host entry, sets searchProvider, disables built-in DeepSeek
139
270
  ```
140
271
 
141
- ## 开发
272
+ ## Development
142
273
 
143
- ### 本地安装与验证
274
+ ### Local installation and verification
144
275
 
145
- 改源码后本机验证,把仓库装进某个 profile(以 `web` 为例)。**同盘**可以直接用相对路径:
276
+ 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:
146
277
 
147
278
  ```powershell
148
279
  dsh plugin --profile web add ".\dsh-web-search-plugin"
149
280
  ```
150
281
 
151
- **Windows 跨盘不要 `dsh plugin add` 绝对路径。** Profile 与仓库不在同一盘时,它会写成 `link:` 或 `file:` 加绝对盘符;pnpm 会把盘符当成相对路径,junction 指向一个不存在的目录。做法是先把仓库快照到与 profile **同盘**,再用相对 `file:`:
282
+ **On Windows, do not pass an absolute path to `dsh plugin add` across drives.** If the profile and checkout are on different drives, the dependency is written as `link:` or `file:` with an absolute drive letter. pnpm treats the drive letter as a relative path, leaving the junction pointing to a nonexistent directory. Copy a snapshot of the checkout onto the **same drive** as the profile, then use a relative `file:` reference:
152
283
 
153
284
  ```powershell
154
285
  $dst = "$env:USERPROFILE\.dsh\profiles\web\.local\dsh-web-search-plugin"
155
- robocopy "<仓库路径>" $dst /E /XD node_modules .git .github .snapshots .workbuddy docs /NFL /NDL /NJH /NJS
286
+ robocopy "<repository-path>" $dst /E /XD node_modules .git .github .snapshots .workbuddy docs /NFL /NDL /NJH /NJS
156
287
  ```
157
288
 
158
- 在 profile 的 `package.json` 里:
289
+ In the profile's `package.json`:
159
290
 
160
291
  ```json
161
292
  "dsh-web-search-plugin": "file:.local/dsh-web-search-plugin"
162
293
  ```
163
294
 
164
- 并保证 `dsh.profile.bundles` 含本包,然后:
295
+ Ensure that `dsh.profile.bundles` includes this package, then run:
165
296
 
166
297
  ```powershell
167
298
  dsh plugin --profile web install
168
299
  ```
169
300
 
170
- `file:` 是快照:改完仓库后要再 robocopy + `install` 并重启 DSH。改了 `package.json` 的 `files` 字段时,pnpm 可能认为快照未变化而跳过更新,需要先删掉 `node_modules/dsh-web-search-plugin` 再装。
301
+ `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.
171
302
 
172
- 用 `dsh --profile web --dump-config` 确认:组成树里应有 `dsh-web-search-plugin` 行,且 `web.searchProvider` 为 `dsh-web-search`。
303
+ 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.
173
304
 
174
- ### 语法检查
305
+ ### Syntax checks
175
306
 
176
307
  ```powershell
177
308
  npm run check
178
309
  npm test
179
310
  ```
180
311
 
181
- 客户端 bundle 必须保持 `window.__ModuleLoader__.load({ id, factory })` 线格式 — 由 `dsh-client-modules` 加载,不是打包器。必须同时导出 `apply` 和 `inject`(`slots`、`locale`、`remote`、`remote.credentials`、`configForms`)。
312
+ 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`).
182
313
 
183
- 配置卡片的宿主就是**设置 → 网页搜索**(`settings.section`,`id: "web-search"`),数据来自 `ctx.configForms.get("dsh-web-search-plugin")`,并通过 `configForms.whileServed([namespace], register)` 条件注册:Host 未下发该命名空间时不留痕迹。
314
+ 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.
184
315
 
185
- 本插件不在插件详情页(`plugins.bundle.config`)显示配置。
316
+ The plugin does not show configuration on the plugin detail page (`plugins.bundle.config`).
186
317
 
187
- ## 本地化
318
+ ## Localization
188
319
 
189
- 插件列表页与详情页的标题和描述走 `locale/<lang>.json`,随界面语言切换:
320
+ Plugin list and detail page titles and descriptions use `locale/<lang>.json` and follow the interface language:
190
321
 
191
- ```
322
+ ```text
192
323
  locale/en.json {"meta": {"title": "Web search", "description": "…"}}
193
324
  locale/zh.json {"meta": {"title": "网页搜索", "description": "…"}}
194
325
  ```
195
326
 
196
- 卡片内的文案由 `lib/client.js` 的 `zh` / `en` 两份字典提供,改动时须保持键名对齐。
327
+ Settings card text comes from the `zh` and `en` dictionaries in `lib/client.js`. Keep their keys aligned when editing them.
197
328
 
198
- ## 发布
329
+ ## Publishing
199
330
 
200
- 发布由 GitHub Actions(`.github/workflows/publish.yml`)自动完成:**推送与 `package.json` 版本一致的 `v*` 标签**会带 provenance 发到 npm。向 `main` 的普通推送不会发布。
331
+ 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.
201
332
 
202
- 1. 确认 `package.json` 的 `version` 与即将推送的标签一致,并在 `CHANGELOG.md` 中为该版本填写非空的 `## [版本号]` 章节。
203
- 2. 在 GitHub **Settings → Secrets and variables → Actions** 里配置有 publish 权限的 npm automation token(仓库密钥 `NPM_TOKEN`),并允许 Actions 运行。
204
- 3. 打标签并推送:
333
+ 1. Check that `package.json`'s `version` matches the tag you will push, and add a nonempty `## [version]` section for that version in `CHANGELOG.md`.
334
+ 2. Configure an npm automation token with publishing permissions as the repository secret `NPM_TOKEN` under GitHub **Settings → Secrets and variables → Actions**, and enable Actions.
335
+ 3. Tag and push:
205
336
 
206
337
  ```powershell
207
338
  $version = node -p "require('./package.json').version"
@@ -209,12 +340,12 @@ locale/zh.json {"meta": {"title": "网页搜索", "description": "…"}}
209
340
  git push origin "v$version"
210
341
  ```
211
342
 
212
- 工作流会先核对标签与 `package.json` 的 `version`,确认 `CHANGELOG.md` 中对应版本的发布说明非空,再执行 `npm publish --provenance --access public`。
343
+ The workflow checks that the tag matches `package.json`'s `version` and that the corresponding release notes in `CHANGELOG.md` are nonempty, then runs `npm publish --provenance --access public`.
213
344
 
214
- ## 参与贡献
345
+ ## Contributing
215
346
 
216
- 欢迎提 issue 和 pull request,见 [issue tracker](https://github.com/X-C1811/dsh-web-search-plugin/issues)。还可以在同一接缝 id 下继续加搜索后端。
347
+ Issues and pull requests are welcome. See the [issue tracker](https://github.com/X-C1811/dsh-web-search-plugin/issues). Additional search backends can be added under the same registered provider ID.
217
348
 
218
- ## 许可证
349
+ ## License
219
350
 
220
351
  [MIT](LICENSE)