TinyChannels is a Rust library for OpenHuman channel and messaging primitives. It provides the portable channel contract, channel configuration schema, connection metadata, route helpers, and backend delegation layer used to connect channel surfaces to OpenHuman harnesses without coupling this crate to the OpenHuman application crate.
- channel abstractions for inbound and outbound message streams
- harness-facing communication contracts
- transport-neutral message envelopes and routing metadata
- adapters for OpenHuman channel surfaces
- observability and lifecycle hooks around channel traffic
Runtime side effects are pluggable through ChannelBackend. OpenHuman owns the
actual backend implementation for REST/JWT/config storage, while this crate
validates channel metadata and delegates operations through that trait.
TinyChannels includes optional provider implementations that must be explicitly enabled:
| Provider | Feature | Channels | Dependencies |
|---|---|---|---|
| Email (send only) | email-send |
EmailChannel (SMTP send) |
lettre |
email |
EmailChannel (SMTP + IMAP) |
lettre, async-imap, mail-parser |
|
| Lark/Feishu | lark |
LarkChannel (webhook receiver + Protobuf decoder) |
axum, prost |
| WhatsApp Web | whatsapp-web |
WhatsAppWebChannel (multi-device via whatsapp-rust) |
whatsapp-rust, whatsapp-rust-tokio-transport, whatsapp-rust-ureq-http-client, wacore |
The default feature set (default = []) does not include these providers. To use them, add to your Cargo.toml:
[dependencies]
tinychannels = { version = "0.1", features = ["email", "lark", "whatsapp-web"] }Or enable them individually as needed:
[dependencies]
tinychannels = { version = "0.1", features = ["email"] }If you only ever send mail — no mailbox is polled — take email-send instead.
It gives you EmailChannel::new, send_message and the build_*_message
helpers on lettre alone, without the IMAP receive stack (18 fewer packages):
[dependencies]
tinychannels = { version = "0.1", features = ["email-send"] }email-send carries no Channel impl — a send-only build cannot listen, so
the trait is gated on the full email feature rather than promising a
half-working channel.
All other providers (Telegram, Discord, Slack, Signal, iMessage, IRC, Yuanbao/钉钉, etc.) are included in the default build.
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo build --all-targets
cargo test
# Test with all optional providers
cargo test --features email,larksrc/lib.rsexports the crate surface.src/traits.rsownsChannel,ChannelMessage, andSendMessage.src/config.rsowns channel configuration structs migrated from OpenHuman.src/controllers/owns connection definitions and backend response types.src/backend.rsownsChannelBackendandChannelManager.src/context.rs,src/routes.rs, andsrc/runtime.rshold portable runtime helpers.docs/spec/README.mdtracks the high-level architecture notes.
