pub struct Paths {
pub config_dir: PathBuf,
pub data_dir: PathBuf,
pub workspace: PathBuf,
pub state_dir: PathBuf,
pub cache_dir: PathBuf,
pub runtime_dir: Option<PathBuf>,
}Expand description
Resolved directory paths for the entire application.
Created once at startup, threaded through Config. All paths are absolute.
Fields§
§config_dir: PathBufConfig directory: config.toml lives here
data_dir: PathBufData directory root: contains workspace/ and localgpt.device.key
workspace: PathBufWorkspace: markdown files, knowledge, skills. May be overridden independently via LOCALGPT_WORKSPACE.
state_dir: PathBufState directory: sessions, audit log, logs
cache_dir: PathBufCache directory: search index, embedding models
runtime_dir: Option<PathBuf>Runtime directory: PID file, sockets. None if no suitable runtime directory is available.
Implementations§
Source§impl Paths
impl Paths
Sourcepub fn resolve_with_env<F>(env_fn: F) -> Result<Self>
pub fn resolve_with_env<F>(env_fn: F) -> Result<Self>
Resolve paths with a custom env var lookup (for testing).
Sourcepub fn config_file(&self) -> PathBuf
pub fn config_file(&self) -> PathBuf
Config file: config_dir/config.toml
Sourcepub fn device_key(&self) -> PathBuf
pub fn device_key(&self) -> PathBuf
Device key: data_dir/localgpt.device.key
pub fn last_heartbeat(&self) -> PathBuf
Sourcepub fn search_index(&self, agent_id: &str) -> PathBuf
pub fn search_index(&self, agent_id: &str) -> PathBuf
Search index for a specific agent: cache_dir/memory/{agent_id}.sqlite
Sourcepub fn sessions_dir(&self, agent_id: &str) -> PathBuf
pub fn sessions_dir(&self, agent_id: &str) -> PathBuf
Sessions directory for a specific agent
Sourcepub fn workspace_lock(&self) -> PathBuf
pub fn workspace_lock(&self) -> PathBuf
Workspace lock file
Sourcepub fn pairing_file(&self) -> PathBuf
pub fn pairing_file(&self) -> PathBuf
Telegram pairing file
Sourcepub fn bridge_socket_name(&self) -> String
pub fn bridge_socket_name(&self) -> String
Bridge socket name (Full path on Unix, pipe name on Windows)
Sourcepub fn managed_skills_dir(&self) -> PathBuf
pub fn managed_skills_dir(&self) -> PathBuf
Managed skills directory: data_dir/skills
Sourcepub fn embedding_cache_dir(&self) -> PathBuf
pub fn embedding_cache_dir(&self) -> PathBuf
Embedding cache directory: cache_dir/embeddings
Sourcepub fn from_root(root: impl Into<PathBuf>) -> Self
pub fn from_root(root: impl Into<PathBuf>) -> Self
Create Paths with all directories rooted under a single base path.
Mobile apps use this to point everything at their app-specific document or library directory.
Sourcepub fn ensure_dirs(&self) -> Result<()>
pub fn ensure_dirs(&self) -> Result<()>
Create all directories with appropriate permissions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Paths
impl RefUnwindSafe for Paths
impl Send for Paths
impl Sync for Paths
impl Unpin for Paths
impl UnsafeUnpin for Paths
impl UnwindSafe for Paths
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().