dsh-free-search 0.4.29 → 0.4.30
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 +14 -4
- package/cordis.patch.yml +4 -2
- package/lib/client.js +33 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ dsh 默认的搜索 provider 依赖 DeepSeek 官方 API key(`DEEPSEEK_API_KEY`
|
|
|
30
30
|
|
|
31
31
|
- **零成本** —— 多个免费引擎,无需 key、无需注册
|
|
32
32
|
- **多引擎可选**:DuckDuckGo(html/lite)、Bing、SearXNG(元搜索,支持自定义实例)、AnySearch、Exa、Tavily、Keenable、Firecrawl、Parallel、Perplexity、SerpBase、DeepSeek 官方
|
|
33
|
-
- **网页设置页** —— 引擎切换 + API key 配置(UI 中 key 脱敏显示"已配置")+
|
|
33
|
+
- **网页设置页** —— 引擎切换 + API key 配置(UI 中 key 脱敏显示"已配置")+ 中英文切换;DSH 0.1.6-alpha.2+ 入口在左侧「插件」页的组件行配置,旧版在「设置 → 插件 → 可配置」
|
|
34
34
|
- **弹出式切换命令** —— 聊天框输入 `/free-search-engine`,弹出引擎选择窗口,点选即切换(等效设置页 + 保存)
|
|
35
35
|
- **引擎测试** —— `free_search_test` 工具让 agent 一键测试所有引擎;设置页也有"测试引擎"按钮(直测当前引擎,不走回退链,付费引擎无 key 会明确报错)
|
|
36
36
|
- **统一引擎回退** —— 任何引擎失败(付费/免费,缺 key/401/限流/网络)自动轮流尝试下一个引擎:首选引擎 → 其他引擎(exa/tavily/keenable/firecrawl 无 key 也会尝试,因为它们自带 keyless 免费额度)→ 剩余免费引擎,搜索永不直接失败;结果顶部注明实际生效的引擎(如 `Note: perplexity unavailable or failed, using exa.`)
|
|
@@ -113,7 +113,12 @@ dsh web
|
|
|
113
113
|
|
|
114
114
|
#### 网页设置(推荐)
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
安装后按 DSH 版本打开配置页:
|
|
117
|
+
|
|
118
|
+
- **DSH 0.1.6-alpha.2 及以上**:左侧 **插件** 页 → **已安装** 分组 → `free-search` → 点击组件行 `web-search-free`(行内"配置"入口)
|
|
119
|
+
- **DSH 0.1.5 及更早**:**设置 → 插件 → 可配置** 标签页 → **Free Search** 卡片
|
|
120
|
+
|
|
121
|
+
配置页提供:
|
|
117
122
|
|
|
118
123
|
- **Search engine**:下拉框切换引擎,保存即生效
|
|
119
124
|
- **API keys**:为 Exa / Tavily / Keenable / Firecrawl / Parallel / Perplexity / DeepSeek 填写 key(密码框,保存后只显示"已配置")
|
|
@@ -294,7 +299,7 @@ This plugin provides multiple free search engines with automatic fallback, compl
|
|
|
294
299
|
|
|
295
300
|
- **Zero Cost** — Multiple free engines with no API key or registration required
|
|
296
301
|
- **Multi-Engine Support** — DuckDuckGo (HTML / Lite), Bing, AnySearch AI, SearXNG (meta-search with custom instances), Exa, Tavily, Keenable, Firecrawl, Parallel, Perplexity, SerpBase, and DeepSeek Official
|
|
297
|
-
- **Web Settings UI** — Engine switching, API key configuration (keys masked as "configured" in the UI), and a Chinese/English toggle
|
|
302
|
+
- **Web Settings UI** — Engine switching, API key configuration (keys masked as "configured" in the UI), and a Chinese/English toggle; on DSH 0.1.6-alpha.2+ the entry is the component-row config on the sidebar Plugins page, on older versions Settings → Plugins → Configurable
|
|
298
303
|
- **Popup Switch Command** — Type `/free-search-engine` in the chat: a picker opens with all engines; click one to switch (equivalent to the settings page + save)
|
|
299
304
|
- **Engine Testing** — `free_search_test` for the agent to check all engines in one call; the settings UI also has a "Test engine" button that tests the selected engine directly (no fallback chain; paid engines without a key report an explicit error)
|
|
300
305
|
- **Unified Engine Fallback** — Any engine failure (paid or free, missing key, 401, rate limit, network error) automatically tries the next engine: the configured engine first, then other engines (exa/tavily/keenable/firecrawl are tried even without a key because they have built-in keyless quota), then the remaining free engines (Bing/AnySearch etc.) — with a note attached to the results naming the engine that actually served them (e.g. `Note: perplexity unavailable or failed, using exa.`). Search never fails outright.
|
|
@@ -377,7 +382,12 @@ This plugin intentionally specifies `@deepseek-ai/dsh-settings` and `@deepseek-a
|
|
|
377
382
|
|
|
378
383
|
#### Web Settings (Recommended)
|
|
379
384
|
|
|
380
|
-
After installation,
|
|
385
|
+
After installation, open the config page according to your DSH version:
|
|
386
|
+
|
|
387
|
+
- **DSH 0.1.6-alpha.2 and later**: sidebar **Plugins** page → **Installed** group → `free-search` → click the `web-search-free` component row (the row's "configure" entry)
|
|
388
|
+
- **DSH 0.1.5 and earlier**: **Settings → Plugins → Configurable** tab → **Free Search** card
|
|
389
|
+
|
|
390
|
+
The config page provides:
|
|
381
391
|
|
|
382
392
|
- **Search engine**: Select an engine from the dropdown; changes take effect immediately upon saving.
|
|
383
393
|
- **API keys**: Enter keys for Exa / Tavily / Keenable / Firecrawl / Parallel / Perplexity / DeepSeek (password fields; displayed as "configured" once saved).
|
package/cordis.patch.yml
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# dsh-free-search — free web search providers (no API key needed)
|
|
2
2
|
# Registers the free-search plugin into ctx.web + a settings bridge
|
|
3
3
|
# (/api/dsh-free-search-settings) that serves the "free-search" namespace.
|
|
4
|
-
# The engine (ddg / ddg-lite / bing) is chosen from the web Settings page
|
|
5
|
-
#
|
|
4
|
+
# The engine (ddg / ddg-lite / bing) is chosen from the web Settings page:
|
|
5
|
+
# DSH 0.1.6-alpha.2+: sidebar Plugins page -> Installed -> free-search -> row config
|
|
6
|
+
# DSH 0.1.5 and earlier: Settings > Plugins > Configurable > Free Search
|
|
7
|
+
# or from settings.yaml:
|
|
6
8
|
# free-search:
|
|
7
9
|
# provider: bing
|
|
8
10
|
# region: cn-zh # DuckDuckGo region
|
package/lib/client.js
CHANGED
|
@@ -13,6 +13,10 @@ window.__ModuleLoader__.load({
|
|
|
13
13
|
".dshfs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}",
|
|
14
14
|
".dshfs-header{width:100%;color:inherit;cursor:pointer;text-align:left;font:inherit;background:0 0;border:0;align-items:center;gap:8px;padding:10px 14px;display:flex}",
|
|
15
15
|
".dshfs-header:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}",
|
|
16
|
+
// 插件页 page 模式:页面自带标题,卡片固定展开、表头不可折叠
|
|
17
|
+
".dshfs-pageMode>.dshfs-header{cursor:default}",
|
|
18
|
+
".dshfs-pageMode>.dshfs-header:hover{background:0 0}",
|
|
19
|
+
".dshfs-pageMode .dshfs-chevron{display:none}",
|
|
16
20
|
".dshfs-headText{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex;overflow:hidden}",
|
|
17
21
|
".dshfs-name{color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;font-weight:600;overflow:hidden}",
|
|
18
22
|
".dshfs-description{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}",
|
|
@@ -298,6 +302,14 @@ window.__ModuleLoader__.load({
|
|
|
298
302
|
return response.json();
|
|
299
303
|
}
|
|
300
304
|
|
|
305
|
+
// 插件页行配置的摘要文案(bundle 页每行显示;不触发 bridge 读取)
|
|
306
|
+
function summaryText() {
|
|
307
|
+
const primary = typeof navigator === "undefined" ? "zh" : String((navigator.languages && navigator.languages[0]) || navigator.language || "zh").toLowerCase();
|
|
308
|
+
return primary.startsWith("en")
|
|
309
|
+
? "13 engines · time filtering · platform search · web_fetch"
|
|
310
|
+
: "13 个搜索引擎 · 时间筛选 · 平台搜索 · web_fetch";
|
|
311
|
+
}
|
|
312
|
+
|
|
301
313
|
function FreeSearchCard(props) {
|
|
302
314
|
// 检测应用主题深浅(读 body 的 --dsw-alias-bg-base 变量亮度),用于锁定原生下拉配色
|
|
303
315
|
const isDarkScheme = react.useMemo(() => {
|
|
@@ -319,7 +331,10 @@ window.__ModuleLoader__.load({
|
|
|
319
331
|
return typeof matchMedia === "function" ? matchMedia("(prefers-color-scheme: dark)").matches : false;
|
|
320
332
|
}, []);
|
|
321
333
|
const selectColorScheme = isDarkScheme ? "dark" : "light";
|
|
322
|
-
|
|
334
|
+
// 插件页(0.1.6-alpha.2+ 的 plugins.row.config)以 page 模式复用本卡片:
|
|
335
|
+
// 页面自带标题/面包屑,卡片固定展开、表头不再可折叠。
|
|
336
|
+
const pageMode = !!(props && props.page);
|
|
337
|
+
const [open, setOpen] = react.useState(pageMode);
|
|
323
338
|
const [state, setState] = react.useState({ status: "loading" });
|
|
324
339
|
const [provider, setProvider] = react.useState("bing");
|
|
325
340
|
const [safeSearch, setSafeSearch] = react.useState("off");
|
|
@@ -566,13 +581,13 @@ window.__ModuleLoader__.load({
|
|
|
566
581
|
};
|
|
567
582
|
|
|
568
583
|
return react_jsx_runtime.jsx("li", {
|
|
569
|
-
className: open ? "dshfs-card dshfs-cardOpen" : "dshfs-card",
|
|
584
|
+
className: (open ? "dshfs-card dshfs-cardOpen" : "dshfs-card") + (pageMode ? " dshfs-pageMode" : ""),
|
|
570
585
|
children: [
|
|
571
586
|
react_jsx_runtime.jsx("button", {
|
|
572
587
|
type: "button",
|
|
573
588
|
className: "dshfs-header",
|
|
574
|
-
"aria-expanded": open,
|
|
575
|
-
onClick: () => setOpen(!open),
|
|
589
|
+
"aria-expanded": pageMode ? void 0 : open,
|
|
590
|
+
onClick: pageMode ? void 0 : () => setOpen(!open),
|
|
576
591
|
children: [
|
|
577
592
|
react_jsx_runtime.jsx("span", { className: "dshfs-headText", children: [
|
|
578
593
|
react_jsx_runtime.jsx("span", { className: "dshfs-name", children: title }),
|
|
@@ -1069,6 +1084,20 @@ react_jsx_runtime.jsx("div", {
|
|
|
1069
1084
|
FreeSearchCard
|
|
1070
1085
|
)
|
|
1071
1086
|
);
|
|
1087
|
+
// 挂 0.1.6-alpha.2+ 的插件页 slot:侧栏 插件 → 已安装 → free-search → 行配置页。
|
|
1088
|
+
// key 规则见 ui-plugin-manager 的 rowConfigKey:<包名>#<patch 里声明的行 id>。
|
|
1089
|
+
ctx.slots.inject("plugins.row.config", () =>
|
|
1090
|
+
ctx.slots.register(
|
|
1091
|
+
{
|
|
1092
|
+
name: "plugins.row.config",
|
|
1093
|
+
key: "dsh-free-search#web-search-free",
|
|
1094
|
+
},
|
|
1095
|
+
(slotProps) =>
|
|
1096
|
+
slotProps && slotProps.view === "summary"
|
|
1097
|
+
? summaryText()
|
|
1098
|
+
: react_jsx_runtime.jsx(FreeSearchCard, { page: true })
|
|
1099
|
+
)
|
|
1100
|
+
);
|
|
1072
1101
|
// /free-search-engine 弹出式命令:输入 "/" 选中后弹出引擎列表,点选即切换。
|
|
1073
1102
|
// 等效于设置页切换引擎+保存;命令只改 provider 配置,搜索仍走回退链。
|
|
1074
1103
|
// description 必须传函数:ui-commands 读回的是 contribution.description(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-free-search",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.30",
|
|
4
4
|
"description": "Free web search for DeepSeek Harness: 13 engines (Bing/DuckDuckGo/AnySearch/SearXNG/Exa/Tavily/Keenable/Firecrawl keyless; Parallel/Perplexity/SerpBase/DeepSeek with key) + time filtering + platform search + web_fetch, with web settings UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|