DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-usage-panel

k

dsh-usage-panel

Manifest valid

DeepSeek Balance + Token Usage Panel (DSH Web): Three-tier Alerts, Custom Thresholds, One-Click Recharge, Cache Hit Rate | Balance & usage panel for DeepSeek Harness

UI (client)hasBundlePatch

dsh-usage-panel

English | 简体中文

为 DSH(DeepSeek Harness) Web 界面提供 DeepSeek 账户余额与本会话 Token 用量,以彩色胶囊显示在会话头部右侧。

面板预览

功能

  • 余额:官方 GET /user/balance,显示总额 / 充值 / 赠送。
  • Token 用量:读取宿主 tokenUsage 投影,显示未缓存输入 / 缓存命中 / 缓存写入 / 输出 / 合计 / 缓存命中率。
  • 三级余额预警(阈值可自定义):充足 / 警告 / 不足,胶囊与卡片颜色随之变化。
  • 充值入口:去充值 / 用量明细 / 登录平台 / 复制链接;支持新标签、当前标签、复制链接三种打开方式。
  • 查询效率:仅在页面可见时轮询(隐藏暂停)、失败指数退避、宿主 30s 缓存 + 单飞、手动刷新。
  • 跨版本兼容:宿主端优先 ctx.connection.fetch 并回退 ctx.webServer;浏览器端依次尝试会话头部插槽。

安装

方式一:作为插件包安装(推荐)

dsh plugin --profile web add dsh-usage-panel

方式二:本地安装脚本

node install.mjs --home ~/.dsh --profile web

重启 dsh web(或等待热重载)后刷新页面。

配置(宿主端)

apply(ctx, config) 可读取 patch 行中的可选配置:

字段默认值说明
routePath/api/usage-panel/balance宿主端路由
cacheMs30000上游缓存与单飞窗口
apiKeyEnvDEEPSEEK_API_KEY经 ctx.credentials 解析,再回退环境变量
baseUrlhttps://api.deepseek.com服务商地址
baseUrlEnvDEEPSEEK_BASE_URL覆盖 baseUrl 的环境变量

兼容性

  • 宿主端:Node >= 18,零 import,可从任意路径加载;优先 ctx.connection.fetch.register,回退 ctx.webServer.register;密钥优先走 ctx.credentials。
  • 浏览器端:仅依赖内置 React 与 slots 服务;优先 conversation.session.header.utilities,其次 conversation.session.header.corner,sidebar.footer.action 为延迟 4 秒的兜底,因此正常启动不会跑到左下角;缺少 useProjection 时仍显示余额。
  • 纯 JS、无平台相关代码,跨机型通用。

自检

node tools/verify.mjs --port 3080 --home ~/.dsh

输出启动图、HMR 通道与服务包特性。

卸载

删除 profile patch 中的 usage-panel 行,并删除 <home>/plugins/dsh-usage-panel。

作者

Mysterious Mark

许可

MIT

Comments

Loading…

Similar plugins

dsh-deepseek-usage

by scientisbo

DeepSeek 用量 · 余额面板(DeepSeek Harness Web 客户端插件) | A clean DeepSeek usage & balance panel for DeepSeek Harness

Models & ProvidersManifest valid

★ 0

MIT

JavaScript

Aug 23, 2026

dsh plugin --profile web add dsh-deepseek-usage

by Ychris12138

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

Tools & CapabilitiesModels & ProvidersDevelopment & InfrastructureManifest valid

★ 164

MIT

JavaScript

Sep 26, 2026

dsh plugin --profile web add @ychris12138/dsh-usage-stats

by xie-tj

Persistent token-usage ledger and Web Usage dashboard for DeepSeek Harness.

Tools & CapabilitiesModels & ProvidersManifest valid

★ 3

MIT

JavaScript

Sep 15, 2026

dsh plugin --profile web add dsh-plugin-usage-ledger

by stevenx65

DeepSeek balance and token usage in the web sidebar, with a today/all-time toggle and provider filtering.

Tools & CapabilitiesModels & ProvidersUI & ExperienceManifest valid

★ 6

↓ 374/wk

MIT

JavaScript

Aug 14, 2026

dsh plugin --profile web add dsh-balance-plugin

by moyuer233

DeepSeek usage monitor as a DeepSeek Harness (DSH) plugin: balance / day-month-all-time token & cost panel in the chat UI with drag-reorder config, plus an optional local usage proxy

UI & ExperienceManifest valid

★ 2

↓ 415/wk

MIT

JavaScript

Sep 18, 2026

dsh plugin --profile web add dsh-deepseek-monitor-moyuer233

by Rannist

Shows DeepSeek account balance and current-session token and cost usage in the sidebar footer and composer dock, including peak and off-peak billing and subagent consumption.

Tools & CapabilitiesModels & ProvidersDevelopment & InfrastructureTerminal & ClientsManifest valid

★ 1

↓ 171/wk

MIT

JavaScript

Sep 27, 2026

dsh plugin --profile web add balance-dsh