winx_code_agent/daemon/
mod.rs1mod client;
4mod control;
5mod protocol;
6mod server;
7
8use std::path::PathBuf;
9
10pub use client::{DaemonClient, DaemonShellRuntime};
11pub use control::ControlServer;
12pub use protocol::{
13 HelloResult, JournalRead, SessionInfo, MAX_FRAME_BYTES, PROTOCOL_MAJOR, PROTOCOL_MINOR,
14};
15pub use server::DaemonServer;
16
17pub fn default_socket_path() -> PathBuf {
19 if let Some(path) = std::env::var_os("WINX_SOCKET") {
20 return PathBuf::from(path);
21 }
22 if let Some(runtime_dir) = std::env::var_os("XDG_RUNTIME_DIR") {
23 return PathBuf::from(runtime_dir).join("winx/winxd.sock");
24 }
25 PathBuf::from(format!("/tmp/winx-{}/winxd.sock", unsafe { libc::geteuid() }))
27}