pub async fn InitializeCocoon(
ApplicationHandle: &AppHandle,
Environment: &Arc<MountainEnvironment>,
) -> Result<(), CommonError>Expand description
The main entry point for initializing the Cocoon sidecar process manager.
This orchestrates the complete initialization sequence including:
- Validating feature flags and dependencies
- Launching the Cocoon process with proper configuration
- Establishing gRPC communication
- Performing the initialization handshake
- Setting up process health monitoring
§Arguments
ApplicationHandle- Tauri application handle for path resolutionEnvironment- Mountain environment containing application state and services
§Returns
Ok(())- Cocoon initialized successfully and ready to accept extension requestsErr(CommonError)- Initialization failed with detailed error context
§Errors
FileSystemNotFound: Bootstrap script not foundIPCError: Failed to spawn process or establish gRPC connection
§Example
use crate::Source::ProcessManagement::CocoonManagement::InitializeCocoon;
InitializeCocoon(&app_handle, &environment).await?;