rdesktop_dev/lib.rs
1//! rdesktop-dev: Agent-first development server.
2//!
3//! This crate provides a browser-based development mode for rdesktop applications.
4//! Instead of opening a native window, it serves the frontend as a web page that
5//! AI agents can interact with using mature browser automation tools.
6//!
7//! ## Why Browser Mode for Development?
8//!
9//! AI agents (Claude, GPT, etc.) have excellent browser automation capabilities
10//! via Playwright/Puppeteer MCP tools, but very limited native desktop control.
11//! By serving the app in a browser during development, agents can:
12//!
13//! - Inspect the DOM directly (no screenshots needed)
14//! - Query elements by CSS selector or text content
15//! - Execute actions (click, type, scroll) with precise targeting
16//! - Take snapshots of the full application state
17//! - Run automated tests against the UI
18//!
19//! ## Agent API Endpoints
20//!
21//! When `agent_mode` is enabled, these endpoints are available:
22//!
23//! - `GET /__rdesktop__/agent/dom` - Full DOM snapshot as JSON
24//! - `GET /__rdesktop__/agent/elements?selector=...` - Query elements
25//! - `POST /__rdesktop__/agent/action` - Execute UI actions
26//! - `GET /__rdesktop__/agent/state` - Application state snapshot
27//! - `POST /__rdesktop__/agent/ipc` - Send IPC message from agent
28//! - `GET /__rdesktop__/agent/screenshot` - Capture current view
29//! - `POST /__rdesktop__/agent/recording/start` - Start or reuse the one video recording
30//! - `POST /__rdesktop__/agent/recording/stop` - Stop and finalize the recording
31//! - `GET /__rdesktop__/agent/recording/file` - Download the finalized recording
32
33pub mod agent_api;
34mod native_recorder;
35pub mod server;
36
37pub use server::{DevServer, PublishedScreenshot, ScreenshotPublisher};