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
// @generated from the MSP stable schema and protocol sources; do not edit by hand.
use serde::Deserialize;
use serde::Serialize;
mod catch_all;
/// Where the session's setup stands: `cua_setup`'s state codes, camelCase.
/// **Open**: a result vocabulary, so an older client tolerates a new state.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum ComputerUseSetupPhase {
/// No attempt has run.
Dormant,
/// An attempt is running.
InProgress,
/// Grants changed; only a relaunched host can recheck them.
RestartRequired,
/// The worker is up with its grants; each app still needs approval.
ReadyForTarget,
/// The chat stopped setup.
Stopped,
/// A value from a newer host, kept verbatim so an older client decodes the
/// rest of the message. Never construct it with a known word.
Unknown(String),
}
/// One macOS permission as setup last saw it. **Open**, like the phase.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum ComputerUsePermission {
/// Setup is ready and didn't name it missing.
Granted,
/// Setup named it missing.
Missing,
/// Setup can't say.
Unknown,
/// A value from a newer host, kept verbatim so an older client decodes the
/// rest of the message. Never construct it with a known word.
Unrecognized(String),
}
/// The session's setup state: the result of both methods and the
/// `computerUseSetup/changed` payload's `state`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct ComputerUseSetupState {
/// Where setup stands.
pub setup: ComputerUseSetupPhase,
/// Accessibility.
pub accessibility: ComputerUsePermission,
/// Screen Recording.
pub screen_recording: ComputerUsePermission,
/// Input Monitoring: computer use is ready without it; some actions need it.
pub input_monitoring: ComputerUsePermission,
/// The `cua_setup` refusal code when the call was refused, verbatim.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub refused: Option<String>,
/// The sentence `cua_setup` gives the user for this answer.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
/// `computerUseSetup/read` params.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ComputerUseSetupReadParams {
/// The session whose setup to read. Omitted reads the host's own setup,
/// which needs the `computerUseHostSetup` grant.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session_id: Option<String>,
}
/// `computerUseSetup/start` params: a human command.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ComputerUseSetupStartParams {
/// The session whose setup to start. Omitted starts the host's own
/// setup, which needs the `computerUseHostSetup` grant.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session_id: Option<String>,
/// The client's id for this command.
pub command_id: String,
}
/// `computerUseSetup/changed` params.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct ComputerUseSetupChanged {
/// The session whose setup state changed; absent for the host's own
/// setup, which only `computerUseHostSetup` holders receive.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub session_id: Option<String>,
/// Its new state.
pub state: ComputerUseSetupState,
}