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-plugin-token-stats

v0.5.1

Published

DSH token usage dashboard: a draggable, position-remembering pill with daily/weekly consumption charts

Readme

dsh-plugin-token-stats

DeepSeek Harness 的 token 用量看板:右下角一个可拖动的胶囊,点开是分时段、分模型的消耗图表。

安装

DeepSeek Harness 桌面端——侧栏打开 插件,添加插件,填 dsh-plugin-token-stats,点 安装,装好后点 立即启用。

就这样。右下角随即出现胶囊,随便拖到哪,位置会记住。

让 agent 装——对桌面端里的 agent 说:

用 plugin_manager 把 dsh-plugin-token-stats 装进当前 profile

离线安装——把 .tgz 或本地目录的绝对路径填进「添加插件」,例如 D:\plugins\dsh-plugin-token-stats。填目录时 pnpm 建的是 junction,改源码即时 生效。

非桌面 profile:

dsh plugin --profile web add dsh-plugin-token-stats

(dsh plugin --profile desktop 由桌面端独占,CLI 会直接拒绝。)

功能

胶囊显示全部会话的累计总量与今日用量。点开面板:

  • 时间范围:今天 · 指定日(任选某一天)· 本周 · 近 30 天 · 近 12 周 · 近 12 月
  • 选某一天:日期选择器、‹ / › 逐日翻、今天/昨天/前天/7 天前快捷按钮; 也可以在 30 天/12 周/12 月图上点任意一根柱子,直接钻取到那天
  • 模型筛选:全部模型或任一模型,图表与数字随之切换
  • 六个指标:区间总计 / 输入 / 输出 / 缓存读取 / 计费合计 / 请求数
  • 柱状图分色:实心=计费(输入+输出),浅色=缓存读取
  • 用量排行:按会话或按模型,跟随所选范围

可拖动、记住位置:按住胶囊,或按住面板标题栏空白处拖动。位置以比例记 住——刷新、重开浏览器、重启 dsh 都还在原处,窗口放大缩小时相对位置也不变。

数据从哪来

读 $DSH_HOME/sessions/**/session.v3.jsonl.zstd,聚合每个 assistant/message 事件的 data.usage(provider 上报的真实用量)。

读的是持久日志而不是实时计数器,所以历史会话——包括更早进程创建的——都在 统计范围内。

卸载与升级

插件页里卸载即可。官方当前不支持插件自动更新,升级要卸载后重装新版。

已知限制

  • 只计 assistant/message 的用量。session/title-llm-request 这类后台小请求 也可能计费但没算进去,所以数字略低于真实账单。
  • 缓存桶的字段名做了兼容猜测(cacheReadTokens 或 cachedInputTokens)。若 provider 改名,缓存会记 0,但输入/输出/总计仍准确。
  • 「按会话」在「指定日」下是该日数据,在其它范围下是所选模型的全部时间 数据;「按模型」始终跟随所选范围(选项卡右侧标注了各自范围)。
  • 「指定日」最早只能选到日志里最早的一天,更早的日期显示 0 与空状态。
  • 「按会话」排行最多显示 8 条,不是分页列表。
  • 全量扫描是同步 IO,会话很多时首次加载偏慢(结果缓存 5 秒)。
  • 拖动只在胶囊和面板标题栏空白处生效。标题栏上的按钮、模型下拉、日期 输入有自己的手势,不会被拖动抢走。
  • 桌面版和 dsh web 端口不同,是两个源,所以浮窗位置各记各的。

开发

扩展点、cordis 约束、拖动实现、测试与发布流程见 docs/DEVELOPMENT.md (仓库内,不随 npm 包分发)。

许可证

MIT