dsh-mac-keep-awake

仅 macOS:任意 DSH 会话运行期间持有 PreventUserIdleSystemSleep 断言(caffeinate -i -w <宿主 pid>),最后一个会话结束后释放,长时间回合不会因空闲休眠被切断;屏幕仍可正常息屏。它会一直持有跨过 maintenance 阶段——该阶段 Agent.status 报 idle 而手动 /compact 正在跑,靠 compaction/start 与 compaction/end 事件兜住。每 60 秒与 ctx.agents.list() 对账,插件热重载时已在运行的会话立即被接管,不必等到下一个回合边界。持有失败按指数退避重试、上限 60 秒且永不放弃;释放时先 SIGTERM,2 秒未退出升级 SIGKILL;带 -w,宿主崩溃时 caffeinate 自行退出。无前端半身,通过 profile patch 配置。共 51 个测试,其中 2 个在真机上直接读 pmset -g assertions。

插件介绍

仅 macOS:任意 DSH 会话运行期间持有 PreventUserIdleSystemSleep 断言(caffeinate -i -w <宿主 pid>),最后一个会话结束后释放,长时间回合不会因空闲休眠被切断;屏幕仍可正常息屏。它会一直持有跨过 maintenance 阶段——该阶段 Agent.status 报 idle 而手动 /compact 正在跑,靠 compaction/start 与 compaction/end 事件兜住。每 60 秒与 ctx.agents.list() 对账,插件热重载时已在运行的会话立即被接管,不必等到下一个回合边界。持有失败按指数退避重试、上限 60 秒且永不放弃;释放时先 SIGTERM,2 秒未退出升级 SIGKILL;带 -w,宿主崩溃时 caffeinate 自行退出。无前端半身,通过 profile patch 配置。共 51 个测试,其中 2 个在真机上直接读 pmset -g assertions。

安装方式

通过 npm 安装

dsh plugin --profile web add dsh-mac-keep-awake

Resolves a published tarball rather than cloning the repository, and installs without any extra setup. Swap `web` for your profile name if you run another one.

从 GitHub 安装

dsh plugin --profile web add github:wjvalue/dsh-mac-keep-awake

Installing from GitHub runs the project's build script, which pnpm blocks until you allowlist it — run the command once and pnpm prints the exact key to add under `allowBuilds` in ~/.dsh/profiles/web/pnpm-workspace.yaml.

版本兼容情况

兼容性待确认。可前往项目文档查看支持版本。

安装提示

  • 可能调用终端命令