Workflow
Application Startup and Handshake
End-to-end process of launching Mountain, spawning Cocoon, and establishing initialized state for UI and extension host.
Application Startup and Handshake
Launches the Land application from native Mountain backend through Wind UI and Cocoon extension host. This is the foundational workflow that enables all others.
Startup Sequence
User -> Mountain: Launch Application
Mountain: Create AppState and AppRuntime
Mountain: Load configuration from settings.json
Mountain: Scan extensions and load manifests
Mountain: Start gRPC server
Mountain: Spawn Node.js process (bootstrap-fork.js)
Cocoon: Run process patches (console piping, etc.)
Cocoon: Start gRPC client
Cocoon: Send $initialHandshake gRPC notification to Mountain
Mountain: Gather InitData from AppState
Mountain: Send initExtensionHost gRPC request to Cocoon
Cocoon: Create InitDataLayer
Cocoon: Run FullAppInitialization effect
Cocoon: Install RequireInterceptor (patch require())
Cocoon: Activate startup extensions
UI: Preload.ts shims window.vscode with Tauri IPC + process
UI: Create AppLayer services (Clipboard, Dialog, Editor)
UI: Instantiate VS Code Workbench class
UI: Render UI parts (Activity Bar, Sidebar, etc.)Phase 1: Mountain Startup
- Tauri’s
Builderis created,.setup()hook configured. AppStateandMountainEnvironmentcreated. The environment implements allCommontraits.AppRuntimewraps the environment as the effect engine.- Background task loads
settings.json, scans extensions, starts gRPC server (vine::server::Initialize). InitializeCocoonhandler constructs the sidecar environment and spawnsnode ./Element/Cocoon/Scripts/cocoon/bootstrap-fork.js.
Phase 2: Cocoon Handshake
- Cocoon runs
RunProcessPatches, starts its gRPC client viaIpcProvider. - On connection, sends
$initialHandshakegRPC notification to Mountain. - Mountain receives the handshake, gathers
InitializationDatafromAppState(workspace info, extensions, configuration). - Mountain sends
initExtensionHostgRPC request with the full initialization payload. - Cocoon creates
InitDataLayer, runsFullAppInitialization, installsRequireInterceptor. ExtensionHostProvideractivates startup extensions (*activation event).
Phase 3: UI Launch
- Tauri window opens, loads
index.html. Preload.tsexecutes, shimmingwindow.vscodeglobal with Tauri-backedipcRendererandprocess.- Main UI script creates the
AppLayercomposing all Wind services. Workbench.startup()is called, rendering Activity Bar, Status Bar, Sidebar, Editor Part.- Application is fully initialized and ready for user interaction.
Key Source Files
Mountain/Source/Binary/Main/Entry.rs— main entryMountain/Source/ProcessManagement/CocoonManagement.rs— sidecar spawningMountain/Source/ProcessManagement/InitializationData.rs— init payloadCocoon/Scripts/cocoon/bootstrap-fork.js— extension host bootstrapWind/Source/Preload.ts— VS Code global shim
