Mountain/Binary/Main/
IPCCommands.rs

1//! # IPCCommands (Binary/Main)
2//!
3//! ## RESPONSIBILITIES
4//!
5//! Tauri command handlers for IPC communication between the frontend and
6//! backend. This module delegates to the atomic command modules in Binary/IPC/.
7//!
8//! ## ARCHITECTURAL ROLE
9//!
10//! The IPCCommands module is the **command layer** in Mountain's architecture:
11//!
12//! ```text
13//! Frontend ──► Tauri IPC Bridge ──► Binary/IPCC::*Commands ──► Backend Services
14//!                                        │
15//!                                        ▼
16//!                                Command Delegation
17//! ```
18//!
19//! ## KEY COMPONENTS
20//!
21//! - **Workbench Configuration**: MountainGetWorkbenchConfiguration
22//!   (Binary/IPC/WorkbenchConfigurationCommand)
23//! - **IPC Messaging**: MountainIPCReceiveMessage, MountainIPCGetStatus,
24//!   MountainIPCInvoke (Binary/IPC/*)
25//! - **Wind Desktop**: MountainGetWindDesktopConfiguration,
26//!   MountainUpdateConfigurationFromWind (Binary/IPC/WindConfigurationCommand)
27//! - **Configuration**: MountainSynchronizeConfiguration,
28//!   MountainGetConfigurationStatus (Binary/IPC/ConfigurationSyncCommand)
29//! - **Configuration Data**: MountainGetConfigurationData,
30//!   MountainSaveConfigurationData (Binary/IPC/ConfigurationDataCommand)
31//! - **IPC Status**: MountainGetIPCStatus, MountainGetIPCStatusHistory,
32//!   MountainStartIPCStatusReporting (Binary/IPC/IPCStatusCommand)
33//! - **Performance**: MountainGetPerformanceStats, MountainGetCacheStats
34//!   (Binary/IPC/PerformanceStatsCommand)
35//! - **Collaboration**: MountainCreateCollaborationSession,
36//!   MountainGetCollaborationSessions (Binary/IPC/CollaborationSessionCommand)
37//! - **Document Sync**: MountainAddDocumentForSync, MountainGetSyncStatus,
38//!   MountainSubscribeToUpdates (Binary/IPC/DocumentSyncCommand)
39//!
40//! ## ERROR HANDLING
41//!
42//! All commands return `Result<serde_json::Value, String>` for consistency.
43//! Errors are logged and converted to user-friendly error messages.
44//! Uses `map_err` and `and_then` for ergonomic error handling.
45//!
46//! ## LOGGING
47//!
48//! Each command logs at INFO level on request receipt, DEBUG for processing
49//! details, and ERROR for failures. All logs are prefixed with `[IPC]
50//! [CommandName]`.
51//!
52//! ## PERFORMANCE CONSIDERATIONS
53//!
54//! All commands are async with `tokio` runtime support.
55//! Minimal allocation overhead by reusing existing data structures.
56//!
57//! ## TODO
58//! - [ ] Add request rate limiting
59//! - [ ] Implement command validation middleware
60//! - [ ] Add telemetry for command usage analytics
61
62// Note: All Tauri IPC commands are now in the atomic command modules
63// in Binary/IPC/*.rs. This module is kept for organizational purposes.
64//
65// Command modules:
66// - WorkbenchConfigurationCommand
67// - MessageReceiveCommand
68// - StatusGetCommand
69// - InvokeCommand
70// - WindConfigurationCommand
71// - ConfigurationUpdateCommand
72// - ConfigurationSyncCommand
73// - ConfigurationStatusCommand
74// - ConfigurationDataCommand
75// - IPCStatusCommand
76// - IPCStatusHistoryCommand
77// - IPCStatusReportingStartCommand
78// - PerformanceStatsCommand
79// - CollaborationSessionCommand
80// - DocumentSyncCommand
81// - UpdateSubscriptionCommand
82// - CacheStatsCommand