dsh-angry

by 01virex

0 UI 增强github收录于 08-23

轮次跑得越久,DeepSeek Harness web UI 就越红越抖——「红色警报」既视感

Turns the DeepSeek Harness web UI red and shaky the longer a turn runs — the "re

安装

dsh plugin --profile web add github:01virex/dsh-angry

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗

安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。

README

目录

回合跑得越久,DeepSeek Harness(dsh)Web 界面就越"红温":红色遮罩随已用时间逐渐变浓, 整个页面开始颤抖。经典"等急了 / 气到红温"整活效果,回合结束自动恢复平静。

特性

  • 怒气爬升:回合运行超过 thresholdMs(默认 30s)后,怒气值从 0 线性涨到 maxAngerMs(默认 3min)时的满怒;
  • 红色遮罩:满屏红色随怒气渐浓(0 → maxOpacity),默认关闭时完全不出现,恢复时平滑淡出;
  • 满怒脉动:怒气 > 0 时红色"呼吸"式明暗脉动(可关);
  • 页面颤抖:整个界面随怒气抖动,满怒时振幅最大 shake.maxAmpPx(默认 3px,可关);
  • 只读时钟:只读取回合计时(TurnStatus 里 15s 后出现的时钟)判定怒气,不动时钟本身;
  • 零素材:红色与抖动全是 CSS/DOM 实时生成,无图片无音效,开箱即用;
  • 可配置 + 实时生效:localStorage 覆盖每秒级生效,无需刷新;也能一键应急关闭;
  • 手动演示:控制台一行代码立刻预览任意怒气值。

安装

方式 A:dsh plugin 自动安装(推荐)

本包声明了 dsh.bundle.patch,dsh plugin add 会自动把它的 patch 层并入 dsh.profile.bundles:

dsh plugin --profile web add <你的仓库地址/dsh-angry>

重启 dsh web,浏览器 Ctrl+F5 硬刷新 即可生效。

方式 B:手动安装

  1. 把本项目放到 web profile 的 node_modules 下(默认 C:\Users\<你>\.dsh\profiles\web\node_modules\dsh-angry\);

  2. 在 web profile 的 cordis.patch.yml 里插入:

    - insert:
        - id: angry
          name: dsh-angry
    
  3. (可选)node gen-config.cjs 生成本地 config.json;

  4. 重启 dsh web,浏览器 Ctrl+F5 硬刷新。

配置

配置优先级从高到低:

  1. localStorage 完整配置:dsh-angry.config(粘贴 JSON,实时生效,无需刷新);
  2. config.json(项目根,本地个性化,被 .gitignore 忽略;缺省时 node half 自动回退到 config.example.json;修改后需刷新页面重新加载);
  3. 内置默认值(见 lib/client.js 顶部 DEFAULT_CONFIG)。

配置文件格式(config.example.json):

{
  "enabled": true,
  "thresholdMs": 30000,
  "maxAngerMs": 180000,
  "maxOpacity": 0.35,
  "pulse": true,
  "shake": { "enabled": true, "maxAmpPx": 3 },
  "debug": false
}
键 默认 说明
enabled true 总开关;false 彻底关掉(应急用)
thresholdMs 30000 回合运行超过多少毫秒开始红温
maxAngerMs 180000 运行达到多少毫秒时怒气拉满(最红最抖)
maxOpacity 0.35 满怒时红色遮罩的最大透明度 0~1
pulse true 怒气 > 0 时红色是否呼吸脉动
shake.enabled true 页面抖动开关
shake.maxAmpPx 3 满怒时的最大抖动振幅(px)
debug false 控制台诊断日志

应急关闭:不想再红温时,在浏览器控制台执行(下一 tick 立即生效,无需刷新):

localStorage.setItem("dsh-angry.config", JSON.stringify({ enabled: false }));
// 恢复默认:localStorage.removeItem("dsh-angry.config")

快速预览 / 测试

不想等 30 秒回合跑完,想立刻看效果?浏览器控制台(F12)执行:

window.dshAngry.setLevel(0.5) // 立即显示 50% 怒气(半红半抖)
window.dshAngry.setLevel(1)   // 满怒(最红最抖)
window.dshAngry.reset()       // 恢复自动跟随回合
window.dshAngry.config        // 查看当前生效配置(只读)

也可以把阈值临时拉到 0(回合一开始就红温)——控制台执行 localStorage.setItem("dsh-angry.config", JSON.stringify({ thresholdMs: 0 })), 下一 tick 即生效;改回/删除该键即可恢复默认(都实时生效,无需刷新)。

怒气是 elapsed 的线性函数:thresholdMs 前为 0,maxAngerMs 后为 1,中间按 (elapsed - thresholdMs) / (maxAngerMs - thresholdMs) 线性爬升。若把 maxAngerMs 设得 ≤ thresholdMs,则一过阈值即满怒。

项目结构

dsh-angry/
├── lib/
│   ├── index.js            # node half:serve config.json
│   └── client.js           # browser half:怒气计算 + 红色遮罩 + 抖动
├── config.example.json     # 完整配置模板(入库)
├── config.json             # 本地个性化配置(被 .gitignore 忽略)
├── gen-config.cjs          # 初始化 config.json 的脚本
├── cordis.patch.yml        # bundle patch(由 dsh.bundle.patch 自动应用)
├── package.json
├── CONTRIBUTORS.md
├── LICENSE                 # MIT
└── README.md

卸载

  • 方式 A 安装:dsh plugin --profile web remove dsh-angry;
  • 方式 B 安装:从 cordis.patch.yml 删掉 angry 那一行,并删除 node_modules 下的包目录。

之后重启 dsh web 即可。

原理

这是 dsh 的「双面(bundle + client)」插件:同一包名既是一个 bundle(通过 dsh.bundle.patch 在配置树里插入一行),又是一个 dsh.client 浏览器插件(web 运行时扫描 dsh.client 元数据、serve /plugins/dsh-angry/client.js 并注入 window.__DSH_BOOT__)。 node 半部只负责把 config.json 送出本地 HTTP,红温逻辑全在浏览器半部。

怒气判定

浏览器半部每 250ms 遍历所有 [role="status"][aria-live="polite"] 元素,找到其中带 aria-hidden="true" 且能解析出正时长的直接子 span(即 TurnStatus 的时钟;页面上还有 轨迹加载、模型保存等其它 status 区,且 dsh-status-rotator 的炫彩文案 span 会占用 TurnStatus 的第一个子节点,所以不能按"第一个元素子节点"或"唯一 status"来定位)。 时钟文本是本地化的(15秒 / 1分02秒 / 15s / 1m 02s / 0:15 等),解析成秒数:

  • 回合刚启动(尚无时钟)→ 怒气 0;
  • 时钟 ≥ thresholdMs → 怒气开始爬升;
  • 时钟 ≥ maxAngerMs → 怒气 1(满怒);
  • 回合结束(时钟消失 / TurnStatus 移除)→ 怒气回落 0,CSS 过渡平滑淡出。

红色遮罩是一个 pointer-events:none 的 position:fixed 全屏层(最高 z-index),透明度 = 怒气 × maxOpacity;抖动是对 body 施加一个无限循环的 translate 动画,振幅通过 CSS 变量 --dsh-angry-amp 由 JS 每 tick 写入,因此能随怒气连续缩放。

贡献

欢迎提交 Issue 和 Pull Request。想改手感,最简单的方式:直接编辑 config.json 的 thresholdMs / maxAngerMs / maxOpacity / shake.maxAmpPx,不需要动任何代码。 详见 CONTRIBUTORS.md。

License

MIT

原始 README: https://github.com/01Virex/dsh-angry/blob/main/README.md ↗