dsh-peak-reminder

usagetested: passnpmMIT

峰时提醒:DeepSeek 走高峰计价时,每隔 N 分钟(默认 5,可设 1–120)在 DSH Web 界面顶部提醒一次「现在是峰时」,峰↔谷切换各提醒一条,谷时完全不打扰;侧边栏底部常驻一行显示当前峰/谷状态与下次切换倒计时。峰谷规则(北京时间工作日 09:00–12:00、14:00–18:00;周末、法定节假日与调休周末全天谷价)由宿主判定,经 /plugins/dsh-peak-reminder/state 与 /config 两个免鉴权路由供界面读取;开关与间隔在设置页一节里改,存到 ~/.dsh/peak-reminder.json。

下载量 / Downloads
1,460
依赖体积 / node_modules
0.08 MB
测试时间 / Tested
2026-11-06
DSH 版本 / Version
0.2.2-rc.1

Install

dsh plugin --profile web add dsh-peak-reminder

Sandbox test results

StageResult
1 install✓
2 list✓
3 mount✓
4 boot—

Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).

README

dsh-peak-reminder

![npm](https://www.npmjs.com/package/dsh-peak-reminder) ![license](./LICENSE)

A DeepSeek Harness (DSH) plugin that tells you when DeepSeek is charging peak rates — a reminder every few minutes while peak hours are on, silence during the cheap hours. Peak costs twice what off-peak costs; this plugin says which side you are on and how long until it flips.

DSH 峰谷提醒插件:峰时段每隔几分钟在界面顶部提醒一次「现在是峰时」,谷时完全不打扰;侧边栏底部常驻一行显示当前峰/谷状态和下一次切换的倒计时。

  • 侧边栏底部一行(sidebar.footer.action):峰时 · 32 分钟后谷 / 谷时 · 1 分钟后峰;橙点是峰时、绿点是谷时、灰点是关掉了。悬停看完整说明,点一下立刻弹一条当前状态。
  • 顶部提醒条:进入峰时先给一条「现在是峰时 —— 高峰计价」,之后每 N 分钟(默认 5)再给一条;进入谷时提示「现在是谷时 —— 空闲计价」;谷时期间不会重复提醒。提醒条带「知道了」和「暂停 30 分钟」。
  • 设置页一节(settings.section):总开关、提醒间隔、峰↔谷切换提醒、侧边栏状态行、谷时自动续跑开关,以及一份「正在跑的任务」清单(逐个「暂停」,谷时逐个或一键「继续」,0.3.0)。
  • 峰时可以把正在跑的任务停在这一轮,队列不丢;到了谷时(或你手动点「继续」)按原任务继续跑。
  • 无网络请求、无凭据,只写两个文件:~/.dsh/peak-reminder.json(配置)与 ~/.dsh/peak-reminder-paused.json(暂停清单)。

Install

# with a global dsh CLI
dsh plugin --profile <profile> add dsh-peak-reminder

# or without installing dsh globally
npx -y @deepseek-ai/dsh plugin --profile <profile> add dsh-peak-reminder

--profile is required and must be the profile you actually run. The desktop app's profile is usually desktop; the CLI/web profile is usually web. Installing into a profile you do not launch looks like a successful install and then nothing appears — check the directory name under ~/.dsh/profiles/ (or %USERPROFILE%\.dsh\profiles\ on Windows) when unsure.

Published on npm as dsh-peak-reminder. Git and local installs work too — github: is a pnpm git spec, and DSH's plugin manager hands git specs to pnpm and fetches them itself. If your build does not take git specs, clone the repo and point the profile at the checkout instead:

git clone https://github.com/54nanmiao/dsh-peak-reminder
dsh plugin --profile web add /absolute/path/to/dsh-peak-reminder

The plugin declares a dsh.bundle manifest (cordis.patch.yml) and ships no build step and no dependencies, so a source install needs no build approval.

Reload the Web UI after installing. The sidebar row appears at the bottom; the settings section is under Settings → the plugins area.

Troubleshooting

'pnpm' is not recognized as an internal or external command — dsh plugin does not ship its own pnpm: it hands add … to whatever pnpm is on PATH, so the install fails at the first step on machines that only have npm (the desktop app bundles pnpm under ~/.dsh/dsh-runtimes/*/dependencies/pnpm but does not put it on PATH). Fix by installing pnpm, or by prepending the bundled one for the command:

# Windows: point a shim at the pnpm the desktop app already bundles
set PATH=%USERPROFILE%\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\pnpm\bin;%PATH%
npm i -g pnpm        # or just install pnpm once, anywhere on PATH

It installs an older version than npm view dsh-peak-reminder version reports — recent pnpm versions gate packages by release age (minimumReleaseAge). A version published minutes ago is skipped silently and the previous one is installed instead, so ^0.x in your package.json points at the older release. Ask for the version you want explicitly:

dsh plugin --profile <profile> add dsh-peak-reminder@0.1.3

pnpm then prints Added 1 entry to minimumReleaseAgeExclude … and installs it. (Observed with pnpm 11.28.5: add dsh-peak-reminder picked the ~29 h-old release while add dsh-peak-reminder@0.1.3 — published ~45 min earlier — succeeded.)

How much it saves

Off-peak rates are exactly half of peak rates (DeepSeek's own wording: "Off-peak rates are half of the peak rates.").

Per 1M tokens, USD:

· Off-peak · Peak

Input, cache hit · $0.003 · $0.006

Input, cache miss · $0.15 · $0.30

Output · $0.60 · $1.20

So 1M output tokens costs $1.20 during peak and $0.60 off-peak — a $0.60 difference for the same work.

The sidebar shows which side you are on (峰时 2× / 谷时 5 折) and how long until it flips.

Since 0.2.0 it also shows a second line — this week's spend during peak, and what it would have been off-peak — computed from DSH's own ~/.dsh/.dshw-usage.json (本周峰时 ¥0.06 · 可省 ¥0.03). That number is an estimate from per-request costs, not your bill.

Peak-time pause and resume (0.3.0)

Peak pricing is 2× and nothing stops you from being mid-task when 09:00 hits. The tasks panel in Settings lists every session the host reports as running, with one button: 暂停.

  • 暂停 cancels the session's current turn only (session.cancel, which DSH implements as agent.cancel({ kind: 'user' }, { keepInbox: true })). Queued messages and the rest of the task stay in the inbox.
  • The session id goes into ~/.dsh/peak-reminder-paused.json before the cancel is attempted, and the record is rolled back if the cancel throws — a failed pause never silently loses a task.
  • 继续 enqueues one prompt (session.prompt, mode: 'queue') with resumeText, so the agent picks the task up again as an ordinary queued turn.
  • Pausing is opt-in and per task — nothing is ever paused automatically. You pick the rows.
  • With autoResume on (default), a 60-second host heartbeat checks the clock: outside peak hours, every paused session that still has the per-task toggle on is resumed automatically. During peak hours it does nothing.
  • Per-task opt-out (0.3.1): each paused row carries a 谷时自动续 checkbox. Uncheck it and that task stays paused indefinitely — only your own 继续 starts it again. The heartbeat skips it and reports it under skipped.
  • 全部继续 is an explicit instruction, so it resumes everything regardless of those checkboxes.
  • The sidebar row keeps a count while anything is paused: `⏸ 2 个任务已暂

…(truncated)

Rendered from the README published on npm. Formatted only, not edited.

Versions

Published on npm::9,最后更新 2026-11-06

Links

GitHub · Homepage · npm

Same category