Mountain/Vine/Server/Notification/mod.rs
1//! # Vine Cocoon → Mountain Notification Atoms
2//!
3//! One handler per file, file name = the exported function name
4//! (reverse-hierarchical path: `Vine::Server::Notification::<Atom>::<Atom>`).
5//! Each atom encapsulates exactly one wire-method's side effects so the
6//! main `send_cocoon_notification` dispatcher in
7//! `MountainVinegRPCService.rs` stays a thin match that routes into
8//! these files.
9//!
10//! ## Naming
11//!
12//! - Wire string `outputChannel.create` → atom file `OutputChannelCreate.rs`
13//! with `pub async fn OutputChannelCreate(...)`.
14//! - Wire string `unregister_scm_provider` → atom file
15//! `UnregisterScmProvider.rs`.
16//! - Wire string `progress.update` → atom file `ProgressUpdate.rs`.
17//!
18//! Snake_case / dotted wire strings collapse to PascalCase file names.
19//! The function name mirrors the file name verbatim so a grep for
20//! `fn <Name>` lands in exactly one place.
21//!
22//! ## Signature contract
23//!
24//! Every atom takes the same two parameters:
25//!
26//! ```ignore
27//! pub async fn <Atom>(
28//! Service: &MountainVinegRPCService,
29//! Parameter: &serde_json::Value,
30//! );
31//! ```
32//!
33//! - `Service` gives access to `ApplicationHandle` (for Tauri `emit` / webview
34//! lookup) and `RunTime` (for `Environment`, `ApplicationState`, provider
35//! registry, scheduler).
36//! - `Parameter` is the raw JSON payload Cocoon sent; each atom extracts the
37//! fields it needs and validates locally.
38//! - Return `()` - atoms that need to fail just log via `dev_log!` on the
39//! `notif-drop` / `grpc` tag; the caller always returns `Empty` to Cocoon
40//! because notifications are fire-and-forget.
41
42#![allow(non_snake_case)]
43
44// --- Batch 8: provider-unregister cleanup ---
45pub mod UnregisterAuthenticationProvider;
46
47pub mod UnregisterDebugAdapter;
48
49pub mod UnregisterFileSystemProvider;
50
51pub mod UnregisterScmProvider;
52
53pub mod UnregisterTaskProvider;
54
55pub mod UnregisterUriHandler;
56
57pub mod UpdateScmGroup;
58
59// --- Batch 11: progress lifecycle name alignment ---
60pub mod ProgressComplete;
61
62pub mod ProgressUpdate;
63
64// --- Batch 10: status-bar text + disposal ---
65pub mod DisposeStatusBarItem;
66
67pub mod SetStatusBarText;
68
69// --- Batch 9: output channel lifecycle (`output.*` + `outputChannel.*`) ---
70pub mod OutputAppend;
71
72pub mod OutputAppendLine;
73
74pub mod OutputChannelAppend;
75
76pub mod OutputChannelClear;
77
78pub mod OutputChannelCreate;
79
80pub mod OutputChannelDispose;
81
82pub mod OutputChannelHide;
83
84pub mod OutputChannelShow;
85
86pub mod OutputClear;
87
88pub mod OutputCreate;
89
90pub mod OutputDispose;
91
92pub mod OutputReplace;
93
94pub mod OutputShow;
95
96// --- Batch 13: webview reverse messaging ---
97pub mod WebviewDispose;
98
99pub mod WebviewPostMessage;
100
101// --- Batch 14: grammar, security, external ---
102pub mod OpenExternal;
103
104pub mod SecurityIncident;
105
106pub mod SetLanguageConfiguration;
107
108// --- Batch 15: inline arms atomised from `MountainVinegRPCService` dispatcher.
109// These were previously ~300 lines of inline match-arm bodies; now each
110// wire method is a one-fn file that the dispatcher delegates into.
111pub mod ExtensionActivated;
112
113pub mod ExtensionDeactivated;
114
115pub mod ExtensionHostMessage;
116
117pub mod LanguagesSetDocumentLanguage;
118
119pub mod ProgressEnd;
120
121pub mod ProgressReport;
122
123pub mod ProgressStart;
124
125pub mod WebviewReady;
126
127pub mod WindowShowTextDocument;
128
129pub mod WorkspaceApplyEdit;
130
131// --- Batch 16: the remaining inline arms - command register/unregister,
132// status-bar lifecycle / message, window show-message / create-terminal,
133// decoration / debug / webview / terminal fan-outs. A handful are
134// "group" atoms (`TerminalLifecycle` covers 4 wire methods that share a
135// relay + provider-drive pattern) - kept together where the handling
136// is truly identical and splitting would duplicate 5-line files.
137pub mod DebugLifecycle;
138
139pub mod DecorationTypeLifecycle;
140
141pub mod RegisterCommand;
142
143pub mod StatusBarLifecycle;
144
145pub mod StatusBarMessage;
146
147pub mod TerminalLifecycle;
148
149pub mod UnregisterCommand;
150
151pub mod WebviewLifecycle;
152
153pub mod WindowCreateTerminal;
154
155pub mod WindowShowMessage;
156
157// --- Batch 17 (post-§14): SCM register pair pulled out of the
158// language-providers OR-block in `MountainVinegRPCService.rs`. The
159// catch-all fallthrough was registering SCM providers in the
160// language-feature provider registry, which the SCM viewlet never
161// reads. These atoms route through `SourceControlManagementProvider`
162// + emit the `sky://scm/*` events the renderer actually subscribes to.
163pub mod RegisterScmProvider;
164pub mod RegisterScmResourceGroup;