paths
paths
¶
Platform-aware path resolution for sandbox directories.
Vendored from core.paths — zero internal dependencies. Provides
the same XDG / FHS resolution logic so that terok-sandbox works
identically whether embedded in terok or used standalone.
config_root()
¶
Base directory for configuration.
Priority: TEROK_SANDBOX_CONFIG_DIR → /etc/terok/sandbox (root)
→ ~/.config/terok/sandbox.
Source code in src/terok_sandbox/paths.py
state_root()
¶
Writable state root (tasks, tokens, caches).
Priority: TEROK_SANDBOX_STATE_DIR → /var/lib/terok/sandbox (root)
→ ~/.local/share/terok/sandbox.
Source code in src/terok_sandbox/paths.py
runtime_root()
¶
Transient runtime directory (PID files, sockets).
Priority: TEROK_SANDBOX_RUNTIME_DIR → /run/terok/sandbox (root) →
$XDG_RUNTIME_DIR/terok/sandbox → $XDG_STATE_HOME/terok/sandbox →
~/.local/state/terok/sandbox.
Source code in src/terok_sandbox/paths.py
credentials_root()
¶
Shared credentials directory used by all terok ecosystem packages.
Priority: TEROK_CREDENTIALS_DIR → /var/lib/terok/credentials (root)
→ XDG data dir.
Source code in src/terok_sandbox/paths.py
umbrella_config_root()
¶
Return the top-level terok config root (umbrella, not sandbox-scoped).
Used for cross-package paths like shield profiles that live under
the shared ~/.config/terok/ umbrella rather than under any single
package's config directory.