From f7af651f76f32a8575e538753d1b5ec69be3d9ff Mon Sep 17 00:00:00 2001 From: meh Date: Thu, 10 Sep 2026 00:02:29 +0700 Subject: [PATCH] refactor: take the control surface from the protocol, not the runtime AgencyZero registered its relaunch handler through `tauri_runtime_blitz::set_agent_control_handler` and named the request types through that crate's `control_protocol` re-export. So the vocabulary an agent drives this application with arrived through a window runtime, and naming an `AgentControlRequest` meant compiling Tauri. A runtime bridges Tauri to Blitz and owns a native window. It does not proxy an inspection service, and it no longer exports one. This takes `blitz-control-protocol` directly, with default features: the vocabulary and the lifecycle handler, no engine and no transport. `tauri-runtime-blitz` stays, at `^0.4`. AgencyZero opens a window, so it wants the runtime for the reason the runtime exists. Not compiled here: its build script needs a frontend install this checkout does not have. --- apps/gui/Cargo.toml | 8 +++++++- apps/gui/src/main.rs | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/gui/Cargo.toml b/apps/gui/Cargo.toml index 32c1ce0c..69e8f741 100644 --- a/apps/gui/Cargo.toml +++ b/apps/gui/Cargo.toml @@ -27,6 +27,7 @@ blitz-runtime = [ "dep:blitz-script", "dep:brotli", "dep:tauri-runtime-blitz", + "dep:blitz-control-protocol", "dep:url", ] # Compile the full diagnostics capability into the binary. The engine-wide @@ -101,7 +102,12 @@ tauri = { version = "2", default-features = false, features = ["macos-private-ap # 0.1.0 the runtime's own feature forwards to `tauri` and `tauri-runtime`, so # naming it here agrees with that rather than being the only thing holding the # two sides together. -tauri-runtime-blitz = { version = "^0.3", optional = true, features = ["macos-private-api"] } +# The window runtime. AgencyZero opens one, so this stays; only the control +# surface left it, and that now comes from `blitz-control-protocol` directly. +tauri-runtime-blitz = { version = "^0.4", optional = true, features = ["macos-private-api"] } +# The control surface agents drive AgencyZero through. Default features only: +# the vocabulary and the lifecycle handler, no engine and no transport. +blitz-control-protocol = { version = "^0.5", optional = true, default-features = false } # # The engine by version, not by branch. Same move `chuzz` made, for the same # reasons its manifest records. diff --git a/apps/gui/src/main.rs b/apps/gui/src/main.rs index 3dec842b..e57c3490 100644 --- a/apps/gui/src/main.rs +++ b/apps/gui/src/main.rs @@ -2920,8 +2920,8 @@ fn main() { #[cfg(feature = "blitz-runtime")] { let relaunch_handle = app.handle().clone(); - tauri_runtime_blitz::set_agent_control_handler(move |request| match request { - tauri_runtime_blitz::control_protocol::AgentControlRequest::Relaunch => { + blitz_control_protocol::lifecycle::set_lifecycle_handler(move |request| match request { + blitz_control_protocol::AgentControlRequest::Relaunch => { let handle = relaunch_handle.clone(); tauri::async_runtime::spawn(async move { let state = handle.state::(); @@ -2933,10 +2933,10 @@ fn main() { ); } }); - tauri_runtime_blitz::control_protocol::DebugResponse::Ack + blitz_control_protocol::DebugResponse::Ack } - _ => tauri_runtime_blitz::control_protocol::DebugResponse::Error( - tauri_runtime_blitz::control_protocol::DebugError { + _ => blitz_control_protocol::DebugResponse::Error( + blitz_control_protocol::DebugError { code: "unsupportedEmbedderAction".into(), message: "AgencyZero delegates only relaunch to its restart Angel" .into(),