dsh-web-search-ddg
aooyoo
Zero-token DuckDuckGo search provider for the DeepSeek Harness (DSH) web seam — local headless browser, no API key, no m…
PROJECT TOPICS
PROJECT README
A DeepSeek Harness plugin that shows your DeepSeek API balance in the web UI, pinned above the Settings button at the sidebar foot.
dsh web。DEEPSEEK_API_KEY / Models 页面里配置,见「API key resolution」)。Connection OK: <金额> <货币> 即成功。total_balance followed by the currency (e.g. 110.00 CNY) in the sidebar foot, directly above the Settings trigger.currency — 货币,人民币或美元 (CNY / USD)total_balance — 总的可用余额,包括赠金和充值余额granted_balance — 未过期的赠金余额topped_up_balance — 充值余额0 = manual only).GET <baseURL>/user/balance and returns only public balance fields.The host resolves the key in this order:
dsh-deepseek-balance.apiKey (Settings → 余额 → API Key, write-only, stored in $DSH_HOME/settings.yaml).DEEPSEEK_API_KEY reference saved through the web Models page.DEEPSEEK_API_KEY environment variable (override the variable name with dsh-deepseek-balance.apiKeyEnv in settings.yaml).The plugin ships as a normal out-of-tree dsh plugin package (host half + browser half). Install it into the web profile:
# from the profile directory
dsh plugin --profile web add dsh-deepseek-balance --link <path-to-this-package>
or, manually:
Add a loader entry to $DSH_HOME/profiles/web/cordis.patch.yml:
- insert:
- id: dsh-deepseek-balance
name: 'dsh-deepseek-balance'
Make the package resolvable from the profile (pnpm file: dependency, or a junction into $DSH_HOME/profiles/node_modules).
Restart dsh web.
Note: the plugin's
dsh.clientdeclaration registers its browser half with the client-modules system, so the plugin-set change takes effect on server restart.
All settings live under the dsh-deepseek-balance: section in $DSH_HOME/settings.yaml, or in the Settings → 余额 (Balance) page:
| Field | Default | Meaning |
|---|---|---|
apiKey |
(empty) | Your DeepSeek API key (write-only; never read back to the browser). |
apiKeyEnv |
DEEPSEEK_API_KEY |
Environment variable / credential reference holding the key. |
baseURL |
https://api.deepseek.com |
API endpoint; GET <baseURL>/user/balance is used. |
color |
#4d6bfe |
Balance text / popover accent color. |
refreshIntervalMs |
0 |
Auto-refresh interval in ms (0 = manual refresh only). |
/plugins/dsh-deepseek-balance/api/balance, and the host injects the Authorization header.Host/cross-origin Origin headers.describe redacts role('secret') fields, so the browser cannot read a stored key back.结论:可以,但它是「本机专用」插件 —— 只能在运行 dsh 的那台电脑的浏览器里正常使用。 换到新设备需要做 4 件事,且有一个硬性限制(远程浏览器拿不到余额)。
| # | 事项 | 说明 |
|---|---|---|
| 1 | 安装 DeepSeek Harness | 新设备需要装好 dsh 并至少启动过一次 dsh web。 |
| 2 | 让 @deepseek-ai/* 依赖可解析 |
本包通过 node_modules/@deepseek-ai 解析 dsh 的包。本机是一个 junction(指向 D:\nodejs\node_global\node_modules\@deepseek-ai\dsh\node_modules\@deepseek-ai)—— 这是本机路径,换机后不存在。新设备上要么重建 junction 指向该机的 dsh 安装,要么把本包放进 dsh 工作区用 pnpm 正常安装。 |
| 3 | 注册到 web profile | 在 $DSH_HOME/profiles/web/cordis.patch.yml 加入插件条目(见上方「Installation」),或 dsh plugin --profile web add dsh-deepseek-balance --link <此包路径>。 |
| 4 | 配置 API Key | 设置页 / 环境变量 / Models 凭据,三选一(见「API key resolution」)。 |
⚠️ 设置白名单补丁(重要):dsh 默认只允许
WEB_SETTINGS_NAMESPACES白名单内的设置命名空间被写入。若新设备没有重新应用补丁(把dsh-deepseek-balance加入@deepseek-ai/dsh-host-apiproxy/lib/index.js中WEB_SETTINGS_NAMESPACES数组),设置页会渲染但所有控件无响应。本机已打补丁(与dsh-notify在同一白名单里,补丁代码见dsh-notify的 README)。未打补丁时仍可改用环境变量 / Models 凭据提供 API Key,插件其余功能不受影响。
lib/index.js):拒绝非 127.0.0.1 / localhost / [::1] 的 Host 头与跨域 Origin。dsh web 启动后,侧边栏底部出现余额入口Connection OK 与金额dsh-deepseek-balance/
├── package.json # dsh.client declaration + exports ("./client" bundle)
└── lib/
├── index.js # host half: key resolution + balance proxy route + settings
└── client.js # browser half: sidebar widget + Balance settings page
The browser half registers into the sidebar.footer.action slot (the seat above the sidebar.settings trigger) and the settings.section slot (id: "balance").
Headless smoke tests (no browser needed) verify the module structure and that both components render without errors:
node test/smoke-test.cjs # client bundle structure (apply/inject exports)
node test/render-test.cjs # server-renders the widget + settings page via react-dom
The host half resolves its @deepseek-ai/* imports through a scoped junction
(node_modules/@deepseek-ai) pointing at the dsh installation; a normal pnpm
install of this package replaces that with real dependency links.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。