dsh-balance-monitor: Display current channel balance and usage in the DSH sidebar

Introduction

In DeepSeek Harness (DSH), if you want to see the channel balance or usage directly next to the current session, you can install a sidebar plugin. dsh-balance-monitor is a minimalist DSH plugin that displays the current session channel’s balance/usage at the bottom of the sidebar (above the settings). Below is an introduction to its features, installation methods, credential configuration, and notes.

What is this

alanzhao0128/dsh-balance-monitor is a DeepSeek Harness (dsh) plugin used to display the current session channel’s balance/usage at the bottom of the sidebar. The license is MIT.

Core Features

  • Displays the current session channel’s balance/usage at the bottom of the dsh sidebar (above the settings).
  • For DeepSeek official channels, displays balance and today/7-day/30-day spending windows.
  • When there is no platform token or the official interface fails, today’s spending falls back to the balance difference ledger, and 7-day/30-day shows —.
  • For Volcano Ark channels, displays Agent Plan 5h/week/month package quota progress bars.
  • For Command Code channels, displays 5h/week/month usage windows.
  • Channel-aware auto-show/hide: Other channels show “Not Supported” placeholders; no session shows nothing.
  • Collapsed state becomes a 36px circle, displaying a compact balance + tooltip.
  • 60s polling, refreshes when switching tabs; retains last data and marks stale on upstream failure.
  • Edit card behavior parameters via the settings panel; saved to the dsh-balance-monitor section of ~/.dsh/settings.yaml.
  • Credentials are read via the official ctx.credentials service; environment variables take precedence.

Installation and Activation

The browser-side bundle is a hand-written classic script with no build steps. Installation command:

dsh plugin --profile web add "github:alanzhao0128/dsh-balance-monitor#main"

Can also be installed from npm:

dsh plugin --profile web add @alanzhao/dsh-balance-monitor

After installation, restart the Web UI:

dsh --profile web

After restarting, the card appears at the bottom of the expanded sidebar, above the settings button.

Typical Usage

DeepSeek Official Channel

Balance query requires configuration:

DEEPSEEK_API_KEY

Official today/7-day/30-day spending also requires configuration:

DEEPSEEK_PLATFORM_TOKEN

To get DEEPSEEK_PLATFORM_TOKEN:

  1. Log in to platform.deepseek.com.
  2. Open DevTools Console.
  3. Execute:
JSON.parse(localStorage.getItem('userToken')).value
  1. Write the output to credentials.

Note: DEEPSEEK_PLATFORM_TOKEN is a webpage session token and will expire. When expired, the card displays a red warning; today’s spending falls back to balance difference estimation, and 7-day/30-day shows —.

Volcano Ark Channel

To display Agent Plan quota, configure:

ARK_ACCESS_KEY_ID
ARK_SECRET_ACCESS_KEY

After configuration, displays the 5h/week/month package quota progress bar.

Command Code Channel

To display usage windows, configure:

COMMANDCODE_API_KEY

After configuration, displays the 5h/week/month usage window.

Settings and Status

Open dsh settings:

余额监控 / Balance Monitor

You can edit card behavior parameters. After saving, it writes to:

~/.dsh/settings.yaml

the dsh-balance-monitor section.

Takes effect immediately after saving; some parameters take effect after restarting.

Status files are located at:

$DSH_HOME/storages/balance-monitor.json

Used for balance difference ledger and other states.

Credentials are read via the official ctx.credentials service; environment variables take precedence. Writable credentials are saved using the official ctx.credentials.set() to write to:

$DSH_HOME/.credentials.yaml

the refs section; the plugin itself does not write files.

Security and Notes

  • The plugin runs with the permissions of the current dsh process; you should check the source code and license before installing.
  • API keys and platform tokens never leave the server side; the browser can only see balance/spending numbers via RPC channels and cannot access credentials.
  • The channel uses the loopback trust policy.
  • No telemetry.
  • DEEPSEEK_PLATFORM_TOKEN will expire, which will affect the official spending window and trigger a fallback to balance difference estimation.
  • Volcano Ark AK/SK are IAM account-level credentials that can operate on all resources; please keep them safe.
  • The community directory skillhub.cn is an independent site with no official affiliation to DeepSeek / Huanfang.

Resources

Directory page:

https://www.skillhub.cn/plugins/alanzhao0128/dsh-balance-monitor

GitHub:

https://github.com/alanzhao0128/dsh-balance-monitor
羽毛球分组比赛记分
小程序二维码

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

Xiaoye