diff --git a/hive-ag3nt/src/mcp.rs b/hive-ag3nt/src/mcp.rs index fb5a1b49..05b189bb 100644 --- a/hive-ag3nt/src/mcp.rs +++ b/hive-ag3nt/src/mcp.rs @@ -58,7 +58,6 @@ pub enum SocketReply { status_set_at: Option, hive_name: Option, swarm_name: Option, - matrix_accounts: Vec, }, /// `create_repo` result — the new repo's full name + clone URL. RepoCreated { @@ -110,7 +109,6 @@ impl From for SocketReply { status_set_at, hive_name, swarm_name, - matrix_accounts, } => Self::AgentMeta { name, running, @@ -119,7 +117,6 @@ impl From for SocketReply { status_set_at, hive_name, swarm_name, - matrix_accounts, }, hive_sh4re::Response::RepoCreated { full_name, @@ -455,7 +452,6 @@ pub fn format_agent_meta(resp: Result) -> String { status_set_at, hive_name, swarm_name, - matrix_accounts, }) => { let rev = hyperhive_rev.as_deref().unwrap_or(""); let run = if running { "yes" } else { "no" }; @@ -502,17 +498,6 @@ pub fn format_agent_meta(resp: Result) -> String { } } } - // Matrix identities the agent can act as (the `account` arg on - // the matrix tools). Listed only when matrix is provisioned, so - // non-matrix agents don't see an empty line. - if !matrix_accounts.is_empty() { - use std::fmt::Write as _; - out.push_str("\nmatrix_accounts:"); - for acct in &matrix_accounts { - let uid = acct.user_id.as_deref().unwrap_or("?"); - let _ = write!(out, "\n {} ({uid}) on {}", acct.name, acct.homeserver); - } - } out } Ok(SocketReply::Err(m)) => format!("get_agent_meta failed: {m}"), diff --git a/hive-c0re/src/socket_server.rs b/hive-c0re/src/socket_server.rs index 75bcf0be..4fcde8c1 100644 --- a/hive-c0re/src/socket_server.rs +++ b/hive-c0re/src/socket_server.rs @@ -417,24 +417,9 @@ async fn handle_get_agent_meta( status_set_at, hive_name, swarm_name, - matrix_accounts: read_agent_matrix_identities(target), } } -/// Read the target agent's matrix identities from the daemon's -/// `matrix-accounts.json` snapshot (under the agent's state dir). -/// Best-effort: an absent / unparseable snapshot (no matrix provisioning, -/// or the daemon not up yet) yields an empty list. The `MatrixIdentity` -/// serde shape matches the snapshot entries; the snapshot's `live` field is -/// ignored (only live accounts are written). -fn read_agent_matrix_identities(agent: &str) -> Vec { - let path = Coordinator::agent_notes_dir(agent).join("matrix-accounts.json"); - std::fs::read_to_string(&path) - .ok() - .and_then(|s| serde_json::from_str::>(&s).ok()) - .unwrap_or_default() -} - /// `Status` — count of pending (unread) inbox messages for `agent`. fn handle_status(coord: &Arc, agent: &str) -> hive_sh4re::Response { match coord.broker.count_pending(agent) { diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index 80d44bc8..155cfd5e 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -845,10 +845,6 @@ pub enum Response { hive_name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] swarm_name: Option, - /// Matrix identities this agent can act as (one per configured + - /// live account). Empty for agents with no matrix provisioning. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - matrix_accounts: Vec, }, /// `GetLogs` result: journal lines for the requested container. /// Returned on the manager socket only. @@ -922,24 +918,6 @@ pub struct AgentStatusRow { pub parent: Option, } -/// One matrix identity an agent can act as, surfaced in `GetAgentMeta`'s -/// `matrix_accounts`. Field names match the daemon's `matrix-accounts.json` -/// snapshot (written by `hive-matrix-mcp`'s account registry) so hive-c0re -/// deserializes the snapshot straight into `Vec`; the -/// snapshot's `live` / `is_primary` fields are ignored here (only live -/// accounts are listed). -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct MatrixIdentity { - /// Logical account name (the `account` arg on the matrix MCP tools). - pub name: String, - /// Matrix user id (`@user:server`). `None` if the session restored - /// without a known user id yet. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub user_id: Option, - /// Homeserver base URL this account is on. - pub homeserver: String, -} - /// Serde default for the `running` field; keeps wire backwards-compat /// with pre-running-field payloads. See /// `docs/conventions.md::Agent metadata`.