Skip to main content

Module data_dir

Module data_dir 

Source
Expand description

Compatibility shim around agentmux_common::DataPaths.

Historically the launcher computed its own paths via the launcher-local resolve_paths() function. After the data-dir unification (see docs/specs/archive/SPEC_DATA_DIR_UNIFICATION_2026-05-05.md and PR #695), path resolution is centralized in agentmux_common::DataPaths. This module keeps the launcher’s existing public API surface (DataPaths struct with 4 fields, resolve_paths(), ensure_dirs()) so call sites in main.rs, diag.rs, srv_spawner.rs etc. don’t need to be rewritten — they see the same shape, populated from the common implementation.

Field mapping:

  • launcher.data_dir = common.data_dir
  • launcher.config_dir = common.config_dir
  • launcher.user_home_dir = common.home_dir (the agentmux root, e.g. ~/.agentmux/, where config.toml lives)
  • launcher.portable_root = exe_dir when mode == Portable, else None

The launcher continues to use these field names internally; the env vars it passes to host + srv are switched in main.rs to the canonical AGENTMUX_* names emitted by DataPaths::to_env_vars.

Structs§

DataPaths
Resolved per-instance paths. Compat shape — see module doc.

Functions§

copy_dir_recursive 🔒
ensure_dirs
Create every directory the launcher + srv expect to exist. Idempotent. Delegates to the common implementation.
migrate_legacy_data_dir 🔒
One-time migration: copy channels/<ch>/data/db/ into the new channels/<ch>/versions/<v>/data/db/ when: (a) the new versioned db dir has no DB files yet, AND (b) the old unversioned db dir does exist (pre-Phase-2 install).
resolve_paths
Resolve all paths from the launcher’s vantage point.