Skip to content

Commit f9d1272

Browse files
1 parent 065ee6b commit f9d1272

1 file changed

Lines changed: 85 additions & 137 deletions

File tree

README.md

Lines changed: 85 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -53,203 +53,151 @@
5353

5454
---
5555

56-
# **Mountain**⛰️
56+
# **Mountain** ⛰️
5757

58-
The Bedrock of Land: Native Backend & Service Host
58+
> **The RAM tax is not optional.** VS Code with a medium project: 500 MB to
59+
> 1.5 GB of RAM. Three open windows means three Chromium renderer processes,
60+
> each carrying a full heap. Every OS interaction crosses a serialized JSON IPC
61+
> pipe.
5962
60-
[![License: CC0-1.0](https://img.shields.io/badge/License-CC0_1.0-lightgrey.svg)](https://github.com/CodeEditorLand/Mountain/tree/Current/LICENSE)
61-
[![Rust Version](https://img.shields.io/badge/Rust-1.77+-blue.svg)](https://www.rust-lang.org/)
62-
[![Tauri Version](https://img.shields.io/badge/Tauri-v2-blue.svg)](https://tauri.app/)
63-
[![Tonic gRPC Version](https://img.shields.io/badge/Tonic-v0.11-blueviolet.svg)](https://github.com/hyperium/tonic)
64-
65-
Mountain is the native process manager that replaces Electron. Built with Rust
66-
and Tauri, it handles windows, files, processes, and extensions at native speed.
67-
Where Electron takes milliseconds, Mountain responds in microseconds.
68-
69-
Your editor starts faster, uses less RAM, and stays responsive with hundreds of
70-
files open.
63+
_"Where Electron takes 200 ms to open a dialog, Mountain takes 2."_
7164

72-
**What Mountain gives you:**
65+
[![License: CC0-1.0](https://img.shields.io/badge/License-CC0_1.0-lightgrey.svg)](https://github.com/CodeEditorLand/Mountain/tree/Current/LICENSE)
66+
[<img src="https://cdn.simpleicons.org/rust" width="14" alt="Rust" />](https://www.rust-lang.org/)&#x2001;[![Rust Version](https://img.shields.io/badge/Rust-1.77+-blue.svg)](https://www.rust-lang.org/)
67+
[<img src="https://cdn.simpleicons.org/tauri/24C8D8" width="14" alt="Tauri" />](https://tauri.app/)&#x2001;[![Tauri Version](https://img.shields.io/badge/Tauri-v2-blue.svg)](https://tauri.app/)
68+
[<img src="https://cdn.simpleicons.org/grpc" width="14" alt="gRPC" />](https://grpc.io/)&#x2001;[![Tonic gRPC Version](https://img.shields.io/badge/Tonic-v0.11-blueviolet.svg)](https://github.com/hyperium/tonic)
7369

74-
1. **No Electron overhead.** Tauri's webview is lightweight. No separate Chromium
75-
process, no 300 MB base memory footprint.
76-
2. **Native file I/O.** Async Rust (tokio) handles filesystem operations. File
77-
trees load instantly even on large monorepos.
78-
3. **Your VS Code extensions work.** Mountain manages the Cocoon sidecar over
79-
gRPC. Extensions run unchanged in Node.js with sub-millisecond IPC.
80-
4. **Secrets stay in the OS keychain.** Authentication tokens are stored via the
81-
native keychain (`keyring` crate), not in plaintext config files.
70+
Mountain replaces Electron's main process entirely with a Rust binary using
71+
Tauri. The OS's own WebView renders the UI: WKWebView on macOS, WebView2 on
72+
Windows, WebKitGTK on Linux. No bundled Chromium. No Node.js in the host
73+
process. Window management, file system access, process lifecycle, and auth
74+
tokens all happen in Rust with zero IPC overhead. Cold start in under 200 ms.
75+
RAM footprint 60-80% smaller per window.
8276

8377
📖 **[Rust API Documentation](https://Rust.Documentation.Mountain.Editor.Land/)**
8478

8579
---
8680

87-
## Key Features 🔐
88-
89-
- **Composable business logic.** Operations are expressed as declarative
90-
`ActionEffect`s executed by a central runtime. Testable, composable, no
91-
spaghetti callbacks.
92-
- **Type-safe extension IPC.** Extensions talk to Mountain over gRPC (tonic).
93-
Sub-millisecond round trips, no JSON serialization overhead, full type safety.
94-
- **One source of truth.** A single thread-safe `ApplicationState` holds the
95-
entire app state. No stale caches, no out-of-sync views.
96-
- **Real terminal, not a wrapper.** Native PTY management via `portable-pty`.
97-
Shell autocompletion, cursor movement, and colors work exactly as expected.
98-
- **OS keychain for secrets.** Tokens stored via `keyring`, not in plaintext
99-
JSON files that any process can read.
81+
## What It Does&#x2001;🔐
82+
83+
- **No Electron overhead.** Tauri's WebView replaces three Chromium renderer
84+
processes. No 300 MB base memory footprint.
85+
- **Native file I/O.** Async Rust (tokio) handles filesystem operations. File
86+
trees load instantly even on large monorepos.
87+
- **Your VS Code extensions work.** Mountain manages the Cocoon sidecar over
88+
gRPC. Extensions run unchanged with sub-millisecond IPC.
89+
- **Secrets stay in the OS keychain.** Authentication tokens stored via
90+
`keyring`, not in plaintext config files.
91+
- **Composable business logic.** Operations expressed as declarative
92+
`ActionEffect`s. Testable, composable, no spaghetti callbacks.
10093
- **Instant command dispatch.** A central `Track` dispatcher routes every UI
101-
action to the right provider. Native commands run directly. Extension commands
102-
proxy over gRPC. The UI never waits.
103-
104-
---
105-
106-
## Core Architecture Principles 🏗️
107-
108-
| Principle | Description | Key Components Involved |
109-
| :------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- |
110-
| **Implementation of Contracts** | Faithfully implement the abstract service `trait`s defined in the `Common` crate, providing the concrete logic for the application's architecture. | `Environment/*` providers |
111-
| **Separation of Concerns** | Isolate service logic into distinct `Environment` provider modules, each responsible for a specific domain (e.g., FileSystem, Documents). | `Environment/*`, `Command/*` |
112-
| **Declarative Logic** | Express complex operations as `ActionEffect`s, which are executed by the `ApplicationRunTime`. This makes logic composable, testable, and robust. | `RunTime/*`, `Track/EffectCreation.rs`, `Common` |
113-
| **Centralized State** | Maintain a single, thread-safe `ApplicationState` struct managed by Tauri to ensure data consistency across the entire application. | `ApplicationState/*` |
114-
| **Secure & Performant IPC** | Utilize gRPC for all communication with the `Cocoon` sidecar, ensuring a well-defined and high-performance API boundary. | `Vine/*` |
115-
| **User Interface-Backend Decoupling** | Interact with the `Wind` frontend exclusively through asynchronous Tauri commands and events, ensuring the backend is User Interface-agnostic. | `Binary.rs` (invoke handler), `Command/*` |
94+
action to the right provider. The UI never waits.
11695

11796
---
11897

119-
## Deep Dive & Component Breakdown 🔬
98+
## Architecture&#x2001;🏗️
12099

121-
To understand how `Mountain`'s internal components are structured and how they
122-
implement the application's core logic, please refer to the detailed technical
123-
breakdown in
124-
[`Documentation/GitHub/DeepDive.md`](https://github.com/CodeEditorLand/Mountain/tree/Current/Documentation/GitHub/DeepDive.md).
100+
| Principle | Description | Key Components |
101+
| :--- | :--- | :--- |
102+
| Implementation of Contracts | Implements abstract service traits from Common | `Environment/*` providers |
103+
| Separation of Concerns | Each domain isolated in its own provider module | `Environment/*`, `Command/*` |
104+
| Declarative Logic | Operations as `ActionEffect`s executed by the runtime | `RunTime/*`, `Track/EffectCreation.rs` |
105+
| Centralized State | Single thread-safe `ApplicationState` | `ApplicationState/*` |
106+
| Typed IPC | gRPC for all Cocoon communication | `Vine/*` |
107+
| UI-Backend Decoupling | Tauri commands and events, backend is UI-agnostic | `Binary.rs`, `Command/*` |
125108

126-
This document explains the roles of the `ApplicationRunTime`,
127-
`ApplicationState`, `Handler`, `Environment`, and the `Vine` gRPC layer.
109+
[Deep Dive](https://github.com/CodeEditorLand/Mountain/tree/Current/Documentation/GitHub/DeepDive.md)
128110

129111
---
130112

131-
## `Mountain` in the Land Ecosystem ⛰️ + 🏞️
132-
133-
This diagram illustrates `Mountain`'s central role as the native orchestrator
134-
for the entire Land application.
113+
## In the Ecosystem&#x2001;⛰️ + 🏞️
135114

136115
```mermaid
137116
graph LR
138-
classDef Mountain fill:#f9f,stroke:#333,stroke-width:2px;
139-
classDef Cocoon fill:#ccf,stroke:#333,stroke-width:2px;
140-
classDef Wind fill:#9cf,stroke:#333,stroke-width:2px;
141-
classDef Common fill:#cfc,stroke:#333,stroke-width:1px;
142-
classDef IPC fill:#ff9,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5;
143-
144-
subgraph "Mountain (Native Rust/Tauri Backend)"
145-
TauriRuntime[Tauri App & Window]:::Mountain
146-
ApplicationRunTime[ApplicationRunTime Engine]:::Mountain
147-
ApplicationState["ApplicationState (Shared State)"]:::Mountain
117+
classDef Mountain fill:#f9f,stroke:#333,stroke-width:2px
118+
classDef Cocoon fill:#ccf,stroke:#333,stroke-width:2px
119+
classDef Wind fill:#9cf,stroke:#333,stroke-width:2px
120+
classDef Common fill:#cfc,stroke:#333,stroke-width:1px
121+
classDef IPC fill:#ff9,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
122+
123+
subgraph "Mountain (Rust/Tauri Backend)"
124+
TauriRuntime[Tauri App]:::Mountain
125+
ApplicationRunTime[ApplicationRunTime]:::Mountain
126+
ApplicationState[ApplicationState]:::Mountain
148127
TrackDispatcher[Track Dispatcher]:::Mountain
149128
VinegRPC[Vine gRPC Server]:::IPC
150129
EnvironmentProviders[Environment Providers]:::Mountain
151-
CommonCrate["Common Crate (Traits & DTOs)"]:::Common
152-
153-
TauriRuntime -- Manages --> ApplicationState
154-
TauriRuntime -- Manages --> ApplicationRunTime
155-
ApplicationRunTime -- Executes effects via --> EnvironmentProviders
156-
TrackDispatcher -- Routes requests to --> ApplicationRunTime
157130
end
158131
159132
subgraph "Clients"
160-
WindUI["Wind/Sky User Interface (Webview)"]:::Wind
161-
CocoonSideCar["Cocoon Extension Host (Node.js)"]:::Cocoon
133+
WindUI[Wind/Sky UI]:::Wind
134+
CocoonSideCar[Cocoon Extension Host]:::Cocoon
162135
end
163136
137+
TauriRuntime -- Manages --> ApplicationState
138+
TauriRuntime -- Manages --> ApplicationRunTime
139+
ApplicationRunTime -- Executes --> EnvironmentProviders
140+
TrackDispatcher -- Routes --> ApplicationRunTime
164141
TauriRuntime -- Hosts --> WindUI
165142
WindUI -- Tauri Command --> TrackDispatcher
166143
TrackDispatcher -- Tauri Events --> WindUI
167-
168-
VinegRPC -- gRPC Protocol <--> CocoonSideCar; class VinegRPC,CocoonSideCar IPC
169-
VinegRPC -- Forwards requests to --> TrackDispatcher
170-
171-
EnvironmentProviders -- Implements traits from --> CommonCrate
144+
VinegRPC -- gRPC --> CocoonSideCar
145+
VinegRPC -- Forwards --> TrackDispatcher
172146
```
173147

174148
---
175149

176-
## Project Structure Overview 🗺️
177-
178-
The `Mountain` repository is organized to clearly separate concerns, following
179-
the architectural patterns defined in `Common`.
150+
## Project Structure&#x2001;🗺️
180151

181152
```
182153
Mountain/
183154
├── Source/
184-
│ ├── Binary.rs # Tauri application entry point and setup.
185-
│ ├── ApplicationState/ # Central, thread-safe state store and its DTOs.
186-
│ ├── Command/ # Tauri command handlers for UI-specific requests.
187-
│ ├── Environment/ # Concrete implementations of the `Common` provider traits.
188-
│ ├── ExtensionManagement/ # Logic for scanning and parsing extensions.
189-
│ ├── FileSystem/ # Native TreeView provider for the File Explorer.
190-
│ ├── ProcessManagement/ # Logic for managing the `Cocoon` sidecar process.
191-
│ ├── RunTime/ # The `ApplicationRunTime` engine that executes effects.
192-
│ ├── Track/ # The central request dispatcher (`EffectCreation`).
193-
│ ├── Update/ # Application self-updating logic.
194-
│ ├── Vine/ # The gRPC server and client implementation (`tonic`).
195-
│ └── Workspace/ # Logic for handling `.code-workspace` files.
155+
│ ├── Binary.rs # Tauri entry point
156+
│ ├── ApplicationState/ # Thread-safe state store
157+
│ ├── Command/ # Tauri command handlers
158+
│ ├── Environment/ # Common trait implementations
159+
│ ├── ExtensionManagement/ # Extension scanning and parsing
160+
│ ├── FileSystem/ # Native TreeView provider
161+
│ ├── ProcessManagement/ # Cocoon sidecar lifecycle
162+
│ ├── RunTime/ # Effect execution engine
163+
│ ├── Track/ # Central request dispatcher
164+
│ ├── Update/ # Self-updating logic
165+
│ ├── Vine/ # gRPC server/client (tonic)
166+
│ └── Workspace/ # .code-workspace handling
196167
├── Proto/
197-
│ └── Vine.proto # The gRPC contract definition file.
198-
└── build.rs # Build script to compile the .proto file into Rust code.
168+
│ └── Vine.proto # gRPC contract definition
169+
└── build.rs # Proto compilation
199170
```
200171

201172
---
202173

203-
## Development Setup 🛠️
204-
205-
`Mountain` is a Rust crate and a core component of the main `Land` repository.
206-
It is not intended to be built or run standalone. Please follow the instructions
207-
in the main [Land Repository README](https://github.com/CodeEditorLand/Land) to
208-
set up, build, and run the entire application.
209-
210-
**Key Dependencies:**
174+
## Development&#x2001;🛠️
211175

212-
- `Common` (local path dependency).
213-
- `Echo` (local path dependency).
214-
- `keyring`: For secure secret storage.
215-
- `log` & `env_logger`: For logging.
216-
- `portable-pty`: For the integrated terminal feature.
217-
- `serde` & `serde_json`: For serialization.
218-
- `tauri`: `^2.x`
219-
- `tokio`: For the asynchronous RunTime.
220-
- `tonic`: For the gRPC server implementation.
176+
Mountain is a Rust crate within the Land workspace. Follow the
177+
[Land Repository](https://github.com/CodeEditorLand/Land) instructions to
178+
build and run.
221179

222180
---
223181

224-
## License⚖️
182+
## License&#x2001;⚖️
225183

226-
This project is released into the public domain under the **Creative Commons CC0
227-
Universal** license.
228-
229-
You are free to use, modify, distribute, and build upon this work for any
230-
purpose, without any restrictions. For the full legal text, see the
231-
[`LICENSE`](https://github.com/CodeEditorLand/Mountain/tree/Current/) file.
184+
CC0 1.0 Universal. Public domain. No restrictions.
185+
[LICENSE](https://github.com/CodeEditorLand/Mountain/tree/Current/LICENSE)
232186

233187
---
234188

235-
## Changelog 📜
236-
237-
Stay updated with our progress! See
238-
[`CHANGELOG.md`](https://github.com/CodeEditorLand/Mountain/tree/Current/) for a
239-
history of changes specific to **Mountain**.
240-
241-
---
242-
243-
244189
## See Also
245190

191+
- [Mountain Documentation](https://editor.land/Doc/mountain)
246192
- [Architecture Overview](https://editor.land/Doc/architecture)
193+
- [Why Rust](https://editor.land/Doc/why-rust)
194+
- [Why Tauri](https://editor.land/Doc/why-tauri)
247195
- [Cocoon](https://github.com/CodeEditorLand/Cocoon)
248-
- [Air](https://github.com/CodeEditorLand/Air)
249196
- [Vine](https://github.com/CodeEditorLand/Vine)
250197
- [Echo](https://github.com/CodeEditorLand/Echo)
198+
- [Air](https://github.com/CodeEditorLand/Air)
251199

252-
## Funding & Acknowledgements🙏🏻
200+
## Funding & Acknowledgements&#x2001;🙏🏻
253201

254202
**Mountain** is a core element of the **Land** ecosystem. This project is funded
255203
through [NGI0 Commons Fund](https://NLnet.NL/Commonsfund), a fund established by

0 commit comments

Comments
 (0)