Skip to main content

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