Skip to content

CodeEditorLand/Sky

Skyβ€πŸŒŒ

Update
Issue
Star
Download

The Astro-based UI Component Layer for Landβ€πŸžοΈ

Sky renders VS Code's core workbench inside a Tauri WebView, surrounded by Astro pages and a bi-directional event bridge to Mountain ⛰️. Every variant - Browser, Electron, Mountain - loads the same workbench.js from @codeeditorland/output.

"The editor UI consumes Wind'sβ€πŸƒ Effect-TS services. State flows from Mountain through Wind into the DOM, not the other way around."

License: CC0-1.0 NPM Version Astro Version Effect Version

@codeeditorland/skyβ€πŸ“¦


Overview

Sky is the declarative UI component layer of the Landβ€πŸžοΈ Code Editor. Built with the Astro framework, Sky renders the editor interface - editor, side bar, activity bar, status bar, and panels - operating within the Tauri webview alongside Windβ€πŸƒ. It consumes state and services from the Wind service layer to display and manage the editor's visual presentation.

Sky loads VS Code's core workbench from @codeeditorland/output and surrounds it with Astro pages, a Tauri event bridge (SkyBridge), and a Vite/Rollup compilation pipeline that pre-compiles each variant into a bundled-workbench chunk. The index.astro entry point selects the active workbench at build time via environment variables, with conditional dynamic imports that prevent unused variants from entering Vite's module graph.

Sky is engineered to:

  1. Render the Editor UI - Display the full VS Code workbench with high visual fidelity inside a Tauri WebView, supporting themes, icons, and extension-provided UI contributions.
  2. Bridge Events Bi-Directionally - Route ~100 sky:// event channels between Mountain ⛰️ (Rust backend) and the workbench (JavaScript frontend) through SkyBridge, enabling real-time command dispatch, status updates, and UI state synchronization.
  3. Support Multiple Workbench Variants - Provide Browser (A1), Mountain-backed (A2, recommended), and Electron (A3) variants from a single codebase, selected at build time via environment variables with conditional dynamic imports.
  4. Optimize Delivery - Use Astro's static generation and selective hydration to minimize JavaScript payload, with @playform/compress and @playform/inline for post-build optimization.

Key Featuresβ€πŸš€

Multi-Variant Workbench System - Four rendering variants (Browser, Mountain, Electron, Bundled) selected at build time via environment variables. Conditional dynamic imports in index.astro ensure only the active variant enters Vite's module graph.

Variant Description
A1: Browser/BrowserProxy Browser workbench with optional service proxy
A2: Mountain (recommended) Browser workbench with Mountain-backed providers via full IPC chain
A3: Electron Electron workbench with WKWebView polyfills (requestIdleCallback, queryLocalFonts, __name, Blob patch)
Bundled Pre-compiled Vite/Rollup chunks under Target/Static/Bundled/<Variant>/

SkyBridge Event Router - A ~1,000-line event router subscribing to ~100 sky:// channels from Mountain ⛰️, with submodules for commands, status bar, output channels, diagnostics, SCM, debug, search, notifications, and more. Bi-directional communication via Tauri invoke + listen.

Astro Component Islands - Pages (index.astro, Mountain.astro, Electron.astro, BrowserProxy.astro, etc.) serve as route entry points, with workbench implementations as composable Astro components that hydrate selectively.

Deep Windβ€πŸƒ Integration - Consumes Wind's Effect-TS service layer directly. The Wind/Preload.ts shim sets up the ipcRenderer bridge and window.vscode namespace before the workbench loads.

WKWebView Polyfills - The Electron (A3) variant includes polyfills for requestIdleCallback, queryLocalFonts, __name, and Blob to match native VS Code behavior in Tauri's WKWebView on macOS.

Build Pipeline Integration - @playform/build, @playform/compress, and @playform/inline integrate with the ~2,000-line astro.config.ts to produce optimized, compressed bundles.


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

Principle Description Key Components
Compatibility High-fidelity VS Code UI rendering to maximize compatibility with extensions and workflows Workbench/*, Workbench/BrowserProxy/*, Workbench/Electron/*, @codeeditorland/output
Modularity Pages, workbenches, and layouts organized into distinct, cohesive modules with conditional imports pages/*, Workbench/*, Function/*
Performance Astro's static generation and selective hydration minimize JavaScript payload; compressed output Astro build system, Component Islands, @playform/compress
Integration Seamless connection with Windβ€πŸƒ services and Mountain ⛰️ backend through Tauri events and IPC SkyBridge, Bootstrap, Tauri event listeners
Maintainability UI state driven by Wind services for predictable data flow; clear boundary between rendering and logic Service consumption pattern, Event-driven updates

System Architecture

graph LR
    classDef sky      fill:#9cf,stroke:#2471a3,stroke-width:2px,color:#001040;
    classDef wind     fill:#ffe,stroke:#d4ac0d,stroke-width:2px,color:#3d3000;
    classDef tauri    fill:#fde,stroke:#c0392b,stroke-width:2px,color:#4a0010;
    classDef mountain fill:#f0d0ff,stroke:#9b59b6,stroke-width:2px,color:#2c0050;
    classDef external fill:#ebebeb,stroke:#888,stroke-dasharray:5 5,color:#333;
    classDef bridge   fill:#e8ffe8,stroke:#27ae60,stroke-width:1px,color:#0a3a0a;

    subgraph SKY["Skyβ€πŸŒŒ - Astro UI Layer (Tauri WebView)"]
        direction TB
        subgraph PAGES["pages/ - Route Entry Points"]
            IndexPage["index.astro - env-driven variant selector"]:::sky
            MountainPage["Mountain.astro - A2 recommendedβ€πŸ”οΈ"]:::sky
            ElectronPage["Electron.astro - A3 + WKWebView polyfills"]:::sky
            BrowserPage["BrowserProxy.astro - A1"]:::sky
            BundledPages["Bundled/ - pre-compiled variants"]:::sky
        end
        subgraph WORKBENCH["Workbench/ - Component Implementations"]
            ElectronWB["Electron/ - Layout Β· Bootstrap Β· Polyfills Β· SkyBridge"]:::sky
            BrowserProxyWB["BrowserProxy/ - Layout Β· Bootstrap Β· Services/Proxy"]:::sky
            BundledWB["Bundled/ - Browser Β· Electron Β· Sessions Β· Workbench"]:::sky
        end
        SkyBridge["Function/Sky/Bridge.ts - ~100 sky:// event channelsβ€πŸŒ‰"]:::bridge
    end

    subgraph WIND["Windβ€πŸƒ - Service Layer (same WebView)"]
        WindPreload["Preload.ts - ipcRenderer shim + window.vscode"]:::wind
        WindServices["Effect/Layers/TauriLiveLayer - 40+ servicesβ€βš‘"]:::wind
    end

    subgraph BACKEND["Tauri Shell + Mountain ⛰️"]
        TauriAPI["Tauri Window API + Events"]:::tauri
        MountainCore["Mountain - Rust Core"]:::mountain
    end

    subgraph OUTPUT["@codeeditorland/outputβ€πŸ“¦"]
        VSCodeUI["VS Code workbench.js + web.main.js"]:::external
    end

    IndexPage --> MountainPage
    IndexPage --> ElectronPage
    IndexPage --> BrowserPage
    MountainPage --> ElectronWB
    ElectronPage --> ElectronWB
    BrowserPage --> BrowserProxyWB
    IndexPage --> BundledPages
    BundledPages --> BundledWB
    ElectronWB --> WindPreload
    BrowserProxyWB --> WindPreload
    WindPreload --> WindServices
    ElectronWB -- loads --> VSCodeUI
    BrowserProxyWB -- loads --> VSCodeUI
    ElectronWB --> SkyBridge
    SkyBridge -- tauri listen sky:// --> TauriAPI
    WindServices -- tauri::invoke --> TauriAPI
    TauriAPI -- commands + events --> MountainCore
    MountainCore -- sky:// emit --> TauriAPI
Loading

Connection paths:

Path Protocol Use Case
Skyβ€πŸŒŒ β†’ Mountain ⛰️ via SkyBridge Tauri sky:// events + invoke Command dispatch, UI state sync, notifications
Sky β†’ @codeeditorland/outputβ€πŸ“¦ Static import / dynamic import() Load VS Code workbench.js bundles
Sky β†’ Windβ€πŸƒ Direct Effect-TS service calls Consume service layer state and effects
Wind β†’ Mountain Tauri invoke IPC command invocation
Mountain β†’ Sky Tauri emit sky:// Backend-to-frontend events
workbench β†’ SkyBridge window.__celBridge object Forward workbench requests to Mountain

Key Components

Component Path Description
index.astro Source/pages/index.astro Dynamic workbench entry point driven by environment variables
Mountain.astro Source/pages/Mountain.astro A2 (recommended) Mountain-backed provider page
Electron.astro Source/pages/Electron.astro A3 electron variant with polyfills
BrowserProxy.astro Source/pages/BrowserProxy.astro A1 browser workbench with service proxy
Bundled Pages Source/pages/Bundled/ Pre-compiled variant entry pages (Browser, Electron, Sessions, Workbench)
SkyBridge Source/Function/Sky/Bridge.ts ~1,000-line event router subscribing to ~100 sky:// channels from Mountain
SkyBridge Submodules Source/Function/Sky/Bridge/ Per-channel routers: Commands, Statusbar, Output, Diagnostics, SCM, Debug, Search, Notifications, etc.
Electron Workbench Source/Workbench/Electron/ A3 variant: Bootstrap, WKWebView polyfills, Workbench loader, SkyBridge, OTELBridge, Traceparent bridge
BrowserProxy Workbench Source/Workbench/BrowserProxy/ A1 variant: Bootstrap, Services/Proxy, Workbench loader, Wind preload
Mountain Workbench Source/Workbench/Mountain.astro A2 variant: Workbench loader with phase advance
Bundled Workbench Source/Workbench/Bundled/ Pre-compiled variants: Browser, Electron, Sessions, Workbench entries
astro.config.ts Source/astro.config.ts ~2,000-line Astro + Vite configuration orchestrating the build pipeline
Base Layout Source/Function/Markup/Base.astro Shared page layout with Content Security Policy
Build Utilities Source/Function/Build/VS/Code.ts Build pipeline utilities
Debug Source/Function/Debug.ts Build context logging
env.d.ts Source/env.d.ts TypeScript environment declarations

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

Sky/
β”œβ”€β”€ Source/
β”‚   β”œβ”€β”€ Function/
β”‚   β”‚   β”œβ”€β”€ Build/VS/Code.ts           # Build pipeline utilities
β”‚   β”‚   β”œβ”€β”€ Markup/Base.astro          # Shared page layout with CSP
β”‚   β”‚   β”œβ”€β”€ Meta.astro                 # Meta tag component
β”‚   β”‚   β”œβ”€β”€ Shared.ts                  # Bust cache, debug toggle
β”‚   β”‚   β”œβ”€β”€ Sky/Bridge.ts              # SkyBridge event router (~1,000 lines)
β”‚   β”‚   β”œβ”€β”€ Sky/Bridge/                # Router submodules (commands,
β”‚   β”‚   β”‚                              #   statusbar, output, diagnostics,
β”‚   β”‚   β”‚                              #   SCM, debug, search, and more)
β”‚   β”‚   β”œβ”€β”€ Debug.ts                   # Build context logging
β”‚   β”‚   └── SmokeTest/                 # Smoke test utilities
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ index.astro                # Dynamic workbench entry (env-driven)
β”‚   β”‚   β”œβ”€β”€ Browser.astro              # Direct browser workbench page
β”‚   β”‚   β”œβ”€β”€ BrowserProxy.astro         # A1: Browser + services proxy page
β”‚   β”‚   β”œβ”€β”€ Electron.astro             # A3: Electron + polyfills page
β”‚   β”‚   β”œβ”€β”€ Isolation.astro            # Tauri isolation hook
β”‚   β”‚   β”œβ”€β”€ Mountain.astro             # A2: Mountain providers page
β”‚   β”‚   β”‚                              #   (RECOMMENDED)
β”‚   β”‚   └── Bundled/
β”‚   β”‚       β”œβ”€β”€ Browser.astro          # Bundled browser variant entry
β”‚   β”‚       β”œβ”€β”€ Electron.astro         # Bundled electron variant entry
β”‚   β”‚       β”œβ”€β”€ Sessions.astro         # Bundled sessions variant entry
β”‚   β”‚       └── Workbench.astro        # Bundled workbench variant entry
β”‚   β”œβ”€β”€ Workbench/
β”‚   β”‚   β”œβ”€β”€ Browser.astro              # Minimal browser workbench loader
β”‚   β”‚   β”œβ”€β”€ BrowserTest.astro          # Test entry with smoke test driver
β”‚   β”‚   β”œβ”€β”€ Default.astro              # DEPRECATED entry point
β”‚   β”‚   β”œβ”€β”€ Mountain.astro             # A2 workbench with phase advance
β”‚   β”‚   β”œβ”€β”€ NLS.astro                  # NLS configuration script
β”‚   β”‚   β”œβ”€β”€ TelemetryBridge.astro      # PostHog telemetry script
β”‚   β”‚   β”œβ”€β”€ BrowserProxy/
β”‚   β”‚   β”‚   β”œβ”€β”€ Bootstrap.ts           # Effect-TS bootstrap
β”‚   β”‚   β”‚   β”œβ”€β”€ Layout.astro           # Sequential load: preload ->
β”‚   β”‚   β”‚   β”‚                          #   bootstrap -> workbench
β”‚   β”‚   β”‚   β”œβ”€β”€ Workbench.ts           # VS Code browser workbench loader
β”‚   β”‚   β”‚   β”œβ”€β”€ Services/Proxy.ts      # Mountain service proxy layer
β”‚   β”‚   β”‚   └── Wind/Preload.ts        # Wind environment shim
β”‚   β”‚   β”œβ”€β”€ Electron/
β”‚   β”‚   β”‚   β”œβ”€β”€ Bootstrap.ts           # Effect-TS bootstrap
β”‚   β”‚   β”‚   β”œβ”€β”€ Layout.astro           # Sequential: preload -> polyfills
β”‚   β”‚   β”‚   β”‚                          #   -> bootstrap -> workbench ->
β”‚   β”‚   β”‚   β”‚                          #   SkyBridge
β”‚   β”‚   β”‚   β”œβ”€β”€ Workbench.ts           # Electron workbench with
β”‚   β”‚   β”‚   β”‚                          #   WKWebView polyfills
β”‚   β”‚   β”‚   β”œβ”€β”€ Polyfills.ts           # requestIdleCallback,
β”‚   β”‚   β”‚   β”‚                          #   queryLocalFonts, __name, Blob
β”‚   β”‚   β”‚   β”œβ”€β”€ Wind/Preload.ts        # Wind environment shim
β”‚   β”‚   β”‚   β”œβ”€β”€ Traceparent/Bridge.ts  # Traceparent propagation
β”‚   β”‚   β”‚   β”œβ”€β”€ OTELBridge.ts          # OpenTelemetry bridge
β”‚   β”‚   β”‚   β”œβ”€β”€ Post/Hog/Bridge.ts     # PostHog analytics bridge
β”‚   β”‚   β”‚   β”œβ”€β”€ WorkerBundleImports.astro
β”‚   β”‚   β”‚   └── Extension/Change/
β”‚   β”‚   β”‚       └── Subscriber.ts
β”‚   β”‚   └── Bundled/
β”‚   β”‚       β”œβ”€β”€ Browser/               # Bundled browser variant
β”‚   β”‚       β”œβ”€β”€ Electron/              # Bundled electron variant
β”‚   β”‚       β”œβ”€β”€ Sessions/              # Bundled sessions variant
β”‚   β”‚       └── Workbench/             # Bundled workbench variant
β”‚   └── env.d.ts                       # TypeScript environment
β”‚                                      #   declarations
β”œβ”€β”€ Public/                # Static assets (favicon, manifest,
β”‚                          #   product.json, robots.txt)
β”œβ”€β”€ Target/                # Build output
β”œβ”€β”€ astro.config.ts        # Astro + Vite configuration (~2,000 lines)
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── jsconfig.json

In the Land Project

Sky is the UI layer that renders inside the Tauri WebView, consuming Wind'sβ€πŸƒ Effect-TS services. It connects the user interface to the Mountain ⛰️ backend through Tauri's IPC and event system.

Role Description
Depends on Windβ€πŸƒ (service layer), @codeeditorland/outputβ€πŸ“¦ (VS Code workbench bundles), Mountain ⛰️ (backend via Tauri IPC)
Consumed by End users (the editor UI)
Protocol Tauri IPC (invoke + listen), sky:// Tauri events
Correlated Element Cocoonβ€πŸ¦‹ (extension host, runs in the same Tauri WebView)

Sky communicates with Mountain via SkyBridge's sky:// Tauri event channels and Wind's invoke IPC. It loads VS Code's workbench.js from @codeeditorland/output and mounts it in the DOM, with environment-variable-driven variant selection at build time.


Getting Startedβ€πŸš€

Prerequisites

  • Node.js 22 or later
  • pnpm package manager
  • Tauri development environment (for full WebView integration)

Install

pnpm add @codeeditorland/sky

Key Dependencies:

Package Purpose
astro UI framework (v7.x)
@codeeditorland/wind Windβ€πŸƒ Effect-TS service layer
@codeeditorland/common Commonβ€πŸ§‘πŸ»β€πŸ­ Rust core bindings and IPC type definitions
@codeeditorland/output Outputβ€βš« VS Code output bundle and transform plugins
@codeeditorland/worker Workerβ€πŸ© Web worker implementations
@codeeditorland/cocoon Cocoonβ€πŸ¦‹ service layer
@playform/build Build pipeline integration
@playform/compress Post-build HTML/CSS/JS compression
@playform/inline Inline critical assets
vite Module bundler (v8.x)
vite-plugin-top-level-await Top-level await support for the Vite pipeline
typescript Type checking (v6.x)

Usage

Select the workbench at runtime via environment variables:

# A2: Mountain workbench (RECOMMENDED)
Mountain=true pnpm run Run

# A3: Electron workbench
Electron=true pnpm run Run

# A1: Browser Proxy workbench
BrowserProxy=true pnpm run Run

# A1: Bare browser workbench
Browser=true pnpm run Run

# Bundled mode (pre-compiled variants)
Bundle=true Pack="electron browser" pnpm run Run

Or import workbench components directly:

---
import MountainWorkbench from "../Workbench/Mountain.astro";
---

<html>
	<body>
		<MountainWorkbench />
	</body>
</html>

Securityβ€πŸ”’

Sky enforces security at multiple layers:

Layer Mechanism
Content Security Policy Strict CSP enforced via Base.astro layout, limiting script sources and inline execution
Protocol Boundary sky:// event channels segregate UI and backend communication; no direct DOM access from Rust
WKWebView Sandbox macOS WebView process isolation with no filesystem or network access beyond Tauri grants
Dependency Integrity All npm packages pinned via pnpm-lock.yaml; pnpm audit runs in CI
Astro Build Static generation eliminates server-side rendering attack surface; no runtime Node.js in production
Tauri CSP Tauri's built-in Content Security Policy headers restrict WebView capabilities

Compatibility

Sky is designed to be compatible with:

Target Integration
Windβ€πŸƒ Consumes Effect-TS service layer directly within the same Tauri WebView
Mountain ⛰️ Connects via SkyBridge sky:// Tauri events and invoke IPC
Cocoonβ€πŸ¦‹ Shares the Tauri WebView; correlated frontend element for extension hosting
Outputβ€βš« Loads VS Code workbench.js and web.main.js bundles from @codeeditorland/output
Workerβ€πŸ© Integrates service worker for caching, offline support, and dynamic CSS loading
VS Code Extensions Renders extension-contributed UI (webviews, status bar items, tree views) with native fidelity
Tauri v2 Built against Tauri v2 API for window management and IPC

API Reference


Related Documentation


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

Skyβ€πŸŒŒβ€+ Editorβ€πŸžοΈ

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors