dsh-union-search 0.13.0 → 0.14.0-rc.2

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.
Files changed (2) hide show
  1. package/lib/client.js +93 -29
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -124,7 +124,9 @@ window.__ModuleLoader__.load({
124
124
  ".dshfs-updatePill:disabled{opacity:.5;cursor:default}",
125
125
  ".dshfs-updateIcon{flex:none;display:block}",
126
126
  ".dshfs-version{color:#6e6e73;font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}",
127
- "@media (prefers-color-scheme: dark){.dshfs-version{color:#a1a1a6}}"
127
+ "@media (prefers-color-scheme: dark){.dshfs-version{color:#a1a1a6}}",
128
+ ".dshfs-sec{border:1px solid rgba(0,0,0,.09);border-radius:10px;margin:8px 0;overflow:hidden}.dshfs-secHead{align-items:center;background:rgba(0,0,0,.03);border:0;cursor:pointer;display:flex;font:inherit;gap:8px;padding:9px 12px;text-align:left;width:100%}.dshfs-secTitle{font-weight:600}.dshfs-secBadge{font-size:11px;opacity:.65}.dshfs-secBody{padding:4px 12px 10px}",
129
+ "@media (prefers-color-scheme: dark){.dshfs-sec{border-color:rgba(255,255,255,.12)}.dshfs-secHead{background:rgba(255,255,255,.05)}}",
128
130
  ].join("");
129
131
  const tagId = "dsh-union-search/card.css";
130
132
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
@@ -205,6 +207,13 @@ window.__ModuleLoader__.load({
205
207
  browserFetchTierHint: "⚠️ 以你的登录身份访问网页:仅在 web_fetch 命中登录墙/反爬/JS 空壳页时,改借已登录浏览器重抓(携带 cookie)。默认关;只在确实需要读取登录后内容时开启,建议配合域名白名单使用。结果会标注「经用户浏览器抓取」。",
206
208
  browserFetchAllowHosts: "升级档域名白名单",
207
209
  browserFetchAllowHostsHint: "逗号分隔域名后缀(含子域),如 linkedin.com,weibo.com;空 = 不限制(仍受上方总开关控制)。建议只钉登录墙域名,避免任意 URL 都被带 cookie 访问。",
210
+ sec_engines: "引擎与回退链",
211
+ sec_behavior: "搜索行为",
212
+ sec_keys: "API Key",
213
+ sec_platform: "平台搜索",
214
+ sec_fetch: "网页抓取",
215
+ sec_block: "屏蔽系统自带搜索",
216
+ sec_update: "版本与更新",
208
217
  advanceFetchEnabled: "advance_fetch 工具",
209
218
  advanceFetchEnabledHint: "【实验性 · 免费】零 key、零按次计费(区别于按次计费的付费搜索 API)。整页 GitHub-Flavored Markdown(宿主同款转换配置)+ CSS selector/fields 定向结构化抽取。关闭后调用被拒绝(热生效),系统提示词也不再宣传该工具。",
210
219
  advanceFetchAllowPrivate: "允许 advance_fetch 访问内网",
@@ -341,6 +350,13 @@ window.__ModuleLoader__.load({
341
350
  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”.",
342
351
  browserFetchAllowHosts: "Browser-tier host allowlist",
343
352
  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.",
353
+ sec_engines: "Engines & fallback chain",
354
+ sec_behavior: "Search behaviour",
355
+ sec_keys: "API keys",
356
+ sec_platform: "Platform search",
357
+ sec_fetch: "Web fetching",
358
+ sec_block: "Block built-in search",
359
+ sec_update: "Version & updates",
344
360
  advanceFetchEnabled: "advance_fetch tool",
345
361
  advanceFetchEnabledHint: "[Experimental · free] No API key and no per-request billing (unlike the metered paid search APIs). Whole-page GitHub-Flavored Markdown (host-twin conversion profile) + CSS selector/fields structured extraction. When off, calls are rejected (hot) and the system prompt stops advertising the tool.",
346
362
  advanceFetchAllowPrivate: "Allow advance_fetch to reach private networks",
@@ -823,6 +839,40 @@ window.__ModuleLoader__.load({
823
839
  });
824
840
  }
825
841
  // 重启入口:清标记 + 就地重开(跳过之后想再看一次,不用去清浏览器存储)
842
+ // 0.14.0 设置抽屉:标题栏 + 可折叠 body;开合态按 id 持久化 localStorage,
843
+ // 读失败(无痕/禁用)回落 defaultOpen,绝不抛。chevron 复用既有旋转样式。
844
+ function Section(props) {
845
+ const storageKey = "dsh.union-search.sec." + props.id;
846
+ const [secOpen, setSecOpen] = react.useState(() => {
847
+ try {
848
+ const raw = localStorage.getItem(storageKey);
849
+ return raw === null ? props.defaultOpen !== false : raw === "1";
850
+ } catch {
851
+ return props.defaultOpen !== false;
852
+ }
853
+ });
854
+ const toggle = () => setSecOpen((o) => {
855
+ try { localStorage.setItem(storageKey, o ? "0" : "1"); } catch {}
856
+ return !o;
857
+ });
858
+ return react_jsx_runtime.jsx("div", {
859
+ className: secOpen ? "dshfs-sec dshfs-secOpen" : "dshfs-sec",
860
+ children: [
861
+ react_jsx_runtime.jsx("button", {
862
+ type: "button",
863
+ className: "dshfs-secHead",
864
+ "aria-expanded": secOpen,
865
+ onClick: toggle,
866
+ children: [
867
+ react_jsx_runtime.jsx("span", { className: "dshfs-secTitle", children: props.title }),
868
+ props.badge ? react_jsx_runtime.jsx("span", { className: "dshfs-secBadge", children: props.badge }) : null,
869
+ react_jsx_runtime.jsx("span", { className: secOpen ? "dshfs-chevron dshfs-chevronOpen" : "dshfs-chevron", children: "\u25BE" }),
870
+ ],
871
+ }),
872
+ secOpen ? react_jsx_runtime.jsx("div", { className: "dshfs-secBody", children: props.children }) : null,
873
+ ],
874
+ });
875
+ }
826
876
  function GuideRestartButton(props) {
827
877
  const labels = guideLabels(guideLocale(props.locale));
828
878
  return react_jsx_runtime.jsx("button", {
@@ -1472,6 +1522,7 @@ window.__ModuleLoader__.load({
1472
1522
  onClose: () => setGuideOpen(false),
1473
1523
  })
1474
1524
  : null,
1525
+ react_jsx_runtime.jsx(Section, { id: "engines", title: t.sec_engines, defaultOpen: true, children: [
1475
1526
  react_jsx_runtime.jsx("div", {
1476
1527
  className: "dshfs-field",
1477
1528
  children: [
@@ -1664,6 +1715,8 @@ react_jsx_runtime.jsx("div", {
1664
1715
  }),
1665
1716
  ],
1666
1717
  }),
1718
+ ] }),
1719
+ react_jsx_runtime.jsx(Section, { id: "behavior", title: t.sec_behavior, defaultOpen: false, children: [
1667
1720
  react_jsx_runtime.jsx("div", {
1668
1721
  className: "dshfs-field",
1669
1722
  children: [
@@ -1900,6 +1953,36 @@ react_jsx_runtime.jsx("div", {
1900
1953
  },
1901
1954
  "searxng-field"
1902
1955
  ),
1956
+ react_jsx_runtime.jsx("div", {
1957
+ className: "dshfs-field",
1958
+ children: [
1959
+ react_jsx_runtime.jsx("div", {
1960
+ className: "dshfs-label",
1961
+ children: t.cacheTtl,
1962
+ }),
1963
+ react_jsx_runtime.jsx("input", {
1964
+ className: "dshfs-input dshfs-ttl",
1965
+ type: "number",
1966
+ min: 0,
1967
+ max: 5,
1968
+ step: 1,
1969
+ value: cacheTtl,
1970
+ disabled: !ready || saving,
1971
+ onChange: (e) => {
1972
+ setCacheTtl(Number(e.target.value));
1973
+ setDirty(true);
1974
+ setFailed(false);
1975
+ setSaveError("");
1976
+ },
1977
+ }),
1978
+ react_jsx_runtime.jsx("p", {
1979
+ className: "dshfs-hint",
1980
+ children: t.cacheTtlHint,
1981
+ }),
1982
+ ],
1983
+ }),
1984
+ ] }),
1985
+ react_jsx_runtime.jsx(Section, { id: "keys", title: t.sec_keys, defaultOpen: true, children: [
1903
1986
  react_jsx_runtime.jsx("div", {
1904
1987
  className: "dshfs-field",
1905
1988
  children: [
@@ -2264,6 +2347,8 @@ react_jsx_runtime.jsx("div", {
2264
2347
  }),
2265
2348
  ],
2266
2349
  }),
2350
+ ] }),
2351
+ react_jsx_runtime.jsx(Section, { id: "platform", title: t.sec_platform, defaultOpen: false, children: [
2267
2352
  react_jsx_runtime.jsx("div", {
2268
2353
  className: "dshfs-field",
2269
2354
  children: [
@@ -2305,34 +2390,8 @@ react_jsx_runtime.jsx("div", {
2305
2390
  }),
2306
2391
  ],
2307
2392
  }),
2308
- react_jsx_runtime.jsx("div", {
2309
- className: "dshfs-field",
2310
- children: [
2311
- react_jsx_runtime.jsx("div", {
2312
- className: "dshfs-label",
2313
- children: t.cacheTtl,
2314
- }),
2315
- react_jsx_runtime.jsx("input", {
2316
- className: "dshfs-input dshfs-ttl",
2317
- type: "number",
2318
- min: 0,
2319
- max: 5,
2320
- step: 1,
2321
- value: cacheTtl,
2322
- disabled: !ready || saving,
2323
- onChange: (e) => {
2324
- setCacheTtl(Number(e.target.value));
2325
- setDirty(true);
2326
- setFailed(false);
2327
- setSaveError("");
2328
- },
2329
- }),
2330
- react_jsx_runtime.jsx("p", {
2331
- className: "dshfs-hint",
2332
- children: t.cacheTtlHint,
2333
- }),
2334
- ],
2335
- }),
2393
+ ] }),
2394
+ react_jsx_runtime.jsx(Section, { id: "block", title: t.sec_block, defaultOpen: false, children: [
2336
2395
  react_jsx_runtime.jsx("div", {
2337
2396
  className: "dshfs-field",
2338
2397
  children: [
@@ -2359,6 +2418,8 @@ react_jsx_runtime.jsx("div", {
2359
2418
  }),
2360
2419
  ],
2361
2420
  }),
2421
+ ] }),
2422
+ react_jsx_runtime.jsx(Section, { id: "fetch", title: t.sec_fetch, defaultOpen: false, children: [
2362
2423
  react_jsx_runtime.jsx("div", {
2363
2424
  className: "dshfs-field",
2364
2425
  children: [
@@ -2480,6 +2541,7 @@ react_jsx_runtime.jsx("div", {
2480
2541
  }),
2481
2542
  ],
2482
2543
  }),
2544
+ ] }),
2483
2545
  react_jsx_runtime.jsx("div", {
2484
2546
  className: "dshfs-resultRow",
2485
2547
  children: [
@@ -2505,6 +2567,7 @@ react_jsx_runtime.jsx("div", {
2505
2567
  children: t.unavailable,
2506
2568
  })
2507
2569
  : null,
2570
+ react_jsx_runtime.jsx(Section, { id: "update", title: t.sec_update, defaultOpen: false, children: [
2508
2571
  react_jsx_runtime.jsx("div", {
2509
2572
  className: "dshfs-footer",
2510
2573
  children: [
@@ -2717,6 +2780,7 @@ react_jsx_runtime.jsx("div", {
2717
2780
  : null,
2718
2781
  ],
2719
2782
  })
2783
+ ] }),
2720
2784
  ],
2721
2785
  })
2722
2786
  : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-union-search",
3
- "version": "0.13.0",
3
+ "version": "0.14.0-rc.2",
4
4
  "description": "Union web search for DeepSeek Harness (renamed from dsh-free-search): free keyless engines + many professional paid search APIs — 28 engines (Bing/DuckDuckGo/AnySearch/SearXNG multi-instance union/Exa/Tavily/Keenable/Firecrawl/Parallel keyless; Zhihu global/site via MCP and Perplexity/SerpBase/Serply/DeepSeek official/You.com/Baidu/Kimi/Aliyun/Doubao/Zhipu/Bocha/Metaso with key; OpenAI/Gemini/Claude/Grok model built-in search, explicit-only) + auto smart routing + global engine enable/disable & fallback priority + multi mode (parallel top-3 merge) + multi_search cross-source tool + failure-aware fallback + block system built-in search toggle + experimental free advance_fetch (no API key, no billing; host-twin GitHub-Flavored Markdown conversion + CSS selector/fields structured extraction) + time filtering + platform search + web_fetch, with web settings UI.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",