Architecture of vercel-labs/agent-desktop
vercel-labs/agent-desktop is 3,449 source files holding 37,087 symbols across 8 modules, written mainly in Rust, Python, Shell. The largest module is crates, with 2,643 files, and 15 files are entry points into the dependency graph.
How agent-desktop fits together
Input enters through the agent-desktop command-line tool in src, which the same binary can also run as an MCP server when started with the mcp subcommand. Both the CLI and the C library run the same core, found in crates/core, a Rust library behind the commands that click, type, read and wait on controls, with its entry point in crates/core/src/lib.rs. The crates/ffi crate exposes that core as a C ABI shared library, so other programs can run commands in process instead of starting the CLI for each command. Each binary is built for one operating system and talks to that system's accessibility API, and crates/linux reads and acts on Linux applications through AT-SPI, the accessibility bus.
Largest modules
- crates: 2,643 files and 308,161 lines of code
- tests: 227 files and 25,467 lines of code
- src: 106 files and 13,155 lines of code
- probes: 60 files and 12,953 lines of code
- scripts: 52 files and 6,438 lines of code
- apps: 32 files and 685 lines of code
- npm: 4 files and 595 lines of code
- .githooks: 1 file and 127 lines of code
Languages
By file count: Rust 2,781 files, Python 166 files, Shell 55 files, JavaScript 33 files, TypeScript 30 files, C# 27 files.
Documentation
Repowise documents agent-desktop in 3,034 pages generated from the source, 74 of them written explanations of the repository and its modules. Module guides include:
- crates/core/src/tree: Accessibility Tree and Waiting
- crates/linux/src/actions: Actions Overview
- crates/core/src/system: Application Inventory and Lookup
- crates/core/src/actionability: Automation Core Library
- crates/core: Core
More on agent-desktop: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos