Introduction

Running models in DSH (DeepSeek Harness) often spreads token consumption across multiple calls: the conversation flow doesn’t show single-call details, the input area lacks session accumulations, and the account balance requires opening a separate page. For developers needing to control costs and observe cache hit effects, this scattered information makes it hard to get immediate feedback.

Here we introduce dsh-damage-pulse (maintainer: wssfk12138). It provides a damage-style balance animation, peak/valley billing, session cost statistics, and an optional whale-girl desktop companion within the DSH Web client, bringing token consumption and account balance into the same view.

What Is This

dsh-damage-pulse is a client-side plugin for DSH, categorized under “Client”. The current project version is 0.3.2, licensed under MIT, and the GitHub repository wssfk12138/dsh-damage-pulse has approximately 107 stars.

The plugin listens to session events, bills precisely based on actual model names and cache hit situations, and displays:

  • Token breakdown and amount for each call
  • Current session cumulative consumption
  • Real-time DeepSeek account balance
  • Hit-rebound and floating-number animations when charging

The project’s public brand is dsh-damage-pulse, but internal directory names, API paths, and settings namespaces still use dsh-token-monitor, so installed users don’t need to migrate configurations.

Core Features

Single-Call Usage and Session Accumulation

After each model call ends, a line of token breakdown is inserted into the conversation flow, including input, cache hit, output, reasoning (thinking) items, and precise amounts.

Above the input box, the current session’s cumulative tokens and amount are continuously displayed, with data from the tokenCost session projection. The standard package displays this in the input area; if using the full DSH source code and executing the sidebar integration script, the cumulative amount can also optionally be shown in the native session list on the left.

Cache-Aware Damage Animation

The balance number rebounds when hit during each token consumption, and a red deducted amount floats out:

  • Pure cache hit: normal red -x.xx¥ pulse
  • Cache miss input or cache write: larger “miss -x.xx¥”, short horizontal shake, and stronger rebound

In multiple deductions merged within the same second, if there’s any miss, the entire group plays as a miss. Consecutive deductions retain at most three floating-number groups.

Balance Floating Window

The balance card supports dragging, with position automatically remembered (via localStorage). Key capabilities include:

  • Recharge detection: when balance increases, a green +x.xx¥ floats out
  • Peak/valley indicator: the right side of the balance bar shows “Peak” (red / peak hours) or “Valley” (green / valley hours), with a glowing traffic-light effect
  • When API Key is not configured, a guided state is shown, but token measurement continues normally

Peak/Valley Billing and Price Table

Built-in DeepSeek 2026-08-23 pricing rules. Weekdays are billed by peak/valley periods; weekends are uniformly at valley price all day. Historical costs are automatically determined by Beijing time at each call; costs calculated before a price increase are not recalculated.

Default peak/valley periods (Beijing time, Monday to Friday):

  • Peak price: 9:00–12:00, 14:00–18:00
  • Other times are at valley price
  • Saturdays and Sundays are at valley price regardless of period

Billing is based on the actual model name for each call, supporting deepseek-v4-pro, deepseek-v4-flash, deepseek-v4-flash-vision-exp, and version suffix longest prefix matching. Cache hit and miss are billed separately.

Prices and weekday peak periods can be overridden via the priceTable field in the settings namespace dsh-token-monitor.

Whale Girl

The whale girl is a desktop companion on the balance floating frame:

  • During model operation, she performs idle animations like finger-biting and blinking
  • She responds according to the intensity of token deductions
  • There are independent action feedbacks for consecutive deductions, balance depletion, and recharge recovery from non-positive balances

She can be dragged along with the balance frame or hidden via the right-click menu on the balance frame.

HTTP Endpoints

The plugin registers the following HTTP endpoints for client-side components to read:

Endpoint Description
GET /api/token-monitor/balance DeepSeek account balance (including currency / total balance / gifted balance)
GET /api/token-monitor/usage?sessionId= Usage detail history (can filter by session)
GET /api/token-monitor/charge-events?since=<seq> Incremental charge events (including damageKind, driving cache-aware damage animation)

Installation and Enabling

From version 0.2.0, the plugin is a standard DSH Host + Client combined package with pre-compiled artifacts submitted. It requires DSH 0.1.1-rc.2 or a higher compatible version, without needing to copy source code, modify tsconfig, manually pass --patch, or rebuild the Client bundle.

  1. Install the plugin:
dsh plugin --profile web add github:wssfk12138/dsh-damage-pulse
  1. Restart the Web profile:
dsh --profile web

After installation, the standard package directly provides the balance floating bar, real-time balance deduction, cache hit/miss animations, single-call usage line, and input area session accumulation.

If upgrading from an earlier source code integration version, please remove the original manual --patch or duplicate mounts to avoid loading the same plugin twice.

Note: The plugin runs with the current dsh process permissions. Before installation, check the GitHub repository source code and MIT license to ensure it fits your usage scenario.

Configuration

API Key

Configure DEEPSEEK_API_KEY through DSH’s credentials mechanism, writing it to ~/.dsh/.credentials.yaml. When not configured, the balance card shows a guided state, but token measurement is unaffected.

WeChat Notifications (Optional)

From 0.3.2, it includes a lightweight ClawBot adapter, selecting notification providers by priority: new external wechat-notify capability object → old send() / status() interface → built-in adapter. If the standalone dsh-wechat-notify is installed, this plugin reuses its sending capability; when not installed, after configuring WECHAT_NOTIFY_CLAWBOT_INDEX, the built-in adapter can send out-of-the-box. WeChat not logged in or send failures won’t block balance monitoring and animation.

Typical Usage

After installation and restart, just use DSH conversation normally without additional commands. After each model call ends, the usage line automatically appears in the conversation flow; the input area shows session accumulation; the balance floating window reflects deductions and peak/valley status in real-time.

To check account balance, observe the balance floating window or query via HTTP endpoint:

GET /api/token-monitor/balance

To pull usage history for a specific session:

GET /api/token-monitor/usage?sessionId=<sessionID>

Use Cases and Notes

Who It’s For:

  • Running DeepSeek models daily in the DSH Web client, wanting to see immediately how many tokens and how much each call costs
  • Needing to observe cache hit effects and distinguish between hit and miss deductions via animation
  • Using DeepSeek peak/valley pricing, wanting to automatically determine the billing period for each call based on Beijing time

Common Issues:

  • Balance card shows “Not Configured”: DEEPSEEK_API_KEY not configured, but token measurement continues normally
  • No amount in the native session lines on the left: this is a source code enhancement feature requiring full DSH source code and executing scripts/apply-sidebar-integration.ps1; input area session accumulation is unaffected
  • No animation after window launch: confirm you’ve restarted the installation target profile; if you previously used the source code integration version, first delete old manual patches and duplicate mounts

Links

dsh-damage-pulse brings token consumption, session accumulations, and account balance into the DSH interface, providing immediate feedback with damage animations and peak/valley indicators. If you’re controlling model costs in DSH, you can install and try it following the steps above.