DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/Binary/Main/mod.rs
1//! # Binary::Main
2//!
3//! Application orchestration layer providing entry point, IPC command
4//! handlers, lifecycle management, and tray integration for the Mountain
5//! desktop application.
6//!
7//! ## Module Layout
8//!
9//! ```text
10//! main.rs --> Binary::Main::Entry::Fn()
11//! |
12//! +-> Entry (Tokio runtime creation, Tauri builder)
13//! +-> IPCCommands (all #[tauri::command] handlers)
14//! +-> AppLifecycle(setup hook: tray, IPC server, window)
15//! +-> Tray (SwitchTrayIcon Tauri command)
16//! ```
17//!
18//! ## Error Handling
19//!
20//! - `Entry::Fn` panics on fatal errors (Tokio runtime failure, Tauri build).
21//! - IPC commands return `Result<serde_json::Value, String>`.
22//! - Lifecycle setup returns `Result<(), Box<dyn std::error::Error>>`.
23//! - Non-critical failures are logged but do not prevent operation.
24//!
25//! ## Logging
26//!
27//! Log prefixes used throughout: `[Boot]`, `[Lifecycle]`, `[IPC]`, `[UI]`.
28//!
29//! No `pub use` re-exports - callers use the full path
30//! `Binary::Main::Entry::Fn()` directly.
31//!
32//! ## Planned Work
33//!
34//! - Comprehensive error recovery mechanism
35//! - Startup progress indicator
36//! - Graceful degradation for service failures
37//! - Performance metrics collection
38
39/// Main application entry point.
40///
41/// Exports `Fn()` which creates the Tokio runtime, initializes application
42/// state, constructs the Tauri builder, and runs the event loop.
43pub mod Entry;
44
45/// IPC command handlers.
46///
47/// All `#[tauri::command]` functions providing the frontend-to-backend
48/// invoke bridge: workbench configuration, IPC messaging, Wind desktop
49/// integration, configuration management, status reporting, performance
50/// monitoring, collaboration, and document synchronization.
51pub mod IPCCommands;
52
53/// Application lifecycle management.
54///
55/// Exports `AppLifecycleSetup()` which runs inside the Tauri setup hook:
56/// tray initialization, command registration, IPC server setup, window
57/// creation, environment configuration, and async service startup.
58pub mod AppLifecycle;
59
60/// System tray commands.
61///
62/// Exports the `SwitchTrayIcon()` Tauri command for switching the system
63/// tray icon based on the active theme (light or dark mode).
64pub mod Tray;