Expand description
Daemon client mode — connects to the infinity daemon over a unix socket (or in-memory channels) and bridges the protocol messages to the terminal.
Functions§
- ensure_
daemon_ running - launch_
daemon - Launch the daemon as a background process and wait until it prints its ready line on stdout. If the daemon exits first (e.g. a configuration error), the error includes everything it printed to stdout/stderr, which would otherwise be invisible for a detached process.
- restart_
daemon - Restart the daemon: stop the running instance (if any), then launch a fresh one.
- run_
client - Core client logic — works with channels regardless of transport, and any terminal implementation. Production wrappers pass the crossterm-backed terminal and the process cwd; tests substitute a virtual terminal, scripted events, and a temp cwd.
- run_
headless - Send a task to the daemon and exit without opening the TUI.
- run_
in_ memory - Run in-memory mode — no serialization, direct channel passing.
- run_
with_ daemon - Connect to the daemon over a unix socket (serialized framing).
- running_
daemon_ pid - Returns the pid of the running daemon, or
Noneif it is not running. Probes the pid recorded in the pid file with signal 0: onlyESRCH(no such process) is treated as not running, so a stale pid file (e.g. left behind by a crash) is detected while an unsignalable-but-alive process (EPERM) is not misreported as stopped. Pid reuse is an accepted risk: the daemon removes its pid file on clean shutdown, and both the file and the daemon are per-user. - stop_
daemon - Stop the running daemon: send SIGTERM and wait for the process to fully
exit (so its shutdown cleanup of the socket and pid files completes).
Returns
Ok(Some(pid))if a daemon was stopped,Ok(None)if no daemon is running.