The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
feat(channels): deliver podcast email through the released bus module
Steven Enamakel24cf212445e1
diff --git a/Cargo.lock b/Cargo.lockindex 8d68d4b898..eae19784b6 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -165,7 +165,7 @@ version = "1.1.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"dependencies = [- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -176,7 +176,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"dependencies = ["anstyle","once_cell_polyfill",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -730,7 +730,7 @@ dependencies = ["cap-primitives","cap-std","io-lifetimes 3.0.1",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -747,7 +747,7 @@ dependencies = ["maybe-owned","rustix","rustix-linux-procfs",- "windows-sys 0.61.2",+ "windows-sys 0.60.2","winx",]@@ -1693,7 +1693,7 @@ dependencies = ["libc","option-ext","redox_users",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -1904,7 +1904,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"dependencies = ["libc",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -3774,7 +3774,7 @@ version = "0.50.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"dependencies = [- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -5066,7 +5066,7 @@ dependencies = ["once_cell","socket2","tracing",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -5599,7 +5599,7 @@ dependencies = ["errno","libc","linux-raw-sys",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -5667,7 +5667,7 @@ dependencies = ["security-framework 3.7.0","security-framework-sys","webpki-root-certs",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -6247,7 +6247,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"dependencies = ["libc",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -6547,7 +6547,7 @@ dependencies = ["getrandom 0.4.3","once_cell","rustix",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -6560,7 +6560,7 @@ dependencies = ["parking_lot","rustix","signal-hook",- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]@@ -6964,7 +6964,7 @@ dependencies = [[[package]]name = "tinychannels"-version = "0.1.13"+version = "0.1.14"dependencies = ["anyhow","async-imap",@@ -7010,32 +7010,29 @@ dependencies = [[[package]]name = "tinychannels-bus"-version = "0.1.13"+version = "0.1.14"dependencies = [- "anyhow",- "async-trait","base64 0.23.1",- "hex",- "hmac 0.13.0",- "parking_lot",- "rand 0.10.2","schemars","serde","serde_json",- "sha2 0.11.0","thiserror 2.0.20",- "tokio",- "tracing",- "uuid",][[package]]name = "tinychannels-runtime"-version = "0.1.13"+version = "0.1.14"dependencies = ["anyhow","async-trait",+ "base64 0.23.1",+ "hex",+ "hmac 0.13.0",+ "parking_lot","rand 0.10.2",+ "serde",+ "serde_json",+ "sha2 0.11.0","tinychannels-bus","tokio","tokio-util",@@ -8886,7 +8883,7 @@ version = "0.1.11"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"dependencies = [- "windows-sys 0.61.2",+ "windows-sys 0.60.2",][[package]]diff --git a/crates/openhuman-app/Cargo.lock b/crates/openhuman-app/Cargo.lockindex be45638156..17ab8614ed 100644--- a/crates/openhuman-app/Cargo.lock+++ b/crates/openhuman-app/Cargo.lock@@ -676,7 +676,7 @@ dependencies = ["cap-primitives","cap-std","io-lifetimes 3.0.1",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -693,7 +693,7 @@ dependencies = ["maybe-owned","rustix","rustix-linux-procfs",- "windows-sys 0.60.2",+ "windows-sys 0.61.2","winx",]@@ -1479,7 +1479,7 @@ dependencies = ["libc","option-ext","redox_users 0.5.3",- "windows-sys 0.59.0",+ "windows-sys 0.61.2",][[package]]@@ -1747,7 +1747,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"dependencies = ["libc",- "windows-sys 0.52.0",+ "windows-sys 0.61.2",][[package]]@@ -2714,7 +2714,7 @@ dependencies = ["js-sys","log","wasm-bindgen",- "windows-core 0.62.2",+ "windows-core 0.57.0",][[package]]@@ -3603,7 +3603,7 @@ dependencies = ["png 0.18.1","serde","thiserror 2.0.20",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -3721,7 +3721,7 @@ version = "0.50.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"dependencies = [- "windows-sys 0.59.0",+ "windows-sys 0.61.2",][[package]]@@ -5066,7 +5066,7 @@ dependencies = ["once_cell","socket2","tracing",- "windows-sys 0.52.0",+ "windows-sys 0.61.2",][[package]]@@ -5495,7 +5495,7 @@ dependencies = ["errno","libc","linux-raw-sys",- "windows-sys 0.52.0",+ "windows-sys 0.61.2",][[package]]@@ -5563,7 +5563,7 @@ dependencies = ["security-framework 3.7.0","security-framework-sys","webpki-root-certs",- "windows-sys 0.52.0",+ "windows-sys 0.61.2",][[package]]@@ -6197,7 +6197,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"dependencies = ["libc",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -6964,10 +6964,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"dependencies = ["fastrand",- "getrandom 0.3.4",+ "getrandom 0.4.3","once_cell","rustix",- "windows-sys 0.52.0",+ "windows-sys 0.61.2",][[package]]@@ -7315,7 +7315,7 @@ dependencies = [[[package]]name = "tinychannels"-version = "0.1.13"+version = "0.1.14"dependencies = ["anyhow","async-imap",@@ -7357,32 +7357,29 @@ dependencies = [[[package]]name = "tinychannels-bus"-version = "0.1.13"+version = "0.1.14"dependencies = [- "anyhow",- "async-trait","base64 0.23.1",- "hex",- "hmac 0.13.0",- "parking_lot",- "rand 0.10.2","schemars 1.2.2","serde","serde_json",- "sha2 0.11.0","thiserror 2.0.20",- "tokio",- "tracing",- "uuid",][[package]]name = "tinychannels-runtime"-version = "0.1.13"+version = "0.1.14"dependencies = ["anyhow","async-trait",+ "base64 0.23.1",+ "hex",+ "hmac 0.13.0",+ "parking_lot","rand 0.10.2",+ "serde",+ "serde_json",+ "sha2 0.11.0","tinychannels-bus","tokio","tokio-util",@@ -8424,7 +8421,7 @@ dependencies = ["png 0.18.1","serde","thiserror 2.0.20",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]@@ -8514,7 +8511,7 @@ checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"dependencies = ["memoffset","tempfile",- "windows-sys 0.60.2",+ "windows-sys 0.61.2",][[package]]diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.tomlindex c1ee647457..068bcc2987 100644--- a/crates/openhuman-core/Cargo.toml+++ b/crates/openhuman-core/Cargo.toml@@ -404,7 +404,7 @@ hostname = "0.4.2"rustls = { version = "0.23", default-features = false, features = ["ring"] }sysinfo = { version = "0.33", default-features = false, features = ["system"] }keyring = { version = "3", features = ["apple-native", "windows-native", "linux-native"] }-lettre = { version = "0.11.22", default-features = false, features = ["builder", "smtp-transport", "rustls-tls"], optional = true }+lettre = { version = "0.11.22", default-features = false, features = ["builder"], optional = true }# HTTP server framework for the domain-owned routes (`/v1`, dictation, the MCP# HTTP transport). Exclusive to the default-ON `http-server`# feature (#5048); the JSON-RPC server that mounts them lives in@@ -770,12 +770,8 @@ voice = ["dep:tinyvoice-bus","dep:lettre","dep:tinyvoice",- # `audio_toolkit::ops` delivers generated podcasts through tinychannels'- # EmailChannel, so the provider — and therefore the implementation crate —- # has to exist even in a channels-less build. This is the ONE reason a- # channels-less build still links the provider stack.- "dep:tinychannels",- "tinychannels/email",+ # Podcast SMTP delivery uses the loadable Channels module. The always-on+ # bus dependency provides its upload vocabulary without linking providers.# `voice::live`: live voice agent sessions over tinyagents-live."dep:tinyagents-live",]@@ -907,39 +903,10 @@ crash-reporting = ["dep:sentry"]# `DomainSet::Channels` flag (#4796): this feature narrows the compile-time# surface, `DomainSet` gates it at runtime.#-# This gate now owns the `tinychannels` CRATE, not just two of its providers.-# The three always-on pins that used to make the crate unconditional-# (`config/schema/channels.rs` re-exporting the config types, `DomainEvent`-# embedding `ChannelInboundEnvelope`, `security/pairing.rs` re-exporting the-# pairing helpers) now resolve through `tinychannels-bus`, the transport-free-# contract crate, which stays unconditional. What is left behind this gate is-# the provider stack and the relay transport loop.-#-# It sheds NO dependencies and is not meant to: measured, the kernel profile is-# 288 packages / 270 names / 2 native both before and after, and the package-list-# diff is one line (`tinychannels` out, `tinychannels-bus` in). Every heavy crate-# tinychannels carried is shared with kernel surface. What the gate buys is-# compile surface — ~31.7k lines a channels-less build no longer compiles — plus-# the contract crate the eventual module extraction needs.-#-# ONE caveat, and it is the reason a channels-less product build still links-# the crate: `voice` enables `dep:tinychannels` for `EmailChannel` alone-# (`audio_toolkit::ops` mails generated podcasts). A build with neither-# `channels` nor `voice` drops it entirely. (`whatsapp-web` refines this gate —-# see below — forwarding to the `tinychannels/whatsapp-web` provider feature.)-#-# NOTE: the in-app web chat (`openhuman::web_chat`, RPC namespace `channel`) is-# NOT gated by this feature even though its runtime tag is-# `DomainGroup::Channels` — it is core product surface and stays always-# compiled (decoupled from `channels/` in #5002). The `channels::{traits, cli}`-# carve-outs also stay ungated — `traits` is a 1-line tinychannels re-export and-# `cli::CliChannel` is the dep-free local REPL used by the always-on agent-# harness interactive loop. See AGENTS.md "channels gate" + `channels/mod.rs`.-# The crate itself is now droppable, which it was not before: splitting-# `tinychannels-bus` out moved every always-on pin into a contract crate. That-# is a compile-surface and architecture win, NOT a dependency win — see the-# measured note above before claiming otherwise.-channels = ["dep:tinychannels", "tinychannels/email", "tinychannels/lark"]+# Provider runtime remains an audited implementation exception until its bus+# cutover. Channels-backed operations require the process-wide module loader;+# serialized configuration/messages come from the always-on bus contract.+channels = ["modules", "dep:tinychannels", "tinychannels/email", "tinychannels/lark"]# The WhatsApp Web provider now lives in tinychannels; forward to its feature.# It is a refinement INSIDE the `channels` gate — enabling it pulls in the whole# channels domain (the provider re-exports live under `channels/providers/`).diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rsindex 2f0b119dad..5ea37c001b 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs@@ -2,6 +2,7 @@//! any live pre-verification).use serde_json::Value;+use tinychannels_runtime::controllers::ChannelDefinitionExt as _;use crate::channels::email_channel::EmailConfig;use crate::channels::providers::yuanbao::YuanbaoConfig;diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rsindex 4d8f258265..43605ccc46 100644--- a/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rs+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/test_channel.rs@@ -1,6 +1,7 @@//! Testing a channel's credentials without persisting anything.use serde_json::Value;+use tinychannels_runtime::controllers::ChannelDefinitionExt as _;use crate::config::Config;use crate::core::Outcome;diff --git a/crates/openhuman-core/src/channels/credentials.rs b/crates/openhuman-core/src/channels/credentials.rsnew file mode 100644index 0000000000..f774b13f25--- /dev/null+++ b/crates/openhuman-core/src/channels/credentials.rs@@ -0,0 +1,44 @@+//! Host-owned channel credential reconciliation.+use crate::config::Config;++/// Best-effort fill of `email_cfg.password` from the encrypted credentials store+/// when TOML doesn't already carry one.+///+/// The IMAP/SMTP `password` is intentionally not persisted in `config.toml` (see+/// `persist_email_config` in `controllers/ops/connect.rs`); it lives only in the+/// credentials store under `channel:email:api_key`. Existing TOML values still+/// win so manually-installed deployments keep working. The stored secret is only+/// copied when the stored profile's `username` matches, so editing `username` in+/// `config.toml` can't silently pair a fresh account with a stale password.+pub(crate) fn resolve_email_password(+ mut email_cfg: tinychannels_bus::config::EmailConfig,+ config: &Config,+) -> tinychannels_bus::config::EmailConfig {+ if !email_cfg.password.is_empty() {+ return email_cfg;+ }+ let auth = crate::security::credentials::AuthService::from_config(config);+ match auth.get_profile("channel:email:api_key", None) {+ Ok(Some(profile)) => {+ let stored_username = profile.metadata.get("username").map(String::as_str);+ if stored_username != Some(email_cfg.username.as_str()) {+ tracing::warn!(+ "[channels] email stored credentials are for a different username (toml={:?}, store={:?}); reconnect the channel to refresh the password",+ email_cfg.username,+ stored_username,+ );+ } else if let Some(password) = profile.metadata.get("password") {+ email_cfg.password = password.clone();+ }+ }+ Ok(None) => {+ tracing::warn!(+ "[channels] email credentials missing — connect the channel again from the UI"+ );+ }+ Err(e) => {+ tracing::warn!("[channels] failed to load email credentials: {e}");+ }+ }+ email_cfg+}diff --git a/crates/openhuman-core/src/channels/mod.rs b/crates/openhuman-core/src/channels/mod.rsindex 81fb834127..3fff207ee5 100644--- a/crates/openhuman-core/src/channels/mod.rs+++ b/crates/openhuman-core/src/channels/mod.rs@@ -1,33 +1,16 @@-//! Channel implementations and runtime orchestration.+//! Channel contracts and OpenHuman runtime orchestration.//!-//! Compile-time gate (`channels`, default-ON — #4801): the whole domain lives-//! behind the feature EXCEPT two dependency-free carve-outs that always-on code-//! reaches directly:+//! Provider orchestration is gated by `channels`. Serialized configuration,+//! messages, and schemas come from `tinychannels-bus`. Podcast email delivery+//! calls the loaded module even in a voice-only build.//!-//! * `traits` — a one-line re-export of the `tinychannels` `Channel` /-//! `SendMessage` traits, named by the always-on agent-harness interactive-//! loop (`agent::session_host::runtime::run_interactive`).-//! * `CliChannel` — the local stdin/stdout REPL the same interactive loop-//! drives in every build, re-exported from the lightweight-//! `tinychannels-runtime` crate.-//! * `contract_schema` — the `tinychannels-bus` controller-schema conversion,-//! shared with `openhuman-tinyhumans`, which serves the managed-bot link-//! controllers (`channels.telegram_login_*`, `channels.discord_link_*`).-//!-//! Everything else (`providers`, `host`, `controllers`, `runtime`, `bus`,-//! `proactive`, `commands`, `context`, `routes`,-//! the provider re-exports,-//! `doctor_channels`, `start_channels`, the `build_system_prompt` re-export and-//! the `test_support` re-export) is `#[cfg(feature = "channels")]`.-//! Nothing INSIDE those submodules changes when the gate flips.-//!-//! The gate sheds ZERO dependencies — `tinychannels` stays load-bearing for the-//! config schema, the `DomainEvent` inbound envelope and security pairing — so-//! its value is compile-time surface + binary size, not the dep tree. See-//! AGENTS.md "channels gate".+//! The local REPL and legacy channel trait remain explicit implementation+//! exceptions while the remaining channel runtime is migrated to TinyBus.// Always-compiled carve-outs (see module docs).pub mod contract_schema;+#[cfg(any(feature = "voice", feature = "channels"))]+pub(crate) mod credentials;pub mod traits;pub use tinychannels_runtime::CliChannel;diff --git a/crates/openhuman-core/src/channels/runtime/startup/credentials.rs b/crates/openhuman-core/src/channels/runtime/startup/credentials.rsindex c042564ca5..9b21cd855c 100644--- a/crates/openhuman-core/src/channels/runtime/startup/credentials.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/credentials.rs@@ -49,47 +49,7 @@ pub(super) fn resolve_yuanbao_app_secret(yb_cfg}-/// Best-effort fill of `email_cfg.password` from the encrypted credentials store-/// when TOML doesn't already carry one.-///-/// The IMAP/SMTP `password` is intentionally not persisted in `config.toml` (see-/// `persist_email_config` in `controllers/ops/connect.rs`); it lives only in the-/// credentials store under `channel:email:api_key`. Existing TOML values still-/// win so manually-installed deployments keep working. The stored secret is only-/// copied when the stored profile's `username` matches, so editing `username` in-/// `config.toml` can't silently pair a fresh account with a stale password.-pub(super) fn resolve_email_password(- mut email_cfg: crate::channels::email_channel::EmailConfig,- config: &Config,-) -> crate::channels::email_channel::EmailConfig {- if !email_cfg.password.is_empty() {- return email_cfg;- }- let auth = crate::security::credentials::AuthService::from_config(config);- match auth.get_profile("channel:email:api_key", None) {- Ok(Some(profile)) => {- let stored_username = profile.metadata.get("username").map(String::as_str);- if stored_username != Some(email_cfg.username.as_str()) {- tracing::warn!(- "[channels] email stored credentials are for a different username (toml={:?}, store={:?}); reconnect the channel to refresh the password",- email_cfg.username,- stored_username,- );- } else if let Some(password) = profile.metadata.get("password") {- email_cfg.password = password.clone();- }- }- Ok(None) => {- tracing::warn!(- "[channels] email credentials missing — connect the channel again from the UI"- );- }- Err(e) => {- tracing::warn!("[channels] failed to load email credentials: {e}");- }- }- email_cfg-}+use crate::channels::credentials::resolve_email_password;/// Supplies `tinychannels`' provider factory with this host's HTTP clients.///diff --git a/crates/openhuman-core/src/channels/runtime/startup/relay.rs b/crates/openhuman-core/src/channels/runtime/startup/relay.rsindex 40d7a5bb2d..d44f29551e 100644--- a/crates/openhuman-core/src/channels/runtime/startup/relay.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/relay.rs@@ -4,6 +4,7 @@ use super::super::dispatch::RuntimeChannelMessage;use anyhow::Result;use async_trait::async_trait;use std::sync::Arc;+use tinychannels_runtime::config::RelayRuntimeConfigExt as _;use tokio::sync::mpsc;pub(super) struct RelayInboundMessageHandler {diff --git a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rsindex 377dddfc0f..0beabbca64 100644--- a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs@@ -18,6 +18,7 @@ use anyhow::Result;use std::collections::HashMap;use std::sync::Arc;use tinychannels::runtime::compute_max_in_flight_messages;+use tinychannels_runtime::config::RelayRuntimeConfigExt as _;use tokio_util::task::AbortOnDropHandle;pub async fn start_channels(config: Config) -> Result<()> {diff --git a/crates/openhuman-core/src/channels/runtime/startup_email_secret_tests_tests.rs b/crates/openhuman-core/src/channels/runtime/startup_email_secret_tests_tests.rsindex 6057933cf9..a280ac6834 100644--- a/crates/openhuman-core/src/channels/runtime/startup_email_secret_tests_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/startup_email_secret_tests_tests.rs@@ -4,7 +4,7 @@ use crate::security::credentials::AuthService;use std::collections::HashMap;use tempfile::tempdir;-use crate::channels::runtime::startup::credentials::resolve_email_password;+use crate::channels::credentials::resolve_email_password;fn isolated_config() -> (tempfile::TempDir, Config) {let tmp = tempdir().expect("tempdir");let mut config = Config::default();diff --git a/crates/openhuman-core/src/channels/traits.rs b/crates/openhuman-core/src/channels/traits.rsindex 3285a98bd2..68396e9f72 100644--- a/crates/openhuman-core/src/channels/traits.rs+++ b/crates/openhuman-core/src/channels/traits.rs@@ -1,11 +1,10 @@-//! The channel seam, re-exported from the contract crate.+//! Legacy channel orchestration seam during the provider cutover.//!-//! This carve-out is deliberately UNGATED: the always-on agent-harness-//! interactive loop and `cron::bus` both name these, so they must resolve in a-//! `channels`-less build. They come from `tinychannels-bus` rather than-//! `tinychannels` for exactly that reason — the implementation crate is-//! optional now, the vocabulary is not.-pub use tinychannels_bus::{Channel, ChannelMessage, ChannelSendExt, SendMessage};+//! Serialized messages come from the pure bus contract. The remaining+//! in-process trait is an explicit `tinychannels-runtime` migration exception;+//! it will be replaced when provider runtime callers switch to TinyBus.+pub use tinychannels_bus::{ChannelMessage, SendMessage};+pub use tinychannels_runtime::{Channel, ChannelSendExt};#[cfg(test)]#[path = "traits_tests.rs"]diff --git a/crates/openhuman-core/src/core/runtime/services.rs b/crates/openhuman-core/src/core/runtime/services.rsindex 55dba8991b..151a1576fb 100644--- a/crates/openhuman-core/src/core/runtime/services.rs+++ b/crates/openhuman-core/src/core/runtime/services.rs@@ -18,6 +18,8 @@// this file is plain field access on OpenHuman's own `Config`.use crate::config::Config;use crate::core::runtime::ServiceSet;+#[cfg(feature = "channels")]+use tinychannels_runtime::config::ChannelsConfigExt as _;/// The long-lived background services a runtime started, so it can stop them.///diff --git a/crates/openhuman-core/src/cron/bus.rs b/crates/openhuman-core/src/cron/bus.rsindex fe1a72afd7..44e03de473 100644--- a/crates/openhuman-core/src/cron/bus.rs+++ b/crates/openhuman-core/src/cron/bus.rs@@ -6,12 +6,12 @@//! picks up those events and dispatches to the appropriate channel, keeping//! channel construction out of the scheduler.+use crate::channels::traits::{Channel, SendMessage};use crate::core::events::DomainEvent;use async_trait::async_trait;use std::collections::HashMap;use std::sync::Arc;use tinybus::EventHandler;-use tinychannels_bus::{Channel, SendMessage};/// Subscribes to `CronDeliveryRequested` events and dispatches/// the output to the named channel.diff --git a/crates/openhuman-core/src/cron/channel_bridge.rs b/crates/openhuman-core/src/cron/channel_bridge.rsindex a2aa3ffd3b..4c3517a299 100644--- a/crates/openhuman-core/src/cron/channel_bridge.rs+++ b/crates/openhuman-core/src/cron/channel_bridge.rs@@ -8,10 +8,10 @@//! it starts; nothing registers in a core with no channels, and every accessor//! then answers "unavailable" instead of failing.+use crate::channels::traits::{Channel, SendMessage};use std::collections::HashMap;use std::sync::{Arc, Mutex, RwLock};use tinyagents_session::transcript::TranscriptMessage;-use tinychannels_bus::{Channel, SendMessage};/// Same shape as `channels::context::ConversationHistoryMap`, spelled out so/// cron does not depend on the feature-gated `channels` module.diff --git a/crates/openhuman-core/src/modules/README.md b/crates/openhuman-core/src/modules/README.mdindex e9e94e0336..f255e661ae 100644--- a/crates/openhuman-core/src/modules/README.md+++ b/crates/openhuman-core/src/modules/README.md@@ -225,8 +225,10 @@ download, its `dlopen`, or its resident memory.| [`search/proxy.rs`](search/proxy.rs) | `tinysearch` | Lazy load, private reinitialization on configuration change, and serialized `list_tools` / `execute_tool`; `refresh_loaded` after settings saves and credential changes. || [`tokenjuice_host.rs`](tokenjuice_host.rs) | `tinyjuice` | The reverse direction: an `MlHost` object the host serves at the contract's `ML_HOST_NAME` / `ML_HOST_PATH` for the module's tool-less summary model call. |-`tinymcp`, `tinybox`, `tinychannels` and `tinyhosts` have registry records but-no host file in this folder.+`channel_email.rs` delivers podcast attachments through TinyChannels' bounded+confidential upload members. `tinybox.rs` supplies the pre-core gateway client.+The remaining channel runtime, MCP and core sandbox callers are still being+migrated; their dependency exceptions remain explicit.## Key types and entry pointsdiff --git a/crates/openhuman-core/src/modules/channel_email.rs b/crates/openhuman-core/src/modules/channel_email.rsnew file mode 100644index 0000000000..ec1c579f7d--- /dev/null+++ b/crates/openhuman-core/src/modules/channel_email.rs@@ -0,0 +1,123 @@+//! Podcast attachment delivery through the loadable TinyChannels module.+use super::client::{ModuleCallError, ModuleClient};+use async_trait::async_trait;+use std::sync::Arc;+use tinychannels_bus::controllers::ChannelSendMessageResult;+use tinychannels_bus::module_email::{EMAIL_ATTACHMENT_BYTES, EMAIL_UPLOAD_CHUNK_BYTES};+use tinychannels_bus::{methods, EmailUploadBegin, EmailUploadChunk, EmailUploadHandle};++#[async_trait]+trait EmailUploadTransport: Send + Sync {+ async fn begin(&self, request: EmailUploadBegin) -> Result<EmailUploadHandle, ModuleCallError>;+ async fn append(&self, request: EmailUploadChunk) -> Result<u32, ModuleCallError>;+ async fn send(+ &self,+ handle: EmailUploadHandle,+ ) -> Result<ChannelSendMessageResult, ModuleCallError>;+ async fn abort(&self, handle: EmailUploadHandle) -> Result<(), ModuleCallError>;+}++#[async_trait]+impl EmailUploadTransport for ModuleClient {+ async fn begin(&self, request: EmailUploadBegin) -> Result<EmailUploadHandle, ModuleCallError> {+ self.call_confidential("tinychannels", methods::BEGIN_EMAIL_UPLOAD, (request,))+ .await+ }+ async fn append(&self, request: EmailUploadChunk) -> Result<u32, ModuleCallError> {+ self.call_confidential(+ "tinychannels",+ methods::APPEND_EMAIL_UPLOAD_CHUNK,+ (request,),+ )+ .await+ }+ async fn send(+ &self,+ handle: EmailUploadHandle,+ ) -> Result<ChannelSendMessageResult, ModuleCallError> {+ self.call_confidential("tinychannels", methods::SEND_EMAIL_UPLOAD, (handle,))+ .await+ }+ async fn abort(&self, handle: EmailUploadHandle) -> Result<(), ModuleCallError> {+ self.call_confidential("tinychannels", methods::ABORT_EMAIL_UPLOAD, (handle,))+ .await+ }+}++/// Transfer one validated attachment in bounded confidential frames and send it.+/// SMTP and MIME delivery execute inside the module; failures have no local fallback.+pub(crate) async fn send_attachment(+ client: ModuleClient,+ request: EmailUploadBegin,+ bytes: Vec<u8>,+) -> Result<ChannelSendMessageResult, ModuleCallError> {+ upload_and_send(Arc::new(client), request, bytes).await+}++async fn upload_and_send<T: EmailUploadTransport + 'static>(+ transport: Arc<T>,+ request: EmailUploadBegin,+ bytes: Vec<u8>,+) -> Result<ChannelSendMessageResult, ModuleCallError> {+ if bytes.len() > EMAIL_ATTACHMENT_BYTES+ || request.attachments.len() != 1+ || request.attachments[0].byte_count != bytes.len()+ {+ return Err(ModuleCallError::ModuleFault);+ }+ let handle = transport.begin(request).await?;+ let mut lease = UploadLease {+ transport: transport.clone(),+ handle: Some(handle.clone()),+ };+ let result = async {+ for (sequence, bytes) in bytes.chunks(EMAIL_UPLOAD_CHUNK_BYTES).enumerate() {+ let expected = sequence as u32 + 1;+ let acknowledged = transport+ .append(EmailUploadChunk {+ handle: handle.clone(),+ attachment_index: 0,+ sequence: sequence as u32,+ bytes: bytes.to_vec(),+ })+ .await?;+ if acknowledged != expected {+ ModuleClient::report_malformed_reply("tinychannels");+ return Err(ModuleCallError::ModuleFault);+ }+ }+ transport.send(handle.clone()).await+ }+ .await;+ if result.is_err() {+ // A send already admitted to SMTP remains module-owned; Abort refuses+ // to cancel it. Failed uploads are explicitly closed before returning.+ if transport.abort(handle).await.is_ok() {+ lease.handle.take();+ }+ } else {+ lease.handle.take();+ }+ result+}++struct UploadLease<T: EmailUploadTransport + 'static> {+ transport: Arc<T>,+ handle: Option<EmailUploadHandle>,+}+impl<T: EmailUploadTransport + 'static> Drop for UploadLease<T> {+ fn drop(&mut self) {+ if let (Some(handle), Ok(runtime)) =+ (self.handle.take(), tokio::runtime::Handle::try_current())+ {+ let transport = self.transport.clone();+ runtime.spawn(async move {+ let _ = transport.abort(handle).await;+ });+ }+ }+}++#[cfg(test)]+#[path = "channel_email_tests.rs"]+mod tests;diff --git a/crates/openhuman-core/src/modules/channel_email_tests.rs b/crates/openhuman-core/src/modules/channel_email_tests.rsnew file mode 100644index 0000000000..105a5c31cd--- /dev/null+++ b/crates/openhuman-core/src/modules/channel_email_tests.rs@@ -0,0 +1,178 @@+use super::*;+use std::sync::Mutex;+use tinychannels_bus::{config::EmailConfig, EmailAttachmentUpload};++#[derive(Default)]+struct Fixture {+ chunks: Mutex<Vec<EmailUploadChunk>>,+ sent: Mutex<bool>,+ aborted: Mutex<bool>,+ bad_ack: bool,+ append_entered: Option<tokio::sync::Notify>,+ abort_finished: tokio::sync::Notify,+}+#[async_trait]+impl EmailUploadTransport for Fixture {+ async fn begin(&self, request: EmailUploadBegin) -> Result<EmailUploadHandle, ModuleCallError> {+ assert_eq!(request.recipient, "[email protected]");+ assert_eq!(request.subject, "Podcast");+ assert_eq!(request.attachments[0].filename, "podcast.mp3");+ Ok(EmailUploadHandle("module-owned-upload".into()))+ }+ async fn append(&self, chunk: EmailUploadChunk) -> Result<u32, ModuleCallError> {+ if let Some(entered) = &self.append_entered {+ entered.notify_one();+ std::future::pending::<()>().await;+ }+ let ack = if self.bad_ack { 0 } else { chunk.sequence + 1 };+ self.chunks.lock().unwrap().push(chunk);+ Ok(ack)+ }+ async fn send(+ &self,+ handle: EmailUploadHandle,+ ) -> Result<ChannelSendMessageResult, ModuleCallError> {+ assert_eq!(handle.0, "module-owned-upload");+ *self.sent.lock().unwrap() = true;+ Ok(ChannelSendMessageResult::default())+ }+ async fn abort(&self, _: EmailUploadHandle) -> Result<(), ModuleCallError> {+ *self.aborted.lock().unwrap() = true;+ self.abort_finished.notify_one();+ Ok(())+ }+}+fn request(length: usize) -> EmailUploadBegin {+ EmailUploadBegin {+ config: EmailConfig::default(),+ recipient: "[email protected]".into(),+ subject: "Podcast".into(),+ body: "Attached.".into(),+ attachments: vec![EmailAttachmentUpload {+ filename: "podcast.mp3".into(),+ content_type: "audio/mpeg".into(),+ byte_count: length,+ }],+ }+}+#[tokio::test]+async fn podcast_attachment_uses_bounded_ordered_chunks_before_module_send() {+ let fixture = Arc::new(Fixture::default());+ let bytes = vec![42; EMAIL_UPLOAD_CHUNK_BYTES + 3];+ upload_and_send(fixture.clone(), request(bytes.len()), bytes.clone())+ .await+ .unwrap();+ let chunks = fixture.chunks.lock().unwrap();+ assert_eq!(chunks.len(), 2);+ assert_eq!(chunks[0].sequence, 0);+ assert_eq!(chunks[1].sequence, 1);+ assert!(chunks+ .iter()+ .all(|chunk| chunk.bytes.len() <= EMAIL_UPLOAD_CHUNK_BYTES && chunk.attachment_index == 0));+ assert_eq!(+ chunks+ .iter()+ .flat_map(|chunk| chunk.bytes.clone())+ .collect::<Vec<_>>(),+ bytes+ );+ assert!(*fixture.sent.lock().unwrap());+ assert!(!*fixture.aborted.lock().unwrap());+}+#[tokio::test]+async fn incorrect_upload_receipt_aborts_without_smtp_delivery() {+ let fixture = Arc::new(Fixture {+ bad_ack: true,+ ..Fixture::default()+ });+ assert_eq!(+ upload_and_send(fixture.clone(), request(1), vec![1])+ .await+ .unwrap_err(),+ ModuleCallError::ModuleFault+ );+ assert!(*fixture.aborted.lock().unwrap());+ assert!(!*fixture.sent.lock().unwrap());+}+#[tokio::test]+async fn inconsistent_attachment_metadata_is_refused_before_module_upload() {+ let fixture = Arc::new(Fixture::default());+ assert_eq!(+ upload_and_send(fixture.clone(), request(2), vec![1])+ .await+ .unwrap_err(),+ ModuleCallError::ModuleFault+ );+ assert!(fixture.chunks.lock().unwrap().is_empty());+ assert!(!*fixture.sent.lock().unwrap());+}++#[tokio::test]+async fn canceled_attachment_upload_closes_its_module_handle_without_sending() {+ let fixture = Arc::new(Fixture {+ append_entered: Some(tokio::sync::Notify::new()),+ ..Fixture::default()+ });+ let task = tokio::spawn(upload_and_send(fixture.clone(), request(1), vec![42]));+ fixture.append_entered.as_ref().unwrap().notified().await;+ task.abort();+ assert!(task.await.unwrap_err().is_cancelled());+ tokio::time::timeout(+ std::time::Duration::from_secs(2),+ fixture.abort_finished.notified(),+ )+ .await+ .unwrap();+ assert!(*fixture.aborted.lock().unwrap());+ assert!(!*fixture.sent.lock().unwrap());+}++#[cfg(feature = "modules")]+#[tokio::test]+async fn unattested_bus_never_receives_email_credentials_or_retries_plaintext() {+ use tinybus::{broker::Broker, transport::memory::MemoryBus, Connection, ObjectPath};+ #[derive(Clone)]+ struct Unattested(std::sync::Arc<std::sync::atomic::AtomicUsize>);+ // An in-process fixture deliberately has no module attestation.+ #[tinybus::interface(name = "test.ChannelEmail")]+ impl Unattested {+ async fn begin_email_upload(+ &self,+ _: EmailUploadBegin,+ ) -> tinybus::Result<EmailUploadHandle> {+ self.0.fetch_add(1, std::sync::atomic::Ordering::SeqCst);+ Ok(EmailUploadHandle("unattested".into()))+ }+ }+ let bus = MemoryBus::new();+ Broker::new().spawn(bus.clone());+ let service = Connection::connect(bus.connect().await.unwrap())+ .await+ .unwrap();+ let caller = Connection::connect(bus.connect().await.unwrap())+ .await+ .unwrap();+ let calls = std::sync::Arc::new(std::sync::atomic::AtomicUsize::new(0));+ service+ .serve_at(+ ObjectPath::new("/test/ChannelEmail").unwrap(),+ Unattested(calls.clone()),+ )+ .await+ .unwrap();+ service.request_name("test.ChannelEmail").await.unwrap();+ let proxy = caller+ .proxy(+ "test.ChannelEmail",+ "/test/ChannelEmail",+ "test.ChannelEmail",+ )+ .unwrap();+ assert_eq!(+ send_attachment(ModuleClient::fixture(proxy), request(1), vec![42])+ .await+ .unwrap_err(),+ ModuleCallError::TransportFailed+ );+ assert_eq!(calls.load(std::sync::atomic::Ordering::SeqCst), 0);+}diff --git a/crates/openhuman-core/src/modules/mod.rs b/crates/openhuman-core/src/modules/mod.rsindex 9e1b7e1338..67f071dfac 100644--- a/crates/openhuman-core/src/modules/mod.rs+++ b/crates/openhuman-core/src/modules/mod.rs@@ -49,6 +49,8 @@ pub(crate) mod browser_sites;pub mod browser_task;#[cfg(feature = "modules")]mod browser_task_report;+#[cfg(feature = "voice")]+pub mod channel_email;pub mod client;#[cfg(feature = "modules")]pub mod computer;diff --git a/crates/openhuman-core/src/modules/registry/records_extra.rs b/crates/openhuman-core/src/modules/registry/records_extra.rsindex 851d2f9df1..37e5887bdc 100644--- a/crates/openhuman-core/src/modules/registry/records_extra.rs+++ b/crates/openhuman-core/src/modules/registry/records_extra.rs@@ -76,63 +76,63 @@ pub(crate) const TINYCHANNELS: ModuleRecord = ModuleRecord {description: "Channel provider lifecycle and message transport",bus_name: "ai.tinyhumans.tinychannels.Channels",object_path: "/ai/tinyhumans/tinychannels/Channels",- version: "0.1.13",- release_url: "https://github.com/tinyhumansai/tinychannels/releases/tag/v0.1.13",+ version: "0.1.14",+ release_url: "https://github.com/tinyhumansai/tinychannels/releases/tag/v0.1.14",assets: &[PlatformAsset {- host_key: "ubuntu-24.04-x86_64",- archive: "tinychannels-module-0.1.13-ubuntu-24.04-x86_64.tar.gz",- sha256: "3fe360f6863a01e2fe48737d9895fd997467121ee1fa9bb30e7f875368c9b5c9",+ host_key: "macos-15-arm64",+ archive: "tinychannels-module-0.1.14-macos-15-arm64.tar.gz",+ sha256: "be83aeca16520766708dd473a52e8b71f1d1d283fae82e5a8c89cb4e45d140bc",},PlatformAsset {- host_key: "ubuntu-24.04-arm64",- archive: "tinychannels-module-0.1.13-ubuntu-24.04-arm64.tar.gz",- sha256: "e636f26b9484b351409f1c1ac0f22ee61435a24961cb0f57e2b7537774b0934a",+ host_key: "macos-15-x86_64",+ archive: "tinychannels-module-0.1.14-macos-15-x86_64.tar.gz",+ sha256: "435b6ec18b25be5bd0b63c5c3cf3d5d688e9934204189b645d13fee29495bbdd",},PlatformAsset {- host_key: "ubuntu-22.04-x86_64",- archive: "tinychannels-module-0.1.13-ubuntu-22.04-x86_64.tar.gz",- sha256: "f0ca5091e42c1493311db34015d4485a557700100feac4245468c3d0f64eef08",+ host_key: "macos-26-arm64",+ archive: "tinychannels-module-0.1.14-macos-26-arm64.tar.gz",+ sha256: "8379e9d60dac93bb6b3f6efe466514767023fa45099922c8eee10acaa9aeff24",},PlatformAsset {- host_key: "ubuntu-22.04-arm64",- archive: "tinychannels-module-0.1.13-ubuntu-22.04-arm64.tar.gz",- sha256: "2824102014b345c21c9d7e16fae8917cdf6fea03529a67de1ee58065f1a694e6",+ host_key: "macos-26-x86_64",+ archive: "tinychannels-module-0.1.14-macos-26-x86_64.tar.gz",+ sha256: "753df946102a41ff119d05b4733ce3ee07483d0b63e2bd94ab8db6ac0fbf319a",},PlatformAsset {- host_key: "macos-26-arm64",- archive: "tinychannels-module-0.1.13-macos-26-arm64.tar.gz",- sha256: "81e16aa479839a673b03a18bd715ebc1b5efef7e6f223953233688ad08d1bbf2",+ host_key: "ubuntu-22.04-arm64",+ archive: "tinychannels-module-0.1.14-ubuntu-22.04-arm64.tar.gz",+ sha256: "079e0bcb34bf75b711a6b5ca17f40b2d7d10296e2dba56bbc3cf18f59301e5e9",},PlatformAsset {- host_key: "macos-26-x86_64",- archive: "tinychannels-module-0.1.13-macos-26-x86_64.tar.gz",- sha256: "dc82f10309946132e7837fb97c86203d79741416536b0d944972cb8acaa3f220",+ host_key: "ubuntu-22.04-x86_64",+ archive: "tinychannels-module-0.1.14-ubuntu-22.04-x86_64.tar.gz",+ sha256: "fe00f8199bdca8ff3d860371cf462526bcc284bc4c343ad6059df0a61e337b15",},PlatformAsset {- host_key: "macos-15-arm64",- archive: "tinychannels-module-0.1.13-macos-15-arm64.tar.gz",- sha256: "7770a906ac3bb46e89725363d723e32709b45300d234b360c4822666c29f7c51",+ host_key: "ubuntu-24.04-arm64",+ archive: "tinychannels-module-0.1.14-ubuntu-24.04-arm64.tar.gz",+ sha256: "33a7f5d131f9a223cddaeaecfb09a176d7f9b021edeaa2ea0d6d7ca1f4d7d1f4",},PlatformAsset {- host_key: "macos-15-x86_64",- archive: "tinychannels-module-0.1.13-macos-15-x86_64.tar.gz",- sha256: "cbd540871efc81822181ddd51502c93f31e2a99a8be58b725d01bc70d7d9ba6d",+ host_key: "ubuntu-24.04-x86_64",+ archive: "tinychannels-module-0.1.14-ubuntu-24.04-x86_64.tar.gz",+ sha256: "88dd9becede87cd4ffaf4587d16379f61b607a7cbb302ba421f1e46d32f14edd",},PlatformAsset {- host_key: "windows-2025-x86_64",- archive: "tinychannels-module-0.1.13-windows-2025-x86_64.zip",- sha256: "a7fee0a4bcbb52b4f7866eab6a1c4eca31fa7de8541c8321c61314c1286f981a",+ host_key: "windows-11-arm64",+ archive: "tinychannels-module-0.1.14-windows-11-arm64.zip",+ sha256: "c2b072246e3dd0e33ebed351cae7e57f30e07f8b89490ed501495b23dd5b01ab",},PlatformAsset {host_key: "windows-2022-x86_64",- archive: "tinychannels-module-0.1.13-windows-2022-x86_64.zip",- sha256: "1a74d967ac4f859d6c210865788fcdb124accc027e75823eb3d9a55a700a0dcd",+ archive: "tinychannels-module-0.1.14-windows-2022-x86_64.zip",+ sha256: "cd3794169dbce1b4f08386f30d47b662f3e6ba785fdbf131530fbd2986756473",},PlatformAsset {- host_key: "windows-11-arm64",- archive: "tinychannels-module-0.1.13-windows-11-arm64.zip",- sha256: "cbcaaeed4c6e2c3baae1474686e210281c16d8f75024d1a4805f68cbbc8f1f67",+ host_key: "windows-2025-x86_64",+ archive: "tinychannels-module-0.1.14-windows-2025-x86_64.zip",+ sha256: "ed50dddcd9b6c07e9286977e28c3f836cb878db5e87e46a4d83aa04104360b90",},],load: LoadPolicy::Lazy,diff --git a/crates/openhuman-core/src/security/pairing.rs b/crates/openhuman-core/src/security/pairing.rsindex 37e5b6fee7..3fc9492cdc 100644--- a/crates/openhuman-core/src/security/pairing.rs+++ b/crates/openhuman-core/src/security/pairing.rs@@ -14,7 +14,7 @@ use std::os::unix::fs::OpenOptionsExt as _;/// `PairingGuard`, `constant_time_eq`, and the pairing lockout constants now/// live in tinychannels (portable, self-contained); re-export them so existing/// callers (channels, `core::auth`, tests) keep their paths.-pub use tinychannels_bus::security::{+pub use tinychannels_runtime::security::{constant_time_eq, generate_code, generate_token, hash_token, is_token_hash, PairingGuard,MAX_PAIR_ATTEMPTS, PAIR_LOCKOUT_SECS,};diff --git a/crates/openhuman-core/src/threads/store/bus.rs b/crates/openhuman-core/src/threads/store/bus.rsindex d9a00487ed..38c63547d4 100644--- a/crates/openhuman-core/src/threads/store/bus.rs+++ b/crates/openhuman-core/src/threads/store/bus.rs@@ -31,8 +31,8 @@ use serde_json::json;use crate::core::events::DomainEvent;use tinybus::EventHandler;use tinybus::SubscriptionHandle;-use tinychannels_bus::context::conversation_history_key;use tinychannels_bus::ChannelMessage;+use tinychannels_runtime::context::conversation_history_key;use super::{append_message, ensure_thread, get_messages, ConversationMessage, CreateConversationThread,@@ -424,7 +424,7 @@ fn persist_channel_turn(}fn tinychannels_session_key(envelope: &tinychannels_bus::ChannelInboundEnvelope) -> String {- tinychannels_bus::build_session_key_for_inbound_envelope(+ tinychannels_runtime::channel::build_session_key_for_inbound_envelope("main",envelope,tinychannels_bus::channel::SessionKeyPolicy::default(),diff --git a/crates/openhuman-core/src/threads/store/bus_tests.rs b/crates/openhuman-core/src/threads/store/bus_tests.rsindex 8656b97382..f63dfcc269 100644--- a/crates/openhuman-core/src/threads/store/bus_tests.rs+++ b/crates/openhuman-core/src/threads/store/bus_tests.rs@@ -20,7 +20,7 @@ async fn persists_inbound_and_processed_turns_into_workspace_thread() {let temp = TempDir::new().expect("tempdir");let subscriber = ConversationPersistenceSubscriber::new(temp.path().to_path_buf());let mut inbound_envelope =- tinychannels_bus::inbound_envelope_from_legacy_message(&ChannelMessage {+ tinychannels_runtime::channel::inbound_envelope_from_legacy_message(&ChannelMessage {channel: "slack".into(),id: "m1".into(),sender: "alice".into(),diff --git a/crates/openhuman-core/src/voice/audio_toolkit/README.md b/crates/openhuman-core/src/voice/audio_toolkit/README.mdindex 3a2954502d..408da36b7f 100644--- a/crates/openhuman-core/src/voice/audio_toolkit/README.md+++ b/crates/openhuman-core/src/voice/audio_toolkit/README.md@@ -1,6 +1,6 @@# audio_toolkit-Text-to-speech "podcast" toolkit. Synthesizes text into a workspace audio file via the `voice` TTS providers, optionally emails that file as an attachment (over SMTP or as a workspace capture in test/e2e mode), and exposes both as agent tools and JSON-RPC controllers. The combined `generate_and_email` flow chains both steps so the agent can turn arbitrary text into a listen-later audio email in one call.+Text-to-speech "podcast" toolkit. Synthesizes text into a workspace audio file via the `voice` TTS providers, optionally emails that file as an attachment (through the loadable TinyChannels module over SMTP, or as a workspace capture in test/e2e mode), and exposes both as agent tools and JSON-RPC controllers. The combined `generate_and_email` flow chains both steps so the agent can turn arbitrary text into a listen-later audio email in one call.## Responsibilities@@ -92,3 +92,10 @@ No durable domain store. Side effects are filesystem writes within the workspace- [Voice tools](../../../../../gitbooks/features/native-tools/voice.md)- [tinyvoice submodule](../../../../../vendor/tinyvoice/README.md)- [Chat](../../../../../gitbooks/features/chat.md)++SMTP delivery uses `modules/channel_email.rs`: credentials are reconciled by+OpenHuman and metadata/attachment chunks travel through confidential TinyBus+calls. Chunks are bounded by the contract limit; unexpected acknowledgments+abort the upload before SMTP. Cancellation requests cleanup of a known upload handle; module lease expiry+reclaims it if transport cleanup fails. Admitted SMTP work remains module-owned. An unavailable module fails delivery.+The existing capture mode still writes its MIME fixture to the workspace.diff --git a/crates/openhuman-core/src/voice/audio_toolkit/ops.rs b/crates/openhuman-core/src/voice/audio_toolkit/ops.rsindex ac8e20b1de..4418134345 100644--- a/crates/openhuman-core/src/voice/audio_toolkit/ops.rs+++ b/crates/openhuman-core/src/voice/audio_toolkit/ops.rs@@ -7,7 +7,7 @@ use lettre::Message;use crate::config::Config;use crate::core::Outcome;use crate::voice::{create_tts_provider, DEFAULT_PIPER_VOICE};-use tinychannels::providers::email_channel::EmailChannel;+use tinychannels_bus::{EmailAttachmentUpload, EmailUploadBegin};use super::types::{AudioEmailDeliveryResult, AudioFormat, AudioGenerateRequest, AudioGeneratedArtifact,@@ -132,19 +132,20 @@ pub async fn email_podcast(.map(|v| v.to_string_lossy().to_string())}).unwrap_or_else(|| "podcast.mp3".to_string());- let content_type = content_type_for_attachment(&attachment_name)?;-- let email = build_email_message(- config,- to,- subject,- body,- &attachment_name,- content_type,- audio_bytes,- )?;+ let content_type = content_type_for_attachment(&attachment_name);if let Some(capture_dir) = resolve_email_capture_dir(config) {+ let email = build_email_message(+ config,+ to,+ subject,+ body,+ &attachment_name,+ content_type+ .parse()+ .map_err(|error| format!("invalid content type for attachment: {error}"))?,+ audio_bytes,+ )?;let capture_rel =capture_email_message(config.workspace_dir.as_path(), &capture_dir, &email).await?;let result = AudioEmailDeliveryResult {@@ -165,10 +166,32 @@ pub async fn email_podcast(.clone().ok_or_else(|| "email channel is not configured".to_string())?;- let channel = EmailChannel::new(email_cfg);- channel- .send_message(email)- .map_err(|e| format!("failed to send email attachment: {e}"))?;+ let mut email_cfg = crate::channels::credentials::resolve_email_password(email_cfg, config);+ email_cfg.from_address = email_cfg.from_address.trim().to_owned();+ if email_cfg.from_address.is_empty() {+ email_cfg.from_address = "[email protected]".into();+ }+ let byte_count = audio_bytes.len();+ if byte_count > tinychannels_bus::module_email::EMAIL_ATTACHMENT_BYTES {+ return Err("audio attachment exceeds the 25 MiB email limit".into());+ }+ crate::modules::channel_email::send_attachment(+ crate::modules::client::ModuleClient::new(config.clone()),+ EmailUploadBegin {+ config: email_cfg,+ recipient: to.to_owned(),+ subject: subject.to_owned(),+ body: body.to_owned(),+ attachments: vec![EmailAttachmentUpload {+ filename: attachment_name.clone(),+ content_type: content_type.to_string(),+ byte_count,+ }],+ },+ audio_bytes,+ )+ .await+ .map_err(|error| format!("failed to send email attachment: {error}"))?;Ok(Outcome::single_log(AudioEmailDeliveryResult {@@ -340,14 +363,12 @@ fn slugify_title(title: &str) -> String {}}-fn content_type_for_attachment(file_name: &str) -> Result<ContentType, String> {- let mime = if file_name.to_ascii_lowercase().ends_with(".wav") {+fn content_type_for_attachment(file_name: &str) -> &'static str {+ if file_name.to_ascii_lowercase().ends_with(".wav") {"audio/wav"} else {"audio/mpeg"- };- mime.parse()- .map_err(|e| format!("invalid content type for attachment: {e}"))+ }}fn build_email_message(diff --git a/crates/openhuman-core/src/web_chat/presentation.rs b/crates/openhuman-core/src/web_chat/presentation.rsindex 42ad246e2c..acf9b4efeb 100644--- a/crates/openhuman-core/src/web_chat/presentation.rs+++ b/crates/openhuman-core/src/web_chat/presentation.rs@@ -6,9 +6,9 @@ use crate::agent::tinyagents::host::LastTurnUsage;use crate::web_chat::{SubagentUsagePayload, TurnUsagePayload, WebChannelEvent};use super::publish_web_channel_event;-use tinychannels_bus::delivery::segment_delay;+use tinychannels_runtime::delivery::segment_delay;#[cfg(test)]-use tinychannels_bus::delivery::segment_for_delivery;+use tinychannels_runtime::delivery::segment_for_delivery;/// Convert a turn's [`LastTurnUsage`] into the wire payload carried on/// `chat_done`. Returns `None` for a turn that recorded no spend at all (e.g. adiff --git a/docs/module-boundary-inventory.md b/docs/module-boundary-inventory.mdindex 7d1da2f22d..152c11360e 100644--- a/docs/module-boundary-inventory.md+++ b/docs/module-boundary-inventory.md@@ -16,10 +16,10 @@ copying its implementation into a host, or accepting weaker isolation.| tinyjuice | none (module loaded through TinyBus) | tinyjuice-bus | core tools, compression, CCR REPL | Complete: PR #59 provides module-owned compression, CCR queries, HTML extraction, schemas and declarations; the host retains turn-bound model callbacks and artifact authorization || tinyconnectors | tinyconnectors, tinyconnectors-sync | tinyconnectors-bus | core integrations, credentials and triggers | Argument preparation, calendar defaults, task windows, structured provider errors, trigger archives; preserve sign-in/out reconciliation || tinymcp | tinymcp | tinymcp-bus | core MCP registry, supervisor, CLI stdio/HTTP server | Supervisor notifications, server protocol operations and callbacks for approved host tools/resources/prompts |-| tinychannels | tinychannels, tinychannels-runtime; runtime/crypto code in contract | tinychannels-bus | core channels and podcast email, TinyHumans host, CLI REPL | Move providers, signing and pairing out of contract; relay config, pairing, start/stop/send/status, inbound/status callbacks, bounded delivery/draining |+| tinychannels | tinychannels, tinychannels-runtime (remaining runtime callers) | tinychannels-bus | core channels and podcast email, TinyHumans host, CLI REPL | Contract is pure in v0.1.14; podcast SMTP uses confidential module uploads. Remaining provider/relay/REPL callers need bus cutover with inbound/status callbacks and shutdown draining || tinyhosts | tinyhosts | tinyhosts-bus | core hosting tools | Consume released Execute/Providers contract; keep workspace authorization, credentials, and approval policy in OpenHuman || tinywallet | tinywallet-crypto, tinywallet-web3, tinywallet-x402 via bus and direct imports | tinywallet-bus | core wallet/web3/x402 | Move behavioral re-exports out of bus; validation, transaction construction, quotes, swaps, payments, budgets, ledger; retain host custody/approval and confidential attestation |-| tinybox | tinybox-core, tinybox-jail, tinybox-docker, tinybox-host, tinybox-ssh | tinybox-bus (missing at pin) | core sandbox and security, desktop gateways | Discovery-only module needs handle-based sandbox/exec/streams/cancel/files/forward/status/close and shell-analysis facts; pre-core gateways use process loader |+| tinybox | tinybox-core, tinybox-jail, tinybox-docker, tinybox-host, tinybox-ssh | tinybox-bus | core sandbox and security, desktop gateways | Pre-core gateways use the released v0.1.18 bus client. Core sandbox execution and shell analysis still require cutover || tinycomputer | tinycomputer-accessibility | tinycomputer-bus | core voice, paste/focus and permission checks | Permission, focus, paste, Globe listener vocabulary/operations; preserve native thread and target rules || tinyvoice | tinyvoice, cpal (also through accessibility probe) | tinyvoice-bus | core voice capture/hotkeys | Devices, recording/capture and hotkey lifecycle, bounded event batches; computer module permission decisions || tinyruntime | tinyruntime-pyserver | tinyruntime-bus | core Python worker, optional TinyJuice ML | Excluded from this migration: TinyRuntime is being removed separately |diff --git a/scripts/__tests__/check-module-boundaries.test.mjs b/scripts/__tests__/check-module-boundaries.test.mjsindex 00a21774f5..53d69dbca4 100644--- a/scripts/__tests__/check-module-boundaries.test.mjs+++ b/scripts/__tests__/check-module-boundaries.test.mjs@@ -144,3 +144,12 @@ test('the migrated TinyJuice implementation has no host exception', () => {const m = metadata({ host: [['tinyjuice']] });assert.equal(auditGraph(m, ['host'], policy).violations[0].package, 'tinyjuice');});++test('contract binary payload serialization permits base64 without admitting crypto or transport', () => {+ const m = metadata({ 'tinychannels-bus': [['serde'], ['base64']] });+ assert.deepEqual(auditGraph(m, ['tinychannels-bus'], strict, 'tinychannels-bus').violations, []);+ for (const dependency of ['hmac', 'sha2', 'tokio', 'tinychannels-runtime']) {+ const invalid = metadata({ 'tinychannels-bus': [['base64']], base64: [[dependency]] });+ assert.deepEqual(auditGraph(invalid, ['tinychannels-bus'], strict, 'tinychannels-bus').violations.map(v => v.package), [dependency]);+ }+});diff --git a/scripts/ci/check-module-boundaries.mjs b/scripts/ci/check-module-boundaries.mjsindex 533b0c09ce..e36e0fcded 100644--- a/scripts/ci/check-module-boundaries.mjs+++ b/scripts/ci/check-module-boundaries.mjs@@ -12,6 +12,8 @@ export const CONTRACT_CLOSURE = new Set(['thiserror', 'thiserror-impl', 'schemars', 'schemars_derive', 'dyn-clone','ref-cast', 'ref-cast-impl', 'serde_derive_internals','proc-macro2', 'quote', 'syn', 'unicode-ident',+ // Base64 encoding of serialized binary contract fields; no transport/crypto.+ 'base64',]);export function isImplementation(name, policy) {diff --git a/scripts/ci/module-boundaries.json b/scripts/ci/module-boundaries.jsonindex 6f61ef88e4..7ef378cb84 100644--- a/scripts/ci/module-boundaries.json+++ b/scripts/ci/module-boundaries.json@@ -92,16 +92,14 @@"name": "tinyhosts-bus","manifest": "vendor/tinyhosts/crates/tinyhosts-bus/Cargo.toml","owner": "https://github.com/tinyhumansai/tinyhosts"- }- ],- "pendingContracts": [+ },{"name": "tinybox-bus","manifest": "vendor/tinybox/crates/tinybox-bus/Cargo.toml",- "owner": "https://github.com/tinyhumansai/tinybox",- "reason": "Sandbox execution, shell analysis and pre-core gateways need a bus contract."+ "owner": "https://github.com/tinyhumansai/tinybox"}],+ "pendingContracts": [],"exceptions": [{"scope": "hosts",@@ -133,16 +131,6 @@"package": "tinybox-docker","reason": "Sandbox execution, shell analysis and pre-core gateways need a bus contract."},- {- "scope": "hosts",- "package": "tinybox-host",- "reason": "Sandbox execution, shell analysis and pre-core gateways need a bus contract."- },- {- "scope": "hosts",- "package": "tinybox-ssh",- "reason": "Sandbox execution, shell analysis and pre-core gateways need a bus contract."- },{"scope": "hosts","package": "tinyvoice",@@ -163,61 +151,6 @@"package": "tinywallet-x402","reason": "Validation, transaction construction, web3 and x402 need module operations."},- {- "scope": "tinychannels-bus",- "package": "anyhow",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "async-trait",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "base64",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "hex",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "hmac",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "parking_lot",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "rand",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "sha2",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "tokio",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "tracing",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },- {- "scope": "tinychannels-bus",- "package": "uuid",- "reason": "Channel trait, relay signing and pairing implementations remain in the contract; move them to the module."- },{"scope": "tinywallet-bus","package": "tinywallet-crypto",diff --git a/scripts/ci/module-pin-exemptions.json b/scripts/ci/module-pin-exemptions.jsonindex e32fbf606d..9720a45edb 100644--- a/scripts/ci/module-pin-exemptions.json+++ b/scripts/ci/module-pin-exemptions.json@@ -11,11 +11,5 @@"Delete an entry the moment the pins are reconciled. An exemption that has","stopped being true fails the gate too \u2014 `expect` must still match."],- "exemptions": [- {- "id": "tinybox",- "expect": "v0.1.16-7-gb61c6bce",- "reason": "The upstream submodule includes seven unreleased commits while the registry continues to load the published v0.1.16 module. Remove this exception when the next TinyBox artifact is published and both pins advance."- }- ]+ "exemptions": []}diff --git a/vendor/tinychannels b/vendor/tinychannelsindex 642687bb9a..aae3902bf2 160000--- a/vendor/tinychannels+++ b/vendor/tinychannels@@ -1 +1 @@-Subproject commit 642687bb9a328d6aa1659595a204c80eb2c2bd8c+Subproject commit aae3902bf2c31ee678dc6e5c3c75586d04a2b318