@moejay/wrightty 0.0.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/cli.d.ts +3 -0
  2. package/dist/cli.js +144 -0
  3. package/dist/client.d.ts +14 -0
  4. package/dist/client.js +83 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.js +8 -0
  7. package/dist/terminal.d.ts +48 -0
  8. package/dist/terminal.js +210 -0
  9. package/dist/types.d.ts +90 -0
  10. package/dist/types.js +3 -0
  11. package/package.json +38 -15
  12. package/.github/workflows/ci.yml +0 -90
  13. package/.github/workflows/release.yml +0 -177
  14. package/Cargo.lock +0 -2662
  15. package/Cargo.toml +0 -38
  16. package/PROTOCOL.md +0 -1351
  17. package/README.md +0 -386
  18. package/agents/ceo/AGENTS.md +0 -24
  19. package/agents/ceo/HEARTBEAT.md +0 -72
  20. package/agents/ceo/SOUL.md +0 -33
  21. package/agents/ceo/TOOLS.md +0 -3
  22. package/agents/founding-engineer/AGENTS.md +0 -44
  23. package/crates/wrightty/Cargo.toml +0 -43
  24. package/crates/wrightty/src/client_cmds.rs +0 -366
  25. package/crates/wrightty/src/discover.rs +0 -78
  26. package/crates/wrightty/src/main.rs +0 -100
  27. package/crates/wrightty/src/server.rs +0 -100
  28. package/crates/wrightty/src/term.rs +0 -338
  29. package/crates/wrightty-bridge-ghostty/Cargo.toml +0 -27
  30. package/crates/wrightty-bridge-ghostty/src/ghostty.rs +0 -422
  31. package/crates/wrightty-bridge-ghostty/src/lib.rs +0 -2
  32. package/crates/wrightty-bridge-ghostty/src/main.rs +0 -146
  33. package/crates/wrightty-bridge-ghostty/src/rpc.rs +0 -307
  34. package/crates/wrightty-bridge-kitty/Cargo.toml +0 -26
  35. package/crates/wrightty-bridge-kitty/src/kitty.rs +0 -269
  36. package/crates/wrightty-bridge-kitty/src/lib.rs +0 -2
  37. package/crates/wrightty-bridge-kitty/src/main.rs +0 -124
  38. package/crates/wrightty-bridge-kitty/src/rpc.rs +0 -304
  39. package/crates/wrightty-bridge-tmux/Cargo.toml +0 -26
  40. package/crates/wrightty-bridge-tmux/src/lib.rs +0 -2
  41. package/crates/wrightty-bridge-tmux/src/main.rs +0 -119
  42. package/crates/wrightty-bridge-tmux/src/rpc.rs +0 -291
  43. package/crates/wrightty-bridge-tmux/src/tmux.rs +0 -215
  44. package/crates/wrightty-bridge-wezterm/Cargo.toml +0 -26
  45. package/crates/wrightty-bridge-wezterm/src/lib.rs +0 -2
  46. package/crates/wrightty-bridge-wezterm/src/main.rs +0 -119
  47. package/crates/wrightty-bridge-wezterm/src/rpc.rs +0 -339
  48. package/crates/wrightty-bridge-wezterm/src/wezterm.rs +0 -190
  49. package/crates/wrightty-bridge-zellij/Cargo.toml +0 -27
  50. package/crates/wrightty-bridge-zellij/src/lib.rs +0 -2
  51. package/crates/wrightty-bridge-zellij/src/main.rs +0 -125
  52. package/crates/wrightty-bridge-zellij/src/rpc.rs +0 -328
  53. package/crates/wrightty-bridge-zellij/src/zellij.rs +0 -199
  54. package/crates/wrightty-client/Cargo.toml +0 -16
  55. package/crates/wrightty-client/src/client.rs +0 -254
  56. package/crates/wrightty-client/src/lib.rs +0 -2
  57. package/crates/wrightty-core/Cargo.toml +0 -21
  58. package/crates/wrightty-core/src/input.rs +0 -212
  59. package/crates/wrightty-core/src/lib.rs +0 -4
  60. package/crates/wrightty-core/src/screen.rs +0 -325
  61. package/crates/wrightty-core/src/session.rs +0 -249
  62. package/crates/wrightty-core/src/session_manager.rs +0 -77
  63. package/crates/wrightty-protocol/Cargo.toml +0 -13
  64. package/crates/wrightty-protocol/src/error.rs +0 -8
  65. package/crates/wrightty-protocol/src/events.rs +0 -138
  66. package/crates/wrightty-protocol/src/lib.rs +0 -4
  67. package/crates/wrightty-protocol/src/methods.rs +0 -321
  68. package/crates/wrightty-protocol/src/types.rs +0 -201
  69. package/crates/wrightty-server/Cargo.toml +0 -23
  70. package/crates/wrightty-server/src/lib.rs +0 -2
  71. package/crates/wrightty-server/src/main.rs +0 -65
  72. package/crates/wrightty-server/src/rpc.rs +0 -455
  73. package/crates/wrightty-server/src/state.rs +0 -39
  74. package/examples/basic_command.py +0 -53
  75. package/examples/interactive_tui.py +0 -86
  76. package/examples/record_session.py +0 -96
  77. package/install.sh +0 -81
  78. package/sdks/node/package-lock.json +0 -85
  79. package/sdks/node/package.json +0 -44
  80. package/sdks/node/src/client.ts +0 -94
  81. package/sdks/node/src/index.ts +0 -19
  82. package/sdks/node/src/terminal.ts +0 -258
  83. package/sdks/node/src/types.ts +0 -105
  84. package/sdks/node/tsconfig.json +0 -17
  85. package/sdks/python/README.md +0 -96
  86. package/sdks/python/pyproject.toml +0 -42
  87. package/sdks/python/wrightty/__init__.py +0 -6
  88. package/sdks/python/wrightty/cli.py +0 -210
  89. package/sdks/python/wrightty/client.py +0 -136
  90. package/sdks/python/wrightty/mcp_server.py +0 -434
  91. package/sdks/python/wrightty/terminal.py +0 -333
  92. package/skills/wrightty/SKILL.md +0 -261
  93. package/src/lib.rs +0 -1
  94. package/tests/integration_test.rs +0 -618
@@ -1,138 +0,0 @@
1
- use serde::{Deserialize, Serialize};
2
-
3
- use crate::types::{CursorShape, Rgb, ScreenRegion, SessionId};
4
-
5
- /// Common event envelope sent to clients.
6
- #[derive(Debug, Clone, Serialize, Deserialize)]
7
- #[serde(rename_all = "camelCase")]
8
- pub struct EventEnvelope {
9
- pub subscription_id: String,
10
- pub event: String,
11
- pub session_id: SessionId,
12
- pub timestamp: u64,
13
- pub data: serde_json::Value,
14
- }
15
-
16
- // --- Tier 1: Core events ---
17
-
18
- #[derive(Debug, Clone, Serialize, Deserialize)]
19
- #[serde(rename_all = "camelCase")]
20
- pub struct ScreenUpdated {
21
- #[serde(skip_serializing_if = "Option::is_none")]
22
- pub dirty_region: Option<ScreenRegion>,
23
- }
24
-
25
- #[derive(Debug, Clone, Serialize, Deserialize)]
26
- #[serde(rename_all = "camelCase")]
27
- pub struct SessionExited {
28
- pub exit_code: Option<i32>,
29
- pub signal: Option<String>,
30
- }
31
-
32
- #[derive(Debug, Clone, Serialize, Deserialize)]
33
- pub struct SessionOutput {
34
- pub data: String, // base64
35
- }
36
-
37
- #[derive(Debug, Clone, Serialize, Deserialize)]
38
- pub struct TerminalBell {}
39
-
40
- #[derive(Debug, Clone, Serialize, Deserialize)]
41
- #[serde(rename_all = "camelCase")]
42
- pub struct TerminalTitleChanged {
43
- pub title: String,
44
- #[serde(skip_serializing_if = "Option::is_none")]
45
- pub icon_name: Option<String>,
46
- }
47
-
48
- #[derive(Debug, Clone, Serialize, Deserialize)]
49
- #[serde(rename_all = "camelCase")]
50
- pub struct TerminalCwdChanged {
51
- pub cwd: String,
52
- #[serde(skip_serializing_if = "Option::is_none")]
53
- pub uri: Option<String>,
54
- }
55
-
56
- #[derive(Debug, Clone, Serialize, Deserialize)]
57
- #[serde(rename_all = "camelCase")]
58
- pub struct TerminalAlternateScreen {
59
- pub active: bool,
60
- }
61
-
62
- #[derive(Debug, Clone, Serialize, Deserialize)]
63
- #[serde(rename_all = "camelCase")]
64
- pub struct TerminalCursorChanged {
65
- pub visible: bool,
66
- pub shape: CursorShape,
67
- pub blinking: bool,
68
- }
69
-
70
- // --- Tier 2: Shell integration ---
71
-
72
- #[derive(Debug, Clone, Serialize, Deserialize)]
73
- pub struct ShellPromptStart {}
74
-
75
- #[derive(Debug, Clone, Serialize, Deserialize)]
76
- pub struct ShellCommandStart {}
77
-
78
- #[derive(Debug, Clone, Serialize, Deserialize)]
79
- #[serde(rename_all = "camelCase")]
80
- pub struct ShellOutputStart {
81
- #[serde(skip_serializing_if = "Option::is_none")]
82
- pub command: Option<String>,
83
- }
84
-
85
- #[derive(Debug, Clone, Serialize, Deserialize)]
86
- #[serde(rename_all = "camelCase")]
87
- pub struct ShellCommandFinished {
88
- pub exit_code: i32,
89
- }
90
-
91
- // --- Tier 2: Notifications ---
92
-
93
- #[derive(Debug, Clone, Serialize, Deserialize)]
94
- #[serde(rename_all = "camelCase")]
95
- pub struct TerminalNotification {
96
- pub title: String,
97
- #[serde(skip_serializing_if = "Option::is_none")]
98
- pub body: Option<String>,
99
- pub urgency: String,
100
- pub source: String,
101
- }
102
-
103
- #[derive(Debug, Clone, Serialize, Deserialize)]
104
- #[serde(rename_all = "camelCase")]
105
- pub struct TerminalClipboardSet {
106
- pub selection: String,
107
- pub text: String,
108
- pub base64: String,
109
- }
110
-
111
- #[derive(Debug, Clone, Serialize, Deserialize)]
112
- #[serde(rename_all = "camelCase")]
113
- pub struct TerminalProgressChanged {
114
- pub state: String,
115
- #[serde(skip_serializing_if = "Option::is_none")]
116
- pub percent: Option<u8>,
117
- }
118
-
119
- #[derive(Debug, Clone, Serialize, Deserialize)]
120
- #[serde(rename_all = "camelCase")]
121
- pub struct TerminalModeChanged {
122
- pub mode: String,
123
- pub enabled: bool,
124
- }
125
-
126
- // --- Tier 3: Extended ---
127
-
128
- #[derive(Debug, Clone, Serialize, Deserialize)]
129
- pub struct TerminalFocusChanged {
130
- pub focused: bool,
131
- }
132
-
133
- #[derive(Debug, Clone, Serialize, Deserialize)]
134
- #[serde(rename_all = "camelCase")]
135
- pub struct TerminalColorPaletteChanged {
136
- pub changes: std::collections::HashMap<String, Rgb>,
137
- pub source: String,
138
- }
@@ -1,4 +0,0 @@
1
- pub mod types;
2
- pub mod methods;
3
- pub mod events;
4
- pub mod error;
@@ -1,321 +0,0 @@
1
- use serde::{Deserialize, Serialize};
2
- use std::collections::HashMap;
3
-
4
- use crate::types::*;
5
-
6
- // --- Wrightty domain ---
7
-
8
- #[derive(Debug, Clone, Serialize, Deserialize)]
9
- pub struct GetInfoResult {
10
- #[serde(flatten)]
11
- pub info: ServerInfo,
12
- }
13
-
14
- // --- Session domain ---
15
-
16
- #[derive(Debug, Clone, Serialize, Deserialize)]
17
- #[serde(rename_all = "camelCase")]
18
- pub struct SessionCreateParams {
19
- #[serde(skip_serializing_if = "Option::is_none")]
20
- pub shell: Option<String>,
21
- #[serde(default, skip_serializing_if = "Vec::is_empty")]
22
- pub args: Vec<String>,
23
- #[serde(default = "default_cols")]
24
- pub cols: u16,
25
- #[serde(default = "default_rows")]
26
- pub rows: u16,
27
- #[serde(default, skip_serializing_if = "HashMap::is_empty")]
28
- pub env: HashMap<String, String>,
29
- #[serde(skip_serializing_if = "Option::is_none")]
30
- pub cwd: Option<String>,
31
- }
32
-
33
- fn default_cols() -> u16 {
34
- 80
35
- }
36
- fn default_rows() -> u16 {
37
- 24
38
- }
39
-
40
- #[derive(Debug, Clone, Serialize, Deserialize)]
41
- #[serde(rename_all = "camelCase")]
42
- pub struct SessionCreateResult {
43
- pub session_id: SessionId,
44
- }
45
-
46
- #[derive(Debug, Clone, Serialize, Deserialize)]
47
- #[serde(rename_all = "camelCase")]
48
- pub struct SessionDestroyParams {
49
- pub session_id: SessionId,
50
- #[serde(skip_serializing_if = "Option::is_none")]
51
- pub signal: Option<String>,
52
- }
53
-
54
- #[derive(Debug, Clone, Serialize, Deserialize)]
55
- #[serde(rename_all = "camelCase")]
56
- pub struct SessionDestroyResult {
57
- pub exit_code: Option<i32>,
58
- }
59
-
60
- #[derive(Debug, Clone, Serialize, Deserialize)]
61
- #[serde(rename_all = "camelCase")]
62
- pub struct SessionListResult {
63
- pub sessions: Vec<SessionInfo>,
64
- }
65
-
66
- #[derive(Debug, Clone, Serialize, Deserialize)]
67
- #[serde(rename_all = "camelCase")]
68
- pub struct SessionGetInfoParams {
69
- pub session_id: SessionId,
70
- }
71
-
72
- // --- Input domain ---
73
-
74
- #[derive(Debug, Clone, Serialize, Deserialize)]
75
- #[serde(rename_all = "camelCase")]
76
- pub struct InputSendKeysParams {
77
- pub session_id: SessionId,
78
- pub keys: Vec<KeyInput>,
79
- }
80
-
81
- #[derive(Debug, Clone, Serialize, Deserialize)]
82
- #[serde(rename_all = "camelCase")]
83
- pub struct InputSendTextParams {
84
- pub session_id: SessionId,
85
- pub text: String,
86
- }
87
-
88
- #[derive(Debug, Clone, Serialize, Deserialize)]
89
- #[serde(rename_all = "camelCase")]
90
- pub struct InputSendMouseParams {
91
- pub session_id: SessionId,
92
- pub event: String,
93
- pub button: String,
94
- pub row: u32,
95
- pub col: u32,
96
- #[serde(default, skip_serializing_if = "Vec::is_empty")]
97
- pub modifiers: Vec<Modifier>,
98
- }
99
-
100
- // --- Screen domain ---
101
-
102
- #[derive(Debug, Clone, Serialize, Deserialize)]
103
- #[serde(rename_all = "camelCase")]
104
- pub struct ScreenGetContentsParams {
105
- pub session_id: SessionId,
106
- #[serde(skip_serializing_if = "Option::is_none")]
107
- pub region: Option<ScreenRegion>,
108
- }
109
-
110
- #[derive(Debug, Clone, Serialize, Deserialize)]
111
- #[serde(rename_all = "camelCase")]
112
- pub struct ScreenGetContentsResult {
113
- pub rows: u32,
114
- pub cols: u32,
115
- pub cursor: CursorState,
116
- pub cells: Vec<Vec<CellData>>,
117
- pub alternate_screen: bool,
118
- }
119
-
120
- #[derive(Debug, Clone, Serialize, Deserialize)]
121
- #[serde(rename_all = "camelCase")]
122
- pub struct ScreenGetTextParams {
123
- pub session_id: SessionId,
124
- #[serde(skip_serializing_if = "Option::is_none")]
125
- pub region: Option<ScreenRegion>,
126
- #[serde(default = "default_true")]
127
- pub trim_trailing_whitespace: bool,
128
- }
129
-
130
- fn default_true() -> bool {
131
- true
132
- }
133
-
134
- #[derive(Debug, Clone, Serialize, Deserialize)]
135
- pub struct ScreenGetTextResult {
136
- pub text: String,
137
- }
138
-
139
- #[derive(Debug, Clone, Serialize, Deserialize)]
140
- #[serde(rename_all = "camelCase")]
141
- pub struct ScreenGetScrollbackParams {
142
- pub session_id: SessionId,
143
- #[serde(default = "default_scrollback_lines")]
144
- pub lines: u32,
145
- #[serde(default)]
146
- pub offset: u32,
147
- }
148
-
149
- fn default_scrollback_lines() -> u32 {
150
- 100
151
- }
152
-
153
- #[derive(Debug, Clone, Serialize, Deserialize)]
154
- #[serde(rename_all = "camelCase")]
155
- pub struct ScrollbackLine {
156
- pub text: String,
157
- pub line_number: i32,
158
- }
159
-
160
- #[derive(Debug, Clone, Serialize, Deserialize)]
161
- #[serde(rename_all = "camelCase")]
162
- pub struct ScreenGetScrollbackResult {
163
- pub lines: Vec<ScrollbackLine>,
164
- pub total_scrollback: u32,
165
- }
166
-
167
- #[derive(Debug, Clone, Serialize, Deserialize)]
168
- #[serde(rename_all = "camelCase")]
169
- pub struct ScreenScreenshotParams {
170
- pub session_id: SessionId,
171
- pub format: ScreenshotFormat,
172
- #[serde(skip_serializing_if = "Option::is_none")]
173
- pub theme: Option<serde_json::Value>,
174
- #[serde(skip_serializing_if = "Option::is_none")]
175
- pub font: Option<FontConfig>,
176
- }
177
-
178
- #[derive(Debug, Clone, Serialize, Deserialize)]
179
- pub struct FontConfig {
180
- pub family: String,
181
- pub size: u32,
182
- }
183
-
184
- #[derive(Debug, Clone, Serialize, Deserialize)]
185
- #[serde(rename_all = "camelCase")]
186
- pub struct ScreenScreenshotResult {
187
- pub format: ScreenshotFormat,
188
- pub data: String,
189
- #[serde(skip_serializing_if = "Option::is_none")]
190
- pub width: Option<u32>,
191
- #[serde(skip_serializing_if = "Option::is_none")]
192
- pub height: Option<u32>,
193
- }
194
-
195
- #[derive(Debug, Clone, Serialize, Deserialize)]
196
- #[serde(rename_all = "camelCase")]
197
- pub struct ScreenWaitForTextParams {
198
- pub session_id: SessionId,
199
- pub pattern: String,
200
- #[serde(default)]
201
- pub is_regex: bool,
202
- #[serde(skip_serializing_if = "Option::is_none")]
203
- pub region: Option<ScreenRegion>,
204
- #[serde(default = "default_timeout")]
205
- pub timeout: u64,
206
- #[serde(default = "default_interval")]
207
- pub interval: u64,
208
- }
209
-
210
- fn default_timeout() -> u64 {
211
- 30000
212
- }
213
- fn default_interval() -> u64 {
214
- 100
215
- }
216
-
217
- #[derive(Debug, Clone, Serialize, Deserialize)]
218
- #[serde(rename_all = "camelCase")]
219
- pub struct TextMatch {
220
- pub text: String,
221
- pub row: u32,
222
- pub col: u32,
223
- pub length: u32,
224
- }
225
-
226
- #[derive(Debug, Clone, Serialize, Deserialize)]
227
- #[serde(rename_all = "camelCase")]
228
- pub struct ScreenWaitForTextResult {
229
- pub found: bool,
230
- pub matches: Vec<TextMatch>,
231
- pub elapsed: u64,
232
- }
233
-
234
- #[derive(Debug, Clone, Serialize, Deserialize)]
235
- #[serde(rename_all = "camelCase")]
236
- pub struct ScreenWaitForCursorParams {
237
- pub session_id: SessionId,
238
- #[serde(skip_serializing_if = "Option::is_none")]
239
- pub row: Option<u32>,
240
- #[serde(skip_serializing_if = "Option::is_none")]
241
- pub col: Option<u32>,
242
- #[serde(default = "default_timeout")]
243
- pub timeout: u64,
244
- }
245
-
246
- #[derive(Debug, Clone, Serialize, Deserialize)]
247
- #[serde(rename_all = "camelCase")]
248
- pub struct ScreenWaitForCursorResult {
249
- pub cursor: CursorState,
250
- pub elapsed: u64,
251
- }
252
-
253
- // --- Terminal domain ---
254
-
255
- #[derive(Debug, Clone, Serialize, Deserialize)]
256
- #[serde(rename_all = "camelCase")]
257
- pub struct TerminalResizeParams {
258
- pub session_id: SessionId,
259
- pub cols: u16,
260
- pub rows: u16,
261
- }
262
-
263
- #[derive(Debug, Clone, Serialize, Deserialize)]
264
- #[serde(rename_all = "camelCase")]
265
- pub struct TerminalGetSizeParams {
266
- pub session_id: SessionId,
267
- }
268
-
269
- #[derive(Debug, Clone, Serialize, Deserialize)]
270
- pub struct TerminalGetSizeResult {
271
- pub cols: u16,
272
- pub rows: u16,
273
- }
274
-
275
- #[derive(Debug, Clone, Serialize, Deserialize)]
276
- #[serde(rename_all = "camelCase")]
277
- pub struct TerminalSetColorPaletteParams {
278
- pub session_id: SessionId,
279
- pub palette: ColorPalette,
280
- }
281
-
282
- #[derive(Debug, Clone, Serialize, Deserialize)]
283
- #[serde(rename_all = "camelCase")]
284
- pub struct TerminalGetModesParams {
285
- pub session_id: SessionId,
286
- }
287
-
288
- // --- Events domain ---
289
-
290
- #[derive(Debug, Clone, Serialize, Deserialize)]
291
- #[serde(rename_all = "camelCase")]
292
- pub struct EventsSubscribeParams {
293
- pub session_id: SessionId,
294
- pub events: Vec<String>,
295
- #[serde(skip_serializing_if = "Option::is_none")]
296
- pub options: Option<EventsSubscribeOptions>,
297
- }
298
-
299
- #[derive(Debug, Clone, Serialize, Deserialize)]
300
- #[serde(rename_all = "camelCase")]
301
- pub struct EventsSubscribeOptions {
302
- #[serde(default = "default_debounce")]
303
- pub screen_debounce_ms: u64,
304
- }
305
-
306
- fn default_debounce() -> u64 {
307
- 16
308
- }
309
-
310
- #[derive(Debug, Clone, Serialize, Deserialize)]
311
- #[serde(rename_all = "camelCase")]
312
- pub struct EventsSubscribeResult {
313
- pub subscription_id: String,
314
- pub subscribed_events: Vec<String>,
315
- }
316
-
317
- #[derive(Debug, Clone, Serialize, Deserialize)]
318
- #[serde(rename_all = "camelCase")]
319
- pub struct EventsUnsubscribeParams {
320
- pub subscription_id: String,
321
- }
@@ -1,201 +0,0 @@
1
- use serde::{Deserialize, Serialize};
2
- use std::collections::HashMap;
3
-
4
- pub type SessionId = String;
5
-
6
- #[derive(Debug, Clone, Serialize, Deserialize)]
7
- pub struct Rgb {
8
- pub r: u8,
9
- pub g: u8,
10
- pub b: u8,
11
- }
12
-
13
- #[derive(Debug, Clone, Serialize, Deserialize)]
14
- #[serde(rename_all = "camelCase")]
15
- pub struct CellAttrs {
16
- pub bold: bool,
17
- pub italic: bool,
18
- pub underline: UnderlineStyle,
19
- #[serde(skip_serializing_if = "Option::is_none")]
20
- pub underline_color: Option<Rgb>,
21
- pub strikethrough: bool,
22
- pub dim: bool,
23
- pub blink: bool,
24
- pub reverse: bool,
25
- pub hidden: bool,
26
- }
27
-
28
- #[derive(Debug, Clone, Serialize, Deserialize)]
29
- #[serde(rename_all = "camelCase")]
30
- pub enum UnderlineStyle {
31
- None,
32
- Single,
33
- Double,
34
- Curly,
35
- Dotted,
36
- Dashed,
37
- }
38
-
39
- #[derive(Debug, Clone, Serialize, Deserialize)]
40
- #[serde(rename_all = "camelCase")]
41
- pub struct CellData {
42
- pub char: String,
43
- pub width: u8,
44
- pub fg: Rgb,
45
- pub bg: Rgb,
46
- pub attrs: CellAttrs,
47
- #[serde(skip_serializing_if = "Option::is_none")]
48
- pub hyperlink: Option<String>,
49
- }
50
-
51
- #[derive(Debug, Clone, Serialize, Deserialize)]
52
- #[serde(rename_all = "camelCase")]
53
- pub struct CursorState {
54
- pub row: u32,
55
- pub col: u32,
56
- pub visible: bool,
57
- pub shape: CursorShape,
58
- }
59
-
60
- #[derive(Debug, Clone, Serialize, Deserialize)]
61
- #[serde(rename_all = "camelCase")]
62
- pub enum CursorShape {
63
- Block,
64
- Underline,
65
- Bar,
66
- }
67
-
68
- #[derive(Debug, Clone, Serialize, Deserialize)]
69
- #[serde(rename_all = "camelCase")]
70
- pub struct ScreenRegion {
71
- pub top: u32,
72
- pub left: u32,
73
- pub bottom: u32,
74
- pub right: u32,
75
- }
76
-
77
- #[derive(Debug, Clone, Serialize, Deserialize)]
78
- #[serde(rename_all = "camelCase")]
79
- pub struct SessionInfo {
80
- pub session_id: SessionId,
81
- pub title: String,
82
- #[serde(skip_serializing_if = "Option::is_none")]
83
- pub cwd: Option<String>,
84
- pub cols: u16,
85
- pub rows: u16,
86
- #[serde(skip_serializing_if = "Option::is_none")]
87
- pub pid: Option<u32>,
88
- pub running: bool,
89
- pub alternate_screen: bool,
90
- }
91
-
92
- // --- Key input types ---
93
-
94
- #[derive(Debug, Clone, Serialize, Deserialize)]
95
- #[serde(untagged)]
96
- pub enum KeyInput {
97
- Shorthand(String),
98
- Structured(KeyEvent),
99
- }
100
-
101
- #[derive(Debug, Clone, Serialize, Deserialize)]
102
- #[serde(rename_all = "camelCase")]
103
- pub struct KeyEvent {
104
- pub key: KeyType,
105
- #[serde(skip_serializing_if = "Option::is_none")]
106
- pub char: Option<String>,
107
- #[serde(skip_serializing_if = "Option::is_none")]
108
- pub n: Option<u8>,
109
- #[serde(default, skip_serializing_if = "Vec::is_empty")]
110
- pub modifiers: Vec<Modifier>,
111
- }
112
-
113
- #[derive(Debug, Clone, Serialize, Deserialize)]
114
- pub enum KeyType {
115
- Char,
116
- Enter,
117
- Tab,
118
- Backspace,
119
- Delete,
120
- Escape,
121
- ArrowUp,
122
- ArrowDown,
123
- ArrowLeft,
124
- ArrowRight,
125
- Home,
126
- End,
127
- PageUp,
128
- PageDown,
129
- Insert,
130
- F,
131
- }
132
-
133
- #[derive(Debug, Clone, Serialize, Deserialize)]
134
- pub enum Modifier {
135
- Ctrl,
136
- Alt,
137
- Shift,
138
- Meta,
139
- }
140
-
141
- // --- Screenshot types ---
142
-
143
- #[derive(Debug, Clone, Serialize, Deserialize)]
144
- #[serde(rename_all = "camelCase")]
145
- pub enum ScreenshotFormat {
146
- Text,
147
- Ansi,
148
- Json,
149
- Svg,
150
- Png,
151
- }
152
-
153
- // --- Capability types ---
154
-
155
- #[derive(Debug, Clone, Serialize, Deserialize)]
156
- #[serde(rename_all = "camelCase")]
157
- pub struct Capabilities {
158
- pub screenshot: Vec<ScreenshotFormat>,
159
- pub max_sessions: u32,
160
- pub supports_resize: bool,
161
- pub supports_scrollback: bool,
162
- pub supports_mouse: bool,
163
- pub supports_session_create: bool,
164
- pub supports_color_palette: bool,
165
- pub supports_raw_output: bool,
166
- pub supports_shell_integration: bool,
167
- pub events: Vec<String>,
168
- }
169
-
170
- #[derive(Debug, Clone, Serialize, Deserialize)]
171
- #[serde(rename_all = "camelCase")]
172
- pub struct ServerInfo {
173
- pub version: String,
174
- pub implementation: String,
175
- pub capabilities: Capabilities,
176
- }
177
-
178
- // --- Terminal mode types ---
179
-
180
- #[derive(Debug, Clone, Serialize, Deserialize)]
181
- #[serde(rename_all = "camelCase")]
182
- pub struct TerminalModes {
183
- pub cursor_key_mode: String,
184
- pub keypad_mode: String,
185
- pub alternate_screen: bool,
186
- pub bracketed_paste: bool,
187
- pub mouse_tracking: String,
188
- pub mouse_encoding: String,
189
- pub focus_reporting: bool,
190
- pub cursor_visible: bool,
191
- pub cursor_style: String,
192
- pub auto_wrap: bool,
193
- pub reverse_video: bool,
194
- pub origin_mode: bool,
195
- pub synchronized_output: bool,
196
- }
197
-
198
- // --- Color palette ---
199
-
200
- #[derive(Debug, Clone, Serialize, Deserialize)]
201
- pub struct ColorPalette(pub HashMap<String, Rgb>);
@@ -1,23 +0,0 @@
1
- [package]
2
- name = "wrightty-server"
3
- version.workspace = true
4
- edition.workspace = true
5
- license.workspace = true
6
- authors.workspace = true
7
- repository.workspace = true
8
- homepage.workspace = true
9
- description = "WebSocket JSON-RPC daemon for Wrightty"
10
-
11
- [dependencies]
12
- wrightty-protocol = { version = "0.1.0", path = "../wrightty-protocol" }
13
- wrightty-core = { version = "0.1.0", path = "../wrightty-core" }
14
-
15
- jsonrpsee = { version = "0.24", features = ["server"] }
16
- tokio = { version = "1", features = ["full"] }
17
- clap = { version = "4", features = ["derive"] }
18
- tracing = "0.1"
19
- tracing-subscriber = { version = "0.3", features = ["env-filter"] }
20
- anyhow = "1"
21
- serde = { version = "1", features = ["derive"] }
22
- serde_json = "1"
23
- regex = "1"
@@ -1,2 +0,0 @@
1
- pub mod rpc;
2
- pub mod state;