systemprompt-models 0.6.1

Foundation data models for systemprompt.io AI governance infrastructure. Shared DTOs, config, and domain types consumed by every layer of the MCP governance pipeline.
Documentation
//! `paths` module — see crate-level docs for context.

mod build;
pub mod constants;
mod error;
mod storage;
mod system;
mod web;

pub use build::BuildPaths;
pub use constants::{cloud_container, dir_names, file_names};
pub use error::PathError;
pub use storage::StoragePaths;
pub use system::SystemPaths;
pub use web::WebPaths;

use std::path::Path;

use crate::profile::PathsConfig;
use systemprompt_extension::AssetPaths;

#[derive(Debug, Clone)]
pub struct AppPaths {
    system: SystemPaths,
    web: WebPaths,
    build: BuildPaths,
    storage: StoragePaths,
}

impl AppPaths {
    pub fn from_profile(paths: &PathsConfig) -> Result<Self, PathError> {
        Ok(Self {
            system: SystemPaths::from_profile(paths)?,
            web: WebPaths::from_profile(paths),
            build: BuildPaths::from_profile(paths),
            storage: StoragePaths::from_profile(paths)?,
        })
    }

    pub const fn system(&self) -> &SystemPaths {
        &self.system
    }

    pub const fn web(&self) -> &WebPaths {
        &self.web
    }

    pub const fn build(&self) -> &BuildPaths {
        &self.build
    }

    pub const fn storage(&self) -> &StoragePaths {
        &self.storage
    }
}

impl AssetPaths for AppPaths {
    fn storage_files(&self) -> &Path {
        self.storage.files()
    }

    fn web_dist(&self) -> &Path {
        self.web.dist()
    }
}