Skip to main content

walrus_core/
paths.rs

1//! Global paths for the walrus runtime.
2//!
3//! All crates resolve configuration, socket, and data paths through these
4//! constants so there is a single source of truth.
5
6use std::path::PathBuf;
7use std::sync::LazyLock;
8
9/// Global configuration directory (`~/.openwalrus/`).
10pub static CONFIG_DIR: LazyLock<PathBuf> = LazyLock::new(|| {
11    dirs::home_dir()
12        .expect("no home directory")
13        .join(".openwalrus")
14});
15
16/// Pinned socket path (`~/.openwalrus/walrus.sock`).
17pub static SOCKET_PATH: LazyLock<PathBuf> = LazyLock::new(|| CONFIG_DIR.join("walrus.sock"));
18
19/// Agents subdirectory (contains *.md files).
20pub const AGENTS_DIR: &str = "agents";
21/// Skills subdirectory.
22pub const SKILLS_DIR: &str = "skills";
23/// Data subdirectory.
24pub const DATA_DIR: &str = "data";
25
26/// SQLite memory database filename.
27pub const MEMORY_DB: &str = "memory.db";