Skip to content

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

feat: cut desktop gateway over to TinyBox module

Steven Enamakel28f1abb0924f
diff --git a/Cargo.lock b/Cargo.lock
index 6cb561efe4..8d68d4b898 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4240,6 +4240,7 @@ dependencies = [
"tinyagents-runtime",
"tinyagents-session",
"tinyagents-tasks",
+ "tinybox-bus",
"tinybox-core",
"tinybox-docker",
"tinybox-jail",
@@ -6891,27 +6892,37 @@ dependencies = [
"tracing",
]
+[[package]]
+name = "tinybox-bus"
+version = "0.1.18"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "tinybox-core"
-version = "0.1.16"
+version = "0.1.18"
dependencies = [
"async-trait",
"serde",
"thiserror 2.0.20",
+ "tinybox-bus",
]
[[package]]
name = "tinybox-docker"
-version = "0.1.16"
+version = "0.1.18"
dependencies = [
"async-trait",
+ "serde_json",
"tinybox-core",
"tokio",
+ "uuid",
]
[[package]]
name = "tinybox-jail"
-version = "0.1.16"
+version = "0.1.18"
dependencies = [
"landlock",
"log",
diff --git a/crates/openhuman-app/src/gateway/ops_tests.rs b/crates/openhuman-app/src/gateway/ops_tests.rs
index 9094b05902..a1e480a06a 100644
--- a/crates/openhuman-app/src/gateway/ops_tests.rs
+++ b/crates/openhuman-app/src/gateway/ops_tests.rs
@@ -167,7 +167,7 @@ mod provisioning {
use std::collections::BTreeMap;
use super::super::ops;
- use super::super::types::{Confinement, Gateway, GatewaySpec, Reach, CORE_PORT_IN_BOX};
+ use super::super::types::{Confinement, Gateway, GatewaySpec, Reach};
/// A stand-in core: answers `/health` on the port it is handed, forever.
///
diff --git a/crates/openhuman-app/src/gateway/provision.rs b/crates/openhuman-app/src/gateway/provision.rs
index 8a78d8f0bd..dbb40fca0c 100644
--- a/crates/openhuman-app/src/gateway/provision.rs
+++ b/crates/openhuman-app/src/gateway/provision.rs
@@ -11,7 +11,7 @@ use openhuman_rpc::embed::config::RuntimeConfig;
use openhuman_rpc::embed::modules::tinybox::{self, contract};
use super::ops::{ProgressSink, Provisioned};
-use super::types::{ActiveGateway, Confinement, Gateway, Reach, SshReach, CORE_PORT_IN_BOX};
+use super::types::{ActiveGateway, Confinement, Gateway, Reach, CORE_PORT_IN_BOX};
/// How long to wait for a provisioned core to answer `/health`.
const HEALTH_TIMEOUT: Duration = Duration::from_secs(120);
@@ -155,7 +155,7 @@ pub(super) async fn provision(
}
/// Construct the module request without exposing TinyBox implementation types.
-fn create_request(
+pub(super) fn create_request(
resource: contract::ResourceId,
reach: &Reach,
confinement: &Confinement,
@@ -197,7 +197,7 @@ fn create_request(
}
}
-fn host_config(reach: &Reach) -> contract::HostConfig {
+pub(super) fn host_config(reach: &Reach) -> contract::HostConfig {
match reach {
Reach::Local => contract::HostConfig::Local,
Reach::Ssh(ssh) => contract::HostConfig::Ssh(contract::SshHostConfig {
@@ -211,7 +211,7 @@ fn host_config(reach: &Reach) -> contract::HostConfig {
}
/// Build the explicit core command passed to TinyBox.
-fn core_command(
+pub(super) fn core_command(
resource: &contract::ResourceId,
confinement: &Confinement,
token: &str,
diff --git a/crates/openhuman-embed/src/modules.rs b/crates/openhuman-embed/src/modules.rs
index b10a14a00b..dcface5c04 100644
--- a/crates/openhuman-embed/src/modules.rs
+++ b/crates/openhuman-embed/src/modules.rs
@@ -13,18 +13,6 @@ pub mod browser {
pub use openhuman_core::modules::browser::MODULE_ID;
}
-/// TinyBox sandbox operations, with request types from its released bus contract.
-#[cfg(feature = "modules")]
-pub mod tinybox {
- pub use openhuman_core::modules::tinybox::{
- abort_file_write, analyze_command, analyze_shell, begin_file_read, begin_file_write,
- cancel, capabilities, close, close_forward, create, describe, exec, finish_file_read,
- finish_file_write, forward, inspect, is_running, jail_status, read_file_chunk, read_output,
- release_output, reserve, shutdown, spawn, start_exec, start_jailed_exec, write_file_chunk,
- MODULE_ID,
- };
-}
-
/// Pre-core calls through the process-wide loader, with explicit runtime configuration.
pub use openhuman_core::modules::client::{ModuleCallError, ModuleClient};
@@ -46,7 +34,6 @@ pub mod tinybox {
abort_file_write, analyze_command, analyze_shell, begin_file_read, begin_file_write,
cancel, capabilities, close, close_forward, create, describe, exec, finish_file_read,
finish_file_write, forward, inspect, is_running, jail_status, read_file_chunk, read_output,
- release_output, reserve, run_docker, shutdown, spawn, start_exec, start_jailed_exec,
- write_file_chunk, MODULE_ID,
+ release_output, reserve, shutdown, spawn, start_exec, start_jailed_exec, write_file_chunk,
};
}