Skip to main content

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
30pub mod server;
31pub mod agent_api;
32
33pub use server::DevServer;