Yolotd/dsh-plugin-duwg
每日用量统计:输入框下方显示当天 Token 用量(万/亿简化)与缓存命中率 | Daily token usage & cache-hit stats for DeepSeek Harness
Project Overview项目介绍
This is a daily token usage and cache hit statistics plugin built exclusively for DeepSeek Harness (DSH). To install the plugin, you can run the official DSH plugin add command with either the local repository path or the public Git URL, or install it directly from npm after it is published to the npm registry. After installation completes, you just need to restart the dsh web service, and the statistics widget will automatically load and appear below the input box of DSH’s web interface, with no extra manual configuration required from the user.
This plugin is designed specifically for DSH users who need to keep close track of their daily DeepSeek API token consumption. When DSH starts, the plugin automatically scans all compressed .jsonl.zstd session logs in the $DSH_HOME/sessions directory to calibrate the daily usage count, so your accumulated usage data will not be lost even after an unexpected process restart or crash. During daily use, it aggregates token usage from all new active sessions in real time, and the frontend widget polls for updated data every 2 seconds to refresh the display, so you can check your current consumption at any time without needing to run manual queries.
All usage data is persisted to the local file $DSH_HOME/storages/duwg/usage.json, which preserves data across process restarts and automatically resets the statistics at the start of each new day. The plugin follows strict security practices: your API key only ever stays on the DSH host side and never gets sent to the browser, and all network requests only go to official DeepSeek endpoints, with no third-party calls or telemetry. The plugin is released under the open-source MIT license, so it is free to use, modify, and distribute with no extra restrictions or hidden costs for end users or developers alike.
这是一款专为 DeepSeek Harness(DSH)开发的原生每日用量统计插件,核心功能是在 DSH 的输入框下方展示当日的 Token 用量统计、缓存命中率、账户余额以及预计消耗数据。它通过 DSH 官方插件命令安装,安装后重启 DSH web 服务即可生效,统计组件自动挂载到输入框下方。
它面向需要监控每日 DeepSeek API Token 消耗的 DSH 用户,启动时会自动扫描 DSH 本地 $DSH_HOME/sessions 目录下的会话日志校准当日用量,就算进程重启或崩溃,统计数据也不会丢失。日常使用中,它会实时聚合所有新会话的 Token 用量,每2秒轮询刷新前端显示,不用用户手动查询就能随时掌握消耗情况。
统计数据会持久化存储到 $DSH_HOME/storages/duwg/usage.json,跨进程保留数据,每日自动重置统计。API 密钥仅保存在 host 端,不会传入浏览器,所有网络请求仅调用 DeepSeek 官方接口,没有第三方请求和遥测,符合安全要求。该插件采用 MIT 许可开源,完全免费供用户使用,没有额外的使用限制。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-plugin-duwg(Yolotd/dsh-plugin-duwg)
仓库:https://github.com/Yolotd/dsh-plugin-duwg
本站详情页:https://www.yhbd.top/plugins/yolotd-dsh-plugin-duwg/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-08-18 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-plugin-duwg
把 Yolotd/dsh-plugin-duwg 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-plugin-duwg
每日用量统计插件 for DeepSeek Harness。
在输入框下方显示当天 Token 用量(万/亿简化显示,悬停看精确值)与缓存命中率,含余额血条和预计消耗。
Daily token usage & cache-hit stats for DeepSeek Harness. Shows today's token usage (simplified to 万/亿 with exact values on hover), cache hit rate, account balance bar, and estimated cost right below the composer.
功能 Features
- 今日总消耗:当天所有会话的 input / output / cache-read / cache-write Token 汇总(Host 端聚合,按天持久化)
- 会话日志校准:启动时扫描
$DSH_HOME/sessions下的.jsonl.zstd会话日志(zstd 帧自动识别),校准当天用量,进程重启/崩溃后数据也不丢 - 万/亿 简化:大数字自动转为
1.23万/4.56亿,悬停显示精确值 - 缓存命中率:缓存读取占总量的比例,绿色数字实时显示
- 余额血条:显示 DeepSeek 账户余额与当天最高余额(充值自动抬高上限),低余额变红
- 预计消耗:网关透传的费用字段累计(
usage.cost) - 持久化:数据写入
$DSH_HOME/storages/duwg/usage.json,跨进程保留、跨天自动重置
安装 Install
# 从源码安装(推荐先审查)
dsh plugin --profile web add <本仓库路径或 git URL>
# 或从 npm(发布后)
dsh plugin --profile web add dsh-plugin-duwg
安装后重启 dsh web,小部件会出现在输入框下方。
数据位置 Data
$DSH_HOME/storages/duwg/usage.json
($DSH_HOME 默认 ~/.dsh)
工作原理 How it works
- Host 半(
lib/index.js):拦截llm/stream瀑布流聚合 usage 块(同一流只计一次);提供GET /duwg/usage-statsHTTP 路由;余额走官方api.deepseek.com/user/balance(60s 缓存,仅 host 端持有 API key);启动时扫描会话日志校准 - Client 半(
lib/client.js):DOM 挂载的小部件,2s 轮询刷新,数字原地更新不重建 DOM
安全 Security
- API key 只存在于 host 端,通过官方
ctx.credentials解析,绝不进入浏览器 - 余额查询仅调用 DeepSeek 官方接口,60s 缓存降低调用频率
- 会话日志扫描仅读取本地
$DSH_HOME/sessions下的.jsonl.zstd文件,用于校准用量,不对外发送 - 无任何第三方网络请求、无遥测
License
MIT
wssfk12138/dsh-damage-pulse
Ychris12138/dsh-usage-stats
JingbiaoMei/Tokdash
yxxbc/dsh-balance-plugin
feiyang-dev/dsh-usage-plugin
LaoYueHanNi/dsh-token-usage
lanlandeli/dsh-usage-stats
Shiye-10Pages/dsh-whale-meter