dsh-prevent-scd

by Codingendless

1 通知与集成github 检测到 manifest package.json#dsh收录于 08-16

DeepSeek Harness(DSH)趣味休息提醒宠物插件。检测深夜或长时间连续的人类操作,并阻止Web UI,直到你同意休息。可配置阈值,无外部资源,MIT。

A playful rest-reminder pet plugin for DeepSeek Harness (DSH). Detects late-night or hours-long continuous human operation and blocks the web UI with a cute nurse-cat until you agree to rest. Configurable thresholds, zero external assets, MIT.

安装

dsh plugin --profile web add github:Codingendless/dsh-prevent-scd

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

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

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

README

目录

English · 中文

dsh-prevent-scd is a playful rest-reminder pet plugin for the DeepSeek Harness (DSH) web UI — like ChatGPT's pet, it comes out and causes trouble to make you take a break.

It watches for traces of human operation in DSH sessions and nags you when:

  • you have been working continuously for hours (default 3 h, any configurable), or
  • it is late night (default 23:00–06:00, configurable) and you are still operating.

A cute hand-drawn nurse-cat (inline SVG, zero external assets) lives in the composer strip, turns worried when you approach the limit, then blocks the whole screen with a bouncing sign — 「⛔ 睡觉!」 at night / 「⛔ 走走!」 by day — intercepting Enter, until you choose the matching action (“OK, I'll sleep” at night / “I'll go for a walk” by day, quiet for 2 h) or snooze for 15 more minutes.

Highlights

  • Host half (Node): listens to session/event real user/messages (plugin-injected / replay events do not count), maintains continuous-work timing.
  • Browser half (Web): persistent status line + companion moe pop-up (once you've been continuously working for each multiple of moeIntervalMinutes, the cat pops into the bottom-right corner to say hi — click to dismiss, never blocks) + full-screen mischief overlay, five SVG poses (napping / worried / blocking-sleep / blocking-walk / relieved farewell), CSS animations (breathing, tail wag, shake, floating Zzz).
  • Scene-aware copy: late night → go to sleep, daytime long work → go for a walk — the messages, title, buttons and the sign all match the trigger.
  • Every threshold is configurable: maxWorkMinutes, idleBreakMinutes (a no-op gap longer than this resets the clock, default 30 min), late-night window, cooldown, snooze.
  • State persists to $DSH_HOME/prevent-scd/state.json, surviving dsh restarts.
  • No external assets, no network calls, works offline. 18 unit/integration/smoke tests.

Quick install

dsh plugin --profile web add -w "path/to/dsh-prevent-scd"
# restart the dsh web service to activate

Override config in the profile's cordis.patch.yml (hot-reloaded, no restart needed):

- id: prevent-scd
  config:
    maxWorkMinutes: 120
    idleBreakMinutes: 20
    lateNightStart: '23:00'
    lateNightEnd: '06:00'

HTTP surface

  • GET /prevent-scd/state.json — state snapshot (browser polls every 15 s)
  • POST /prevent-scd/ack — { "kind": "rest" | "snooze" } user response

License

MIT


中文文档

一个 DSH(DeepSeek Harness)Web 插件:检测「深夜 + 有人工操作」或「连续数小时有人工操作」, 放出宠物跳出来捣乱,提醒你休息——像 ChatGPT 的宠物一样。

  • 宿主半边(Node):监听 session/event 的真实用户消息(user/message,source.kind === 'user', 且为 append 进入日志的事件;插件注入/历史回放不算人工操作),维护连续计时;
  • 浏览器半边(Web):输入框下方常驻一行状态小字;卫士猫每隔 45 分钟(可配置)在右下角 冒出来卖个萌说句话(点一下就关,不挡工作);休息时间到后宠物占满全屏捣乱 (挡住界面、拦截回车),给你「去休息 / 再干 N 分钟」两个出口。

规则(全部可配置)

配置 默认 说明
maxWorkMinutes 180 连续工作上限(分钟),达到后宠物出来捣乱
warnAtMinutes 150 提前提醒:连续时长到达该值先小声提醒
idleBreakMinutes 30 无操作多久算中断:超过该时长连续计时清零
moeIntervalMinutes 45 陪伴卖萌:卫士猫每连续工作满该分钟数,在右下角冒出来卖萌一次(0 = 关闭)
moeDurationSeconds 6 卖萌卡片停留时长(秒),点一下可提前关闭
lateNightStart 23:00 深夜窗口开始(HH:MM,支持跨零点)
lateNightEnd 06:00 深夜窗口结束
recentActivityMinutes 20 深夜判定「人在」的操作窗口:超过该时长无操作不打扰
lateNightMinWorkMinutes 0 深夜触发所需的最少连续工作分钟(0 = 深夜有操作即提醒)
restCooldownMinutes 120 点「我去休息」后的安静时长
snoozeMinutes 15 点「再干 N 分钟」的延时时长
evaluateIntervalSeconds 30 宿主侧评估间隔(浏览器侧轮询固定 15 秒)
persist true 计时状态持久化(重启 dsh 不丢)
statePath '' 状态文件路径;留空 = $DSH_HOME/prevent-scd/state.json

「连续」的定义:任一无操作间隔超过 idleBreakMinutes(默认 30 分钟)即视为中断, 连续计时清零,下次操作重新起算。

安装

# 在你的 profile 里安装(示例:web)
dsh plugin --profile web add -w "D:\projects\vibe\dshp\dsh-prevent‑scd"

然后重启 dsh web 服务生效(profile bundle 列表变更需要重启;运行中的实例不受影响)。

注意:pnpm 对 link: 依赖不安装传递依赖,@deepseek-ai/cordis / @deepseek-ai/schemastery 通过本机共享的 D:\projects\vibe\dshp\node_modules 解析 (与同目录的 dsh-liang-rheostat 插件同一约定)。换机器部署时,先在插件目录 执行 pnpm install 或把这两个依赖装到可达的 node_modules。

配置

在 profile 的 cordis.patch.yml 里按行 id 覆盖(最后写入者胜,保存即热生效):

- id: prevent-scd
  config:
    maxWorkMinutes: 120        # 2 小时就提醒
    idleBreakMinutes: 20       # 20 分钟无操作算中断
    lateNightStart: '22:30'    # 22:30 到次日 6:30 算深夜
    lateNightEnd: '06:30'
    snoozeMinutes: 10

或直接改 bundle 里的默认值(cordis.patch.yml 中该行的 config)。

卸载

dsh plugin --profile web remove dsh-prevent-scd
# 并删除 profile package.json 的 dsh.profile.bundles 里的 dsh-prevent-scd(如果 pnpm remove 没自动清)

删除 $DSH_HOME/prevent-scd/ 可清掉计时状态。

内部结构

cordis.patch.yml      bundle patch:插入 prevent-scd 一行(dsh.client 双面包)
lib/index.js          宿主插件:session/event 监听、/prevent-scd/* HTTP 端点、持久化
lib/tracker.js        纯逻辑规则引擎(无 cordis 依赖,可独立测试)
lib/client.js         浏览器 bundle:状态条 + 全屏宠物拦截(手写 ModuleLoader 格式)
                      宠物为内嵌 SVG 矢量插画(渐变毛色/高光/护士帽+爱心主题,
                      打盹/担忧/拦路(深夜睡觉版/白天走走版)/放行,零外部资源)
tools/render-pets.mjs 开发工具:把四个宠物 SVG 渲染成 PNG 并做结构分析
test/                 node:test 单元/集成/冒烟测试
  • GET /prevent-scd/state.json — 状态快照(浏览器每 15 秒轮询)
  • POST /prevent-scd/ack — { "kind": "rest" | "snooze" } 用户回应

改宠物美术:lib/client.js 里的 PET_SLEEP / PET_WORRY / PET_ANGRY_SLEEP / PET_ANGRY_MOVE / PET_HAPPY 五个 SVG 字符串,改完用 node tools/render-pets.mjs tools/art 渲染预览,再刷新浏览器即可(客户端 bundle 是运行时从插件目录读取的,无需重启 dsh)。

测试

pnpm test    # 或 node --test-force-exit test/tracker.test.js 等

License

MIT

原始 README: https://github.com/Codingendless/dsh-prevent-scd/blob/main/README.md ↗

同类插件

查看全部 →
通知与集成alvinunreal

dsh

将 DeepSeek Harness 的生命周期状态、错误与审批请求,桥接到本地运行的 OpenPets 桌面伙伴。

查看详情
1081github+08-21
通知与集成tencent-connect

dsh-qqbot

让 QQ Bot 接入 DeepSeek Harness(dsh)的官方插件

查看详情
55github+08-17
通知与集成omdsh-dev

dsh-open-in-vscode

从 Web GUI 一键在 VS Code 中打开工作区目录。

查看详情
39github+08-13
通知与集成omdsh-dev

dsh-notification

回合完成桌面通知,按结果分控 + 关键词过滤。

查看详情
38github+08-13
通知与集成THEWOLFWALKER

dsh-notifier

DSH 统一通知推送与远程控制:一个 `notify()` API 打通 25+ 渠道(Telegram / 钉钉 / 飞书 / 企业微信 / QQ 机器人 / WxPusher / PushPlus / Server 酱 / Bark / Discord / Slack / ntfy / webhook 等),timeSensitive / active / passive 分级路由并重试;五通道反向审批(Telegram 按钮 / 飞书卡片 / QQ / WxPusher / 微信 iLink);QQ/钉钉/飞书官方扫码登录;本地 Web 管理台;多 agent 路由;系统桌面通知——以及**手机指挥中心**:在手机上发 `!status` / `!stop` / `!retry` 遥控 agent,通知带可操作按钮(查看结果 / 重试 / 日志,点击回调 agent)。密钥脱敏、工具限流、零运行时依赖。

查看详情
27github+08-16
通知与集成wzj998

chatccc

飞书(Lark)或微信(WeChat)聊天控制 DeepSeek Harness / Claude Code / Cursor / Codex / CCC Agent

查看详情
22github+08-23