adk-surface 3.0.0

Agent surfaces for ADK-Rust: one engine that turns a kernel's sessions, decisions and activity into plain words for every surface, and the surfaces that show them
Documentation
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
//! What the live camera surface shows (spec 3.7 §8.2), in the words of the signed-off boards
//! (`camera-*`, board choices C1–C15): the wire types of its routes, in the OpenAPI document of
//! every `web` build.

use chrono::{DateTime, Utc};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use crate::engine::CommandOutcome;
use crate::model::{AgentRef, DecisionCard};

/// A camera's state, as its pill and its picture show it.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub enum CameraState {
    /// "Live".
    Live,
    /// "Saving frames": the governor looks less often or stopped escalating (board choice C4).
    SavingFrames,
    /// "Paused until midnight": the day's frames are used (board choice C5).
    Paused,
    /// "Can't reach the camera" (board choice C6).
    Lost,
    /// "Camera off": a person switched it off; nothing is captured or sent (board choice C7).
    Off,
    /// "Stream stopped": a person ended the stream (board choice C2).
    Stopped,
    /// "Paused by Stop all": every camera is paused until Resume all (spec 3.7 V-I17); nothing
    /// is looked at.
    Frozen,
}

/// The colour a line of words takes.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub enum Tone {
    /// Green: live, watching, within budget.
    Ok,
    /// Amber: saving frames, near the limit.
    Warn,
    /// Red: paused, lost, at the limit.
    Fail,
    /// Grey: off, nothing to say.
    Muted,
    /// The text's own colour.
    Plain,
}

/// How the picture is drawn.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub enum StageLook {
    /// The live frame.
    Live,
    /// The last frame, frozen and dimmed under the words (board choice C5).
    Dimmed,
    /// The last frame in grey under the words (board choice C6).
    Grey,
    /// A black panel: nothing is shown because nothing is captured (board choice C7).
    Dark,
}

/// Where a region's tag sits: above its box, below it, or inside it at the frame's edge.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub enum TagAt {
    /// Above the box.
    Above,
    /// Below the box: a finding, so it does not cover the part's tag.
    Below,
    /// Inside the box, at its top.
    In,
}

/// `GET /surface/cameras/{camera}` answer: one camera, watched large (board choice C1).
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CameraView {
    /// The camera's id.
    pub id: String,
    /// "Line 2 camera".
    pub name: String,
    /// "RTSP · 1920 × 1080 · on the line 2 server".
    pub ingest: String,
    /// The state.
    pub state: CameraState,
    /// "Live", "Saving frames", "Paused until midnight", "Can't reach the camera", "Camera off".
    pub state_text: String,
    /// The pill's colour.
    pub tone: Tone,
    /// The switch: on, or off (board choice C2).
    pub on: bool,
    /// The agent that watches it.
    pub agent: CameraAgent,
    /// The picture.
    pub stage: StageView,
    /// The banner over the picture, when there is something to warn about.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub notice: Option<NoticeView>,
    /// What the person may do here now.
    pub actions: CameraActions,
    /// The agent's open decisions on this session, such as the held line stop (board choice C13).
    pub decisions: Vec<DecisionCard>,
    /// "Nothing is waiting for you."
    pub nothing_waiting: String,
    /// "Watching for".
    pub watches: Vec<WatchView>,
    /// "Frame budget".
    pub budget: BudgetView,
    /// "Tracks now".
    pub tracks: Vec<TrackRow>,
    /// The words under the tracks: "Tracks are anonymous and start again when the camera does."
    pub tracks_note: String,
    /// The phone's words under the budget while the camera is off: "Tracks start again when the
    /// camera is back on."
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tracks_short_note: Option<String>,
    /// The zones a person may edit, in the camera's pixels.
    pub zones: Vec<ZoneView>,
    /// "Sources": every camera, this one's tile following its state (board choice C15).
    pub sources: Vec<SourceTile>,
}

/// The agent that watches a camera.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CameraAgent {
    /// The agent.
    pub agent: AgentRef,
    /// "Asleep until a defect", "Paused by the frame budget", "Not watching: no frames".
    pub line: String,
    /// The line's colour.
    pub tone: Tone,
    /// The session its thread follows: "Open the thread".
    pub session_id: String,
}

/// What a person may do with a camera now.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CameraActions {
    /// "Camera on / Off".
    pub switch: bool,
    /// "Stop the stream".
    pub stop: bool,
    /// "Try again now".
    pub retry: bool,
    /// "Draw a zone", "Edit the zone".
    pub zone: bool,
    /// "Raise a card from this frame".
    pub raise_card: bool,
    /// "Use this browser's camera": the camera takes the frames this screen captures
    /// (`POST /surface/cameras/{camera}/frames`), as the web home's own camera does.
    #[serde(default, skip_serializing_if = "std::ops::Not::not")]
    pub send_frames: bool,
}

/// The picture and what is drawn over it.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct StageView {
    /// The camera's width in pixels; every region is in these pixels.
    pub width: u32,
    /// The camera's height in pixels.
    pub height: u32,
    /// How the picture is drawn.
    pub look: StageLook,
    /// The frame shown, when one is held.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub frame: Option<FrameView>,
    /// "Live · 10:41:09", "Last frame · 15:12:03".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub badge: Option<BadgeView>,
    /// "Looking 5 a second · overlays 0.1 s behind" (board choice C10).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rate: Option<String>,
    /// The words over the picture when it is not live.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cover: Option<CoverView>,
    /// What was found on the frame.
    pub regions: Vec<CameraRegion>,
    /// The zones.
    pub zones: Vec<ZoneView>,
    /// Where each track was over the frames held.
    pub trails: Vec<TrailView>,
}

/// A frame the hub holds, served by its digest.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct FrameView {
    /// `sha256:` of its bytes.
    pub digest: String,
    /// `/api/surface/cameras/{camera}/frames/{digest}`: the bytes, while the hub holds them.
    pub href: String,
    /// When it was captured.
    pub at: DateTime<Utc>,
    /// "10:41:09".
    pub at_text: String,
}

/// A badge on the picture.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct BadgeView {
    /// "Live · 10:41:09".
    pub text: String,
    /// The dot's colour.
    pub tone: Tone,
}

/// The words over a picture that is not live.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CoverView {
    /// "Paused until midnight", "Can't reach the line 2 camera", "Camera off".
    pub title: String,
    /// "Nothing is captured or sent. You switched line 2 off at 11:05."
    pub text: String,
    /// A spinner: the source is being tried again.
    pub retrying: bool,
    /// The camera-off icon.
    pub off: bool,
}

/// Something found on the frame, in the camera's pixels.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CameraRegion {
    /// "part", "seal tear", "fiducial", "person": the overlay's colour (board choice S1).
    pub label: String,
    /// `[x0, y0, x1, y1]`; absent for a mask drawn alone.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub bbox: Option<[f64; 4]>,
    /// "part · T45", "seal tear · 0.91 · 5 frames · 14.3 mm", "person · blurred".
    pub tag: String,
    /// The phone's and a tile's tag: "T45", "14.3 mm".
    pub short_tag: String,
    /// Where the tag sits.
    pub tag_at: TagAt,
    /// The anonymous track.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub track: Option<u64>,
    /// A mask's outline (the Masks layer).
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub outline: Vec<[f64; 2]>,
    /// A measured length.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub measurement: Option<MeasurementView>,
    /// What a watch looks for: drawn selected.
    pub finding: bool,
}

/// A measured length, drawn as a line with its ends.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct MeasurementView {
    /// One end, in the camera's pixels.
    pub from: [f64; 2],
    /// The other end.
    pub to: [f64; 2],
    /// "14.3 mm".
    pub text: String,
}

/// A zone, in the camera's pixels (board choice C12).
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct ZoneView {
    /// Its id.
    pub id: String,
    /// "Inspection window".
    pub name: String,
    /// `[x0, y0, x1, y1]` in the camera's pixels.
    pub corners: [f64; 4],
    /// "700, 200 → 1600, 880".
    pub corners_text: String,
    /// The watches that use it: "Seal tear watch".
    pub used_by: Vec<String>,
}

/// Where a track was over the frames held: its trail.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct TrailView {
    /// The track.
    pub track: u64,
    /// Its centres, newest first, in the camera's pixels.
    pub points: Vec<[f64; 2]>,
}

/// The banner over the picture.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct NoticeView {
    /// Its colour.
    pub tone: Tone,
    /// "Saving frames.", "Parts on line 2 are passing without inspection."
    pub title: String,
    /// What follows the title.
    pub text: String,
    /// The error, credentials hidden: "connection refused · rtsp://[credentials hidden]@…".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub detail: Option<String>,
    /// The phone's shorter title.
    pub short_title: String,
    /// The phone's shorter text.
    pub short_text: String,
    /// What the banner offers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub action: Option<NoticeAction>,
}

/// What a banner offers.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase", rename_all_fields = "camelCase", tag = "kind")]
pub enum NoticeAction {
    /// "Try again now".
    Retry {
        /// The words.
        text: String,
        /// The phone's words.
        short_text: String,
    },
    /// "Change the daily frame limit", in Memory & rules.
    Limit {
        /// The words.
        text: String,
        /// The phone's words.
        short_text: String,
        /// Where it opens.
        href: String,
    },
}

/// One watch condition (board choice C1 "Watching for").
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct WatchView {
    /// Its id.
    pub id: String,
    /// "Seal tear".
    pub name: String,
    /// The label it looks for: its colour.
    pub label: String,
    /// "Watching", "Paused", "No frames", "Camera off".
    pub pill: String,
    /// It looks at frames now.
    pub active: bool,
    /// "Score 0.80 or more, 3 frames in a row, inside".
    pub before: String,
    /// The zone it looks inside: "Inspection window".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub zone: Option<String>,
    /// ". Then wait 30 s before waking again for the same track."
    pub after: String,
    /// The phone's line: "Seal tear, 0.80+, 3 frames in".
    pub short_before: String,
    /// What follows the zone on the phone: " · not watching" when it does not look.
    pub short_after: String,
    /// "Woke the Inspector 3 times today".
    pub woke: String,
}

/// "Frame budget" (board choice C3).
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct BudgetView {
    /// "for line 2".
    pub scope: String,
    /// Looking, Asking, Frames today.
    pub meters: Vec<MeterView>,
    /// "Steps down in this order: …", while nothing has stepped down.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub order: Option<String>,
    /// "What the budget did": each step with its time, then the next.
    pub steps: Vec<StepView>,
    /// "Change the daily frame limit", once the camera paused.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limit: Option<String>,
    /// The phone's rows.
    pub rows: Vec<BudgetRow>,
}

/// One meter.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct MeterView {
    /// "Looking", "Asking sam-3.1 about unclear tracks", "Frames today".
    pub label: String,
    /// "5 a second", "2 in the last minute", "61,240 of 300,000".
    pub value: String,
    /// How full the bar is, in hundredths.
    pub percent: u8,
    /// The bar's colour.
    pub tone: Tone,
    /// "As set", "At most 6 a minute · 14 today · $0.14", "Renews at midnight".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub note: Option<String>,
}

/// One step the governor took, or the next.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct StepView {
    /// "14:02", or "next".
    pub at: String,
    /// "Looked less often: 5 → 2 a second (90% used)".
    pub text: String,
    /// The next step, not taken yet.
    pub next: bool,
}

/// One of the phone's budget rows.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct BudgetRow {
    /// "Looking".
    pub label: String,
    /// "2 a second (was 5)".
    pub value: String,
    /// Its colour; `muted` for plain words.
    pub tone: Tone,
}

/// One track now.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct TrackRow {
    /// "T43".
    pub id: String,
    /// "part".
    pub label: String,
    /// "seal tear 0.91 · in the zone · 5 frames".
    pub note: String,
    /// The phone's note: "seal tear 0.91 · in the zone".
    pub short_note: String,
    /// The swatch: the finding's label, else the track's.
    pub swatch: String,
    /// A watch looks for what was found on it: the row is marked.
    pub finding: bool,
}

/// One camera in "Sources", the strip under a single camera (board choice C15).
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct SourceTile {
    /// The camera's id.
    pub id: String,
    /// "Line 3 camera".
    pub name: String,
    /// The state.
    pub state: CameraState,
    /// "Live", "Saving frames", "Paused", "Lost", "Off".
    pub state_text: String,
    /// Its colour.
    pub tone: Tone,
    /// The camera shown large.
    pub selected: bool,
    /// The small picture.
    pub stage: StageView,
}

/// `GET /surface/cameras` answer: every camera, a grid of them (board choice C8).
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CamerasView {
    /// "Cameras".
    pub title: String,
    /// "4 sources · 3 on".
    pub count_text: String,
    /// The phone's: "4 · 3 on".
    pub count_short: String,
    /// The agent that watches them.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub agent: Option<CameraAgent>,
    /// The camera shown first, by its id.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selected: Option<String>,
    /// The phone's line under the large picture: "Line 2 camera · Live · 5 a second".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selected_line: Option<String>,
    /// Every camera.
    pub tiles: Vec<CameraTile>,
    /// "Each source has its own frame budget. Stop all pauses every one of them."
    pub note: String,
    /// "Each camera has its own frame budget. People are blurred before any frame is shown or kept."
    pub short_note: String,
    /// "Select a camera to watch it large. People are blurred before any frame is shown or kept."
    pub footer: String,
    /// The agents' open decisions on these cameras' sessions.
    pub decisions: Vec<DecisionCard>,
    /// "Nothing is waiting for you."
    pub nothing_waiting: String,
    /// Each camera's frames today.
    pub budget: Vec<MeterView>,
}

/// One camera of the grid.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CameraTile {
    /// The camera's id.
    pub id: String,
    /// "Line 2 camera".
    pub name: String,
    /// The state.
    pub state: CameraState,
    /// "Live", "Saving frames", "Off".
    pub state_text: String,
    /// Its colour.
    pub tone: Tone,
    /// The switch.
    pub on: bool,
    /// The switch may be changed here.
    pub can_switch: bool,
    /// The picture, with its overlays.
    pub stage: StageView,
    /// "watching for seal tears", "shown only, nothing watched", "from the voice screen".
    pub caption: String,
    /// The switch list's line: "5 a second · 20% of today's frames".
    pub line: String,
    /// The phone's line: "watching", "2 a second", "shown only".
    pub short_line: String,
}

/// `PUT /surface/cameras/{camera}/zones/{zone}` body: the zone's new name and corners, and the
/// corners the person saw before changing them.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct ZoneChange {
    /// The zone's name.
    pub name: String,
    /// `[x0, y0, x1, y1]` in the camera's pixels.
    pub corners: [f64; 4],
    /// The corners the person started from: a zone changed since is refused, not overwritten.
    pub was: [f64; 4],
}

/// `PUT /surface/cameras/{camera}/zones/{zone}` answer.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct ZoneSaved {
    /// The zone now.
    pub zone: ZoneView,
    /// "Saved. The seal tear watch uses it from the next frame."
    pub text: String,
}

/// `POST /surface/cameras/{camera}/freeze` body: the frame on screen, by its digest.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct FreezeFrame {
    /// The frame's `sha256:` digest; the hub must still hold it.
    pub frame: String,
}

/// `POST /surface/cameras/{camera}/cards` body: a card from a frozen frame (board choice C11).
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct RaiseCard {
    /// The frozen frame, by its digest; the hub must still hold it.
    pub frame: String,
    /// "What should it look at?"
    pub note: String,
}

/// `POST /surface/cameras/{camera}/frames` answer: what became of one frame this screen
/// captured.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct FrameTaken {
    /// The frame went on to the camera's pipeline.
    pub taken: bool,
    /// Why it did not. While the camera is off, stopped or paused by Stop all, the screen stops
    /// capturing: a camera switched off sends nothing.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub dropped: Option<FrameDropped>,
}

/// Why the server dropped a frame a screen sent.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub enum FrameDropped {
    /// The camera is switched off.
    Off,
    /// The camera's stream was stopped.
    Stopped,
    /// Stop all paused every camera.
    Frozen,
    /// The pipeline was not reading the camera when the frame came.
    NotReading,
}

/// `POST /surface/cameras/{camera}/cards` answer.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CardRaised {
    /// The kept frame's digest, after blurring: the evidence the card and a held call carry.
    pub digest: String,
    /// The short form: `sha256:c52ca5…ce7550`.
    pub short_digest: String,
    /// The regions that went with it.
    pub regions: usize,
    /// "Kept as evidence until 18 Dec".
    pub kept_until: String,
    /// The kept frame in the annotated viewer.
    pub href: String,
    /// What sending it to the agent did: sent, or queued behind a decision or a turn.
    pub outcome: CommandOutcome,
    /// "Raised to the Inspector. This one frame is kept as evidence until 18 Dec."
    pub text: String,
}