Element
Cocoon
The Node.js extension host that runs unmodified VS Code extension entry points through Effect-TS services and Vine IPC.
Cocoon
Cocoon is the active VS Code extension-host compatibility path for Editor.Land. It is a Node.js process that loads existing extension entry points, provides a vscode API object, and routes implemented API calls through Effect-TS services and Mountain.
The source supports this claim: installed VS Code extensions can run unmodified through Cocoon when the APIs they use are implemented. Marketplace-wide coverage still needs a public validation matrix.
Source Layout 🗺️
Key Cocoon source areas:
Bootstrap/- process entry point, service composition, andgRPCstartup.Generated/-TypeScriptstubs generated fromVineprotocol definitions.IPC/- typedIPChelpers andSkyevent registry support.PatchProcess/- targeted adaptation forVS Codeplatform assumptions that do not fit the Land runtime.Services/- the extension-host service layer.TypeConverter/- conversion betweenVineDTOs andVS Code-facing types.WebviewPanel/-vscode.WebviewPanelsupport throughMountainand the WebView bridge.
Extension-Host Services 🔌
Cocoon contains source paths for:
- Module interception so
require("vscode")returns Land’sAPIshim. - Extension loading, manifest handling, activation, and deactivation.
ExtensionContextconstruction for extensionactivate()calls.- Commands, workspace, configuration, windows, terminals, diagnostics, output, webviews, tree views, and language-provider registration.
- Health and performance instrumentation for local diagnostics.
gRPCrequest handling throughProcessMountainRequest,SendMountainNotification, andCancelOperation.
Some namespaces exist as stubs or partial routes. Chat, language-model, notebook, and tests APIs should stay marked WIP until their runtime behavior is verified.
Mountain Communication
Cocoon talks to Mountain through Vine gRPC. Mountain sends extension-host requests to Cocoon, and Cocoon sends events and results back to Mountain. The wire shape is generated from protocol definitions rather than handwritten JSON.
The route is real source, but public docs should name the route being discussed instead of saying all editor communication flows through Cocoon.
Module Interception
Cocoon’s module interception path is what lets existing extension code import or require VS Code APIs without being repackaged for Land. The host supplies the Land vscode API shim and maps implemented calls onto services.
This is a strong compatibility point, but not a promise that every API in every extension has runtime parity yet.
Status 🚀
Cocoon should be shown as active for unmodified extension execution and WIP for long-tail API coverage. Claims about specific extension categories should link to tests or a validation matrix.
