Skip to main content

fresh/server/
mod.rs

1//! Server-side implementation for session persistence
2//!
3//! The server runs as a daemon and holds all editor state. Clients connect
4//! via IPC (Unix domain sockets or Windows named pipes) to send input and
5//! receive rendered output.
6//!
7//! ## Architecture
8//!
9//! - **Data socket**: Pure byte stream for stdin/stdout relay (hot path)
10//! - **Control socket**: JSON messages for resize, ping/pong, etc (cold path)
11//!
12//! See `docs/internal/session-persistence-design.md` for full design.
13
14pub mod capture_backend;
15pub mod daemon;
16pub mod editor_server;
17pub mod input_parser;
18pub mod ipc;
19pub mod protocol;
20
21#[cfg(test)]
22mod runner;
23#[cfg(test)]
24mod tests;
25
26pub use capture_backend::{terminal_setup_sequences, terminal_teardown_sequences, CaptureBackend};
27pub use daemon::{
28    daemonize, is_process_running, read_pid_file, spawn_server_detached, write_pid_file,
29};
30pub use editor_server::{EditorServer, EditorServerConfig};
31pub use input_parser::InputParser;
32pub use ipc::{ServerListener, SocketPaths};
33pub use protocol::{ClientHello, ControlMessage, ServerHello, PROTOCOL_VERSION};
34#[cfg(test)]
35pub use runner::{Server, ServerConfig};