luokai-demo/dsh-plugins--plugins-dsh-balance-plugin ↗★ 0
dsh-balance-plugin
DeepSeek wallet-balance readout at the sidebar foot: card icon + amount, status-tinted, refreshed on turn end and on click
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:luokai-demo/dsh-plugins#832abeacbf52ce26103e2bb8a21d9b7ff2c36fce&path:plugins/dsh-balance-plugin说明文档
阅读完整 README ↗dsh-balance-plugin
侧边栏底部的 DeepSeek 钱包余额——一个 DeepSeek Harness 插件。
English | 中文
在侧边栏底部(设置按钮旁)以信用卡图标 + 金额显示你的 DeepSeek 账户余额,并按剩余额度着色。在对话结束时、点击时与挂载时刷新——无轮询。

功能
- 状态着色:只有金额带颜色,图标保持中性——
- ≥
lowBalanceThreshold(默认 2):绿色 - 大于零:黄色
- 零或以下:红色
- ≥
- 对话结束自动刷新:宿主在任何对话轮次结束时推送 SSE
refresh事件——消耗随轮次结算。 - 点击刷新;在途刷新去重(查询进行中时点击或轮次结束触发均为 no-op)。
- 失败静默:凭证未配置或抓取失败时不渲染任何内容——读数仅供参考,绝不显示错误。
- 原始币种:余额按提供方报告显示;不换算、不加总。
安装
需要一个 DeepSeek 账户凭证。插件通过 harness 凭证接缝(~/.dsh/.credentials.yaml 或环境变量)解析 DEEPSEEK_API_KEY,与官方 DeepSeek 适配器一致。
从 npm 安装(推荐)
dsh plugin --profile add dsh-balance-plugin
从 GitHub Release 安装(无需 npm 账号)
从 releases 页面 下载 dsh-balance-plugin-.tgz,然后:
dsh plugin --profile add ./dsh-balance-plugin-.tgz
注意:插件位于 dsh-plugins monorepo 的 plugins/ 子目录,dsh plugin add github:... 无法指向子目录——请使用 tarball(或 npm)。
配置
插件带合理默认值;可通过 bundle 的插件行覆盖:
# profile 的 cordis.patch.yml(或 home 级)
- id: balance
name: dsh-balance-plugin
config:
apiKeyEnv: DEEPSEEK_API_KEY # 凭证引用,随后回退环境变量
baseURL: https://api.deepseek.com # 提供方基础 URL
timeoutMs: 12000 # 每次请求超时;中止映射为 balance-timeout
lowBalanceThreshold: 2 # 读数视为健康的最低金额