DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-peak-guard

c

dsh-peak-guard

Discovered

DSH Mandatory Peak/Off-Peak Mode: intercepts new queries during DeepSeek peak hours (switchable to notify-only), persistent time period/mode/countdown on the chat page, and estimated cost for the current session

Machine translated

强制梁文谷辅助器(不听话的孩子就应该被锁起来哦 你看你的价格胀的这么大 小鲸鱼真是急不可耐了呢~)

test

DeepSeek 峰谷时段守门员(DSH 插件,宿主半 + 浏览器半)。

高峰时段拦下「新一轮提问」,避免按双倍价调用;可以切换成只提醒,并在聊天页常驻一条状态提示。

A DSH plugin that blocks new prompts during DeepSeek peak-pricing hours (or just warns), shows a live peak/off-peak banner in the composer, and estimates this session's cost in CNY. Configuration lives in the DSH Plugins page.

安装

一键下载:Releases 页面点 dsh-peak-guard-0.1.0.zip,解压到 %DSH_HOME%\plugins\peak-guard,然后按下面的「手动安装」登记到 profile。

命令行安装:

dsh plugin add changzheng-Loji/dsh-peak-guard

装完完全退出并重开 DSH(bundle 列表是启动时读的),然后在 插件 → dsh-peak-guard → 配置 里把模式设为「拦截」。

手动安装(不想用 dsh plugin add):把本仓库拷到 %DSH_HOME%\plugins\peak-guard,在 %DSH_HOME%\profiles\<profile>\package.json 的 dependencies 里加 "dsh-peak-guard": "link:<该路径>"、dsh.profile.bundles 里加 dsh-peak-guard,跑一次 pnpm install 再重启。

规则(默认取官方定价页)

  • 高峰:北京时间 周一至周五 9:00–12:00、14:00–18:00(法定节假日除外)
  • 其余时段(午休、夜间、周末全天、法定节假日)都是空闲,价格是高峰的一半
  • 判定一律用 UTC+8 计算,不看本机时区;时间取不到或判定抛错时放行
  • 峰时窗口可以自己改(见下),改完仍保留「周末/节假日算空闲」的语义

行为

模式行为
block高峰时段拒绝新一轮提问(agent/pre-step 不调 next(),轮次以 blocked 收尾,不发出模型请求、不扣钱)
remind只提醒不拦截(聊天页状态条会标「只提醒」)
off完全关闭,默认值

细节:

  • 只拦一轮的第一条输入(step === 1)。工具跑完后的续跑是 step > 1,永远不会被掐断——11:58 启动的任务不会在 12:00 被腰斩。
  • 被拦下的原文会写到 %DSH_HOME%\peak-guard\last-blocked.json,不会白打。
  • 逃生阀:设置环境变量 DSH_PEAK_GUARD_DISABLE=1 后完全不拦。

界面

插件 → dsh-peak-guard → 配置:

  • 模式:拦截 / 只提醒 / 关闭
  • 哪几天算峰时:工作日 / 每天 / 自定义(勾周一…周日)。选「每天」可以在周末当场测试
  • 峰时窗口:下拉选小时和分钟,不用手打;可以选一段或两段(默认 9:00→12:00、14:00→18:00)
  • 额外节假日:2027-01-01,2027-02-06
  • 计价模型:deepseek-flash / v4-pro,只影响花费估算

聊天页输入框上方的状态条(conversation.composer.dock 槽位):

  • 现在高峰还是空闲、当前模式、距离切换还有多久
  • 右侧「本会话 ≈¥x.xx · 12.3k tok」,按当前时段单价估算(不是账单)
  • 关闭模式下不显示

已知限制

  • 硬拦截发生在消息已经发出之后(DSH 没有「提交前」钩子),所以被拦时输入框里的字不会自动回来;原文在 last-blocked.json 里。
  • 只有新一轮会被拦。一个 8:50 开始、9:40 才跑完的长任务,9:00 之后的部分照样按高峰计费。
  • 花费是估算:按 tokenUsage 投影里的 cacheRead/uncachedInput/output 乘价目,缓存写入、重试、图片等细节未计;切换模型不会自动换价目表,要手动改「计价模型」。
  • 「今日累计」和「余额」还没做:这两项需要宿主把数据送到浏览器(自定义 RPC 或 HTTP 路由),目前插件只有设置命名空间这一条通道。

开发

pnpm test          # 或:node test/peak.test.mjs && node test/gate.test.mjs

test/peak.test.mjs 覆盖时段判定(默认/自定义窗口、周末、节假日、日模式),test/gate.test.mjs 用 mock 时钟覆盖拦截行为。

lib/vendor/ 里是随包的 schemastery + cosmokit(MIT,授权文本见 lib/vendor/LICENSE.*):优先用宿主自带的那份,宿主不暴露裸说明符时自动回退,保证离线也能装配。

目录

lib/index.js     宿主半:Config schema + agent/pre-step 拦截
lib/peak.js      纯时段判定(无副作用,好测)
lib/client.js    浏览器半(手写 lazy-CJS):配置页 + composer 状态条
cordis.patch.yml 挂载行(id 必须等于设置命名空间 peak-guard)
test/*.mjs       node:test

Comments

Loading…

Similar plugins

dsh-peak-gate

by CNyaotian-Lunar

DSH 插件:按 DeepSeek 峰谷分时计价,在高峰时段给 token 花销踩刹车(拦大任务 / 压缩输出上限 / 让模型少说废话),并提供一键放行口令

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Sep 25, 2026

dsh plugin --profile web add dsh-peak-gate

by f20880479-lab

DeepSeek Harness 峰谷计费插件:高峰时段发送前确认(可勾选本次高峰段内不再提示),支持将消息排队到空闲时段(半价)自动发送;可拖拽悬浮队列窗口、调整发送顺序与时间。

Terminal & ClientsManifest valid

★ 3

↓ 54/wk

MIT

JavaScript

Aug 26, 2026

dsh plugin --profile web add dsh-peak-gate

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 lsakira

峰谷提示器:DeepSeek Harness 高峰时段提醒插件(模式指示灯 / 高峰前提醒 / 余额卡片)

UI & ExperienceManifest valid

★ 0

MIT

JavaScript

Aug 21, 2026

dsh plugin --profile web add @local/dsh-peak-reminder

by ytftu

DSH(DeepSeek Harness)插件:底栏会话消费金额、每条回复本轮金额、右上角开放平台余额/今日用量/峰谷,点击弹出折线图。

Development & InfrastructureManifest valid

★ 3

↓ 84/wk

MIT

JavaScript

Oct 26, 2026

dsh plugin --profile web add dsh-session-cost

by rinttt233

DSH(DeepSeek Harness)峰谷调度插件:高峰前 N 分钟自动生成仅供 AI 恢复用的简报并停自动续跑,高峰硬挡模型请求(带一键逃生),闲时自动注入简报继续任务。

Manifest valid

★ 0

MIT

JavaScript

Oct 13, 2026

dsh plugin --profile web add dsh-peak-brief