dsh-peak
Manifest validDeepSeek API peak/off-peak pricing indicator: a live composer pill (red during peak, green off-peak) with a countdown to the next switch, plus a dsh_peak_status tool the agent can call to warn about cost.
dsh-peak
A live peak/off-peak pricing indicator for the DeepSeek Harness, shipped as an installable dual-face bundle.
DeepSeek's API moved to peak/off-peak pricing on 2026-08-16 16:00 UTC: during peak windows the rate is 2× the off-peak rate, and the windows line up almost exactly with Chinese work hours. Weekends and Chinese statutory holidays are billed off-peak all day. This plugin makes that visible:
- Composer pill (browser): a small always-visible control at the left of the input row — red "PEAK" during peak windows, green "OFF-PEAK" otherwise, with a live countdown to the next switch and a hover tooltip showing UTC + Beijing times and the reason the day is off-peak.
dsh_peak_statustool (host): the agent can call it before suggesting or running long/expensive work, so it can warn you when you're about to pay the peak rate.
Pricing windows
Peak applies on days that are neither a weekend nor a Chinese statutory holiday:
| Window | Beijing | UTC |
|---|---|---|
| Peak 1 | 09:00–12:00 weekdays | 01:00–04:00 |
| Peak 2 | 14:00–18:00 weekdays | 06:00–10:00 |
| Off-peak | everything else | — (half of peak) |
Whole-day off-peak, since 2026-08-23 00:00 Beijing:
| Day | Rule |
|---|---|
| Saturday + Sunday | off-peak all day, including make-up workdays (调休) that fall on a weekend |
| Chinese statutory holidays | off-peak all day (DeepSeek notice of 2026-09-19) |
Holidays follow the State Council's annual arrangement (国办发明电〔2025〕7号). The 2026 table covers Mid-Autumn (Sep 25) and National Day (Oct 1–7), which — with the Sep 20 and Oct 10 make-up weekends — make Sep 20 to Oct 10, 2026 almost entirely off-peak.
Holiday data
core.js holds the whole-day rules: HOLIDAYS (inclusive Beijing date ranges, listed only from the 2026-09-19 notice onward), MAKEUP_WORKDAYS (labels only — a make-up workday is off-peak because it is a weekend), and HOLIDAY_CALENDAR_THROUGH, the last date the table covers. The State Council publishes the next year's arrangement each November, so update all three when it lands; until then the tool appends a warning to its summary and the pill's tooltip, because holidays after that date would be misreported as peak.
Both halves run the same code: index.js imports core.js, while the browser bundle embeds the marked region from core.js verbatim (a bundle is served as one script and cannot import a sibling module).
Requirements
- A DeepSeek Harness web profile (the pill mounts in the browser; the tool registers host-side)
- No runtime dependencies — the host half uses a raw
ctx.tools.registerdefinition and the client bundle's only external isreact
Install
dsh plugin --profile web add dsh-peak # once published to npm
dsh plugin --profile web add github:geokkjer/dsh-peak # or straight from this repo
Or from a local checkout of this repo:
cd /path/to/dsh-peak
dsh plugin --profile web add .
dsh plugin runs pnpm add in the profile directory and registers the package as a bundle layer (dsh.bundle.patch → cordis.patch.yml). After the next dsh web restart, both halves activate: the host row registers dsh_peak_status, and the dsh.client declaration makes the browser roster serve /plugins/dsh-peak/client.js, mounting the pill in every session.
Usage
Ask the agent:
- "is it peak pricing right now?" → calls
dsh_peak_status - "run this long job off-peak" → the agent checks
dsh_peak_statusfirst and reports the window
The pill itself needs no interaction: it self-updates every 30s and flips color at each window boundary.
dsh_peak_status returns the summary an agent reads plus structured fields: peak, offPeakReason (weekend / holiday / none, the last when only the peak-window rule applies), holidayName (empty unless the day is a holiday), makeupWorkday, the UTC and Beijing clocks, nextSwitchUtc / nextSwitchInMinutes, and holidayCalendarThrough / holidayCalendarStale.
Tool schemas use the harness's JSON-schema subset, which takes a single type string per node — a type array disables the whole plugin entry at load, so offPeakReason carries the none sentinel instead of a nullable type.
Development
The repo is deliberately build-free: core.js, index.js (host tool), and client.js (browser bundle in the module-loader format) are committed plain ESM, so pnpm add works with no prepare step.
npm run sync:client # after editing core.js: refresh the region embedded in client.js
npm test
npm test runs the smoke suite: host identity + tool registration, window and whole-day classification at known instants (09:46 UTC → peak; 05:00 UTC → off-peak; Mid-Autumn and National Day → off-peak all day, including the switch that skips the whole National Day break; make-up workday weekends), a check that client.js still embeds the current core.js, and client bundle materialization against a stubbed module loader + React.
License
Comments
Loading…
Similar plugins
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
★ 0
MIT
JavaScript
Aug 26, 2026
dsh plugin --profile web add dsh-peak-price-panelby overact
DeepSeek Peak / Off-Peak Time Indicator for DSH Web GUI (live status, timezone auto-detection, countdown, SVG icons, discount schedule)
★ 1
↓ 242/wk
NOASSERTION
JavaScript
Sep 10, 2026
dsh plugin --profile web add dsh-peak-indicatorShows DeepSeek API balance and tells whether the current moment is peak or off-peak pricing time, with a live countdown to the next switch.
★ 0
dsh plugin --profile web add dsh-balanceby williamzhangww
Official DeepSeek peak/off-peak pricing, countdown and off-peak message scheduling for DSH.
★ 0
MIT
JavaScript
Sep 29, 2026
dsh plugin --profile web add dsh-priceflowShows DeepSeek peak/off-peak pricing status, a countdown to the next rate change, and the estimated session cost as inline text beside the model selector.
★ 0
dsh plugin --profile web add @imnotndesh/dsh-peak-pricing-warningby ibrhr
DeepSeek API Peak & Off-Peak (50% Discount) status indicator plugin for DeepSeek Harness (DSH)
★ 0
BSD-3-Clause
TypeScript
Aug 20, 2026
dsh plugin --profile web add @dsh-external/dsh-peak