dsh-free-search 0.9.51 → 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 +20 -12
- package/lib/client.js +16 -5
- package/lib/doctor.js +6 -1
- package/lib/engine_meta.js +111 -108
- package/lib/engines/anysearch.js +75 -74
- package/lib/engines/bing.js +2 -39
- package/lib/engines/brave.js +110 -0
- package/lib/engines/ddg-lite.js +38 -37
- package/lib/engines/ddg.js +34 -33
- package/lib/engines/degoog.js +80 -73
- package/lib/engines/keenable.js +126 -124
- package/lib/engines/searxng.js +71 -66
- package/lib/engines/shared.js +373 -334
- package/lib/index.js +24 -5
- package/lib/multi_policy.js +1 -0
- package/package.json +140 -139
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
#### 引擎与切换
|
|
35
35
|
|
|
36
36
|
- **零成本** —— 多个免费引擎,无需 key、无需注册
|
|
37
|
-
- **
|
|
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` |
|
|
@@ -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
|
|
|
@@ -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: # 留空 =
|
|
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)、地理编码语言;
|
|
@@ -621,7 +623,7 @@ npx -y -p dsh-free-search dsh-free-search-mcp
|
|
|
621
623
|
|
|
622
624
|
#### 离线自检断言(tools/)
|
|
623
625
|
|
|
624
|
-
仓库自带 **
|
|
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 与服务端清单一致、清单覆盖
|
|
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) |
|
|
@@ -674,7 +678,7 @@ npx -y -p dsh-free-search dsh-free-search-mcp
|
|
|
674
678
|
| `assert-x-platform.mjs` | X (Twitter) 平台(Grok Build CLI):可用性、提示词约束、structuredOutput/text/原始 JSON 解析、status 链接过滤与截断、双语文案与面板默认值 | `node tools/assert-x-platform.mjs`(8) |
|
|
675
679
|
| `assert-cooldown.mjs` | 冷却:Retry-After / reset 时间提示优先、失败类档次(session / 短冷却 / 额度 / 月度 / 地区)、key 指纹稳定且互不相同、store 冷却 / 剩余 / 清除、有限冷却落盘重启后仍在而 session 不落盘、按 key 与按引擎互不干扰 | `node tools/assert-cooldown.mjs`(6) |
|
|
676
680
|
| `assert-redact.mjs` | 错误脱敏:已登记 key 全量替换、`sk-` / Bearer / api_key / x-api-key 形态无需登记也能打码、普通文本与短值不动、环境变量按名称收集 | `node tools/assert-redact.mjs`(4) |
|
|
677
|
-
| `assert-doctor.mjs` | 诊断报告:时长格式化、头部版本 / Node / DSH 主目录 / 生效默认 /
|
|
681
|
+
| `assert-doctor.mjs` | 诊断报告:时长格式化、头部版本 / Node / DSH 主目录 / 生效默认 / 提示词字数、每个引擎的标记与原因、冷却原因去重列出、提示词未注入的提示、非 Auto 语言池告警 | `node tools/assert-doctor.mjs`(7) |
|
|
678
682
|
| `assert-agy.mjs` | Antigravity CLI:提示词查询 / 条数 / JSON 契约、structuredOutput 与 response 两种信封、非 SUCCESS 透出上游原因、URL 过滤与截断、CLI 参数、注入 runner 跳过 PATH 检查 | `node tools/assert-agy.mjs`(6) |
|
|
679
683
|
| `assert-allowed-engines.mjs` | 引擎白名单(#106):条目归一化、空名单保持原状、非空时禁用其余全部(含未来新增)、显式禁用优先、错拼不锁死搜索、白名单内引擎可入链(HTML 家族 / 按次计费)、auto 只路由白名单、内置提示词只列白名单且回退为 none、schema 默认空 | `node tools/assert-allowed-engines.mjs`(9) |
|
|
680
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) |
|
|
@@ -739,7 +743,7 @@ This plugin solves exactly that: multiple free engines plus automatic fallback,
|
|
|
739
743
|
#### Engines and switching
|
|
740
744
|
|
|
741
745
|
- **Zero Cost** — Multiple free engines with no API key or registration required
|
|
742
|
-
- **
|
|
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.
|
|
743
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.
|
|
744
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).
|
|
745
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).
|
|
@@ -848,6 +852,7 @@ If this plugin has been helpful, a ⭐ on [GitHub](https://github.com/DDDMUC/dsh
|
|
|
848
852
|
| `keenable` | Keenable | Free | **Usable without a key** (anonymous MCP); configure a key for higher quota |
|
|
849
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) |
|
|
850
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 |
|
|
851
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) |
|
|
852
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 |
|
|
853
858
|
| `perplexity` | Perplexity | Paid | Requires `PERPLEXITY_API_KEY` |
|
|
@@ -885,6 +890,7 @@ If this plugin has been helpful, a ⭐ on [GitHub](https://github.com/DDDMUC/dsh
|
|
|
885
890
|
- Tavily: <https://app.tavily.com/home>
|
|
886
891
|
- Keenable: <https://keenable.ai/login>
|
|
887
892
|
- Parallel: <https://platform.parallel.ai>
|
|
893
|
+
- Brave: <https://api-dashboard.search.brave.com> (API docs: <https://api-dashboard.search.brave.com/app/documentation>)
|
|
888
894
|
- Perplexity: <https://www.perplexity.ai/settings/api>
|
|
889
895
|
- SerpBase: <https://serpbase.dev>
|
|
890
896
|
- Serply: <https://serply.io> (API docs: <https://serply.io/docs>)
|
|
@@ -902,7 +908,7 @@ The free/paid binary is not what decides **who belongs in a default pool** — t
|
|
|
902
908
|
|---|---|---|
|
|
903
909
|
| ① Unlimited, no key | `ddg` / `ddg-lite` / `bing` / `searxng` / `anysearch` | — |
|
|
904
910
|
| ② Anonymous quota (runs without a key) | `exa` / `tavily` / `keenable` / `firecrawl` / `parallel` / `you` (100/day) | key raises the quota |
|
|
905
|
-
| ③ 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 |
|
|
906
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 |
|
|
907
913
|
| ⑤ Per-call billing (model built-in, explicit-only) | `openai` / `gemini` / `claude` | per token + per search |
|
|
908
914
|
|
|
@@ -1087,7 +1093,7 @@ The old `free-search:` section of `~/.dsh/settings.yaml` is **not** imported by
|
|
|
1087
1093
|
|
|
1088
1094
|
```yaml
|
|
1089
1095
|
# config of that entry in profiles/<profile>/cordis.patch.yml:
|
|
1090
|
-
provider: # empty =
|
|
1096
|
+
provider: # empty = geo default (NOT Auto routing; bing on a mainland egress, parallel elsewhere); or ddg / bing / auto / multi
|
|
1091
1097
|
fallbackOn: [quota, auth, bot-wall, transient, invalid-response, unknown] # failure classes allowed to trigger fallback; [] = abort on any failure (default: all)
|
|
1092
1098
|
lang: zh # search language pools / localization (zh / en / ru …; no longer rewritten by the settings page)
|
|
1093
1099
|
# lang drives Bing's mkt/Accept-Language, the Wikipedia subdomain (ja → ja.wikipedia.org) and the geocoding language;
|
|
@@ -1328,7 +1334,7 @@ Restart `dsh web` after switching to apply changes.
|
|
|
1328
1334
|
|
|
1329
1335
|
#### Offline self-check assertions (`tools/`)
|
|
1330
1336
|
|
|
1331
|
-
**Sixty-
|
|
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`.
|
|
1332
1338
|
|
|
1333
1339
|
| Script | Covers | Run (count) |
|
|
1334
1340
|
|---|---|---|
|
|
@@ -1339,8 +1345,10 @@ Restart `dsh web` after switching to apply changes.
|
|
|
1339
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) |
|
|
1340
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) |
|
|
1341
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) |
|
|
1342
|
-
| `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
|
|
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) |
|
|
1343
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) |
|
|
1344
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) |
|
|
1345
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) |
|
|
1346
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) |
|
|
@@ -1379,7 +1387,7 @@ Restart `dsh web` after switching to apply changes.
|
|
|
1379
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) |
|
|
1380
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) |
|
|
1381
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) |
|
|
1382
|
-
| `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` (
|
|
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) |
|
|
1383
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) |
|
|
1384
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) |
|
|
1385
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) |
|
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.
|
|
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 ||
|
|
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
|
}
|
package/lib/engine_meta.js
CHANGED
|
@@ -1,108 +1,111 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Engine catalog: the one place that defines which engines exist, their order,
|
|
3
|
-
* and their static capabilities. Routing, prompts, the settings client and the
|
|
4
|
-
* fallback chain all derive from these lists instead of keeping parallel copies
|
|
5
|
-
* (add an engine here first; the client has its own copy in the web bundle).
|
|
6
|
-
*/
|
|
7
|
-
import { SERP_ENGINE_IDS, SERP_TIME_ENGINES } from "./serp_engines.js";
|
|
8
|
-
|
|
9
|
-
// Base order is the order the settings page and prompts have always used.
|
|
10
|
-
const BASE_ENGINES = [
|
|
11
|
-
{ id: "ddg", free: true, time: true },
|
|
12
|
-
{ id: "ddg-lite", free: true, time: true },
|
|
13
|
-
{ id: "bing", free: true, time: false },
|
|
14
|
-
{ id: "searxng", free: true, time: true },
|
|
15
|
-
{ id: "degoog", free: true, time: true },
|
|
16
|
-
{ id: "anysearch", free: true, time: false },
|
|
17
|
-
{ id: "exa", free: false, time: true },
|
|
18
|
-
{ id: "tavily", free: false, time: true },
|
|
19
|
-
{ id: "keenable", free: false, time: true },
|
|
20
|
-
{ id: "firecrawl", free: false, time: true },
|
|
21
|
-
{ id: "parallel", free: false, time: true },
|
|
22
|
-
{ id: "
|
|
23
|
-
{ id: "
|
|
24
|
-
{ id: "
|
|
25
|
-
{ id: "
|
|
26
|
-
{ id: "
|
|
27
|
-
{ id: "
|
|
28
|
-
{ id: "
|
|
29
|
-
{ id: "
|
|
30
|
-
{ id: "
|
|
31
|
-
{ id: "deepseek-
|
|
32
|
-
{ id: "
|
|
33
|
-
{ id: "
|
|
34
|
-
{ id: "
|
|
35
|
-
{ id: "
|
|
36
|
-
{ id: "
|
|
37
|
-
{ id: "
|
|
38
|
-
{ id: "
|
|
39
|
-
{ id: "
|
|
40
|
-
{ id: "
|
|
41
|
-
{ id: "
|
|
42
|
-
{ id: "
|
|
43
|
-
{ id: "
|
|
44
|
-
{ id: "
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Engine catalog: the one place that defines which engines exist, their order,
|
|
3
|
+
* and their static capabilities. Routing, prompts, the settings client and the
|
|
4
|
+
* fallback chain all derive from these lists instead of keeping parallel copies
|
|
5
|
+
* (add an engine here first; the client has its own copy in the web bundle).
|
|
6
|
+
*/
|
|
7
|
+
import { SERP_ENGINE_IDS, SERP_TIME_ENGINES } from "./serp_engines.js";
|
|
8
|
+
|
|
9
|
+
// Base order is the order the settings page and prompts have always used.
|
|
10
|
+
const BASE_ENGINES = [
|
|
11
|
+
{ id: "ddg", free: true, time: true },
|
|
12
|
+
{ id: "ddg-lite", free: true, time: true },
|
|
13
|
+
{ id: "bing", free: true, time: false },
|
|
14
|
+
{ id: "searxng", free: true, time: true },
|
|
15
|
+
{ id: "degoog", free: true, time: true },
|
|
16
|
+
{ id: "anysearch", free: true, time: false },
|
|
17
|
+
{ id: "exa", free: false, time: true },
|
|
18
|
+
{ id: "tavily", free: false, time: true },
|
|
19
|
+
{ id: "keenable", free: false, time: true },
|
|
20
|
+
{ id: "firecrawl", free: false, time: true },
|
|
21
|
+
{ id: "parallel", free: false, time: true },
|
|
22
|
+
{ id: "brave", free: false, time: true },
|
|
23
|
+
{ id: "perplexity", free: false, time: false },
|
|
24
|
+
{ id: "serpbase", free: false, time: false },
|
|
25
|
+
{ id: "serply", free: false, time: false },
|
|
26
|
+
{ id: "outcrawl", free: false, time: false },
|
|
27
|
+
{ id: "google", free: false, time: true },
|
|
28
|
+
{ id: "metaso", free: false, time: false, explicitOnly: true },
|
|
29
|
+
{ id: "yandex", free: false, time: false, explicitOnly: true },
|
|
30
|
+
{ id: "yuanbao", free: false, time: true, explicitOnly: true },
|
|
31
|
+
{ id: "deepseek-official", free: false, time: false },
|
|
32
|
+
{ id: "deepseek-tools", free: false, time: true },
|
|
33
|
+
{ id: "you", free: false, time: false },
|
|
34
|
+
{ id: "baidu", free: false, time: true },
|
|
35
|
+
{ id: "kimi", free: false, time: false },
|
|
36
|
+
{ id: "aliyun", free: false, time: false },
|
|
37
|
+
{ id: "doubao", free: false, time: true },
|
|
38
|
+
{ id: "tinyfish", free: false, time: true },
|
|
39
|
+
{ id: "jina", free: false, time: false },
|
|
40
|
+
{ id: "zhihu_global", free: false, time: true },
|
|
41
|
+
{ id: "zhihu_site", free: false, time: false },
|
|
42
|
+
{ id: "agy", free: false, time: false },
|
|
43
|
+
{ id: "openai", free: false, time: false, explicitOnly: true },
|
|
44
|
+
{ id: "gemini", free: false, time: false, explicitOnly: true },
|
|
45
|
+
{ id: "claude", free: false, time: false, explicitOnly: true },
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
/** Every engine id, base engines first and the HTML SERP family last. */
|
|
49
|
+
export const ALL_ENGINES = [...BASE_ENGINES.map((engine) => engine.id), ...SERP_ENGINE_IDS];
|
|
50
|
+
|
|
51
|
+
/** Engines that need no credential at all. */
|
|
52
|
+
export const FREE_ENGINES = BASE_ENGINES.filter((engine) => engine.free).map((engine) => engine.id);
|
|
53
|
+
|
|
54
|
+
/** Per-call billed model searches: never auto-routed, only explicit picks. */
|
|
55
|
+
export const EXPLICIT_ONLY_ENGINES = BASE_ENGINES.filter((engine) => engine.explicitOnly).map((engine) => engine.id);
|
|
56
|
+
|
|
57
|
+
// Time-filter support. The order is deliberate (tavily before exa) and differs
|
|
58
|
+
// from the base order, so it stays explicit instead of being filtered from BASE.
|
|
59
|
+
export const TIME_ENGINES = [
|
|
60
|
+
"tavily",
|
|
61
|
+
"exa",
|
|
62
|
+
"keenable",
|
|
63
|
+
"firecrawl",
|
|
64
|
+
"google",
|
|
65
|
+
"parallel",
|
|
66
|
+
"brave",
|
|
67
|
+
"searxng",
|
|
68
|
+
"degoog",
|
|
69
|
+
"ddg",
|
|
70
|
+
"ddg-lite",
|
|
71
|
+
"baidu",
|
|
72
|
+
"yuanbao",
|
|
73
|
+
"doubao",
|
|
74
|
+
"tinyfish",
|
|
75
|
+
"deepseek-tools",
|
|
76
|
+
"zhihu_global",
|
|
77
|
+
...SERP_TIME_ENGINES,
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
/** Default fallback chain order (the settings UI exposes it as a sort list). */
|
|
81
|
+
export const DEFAULT_FALLBACK_ORDER = [
|
|
82
|
+
"exa",
|
|
83
|
+
"tavily",
|
|
84
|
+
"keenable",
|
|
85
|
+
"firecrawl",
|
|
86
|
+
"parallel",
|
|
87
|
+
"brave",
|
|
88
|
+
"perplexity",
|
|
89
|
+
"serpbase",
|
|
90
|
+
"serply",
|
|
91
|
+
"outcrawl",
|
|
92
|
+
"google",
|
|
93
|
+
"agy",
|
|
94
|
+
"deepseek-tools",
|
|
95
|
+
"deepseek-official",
|
|
96
|
+
"you",
|
|
97
|
+
"baidu",
|
|
98
|
+
"kimi",
|
|
99
|
+
"aliyun",
|
|
100
|
+
"doubao",
|
|
101
|
+
"tinyfish",
|
|
102
|
+
"jina",
|
|
103
|
+
"bing",
|
|
104
|
+
"anysearch",
|
|
105
|
+
"ddg",
|
|
106
|
+
"ddg-lite",
|
|
107
|
+
"searxng",
|
|
108
|
+
"degoog",
|
|
109
|
+
"zhihu_global",
|
|
110
|
+
"zhihu_site",
|
|
111
|
+
];
|