use std::path::{Path, PathBuf};
#[derive(Debug, Clone)]
pub struct Paths {
pub root: PathBuf,
}
impl Paths {
#[must_use]
pub fn at(root: impl Into<PathBuf>) -> Self {
Self { root: root.into() }
}
#[must_use]
pub fn home() -> Self {
let root = std::env::var_os("HOME").map_or_else(
|| PathBuf::from(".vibesurfer"),
|h| Path::new(&h).join(".vibesurfer"),
);
Self::at(root)
}
#[must_use]
pub fn socket(&self) -> PathBuf {
self.root.join("daemon.sock")
}
#[must_use]
pub fn active_session(&self) -> PathBuf {
self.root.join("active-session")
}
#[must_use]
pub fn caller_session(&self, caller_key: &str) -> PathBuf {
self.root.join("callers").join(caller_key)
}
}