Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(tinyflows): add portability proxy for CapsHost

Steven Enamakeldb198c093b05
diff --git a/crates/openhuman-core/src/modules/tinyflows.rs b/crates/openhuman-core/src/modules/tinyflows.rs
index ae84695f79..f7be87f488 100644
--- a/crates/openhuman-core/src/modules/tinyflows.rs
+++ b/crates/openhuman-core/src/modules/tinyflows.rs
@@ -157,6 +157,23 @@ mod imp {
.map_err(|error| format!("the tinyflows catalog object is unreachable: {error}"))
}
+ /// Proxy to the module-owned portability helpers used by CapsHost.
+ pub(crate) async fn portability_proxy(config: &Config) -> Result<Proxy, String> {
+ ensure(config).await?;
+ let runtime = runtime::runtime()
+ .await
+ .map_err(|error| format!("the module bus is unavailable: {error}"))?;
+ runtime
+ .connection()
+ .proxy(
+ tinyflows_bus::BUS_NAME,
+ tinyflows_bus::OBJECT_PATH,
+ tinyflows_bus::portability::INTERFACE,
+ )
+ .map(|proxy| proxy.with_timeout(CALL_TIMEOUT))
+ .map_err(|error| format!("the tinyflows portability object is unreachable: {error}"))
+ }
+
async fn copilot_invoke_interface_proxy(config: &Config) -> Result<Proxy, String> {
ensure(config).await?;
let runtime = runtime::runtime()
@@ -370,6 +387,10 @@ mod imp {
Err(unavailable(config))
}
+ pub(crate) async fn portability_proxy(config: &Config) -> Result<tinybus::Proxy, String> {
+ Err(unavailable(config))
+ }
+
pub(crate) async fn copilot_invoke_proxy(config: &Config) -> Result<tinybus::Proxy, String> {
Err(unavailable(config))
}
@@ -401,8 +422,8 @@ mod imp {
#[cfg(not(feature = "modules"))]
pub(crate) use imp::{
- authoring_proxy, catalog_proxy, copilot_invoke_proxy, copilot_proxy, proxy, run_proxy, serve,
- serve_pair, serve_registered, unserve,
+ authoring_proxy, catalog_proxy, copilot_invoke_proxy, copilot_proxy, portability_proxy, proxy,
+ run_proxy, serve, serve_pair, serve_registered, unserve,
};
/// Whether the module can serve in this build and configuration (the switch