//! # Daemon Interface //! //! Background process that owns agent state and communicates with TUI //! clients over a Unix-socket IPC protocol. //! //! ## Architecture //! //! ```text //! src/ //! ├── lib.rs — Crate root, module declarations, re-exports //! ├── server.rs — Daemon server: session creation, socket bind, client loop //! ├── client.rs — IPC client for attaching to daemon (moved from attach mode) //! ├── key_code.rs — KeyCode <-> KeyAction conversions //! ├── state.rs — AppStateRest, DaemonState, supporting types, create_session //! └── handler.rs — Action, apply_action, handle_key, IPC request handler //! ``` //! //! ## Modes //! //! - **Server** (`run_daemon`): creates a session, binds a Unix socket, accepts //! incoming clients, and processes their IPC `ClientRequest`s. //! - **Client** (`run_attach`): connects to a running daemon over its Unix socket, //! enters raw TUI mode, forwards keystrokes, and renders state updates. pub mod client; pub mod handler; pub mod key_code; pub mod server; pub mod state; // Re-export key types for convenience. pub use handler::{apply_action, Action}; pub use state::{AppStateRest, DaemonState, Overlay};