1use std::path::{Path, PathBuf};
8
9#[derive(Debug, Clone)]
11pub struct Paths {
12 pub root: PathBuf,
13}
14
15impl Paths {
16 #[must_use]
17 pub fn at(root: impl Into<PathBuf>) -> Self {
18 Self { root: root.into() }
19 }
20
21 #[must_use]
24 pub fn home() -> Self {
25 let root = std::env::var_os("HOME").map_or_else(
26 || PathBuf::from(".vibesurfer"),
27 |h| Path::new(&h).join(".vibesurfer"),
28 );
29 Self::at(root)
30 }
31
32 #[must_use]
33 pub fn socket(&self) -> PathBuf {
34 self.root.join("daemon.sock")
35 }
36
37 #[must_use]
38 pub fn active_session(&self) -> PathBuf {
39 self.root.join("active-session")
40 }
41}