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-glm-quota-dock

v1.3.2

Published

Shows GLM Coding Plan quota usage and the 5-hour window reset countdown next to the session stats row.

Downloads

1,416

Readme

dsh-glm-quota-dock

GitHub Release npm Last Commit License: MIT Platform PRs Welcome

DeepSeek Harness (DSH) 插件:在会话输入框下方的统计行内,常驻一个 GLM Coding Plan 额度 pill,实时显示各窗口用量百分比。

A lightweight DeepSeek Harness plugin that shows your GLM Coding Plan quota as an always-visible pill in the composer stats row.

◔ GLM 5h 9% · 周 45% · 工具 7% · 🕐 2h 15m

截图

v1.3.2 双列卡片式详情面板(截图摄于 v1.3.1,24h 用量卡为展开态;v1.3.2 起该卡默认折叠,点击头部展开。Lite 档模拟数据、本地渲染,着色与布局与真实环境一致):

| 正常(<80%,绿/蓝) | 告警(≥80%,琥珀) | 临界(≥95%,红) | | :---: | :---: | :---: | | 详情面板 正常(45%) | 详情面板 告警(88%) | 详情面板 临界(99%) |

特性

  • 实时额度:输入框统计行内常驻 pill,30 秒轮询;pill 百分比与详情卡片共用同一套强调色(5h 蓝 #0B7FFF、工具紫 #9E77ED),≥80% 琥珀、≥95% 红同步覆盖
  • 5h 重置倒计时:pill 末尾常驻 5 小时窗口的重置倒计时(悬浮看具体时刻),颜色跟随 5h 窗口;面板内 5h 卡片头部右侧展示倒计时
  • 仅在 GLM 会话显示:通过会话的模型选择投影判断,只有当前会话走 Coding Plan 路由 且使用 glm-* 模型时才渲染;纯 API 计费路由(消耗余额而非套餐)不会误亮,非 GLM 会话完全零请求
  • 点击详情:双列卡片式面板 —— 每个窗口一张卡片(标题 + 大号百分比 + 右侧重置时刻 + 5px 粗进度条,正常态按卡片着色),绝对用量(如工具调用 7/100)与各模型明细折叠进卡片悬浮提示;24 小时用量卡默认折叠(只显示标题与 24h 总 token,点击头部展开小时级 token sparkline、按模型明细与调用次数;展开状态会话内记忆,刷新/新会话回到默认折叠),另有档位徽标(悬浮看套餐版本说明)、一键打开官方用量页、手动强制刷新
  • 空闲降频:页面可见但 5 分钟无操作时自动降为 5 分钟一轮,恢复操作立即刷新;最小化/切走完全停止
  • 插件版本与一键更新:面板页脚显示插件版本号(灰色小字,与套餐档位无关);每小时静默检查一次 npm 新版本(失败不打扰),有更新时出现「可更新」绿色药丸,点击弹出确认气泡,确认后由 Host 端执行 pnpm 自更新并自动刷新页面;插件配置 enableSelfUpdate: false 可关闭自更新入口
  • 套餐版本自适应:V1(5h + 月度)、V2(含周窗口)、新版积分制均按响应字段自动识别展示,未知形状优雅回退
  • 密钥不出本机:API Key 只在 Host 进程内解析与使用,浏览器仅拿到聚合后的百分比;路由挂在 DSH /api 信任栅栏与浏览器鉴权之后

要求

  • DeepSeek Harness(Desktop 或 dsh web,建议较新版本)
  • 已在 DSH 模型页配置 GLM Coding Plan 供应商(如 zai-coding-cn),其 API Key 会通过凭据引用自动解析(默认 ZAI_CODING_CN_API_KEY)

[!NOTE] 作者仅在 Lite 档(历史版本 V1:5 小时窗口 + 月度工具额度) 上实际验证过。V2(含周窗口)与新版积分制是按官方响应字段做的适配,逻辑上兼容但未经真机验证;如显示异常,欢迎提 issue 附上返回结构。

安装

插件零构建、零依赖,已发布到 npm,最简单的安装只需一条命令。

方式 A:npm(推荐)

dsh plugin --profile <你的profile> add dsh-glm-quota-dock

方式 B:让 DSH 会话里的 Agent 安装(任何 profile 通用)

把仓库地址交给 DSH 会话里的 Agent:

请用 plugin_manager 的 install_bundle 安装 https://github.com/Everglow28/dsh-glm-quota-dock

Agent 会克隆仓库并把 bundle 装进当前 profile,安装成功后按提示重启 DSH + 刷新网页即可。

方式 C:dsh CLI + git clone

git clone https://github.com/Everglow28/dsh-glm-quota-dock.git
dsh plugin --profile <你的profile> add <克隆目录的绝对路径>

方式 D:手动

把仓库克隆/复制到 ~/.dsh/profiles/<profile>/node_modules/dsh-glm-quota-dock/,并在该 profile 的 cordis.patch.yml 追加:

- insert:
    - id: glm-quota-dock
      name: 'dsh-glm-quota-dock'
      config:
        endpoint: https://open.bigmodel.cn
        minIntervalSec: 60

安装后重启 DSH(Host 半部需要随进程加载),再刷新网页(Client 半部)。

配置

在安装时生成的 Cordis entry 的 config 下调整(改完重启):

| 字段 | 默认 | 说明 | | --- | --- | --- | | endpoint | https://open.bigmodel.cn | 全球站用户改为 https://api.z.ai | | minIntervalSec | 60 | 上游最小请求间隔(秒),下限 30 | | apiKeyRef | ZAI_CODING_CN_API_KEY | 凭据引用名(与模型页写入的引用一致) | | apiKey | 无 | 直接内联 key(不推荐,优先用凭据引用) | | cwd | \ | 上游请求(curl)的工作目录,一般不用改 |

工作原理

凭据服务解析 API Key(与 zai-coding-cn 模型路由同一把 key)
        │
        ▼
Host 半部调用官方监控端点(裸 key 鉴权,与官方 glm-plan-usage 一致):
  GET {endpoint}/api/monitor/usage/quota/limit     ← 各窗口百分比/重置时间
  GET {endpoint}/api/monitor/usage/model-usage     ← 近 24h 按模型用量
        │  60s 内存缓存 + 并发去重
        ▼
注册认证路由 GET /api/glm-quota(DSH /api 信任栅栏 + 浏览器签名 cookie)
        │
        ▼
Client 半部:同源 fetch,30s 轮询(空闲降频),渲染 pill 与详情面板

数据来自智谱官方监控接口(与官方 glm-plan-usage 插件同源),轮询频率保守,不触碰任何非公开接口。

卸载

dsh plugin --profile <你的profile> remove "dsh-glm-quota-dock"

或让 Agent 调 plugin_manager remove_bundle。移除后重启 + 刷新页面。

常见问题

  • pill 不显示? 确认当前会话使用的是 Coding Plan 路由下的 glm 模型;确认凭据引用已配置(面板报错时悬停 "GLM !" 可看原因);Host 半部改动需要重启而非刷新

License

MIT