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
DSH Web 插件:在模型选择器旁显示 DeepSeek 账户余额徽章。
A DSH web plugin that puts a DeepSeek account-balance badge right next to the model picker.
Balance,点击后向上弹出明细面板:总余额 / 赠送余额 / 充值余额、多币种、更新时间、手动刷新GET /api/dsh-balance 获取:服务端解析 DEEPSEEK_API_KEY 并缓存(60 秒),API key 永不进入浏览器| 文件 | 说明 |
|---|---|
lib/index.js |
host 半部(Node,ESM,零依赖):ctx.webServer.register 挂载 /api/dsh-balance 路由,ctx.credentials.resolve('DEEPSEEK_API_KEY') 在服务端取密钥;单飞(single-flight)缓存 + 失败降级;仅接受回环 Host 与 GET/HEAD |
lib/client.js |
浏览器半部(DSH client-bundle 格式):注册 conversation.input.right 槽位(模型选择器左侧),React 徽章 + 弹窗,zh/en 双语 |
test-host.mjs |
host 半部单元测试(mock ctx / fetch / 时钟,15 项断言),node test-host.mjs 运行 |
数据流:浏览器 fetch('/api/dsh-balance') → 本地 dsh web 服务(插件路由)→ 服务端用密钥查询 DeepSeek /user/balance → 只把余额 JSON 返回浏览器。
把本仓库复制到 <DSH_HOME>/profiles/web/node_modules/dsh-balance-watch(Windows 默认 C:\Users\<you>\.dsh\profiles\web\node_modules\;注意是 web profile 自己的 node_modules,不是上一级 profiles\node_modules —— 后者在全新启动时 host 半部可能不被加载):
Copy-Item -Recurse <本仓库路径> "$env:USERPROFILE\.dsh\profiles\web\node_modules\dsh-balance-watch"
在 <DSH_HOME>/profiles/web/cordis.patch.yml 末尾追加:
- insert:
- id: balance-watch
name: 'dsh-balance-watch'
重启 dsh web,刷新浏览器页面。
或者使用官方插件管理命令(需先安装 pnpm):
dsh plugin --profile web add <本仓库路径>
node test-host.mjs
webServer、credentials)与全局 fetch,无第三方依赖dsh.client.inject 复用 DSH 已提供的 dsh-client-runtime、dsh-client-locale、dsh-client-ui-conversationMIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。