dsh-plan-spend: DSH Web GUI Plan Spending Viewer Plugin

Introduction

DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture, and the Web GUI can also be extended via plugins. During development or usage, it is necessary to check the balance and quotas of configured service providers at any time. dsh-plan-spend is a Web GUI popup plugin that centralizes the originally scattered balance queries and quota monitoring into a single sidebar entry, directly displaying the DeepSeek official balance and OpenCode Go usage.

Feature Overview

This plugin primarily addresses the following issues:
* Centralized Display: Provides a unified entry point in the DSH Web GUI sidebar navigation to display the plan spending of configured service providers.
* DeepSeek Official Balance: Queries account recharge balance, credits (bonus), peak/off-peak time slot status, and recharge source. The plugin intentionally bypasses direct access to platform.deepseek.com to avoid 429 errors returned by the WAF.
* OpenCode Go Quota: Displays the usage percentage, progress bar, and reset countdown for 5-hour/7-day/monthly quotas. Note that this interface only returns percentages and reset times; it does not provide specific monetary amounts.
* Smart Peak/Off-Peak Detection: The client automatically calculates peak and off-peak time slots in Beijing time and determines if a day is a holiday based on the China holiday schedule (the holiday table requires manual maintenance).
* Dual-Channel Query Support: Supports querying via API Key and via DeepSeek account login state. Unconfigured providers are automatically skipped with a prompt.

Installation and Activation

The installation command is as follows:

dsh plugin --profile <profile> add github:Chi-hong22/dsh-plan-spend

After installation, locate the row corresponding to “Usage” in the sidebar navigation of the DSH Web GUI and click it to open the plugin panel.

Verify that the plugin is mounted correctly:

dsh --profile <profile> --dump-config | grep dsh-plan-spend

About the desktop profile

The desktop profile is managed exclusively by the Electron application, and CLI commands refuse to install plugins under this profile. To use it on the desktop client, please install it via the GUI plugin page.

Usage

Once installation is complete, no additional configuration is required. The plugin will automatically detect configured service providers:
1. Open the DSH Web GUI.
2. Click “Usage” in the left navigation bar.
3. The popup panel will display cards for configured providers:
* DeepSeek Official Card: Displays balance, credits, and peak/off-peak status. If the login is invalid, it prompts “Login state invalid”; if the query request fails, it prompts “Query failed”.
* OpenCode Go Card: Displays the progress bar and countdown.

Implementation Details and Notes

  • Holiday Table Maintenance: The plugin internally uses the UM_CHINA_PUBLIC_HOLIDAYS_UTC table to determine holidays. This table must be maintained manually to cover the current year and future Chinese statutory holidays. If the current year is not in the table, the plugin will explicitly prompt “Holiday table does not cover this year” rather than defaulting to calculation.
  • DeepSeek Query Mechanism: The DeepSeek card prioritizes using the account login state (obtaining the authorization token via ctx.deepseekAccount.resolveToken) and only falls back to API Key mode if the login state is invalid.
  • OpenCode Go Limitations: Due to interface restrictions, the OpenCode Go card cannot display specific amounts, only progress percentages and reset times.

Summary

dsh-plan-spend provides DSH users with a lightweight Web GUI balance monitoring tool. It solves the issue of DeepSeek official balance queries being blocked by WAF and provides intuitive visualization of peak/off-peak periods and quotas.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye