DeepSeek Harness 插件

dsh-provider-usage-lizhouai

DeepSeek Harness plugin: live account balance/usage panel for every configured LLM provider (draggable floating-ball widget, configurable refresh interval)(英文原文)

跳到安装方式

来源信息

GitHub 仓库
lizhouai/dsh-provider-usage
最近更新
2026年8月21日
分类
模型与服务商
GitHub stars
1
载体类型
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/lizhouai/dsh-provider-usage
插件名:dsh-provider-usage-lizhouai
作者:lizhouai

检查来源文件

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

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

<p align="right"> <strong>English</strong> · <a href="./README_ZH.md">简体中文</a> </p>

<p align="center"> <a href="https://www.npmjs.com/package/dsh-provider-usage"><img src="https://img.shields.io/npm/v/dsh-provider-usage.svg?cacheSeconds=300" alt="npm version"></a> <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT license"></a> <img src="https://img.shields.io/badge/DeepSeek%20Harness-plugin-202724" alt="DeepSeek Harness plugin"> </p>

dsh-provider-usage

Every provider's balance, one glance away. A DeepSeek Harness plugin that floats a small draggable usage ball over the Web GUI — no more logging into each provider console to check whether you are about to run out of credit mid-session.

Features

  • Auto-detection — enumerates the provider routes registered in the current profile (ctx.llm); zero configuration for well-known routes.
  • Per-kind wire adapters — routes with no public balance/quota API (Google, Mistral, Groq, Bedrock, Azure, Qwen Token Plan, …) are listed as unsupported instead of being silently dropped:
kindroutesqueryshows
------------
deepseekdeepseek-official, deepseekGET {baseURL}/user/balancetotal / granted / topped-up balance
moonshotmoonshotai-cn, moonshotaiGET {baseURL}/users/me/balanceavailable / voucher / cash balance
kimi-codingkimi-codingGET {baseURL}/v1/usagesweekly quota + rate-limit windows, reset countdown
openrouteropenrouterGET {origin}/api/v1/creditscredits used / total
github-copilotgithub-copilotGET api.github.com/copilot_internal/userplan quota snapshots (paid) or monthly quotas (free)
openai-codexopenai-codexGET {baseURL}/wham/usageChatGPT subscription 5h / weekly windows + credits
openaiopenaiGET {origin}/v1/organization/costscurrent-month spend (admin key required; a regular key fails with 403)
anthropicanthropicGET {baseURL}/v1/organizations/cost_reportcurrent-month spend (admin key required, x-api-key auth)
minimaxminimax, minimax-cnGET {origin}/v1/api/openplatform/coding_plan/remainsCoding Plan 5h / weekly remaining %
zaizai, zai-coding-cnGET {origin}/api/monitor/usage/quota/limitGLM Coding Plan windows (raw key in Authorization, no Bearer)
opencodeopencode, opencode-goGET {baseURL}/usageZen Go rolling / weekly / monthly windows
vercel-ai-gatewayvercel-ai-gatewayGET {baseURL}/v1/creditsteam credit balance
xaixaiGET {baseURL}/billing/creditsprepaid balance (USD)
  • Credentials stay safe — API keys are resolved per request through the harness credentials service (environment variables / ~/.dsh/.credentials.yaml); never cached, never written to disk.
  • Floating ball widget — a draggable floating ball opens the usage panel. Drop it anywhere in the viewport (position persisted); it docks by default at the bottom-left of the chat area with equal margins, and the panel-header home button sends it back. The halo around the ball encodes provider health: green all good, amber some quota below 30% left, red on query failure / missing key / usage ≥90%.
  • Version badge — the panel header shows the running plugin version next to the title, so it is obvious which release is loaded.
  • Bilingual panel — built-in Chinese/English UI; follows the harness language by default, with a one-click toggle in the panel header (persisted in localStorage).
  • Configurable refresh — adjustable in the panel (15s–30min, persisted in localStorage); the default comes from the plugin config.
  • Manual providers — add arbitrary gateways (e.g. a self-hosted DeepSeek-compatible endpoint) via config.

Screenshots

The floating ball (bottom-left, with the green healthy halo) and the open usage panel:

![Usage panel in English](docs/panel-en.png)

Install

> [!NOTE] > Requires an existing DeepSeek Harness installation.

npm

dsh plugin --profile web add dsh-provider-usage@latest

Build from source

git clone https://github.com/lizhouai/dsh-provider-usage.git
cd dsh-provider-usage
pnpm install
pnpm build
pnpm pack   # produces dsh-provider-usage-<version>.tgz
dsh plugin --profile web add ./dsh-provider-usage-<version>.tgz

Install the tarball, not the repo directory: dsh plugin add . links the repo, whose own node_modules then shadows the harness's shared @deepseek-ai/cordis instance and the host half never registers (RPC 404). The link form is still handy for client-only UI iteration — the browser bundle is self-contained, so a rebuild + page refresh picks it up — but switch to the tarball (or the npm release) whenever you need the host half. If pnpm fails with EPERM ... symlink while replacing a linked install, delete the stale node_modules/dsh-provider-usage junction in the profile directory and retry.

Restart dsh web after changing the plugin set (a plugin add/remove requires a restart; afterwards, code changes only need a rebuild + re-add + page refresh).

Upgrade

dsh plugin --profile web add dsh-provider-usage@latest

Then restart dsh web and refresh the page. If the release you want was published very recently, your profile's supply-chain cooldown (minimumReleaseAge) may silently keep the older version — pin the exact version instead (dsh plugin --profile web add dsh-provider-usage@0.3.1) and dsh will exempt it automatically. The version badge in the panel header confirms which release is actually loaded.

Configuration

Defaults work out of the box: the plugin auto-detects every provider route of the active profile. A trusted profile can tune behavior in ~/.dsh/profiles/web/cordis.patch.ymloverride the bundle's row by id (the package's own bundle patch already inserts it; a second insert of the same id fails the boot with duplicate loader entry id):

- id: provider-usage
  name: dsh-provider-usage
  config:
    refreshSeconds: 60   # suggested panel refresh interval (5–86400)
    autoDetect: true     # enumerate provider routes from the llm registry
    providers: []        # manual specs; an id matching a detected route overrides it
FieldTypeDefaultDescription
refreshSecondsnumber60Suggested widget refresh interval in seconds (5–86400)
autoDetectbooleantrueEnumerate live provider routes from the llm registry
providersarray[]Manual provider specs: {id, kind, baseURL, apiKeyEnv, displayName?, enabled?}; kind is one of the adapter table above

The same fields can be hot-updated under the provider-usage: namespace in ~/.dsh/settings.yaml.

Adding a manual provider

config:
  providers:
    - id: my-deepseek-gateway
      kind: deepseek
      baseURL: https://my-gateway.example.com
      apiKeyEnv: MY_GATEWAY_KEY
      displayName: My Gateway

How it works

  • Host half (src/index.ts): UsageService extends TypertRemoteService exposes usage/list via @Remote('list') (SRC mode, no codegen). Config is declared with schemastery, and installSettingsSection enables hot updates from settings.
  • Client half (src/client/): a window.__ModuleLoader__.load({id, factory}) bundle (built by tsdown) mounts through the sidebar.footer.action slot (used purely as a mount point — the trigger itself is a floating ball portaled to document.body) and polls usage/list through ctx.connection.rpc.call('/api', 'usage/list', {args:{}}) on its own interval. The service stays stateless — every poll fetches live values.

License

[MIT](./LICENSE)