In the DSH Web GUI, adding a visual “balance chip” to the session header can reduce the need to switch browsers to check the balance. The dsh-header-balance plugin displays the account balance in the session header, allowing balance queries and conversation management to be completed on the same page.

This is a client-side plugin maintained by lijunyu726. Its core purpose is to display the account balance in the session header, with a click to jump to the top-up page.

Installation and Enablement

Install it through the official CLI:

dsh plugin --profile web add dsh-header-balance

After restarting DSH, the balance chip will appear in the session header.

Core Features

  • Balance Display: The chip displays the total balance, with visual density consistent with the “Session Logs” button.
  • Click to Top Up: Clicking the entire chip opens platform.deepseek.com/top_up. The Electron shell invokes the system browser to open the link.
  • Manual Refresh: The chip contains an ↻ button. Clicking it refreshes the balance (event bubbling is prevented, so accidental top-up navigation does not occur).
  • Automatic Refresh: Balances refresh automatically on mount, every 60 seconds, and when the window regains focus.
  • Hover Details: Hovering with the mouse shows the account balance, the split between gifted funds and topped-up funds (the gifted funds row is automatically omitted when it is 0), and the top-up entry.
  • Narrow Screen Adaptation: On mobile devices, the word “balance” is omitted, leaving only the amount.
  • Unavailable Alerts: When is_available is false, a clear prompt is shown instead of silently displaying ¥0.00.
  • Readable Failures: For cases such as a missing Key, invalid Key, insufficient balance, rate limiting, timeout, network disconnection, or abnormal response, corresponding prompt messages are provided.

Typical Usage

  1. View Balance: After restarting, the current balance is automatically displayed in the session header.
  2. Top Up: Click the chip area to jump directly to the top-up page.
  3. Refresh: Click the ↻ icon inside the chip to refresh the data.
  4. Details: Hover over the chip to view the detailed breakdown between gifted and topped-up funds.

Architecture and Security

Balance queries involve the API Key, so the plugin adopts host-side logic:

  • Host-Side Processing: The API Key and network requests are completed entirely on the host side. The Key never enters browser code.
  • Dependent Services: It relies on host-side settings and credentials services to read credentials.
  • Remote Invocation: It uses connection.rpc.call to invoke the accountBalance/balance endpoint, rather than directly accessing the browser-side remote namespace.

Applicable Scenarios and Notes

  • Version Dependency: This plugin has only been verified on the DSH 0.1.5 slot contract.
  • License: Check the source code and license before use.

Summary

dsh-header-balance ensures API Key security through host-side logic, while providing an intuitive balance view and top-up entry. It is suitable for users who need to quickly monitor their DeepSeek account status within the DSH interface.

Plugin Directory | GitHub Repository