Overview 📋
| Attribute | Value |
|---|---|
| Language | Rust (edition 2024) |
| Crate type | Binary (Air) + library (AirLibrary, for integration tests) |
| IPC | gRPC (tonic) on [::1]:50053, service AirService |
| Dependencies | tokio, tonic, tonic-prost, prost, reqwest, ring, sha2, Common, Mist, Vine |
| Managed by | Mountain ProcessManagement |
- A persistent
Rustsidecar process that runs alongsideMountain - Handles resource-intensive operations to keep the main editor process responsive
- Operations include: update management, file indexing, cryptographic operations, and background downloads
Architecture 🏗️
Air is structured around a central gRPC server that receives task delegation from Mountain. Internal modules handle distinct responsibilities.
Boundary and Ownership 🧱
Air owns work that is slow, background or security-sensitive. It does not own the window, the workbench or the extension host - those belong to Mountain, Wind/Sky and Cocoon.
| Concern | Owner | Where it lives in Air |
|---|---|---|
| Update check, download, verify | Air | Source/Updates/, Source/Downloader/ |
| Binary and payload signing | Air | Source/Authentication/, Source/Security/ |
| Workspace content indexing | Air | Source/Indexing/ |
| Download queue and resume | Air | Source/Downloader/ |
| Resource metrics and health | Air reports; Mountain decides | Source/Metrics/, Source/HealthCheck/ |
| Process spawn, restart, timeout | Mountain | not in Air |
| Window, workbench, extensions | Mountain, Wind/Sky, Cocoon | not in Air |
The boundary is two-way. Air serves AirService on [::1]:50053 for
Mountain to call, and it is also a client: Source/Mountain/MountainClient.rs
holds the connection it uses to send heartbeats and progress events back. That is
why the crate ships both a binary and a library - AirLibrary is what the
integration tests link against.
The module layout, the full RPC surface, the lifecycle, the configuration schema and the current limitations are Air - Deep Dive’s subject. This page states the role and the boundary.
Services 🔌
Update Manager 🔄
The update manager owns the full lifecycle of application updates:
| Phase | Operation | Description |
|---|---|---|
| Check | CheckForUpdate |
HTTP GET to update server for release manifest |
| Verify | VerifyChecksum |
SHA-256 verification of downloaded artifact |
| Stage | StageUpdate |
Cache update binary in staging directory |
| Apply | ApplyUpdate |
Replace running binary on next restart |
| Rollback | RollbackUpdate |
Restore previous version on failure |
Download Manager 📥
The resilient download manager handles extension downloads, language server binaries, and dependency fetching:
| Feature | Implementation |
|---|---|
| Resume | HTTP Range headers for partial download resume |
| Retry | Exponential backoff with configurable max attempts |
| Progress | Streaming progress reporting to Mountain via gRPC |
| Bandwidth | Configurable rate limiting per download |
| Concurrent | Parallel download queue with configurable concurrency |
Indexing Service 🔍
File indexing builds and maintains a searchable content index of the workspace:
- File system walker discovers files (respecting
.gitignoreand exclude patterns) - Language-aware content extraction (plain text, code tokens, symbols)
- Inverted index construction for fast text search
- Incremental indexing on file system change events
- Index persistence across daemon restarts
Authentication Service 🔐
Manages sensitive cryptographic operations:
- Binary signing for update authenticity verification
- Secure token storage for remote service authentication
- Login flow orchestration for cloud services
- Key generation and rotation for local encryption
Data Flow 📊
Update Check Flow 🔄
Download with Progress Flow 📥
Startup Sequence 🚀
sequenceDiagram
participant M as Mountain
participant A as Air
participant V as gRPC server ([::1]:50053)
M->>A: spawn detached via AirStart
Note over M,A: AIR_GRPC_ADDRESS, AIR_GRPC_BIND_ADDRESS, AIR_LOG_DIR
A->>A: parse CLI, initialise tracing, load Air.toml
A->>V: bind AirService
A->>M: MountainClient connects back
loop every 5 seconds
M->>A: Heartbeat
A->>M: Heartbeat + resource usage metrics
end
M->>A: dispatch background work
1. Mountain spawns Air via Binary/Service/AirStart.rs
- Sets AIR_GRPC_ADDRESS and AIR_GRPC_BIND_ADDRESS to [::1]:50053
- Sets AIR_LOG_DIR (default /tmp/air-log) and pipes stdout/stderr into
Mountain's dev log
- Spawns detached: Mountain holds no Child handle, so Air's lifecycle is
independent of Mountain's boot path
2. Air Binary::main() executes
- Parses CLI arguments
- Initializes tracing/logging
- Loads Air.toml (with hot-reload)
3. Air starts the gRPC server on [::1]:50053
- Registers the AirService handlers
- Begins listening for incoming connections
4. Air's MountainClient connects back
- Registers available capabilities and exchanges version information
5. Heartbeat monitoring begins
- Both sides send Heartbeat every 5 seconds
- Air includes resource usage metrics in its heartbeat
- Mountain detects timeout after 3 missed heartbeats
6. Air signals ready for task processing
- Mountain begins dispatching background work
Configuration ⚙️
Air reads one file, Air.toml, from the platform config directory -
<config_dir>/Air/Air.toml (~/Library/Application Support/Air/Air.toml on
macOS). The schema requires SchemaVersion and profile and groups the rest
into sections: grpc, download, indexing, logging, authentication,
performance, update. Any field can be overridden from the environment as
AIR_<SECTION>_<FIELD> - grpc.bind_address becomes
AIR_GRPC_BIND_ADDRESS, which is exactly what Mountain sets when it
spawns the daemon.
The full schema, the defaults and the hot-reload behaviour are on Air - Deep Dive.
Related Documentation 📖
- Common — Abstract core traits
- Mountain — Main backend application
- Mist — DNS isolation server
- Vine —
gRPCprotocol specification - BuildPipeline — Build pipeline
Funding 💎
Air is developed as part of the CodeEditorLand project, funded through the NGI0 Commons Fund, a grant programme of the European Commission’s Next Generation Internet initiative.
Project Maintainers: Source Open (Source/[email protected]) | GitHub Repository | Report an Issue
The record this page documents, as the site files it: the six facts the claim is checked against, and the three files the manual names to check it.
WORKING, 06
- FORM:
- BACKGROUND SERVICE
- WRITTEN IN:
- RUST
- BOUNDARY:
- LOOPBACK DAEMON
- DEPENDS ON:
- MOUNTAIN
- MANUAL:
- /DOC/DEEP-DIVE-AIR
- EVIDENCE:
- MANIFEST PLACEHOLDER PLATE NOT IN BUILD
# TRACE / AIR 03 STEPS
- 01
Source/Binary.rsTHE DAEMON BINARY - 02
Source/HTTP/Client.rsTHE UPDATE CLIENT - 03
Source/Library.rsWHAT THE CRATE EXPORTS
SOURCE: /DOC/DEEP-DIVE-AIR