PowerNAP is a macOS Swift package. Contributions should keep the local-only safety contract intact: PowerNAP may keep a Mac awake only while protected work is active, and it must release power state when work stops, waits, or becomes unsafe.
Requirements:
- macOS 13 or later.
- Xcode Command Line Tools.
- Swift Package Manager.
Build and test:
swift test
swift build -c release
bash -n scripts/install.sh scripts/uninstall.shRun the non-invasive local diagnostic after installing:
powernap doctor --check-timeout-seconds 2Only run closed-lid tests on hardware after:
powernap doctor --hardware-spike- Keep hooks fail-open: hook failures must not block Codex or Claude Code.
- Keep hook stdout empty unless an agent integration explicitly requires output.
- Treat hook payloads as untrusted input.
- Do not log prompts, model output, API request bodies, credentials, or raw hook JSON by default.
- Preserve existing Codex/Claude user configuration when installing or uninstalling hooks.
- Add or update tests for config parsing, IPC, lease lifecycle, hook mapping, and state restoration changes.
- Update docs when behavior, safety assumptions, install paths, or release gates change.
swift testpasses.swift build -c releasepasses.- Shell scripts pass
bash -n. - User-facing commands and docs match.
- Power, hook, install, and menu bar behavior should have a clear manual verification path in the relevant user-facing docs.