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 |
Not on crates.io. This crate and
tinychannels-busarepublish = falseOpenHuman uses the vendored path dependency undervendor/tinychannels. Other consumers can use the direct Git dependency shown below. What a host loads at runtime is the compiledtinychannels-modulecdylib, delivered as a release artifact and pinned by SHA-256, not a published crate.
The default feature set (default = []) does not include these providers. To use them, add to your Cargo.toml:
[dependencies]
tinychannels = { git = "https://github.com/tinyhumansai/tinychannels", features = ["email", "lark", "whatsapp-web"] }Or enable them individually as needed:
[dependencies]
tinychannels = { git = "https://github.com/tinyhumansai/tinychannels", 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 = { git = "https://github.com/tinyhumansai/tinychannels", 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,larkcrates/tinychannels-bus/is the contract:Channel,ChannelMessageandSendMessage(traits.rs), channel configuration (config.rs), per-provider capabilities (capabilities.rs), connection definitions, connect-form parsing and backend response types (controllers/), and conversation keys (context.rs).crates/tinychannels-runtime/holds listener supervision, the bounded dispatch loop, logout-scoped sessions, channel health checks and the consoleCliChannel.crates/tinychannels-module/is the loadable TinyBus module.src/lib.rsexports the crate surface and re-exports the contract.src/providers/holds the provider transports.src/delivery/holds the durable outbound queue andprogressive/, the streaming reply driver (draft, thinking and filler bubbles) over a host-suppliedProgressiveSender. The reply splitter (segment_for_delivery) lives intinychannels-bus(delivery::segment) and is re-exported here.src/remote/implements/status,/sessions,/newand/helpfor every provider with theremote_controlcapability, over a host-suppliedRemoteControlHost.src/approvals/sends in-chat approval prompts for every provider with thechat_approvalscapability.src/relay/holds the relay transport loop, the WebSocket dialer and the process-wide transport registry.src/backend.rsownsChannelBackendandChannelManager;src/host/is the host service boundary;src/routes.rsandsrc/runtime.rshold portable runtime helpers.
