macro_rules! exe {
($name:literal) => {
if cfg!(windows) {
concat!($name, ".exe")
} else {
$name
}
};
}
pub const EXE_SUFFIX: &str = std::env::consts::EXE_SUFFIX;
pub const CLI_EXE: &str = exe!("allot");
pub const DAEMON_EXE: &str = exe!("allotd");
pub const MCP_EXE: &str = exe!("allot-mcp");
pub const ALLOT_BINARIES: [&str; 3] = [CLI_EXE, DAEMON_EXE, MCP_EXE];
pub const SESSION_ROOTS: &[&str] = &[exe!("claude")];
pub const CONSOLE_HOSTS: &[&str] = if cfg!(windows) { &["conhost.exe"] } else { &[] };
pub const HOME_VAR: &str = if cfg!(windows) { "USERPROFILE" } else { "HOME" };
pub const DATA_DIR_TEXT: &str = if cfg!(windows) {
r"%USERPROFILE%\.allot"
} else {
"~/.allot"
};
pub const DAEMON_LOG_TEXT: &str = if cfg!(windows) {
r"%USERPROFILE%\.allot\logsllotd.log"
} else {
"~/.allot/logs/allotd.log"
};
pub const PATH_STYLE: PathStyle = if cfg!(windows) {
PathStyle::Windows
} else if cfg!(target_os = "macos") {
PathStyle::Macos
} else {
PathStyle::Linux
};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PathStyle {
Windows,
Macos,
Linux,
}
impl PathStyle {
pub const fn ignores_case(self) -> bool {
matches!(self, Self::Windows | Self::Macos)
}
}