muse_code_sdk/msp/view.rs
1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use serde::Deserialize;
4use serde::Serialize;
5
6pub(crate) mod approval;
7pub(crate) mod approval_card_facts;
8pub(crate) mod approval_wire_words;
9pub(crate) mod event;
10pub(crate) mod event_wire_words;
11pub(crate) mod gap;
12pub(crate) mod health;
13pub(crate) mod health_wire_words;
14pub(crate) mod item;
15pub(crate) mod item_background;
16pub(crate) mod item_background_terminal_completion;
17pub(crate) mod item_content;
18pub(crate) mod item_damaged_range;
19pub(crate) mod item_earlier_history;
20pub(crate) mod item_hold;
21pub(crate) mod item_status;
22pub(crate) mod message_phase;
23pub(crate) mod monitor_inbox;
24pub(crate) mod state;
25pub(crate) mod state_wire_words;
26pub(crate) mod tool_label;
27pub(crate) mod tool_receipt;
28pub(crate) mod user_input;
29
30/// The inclusive raw-record range a durable-sourced view event folded from —
31/// the reconciliation token: re-folding the cited records from the canonical
32/// fold state immediately before `first` — appended host-death terminals seed
33/// from the end-of-records state — reproduces the event. In v1 it is an
34/// **opaque provenance token**: no wire method reads what it points at.
35///
36/// Ephemeral-sourced events (`item/delta`, and an `item/started` that opens on
37/// an ephemeral record) carry no `sourceRange` — ephemeral records may be
38/// evicted by retention.
39#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
40#[serde(rename_all = "camelCase")]
41#[non_exhaustive]
42pub struct SourceRange {
43 /// The stream the folded records live on.
44 pub stream: StreamRef,
45 /// The first record of the inclusive range.
46 pub first: RecordPosition,
47 /// The last record of the inclusive range; equal to `first` for an event
48 /// folded from one record.
49 pub last: RecordPosition,
50}
51
52/// One raw stream named by a [`SourceRange`].
53#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
54#[serde(rename_all = "camelCase")]
55#[non_exhaustive]
56pub struct StreamRef {
57 /// The stream kind, verbatim raw-log vocabulary (e.g. `"run"`,
58 /// `"session"`). A free string, not an enum: `sourceRange` is an opaque
59 /// provenance token in v1 and the raw stream vocabulary is the deferred
60 /// altitude's to freeze.
61 pub kind: String,
62 /// The stream id.
63 pub id: String,
64}
65
66/// One end of a [`SourceRange`]: a record's event id and its sequence number
67/// within the stream.
68#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
69#[serde(rename_all = "camelCase")]
70#[non_exhaustive]
71pub struct RecordPosition {
72 /// The record's event id.
73 pub id: String,
74 /// The record's sequence number within its stream.
75 pub sequence: u64,
76}