DeepSeek Harness 插件

ui-theme-quota-show

DeepSeek Harness web UI plugin: a sidebar card above Settings that shows the live DeepSeek API balance (total / topped-up / granted, period usage, low-balance warning) from the official GET(英文原文)

跳到安装方式

来源信息

GitHub 仓库
wwxiaoqi/ui-theme-quota-show
最近更新
2026年8月15日
分类
界面增强
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/wwxiaoqi/ui-theme-quota-show
插件名:ui-theme-quota-show
作者:wwxiaoqi

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

ui-theme-quota-show

A DeepSeek Harness web UI plugin that adds a DeepSeek API balance card directly above the Settings trigger in the sidebar. It reads the official GET /user/balance endpoint, shows the remaining balance plus its top-up/granted breakdown, and refreshes automatically every 60s.

![SHOW](./pic.webp)

Features

  • Live remaining balance (total_balance), big number, with a low-balance red warning (lowBalanceThreshold, default 5).
  • Breakdown of top-up (topped_up_balance) and granted (granted_balance) balance.
  • Update time and period usage (the balance delta since the card loaded — the same key's total across all clients).
  • 60s auto-refresh + a manual refresh button; a failed refresh keeps the last good value (stale-while-error).
  • Collapsed-sidebar (rail) mode collapses to a 32px round button — ¥ normally, ! when balance is low — and clicking it expands the sidebar.
  • No new secret: the API key is reused from the existing DEEPSEEK_API_KEY credential (written by Settings → Models, stored in ~/.dsh/.credentials.yaml), resolved on the host and never sent to the browser.

Quick start

One-click script (recommended)

Clone and run the installer — it checks that dsh is on your PATH, links the plugin into your web profile with link:, and prompts you to restart:

git clone https://github.com/wwxiaoqi/ui-theme-quota-show.git
cd ui-theme-quota-show

# Windows (PowerShell)
.\scripts\install.ps1

# macOS / Linux
bash ./scripts/install.sh

Then restart dsh web (the client module system only picks up a new plugin on restart).

Developer iteration (link mode)

No build step, no npm dependencies — just link your checkout:

cd ui-theme-quota-show

# macOS / Linux
dsh plugin --profile web add "link:$PWD"

# Windows (PowerShell) — forward slashes; link: is required cross-drive
dsh plugin --profile web add "link:D:/path/to/ui-theme-quota-show"

Update / reinstall

dsh plugin --profile web remove ui-theme-quota-show
dsh plugin --profile web add "link:D:/path/to/ui-theme-quota-show"

Configuration

The base config lives in cordis.patch.yml under config.

FieldTypeDefaultMeaning
baseUrlstringhttps://api.deepseek.comBalance endpoint base; /user/balance is appended.
lowBalanceThresholdnumber5Main number turns red when total_balance falls to or below this amount (account currency).

> The DEEPSEEK_API_KEY credential is resolved per request through the credentials seam (the Models page writes it), falling back to the process environment when that seam is absent. A changed key reaches the next request without a restart.

Field semantics

DeepSeek's balance API is a prepaid-credit model — there is no "total quota" or "used" field. The card maps it faithfully:

ShownSource
Remaining balancetotal_balance (total available credit)
Total compositiontopped_up_balance (top-up) + granted_balance (granted)
Period usagebalance delta since the card loaded (approximation)
Update timetime of the last successful fetch

How it works

  • Host registers the route /ui-theme-quota-show/balance. Each request resolves DEEPSEEK_API_KEY through ctx.credentials (or process.env), calls GET https://api.deepseek.com/user/balance with Node fetch, and returns only normalized numbers — the key never reaches the browser.
  • Client registers into sidebar.footer.action (the row the sidebar shell renders directly above the Settings trigger), receives the wide column state, and renders the card (wide) or the 32px rail button (collapsed). It polls the host route every 60s with cache: no-store, keeping the last good snapshot on failure.
  • The rail button expands the collapsed sidebar through layout.toggleSidebar().

File layout

FileRole
index.jsHost half: balance route + credential resolution + upstream proxy
client.jsClient half: card + rail button + 60s refresh + state machine
cordis.patch.ymlBundle patch: inserts the row with base config
package.jsonDeclares dsh.bundle.patch and dsh.client

> client.js is hand-authored in the exact window.__ModuleLoader__.load format that the tsdown client-bundle preset emits (packages/client/tsdown.client.ts in the harness). If you migrate to a TypeScript/tsdown build, move it to src/client/index.ts plus a tsdown.config.ts.

License

[MIT](./LICENSE)