Skip to main content

Module daemon

Module daemon 

Source
Expand description

The extensible omni-dev daemon: a long-lived supervisor that hosts pluggable DaemonServices over a local Unix-domain control socket.

The daemon owns lifecycle, single-instance supervision, status aggregation, and (on macOS) the menu-bar shell. Each service wraps its own work and exposes status/control; the browser bridge is the first such service (#987). The control socket is a private operator/tray channel — it does not carry any service’s own data plane (e.g. the bridge keeps its loopback-TCP planes per ADR-0036). See ADR-0039.

Process model:

  • daemon run becomes the daemon (server::run), blocking until a signal or a built-in shutdown op.
  • daemon start launches it in the background (a launchd LaunchAgent on macOS, a systemd user unit on Linux); stop / restart / status are thin client::DaemonClients.

Modules§

client
DaemonClient: a thin client for the daemon’s Unix control socket, used by daemon status / stop / restart and the single-instance ping probe.
lifecycle
Process-lifecycle wiring: translate OS termination signals into a graceful shutdown of the daemon’s CancellationToken.
paths
Per-user runtime paths for the daemon (control socket, token file) and the filesystem-permission helpers that keep them owner-private.
protocol
Wire types for the daemon’s Unix-domain control socket.
registry
The ServiceRegistry: the daemon’s set of hosted services, plus routing.
server
The daemon server core: bind the control socket, accept NDJSON connections, route envelopes to services (or built-in ops), and shut down gracefully.
service
The DaemonService abstraction: a pluggable unit of work hosted by the daemon supervisor.
services
Built-in daemon services.
single_instance
Single-instance supervision: the exclusive socket bind is the lock.
systemd
Linux systemd user-unit integration for omni-dev daemon start / stop and socket activation — the Linux mirror of the macOS launchd module.

Structs§

DaemonRunConfig
Everything daemon run needs to start the daemon, resolved from the CLI.

Functions§

build_default_registry
Builds the daemon’s default service registry: starts the browser bridge on its loopback-TCP planes and registers it alongside the Snowflake query service and the cross-window worktrees registry.
run_headless
Runs the daemon headlessly (no tray).