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
use rmcp::schemars;
use serde::Deserialize;
#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct ControlParams {
/// Target session identifier
pub tag: String,
/// Control character letter, e.g. "C" = Ctrl+C (interrupt/SIGINT), "D" = Ctrl+D (EOF),
/// "Z" = Ctrl+Z (suspend, meaningful in pty mode only), "?" = DEL.
/// Provide only the letter itself, without a "^" prefix.
pub key: String,
}
#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct SendKeysParams {
/// Target session identifier
pub tag: String,
/// Ordered list of items sent as a single burst. Each item is either:
/// - literal text, sent as-is (e.g. "ls -la", "ihello world" for entering vim insert mode + typing)
/// - a bracket-tagged special key (case-insensitive): [Up] [Down] [Left] [Right] [Home] [End]
/// [PageUp] [PageDown] [Insert] [Delete] [Tab] [BackTab] [Enter] [Escape] [Backspace]
/// [F1]..[F12]
///
/// An unrecognized bracket tag (e.g. a typo like "[Upp]") causes an explicit error instead of
/// being silently sent as literal text.
pub keys: Vec<String>,
}
#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct MoveCursorParams {
/// Target session identifier
pub tag: String,
/// Target row, 1-based (ANSI CUP convention)
pub row: u16,
/// Target column, 1-based (ANSI CUP convention)
pub col: u16,
}
#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct ResizeParams {
/// Target session identifier
pub tag: String,
/// New column count (must be >= 1)
pub cols: u16,
/// New row count (must be >= 1)
pub rows: u16,
}
#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct SnapshotParams {
/// Target session identifier
pub tag: String,
/// The number of milliseconds to wait before taking a snapshot. The default value is 1000 (the default value is usually used directly. If you want to set it, a range of 0 to 10000 is recommended).
pub wait_ms: Option<u64>,
}