Expand description
Centralized platform-aware path helpers for Perspt.
Three-tier model:
- Config:
dirs::config_dir()/perspt/— config.toml, policy rules - Data:
dirs::data_local_dir()/perspt/— perspt.db - Project:
<working_dir>/.perspt/— sandboxes, scratch state
Functions§
- check_
legacy_ migration - Check for legacy paths and log migration warnings.
- config_
dir - Platform config directory:
~/.config/perspt/(Linux) or~/Library/Application Support/perspt/(macOS). - config_
file - Path to the main configuration file:
<config_dir>/config.toml. - data_
dir - Platform data directory:
~/.local/share/perspt/(Linux) or~/Library/Application Support/perspt/(macOS). - database_
path - Path to the DuckDB database file:
<data_dir>/perspt.db. - legacy_
dir - Returns the legacy
~/.persptdirectory if it exists on disk. - policy_
dir - Path to the policy rules directory:
<config_dir>/rules/. - resolve_
config_ file - Resolve the config file path, falling back to legacy
~/.perspt/config.tomlif the platform path doesn’t exist yet. - resolve_
policy_ dir - Resolve the policy directory, falling back to legacy
~/.perspt/rules/if the platform path doesn’t exist yet.