npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-usage-balance-plugin

v0.1.0

Published

DeepSeek Harness usage & balance floating widget: live account balance, today's spend / request count / tokens, and auto-synced official CNY pricing.

Downloads

147

Readme

dsh-usage-balance-plugin

DeepSeek Harness 的今日用量 & 余额悬浮窗插件:

  • 💰 实时余额(DeepSeek 官方接口,每 60 秒自动刷新)
  • 📊 今日用量:消费金额 / API 请求次数 / Tokens(统计自 DSH 本地会话日志,精确)
  • 🏷️ 消费金额按官方中文定价页的实时人民币单价估算(缓存 1 小时,调价自动同步;页面抓取失败时回退内置价格)
  • 🪟 可拖动悬浮窗(限制在视口内)、可关闭、侧边栏 ¥ 按钮开关、手动刷新

安装

前置:已安装 DeepSeek Harness(DSH)。

# 1. 找到 DSH 的依赖目录(Windows 示例;通用方法见下方"如何找到 DSH 目录")
cd "C:\Users\你的用户名\AppData\Roaming\npm\node_modules\@deepseek-ai\dsh"

# 2. 安装本插件(装进 DSH 的 node_modules)
npm install dsh-usage-balance-plugin
# 3. 在 DSH 配置的补丁文件里注册插件行。
#    文件路径:<DSH 配置目录>\profiles\<profile>\cordis.patch.yml
#    例如 C:\Users\你的用户名\.dsh\profiles\web\cordis.patch.yml:
- insert:
    - id: dsh-usage-balance-plugin
      name: dsh-usage-balance-plugin
# 4. 重启 DSH → 右下角出现悬浮窗

如何找到 DSH 目录

npm root -g
# 输出全局 node_modules 路径(如 C:\Users\<你>\AppData\Roaming\npm\node_modules)
# DSH 目录就在它下面:<全局 node_modules>\@deepseek-ai\dsh

DSH 的配置目录默认为 %USERPROFILE%\.dsh(可用环境变量 DSH_HOME 覆盖)。

使用

  • 右下角悬浮窗:今日消费金额(大字)、API 请求次数、Tokens、余额
  • 按住标题栏拖动;✕ 关闭;侧边栏底部 ¥ 按钮开关
  • 余额 60 秒自动刷新,用量 5 分钟自动刷新;"刷新"按钮同时手动刷新

数据说明

  • 请求次数 / Tokens:来自 DSH 本地会话日志(assistant/message 事件的 usage),精确反映本机 DSH 的调用;不含通过同一 API Key 的其他程序(如联网搜索、其他工具)。
  • 消费金额:Token 桶 × 官方人民币单价(缓存命中 / 未命中 / 输出 × 平峰 / 高峰,周末全天低谷)× 时段规则,为估算值,可能与平台账单有小偏差。
  • 余额:官方 /user/balance 接口实时查询;API Key 从 DSH 凭据存储(DEEPSEEK_API_KEY)解析。

隐私与安全

  • API Key 仅存在于 DSH 进程内,通过 stdin 传给 curl(不落盘、不显示在命令行)。
  • 插件只读取 DSH 本地会话日志与官方公开页面,不上传任何数据。

License

MIT