muse_code_sdk/msp/view/monitor_inbox.rs
1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use crate::msp::view::SourceRange;
4use crate::msp::view::StreamRef;
5use serde::Deserialize;
6use serde::Serialize;
7
8/// `monitor/inboxItemAdmitted` params: one monitor inbox admission — the fold
9/// keys gate-off consumes.
10#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11#[serde(rename_all = "camelCase")]
12#[non_exhaustive]
13pub struct MonitorInboxItemAdmittedParams {
14 /// The owning session.
15 pub session_id: String,
16 /// Opaque, strictly monotonic view cursor.
17 pub view_cursor: String,
18 /// The durable records this event folded from.
19 pub source_range: SourceRange,
20 /// The inbox item id (dedupe key).
21 pub item_id: String,
22 /// The owning monitor task id (per-task set key).
23 pub task_id: String,
24 /// Per-task event order key (with `line_index`).
25 pub event_index: u64,
26 /// Monitor event kind, snake_case, open vocabulary — clients
27 /// ignore unknown kinds.
28 pub event_kind: String,
29 /// Line order key; absent when the event has no line.
30 #[serde(default, skip_serializing_if = "Option::is_none")]
31 pub line_index: Option<u64>,
32 /// Whether the event carries displayable lines.
33 pub show_lines: bool,
34 /// The model-facing delivery text.
35 pub body: String,
36 /// The producer-recorded pre-augmentation content; absent on earlier
37 /// records.
38 #[serde(default, skip_serializing_if = "Option::is_none")]
39 pub display_body: Option<String>,
40 /// The notice-text summary.
41 pub summary: String,
42 /// Admission stamp (RFC3339); consumed by the pending sort.
43 pub queued_at: String,
44}
45
46/// One snapshot `monitorInbox` entry: a retained admission in the
47/// `monitor/inboxItemAdmitted` shape, envelope-stripped, plus the newest drain
48/// and void stamps folded for it. The entry is still awaiting delivery when
49/// `drainedAt` is absent, or when `voidedAt` is strictly newer than it.
50#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
51#[serde(rename_all = "camelCase")]
52#[non_exhaustive]
53pub struct MonitorInboxSnapshotEntry {
54 /// The inbox item id (dedupe key).
55 pub item_id: String,
56 /// The owning monitor task id (per-task set key).
57 pub task_id: String,
58 /// Per-task event order key (with `line_index`).
59 pub event_index: u64,
60 /// Monitor event kind, snake_case, open vocabulary.
61 pub event_kind: String,
62 /// Line order key; absent when the event has no line.
63 #[serde(default, skip_serializing_if = "Option::is_none")]
64 pub line_index: Option<u64>,
65 /// Whether the event carries displayable lines.
66 pub show_lines: bool,
67 /// The model-facing delivery text.
68 pub body: String,
69 /// The producer-recorded pre-augmentation content; absent on earlier
70 /// records.
71 #[serde(default, skip_serializing_if = "Option::is_none")]
72 pub display_body: Option<String>,
73 /// The notice-text summary.
74 pub summary: String,
75 /// Admission stamp (RFC3339).
76 pub queued_at: String,
77 /// The newest drain stamp (RFC3339); absent while never drained.
78 #[serde(default, skip_serializing_if = "Option::is_none")]
79 pub drained_at: Option<String>,
80 /// The newest wake-missed void stamp (RFC3339); absent while never voided.
81 #[serde(default, skip_serializing_if = "Option::is_none")]
82 pub voided_at: Option<String>,
83}
84
85/// `monitor/inboxItemDrained` params: one monitor inbox drain — a consumption
86/// marker with its recorded stamp.
87#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
88#[serde(rename_all = "camelCase")]
89#[non_exhaustive]
90pub struct MonitorInboxItemDrainedParams {
91 /// The owning session.
92 pub session_id: String,
93 /// Opaque, strictly monotonic view cursor.
94 pub view_cursor: String,
95 /// The durable records this event folded from.
96 pub source_range: SourceRange,
97 /// The drained inbox item id.
98 pub item_id: String,
99 /// The draining run stream (`StreamRef`), absent means the current
100 /// draining run.
101 #[serde(default, skip_serializing_if = "Option::is_none")]
102 pub drain_target_run_stream: Option<StreamRef>,
103 /// False is a local claim-only recall: no delivery row or recovery
104 /// consequence, but the drain still stamps the awaiting verdict.
105 pub delivery_visible: bool,
106 /// The drain record's recorded stamp (RFC3339), the drain-side
107 /// operand of drain-vs-void latest-wins.
108 pub drained_at: String,
109}
110
111/// `monitor/inboxItemVoided` params: one wake-missed void — count-only, no
112/// transcript row.
113#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
114#[serde(rename_all = "camelCase")]
115#[non_exhaustive]
116pub struct MonitorInboxItemVoidedParams {
117 /// The owning session.
118 pub session_id: String,
119 /// Opaque, strictly monotonic view cursor.
120 pub view_cursor: String,
121 /// The durable records this event folded from.
122 pub source_range: SourceRange,
123 /// The voided inbox item id.
124 pub item_id: String,
125 /// The anomaly's recorded stamp (RFC3339), the void-side operand
126 /// of drain-vs-void latest-wins.
127 pub voided_at: String,
128}