feat: matrix MCP invite_user tool

Adds an invite_user tool to the per-agent matrix MCP so an agent can invite
another user to a room it's already in (e.g. pull a peer into an existing
chat). Mirrors the existing join_room/send_dm wiring:

- protocol.rs: DaemonRequest::InviteUser { room, user_id }
- handlers.rs: invite_user — parse user_id, resolve room, room.invite_user_by_id
- socket.rs: dispatch arm
- bin/mcp.rs: invite_user tool + InviteUserArgs

room accepts an id or alias; the caller must hold a power level high enough
to invite (the homeserver error is surfaced verbatim otherwise). The invitee
then accepts via join_room. allowedTools is already '*' for the matrix server,
so the tool is exposed without a nix change.
This commit is contained in:
atlas 2026-06-05 12:06:59 +02:00 committed by mara
commit c85dcc0dec
4 changed files with 57 additions and 0 deletions

View file

@ -81,6 +81,9 @@ async fn dispatch(req: DaemonRequest, client: &Client) -> DaemonResponse {
DaemonRequest::ListRooms => handlers::list_rooms(client).await,
DaemonRequest::ListInvites => handlers::list_invites(client).await,
DaemonRequest::JoinRoom { room } => handlers::join_room(client, &room).await,
DaemonRequest::InviteUser { room, user_id } => {
handlers::invite_user(client, &room, &user_id).await
}
DaemonRequest::ListRoomMembers { room } => handlers::list_room_members(client, &room).await,
DaemonRequest::ReadRoom { room, limit } => handlers::read_room(client, &room, limit).await,
DaemonRequest::UnreadCount => handlers::unread_count(client),