DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-usage-pulse

h

dsh-usage-pulse

Discovered

DSH Web UI plugin: live DeepSeek peak / off-peak pricing, token spend and hourly usage bars in the composer dock.

Usage Pulse · 峰谷用量

本地开发备忘(怎么改、改完怎么生效、踩过的坑):见 NOTES.md。

A DSH Web UI plugin that keeps DeepSeek's peak / off-peak pricing, your token spend and your hourly usage visible right below the composer — updated live, no page reload.

一个 DSH Web UI 插件:在输入框下方实时显示 DeepSeek 的峰谷时段与价格、token 用量与花费,以及分时用量图表。

status: peak/off-peak badge with live countdown

Features · 功能

  • Live regime badge — 峰时 / 谷时 5 折 with a countdown to the next price switch, computed in Beijing time (Asia/Shanghai), including Chinese statutory holidays (peak is Mon–Fri 09:00–12:00 and 14:00–18:00, holidays and weekends are always off-peak).
  • When the cheap window starts — the expando shows the next off-peak window (下一谷段 今天 12:00 开始 · 4 小时后) and when the current segment began, and while peak is running the pill itself shows 谷段 12:00 起.
  • Today at a glance — today's spend in CNY plus total tokens, refreshed every 5 seconds.
  • Session breakdown — expand the pill to see this session's requests, tokens and cost, plus the cache-hit / cache-miss / output split and how much of today's spend happened in peak vs off-peak hours.
  • Hourly & daily usage — 24 one-hour bars (amber = peak hours) and the last 7 days, so you can see when you spend.
  • Official unit prices — the current tier's CNY / 1M-token prices for deepseek-flash and deepseek-v4-pro (peak and off-peak are exactly ×2 / ×1).
  • Bilingual UI — 中文 / English through the harness locale service.

How pricing is computed · 计费口径

Prices follow the official page https://api-docs.deepseek.com/quick_start/pricing/ (verified 2026-10-22, CNY per 1M tokens):

ModelBandCache hitCache missOutput
deepseek-flashpeak0.0428
deepseek-flashoff-peak0.0214
deepseek-v4-propeak0.309.027.0
deepseek-v4-prooff-peak0.154.513.5

Peak = Beijing time Mon–Fri 09:00–12:00 and 14:00–18:00, excluding Chinese statutory holidays. Everything else (nights, weekends, holidays) is off-peak, at exactly half the peak price.

Usage is read from the harness session event feed (assistant/message → usage), where inputTokens already excludes cache hits: cost = miss·missRate + hit·hitRate + output·outRate (cacheWriteTokens is billed at the cache-miss rate). Estimates only — Search / Fetch request fees are not included.

Privacy · 隐私

Only aggregates are stored, never conversation content: per-hour counters (tokens and cost) and per-session totals, kept for 35 / 120 days respectively and capped at 300 sessions. The file lives at ~/.dsh-usage-pulse/usage.json (override with DSH_USAGE_PULSE_DIR). All computation is local; the widget talks to the host over a same-origin route only.

Install · 安装

This repository is a DSH plugin bundle: package.json declares the dsh.bundle manifest and cordis.patch.yml inserts the plugin, so it installs the same way as any other plugin.

# once the entry is listed in the community catalog
dsh plugin add hunyu-feng/dsh-usage-pulse

For a local checkout, point the DSH plugin manager at the directory containing package.json (plugin_manager install_bundle in the Web UI). No restart is needed: the widget appears in the composer dock right after install.

Files

FilePurpose
index.jsHost half: event aggregation, pricing, persistence, GET /usage-pulse/api/snapshot
client.jsClient half: composer-dock widget + detail panel
holidays.jsChinese statutory holidays (off-peak days)
locale/Bundle metadata (zh / en)
cordis.patch.ymlLoader patch that inserts the plugin

Notes

  • Peak-regime accuracy depends on holidays.js: add the next year's State Council holiday list once it is published (usually the preceding November). A stale list only mislabels holiday days.
  • Usage that happens while the plugin is disabled is not backfilled (the persisted session log is a concatenated zstd frame stream that Node cannot decode frame-by-frame reliably).

Licensed under the MIT License.

Comments

Loading…

Similar plugins

dsh-token-saver

by vitkuz573

DSH plugin: peak-hour billing guard for DeepSeek Harness, plus token-saving settings UI and a live session cost strip

Manifest valid

★ 0

JavaScript

Oct 10, 2026

dsh plugin --profile web add @local/dsh-token-saver

by LucienLL

DeepSeek Harness plugin: peak/off-peak price watch, live account balance with tiered low-balance alerts, and a top-up button for the main web UI

Models & ProvidersManifest valid

★ 0

MIT

JavaScript

Aug 26, 2026

dsh plugin --profile web add dsh-peak-price-panel

by zi7tian

DeepSeek Harness (dsh) web plugin: shows whether DeepSeek API pricing is peak or off-peak, plus a countdown to the next switch, below the composer.

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Oct 9, 2026

dsh plugin --profile web add dsh-deepseek-billing-period

by jessicacui99

Live token spend for the current DSH session, priced with your profile's table and shown beside the composer.

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Oct 11, 2026

dsh plugin --profile web add dsh-plugin-token-cost

by 1134478268-dev

DeepSeek Harness 峰谷时段 + 用量/费用指示器(随时区自适应、中英双语)· Peak/off-peak timing with token usage and spend tracking for the DSH Web UI.

Development & InfrastructureTerminal & ClientsManifest valid

★ 1

MIT

JavaScript

Oct 3, 2026

dsh plugin --profile web add dsh-peak-clock

by XiaHouSheng

A DeepSeek-Harness web plugin that tracks provider token usage, prices it with a peak/off-peak table, and shows the totals in the dsh GUI — plus a standalone overview page and JSON API.

Manifest valid

★ 0

MIT

TypeScript

Aug 17, 2026

dsh plugin --profile web add dsh-token-tracker