dsh-free-search 0.4.3 → 0.4.4
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.en.md +190 -163
- package/README.md +189 -162
- package/lib/client.js +11 -0
- package/lib/index.js +5 -0
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -1,163 +1,190 @@
|
|
|
1
|
-
# dsh-free-search
|
|
2
|
-
|
|
3
|
-
**Free web search
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
1
|
+
# dsh-free-search
|
|
2
|
+
|
|
3
|
+
**Free web search plugin for DeepSeek Harness — no API key required, zero cost, multi-engine switcher.** A plugin that adds multi-engine search providers to DeepSeek Harness (dsh), registered into the `ctx.web` seam. The built-in `web_search` tool picks it up automatically. Supports switching engines via the web settings UI, configuring API keys, and one-click testing of all search engines.
|
|
4
|
+
|
|
5
|
+
English | [中文](./README.md)
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
<a href="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-free1.png">
|
|
9
|
+
<img src="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-free1.png" alt="Free Engine Settings (Bing)" width="820" />
|
|
10
|
+
</a>
|
|
11
|
+
<br>
|
|
12
|
+
<sub>▲ Free engine (using Bing as an example)</sub>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
## Why You Need It
|
|
16
|
+
|
|
17
|
+
dsh's default search provider relies on the official DeepSeek API key (`DEEPSEEK_API_KEY`). If you:
|
|
18
|
+
- Do not have (or prefer not to use) an official DeepSeek key,
|
|
19
|
+
- Use a gateway like opencode-go (whose OpenAI-compatible endpoint does not support the `web_search` tool),
|
|
20
|
+
|
|
21
|
+
...then the built-in search will inevitably fail, and the agent will tell you "I cannot access the internet."
|
|
22
|
+
|
|
23
|
+
This plugin provides multiple free search engines with automatic fallback, completely freeing you from relying on DeepSeek's official key.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Zero Cost** — Multiple free engines with no API key or registration required
|
|
28
|
+
- **Multi-Engine Support** — DuckDuckGo (HTML / Lite), Bing, AnySearch AI, SearXNG (meta-search with custom instances), Exa, Perplexity, and DeepSeek Official
|
|
29
|
+
- **Web Settings UI** — Engine switching and API key configuration (API keys are masked in the UI and displayed as "configured")
|
|
30
|
+
- **Engine Testing Tool** — `free_search_test`, allowing the agent to test the availability of all engines in a single call
|
|
31
|
+
- **Automatic Fallback** — Automatically falls back to the next available free engine if one fails or gets rate-limited
|
|
32
|
+
- **System Prompt Injection** — The agent is aware of the currently active engine and which engines require API keys
|
|
33
|
+
- **Visual Badges** — Free engines feature a green `FREE` badge, while paid engines show an orange `API KEY` badge in the settings UI
|
|
34
|
+
- **Webpage Fetching (`web_fetch`)** — Allows the agent to read full webpage contents (official `dsh-web-fetch-http` provider, pure JS, zero extra dependencies)
|
|
35
|
+
- **Platform Search (`platform_search`)** — Search GitHub / V2EX / Bilibili (public APIs, zero extra dependencies)
|
|
36
|
+
- **Clean Integration** — Implements the official `WebSearchProvider` seam interface, coexisting seamlessly with official plugins
|
|
37
|
+
|
|
38
|
+
## Supported Engines
|
|
39
|
+
|
|
40
|
+
| id | Engine | Cost | Description |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
| `ddg` | DuckDuckGo HTML | Free | Occasional rate limits (anti-bot challenges); recovers automatically |
|
|
43
|
+
| `ddg-lite` | DuckDuckGo Lite | Free | Lightweight version; same rate-limit behavior as above |
|
|
44
|
+
| `bing` | Bing | Free | **Default engine**, most stable, optimized for Chinese (`zh-CN`) |
|
|
45
|
+
| `anysearch` | AnySearch AI | Free | AI search, no key needed (anonymous quota) |
|
|
46
|
+
| `searxng` | SearXNG Meta Search | Free | Multi-instance automatic failover; supports custom instances |
|
|
47
|
+
| `exa` | Exa | Free | **Usable without a key** (anonymous MCP); configure a key for higher quota |
|
|
48
|
+
| `perplexity` | Perplexity | Paid | Requires `PERPLEXITY_API_KEY` |
|
|
49
|
+
| `deepseek-official` | DeepSeek Official | Paid | Requires `DEEPSEEK_API_KEY` |
|
|
50
|
+
|
|
51
|
+
- **Default engine is `bing`** (free and most stable), ready to use out of the box after installation.
|
|
52
|
+
- Free engines automatically fall back to other free engines upon failure. Paid engines report clear error messages when keys are missing or invalid, avoiding silent fallbacks.
|
|
53
|
+
- **Official Links in Settings**: Free engines display "Visit Website →", while paid engines display "Get API Key →" (opens in a new tab):
|
|
54
|
+
- Exa: <https://dashboard.exa.ai/api-keys>
|
|
55
|
+
- Perplexity: <https://www.perplexity.ai/settings/api>
|
|
56
|
+
- DeepSeek: <https://platform.deepseek.com/api_keys>
|
|
57
|
+
|
|
58
|
+
### Why is AnySearch free?
|
|
59
|
+
|
|
60
|
+
AnySearch (anysearch.com) is an AI search gateway that provides **anonymous public search quota** — it can be called directly via its `v1/search` REST endpoint without registration or an API key. Quotas are rate-limited (suitable for daily queries), but as one of the free engines with mutual fallback, it offers a reliable experience.
|
|
61
|
+
|
|
62
|
+
The same applies to Exa: its public MCP endpoint (`mcp.exa.ai/mcp`) supports anonymous requests, allowing it to work without an API key. Configuring `EXA_API_KEY` grants a higher usage quota.
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
git clone https://github.com/DDDMUC/dsh-free-search.git
|
|
68
|
+
dsh plugin --profile web add /path/to/dsh-free-search
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Then restart:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
dsh web
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Dependency Note
|
|
78
|
+
|
|
79
|
+
This plugin intentionally specifies `@deepseek-ai/dsh-settings` and `@deepseek-ai/dsh-tools` as `peerDependencies`: the DSH runtime must use a single instance from the installation tree. Always install the plugin using `dsh plugin --profile <profile> add ...`. Do **not** copy DSH core packages into a profile-local `node_modules`, as duplicate copies can break the tool scheduler.
|
|
80
|
+
|
|
81
|
+
## Usage
|
|
82
|
+
|
|
83
|
+
### Web Settings (Recommended)
|
|
84
|
+
|
|
85
|
+
After installation, navigate to **Settings → Plugins → Configurable** tab → **Free Search** card (the official settings page):
|
|
86
|
+
|
|
87
|
+
- **Search engine**: Select an engine from the dropdown; changes take effect immediately upon saving.
|
|
88
|
+
- **API keys**: Enter keys for Exa / Perplexity / DeepSeek (password fields; displayed as "configured" once saved).
|
|
89
|
+
- **Use Bing default**: stage a switch back to the stable free Bing engine; `Discard` only cancels unsaved edits.
|
|
90
|
+
|
|
91
|
+
<table align="center" style="border: none; border-collapse: collapse;">
|
|
92
|
+
<tr style="border: none;">
|
|
93
|
+
<td align="center" width="50%" style="border: none; padding: 6px;">
|
|
94
|
+
<a href="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-free.png">
|
|
95
|
+
<img src="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-free.png" alt="Free Engine Settings" width="100%" />
|
|
96
|
+
</a>
|
|
97
|
+
<br>
|
|
98
|
+
<sub>▲ <b>Free Engine</b> (shows green FREE badge and official website link)</sub>
|
|
99
|
+
</td>
|
|
100
|
+
<td align="center" width="50%" style="border: none; padding: 6px;">
|
|
101
|
+
<a href="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-apikey.png">
|
|
102
|
+
<img src="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-apikey.png" alt="Paid/API Key Engine Settings" width="100%" />
|
|
103
|
+
</a>
|
|
104
|
+
<br>
|
|
105
|
+
<sub>▲ <b>Paid / API Key Engine</b> (shows orange API KEY badge and link to get an API key)</sub>
|
|
106
|
+
</td>
|
|
107
|
+
</tr>
|
|
108
|
+
</table>
|
|
109
|
+
|
|
110
|
+
### Configuration File / CLI
|
|
111
|
+
|
|
112
|
+
Configuration is stored in `~/.dsh/settings.yaml`:
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
free-search:
|
|
116
|
+
provider: bing # ddg / ddg-lite / bing / searxng / exa / perplexity / deepseek-official
|
|
117
|
+
bingMarket: zh-CN # Bing market
|
|
118
|
+
region: cn-zh # DuckDuckGo region (optional)
|
|
119
|
+
searxngInstances: # Custom SearXNG instances (optional)
|
|
120
|
+
- https://your-instance.example
|
|
121
|
+
exaApiKey: ... # Or configure via the web settings UI
|
|
122
|
+
perplexityApiKey: ...
|
|
123
|
+
deepseekApiKey: ...
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Asking the Agent to Test All Engines
|
|
127
|
+
|
|
128
|
+
Tell the agent *"Test all search engines"*, and it will call the `free_search_test` tool to check each engine sequentially and report back:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
Search engine test:
|
|
132
|
+
- ddg: FAIL - DuckDuckGo is rate-limited right now (anti-bot challenge, usually temporary) - Bing works
|
|
133
|
+
- bing: OK (2 results, e.g. "DeepSeek Harness developer preview...")
|
|
134
|
+
- exa: FAIL - EXA_API_KEY not configured
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Fetch Webpage Content (`web_fetch`)
|
|
138
|
+
|
|
139
|
+
After searching, the agent can **read full webpage content** (e.g., *"Open the first link and summarize it"*). The `web_fetch` tool is enabled by default (official `dsh-web-fetch-http` provider):
|
|
140
|
+
|
|
141
|
+
- Automatically follows redirects and decodes HTML to plain text.
|
|
142
|
+
- Supports timeout and response size limits.
|
|
143
|
+
- ⚠️ Note: `web_fetch` does not have SSRF protection; the agent could theoretically access internal network addresses. Use as needed.
|
|
144
|
+
|
|
145
|
+
### Platform Search (`platform_search`)
|
|
146
|
+
|
|
147
|
+
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:
|
|
148
|
+
|
|
149
|
+
| Platform | Purpose |
|
|
150
|
+
|---|---|
|
|
151
|
+
| `github` | GitHub repository search (public API, free, no key required) |
|
|
152
|
+
| `v2ex` | V2EX hot / relevant topics |
|
|
153
|
+
| `bilibili` | Bilibili video / content search (public API) |
|
|
154
|
+
|
|
155
|
+
All platform searches rely on public endpoints with zero external dependencies and work out of the box.
|
|
156
|
+
|
|
157
|
+
## Local Engine Switcher (`tools/`)
|
|
158
|
+
|
|
159
|
+
The `tools/` directory includes a lightweight, zero-dependency switcher:
|
|
160
|
+
|
|
161
|
+
- **`启动搜索引擎切换器.cmd`** (Windows) — Double-click to launch a local Node server (`http://127.0.0.1:4789`) and automatically open the engine selector page in your browser.
|
|
162
|
+
- **`switch-engine.html`** — The selector UI: displays current engine status and allows one-click switching.
|
|
163
|
+
- **`server.mjs`** — The local backend service responsible for reading/writing `~/.dsh/profiles/web/cordis.patch.yml`.
|
|
164
|
+
- **`switch-engine.ps1`** — Headless PowerShell script: `powershell -File tools/switch-engine.ps1 -Engine bing`.
|
|
165
|
+
|
|
166
|
+
Restart `dsh web` after switching to apply changes.
|
|
167
|
+
|
|
168
|
+
> The settings card mounts into the official `settings.plugin.item` slot (built into DSH), and configuration reads/writes go through the plugin's own bridge. **No `dsh-web-ui` dependency — the plugin can be used standalone.**
|
|
169
|
+
|
|
170
|
+
## Proxy Note (for Users in Mainland China)
|
|
171
|
+
|
|
172
|
+
Engines like DuckDuckGo may require a proxy. Since Node.js `fetch` does not use the system proxy by default, set the following environment variables for the dsh process (Node 24+):
|
|
173
|
+
|
|
174
|
+
```sh
|
|
175
|
+
export NODE_USE_ENV_PROXY=1
|
|
176
|
+
export HTTPS_PROXY=http://127.0.0.1:7897 # Your proxy address
|
|
177
|
+
export HTTP_PROXY=http://127.0.0.1:7897
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Windows users: The desktop shortcut already includes this configuration (`set NODE_USE_ENV_PROXY=1&& set HTTPS_PROXY=...`).
|
|
181
|
+
|
|
182
|
+
## How It Works
|
|
183
|
+
|
|
184
|
+
- `lib/index.js`: Host side. Implements `WebSearchProvider` (`id` / `available()` / `search()`), multi-engine routing + auto-fallback; registers the `free-search` settings namespace; provides the `/api/dsh-free-search-settings` read/write bridge; registers the `free_search_test` tool; injects the engine list into system prompts.
|
|
185
|
+
- `lib/client.js`: Browser side. React configuration card (engine select + key inputs), mounted into the official `settings.plugin.item` slot (Settings → Plugins → Configurable), without requiring `dsh-web-ui`.
|
|
186
|
+
- `cordis.patch.yml`: Plugin loader configuration.
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,164 +1,191 @@
|
|
|
1
|
-
# dsh-free-search
|
|
2
|
-
|
|
3
|
-
**DeepSeek Harness 免费搜索插件 —— 无需 API key,零成本,多引擎可切换。**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
dsh web
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
###
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
1
|
+
# dsh-free-search
|
|
2
|
+
|
|
3
|
+
**DeepSeek Harness 免费搜索插件 —— 无需 API key,零成本,多引擎可切换。** 一个给 DeepSeek Harness (dsh) 添加多引擎搜索 provider 的插件,注册进 `ctx.web` seam。内置 `web_search` 工具自动选用,支持网页设置页切换引擎、配置 API key、一键测试所有引擎。
|
|
4
|
+
|
|
5
|
+
[English](./README.en.md) | 中文
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
<a href="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-free1.png">
|
|
9
|
+
<img src="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-free1.png" alt="免费引擎设置 (Bing)" width="820" />
|
|
10
|
+
</a>
|
|
11
|
+
<br>
|
|
12
|
+
<sub>▲ 免费引擎(以Bing为例)</sub>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
## 为什么需要它
|
|
16
|
+
|
|
17
|
+
dsh 默认的搜索 provider 依赖 DeepSeek 官方 API key(`DEEPSEEK_API_KEY`)。如果你:
|
|
18
|
+
- 没有(或不想用)DeepSeek 官方 key,
|
|
19
|
+
- 用的是 opencode-go 这类网关(其 OpenAI 兼容端点不支持 `web_search` 工具),
|
|
20
|
+
|
|
21
|
+
……那么内置搜索必然失败,agent 会告诉你"无法联网"。
|
|
22
|
+
|
|
23
|
+
这个插件提供多个免费引擎 + 自动回退,彻底摆脱 DeepSeek 官方 key 的依赖。
|
|
24
|
+
|
|
25
|
+
## 特性
|
|
26
|
+
|
|
27
|
+
- **零成本** —— 多个免费引擎,无需 key、无需注册
|
|
28
|
+
- **多引擎可选**:DuckDuckGo(html/lite)、Bing、SearXNG(元搜索,支持自定义实例)、Exa、Perplexity、DeepSeek 官方
|
|
29
|
+
- **网页设置页** —— 引擎切换 + API key 配置(UI 中 key 脱敏显示"已配置")
|
|
30
|
+
- **引擎测试工具** —— `free_search_test`,让 agent 一键测试所有引擎可用性
|
|
31
|
+
- **自动回退** —— 免费引擎失败/限流时自动切换到下一个可用引擎
|
|
32
|
+
- **系统提示词注入** —— agent 知道当前用哪个引擎、哪些需要 key
|
|
33
|
+
- **免费标注** —— 设置页中免费引擎带绿色 `FREE` 徽章,付费引擎带橙色 `API KEY` 徽章
|
|
34
|
+
- **网页抓取(web_fetch)** —— 让 agent 抓取网页内容(官方 `dsh-web-fetch-http` provider,纯 JS,零额外依赖)
|
|
35
|
+
- **平台搜索(platform_search)** —— 搜 GitHub / V2EX / B站(公开 API,零依赖)
|
|
36
|
+
- **干净集成** —— 实现官方 `WebSearchProvider` seam 接口,与官方插件共存
|
|
37
|
+
|
|
38
|
+
## 引擎列表
|
|
39
|
+
|
|
40
|
+
| id | 引擎 | 费用 | 说明 |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
| `ddg` | DuckDuckGo HTML | 免费 | 偶发限流(反爬),解封自动恢复 |
|
|
43
|
+
| `ddg-lite` | DuckDuckGo Lite | 免费 | 轻量版,同上 |
|
|
44
|
+
| `bing` | Bing | 免费 | **默认引擎**,最稳定,中文优化(zh-CN) |
|
|
45
|
+
| `anysearch` | AnySearch AI | 免费 | AI 搜索,无 key(匿名额度) |
|
|
46
|
+
| `searxng` | SearXNG 元搜索 | 免费 | 多实例自动切换,支持自定义实例 |
|
|
47
|
+
| `exa` | Exa | 免费 | **无 key 也可用**(MCP 匿名),配 key 提升额度 |
|
|
48
|
+
| `perplexity` | Perplexity | 付费 | 需 `PERPLEXITY_API_KEY` |
|
|
49
|
+
| `deepseek-official` | DeepSeek 官方 | 付费 | 需 `DEEPSEEK_API_KEY` |
|
|
50
|
+
|
|
51
|
+
- **默认引擎为 `bing`**(免费且最稳定),安装后开箱即用。
|
|
52
|
+
- 免费引擎失败会自动回退到其他免费引擎;付费引擎缺 key 或 key 无效时报清晰错误,不会静默切换。
|
|
53
|
+
- **设置页有官网链接**:免费引擎显示"访问官网 →",付费引擎显示"获取 API Key →"(新标签页打开):
|
|
54
|
+
- Exa:<https://dashboard.exa.ai/api-keys>
|
|
55
|
+
- Perplexity:<https://www.perplexity.ai/settings/api>
|
|
56
|
+
- DeepSeek:<https://platform.deepseek.com/api_keys>
|
|
57
|
+
|
|
58
|
+
### 为什么 AnySearch 免费?
|
|
59
|
+
|
|
60
|
+
AnySearch(anysearch.com)是一个 AI 搜索网关,提供**匿名的公共搜索额度**——通过其 `v1/search` REST 接口可以直接调用,无需注册或 API key。额度有限流(适合日常搜索),但作为免费引擎之一,与其他免费引擎互相回退,体验稳定。
|
|
61
|
+
|
|
62
|
+
Exa 同理:其公开 MCP 端点(`mcp.exa.ai/mcp`)支持匿名调用,因此不配置 key 也能用;配置 `EXA_API_KEY` 后可获得更高额度。
|
|
63
|
+
|
|
64
|
+
## 安装
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
git clone https://github.com/DDDMUC/dsh-free-search.git
|
|
68
|
+
dsh plugin --profile web add /path/to/dsh-free-search
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
然后重启:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
dsh web
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 依赖说明
|
|
78
|
+
|
|
79
|
+
插件对 `@deepseek-ai/dsh-settings` 和 `@deepseek-ai/dsh-tools` 使用 `peerDependencies`,这是刻意的:DSH 运行时必须使用安装树中的唯一实例。请通过 `dsh plugin --profile <profile> add ...` 安装插件,不要把 DSH 核心包复制进 profile 的本地 `node_modules`;重复副本会导致工具调度器失效。
|
|
80
|
+
|
|
81
|
+
## 使用
|
|
82
|
+
|
|
83
|
+
### 网页设置(推荐)
|
|
84
|
+
|
|
85
|
+
安装后,打开 **设置 → 插件 → 可配置** 标签页 → **Free Search** 卡片(官方设置页):
|
|
86
|
+
|
|
81
87
|
- **Search engine**:下拉框切换引擎,保存即生效
|
|
82
88
|
- **API keys**:为 Exa / Perplexity / DeepSeek 填写 key(密码框,保存后只显示"已配置")
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
free-search
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
让 agent
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
89
|
+
- **Use Bing default**:把当前搜索引擎切回稳定的免费 Bing;`Discard` 只撤销尚未保存的编辑
|
|
90
|
+
|
|
91
|
+
<table align="center" style="border: none; border-collapse: collapse;">
|
|
92
|
+
<tr style="border: none;">
|
|
93
|
+
<td align="center" width="50%" style="border: none; padding: 6px;">
|
|
94
|
+
<a href="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-free.png">
|
|
95
|
+
<img src="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-free.png" alt="免费引擎设置" width="100%" />
|
|
96
|
+
</a>
|
|
97
|
+
<br>
|
|
98
|
+
<sub>▲ <b>免费引擎</b>(显示绿色 FREE 徽章与官网链接)</sub>
|
|
99
|
+
</td>
|
|
100
|
+
<td align="center" width="50%" style="border: none; padding: 6px;">
|
|
101
|
+
<a href="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-apikey.png">
|
|
102
|
+
<img src="https://raw.githubusercontent.com/DDDMUC/dsh-free-search/master/assets/settings-apikey.png" alt="付费引擎设置" width="100%" />
|
|
103
|
+
</a>
|
|
104
|
+
<br>
|
|
105
|
+
<sub>▲ <b>付费/API Key 引擎</b>(显示橙色 API KEY 徽章与获取链接)</sub>
|
|
106
|
+
</td>
|
|
107
|
+
</tr>
|
|
108
|
+
</table>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
### 命令行 / 配置文件
|
|
112
|
+
|
|
113
|
+
配置存在 `~/.dsh/settings.yaml`:
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
free-search:
|
|
117
|
+
provider: bing # ddg / ddg-lite / bing / searxng / exa / perplexity / deepseek-official
|
|
118
|
+
bingMarket: zh-CN # Bing 市场
|
|
119
|
+
region: cn-zh # DuckDuckGo 区域(可选)
|
|
120
|
+
searxngInstances: # 自定义 SearXNG 实例(可选)
|
|
121
|
+
- https://your-instance.example
|
|
122
|
+
exaApiKey: ... # 或通过设置页填写
|
|
123
|
+
perplexityApiKey: ...
|
|
124
|
+
deepseekApiKey: ...
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 让 agent 测试所有引擎
|
|
128
|
+
|
|
129
|
+
对 agent 说"测试一下所有搜索引擎",它会调用 `free_search_test` 工具,逐个测试并报告:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Search engine test:
|
|
133
|
+
- ddg: FAIL - DuckDuckGo is rate-limited right now (anti-bot challenge, usually temporary) - Bing works
|
|
134
|
+
- bing: OK (2 results, e.g. "DeepSeek Harness developer preview...")
|
|
135
|
+
- exa: FAIL - EXA_API_KEY not configured
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 抓取网页内容(web_fetch)
|
|
139
|
+
|
|
140
|
+
搜索到 URL 后,可以让 agent **读取网页全文**(如"打开第一个链接看看内容")。`web_fetch` 工具已启用(官方 `dsh-web-fetch-http` provider):
|
|
141
|
+
|
|
142
|
+
- 自动跟随重定向、解码正文(HTML 转文本)
|
|
143
|
+
- 支持超时和大小限制
|
|
144
|
+
- ⚠️ 注意:`web_fetch` 无 SSRF 防护,agent 理论上可访问内网地址——按需使用
|
|
145
|
+
|
|
146
|
+
### 平台搜索(platform_search)
|
|
147
|
+
|
|
148
|
+
让 agent 搜特定平台,如"在 GitHub 上搜 deepseek harness"、"看看 B站有什么相关视频"、"V2EX 上关于 dsh 的讨论"。`platform_search` 工具支持:
|
|
149
|
+
|
|
150
|
+
| 平台 | 用途 |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `github` | GitHub 仓库搜索(API,免费无 key) |
|
|
153
|
+
| `v2ex` | V2EX 热门/相关主题 |
|
|
154
|
+
| `bilibili` | B站视频/内容搜索(公开接口) |
|
|
155
|
+
|
|
156
|
+
全部走公开 API,零外部依赖,开箱即用。
|
|
157
|
+
|
|
158
|
+
## 本地引擎切换工具(tools/)
|
|
159
|
+
|
|
160
|
+
`tools/` 目录附带了一个本地切换小工具(零依赖):
|
|
161
|
+
|
|
162
|
+
- **`启动搜索引擎切换器.cmd`**(Windows)——双击启动本地 Node 服务(`http://127.0.0.1:4789`)并自动打开浏览器选择页面
|
|
163
|
+
- **`switch-engine.html`** —— 选择页面:显示当前引擎,点选新引擎,一键写入配置
|
|
164
|
+
- **`server.mjs`** —— 本地服务,负责读写 `~/.dsh/profiles/web/cordis.patch.yml`
|
|
165
|
+
- **`switch-engine.ps1`** —— 无界面命令行版:`powershell -File tools/switch-engine.ps1 -Engine bing`
|
|
166
|
+
|
|
167
|
+
切换后重启 `dsh web` 生效。
|
|
168
|
+
|
|
169
|
+
> 配置卡片挂在官方设置页的 `settings.plugin.item` 插槽(dsh 自带),配置读写走插件自建 bridge,**不依赖 dsh-web-ui**,插件可独立使用。
|
|
170
|
+
|
|
171
|
+
## 代理说明(国内用户)
|
|
172
|
+
|
|
173
|
+
DuckDuckGo 等引擎可能需要代理才能访问,而 Node.js 的 `fetch` 默认不走系统代理。需要给 dsh 进程设置(Node 24+):
|
|
174
|
+
|
|
175
|
+
```sh
|
|
176
|
+
export NODE_USE_ENV_PROXY=1
|
|
177
|
+
export HTTPS_PROXY=http://127.0.0.1:7897 # 你的代理地址
|
|
178
|
+
export HTTP_PROXY=http://127.0.0.1:7897
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Windows 用户:桌面快捷方式已内置此配置(`set NODE_USE_ENV_PROXY=1&& set HTTPS_PROXY=...`)。
|
|
182
|
+
|
|
183
|
+
## 工作原理
|
|
184
|
+
|
|
185
|
+
- `lib/index.js`:host 端。实现 `WebSearchProvider`(`id` / `available()` / `search()`),多引擎路由 + 自动回退;注册 `free-search` settings namespace;提供 `/api/dsh-free-search-settings` 读写桥;注册 `free_search_test` 工具;注入引擎清单到系统提示词。
|
|
186
|
+
- `lib/client.js`:浏览器端。React 配置卡片(引擎选择 + key 输入),挂载到官方设置页的 `settings.plugin.item` 插槽(设置 → 插件 → 可配置),不依赖 dsh-web-ui。
|
|
187
|
+
- `cordis.patch.yml`:插件 loader 配置。
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
MIT
|
package/lib/client.js
CHANGED
|
@@ -301,6 +301,17 @@ window.__ModuleLoader__.load({
|
|
|
301
301
|
className: "dshfs-footer",
|
|
302
302
|
children: [
|
|
303
303
|
failed ? react_jsx_runtime.jsx("p", { className: "dshfs-failed", children: "save failed" }) : null,
|
|
304
|
+
react_jsx_runtime.jsx("button", {
|
|
305
|
+
className: "dshfs-btn",
|
|
306
|
+
type: "button",
|
|
307
|
+
onClick: () => {
|
|
308
|
+
setProvider("bing");
|
|
309
|
+
setDirty(true);
|
|
310
|
+
setFailed(false);
|
|
311
|
+
},
|
|
312
|
+
disabled: saving || !ready || provider === "bing",
|
|
313
|
+
children: "Use Bing default",
|
|
314
|
+
}),
|
|
304
315
|
react_jsx_runtime.jsx("button", {
|
|
305
316
|
className: "dshfs-btn",
|
|
306
317
|
type: "button",
|
package/lib/index.js
CHANGED
|
@@ -1048,6 +1048,11 @@ function apply(ctx, config) {
|
|
|
1048
1048
|
const result = await searchPlatform(platform, args.query, limit);
|
|
1049
1049
|
return { platform, sources: result.sources };
|
|
1050
1050
|
},
|
|
1051
|
+
finalizeContent(exec, result) {
|
|
1052
|
+
// Tool-result content must be an array of content blocks, not a raw string.
|
|
1053
|
+
const text = result.content;
|
|
1054
|
+
return typeof text === "string" && text.length > 0 ? [{ type: "text", text }] : undefined;
|
|
1055
|
+
},
|
|
1051
1056
|
})
|
|
1052
1057
|
);
|
|
1053
1058
|
return () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-free-search",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Free web search for DeepSeek Harness: 8 engines (Bing/DuckDuckGo/AnySearch/SearXNG/Exa keyless) + platform search + web_fetch, with web settings UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|