DeepSeek Harness 插件

dsh-balance-kkbsgg

Shows the selected model provider's account balance next to the composer model seat once a model and reasoning effort are selected.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
kkbsgg/dsh-balance
最近更新
2026年8月19日
分类
模型与服务商
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/kkbsgg/dsh-balance
插件名:dsh-balance-kkbsgg
作者:kkbsgg

检查来源文件

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

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

dsh-balance

!CI !License !Version

DeepSeek Harness plugin that displays the selected model provider's account balance as a small text next to the composer's model seat, once a model (and its reasoning effort) is selected for the active conversation.

How it works

  • Host half (lib/index.js, a Cordis plugin) mounts one loopback HTTP

route — GET /dsh-balance/balance?provider=<route> — on the webserver. The route resolves the selected provider's own API key through the standard credentials service (the llm-deepseek section for the DeepSeek official route, the llm-pi-ai providers table for custom/other routes), then probes the provider's balance: DeepSeek-style GET <baseURL>/user/balance first, falling back to the OpenAI-style GET <baseURL>/v1/dashboard/billing/credit_grants. The key never crosses the wire boundary.

  • Client half (client/client.js, a web client plugin) registers a seat

into the conversation.input.right slot (immediately beside the model selector). It subscribes to the active session's model-selection directory (modelDirectories), passes the selected provider to the route, and only renders after a model with a non-empty id is selected — an empty selection hides the text instead of retaining a stale balance. Polls every 60s; clicking the text refreshes immediately.

Installation

From source (any DSH profile)

The package declares a dsh.bundle manifest, so it installs through the standard plugin command once the repo is resolvable:

dsh plugin add @kkbsgg/dsh-balance

Manual (packaged DSH Desktop)

With the package resolvable from the profile's node_modules, add one loader row to the profile patch ($DSH_HOME/profiles/<profile>/cordis.patch.yml):

- insert:
    - id: balance
      name: 'dsh-balance'

and restart the application so the loader composes the new row. Subsequent edits to the client bundle hot-reload through the client HMR channel.

For the packaged DSH Desktop app, the package lives in the app's unpacked node_modules and is linked into $DSH_HOME/profiles/node_modules as a junction, so the profile loader resolves it exactly like the in-box plugins.

> Note: the package is installed by hand into the pnpm-managed hoisted store. > A future pnpm install in the profile may prune it; re-create the link if > the balance text disappears after a plugin-market install.

Repository layout

dsh-balance/  (@kkbsgg/dsh-balance)
├── lib/index.js           # host half (Cordis plugin + balance route)
├── client/client.js       # client half (web client plugin bundle)
├── test/smoke.test.mjs    # host-half smoke test (run: node test/smoke.test.mjs)
├── cordis.patch.yml       # dsh.bundle patch (market installability)
├── package.json           # dsh.bundle + dsh.client manifest
├── CHANGELOG.md
├── .editorconfig
└── README.md

The live copy currently installed in the DSH Desktop app lives under the app's unpacked node_modules; this repository is the source of truth. After changing code here, re-sync the files into the installed copy (or install the package from this repo and re-create the profile link).

Response shape

{ "ok": true, "isAvailable": true,
  "balanceInfos": [{ "currency": "CNY", "totalBalance": "110.00", "grantedBalance": "10.00", "toppedUpBalance": "100.00" }],
  "fetchedAt": "2026-01-01T00:00:00.000Z" }
{ "ok": false, "code": "no-api-key", "message": "no credential configured for DEEPSEEK_API_KEY" }