The Breath of Land: VS Code Environment & Services for Tauri.
VS Code's workbench runs inside the Chromium renderer process, meaning
every panel interaction that touches files or state must cross the Electron
IPC bridge through untyped JSON serialization. Wind replaces that pipeline
with typed Tauri commands routed to Rust handlers in Mountain's core,
eliminating the untyped serialization layer entirely while preserving full
VS Code workbench compatibility.
Welcome to Windβπ. This element provides the Effect-TS native
service layer that enables Sky, Land's VS Code-based UI, to function
within the Tauri shell. Wind recreates the essential VS Code renderer
environment, implements core services through Effect-TS's typed error and
dependency injection patterns, and connects the frontend to Mountain's Rust
backend through Tauri's invoke and event system.
Wind operates through three primary mechanisms. The Preload.sh script shims
Electron and Node.js APIs that the VS Code workbench expects,
establishing a compatible execution context inside the Tauri WebView. The
Effect/ directory contains the service implementations, each organized as an
atomic module with Tag, Interface, Implementation, Layer, and Type
subdirectories that compose into TauriLiveLayer, ElectronLiveLayer, and
TestLayer stacks. The Mountain service maintains an RPC connection to the
Rust backend for configuration, state synchronization, and native operations.
Wind exposes Tauri's native OS file dialogs through an Effect-TS wrapper
that surfaces typed, tagged errors for every failure path, providing an
integrated dialog experience without the Electron IPC indirection. The
Preload.ts script establishes the window.vscode global object and shims
ipcRenderer and process so the VS Code workbench code interacts with a
familiar environment while actually communicating through Tauri's invoke
system. Every asynchronous operation and service uses Effect for structured
concurrency, meaning all potential failures are explicitly typed rather than
thrown as untyped exceptions. Service composition relies on Effect-TS's
Layer and Context.Tag primitives, enabling clean dependency injection where
individual services like Clipboard, Terminal, or Configuration can be
swapped between live, mock, and test implementations without modifying consuming
code. The abstraction layer isolates Tauri-specific details so application
code works against stable service interfaces rather than platform-specific
APIs.
| Principle | Description | Key Components |
|---|---|---|
| Compatibility | High-fidelity VS Code renderer environment to maximize Sky's reusability and minimize changes needed for VS Code UI components. | Preload.ts, Polyfills/, Types/ |
| Modularity | Each service follows an atomic directory structure with interface, implementation, tag, layer, and type subdirectories. | Effect/ services |
| Robustness | Effect-TS powers all service implementations, ensuring tagged error types and composable dependency injection via Layer. | All Effect/ services with Layer and Tag patterns |
| Abstraction | Clean layer over Tauri APIs replaces the untyped Electron IPC pipe with typed Tauri commands whose handlers live in Rust. | Preload.ts, Effect/IPC/, Effect/Mountain/ |
| Integration | Sky's frontend requests connect to Mountain's backend capabilities through Tauri's invoke and event system. | Preload.ts (ipcRenderer shim), Effect/Mountain/ |
The Wind architecture centers around the
Preload.ts
script which sets up the VS Code compatibility layer, and the
Effect/
directory which contains all Effect-TS based services. Preload.ts shims
Electron APIs, creates window.vscode, and prepares the environment that
Sky's VS Code code relies on. The Effect/ module exports all services and
composed layer stacks, with
TauriLiveLayer
in Effect/Layers/Tauri.ts serving as the primary composition that merges
sandbox, IPC, configuration, telemetry, Mountain, and dozens of UI and
editor services into a single runnable layer. The code generator under
Codegen/
walks the VS Code service catalog, extracts decorator matches and interface
members, and emits bridge shape specifications that the Workbench* services
implement. See
Effect/index.ts
for the complete module exports and layer compositions.
This diagram illustrates Wind's central role between Sky (the UI) and
Tauri / Mountain (backend).
graph LR
classDef sky fill:#cce8ff,stroke:#2980b9,stroke-width:2px,color:#003050;
classDef wind fill:#fffde0,stroke:#f0b429,stroke-width:2px,color:#4a3500;
classDef tauri fill:#ffe0f0,stroke:#c0396a,stroke-width:2px,color:#4a0020;
classDef mountain fill:#f0d0ff,stroke:#9b59b6,stroke-width:2px,color:#2c0050;
classDef effectts fill:#d4f5d4,stroke:#27ae60,stroke-width:1px,color:#0a3a0a;
subgraph "π Sky - Frontend UI (Tauri WebView)"
SkyApp["πΌοΈ Sky Application - VS Code UI"]:::sky
end
subgraph "π Wind - VS Code Env & Services Layer (WebView)"
PreloadJS["π Preload.js - Environment Shim"]:::wind
WindEffectTSRuntime["β‘ Wind Effect-TS Runtime & Service Layers"]:::effectts
TauriIntegrations["π Wind Effect Services - Tauri API Wrappers"]:::wind
SkyApp -- consumes --> WindEffectTSRuntime
WindEffectTSRuntime -- executes via --> TauriIntegrations
end
subgraph "β°οΈ Tauri Core & Mountain - Rust Backend"
TauriAPIs["βοΈ Tauri JS API & Plugins"]:::tauri
MountainBackend["π¦ Mountain Rust Core - Command Handlers"]:::mountain
end
TauriWindow["π― Tauri Window"] -- loads --> PreloadJS
PreloadJS -- prepares env for --> SkyApp
TauriIntegrations -- calls --> TauriAPIs
TauriAPIs -- communicates with --> MountainBackend
Wind/
βββ Source/
βββ Preload.ts # VS Code environment emulation in Tauri WebView.
βββ Effect/ # Effect-TS services (atomic structure).
β βββ IPC/ # Inter-process communication via Tauri invoke.
β βββ Sandbox/ # Preload globals and environment service.
β βββ Configuration/ # Workbench configuration with sync.
β βββ Telemetry/ # Logging, spans, and metrics (PostHog/OTLP).
β βββ Mountain/ # Backend RPC connection service.
β βββ MountainSync/ # Background configuration sync.
β βββ Environment/ # System and platform detection.
β βββ Health/ # Service health checks.
β βββ Bootstrap/ # Multi-stage bootstrap orchestration.
β βββ Clipboard/ # System clipboard access.
β βββ Commands/ # VS Code command registry.
β βββ Editor/ # Editor service abstraction.
β βββ ActivityBar/ # Activity bar management.
β βββ Panel/ # Bottom panel management.
β βββ Sidebar/ # Sidebar management.
β βββ StatusBar/ # Status bar management.
β βββ Decorations/ # Editor decorations service.
β βββ Extensions/ # Extension management.
β βββ Files/ # File system operations.
β βββ History/ # Editor history service.
β βββ Keybinding/ # Keyboard shortcut binding.
β βββ Label/ # Label service.
β βββ Language/ # Language service.
β βββ Lifecycle/ # Application lifecycle.
β βββ Model/ # Text model service.
β βββ Notification/ # Notification service.
β βββ Output/ # Output panel service.
β βββ Progress/ # Progress indication.
β βββ QuickInput/ # Quick input UI.
β βββ Search/ # Search service.
β βββ Storage/ # Persistent storage.
β βββ Terminal/ # Terminal service.
β βββ TextFile/ # Text file service.
β βββ TextModelResolver/ # Text model resolver.
β βββ Themes/ # Theme management.
β βββ WorkingCopy/ # Working copy service.
β βββ Workspaces/ # Workspace management.
β βββ NetworkRestrictions/# Network access restrictions.
β βββ UserSettings/ # User settings bridge.
β βββ Vine/ # Notification stream.
β βββ LandWorkbench/ # Land workbench integration.
β βββ Generated/ # Auto-generated VS Code service interfaces.
β βββ Layers/ # Layer compositions (Tauri, Electron, Test).
βββ Bootstrap/ # Bootstrap type definitions for startup.
βββ Codegen/ # VS Code service code generator.
βββ Configuration/ # ESBuild and TypeScript configurations.
βββ FileSystem/ # VS Code-like file system provider.
βββ Function/ # Preload install helpers and IPC renderer creation.
βββ IPC/ # IPC channel and Sky event definitions.
βββ Service/ # Tauri main process service.
βββ Telemetry/ # PostHog telemetry bridge.
βββ Types/ # Sandbox, IPC, and error type definitions.
βββ Utility/ # Shared utility functions.
βββ Workbench/ # Workbench integration service.
pnpm add @codeeditorland/windKey Dependencies:
| Package | Version | Purpose |
|---|---|---|
@tauri-apps/api |
2.11.0 |
Tauri JS bridge |
@tauri-apps/plugin-dialog |
2.7.1 |
Native OS file dialogs |
@codeeditorland/output |
0.0.1 |
Shared output utilities |
effect |
3.21.2 |
Structured concurrency & DI |
@effect/platform |
0.96.1 |
Platform abstractions for Effect |
Wind is primarily integrated via its Preload.ts script and its Effect-TS
layers.
-
Integrate the Preload Script: Configure your
tauri.config.jsonto include the bundledPreload.jsfromWindin your main window's preload scripts. -
Use Services with
Effect-TS:
import { IPC } from "@codeeditorland/wind/Effect";
import { TauriLiveLayer } from "@codeeditorland/wind/Effect/Layers/Tauri";
import { Effect, Layer, Runtime } from "effect";
// Build the application runtime with Tauri live layer
const AppRuntime = Layer.toRuntime(TauriLiveLayer).pipe(
Effect.scoped,
Effect.runSync,
);
// Example: invoke a Tauri command through the typed IPC service
const InvokeEffect = Effect.gen(function* (_) {
const IPCService = yield* _(IPC);
const Result = yield* _(
IPCService.invoke("mountain_get_workbench_configuration"),
);
yield* _(Effect.log(`Configuration received: ${JSON.stringify(Result)}`));
});
Runtime.runPromise(AppRuntime, InvokeEffect);| Service | Import Path | Description |
|---|---|---|
IPC |
@codeeditorland/wind/Effect |
Inter-process communication via Tauri |
Sandbox |
@codeeditorland/wind/Effect |
Preload globals and environment |
Configuration |
@codeeditorland/wind/Effect |
Workbench configuration with sync |
Telemetry |
@codeeditorland/wind/Effect |
Logging, spans, and metrics |
Mountain |
@codeeditorland/wind/Effect |
Backend RPC connection |
MountainSync |
@codeeditorland/wind/Effect |
Background configuration sync |
Environment |
@codeeditorland/wind/Effect |
System and platform detection |
Health |
@codeeditorland/wind/Effect |
Service health checks |
Bootstrap |
@codeeditorland/wind/Effect |
Multi-stage bootstrap orchestration |
Clipboard |
@codeeditorland/wind/Effect |
System clipboard access |
Commands |
@codeeditorland/wind/Effect |
VS Code command registry |
Editor |
@codeeditorland/wind/Effect |
Editor service abstraction |
ActivityBar |
@codeeditorland/wind/Effect |
Activity bar management |
Panel |
@codeeditorland/wind/Effect |
Bottom panel management |
Sidebar |
@codeeditorland/wind/Effect |
Sidebar management |
StatusBar |
@codeeditorland/wind/Effect |
Status bar management |
Decorations |
@codeeditorland/wind/Effect |
Editor decoration service |
Extensions |
@codeeditorland/wind/Effect |
Extension management |
Files |
@codeeditorland/wind/Effect |
File system operations |
History |
@codeeditorland/wind/Effect |
Editor history |
Keybinding |
@codeeditorland/wind/Effect |
Keyboard shortcut binding |
Label |
@codeeditorland/wind/Effect |
Label service |
Language |
@codeeditorland/wind/Effect |
Language service |
Lifecycle |
@codeeditorland/wind/Effect |
Application lifecycle |
Model |
@codeeditorland/wind/Effect |
Text model service |
Notification |
@codeeditorland/wind/Effect |
Notification service |
Output |
@codeeditorland/wind/Effect |
Output panel service |
Progress |
@codeeditorland/wind/Effect |
Progress indication |
QuickInput |
@codeeditorland/wind/Effect |
Quick input UI |
Search |
@codeeditorland/wind/Effect |
Search service |
Storage |
@codeeditorland/wind/Effect |
Persistent storage |
Terminal |
@codeeditorland/wind/Effect |
Terminal service |
TextFile |
@codeeditorland/wind/Effect |
Text file service |
TextModelResolver |
@codeeditorland/wind/Effect |
Text model resolver |
Themes |
@codeeditorland/wind/Effect |
Theme management |
WorkingCopy |
@codeeditorland/wind/Effect |
Working copy service |
Workspaces |
@codeeditorland/wind/Effect |
Workspace management |
NetworkRestrictions |
@codeeditorland/wind/Effect |
Network access restrictions |
UserSettings |
@codeeditorland/wind/Effect |
User settings bridge |
Vine |
@codeeditorland/wind/Effect |
Notification stream |
LandWorkbench |
@codeeditorland/wind/Effect |
Land workbench integration |
Layers/Tauri |
@codeeditorland/wind/Effect/Layers/Tauri |
Complete Tauri layer stack |
Layers/Electron |
@codeeditorland/wind/Effect/Layers/Electron |
Electron compatibility layer stack |
Layers/Test |
@codeeditorland/wind/Effect/Layers/Test |
Test/mock layer stack |
FileSystem |
@codeeditorland/wind/FileSystem |
VS Code-like file system provider |
Workbench |
@codeeditorland/wind/Workbench |
Workbench integration service |
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.
See CHANGELOG.md for a
history of changes specific to Windβπ.
Windβπ is a core element of the LandβποΈ ecosystem. 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.
The project is operated by PlayForm, based in Sofia, Bulgaria.
PlayForm acts as the open-source steward for Code Editor Land under the NGI0 Commons Fund grant.
| Land | PlayForm | NLnet | NGI0 Commons Fund |
|---|---|---|---|
|
|
|
|
|
Project Maintainers: Source Open (Source/Open@Editor.Land) | GitHub Repository | Report an Issue | Security Policy