DeepSeek Harness plugin

dsh-balance-qiuyongj

DSH plugin: query and display the DeepSeek account balance — dsh_balance tool + live conversation-input widget in the web UI (TypeScript, dual-face).

Jump to install

Source facts

Repository
qiuyongjin/dsh-balance
Latest update
Aug 16, 2026
Category
Development & Runtime
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/qiuyongjin/dsh-balance
Plugin: dsh-balance-qiuyongj
Author: qiuyongjin

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

<p align="center"> <img src="./preview.png" alt="dsh-balance 界面预览" /> </p>

<h1 align="center">dsh-balance</h1>

<p align="center">DSH 插件:查询并展示 DeepSeek 账户余额(/user/balance API)。工具可查、Web UI 会话输入区常驻显示,TypeScript 双面开发,零运行时依赖。</p>

能力

类型名称说明
Toolsdsh_balance调用 DeepSeek GET /user/balance,返回账户可用状态与各币种余额明细(总余额 / 赠送余额 / 充值余额),headless / web 通用
UI(web)输入区余额入口填官方 conversation.input.right slot:按钮常驻显示当前总余额,点击展开明细卡片(可用状态 / 各币种明细 / 更新时间),手动刷新

工作原理

  • 节点侧:注册 dsh_balance 工具;同时经 webServer(可选后端,ctx.inject 等待就绪,headless 组合下不挂载)暴露 GET /plugins/dsh-balance/balance JSON 端点,供浏览器拉取。
  • 浏览器侧:惰性 CJS client bundle(window.__ModuleLoader__.load 包装)填充官方 conversation.input.right slot,同源 fetch 余额端点——API key 只存在于节点侧,浏览器不接触凭据。
  • API key:通过 DSH 凭据服务解析(默认引用 DEEPSEEK_API_KEY,Web 的 Models 设置页可直接写入),凭据服务缺席时回退到启动环境变量;每次调用实时解析,改 key 无需重启。与官方 dsh-llm-deepseek 的取值方式一致。
  • 取消语义:工具执行合并超时与调用方取消(AbortSignal.any),符合 dsh-tools 的协作取消契约。

安装

dsh plugin --profile web add ./dsh-balance

bundle 层栈变更需重启生效:

dsh --profile web

重启后,会话输入区工具行右侧(发送按钮前)出现 🔋 余额入口,按钮上直接显示当前总余额;会话中向代理提问"查询 DeepSeek 余额"同样可用工具查询。启动日志出现 [dsh-balance] plugin loaded(API key 引用:DEEPSEEK_API_KEY,基地址:https://api.deepseek.com) 即挂载成功。

配置

默认配置开箱即用;如需覆盖,在 profile 的 cordis.patch.yml 按行 id 覆盖(patch 整替换 config,需重述全部键):

- id: dsh-balance
  config:
    apiKeyEnv: DEEPSEEK_API_KEY
    baseURL: https://api.deepseek.com
    timeoutMs: 10000
默认值说明
apiKeyEnvDEEPSEEK_API_KEY读取 API key 的凭据引用(POSIX 环境变量名)
baseURLhttps://api.deepseek.comDeepSeek API 基地址
timeoutMs10000请求超时(毫秒)

开发

pnpm install
pnpm run build       # tsc 产出 lib/types(含 JS emit)+ tsdown 产出 lib/index.js / lib/client.js
pnpm run typecheck   # 严格类型检查(单一 tsconfig 覆盖 node + client 两侧)
pnpm run watch       # tsdown 增量重建(client half)

lib/ 为构建产物,勿手改——改源码后重新构建。单一 tsconfig 覆盖两侧(DOM lib 与 @types/node 全局共存),tsconfig.decl.json 产出 lib/types;node half 由 tsdown 从 tsc emit 打包(@deepseek-ai/* 依赖内联,运行期零依赖),client half 从源码打包为惰性 CJS bundle(react external 走平台种子表)。

验证

  • 类型:pnpm run typecheck
  • 挂载冒烟:安装并重启后,启动日志出现插件加载行;会话输入区工具行右侧出现余额入口
  • 工具调用:在会话中向代理提问"查询我的 DeepSeek 余额",确认返回账户可用状态与余额明细