Commit graph hyperhive/hive-matrix-mcp
Author SHA1 Message Date
iris
a35fd1dcf2 docs(matrix-mcp): document send_file, download_file, and unread guard in server instructions
The MCP server instructions string omitted three behaviours added in
earlier PRs, leaving agents without context on them:

- send_file / download_file tools (#1829, #1830)
- [file:]/[image:]/[audio:]/[video:] attachment markers in read_room (#1830)
- unread guard: send_message, send_dm, send_file, send_reply all
  reject if the room has unread messages; read_room + mark_read
  are required first (#1828)

Closes #1828. Closes #1829. Closes #1830.
2026-07-01 19:05:54 +02:00
damocles
db3249a390 fix(#2050): use stable fnv-1a for avatar idempotency hash 2026-06-28 01:38:21 +02:00
damocles
c99fa714d9 feat(#2050): set matrix avatar in the daemon over the live client 2026-06-28 01:38:21 +02:00
damocles
52de0ca648 feat(#2038): hint matrix bridge errors may be a daemon restart 2026-06-27 11:46:47 +02:00
damocles
f477a2f901 feat(#2039): require explicit account when multiple matrix accounts configured 2026-06-27 11:45:57 +02:00
damocles
8aba2e5509 fix(#2033): drop tracker tag from code comment (tracker-tag lint) 2026-06-27 00:33:58 +02:00
damocles
652acf8c6e fix(#2033): gate matrix mcp bridge startup on token, not daemon socket 2026-06-27 00:33:58 +02:00
damocles
3b0a914487 feat(#2035): auto-discover dashboard-provisioned matrix accounts via token+homeserver sidecar 2026-06-27 00:30:04 +02:00
damocles
d5202ebf60 heartbeat the matrix-accounts snapshot so as_of tracks daemon liveness 2026-06-22 13:30:07 +02:00
damocles
f38bc13293 matrix-accounts dashboard: live status + homeserver from daemon snapshot (be-4) 2026-06-22 13:02:43 +02:00
damocles
f5003fd1bb hive-matrix-mcp: remove planted marker from send_redact comment, fix concurrent-delivery wording 2026-06-19 13:46:50 +02:00
damocles
68b0894f5b add list_accounts daemon op to hive-matrix-mcp 2026-06-18 14:00:44 +02:00
damocles
8799a9aa11 hive-matrix-mcp: document redaction power-level + concurrency semantics 2026-06-16 11:06:39 +02:00
damocles
55ba30aa18 hive-matrix-mcp: cover send_redact reason=None in round-trip test (argus note) 2026-06-16 11:03:53 +02:00
damocles
1c0f7a72f7 hive-matrix-mcp: add send_redact tool to delete matrix events 2026-06-16 10:58:34 +02:00
damocles
e5cd4e58f1 matrix multi-account: isolate per-account stale-token failure so a bad secondary token doesn't kill the daemon 2026-06-15 23:13:45 +02:00
damocles
36fb041c55 matrixAccounts: hive 'main' is implicit primary, option declares extras only 2026-06-15 21:24:16 +02:00
damocles
3b26f58a00 docs: note ping arm in dispatch_op is unreachable 2026-06-15 20:28:31 +02:00
damocles
8e79eb4f26 feat: multi-account matrix daemon (account-routed mcp surface) 2026-06-15 20:23:42 +02:00
damocles
73c53c7d4a feat(#1685): surface attachments in read_room + add download_file 2026-06-15 18:17:35 +02:00
damocles
801b886a4c drop stale send_file_dm doc refs (per review) 2026-06-15 17:59:02 +02:00
damocles
07941421c1 replace send_file_dm with open_dm resolver (per review) 2026-06-15 17:59:02 +02:00
damocles
19f1fa4f28 rustfmt send_file handlers 2026-06-15 17:59:02 +02:00
damocles
cbbd6f3d6e feat(#1681): add matrix send_file + send_file_dm tools 2026-06-15 17:59:02 +02:00
damocles
1b0f035a05 matrix: add #[must_use] on room_label per review 2026-06-15 15:50:53 +02:00
damocles
1b1c6e03b9 refactor(matrix): extract room_label helper, dedup 4 call sites 2026-06-15 15:50:53 +02:00
damocles
f6e1651dff feat(#1671): reject matrix send when room has unread messages 2026-06-15 11:38:25 +02:00
damocles
ca84cf427b fix(#1666): wake on pending matrix invites via post-sync sweep 2026-06-14 23:37:45 +02:00
damocles
41c4682f7a refactor(#1450): lift shared harness-path resolution into hive-sh4re 2026-06-14 21:34:58 +02:00
damocles
78317b9cac feat(#551): switch read_room to room.messages() for e2ee decryption, add UTD sentinel, update docs 2026-06-10 19:12:36 +02:00
damocles
f51402a867 feat(#551): enable matrix e2ee -- add e2e-encryption feature, wire EncryptionSettings, flip tuwunel allow_encryption 2026-06-10 19:12:36 +02:00
atlas
5f57ea4ef1 ci(#1555): de-circularize hive-matrix-mcp lib doc (argus nit)
Drop 'Phase 3 of the matrix-MCP work' (circular inside the matrix-mcp
crate) + the vague issue-thread pointer; keep the self-contained note
that it mirrors damocles-daemon's v0 set.
2026-06-10 13:14:42 +02:00
atlas
ab1b07acce ci(#1555): prose-ify legacy tracker tags; add lint:allow escape hatch
Clean the legacy backlog so the tracker-tag lint can become a required
gate (mara's warn-during-cleanup -> full-tree-enforcement path). Rewrite
the ~33 real `closes/see #NNN` provenance refs in doc-comments to prose
across hive-forge, hive-c0re, hive-ag3nt, hive-matrix-mcp, hive-sh4re,
and add a `lint:allow` line marker to check-issue-refs.sh for genuine
non-tracker `#<digits>` (a hash-digit heading-detection test input).
Tree is now lint-clean; tracker-tag lint ready to promote to required.
2026-06-10 13:14:42 +02:00
damocles
7c9954ceec chore(#1474): add reason= to remaining bare clippy allows outside dashboard 2026-06-09 11:25:38 +02:00
damocles
b7529f2e00 feat(matrix): log message-handler firing + wake delivery to localise the no-wake bug 2026-06-06 09:19:02 +02:00
damocles
86f0de751f feat(matrix mcp): add resolve_invite tool to accept or reject pending invites 2026-06-05 21:55:04 +02:00
damocles
fb726197ea fix(#1375): clean up pedantic warnings and re-enable -D warnings without pedantic bypass 2026-06-05 16:55:09 +02:00
atlas
734fe88858 fix(ci): unblock nix flake check after clippy 0.1.95 bump (#1368)
The nixpkgs bump to clippy 0.1.95 / cargo 1.95.0 added + strengthened a
large batch of lints. CI denied ALL warnings (`-D warnings`) against the
`pedantic = warn` workspace lint, so the bump hard-failed `nix flake
check` workspace-wide with zero code changes — and would recur on every
future clippy bump.

Posture fix (the durable part): CI now runs
`-D warnings -A clippy::pedantic`, so the default/correctness/style lints
stay a hard gate while the "extra, opinionated" pedantic group is
advisory only (still `warn` for local `cargo clippy` via the workspace
lints table, just non-blocking in CI). `-A` rather than `-W` so the
group drop doesn't re-enable the specific pedantic lints the workspace
allows (e.g. `must_use_candidate`).

Also fixes the genuine DEFAULT/STYLE lints the bump surfaced across the
workspace (doc_lazy_continuation, collapsible_if, ptr_arg,
match_like_matches_macro, …) via `cargo clippy --fix` + manual stragglers
(`too_many_arguments` #[allow] on the host-config constructors), and
three tests that had rotted while the CI runner was offline (#1221):
- topology::top_level_agents_in_multi_root — hardcoded unsorted expected
- rebuild_queue::depends_on_evicted_dep_counts_as_resolved — needs
  MAX_HISTORY_PER_KIND newer terminals to evict, not one
- coordinator::agent_paths doctest — illustrative pseudo-code, now `ignore`

Validated: clippy + formatting + cargo-test checks all pass.
2026-06-05 15:32:07 +02:00
iris
92b32d06fb fix(clippy): fix all clippy warnings in hive-ag3nt, hive-forge, hive-matrix-mcp, hive-sh4re
Fixes all clippy -D warnings errors in the crates iris owns:

hive-sh4re:
- doc_lazy_continuation: add blank /// separator in priv_proto.rs
- doc_markdown: backtick PRIVATE_NETWORK=0 / PRIVATE_NETWORK=1

hive-matrix-mcp:
- map_unwrap_or: map().unwrap_or_else() -> map_or_else() in paths.rs
- collapsible_if: if-let chains in wake.rs
- doc_markdown: backtick M_UNKNOWN_TOKEN in main.rs
- cast_possible_truncation: usize/u64 -> u32::try_from in handlers.rs
- map_unwrap_or: map_or_else() in handlers.rs
- manual_let_else: match Ok(r) => r, Err => return -> let Ok in handlers.rs
- unused_async: remove async from list_invites; update socket.rs call site

hive-forge:
- doc_markdown: backtick REQUEST_CHANGES / APPROVED / COMMENT in pr_reviews.rs
- unnecessary_wraps: list_reviews_text returns () not Result<()>
- doc_markdown: backtick start_page / last_page in comments.rs
- cast_possible_truncation: PAGE_SIZE u64 -> usize; remove as usize casts

hive-ag3nt:
- collapsible_if: if-let chains in events.rs and mcp.rs
- single_match_else: match -> if let in events.rs and mcp.rs
- items_after_statements: hoist STATUS_MAX_CHARS const in mcp.rs
- map_unwrap_or: map_or_else() in mcp.rs and mcp_loose_ends.rs
- cast_possible_truncation: usize -> u32::try_from in mcp.rs
- doc_markdown: backtick snake_case in mcp.rs, needs_update/deployed_sha
  in web_ui.rs, HISTORY_CAPACITY in web_ui.rs
- identical_match_arms: combine manage_root_agent | query_agent_state
- redundant_closure: |s| s.to_string() -> ToString::to_string in web_ui.rs
- duration_suboptimal_units: from_secs(3600) -> from_hours(1) in turn.rs

Remaining failures in hive-c0re (39), hive-priv (8), hive-bash-mcp (11)
are owned by damocles.
2026-06-05 14:35:12 +02:00
atlas
c85dcc0dec 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.
2026-06-05 13:16:09 +02:00
damocles
186ee430b5 docs: comment std::process::exit(0) intent in M_UNKNOWN_TOKEN recovery 2026-06-04 12:12:20 +02:00
damocles
92ed989f8c refactor: move M_UNKNOWN_TOKEN recovery into client::build_and_restore 2026-06-04 12:12:20 +02:00
damocles
7010d06c34 fix: warn on failed sdk state dir removal in M_UNKNOWN_TOKEN recovery 2026-06-04 12:12:20 +02:00
damocles
1c5936febb fix: recover from M_UNKNOWN_TOKEN in hive-matrix-daemon
when the homeserver rejects the token (stale session after state wipe or
expiry), the daemon now deletes the token file + matrix-sdk state dir
and exits cleanly instead of crash-looping.

hive-c0re's matrix::ensure_all sweep now runs periodically every 30
minutes (in addition to startup) so deleted token files get
re-provisioned without requiring a hive-c0re restart. the systemd.paths
watcher on the token file path then restarts the daemon with a fresh
token.
2026-06-04 12:12:20 +02:00
atlas
4fbe9e4927 feat: surface pending matrix invites in get_loose_ends
Write mcp-loose-ends/matrix.json on invite arrival (before wake) and
after join_room clears an invite. The harness scans mcp-loose-ends/
generically in get_loose_ends, so pending invites are visible there
without any harness-side changes.

- paths: add mcp_loose_ends_dir() (mirrors hive-bash-mcp pattern)
- handlers: add refresh_invite_loose_ends() — atomic tmp+rename write
- handlers: join_room calls refresh after successful join to clear entry
- timeline: install_invite_handler refreshes loose-ends before wake
2026-06-03 22:33:58 +02:00
atlas
06b4745d76 fix: wake agent on matrix invite instead of auto-accepting 2026-06-03 22:33:58 +02:00
atlas
c5b35fb5fa feat: auto-accept matrix room invites in hive-matrix-daemon 2026-06-03 22:33:58 +02:00
damocles
a789c096e7 feat(#1135): transient wake for matrix mcp events - bypass broker sqlite 2026-06-03 16:09:07 +02:00
atlas
0bff5cd5c3 docs: address argus nits — latency note in collect_unread, unread_count retention rationale 2026-06-03 13:56:00 +02:00
atlas
0e5bffc9f4 fix: add #[must_use] to unread_count, collect_unread, unread_summary per codebase convention 2026-06-03 13:56:00 +02:00