Monolex Architecture
Monolex is a next-generation AI-native terminal built on Tauri 2.0 with a unique hybrid architecture combining the best of Rust and TypeScript.High-Level Architecture
Key Components
PTY Daemon
Standalone Rust binary that survives app crashes. Manages PTY sessions via Unix sockets.
SessionActor
Lock-free concurrency pattern. Single owner of all session state eliminates deadlocks.
Native VTE Parser
Battle-tested native VTE parser. Fast native ANSI parsing in Rust.
xterm.js WebGL
GPU-accelerated rendering with direct buffer injection for maximum performance.
Why This Architecture?
The Problem with Traditional Terminals
Standard xterm.js architecture:Monolex’s Solution
Grid Mode v2 architecture:Core Principles
SMPC (Simplicity is Managed Part Chaos)
- Simple solutions over complex ones
- Each component has a single responsibility
- Let simplicity guide architecture
OFAC (Order is a Feature of Accepted Chaos)
- Accept complexity where it naturally emerges
- Let order emerge from well-designed constraints
- Don’t force patterns that don’t fit
Technology Stack
| Layer | Technology | Purpose |
|---|---|---|
| App Framework | Tauri 2.0 | Native app with web frontend |
| Backend | Rust | Performance-critical operations |
| Frontend | TypeScript | UI and user interaction |
| PTY Management | pty-daemon-rust | Session lifecycle, Unix sockets |
| VTE Parsing | Native Rust | ANSI sequence processing |
| Rendering | xterm.js WebGL | GPU-accelerated display |
| IPC | Tauri Events | Async communication |