future007s/dsh-peak-indicator

功能:会话头部显示一个徽标指示当前收费档期—— ⚡ 高峰(红色):当前按原价计费 🌙 闲时 · 半价(绿色):当前按半价计费 悬停显示:当前北京时间、时段说明、距离下次切换的倒计时;每 30 秒自动刷新

Project Overview项目介绍

dsh-peak-indicator is a native plugin built exclusively for the DeepSeek Harness (DSH) Web profile. To install, users place the plugin package into the DSH node_modules directory and add a configuration entry to their cordis.patch.yml file, then refresh their browser to activate it. The plugin delivers two core value propositions: peak/off-peak cost tracking for DeepSeek API usage and automatic long context compression to cut ongoing token costs. When enabled, it triggers compression once the session context hits a configured token threshold, using DSH’s built-in compaction tool to fold older conversation into a summary and reduce redundant token usage for subsequent requests.

The cost indicator displays a colored badge at the top of the current session that marks whether the current time falls into DeepSeek’s peak or off-peak window, along with the total accumulated cost of the session so far. Hovering over the badge shows the current per-million token prices for input, output, and cached tokens, plus a countdown to the next pricing switch. The plugin calculates costs based on the timestamp of each request, so it accurately reflects the actual billable cost per DeepSeek’s pricing rules. It also shows the cost of each individual message at the end of the message stats line, so users can track their spending in real time.

This plugin requires Node.js version 22.13.0 or newer, and DSH version 0.1.0-rc.7 or newer, and supports the official DSH Web profile only, and has been verified compatible with multiple recent DSH releases on macOS. It is released under the open-source MIT license, so it is free to use, modify, and distribute. If DeepSeek adjusts their pricing, users will need to manually update the MODEL_PRICES table in the plugin code to keep cost calculations accurate. For tasks that require full historical context details, users are advised to adjust the compression settings to retain more original tokens.

这是一款专为 DeepSeek Harness(DSH)Web 开发的原生插件,核心功能包含两项:一是根据 DeepSeek API 的峰谷定价规则,在会话头部标记当前时段并计算显示会话总消耗和单轮消耗;二是当会话 token 数达到设定阈值时自动压缩长上下文,减少后续 API 调用的输入 token 费用,降低整体使用成本。

安装完成后默认开启所有功能,用户可在DSH设置面板实时调整压缩阈值、保留token数、开关状态等参数,无需手动编辑配置文件或重启应用。默认在上下文达到10万token时触发压缩,可移除约85%的冗余旧上下文,大幅降低后续请求的输入费用,适合经常使用长会话开发的用户控制使用成本。

该插件要求Node.js >=22.13.0、DSH >=0.1.0-rc.7,仅支持DSH Web配置文件。遵循MIT许可协议免费开源,DeepSeek调整价格后用户需手动更新代码内的价格表,涉及精确历史细节的任务建议调高压缩阈值保留更多原文token。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 4 stars - very few users, little community feedback星标只有 4,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:future007s/dsh-peak-indicator

把 future007s/dsh-peak-indicator 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-peak-indicator

DeepSeek API 高峰/闲时(峰谷)计价标记插件 for DeepSeek Harness (DSH) Web。

首要功能:自动压缩长会话,减少后续上下文费用

安装后默认开启。 当会话上下文达到 100,000 tokens 时,插件会配置 DSH 内置 compaction-basic,将较早的对话折叠为摘要、保留最近约 15,000 tokens;不需要额外启动参数、 patch 或命令。这样后续每一步不必反复重读整段旧对话。

默认一次可从约 100k 上下文中移除约 85k tokens,因此在不计摘要自身长度的理想比较下, 后续每一步需要重读的历史上下文最多可减少约 85%。这节省的是后续请求的上下文输入费用, 不是整次请求的总费用:输出 tokens、保留的最近上下文和新生成的摘要仍会计费。

自动压缩不限 DeepSeek 模型:只要当前 DSH profile 提供 compaction-basic,DeepSeek、OpenAI、 Claude、Gemini 等长会话都可受益。插件会对内置价格表已知的模型或 config.prices 中自定义的模型 记录每一步的估算节省;未知模型仍会被压缩,但金额估算不可靠。

建议从平衡档开始:

  • 保守:150,000 tokens(更少摘要,节省较少)
  • 平衡:100,000 tokens(默认、推荐)
  • 节省:60,000 tokens(更早压缩,旧内容更依赖摘要)

在 DSH 设置中打开 插件 → 成本与上下文,即可实时调整开关、触发预算、保留 tokens 和参考窗口, 无需编辑 YAML 或重启。压缩会用摘要代替早期原文,涉及精确历史细节的任务应提高预算或保留更多 tokens。

在会话头部显示一个标记,标明当前处于 高峰时段 还是 闲时,并附带当前会话实际消耗费用 (保留两位小数)。鼠标悬停可查看当前模型在当前时段的 token 单价明细(输入/输出/缓存命中):

  • ⚡ 高峰 · 本会话$0.12(红色徽标):仅周一至周五北京时间 09:00–12:00、14:00–18:00
  • 🌙 闲时 · 本会话$0.12(绿色徽标):其余时段,周六、周日全天均按闲时价
  • 徽标内常驻显示距离下一次峰谷切换的倒计时;悬停可查看当前官方美元单价(每百万 tokens)和当前北京时间

每轮聊天末尾还会显示本轮实际 token 消耗金额(如 本轮 $0.08,常显在消息统计行)。

价格表(MODEL_PRICES,来自 DeepSeek 官方价格页,单位 USD/百万 tokens):

模型 高峰 输入/输出/缓存命中 闲时 输入/输出/缓存命中
deepseek-flash(V4.1-Flash) 0.30 / 1.20 / 0.006 0.15 / 0.60 / 0.003
deepseek-v4-pro 1.32 / 3.96 / 0.044 0.66 / 1.98 / 0.022

会话与本轮费用由宿主侧 peakCost 会话投影计算:重放会话日志中的真实 token 用量,按每个事件 自身时间戳所处的时段(高峰/闲时)计价,缓存命中 token 按缓存价计算。

徽标仅在当前会话使用 DeepSeek flash/pro 模型时显示(provider 为 DeepSeek 且模型名含 flash 或 pro,如 deepseek-flash、deepseek-v4-flash、deepseek-v4-pro);使用其他模型时自动隐藏。 徽标会常驻显示距离下次切换的倒计时,并每 30 秒自动刷新;悬停可看到当前北京时间和完整价格明细(含缓存命中价)。 价格表按插件版本固定,插件不会在每次请求时联网抓取价格:这样历史会话可以按当时版本和事件时间稳定重放, 官方调价后发布新插件版本更新即可;自定义模型仍可通过 config.prices 覆盖。当前数据来自 DeepSeek 官方模型与价格页,宿主端和浏览器端价格表需同步更新。

时段规则依据 DeepSeek 官方峰谷定价公告:峰值时段为工作日北京时间 09:00–12:00、14:00–18:00, 周末全天闲时;闲时价格为高峰时段的一半。V4.1-Flash 新价格自北京时间 2026-09-10 12:00 起生效, 旧模型名 deepseek-v4-flash 和 deepseek-v4-flash-vision-exp 均按 V4.1-Flash 价格计费。

安装

插件包放入 ~/.dsh/profiles/web/node_modules/dsh-peak-indicator/(以及 dsh 安装目录的 node_modules/),并在 ~/.dsh/profiles/web/cordis.patch.yml 增加:

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-character-profiler 下一个 Next dsh-model-picker →