muse_code_sdk/msp/method/session_satellites.rs
1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use super::session::Session;
4use crate::msp::view::state::ApprovalMode;
5use crate::msp::view::state::ApprovalModeSource;
6use crate::msp::view::state::PermissionAxes;
7use crate::msp::view::state::ReviewerAuthority;
8use serde::Deserialize;
9use serde::Serialize;
10
11mod catch_all;
12
13/// `session/listChanged` params: one changed row of the `session/list` shape —
14/// the full Session object as the answering host's list face serves it at
15/// emission, a replace, never a delta. Emitted only on connections that
16/// negotiated the `sessionListStream` capability at `initialize`; row birth
17/// stays on `session/started`, unload pairs with `session/closed`.
18#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
19#[serde(rename_all = "camelCase")]
20#[non_exhaustive]
21pub struct SessionListChangedParams {
22 /// The served list row for the changed session.
23 pub session: Session,
24}
25
26/// One attention flag: a pending server-initiated request class parked on the
27/// session. Open on the wire — clients MUST ignore unknown values; future
28/// attention kinds are additive.
29#[derive(Debug, Clone, PartialEq, Eq)]
30#[allow(clippy::enum_variant_names)]
31#[non_exhaustive]
32pub enum AttentionFlag {
33 /// At least one approval request is open and unresolved.
34 ApprovalPending,
35 /// At least one user-input request is open.
36 InputPending,
37 /// At least one peer-admission request is open. Experimental: stripped
38 /// per-connection for unopted callers.
39 AdmissionPending,
40 /// A value from a newer host, kept verbatim so an older client decodes the
41 /// rest of the message. Never construct it with a known word.
42 Unknown(String),
43}
44
45/// The effective approval-mode projection: the same object
46/// `session/setApprovalMode` returns as `effectiveMode` and the `Session`
47/// object carries as `approvalMode`.
48#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
49#[serde(rename_all = "camelCase")]
50#[non_exhaustive]
51pub struct EffectiveApprovalModeState {
52 /// The mode in effect.
53 pub mode: ApprovalMode,
54 /// How the mode took effect.
55 pub source: ApprovalModeSource,
56 /// The command that last set it; `null` when no command did.
57 pub last_command_id: Option<String>,
58}
59
60/// The effective permission-state projection: the committed native permission
61/// snapshot (profile identity, reviewer authority) plus the live per-session
62/// runtime's attachment evidence. The same object
63/// `session/setPermissionProfile` returns and the `Session` object carries as
64/// `permissionState`. Served values must be coherent: a read never combines an
65/// old profile with a newer runtime's attachment claim.
66#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
67#[serde(rename_all = "camelCase")]
68#[non_exhaustive]
69pub struct EffectivePermissionState {
70 /// The committed profile id; `null` when the committed source is a launch
71 /// override (`LaunchOverrides` pins `id: None`); every catalog row and
72 /// configured/default commit carries a non-null id.
73 pub profile_id: Option<String>,
74 /// The committed profile's reviewer authority.
75 pub reviewer_authority: ReviewerAuthority,
76 /// Whether an executable reviewer is currently installed for this loaded
77 /// session (live runtime evidence).
78 pub reviewer_attached: bool,
79 /// The committed profile's effective four axis values: the resolved
80 /// filesystem, network, approval, and reviewer the YOLO predicate reads.
81 /// Omitted when unknown — an older host, the no-profile state, or the
82 /// commit-receipt fallback arm that reports without a re-inspect — and a
83 /// client MUST fall back to the served id there, never infer equivalence it
84 /// cannot see.
85 #[serde(skip_serializing_if = "Option::is_none")]
86 pub axes: Option<PermissionAxes>,
87}
88
89/// Who opened a session.
90#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
91#[serde(rename_all = "camelCase")]
92pub struct SessionSpawnedBy {
93 /// The exact session that opened this one.
94 pub parent_session_id: String,
95 /// An opaque project label the spawner named, when it named one.
96 #[serde(default, skip_serializing_if = "Option::is_none")]
97 pub project: Option<String>,
98 /// An opaque thread label the spawner named, when it named one.
99 #[serde(default, skip_serializing_if = "Option::is_none")]
100 pub thread: Option<String>,
101}
102
103/// Fork provenance folded from the durable `session.fork.created` record.
104#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
105#[serde(rename_all = "camelCase")]
106#[non_exhaustive]
107pub struct ForkProvenance {
108 /// The source session this fork was cut from.
109 pub session_id: String,
110 /// An **opaque provenance string** preserved verbatim from the durable
111 /// record. Display-only — not one of the cursor families: clients MUST NOT
112 /// parse it and no method accepts it.
113 pub cut_cursor: String,
114 /// Whether the fork named an explicit cut point.
115 pub cut_explicit: bool,
116 /// The `commandId` of the `session/fork` that created it.
117 pub command_id: String,
118}
119
120/// Side provenance folded from the durable side provenance.
121#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
122#[serde(rename_all = "camelCase")]
123#[non_exhaustive]
124pub struct SideProvenance {
125 /// The source main session this side was opened from.
126 pub session_id: String,
127 /// An **opaque provenance string** preserved verbatim from the durable side
128 /// provenance (`source_cut_cursor`). Display-only — not one of the cursor
129 /// families: clients MUST NOT parse it and no method accepts it.
130 pub cut_cursor: String,
131 /// The `commandId` of the `session/sideChat` that created it.
132 pub command_id: String,
133}