<!-- source: https://deepwiki.com/qhkm/zeptoclaw/7-communication-channels -->

# Communication Channels

- Cargo.lock
- Cargo.toml
- src/channels/factory.rs
- src/channels/mod.rs
- src/cli/channel.rs

This page provides an overview of ZeptoClaw's communication channel system, which enables the agent to interact with users across multiple messaging platforms and interfaces. For detailed implementation information about specific channel types, see the child pages ([Telegram Integration](/qhkm/zeptoclaw/7.2-telegram-integration), [Slack Integration](/qhkm/zeptoclaw/7.3-slack-integration), [Discord Integration](/qhkm/zeptoclaw/7.4-discord-integration), [WhatsApp Integration](/qhkm/zeptoclaw/7.5-whatsapp-integration), [Email Integration](/qhkm/zeptoclaw/7.6-email-integration), [Lark Integration](/qhkm/zeptoclaw/7.7-lark-integration), [Other Channels](/qhkm/zeptoclaw/7.8-other-channels)). For information about the architectural patterns and trait definitions, see [Channel Architecture](/qhkm/zeptoclaw/7.1-channel-architecture).

## Overview

Communication channels are the entry and exit points for user interactions with ZeptoClaw. Each channel implementation wraps a specific messaging platform's API (Telegram, Discord, Slack, etc.) and provides a standardized interface for receiving and sending messages through the `MessageBus`.

The channel system supports:

- Built-in channel implementations : Telegram, Discord, Slack, WhatsApp (native/web and cloud), Email (IMAP/SMTP), Lark/Feishu. src/channels/mod.rs 134-152
- Extensibility mechanisms : Webhook endpoints, Serial/UART (hardware feature), MQTT (IoT feature). src/channels/mod.rs 141-149
- Binary channel plugins : External processes exposing JSON-RPC 2.0 over stdin/stdout via ChannelPluginAdapter . src/channels/plugin.rs 15-60 src/channels/mod.rs 143
- Per-channel security controls : Allowlists, deny-by-default mode, and trust validation via BaseChannelConfig . src/channels/types.rs 138-148

**Sources:** [src/channels/mod.rs1-153](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/mod.rs#L1-L153) [src/channels/factory.rs23-250](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/factory.rs#L23-L250)

## System Architecture

```

```

**Figure 1: Channel System Architecture - Platform APIs to MessageBus Integration**

This diagram shows how external platform APIs are wrapped by channel implementations, unified through the `Channel` trait, orchestrated by `ChannelManager`, and connected to the agent via `MessageBus`.

**Sources:** [src/channels/mod.rs9-28](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/mod.rs#L9-L28) [src/channels/factory.rs23-210](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/factory.rs#L23-L210)

## Channel Trait Interface

All channel implementations must implement the `Channel` trait defined in `src/channels/types.rs`. The trait provides core methods for lifecycle and communication:

**Sources:** [src/channels/types.rs62-110](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/types.rs#L62-L110)

## Channel Registration and Lifecycle

Channels are registered with the `ChannelManager` during gateway initialization. The registration flow is handled by `register_configured_channels` in `src/channels/factory.rs`:

```

```

**Figure 2: Channel Registration Flow**

The registration process validates configuration, instantiates channel implementations, and starts them:

**Sources:** [src/channels/factory.rs23-177](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/factory.rs#L23-L177) [src/channels/manager.rs1-164](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/manager.rs#L1-L164)

## Message Flow Through Channels

Channels participate in bidirectional message flow between users and the agent:

```

```

**Figure 3: Bidirectional Message Flow Through Channels**

### Inbound Message Processing

When a channel receives a message (e.g., `TelegramChannel` receiving an update), it converts it to an `InboundMessage` and publishes it to the `MessageBus`.

### Outbound Message Delivery

The `ChannelManager` manages a registry of channels. When an `OutboundMessage` is emitted by the agent, it is routed to the appropriate registered channel via `channel.send()`. [src/channels/types.rs74-77](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/types.rs#L74-L77)

**Sources:** [src/channels/mod.rs9-28](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/mod.rs#L9-L28) [src/channels/types.rs62-110](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/types.rs#L62-L110)

## Security and Allowlists

The `BaseChannelConfig` provides allowlist functionality through the `is_allowed` method. It supports both open and strict (deny-by-default) modes. [src/channels/types.rs138-148](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/types.rs#L138-L148)

### Allowlist Behavior

**Sources:** [src/channels/types.rs198-210](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/types.rs#L198-L210)

## Available Channel Types

ZeptoClaw provides various channel types across categories:

### Built-in Messaging Platforms

### IoT and Hardware

**Sources:** [src/channels/mod.rs134-152](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/mod.rs#L134-L152) [src/channels/factory.rs23-219](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/factory.rs#L23-L219) [Cargo.toml153-170](https://github.com/qhkm/zeptoclaw/blob/2c743d31/Cargo.toml#L153-L170)

## Summary

The Communication Channel system is a modular architecture that abstracts messaging platform complexities behind a unified `Channel` trait. By leveraging the `MessageBus`, ZeptoClaw ensures that the core agent logic remains platform-agnostic while supporting a wide array of integrations from Telegram to Serial hardware.

For implementation details of specific channels, see the child pages: [Telegram Integration](/qhkm/zeptoclaw/7.2-telegram-integration), [Slack Integration](/qhkm/zeptoclaw/7.3-slack-integration), [Discord Integration](/qhkm/zeptoclaw/7.4-discord-integration), [WhatsApp Integration](/qhkm/zeptoclaw/7.5-whatsapp-integration), [Email Integration](/qhkm/zeptoclaw/7.6-email-integration), [Lark Integration](/qhkm/zeptoclaw/7.7-lark-integration), [Other Channels](/qhkm/zeptoclaw/7.8-other-channels).

**Sources:** [src/channels/mod.rs1-153](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/mod.rs#L1-L153) [src/channels/factory.rs23-250](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/channels/factory.rs#L23-L250)
