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

@az7627/dsh-token-usage

v0.1.1

Published

Per-conversation token usage timeline plugin for the dsh Web conversation view

Readme

@az7627/dsh-token-usage

DeepSeek Harness 插件:在 Web 对话视图统计 token 用量(分时段堆叠柱状图 + 精确到个位的总计)。npm 包名带作用域(无作用域的 dsh-token-usage 已被他人占用)。

  • 会话头右缘「用量统计」按钮 → 右侧抽屉
  • 对话多选(默认当前对话 / 全选 / 仅当前)
  • 分度:15 分钟 / 1 小时 / 1 天;范围:近 7 天 / 近 30 天 / 全部
  • 三桶:缓存输入(cacheReadTokens)、输入(inputTokens + cacheWriteTokens)、输出(outputTokens
  • ECharts 堆叠柱状图(本地时区日历对齐)、精确到个位的 tooltip、总计与每对话明细
  • 数据来自会话日志重放(/usage RPC 通道),历史对话装上即有数据

安装到你的 dsh

从 npm 安装(推荐)

# 首次安装(会把它挂进 ~/.dsh/profiles/web 的 bundle 列表)
npx @deepseek-ai/dsh plugin --profile web add @az7627/dsh-token-usage

# 重启你的 dsh web 后生效
npx @deepseek-ai/dsh web
  • 更新:重新执行上面的 add(pnpm 会装最新版)
  • 卸载:npx @deepseek-ai/dsh plugin --profile web remove @az7627/dsh-token-usage

本地开发(link 安装)

npx @deepseek-ai/dsh plugin --profile web add <本目录的绝对路径>

改完源码 pnpm run build 后重启 npx @deepseek-ai/dsh web 即生效,无需重新 add。

开发

pnpm install     # 依赖(zod 运行期;echarts 打进浏览器 bundle)
pnpm run build   # tsc + tsdown → lib/index.js(宿主半)+ lib/client.js(浏览器半)
pnpm test        # vitest(组件测试 mock 了 echarts)

类型检查依赖同目录下 deepseek-harness 源码树里已构建的 lib/types(仅编译期引用,运行期全部由 dsh 安装提供)。