Mountain/ProcessManagement/
mod.rs

1//! # Process Management Module
2//!
3//! This module provides comprehensive lifecycle management for external sidecar
4//! processes within the Mountain editor ecosystem. It is responsible for:
5//!
6//! ## Core Responsibilities
7//!
8//! 1. **Process Spawning**: Launching and configuring sidecar processes with
9//!    proper environment variables, IPC channels, and communication endpoints
10//!
11//! 2. **Lifecycle Management**: Monitoring process health, handling automatic
12//!    restarts on failure, managing graceful shutdowns, and tracking process
13//!    state
14//!
15//! 3. **Communication Setup**: Establishing IPC connections via gRPC/Vine,
16//!    performing initial handshakes, and ensuring bidirectional communication
17//!
18//! 4. **Initialization Data**: Constructing comprehensive initialization
19//!    payloads for both the Sky frontend and Cocoon extension host
20//!
21//! ## Architecture
22//!
23//! The module is divided into two main components:
24//!
25//! - **CocoonManagement**: Handles the VS Code extension host process (Cocoon)
26//!   which provides compatibility with VS Code extensions
27//!
28//! - **InitializationData**: Constructs and validates initialization payloads
29//!   containing workspace information, extension manifests, and system
30//!   configuration
31//!
32//! ## Port Allocation
33//!
34//! The module reserves specific ports for gRPC communication:
35//! - 50051: Mountain Vine server (main process)
36//! - 50052: Cocoon Vine server (extension host)
37//!
38//! ## Feature Flags
39//!
40//! - `ExtensionHostCocoon`: Enables Cocoon extension host (required for VS Code
41//!   extension compatibility)
42//!
43//! ## Error Handling
44//!
45//! All operations return `Result<(), CommonError>` with detailed error context
46//! for graceful degradation when sidecar processes are unavailable.
47//!
48//! # Module Contents
49//!
50//! - [`CocoonManagement`]: Cocoon sidecar process lifecycle management
51//! - [`InitializationData`]: Initialization data construction
52
53#![allow(non_snake_case)]
54
55pub mod CocoonManagement;
56pub mod InitializationData;