feat(#1137): rich unread summary in loose ends and wake signal

- hive-sh4re: UnreadMatrix gains summary: String field (per-room breakdown)
- hive-matrix-mcp/protocol: add RoomUnread struct + UnreadSummary request
- hive-matrix-mcp/handlers: collect_unread() fetches per-room data;
  single-unread rooms include truncated last-message body + sender;
  multi-unread rooms carry count only
- hive-matrix-mcp/wake: format_unread_summary() builds wake body from
  RoomUnread slice; terse one-liner for single-room/single-message,
  bulleted list for multi-room; always appends read-hint
- hive-matrix-mcp/timeline: wake body now covers all rooms with unread
  at fire time, not just the triggering event; falls back to per-event
  teaser if notification counts haven't updated yet
- hive-ag3nt/mcp: matrix_unread_summary() replaces matrix_unread_rooms();
  UnreadMatrix loose end carries per-room summary lines; render shows
  room breakdown with sender: body for single-unread rooms
This commit is contained in:
atlas 2026-06-03 12:52:24 +02:00
commit 68e30b857c
19 changed files with 421 additions and 108 deletions

View file

@ -121,7 +121,11 @@ pub enum MessageEvent {
/// `recv_blocking_batch` for the target agent but is not stored,
/// not re-delivered on restart, and not shown in message history.
/// Used for bash task completion notifications.
Ping { to: String, from: String, body: String },
Ping {
to: String,
from: String,
body: String,
},
}
/// Per-recipient in-memory bookkeeping for the deliver-then-ack
@ -423,11 +427,7 @@ impl Broker {
// Transient ping — not sqlite-backed. Return it directly as
// a Delivery with id=0 (sentinel: never pushed to unacked_ids
// so ack_turn silently ignores it).
Ok(Ok(MessageEvent::Ping {
to,
from,
body,
})) if to == recipient => {
Ok(Ok(MessageEvent::Ping { to, from, body })) if to == recipient => {
// Also drain any real sqlite messages that may have landed
// concurrently; prepend the ping so the agent sees both.
let mut batch = self.recv_batch(recipient, max.saturating_sub(1))?;