brittanistrehlowll-oss/dsh-quota-panel ↗★ 2
dsh-quota-panel
dsh 网页界面的提供商配额/余额角部面板:服务端凭据代理,以及一个由配置驱动的页面徽章,用于显示 DeepSeek 余额和 OpenCode Zen Go 使用窗口。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:brittanistrehlowll-oss/dsh-quota-panel说明文档
阅读完整 README ↗dsh-quota-panel
English | 中文
dsh-quota-panel 是 DeepSeek Harness(DSH)网页端的提供方额度/余额状态卡片插件。
零依赖宿主端插件:为每个配置的提供方注册一条服务端代理路由
/api/quota/ —— API Key 通过凭据系统在服务端解析,绝不进入浏览器 ——
然后在页面注入一个右下角的 Harness 原生风格悬浮卡片,按提供方逐行渲染:
状态点、名称、主数值、次级信息,用量型提供方还有进度条。页面隐藏时自动暂停
刷新;右上角刷新按钮在手动刷新时旋转,重复点击不会并发请求。
卡片完全使用 Harness 设计 Token(--dsw-alias-*、--dsw-static-*、
--dsw-shadow-*、--dsw-font-*)驱动,token 缺失时有合理的 fallback,
因此自动跟随产品主题(浅色/深色),不携带自己的配色。
效果图
浅色主题:

深色主题:

完整页面(浅色):

安装
dsh plugin --profile web add "github:brittanistrehlowll-oss/dsh-quota-panel"
# 重启 `dsh web`(bundle 层在启动时生效)
包声明了 dsh.bundle.patch,因此 dsh plugin add 会把它自动激活为 profile 层。
配置
每个提供方是 providers 下的一项,内置两种渲染器:
| format | 接口返回形态 | 行显示 |
|---|---|---|
deepseek-balance | { "balance_infos": [{ "currency", "total_balance", "granted_balance", "topped_up_balance" }] } | ¥58.36 + 余额充足/正常/紧张/建议充值 |
opencode-usage | { "usage": { "rolling"|"weekly"|"monthly": { "percent", "resetsAt" } } } | 五 10% · 周 45% · 月 22% + 进度条 + 当前最高占用 |
在 profile 的 cordis.patch.yml 中覆盖默认配置:
- id: quota-panel
config:
refreshMs: 30000
providers:
- id: deepseek
label: DeepSeek
credential: DEEPSEEK_API_KEY
endpoint: https://api.deepseek.com/user/balance
format: deepseek-balance
balanceTiers: { critical: 10, warn: 20, healthy: 50 }
- id: opencode-go
label: OpenCode Go
credential: OPENCODE_GO_API_KEY
endpoint: https://opencode.ai/zen/go/v1/usage
format: opencode-usage
windowLabels: { rolling: 五, weekly: 周, monthly: 月 }
warnPercent: 70
errorPercent: 90