dsh-plugin-quota-monitor
Manifest valid★ 1DSH sidebar footer quota & balance monitor with a Settings section (设置 → Plugin Management): always-on DeepSeek Rage (¥), plus per-provider status rows — OpenCode Go HP/MP/SP (monthly/weekly/5h) and SCNet (国家超算) Credits remaining estimated locally from DSH session logs. Provider selectable (auto/opencode/scnet), meters toggleable.
dsh-plugin-quota-monitor
DSH(DeepSeek Harness)侧边栏底部的额度与余额监控插件:一条怒气条 + 各服务商状态条,并在 设置 → 插件管理 → 余额监控里提供完整配置页。
RPG 风格的映射:HP 血(红)= 月额度 · 魔法 MP(蓝)= 周额度 · 耐力 SP(黄)= 5h 额度 · 怒气 Rage(金)= DeepSeek 余额。
预览
| 国家超算中心(scnet · Credits) | OpenCode Go(HP / MP / SP) |
|---|---|
![]() | ![]() |
设置页(设置 → 插件管理 → 余额监控):

功能
- 怒气 Rage(金,始终显示):DeepSeek 官方接口实时余额(
api.deepseek.com/user/balance),显示 ¥ 剩余金额。 - OpenCode Go(
opencode-go):官方用量接口的 月 / 周 / 5h 三个窗口 → HP / MP / SP,显示剩余$与细条。 - 国家超算中心(scnet):Token Plan Credits 剩余(单条,绿色)。scnet 没有公开的用量查询接口,本插件改为本地估算:直接读取 DSH 自己的会话日志(
$DSH_HOME/sessions/**/*.jsonl(.zstd),纯 Node 解压 Zstandard 多帧),统计本月经 scnet 消耗的 token,再按 scnet 官方费率表折算成 Credits。 - 自动识别数据源:默认
auto—— 从 DSHsettings.yaml的agent-default-model.provider自动选择(opencode-go / scnet),也可手动指定。 - 设置页:数据源切换、每个条目的开关、scnet 月度额度与模型费率表(JSON 可编辑,含 DeepSeek-V4-Flash-0731 / GLM-5 / Kimi-K3 / MiniMax-M3 / Qwen3.8-Max 等 13 个官方费率)。
- 60 秒轮询 + 切回页面即时刷新;窄侧栏折叠为圆形小徽标。
安装
dsh plugin --profile web add dsh-plugin-quota-monitor-<version>.tgz
# 或从 npm
dsh plugin --profile web add dsh-plugin-quota-monitor
重启 dsh web 进程后生效(client bundle 与 host 都需要重启进程,刷新页面不够)。
密钥从环境变量或 ~/.dsh/.credentials.yaml 读取(环境变量优先):
| 数据源 | 密钥 |
|---|---|
| DeepSeek 怒气 | DEEPSEEK_API_KEY |
| OpenCode Go | OPENCODE_GO_API_KEY |
| scnet Credits(本地估算) | 无需密钥,读本地会话日志 |
设置
打开 设置 → 插件管理 → 余额监控:
- 数据源:自动(跟随默认模型)/ OpenCode Go / 国家超算中心。
- OpenCode 显示的条:月额度(HP)/ 周额度(MP)/ 5h 额度(SP)开关。
- 国家超算 Credits:月度额度(默认 60,000,基础版)、每月重置日(Token Plan 按计费周期重置、不一定每月 1 号;填控制台显示的额度重置日 1-28,插件按“上次重置日→今天”统计)与模型费率表(每百万 token 的 Credits,JSON 编辑)。
- 始终显示 DeepSeek 怒气条。
配置保存在 $DSH_HOME/storages/quota-monitor-config.json。
关于 scnet 估算的准确度
- scnet 官方文档确认 Token Plan 没有公开的用量/余额查询 API,用量只能网页控制台查看。
- 本插件统计的是 DSH 实际记录的 token 消耗(每次对话的
inputTokens / outputTokens / cacheReadTokens),按 scnet 官方费率表折算,因此会自动跟随你在 DSH 里的真实使用,并回填整个自然月。 - 表外模型(如 SCNet-Max、Qwen3.6-Flash、DeepSeek-R1 系列)没有官方公开费率,会用默认费率近似;可在设置页补充费率或调整默认值。
- 如果你只在 DSH 之外用 scnet,这部分用量不包含在内。
开发
npm pack # 打 tarball
dsh plugin --profile web remove dsh-plugin-quota-monitor
dsh plugin --profile web add ./dsh-plugin-quota-monitor-<version>.tgz
lib/index.js— host 半:/balanceRPC 通道(snapshot / opencode / scnet / configGet / configSet / detect)。lib/client.js— browser 半:侧边栏卡片 + 设置页(手写 classic-script bundle,零构建)。
致谢 / 衍生
本项目由 jelly-000/dsh-balance-monitor 大幅扩展而来(MIT)。
License
Comments
Loading…
From the same category
DeepSeek Harness plugin for Reactive Resume: bridges your resumes and job applications into a Harness session over MCP.
★ 41.7k
↓ 156/wk
MIT
Aug 24, 2026
dsh plugin --profile web add dsh-plugin-reactive-resumeby Tencent
Let AI agents use your real, logged-in browser without interrupting your work. CLI + extension for browser automation across any shell-capable AI agent.
★ 8.6k
↓ 6.1k/wk
MIT
TypeScript
Oct 10, 2026
dsh plugin --profile terminal add @wxg-prc-cpg/browser-skill-dsh-pluginby yjh051108
dsh-routing-suite — injector + router-standard kit: install the runtime injector first, then the task-aware reasoning-mode router preset (measured P1-P23).
★ 7k
MIT
JavaScript
Sep 18, 2026
dsh plugin --profile web add @dsh-external/dsh-super-injectorby Q00
Agent OS: the agent gets smarter on its own. We just hold the line: Interview-gated, staged evaluation, budgeted evolution loop. MCP server, 14 runtimes: Claude Code, Codex CLI, Gemini CLI, OpenCode,
★ 6.2k
MIT
Python
Oct 7, 2026
by dsh-market
The plugin market inside DeepSeek Harness — browse, search, one-click install · DSH 可视化插件市场
★ 6.1k
↓ 112.4k/wk
MIT
TypeScript
Oct 10, 2026
dsh plugin --profile web add dshmarketby superdesigndev
OpenRouter for agent tools. Join community here: https://discord.gg/6mQYYfFMAn
★ 5k
NOASSERTION
Python
Oct 11, 2026
dsh plugin --profile web add treg-dsh
