🔍 dsh-searchhub
🇨🇳 中文说明(点击展开完整中文文档)
### 别再为 Agent 的联网搜索花钱了 **dsh-searchhub** 是给 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 用的**可插拔搜索中枢**。它让你的 Agent 通过市面主流、即插即用的搜索服务商(挂在 DSH 的 web 能力接缝 `ctx.web` 后面)来联网搜索,而**不用每次 `web_search` 都消耗付费的 DeepSeek 模型调用**。 > 💸 **不用再为搜索付费。** 把内置的 `web_search` 工具接到真正的搜索 API,把模型预算留给真正的思考。 > > 🧩 **可插拔设计。** 一个中枢,多家服务商。目前内置 **Tavily**;架构从一开始就为后续接入更多主流搜索引擎而设计——挑你喜欢的,随时替换。 > > 🎁 **免费起步。** Tavily 每月赠送 **1000 个免费额度**,无需信用卡即可开始,日常 Agent 检索完全够用。 > > ✨ **做得精美。** 不是一个干巴巴的配置开关——dsh-searchhub 自带**手工打造的原生设置卡片**:可折叠、带实时三态状态圆点、真正的显示/隐藏眼睛按钮、即时的密钥格式校验,以及一个可点击的取密钥链接。它看起来就像产品自带的功能,因为它就是照着这个标准做的。 #### 📸 原生设置卡片 这是它在 **设置 → 插件** 里**自带**的精美卡片——实时状态圆点、真正的显示/隐藏按钮、行内格式校验,看起来就像产品原生功能。界面语言切到中文时,卡片文案**全中文**(对比上方英文效果,绝不混杂):
Stop paying for your agent's web search.
dsh-searchhub is a pluggable search hub for the
DeepSeek Harness (DSH). It
lets your agent search the web through mainstream, drop-in search providers
behind the DSH web capability seam (ctx.web) — instead of burning paid
DeepSeek model turns on every web_search call.
💸 No more paying for search. Point the agent's built-in
web_search
tool at a real search API and keep your model spend for actual thinking.🧩 Pluggable by design. One hub, many providers. Today it ships with
Tavily; the architecture is built to add more of the market's popular
search engines over time — pick the one you like and swap it in.🎁 Free to start. Tavily gives you 1,000 free credits every month — no
credit card to get going. Plenty for everyday agent research.✨ Beautifully polished. Unlike a bare config toggle, dsh-searchhub ships
its own hand-crafted native Settings card — collapsible, with a live
tri-state status dot, a real show/hide eye toggle, instant key-format
validation, and a proper clickable link to grab your key. It looks like it
belongs in the product, because it was built to.
📸 The native Settings card
Its own polished card under Settings → Plugins, with a live status dot, a real show/hide toggle, and inline validation — it looks like it belongs in the product:
✨ Features
- 🔌 Pluggable search hub — a clean provider seam so mainstream search
engines can be swapped in behindctx.web. Tavily is included today, with
room to grow. - 💰 Zero model-turn cost — replaces the built-in
web-search-deepseek
provider, soweb_searchhits a real search API, not a paid model turn. - 🎨 Its own polished native card — appears under Settings → Plugins →
Plugin configuration as a dedicated, collapsible card (endpoint, search
depth, max results, answer toggle, API key) with a live status dot, eye
toggle, and inline key-format check. - 🔐 Secrets done right — the API key lives as a credential reference
(TAVILY_API_KEYby default), entered from the UI or the environment; it never
has to sit in a config file. - ⚡ One-command install — ships as a dsh bundle, so
npx @wilson.liu.cn/dsh-searchhub installinstalls it with npm (no pnpm required) and
appends it todsh.profile.bundles. No hand-editing profile patch files. - 🧭 Normalized results — maps provider results into the seam's
{ sources, truncated }shape the agent already understands.
🚀 Installation
Option A — install from npm (recommended, no pnpm needed)
npx @wilson.liu.cn/dsh-searchhub install --profile web
This downloads the package from the npm registry
(@wilson.liu.cn/dsh-searchhub)
and installs + activates it. To install with plain npm instead, see Option B.
From a checkout (when developing this plugin itself):
node scripts/cli.mjs install
It performs the same three steps dsh plugin performs, using the package
manager you actually have:
- initializes
$DSH_HOME/profiles/webwhen it does not exist yet, exactly like
DSH's own template (package.json+cordis.patch.yml+pnpm-workspace.yaml); - installs this package into that directory with npm;
- appends the package to the profile's
dsh.profile.bundleslayer list, so its
cordis.patch.yml(switchctx.webto Tavily, disable
web-search-deepseek, register this plugin's host + browser halves) applies
on the next boot.
Other subcommands:
npx @wilson.liu.cn/dsh-searchhub status # installed? activated? key configured?
npx @wilson.liu.cn/dsh-searchhub install --dry-run # print the plan, change nothing
npx @wilson.liu.cn/dsh-searchhub uninstall # remove it and drop its layer again
npx @wilson.liu.cn/dsh-searchhub install --spec github:Bin-top1/dsh-searchhub
npx @wilson.liu.cn/dsh-searchhub install --spec /path/to/dsh-searchhub # checkout → packed first
Then restart the web profile (dsh web or dsh --profile web) and open
Settings → Plugins; set the API key in the SearchHub card (or export
TAVILY_API_KEY).
Why not
dsh plugin add?dsh pluginis a pnpm forwarder
(spawnSync("pnpm", …)internally) and fails outright on a machine without
pnpm. This installer performs the same three steps with npm.Why does a directory
--specget packed first? npm installs a local
directory as a symlink, and a symlinked package resolves its
@deepseek-ai/*imports from the checkout's real path — where the DSH peer
packages are absent (or a duplicate copy lives). Packing the checkout into a
tarball installs a real copy inside the profile, so those imports resolve
through the profile's ownnode_moduleschain into the DSH installation
closure.
Option B — manual npm install + one manifest line
cd "$DSH_HOME/profiles/web"
npm install @wilson.liu.cn/dsh-searchhub
Then add the package name to that profile's dsh.profile.bundles (the layer
list DSH composes plugins from):
"dsh": {
"profile": {
"bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "@wilson.liu.cn/dsh-searchhub"]
}
}
Option C — the dsh plugin forwarder (needs pnpm on PATH)
dsh plugin --profile web add @wilson.liu.cn/dsh-searchhub
Option D — hand-written patch layer (works without the bundles list)
# $DSH_HOME/profiles/web/cordis.patch.yml
- id: web
config:
searchProvider: tavily
fetchProvider: http
- id: web-search-deepseek
disabled: true
- insert:
- id: searchhub
name: "@wilson.liu.cn/dsh-searchhub"
⚠️ Do not point
name:at a file inside a checkout
(file:///…/dsh-searchhub/lib/index.js): the plugin then resolves its
host-provided@deepseek-ai/*imports from the checkout's real path and fails
withERR_MODULE_NOT_FOUND(measured). For a local checkout use Option A's
--spec <checkout>, which packs it first.
⚙️ Configuration
| Key | Type | Default | Description |
|---|---|---|---|
apiKey |
secret string | - | Literal key (prefer apiKeyEnv instead). |
apiKeyEnv |
credential ref | TAVILY_API_KEY |
Env-var name the key is stored under. |
baseURL |
string | https://api.tavily.com |
Tavily API base; /search is appended. |
searchDepth |
basic | advanced |
basic |
Deeper search costs more Tavily credits. |
maxResults |
number (1-20) | 5 |
Results requested per query. |
includeAnswer |
boolean | false |
Ask Tavily to include a generated answer. |
Setting the API key
Pick one:
- Native settings card — open the SearchHub card under
Settings → Plugins → Plugin configuration and paste the key into the API
key box. It is stored encrypted through the credentials service (under the
TAVILY_API_KEYreference by default). - Environment variable — export
TAVILY_API_KEY(or whateverapiKeyEnv
you set) before launching DSH. - Literal config — set
apiKeydirectly (discouraged; keeps a secret in a
file).
Get a key — and your 1,000 free credits/month — at
https://app.tavily.com/.
The native settings card (dual-face plugin)
The DSH web Plugin configuration surface does not auto-generate a card for
an arbitrary plugin. A card appears only when both halves are present:
- Host half installs a settings section under a namespace (
searchhub) —
lib/index.js. - Browser half registers a React card into the
settings.plugin.itemslot,
keyed by that same namespace —lib/client.js.
This plugin ships both, so it gets its own polished card (not a borrowed
one). The browser half is declared to the DSH client-modules scanner via
package.json:
{
"dsh": {
"bundle": { "patch": "./cordis.patch.yml" },
"client": { "platform": "web" }
},
"exports": {
".": { "default": "./lib/index.js" },
"./client": { "default": "./lib/client.js" }
}
}
The scanner serves lib/client.js to the browser as a classic script whose only
top-level statement is a single window.__ModuleLoader__.load({ id, factory })
call. React and the JSX runtime are host-provided seed modules obtained
through the factory's synchronous require — the browser half never bundles its
own React. The card's secret input writes to the TAVILY_API_KEY credential
reference through ctx.remote.credentials.set(...), and the host half resolves
that same reference per search.
🗺️ Roadmap
dsh-searchhub is a hub, not a single-engine wrapper. Tavily is the first
provider; the seam is deliberately generic so more of the market's popular
search backends can be added behind the same card and the same ctx.web
contract. Contributions of new providers are welcome.
📦 Publishing (maintainers)
npm login
npm publish
The prebuilt lib/ runtimes and cordis.patch.yml are included via the files
allowlist, so consumers do not need a build step.
🛠️ Building from source
Nothing needs to be built to install or use this plugin: the repository ships
prebuilt lib/index.js (host half) and lib/client.js (browser half), and the
npm package contains only those, scripts/cli.mjs, cordis.patch.yml and the
docs.
Maintainers run the build for the published type declarations:
npm install # devDependencies only: typescript + the host type packages
npm run build # tsc -p tsconfig.json → lib/types/*.d.ts
npm test # installer behaviour + packaging invariants
- Host half: typed sources live in
src/types/(index.ts,provider.ts)
and compile to.d.tsdeclarations vianpm run build, which
prepublishOnlyruns before the tarball is built.lib/index.jsis the
authoritative runtime. - Browser half:
lib/client.jsis the single authoritative, hand-authored
source — read it directly. It is intentionally written in the exact
factory-registration form the DSH client-modules scanner serves (React and the
JSX runtime come from the host seed viarequire), so it needs no bundler and
has no separate.tsmirror to drift out of sync.
📄 License
MIT © Bin