DeepSeek Harness (DSH) uses a plugin-based architecture. Developers often need to quickly view their account balance or fully shut down the Harness process. The dsh-system-control plugin embeds these two core features directly into the left sidebar, avoiding occlusion and distraction caused by overlays.

Plugin Overview

This is a DSH Web plugin maintained by lnetrit-alt, positioned as a sidebar component. It primarily addresses two pain points: providing real-time API balance display and offering an elegant entry point for shutting down the entire system. The plugin follows the MIT license.

Core Features

1. Sidebar Embedding

The plugin is registered in sidebar.footer.action and renders above the settings button in the left sidebar. It does not use card styling; it renders directly according to the theme, without obstructing or being clipped.

2. Real-Time Balance Display

The balance data is obtained from https://api.deepseek.com/user/balance.
* Automatic refresh: The balance refreshes automatically after each model API call, and also polls once every 25 seconds.
* Manual refresh: Clicking the balance text triggers a refresh.
* Error handling: If retrieval fails, it displays Failed to fetch; clicking it allows a retry.

3. Minimal Shutdown Button

It uses a black outlined power icon in a wireframe style (no fill, no circle). Clicking it opens a confirmation dialog. The confirmation flow is as follows:
1. It calls sessions.flush to flush all session data and ensure persistence.
2. It calls appExit(0) to gracefully exit Harness, including stopping the Web UI, terminating child processes, and destroying the process tree.
3. Hard fallback: If graceful exit is not completed within 1.5 seconds, it forces process.exit(0) to ensure the Web UI closes.

4. Layout Adaptation and Cleanup

  • Collapsed sidebar support: In the 56px-wide collapsed sidebar mode, the confirmation prompt automatically shrinks to Exit?.
  • Visual cleanup: When this plugin is enabled, the official Cordis panel icon is hidden to keep the sidebar tidy.

Installation and Enablement

Currently, the plugin is installed from a Git source. Local development is also supported.

dsh plugin --profile web add git+https://github.com/lnetrit-alt/dsh-system-control.git

It takes effect after restarting Harness or refreshing the page. The client portion supports hot reloading.

Typical Usage

  1. Check balance: At the bottom of the sidebar, view information such as Balance ¥0.69. The currency symbol is automatically mapped based on CNY/USD/EUR/GBP returned by the API.
  2. Manual refresh: Click the balance text to immediately fetch the latest value.
  3. Shut down Harness: Click the power icon. After confirmation, the system saves sessions and exits the Harness process.

Applicable Scenarios and Notes

This plugin is part of the UI surface layer. It does not register model-visible tools, does not change Agent behavior, and the model does not need to be aware of its existence.

The following considerations are important during installation and use:
* Required service: It requires the appExit service provided by the DSH launcher. If running embedded in a non-official dsh or dsh web environment, shutdown may fail with an error.
* Permission risk: The plugin runs with the permissions of the current DSH process. Install it from a trusted source and review the source code.
* Release status: NPM publication is pending (account 2FA must be configured). Currently, only Git-source installation is supported.

Summary

dsh-system-control provides non-intrusive balance monitoring and reliable shutdown functionality through sidebar embedding. For DSH users who frequently need to manage account status and processes, this is a practical utility for improving operational efficiency.

  • Project homepage: https://github.com/lnetrit-alt/dsh-system-control
  • Directory page: https://www.skillhub.cn/plugins/lnetrit-alt/dsh-system-control