插件目录 / Developer / dsh-quota-cards
dsh-quota-cards
已验证 · 实测可装 ShiraGawaAnri
功能简介
DSH 额度查询插件:在**消息输入框左侧**常驻一张额度 Card,随当前模型自动切换,展示对应账号的额度/流量,支持手动刷新(带防抖)和按周期自动刷新。无需发布到 npm —— 打包成 zip 发给对方即可安装。
可用 — 实测通过,早期项目
DSH 额度查询插件:在**消息输入框左侧**常驻一张额度 Card,随当前模型自动切换,展示对应账号的额度/流量,支持手动刷新(带防抖)和按周期自动刷新。无需发布到 npm —— 打包成 zip 发给对方即可安装。 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-quota-cards
A DSH account-quota plugin. It keeps a resident Card at the left end of the
composer that follows the selected model and shows the matching account
readout — DeepSeek balance, or OpenCode Go remaining token usage over the
5h (rolling) / weekly / monthly windows — with a debounced manual refresh
button and interval-based auto refresh.
Features
Composer-left quota Card (conversation.input.left)
- DeepSeek: account balance (total, with granted/topped-up detail in the
tooltip). Credential reference and refresh interval are configured in
Settings. - OpenCode Go: remaining token traffic for the 5h (rolling) / weekly /
monthly windows as percentages (tooltip carries the used share and reset
time). - Follows the model: each refresh re-resolves the current provider via the
session.modelsRPC; providers whose id containsdeepseekshow the balance
card,opencodeproviders show the usage card, anything else shows a muted
placeholder. The model is re-checked on mount, after each finished turn
(runningflips), on connection reset, and on settings changes. - Manual refresh (debounced): a click refreshes immediately (bypassing the
host cache); clicks inside the 2 s cooldown window, or while a request is
in flight, are ignored. - Auto refresh: every configured interval (1 / 5 / 10 / 30 / 60 min);
the next tick is re-scheduled with the latest interval after each fetch.
Settings → 额度查询
- DeepSeek balance: credential reference (default
DEEPSEEK_API_KEY) +
refresh interval, with a configured/missing badge. - OpenCode Go usage: credential reference (default
OPENCODE_GO_API_KEY) +
refresh interval. - Saves apply live; credential values never reach the browser.
Data sources & security
- DeepSeek:
GET https://api.deepseek.com/user/balancewithAuthorization: Bearer <key>. - OpenCode Go:
GET https://opencode.ai/zen/go/v1/usagewithAuthorization: Bearer <key>(the same Anthropic-compatible key used whenANTHROPIC_BASE_URLpoints atopencode.ai/zen/go). - Keys are resolved host-side via
ctx.credentials.resolve(); the browser only
receives read-only fetched results. Settings writes require a same-origin
POST. - The host caches each provider's readout for its configured interval; manual
refresh (force=1) bypasses the cache.
Installation
Prerequisites: DSH installed (dsh web runs) and pnpm on PATH (dsh plugin
forwards to pnpm).
# 1. Unzip to a folder, e.g. D:\plugins\dsh-quota-cards
# 2. Install into the web profile:
dsh plugin --profile web add file:D:/plugins/dsh-quota-cards
dsh plugin add runs pnpm and adds @dsh-external/dsh-quota-cards to the
profile's dsh.profile.bundles.
# 3. Restart dsh web
# 4. Open Settings → 额度查询, confirm both credential references, and make
# sure the keys exist (e.g. in .credentials.yaml or env):
# DEEPSEEK_API_KEY: sk-xxxx
# OPENCODE_GO_API_KEY: sk-yyyy
# 5. Back on the chat page, the quota Card sits at the left of the composer.
Uninstall
dsh plugin --profile web remove @dsh-external/dsh-quota-cards
# then restart dsh web
Compatibility
- Host services:
settings,credentials,sessions,agentDefaultModel,
optionalwebServer; client servicesslots,connection; slotsconversation.input.leftandsettings.section(declared by the shipped
ui-conversation / ui-settings bundles). - Provider matching is by provider id (
deepseek→ balance card,opencode→
usage card); DeepSeek's official provider id isdeepseek-officialand the
common OpenCode Go id isopencode-go. - No third-party runtime deps of its own (schemastery and the
@deepseek-ai
packages are peerDependencies resolved from the profile).
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-quota-cards」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:ShiraGawaAnri/dsh-quota-cards Headless(CLI)profile:
dsh plugin --profile headless add github:ShiraGawaAnri/dsh-quota-cards 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。