Skip to main content

muse_code_sdk/msp/view/
approval_card_facts.rs

1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use serde::Deserialize;
4use serde::Serialize;
5
6/// One Computer Use card's facts. Empty collections and absent rows are
7/// omitted, never `null`.
8#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10#[non_exhaustive]
11pub struct ApprovalCuaCardFacts {
12    /// The target window's title: the app's own text, which a page can set;
13    /// a client shows it quoted and as plain text, never as markup or a
14    /// choice, and may cap it.
15    #[serde(default, skip_serializing_if = "Option::is_none")]
16    pub window_title: Option<String>,
17    /// For a browser, the host of the window's current page.
18    #[serde(default, skip_serializing_if = "Option::is_none")]
19    pub page: Option<ApprovalCuaPage>,
20    /// Only the consequential steps, in call order.
21    #[serde(default, skip_serializing_if = "Vec::is_empty")]
22    pub steps: Vec<ApprovalCuaStep>,
23}
24
25/// The page's full host, no path or query.
26#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
27#[serde(rename_all = "camelCase")]
28#[non_exhaustive]
29pub struct ApprovalCuaPage {
30    /// The host in Unicode.
31    pub host: String,
32    /// The host's `xn--` form; equal to `host` when they don't differ.
33    pub host_ascii: String,
34}
35
36/// One consequential step. A client renders "Step N: <action> <roleWord>
37/// "<label>" — <effect>"; a key step names its `chord`, and only a step with
38/// a `point` (and no label or chord) reads "at x,y".
39#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
40#[serde(rename_all = "camelCase")]
41#[non_exhaustive]
42pub struct ApprovalCuaStep {
43    /// 1-based, as the batch numbers its steps.
44    pub step: u32,
45    /// An open tag for styling and tests only (`verb:<class>`, `unresolved`,
46    /// `unlabeled`); a client that doesn't know a value renders the step from
47    /// `effect` and its label as usual.
48    pub kind: String,
49    /// The host's verb phrase, such as `click` or `type into`.
50    pub action: String,
51    /// The host's trusted sentence for what the step may do.
52    pub effect: String,
53    /// `button`, `link`, `menu item` or `key`; absent for a point step.
54    #[serde(default, skip_serializing_if = "Option::is_none")]
55    pub role_word: Option<String>,
56    /// The control's label: the app's own text, shown quoted and as plain
57    /// text; a client may cap it.
58    #[serde(default, skip_serializing_if = "Option::is_none")]
59    pub label: Option<String>,
60    /// The chord, for a key step.
61    #[serde(default, skip_serializing_if = "Option::is_none")]
62    pub chord: Option<String>,
63    /// The step's own 0–1000 model coordinates, only for a point step.
64    #[serde(default, skip_serializing_if = "Option::is_none")]
65    pub point: Option<ApprovalCuaPoint>,
66}
67
68/// A point in the model's 0–1000 coordinates.
69#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
70#[non_exhaustive]
71pub struct ApprovalCuaPoint {
72    pub x: u16,
73    pub y: u16,
74}