dsh-union-search 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -73,6 +73,7 @@ dsh 默认的搜索 provider 依赖 DeepSeek 官方 API key(`DEEPSEEK_API_KEY`
73
73
  | `perplexity` | Perplexity | 付费 | 需 `PERPLEXITY_API_KEY` |
74
74
  | `serpbase` | SerpBase | 付费 | 需 `SERPBASE_API_KEY`(serpbase.dev,注册送 100 次免费额度) |
75
75
  | `serply` | Serply | 付费 | 需 `SERPLY_API_KEY`(serply.io,新账户 30 天内 2,500 次免费额度);Google 网页结果,按设置页语言本地化 |
76
+ | `deepseek-tools` | DeepSeek 原生搜索 API | 付费 | 需 `DEEPSEEK_API_KEY`(与 `deepseek-official` 同一 key);直接 `POST /v1/tools/search` **无模型参与**,同 query 实测 ~0.3s(对比 official 约 5-6s);透传 `rerank_score`/`authority`;端点可经 `deepseekToolsBaseUrl` 改自建网关(完整 URL 或 base 都吃) |
76
77
  | `deepseek-official` | DeepSeek 官方 | 付费 | 需 `DEEPSEEK_API_KEY`;官方定价 Search **$0.75 / 千次成功请求(≈ 单次 5 厘)**(2026-10 口径;经 DSH 宿主的服务端工具调用 2026-11-01 前免费),见下方「DeepSeek 官方定价」 |
77
78
  | `you` | You.com | 付费 | 需 `YOUCOM_API_KEY`(you.com/platform/api-keys,注册即送免费额度) |
78
79
  | `baidu` | 百度千帆 AI 搜索 | 额度 | 需 `BAIDU_API_KEY`(千帆 AI 搜索,每日赠 50 次,超额按量后付费);中文全网,支持时间过滤 |
@@ -343,6 +344,7 @@ deepseekApiKey: ...
343
344
  - **去重与合并**:按规范化 URL 去除结尾斜杠并合并结果,多引擎共同命中的条目优先置顶排在最前,并在结果附带 `seenIn` 命中来源清单(如 `[seen in: bing, exa]`)。
344
345
  - **不可信边界与清洗**:严格遵守 `<untrusted-web-content>` 数据边界,正文 snippet 统一清洗。
345
346
  - ⚠️ 注:多源并发会消耗更多 API 配额,建议在需要多角度核验时按需使用。
347
+ - **同计费上游去重(0.15.0)**:`deepseek-tools` 与 `deepseek-official` 共用同一个 `DEEPSEEK_API_KEY`(同一账号),multi 模式同时点名两者会**双计费**;现已自动只保留先点名的一路,被跳过项列在结果 note 的 `dedupedSameBilling` 里。
346
348
 
347
349
  #### 抓取网页内容(web_fetch)
348
350
 
@@ -485,6 +487,7 @@ If this plugin has been helpful, a ⭐ on [GitHub](https://github.com/drscrewdri
485
487
  | `perplexity` | Perplexity | Paid | Requires `PERPLEXITY_API_KEY` |
486
488
  | `serpbase` | SerpBase | Paid | Requires `SERPBASE_API_KEY` (serpbase.dev, 100 free queries on signup) |
487
489
  | `serply` | Serply | Paid | Requires `SERPLY_API_KEY` (serply.io, 2,500 free credits for the first 30 days); Google web results localized to the settings language |
490
+ | `deepseek-tools` | DeepSeek Native Search API | Paid | Requires `DEEPSEEK_API_KEY` (same key as `deepseek-official`); hits `POST /v1/tools/search` directly with **no model in the loop** — ~0.3s vs ~5-6s for official on the same query; passes through `rerank_score`/`authority`; endpoint switchable to a self-hosted gateway via `deepseekToolsBaseUrl` (full URL or base both accepted) |
488
491
  | `deepseek-official` | DeepSeek Official | Paid | Requires `DEEPSEEK_API_KEY`; official pricing: Search **$0.75 per 1,000 successful requests (≈ ¥0.005 per request)** (as of 2026-10; server-side tool calls through the DSH harness are free until 2026-11-01) — see "DeepSeek official pricing" below |
489
492
  | `you` | You.com | Paid | Requires `YOUCOM_API_KEY` (you.com/platform/api-keys, free tier on signup) |
490
493
  | `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 |
@@ -748,6 +751,7 @@ When you need **cross-source verification** to prevent biases or fail-safes from
748
751
  - **Deduplication & Merge**: Normalizes URLs and ranks items by the number of engines that found them (`seenIn` counts), with cross-hit results placed at the top.
749
752
  - **Untrusted Boundary**: Enforces the `<untrusted-web-content>` safety wrapper and trims snippets.
750
753
  - ⚠️ Note: Running multiple engines in parallel consumes more search quota; use on demand when high source diversity is needed.
754
+ - **Same-billing upstream dedup (0.15.0)**: `deepseek-tools` and `deepseek-official` share one `DEEPSEEK_API_KEY` (same account), so naming both in multi mode would **double-bill** it; only the first-named engine now runs, and the skipped one is listed under `dedupedSameBilling` in the result note.
751
755
 
752
756
  #### Fetch Webpage Content (`web_fetch`)
753
757
 
package/lib/client.js CHANGED
@@ -207,6 +207,8 @@ window.__ModuleLoader__.load({
207
207
  browserFetchTierHint: "⚠️ 以你的登录身份访问网页:仅在 web_fetch 命中登录墙/反爬/JS 空壳页时,改借已登录浏览器重抓(携带 cookie)。默认关;只在确实需要读取登录后内容时开启,建议配合域名白名单使用。结果会标注「经用户浏览器抓取」。",
208
208
  browserFetchAllowHosts: "升级档域名白名单",
209
209
  browserFetchAllowHostsHint: "逗号分隔域名后缀(含子域),如 linkedin.com,weibo.com;空 = 不限制(仍受上方总开关控制)。建议只钉登录墙域名,避免任意 URL 都被带 cookie 访问。",
210
+ deepseekToolsBaseUrl: "DeepSeek Tools 端点(可选)",
211
+ deepseekToolsBaseUrlHint: "默认直连官方 https://api.deepseek.com/v1/tools/search;自建网关可填 base(自动补 /v1/tools/search)或完整端点 URL(走 /v1/search 的网关填完整 URL);留空 = 官方默认,保存即热生效。",
210
212
  sec_engines: "引擎与回退链",
211
213
  sec_behavior: "搜索行为",
212
214
  sec_keys: "API Key",
@@ -350,6 +352,8 @@ window.__ModuleLoader__.load({
350
352
  browserFetchTierHint: "⚠️ Visits pages AS YOU (session cookies). When a web_fetch hits a login wall / anti-bot page / JS shell, the page is re-fetched through the logged-in agent browser instead. Off by default; enable only when you truly need post-login content, ideally with the host allowlist below. Upgraded results are labelled “fetched via user browser”.",
351
353
  browserFetchAllowHosts: "Browser-tier host allowlist",
352
354
  browserFetchAllowHostsHint: "Comma-separated domain suffixes (subdomains included), e.g. linkedin.com,weibo.com; empty = unrestricted (still gated by the master switch above). Recommended: pin only the login-walled domains so arbitrary URLs never get fetched with your cookies.",
355
+ deepseekToolsBaseUrl: "DeepSeek Tools endpoint (optional)",
356
+ deepseekToolsBaseUrlHint: "Defaults to the official https://api.deepseek.com/v1/tools/search; a custom gateway accepts either a base URL (…/v1/tools/search is appended) or the full endpoint URL (fill the full URL for gateways serving /v1/search); empty = official default, takes effect on save.",
353
357
  sec_engines: "Engines & fallback chain",
354
358
  sec_behavior: "Search behaviour",
355
359
  sec_keys: "API keys",
@@ -450,6 +454,7 @@ window.__ModuleLoader__.load({
450
454
  { id: "perplexity", label: "Perplexity", badge: "API KEY", link: "https://www.perplexity.ai/settings/api", price: "按量", noteZh: "免费可用:否;无 key:不可用;配 key:必需 PERPLEXITY_API_KEY;价格:按 token 计费", noteEn: "Free: no; no-key: unavailable; with-key: PERPLEXITY_API_KEY required; price: token-billed" },
451
455
  { id: "serpbase", label: "SerpBase · Google", badge: "API KEY", link: "https://serpbase.dev", price: "送100次", noteZh: "免费可用:注册送;无 key:不可用;配 key:注册送 100 次;价格:超额按量", noteEn: "Free: signup 100; no-key: unavailable; with-key: 100 free calls; price: pay-as-you-go beyond" },
452
456
  { id: "serply", label: "Serply · Google", badge: "API KEY", link: "https://serply.io", price: "2500/月", noteZh: "免费可用:新账户送;无 key:不可用;配 key:30 天内 2500 次免费;价格:超额按量", noteEn: "Free: new-account 2,500/30d; no-key: unavailable; with-key: 2,500 free in 30 days; price: beyond that" },
457
+ { id: "deepseek-tools", label: "DeepSeek Tools · 直连", badge: "API KEY", link: "https://platform.deepseek.com/api_keys", price: "≈5厘/次", noteZh: "免费可用:否;无 key:不可用;配 key:与 DeepSeek Official 共用 DEEPSEEK_API_KEY;价格:按次计费 ≈5厘/次;直连 /v1/tools/search 无模型轮次,同 query 实测 ~0.3s(official 约 5-6s)", noteEn: "Free: no; no-key: unavailable; with-key: shares DEEPSEEK_API_KEY with DeepSeek Official; price: per-call ≈¥0.005; hits /v1/tools/search directly with no model turns — ~0.3s vs ~5-6s for official on the same query" },
453
458
  { id: "deepseek-official", label: "DeepSeek Official", badge: "API KEY", link: "https://platform.deepseek.com/api_keys", price: "≈5厘/次", noteZh: "免费可用:否;无 key:不可用;配 key:必需 DEEPSEEK_API_KEY;价格(2026-10 官方):Search $0.75/千次成功请求 ≈ 单次 5 厘;经 DSH 宿主的服务端工具调用 2026-11-01 前免费", noteEn: "Free: no; no-key: unavailable; with-key: DEEPSEEK_API_KEY; price (2026-10 official): Search $0.75 per 1,000 successful requests ≈ ¥0.005 per request; server-side tool calls via the DSH harness are free until 2026-11-01" },
454
459
  { id: "you", label: "You.com", badge: "API KEY", link: "https://you.com/platform/api-keys", price: "注册送额", noteZh: "免费可用:注册送;无 key:不可用;配 key:注册即送免费额度;价格:超额按量", noteEn: "Free: signup quota; no-key: unavailable; with-key: free on signup; price: pay-as-you-go beyond" },
455
460
  { id: "baidu", label: "Baidu · 百度千帆", badge: "API KEY", link: "https://console.bce.baidu.com/qianfan", price: "50次/日", noteZh: "免费可用:每日赠;无 key:不可用;配 key:每日赠 50 次;价格:超额后付费", noteEn: "Free: 50/day; no-key: unavailable; with-key: 50 free/day; price: post-pay beyond" },
@@ -467,7 +472,7 @@ window.__ModuleLoader__.load({
467
472
  { id: "grok", label: "Grok · X 搜索", badge: "API KEY", link: "https://console.x.ai", price: "按次", noteZh: "免费可用:否;无 key:不可用;配 key:XAI_API_KEY;价格:xAI Responses API + x_search,按 token+工具次数计费,仅显式选用(X/Twitter)", noteEn: "Free: no; no-key: unavailable; with-key: XAI_API_KEY; price: xAI Responses + x_search, token+tool billed, explicit use only (X/Twitter)" },
468
473
  ];
469
474
  const ENGINE_IDS = ENGINES.filter((engine) => engine.id !== "auto" && engine.id !== "multi").map((engine) => engine.id);
470
- const DEFAULT_FALLBACK_ORDER = ["exa", "tavily", "keenable", "firecrawl", "parallel", "perplexity", "serpbase", "serply", "deepseek-official", "you", "baidu", "kimi", "aliyun", "doubao", "zhipu", "bocha", "metaso", "zhihu_global", "zhihu_site", "bing", "anysearch", "ddg", "ddg-lite", "searxng"];
475
+ const DEFAULT_FALLBACK_ORDER = ["exa", "tavily", "keenable", "firecrawl", "parallel", "perplexity", "serpbase", "serply", "deepseek-tools", "deepseek-official", "you", "baidu", "kimi", "aliyun", "doubao", "zhipu", "bocha", "metaso", "zhihu_global", "zhihu_site", "bing", "anysearch", "ddg", "ddg-lite", "searxng"];
471
476
  // SearXNG 公网池展示用(host 端 SEARXNG_INSTANCES 的镜像;探测 public 态时直接探这组)
472
477
  const SEARXNG_PUBLIC_POOL = ["https://opnxng.com", "https://priv.au", "https://searx.be", "https://searx.tiekoetter.com", "https://search.inetol.net", "https://paulgo.io"];
473
478
  const normalizeFallbackOrder = (value) => {
@@ -985,6 +990,7 @@ window.__ModuleLoader__.load({
985
990
  const [fetchTakeover, setFetchTakeover] = react.useState(false);
986
991
  const [browserFetchTier, setBrowserFetchTier] = react.useState(false);
987
992
  const [browserFetchAllowHosts, setBrowserFetchAllowHosts] = react.useState("");
993
+ const [deepseekToolsBaseUrl, setDeepseekToolsBaseUrl] = react.useState("");
988
994
  // 0.10.3:自有 advance_fetch 开关 / SearXNG 语言锁定档
989
995
  const [advanceFetchEnabled, setAdvanceFetchEnabled] = react.useState(true);
990
996
  const [advanceFetchAllowPrivate, setAdvanceFetchAllowPrivate] = react.useState(false);
@@ -1070,6 +1076,7 @@ window.__ModuleLoader__.load({
1070
1076
  setFetchTakeover(v.fetchTakeover === true);
1071
1077
  setBrowserFetchTier(v.browserFetchTier === true);
1072
1078
  setBrowserFetchAllowHosts(typeof v.browserFetchAllowHosts === "string" ? v.browserFetchAllowHosts : "");
1079
+ setDeepseekToolsBaseUrl(typeof v.deepseekToolsBaseUrl === "string" ? v.deepseekToolsBaseUrl : "");
1073
1080
  setAdvanceFetchEnabled(v.advanceFetchEnabled !== false);
1074
1081
  setAdvanceFetchAllowPrivate(v.advanceFetchAllowPrivate === true);
1075
1082
  setSearxngLang(typeof v.searxngLanguage === "string" && v.searxngLanguage ? v.searxngLanguage : "auto");
@@ -1304,6 +1311,7 @@ window.__ModuleLoader__.load({
1304
1311
  ops.push({ op: "set", path: ["fetchTakeover"], value: fetchTakeover });
1305
1312
  ops.push({ op: "set", path: ["browserFetchTier"], value: browserFetchTier });
1306
1313
  ops.push({ op: "set", path: ["browserFetchAllowHosts"], value: String(browserFetchAllowHosts).trim() });
1314
+ ops.push({ op: "set", path: ["deepseekToolsBaseUrl"], value: String(deepseekToolsBaseUrl).trim() });
1307
1315
  ops.push({ op: "set", path: ["advanceFetchEnabled"], value: advanceFetchEnabled });
1308
1316
  ops.push({ op: "set", path: ["advanceFetchAllowPrivate"], value: advanceFetchAllowPrivate });
1309
1317
  ops.push({ op: "set", path: ["searxngLanguage"], value: searxngLang });
@@ -2144,6 +2152,27 @@ react_jsx_runtime.jsx(Section, { id: "keys", title: t.sec_keys, defaultOpen: tru
2144
2152
  setSaveError("");
2145
2153
  },
2146
2154
  }),
2155
+ react_jsx_runtime.jsx("p", {
2156
+ className: "dshfs-hint",
2157
+ children: t.deepseekToolsBaseUrl,
2158
+ }),
2159
+ react_jsx_runtime.jsx("input", {
2160
+ className: "dshfs-input",
2161
+ type: "text",
2162
+ placeholder: "https://api.deepseek.com/v1/tools/search",
2163
+ value: deepseekToolsBaseUrl,
2164
+ disabled: !ready || saving,
2165
+ onChange: (e) => {
2166
+ setDeepseekToolsBaseUrl(e.target.value);
2167
+ setDirty(true);
2168
+ setFailed(false);
2169
+ setSaveError("");
2170
+ },
2171
+ }),
2172
+ react_jsx_runtime.jsx("p", {
2173
+ className: "dshfs-hint",
2174
+ children: t.deepseekToolsBaseUrlHint,
2175
+ }),
2147
2176
  priceTag("baidu"),
2148
2177
  react_jsx_runtime.jsx("input", {
2149
2178
  className: "dshfs-input",