Skip to main content

Module paths

Module paths 

Source
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 ~/.perspt directory 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.toml if 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.