feat(desktop): native terminal session driver (VAPP-87) #96
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VAPP-87-native-transport-terminal"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
First native desktop session driver (VAPP-87). The desktop app ships every release but its Terminal/Files/Remote-desktop panes were wasm-only and gated to "unavailable, use the web console" (VAPP-86). This makes the Terminal pane open a live session on the desktop build, matching the web console.
How
native_relay::connect): dials vervain-server's relay withtokio-tungstenite(ws:// or wss://, rustls) and splits it into a write/read half. Reusable by the Files and Remote-desktop drivers next.imp_nativeinterminal.rs): drives the same vendored xterm.js inside the desktop webview over thedocument::evalbidirectional bridge, speaking the identical relay wire protocol as the wasm path ('c'rendezvous ->"1"+optionsenvelope; PTY Binary frames ->term.write;onData-> Binary frames;onResize->termsizecontrol envelope). Runs as a Dioxusspawntask (polled inside dioxus-desktop's tokio runtime, so tokio I/O works); dropping the pane cancels it, drops the socket, and the agent kills the PTY.TermHandleis now three-way: wasm (unchanged), desktop-native (new), no-op SSR stub (not(feature = "desktop")).tunnel_gate_guard'sPANES, so the guard and the pane can't drift. Files and Remote-desktop keep their gate until their native drivers land.No new dependencies:
tokio-tungstenite(rustls, ws+wss) andfutures-utilwere already in the non-wasm dependency set.Verification
cargo check+cargo clippyon thedesktopfeature: green.just pre-commit): fmt,clippy --features server -D warnings, server check,check --target wasm32-unknown-unknown, and all 102 tests (including the updatedtunnel_gate_guard) pass.Scope
PR1 of 3 for VAPP-87. Files and Remote-desktop follow on the same shared transport.
🤖 Generated with Claude Code
Closing: wrong premise. Live testing on a real desktop run showed the "desktop" app runs the wasm web client inside a webview (
http://127.0.0.1:<port>servingvervain-app_bg.wasm), not native dioxus-desktop rendering. Soweb_sysis present,Terminal(xterm.js) loads, and the wasm session drivers execute - the relay even connects and rendezvouses with the agent (server logs:stashed -> joined existing relay -> ate protocol byte).That invalidates the VAPP-87 premise this PR is built on ("dioxus-desktop runs natively, so web_sys is absent, rewrite the drivers in Rust"). A native
document::eval+ tokio-tungstenite driver never executes in this architecture - it's dead code.The genuine bug is wasm-side: the Terminal pane churns/reconnects in the webview (new tunnel every few seconds,
WebSocket CLOSING/CLOSED, blank pane). Re-investigating that under VAPP-87 with the corrected understanding. Not merging this.Closing: wrong premise. Live testing on a real desktop run showed the "desktop" app runs the wasm web client inside a webview (http://127.0.0.1: serving vervain-app_bg.wasm), not native dioxus-desktop rendering. So web_sys is present, xterm.js loads, and the wasm session drivers execute; the relay even connects and rendezvouses with the agent (server logs: stashed -> joined existing relay -> ate protocol byte).
That invalidates the VAPP-87 premise this PR is built on ("dioxus-desktop runs natively, so web_sys is absent, rewrite the drivers in Rust"). A native document::eval + tokio-tungstenite driver never executes in this architecture.
The genuine bug is wasm-side: the Terminal pane churns/reconnects in the webview (new tunnel every few seconds, WebSocket CLOSING/CLOSED, blank pane). Re-investigating under VAPP-87 with the corrected understanding.