Skip to main content

Module paths

Module paths 

Source
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 (see crate::auth_file).
  • keys/<user_id>.private — Ed25519 signing-key seed for mnm 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.