Skip to main content

Deep Dive

Vine - Deep Dive

gRPC protocol definitions, message types, and inter-process communication contracts

Vine - Deep Dive

Vine is the contract-first gRPC protocol layer defining strongly-typed inter-process communication contracts between Mountain, Cocoon, Grove, and Air.

Architecture 🏗️

The proto files are the source of truth. Generated Rust code from tonic/prost is used by Mountain for the server implementation and by Cocoon/Grove for client stubs.

Protocol Files

Proto FilePurpose
Vine.protoCore protocol: Mountain to Cocoon commands, events, handshake
Spine.protoExtension host coordination: action/response pattern
Grove.protoGrove-specific: WASM host function calls, extension lifecycle
Air.protoAir daemon: updates, downloads, health checks

Modules

| Path | | -------------------------------------------------------- | ----------------------------------------------- | | Source/lib.rs - Library root, re-exports generated types | | Source/Message/ | Structured message types shared across services | | Source/Service/ | gRPC service trait implementations | | Source/Client/ | Protocol client helpers for consumer crates |

Communication Patterns 📡

PatternUse Case
Unary RPCCommands and queries
Server streamingMountain streams terminal output, diagnostics to Cocoon
Client streamingCocoon sends batched registration at startup
Bidirectional streamingSpine protocol real-time extension host coordination

Ports and Transport 🌐

ServicePortTransport
Vine/Cocoon50052TCP loopback
Air daemon50053TCP loopback
TLSDisabledLoopback only, Mist DNS provides network boundary

Client Implementations 📱

ElementImplementation
Cocoon@grpc/grpc-js Node.js client
Grovetonic Rust client
Air daemontonic gRPC server (Mountain connects as client)

Request Flow Example 📋

Wind UI -> Mountain Tauri invoke (executeCommand)
  -> Mountain serializes to CommandRequest protobuf
  -> gRPC unary call to Cocoon
  -> Cocoon returns CommandResponse protobuf
  -> Mountain deserializes, sends Tauri event with result

Proto files compiled at build time by prost-build in Mountain build script.