Skip to main content

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_status;
20pub(crate) mod message_phase;
21pub(crate) mod monitor_inbox;
22pub(crate) mod state;
23pub(crate) mod state_wire_words;
24pub(crate) mod tool_label;
25pub(crate) mod tool_receipt;
26pub(crate) mod user_input;
27
28/// The inclusive raw-record range a durable-sourced view event folded from —
29/// the reconciliation token: re-folding the cited records from the canonical
30/// fold state immediately before `first` — appended host-death terminals seed
31/// from the end-of-records state — reproduces the event. In v1 it is an
32/// **opaque provenance token**: no wire method reads what it points at.
33///
34/// Ephemeral-sourced events (`item/delta`, and an `item/started` that opens on
35/// an ephemeral record) carry no `sourceRange` — ephemeral records may be
36/// evicted by retention.
37#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
38#[serde(rename_all = "camelCase")]
39#[non_exhaustive]
40pub struct SourceRange {
41    /// The stream the folded records live on.
42    pub stream: StreamRef,
43    /// The first record of the inclusive range.
44    pub first: RecordPosition,
45    /// The last record of the inclusive range; equal to `first` for an event
46    /// folded from one record.
47    pub last: RecordPosition,
48}
49
50/// One raw stream named by a [`SourceRange`].
51#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
52#[serde(rename_all = "camelCase")]
53#[non_exhaustive]
54pub struct StreamRef {
55    /// The stream kind, verbatim raw-log vocabulary (e.g. `"run"`,
56    /// `"session"`). A free string, not an enum: `sourceRange` is an opaque
57    /// provenance token in v1 and the raw stream vocabulary is the deferred
58    /// altitude's to freeze.
59    pub kind: String,
60    /// The stream id.
61    pub id: String,
62}
63
64/// One end of a [`SourceRange`]: a record's event id and its sequence number
65/// within the stream.
66#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
67#[serde(rename_all = "camelCase")]
68#[non_exhaustive]
69pub struct RecordPosition {
70    /// The record's event id.
71    pub id: String,
72    /// The record's sequence number within its stream.
73    pub sequence: u64,
74}