- Home
- Plugin
- Strumenti e capacità
- dsh-power-off
Y
dsh-power-off
yiguln/dsh-power-off
A power button in the DSH composer toolbar: arm it and DSH shuts down the Windows PC once every session in the batch goes idle, with a cancellable countdown. It only fires after it actually saw a task run, a new task during the countdown cancels the shutdown, and with the default onlyOnSuccess no shutdown happens when any session in the batch errored. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Installazione
dsh plugin --profile web add github:yiguln/dsh-power-offREADME
dsh-power-off
在 DSH 会话输入栏工具栏「AI 控制电脑」右侧新增一个电源图标按钮:激活后持续监听当前会话的任务进度,任务全部完成时自动关闭电脑,带倒计时与一键取消。
安装
从插件市场安装(推荐):DSH → 插件 → 发现,搜索 dsh-power-off,点安装。
命令行从 GitHub 安装:
dsh plugin add github:YIGULN/dsh-power-off
本地目录安装:
plugin_manager install_bundle target=<本包目录的绝对路径>
安装后对所有会话生效,重启 DSH 后仍在。
用法
- 点电源按钮 → 图标点亮为绿色(已激活)。
- 插件持续监听当前会话的任务进度;任务全部完成(所有会话回到空闲)后,开始倒计时并执行
shutdown /s /t <sec>。 - 倒计时内或任务完成前再次点击 → 取消自动关机,图标恢复为未激活,关机绝不触发。
状态
| 状态 | 视觉 | 含义 |
|---|---|---|
| 未激活 | 低亮、低饱和 | 默认;点一下激活 |
| 已激活 | 绿色 + 柔和光晕 | 监听任务,完成后关机 |
| 关机执行中 | 绿色脉冲 | 倒计时中;悬浮显示剩余秒数,点一下取消 |
| 已取消 | 短暂琥珀色闪烁 | 已撤销,回到未激活 |
安全设计
- 仅在「已激活 且 确有任务跑过 且 全部会话空闲 且(无错误或允许出错时关机)」时才关机;激活时没有任务在跑绝不会立即关机。
- 倒计时中若又有新任务开始,自动撤消系统关机(保持激活,等下次完成)。
- 取消时执行
shutdown /a撤销系统定时器。 - 激活状态持久化到
$DSH_HOME/dsh-power-off.json,切换/重载会话、重启 DSH 后保持一致。 - 变更接口(激活/取消)仅接受同源(loopback)请求。
- 任何异常路径(无任务、任务出错、被中断)都不会误触发关机。
配置
| 键 | 范围 | 默认 | 说明 |
|---|---|---|---|
countdownSec | 10–600 | 60 | 倒计时秒数 |
marginSec | 0–60 | 5 | 倒计时之外额外给系统的余量秒数 |
onlyOnSuccess | bool | true | 仅在本批次无会话出错时才关机 |
仅支持 Windows(调用 shutdown.exe);其他平台为惰性,不执行关机。
结构
index.js— host 半:状态机 + 事件监听 +shutdown执行 + HTTP 路由 + 状态持久化client.js— client 半:conversation.input.leftslot 注入电源按钮,轮询 host 状态cordis.patch.yml— bundle 补丁(向 profile 插入插件行)locale/{en,zh}.json— 插件详情页元数据docs/DETAIL.md、docs/DETAIL.zh.md— 插件市场详情文档icon.svg— 插件图标
Plugin correlati
T
archify (deepseek-harness)
tt-a1i/archify
101.4k9 ore faStrumenti e capacitàApache-2.0
T
WeKnora (dsh-weknora)
tencent/weknora
38.4k3 giorni faStrumenti e capacità
D
next-ai-draw-io (dsh-plugin)
dayuanjiang/next-ai-draw-io
37.2k18 ore faStrumenti e capacitàApache-2.0
Y
AiToEarn (dsh-plugin-aitoearn)
yikart/aitoearn
28.9kl’altro ieriStrumenti e capacitàMIT