dsh-free-search 0.9.50 → 0.9.52

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/README.md CHANGED
@@ -34,7 +34,7 @@
34
34
  #### 引擎与切换
35
35
 
36
36
  - **零成本** —— 多个免费引擎,无需 key、无需注册
37
- - **39 个引擎可选**:DuckDuckGo(html/lite)、Bing、SearXNG(元搜索,支持自定义实例)、AnySearch、Exa、Tavily、Keenable、Firecrawl、Parallel、Perplexity、SerpBase、Serply、Outcrawl、Google 自定义搜索(`google`,需 API key + CSE ID)、秘塔搜索(`metaso`,官方 API,按点数计费)、Yandex 搜索(`yandex`,官方 API,按请求计费,需 folder ID)、腾讯元宝搜索(`yuanbao`,API key 网关,有活动免费额度)、DeepSeek 官方、DeepSeek 原生搜索 API、You.com、百度千帆、Kimi、阿里云百炼、火山联网搜索(豆包搜索)、知乎全网/站内(`zhihu_global`/`zhihu_site`,经知乎开放平台 MCP)、Antigravity CLI 搜索(`agy`,需本机安装)、OpenAI / Gemini / Claude 模型内置搜索。默认自动回退链覆盖其中 28 个;5 个 HTML SERP 引擎默认不参与,OpenAI / Gemini / Claude 三个模型引擎、Metaso、Yandex 和 Yuanbao 都只在显式点名时运行。
37
+ - **40 个引擎可选**:DuckDuckGo(html/lite)、Bing、SearXNG(元搜索,支持自定义实例)、AnySearch、Exa、Tavily、Keenable、Firecrawl、Parallel、Brave(`brave`,官方 Search API,需 `BRAVE_API_KEY`)、Perplexity、SerpBase、Serply、Outcrawl、Google 自定义搜索(`google`,需 API key + CSE ID)、秘塔搜索(`metaso`,官方 API,按点数计费)、Yandex 搜索(`yandex`,官方 API,按请求计费,需 folder ID)、腾讯元宝搜索(`yuanbao`,API key 网关,有活动免费额度)、DeepSeek 官方、DeepSeek 原生搜索 API、You.com、百度千帆、Kimi、阿里云百炼、火山联网搜索(豆包搜索)、知乎全网/站内(`zhihu_global`/`zhihu_site`,经知乎开放平台 MCP)、Antigravity CLI 搜索(`agy`,需本机安装)、OpenAI / Gemini / Claude 模型内置搜索。默认自动回退链覆盖其中 29 个;5 个 HTML SERP 引擎默认不参与,OpenAI / Gemini / Claude 三个模型引擎、Metaso、Yandex 和 Yuanbao 都只在显式点名时运行。
38
38
  - **5 个 HTML 搜索页引擎(默认关闭)** —— 把传统搜索页并入同一套引擎 / 回退 / 冷却 / 设置体系:`baidu-html`(百度网页)、`so360`、`sogou`、`wechat`(微信文章)、`toutiao`。免 key、免额度,代价是抓页面:验证码/反爬按 `bot-wall` 归类并让整个家族冷却 10 分钟(整段出口 IP 都会被打标),结果也没有 API 摘要。它们默认不进 auto / 回退链 / 语言池,只在显式 `engine=` 或加入语言池时运行。
39
39
  - **引擎白名单** —— 设置页「只使用勾选的引擎」开启后,只有勾选的引擎可用,升级新增的引擎默认不启用;配置里对应 `allowedEngines`(非空时等价于把其余引擎全部禁用)。
40
40
  - **全局引擎开关与回退优先级** —— 设置页可勾选/取消引擎(取消后全局生效:普通搜索 / Auto / `advanced_search` / `multi_search` / 引擎测试都不再用它),并可用 ↑↓ 调整全局回退顺序(一键恢复默认)。
@@ -142,6 +142,7 @@
142
142
  | `keenable` | Keenable | 免费 | **无 key 也可用**(MCP 匿名),配 key 提升额度 |
143
143
  | `firecrawl` | Firecrawl | 免费 | **无 key 也可用**(官方免 key 匿名额度),配 key 提升限额。注意:keyless 档按**出口 IP** 判定,VPN/代理出口会被 403 拒绝;插件会冷却 6 小时并说明原因(有 key 不受影响) |
144
144
  | `parallel` | Parallel | 免费 | **无 key 也可用**(官方 MCP 匿名额度),配 key 提升额度并支持精确时间过滤 |
145
+ | `brave` | Brave Search | 付费(有免费额度) | 需 `BRAVE_API_KEY`([API Dashboard](https://api-dashboard.search.brave.com),$5/月免费额度 ≈ 1,000 次,超出按 $5/1,000 次计费);独立索引,`freshness` 支持 pd/pw/pm/py 与日期区间 |
145
146
  | `you` | You.com | 免费 | **无 key 也可用**(官方免 key 档,每天 100 次),配 `YDC_API_KEY` 提升额度(旧名 `YOUCOM_API_KEY` 继续兼容) |
146
147
  | `agy` | Antigravity CLI | 免费 | 需本机安装 [Antigravity](https://antigravity.google) 并登录,插件通过 `agy -p` 调用;免 key、免额度,默认在引擎列表里,没装 CLI 时自动跳过 |
147
148
  | `perplexity` | Perplexity | 付费 | 需 `PERPLEXITY_API_KEY` |
@@ -151,7 +152,7 @@
151
152
  | `google` | Google 自定义搜索 | 免费额度 | 需 `GOOGLE_CSE_API_KEY` 和 Programmable Search Engine ID(`googleCseId` / cx);Google 官方 Custom Search JSON API,每天 100 次免费,按次计费超额;支持 `hl`、安全搜索和 `dateRestrict` 时间过滤 |
152
153
  | `metaso` | 秘塔搜索 | 付费(点数) | 需 `METASO_API_KEY`(metaso.cn/api);官方 AI 搜索 API,按点数计费(约 0.03 元/次,新用户有体验额度);支持网页 / 文库 / 学术三种 `scope`,返回摘要和来源;不在默认回退顺序里,配 key 后显式选用 |
153
154
  | `yandex` | Yandex 搜索 | 付费 | 需 `YANDEX_API_KEY` 和 `yandexFolderId`(AI Studio,按请求计费,需 billing account);官方 Search API,`searchType` 支持 RU/TR/COM/KK/BE/UZ,响应为 Base64 XML;支持 day / 2 weeks / month 时间过滤;显式专用 |
154
- | `yuanbao` | 腾讯元宝搜索 | 付费(有活动免费额度) | 需 `TENCENTCLOUD_WSA_APIKEY`(console.cloud.tencent.com/wsapi);API key 网关,支持自然 / 权威 / 混合模式、站点限定、时间范围;活动页可领每日免费额度(限时);显式专用 |
155
+ | `yuanbao` | 腾讯元宝搜索 | 付费(有活动免费额度) | 需 `TENCENTCLOUD_WSA_APIKEY`(console.cloud.tencent.com/wsapi);API key 网关,支持自然 / 权威 / 混合模式、站点限定、时间范围;活动页可领每日免费额度(限时);显式专用 |
155
156
  | `deepseek-official` | DeepSeek 官方 | 付费 | 需 `DEEPSEEK_API_KEY`;走 Anthropic 兼容的 `web_search` 服务端工具,每次搜索是一整个模型轮次(慢、耗 token) |
156
157
  | `deepseek-tools` | DeepSeek 原生搜索 API | 付费 | 需 `DEEPSEEK_API_KEY`(与上一档共用);直接 `POST /v1/tools/search`,无模型参与,返回结构化 `results[]`(`title`/`url`/`summary`/`date`),同 query 实测 ~0.3s vs 上一档 ~5-6s;端点可通过 `deepseekToolsBaseUrl` 改成自定义网关(完整 URL 或 base;走 `/v1/search` 的网关请填完整 URL),key 可用 `deepseekToolsApiKey` 单独覆盖 |
157
158
  | `baidu` | 百度千帆 AI 搜索 | 额度 | 需 `BAIDU_API_KEY`(千帆 AI 搜索:web_search 每日赠 50 次,额度用尽/403 时自动回退到 chat/completions,另有 100 次/天免费额度;超额按量后付费);中文全网,支持时间过滤 |
@@ -179,6 +180,7 @@
179
180
  - Tavily:<https://app.tavily.com/home>
180
181
  - Keenable:<https://keenable.ai/login>
181
182
  - Parallel:<https://platform.parallel.ai>
183
+ - Brave:<https://api-dashboard.search.brave.com>(API 文档:<https://api-dashboard.search.brave.com/app/documentation>)
182
184
  - Perplexity:<https://www.perplexity.ai/settings/api>
183
185
  - SerpBase:<https://serpbase.dev>
184
186
  - Serply:<https://serply.io>(API 文档:<https://serply.io/docs>)
@@ -195,7 +197,7 @@
195
197
  |---|---|---|
196
198
  | ① 无限免 key | `ddg` / `ddg-lite` / `bing` / `searxng` / `anysearch` | — |
197
199
  | ② 匿名额度(不配 key 也能跑) | `exa` / `tavily` / `keenable` / `firecrawl` / `parallel` / `you`(每天 100 次) | 配 key 提额 |
198
- | ③ 免费额度(需 key) | `zhihu_global` / `zhihu_site`(每日 5,000 次试用)、`doubao`(每月 500 次)、`baidu`(每日 50 次)、`aliyun`(新用户 200 次包) | 按量后付费 |
200
+ | ③ 免费额度(需 key) | `zhihu_global` / `zhihu_site`(每日 5,000 次试用)、`doubao`(每月 500 次)、`baidu`(每日 50 次)、`aliyun`(新用户 200 次包)、`brave`(每月 $5 额度 ≈ 1,000 次) | 按量后付费 |
199
201
  | ④ 付费升级(需 key 才有产出) | `serpbase`(注册送 100 次)/ `serply`(30 天 2,500 次)/ `outcrawl`(每月 1,000 credits)/ `perplexity` / `deepseek-official` / `deepseek-tools` / `kimi` | 按量 / 按次 |
200
202
  | ⑤ 按次计费(模型内置,显式-only) | `openai` / `gemini` / `claude` | 按 token + 每次搜索 |
201
203
 
@@ -212,7 +214,7 @@
212
214
 
213
215
  ### 安装
214
216
 
215
- 需要 **DSH 0.2.1-rc.2 或更新的 0.2.x**;更早的 0.1.x 宿主不满足 `engines.dsh`,插件管理器会拒绝安装。
217
+ 需要 **DSH 0.2.1-rc.2 到 0.3.x**(`engines.dsh` = `>=0.2.1-rc.2 <0.4.0-0`,顶层 `engines.dsh` 与 `dsh.engines.dsh` 同步声明,安装门禁与社区市场读同一范围);更早的 0.1.x 和 0.4 及以上宿主不满足该范围,插件管理器会拒绝安装。已实测:0.2.2-rc.1(DSH Desktop 2.0.22-next 内置版本)与 0.2.2-rc.3。
216
218
 
217
219
  ```sh
218
220
  git clone https://github.com/DDDMUC/dsh-free-search.git
@@ -380,7 +382,7 @@ DSH 0.2.1 设置 → 网页搜索 → **DeepSeek 搜索 API** 开关会和本插
380
382
 
381
383
  ```yaml
382
384
  # profiles/<profile>/cordis.patch.yml 中该条目的 config:
383
- provider: # 留空 = 自动(中国出口 bing,其它 parallel);也可写 ddg / bing / auto / multi 等
385
+ provider: # 留空 = 地区默认(不是 Auto 路由;中国出口 bing,其它 parallel);也可写 ddg / bing / auto / multi 等
384
386
  fallbackOn: [quota, auth, bot-wall, transient, invalid-response, unknown] # 允许触发回退的失败类别;[] = 任何失败都立即中止(默认全部)
385
387
  lang: zh # 搜索语言池/本地化(zh / en / ru …,不再被设置页强行改写)
386
388
  # lang 决定:Bing 的 mkt/Accept-Language、Wikipedia 子域(ja → ja.wikipedia.org)、地理编码语言;
@@ -434,8 +436,8 @@ metasoScope: webpage # webpage | document | scholar
434
436
  yandexApiKey: ... # Yandex Search API key (AI Studio)
435
437
  yandexFolderId: "..." # folder the key was created in
436
438
  yandexSearchType: auto # auto | ru | tr | com | kk | be | uz
437
- deepseekApiKey: ...
438
- deepseekToolsApiKey: ... # optional key for the custom endpoint
439
+ deepseekApiKey: ...
440
+ deepseekToolsApiKey: ... # optional key for the custom endpoint
439
441
  deepseekToolsBaseUrl: "" # custom /v1/tools/search endpoint or base; empty = api.deepseek.com
440
442
  ```
441
443
 
@@ -621,7 +623,7 @@ npx -y -p dsh-free-search dsh-free-search-mcp
621
623
 
622
624
  #### 离线自检断言(tools/)
623
625
 
624
- 仓库自带 **61 个**零依赖断言脚本(合计 **882 项**),**不需要 API key、不联网、不需要测试框架**,Node ≥ 20 即可跑。一次跑全部:`npm test`。
626
+ 仓库自带 **65 个**零依赖断言脚本(合计 **961 项**),**不需要 API key、不联网、不需要测试框架**,Node ≥ 20 即可跑。一次跑全部:`npm test`。
625
627
 
626
628
  | 脚本 | 覆盖 | 运行(项数) |
627
629
  |---|---|---|
@@ -632,8 +634,10 @@ npx -y -p dsh-free-search dsh-free-search-mcp
632
634
  | `assert-multi-policy.mjs` | multi 执行策略:并发上限是天花板 / 目标成功源非硬下限 / 凭据资格在上限之前分流 / **Fast·Balanced·Deep 档位** | `node tools/assert-multi-policy.mjs`(146) |
633
635
  | `assert-multi-limit.mjs` | multi 结果上限(#109):默认 20 / 硬上限 100 / 配置归一化、单次 maxResults 受上限约束、工具参数与本段提示词写明生效上限、设置页字段与保存 | `node tools/assert-multi-limit.mjs`(6) |
634
636
  | `assert-maintenance.mjs` | 维护面:CI 在 Node 20/22/24 跑全部断言并过打包闸门、发布脚本会 bump / 校验 / 打 tag / 可发布、恢复官方 provider 的桥接与设置页按钮 | `node tools/assert-maintenance.mjs`(4) |
635
- | `assert-engine-modules.mjs` | 引擎分层:实现文件存在且被 index 引用、引擎函数已迁出 index、设置页引擎 id 与服务端清单一致、清单覆盖 39 个引擎且免费/按次标记正确、index 不引用引擎私有名 | `node tools/assert-engine-modules.mjs`(6) |
637
+ | `assert-engine-modules.mjs` | 引擎分层:实现文件存在且被 index 引用、引擎函数已迁出 index、设置页引擎 id 与服务端清单一致、清单覆盖 40 个引擎且免费/按次标记正确、index 不引用引擎私有名 | `node tools/assert-engine-modules.mjs`(6) |
638
+ | `assert-brave.mjs` | Brave Search:catalog/凭据/设置接线、请求头与 count/freshness、错误分类、HTML 清洗、ISO 日期归一化、15s 超时 | `node tools/assert-brave.mjs`(54) |
636
639
  | `assert-bing-relevance.mjs` | Bing 相关性(#112):单字中文 token 被剔除、无关替代 SERP 被拒、真正相关的结果通过、只命中通用引擎名的整批被拒、单一 token 覆盖一半时放行、单字/纯数字查询的显式行为 | `node tools/assert-bing-relevance.mjs`(6) |
640
+ | `assert-relevance-pools.mjs` | 相关性守卫与语言池(#132/#133):AnySearch 无关批次判空、相关批次保留、shared.js 守卫被 anysearch/searxng/ddg/ddg-lite/degoog/keenable 使用、doctor 地区默认文案与语言池告警、缓存 key 随 zhPool/enPool 变化 | `node tools/assert-relevance-pools.mjs`(5) |
637
641
  | `assert-quality.mjs` | 研究证据闸门:8 源 / 3 域 / 3 正文 / 2 日期为 high,3 源 / 2 域 / 1 正文为 medium,单源与失败注记为 low,空包为 low,research 的 schema/输出/brief 接线 | `node tools/assert-quality.mjs`(6) |
638
642
  | `assert-dedupe.mjs` | 近重复去重:MinHash 同文本同签名、同 URL 去重、跨站转载去重、不同文章保留且顺序不变、阈值可调、provider 与 multi 两条路径接线 | `node tools/assert-dedupe.mjs`(6) |
639
643
  | `assert-intent-routing.mjs` | 意图路由:五类领域与 general 分类、偏好重排稳定、Auto 头部按领域、自定义回退顺序不被重排、时间过滤仍生效、接线 | `node tools/assert-intent-routing.mjs`(6) |
@@ -644,11 +648,11 @@ npx -y -p dsh-free-search dsh-free-search-mcp
644
648
  | `assert-research-call-wrappers.mjs` | research 四个 `call*` 包装层的替身/底层透传(#75 回归) | `node tools/assert-research-call-wrappers.mjs`(23) |
645
649
  | `assert-fetch-chain.mjs` | `fs-quality-fetch` 四层链序、任一层命中即停、exa 失败静默降级 firecrawl、全层失败聚合报错 | `node tools/assert-fetch-chain.mjs`(8) |
646
650
  | `assert-fetch-ssrf.mjs` | 抓取 SSRF 防护:公网/私网/保留地址判定、DNS 解析到私网拒绝、localhost 与 IP 字面量拒绝、非 HTTPS 与带凭据 URL 拒绝、fake-ip 网段默认拒绝且仅按配置放行、IPv6 ULA 显式放行、放行后仍拒绝回环/IPv4 私网/链路本地、provider 接线与设置项 | `node tools/assert-fetch-ssrf.mjs`(8) |
647
- | `assert-mcp.mjs` | MCP stdio 面:initialize 协议协商、tools/list 的 JSON Schema、tools/call 文本结果、工具错误与 JSON-RPC 错误区分、必填参数校验、bin/files 打包 | `node tools/assert-mcp.mjs`(6) |
648
- | `assert-mcp.mjs` | MCP stdio surface: initialize negotiation, tools/list JSON Schema, tools/call text results, tool errors vs JSON-RPC errors, required arguments, bin/files packaging | `node tools/assert-mcp.mjs` (6) |
649
- | `assert-baidu.mjs` | 百度千帆:key 必填、web_search 首请求、403 或 results.code 额度错误回退 chat/completions(stream:false)、401 不回退、双端失败合并报错 | `node tools/assert-baidu.mjs`(6) |
650
- | `assert-deepseek-endpoint.mjs` | DeepSeek 搜索端点:默认地址、base/完整 URL 归一、自定义 endpoint 收 Bearer/key/query、配置与设置页接线 | `node tools/assert-deepseek-endpoint.mjs`(4) |
651
- | `assert-yuanbao.mjs` |key 必填、Bearer 网关/Query/Mode/Site/FromTime、自然与 VR 页面解析、日期归一、错误分类、注册与显式专用 | `node tools/assert-yuanbao.mjs`(6) |
651
+ | `assert-mcp.mjs` | MCP stdio 面:initialize 协议协商、tools/list 的 JSON Schema、tools/call 文本结果、工具错误与 JSON-RPC 错误区分、必填参数校验、bin/files 打包 | `node tools/assert-mcp.mjs`(6) |
652
+ | `assert-mcp.mjs` | MCP stdio surface: initialize negotiation, tools/list JSON Schema, tools/call text results, tool errors vs JSON-RPC errors, required arguments, bin/files packaging | `node tools/assert-mcp.mjs` (6) |
653
+ | `assert-baidu.mjs` | 百度千帆:key 必填、web_search 首请求、403 或 results.code 额度错误回退 chat/completions(stream:false)、401 不回退、双端失败合并报错 | `node tools/assert-baidu.mjs`(6) |
654
+ | `assert-deepseek-endpoint.mjs` | DeepSeek 搜索端点:默认地址、base/完整 URL 归一、自定义 endpoint 收 Bearer/key/query、配置与设置页接线 | `node tools/assert-deepseek-endpoint.mjs`(4) |
655
+ | `assert-yuanbao.mjs` |key 必填、Bearer 网关/Query/Mode/Site/FromTime、自然与 VR 页面解析、日期归一、错误分类、注册与显式专用 | `node tools/assert-yuanbao.mjs`(6) |
652
656
  | `assert-yandex.mjs` | Yandex Search:key+folder 必填、Api-Key/请求体/分组、searchType 与 period/family 映射、Base64 XML 解析与日期、错误分类、注册与显式专用 | `node tools/assert-yandex.mjs`(6) |
653
657
  | `assert-metaso.mjs` | 秘塔搜索:key 必填、请求体(q/scope/size/summary/raw/concise)、摘要与日期映射、文库数组、size 上限、无效 scope 回退、401/402/429/400 错误分类、注册与默认回退排除 | `node tools/assert-metaso.mjs`(6) |
654
658
  | `assert-google-cse.mjs` | Google Custom Search:key+ID 必填、请求参数(q/num/start/hl/safe/dateRestrict)、结果映射与发布日期、超过 10 条分页、403/429/400 错误分类、时间档映射、全链路注册 | `node tools/assert-google-cse.mjs`(6) |
@@ -670,12 +674,14 @@ npx -y -p dsh-free-search dsh-free-search-mcp
670
674
  | `assert-rail-section.mjs` | 页内目录的机器可读当前段:卡片根 `data-dsh-fs-section` 与 `railActive` 绑定、六段 id 固定、滚动监听仍在更新 | `node tools/assert-rail-section.mjs`(4) |
671
675
  | `assert-package-files.mjs` | 发布清单闸门(#97):`files` 展开后必须覆盖被引用的本地模块、入口点与 `cordis.patch.yml`,并确认 `prepack` 守卫生效 | `node tools/assert-package-files.mjs`(4) |
672
676
  | `assert-key-rotation.mjs` | 多 key 轮换(#96):round-robin 与 peek、单 key 不推进、配额优先于 429 的分类、轮换候选集合、`multi` 模式内重试与预检不消耗 key | `node tools/assert-key-rotation.mjs`(7) |
677
+ | `assert-fetch-key-rotation.mjs` | `web_fetch` 云端抓取(#128):配额失败冻结当前 key 并用下一把重试、非轮换错误不换 key、无 key 不发请求、真实 provider 的 exa 402 重试、Linux 浏览器路径可发现 | `node tools/assert-fetch-key-rotation.mjs`(6) |
673
678
  | `assert-x-platform.mjs` | X (Twitter) 平台(Grok Build CLI):可用性、提示词约束、structuredOutput/text/原始 JSON 解析、status 链接过滤与截断、双语文案与面板默认值 | `node tools/assert-x-platform.mjs`(8) |
674
679
  | `assert-cooldown.mjs` | 冷却:Retry-After / reset 时间提示优先、失败类档次(session / 短冷却 / 额度 / 月度 / 地区)、key 指纹稳定且互不相同、store 冷却 / 剩余 / 清除、有限冷却落盘重启后仍在而 session 不落盘、按 key 与按引擎互不干扰 | `node tools/assert-cooldown.mjs`(6) |
675
680
  | `assert-redact.mjs` | 错误脱敏:已登记 key 全量替换、`sk-` / Bearer / api_key / x-api-key 形态无需登记也能打码、普通文本与短值不动、环境变量按名称收集 | `node tools/assert-redact.mjs`(4) |
676
- | `assert-doctor.mjs` | 诊断报告:时长格式化、头部版本 / Node / DSH 主目录 / 生效默认 / 提示词字数、每个引擎的标记与原因、冷却原因去重列出、提示词未注入的提示 | `node tools/assert-doctor.mjs`(5) |
681
+ | `assert-doctor.mjs` | 诊断报告:时长格式化、头部版本 / Node / DSH 主目录 / 生效默认 / 提示词字数、每个引擎的标记与原因、冷却原因去重列出、提示词未注入的提示、非 Auto 语言池告警 | `node tools/assert-doctor.mjs`(7) |
677
682
  | `assert-agy.mjs` | Antigravity CLI:提示词查询 / 条数 / JSON 契约、structuredOutput 与 response 两种信封、非 SUCCESS 透出上游原因、URL 过滤与截断、CLI 参数、注入 runner 跳过 PATH 检查 | `node tools/assert-agy.mjs`(6) |
678
683
  | `assert-allowed-engines.mjs` | 引擎白名单(#106):条目归一化、空名单保持原状、非空时禁用其余全部(含未来新增)、显式禁用优先、错拼不锁死搜索、白名单内引擎可入链(HTML 家族 / 按次计费)、auto 只路由白名单、内置提示词只列白名单且回退为 none、schema 默认空 | `node tools/assert-allowed-engines.mjs`(9) |
684
+ | `assert-host-compat.mjs` | 宿主兼容声明(0.9.51):顶层 `engines.dsh` 与 `dsh.engines.dsh` 一致、覆盖 0.2.1-rc.2~0.3.x 并拒绝 0.1.x/0.4+、每个 `@deepseek-ai/dsh*` peer 与主范围无冲突、市场的交集判定与安装门禁一致、`dshReleases` 列出实测版本、客户端版本跟随 package.json | `node tools/assert-host-compat.mjs`(8) |
679
685
  | `assert-updater.mjs` | 自带更新:版本比较、registry 探测(成功 / 非 200 / 网络失败返回 null)、安装模式识别(真实安装优先于 link)、客户端按钮与桥接、服务端两条路由与 pnpm 升级命令、卡片版本跟 package.json 一致 | `node tools/assert-updater.mjs`(9) |
680
686
  | `assert-inject.mjs` | 旧版 Cordis 兼容(#107):静态 inject 声明 web / settings / tools / systemPrompt、可选服务只走 `ctx.get`、回调上下文的属性读取都在 inject 里、动态依赖列表没有未知服务 | `node tools/assert-inject.mjs`(4) |
681
687
  | `assert-safe-text.mjs` | UTF-16 截断安全(#108):孤立高低代理清理、有效代理对保留、码点截断不切开 emoji、`cleanSnippet` 300 边界落在整字符、结果/来源/错误脱敏、web_fetch 各层正文兜底、源码守卫 | `node tools/assert-safe-text.mjs`(9) |
@@ -737,7 +743,7 @@ This plugin solves exactly that: multiple free engines plus automatic fallback,
737
743
  #### Engines and switching
738
744
 
739
745
  - **Zero Cost** — Multiple free engines with no API key or registration required
740
- - **39 engines available** — DuckDuckGo (HTML / Lite), Bing, AnySearch AI, SearXNG (meta-search with custom instances), Exa, Tavily, Keenable, Firecrawl, Parallel, Perplexity, SerpBase, Serply, Outcrawl, Google Programmable Search (`google`, needs an API key plus a CSE ID), Metaso (秘塔搜索, official API, billed per call), Yandex Search (official API, billed per request, folder ID required), Tencent Yuanbao Search (API-key gateway with a limited free-quota activity), DeepSeek Official, DeepSeek Native Search API, You.com, Baidu Qianfan, Kimi, Aliyun Bailian, Volcano Doubao, Zhihu web-wide/site search (`zhihu_global`/`zhihu_site`, via the Zhihu open-platform MCP), Antigravity CLI search (`agy`, requires the local CLI), and the model-based OpenAI / Gemini / Claude searches. The default auto-fallback chain covers 28 of them; the 5 HTML SERP engines stay out by default and the per-call billed OpenAI / Gemini / Claude engines, Metaso, Yandex and Yuanbao run only when explicitly named.
746
+ - **40 engines available** — DuckDuckGo (HTML / Lite), Bing, AnySearch AI, SearXNG (meta-search with custom instances), Exa, Tavily, Keenable, Firecrawl, Parallel, Brave (`brave`, official Search API, needs `BRAVE_API_KEY`), Perplexity, SerpBase, Serply, Outcrawl, Google Programmable Search (`google`, needs an API key plus a CSE ID), Metaso (秘塔搜索, official API, billed per call), Yandex Search (official API, billed per request, folder ID required), Tencent Yuanbao Search (API-key gateway with a limited free-quota activity), DeepSeek Official, DeepSeek Native Search API, You.com, Baidu Qianfan, Kimi, Aliyun Bailian, Volcano Doubao, Zhihu web-wide/site search (`zhihu_global`/`zhihu_site`, via the Zhihu open-platform MCP), Antigravity CLI search (`agy`, requires the local CLI), and the model-based OpenAI / Gemini / Claude searches. The default auto-fallback chain covers 29 of them; the 5 HTML SERP engines stay out by default and the per-call billed OpenAI / Gemini / Claude engines, Metaso, Yandex and Yuanbao run only when explicitly named.
741
747
  - **5 HTML SERP engines (off by default)** — Traditional result pages join the same engine / fallback / cooldown / settings machinery: `baidu-html` (Baidu web), `so360`, `sogou`, `wechat` (WeChat articles) and `toutiao`. No key, no quota — the trade-off is scraping: captcha/anti-bot pages are classified as `bot-wall` and cool the whole family down for 10 minutes (the egress IP gets flagged as a whole), and results carry no API snippets. They never join auto routing, the fallback chain or the language pools; they only run when named via `engine=` or added to a pool.
742
748
  - **Engine whitelist** — turn on Use only the checked engines and only those engines stay usable; engines added by later versions stay off. It maps to `allowedEngines` in the config (a non-empty list is equivalent to disabling every other engine).
743
749
  - **Global engine enable/disable & fallback priority** — uncheck engines you never want (applies everywhere: web_search fallback, Auto routing, advanced_search, multi_search, engine tests) and reorder the global fallback chain with ↑↓ (one-click reset).
@@ -846,6 +852,7 @@ If this plugin has been helpful, a ⭐ on [GitHub](https://github.com/DDDMUC/dsh
846
852
  | `keenable` | Keenable | Free | **Usable without a key** (anonymous MCP); configure a key for higher quota |
847
853
  | `firecrawl` | Firecrawl | Free | **Usable without a key** (official keyless anonymous quota); a key adds higher limits. Note: the keyless tier is judged by **egress IP** — VPN/proxy egress gets a 403, in which case the plugin cools it down for 6 hours and says why (a key is unaffected) |
848
854
  | `parallel` | Parallel | Free | **Works without a key** (official MCP anonymous quota); a key raises limits and enables precise time filtering |
855
+ | `brave` | Brave Search | Paid (free allowance) | Requires `BRAVE_API_KEY` ([API Dashboard](https://api-dashboard.search.brave.com); $5/month free credit ≈ 1,000 queries, then $5 per 1,000); independent index, `freshness` supports pd/pw/pm/py and date ranges |
849
856
  | `you` | You.com | Free | **Works without a key** (official keyless tier, 100 searches a day); set `YDC_API_KEY` for higher limits (the old `YOUCOM_API_KEY` name still works) |
850
857
  | `agy` | Antigravity CLI | Free | Requires the [Antigravity](https://antigravity.google) CLI installed and signed in; invoked as `agy -p`, no key and no quota, enabled by default and skipped automatically when the CLI is absent |
851
858
  | `perplexity` | Perplexity | Paid | Requires `PERPLEXITY_API_KEY` |
@@ -855,7 +862,7 @@ If this plugin has been helpful, a ⭐ on [GitHub](https://github.com/DDDMUC/dsh
855
862
  | `google` | Google Programmable Search | Free quota | Requires `GOOGLE_CSE_API_KEY` and a Programmable Search Engine ID (`googleCseId` / cx); official Custom Search JSON API, 100 free queries/day then billed; supports `hl`, safe search and `dateRestrict` time filtering |
856
863
  | `metaso` | Metaso (秘塔搜索) | Paid (credits) | Requires `METASO_API_KEY` (metaso.cn/api); official AI search API billed per call (about ¥0.03/query, trial credits for new accounts); supports webpage / document / scholar scopes and returns summaries with sources; not in the default fallback order, use it explicitly after configuring a key |
857
864
  | `yandex` | Yandex Search | Paid | Requires `YANDEX_API_KEY` and `yandexFolderId` (AI Studio; billed per request to a billing account); official Search API with RU/TR/COM/KK/BE/UZ search types and Base64 XML responses; supports day / 2 weeks / month time filters; explicit-only |
858
- | `yuanbao` | Tencent Yuanbao Search | Paid (limited free-quota activity) | Requires `TENCENTCLOUD_WSA_APIKEY` (console.cloud.tencent.com/wsapi); API-key gateway with natural / authoritative / hybrid modes, site restriction and time ranges; the activity page offers a limited daily free quota; explicit-only |
865
+ | `yuanbao` | Tencent Yuanbao Search | Paid (limited free-quota activity) | Requires `TENCENTCLOUD_WSA_APIKEY` (console.cloud.tencent.com/wsapi); API-key gateway with natural / authoritative / hybrid modes, site restriction and time ranges; the activity page offers a limited daily free quota; explicit-only |
859
866
  | `deepseek-official` | DeepSeek Official | Paid | Requires `DEEPSEEK_API_KEY`; uses the Anthropic-compatible `web_search` server tool, so every search is a full model turn (slow, token-billed) |
860
867
  | `deepseek-tools` | DeepSeek Native Search API | Paid | Requires `DEEPSEEK_API_KEY` (shared with the row above); calls `POST /v1/tools/search` directly, no model involved, returns structured `results[]` (`title`/`url`/`summary`/`date`) — measured ~0.3s vs ~5-6s for the row above; the endpoint is configurable via `deepseekToolsBaseUrl` (full URL or base; use the full URL for a gateway exposing `/v1/search`) and the key can be overridden with `deepseekToolsApiKey` for custom gateways |
861
868
  | `baidu` | Baidu Qianfan AI Search | Quota | Requires `BAIDU_API_KEY` (Qianfan AI Search: 50 free web_search calls/day; when that quota is exhausted or returns 403 it falls back to chat/completions, which has a separate 100/day free quota; pay-as-you-go beyond); Chinese web-wide, supports time filtering |
@@ -883,6 +890,7 @@ If this plugin has been helpful, a ⭐ on [GitHub](https://github.com/DDDMUC/dsh
883
890
  - Tavily: <https://app.tavily.com/home>
884
891
  - Keenable: <https://keenable.ai/login>
885
892
  - Parallel: <https://platform.parallel.ai>
893
+ - Brave: <https://api-dashboard.search.brave.com> (API docs: <https://api-dashboard.search.brave.com/app/documentation>)
886
894
  - Perplexity: <https://www.perplexity.ai/settings/api>
887
895
  - SerpBase: <https://serpbase.dev>
888
896
  - Serply: <https://serply.io> (API docs: <https://serply.io/docs>)
@@ -900,7 +908,7 @@ The free/paid binary is not what decides **who belongs in a default pool** — t
900
908
  |---|---|---|
901
909
  | ① Unlimited, no key | `ddg` / `ddg-lite` / `bing` / `searxng` / `anysearch` | — |
902
910
  | ② Anonymous quota (runs without a key) | `exa` / `tavily` / `keenable` / `firecrawl` / `parallel` / `you` (100/day) | key raises the quota |
903
- | ③ Free quota (key required) | `zhihu_global` / `zhihu_site` (5,000/day trial), `doubao` (500/month), `baidu` (50/day), `aliyun` (200-call starter pack) | pay-as-you-go |
911
+ | ③ Free quota (key required) | `zhihu_global` / `zhihu_site` (5,000/day trial), `doubao` (500/month), `baidu` (50/day), `aliyun` (200-call starter pack), `brave` ($5/month credit ≈ 1,000 queries) | pay-as-you-go |
904
912
  | ④ Paid upgrade (needs a key to return anything) | `serpbase` (100 free on signup) / `serply` (2,500 for 30 days) / `outcrawl` (1,000 credits a month) / `perplexity` / `deepseek-official` / `deepseek-tools` / `kimi` | per call / per query |
905
913
  | ⑤ Per-call billing (model built-in, explicit-only) | `openai` / `gemini` / `claude` | per token + per search |
906
914
 
@@ -917,7 +925,7 @@ Rule of thumb for a default pool: **① as the floor + ③ as the workhorse**;
917
925
 
918
926
  ### Installation
919
927
 
920
- Requires **DSH 0.2.1-rc.2 or a newer 0.2.x**; older 0.1.x hosts do not satisfy `engines.dsh` and the plugin manager will refuse the install.
928
+ Requires **DSH 0.2.1-rc.2 through 0.3.x** (`engines.dsh` = `>=0.2.1-rc.2 <0.4.0-0`, declared at both the top-level `engines.dsh` and `dsh.engines.dsh` so the install gate and the community market read one range); older 0.1.x hosts and 0.4+ hosts do not satisfy it and the plugin manager refuses the install. Verified on 0.2.2-rc.1 (the runtime inside DSH Desktop 2.0.22-next) and 0.2.2-rc.3.
921
929
 
922
930
  ```sh
923
931
  git clone https://github.com/DDDMUC/dsh-free-search.git
@@ -1085,7 +1093,7 @@ The old `free-search:` section of `~/.dsh/settings.yaml` is **not** imported by
1085
1093
 
1086
1094
  ```yaml
1087
1095
  # config of that entry in profiles/<profile>/cordis.patch.yml:
1088
- provider: # empty = auto (bing on a mainland egress, parallel elsewhere); or ddg / bing / auto / multi
1096
+ provider: # empty = geo default (NOT Auto routing; bing on a mainland egress, parallel elsewhere); or ddg / bing / auto / multi
1089
1097
  fallbackOn: [quota, auth, bot-wall, transient, invalid-response, unknown] # failure classes allowed to trigger fallback; [] = abort on any failure (default: all)
1090
1098
  lang: zh # search language pools / localization (zh / en / ru …; no longer rewritten by the settings page)
1091
1099
  # lang drives Bing's mkt/Accept-Language, the Wikipedia subdomain (ja → ja.wikipedia.org) and the geocoding language;
@@ -1139,8 +1147,8 @@ metasoScope: webpage # webpage | document | scholar
1139
1147
  yandexApiKey: ... # Yandex Search API key (AI Studio)
1140
1148
  yandexFolderId: "..." # folder the key was created in
1141
1149
  yandexSearchType: auto # auto | ru | tr | com | kk | be | uz
1142
- deepseekApiKey: ...
1143
- deepseekToolsApiKey: ... # optional key for the custom endpoint
1150
+ deepseekApiKey: ...
1151
+ deepseekToolsApiKey: ... # optional key for the custom endpoint
1144
1152
  deepseekToolsBaseUrl: "" # custom /v1/tools/search endpoint or base; empty = api.deepseek.com
1145
1153
  ```
1146
1154
 
@@ -1326,7 +1334,7 @@ Restart `dsh web` after switching to apply changes.
1326
1334
 
1327
1335
  #### Offline self-check assertions (`tools/`)
1328
1336
 
1329
- **Sixty-one** zero-dependency assertion scripts ship with the repo (**882 assertions** total): **no API keys, no network, no test framework**, Node ≥ 20. Run everything with `npm test`.
1337
+ **Sixty-five** zero-dependency assertion scripts ship with the repo (**961 assertions** total): **no API keys, no network, no test framework**, Node ≥ 20. Run everything with `npm test`.
1330
1338
 
1331
1339
  | Script | Covers | Run (count) |
1332
1340
  |---|---|---|
@@ -1337,8 +1345,10 @@ Restart `dsh web` after switching to apply changes.
1337
1345
  | `assert-multi-policy.mjs` | multi execution policy: ceiling semantics / target-is-not-a-hard-minimum / credential eligibility before the ceiling / **Fast·Balanced·Deep presets** | `node tools/assert-multi-policy.mjs` (146) |
1338
1346
  | `assert-multi-limit.mjs` | Multi result ceiling (#109): default 20 / hard max 100 / config normalisation, per-call maxResults clamped to the ceiling, tool copy and prompt state name the effective limit, settings field and save path | `node tools/assert-multi-limit.mjs` (6) |
1339
1347
  | `assert-maintenance.mjs` | Maintenance surface: CI runs every assertion on Node 20/22/24 plus the packaging gate, the release script bumps / verifies / tags / can publish, and the restore-official-provider bridge and settings button are wired | `node tools/assert-maintenance.mjs` (4) |
1340
- | `assert-engine-modules.mjs` | Engine layout: module files exist and are imported, implementations have left index.js, the client engine ids match the server catalog, the catalog covers 39 engines with the right free/explicit flags, and index never reads an engine-private name | `node tools/assert-engine-modules.mjs` (6) |
1348
+ | `assert-engine-modules.mjs` | Engine layout: module files exist and are imported, implementations have left index.js, the client engine ids match the server catalog, the catalog covers 40 engines with the right free/explicit flags, and index never reads an engine-private name | `node tools/assert-engine-modules.mjs` (6) |
1349
+ | `assert-brave.mjs` | Brave Search: catalog / credential / settings wiring, request headers and count/freshness, error classification, HTML stripping, ISO date normalization, and the 15s budget | `node tools/assert-brave.mjs` (54) |
1341
1350
  | `assert-bing-relevance.mjs` | Bing relevance (#112): single-character CJK tokens removed, an unrelated substituted SERP rejected, genuinely relevant results accepted, a batch matching only a generic engine name rejected, one distinctive token covering half the query accepted, and explicit single-character/numeric behaviour | `node tools/assert-bing-relevance.mjs` (6) |
1351
+ | `assert-relevance-pools.mjs` | Relevance guard and language pools (#132/#133): AnySearch drops an unrelated batch but keeps a matching one, the shared guard is used by anysearch/searxng/ddg/ddg-lite/degoog/keenable, doctor reports the geo default and warns about unused pools, and the cache key changes with zhPool/enPool | `node tools/assert-relevance-pools.mjs` (5) |
1342
1352
  | `assert-quality.mjs` | Research evidence gate: 8 sources / 3 domains / 3 bodies / 2 dates is high, 3 / 2 / 1 is medium, a single source or a degraded note is low, an empty package is low, and research wires the gate into schema, output and brief | `node tools/assert-quality.mjs` (6) |
1343
1353
  | `assert-dedupe.mjs` | Near-duplicate removal: identical text shares a MinHash signature, exact URLs and cross-site copies are dropped, different articles survive in order, the threshold is configurable, and both the provider and multi paths run it | `node tools/assert-dedupe.mjs` (6) |
1344
1354
  | `assert-intent-routing.mjs` | Intent routing: the five domains plus general, stable preference reordering, Auto head follows the domain, a custom fallback order is never reordered, time filtering still applies, and the wiring | `node tools/assert-intent-routing.mjs` (6) |
@@ -1349,9 +1359,9 @@ Restart `dsh web` after switching to apply changes.
1349
1359
  | `assert-research-call-wrappers.mjs` | the four research `call*` wrappers proxy to stubs / the real layer (#75 regression) | `node tools/assert-research-call-wrappers.mjs` (23) |
1350
1360
  | `assert-fetch-chain.mjs` | `fs-quality-fetch` tier ordering, stop-on-first-success, silent firecrawl degradation, aggregated all-tiers failure | `node tools/assert-fetch-chain.mjs` (8) |
1351
1361
  | `assert-fetch-ssrf.mjs` | Fetch SSRF guard: public/private/reserved address classification, DNS resolving to a private address rejected, localhost and IP literals rejected, non-HTTPS and credential URLs rejected, fake-ip ranges blocked by default and allowed only when configured, IPv6 ULA allowed only when listed, loopback/IPv4-private/link-local still blocked after opt-in, provider wiring and settings | `node tools/assert-fetch-ssrf.mjs` (8) |
1352
- | `assert-baidu.mjs` | Baidu Qianfan: key required, web_search first, 403 or results.code quota fallback to chat/completions (stream:false), no fallback on 401, combined error when both fail | `node tools/assert-baidu.mjs` (6) |
1353
- | `assert-deepseek-endpoint.mjs` | DeepSeek search endpoint: default URL, base/full-URL normalization, custom endpoint receives bearer/key/query, config and settings wiring | `node tools/assert-deepseek-endpoint.mjs` (4) |
1354
- | `assert-yuanbao.mjs` | key required, Bearer gateway and Query/Mode/Site/FromTime, natural and VR page parsing, date normalization, error classes, registration and explicit-only | `node tools/assert-yuanbao.mjs` (6) |
1362
+ | `assert-baidu.mjs` | Baidu Qianfan: key required, web_search first, 403 or results.code quota fallback to chat/completions (stream:false), no fallback on 401, combined error when both fail | `node tools/assert-baidu.mjs` (6) |
1363
+ | `assert-deepseek-endpoint.mjs` | DeepSeek search endpoint: default URL, base/full-URL normalization, custom endpoint receives bearer/key/query, config and settings wiring | `node tools/assert-deepseek-endpoint.mjs` (4) |
1364
+ | `assert-yuanbao.mjs` | key required, Bearer gateway and Query/Mode/Site/FromTime, natural and VR page parsing, date normalization, error classes, registration and explicit-only | `node tools/assert-yuanbao.mjs` (6) |
1355
1365
  | `assert-yandex.mjs` | Yandex Search: key + folder required, Api-Key/body/grouping, searchType and period/family mapping, Base64 XML parsing and dates, error classes, registration and explicit-only | `node tools/assert-yandex.mjs` (6) |
1356
1366
  | `assert-metaso.mjs` | Metaso search: key required, request body (q/scope/size/summary/raw/concise), summary and date mapping, document array, size clamp, invalid scope fallback, 401/402/429/400 error classes, registration and default-chain exclusion | `node tools/assert-metaso.mjs` (6) |
1357
1367
  | `assert-google-cse.mjs` | Google Custom Search: key + ID required, request params (q/num/start/hl/safe/dateRestrict), result mapping with dates, pagination past ten results, 403/429/400 classification, time-range mapping, full registration | `node tools/assert-google-cse.mjs` (6) |
@@ -1373,12 +1383,14 @@ Restart `dsh web` after switching to apply changes.
1373
1383
  | `assert-rail-section.mjs` | Machine-readable active section for the in-page rail: the card root's `data-dsh-fs-section` tracks `railActive`, the six section ids are fixed, and the scroll spy still updates it | `node tools/assert-rail-section.mjs` (4) |
1374
1384
  | `assert-package-files.mjs` | Packaging gate (#97): after expanding `files`, every imported local module, the entry points and `cordis.patch.yml` must be published, and the `prepack` guard must be wired | `node tools/assert-package-files.mjs` (4) |
1375
1385
  | `assert-key-rotation.mjs` | Multi-key rotation (#96): round-robin and peek, single keys never advancing, quota classification ahead of 429, the rotation-candidate set, and in-engine retries that keep multi-mode preflight from consuming keys | `node tools/assert-key-rotation.mjs` (7) |
1386
+ | `assert-fetch-key-rotation.mjs` | `web_fetch` cloud tiers (#128): a quota-failed key is cooled and the next key is tried, non-rotation errors do not consume another key, no key means no request, the real provider retries exa after a 402, and Linux browser paths | `node tools/assert-fetch-key-rotation.mjs` (6) |
1376
1387
  | `assert-x-platform.mjs` | X (Twitter) platform via the Grok Build CLI: availability, prompt guardrails, structuredOutput/text/raw JSON parsing, status-link filtering and caps, bilingual copy and panel defaults | `node tools/assert-x-platform.mjs` (8) |
1377
1388
  | `assert-cooldown.mjs` | Cooldowns: Retry-After / reset hints win, failure classes (session / short / quota / monthly / region), stable distinct key fingerprints, store cool/remaining/clear, finite cooldowns survive a restart while session ones do not, per-key and per-engine state stay separate | `node tools/assert-cooldown.mjs` (6) |
1378
1389
  | `assert-redact.mjs` | Error redaction: registered keys are scrubbed everywhere, `sk-` / Bearer / api_key / x-api-key shapes need no registration, ordinary text and short values are untouched, environment secrets are collected by name | `node tools/assert-redact.mjs` (4) |
1379
- | `assert-doctor.mjs` | Doctor report: duration formatting, version / Node / DSH home / effective default / prompt size header, a mark and reason per engine, cooldown reasons listed once, a warning when the prompt is not injected | `node tools/assert-doctor.mjs` (5) |
1390
+ | `assert-doctor.mjs` | Doctor report: duration formatting, version / Node / DSH home / effective default / prompt size header, a mark and reason per engine, cooldown reasons listed once, a warning when the prompt is not injected, and a warning when language pools are configured but cannot apply | `node tools/assert-doctor.mjs` (7) |
1380
1391
  | `assert-agy.mjs` | Antigravity CLI: query / cap / JSON contract in the prompt, structuredOutput and response envelopes, upstream reason on non-SUCCESS, URL filtering and truncation, CLI flags, injected runner skips the PATH check | `node tools/assert-agy.mjs` (6) |
1381
1392
  | `assert-allowed-engines.mjs` | Engine whitelist (#106): entries normalised, an empty list changes nothing, a non-empty list disables everything else (including future engines), explicit disables win, a typo does not brick search, whitelisted engines join the chain (HTML family / billed), Auto only routes allowed engines, the built-in prompt lists only them with a none fallback, and the schema defaults to empty | `node tools/assert-allowed-engines.mjs` (9) |
1393
+ | `assert-host-compat.mjs` | Host compatibility declarations (0.9.51): top-level `engines.dsh` matches `dsh.engines.dsh`, covers 0.2.1-rc.2 through 0.3.x and rejects 0.1.x/0.4+, every `@deepseek-ai/dsh*` peer agrees with that line, the market's intersection matches the install gate, `dshReleases` lists the verified hosts, and the client version follows package.json | `node tools/assert-host-compat.mjs` (8) |
1382
1394
  | `assert-updater.mjs` | Built-in updater: version comparison, registry probe (success / non-200 / network failure yields null), install-mode detection (a real install beats a link), the client button and bridge helper, both server routes with the pnpm upgrade command, and the card version matching package.json | `node tools/assert-updater.mjs` (9) |
1383
1395
  | `assert-inject.mjs` | Older Cordis compatibility (#107): the static inject list declares web / settings / tools / systemPrompt, optional services are read through `ctx.get`, every property read on a callback context is declared, and dynamic dependency lists contain no unknown services | `node tools/assert-inject.mjs` (4) |
1384
1396
  | `assert-safe-text.mjs` | UTF-16 truncation safety (#108): lone high/low surrogates replaced, valid pairs kept, code-point slicing never splits an emoji, `cleanSnippet`'s 300 boundary lands on a whole character, results/sources/errors sanitized, every web_fetch tier covered, plus source guards | `node tools/assert-safe-text.mjs` (9) |
package/lib/client.js CHANGED
@@ -354,7 +354,7 @@ window.__ModuleLoader__.load({
354
354
  keyStorage: "Key 存储位置",
355
355
  keyStorageCred: "凭据中心(推荐)",
356
356
  keyStorageSettings: "设置页(兼容)",
357
- keyStorageCredHint: (c) => `保存后写入 ~/.dsh/.credentials.yaml(最高优先级)。当前已配置:${["anysearch", "exa", "tavily", "keenable", "firecrawl", "parallel", "perplexity", "serpbase", "serply", "outcrawl", "deepseek", "youcom", "baidu", "kimi", "aliyun", "doubao", "openai", "gemini", "claude"].filter((k) => c[k]).map((k) => k.toUpperCase()).join(", ") || "无"}`,
357
+ keyStorageCredHint: (c) => `保存后写入 ~/.dsh/.credentials.yaml(最高优先级)。当前已配置:${["anysearch", "exa", "tavily", "keenable", "firecrawl", "parallel", "brave", "perplexity", "serpbase", "serply", "outcrawl", "deepseek", "youcom", "baidu", "kimi", "aliyun", "doubao", "openai", "gemini", "claude"].filter((k) => c[k]).map((k) => k.toUpperCase()).join(", ") || "无"}`,
358
358
  keyStorageSettingsHint: "保存后写入当前 profile 的插件条目 config(cordis.patch.yml,优先级低于凭据中心)。",
359
359
  engineEnable: "全局启用的搜索引擎",
360
360
  engineEnableHint: "取消勾选后,该引擎会从普通 web_search 回退链、Auto 智能路由、advanced_search、multi_search 和引擎测试中全局排除。至少保留一个引擎。",
@@ -369,6 +369,7 @@ window.__ModuleLoader__.load({
369
369
  zhPoolLabel: "中文查询池",
370
370
  enPoolLabel: "英文查询池",
371
371
  languagePoolHint: "Auto 路由的起始组与 Multi 模式的并发池:按查询语言二选一,Multi 并发池内全部引擎(不再是前 3 个)。每池最低 2 个引擎、无上限;禁用/冷却/缺 key 的引擎会自动跳过。",
372
+ languagePoolInactive: "当前引擎选择不是 Auto 或 Multi,语言池不会参与路由;要使用语言池请把搜索引擎切到 Auto 或 Multi。",
372
373
  poolAddFirst: "添加引擎…",
373
374
  poolRemove: "移除",
374
375
  poolReset: "恢复默认池",
@@ -556,7 +557,7 @@ window.__ModuleLoader__.load({
556
557
  keyStorage: "Key storage",
557
558
  keyStorageCred: "Credential center (recommended)",
558
559
  keyStorageSettings: "Settings page (legacy)",
559
- keyStorageCredHint: (c) => `Saved to ~/.dsh/.credentials.yaml (highest priority). Currently configured: ${["anysearch", "exa", "tavily", "keenable", "firecrawl", "parallel", "perplexity", "serpbase", "serply", "outcrawl", "deepseek", "youcom", "baidu", "kimi", "aliyun", "doubao", "openai", "gemini", "claude"].filter((k) => c[k]).map((k) => k.toUpperCase()).join(", ") || "none"}`,
560
+ keyStorageCredHint: (c) => `Saved to ~/.dsh/.credentials.yaml (highest priority). Currently configured: ${["anysearch", "exa", "tavily", "keenable", "firecrawl", "parallel", "brave", "perplexity", "serpbase", "serply", "outcrawl", "deepseek", "youcom", "baidu", "kimi", "aliyun", "doubao", "openai", "gemini", "claude"].filter((k) => c[k]).map((k) => k.toUpperCase()).join(", ") || "none"}`,
560
561
  keyStorageSettingsHint: "Saved to the active profile plugin entry config (cordis.patch.yml; lower priority than the credential center).",
561
562
  engineEnable: "Globally enabled search engines",
562
563
  engineEnableHint: "Unchecked engines are excluded globally from web_search fallback, Auto routing, advanced_search, multi_search, and engine tests. At least one engine must remain enabled.",
@@ -571,6 +572,7 @@ window.__ModuleLoader__.load({
571
572
  zhPoolLabel: "Chinese query pool",
572
573
  enPoolLabel: "English query pool",
573
574
  languagePoolHint: "The route head for Auto and the concurrent pool for Multi: picked by query language. Multi runs every engine in the pool (no longer top 3). Each pool keeps a minimum of 2 engines, no upper limit; disabled/cooling/keyless engines are skipped automatically.",
575
+ languagePoolInactive: "The current provider is not Auto or Multi, so the language pools are not used. Switch the search engine to Auto or Multi to use them.",
574
576
  poolAddFirst: "Add engine…",
575
577
  poolRemove: "Remove",
576
578
  poolReset: "Reset default pool",
@@ -733,7 +735,7 @@ window.__ModuleLoader__.load({
733
735
  "cache_search",
734
736
  "domain_search",
735
737
  ];
736
- const PLUGIN_VERSION = "0.9.50";
738
+ const PLUGIN_VERSION = "0.9.52";
737
739
  const PLUGIN_REPO_URL = "https://github.com/DDDMUC/dsh-free-search";
738
740
  // 右侧浮动目录(#85):条目顺序即页面顺序,anchor 是页面里对应 field 的 id。
739
741
  const NAV_ITEMS = [
@@ -777,6 +779,7 @@ window.__ModuleLoader__.load({
777
779
  { id: "keenable", label: "Keenable", badge: "FREE", link: "https://keenable.ai/login" },
778
780
  { id: "firecrawl", label: "Firecrawl", badge: "FREE", link: "https://www.firecrawl.dev" },
779
781
  { id: "parallel", label: "Parallel", badge: "FREE", link: "https://platform.parallel.ai" },
782
+ { id: "brave", label: "Brave Search", badge: "API KEY", link: "https://api-dashboard.search.brave.com" },
780
783
  { id: "perplexity", label: "Perplexity", badge: "API KEY", link: "https://www.perplexity.ai/settings/api" },
781
784
  { id: "serpbase", label: "SerpBase · Google", badge: "API KEY", link: "https://serpbase.dev" },
782
785
  { id: "serply", label: "Serply · Google", badge: "API KEY", link: "https://serply.io" },
@@ -814,7 +817,7 @@ window.__ModuleLoader__.load({
814
817
  const MODEL_ENGINES = ENGINES.filter(
815
818
  (engine) => EXPLICIT_ONLY_ENGINES.includes(engine.id) && !["metaso", "yandex", "yuanbao"].includes(engine.id)
816
819
  );
817
- const DEFAULT_FALLBACK_ORDER = ["exa", "tavily", "keenable", "firecrawl", "parallel", "perplexity", "serpbase", "serply", "outcrawl", "agy", "deepseek-tools", "deepseek-official", "you", "baidu", "kimi", "aliyun", "doubao", "tinyfish", "jina", "bing", "anysearch", "ddg", "ddg-lite", "searxng", "degoog", "zhihu_global", "zhihu_site"];
820
+ const DEFAULT_FALLBACK_ORDER = ["exa", "tavily", "keenable", "firecrawl", "parallel", "brave", "perplexity", "serpbase", "serply", "outcrawl", "agy", "deepseek-tools", "deepseek-official", "you", "baidu", "kimi", "aliyun", "doubao", "tinyfish", "jina", "bing", "anysearch", "ddg", "ddg-lite", "searxng", "degoog", "zhihu_global", "zhihu_site"];
818
821
  const normalizeFallbackOrder = (value) => {
819
822
  const configured = Array.isArray(value) ? value.filter((id) => ENGINE_IDS.includes(id)) : [];
820
823
  return [...new Set([...configured, ...DEFAULT_FALLBACK_ORDER, ...ENGINE_IDS.filter((id) => !EXPLICIT_ONLY_ENGINES.includes(id) && !SERP_ENGINE_IDS.includes(id))])].filter((id) => !EXPLICIT_ONLY_ENGINES.includes(id));
@@ -1069,6 +1072,7 @@ window.__ModuleLoader__.load({
1069
1072
  const [keenableKey, setKeenableKey] = react.useState("");
1070
1073
  const [firecrawlKey, setFirecrawlKey] = react.useState("");
1071
1074
  const [parallelKey, setParallelKey] = react.useState("");
1075
+ const [braveKey, setBraveKey] = react.useState("");
1072
1076
  const [perplexityKey, setPerplexityKey] = react.useState("");
1073
1077
  const [deepseekKey, setDeepseekKey] = react.useState("");
1074
1078
  const [serpbaseKey, setSerpbaseKey] = react.useState("");
@@ -1164,6 +1168,7 @@ window.__ModuleLoader__.load({
1164
1168
  keenable: [keenableKey, setKeenableKey],
1165
1169
  firecrawl: [firecrawlKey, setFirecrawlKey],
1166
1170
  parallel: [parallelKey, setParallelKey],
1171
+ brave: [braveKey, setBraveKey],
1167
1172
  perplexity: [perplexityKey, setPerplexityKey],
1168
1173
  "deepseek-official": [deepseekKey, setDeepseekKey],
1169
1174
  "deepseek-tools": [deepseekKey, setDeepseekKey],
@@ -1389,6 +1394,7 @@ window.__ModuleLoader__.load({
1389
1394
  setKeenableKey(v.keenableApiKey ?? "");
1390
1395
  setFirecrawlKey(v.firecrawlApiKey ?? "");
1391
1396
  setParallelKey(v.parallelApiKey ?? "");
1397
+ setBraveKey(v.braveApiKey ?? "");
1392
1398
  setPerplexityKey(v.perplexityApiKey ?? "");
1393
1399
  setDeepseekKey(v.deepseekApiKey ?? "");
1394
1400
  setSerpbaseKey(v.serpbaseApiKey ?? "");
@@ -1434,6 +1440,7 @@ window.__ModuleLoader__.load({
1434
1440
  if (path === "keenableApiKey") configured.keenable = true;
1435
1441
  if (path === "firecrawlApiKey") configured.firecrawl = true;
1436
1442
  if (path === "parallelApiKey") configured.parallel = true;
1443
+ if (path === "braveApiKey") configured.brave = true;
1437
1444
  if (path === "perplexityApiKey") configured.perplexity = true;
1438
1445
  if (path === "deepseekApiKey") configured.deepseek = true;
1439
1446
  if (path === "serpbaseApiKey") configured.serpbase = true;
@@ -1468,7 +1475,7 @@ window.__ModuleLoader__.load({
1468
1475
  const cred = await bridgeCredentialsStatus();
1469
1476
  if (cred.ok) {
1470
1477
  const cc = {};
1471
- const map = { anysearchApiKey: "anysearch", exaApiKey: "exa", tavilyApiKey: "tavily", keenableApiKey: "keenable", firecrawlApiKey: "firecrawl", parallelApiKey: "parallel", perplexityApiKey: "perplexity", deepseekApiKey: "deepseek", serpbaseApiKey: "serpbase", serplyApiKey: "serply", outcrawlApiKey: "outcrawl", youcomApiKey: "youcom", degoogApiKey: "degoog", googleCseApiKey: "google", metasoApiKey: "metaso", yandexApiKey: "yandex", yuanbaoApiKey: "yuanbao", deepseekToolsApiKey: "deepseek", baiduApiKey: "baidu", kimiApiKey: "kimi", aliyunApiKey: "aliyun", doubaoApiKey: "doubao", openaiApiKey: "openai", geminiApiKey: "gemini", claudeApiKey: "claude", zhihuApiKey: "zhihu", tinyfishApiKey: "tinyfish", jinaApiKey: "jina", searxngBearerToken: "searxng" };
1478
+ const map = { anysearchApiKey: "anysearch", exaApiKey: "exa", tavilyApiKey: "tavily", keenableApiKey: "keenable", firecrawlApiKey: "firecrawl", parallelApiKey: "parallel", braveApiKey: "brave", perplexityApiKey: "perplexity", deepseekApiKey: "deepseek", serpbaseApiKey: "serpbase", serplyApiKey: "serply", outcrawlApiKey: "outcrawl", youcomApiKey: "youcom", degoogApiKey: "degoog", googleCseApiKey: "google", metasoApiKey: "metaso", yandexApiKey: "yandex", yuanbaoApiKey: "yuanbao", deepseekToolsApiKey: "deepseek", baiduApiKey: "baidu", kimiApiKey: "kimi", aliyunApiKey: "aliyun", doubaoApiKey: "doubao", openaiApiKey: "openai", geminiApiKey: "gemini", claudeApiKey: "claude", zhihuApiKey: "zhihu", tinyfishApiKey: "tinyfish", jinaApiKey: "jina", searxngBearerToken: "searxng" };
1472
1479
  for (const [k, v] of Object.entries(cred.value.configured ?? {})) {
1473
1480
  if (map[k]) cc[map[k]] = v;
1474
1481
  }
@@ -1511,6 +1518,7 @@ window.__ModuleLoader__.load({
1511
1518
  ["keenableApiKey", keenableKey],
1512
1519
  ["firecrawlApiKey", firecrawlKey],
1513
1520
  ["parallelApiKey", parallelKey],
1521
+ ["braveApiKey", braveKey],
1514
1522
  ["perplexityApiKey", perplexityKey],
1515
1523
  ["deepseekApiKey", deepseekKey],
1516
1524
  ["deepseekToolsApiKey", deepseekToolsKey],
@@ -2475,6 +2483,9 @@ react_jsx_runtime.jsx("div", {
2475
2483
  }),
2476
2484
  renderPoolField("zh", t.zhPoolLabel, zhPool, setZhPool, DEFAULT_ZH_POOL, false),
2477
2485
  renderPoolField("en", t.enPoolLabel, enPool, setEnPool, DEFAULT_EN_POOL, true),
2486
+ provider !== "auto" && provider !== "multi" && (zhPool.join(",") !== DEFAULT_ZH_POOL.join(",") || enPool.join(",") !== DEFAULT_EN_POOL.join(","))
2487
+ ? react_jsx_runtime.jsx("p", { className: "dshfs-hint", children: t.languagePoolInactive })
2488
+ : null,
2478
2489
  react_jsx_runtime.jsx("div", {
2479
2490
  className: "dshfs-field",
2480
2491
  children: [
package/lib/doctor.js CHANGED
@@ -29,6 +29,7 @@ export function buildDoctorReport({
29
29
  promptLanguage = "en",
30
30
  promptChars = 0,
31
31
  promptInjected = true,
32
+ poolsConfigured = false,
32
33
  tools = { enabled: [], disabled: [] },
33
34
  toolsKnown = [],
34
35
  engines = [],
@@ -37,11 +38,15 @@ export function buildDoctorReport({
37
38
  const lines = [];
38
39
  lines.push(`dsh-free-search ${version}`);
39
40
  lines.push(`node ${nodeVersion}${dshHome ? ` · ${dshHome}` : ""}`);
41
+ const effectiveLabel = `geo default (${effectiveProvider || "?"})`;
40
42
  lines.push(
41
- `preferred: ${provider || "auto"}${provider ? "" : ` (resolves to ${effectiveProvider || "?"})`} · prompt ${promptLanguage}, ${promptChars} chars${promptInjected ? "" : ", not injected"}`
43
+ `preferred: ${provider || effectiveLabel} · prompt ${promptLanguage}, ${promptChars} chars${promptInjected ? "" : ", not injected"}`
42
44
  );
43
45
  lines.push(`providers: search=${searchProvider || "auto"} · fetch=${fetchProvider || "auto"}`);
44
46
  const warnings = [];
47
+ if (poolsConfigured && provider !== "auto" && provider !== "multi") {
48
+ warnings.push(`language pools are configured, but provider is ${provider || effectiveLabel}; zhPool/enPool only apply to auto or multi`);
49
+ }
45
50
  if (searchProvider && searchProvider !== "ddg" && searchProvider !== "deepseek-official") {
46
51
  warnings.push(`search is served by "${searchProvider}", not this plugin; search providers are mutually exclusive (the last takeover wins)`);
47
52
  }