Skip to content

[Matrix] Phase 1: Core Adapter Implementation #779

@alacy-centrl

Description

@alacy-centrl

Overview

Implement the Matrix adapter following the existing adapter pattern (similar to Telegram and Slack adapters).

Tasks

  • Install matrix-bot-sdk dependency
  • Create packages/opencode-router/src/matrix.ts
  • Implement createMatrixAdapter() function
  • Add peer ID validation (Matrix room IDs: !id:domain)
  • Implement message reception handler
  • Implement message sending logic
  • Handle Matrix event types (m.room.message, etc.)
  • Add error handling and retry logic

Key Features

  • Connect to Matrix homeserver using access token
  • Receive messages from Matrix rooms
  • Send text and media messages
  • Support multiple Matrix accounts
  • Handle federation and room IDs

Acceptance Criteria

  • Adapter compiles without errors
  • Can connect to Matrix homeserver
  • Receives messages from joined rooms
  • Sends messages to specified rooms
  • Handles errors gracefully

Estimated Time

3 days

Dependencies

Technical Details

  • Use matrix-bot-sdk for Matrix protocol
  • Room ID format: !abc123:matrix.org
  • Media upload/download via Matrix media API
  • Sync API for event streaming

See full plan: https://github.com/users/alacy-centrl/projects/2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions