Ychris12138/dsh-usage-stats

Provider balances, subscription quotas, and token-usage analytics for the DeepSeek Harness Web GUI (dsh web).

Bundle verified MIT JavaScript v0.2.3
Bundle verified

Listed

65

Usage

Bundle verified

Versionv0.2.3
LanguageJavaScript
LicenseMIT
View on GitHub

Preview

Preview 1 of 2: Ychris12138/dsh-usage-stats
Preview 2 of 2: Ychris12138/dsh-usage-stats

What it does

Multi-provider usage dashboard with provider/model token breakdowns, calendar drill-downs, account balances, and OpenCode Go / Z.ai subscription quota tracking.

Best for

  • DSH Web users who want token usage broken down by date, provider, and model in one dashboard.
  • Teams monitoring supported provider balances and coding-plan subscription quotas alongside local usage.
  • Operators who need calendar drill-downs, cache-hit analytics, background account refreshes, and provider status in a bilingual interface.

Not ideal for

  • TUI or headless-only deployments; the documented interface requires the DSH Web profile.
  • Users expecting balances for every provider; providers without a public account endpoint still expose token statistics but show account monitoring as unsupported.
  • Environments unable to accommodate compatibility updates when DSH pre-release client, Cordis, or persistence interfaces change.

README

dsh-usage-stats

GitHub Release CI License

为 DeepSeek Harness 网页端提供多供应商账户监测与 Token 用量分析。

Provider balances, subscription quotas, and token-usage analytics for the DeepSeek Harness Web GUI (dsh web).

dsh-usage-stats v0.2.0 interface preview

展示图使用脱敏演示数据;插件不会把 API Key、Cookie、管理 PAT 或上游原始响应发送到浏览器。

一眼看懂 / At a glance

  能力 说明
💳 统一账户卡片 API 供应商显示余额,Token Plan 显示分窗口额度;面板一次只呈现当前供应商
📊 Token 用量分析 今日、本月、累计、缓存命中率、月历热图,以及按日期/供应商/模型下钻
🔄 后台监测 服务端启动即刷新,之后每五分钟更新全部已配置账户与本地 Token 聚合
🧩 可扩展适配器 支持 New API、Sub2API、通用余额模板,以及声明式 JSON Pointer 自定义查询
🔒 本机安全边界 五个端点仅接受回环 GET;凭据只在服务端解析并发往校验后的供应商地址

界面支持中文和英文。浏览器只请求当前选择的 provider;后台刷新与面板是否打开无关。手动刷新会更新用量、供应商列表,并强制刷新当前账户,不会批量强制请求其他供应商。

快速安装 / Quick start

需要 DeepSeek Harness web profile(@deepseek-ai/dsh >= 0.1.0-rc.6)。

dsh plugin --profile web add "github:Ychris12138/dsh-usage-stats"

然后重启已经运行的 dsh web,并在浏览器中硬刷新。侧边栏底部会出现“用量/余额”(Usage/Balance)入口。

插件市场 GUI 安装(DSH Community Market,Path A 标准来源)

本仓库按 DSH Community Market 目录 adapter 指南 的标准来源(Path A) 接入,无需修改 Market 代码。内置两份目录数据:

  • catalog/catalog-source.json — 来源 manifest(catalog-source.schema.json v1.0.0)
  • catalog/v1/plugins.json — 标准 provider page(catalog-provider-page.schema.json v1.0.0)

使用前提(重要):市场托管安装只接受 npm registry 的精确稳定版本,git 条目仅可浏览。dsh-usage-stats 这个 npm 名已被其他项目占用,因此目录条目身份使用 @ychris12138/dsh-usage-stats(当前可用)。要启用 GUI「安装」按钮,需先发布:

  1. 仓库包身份已统一为 @ychris12138/dsh-usage-stats;每次发版需同步 package.json / package-lock.json / catalog/v1/plugins.json 的版本。
  2. 发布 scoped 公共包:npm publish --access public。
  3. 把 catalog/v1/plugins.json 内容发布到 https://ychris12138.github.io/dsh-usage-stats/v1/plugins(GitHub Pages,manifest 与 endpoint 必须同源、HTTPS 443、无凭据)。
  4. 在 DSH 插件市场 → 来源管理 → 添加来源,粘贴 manifest URL:https://ychris12138.github.io/dsh-usage-stats/catalog-source.json,选择后即可走「可恢复安装边界」GUI 安装。

若最终包名不同,请同步修改 catalog-source.json 的 providerId/transport.endpoint 与 catalog/v1/plugins.json 的身份字段。发布前目录条目可浏览但安装保持禁用(fail-closed,属预期)。

升级或卸载:

dsh plugin --profile web update dsh-usage-stats
dsh plugin --profile web remove dsh-usage-stats

Frequently Asked QuestionsFAQ

Use the verified command dsh plugin --profile default add github:Ychris12138/dsh-usage-stats in a DSH-enabled shell. The command resolves the public package metadata and keeps the plugin attached to the catalog identity shown on this page.