- TypeScript 98.6%
- JavaScript 1.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Named Koffi types are process-global; re-evaluating this module after /reload previously collided on sd_bus_error. |
||
| test | ||
| .gitignore | ||
| index.ts | ||
| LICENSE | ||
| lifecycle.ts | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| systemd.ts | ||
| tsconfig.json | ||
pi-sleep-inhibitor
Pi extension that prevents system sleep while Pi is processing an agent run. It
acquires a blocking sleep inhibitor at agent_start, then releases it at
agent_settled or session_shutdown.
Requirements
- Linux with systemd-logind and its system D-Bus available.
- The normal user-session permission to call
org.freedesktop.login1.Manager.Inhibit; no elevated permissions are used.
The extension calls logind directly through libsystemd's sd-bus API using the
runtime dependency Koffi. It does not spawn
systemd-inhibit, busctl, or a helper process.
Installation
Install it as a Pi package; for example, from a checked-out copy:
pi install /path/to/pi-sleep-inhibitor
Restart Pi after installation. This README deliberately does not install the package for you.
Behavior
Each running Pi session independently holds its own inhibitor, so concurrent sessions remain protected until each one settles. On unsupported systems or when logind denies access, Pi continues normally and the extension shows at most one warning per session.
Inspect active inhibitors with:
systemd-inhibit --list
Look for an entry with WHO set to Pi and WHY set to Model turn in progress.