用量统计面板:静默按模型采集 token、活跃热力图、趋势图、费用估算与每日超限守卫。
Usage statistics panel: silent per-model token collection, activity heatmap, trend charts, cost estimation and daily-limit guard.
安装
dsh plugin --profile web add github:hb-degithub/dsh-usage-guardGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
English | 中文
Usage statistics panel for DeepSeek Harness (DSH) Web GUI — silent background collection, per-model analytics, cost estimation and a daily-limit guard.
Features
- Silent collection — hooks session events, folds every assistant message's token usage into daily buckets per provider × model; survives restarts, backfills from session logs on first run
- Dashboard in Settings → Usage: six stat cards (tokens, sessions, messages, active days, current streak, top model), a GitHub-style activity heatmap (continuous year view, weekday/month labels, hover detail card per day), a multi-series line/area trend chart (input / output / cache hit / cache write / cost, dual axes, 7d/30d switch) and a model-usage donut
- Cost estimation — configurable per-model prices (input / output / cache read / cache write per 1M tokens); built-in DeepSeek list prices; models without a price are excluded from cost instead of guessed
- Daily-limit guard — optional daily token / cost caps;
warnmode shows a global banner,blockmode aborts over-limit LLM requests before they hit the network - Bilingual (zh/en), follows the DSH theme tokens, zero external runtime dependencies
Install
From the DSH plugin market (Settings → 插件市场), or:
dsh plugin --profile web add dsh-usage-guard # npm
dsh plugin --profile web add <github-url> # or from GitHub
Restart dsh web, then open Settings → 使用统计.
Develop
pnpm install
pnpm build # tsdown + wrap-client → dist/client.js (host loads host/, browser loads dist/)
pnpm test # vitest, incl. an SSR smoke test that renders all charts from real data
License
MIT
中文
DeepSeek Harness(DSH)Web GUI 的用量统计面板——后台静默采集、按模型分析、费用估算、每日超限守卫。
功能
- 静默采集——挂钩会话事件,把每条助手消息的 token 用量折叠进 天 × 提供商 × 模型 桶;重启不丢,首次运行自动从会话日志回填
- 仪表盘(设置 → 使用统计):六张统计卡(tokens、会话数、消息数、活跃天数、连续天数、最常用模型)、GitHub 风格活跃热力图(连续年度视图、星期/月份标注、逐日悬浮详情卡)、多序列折线/面积趋势图(输入/输出/缓存命中/缓存创建/成本,双轴,7/30 天切换)、模型用量环形图
- 费用估算——按模型配置价格(每 1M tokens 的 输入/输出/缓存读/缓存写);内置 DeepSeek 刊例价;未配置价格的模型不计费而不是瞎猜
- 每日超限守卫——可选每日 token / 费用上限;
warn模式全局横幅提醒,block模式在请求发出前直接拦截 - 中英双语,跟随 DSH 主题令牌,零外部运行时依赖
安装
插件市场(设置 → 插件市场)一键安装,或:
dsh plugin --profile web add dsh-usage-guard # npm
dsh plugin --profile web add <github 地址> # 或从 GitHub
重启 dsh web,打开 设置 → 使用统计。
许可
MIT
原始 README: https://github.com/hb-degithub/dsh-usage-guard/blob/main/README.md ↗
同类插件
查看全部 →
dsh-usage-plugin
DeepSeek Harness 用量与消耗插件(dsh-usage)—— 每次调用的 token 用量/缓存命中统计、峰谷计费、余额查询、CSV/JSON/PNG 导出,可经桌面端一键安装或命令行 dsh plugin add 安装。

dsh-whale-report
🐋 鲸鱼记事本 — 你的 Agent 年度报告:从会话事件日志生成日报/周报/月报/年报,任意区间、只读不改写

dsh-balance-meter
输入框 dock 显示 DeepSeek 账户余额与会话花费,自动拉取官方定价,支持高峰/低谷计价。

dsh-usage-stats
DeepSeek Harness 使用统计插件|Token 总量与构成、7/30 天趋势、年度活跃热力图、模型占比、工作区/任务筛选、CSV/JSON 导出

dsh-balance
DeepSeek 余额实时显示插件: 在 dsh Web UI 输入框 下方、命中率/输入输出 token 统计条所在的同一行 , 实时显示:

dsh-balance-monitor
DeepSeek 账户余额、剩余比例条与今日花费,显示在 dsh 侧边栏底部 · DeepSeek balance, remaining-ratio bar and today's spend in the dsh si