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
- Client for the Air background daemon (updates and crypto signing).
- Application
State - Centralized, thread-safe application state managed by Tauri.
- Binary
- Binary entry points for desktop and mobile builds.
- Cache
- MemoryMap asset cache, path-canonicalisation cache, and future entries.
See
Cachemodule index for the full entry list. Mountain caching primitives. - Command
- Native command handlers for file, edit, view, and terminal operations. Commands registered at startup and dispatched via Tauri invoke handlers. Commands are grouped by domain and delegate to providers through the effect system.
- Environment
- Capability providers: file system, process, terminal, and extension host.
- Error
- Local error taxonomy (superseded; zero callers - see
CommonLibrary::Error::CommonError). Local error stack - currently unused. - Extension
Management - Extension discovery, scanning, and activation.
Extension lifecycle: scan bundled + user-installed extension trees, parse
their
package.jsonmanifests, install VSIX archives. Mountain owns the discovery surface; activation runs in Cocoon over gRPC. - File
System - Native TreeView provider for the File Explorer.
Native file-explorer surface for the workspace sidebar. Mountain owns the
tree-view provider; URIs flow through
CommonLibrary::FileSystemtraits. - IPC
- Inter-process communication primitives. Inter-process communication for the Mountain application, handling communication between the Tauri frontend and the Rust backend through Tauri commands, WebSocket, and custom message formats.
- Land
FixTier - Emits a single ISO-timestamped boot banner listing all compiled-in tier values.
- Process
Management - Sidecar process lifecycle: launch, monitor, and restart.
- RPC
- Remote procedure call service implementations.
Mountain RPC services. The active surface is
CocoonService- the tonic server impl that Cocoon dials into. The other modules here (EchoAction,Commands,Workspace,Configuration, plus theWindows/Terminals/Debug/SCM/Processes/Telemetrycfg-feature shells) are scaffolding for the multi-extension-host roadmap; most carry zero external callers today. - RunTime
- Effect execution engine that drives
ActionEffectpipelines. Effect execution engine for the Mountain application. Provides the runtime environment for executing effects through the Echo scheduler. - Track
- Central command dispatcher routing UI requests to the correct provider. Central request dispatcher that routes commands from the Sky frontend and Cocoon sidecar into strongly-typed ActionEffects executed by the runtime.
- Vine
- gRPC server and client for Cocoon extension host communication.
- Workspace
.code-workspacefile parsing and multi-root workspace support. Workspace lifecycle:.code-workspaceparsing, multi-root folder resolution, workspace-scoped configuration. ImplementsCommonLibrary::Workspace::WorkspaceProvideroverApplicationState.
Macros§
- Trace
Step - Logs a checkpoint message at TRACE level (for “every step” tracing).
- dev_log
- Tag-gated dev log. Compiled out in release builds.
- impl_
provider - Macro to generate
Requires<dyn T>trait implementations forMountainEnvironment. - otel_
span - Convenience macro: emit an OTLP span for an IPC handler.
Usage:
otel_span!("file:readFile", StartNano, &[("path", &Path)]);
Functions§
- main
- Main entry point for both mobile and desktop builds.