matrix-accounts dashboard: live status + homeserver from daemon snapshot (be-4)

This commit is contained in:
damocles 2026-06-22 12:42:56 +02:00 committed by mara
commit f38bc13293
5 changed files with 286 additions and 14 deletions

View file

@ -58,6 +58,21 @@ pub fn matrix_state_dir() -> PathBuf {
PathBuf::from(format!("{state_dir}/matrix-sdk-state"))
}
/// Resolve the live-accounts snapshot file the daemon writes after
/// startup restores. Override via `HIVE_MATRIX_ACCOUNTS_FILE`; default
/// is `<HYPERHIVE_STATE_DIR>/matrix-accounts.json` — the host-visible
/// per-agent state dir (sibling to `matrix-token`) that hive-c0re's
/// dashboard reads to backfill live up/down status + the effective
/// homeserver for each provisioned account.
#[must_use]
pub fn accounts_file() -> PathBuf {
if let Some(p) = std::env::var_os("HIVE_MATRIX_ACCOUNTS_FILE") {
return PathBuf::from(p);
}
let state_dir = std::env::var("HYPERHIVE_STATE_DIR").unwrap_or_default();
PathBuf::from(format!("{state_dir}/matrix-accounts.json"))
}
/// Hyperhive control socket — the daemon writes wake signals here so
/// the harness drives a new claude turn on incoming matrix events.
/// Mirrors the path `forge_notify` writes to.