Add agent-night-watch extension - #30185
Conversation
- fix: make Skill preflight portable - feat: publish Agent Night Watch extension and skill
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
Greptile SummaryThe PR adds the Agent Night Watch extension for manually controlling macOS closed-lid sleep.
Confidence Score: 5/5The PR appears safe to merge because the previously reported privileged-path and symlink-write vulnerabilities are no longer present and no blocking failure remains. No blocking failure remains. Important Files Changed
Reviews (5): Last reviewed commit: "fix: harden privileged guard execution" | Re-trigger Greptile |
| /bin/echo "$original_state" > "$ORIGINAL_FILE" | ||
| /usr/bin/pmset -a disablesleep 1 >/dev/null | ||
| sleep_is_disabled || exit 1 | ||
| /usr/bin/touch "$READY_FILE" |
There was a problem hiding this comment.
Root follows user-controlled symlinks
When another user-level process substitutes original, ready, reason, or stopped with a symlink, the root guard follows it during redirection or touch, modifying a protected target and causing system-file corruption or local privilege escalation. How this was verified: The root-executed guard writes predictable names inside a session directory that remains owned and writable by the invoking user, without securely creating or rejecting symlinks.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/agent-night-watch/assets/night-watch-guard.sh
Line: 38-41
Comment:
**Root follows user-controlled symlinks**
When another user-level process substitutes `original`, `ready`, `reason`, or `stopped` with a symlink, the root guard follows it during redirection or `touch`, modifying a protected target and causing system-file corruption or local privilege escalation. **How this was verified:** The root-executed guard writes predictable names inside a session directory that remains owned and writable by the invoking user, without securely creating or rejecting symlinks.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.- fix: allow repeated menu bar toggles - feat: toggle directly from menu bar cup
Description
Agent Night Watch adds a manual Raycast menu-bar control for MacBook closed-lid sleep.
SleepDisabled=1; no steam means normal sleep.pmset -ginstead of inferred from a cached PID.SleepDisabledreturned to0.SleepDisabled=1, the extension opens a safety/status menu instead of overriding it.Public commands:
This differs from ordinary
caffeinateextensions: it is specifically designed for the macOS closed-lid sleep setting and usesSleepDisabledas the status truth.Security hardening
/usr/bin/pmset,/usr/bin/grep, and/bin/sleep.pmset -gplus verified launcher identity, and the previous session schema is invalidated.Testing
npm run lint,npm run build, ShellCheck, Skill validation, secret scanning, and high-severity dependency audit pass in public CI.SleepDisabled=0, and no remaining owned session.Screencast
Watch the 36-second interaction screencast
SHA-256:
8a291ad69d0895707a407c3d2ff336044a8d1212d6a19b84fc3e2700d2ce4ed1Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder