Module Map
The Rust workspace is split into focused crates plus the frontend and Tauri shell.
| Module | Role |
|---|---|
server/ | Desk server: REST API (Actix-Web), WebRTC, settings, file/terminal management (supports ServiceDaemon and SessionWorker modes). The AI diagnostic orchestrator lives in server/src/diagnose/ (collect → redact → model → render), with model adapters in server/src/diagnose/model/ (openai.rs / anthropic.rs). |
signal/ | Signaling server + TURN. |
signal-facade/ | Shared signaling protocol models. |
turn/ | TURN / STUN service (bundled with the signaling server). |
vite-project/ | React 19 + TanStack Query frontend — management UI and the web control client (includes the AI settings page and diagnostic panel). |
tauri-app/ | Tauri shell for locally-rendered Privacy Screen / Whiteboard on the controlled machine. |
agent-protocol/ | Device capability protocol (desk-agent-protocol): wire types + DeviceAgent trait + audit / diagnose / exec protocol. Pure protocol, no platform impl; the server is the sole source of truth for all trusted fields. |
mcp-server/ | Read-only MCP service (desk-mcp-server): rmcp SDK + stdio, a static whitelist of read-only tools (no exec/write/control). |
capture-engine/ | Screen / audio capture and encoding. |
input-injection/ | Mouse / keyboard injection and clipboard control. |
ipc-protocol/ | IPC message definitions for daemon ↔ worker. |
virtual-display/ | Virtual display (IddCx) userspace abstraction (desk-virtual-display). |
virtual-display-driver-ops/ | Virtual display driver install / uninstall wrapper. |
server-user/ | Server-side user / account models. |
utils/ | Common utilities. |
server-version/ | API version constants. |
Adding a New REST API
- Define models in
server/src/model/. - Implement logic in
server/src/service/. - Add route handlers with
utoipaannotations inserver/src/controller/. - Register routes in
server/src/main.rs. - Run the OpenAPI update script to regenerate the frontend client.
Adding a New Signaling Type
- Add a new variant (with a unique integer value) to
SignalingTypeinsignal-facade/src/model/signal.rs. - Handle it in
handle_messageinsignal/src/service.rs— add a forwarding branch or a dedicated match arm. Never add a_ =>catch-all (exhaustiveness is compiler-enforced). - Update the frontend: regenerate the client, then add an
onMessagehandler in the frontend RTC hook.