DeepSeek Harness plugin

dsh-peak-indicator

Session header badge showing DeepSeek peak/off-peak status, per-model token prices on hover, and real session/turn costs from actual usage.

Jump to install

Source facts

Repository
future007s/dsh-peak-indicator
Latest update
Aug 18, 2026
Category
UI Enhancements
GitHub stars
0

Install

Start with a prompt that asks an agent to read the source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to read the page and repository first.

Do not install anything yet. Read this DeepSeek Harness plugin and explain what it does, which files, networks, or credentials it can access, and how to install and remove it.

Plugin page: https://deepseekplugins.org/plugins/future007s/dsh-peak-indicator
GitHub: https://github.com/future007s/dsh-peak-indicator
Plugin: dsh-peak-indicator
Author: future007s
Install command: dsh plugin --profile web add dsh-peak-indicator

Do not run the install command until I confirm.

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-peak-indicator

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

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

  • 高峰 · 本会话¥0.12(红色徽标):北京时间 09:00–12:00、14:00–18:00,按高峰价计费
  • 🌙 闲时 · 本会话¥0.12(绿色徽标):高峰以外时段,价格为高峰的一半
  • 悬停显示:输入 ¥3 · 输出 ¥9 · 缓存命中 ¥0.1(每百万 tokens) + 当前北京时间 + 切换倒计时

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

价格表(MODEL_PRICES,来自 DeepSeek 官方 2026-08-17 生效的价格表,单位 CNY/百万 tokens):

模型高峰 输入/输出/缓存命中闲时 输入/输出/缓存命中
deepseek-v4-flash3.0 / 9.0 / 0.11.5 / 4.5 / 0.05
deepseek-v4-pro9.0 / 27.0 / 0.34.5 / 13.5 / 0.15

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

徽标仅在当前会话使用 DeepSeek flash/pro 模型时显示(provider 为 DeepSeek 且模型名含 flash 或 pro,如 deepseek-v4-flashdeepseek-v4-pro);使用其他模型时自动隐藏。 悬停徽标可看到当前北京时间、完整价格明细(含缓存命中价)以及距离下次切换的倒计时; 徽标每 30 秒自动刷新。DeepSeek 调价后请更新 lib/client.js 中的 MODEL_PRICES

时段规则依据 DeepSeek 官方峰谷定价公告(北京时间 2026-08-17 00:00 生效):空闲时段价格为高峰时段的一半。

安装

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

- insert:
    - id: peak-indicator
      name: 'dsh-peak-indicator'

刷新浏览器(Ctrl+Shift+R)后,会话头部即可看到徽标。

配置(host 侧,可选)

默认无需任何配置。如需调整时段(政策变更时),可在 patch 条目中传:

    - id: peak-indicator
      name: 'dsh-peak-indicator'
      config:
        peakWindows: [[9, 12], [14, 18]]
        beijingOffsetMinutes: 480
        offPeakDiscount: 0.5
        policyEffectiveDate: '2026-08-17T00:00:00+08:00'

注意:浏览器端的徽标计算使用与官方公告一致的内置时段(北京 09:00–12:00、14:00–18:00), host 配置主要用于程序化调用 ctx.peakIndicator.current()

自动压缩成本守护(可选,v0.1.12+)

长会话每步都会把整个上下文重读(缓存读取费用随上下文线性增长,且隔夜后缓存失效 会按全价重读)。开启后插件会把 DSH 的压缩触发点从默认的"模型窗口 80%"调到预算值, 让旧轮次提前折叠成摘要,大幅降低后续每步成本,并在日志中记录每次压缩移除的 tokens 与估算节省金额。

- insert:
    - id: peak-indicator
      name: 'dsh-peak-indicator'
      config:
        autoCompact:
          enabled: true          # 默认 false
          contextBudget: 100000  # 上下文超过该 token 数即压缩
          retainTokens: 15000    # 压缩后保留最近 tokens
          referenceWindow: 256000

注意:压缩会把旧轮次折叠成摘要,历史细节只保留摘要内容;默认关闭,按需开启。