Skip to main content

Crate Grove

Crate Grove 

Source
Expand description

Grove - Rust/WASM Extension Host for VS Code

Grove provides a secure, sandboxed environment for running VS Code extensions compiled to WebAssembly or native Rust. It complements Cocoon (Node.js) by offering a native extension host with full WASM support.

§Architecture

+++++++++++++++++++++++++++++++++++++++++++
+          Extension Host                 +
+++++++++++++++++++++++++++++++++++++++++++
+  Extension Manager  →  Activation Engine +
+  API Bridge         →  VS Code API      +
+++++++++++++++++++++++++++++++++++++++++++
                    +
++++++++++++++++++++▼++++++++++++++++++++++
+          WASM Runtime (WASMtime)        +
+  Module Loader  →  Host Bridge         +
+++++++++++++++++++++++++++++++++++++++++++
                    +
++++++++++++++++++++▼++++++++++++++++++++++
+        Transport Layer                  +
+  gRPC  |  IPC  |  Direct WASM          +
+++++++++++++++++++++++++++++++++++++++++++

§Features

  • Standalone Operation: Run independently or connect to Mountain via gRPC
  • WASM Support: Full WebAssembly runtime with WASMtime
  • Multiple Transport: gRPC, IPC, and direct WASM communication
  • Secure Sandboxing: WASMtime-based isolation for untrusted extensions
  • Cocoon Compatible: Shares API surface with Node.js host

§Example: Standalone Usage

use grove::{ExtensionHost, Transport};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
	let host = ExtensionHost::new(Transport::default()).await?;
	host.load_extension("/path/to/extension").await?;
	host.activate().await?;
	Ok(())
}

§Module Organization

  • Host - Extension hosting core (ExtensionHost, ExtensionManager, etc.)
  • WASM - WebAssembly runtime integration
  • Transport - Communication strategies (gRPC, IPC, WASM)
  • API - VS Code API facade and types
  • Protocol - Protocol handling (Spine connection)
  • Services - Host services (configuration, etc.)
  • Common - Shared utilities and error types

Modules§

API
API Module
Binary
Binary Module
Common
Common Module
DevLog
DevLog - Tag-filtered development logging for Grove
Host
Host Module
Protocol
Protocol Module
Services
Services Module
Transport
Transport Layer Module
WASM
WebAssembly Runtime Module

Macros§

dev_log
Log a tagged dev message. Only prints if the tag is enabled via LAND_DEV_LOG.
otel_span
Convenience macro: emit an OTLP span for a Grove handler. Usage: otel_span!("grove:activate", StartNano, &[("extension", &Id)]);

Structs§

GroveInfo
Grove library information

Constants§

VERSION 🔒

Functions§

init
Initialize Grove library