Expand description
§Mountain: Native Backend for Code Editor Land
Mountain replaces Electron with Rust and Tauri. It manages windows, file systems, processes, and extensions at native speed. Where Electron takes milliseconds, Mountain responds in microseconds.
§What Mountain Does
- Hosts the editor UI via Tauri webview (no Chromium process overhead)
- Runs VS Code extensions by managing the Cocoon sidecar over gRPC
- Handles file I/O through native async Rust (tokio), not Node.js
fs - Manages terminals via native PTY (
portable-pty), not shell wrappers - Stores secrets in the OS keychain (
keyringcrate), not plaintext
§Architecture
Mountain uses a declarative effect system defined in Common. Business
logic is expressed as ActionEffects executed by the ApplicationRunTime.
All state lives in a single thread-safe ApplicationState managed by Tauri.
Wind/Sky (UI) ──Tauri commands──> Mountain ──gRPC──> Cocoon (extensions)
│
├── Environment providers (file, process, terminal)
├── ApplicationRunTime (effect executor)
└── ApplicationState (shared state)§Module Layout
§Core Infrastructure
ApplicationState: Centralized, thread-safe state for the entire appEnvironment: Capability providers (file system, processes, extensions)RunTime: Effect execution engine that runsActionEffectpipelines
§Communication
IPC: Inter-process communication primitivesAir: Client for the background daemon (updates, crypto signing)Vine: gRPC server/client for Cocoon extension host communicationRPC: Remote procedure call service implementations
§Services
ProcessManagement: Sidecar process lifecycle (launch, monitor, restart)FileSystem: Native TreeView provider for the File ExplorerExtensionManagement: Extension discovery, scanning, and activation
§Commands
Command: Native command handlers (file, edit, view, terminal)Track: Central command dispatcher routing UI requests to providersWorkspace:.code-workspacefile parsing and multi-root support
§Related Crates
| Crate | Role |
|---|---|
Common | Abstract traits and DTOs that Mountain implements |
Echo | Work-stealing task scheduler used by Mountain’s runtime |
Air | Background daemon that Mountain communicates with |
§Getting Started
Mountain builds as part of the Land monorepo:
cargo build -p MountainFull setup: https://github.com/CodeEditorLand/Land
Modules§
- Air
- Air (Air Integration Module)
- Application
State - ApplicationState Module
- Binary
- Binary Module
- Command
- Command Module
- Environment
- Environment Module
- Error
- Centralized error handling system
- Extension
Management - Extension Management Module
- File
System - FileSystem Module
- IPC
- IPC Module
- Process
Management - Process Management Module
- RPC
- Mountain RPC Services
- RunTime
- RunTime Module
- Track
- Track Module
- Vine
- Vine gRPC Module
- Workspace
- Workspace Module
Macros§
- Trace
Step - Logs a checkpoint message at TRACE level (for “every step” tracing).
- dev_log
- Log a tagged dev message. Only prints if the tag is enabled via LAND_DEV_LOG.
- impl_
provider - Macro to generate
Requires<T>trait implementations for MountainEnvironment. - otel_
span - Convenience macro: emit an OTLP span for an IPC handler.
Usage:
otel_span!("file:readFile", StartNano, &[("path", &SomePath)]);
Functions§
- main
- Main entry point for both mobile and desktop builds.