dsh-damage-pulse
Manifest valid★ 278DeepSeek Harness Token Balance Monitoring Plugin: Whale Girl Idle/Deduction/Recovery Animations, Peak & Off-Peak Billing, Continuous Deduction Floaters, and Session Cost Statistics.
dsh-damage-pulse
dsh-damage-pulse is a DeepSeek usage, spending, and balance monitoring plugin built for DSH (DeepSeek Harness). It records each call according to official billing rules, presents tokens and costs across single-call, session, and global tiers, and uses the Whale Girl's dynamic feedback to turn abstract model consumption into changes you can understand at a glance.
Fastai 模型赞助商
免费不意味着开发没有成本。感谢Fastai的赞助,让我能把功能留给所有用户,把广告留在应用之外。
If you're looking for a stable and affordable AI model relay service, try Fastai, or read the relay service beginner's guide to learn about relay services, multipliers, billing, and usage. Every purchase you make on Fastai earns me a referral rebate, which I convert into tokens to keep developing new projects and publishing them on GitHub. All current projects use GPT models provided by Fastai in their development. Use promo code WSSFK at signup to receive a $3 trial credit.
Feature Overview
| Capability | What You See |
|---|---|
| Precise Billing | Computes the real cost of each call by provider, model, cache type, and Beijing-time peak/off-peak pricing |
| Three-Tier Usage Display | Per-call detail in the chat, session cumulative in the input area, and a global account balance floating card |
| Historical Statistics | Today, last 7 days, last 30 days, and all-time spending, request, and token overview |
| Balance & Peak/Off-Peak Monitoring | Scheduled official balance calibration, real-time deductions, top-up recovery, and peak/off-peak status indicators |
| Whale Girl Dynamic Feedback | Idle, blinking, deduction hit, cache miss, balance depletion, and top-up revive |
| Proactive Alerts | Daily budget, peak/off-peak transitions, cache-hit anomalies, and Whale Girl notification bubbles |
| WeChat Notifications | Log in and manage ClawBot in detailed settings, and receive business alerts in a girly style |
| Secure Updates | Checks GitHub Releases, verifies version, source, and SHA-256 before installing |
September 2026 Official Pricing Update
- Starting from 12:00 Beijing time on September 10,
deepseek-flash(V4.1 Flash),deepseek-v4-flash, anddeepseek-v4-flash-vision-expshare the new Flash pricing. Per million tokens: off-peak cached input ¥0.02, uncached input ¥1, output ¥4; peak hours ¥0.04, ¥2, ¥8 respectively. - Peak hours are 09:00–12:00 and 14:00–18:00 Beijing time on weekdays; weekends are entirely off-peak.
- The official plan to bill
deepseek-v4-proat Flash prices starting 12:00 Beijing time on September 14 has been canceled: V4 Pro continues to be billed at the original Pro pricing; off-peak cached input ¥0.15, uncached input ¥4.5, output ¥13.5, and peak hours ¥0.3, ¥9, ¥27 respectively. Any changes will be updated per official announcements. - Session amounts are recalculated based on available events after a cache upgrade; persisted usage ledgers are not rewritten. The official built-in price table uses time-segmented pricing: before 00:00 Beijing time on August 17 uses the old unified price, from 00:00 August 17 to 12:00 September 10 uses the old peak/off-peak prices, and thereafter uses current prices. An explicit custom price table takes full priority over the default table without historical segmentation; after updating pricing rules, the plugin host must be restarted to load them.
- Pricing reference: DeepSeek Official Models and Pricing.
Billing & Ledger
- Billing eligibility is determined by both provider and model; unknown or ineligible models never fall back to default pricing.
- Uncached input, cache reads, cache writes, and output are tracked separately, and the peak or off-peak price is selected based on the Beijing time when the call occurred.
- Vision models use the usage data returned by DeepSeek directly, without re-estimating image tokens.
- Eligible calls are written to the local persistent ledger; after a restart, historical statistics and session summaries are restored, and zero-cost records never pollute the ledger.
sessionId + sourceEventSeqguarantees event idempotency, preventing duplicate charges from replayed events.
Three-Tier Usage & History
- Per-Call Row: After each model call, the chat shows input, cache, output, thinking tokens and the exact cost.
- Session Bar: The input area continuously shows the current session's cumulative tokens and cost.
- Global Floating Card: Shows the DeepSeek account balance across sessions; today's spending and history stats are in the settings overview.
- Stats Overview: Today, 7 days, 30 days and all-time, with spending, requests, total tokens, cache-hit tokens, cache hit rate and active days.
- Chinese Large-Number Units: The overview scales through 万, 千万, 亿, 万亿; 千万-scale numbers are no longer rounded into two-digit "millions"; rounding across a boundary automatically bumps the unit.
Balance & Peak/Off-Peak
- Queries the official balance, recalibrating every 60s; on a deduction event the balance updates first, top-ups restore with green feedback.
- On query failure or missing API key, a clear status is shown; today's ledger spending is independent of the balance API.
- Peak/off-peak indicator refreshes every 30s; red for peak, green for off-peak.
- Floating card supports mouse drag, keyboard movement, viewport clamping and position memory; right-click hides the Whale Girl or opens settings.
Whale Girl
Whale Girl is a desktop companion on the balance card, keeping you company with idle and blink animations. She gives different feedback for deductions, cache misses, consecutive spending, depletion and top-up recovery. Amounts queue as floating text in event order with varied colors; ordinary ones stay lightweight.
![]() 等待任务时:啃手指待机 |
![]() 缓存未命中时:严重扣费反应 |
Alerts & WeChat
- Daily Budget: Set a daily budget; an alert fires the first time it's crossed. Alerts never block, cancel, or throttle model requests.
- Peak/Off-Peak Switch: Enter-peak and enter-off-peak alerts can be enabled separately; the same price boundary won't notify twice.
- Cache Anomaly: Configurable hit-rate threshold and consecutive-anomaly count; alerts can re-fire after a recovery and another anomaly.
- Whale Girl Bubbles: Carry only budget breaches, peak/off-peak switches, and cache anomalies; can be disabled independently.
- ClawBot WeChat: View connection, auth, and delivery status in settings; complete QR login, refresh, reconnect, secure disconnect, and test-message send.
- Girly-Style Copy: Channel test, budget breach, enter-peak, enter-off-peak, and cache anomalies all use the
dsh-damage-pulseproject name; Star invitations appear only in test messages. - All business notification switches default to off; legacy configs migrating from v0–v3 without notification fields are conservatively set to off. Test messages are independent channel checks, not gated by the business WeChat master switch.
Settings & Updates
The plugin offers a responsive blue/pink settings panel showing today's spend, history, and config for Whale-girl, budget, peak/valley alerts, cache errors, bubbles, and WeChat. Updates use a revision to prevent multi-page conflicts, with legacy field migration.
The update panel can open the project homepage, check the latest release, compare versions, and download installers. Before installing, it validates the release/tag version, asset name, download source, redirect domain, and SHA-256, and only proceeds when an installable profile is detected.
Architecture
The project's public brand is
dsh-damage-pulse. For compatibility with existing users, the directory names, package names, API paths, settings namespace, and local storage keys below still usedsh-token-monitor/token-monitor, so no migration of existing configuration or historical data is required.
| Component | Location | Responsibility |
|---|---|---|
| Host plugin | plugins/dsh-token-monitor | Billing eligibility, price calculation, persistent ledger, balance, statistics, budget/peak-valley/cache reminders, WeChat and update APIs |
| Client package | packages/client/ui-token-monitor | Per-call usage, session totals, balance floating card, Whale-girl animation, notification bubbles, and detailed settings |
| WeChat capabilities | plugins/wechat-notify / ClawBot | Connection status, login management, and message delivery; does not block billing or balance monitoring when unavailable |
Installation
This repository provides the standard DSH Host + Client combined package and prebuilt artifacts since 0.2.0. 4.0.10 fixes an issue where balance numbers could remain stale for a long time: the card's displayed value was previously synthesized from "API snapshot + not-yet-emitted charges," so once the floating-text emission chain threw an error and halted, the 60-second calibration would add the balance's decrease back as-is, freezing the number at a seemingly reasonable value with no visible error; the charge cursor now advances before visual processing, preventing visual failures from making the client replay the entire ledger every second and double-deduct; the emission chain has been made self-healing (a single emission failure no longer kills the queue, the queue can resume whenever it is non-empty, and timer references are reset during cleanup), and balance calibration now takes a snapshot before playing the top-up animation. 4.0.9 follows the official September 2026 pricing announcement to correct V4 Pro pricing: the official adjustment to bill at Flash pricing starting September 14 at 12:00 has been cancelled, deepseek-v4-pro continues to be billed at the original Pro price, and the price table no longer switches at boundary moments. 4.0.9 also fixes three historical defects (the built-in price table's historical segments never took effect due to object-identity comparison, the balance card and Whale-girl being occluded by the right sidebar's floating panel, and historical ledger rows without event sequence numbers being double-counted), and changed the silent failure of the Whale-girl toggle write to a visible warning; 4.0.8 fixes two breakages under DSH 0.1.5-alpha.2 (the official 0.1.5 line): the Host now semi-compatibly handles 0.1.5's SessionHandleReadResult (the { eventState, events } wrapped result), so session history amount projection no longer fails to migrate as a whole; the Client now semi-uses the official slot conversation.session.header.actions. 4.0.3 explicitly supports DSH Desktop 2.0.4 (DSH 0.1.2-alpha.1), and continues to support legacy compatible hosts from 0.1.0-rc.5 onward (including 0.1.0-rc.6/rc.7/rc.8 and 0.1.1-rc.2). No need to copy source code, modify DSH's tsconfig, manually pass --patch, or rebuild the Client bundle.
Desktop 2.0.4 no longer provides the legacy @deepseek-ai/dsh-client-runtime module; 4.0.3 has removed that package from product peer dependencies and the Client injection graph, keeping the legacy-host regression tests only in development environments.
Legacy or community-built DSH clients should install this plugin using their host's own lockfile and dependency versions within their existing projects. Do not pin a mix of rc.5/rc.6/rc.7 host packages with the current registry's rc.8 upstream packages in a brand-new pure npm dependency tree; such combinations fail to resolve due to upstream peer version drift and do not indicate that the plugin is incompatible with the original host.
dsh plugin --profile web add github:wssfk12138/dsh-damage-pulse
Restart the Web profile after installation:
dsh --profile web
Provides a balance bar, real-time deduction, cache hit/miss animations, per-call usage, and session totals. When upgrading from an early source-integration build, remove old manual --patch or duplicate mounts.
Native session amounts
Session amounts work out of the box with no host source changes:
- Official session header slot (
conversation.session.header.actions): both 0.1.5-alpha and rc.7 session headers declare this slot, and the standard package registers the amount badge in the action area next to the session title;sessionIdanduseSessionsare provided by the host's standard props, with no host files modified and no bundle rebuild needed. - Compatible host sidebar tail slot (
sidebar.workspaces.sessionRow.trailing): this slot is declared by the local sidebar-patched host itself; neither upstream 0.1.3 / 0.1.5 provides it. The standard package only appends registration after the host declares it, showing the amount before the time on session rows; when undeclared it waits silently, registering nothing and raising no errors. - Legacy / community-built or customized clients (neither the official session header slot nor the sidebar tail slot): the standard package includes a strictly fail-closed compatibility bridge that shows the amount only when it can uniquely and unambiguously match native session rows; the moment it detects a host that already has a formal slot marker, stable session identifier, or existing amount, it disables itself entirely and will never double-write.
- The input-area session total bar behavior is unchanged and works on all of the above clients.
scripts/apply-sidebar-integration.ps1 is retained as a development/historical compatibility tool for full DSH source deployments; it does not need to be run when the standard package already displays amounts automatically. To manually mount on a full DSH source tree, run:
.\scripts\apply-sidebar-integration.ps1 -HarnessRoot 'C:\path\to\deepseek-harness'
$env:DSH_BUILD_FACE = 'client'
corepack pnpm --dir 'C:\path\to\deepseek-harness\packages\client\ui-workspace' exec tsdown
The script first backs up the three target files, then reads projectionValues.tokenCost.cost in an idempotent way. If the upstream structure does not match, it stops and will not guess-write.
Source development
corepack pnpm install
corepack pnpm build
corepack pnpm run check:bundle
Config
API Key
Configure DEEPSEEK_API_KEY via DSH's credentials mechanism (~/.dsh/.credentials.yaml); when not configured, the balance card shows a guidance state, and token metering is unaffected.
Price table (optional override)
The price table is built-in by default (see src/pricing.ts) and can be overridden via the priceTable field in the dsh-token-monitor settings namespace. Mon–Fri default peak hours are Beijing time 9:00–12:00 and 14:00–18:00; all other hours are valley. Sat/Sun are always valley regardless of time. The built-in table is segmented by effective date: before Aug 17 00:00 uses the old flat rate, Aug 17 00:00 to Sep 10 12:00 uses the old peak/valley rate, and after that uses current prices. Passing a custom priceTable is treated as a full override, applied to all calls from Aug 17 of that year onward; calls before Aug 17 still bill at the official legacy flat rate. Official references: Models & Pricing, Vision Token Usage.
HTTP Endpoints
| Endpoint | Description |
|---|---|
GET /api/token-monitor/balance | DeepSeek account balance (currency / total / bonus balance) |
GET /api/token-monitor/usage?sessionId= | Usage detail history (filterable by session) |
GET /api/token-monitor/usage-summary?range= | Aggregated stats for today / 7 days / 30 days / all |
GET /api/token-monitor/charge-events?since=<seq> | Strictly incrementing charge event stream driving balance changes, floating text, and hit animations |
GET /api/token-monitor/notification-events?since=<seq> | Budget, peak/valley, and cache anomaly notification stream |
GET/PATCH /api/token-monitor/settings | Revision-guarded unified settings read and update |
GET /api/token-monitor/wechat/status | Query WeChat connection, auth, delivery, and short-lived login session status; the settings page "Refresh" re-requests this endpoint |
POST /api/token-monitor/wechat/login | Create a QR code login session |
POST /api/token-monitor/wechat/login/confirm | Confirm current QR code login state |
POST /api/token-monitor/wechat/reconnect | Reconnect the DSH Host-managed WeChat bridge |
POST /api/token-monitor/wechat/disconnect | Disconnect the DSH Host-managed WeChat bridge after explicit confirmation |
POST /api/token-monitor/wechat/test | Send a standalone test message, not subject to the business WeChat notification master switch |
GET/POST /api/token-monitor/update* | Release check and security-gated install flow |
WeChat Compat Layer
The plugin includes a lightweight ClawBot adapter that does not register Cordis tools, and selects the notification provider by this priority: newer external wechat-notify capability object → legacy send() / status() interfaces → built-in adapter → unavailable. Only one provider is active at any time; WeChat being logged out, timed out, or failing to send never blocks balance monitoring, billing, or Whale-girl animations.
If the user already has a standalone dsh-wechat-notify installed, this plugin reuses its sending capability; if not, simply setting WECHAT_NOTIFY_CLAWBOT_INDEX enables the built-in adapter out of the box. This variable must point to the local ClawBot CLI entry file, e.g.:
$env:WECHAT_NOTIFY_CLAWBOT_INDEX = 'C:\path\to\clawbot-cli\dist\index.js'
dsh --profile web
Does not migrate/delete credentials or re-register wechat_notify, QR tools, or bridge. Legacy send-only: panel notes "send available; login managed by original plugin."
FAQ
- Balance card shows "Not configured":
DEEPSEEK_API_KEYis not set; token metering still works normally. - Session amounts not showing: The standard package registers the amount badge to the official session header slot (
conversation.session.header.actions, the action area next to the session title); legacy/customized clients use the built-in fail-closed bridge to display when it can safely match native sidebar session rows. If still missing, first confirm you restarted the target profile; for full source deployments you may optionally run the dev compatibility script, but do not run it again when the standard package already shows amounts, to avoid duplicate writes. The input-area session total bar is always available. - Only old sessions lack amounts: Sessions that ended before plugin load are backfilled on next startup (cold-read fold for missing projection on historical sessions); wait a few seconds after startup before refreshing the page.
- No animation after window launch: Confirm the installed target profile has been restarted; if you previously used a source-integration build, first remove the old manual patch and duplicate mounts.
Community & Feedback
Feel free to share your experience, report issues, and suggest improvements in the LINUX DO community. The plugin's installation, operation, and all features do not depend on any proxy service or recharge channel.
Community submissions are reviewed and merged into the mainline, with credit in release notes and this file. Merged so far: @gurio-wine (PR #17: desktop card position and Whale-girl toggle fix, included in 4.0.9).
License
MIT
赞助商简介
免费不意味着开发没有成本。感谢Fastai的赞助,让我能把功能留给所有用户,把广告留在应用之外。
This project is sponsored and developed with support from Fastai. Fastai is an affordable model relay service covering the full GPT / Claude model lineup, plus mainstream image and video generation models. Guaranteed purity, practical and durable, invoicing supported, and long-term enterprise/school partnerships welcome. Use promo code WSSFK at sign-up to get $3 in trial credit. Below is a screenshot of my account usage history; after a month of heavy use, I can confirm it works great.


Compatibility
Versions
| Latest version | Published | Size |
|---|---|---|
| 4.0.8 | — | — |
| 4.0.4 | — | — |
| 4.0.11 | — | — |
| 4.1.0 | — | — |
| 4.0.7 | — | — |
| 4.1.1 | — | — |
| 4.0.3 | — | — |
| 4.0.1 | — | — |
| 4.0.0 | — | — |
| 4.1.2 | — | — |
| 4.1.3 | — | — |
| 4.2.0 | — | — |
| 4.2.1 | — | — |
| 4.2.2 | — | — |
| 4.2.3 | — | — |
| 4.2.4 | — | — |
| 4.2.5 | — | — |
| 4.2.6 | — | — |
| 4.2.7 | — | — |
| 4.2.8 | — | — |
Comments
Loading…
Similar plugins
by huanyuLv
DeepSeek Harness (DSH) Web 插件: 余额 + 峰谷计价潮汐提示。显示 DeepSeek 账户余额与本会话花费, 并在余额前提示当前峰/谷价格档位、距切换倒计时与使用建议。
★ 8
MIT
JavaScript
Aug 22, 2026
dsh plugin --profile web add dsh-balance-tideby Rainronin
DeepSeek Harness 插件:DeepSeek API 余额实时监测(官方 /user/balance 快照 + ds_balance 工具 + 峰谷计价状态 + 单会话费用估算 + dsh 原生风格侧边栏徽章)
★ 3
↓ 66/wk
MIT
JavaScript
Aug 31, 2026
dsh plugin --profile web add @rainronin/dsh-balance-monitorby fqsklm
DSH Web 顶部标题栏的 DeepSeek 余额/当日消费/峰谷双层图表挂件
★ 0
MIT
JavaScript
Sep 11, 2026
dsh plugin --profile web add dsh-balance-chartby ytftu
DSH(DeepSeek Harness)插件:底栏会话消费金额、每条回复本轮金额、右上角开放平台余额/今日用量/峰谷,点击弹出折线图。
★ 3
↓ 84/wk
MIT
JavaScript
Oct 26, 2026
dsh plugin --profile web add dsh-session-costby DosterBool
DeepSeek Harness 插件:状态栏实时余额 + 本会话花费追踪 + 低余额暂停输出并引导充值
★ 0
JavaScript
Aug 16, 2026
dsh plugin --profile web add dsh-balance-guardby jcleener
DSH 插件:常驻 API 用量监控 —— DeepSeek/SiliconFlow/OpenCode Go/火山引擎 余额与配额、会话树 token 与花费(侧边栏入口 + 浮动窗)
★ 0
MIT
JavaScript
Oct 10, 2026
dsh plugin --profile web add api-monitor
