feat(app): UDS bridge (channel/invoke/emit) + xterm.js terminal, M0 e2e works
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,31 @@
|
||||
mod bridge;
|
||||
|
||||
use tauri::Manager;
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.setup(|app| {
|
||||
let handle = app.handle().clone();
|
||||
// Connect the bridge on a tokio runtime, then manage it.
|
||||
tauri::async_runtime::block_on(async move {
|
||||
let bridge = bridge::Bridge::connect(handle.clone())
|
||||
.await
|
||||
.expect("failed to connect to spaceshd");
|
||||
handle.manage(bridge);
|
||||
});
|
||||
Ok(())
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
bridge::open,
|
||||
bridge::new_surface,
|
||||
bridge::input,
|
||||
bridge::resize,
|
||||
bridge::attach,
|
||||
bridge::detach,
|
||||
bridge::status,
|
||||
bridge::close_surface,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running spacesh");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user