Channels are WASM components that handle communication with external messaging platforms (Telegram, WhatsApp, Slack, etc.). They run in a sandboxed environment and communicate with the host via the WIT interface.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/logicminds/ironclaw/llms.txt
Use this file to discover all available pages before exploring further.
Overview
A channel:- Receives messages from a messaging platform (webhook or polling)
- Emits messages to the agent for processing
- Sends agent responses back to the platform
- Runs isolated with explicit capabilities
Directory Structure
Step 1: Create Cargo.toml
Step 2: Implement the Channel
Required Imports
Implement the Guest Trait
Critical Pattern: Metadata Flow
The most important pattern: Store routing info in metadata so responses can be delivered.Step 3: Create Capabilities File
Createmy-channel.capabilities.json:
Building and Deploying
Build
Install
Enable
Host Functions Available
Logging
Time
Workspace
HTTP Requests
Emit Message to Agent
Common Patterns
Webhook Secret Validation
The host validates automatically, but checkreq.secret_validated:
Polling with Offset Tracking
Bot Message Filtering
Skip bot messages to prevent loops:Status Message Filtering
Skip status updates:Testing
Add tests tolib.rs:
Troubleshooting
”byte index N is not a char boundary”
Never slice strings by byte index! Use character-aware truncation:Credential Placeholders Not Replaced
- Check the secret name matches (lowercase with underscores)
- Verify the secret is in
allowed_namesin capabilities - Check logs for “unresolved placeholders” warnings
Messages Not Routing to Responses
Ensureon_respond uses the ORIGINAL message’s metadata:
Supply Chain Security
Do not commit compiled WASM binaries. They are a supply chain risk — the binary in a PR may not match the source.- Build channels from source:
cargo build - The built binary is in
.gitignore - CI should run
cargo buildto produce releases
Examples
Check the bundled channel:channels-src/telegram/- Full Telegram implementation with polling and webhooks
Next Steps
- Set up Telegram channel
- Learn about WASM tools
- Explore MCP servers for external integrations
