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