Skip to content

CodeEditorLand/Air

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

384 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Air πŸͺ

Update
Issue
Star
Download

The Native Background Daemon for Landβ€πŸžοΈ

VS Code cold-starts slowly because everything initializes fresh each launch. Updates require a full restart that kills open terminals and in-progress work. There is no mechanism to pre-stage work between sessions.

"The next version is already downloaded and verified before you decide to update. The main window never blocks waiting for a download."

License: CC0-1.0 Rust Crates.io Rust Rust Version

Rust API Documentationβ€πŸ“–


Overview

Air is the lightweight, persistent daemon that powers the background capabilities of the Land Code Editor. While Mountain ⛰️ handles the core application logic and UI, Air operates as a specialized sidecar process dedicated to heavy lifting, network operations, and system maintenance. It ensures that the main editor remains responsive by offloading resource-intensive tasks such as updates, large downloads, cryptographic signing, and file indexing.

VS Code cold-starts slowly because everything initializes fresh each launch, and updates require a full restart. Air solves this by running as a persistent background process that survives window closures, pre-stages updates, and keeps a warm file index across sessions - so the editor is always ready the moment you launch it.

Air is engineered to:

  1. Serve as the Persistent Background Daemon - Run as a standalone process alongside Mountain ⛰️, surviving window closures and maintaining background services across sessions via Daemon/ singleton enforcement and platform-native daemonization.
  2. Own the Update Lifecycle - Take full ownership of downloading, verifying, and applying patches for Land without user interruption or restart prompts, with staged installation and automatic rollback via Updates/.
  3. Offload Heavy Network Operations - Act as the traffic manager for large downloads (extensions, language servers, dependencies) with resilient, resume-capable transfers through Downloader/ and Resilience/.
  4. Isolate Security-Critical Operations - Manage cryptographic signing, secure credential storage, and authentication token lifecycle via Security/ and Authentication/, keeping sensitive logic isolated from the main application process.

Key Features πŸͺ

gRPC Native Communication - All inter-process communication with Mountain ⛰️ travels over a Vineβ€πŸŒΏ (tonic-based gRPC) channel on [::1]:50053, providing strongly-typed protobuf contracts, bi-directional streaming for progress events, and a well-defined API surface generated from Air.proto.

Self-Contained Daemon Lifecycle - Runs as an independent process with singleton enforcement via PID locking in Daemon/, graceful shutdown on SIGTERM managed by Binary/Shutdown/WaitForShutdownSignal.rs, and platform-native daemonization on macOS, Linux, and Windows. Survives window closures and persists across editor sessions.

Resilient Update Engine - Full ownership of the update lifecycle: version checking against multiple channels (stable, beta, nightly) in Updates/, concurrent chunked downloads with resume capability in Downloader/, cryptographic checksum verification via Security/ChecksumVerifier.rs, staged installation, and automatic rollback on failure via Updates/RollbackState.rs.

Isolated Security Boundaries - Cryptographic signing with ring, AEAD encrypted credential storage with zeroize in Security/SecureStorage.rs, token lifecycle management in Authentication/, rate limiting via token bucket in Security/TokenBucket.rs, and a comprehensive security audit subsystem in Security/SecurityAuditor.rs - all isolated from the main application process.

Real-Time File Indexing - Persistent file index with Rust and TypeScript symbol extraction in Indexing/Language/, recursive directory scanning via Indexing/Scan/, notify-based file system watching for live updates in Indexing/Watch/, and a fast query engine with fuzzy search across the entire workspace in Indexing/Store/.

Observability by Default - Structured JSON logging with trace-ID propagation in Logging/, OpenTelemetry-compatible distributed tracing with configurable sampling in Tracing/, and Prometheus-compatible metrics for latency, success rates, and resource utilization across every service in Metrics/.

Resilience Everywhere - All network operations are wrapped in retry-with- exponential-backoff via Resilience/Retry.rs, circuit breakers with half-open probing in Resilience/CircuitBreaker.rs, bulkhead executors for service isolation in Resilience/BulkheadExecutor.rs, and configurable timeouts via Resilience/Timeout.rs.


Core Architecture Principlesβ€πŸ—οΈ

Principle Description Key Components
Sidecar Isolation Run as a standalone daemon process, surviving independently of the main window lifecycle for persistent background operations. Daemon/, Binary/, PID locking
gRPC IPC Boundary Use Vineβ€πŸŒΏ (tonic-based gRPC) for all communication with Mountain ⛰️, ensuring a high-performance and well-defined API. Vine/, Air.proto, generated prost bindings
Service Modularity Each capability (updates, downloads, auth, indexing) lives in its own module with independent startup and health monitoring. Updates/, Downloader/, Authentication/, Indexing/
Resilience by Default Wrap all network operations in retry-with-backoff, circuit breakers, bulkheads, and timeouts via the shared Resilience/ library. Resilience/, HealthCheck/
Secure Credential Handling Never expose raw secrets; store credentials with AEAD encryption (ring), enforce key rotation, and audit all access. Security/, Authentication/, zeroize

System Architecture

graph LR
    classDef mountain fill:#f0d0ff,stroke:#9b59b6,stroke-width:2px,color:#2c0050;
    classDef air      fill:#e0f4ff,stroke:#2471a3,stroke-width:2px,color:#001040;
    classDef external fill:#ebebeb,stroke:#888,stroke-width:1px,stroke-dasharray:5 5,color:#333;
    classDef infra    fill:#fff3c0,stroke:#f39c12,stroke-width:1px,stroke-dasharray:5 5,color:#5a3e00;

    subgraph MOUNTAIN["Mountain ⛰️ - Main Application"]
        MountainIPC["Mountain gRPC client delegates heavy tasks"]:::mountain
    end

    subgraph AIR["Air πŸͺβ€- Persistent Background Daemon (::1:50053)"]
        direction TB
        subgraph COMM["Vine/ - gRPC Transport"]
            VineServer["Vine/Server/ - gRPC server (Generated/ prost bindings)"]:::air
            MountainClient["Mountain gRPC client (Air β†’ Mountain callbacks)"]:::air
        end
        subgraph CORE["Core Services"]
            Updates["Updates/ - version check, download, verify, staged install, rollback"]:::air
            Downloader["Downloader/ - parallel chunks, rate-limit, resume, retry"]:::air
            Auth["Authentication/ - token mgmt, AEAD encrypt, key rotation"]:::air
            Indexing["Indexing/ - file index, symbol extract, FS watch, search"]:::air
        end
        subgraph INFRA["Infrastructure"]
            Health["HealthCheck/ - Alive/Responsive/Functional, auto-recovery"]:::infra
            Resilience["Resilience/ - retry backoff, circuit breaker, bulkhead"]:::infra
            Metrics["Metrics/ - Prometheus-compatible, latency, success rate"]:::infra
            Security["Security/ - AES-GCM, checksum, audit"]:::infra
            Daemon["Daemon/ - PID lock, singleton enforce"]:::air
        end

        VineServer --> Updates
        VineServer --> Downloader
        VineServer --> Auth
        VineServer --> Indexing
        Updates --> Resilience
        Downloader --> Resilience
    end

    subgraph EXTERNAL["Externalβ€β˜οΈ"]
        UpdateSrv["Update servers / extension registry"]:::external
    end

    MountainIPC -- gRPC :50053 --> VineServer
    MountainClient -- progress events --> MountainIPC
    Updates -- fetches --> UpdateSrv
    Downloader -- downloads --> UpdateSrv
Loading

Connection paths:

Path Protocol Use Case
Mountain ⛰️ β†’ Air πŸͺ via gRPC protobuf over gRPC on port 50053 Delegate updates, downloads, indexing, auth
Air πŸͺ β†’ Mountain ⛰️ via gRPC callback protobuf over gRPC Progress events, health status, metrics
Air πŸͺ β†’ External via HTTP HTTPS with Mistβ€πŸŒ«οΈ DNS isolation Update servers, extension registries

Key Components

Component Path Description
Binary Entry Point Source/Binary.rs Binary entry point for the Air daemon
Library Root Source/Library.rs Module declarations and crate-level exports
Daemon Lifecycle Source/Binary/ Daemon process lifecycle (startup, shutdown, monitoring)
Singleton Enforcer Source/Daemon/ Singleton enforcement, PID locking, platform-native integration
Initialization Source/Initialize/ Configuration, port binding, gRPC server construction, per-service startup
CLI Interface Source/CLI/ Command-line interface for daemon interaction and diagnostics
gRPC Client Source/Client/ Typed gRPC client (AirClient) and service provider (AirServiceProvider) for Mountain ⛰️ interaction
gRPC Protocol Source/Vine/ gRPC protocol implementation (generated prost bindings, server, errors)
Application State Source/ApplicationState/ Central coordination (connections, service states, telemetry, resources)
Configuration Source/Configuration/ TOML config loading with schema validation, env overrides, hot reload
Updates Source/Updates/ Version checking, download, verification, staged install, rollback
Downloader Source/Downloader/ Parallel downloads, chunk transfers, rate limiting, resume capability
Authentication Source/Authentication/ Token management, credential storage, AEAD encryption, key rotation
Indexing Engine Source/Indexing/ File index, symbol extraction, scanning, persistent storage, FS watch
Health Check Source/HealthCheck/ Multi-level health monitoring (alive, responsive, functional) with auto-recovery
Logging Source/Logging/ Structured JSON logging with trace-ID propagation, rotation, sensitive data filtering
Metrics Source/Metrics/ Prometheus-compatible metrics (latency, success rate, resource usage)
Resilience Source/Resilience/ Retry with exponential backoff, circuit breaker, bulkhead, timeout management
Security Source/Security/ Checksum verification, AES-GCM credential storage, rate limiting, audit subsystem
Tracing Source/Tracing/ Distributed tracing with sampling, span events, context propagation
HTTP Client Source/HTTP/ Secure HTTP client with custom DNS via Mistβ€πŸŒ«οΈ, TLS, timeout management
Mountain Bridge Source/Mountain/ Client for Mountain ⛰️ callbacks with TLS configuration
Plugin System Source/Plugins/ Plugin discovery, loading, sandboxing, event bus, and capability management

Project Structureβ€πŸ—ΊοΈ

Element/Air/
β”œβ”€β”€ Cargo.toml                    # Package manifest with feature flags
β”œβ”€β”€ build.rs                      # Build script (tonic/prost codegen)
β”œβ”€β”€ LICENSE                       # CC0-1.0 license
β”œβ”€β”€ Source/
β”‚   β”œβ”€β”€ Binary.rs                 # Binary entry point
β”‚   β”œβ”€β”€ Library.rs                # Library root (rlib)
β”‚   β”œβ”€β”€ DevLog.rs                 # Development logging utilities
β”‚   β”œβ”€β”€ ApplicationState/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ ApplicationState.rs   # Central application state
β”‚   β”‚   β”œβ”€β”€ ConnectionHealthReport.rs
β”‚   β”‚   β”œβ”€β”€ ConnectionInfo.rs
β”‚   β”‚   β”œβ”€β”€ ConnectionType.rs
β”‚   β”‚   β”œβ”€β”€ PerformanceMetrics.rs
β”‚   β”‚   β”œβ”€β”€ RequestState.rs
β”‚   β”‚   β”œβ”€β”€ RequestStatus.rs
β”‚   β”‚   β”œβ”€β”€ ResourceUsage.rs
β”‚   β”‚   └── ServiceStatus.rs
β”‚   β”œβ”€β”€ Authentication/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ AuthenticationService.rs
β”‚   β”‚   β”œβ”€β”€ AuthSession.rs
β”‚   β”‚   β”œβ”€β”€ CredentialsStore.rs
β”‚   β”‚   └── CryptoKeys.rs
β”‚   β”œβ”€β”€ Binary/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ Binary.rs             # Binary initialization
β”‚   β”‚   β”œβ”€β”€ Monitor/
β”‚   β”‚   β”‚   └── StartMonitoring.rs
β”‚   β”‚   └── Shutdown/
β”‚   β”‚       └── WaitForShutdownSignal.rs
β”‚   β”œβ”€β”€ CLI/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ CliHandler.rs
β”‚   β”‚   β”œβ”€β”€ CliParser.rs
β”‚   β”‚   β”œβ”€β”€ CommandTypes.rs
β”‚   β”‚   β”œβ”€β”€ DaemonClient.rs
β”‚   β”‚   β”œβ”€β”€ OutputFormat.rs
β”‚   β”‚   β”œβ”€β”€ OutputFormatter.rs
β”‚   β”‚   β”œβ”€β”€ ResponseTypes.rs
β”‚   β”‚   └── Tests.rs
β”‚   β”œβ”€β”€ Client/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ AirClient/            # Typed gRPC client methods
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ AirMetrics.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ AirStatus.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ ApplyUpdate.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ Authenticate.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ CheckForUpdates.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ DownloadFile.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ DownloadStream.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ DownloadStreamChunk.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ DownloadStreamRpc.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ DownloadUpdate.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ ExtendedFileInfo.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ FileInfo.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ FileResult.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ GetConfiguration.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ GetFileInfo.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ GetMetrics.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ GetResourceUsage.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ GetStatus.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ HealthCheck.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ IndexFiles.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ IndexInfo.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ ResourceUsage.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchFiles.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ SetResourceLimits.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ UpdateConfiguration.rs
β”‚   β”‚   β”‚   └── UpdateInfo.rs
β”‚   β”‚   └── AirServiceProvider/   # Service provider implementations
β”‚   β”‚       β”œβ”€β”€ mod.rs
β”‚   β”‚       β”œβ”€β”€ ApplyUpdate.rs
β”‚   β”‚       β”œβ”€β”€ Authenticate.rs
β”‚   β”‚       β”œβ”€β”€ CheckForUpdates.rs
β”‚   β”‚       β”œβ”€β”€ DownloadFile.rs
β”‚   β”‚       β”œβ”€β”€ DownloadStream.rs
β”‚   β”‚       β”œβ”€β”€ DownloadUpdate.rs
β”‚   β”‚       β”œβ”€β”€ GenerateRequestID.rs
β”‚   β”‚       β”œβ”€β”€ GetConfiguration.rs
β”‚   β”‚       β”œβ”€β”€ GetFileInfo.rs
β”‚   β”‚       β”œβ”€β”€ GetMetrics.rs
β”‚   β”‚       β”œβ”€β”€ GetResourceUsage.rs
β”‚   β”‚       β”œβ”€β”€ GetStatus.rs
β”‚   β”‚       β”œβ”€β”€ HealthCheck.rs
β”‚   β”‚       β”œβ”€β”€ IndexFiles.rs
β”‚   β”‚       β”œβ”€β”€ SearchFiles.rs
β”‚   β”‚       β”œβ”€β”€ SetResourceLimits.rs
β”‚   β”‚       └── UpdateConfiguration.rs
β”‚   β”œβ”€β”€ Configuration/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ AirConfiguration.rs
β”‚   β”‚   β”œβ”€β”€ ConfigurationManager.rs
β”‚   β”‚   β”œβ”€β”€ HotReload.rs
β”‚   β”‚   β”œβ”€β”€ Schema.rs
β”‚   β”‚   └── Tests.rs
β”‚   β”œβ”€β”€ Daemon/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ DaemonManager.rs
β”‚   β”‚   β”œβ”€β”€ DaemonStatus.rs
β”‚   β”‚   β”œβ”€β”€ ExitCode.rs
β”‚   β”‚   β”œβ”€β”€ Platform.rs
β”‚   β”‚   └── PlatformInfo.rs
β”‚   β”œβ”€β”€ Downloader/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ DownloadManager.rs
β”‚   β”‚   β”œβ”€β”€ RateLimit.rs
β”‚   β”‚   └── Types.rs
β”‚   β”œβ”€β”€ HealthCheck/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ DegradationLevel.rs
β”‚   β”‚   β”œβ”€β”€ HealthCheckConfig.rs
β”‚   β”‚   β”œβ”€β”€ HealthCheckLevel.rs
β”‚   β”‚   β”œβ”€β”€ HealthCheckManager.rs
β”‚   β”‚   β”œβ”€β”€ HealthCheckRecord.rs
β”‚   β”‚   β”œβ”€β”€ HealthCheckResponse.rs
β”‚   β”‚   β”œβ”€β”€ HealthStatistics.rs
β”‚   β”‚   β”œβ”€β”€ HealthStatus.rs
β”‚   β”‚   β”œβ”€β”€ PerformanceIndicators.rs
β”‚   β”‚   β”œβ”€β”€ RecoveryAction.rs
β”‚   β”‚   β”œβ”€β”€ RecoveryActionType.rs
β”‚   β”‚   β”œβ”€β”€ RecoveryTrigger.rs
β”‚   β”‚   β”œβ”€β”€ ResourceWarning.rs
β”‚   β”‚   β”œβ”€β”€ ResourceWarningType.rs
β”‚   β”‚   β”œβ”€β”€ ServiceHealth.rs
β”‚   β”‚   └── WarningSeverity.rs
β”‚   β”œβ”€β”€ HTTP/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   └── Client.rs
β”‚   β”œβ”€β”€ Indexing/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ FileIndexer.rs
β”‚   β”‚   β”œβ”€β”€ IndexResult.rs
β”‚   β”‚   β”œβ”€β”€ Background/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   └── StartWatcher.rs
β”‚   β”‚   β”œβ”€β”€ Language/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ ParseRust.rs
β”‚   β”‚   β”‚   └── ParseTypeScript.rs
β”‚   β”‚   β”œβ”€β”€ Process/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ ExtractSymbols.rs
β”‚   β”‚   β”‚   └── ProcessContent.rs
β”‚   β”‚   β”œβ”€β”€ Scan/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ ScanDirectory.rs
β”‚   β”‚   β”‚   └── ScanFile.rs
β”‚   β”‚   β”œβ”€β”€ State/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ CreateState.rs
β”‚   β”‚   β”‚   └── UpdateState.rs
β”‚   β”‚   β”œβ”€β”€ Store/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ QueryIndex.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ StoreEntry.rs
β”‚   β”‚   β”‚   └── UpdateIndex.rs
β”‚   β”‚   └── Watch/
β”‚   β”‚       β”œβ”€β”€ mod.rs
β”‚   β”‚       └── WatchFile.rs
β”‚   β”œβ”€β”€ Initialize/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ Build/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   └── BuildServer.rs
β”‚   β”‚   β”œβ”€β”€ Command/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ Connect/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   β”‚   └── ConnectDaemon.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ HandleCommand.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ ParseArguments.rs
β”‚   β”‚   β”‚   └── ValidateCommand.rs
β”‚   β”‚   β”œβ”€β”€ Configure/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ Log/
β”‚   β”‚   β”‚   β”‚   └── ConfigureLog.rs
β”‚   β”‚   β”‚   └── Port/
β”‚   β”‚   β”‚       └── SelectPort.rs
β”‚   β”‚   └── Service/
β”‚   β”‚       β”œβ”€β”€ mod.rs
β”‚   β”‚       β”œβ”€β”€ Auth/
β”‚   β”‚       β”‚   └── StartAuth.rs
β”‚   β”‚       β”œβ”€β”€ Download/
β”‚   β”‚       β”‚   └── StartDownload.rs
β”‚   β”‚       β”œβ”€β”€ Echo/
β”‚   β”‚       β”‚   └── StartEcho.rs
β”‚   β”‚       β”œβ”€β”€ Health/
β”‚   β”‚       β”‚   └── StartHealthCheck.rs
β”‚   β”‚       β”œβ”€β”€ Index/
β”‚   β”‚       β”‚   └── StartIndex.rs
β”‚   β”‚       β”œβ”€β”€ State/
β”‚   β”‚       β”‚   └── CreateState.rs
β”‚   β”‚       β”œβ”€β”€ Update/
β”‚   β”‚       β”‚   └── StartUpdate.rs
β”‚   β”‚       └── Vine/
β”‚   β”‚           └── StartService.rs
β”‚   β”œβ”€β”€ Logging/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ ContextLogger.rs
β”‚   β”‚   β”œβ”€β”€ LogContext.rs
β”‚   β”‚   β”œβ”€β”€ LogManager.rs
β”‚   β”‚   β”œβ”€β”€ LogRotationConfig.rs
β”‚   β”‚   β”œβ”€β”€ SensitiveDataConfig.rs
β”‚   β”‚   β”œβ”€β”€ SensitiveDataFilter.rs
β”‚   β”‚   └── StructuredLogEntry.rs
β”‚   β”œβ”€β”€ Metrics/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ AggregationValidator.rs
β”‚   β”‚   β”œβ”€β”€ GetMetrics.rs
β”‚   β”‚   β”œβ”€β”€ MetricGuard.rs
β”‚   β”‚   β”œβ”€β”€ MetricsCollector.rs
β”‚   β”‚   β”œβ”€β”€ MetricsData.rs
β”‚   β”‚   └── MinMaxUpdate.rs
β”‚   β”œβ”€β”€ Mountain/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ Constants.rs
β”‚   β”‚   β”œβ”€β”€ MountainClient.rs
β”‚   β”‚   β”œβ”€β”€ MountainClientConfig.rs
β”‚   β”‚   └── TlsConfig.rs
β”‚   β”œβ”€β”€ Plugins/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ ApiVersion.rs
β”‚   β”‚   β”œβ”€β”€ EventBus.rs
β”‚   β”‚   β”œβ”€β”€ Plugin.rs
β”‚   β”‚   β”œβ”€β”€ PluginCapability.rs
β”‚   β”‚   β”œβ”€β”€ PluginDependency.rs
β”‚   β”‚   β”œβ”€β”€ PluginDiscoveryResult.rs
β”‚   β”‚   β”œβ”€β”€ PluginHooks.rs
β”‚   β”‚   β”œβ”€β”€ PluginInfo.rs
β”‚   β”‚   β”œβ”€β”€ PluginLoader.rs
β”‚   β”‚   β”œβ”€β”€ PluginManager.rs
β”‚   β”‚   β”œβ”€β”€ PluginManifest.rs
β”‚   β”‚   β”œβ”€β”€ PluginMessage.rs
β”‚   β”‚   β”œβ”€β”€ PluginMetadata.rs
β”‚   β”‚   β”œβ”€β”€ PluginPermission.rs
β”‚   β”‚   β”œβ”€β”€ PluginRegistry.rs
β”‚   β”‚   β”œβ”€β”€ PluginSandboxConfig.rs
β”‚   β”‚   β”œβ”€β”€ PluginSandboxManager.rs
β”‚   β”‚   β”œβ”€β”€ PluginState.rs
β”‚   β”‚   β”œβ”€β”€ PluginValidationResult.rs
β”‚   β”‚   └── Test.rs
β”‚   β”œβ”€β”€ Resilience/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ BulkheadConfig.rs
β”‚   β”‚   β”œβ”€β”€ BulkheadExecutor.rs
β”‚   β”‚   β”œβ”€β”€ BulkheadStatistics.rs
β”‚   β”‚   β”œβ”€β”€ CircuitBreaker.rs
β”‚   β”‚   β”œβ”€β”€ CircuitBreakerConfig.rs
β”‚   β”‚   β”œβ”€β”€ CircuitEvent.rs
β”‚   β”‚   β”œβ”€β”€ CircuitState.rs
β”‚   β”‚   β”œβ”€β”€ CircuitStatistics.rs
β”‚   β”‚   β”œβ”€β”€ ResilienceOrchestrator.rs
β”‚   β”‚   β”œβ”€β”€ ResilienceTests.rs
β”‚   β”‚   β”œβ”€β”€ Retry.rs
β”‚   β”‚   └── Timeout.rs
β”‚   β”œβ”€β”€ Security/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ ChecksumVerifier.rs
β”‚   β”‚   β”œβ”€β”€ RateLimitConfig.rs
β”‚   β”‚   β”œβ”€β”€ RateLimiter.rs
β”‚   β”‚   β”œβ”€β”€ RateLimitStatus.rs
β”‚   β”‚   β”œβ”€β”€ SecureBytes.rs
β”‚   β”‚   β”œβ”€β”€ SecureStorage.rs
β”‚   β”‚   β”œβ”€β”€ SecurityAuditor.rs
β”‚   β”‚   β”œβ”€β”€ SecurityEvent.rs
β”‚   β”‚   β”œβ”€β”€ SecurityEventType.rs
β”‚   β”‚   β”œβ”€β”€ SecuritySeverity.rs
β”‚   β”‚   β”œβ”€β”€ SecurityTests.rs
β”‚   β”‚   └── TokenBucket.rs
β”‚   β”œβ”€β”€ Tracing/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ PropagationContext.rs
β”‚   β”‚   β”œβ”€β”€ SamplingConfig.rs
β”‚   β”‚   β”œβ”€β”€ SpanEvent.rs
β”‚   β”‚   β”œβ”€β”€ SpanStatus.rs
β”‚   β”‚   β”œβ”€β”€ TraceGenerator.rs
β”‚   β”‚   β”œβ”€β”€ TraceMetadata.rs
β”‚   β”‚   β”œβ”€β”€ TraceSpan.rs
β”‚   β”‚   └── TraceStatistics.rs
β”‚   β”œβ”€β”€ Updates/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ ChecksumUtil.rs
β”‚   β”‚   β”œβ”€β”€ DownloadSession.rs
β”‚   β”‚   β”œβ”€β”€ InstallationStatus.rs
β”‚   β”‚   β”œβ”€β”€ PackageFormat.rs
β”‚   β”‚   β”œβ”€β”€ PlatformConfig.rs
β”‚   β”‚   β”œβ”€β”€ PlatformDetect.rs
β”‚   β”‚   β”œβ”€β”€ PlatformMetadata.rs
β”‚   β”‚   β”œβ”€β”€ RollbackHistory.rs
β”‚   β”‚   β”œβ”€β”€ RollbackState.rs
β”‚   β”‚   β”œβ”€β”€ Types.rs
β”‚   β”‚   β”œβ”€β”€ UpdateChannel.rs
β”‚   β”‚   β”œβ”€β”€ UpdateInfo.rs
β”‚   β”‚   β”œβ”€β”€ UpdateManager.rs
β”‚   β”‚   β”œβ”€β”€ UpdateStatus.rs
β”‚   β”‚   β”œβ”€β”€ UpdateTelemetry.rs
β”‚   β”‚   └── VersionCompare.rs
β”‚   └── Vine/
β”‚       β”œβ”€β”€ mod.rs
β”‚       β”œβ”€β”€ Error.rs
β”‚       β”œβ”€β”€ Generated/
β”‚       β”‚   β”œβ”€β”€ mod.rs
β”‚       β”‚   └── air.rs
β”‚       └── Server/
β”‚           β”œβ”€β”€ mod.rs
β”‚           └── AirVinegRPCService.rs
└── Documentation/
    β”œβ”€β”€ GitHub/
    β”‚   β”œβ”€β”€ Architecture.md
    β”‚   └── DeepDive.md
    └── Rust/
        └── doc/                  # Cargo doc output

In the Land Project

Air πŸͺ is the persistent background daemon for the Land ecosystem. It communicates with Mountain ⛰️ via Vineβ€πŸŒΏ (gRPC) on port [::1]:50053 and uses Mistβ€πŸŒ«οΈ for DNS isolation on its HTTP client.

Role Details
Daemon Process Persistent executable that runs independently of the main window, even after the window closes
Server Host Hosts a local gRPC server on [::1]:50053 to accept commands from Mountain ⛰️
Update Delegate Sole authority for modifying installation files of the parent application
Signer Handles cryptographic signing of artifacts and secure token storage for user login
Traffic Manager Proxy/downloader that keeps large network operations off the main renderer process
File Indexer Maintains a persistent file index with symbol extraction and fast search across the workspace
Health Monitor Periodically checks all service health with automatic recovery and degradation tracking

Port Allocation

Process Port Protocol Purpose
Air πŸͺ 50053 Vineβ€πŸŒΏ / Air.proto (gRPC) Daemon services - updates, downloads, indexing
Cocoonβ€πŸ¦‹ 50052 Vine.proto (gRPC) VS Code extension hosting

Air is part of the networking/IPC connectivity stack alongside Mistβ€πŸŒ«οΈ (DNS isolation) and Vineβ€πŸŒΏ (gRPC protocol layer).

Typical usage flow:

  1. Spawn: Mountain ⛰️ detects if Air&#no ;πŸͺ is running. If not, it spawns the binary.
  2. Connect: Mountain ⛰️ establishes a Vineβ€πŸŒΏ (gRPC) connection to Air πŸͺ's local port [::1]:50053.
  3. Delegate: When a user requests an update or large download, Mountain ⛰️ sends a command to Air πŸͺ and immediately returns control to the user.
  4. Monitor: Air πŸͺ emits progress events back to Mountain ⛰️ to update the UI status bars.

Getting Startedβ€πŸš€

Prerequisites

  • Rust 1.95.0 or later (edition 2024)
  • Protocol Buffer compiler (included via tonic-build build dependency)

Build

cd Element/Air
cargo build --release

Run

# Run with default settings
./Target/release/Air

# Or via cargo
cargo run --bin Air

Available Features

Feature Description
default Enables full-services and mtls
full-services Enables authentication, updates, downloader, indexing
authentication Token management and credential storage
updates Update lifecycle management
downloader Parallel chunked downloads with resume
indexing File indexing with symbol extraction
mtls Mutual TLS for gRPC connections
appimage AppImage package format support
deb Debian package format support
rpm RPM package format support

Build with Features

# Default features (full-services + `mTLS`)
cargo build --release

# Minimal daemon (no update/auth/indexing)
cargo build --release --no-default-features

# All features
cargo build --release --all-features

Key Dependencies

Crate / Package Purpose
tonic / prost gRPC server and Protocol Buffer code generation
Vineβ€πŸŒΏ Local path dependency - generated Air.proto gRPC contracts
Commonβ€πŸ§‘πŸ»β€πŸ­ Local path dependency - shared types and abstractions
Mistβ€πŸŒ«οΈ Local path dependency - DNS isolation for HTTP client
reqwest / rustls HTTPS downloads with TLS certificate verification
tokio Async runtime for concurrent I/O and task scheduling
notify / ignore File system event watching for real-time index updates
ring / zeroize Cryptographic signing and secure credential storage
tracing Structured JSON logging with span propagation
config / toml Configuration file loading with hot-reload support
sysinfo / systemstat System resource monitoring and health checks
walkdir / ignore Recursive directory traversal for file indexing

Securityβ€πŸ”’

Air enforces security at multiple layers, isolating sensitive operations from the main application process:

Layer Mechanism
Process Isolation Separate daemon process - cryptographic and auth logic never runs in the renderer
Network mTLS for gRPC connections, Mistβ€πŸŒ«οΈ DNS isolation for outbound HTTP
Credentials AEAD encryption via ring, zeroize-protected memory, key rotation
Rate Limiting Token bucket algorithm per-endpoint rate limiting
Checksum Verification All downloaded artifacts verified via SHA-256 / MD5 before installation
Audit Logging Security audit subsystem with severity-classified events
Singleton Enforcement PID locking prevents duplicate daemon instances

Compatibility

Air is designed to be compatible with:

Target Integration
Mountain ⛰️ Communicates via gRPC on port 50053 - delegates updates, downloads, indexing, auth
Vineβ€πŸŒΏ Uses Air.proto gRPC contracts for all inter-process communication
Mistβ€πŸŒ«οΈ Uses DNS isolation for all outbound HTTP requests
Cocoonβ€πŸ¦‹ Shares port allocation awareness - Cocoon occupies port 50052, Air occupies 50053
Echoβ€πŸ“£ StartEcho service initializes Echo task scheduling within the daemon process

API Reference


Related Documentation

  • Architecture Overview
    • Internal module structure
  • Deep Dive
    • In-depth technical details
  • Land Documentation - Complete documentation index
  • Mountain ⛰️ - Main application process - GitHub
  • Mistβ€πŸŒ«οΈ - DNS isolation for the private network - GitHub
  • Vineβ€πŸŒΏ - gRPC protocol layer - GitHub
  • Cocoonβ€πŸ¦‹ - Node.js/Effect-TS extension host - GitHub
  • Groveβ€πŸŒ³ - Rust/WASM extension host - GitHub
  • Echoβ€πŸ“£ - Task scheduler - GitHub
  • Commonβ€πŸ§‘πŸ»β€πŸ­ - Shared types and abstractions - GitHub

Licenseβ€βš–οΈ

This project is released into the public domain under the Creative Commons CC0 Universal license. You are free to use, modify, distribute, and build upon this work for any purpose, without any restrictions. For the full legal text, see the LICENSE file.


Changelogβ€πŸ“œ

Stay updated with our progress! See CHANGELOG.md for a history of changes.


Funding & Acknowledgementsβ€πŸ™πŸ»

Landβ€πŸžοΈ is proud to be an open-source endeavor. Our journey is significantly supported by the organizations and projects that believe in the future of open-source software.

This project is funded through NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

Land PlayForm NLnet NGI0 Commons Fund
Land PlayForm NLnet NGI0 Commons Fund

Project Maintainers: Source Open (Source/Open@editor.land) | GitHub Repository | Report an Issue | Security Policy

About

Air πŸͺ

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages