feat(wake): node port of wake-drain-claude for Windows / no sqlite3 CLI
wake-drain-claude.sh shells out to the `sqlite3` CLI. It is not installed by default on Windows — the daemon uses `node:sqlite`, not the CLI — so the drain query returns empty, the hook exits 0, and the session is never woken. Native wake silently looks broken on Windows when the cause is only a missing binary. Add `scripts/wake-drain-claude.mjs`, a dependency-free node port that reads the store via `node:sqlite`, so it runs anywhere node does. Same cursor-based dedup and `<system-reminder>`-on-exit-2 contract as the shell version. It also adds a poll mode (default; single-poller lock, bounded by MURMUR_WAKE_MAX_SECONDS): a one-shot Stop hook cannot catch a message that lands while the session is already idle, and polling closes that gap. `--once` keeps the original single-check behaviour for a PostToolUse-style hook. First run establishes a cursor baseline at the current tip so install does not dump history. Verified on Windows 11 / Node 24.13.1: with `sqlite3` absent, the shell version exits 0 (no wake); this port surfaces new inbound rows to stderr and exits 2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
S
Stanislav Glazov committed
46b91575304d3912ef307946cc8b36335c1e6d9c
Parent: 7208903