Expand description
Shared XDG path helpers (D18).
Every binary in the workspace (CLI, MCP, server) walks the same path
precedence to find on-disk state: explicit env override first, then
$XDG_CONFIG_HOME/midnight-manual/, then $HOME/.config/midnight-manual/.
These helpers consolidate that walk so the CLI commands, the MCP server,
and tests all agree on where files live.
Each helper takes a crate::config::ConfigEnv so tests can drive the
resolver with a fake environment.
Files this module resolves:
auth.toml— bearer / JWT store (seecrate::auth_file).keys/<user_id>.private— Ed25519 signing-key seed formnm login.users.toml— local user-store (CLI mutates; server reads as TOML body via env per FR-057, not as a path).
Functions§
- auth_
file_ path - Resolve the auth-file path (
<config_home>/auth.toml). - config_
home - Resolve the on-disk directory that holds CLI / server state.
- keys_
dir - Resolve the keypair-storage directory (
<config_home>/keys/). - private_
key_ path - Resolve the on-disk path to a user’s signing-key seed
(
<config_home>/keys/<user_id>.private). - telemetry_
marker_ path - Resolve the persistent telemetry-opt-out marker path.
- user_
store_ path - Resolve the user-store path on the CLI side.