dsh-zhipu-coding-plan
v0.1.0
Published
GLM Coding Plan quota and usage as a conversation view tab (额度) for DeepSeek Harness web: 5-hour/weekly token windows, monthly MCP tool quota, and per-model/tool usage over the Zhipu monitor API
Readme
Highlights
| | Capability | What it gives you |
| :---: | --- | --- |
| ⏱️ | Token windows | 5-hour / weekly token progress with reset countdowns; color escalates as windows fill. |
| 🔧 | MCP tool quota | Monthly used / total / remaining, with per-tool details for network search, web read, Zread, and more. |
| 🤖 | Model usage | Call count, token totals, and per-model shares over the last 24 hours or 7 days. |
| 🔑 | In-tab key setup | Save the API key right in the panel (validated before storing), or use the ZHIPU_API_KEY environment variable. |
| 🛡️ | Readable errors | Classified messages for invalid keys, rate limits, and network failures; quota display survives detail-endpoint failures. |
Quick start
Install from npm (recommended)
dsh plugin --profile web add dsh-zhipu-coding-plan[!IMPORTANT] Restart DSH Web after installing. The 额度 / Quota tab then appears beside 对话 / 轨迹 / 统计. On first open, save your Zhipu API key right in the panel.
# From GitHub
dsh plugin --profile web add github:tsja2001/dsh-zhipu-coding-plan
# Uninstall
dsh plugin --profile web remove dsh-zhipu-coding-planWhat you get
Quota windows
- 5-hour / weekly tokens: used-percentage bars — warn color at ≥80%, error color at ≥95% — with each window's reset countdown.
- Monthly MCP tools: used / total / remaining counts plus per-tool detail rows.
Usage detail
- Model usage: switchable last-24h / 7-day window; calls, token totals, a per-bucket sparkline, and per-model share rows.
- Tool usage: network search, web read, Zread, and search MCP counts over the same window.
API key & privacy
[!NOTE] The key is stored only in the local DSH credential store (
~/.dsh/.credentials.yaml) or the environment; the panel never displays its value. Quota queries go straight to the official Zhipu monitor API (open.bigmodel.cn) — no third-party relay, no telemetry.
- Resolution order: launching environment
ZHIPU_API_KEY→ DSH credential store → launch-directory.env. - Re-resolved on every query; rotating the key needs no restart.
- Personal plans only; keys from other providers (e.g. DeepSeek) are reported as rejected, never shown as data.
Compatibility
- Requires a working DSH Web.
- Requires Node.js
^22.19.0or>=24.0.0. - Token windows are percentages only (the API returns no absolute values); the panel shows them as-is.
