host: expose harness state and actions over the world API

This commit is contained in:
2026-11-07 19:22:06 +00:00
parent c3c5b36d09
commit 5dc4833e28
33 changed files with 33178 additions and 112 deletions
+9 -1
View File
@@ -120,6 +120,8 @@ pub async fn run_with_userland(
crate::process::default_script(),
Some(api.clone()),
)?;
let (sender, receiver) = crate::harness::input::channel();
api.attach_harness(sender.clone());
let listener = Listener::start_with_api(api, options)?;
runtime
.network_policy()
@@ -129,7 +131,13 @@ pub async fn run_with_userland(
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()?
.block_on(crate::harness::run_console(world, Arc::new(runtime), cred))
.block_on(crate::harness::run_console_with_input(
world,
Arc::new(runtime),
cred,
sender,
receiver,
))
})
.await
.map_err(anyhow::Error::from)