Implements the Matrix connector behind the F4 abstraction (stacked on #617).
Speaks the Matrix client-server API directly over HTTPS (injectable fetch, no
SDK) so it is homeserver-agnostic (Conduit default, Synapse alt).
- MatrixConnector implements OrchestratorConnector:
- send → PUT /_matrix/client/v3/rooms/{room}/send/m.room.message/{txn}
(thread-aware via m.thread relation), returns event_id.
- subscribe → /sync long-poll loop driven by the pure parseSyncResponse
(skips the orchestrator's own echoes; carries threadId).
- health → /_matrix/client/versions (reachable) + /account/whoami (authed).
- Pure helpers buildMessageBody + parseSyncResponse → send/receive unit-testable.
- registerMatrixConnector(env) registers the factory; the access token comes from
MATRIX_ACCESS_TOKEN, never the roster.
Verified: 13 Matrix + 7 registry = 20 connector tests green; tsc/eslint/prettier
clean. Still a self-contained connectors/ module (no fleet.ts changes).
Stacked on #617 (F4 Phase 1). Merge order: #617 -> this; rebases onto main after.
Refs #616, #613
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsgTQzV5YUGk1JtCLP4B83