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

@voidqr/dsh-deepseek-balance

v0.1.5

Published

DSH Web UI DeepSeek account balance row above the sidebar Settings trigger, 3-min auto refresh, click to refresh (host proxies /user/balance via credentials service)

Readme

@voidqr/dsh-deepseek-balance

在侧边栏「设置」入口上方显示 DeepSeek 账户余额,每 3 分钟自动刷新,点击立即刷新。

DeepSeek Harness 插件(host + browser 双半)。 host 半注册 GET /api/v1/balance 路由,用 DEEPSEEK_API_KEY 凭证代理官方余额接口 (https://api.deepseek.com/user/balance),密钥不出主机;browser 半在侧边栏 渲染余额行并轮询该路由。

功能

  • 余额行:显示在侧边栏「设置」入口上方。余额优先取 CNY 条目,显示为 余额:12.34元;没有 CNY 时回退 $12.34 或其他币种原样展示。
  • 自动刷新:每 3 分钟轮询一次;点击余额行立即刷新。
  • 悬停提示:显示「DeepSeek余额,点击刷新」;查询失败时附上具体错误原因。
  • 窄栏 / 宽栏跟随:读取「设置」按钮的 class 同步侧边栏 rail / wide 模式, 窄栏只保留图标。
  • 密钥安全:通过 dsh 凭证服务读取(~/.dsh/.credentials.yaml 中的 DEEPSEEK_API_KEY),取不到时回退 process.env.DEEPSEEK_API_KEY。密钥不会 打进前端产物,也只发给官方 api.deepseek.com。

安装

# web profile(或你自己的 profile 名)
dsh plugin --profile web add "@voidqr/dsh-deepseek-balance"

重启 DSH(或刷新页面让 bundle 重建)后,余额行出现在侧边栏「设置」入口上方。

卸载

dsh plugin --profile web remove @voidqr/dsh-deepseek-balance

⚠️ 卸载命令必须写完整的 @voidqr/ scope。pnpm 按包名精确匹配,只写 dsh-deepseek-balance 会报 ERR_PNPM_CANNOT_REMOVE_MISSING_DEPS。

Host 路由

| 方法 | 路径 | 说明 | | --- | --- | --- | | GET | /api/v1/balance | 代理 DeepSeek 官方余额接口。成功返回 { ok: true, is_available, balance_infos },失败返回 { ok: false, error }(未配置密钥 503 / 上游异常 502 / 非 GET 405) |

结构

package.json          npm 元数据 + dsh.bundle.patch + dsh.client(浏览器半声明)
cordis.patch.yml      向 profile bundle 插入本插件行
src/index.js          host 源码(/api/v1/balance 路由)
src/client/index.js   client 源码(余额行 DOM 注入)
build.mjs             esbuild 构建脚本(重新生成 lib/)
lib/index.js          预构建 host(ESM)
lib/client.js         预构建 client(ModuleLoader CJS handshake)

lib/ 已预构建,clone 即可用。

本地开发

dsh plugin --profile web add "link:D:/dev/dsh/dsh-plugins/dsh-deepseek-balance"

改动 src/ 后执行 npm i -D esbuild && npm run build 重新生成 lib/。 client 半改动刷新页面(Ctrl+F5)即可;host 半改动必须重启 dsh web。

开源协议

MIT