How arover/agenttars works
Project Type & Purpose
• This is a monorepo for a desktop GUI-agent platform built on Electron + React + TypeScript. It delivers two Electron apps under apps/:
• agent-tars – a “technical preview” multimodal AI agent, capable of web-page visual interpretation + command-line/file-system controls
• ui-tars – the flagship UI-TARS agent desktop, controlling your computer via natural language and a Vision-Language Model
• The remainder of the repo hosts supporting libraries (agent-infra, common, shared, operators, sdk, cli, electron-ipc, visualizer) and examples, all tied together with pnpm/Turbo for build/test orchestration.
File Structure Analysis
• Top-level folders:
• apps/ – two Electron apps (each with main, preload, renderer layers, build configs, resources)
• packages/ – modular libraries (agent infrastructure, CLI, SDK, operators, shared types/utils, visualizer, etc.)
• docs/, examples/ – documentation and usage samples
• scripts/, .github/, turbo.json, pnpm-workspace.yaml – CI/CD, release automation, monorepo tooling
• Patterns & Configs:
• Electron architecture: main (Node.js background), preload (IPC bridge), renderer (React UI)
• Plugin/Provider pattern for LLMs under agent-tars/src/main/llmProvider
• Micro-libraries for browser automation, search, logging, MCP (message/control protocol) servers & clients
• Workspace testing with Vitest, Playwright, e2e workflows, and CI pipelines under .github.
a. Main Components
• Electron Apps
• Agent-TARS Main Process
• Agent-TARS Renderer (React + Vite)
• UI-TARS Main Process
• UI-TARS Renderer (React + Vite)
• Preload/IPCs: bridges exposing safe APIs to renderer
• Core Libraries (packages/agent-infra, packages/common, packages/shared)
• SDK & CLI (packages/ui-tars/sdk, packages/ui-tars/cli)
• Operators & Electron-IPC (packages/ui-tars/operators/*, packages/ui-tars/electron-ipc)
• External Services
• LLM Providers (OpenAI, Anthropic, Mistral, Gemini, AzureOpenAI…)
• ModelScope platform (optional cloud deployment)
• Local OS (file system, browser automation, system permissions)
b. Relationships & Interactions
• Renderer → Preload → Main (data-flow for UI events, commands, results)
• Main → agent-infra/mcp-client → MCP servers (file system commands, shell commands, browser operations)
• Main → LLM provider modules (via ProviderFactory) → External LLM APIs
• Renderer calls UI services (chat session storage, file-permission service, agent flows)
• SDK/CLI consume shared packages to script or extend agent capabilities
• Operators plug into agent-infra to add new device/browser/file operations
c. Architectural Patterns & Principles
• Monorepo modularity: clear separation of concerns by package
• Plugin/provider for LLM engines – easy extension and configuration
• IPC boundary to sandbox renderer and expose only whitelisted APIs
• Event-driven flows in React for agent conversations and canvas replay
• Microservices style within local context: MCP servers for file/shell operations
d. Key Technologies & Frameworks
• Electron (main/preload/renderer splits)
• React + Vite (UI)
• TypeScript (all layers)
• pnpm & Turbo (monorepo, workspace management, caching)
• Vitest / Playwright (unit & e2e tests)
• Node.js (back-end services)
• Various LLM SDKs via HTTP/gRPC