Add internal/control: an HTTP/1.1 control plane the daemon hosts on a 0600 Unix socket (control.sock) in the config dir — GET /state, GET /events (SSE), POST /pause|/resume — plus a stdlib net/http client (DialState/Pause/Resume) that returns a typed ErrNotRunning when the daemon is down so callers can fall back. Wire into the daemon: paused atomic.Bool gates runMount's trigger loop (drains while paused, no-ops the initial nudge), a per-mount nudge registry lets Resume catch every mount up, and StateSnapshot feeds /state. The control server starts in Run and is non-fatal — sync never depends on it. Windows gets a build-tagged stub (named-pipe upgrade path noted). CLI: devbox pause/resume call the client (friendly 'daemon not running' when absent); status prefers the live socket but ONLY on a TTY, so piped output stays byte-identical to v1 for scripts. |
||
|---|---|---|
| .. | ||
| backoff.go | ||
| backoff_test.go | ||
| daemon.go | ||
| daemon_test.go | ||
| pause_test.go | ||