dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
GLM Coding Plan quota display plugin for the DeepSeek Harness (DSH) web UI
GLM Coding Plan(智谱 bigmodel.cn 订阅套餐)配额显示插件,适用于 DeepSeek Harness(DSH)Web UI。
English: A DeepSeek Harness (DSH) plugin that shows your GLM Coding Plan quota — 5-hour / weekly credit windows, plan expiry, reset cards and cash balance — as a compact chip left of the model selector in the composer. Zero-config for personal plans: it reads the key you configured for the
zai-coding-cnprovider. Install withdsh plugin --profile web add dsh-glm-quota.
在输入框工具行、模型选择器的左侧显示一个「剩余额度」芯片,鼠标悬停展开详情:
zai-coding-cn 时显示;Key 自动读取「添加模型提供商」时录入的凭证(ZAI_CODING_CN_API_KEY),浏览器半侧不接触任何凭证bigmodel-organization / bigmodel-project 头);type 参数自动探测(个人不带 type,团队以 type=2 兜底)running 下降沿)、模型切换与手动按钮推荐用官方 CLI 安装(自动维护依赖与 bundle 列表):
# 从 npm 安装(发布后的包名)
dsh plugin --profile web add dsh-glm-quota
# 或直接从 GitHub 安装(本包是纯 JS、lib/ 随仓库分发,无需构建授权)
dsh plugin --profile web add github:chiikin/dsh-glm-quota
# 或从本地 tarball 安装
pnpm pack # 生成 dsh-glm-quota-0.1.0.tgz
dsh plugin --profile web add ./dsh-glm-quota-0.1.0.tgz
<profile> 换成实际的 profile 名(默认 web)。也可以手动安装:在 profile 目录 pnpm add dsh-glm-quota,再把下面一段加进 profile 的 cordis.patch.yml(用户 patch 层):
- insert:
- id: glm-quota
name: 'dsh-glm-quota'
安装后重启 DSH(或等待 patch 热重载)生效。
浏览器 (lib/client.js) 宿主 (lib/index.js)
┌──────────────────────────┐ 事件驱动 ┌──────────────────────────────┐
│ conversation.input.right │ ──────────▶ │ GET /dsh-glm-quota/status │
│ 「剩余额度」芯片+悬浮窗 │ 挂载/回合 │ · 会话级供应商判定 │
│ useSession(running 沿) │ 结束/切模型│ (model/selection 事件跟踪, │
└──────────────────────────┘ │ 回落 agentDefaultModel) │
│ · credentials.resolve │
│ (ZAI_CODING_CN_API_KEY) │
│ · 60s TTL 缓存 ──▶ open.bigmodel.cn
└──────────────────────────────┘
上游端点(非官方公开接口,改版可能失效):
| 端点 | 用途 |
|---|---|
GET /api/monitor/usage/quota/limit | 5h / 周窗口配额 |
GET /api/biz/subscription/list | 套餐名称、到期、自动续费 |
GET /api/biz/account/query-customer-account-report | 现金余额 |
Bearer,暂未适配type=2 兜底可查,但团队上下文头(org/project)未实现——如团队套餐查询为空,需要补充组织上下文支持MIT