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-center

v0.4.2

Published

Native DSH settings page for daily provider usage, subscription quotas, and API price estimates.

Readme

dsh-usage-center

为 DeepSeek Harness Web 提供原生的用量与费用面板。插件会在 DSH 设置中新增独立的 用量与费用 页面,将 Provider 用量、订阅额度、账户余额、API 估价和年度活动集中展示。

包含年度 Token 活动热力图的用量概览

Provider 用量、账户余额与订阅额度详情

功能

  • 按 Provider 和模型展示今日输入、缓存读取和输出 Token。
  • 最近 365 天 Token 活动热力图,包括累计 Token、单日峰值、当前连续天数和最长连续天数。
  • DeepSeek 账户余额,包括可用总额、充值余额和赠送余额。
  • Z.ai Coding Plan 当前会话周期、每周和账期额度百分比。
  • Kimi Code 会员等级、5 小时滚动额度和每周额度百分比。
  • 按公开模型单价计算等量 API 调用的估价。
  • 使用持久化快照和 stale-while-revalidate,重复进入时立即显示数据。
  • UI 支持中文和英文,并跟随 DSH 当前语言设置。
  • 所有聚合均在本机完成,只提供回环地址可访问的只读接口。

API 估价与实际扣费

API 估价回答的是:“相同 Token 用量按公开 API 单价计算需要多少钱?”它不是账单,也不会被当作订阅实际扣费。

  • 按量计费 Provider 展示今日 API 估价,以及支持查询时的账户余额。
  • 订阅 Provider 展示额度消耗百分比和等量 API 估价。
  • 页面会直接展示价格来源链接和单价生效日期。

环境要求

  • 支持插件的 DeepSeek Harness Web。
  • Node.js >= 22.19.0。

一键安装

dsh plugin --profile web add dsh-usage-center

安装后重启 DSH Web:

dsh web

npm 包和仓库均包含预构建插件 bundle,安装时不需要额外配置 pnpm allowBuilds。如需直接从 GitHub 安装,可将包名换成 github:Tieboyh/dsh-usage-center。

从源码安装

git clone https://github.com/Tieboyh/dsh-usage-center.git
cd dsh-usage-center
npm install
npm run check
dsh plugin --profile web add "$PWD"

开发或修改插件时使用源码安装流程。安装、升级或卸载后需要重启 DSH Web。

凭据

插件复用 DSH 凭据。API Key 只由服务端进程解析,不会返回浏览器,也不会写入统计快照。

| 凭据 | 用途 | | --- | --- | | DEEPSEEK_API_KEY | 查询 DeepSeek 账户余额。 | | ZAI_CODING_CN_API_KEY | 查询中国区域 Z.ai Coding Plan 的额度周期。 | | ZAI_API_KEY | Z.ai Coding Plan 的备用凭据。 | | ZAI_API_REGION | 可选的 Z.ai 区域覆盖配置。 | | KIMI_CODING_API_KEY | 查询 Kimi Code 会员等级和订阅额度周期。 |

数据与刷新机制

用量从本机 DSH 会话事件中聚合。同一 turn 和 step 重复上报的累计 usage 会替换旧样本,不会重复计数。

  • 最近一次成功结果保存在 <DSH_HOME>/storages/usage-center-snapshot.json。
  • 打开页面或重启 DSH 后,会立即展示当天快照。
  • 快照超过一分钟时,保留现有数据并在后台刷新。
  • 手动刷新期间不会清空当前页面。
  • 上游余额或额度请求失败时,继续保留上一次成功快照。
  • 快照包含聚合用量和已展示的余额/额度结果,但不包含 API Key。

隐私与安全

  • 概览接口只接受来自回环地址的只读 GET 请求。
  • 浏览器无法读取会话正文和原始事件日志。
  • 凭据始终位于 DSH credentials 服务之后。
  • 插件不包含外部分析或遥测。

开发

npm install
npm run check
npm run build

npm run check 会执行语法检查和 Node 测试。npm run build 会更新提交在 lib/ 中的 DSH 客户端与服务端 bundle;提交构建产物可以让 GitHub 一键安装无需授权依赖构建。

许可证

MIT