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