Mountain/Binary/IPC/HealthCommand.rs
1//! # HealthCommand
2//!
3//! Tauri commands for Wind's SharedProcessProxy health checks.
4//! These are invoked directly as Tauri commands from the frontend.
5
6/// Check extension host (Cocoon) health.
7/// Returns true if Cocoon is connected via gRPC, false otherwise.
8#[tauri::command]
9pub async fn cocoon_extension_host_health() -> Result<bool, String> {
10 // TODO: Wire to real Cocoon gRPC health check when Cocoon is spawned
11 Ok(false)
12}
13
14/// Check search service health.
15#[tauri::command]
16pub async fn cocoon_search_service_health() -> Result<bool, String> {
17 // Search is available when file system is accessible
18 Ok(true)
19}
20
21/// Check debug service health.
22#[tauri::command]
23pub async fn cocoon_debug_service_health() -> Result<bool, String> {
24 // Debug adapter protocol - not yet wired
25 Ok(false)
26}
27
28/// Generic shared process service health check.
29#[tauri::command]
30pub async fn shared_process_service_health(service:String) -> Result<bool, String> {
31 match service.as_str() {
32 "storage" => Ok(true), // Storage is always available (file-backed)
33 "update" => Ok(true), // Update service always reports idle
34 "search" => Ok(true), // Search available via file system
35 _ => Ok(false),
36 }
37}