dsh-api-balance: A Real-Time DeepSeek API Balance Reader Plugin for DSH Web

Preface

In DSH’s plugin-based extension approach, some interface information can be integrated into dsh web through standalone plugins. The following introduces 02Muller25/dsh-api-balance, which solves the problem of displaying DeepSeek API account balance directly within the session interface of dsh web, eliminating the need to leave the current workspace to check the balance each time.

What This Is

dsh-api-balance is a DeepSeek Harness (dsh web) plugin that displays DeepSeek API account balance in real time, maintained by 02Muller25, licensed under MIT.

It displays the balance, status, and last update time in the readout strip conversation.composer.dock below the conversation input box.

Core Features

The verified capabilities provided by the plugin include:

  • Real-time display of DeepSeek API account balance
  • Display balance, status, and last update time in conversation.composer.dock
  • Auto-refresh every 30 seconds, with an immediate query on mount
  • Refresh modes are selectable: Manual / Every 10 seconds / Every 30 seconds / Every 1 minute / Every 5 minutes / Custom interval (5–3600 seconds)
  • In manual mode, clicking the “Refresh” button triggers an immediate refresh
  • On refresh failure, retains the last data and displays the reason; the next automatic poll recovers
  • Displays a red “Unavailable” indicator when the balance is unavailable
  • The API key is resolved on demand via the dsh credentials service as DEEPSEEK_API_KEY, without leaving the host process

Installation

The plugin requires Node.js:

>=20

On the target dsh web deployment, you can use the installation command provided in the repository:

dsh plugin --profile web add github:02Muller25/dsh-api-balance

This command explicitly specifies --profile web. Verified sources do not provide a generic installation command for other profiles.

Manual Placement

If you are not installing via GitHub dependency, you can manually place the package:

  1. Place the complete package into the profile’s node_modules:
$DSH_HOME/profiles/node_modules/api-balance/

The complete directory should include package.json, cordis.patch.yml, and lib/.

  1. Append the insert block to the profile’s cordis.patch.yml:
- insert:
    - id: api-balance
      name: 'api-balance'
  1. Restart the dsh web service.

Note: If you run pnpm install on the profile, manually placed packages in node_modules may be cleaned up.

Enabling, Disabling, and Uninstalling

  • Enable: Via patch + restart
  • Disable: Add disabled: true to the patch entry and restart
  • Uninstall: Remove the patch entry and profiles/node_modules/api-balance/, then restart
  • Settings → Plugin Marketplace list is read-only; enabling/disabling is done via patch + restart

Typical Usage

After mounting, the plugin queries the balance once, then operates according to the current refresh mode.

Selectable refresh modes include:

Manual
Every 10 seconds
Every 30 seconds
Every 1 minute
Every 5 minutes
Custom interval: 5–3600 seconds

When “Custom…” is selected, values outside the range are validated. The refresh preference is saved in the browser’s localStorage key:

dsh.api-balance.refresh

In manual mode, clicking the “Refresh” button triggers an immediate refresh.

On refresh failure, the plugin retains the last data and displays the reason; the next automatic poll recovers. A red “Unavailable” indicator is displayed when the balance is unavailable.

Dependencies and Runtime Location

The plugin depends on the dsh host services:

webServer
credentials
shell
sandboxPolicy

Client-side dependencies:

react
slots

The balance request runs with the danger-full-access policy. It is a read-only network request and bypasses the platform sandbox runner.

Credential read location:

credentials.resolve('DEEPSEEK_API_KEY')

The balance endpoint is defined by BALANCE_URL in lib/index.js.

Applicable Scenarios and Notes

Suitable for users who need to view DeepSeek API balance, status, and update time within the dsh web session interface.

Before installation, review the source code and the MIT license. The balance request in this plugin is executed through the dsh host-side services and runs with the danger-full-access policy, which bypasses the platform sandbox runner; before use, confirm that such requests are permitted in your current environment.

Directory Page and GitHub

  • Directory page: https://www.skillhub.cn/plugins/02Muller25/dsh-api-balance
  • GitHub: https://github.com/02Muller25/dsh-api-balance
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye