Communication interfaces through which users interact with Syscity.
Channeltrait — Unified interface:start(),stop(),send(),send_typing(),edit_message(),delete_message(),health_check().- Feature-gated implementations — Each channel is behind a Cargo feature:
telegram—teloxide-based botdiscord—serenity-based botslack— Socket Mode botwhatsapp,qq,feishu,signal,imessage,webchat
ChannelRegistry— Holds all enabled channels and manages start/stop.- Extended registry —
ExtendedChannelRegistrysupports both native and WASM plugin channels. - Formatter subsystem —
MessageFormattertrait with Markdown, HTML, Slack mrkdwn, and Discord embed formatters. - Input provenance —
InputProvenancetracks message origin (external user, inter-session, internal system) for trust decisions. - Mention gating —
MentionStatecontrols whether a group message is processed (DM, mentioned, not mentioned). - Channel management —
ChannelHealthMonitor,LifecycleManager,MetricsManager,ChannelStateStorefor health, lifecycle, metrics, and state persistence. - Command gating —
CommandGatewithAuthorizerandAccessGroupfor command access control. - Thread binding —
ThreadBindingManagerwith policies for conversation placement decisions. - Identity validation —
IdentityValidatorandSenderIdentityfor sender verification. - Reply prefix —
ReplyPrefixEnginewith templates for prepending model info to replies. Responsibility boundary: The template engine lives inchannels::reply_prefixbut is applied by the outbound pipeline (DefaultOutboundPipeline), not by channels themselves.ReplyDispatcherandMessageFormatterdo not add prefixes — they receive already-prefixed content. Seedocs/modules/outbound.md. - Account snapshots —
AccountSnapshotStorefor channel health snapshots. - ACP bridge —
ChannelAcpBridgefor routing ACP commands through channels. - Session envelopes —
SessionEnvelopeManagerfor tracking session context. - Conversation resolver —
ConversationResolverwith multiple resolution providers.
#[async_trait]
pub trait Channel: Send + Sync {
fn name(&self) -> &str;
fn capabilities(&self) -> ChannelCapabilities;
async fn start(&self) -> Result<()>;
async fn stop(&self) -> Result<()>;
async fn send(&self, message: OutgoingMessage) -> Result<Id>;
// ...
}pub enum InputProvenance {
ExternalUser { channel: String, is_direct: bool },
InterSession { source_session: String },
InternalSystem { source: String },
}pub enum MentionState {
DirectMessage,
Mentioned,
NotMentioned,
}- Unified
Channeltrait with async lifecycle management - Feature-gated channel implementations (Telegram, Discord, Slack, WhatsApp, QQ, Feishu/Lark, Signal, iMessage, WebChat)
- Native and WASM plugin channel support via
ExtendedChannelRegistry - Message validation and sanitization (length, control characters, null bytes)
- Input provenance tracking for trust decisions
- Mention gating for group channels
- Rich formatted content (Markdown, HTML, Slack mrkdwn, Discord embeds)
- Channel health monitoring and lifecycle management
- Metrics tracking with latency windows
- Command gating with authorizer modes
- Thread binding with placement policies
- Identity validation for sender verification
- Reply prefix templates with model metadata
- Account snapshot store for health reporting
- ACP bridge for inter-agent communication via channels
- Session envelope tracking
- Conversation resolution with multiple providers