Introduction¶
DeepSeek Harness (DSH) adopts a plugin-based architecture designed to extend client capabilities. dsh-peak-alert is a pure frontend plugin for the web client, intended to address the problem that users cannot directly perceive whether they are currently in a “peak/off-peak pricing” period when using DeepSeek models. The plugin automatically identifies the period and adjusts the interface style, helping users avoid unnecessary costs incurred during peak periods.
Period Rules¶
According to official information, the plugin determines periods based on Beijing time:
- Peak period: Monday to Friday (excluding Chinese statutory holidays), from 09:00 to 12:00 and from 14:00 to 18:00.
- Off-peak period: all other times, including weekends and full days of Chinese statutory holidays.
- Price relationship: the off-peak price is half of the peak price (peak ≈ off-peak × 2).
Core Features¶
-
Three-level hint intensity
In Settings → General Settings, users can select a “Peak/Off-Peak Pricing Hint Intensity”:- Off: no period chip is displayed, and the input card is not tinted.
- Low: only DeepSeek models display a period chip, and the input card is not tinted.
- Medium: displays a period chip, and during peak periods the input card background is tinted light red (with a red border).
- The setting is persisted in the browser
localStorageand remains after refresh or restart.
-
Input card peak tinting
When the intensity is Medium, the current model is DeepSeek, and the current time is a peak period, the input card ([data-composer-card]) background automatically overlays a light red tint, and the color changes immediately when the period switches. -
Period chip display
The status bar below the input box displays a colored chip, including the current status, price multiplier, and next switch time.- Peak: red
⚠ Peak · Price×2 - Off-peak: green
Off-Peak · Price×1 - Weekend: green
Off-Peak (Weekend) · Price×1 - Statutory holiday: green
Off-Peak (Spring Festival) · Price×1 - Next switch: automatically calculated and displayed; weekends and statutory holidays are skipped. For example,
Mon 9/21 09:00 switch to peak. Hovering shows the full description and remaining time, refreshed every 10 seconds.
- Peak: red
-
Statutory holiday recognition
- Automatically fetches data from the apisbo statutory holiday API.
- Only items with
type === "holiday"are used, whiletype === "workday"(make-up workdays) are ignored. - Data is cached by year in
localStorage; when 45 days remain before the end of the year, data for the following year is fetched in advance. - Fault tolerance: If the API is unavailable, it silently falls back to judging only by “Monday to Friday”; the chip remains displayed, but the hint notes that “statutory holiday data is temporarily unavailable”.
-
Automatic DeepSeek model recognition
- Automatically matches the model name in the bottom-right corner of the input box; any name containing “DeepSeek” is treated as a DeepSeek model.
- For non-DeepSeek models in Medium mode, only a gray neutral chip is displayed, and the input card is not tinted.
- Detection is triggered on page mount, session switch, model switch, and window focus.
Installation and Activation¶
Before installation, ensure that pnpm is available in the system PATH.
Install the plugin:
dsh plugin --profile web add https://github.com/zbxzbx98/dsh-peak-alert
Activation steps:
After installation, you must restart dsh web and refresh the page. The client bundle is loaded based on the startup hash, so the new plugin can only be recognized after restart. At that time, when using a DeepSeek model during a peak period, the input card will show a light red background.
Update and Uninstall¶
Update the plugin:
dsh plugin --profile web update dsh-peak-alert
If the update fails (for example, if the version was previously pinned), you can remove the plugin first and then add it again:
dsh plugin --profile web remove dsh-peak-alert
dsh plugin --profile web add https://github.com/zbxzbx98/dsh-peak-alert
Pinned version installation:
If you need to install a specific version (for example, v0.1.0), you can use:
dsh plugin --profile web add github:zbxzbx98/dsh-peak-alert#v0.1.0
Uninstall the plugin:
dsh plugin --profile web remove dsh-peak-alert
Technical Notes¶
- Pure frontend execution: All period calculations are performed in the browser using
Intl.DateTimeFormat, with no dependency on the local time zone setting. - External request: The only external request is the yearly holiday table fetch (GET, sending only the year, without cookies). The request is configured with
credentials: omit. - Local storage: The intensity setting and holiday cache are both stored in the browser
localStorage. - License: MIT.
- Directory page and source code: SkillHub directory | GitHub repository