Expand description
The worktrees daemon service.
A thin adapter that hosts the cross-window WorktreesRegistry under the
daemon’s lifecycle and exposes register/heartbeat/unregister/list over the
control socket, plus a tray submenu with a per-window “focus” action.
All registry state and liveness logic (the Mutex<HashMap>, TTL reaping, the
entry cap/eviction) lives in crate::worktrees; this adapter only routes
ops, renders the menu/status, and drives the VS Code launcher. Like the
Snowflake service it is a cheap, in-memory adapter — no async setup, no
secret persisted.
The adapter also computes the per-worktree git enrichment (current
branch, ahead/behind counts) on read via git2 (#1186), keeping the
companion a thin reporter of raw folder paths (ADR-0040). The engine stores
only what the companion sends; disk I/O for the enrichment lives here,
alongside the launcher, never under the registry lock.
Structs§
- Worktrees
Service - Hosts the cross-window
WorktreesRegistryas aDaemonService.
Constants§
- SERVICE_
NAME - The worktrees service name (the control-socket routing key).