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

@trinitydesk/dsh-usage-stats

v0.1.0

Published

Trinity dashboard usage/balance panel for DeepSeek Harness: reads the current session model's API key, validates xh- prefix, then calls GET /v1/dashboard/billing and /usage/daily.

Readme

@trinitydesk/dsh-usage-stats

Trinity 用量/余额侧栏插件,面向 DeepSeek Harness / Trinity Code(dsh plugin add 安装)。

安装(npm)

需已安装 Harness / Trinity Code,且 dsh >= 0.1.0-rc.7

dsh plugin --profile web add @trinitydesk/dsh-usage-stats@latest
dsh web

可选环境变量:TRINITY_BASE_URL(默认 https://api.trinitydesk.ai)。

行为

  • 侧栏底部「用量」入口,展示余额与近 90 日用量汇总。
  • API Key 来源:当前会话所选模型的 provider → llm-pi-ai 配置里的 apiKeyEnvcredentials.resolve
  • 密钥须以 xh- 开头才会请求 Trinity dashboard;否则显示「非 Trinity 官方 Key,无法获取用量信息」。
  • Host 侧调用 GET /v1/dashboard/billingGET /v1/dashboard/usage/daily,密钥不下发到浏览器。

发布

cd ide工具/dsh-trinity-usage-stats
pnpm run check
npm publish --access public

prepublishOnly 会自动执行 typecheck、测试与构建。

本地开发

仓库内源码路径:ide工具/dsh-trinity-usage-stats/。联调需克隆官方 Harness 到 ide工具/deepseek-harness-upstream/

cd ide工具/dsh-trinity-usage-stats
pnpm install
pnpm run check

cd ../deepseek-harness-upstream
dsh plugin --profile web add ../dsh-trinity-usage-stats
dsh web

验收

  1. 为某 provider 配置 xh- 开头的 Trinity Key,并在会话中选该模型 → 用量面板可加载余额/用量。
  2. 使用非 xh- 密钥 → 提示非 Trinity 官方 Key。
  3. 无活动会话 → 请先打开或选中会话。

与 Trinity Code 内置版的区别

Trinity Code fork 内置 packages/host/usage-stats 固定读 TRINITY_API_KEY。本插件按会话当前模型解析密钥,适合在官方 Harness 上通过 npm 单独安装。