1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
//! Standard RPC method names.
//!
//! This module defines constant strings for all supported RPC methods.
//! Methods are organized by category (input, command, buffer, state, etc.).
// Input methods
/// Inject key events.
pub const INPUT_KEYS: &str = "input/keys";
// Command methods
/// Execute an ex-command.
pub const COMMAND_EXECUTE: &str = "command/execute";
// Buffer methods
/// Get buffer content.
pub const BUFFER_GET_CONTENT: &str = "buffer/get_content";
/// Set buffer content.
pub const BUFFER_SET_CONTENT: &str = "buffer/set_content";
/// Open a file in a buffer.
pub const BUFFER_OPEN_FILE: &str = "buffer/open_file";
/// List all buffers.
pub const BUFFER_LIST: &str = "buffer/list";
/// Write buffer to file.
pub const BUFFER_WRITE_FILE: &str = "buffer/write_file";
// State methods
/// Get current mode.
pub const STATE_MODE: &str = "state/mode";
/// Get cursor position.
pub const STATE_CURSOR: &str = "state/cursor";
/// Get selection.
pub const STATE_SELECTION: &str = "state/selection";
/// Get screen state.
pub const STATE_SCREEN: &str = "state/screen";
/// Get screen content.
pub const STATE_SCREEN_CONTENT: &str = "state/screen_content";
/// Get telescope state.
pub const STATE_TELESCOPE: &str = "state/telescope";
/// Get microscope state.
pub const STATE_MICROSCOPE: &str = "state/microscope";
/// Get windows state.
pub const STATE_WINDOWS: &str = "state/windows";
/// Get window layout state.
///
/// Returns the complete layout tree with window positions, focus state,
/// and layer information. Used by TUI to render multi-window layouts.
pub const STATE_LAYOUT: &str = "state/layout";
/// Get content for a specific window.
///
/// Returns rendered content for a single window, allowing clients to
/// compose multi-window displays or update individual windows.
pub const STATE_WINDOW_CONTENT: &str = "state/window_content";
/// Get editor option values.
///
/// Returns option values with optional filtering by window ID and option names.
/// Options can be bool, int, or string depending on the option type.
pub const STATE_OPTIONS: &str = "state/options";
// Visual methods (for debugging and AI understanding)
/// Get visual snapshot.
pub const STATE_VISUAL_SNAPSHOT: &str = "state/visual_snapshot";
/// Get ASCII art representation.
pub const STATE_ASCII_ART: &str = "state/ascii_art";
/// Get layer information.
pub const STATE_LAYER_INFO: &str = "state/layer_info";
// Editor methods
/// Resize the editor.
pub const EDITOR_RESIZE: &str = "editor/resize";
/// Set the active buffer for a client.
pub const EDITOR_SET_ACTIVE_BUFFER: &str = "editor/set_active_buffer";
/// Quit the editor.
pub const EDITOR_QUIT: &str = "editor/quit";
// TUI methods
/// Capture TUI frame via RPC relay.
///
/// This method is relayed by the server to a connected TUI client,
/// which responds with rendered frame content. Requires a TUI client
/// to be connected (interactive or headless mode).
pub const TUI_CAPTURE: &str = "tui/capture";
// Server methods
/// Kill the server.
pub const SERVER_KILL: &str = "server/kill";
// Module methods
/// Load a module from a path.
pub const MODULE_LOAD: &str = "module/load";
/// Unload a module by ID.
pub const MODULE_UNLOAD: &str = "module/unload";
/// Hot reload a module by ID.
pub const MODULE_RELOAD: &str = "module/reload";
/// List all loaded modules.
pub const MODULE_LIST: &str = "module/list";
// Debug methods
/// Get server version information.
pub const DEBUG_VERSION: &str = "debug/version";
/// Get server uptime.
pub const DEBUG_UPTIME: &str = "debug/uptime";
/// Get kernel state summary.
pub const DEBUG_KERNEL_STATE: &str = "debug/kernel_state";
/// Get register contents.
pub const DEBUG_REGISTERS: &str = "debug/registers";
/// Get mark contents.
pub const DEBUG_MARKS: &str = "debug/marks";
/// Get mode stack.
pub const DEBUG_MODE_STACK: &str = "debug/mode_stack";
/// Get performance metrics.
pub const DEBUG_METRICS: &str = "debug/metrics";
/// Get per-handler statistics.
pub const DEBUG_HANDLERS: &str = "debug/handlers";
/// Get or set log level.
pub const DEBUG_LOG_LEVEL: &str = "debug/log_level";
/// Get recent log entries.
pub const DEBUG_LOG_TAIL: &str = "debug/log_tail";
/// Subscribe to log streaming.
pub const DEBUG_LOG_SUBSCRIBE: &str = "debug/log_subscribe";
/// Unsubscribe from log streaming.
pub const DEBUG_LOG_UNSUBSCRIBE: &str = "debug/log_unsubscribe";
/// Get full debug snapshot for AI/tooling.
pub const DEBUG_VISUAL_SNAPSHOT: &str = "debug/visual_snapshot";