Skip to content

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

feat(tinyflows): add authoring and catalog bus proxies

Steven Enamakel1734a7af829f
diff --git a/crates/openhuman-core/src/modules/tinyflows.rs b/crates/openhuman-core/src/modules/tinyflows.rs
index 3a7fad7c22..fd525a9a5f 100644
--- a/crates/openhuman-core/src/modules/tinyflows.rs
+++ b/crates/openhuman-core/src/modules/tinyflows.rs
@@ -123,6 +123,32 @@ mod imp {
.map_err(|error| format!("the tinyflows copilot object is unreachable: {error}"))
}
+ /// Proxy to the module-owned Authoring contract.
+ pub(crate) async fn authoring_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::INTERFACE)
+ .map(|proxy| proxy.with_timeout(CALL_TIMEOUT))
+ .map_err(|error| format!("the tinyflows authoring object is unreachable: {error}"))
+ }
+
+ /// Proxy to the module-owned Catalog contract.
+ pub(crate) async fn catalog_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::catalog::INTERFACE)
+ .map(|proxy| proxy.with_timeout(CALL_TIMEOUT))
+ .map_err(|error| format!("the tinyflows catalog object is unreachable: {error}"))
+ }
+
async fn copilot_invoke_interface_proxy(config: &Config) -> Result<Proxy, String> {
ensure(config).await?;
let runtime = runtime::runtime()
@@ -270,7 +296,7 @@ mod fixture;
pub(crate) use imp::serve_pair_after_first;
#[cfg(feature = "modules")]
pub(crate) use imp::{
- copilot_invoke_proxy, copilot_proxy, proxy, run_proxy, serve, serve_pair, unserve,
+ authoring_proxy, catalog_proxy, copilot_invoke_proxy, copilot_proxy, proxy, run_proxy, serve, serve_pair, unserve,
};
#[cfg(not(feature = "modules"))]
@@ -299,6 +325,14 @@ mod imp {
Err(unavailable(config))
}
+ pub(crate) async fn authoring_proxy(config: &Config) -> Result<tinybus::Proxy, String> {
+ Err(unavailable(config))
+ }
+
+ pub(crate) async fn catalog_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))
}
@@ -323,7 +357,7 @@ mod imp {
#[cfg(not(feature = "modules"))]
pub(crate) use imp::{
- copilot_invoke_proxy, copilot_proxy, proxy, run_proxy, serve, serve_pair, unserve,
+ authoring_proxy, catalog_proxy, copilot_invoke_proxy, copilot_proxy, proxy, run_proxy, serve, serve_pair, unserve,
};
/// Whether the module can serve in this build and configuration (the switch