resolve_shared_registry_dir

Function resolve_shared_registry_dir 

Source
pub fn resolve_shared_registry_dir() -> Option<PathBuf>
Expand description

Resolve <shared_home>/agents/registry/.

The registry is shared across every portable/installed version on the same machine — it must NOT use the per-version data dir.

Resolution order:

  1. AGENTMUX_HOME_OVERRIDE — test-only escape hatch, matching agentmux-common::data_paths convention.
  2. Walk up from AGENTMUX_DATA_DIR (per-version data dir set by the launcher) by three levels: data → versions/<v> → versions → <shared_home>. Robust against the launcher running without a real home dir (CI).
  3. Fall back to ~/.agentmux/.

Returns None only if every source fails — caller treats this as “registry disabled,” no write attempts.