Skip to content

CodeEditorLand/Wind

Wind ๐ŸŒฌ๏ธ

The VS Code Environment & Services Layer for Land โ€” Effect-TS powered Tauri service layer.

License: CC0-1.0 NPM Version Tauri API Version Effect Version


Overview

Wind replaces VS Code's Electron IPC bridge โ€” which forces every panel interaction through untyped JSON serialization โ€” with typed Tauri commands routed to Rust handlers in Mountain's core. It 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. It exposes Tauri's native OS file dialogs through Effect-TS wrappers that surface typed, tagged errors. The Preload.ts script establishes window.vscode and shims ipcRenderer and process so VS Code workbench code communicates through Tauri's invoke system instead of Electron's IPC.


Architecture

Wind operates through three primary mechanisms:

  1. Preload Shim โ€” Preload.ts shims Electron and Node.js APIs that the VS Code workbench expects, establishing a compatible execution context inside the Tauri WebView.
  2. Effect-TS Services โ€” The Effect/ directory contains service implementations, each organized as atomic modules with Tag, Interface, Implementation, Layer, and Type subdirectories that compose into TauriLiveLayer, ElectronLiveLayer, and TestLayer stacks.
  3. Mountain RPC โ€” The Mountain service maintains an RPC connection to the Rust backend for configuration, state synchronization, and native operations.
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;
    classDef ipc      fill:#fff3c0,stroke:#f39c12,stroke-width:1px,stroke-dasharray:5 5,color:#5a3e00;

    subgraph SKY["Sky โ˜€๏ธ - Astro UI (Tauri WebView)"]
        SkyApp["Sky Workbench Pages ๐Ÿ–ผ๏ธ"]:::sky
    end

    subgraph WIND["Wind ๐ŸŒฌ๏ธ - VS Code Env + Effect-TS Service Layer (WebView)"]
        direction TB
        subgraph COMPAT["Compatibility Layer"]
            Preload["Preload.ts - window.vscode + ipcRenderer shim"]:::wind
            Sandbox["Effect/Sandbox - globals service"]:::wind
        end
        subgraph EFFECTLAYERS["Effect/ - 40+ Service Modules"]
            TauriLayer["Effect/Layers/Tauri.ts - TauriLiveLayer โšก"]:::effectts
            ElectronLayer["Effect/Layers/Electron.ts"]:::effectts
            CoreServices["IPC ยท Mountain ยท MountainSync ยท Bootstrap\nConfiguration ยท Lifecycle ยท Storage ยท Telemetry"]:::effectts
            UIServices["Clipboard ยท Commands ยท Editor ยท Terminal\nStatusBar ยท Sidebar ยท ActivityBar ยท Panel\nSearch ยท Notifications ยท QuickInputโ€ฆ"]:::effectts
            WorkbenchServices["Workbench* generated bridge services"]:::wind
        end
        subgraph IPCBRIDGE["Service/TauriMainProcessService.ts"]
            TauriSvc["IPC channel router + event bridge ๐Ÿ“ก"]:::ipc
        end

        Preload --> Sandbox
        Preload --> TauriLayer
        TauriLayer --> CoreServices
        TauriLayer --> UIServices
        TauriLayer --> WorkbenchServices
        CoreServices --> TauriSvc
    end

    subgraph BACKEND["Tauri Shell + Mountain โ›ฐ๏ธ - Rust Backend"]
        TauriAPI["Tauri JS API / @tauri-apps/api โš™๏ธ"]:::tauri
        MountainCore["Mountain - WindServiceHandlers ๐Ÿฆ€"]:::mountain
    end

    SkyApp -- imports TauriLiveLayer --> TauriLayer
    SkyApp -- consumes services via __CEL_SERVICES__ --> UIServices
    TauriSvc -- tauri::invoke --> TauriAPI
    TauriAPI -- Rust command handlers --> MountainCore
    MountainCore -- sky:// Tauri events --> TauriSvc
    TauriSvc -- event bridge --> SkyApp
Loading

Key Components

Component Path Description
Preload Shim Source/Preload.ts VS Code environment emulation in Tauri WebView โ€” shims Electron APIs, creates window.vscode
IPC Service Source/Effect/IPC/ Inter-process communication via Tauri invoke with typed, tagged errors
Mountain RPC Source/Effect/Mountain/ Backend RPC connection service for configuration, state, and native operations
Configuration Source/Effect/Configuration/ Workbench configuration with sync and change detection
Bootstrap Source/Effect/Bootstrap/ Multi-stage bootstrap orchestration for service initialization
Codegen Source/Codegen/ VS Code service code generator โ€” walks service catalog, emits bridge shapes
Layers/Tauri Source/Effect/Layers/Tauri.ts Primary composed layer merging 40+ services into TauriLiveLayer
Layers/Electron Source/Effect/Layers/Electron.ts Electron compatibility layer stack
Layers/Test Source/Effect/Layers/Test.ts Test/mock layer stack for isolated testing

Project Structure

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

Core Architecture Principles

Principle Description Key Components
Compatibility High-fidelity VS Code renderer environment to maximize Sky's reusability 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 DI via Layer All Effect/ services with Layer and Tag patterns
Abstraction Clean layer over Tauri APIs replaces untyped Electron IPC with typed Tauri commands Preload.ts, Effect/IPC/, Effect/Mountain/
Integration Sky's frontend requests connect to Mountain's backend through Tauri's invoke and event system Preload.ts (ipcRenderer shim), Effect/Mountain/

In the Land Project

Wind is the middle layer between Sky (the UI) and Tauri / Mountain (the backend). It provides the service abstraction that Sky consumes to perform file operations, dialogs, configuration, and state management โ€” all through typed, tagged Effect services rather than untyped IPC. Communication flows through Tauri's invoke (request) and event (notification) channels.

  • Depends on: Mountain (Rust backend handlers), Tauri (invoke/event system)
  • Consumed by: Sky (Astro UI layer), Cocoon (extension host), Worker (service worker)
  • Protocol: Tauri IPC (invoke + listen)

Getting Started

pnpm add @codeeditorland/wind

Key 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

Usage

Wind is integrated via its Preload.ts script and Effect-TS layers.

  1. Integrate the Preload Script: Configure tauri.config.json to include the bundled Preload.js from Wind in your main window's preload scripts.

  2. 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);

Available Effect Services

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

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

See CHANGELOG.md for a history of changes specific to Wind ๐ŸŒฌ๏ธ.


Funding

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, under grant agreement No 101135429.

Land PlayForm NLnet NGI0

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

About

Windโ€๐Ÿƒโ€+โ€Landโ€๐Ÿž๏ธ

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages