chump-messaging
Platform-agnostic messaging trait for LLM agents. Define one MessagingAdapter impl per platform (Telegram, Slack, Matrix, Discord, IRC, your own) and the agent loop talks to all of them through the same contract.
Capabilities are carried as fields on IncomingMessage / OutgoingMessage rather than per-platform enums, so adapters with weaker features just leave fields empty (e.g. an IRC adapter sets attachments = vec![] and thread_id = None — the agent loop already handles that case).
Why a separate crate
If you're building an agent that needs multi-platform reach, you don't want to copy ~1400 lines of platform-specific glue per platform and let them diverge. The MessagingAdapter trait is the contract — implement it once per platform, plug all of them into the same router (MessagingHub).
The trait is async-first (async fn via async-trait), platform-agnostic, and has zero opinions about how the agent loop is structured underneath.
Install
Use
use ;
use async_trait;
Core types
| symbol | what |
|---|---|
MessagingAdapter |
the contract; 4 async methods (start / send_reply / send_dm / request_approval) |
IncomingMessage |
platform-agnostic user-sent message (text, channel_id, user_id, dm flag, attachments, thread context) |
OutgoingMessage |
the agent's reply (text, optional attachments, optional thread_id) |
ApprovalResponse |
yes / no / timeout result from request_approval |
MessagingHub |
dispatches incoming events from N adapters into a single agent loop, routes outgoing replies back by channel_id prefix |
Channel-id namespacing convention
To route a reply back to the right adapter, channel ids are prefixed by platform:
telegram:<chat_id>slack:<channel_id>discord:<channel_id>web:<session_id>
MessagingHub::send_reply() strips the prefix and dispatches to the matching adapter.
Status
- v0.1.0 — initial publish (extracted from the
chumprepo, where it powers the Telegram + Discord + PWA adapters viachump --serve/chump --discord/chump --telegram)
License
MIT.
Companion crates
chump-agent-lease— multi-agent file-coordination leaseschump-cancel-registry— request-id-keyed CancellationToken storechump-belief-state— Bayesian per-tool reliability beliefschump-cost-tracker— per-provider call/token + budget warningschump-perception— rule-based perception layerchump-mcp-lifecycle— per-session MCP server lifecyclechump-tool-macro— proc macro for declaring agent tools