dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DeepSeek Harness 轻量级搜索插件 — 不走 DeepSeek 官方 LLM 搜索,可插拔后端,零 token 成本
DeepSeek Harness 免费搜索插件 —— 零成本、零 API key、零模型调用。
DSH 官方网页搜索强制依赖 DeepSeek V4 Flash 模型(Anthropic 格式),每次搜索都消耗一次模型调用。本插件用纯 HTTP 抓取免费搜索引擎(Bing / DuckDuckGo / SearXNG / AnySearch),不调用任何模型、不需要任何 API key,任何第三方网关/中转用户都能直接联网搜索。
DSH 官方自带的网页搜索插件(dsh-web-search-deepseek)会强制调用 DeepSeek V4 Flash 模型,并以 Anthropic 格式(/anthropic/v1/messages + web_search_20250305 工具)发起请求:
本插件用普通 HTTP 抓取免费搜索引擎,完全不调用模型,任何网络环境都能用,搜索本身零成本。
| 功能 | 说明 |
|---|---|
| 🆓 零成本搜索 | 全部引擎免费、无需 API key、无需注册 |
| 🚫 零模型调用 | 只发普通 HTTP 请求,不消耗任何 token,不依赖 Anthropic 协议 |
| 🔁 自动回退 | 任一引擎失败(限流/反爬/网络错误/0 结果)自动尝试下一个,结果注明实际生效引擎 |
| 🌐 多引擎 | AnySearch(默认)/ Bing / DuckDuckGo / SearXNG,支持自定义 SearXNG 实例 |
| ⚙️ 插件配置页 | 插件管理 → dsh-thin-search → 配置:引擎选择、官方搜索切换、增强开关、平台开关、缓存时长 |
| 💬 弹出式切换 | 聊天框输入 /thin-search-engine,点选即切换引擎 |
| 🧪 引擎测试 | free_search_test 工具 + 插件配置页"测试引擎"按钮 |
| 🕒 时效 | 按时间范围限定搜索结果,如「最近一周的新闻」 |
| 🔎 平台搜索 | platform_search:GitHub / V2EX / Bilibili / Reddit / Hacker News / Stack Overflow / Wikipedia / npm(公开 API,零 key) |
| 🧠 搜索增强 | 可选(默认关):LLM 把口语化输入规范化为搜索关键词,改善中文问句效果;⚠️ 开启后消耗 Token;支持自定义提示词 |
| 🚀 网络代理 | 内置 HTTP/HTTPS 代理(undici ProxyAgent),仅本插件生效,不污染 DSH 全局 |
| 📦 结果缓存 | LRU 50 条,TTL 0-5 分钟可配,防免费引擎限流 |
| 🤝 干净集成 | 实现官方 WebSearchProvider seam,与官方插件共存,patch 自动接管 web.searchProvider |
| id | 引擎 | 说明 |
|---|---|---|
anysearch | AnySearch AI | 默认引擎,对中文自然语言问句理解最好,免费无 key |
bing | Bing | 免费,速度快,中文优化(bingMarket: zh-CN) |
searxng | SearXNG 元搜索 | 免费,多个公开实例自动切换,支持自定义实例 |
ddg | DuckDuckGo HTML | 免费,共享 IP 上可能限流(自动回退) |
ddg-lite | DuckDuckGo Lite | 免费,同上 |
# 从 npm 安装(发布后)
dsh plugin --profile web add dsh-thin-search
# 或从 GitHub 安装
dsh plugin --profile web add github:loommii/dsh-thin-search
# 或本地源码(开发/自用)
git clone git@github.com:loommii/dsh-thin-search.git
dsh plugin --profile web add /path/to/dsh-thin-search
安装后重启 dsh web 生效。插件通过 patch 自动把 web.searchProvider 指向本插件,无需手动配置。
dsh plugin --profile web remove dsh-thin-search
卸载后重启 dsh web,即可恢复 DSH 官方默认搜索。
依赖说明:
@deepseek-ai/dsh-atomic-write、dsh-llm、dsh-settings、dsh-tools、dsh-web均使用peerDependencies,DSH 运行时必须使用安装树中的唯一实例。请用dsh plugin --profile <profile> add ...安装,不要把 DSH 核心包复制进 profile 的本地node_modules。
安装重启后,在任意会话直接对 agent 说"帮我搜索……"即可 —— 默认引擎 AnySearch,开箱即用。
打开 插件管理 → dsh-thin-search → 配置(DSH 0.1.7 起插件配置统一挂在插件管理页):
cordis.patch.yml,重启 DSH 后生效(页面会提示)anysearch)http://127.0.0.1:7890),用于访问需要外网的引擎。V2Ray / Clash 需开启 HTTP 端口;不支持 SOCKS5。留空 = 直连,保存即生效platform_search 工具按此过滤)输入 /thin-search-engine 弹出引擎选择窗口(和 /model 一样的交互),点选即切换,当前引擎会标记出来。命令只改首选引擎,搜索仍走自动回退链。
~/.dsh/profiles/<profile>/cordis.patch.yml)DSH 0.1.7 起,用户设置直接持久化到当前 profile 的 cordis.patch.yml。手工配置时使用 thin-search 条目:
- id: thin-search
name: dsh-thin-search
config:
provider: anysearch # anysearch / bing / ddg / ddg-lite / searxng
searchEnhance: false # 搜索增强:LLM 规范化搜索词(默认关,开启消耗 Token)
enhanceModel: "" # 增强模型 "provider:model";空 = 跟随 DSH 默认模型
proxy: "" # HTTP/HTTPS 代理,如 http://127.0.0.1:7890;空 = 直连
bingMarket: zh-CN # Bing 市场
region: cn-zh # DuckDuckGo 区域(可选)
searxngInstances: # 自定义 SearXNG 实例(可选)
- https://your-instance.example
platforms: # platform_search 启用列表
- github
- v2ex
- bilibili
- reddit
- hn
- stackoverflow
- wikipedia
- npm
cacheTtl: 5 # 结果缓存分钟数(0-5)
Bing / AnySearch 在多数网络环境可直接访问;DuckDuckGo / SearXNG / GitHub 等可能需要代理。本插件内置 HTTP/HTTPS 代理支持(基于 undici ProxyAgent),无需设置系统环境变量:
dsh-thin-search → 配置 → 网络代理:填 http://127.0.0.1:7890(V2Ray / Clash 的 HTTP 端口),保存即生效,无需重启~/.dsh/profiles/<profile>/cordis.patch.yml 中 thin-search.config.proxy作用域:代理只作用于本插件的 11 处引擎请求,不设置全局 dispatcher、不修改 DSH 全局 fetch,其他插件和 DSH 本身不受影响。
⚠️ 已知限制:DuckDuckGo 对代理/数据中心出口 IP 有反爬(HTTP 202 风控页),公共 SearXNG 实例对代理 IP 普遍限流(HTTP 429)。代理场景下推荐 Bing / AnySearch(实测稳定)。如自建 SearXNG 实例,填入
searxngInstances即可。
对 agent 说"测试一下所有搜索引擎",它会调用 free_search_test 工具并报告:
Search engine test:
- bing: OK (3 results, e.g. "DeepSeek Harness developer preview: Everything is a plugin")
- anysearch: OK (3 results, ...)
- ddg: FAIL - DuckDuckGo anti-bot challenge (HTTP 202): DDG blocks datacenter/proxy egress IPs. Try Bing instead.
对 agent 说「最近一周的新闻」「最近 3 天的消息」,搜索即自动限定在对应时间段,返回较新的结果。
| 形式 | 示例 | 含义 |
|---|---|---|
| 固定档 | day / week / month / year | 1 / 7 / 30 / 365 天 |
| 自定义相对值 | 12h、3d、2mo、1y | 最近 N 小时/天/月/年 |
| 绝对日期 | 2026-07-01 | 该日期(含)之后发布的结果 |
实现上,支持时间范围的引擎(SearXNG / DDG / DDG Lite)会把天数映射到最近似档位(≤2 天 → day,≤14 天 → week,≤90 天 → month,否则 year);Bing / AnySearch 无对应参数会忽略。带 timeRange 时支持时间范围的引擎自动排到回退链前面。
platform_search 支持 GitHub / V2EX / Bilibili / Reddit / Hacker News / Stack Overflow / Wikipedia / npm,全部走公开 API(零 key)。可在插件配置页勾选启用哪些平台。
lib/index.js(host 端):实现 WebSearchProvider(id: thin-search / available() / search()),统一引擎路由 + 自动回退 + 时间过滤解析 + 结果缓存;以 thin-search profile entry 接入 DSH 0.1.7 Settings;提供 /api/dsh-thin-search-settings 读写桥(describe / mutate / raw-search,仅限 loopback);注册 free_search_test、platform_search、advanced_search 工具;动态注入引擎清单到系统提示词lib/client.js(浏览器端):React 配置页(挂 plugins.row.config 插槽,key dsh-thin-search#thin-search,由 ctx.configForms.whileServed 守卫)+ /thin-search-engine 弹出式命令(commandUi popupSelect)lib/proxy.js:undici ProxyAgent 封装,单例缓存 + fetchWithProxy,仅本插件使用cordis.patch.yml:插件 loader 配置,patch 同时把 web.searchProvider 设为 thin-search(保留 fetchProvider: http)| 项目 | 要求 |
|---|---|
| DSH | >= 0.1.7-rc.1(依赖 @deepseek-ai/dsh-atomic-write / dsh-settings / dsh-tools / dsh-web / dsh-llm 均 >= 0.1.7-rc.1) |
| Node.js | >= 22.19.0 |
DSH 0.1.7 适配:0.1.7 移除了旧的
SettingsProvider.installSection(),改为从 Loader profile entry 投影.volatile()配置。本插件现使用thin-search条目、SettingsForms.configure({ auto: false })和SettingsForms.mutate();自定义配置页从settings.section(全局设置)迁到plugins.row.config(插件管理页),/thin-search-engine命令保持不变,设置保存到当前 profile 的cordis.patch.yml。entry id 特意沿用旧settings.yaml的thin-search:section 名,因此 DSH 0.1.7 首次启动时可自动导入旧配置。从 v0.4.0 升级:v0.4.0 仍依赖已移除的 settings namespace API,只能用于 DSH 0.1.5–0.1.6;升级 DSH 到 0.1.7 时必须使用 v0.5.0 或更高版本。若曾在 profile patch 中手工写过
id: web-thin-search,请改为id: thin-search。
同时修正(v0.4.0):三个自带工具(
free_search_test/platform_search/advanced_search)的output.render原先返回裸字符串,而核心契约要求返回ContentBlock[]({ type: "text", text })。已改为符合契约的数组形式。说明(避免误读):这不是一次线上故障修复。这三个工具始终声明了
finalizeContent,核心会在结果落库前先套用它把字符串转成ContentBlock[],因此裸字符串从未真正进入tool-result.content——实测全部会话日志(截至 2026-09-11,269 个会话文件)中,这三个工具共 120 次真实调用(111 成功 / 9 失败),落库结果 100% 是数组,无一例外,也从未出现过相关 TypeError。本次改动属于契约对齐与纵深防御(若日后移除finalizeContent,或核心在规范化之前新增校验,裸字符串才会暴露)。输出文本与改动前逐字节一致,无行为变化。
从 v0.1.x 升级:dsh v0.1.2-alpha.2 对 settings seam 做了破坏性重构——
installSettingsSection/settingsNamespace被移除,改用SettingsProvider.installSection(见 dsh-v0.1.2-alpha.2+)。插件 v0.2.0 起仅支持 dsh ≥ 0.1.2-alpha.2;仍在 dsh 0.1.1 的用户请使用插件 v0.1.1。
web-search-deepseek(deepseek-official)与本插件可共存;searchProvider 指向谁就用谁searchProvider: deepseek-official,需重启 DSH 生效),也可手动改 ~/.dsh/profiles/<profile>/cordis.patch.ymlDEEPSEEK_API_KEY —— 第三方网关用户可直接使用MIT
DSH's official web-search plugin forces a DeepSeek V4 Flash model call in Anthropic format (/anthropic/v1/messages + web_search_20250305). If you use a third-party gateway, it may not speak the Anthropic protocol — and even when it does, every search costs a model turn.
This plugin scrapes free search engines with plain HTTP (Bing / DuckDuckGo / SearXNG / AnySearch). No model calls, no Anthropic protocol, no API keys — searching costs nothing and works with any gateway.
Note: ... using ... markeranysearch (default, best for Chinese natural-language queries) · bing (fast, zh-CN) · searxng (multi-instance, custom instances) · ddg · ddg-lite/thin-search-engine in chatfree_search_test tool + "Test engine" buttondsh-web-fetch-http stays enabledWebSearchProvider seam; coexists with official pluginsdsh plugin --profile web add dsh-thin-search # from npm (once published)
dsh plugin --profile web add github:loommii/dsh-thin-search # from GitHub
Restart dsh web after installing. The plugin's patch points web.searchProvider to itself automatically.
To uninstall:
dsh plugin --profile web remove dsh-thin-search
Restart dsh web afterwards to restore DSH's official search.
Settings page: Settings → Search Engine (provider switch, engine, enhancement, platforms, cache TTL, proxy). Chat command: /thin-search-engine. On DSH 0.1.7, config is stored in ~/.dsh/profiles/<profile>/cordis.patch.yml under the thin-search entry (see the Chinese section above for the full schema).
Set thin-search.config.proxy (e.g. http://127.0.0.1:7890) in the settings page or ~/.dsh/profiles/<profile>/cordis.patch.yml — no env vars needed. HTTP/HTTPS only; no SOCKS5. Only this plugin's requests go through the proxy; DSH and other plugins are untouched.
Known limits: DuckDuckGo anti-bot (HTTP 202) and public SearXNG rate limits (HTTP 429) apply to proxy/datacenter egress IPs. Prefer Bing / AnySearch behind a proxy. Self-hosted SearXNG instances can be added via
searxngInstances.
| Item | Requirement |
|---|---|
| DSH | >= 0.1.7-rc.1 |
| Node.js | >= 22.19.0 |
DSH 0.1.7 migration: DSH 0.1.7 removed the old
SettingsProvider.installSection()namespace API. The plugin now declares every editable field with.volatile(), attaches its custom page throughSettingsForms.configure({ auto: false }, ctx.fiber), and maps the bridge's logicalthin-searchnamespace to thethin-searchLoader profile entry. Saves are persisted to the active profile'scordis.patch.yml. The entry id deliberately matches the legacysettings.yamlthin-search:section so DSH 0.1.7 can import existing settings automatically on first boot.Upgrading from v0.4.0: v0.4.0 still calls the removed settings namespace API and therefore only supports DSH 0.1.5–0.1.6. Use v0.5.0 or newer when upgrading to DSH 0.1.7. If a profile patch manually contains
id: web-thin-search, rename it toid: thin-search.
Also corrected in v0.4.0: the three bundled tools (
free_search_test/platform_search/advanced_search) returned a bare string fromoutput.render, while the core contract requiresContentBlock[]({ type: "text", text }). They now return conformant arrays.Note (to prevent misreading): this was not a production bug fix. All three tools have always declared
finalizeContent, which the core applies before a result is persisted, converting the string toContentBlock[]— so the bare string never actually reachedtool-result.content. Across every session log on the author's machine (269 session files, as of 2026-09-11) these three tools were invoked 120 times (111 succeeded, 9 failed), and 100% of the persisted results are arrays; the relatedTypeErrornever occurred. This change is contract alignment and defence in depth (it would only surface iffinalizeContentwere removed, or if the core added a check before normalization). Rendered text is byte-identical to before — no behavioural change.
Upgrading from v0.1.x: dsh v0.1.2-alpha.2 shipped a breaking settings-seam refactor — the module-level
installSettingsSection/settingsNamespacehelpers were removed in favor ofSettingsProvider.installSection. Plugin v0.2.0 requires dsh ≥ 0.1.2-alpha.2; stay on plugin v0.1.1 if you are still on dsh 0.1.1.
MIT