Skip to main content

Module worktrees

Module worktrees 

Source
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§

WorktreesService
Hosts the cross-window WorktreesRegistry as a DaemonService.

Constants§

SERVICE_NAME
The worktrees service name (the control-socket routing key).