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-quota-meter

v0.3.2

Published

A usage panel for provider plans: shows how much of each quota window is left (GLM Coding Plan and OpenCode Zen) as a compact chip next to the model selector, with a detail popover.

Readme

dsh-quota-meter

给 DeepSeek Harness 加一个供应商套餐用量面板:在模型选择器右侧显示一枚小图标,悬停(或点击)展开当前套餐的窗口明细。

已接入两家:

| 套餐 | 面板列 | | --- | --- | | GLM Coding Plan(智谱 / Z.ai) | 5 小时 · 每周 · 工具调用 | | OpenCode Zen(Go) | 滚动窗口 · 每周 · 每月 |

  • 按会话实际使用的供应商显示:面板问 Host「这个会话在跑哪家」,Host 从会话自己的 model/selection 事件读 provider id,所以 newapi 之类的网关不会误显示
  • 平时不发任何请求:只有悬停/点击时才查一次(?refresh=1 绕过缓存),移开即关闭
  • API key 只在 Host 进程内使用,不下发到浏览器;上游结果按 refreshSeconds 缓存

安装

dsh plugin install dsh-quota-meter

或在 Plugins 页安装后重启。

配置

| 键 | 默认 | 说明 | | --- | --- | --- | | source | auto | auto / glm / opencode;auto 按当前 provider 判断 | | apiKeyEnv | ZAI_CODING_CN_API_KEY | 智谱 key 的凭据名 | | baseUrl | https://api.z.ai | 智谱接口域名;BigModel 用 https://open.bigmodel.cn | | opencodeApiKeyEnv | OPENCODE_GO_API_KEY | OpenCode key 的凭据名 | | opencodeBaseUrl | https://opencode.ai/zen/go/v1 | OpenCode 接口域名 | | refreshSeconds | 20 | 缓存时间(下限 10 秒) |

两个 key 都只在 Host 进程内使用,不会下发到浏览器。只配一家也能用,另一家会显示「未配置 API Key」。

数据来源

与各家客户端自己用的接口一致:

# GLM Coding Plan
GET <base>/api/monitor/usage/quota/limit
authorization: <api key>

# OpenCode Zen (Go)
GET <opencodeBaseUrl>/usage
authorization: Bearer <api key>

OpenCode 返回的是三个窗口的使用百分比:

{"usage":{"rolling":{"percent":1,"resetsAt":"..."},"weekly":{"percent":0,...},"monthly":{"percent":0,...}}}

位置与可见性

  • 挂在 conversation.input.activity:输入框工具行里、模型选择器右侧紧邻。 (布局没有"模型左侧"的插槽:conversation.input.left 是最左边那一簇,而模型选择器本身是 single 槽,不能被扩展。)

  • 渲染前先问 Host 一次 ?probe=1(纯本地、不打上游),Host 用会话的 model/selection 事件得出 provider: 判断顺序:

    1. 模型控件上的 data-provider-id(选择器自己渲染的属性,就是用户眼前那个)→ 最优先
    2. 会话的 model/selection 事件(会话记录过选择时)
    3. 都没有 → 隐藏图标

    为什么不能只看模型名:deepseek-v4.1-flash 这类模型同时挂在多个供应商下,名字分不出归属。 为什么不能退到「profile 默认模型」:新会话在第一次选择被记录前没有事件,而默认模型未必是用户刚切换的那个——之前就因此把 GLM 会话显示成了 OpenCode。

显示内容

  • 触发图标:一个柱状小图标,不显示数字
  • 弹层:套餐徽标(GLM Coding Plan / OpenCode Go)+ 各窗口一列(名称、剩余百分比、重置日期、进度条)
  • 底部:本次读数时间

接口字段对照

| 面板 | GLM | OpenCode | | --- | --- | --- | | 5 小时 / 滚动 | TOKENS_LIMIT + unit: 3 | usage.rolling.percent | | 每周 | TOKENS_LIMIT + unit: 6 | usage.weekly.percent | | 每月 | — | usage.monthly.percent | | 工具调用 | TIME_LIMIT(usage 总额、currentValue 已用) | — | | 套餐 | data.level | — |

两家返回的都是已用百分比,面板统一按 剩余 = 100 - 已用 显示。

相关插件

| 插件 | 说明 | | --- | --- | | dsh-predict | 预测下一条指令并显示为占位文字,Tab 采纳 | | dsh-input-history | 输入框中按 ↑ / ↓ 回填历史消息 | | dsh-subagent-bridge | 让 Codex 通过本机 MCP 把 DSH 当 subagent 用(spawn / wait / followup),反向也能把任务派给 Codex | | dsh-quota-meter(本仓库) | 在模型选择器旁显示供应商套餐额度余量(GLM Coding Plan / OpenCode Go),点开是明细浮层 | | dsh-provider-icons | 在模型名旁显示供应商品牌 logo(24 个厂商,支持前缀匹配) |