dsh-balance-guard
Manifest validBalance Sentinel: Real-time display of your DeepSeek balance in the top-right corner of the session header. When the balance runs low, it automatically turns orange to alert you (title marker + system notification). Click to refresh instantly.
dsh-balance-guard · 余额哨兵
DeepSeek Harness 插件:在 Web 界面会话头部右上角实时显示 DeepSeek API 账户余额,余额不足自动变橙提醒(标题标记 + 系统通知)。
- Host 端注册同源端点
GET /api/dsh-plugin-balance,服务端读取与llm-deepseek相同的凭证(默认 credential refDEEPSEEK_API_KEY,即$DSH_HOME/.credentials.yaml或环境变量),调用https://api.deepseek.com/user/balance(15 秒缓存、单飞)。 - Client 端把余额胶囊渲染到
conversation.session.header.utilities— 会话头部右上角(状态圆点 + 金额) - 客户端默认每 30 秒轮询一次;点击胶囊立即刷新;页面重新可见时也会刷新。 悬停显示总额 / 赠送 / 充值明细与更新时间。
- 低余额自动提醒:余额 ≤ 阈值(默认 ¥5)时,胶囊变橙并显示 ⚠,页面标题加 「⚠ 余额不足」前缀,并弹一条浏览器系统通知(每个低余额事件只提醒一次,充值 恢复到阈值以上后再次跌破会重新提醒)。第一次点击胶囊会请求系统通知授权。
配置
插件行配置(profile cordis.patch.yml,或通过 llm 同款设置节):
- insert:
- id: plugin-balance
name: dsh-balance-guard
config:
apiKeyEnv: DEEPSEEK_API_KEY # credential ref
baseURL: https://api.deepseek.com # 可用 $DEEPSEEK_BASE_URL 覆盖
pollIntervalMs: 30000 # 客户端轮询间隔
cacheMs: 15000 # 服务端缓存
timeoutMs: 10000 # 上游请求超时
lowBalanceThreshold: 5 # 低余额提醒阈值
lowBalanceCurrency: CNY # 阈值比较的币种
也支持在 $DSH_HOME/settings.yaml 里以 plugin-balance: 节覆盖
pollIntervalMs / cacheMs / timeoutMs / lowBalanceThreshold /
lowBalanceCurrency。
安装
dsh plugin --profile web add dsh-balance-guard
# 或本地目录:
dsh plugin --profile web add file:/path/to/dsh-balance-guard
运行中的 web 进程会热加载 patch 变更(host 插件即时生效),刷新页面即可看到胶囊。
端点响应
{
"ok": true,
"value": {
"isAvailable": true,
"balanceInfos": [
{ "currency": "CNY", "totalBalance": "110.00",
"grantedBalance": "10.00", "toppedUpBalance": "100.00" }
],
"lowBalance": {
"active": false,
"currency": "CNY",
"threshold": 5,
"amount": "110.00"
},
"updatedAt": 1755012345678
},
"pollIntervalMs": 30000
}
错误时 ok: false + error.code:no-api-key | invalid-api-key | api-error |
transport-error | bad-response。
Comments
Loading…
From the same category
by ccch1mneyyy
DSH 官方公众号收录的 TUI 补位插件:Claude Code 风,鲸鱼顶栏/实时状态/流式思考/双击 Esc 回滚/上下文进度+TPS。npm 一键装。 DSH official WeChat featured TUI plugin — Claude Code style: whale bar, live status, streaming thoughts, double-Esc rol
★ 4.3k
↓ 10.9k/wk
MIT
TypeScript
Oct 11, 2026
dsh plugin --profile terminal add @deepseek-harness-tui/dsh-tuiby strukto-ai
The World's First Virtual Terminal for AI Agents
★ 3.7k
↓ 355/wk
Apache-2.0
TypeScript
Oct 11, 2026
dsh plugin --profile agent add @struktoai/mirage-dshby bowenliang123
The best DeepSeek Harness plugin for context insight and management, with context dashboard / browser / sidebar and context command, for context statistics, composition, breakdown, evolution details,
★ 2k
↓ 34.4k/wk
Apache-2.0
TypeScript
Oct 11, 2026
dsh plugin --profile web add dsh-contextby huiliyi37
官方 DeepSeek Harness 的交互式终端 UI 插件:自研 ANSI 极简交互渲染、流式 Markdown/工具卡、16+ 主题、slash 命令与选择器、输入历史与本地偏好持久化、LSP 诊断、memory记忆,很丝滑的开发体验。
★ 287
↓ 462/wk
Apache-2.0
TypeScript
Sep 30, 2026
dsh plugin --profile terminal add @huiliyi37/dsh-tianshu-tuiby Hilbert-beinghappy
面向 DeepSeek Harness 的 Claude Code 风格终端界面,支持 Windows、macOS 与 Linux,兼容透明终端、VS Code 主题和自定义配色。
★ 197
↓ 108/wk
MIT
TypeScript
Oct 1, 2026
dsh plugin --profile web add seekttyby T-Auto
deepseek-harness Plugin Access and Implementation Standards / deepseek-harness交互生态插件规范与实施标准
★ 83
MIT
JavaScript
Oct 10, 2026