Ship CodeTrial as a desktop app
CodeTrial now ships as a desktop app for macOS, Windows and Linux. The app is a Tauri 2 shell in desktop/ that runs the same codetrial web binary as a child process and shows it in one window on a fixed 127.0.0.1:3101, so no browser has to be opened by hand. Running the server as a child rather than linking it in keeps src/main.rs close to unchanged: the server gains three launcher options instead (--allowed-hosts, --data-dir, CODETRIAL_EXIT_WITH_STDIN), each an ordinary CLI option a non-desktop install can use too. The first launch asks for the LiveKit and Google keys on the server's Setup page, unless it was started from a terminal that already exports LIVEKIT_URL, LIVEKIT_API_KEY and LIVEKIT_API_SECRET (and optionally GOOGLE_API_KEY or GOOGLE_API_KEYS): those are written to the app's own config, checked as Setup checks them, and Setup is skipped. docs/desktop.md has the design, the file locations and the qualification list.
The page gets no native access at all; navigation, camera and microphone permission, downloads and the close check are all decided from outside the page. Where WebKitGTK is built without WebRTC (Ubuntu 24.04, Debian 12 and Arch as packaged), the app opens the interview in the default browser and keeps the server running. The app's own starting page uses the visual system the interview pages now share: the lobby's palette on a light system and the warm dark one otherwise, the violet accent, and the same radii and type steps.



Verified with scripts/test.sh at the tip: exit 0, 1751 Rust tests, with the desktop and shellcheck lanes skipped because this host has neither WebKitGTK nor shellcheck; both ran separately. In a Debian 12 container with WebKitGTK 4.1 under xvfb: desktop clippy with -D warnings, the desktop unit tests, a release build, and scripts/desktop-smoke.sh (Setup answers, a foreign Host is refused, and SIGKILL of the app takes the server with it). Every commit builds, passes clippy and passes the server tests on its own. The screenshots come from that container at the app's 1280x860 window, light and dark from the system scheme; the Setup page is the server's own and is not changed here.
Left out: GitHub sign-in and recording inside the window, signed installers, and automatic updates. An interview has not yet been run on real hardware in WKWebView, WebView2 or a WebRTC-enabled WebKitGTK; the checklist in docs/desktop.md is what a release needs before it is called more than a preview.
Closes #289
Summary by cubic
CodeTrial now ships as a desktop app for macOS, Windows, and Linux. It starts the existing server in a child process and displays it in one window, so users don't need to launch a terminal or open a browser themselves.
Server and security
- Adds
--data-dir,--allowed-hosts, andCODETRIAL_EXIT_WITH_STDINto isolate desktop state, reject unexpectedHostvalues, and stop the server if the app exits. - The app limits navigation and permissions; on WebKitGTK builds without WebRTC, interviews open in the default browser while the server stays running.
- Bounds CLI test runs so a server that hangs fails the test instead of timing out.
Build and releases
- Adds cross-platform installer builds and smoke tests; desktop prerelease tags publish separately from the CLI's rolling release.
- CI builds and tests the desktop crate when its files or the server launch contract change.