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