forked from chriswritescode-dev/opencode-manager
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Overview
Enhance messenger integrations inspired by OpenClaw, a popular personal AI assistant project (167k stars) with comprehensive multi-channel support.
Features
1. Voice Messages in Telegram (High Priority)
- Handle voice notes sent to the Telegram bot
- Use existing Whisper STT server to transcribe audio
- Send transcription to OpenCode, return response as text
- Support opus/ogg audio format conversion
2. WhatsApp via Baileys (High Priority)
- Add WhatsApp channel using Baileys library
- QR code pairing flow for device linking
- Store credentials in
~/.opencode-manager/credentials/whatsapp/ - Per-chat session management (like Telegram)
- Message queueing to prevent race conditions
3. Pairing Security Model (High Priority)
- Replace simple allowlist with pairing code system
- Generate 8-character codes for unknown senders
- CLI command:
opencode-manager pairing approve <channel> <code> - 60-minute TTL for pending requests
- Max 3 pending pairing requests at a time
- Store approved contacts in database
4. Channel Abstraction Layer (Medium Priority)
- Create
Channelinterface with common capabilities - Define
ChannelCapabilitiestype (chatTypes, media, threads, reactions) - Abstract message sending/receiving
- Support for text, audio, images, and files
- Per-channel configuration in settings
5. Telegram Settings UI (Medium Priority)
- Add Telegram settings page in web UI
- Configure bot token via UI (not just env vars)
- Manage allowlist via UI
- View active sessions
- Test bot connectivity
Technical Approach
Channel Interface (TypeScript)
interface Channel {
id: string;
name: string;
capabilities: ChannelCapabilities;
start(): Promise<void>;
stop(): Promise<void>;
send(chatId: string, message: OutboundMessage): Promise<void>;
onMessage(handler: MessageHandler): void;
}
interface ChannelCapabilities {
chatTypes: ('direct' | 'group' | 'channel')[];
media: boolean;
voice: boolean;
reactions: boolean;
threads: boolean;
}Libraries
- Telegram: grammy (already using)
- WhatsApp: @whiskeysockets/baileys
- Audio: ffmpeg for format conversion
Acceptance Criteria
- Send voice note to Telegram bot → gets transcribed and responded to
- Link WhatsApp via QR code → send/receive messages
- Unknown sender gets pairing code → approved via CLI → can chat
- Telegram settings configurable via web UI
- All channels use common Channel interface
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels