dsh-shutdown-idle
Manifest validRuns a chosen power action (shutdown / restart / hibernate / sleep / lock / logoff) once every Agent session and background job has gone idle: the plugin samples in-process sessions once per second, c
dsh-shutdown-idle
DSH 插件:开启后,等所有会话都结束(没有任何 Agent 在跑)并保持空闲,自动执行关机(也可选重启 / 休眠 / 睡眠 / 锁定 / 注销)。
用起来
- 打开「设置 → 会话结束后关机」,点 开启。
- 正常派活给任意会话;所有会话的回合结束后,插件先等
空闲确认秒,再进入倒计时秒。 - 倒计时结束即执行所选动作。期间任何会话重新开始运行,或点界面上的 取消,这次动作都会被撤销。
右上角(浮层右下角)在开启后会常驻一张小卡片,显示当前阶段与剩余秒数,并带「取消」按钮。按住卡片标题即可拖动:松手后位置写进浏览器 localStorage(键 dsh.shutdown-idle.pill.position),下次打开停在原处;拖动过程始终夹在视口内(留 8px 可见),窗口变小也会自动收回视野。从「取消」按钮上按下不会误触发拖动。
判据
- 会话进行中 =
ctx.get('agents').list()里存在status === 'running'的 Agent(与 dshmarket 的更新守卫同一判据)。这一条固定生效,不可关闭。 - 后台任务 =
ctx.get('jobs')中status === 'running'的作业(含各存活会话名下的作业),即 DSH 界面里的「后台任务」;由配置项considerJobs决定是否检测,关掉后完全不再统计。 - 拿不到
agents服务时按 不空闲 处理:宁可不执行,也不误关机。 - 「必须观察到会话运行过」默认开启:刚开启且没有任何任务时不会执行动作。
参数
| 参数 | 默认 | 说明 |
|---|---|---|
| 动作 | shutdown | shutdown / restart / hibernate / sleep / lock / logoff / none(none = 只记录不执行) |
| 空闲确认 | 20 秒 | 全部空闲后先确认这么久,避免回合间隙被误判为结束 |
| 倒计时 | 60 秒 | 可取消的执行前倒计时 |
| 必须观察到会话运行过 | 是 | 防止刚开启就执行 |
后台任务也算占用(considerJobs) | 是 | 关掉后完全不再检测后台任务(shell 作业) |
设置页把这几项收在「什么算『还在忙』」区块里:会话在跑固定算忙,下面两个复选框是配置项。
初始值来自本包 cordis.patch.yml 的行 config;界面改动写入 <DSH_HOME>/dsh-shutdown-idle/settings.json 并优先生效(删除该文件即回落到 patch 初始值)。
开关状态不持久化:宿主重启后一律是「关闭」,避免开机即误关机。
接口
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /dsh-shutdown/api/state | 开关、阶段、倒计时、运行中会话/作业 |
| POST | /dsh-shutdown/api/config | { enabled?, action?, settleSeconds?, countdownSeconds?, requireActivity?, considerJobs? } |
| POST | /dsh-shutdown/api/cancel | 取消倒计时并关闭开关 |
| GET | /dsh-shutdown | 客户端半不可用时的兜底页面 |
平台
动作命令是 Windows 自带的 shutdown / rundll32。非 Windows 平台上,除 none 外的动作会被降级为 none 并在界面标注,不会执行命令。
字段一览
host.v2.mjs— Host 半:状态机、HTTP 接口、命令派发、兜底页面。(host.v1.mjs为上一版,保留以便回滚。)client.js— 浏览器半:设置页分区 +shell.overlay浮层卡片(可拖动,useDraggable负责指针捕获、边界夹取与位置持久化)。cordis.patch.yml— bundle 补丁:插入插件行与初始配置。
升级宿主半代码时换文件名(host.v1.mjs → host.v2.mjs)并同步 package.json 的 main / exports:config-only 热重载不会重新加载同一路径的模块。
Comments
Loading…
Similar plugins
by wjvalue
Keep macOS awake (no idle system sleep) while a DeepSeek Harness session is running · 会话进行时不让 Mac 空闲休眠的 DSH 插件
★ 0
MIT
JavaScript
Oct 4, 2026
dsh plugin --profile web add dsh-mac-keep-awakeby SanYe-SanJiu
Windows-only process control for the harness: a sidebar button that shuts DSH down through the host's own graceful exit path, an app-window / normal-tab switch on the Plugins card that rewrites the de
★ 0
MIT
JavaScript
Sep 24, 2026
dsh plugin --profile web add dsh-power-switchKeeps an unfinished task list visible across turns. DSH clears the todos projection at the start of every turn and expects the model to rewrite the whole list, so when a turn is interrupted the plan i
★ 0
dsh plugin --profile web add dsh-todo-continuityby qingyou002
DSH plugin: hands a long session over to a fresh session in the same workspace on /handoff or at a token threshold, carrying the preset, model, permissions and plan mode across; the brief is written by the session's own model and the switch waits for a step boundary instead of interrupting running work.
★ 0
MIT
TypeScript
Sep 28, 2026
dsh plugin --profile web add dsh-auto-handoffby Meowrium
dsh plugin: auto-continue after quota/rate-limit reset + peak/valley idle-task suspend/resume, with composer toggles and a status line.
★ 0
MIT
JavaScript
Sep 10, 2026
dsh plugin --profile web add dsh-auto-continueCompacts a long session after a configurable idle time when its context exceeds a configurable token threshold, before the provider KV cache expires; both values are set on the plugin's page in the Pl
★ 0
dsh plugin --profile web add dsh-idle-compact