feat(matrix mcp): add resolve_invite tool to accept or reject pending invites

This commit is contained in:
damocles 2026-06-05 21:55:04 +02:00
commit 86f0de751f
6 changed files with 121 additions and 19 deletions

View file

@ -81,6 +81,13 @@ pub enum DaemonRequest {
#[serde(rename = "join_room")]
JoinRoom { room: String },
/// Resolve a pending invite to `room` (id or alias) by either
/// accepting it (join) or rejecting it (decline + leave). For rooms
/// you were *invited* to; `join_room` is the path for joining a
/// public room you weren't invited to.
#[serde(rename = "resolve_invite")]
ResolveInvite { room: String, action: InviteAction },
/// Invite `user_id` (`@user:server`) to `room` (id or alias). The
/// calling agent must already be a member with a high enough power
/// level to invite. Idempotent-ish: inviting an already-joined or
@ -110,6 +117,18 @@ pub enum DaemonRequest {
Ping,
}
/// Whether to accept or reject a pending invite in
/// [`DaemonRequest::ResolveInvite`]. Serialises as `"accept"` /
/// `"reject"` on the wire.
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum InviteAction {
/// Accept the invite — join the room (same effect as `join_room`).
Accept,
/// Reject the invite — decline it and leave the room.
Reject,
}
/// One entry in the [`DaemonRequest::UnreadSummary`] response payload.
#[derive(Debug, Serialize, Deserialize)]
pub struct RoomUnread {