feat: surface pending matrix invites in get_loose_ends
Write mcp-loose-ends/matrix.json on invite arrival (before wake) and after join_room clears an invite. The harness scans mcp-loose-ends/ generically in get_loose_ends, so pending invites are visible there without any harness-side changes. - paths: add mcp_loose_ends_dir() (mirrors hive-bash-mcp pattern) - handlers: add refresh_invite_loose_ends() — atomic tmp+rename write - handlers: join_room calls refresh after successful join to clear entry - timeline: install_invite_handler refreshes loose-ends before wake
This commit is contained in:
parent
06b4745d76
commit
4fbe9e4927
3 changed files with 75 additions and 5 deletions
|
|
@ -66,3 +66,25 @@ pub fn hyperhive_socket() -> PathBuf {
|
|||
std::env::var_os("HIVE_CONTROL_SOCKET")
|
||||
.map_or_else(|| PathBuf::from("/run/hive/mcp.sock"), PathBuf::from)
|
||||
}
|
||||
|
||||
/// Directory where MCP daemons write loose-end summary files for the harness.
|
||||
/// Each daemon writes `<name>.json` here; the harness scans the dir in
|
||||
/// `get_loose_ends` to surface active work from all MCPs generically.
|
||||
///
|
||||
/// NOTE: the base-dir resolution logic here is intentionally mirrored in
|
||||
/// `hive-ag3nt/src/mcp_loose_ends.rs::loose_ends_dir()`. They can't share
|
||||
/// code across crates — keep them in sync if the fallback logic changes.
|
||||
#[must_use]
|
||||
pub fn mcp_loose_ends_dir() -> PathBuf {
|
||||
let base = if let Some(p) = std::env::var_os("HYPERHIVE_HARNESS_DIR") {
|
||||
PathBuf::from(p)
|
||||
} else {
|
||||
let state = std::env::var("HYPERHIVE_STATE_DIR").unwrap_or_default();
|
||||
let state_path = PathBuf::from(&state);
|
||||
state_path
|
||||
.parent()
|
||||
.map(|p| p.join("harness"))
|
||||
.unwrap_or_else(|| PathBuf::from(state))
|
||||
};
|
||||
base.join("mcp-loose-ends")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue