dsh-free-search 0.9.42 → 0.9.44

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
- - **37 个引擎可选**:DuckDuckGo(html/lite)、Bing、SearXNG(元搜索,支持自定义实例)、AnySearch、Exa、Tavily、Keenable、Firecrawl、Parallel、Perplexity、SerpBase、Serply、Outcrawl、Google 自定义搜索(`google`,需 API key + CSE ID)、秘塔搜索(`metaso`,官方 API,按点数计费)、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 都只在显式点名时运行。
37
+ - **38 个引擎可选**: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)、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 都只在显式点名时运行。
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` / 引擎测试都不再用它),并可用 ↑↓ 调整全局回退顺序(一键恢复默认)。
@@ -150,9 +150,10 @@
150
150
  | `outcrawl` | Outcrawl | 付费 | 需 `OUTCRAWL_API_KEY`(outcrawl.ai,每月 1,000 credits 免费额度);网页搜索结果(标题/链接/摘要),单次最多 20 条 |
151
151
  | `google` | Google 自定义搜索 | 免费额度 | 需 `GOOGLE_CSE_API_KEY` 和 Programmable Search Engine ID(`googleCseId` / cx);Google 官方 Custom Search JSON API,每天 100 次免费,按次计费超额;支持 `hl`、安全搜索和 `dateRestrict` 时间过滤 |
152
152
  | `metaso` | 秘塔搜索 | 付费(点数) | 需 `METASO_API_KEY`(metaso.cn/api);官方 AI 搜索 API,按点数计费(约 0.03 元/次,新用户有体验额度);支持网页 / 文库 / 学术三种 `scope`,返回摘要和来源;不在默认回退顺序里,配 key 后显式选用 |
153
+ | `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 时间过滤;显式专用 |
153
154
  | `deepseek-official` | DeepSeek 官方 | 付费 | 需 `DEEPSEEK_API_KEY`;走 Anthropic 兼容的 `web_search` 服务端工具,每次搜索是一整个模型轮次(慢、耗 token) |
154
155
  | `deepseek-tools` | DeepSeek 原生搜索 API | 付费 | 需 `DEEPSEEK_API_KEY`(与上一档共用);直接 `POST /v1/tools/search`,无模型参与,返回结构化 `results[]`(`title`/`url`/`summary`/`date`),同 query 实测 ~0.3s vs 上一档 ~5-6s |
155
- | `baidu` | 百度千帆 AI 搜索 | 额度 | 需 `BAIDU_API_KEY`(千帆 AI 搜索,每日赠 50 次,超额按量后付费);中文全网,支持时间过滤 |
156
+ | `baidu` | 百度千帆 AI 搜索 | 额度 | 需 `BAIDU_API_KEY`(千帆 AI 搜索:web_search 每日赠 50 次,额度用尽/403 时自动回退到 chat/completions,另有 100 次/天免费额度;超额按量后付费);中文全网,支持时间过滤 |
156
157
  | `kimi` | Kimi(Moonshot)联网搜索 | 付费 | 需 `MOONSHOT_API_KEY`(basic 约 ¥0.01/次),返回带正文 chunks 的中文结果;**无免费额度**,适合显式选用或作质量升级池,不建议放进默认并发池 |
157
158
  | `kimi` | Kimi(Moonshot)联网搜索 | 付费 | 需 `MOONSHOT_API_KEY`(basic 约 ¥0.01/次),返回带正文 chunks 的中文结果 |
158
159
  | `aliyun` | 阿里云百炼 EnhancedSearch | 付费 | 需 `DASHSCOPE_API_KEY`(MCP search_pro,约 ¥0.03/次,新用户 200 次免费包);中文全网带来源 hostname |
@@ -227,7 +228,7 @@ dsh web
227
228
 
228
229
  插件加载后**自动接管搜索**:
229
230
 
230
- - `web.searchProvider` 未设置,或仍是 DSH 出厂默认的官方搜索 `deepseek-official` 时,自动切换为本插件的 provider(id 固定为 `ddg`);
231
+ - `web.searchProvider` 未设置,或仍是当前版本的官方搜索默认(0.2.2-rc.2 起是 `deepseek-search-api`,旧版是 `deepseek-official`)时,自动切换为本插件的 provider(id 固定为 `ddg`);
231
232
  - 如果(你或别的插件)已显式选择其他 provider,本插件不抢占,只在启动日志输出 WARN 与切换用的 YAML。
232
233
 
233
234
  **接管会写进 profile(DSH 0.2.x)**:从 `0.2.0-rc.2` 起 provider 选择存放在 config 的 volatile ref 里,只能经 `settings.mutate("web", …)` 写入,落盘结果就是 `profiles/<profile>/cordis.patch.yml` 多出:
@@ -254,8 +255,8 @@ DSH 0.2.1 设置 → 网页搜索 → **DeepSeek 搜索 API** 开关会和本插
254
255
  | 操作 | 结果 |
255
256
  |---|---|
256
257
  | 打开开关 | `web.searchProvider` 写成 `deepseek-search-api`(属于「显式选择其他 provider」),**本插件主动让路**,搜索走官方直连 API;抓取同时变成 `deepseek-fetch-api` |
257
- | 关闭开关 | DSH 会把整行 `- id: web` 删掉,provider 回到出厂默认 `deepseek-official` —— 这是**模型搜索**(一次完整 aux 请求,实测 ~12s、按 token 计费),不是免费引擎 |
258
- | 关闭后 | **0.9.8 起**:插件检测到 `deepseek-official` 会在运行时补一次接管(日志 `DSH's search switch put the web providers back to the official defaults — re-took …`),通常几秒内恢复免费链路;若没恢复,完整重启 DSH |
258
+ | 关闭开关 | DSH 会把整行 `- id: web` 删掉,provider 回到当前版本的官方默认:0.2.2-rc.2 起是 `deepseek-search-api`(按 Search API 计费),旧版是 `deepseek-official`(模型搜索,一次完整 aux 请求,按 token 计费);都不是免费引擎 |
259
+ | 关闭后 | **0.9.8 起**:插件检测到任一官方默认会在运行时补一次接管(日志 `DSH's search switch put the web providers back to the official defaults — re-took …`),通常几秒内恢复免费链路;若没恢复,完整重启 DSH |
259
260
 
260
261
  想换引擎请用 `/free-search-engine` 或本插件设置页,**不要动那个开关**。打开开关再关掉,官方直连会退回模型搜索,直到插件重新接管或重启。
261
262
 
@@ -280,7 +281,7 @@ DSH 0.2.1 设置 → 网页搜索 → **DeepSeek 搜索 API** 开关会和本插
280
281
  配置页提供:
281
282
 
282
283
  - **Search engine**:下拉框切换引擎,保存即生效
283
- - **API keys**:为 Exa / Tavily / Keenable / Firecrawl / Parallel / Perplexity / DeepSeek / SerpBase / Serply / Outcrawl / Google CSE / Metaso / You.com 填写 key(密码框,保存后只显示"已配置";Exa / Tavily / Keenable / Firecrawl / Parallel / You.com 不填也可免 key 使用)
284
+ - **API keys**:为 Exa / Tavily / Keenable / Firecrawl / Parallel / Perplexity / DeepSeek / SerpBase / Serply / Outcrawl / Google CSE / Metaso / Yandex / You.com 填写 key(密码框,保存后只显示"已配置";Exa / Tavily / Keenable / Firecrawl / Parallel / You.com 不填也可免 key 使用)
284
285
  - **推荐**:付费引擎 key 建议写入 harness 凭据中心 `~/.dsh/.credentials.yaml`(如 `DEEPSEEK_API_KEY: sk-...`,与官方 LLM provider 一致,一处管理所有 key)。插件读取优先级:凭据中心 > 设置页 > 环境变量,设置页填的 key 仅作为遗留兼容。
285
286
  - **Test engine**:直测当前引擎可用性(不走回退链,付费引擎无 key 会明确报错)
286
287
  - **Use Bing default**:把当前搜索引擎切回稳定的免费 Bing;`Discard` 只撤销尚未保存的编辑
@@ -368,7 +369,7 @@ DSH 0.2.1 设置 → 网页搜索 → **DeepSeek 搜索 API** 开关会和本插
368
369
 
369
370
  如果你**特意** pin 了 `fetchProvider: http`(只想要内置抓取),把 `fetchProviderTakeover` 设为 `false` 即可:本插件不再把 `http` 当成「出厂默认」去接管,但仍会在完全未设置时补上。
370
371
 
371
- `searchProvider` 的规则相同:未设置或仍是 `deepseek-official` 时接管,显式指定其它 provider 时不抢占。
372
+ `searchProvider` 的规则相同:未设置或仍是当前版本的官方默认(`deepseek-search-api` / `deepseek-official`)时接管,显式指定其它 provider 时不抢占。
372
373
 
373
374
  #### 配置文件
374
375
 
@@ -429,6 +430,9 @@ googleCseApiKey: ... # Google Custom Search API key
429
430
  googleCseId: "..." # Programmable Search Engine 的 cx
430
431
  metasoApiKey: ... # Metaso API key (metaso.cn/api)
431
432
  metasoScope: webpage # webpage | document | scholar
433
+ yandexApiKey: ... # Yandex Search API key (AI Studio)
434
+ yandexFolderId: "..." # folder the key was created in
435
+ yandexSearchType: auto # auto | ru | tr | com | kk | be | uz
432
436
  deepseekApiKey: ...
433
437
  ```
434
438
 
@@ -518,6 +522,30 @@ Search engine test:
518
522
  - 支持超时和大小限制
519
523
  - ⚠️ 注意:`web_fetch` 默认拒绝回环、私网、链路本地和云元数据地址。若使用 Clash / mihomo TUN 的 fake-ip DNS,请把对应网段(常见 `198.18.0.0/15`)加入设置页的「额外允许的网段」,否则所有被代理域名都会被判成私网而抓取失败;只放行 fake-ip 保留段,不要放行 RFC1918。
520
524
 
525
+ #### MCP server(stdio)
526
+
527
+ 同仓库带一个独立的 stdio MCP server,供 Claude Desktop、Cursor、Codex 等 MCP 客户端使用,不依赖 DSH 运行时:
528
+
529
+ ```bash
530
+ npx -y -p dsh-free-search dsh-free-search-mcp
531
+ ```
532
+
533
+ 第一版只暴露 `web_search`(Bing / DuckDuckGo,免 key)和 `web_fetch`(直连 / 浏览器 / Exa / Firecrawl);不暴露付费引擎、`research`、`multi_search`,也不监听端口。Claude Desktop 配置示例:
534
+
535
+ ```json
536
+ {
537
+ "mcpServers": {
538
+ "dsh-free-search": {
539
+ "command": "npx",
540
+ "args": ["-y", "-p", "dsh-free-search", "dsh-free-search-mcp"],
541
+ "env": { "MCP_LANG": "zh", "MCP_SEARCH_ENGINE": "auto" }
542
+ }
543
+ }
544
+ }
545
+ ```
546
+
547
+ 环境变量:`MCP_SEARCH_ENGINE`(auto / bing / ddg / ddg-lite)、`MCP_MAX_RESULTS`、`MCP_SAFE_SEARCH`、`MCP_LANG`、`MCP_BING_MARKET`、`MCP_BROWSER_FETCH`、`MCP_ALLOW_FAKE_IP_CIDRS`;抓取层可用 `EXA_API_KEY` / `FIRECRAWL_API_KEY`。
548
+
521
549
  #### 平台搜索(platform_search)
522
550
 
523
551
  让 agent 搜特定平台,如"在 GitHub 上搜 deepseek harness"、"看看 B站有什么相关视频"、"V2EX 上关于 dsh 的讨论"。`platform_search` 工具支持:
@@ -590,7 +618,7 @@ Search engine test:
590
618
 
591
619
  #### 离线自检断言(tools/)
592
620
 
593
- 仓库自带 **56 个**零依赖断言脚本(合计 **839 项**),**不需要 API key、不联网、不需要测试框架**,Node ≥ 20 即可跑。一次跑全部:`npm test`。
621
+ 仓库自带 **59 个**零依赖断言脚本(合计 **867 项**),**不需要 API key、不联网、不需要测试框架**,Node ≥ 20 即可跑。一次跑全部:`npm test`。
594
622
 
595
623
  | 脚本 | 覆盖 | 运行(项数) |
596
624
  |---|---|---|
@@ -601,7 +629,7 @@ Search engine test:
601
629
  | `assert-multi-policy.mjs` | multi 执行策略:并发上限是天花板 / 目标成功源非硬下限 / 凭据资格在上限之前分流 / **Fast·Balanced·Deep 档位** | `node tools/assert-multi-policy.mjs`(146) |
602
630
  | `assert-multi-limit.mjs` | multi 结果上限(#109):默认 20 / 硬上限 100 / 配置归一化、单次 maxResults 受上限约束、工具参数与本段提示词写明生效上限、设置页字段与保存 | `node tools/assert-multi-limit.mjs`(6) |
603
631
  | `assert-maintenance.mjs` | 维护面:CI 在 Node 20/22/24 跑全部断言并过打包闸门、发布脚本会 bump / 校验 / 打 tag / 可发布、恢复官方 provider 的桥接与设置页按钮 | `node tools/assert-maintenance.mjs`(4) |
604
- | `assert-engine-modules.mjs` | 引擎分层:实现文件存在且被 index 引用、引擎函数已迁出 index、设置页引擎 id 与服务端清单一致、清单覆盖 37 个引擎且免费/按次标记正确、index 不引用引擎私有名 | `node tools/assert-engine-modules.mjs`(6) |
632
+ | `assert-engine-modules.mjs` | 引擎分层:实现文件存在且被 index 引用、引擎函数已迁出 index、设置页引擎 id 与服务端清单一致、清单覆盖 38 个引擎且免费/按次标记正确、index 不引用引擎私有名 | `node tools/assert-engine-modules.mjs`(6) |
605
633
  | `assert-bing-relevance.mjs` | Bing 相关性(#112):单字中文 token 被剔除、无关替代 SERP 被拒、真正相关的结果通过、只命中通用引擎名的整批被拒、单一 token 覆盖一半时放行、单字/纯数字查询的显式行为 | `node tools/assert-bing-relevance.mjs`(6) |
606
634
  | `assert-quality.mjs` | 研究证据闸门:8 源 / 3 域 / 3 正文 / 2 日期为 high,3 源 / 2 域 / 1 正文为 medium,单源与失败注记为 low,空包为 low,research 的 schema/输出/brief 接线 | `node tools/assert-quality.mjs`(6) |
607
635
  | `assert-dedupe.mjs` | 近重复去重:MinHash 同文本同签名、同 URL 去重、跨站转载去重、不同文章保留且顺序不变、阈值可调、provider 与 multi 两条路径接线 | `node tools/assert-dedupe.mjs`(6) |
@@ -613,6 +641,10 @@ Search engine test:
613
641
  | `assert-research-call-wrappers.mjs` | research 四个 `call*` 包装层的替身/底层透传(#75 回归) | `node tools/assert-research-call-wrappers.mjs`(23) |
614
642
  | `assert-fetch-chain.mjs` | `fs-quality-fetch` 四层链序、任一层命中即停、exa 失败静默降级 firecrawl、全层失败聚合报错 | `node tools/assert-fetch-chain.mjs`(8) |
615
643
  | `assert-fetch-ssrf.mjs` | 抓取 SSRF 防护:公网/私网/保留地址判定、DNS 解析到私网拒绝、localhost 与 IP 字面量拒绝、非 HTTPS 与带凭据 URL 拒绝、fake-ip 网段默认拒绝且仅按配置放行、放行后仍拒绝回环/私网、provider 接线与设置项 | `node tools/assert-fetch-ssrf.mjs`(8) |
644
+ | `assert-mcp.mjs` | MCP stdio 面:initialize 协议协商、tools/list 的 JSON Schema、tools/call 文本结果、工具错误与 JSON-RPC 错误区分、必填参数校验、bin/files 打包 | `node tools/assert-mcp.mjs`(6) |
645
+ | `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) |
646
+ | `assert-baidu.mjs` | 百度千帆:key 必填、web_search 首请求、403 或 results.code 额度错误回退 chat/completions(stream:false)、401 不回退、双端失败合并报错 | `node tools/assert-baidu.mjs`(6) |
647
+ | `assert-yandex.mjs` | Yandex Search:key+folder 必填、Api-Key/请求体/分组、searchType 与 period/family 映射、Base64 XML 解析与日期、错误分类、注册与显式专用 | `node tools/assert-yandex.mjs`(6) |
616
648
  | `assert-metaso.mjs` | 秘塔搜索:key 必填、请求体(q/scope/size/summary/raw/concise)、摘要与日期映射、文库数组、size 上限、无效 scope 回退、401/402/429/400 错误分类、注册与默认回退排除 | `node tools/assert-metaso.mjs`(6) |
617
649
  | `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) |
618
650
  | `assert-engine-runtime.mjs` | 引擎运行时:按引擎并发上限(普通 2 / HTML SERP 1)、排队与 abort 清理、成功/空/失败/平均耗时统计、provider 与 runEngineTest 两条路径接线、诊断报告带 stats | `node tools/assert-engine-runtime.mjs`(4) |
@@ -647,8 +679,8 @@ Search engine test:
647
679
  | `assert-firecrawl-keyless.mjs` | Firecrawl keyless 出口判定:403 + VPN/proxy 文案才算拒绝、普通 403 与 401/429/500 不算、冷却初始未触发 | `node tools/assert-firecrawl-keyless.mjs`(5) |
648
680
  | `assert-fetch-charset.mjs` | 抓取编码(#88):`charset=gbk` / `gb2312` 按声明解码、无声明时嗅探 `<meta charset>` 与 http-equiv 形式、默认 UTF-8、未知 label 兜底 UTF-8 不抛错 | `node tools/assert-fetch-charset.mjs`(6) |
649
681
  | `assert-fetch-abort.mjs` | 抓取中断(#87):压缩响应中途断连必须 reject(不再永久 pending)、明文断连同样 reject、abort 能打断停滞的 gzip 流、complete 响应与重定向仍正常 | `node tools/assert-fetch-abort.mjs`(6) |
650
- | `assert-bridge-access.mjs` | 桥接 Host 围栏(#84):loopback 放行、remote peer 打 loopback Host 拒绝、`--trusted-host`(无端口匹配任意端口 / 带端口精确匹配)、`--public-url`、绑定地址、跨站与异源拒绝 | `node tools/assert-bridge-access.mjs`(11) |
651
- | `assert-provider-takeover.mjs` | provider 接管:旧属性 API 与 rc.2 的 `config.*` ref 两套兼容、`settings.mutate(web)` 单批写入、显式指定的 provider 不被抢占、`fetchProviderTakeover: false` 时保留显式 `http`、describe 噪声不误报、嵌套 config 变化与 web 重建分别成行、关闭 DSH 搜索开关后重新接管且不抢 `deepseek-search-api`、apply 重入/重复注册不再中断、重复日志去重 | `node tools/assert-provider-takeover.mjs`(16) |
682
+ | `assert-bridge-access.mjs` | 桥接 Host 围栏(#84):loopback 放行、remote peer 打 loopback Host 拒绝、`--trusted-host`(无端口匹配任意端口 / 带端口精确匹配)、`--public-url`、绑定地址、跨站与异源拒绝、connection 鉴权委托与 fail-closed | `node tools/assert-bridge-access.mjs`(13) |
683
+ | `assert-provider-takeover.mjs` | provider 接管:旧属性 API 与 rc.2 的 `config.*` ref 两套兼容、`settings.mutate(web)` 单批写入、显式指定的 provider 不被抢占、`fetchProviderTakeover: false` 时保留显式 `http`、describe 噪声不误报、嵌套 config 变化与 web 重建分别成行、关闭 DSH 搜索开关后重新接管(`deepseek-search-api` / `deepseek-official` 均视为官方默认)、打开 DeepSeek 开关(`deepseek-fetch-api`)时让路、apply 重入/重复注册不再中断、重复日志去重 | `node tools/assert-provider-takeover.mjs`(20) |
652
684
 
653
685
  任何一个失败会以非 0 退出码结束并列出失败项;把某个旧版本文件路径作为参数传进去,可以看到修复前必红(用来证明断言不是空转)。改动发布相关逻辑后建议先跑一遍再发版。
654
686
 
@@ -700,7 +732,7 @@ This plugin solves exactly that: multiple free engines plus automatic fallback,
700
732
  #### Engines and switching
701
733
 
702
734
  - **Zero Cost** — Multiple free engines with no API key or registration required
703
- - **37 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), 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 and Metaso run only when explicitly named.
735
+ - **38 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), 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 and Yandex run only when explicitly named.
704
736
  - **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.
705
737
  - **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).
706
738
  - **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).
@@ -817,9 +849,10 @@ If this plugin has been helpful, a ⭐ on [GitHub](https://github.com/DDDMUC/dsh
817
849
  | `outcrawl` | Outcrawl | Paid | Requires `OUTCRAWL_API_KEY` (outcrawl.ai, free tier of 1,000 credits a month); web results with title, URL and snippet, up to 20 per search |
818
850
  | `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 |
819
851
  | `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 |
852
+ | `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 |
820
853
  | `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) |
821
854
  | `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 on the same query |
822
- | `baidu` | Baidu Qianfan AI Search | Quota | Requires `BAIDU_API_KEY` (Qianfan AI Search, 50 free calls/day then pay-as-you-go); Chinese web-wide, supports time filtering |
855
+ | `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 |
823
856
  | `kimi` | Kimi (Moonshot) Web Search | Paid | Requires `MOONSHOT_API_KEY` (basic ~¥0.01/call); returns Chinese results with body chunks; **no free quota**, so prefer explicit selection or the escalation pool over the default concurrent pool |
824
857
  | `kimi` | Kimi (Moonshot) Web Search | Paid | Requires `MOONSHOT_API_KEY` (basic ~¥0.01/call); returns Chinese results with body chunks |
825
858
  | `aliyun` | Aliyun Bailian EnhancedSearch | Paid | Requires `DASHSCOPE_API_KEY` (MCP search_pro, ~¥0.03/call, 200 free calls for new users); Chinese web-wide with source hostnames |
@@ -895,7 +928,7 @@ dsh web
895
928
 
896
929
  The plugin **takes over search** once loaded:
897
930
 
898
- - When `web.searchProvider` is unset, or still the shipped default `deepseek-official`, it switches to this plugin's provider (id: `ddg`);
931
+ - When `web.searchProvider` is unset, or still the shipped default for the running DSH (`deepseek-search-api` since 0.2.2-rc.2, `deepseek-official` on older hosts), it switches to this plugin's provider (id: `ddg`);
899
932
  - If you (or another plugin) explicitly selected a different provider, it does not steal it — it only logs a WARN with a copy-pasteable YAML snippet.
900
933
 
901
934
  **The takeover is persisted into the profile (DSH 0.2.x).** Since `0.2.0-rc.2` the provider selection lives in volatile config refs and can only be written through `settings.mutate("web", …)`, which lands in `profiles/<profile>/cordis.patch.yml` as:
@@ -922,8 +955,8 @@ DSH 0.2.1 has Settings → Web search → **DeepSeek search API**, which interac
922
955
  | Action | Result |
923
956
  |---|---|
924
957
  | Turn the switch on | `web.searchProvider` becomes `deepseek-search-api` (an explicit choice), so **this plugin steps aside** and search goes through the official direct API; fetch becomes `deepseek-fetch-api` as well |
925
- | Turn the switch off | DSH deletes the whole `- id: web` row, so the provider falls back to the shipped default `deepseek-official` — that is **model search** (a full auxiliary request, ~12 s in practice, billed per token), not the free engines |
926
- | After turning it off | **Since 0.9.8**: the plugin notices `deepseek-official` and re-takes at runtime (log line `DSH's search switch put the web providers back to the official defaults — re-took …`), normally within seconds; if it does not, restart DSH |
958
+ | Turn the switch off | DSH deletes the whole `- id: web` row, so the provider falls back to the shipped default for the running DSH: `deepseek-search-api` since 0.2.2-rc.2 (billed per Search API call), or `deepseek-official` on older hosts (model search: a full auxiliary request, billed per token). Neither is a free engine |
959
+ | After turning it off | **Since 0.9.8**: the plugin notices either official default and re-takes at runtime (log line `DSH's search switch put the web providers back to the official defaults — re-took …`), normally within seconds; if it does not, restart DSH |
927
960
 
928
961
  Use `/free-search-engine` or this plugin's settings page to change engines, **not that switch**. Turning it on and then off drops you from the official direct API back to model search until the plugin re-takes over or DSH restarts.
929
962
 
@@ -948,7 +981,7 @@ After installation, open the config page (DSH 0.2.1-rc.2+):
948
981
  The config page provides:
949
982
 
950
983
  - **Search engine**: Select an engine from the dropdown; changes take effect immediately upon saving.
951
- - **API keys**: Enter keys for Exa / Tavily / Keenable / Firecrawl / Parallel / Perplexity / DeepSeek / Google CSE / Metaso / You.com (password fields; displayed as "configured" once saved; Exa / Tavily / Keenable / Firecrawl / Parallel / You.com work without a key too).
984
+ - **API keys**: Enter keys for Exa / Tavily / Keenable / Firecrawl / Parallel / Perplexity / DeepSeek / Google CSE / Metaso / Yandex / You.com (password fields; displayed as "configured" once saved; Exa / Tavily / Keenable / Firecrawl / Parallel / You.com work without a key too).
952
985
  - **Recommended**: store paid-engine keys in the harness credential center `~/.dsh/.credentials.yaml` (e.g. `DEEPSEEK_API_KEY: sk-...`, same as the official LLM providers — one place for all keys). Resolution order: credentials center > settings page > environment variable; the settings-page fields remain for backward compatibility.
953
986
  - **Test engine**: Tests the selected engine directly (no fallback chain; paid engines without a key report an explicit error).
954
987
  - **Use Bing default**: stage a switch back to the stable free Bing engine; `Discard` only cancels unsaved edits
@@ -1036,7 +1069,7 @@ Otherwise startup can loop on "write the `web` config → the web service rebuil
1036
1069
 
1037
1070
  If you deliberately pinned `fetchProvider: http` (you only want the built-in fetcher), set `fetchProviderTakeover: false`: `http` is no longer treated as the factory default, while a completely unset provider is still filled in.
1038
1071
 
1039
- `searchProvider` follows the same rule: taken over when unset or still `deepseek-official`, never when explicitly pointed elsewhere.
1072
+ `searchProvider` follows the same rule: taken over when unset or still the running host's official default (`deepseek-search-api` / `deepseek-official`), never when explicitly pointed elsewhere.
1040
1073
 
1041
1074
  #### Configuration File
1042
1075
 
@@ -1097,6 +1130,9 @@ googleCseApiKey: ... # Google Custom Search API key
1097
1130
  googleCseId: "..." # Programmable Search Engine cx
1098
1131
  metasoApiKey: ... # Metaso API key (metaso.cn/api)
1099
1132
  metasoScope: webpage # webpage | document | scholar
1133
+ yandexApiKey: ... # Yandex Search API key (AI Studio)
1134
+ yandexFolderId: "..." # folder the key was created in
1135
+ yandexSearchType: auto # auto | ru | tr | com | kk | be | uz
1100
1136
  deepseekApiKey: ...
1101
1137
  ```
1102
1138
 
@@ -1186,6 +1222,30 @@ After searching, the agent can **read full webpage content** (e.g., *"Open the f
1186
1222
  - Supports timeout and response size limits.
1187
1223
  - ⚠️ Note: `web_fetch` rejects loopback, private, link-local and cloud-metadata addresses by default. Under Clash / mihomo TUN fake-ip DNS, add the fake-ip range (usually `198.18.0.0/15`) to extra allowed networks in Settings, otherwise every proxied host resolves to a placeholder address and is rejected; only allow fake-ip reserved ranges, never RFC1918.
1188
1224
 
1225
+ #### MCP server (stdio)
1226
+
1227
+ The repo also ships a standalone stdio MCP server for Claude Desktop, Cursor, Codex and other MCP clients; it does not need the DSH runtime:
1228
+
1229
+ ```bash
1230
+ npx -y -p dsh-free-search dsh-free-search-mcp
1231
+ ```
1232
+
1233
+ The first version exposes `web_search` (Bing / DuckDuckGo, no key) and `web_fetch` (direct / browser / Exa / Firecrawl). It does not expose paid engines, `research` or `multi_search`, and it does not listen on a port. Claude Desktop example:
1234
+
1235
+ ```json
1236
+ {
1237
+ "mcpServers": {
1238
+ "dsh-free-search": {
1239
+ "command": "npx",
1240
+ "args": ["-y", "-p", "dsh-free-search", "dsh-free-search-mcp"],
1241
+ "env": { "MCP_LANG": "zh", "MCP_SEARCH_ENGINE": "auto" }
1242
+ }
1243
+ }
1244
+ }
1245
+ ```
1246
+
1247
+ Environment: `MCP_SEARCH_ENGINE` (auto / bing / ddg / ddg-lite), `MCP_MAX_RESULTS`, `MCP_SAFE_SEARCH`, `MCP_LANG`, `MCP_BING_MARKET`, `MCP_BROWSER_FETCH`, `MCP_ALLOW_FAKE_IP_CIDRS`; the fetch tiers can use `EXA_API_KEY` / `FIRECRAWL_API_KEY`.
1248
+
1189
1249
  #### Platform Search (`platform_search`)
1190
1250
 
1191
1251
  Ask the agent to search specific platforms (e.g., *"Search GitHub for deepseek harness"*, *"Find related videos on Bilibili"*, or *"Discussions about dsh on V2EX"*). The `platform_search` tool supports:
@@ -1258,7 +1318,7 @@ Restart `dsh web` after switching to apply changes.
1258
1318
 
1259
1319
  #### Offline self-check assertions (`tools/`)
1260
1320
 
1261
- **Fifty-six** zero-dependency assertion scripts ship with the repo (**839 assertions** total): **no API keys, no network, no test framework**, Node ≥ 20. Run everything with `npm test`.
1321
+ **Fifty-nine** zero-dependency assertion scripts ship with the repo (**867 assertions** total): **no API keys, no network, no test framework**, Node ≥ 20. Run everything with `npm test`.
1262
1322
 
1263
1323
  | Script | Covers | Run (count) |
1264
1324
  |---|---|---|
@@ -1269,7 +1329,7 @@ Restart `dsh web` after switching to apply changes.
1269
1329
  | `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) |
1270
1330
  | `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) |
1271
1331
  | `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) |
1272
- | `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 37 engines with the right free/explicit flags, and index never reads an engine-private name | `node tools/assert-engine-modules.mjs` (6) |
1332
+ | `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 38 engines with the right free/explicit flags, and index never reads an engine-private name | `node tools/assert-engine-modules.mjs` (6) |
1273
1333
  | `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) |
1274
1334
  | `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) |
1275
1335
  | `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) |
@@ -1281,6 +1341,8 @@ Restart `dsh web` after switching to apply changes.
1281
1341
  | `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) |
1282
1342
  | `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) |
1283
1343
  | `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, loopback/RFC1918 still blocked after opt-in, provider wiring and settings | `node tools/assert-fetch-ssrf.mjs` (8) |
1344
+ | `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) |
1345
+ | `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) |
1284
1346
  | `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) |
1285
1347
  | `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) |
1286
1348
  | `assert-engine-runtime.mjs` | Engine runtime: per-engine concurrency caps (2 normally, 1 for HTML SERP), queueing with abort cleanup, ok/empty/fail/average-latency stats, wiring on both the provider and runEngineTest paths, and stats in the doctor report | `node tools/assert-engine-runtime.mjs` (4) |
@@ -1315,8 +1377,8 @@ Restart `dsh web` after switching to apply changes.
1315
1377
  | `assert-firecrawl-keyless.mjs` | Firecrawl keyless egress refusal: only a 403 with the VPN/proxy wording counts, plain 403 and 401/429/500 do not, and the cooldown starts inactive | `node tools/assert-firecrawl-keyless.mjs` (5) |
1316
1378
  | `assert-fetch-charset.mjs` | fetch encoding (#88): `charset=gbk` / `gb2312` decoded as declared, `<meta charset>` and the http-equiv form sniffed when the header omits it, UTF-8 by default, and an unknown label falls back to UTF-8 instead of throwing | `node tools/assert-fetch-charset.mjs` (6) |
1317
1379
  | `assert-fetch-abort.mjs` | fetch interruption (#87): a compressed response cut mid-body rejects instead of hanging forever, identity truncation rejects too, abort breaks a stalled gzip stream, and complete responses plus redirects still work | `node tools/assert-fetch-abort.mjs` (6) |
1318
- | `assert-bridge-access.mjs` | bridge Host fence (#84): loopback allowed, a remote peer behind a loopback Host refused, `--trusted-host` (port-less matches any port, explicit port matches exactly), `--public-url`, the bind address, cross-site and foreign-Origin refused | `node tools/assert-bridge-access.mjs` (11) |
1319
- | `assert-provider-takeover.mjs` | provider takeover: both the legacy property API and the rc.2 `config.*` refs, a single batched `settings.mutate(web)`, explicit foreign providers left untouched, an explicit `http` kept when `fetchProviderTakeover` is off, describe()-triggered events ignored when nothing changed, nested config changes and web rebuilds reported separately, re-takeover after DSH's search switch is turned off without fighting an explicit `deepseek-search-api`, apply re-entry / duplicate registrations tolerated, and repeated logs deduplicated | `node tools/assert-provider-takeover.mjs` (16) |
1380
+ | `assert-bridge-access.mjs` | bridge Host fence (#84): loopback allowed, a remote peer behind a loopback Host refused, `--trusted-host` (port-less matches any port, explicit port matches exactly), `--public-url`, the bind address, cross-site and foreign-Origin refused, connection-auth delegation and fail-closed behavior | `node tools/assert-bridge-access.mjs` (13) |
1381
+ | `assert-provider-takeover.mjs` | provider takeover: both the legacy property API and the rc.2 `config.*` refs, a single batched `settings.mutate(web)`, explicit foreign providers left untouched, an explicit `http` kept when `fetchProviderTakeover` is off, describe()-triggered events ignored when nothing changed, nested config changes and web rebuilds reported separately, re-takeover after DSH's search switch is turned off (both `deepseek-search-api` and `deepseek-official` count as the factory default), stepping aside for the explicit `deepseek-fetch-api` switch, apply re-entry / duplicate registrations tolerated, and repeated logs deduplicated | `node tools/assert-provider-takeover.mjs` (20) |
1320
1382
 
1321
1383
  Any failure exits non-zero with the failing items listed. Passing the path of an older file shows the pre-fix failures (proving the assertions are not vacuous). Worth running before a release.
1322
1384
 
package/bin/mcp.js ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ // stdio MCP server. Protocol messages go to stdout; diagnostics go to stderr.
3
+ import readline from "node:readline";
4
+ import { createMcpHandler } from "../lib/mcp_server.js";
5
+
6
+ const handle = createMcpHandler();
7
+
8
+ const rl = readline.createInterface({ input: process.stdin, crlfDelay: Infinity });
9
+
10
+ rl.on("line", async (line) => {
11
+ const text = line.trim();
12
+ if (text === "") return;
13
+ let message;
14
+ try {
15
+ message = JSON.parse(text);
16
+ } catch {
17
+ process.stdout.write(`${JSON.stringify({ jsonrpc: "2.0", id: null, error: { code: -32700, message: "parse error" } })}\n`);
18
+ return;
19
+ }
20
+ try {
21
+ const response = await handle(message);
22
+ if (response !== undefined) process.stdout.write(`${JSON.stringify(response)}\n`);
23
+ } catch (error) {
24
+ process.stderr.write(`mcp: ${error?.stack ?? error}\n`);
25
+ if (message?.id !== undefined) {
26
+ process.stdout.write(
27
+ `${JSON.stringify({ jsonrpc: "2.0", id: message.id, error: { code: -32603, message: "internal error" } })}\n`
28
+ );
29
+ }
30
+ }
31
+ });
package/cordis.patch.yml CHANGED
@@ -14,17 +14,17 @@
14
14
  #
15
15
  # NOTE (2026-10, issue #51): this bundle does NOT touch `web.searchProvider`.
16
16
  # The plugin takes the search provider over at runtime instead — when the field
17
- # is unset or still the shipped default (`deepseek-official`) it points it at its
18
- # own provider id (`ddg`); when another provider was chosen explicitly it leaves
19
- # it alone and only warns.
17
+ # is unset or still the shipped default (`deepseek-search-api` since 0.2.2-rc.2,
18
+ # `deepseek-official` on older hosts) it points it at its own provider id (`ddg`);
19
+ # when another provider was chosen explicitly it leaves it alone and only warns.
20
20
  #
21
21
  # A static `- id: web config: searchProvider: ddg` used to live here. It was
22
22
  # removed because it created a dangling reference: a patch replaces the whole
23
23
  # row config, so rows that came from a *disabled* or skipped plugin left
24
24
  # `searchProvider: ddg` behind while nothing registered `ddg` — every web search
25
25
  # then failed with `configured web provider "ddg" is not registered`. Leaving the
26
- # base default (`deepseek-official`) in place means a disabled plugin degrades to
27
- # the official provider instead of breaking search outright.
26
+ # base default in place means a disabled plugin degrades to the official provider
27
+ # instead of breaking search outright.
28
28
  - insert:
29
29
  - id: web-search-free
30
30
  name: dsh-free-search
package/lib/client.js CHANGED
@@ -446,6 +446,19 @@ window.__ModuleLoader__.load({
446
446
  metasoScopeDocument: "文库",
447
447
  metasoScopeScholar: "学术",
448
448
  metasoScopeHint: "网页最通用;文库面向 PDF/文档,学术面向论文,单次消耗更高。",
449
+ yandexKeyLabel: "Yandex API key",
450
+ yandexKeyHint: "在 Yandex AI Studio 创建,需要同时有 folder ID;按请求计费,需绑定 billing account。",
451
+ yandexFolderLabel: "Yandex folder ID",
452
+ yandexFolderHint: "创建 API key 时所在的 folder;在 AI Studio 顶部文件夹名旁复制。",
453
+ yandexSearchTypeLabel: "Yandex 搜索区域",
454
+ yandexSearchTypeAuto: "自动(按查询语言)",
455
+ yandexSearchTypeRu: "RU · 俄罗斯",
456
+ yandexSearchTypeTr: "TR · 土耳其",
457
+ yandexSearchTypeCom: "COM · 国际",
458
+ yandexSearchTypeKk: "KK · 哈萨克斯坦",
459
+ yandexSearchTypeBe: "BE · 白俄罗斯",
460
+ yandexSearchTypeUz: "UZ · 乌兹别克斯坦",
461
+ yandexSearchTypeHint: "自动按 lang 选择;也可以固定到某个区域。",
449
462
  restoreOfficial: "恢复官方搜索",
450
463
  restoreOfficialHint: "把 web.searchProvider 改回 deepseek-official、web.fetchProvider 改回 http。停用或卸载本插件前建议先点一次,避免宿主报 configured web provider \"ddg\" is not registered。",
451
464
  restoringOfficial: "恢复中…",
@@ -619,6 +632,19 @@ window.__ModuleLoader__.load({
619
632
  metasoScopeDocument: "Documents",
620
633
  metasoScopeScholar: "Scholars",
621
634
  metasoScopeHint: "Webpages is the general default; documents targets PDFs/files and scholars targets papers, both cost more per call.",
635
+ yandexKeyLabel: "Yandex API key",
636
+ yandexKeyHint: "Create one in Yandex AI Studio; a folder ID is required too, and requests are billed to a billing account.",
637
+ yandexFolderLabel: "Yandex folder ID",
638
+ yandexFolderHint: "The folder the API key was created in; copy it from the folder name in AI Studio.",
639
+ yandexSearchTypeLabel: "Yandex search region",
640
+ yandexSearchTypeAuto: "Auto (follow query language)",
641
+ yandexSearchTypeRu: "RU · Russia",
642
+ yandexSearchTypeTr: "TR · Turkey",
643
+ yandexSearchTypeCom: "COM · International",
644
+ yandexSearchTypeKk: "KK · Kazakhstan",
645
+ yandexSearchTypeBe: "BE · Belarus",
646
+ yandexSearchTypeUz: "UZ · Uzbekistan",
647
+ yandexSearchTypeHint: "Auto follows lang; pin a region to override.",
622
648
  restoreOfficial: "Restore official search",
623
649
  restoreOfficialHint: "Sets web.searchProvider back to deepseek-official and web.fetchProvider back to http. Run this before disabling or uninstalling the plugin, otherwise the host reports configured web provider \"ddg\" is not registered.",
624
650
  restoringOfficial: "Restoring…",
@@ -668,7 +694,7 @@ window.__ModuleLoader__.load({
668
694
  "cache_search",
669
695
  "domain_search",
670
696
  ];
671
- const PLUGIN_VERSION = "0.9.42";
697
+ const PLUGIN_VERSION = "0.9.44";
672
698
  const PLUGIN_REPO_URL = "https://github.com/DDDMUC/dsh-free-search";
673
699
  // 右侧浮动目录(#85):条目顺序即页面顺序,anchor 是页面里对应 field 的 id。
674
700
  const NAV_ITEMS = [
@@ -710,6 +736,7 @@ window.__ModuleLoader__.load({
710
736
  { id: "outcrawl", label: "Outcrawl", badge: "API KEY", link: "https://outcrawl.ai" },
711
737
  { id: "google", label: "Google · 自定义搜索", badge: "API KEY", link: "https://developers.google.com/custom-search/v1/overview" },
712
738
  { id: "metaso", label: "Metaso · 秘塔搜索", badge: "API KEY", link: "https://metaso.cn/api" },
739
+ { id: "yandex", label: "Yandex · 搜索 API", badge: "API KEY", link: "https://aistudio.yandex.cloud" },
713
740
  { id: "deepseek-official", label: "DeepSeek Official", badge: "API KEY", link: "https://platform.deepseek.com/api_keys" },
714
741
  { id: "deepseek-tools", label: "DeepSeek Tools API", badge: "API KEY", link: "https://api-docs.deepseek.com/zh-cn/guides/search" },
715
742
  { id: "you", label: "You.com", badge: "FREE", link: "https://you.com/platform/api-keys" },
@@ -733,10 +760,10 @@ window.__ModuleLoader__.load({
733
760
  ];
734
761
  const ENGINE_IDS = ENGINES.filter((engine) => engine.id !== "auto" && engine.id !== "multi").map((engine) => engine.id);
735
762
  // 与 lib/index.js 的 EXPLICIT_ONLY_ENGINES 同源:按次计费、只在显式选中时运行,因此不提供入池候选。
736
- const EXPLICIT_ONLY_ENGINES = ["openai", "gemini", "claude", "metaso"];
763
+ const EXPLICIT_ONLY_ENGINES = ["openai", "gemini", "claude", "metaso", "yandex"];
737
764
  // 与 lib/serp_engines.js 的 SERP_ENGINE_IDS 同源:HTML 抓取型引擎,默认不进自动回退链。
738
765
  const SERP_ENGINE_IDS = ["baidu-html", "so360", "sogou", "wechat", "toutiao"];
739
- const MODEL_ENGINES = ENGINES.filter((engine) => EXPLICIT_ONLY_ENGINES.includes(engine.id) && engine.id !== "metaso");
766
+ const MODEL_ENGINES = ENGINES.filter((engine) => EXPLICIT_ONLY_ENGINES.includes(engine.id) && engine.id !== "metaso" && engine.id !== "yandex");
740
767
  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"];
741
768
  const normalizeFallbackOrder = (value) => {
742
769
  const configured = Array.isArray(value) ? value.filter((id) => ENGINE_IDS.includes(id)) : [];
@@ -952,6 +979,9 @@ window.__ModuleLoader__.load({
952
979
  const [googleCx, setGoogleCx] = react.useState("");
953
980
  const [metasoKey, setMetasoKey] = react.useState("");
954
981
  const [metasoScope, setMetasoScope] = react.useState("webpage");
982
+ const [yandexKey, setYandexKey] = react.useState("");
983
+ const [yandexFolder, setYandexFolder] = react.useState("");
984
+ const [yandexType, setYandexType] = react.useState("auto");
955
985
  const [youcomKey, setYoucomKey] = react.useState("");
956
986
  const [baiduKey, setBaiduKey] = react.useState("");
957
987
  const [kimiKey, setKimiKey] = react.useState("");
@@ -1130,6 +1160,9 @@ window.__ModuleLoader__.load({
1130
1160
  setGoogleCx(v.googleCseId ?? "");
1131
1161
  setMetasoKey(v.metasoApiKey ?? "");
1132
1162
  setMetasoScope(v.metasoScope === "document" || v.metasoScope === "scholar" ? v.metasoScope : "webpage");
1163
+ setYandexKey(v.yandexApiKey ?? "");
1164
+ setYandexFolder(v.yandexFolderId ?? "");
1165
+ setYandexType(["ru", "tr", "com", "kk", "be", "uz"].includes(v.yandexSearchType) ? v.yandexSearchType : "auto");
1133
1166
  setYoucomKey(v.youcomApiKey ?? "");
1134
1167
  setBaiduKey(v.baiduApiKey ?? "");
1135
1168
  setKimiKey(v.kimiApiKey ?? "");
@@ -1180,6 +1213,7 @@ window.__ModuleLoader__.load({
1180
1213
  if (path === "degoogApiKey") configured.degoog = true;
1181
1214
  if (path === "googleCseApiKey") configured.google = true;
1182
1215
  if (path === "metasoApiKey") configured.metaso = true;
1216
+ if (path === "yandexApiKey") configured.yandex = true;
1183
1217
  }
1184
1218
  }
1185
1219
  setKeysConfigured(configured);
@@ -1191,7 +1225,7 @@ window.__ModuleLoader__.load({
1191
1225
  const cred = await bridgeCredentialsStatus();
1192
1226
  if (cred.ok) {
1193
1227
  const cc = {};
1194
- 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", baiduApiKey: "baidu", kimiApiKey: "kimi", aliyunApiKey: "aliyun", doubaoApiKey: "doubao", openaiApiKey: "openai", geminiApiKey: "gemini", claudeApiKey: "claude", zhihuApiKey: "zhihu", tinyfishApiKey: "tinyfish", jinaApiKey: "jina", searxngBearerToken: "searxng" };
1228
+ 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", baiduApiKey: "baidu", kimiApiKey: "kimi", aliyunApiKey: "aliyun", doubaoApiKey: "doubao", openaiApiKey: "openai", geminiApiKey: "gemini", claudeApiKey: "claude", zhihuApiKey: "zhihu", tinyfishApiKey: "tinyfish", jinaApiKey: "jina", searxngBearerToken: "searxng" };
1195
1229
  for (const [k, v] of Object.entries(cred.value.configured ?? {})) {
1196
1230
  if (map[k]) cc[map[k]] = v;
1197
1231
  }
@@ -1241,6 +1275,7 @@ window.__ModuleLoader__.load({
1241
1275
  ["outcrawlApiKey", outcrawlKey],
1242
1276
  ["googleCseApiKey", googleKey],
1243
1277
  ["metasoApiKey", metasoKey],
1278
+ ["yandexApiKey", yandexKey],
1244
1279
  ["youcomApiKey", youcomKey],
1245
1280
  ["baiduApiKey", baiduKey],
1246
1281
  ["kimiApiKey", kimiKey],
@@ -1288,6 +1323,8 @@ window.__ModuleLoader__.load({
1288
1323
  ops.push({ op: "set", path: ["fetchProviderTakeover"], value: fetchProviderTakeover });
1289
1324
  ops.push({ op: "set", path: ["googleCseId"], value: googleCx.trim() });
1290
1325
  ops.push({ op: "set", path: ["metasoScope"], value: metasoScope === "document" || metasoScope === "scholar" ? metasoScope : "webpage" });
1326
+ ops.push({ op: "set", path: ["yandexFolderId"], value: yandexFolder.trim() });
1327
+ ops.push({ op: "set", path: ["yandexSearchType"], value: ["ru", "tr", "com", "kk", "be", "uz"].includes(yandexType) ? yandexType : "auto" });
1291
1328
  ops.push({ op: "set", path: ["browserFetch"], value: browserFetch });
1292
1329
  ops.push({
1293
1330
  op: "set",
@@ -2124,6 +2161,94 @@ react_jsx_runtime.jsx("div", {
2124
2161
  }),
2125
2162
  ],
2126
2163
  }),
2164
+ react_jsx_runtime.jsx("div", {
2165
+ className: "dshfs-field",
2166
+ children: [
2167
+ react_jsx_runtime.jsx("div", {
2168
+ className: "dshfs-label",
2169
+ children: t.yandexKeyLabel,
2170
+ }),
2171
+ react_jsx_runtime.jsx("input", {
2172
+ className: "dshfs-input",
2173
+ type: "password",
2174
+ value: yandexKey,
2175
+ spellCheck: false,
2176
+ placeholder: "API key",
2177
+ disabled: !ready || saving,
2178
+ onChange: (e) => {
2179
+ setYandexKey(e.target.value);
2180
+ setDirty(true);
2181
+ setFailed(false);
2182
+ setSaveError("");
2183
+ },
2184
+ }),
2185
+ react_jsx_runtime.jsx("p", {
2186
+ className: "dshfs-hint",
2187
+ children: t.yandexKeyHint,
2188
+ }),
2189
+ ],
2190
+ }),
2191
+ react_jsx_runtime.jsx("div", {
2192
+ className: "dshfs-field",
2193
+ children: [
2194
+ react_jsx_runtime.jsx("div", {
2195
+ className: "dshfs-label",
2196
+ children: t.yandexFolderLabel,
2197
+ }),
2198
+ react_jsx_runtime.jsx("input", {
2199
+ className: "dshfs-input",
2200
+ type: "text",
2201
+ value: yandexFolder,
2202
+ spellCheck: false,
2203
+ placeholder: "b1g...",
2204
+ disabled: !ready || saving,
2205
+ onChange: (e) => {
2206
+ setYandexFolder(e.target.value);
2207
+ setDirty(true);
2208
+ setFailed(false);
2209
+ setSaveError("");
2210
+ },
2211
+ }),
2212
+ react_jsx_runtime.jsx("p", {
2213
+ className: "dshfs-hint",
2214
+ children: t.yandexFolderHint,
2215
+ }),
2216
+ ],
2217
+ }),
2218
+ react_jsx_runtime.jsx("div", {
2219
+ className: "dshfs-field",
2220
+ children: [
2221
+ react_jsx_runtime.jsx("div", {
2222
+ className: "dshfs-label",
2223
+ children: t.yandexSearchTypeLabel,
2224
+ }),
2225
+ react_jsx_runtime.jsx("select", {
2226
+ className: "dshfs-select",
2227
+ value: yandexType,
2228
+ style: { colorScheme: selectColorScheme },
2229
+ disabled: !ready || saving,
2230
+ onChange: (e) => {
2231
+ setYandexType(["ru", "tr", "com", "kk", "be", "uz"].includes(e.target.value) ? e.target.value : "auto");
2232
+ setDirty(true);
2233
+ setFailed(false);
2234
+ setSaveError("");
2235
+ },
2236
+ children: [
2237
+ react_jsx_runtime.jsx("option", { value: "auto", children: t.yandexSearchTypeAuto }),
2238
+ react_jsx_runtime.jsx("option", { value: "ru", children: t.yandexSearchTypeRu }),
2239
+ react_jsx_runtime.jsx("option", { value: "tr", children: t.yandexSearchTypeTr }),
2240
+ react_jsx_runtime.jsx("option", { value: "com", children: t.yandexSearchTypeCom }),
2241
+ react_jsx_runtime.jsx("option", { value: "kk", children: t.yandexSearchTypeKk }),
2242
+ react_jsx_runtime.jsx("option", { value: "be", children: t.yandexSearchTypeBe }),
2243
+ react_jsx_runtime.jsx("option", { value: "uz", children: t.yandexSearchTypeUz }),
2244
+ ],
2245
+ }),
2246
+ react_jsx_runtime.jsx("p", {
2247
+ className: "dshfs-hint",
2248
+ children: t.yandexSearchTypeHint,
2249
+ }),
2250
+ ],
2251
+ }),
2127
2252
  react_jsx_runtime.jsx("div", {
2128
2253
  className: "dshfs-field",
2129
2254
  id: "dshfs-anchor-fallback",
@@ -25,6 +25,7 @@ const BASE_ENGINES = [
25
25
  { id: "outcrawl", free: false, time: false },
26
26
  { id: "google", free: false, time: true },
27
27
  { id: "metaso", free: false, time: false, explicitOnly: true },
28
+ { id: "yandex", free: false, time: false, explicitOnly: true },
28
29
  { id: "deepseek-official", free: false, time: false },
29
30
  { id: "deepseek-tools", free: false, time: true },
30
31
  { id: "you", free: false, time: false },