Introduction

When developing agents or running interface tests with DeepSeek Harness (DSH), keeping track of account balance changes at all times is a basic requirement. Although DSH’s built-in features provide some level of statistics, they lack a lightweight, floating real-time monitoring entry point. dsh-balance-bubble was created to address exactly this problem.

Plugin Overview

This is a Cordis plugin maintained by Jescoi, specifically designed for the DSH web interface. It displays a semi-transparent “glassmorphism” bubble in the top-right corner of the interface in real time, showing the DeepSeek account balance and automatically refreshing the data every 20 seconds.

Core Features

  • Real-time balance synchronization: The plugin uses a decoupled Host and Browser architecture. The Host reads the API Key from ctx.credentials, calls the official API to retrieve the balance, and exposes a GET /dsh-balance route on ctx.webServer. The Browser side registers the bubble component and polls this endpoint every 20 seconds to fetch the latest data.
  • Liquid glass visual style: The bubble uses a semi-transparent light-blue circular design, with background blur, a top glossy highlight, and soft inner shadow effects, creating a liquid glass texture.
  • Free dragging and adaptive positioning: The bubble can be dragged with the mouse, and its position is automatically constrained within the window. When the browser window resizes, the bubble scales proportionally to maintain its relative position.
  • Synchronized state control: A close button is provided on the top-right corner of the bubble; a “Balance” toggle switch is provided at the bottom of the sidebar, above the Cordis plugin entry. Both states are synchronized in real time.
  • Low balance alerts: When the balance falls below the threshold (default 5 CNY), the bubble turns red and shows a pulse ring. Even if the bubble is currently hidden, it will be forced to reappear.
  • Dark mode adaptation: It listens for the theme/change event and automatically adjusts colors and text contrast under dark themes.

Installation and Enablement

This plugin only supports the DSH Web Profile.

  1. Run the installation command:
dsh plugin --profile web add dsh-balance-bubble
  1. Restart the DSH process; the plugin will be loaded automatically.

Configuration and Usage

  • Show/Hide: Click the close button on the bubble, or use the “Balance” toggle at the bottom of the sidebar to switch it.
  • Balance threshold adjustment: The plugin does not currently provide a settings UI. To change the low balance alert threshold, directly edit the totalBalance < 5 condition in lib/client.js.
  • API Key: The plugin does not store the key. Instead, it reads DEEPSEEK_API_KEY from DSH’s credential service, sharing the same key configured in the settings page.

Known Limitations

  • Position is not persisted: The bubble’s dragged position resets to the default position after a page refresh.
  • Web interface only: Currently, it only supports the Web Profile and does not support the TUI interface.
  • Hard-coded configuration: Settings such as the low balance threshold are currently hard-coded in the source code, and no configuration UI is available yet.

Summary

dsh-balance-bubble addresses the need for real-time balance monitoring in the Web interface through an extremely simple UI design, and is suitable for developers who need to call the API frequently.

  • Repository: https://github.com/Jescoi/dsh-balance-bubble
  • Directory: https://www.skillhub.cn/plugins/Jescoi/dsh-balance-bubble