feat(#1134): add unread matrix messages as a loose end
When the local matrix daemon has rooms with unread notifications,
get_loose_ends now prepends an UnreadMatrix entry to the output so
agents see pending matrix activity alongside questions/reminders
without message content being exposed.
Changes:
- hive-sh4re: add LooseEnd::UnreadMatrix { rooms: u32 } variant
- hive-matrix-mcp: add DaemonRequest::UnreadCount and handler that
counts joined rooms with notification_count > 0 (server-side push
notification counts, cached by matrix-sdk)
- hive-ag3nt/mcp: inject UnreadMatrix entry on self-queries by
connecting to /run/hive-matrix/socket (HIVE_MATRIX_SOCKET override);
best-effort — agents without matrix configured are unaffected
This commit is contained in:
parent
1386439591
commit
46edc635f2
5 changed files with 114 additions and 14 deletions
|
|
@ -343,3 +343,17 @@ pub async fn read_room(client: &Client, room_ref: &str, limit: Option<usize>) ->
|
|||
.collect();
|
||||
DaemonResponse::ok(&events)
|
||||
}
|
||||
|
||||
/// Return the number of joined rooms with at least one unread
|
||||
/// notification according to the server-side push notification counts
|
||||
/// cached by the matrix-sdk client. Used by the harness to surface
|
||||
/// unread matrix activity in `get_loose_ends` without exposing
|
||||
/// message content.
|
||||
pub fn unread_count(client: &Client) -> DaemonResponse {
|
||||
let rooms = client
|
||||
.joined_rooms()
|
||||
.into_iter()
|
||||
.filter(|r| r.unread_notification_counts().notification_count > 0)
|
||||
.count() as u32;
|
||||
DaemonResponse::ok(&serde_json::json!({ "rooms": rooms }))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue