Skip to main content

state_dir

Function state_dir 

Source
pub fn state_dir() -> Result<PathBuf>
Expand description

Per-platform STATE dir for durable, per-node runtime state: $XDG_STATE_HOME/mcpmesh when that var is set, non-empty, and absolute; otherwise $HOME/.local/state/mcpmesh. Distinct from data_dir() (~/.local/share, XDG_DATA_HOME): the XDG basedir spec places state data (logs, history — the audit JSONL here) under ~/.local/state, separate from portable app data. Mirrors the data_dir() derivation exactly, swapping the var and the .local/state segment. On Windows, %LOCALAPPDATA%\mcpmesh\state (mirrors data_dir()’s Windows branch, state segment).