Mountain/IPC/mod.rs
1//! Inter-process communication for the Mountain application, handling
2//! communication between the Tauri frontend and the Rust backend through
3//! Tauri commands, WebSocket, and custom message formats.
4
5#![allow(unused_imports, unused_variables)]
6
7// --- Main Sub-modules ---
8
9/// Common shared types and abstractions for IPC layer.
10pub mod Common;
11
12/// Main Tauri IPC server orchestrator.
13// Legacy TauriIPCServer.rs for backward compatibility
14#[path = "TauriIPCServer.rs"]
15pub mod TauriIPCServer_Old;
16
17/// Message types and routing.
18pub mod Message;
19
20/// Connection management and health monitoring.
21pub mod Connection;
22
23/// Message compression and secure channels.
24pub mod Encryption;
25
26/// Permission system for IPC access control.
27pub mod Security;
28
29// --- Feature Sub-modules ---
30
31/// Advanced experimental features (collaboration, intelligent caching,
32/// performance monitoring). TODO: atomize this 648-LOC single file into a
33/// directory; for now consumers spell `IPC::AdvancedFeatures::*` directly.
34pub mod AdvancedFeatures;
35
36/// Configuration synchronization bridge.
37// Legacy ConfigurationBridge.rs for backward compatibility
38#[path = "ConfigurationBridge.rs"]
39pub mod ConfigurationBridge;
40
41/// Status and metrics reporting (atomized; siblings live in `StatusReporter/`).
42pub mod StatusReporter;
43
44/// Wind UI framework synchronization.
45// Legacy WindAdvancedSync.rs for backward compatibility
46#[path = "WindAdvancedSync.rs"]
47pub mod WindAdvancedSync;
48
49// --- Legacy Sub-modules ---
50
51/// Legacy Wind Air Commands.
52pub mod WindAirCommands;
53
54/// Legacy Wind Service Adapters.
55pub mod WindServiceAdapters;
56
57/// Tag-filtered development logging (Trace env var).
58/// Must be declared before WindServiceHandlers so the dev_log! macro is
59/// available.
60pub mod DevLog;
61
62/// Central `sky://` emit wrapper that logs under the `sky-emit` DevLog
63/// tag. Optional drop-in for any `ApplicationHandle::emit(channel, …)`
64/// call site; existing emits keep working unchanged.
65pub mod SkyEmit;
66
67/// Outbound emit wrapper that stamps a W3C `_traceparent` field onto
68/// every JSON payload before forwarding to `app_handle.emit(...)`.
69/// Sky's `Workbench/Electron/TraceparentBridge.ts` extracts the
70/// header at the receiving end so spans emitted inside the handler
71/// attach to the same Jaeger trace. Release builds short-circuit to
72/// a plain `emit(...)` via `cfg!(debug_assertions)`.
73pub mod EmitWithTraceparent;
74
75/// Shared `UriComponents` emitter. Every handler that returns a URI to the
76/// renderer must route through this module so the `$mid: 1` marshalling
77/// marker is never forgotten (without it VS Code's IPC reviver skips the
78/// field and `uri.with is not a function` cascades through the sidebar).
79pub mod UriComponents;
80
81/// Wind Service Handlers - dispatcher for every `MountainIPCInvoke` Tauri
82/// call from Wind/Output/Sky. The `mod.rs` inside is the central `match`
83/// that routes wire strings to per-domain atoms or handler files. Atoms
84/// live under `WindServiceHandlers/<Domain>/<Atom>.rs` following the
85/// one-export-per-file convention.
86///
87/// The previous `WindServiceHandler` (singular) sibling was merged here
88/// on 2026-04-23: of its 24 files, only 3 functions were live
89/// (extensions install/uninstall, nativeHost showOpenDialog) and those
90/// now live as atoms under `WindServiceHandlers/Extension/` and
91/// `WindServiceHandlers/NativeDialog/`. The remaining 21 files were
92/// dead-code duplicates of plural-side implementations.
93pub mod WindServiceHandlers;
94
95// --- Legacy Subdirectories ---
96
97/// Legacy Enhanced subdirectory.
98pub mod Enhanced;
99
100/// Legacy Permission subdirectory.
101pub mod Permission;
102
103// No `pub use` re-exports - callers spell the full path
104// (`IPC::Connection::Manager::ConnectionManager`, etc.). The legacy single-
105// file modules `TauriIPCServer_Old`, `AdvancedFeatures`, `StatusReporter`,
106// `WindAdvancedSync`, `ConfigurationBridge` remain as roots for the
107// in-progress atomic migration.
108
109// --- Notes on Migration ---
110
111// MIGRATION PATH TO ATOMIC STRUCTURE:
112//
113// Phase 1: ✅ Create Atomic Structure
114// - Created new atomic module directories
115// - Implemented core functionality
116// - Added comprehensive documentation
117//
118// Phase 2: 🔄 Backward Compatibility (Current)
119// - Keeping legacy files for compatibility
120// - Using #[path = "..."] to reference legacy files
121// - Gradually migrating dependent code
122//
123// Phase 3: ⏳ Migration
124// - Update dependent files to use new structure
125// - Test migration incrementally
126// - Monitor for issues
127//
128// Phase 4: ⏳ Cleanup
129// - Remove legacy files
130// - Update all documentation
131// - Final verification
132//
133// The following atomic modules are ready for migration:
134// - IPC/TauriIPCServer/ (Server.rs)
135// - IPC/Message/ (Types.rs)
136// - IPC/Connection/ (Manager.rs, Types.rs, Health.rs)
137// - IPC/Encryption/ (MessageCompressor.rs, SecureChannel.rs)
138// - IPC/Security/ (PermissionManager.rs, Role.rs, Permission.rs)
139// - IPC/AdvancedFeatures/ (Features.rs)
140// - IPC/ConfigurationBridge/ (mod.rs - placeholder)
141// - IPC/StatusReporter/ (mod.rs - placeholder)
142// - IPC/WindAdvancedSync/ (mod.rs - placeholder)