Skip to main content

Deep Dive

Sky - Deep Dive

Technical architecture of the Sky UI component layer: Astro-based page routes, workbench variants, and integration with Wind and Mountain through Tauri.

Sky - Deep Dive

Sky renders the complete editor interface inside the Tauri webview using Astro. It consumes state and services from the Wind service layer and communicates with the Mountain Rust backend through Tauri IPC.

Architecture 🏗️

Sky is organized into three tiers:

Pages (Tauri webview entry points)
  |
  +-- Workbench Components (VSCode-compatible editor layout)
        |
        +-- Workbench Implementations (Browser/Mountain/Electron variants)
        +-- Function utilities (Debug, Shared, Meta, Markup)

Key Modules 📁

PathDescription
Source/pages/index.astroDefault entry point; selects workbench variant via environment variables
Source/pages/Mountain.astroA2 workbench page - recommended production entry point
Source/pages/Browser.astroA1 browser-only workbench
Source/pages/BrowserProxy.astroA1 workbench with service proxy
Source/pages/Electron.astroA3 workbench with Electron polyfills
Source/pages/Isolation.astroIsolated mode for extension sandboxing
Source/Workbench/Mountain.astroA2 workbench - loads VSCode UI with Mountain providers
Source/Workbench/Browser.astroA1 pure browser workbench
Source/Workbench/BrowserProxy/Bootstrap.tsEffect-TS runtime and services initialization
Source/Workbench/BrowserProxy/ServicesProxy.tsService proxy implementation
Source/Workbench/Electron/Polyfills.tsElectron compatibility shims
Source/Workbench/NLS.astroNatural language support
Source/Function/Debug.tsBuild-time debug utilities
Source/Function/Shared.tsShared runtime utilities
astro.config.tsAstro build config, Vite aliases, output to Target/

Startup Sequence 🚀

  1. Tauri loads the webview pointing at Sky’s built output.
  2. The page route reads environment variables and selects a workbench variant.
  3. Wind’s Preload.ts shims window.vscode globals before VSCode code runs.
  4. Wind bootstraps the Effect-TS service layer and establishes Tauri IPC.
  5. Sky components subscribe to Wind services for live state updates.
  6. Sky listens for Tauri events from Mountain (sky://terminal/data, sky://scm/update-group, sky://configuration/changed).

Data Flow 🔄

User interaction triggers a Sky component, which calls a Wind service method. Wind invokes a Tauri command, Mountain’s Rust handler processes it and returns. The result resolves through Wind back to Sky, which re-renders.

Workbench Variants 🖥️

VariantDescriptionStatus
A1 BrowserPure browser workbenchAvailable
A1 BrowserProxyBrowser workbench with service proxyAvailable
A2 MountainVSCode UI with Mountain providersRecommended
A3 ElectronWorkbench with Electron polyfillsAvailable
IsolationExtension sandboxing modeAvailable

When no variant flag is set, index.astro loads Workbench/Default.astro. The recommended deployment sets Mountain=true.

Integration Points 🔗

Connecting ElementDirectionMechanismDescription
WindInboundDirect importConsumes Wind Effect-TS services for business logic
MountainBidirectionalTauri IPC + EventsCommands via Tauri invoke; updates as Tauri events
OutputInboundStatic bundleVSCode core UI from @codeeditorland/output
WorkerInboundWeb Worker APIBackground processing from @codeeditorland/worker