Skip to main content

muse_code_sdk/msp/view/
item_kind.rs

1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3mod catch_all;
4
5/// The eleven v1 item kinds plus post-v1 kinds. Open: a new kind is additive
6/// evolution, and clients MUST render unknown kinds generically.
7#[derive(Debug, Clone, PartialEq, Eq)]
8#[non_exhaustive]
9pub enum ItemKind {
10    /// A submitted user prompt. Single-shot.
11    UserMessage,
12    /// A committed assistant message. Delta-streamed.
13    AgentMessage,
14    /// Reasoning summary/text. Delta-streamed.
15    Reasoning,
16    /// A committed tool call joined to its task lifecycle.
17    ToolCall,
18    /// The user shell escape hatch, item-ified; `turnId` is `null`.
19    UserShell,
20    /// A subagent child lifecycle.
21    Subagent,
22    /// A workflow run.
23    Workflow,
24    /// A reminder agent's child session: opened `inProgress` at the link
25    /// record, settled with the child task's real terminal outcome.
26    ReminderChild,
27    /// A context compaction.
28    Compaction,
29    /// A hook run folding its started/terminal records.
30    HookRun,
31    /// A side-chat link on its main session's view: opened `inProgress` at the
32    /// side creation, settled once (Accepted completes, Rejected rejects,
33    /// Abandoned cancels) — a signpost, not a live fold.
34    SideChat,
35    /// A skill-read notice: single-shot only, status `completed` — a notice has
36    /// no progress. Experimental: stripped per-connection for unopted callers.
37    SkillRead,
38    /// A provider-hosted web search call: a plain additive value of this open
39    /// enum — never strip-armed, since `kind` is required (the `AuthRequired`
40    /// precedent). Only the seven `webSearch` members are experimental-gated.
41    WebSearch,
42    /// One monitor feed line as one transcript cell: a plain additive value of
43    /// this open enum, stable from day one. Single-shot only, status
44    /// `completed`, `turnId` null — arrival is the transcript fact.
45    MonitorFeed,
46    /// One damaged range of the session log, at its position. Single-shot only,
47    /// status `completed`, `turnId` null. No log record carries it: the fold
48    /// that reads the damaged bytes derives it. A build that predates the kind
49    /// decodes it only if its `ItemKind` has a catch-all; the protocol crate's
50    /// does not yet.
51    DamagedRange,
52    /// A scheduled-task fire notice: a plain additive value of this open enum,
53    /// stable from day one — never strip-armed, since `kind` is required (the
54    /// `AuthRequired` precedent). Single-shot only, status `completed`,
55    /// `revision` 1 — a notice has no progress.
56    ScheduledFire,
57    /// A background-terminal completion marker: a plain additive the protocol
58    /// spec open-enum value, stable from day one — never strip-armed, since
59    /// `kind` is required (the `AuthRequired` precedent). Single-shot only,
60    /// status `completed`, `revision` 1 — a notice has no progress.
61    BackgroundTerminalCompletion,
62    /// One background-overdue drain as one transcript line: a plain additive
63    /// value of this open enum, stable from day one. Single-shot only, status
64    /// `completed` — a notice has no progress. `text` is the gate-off literal
65    /// verbatim; `turnId` is the draining turn.
66    OverdueNotice,
67    /// The history before a session's boundary checkpoint, collapsed to the
68    /// checkpoint's transcript tail: the served view's origin. Single-shot
69    /// only, status `completed`, `turnId` null, never pushed live. No log
70    /// record carries it. A build that predates the kind decodes it only if its
71    /// `ItemKind` has a catch-all; the protocol crate's does not yet.
72    EarlierHistory,
73    /// A consumed peer message marker: a plain additive the protocol spec
74    /// open-enum value, stable from day one — never strip-armed, since `kind`
75    /// is required (the `AuthRequired` precedent). Single-shot only, status
76    /// `completed`, `revision` 1 — a notice has no progress.
77    PeerMessage,
78    /// One parent-to-subagent input record on the parent session's view: a
79    /// plain additive value of this open enum, single-shot only, status
80    /// `completed`. `inputPhase` names the record (the queue or the
81    /// delivery-visible drain); `subagentId`, `commandId` (the send's command),
82    /// `text` (the queued summary) and `turnId` (the parent run) are its
83    /// members.
84    SubagentInput,
85    /// One consumed subagent result on the parent session's view: a plain
86    /// additive value of this open enum, single-shot only, status `completed`,
87    /// one per drain of the result's inbox item (delivery-visible or
88    /// claim-only). `subagentId`, `resultStatus` (the consumed attempt's
89    /// outcome), `text` (the result summary) and `turnId` (the consuming run)
90    /// are its members.
91    SubagentResult,
92    /// A system notice: a plain additive value of this open enum, stable from
93    /// day one. Single-shot only, status `completed`, `revision` 1 — a notice
94    /// has no progress. `turnId` is the enclosing turn or `null`. Served
95    /// origin: `hook`. A client renders `text`, or `fallbackText` when it does
96    /// not know the origin, and never synthesizes one.
97    SystemNotice,
98    /// One body-completion receipt row: a plain additive the protocol spec
99    /// open-enum value, stable from day one — never strip-armed, since `kind`
100    /// is required (the `AuthRequired` precedent). Single-shot only, status
101    /// `completed`, `revision` 1 — a notice has no progress. `turnId` is the
102    /// delivering turn.
103    BodyCompletion,
104    /// A value from a newer host, kept verbatim so an older client decodes the
105    /// rest of the message. Never construct it with a known word.
106    Unknown(String),
107}
108
109/// Item status. Open; terminal = anything other than `"inProgress"`, and
110/// unknown values are terminal-unknown, rendered generically.
111#[derive(Debug, Clone, PartialEq, Eq)]
112#[non_exhaustive]
113pub enum ItemStatus {
114    /// The item is open; a terminal is guaranteed.
115    InProgress,
116    /// Terminal: finished normally.
117    Completed,
118    /// Terminal: the item's own execution failed.
119    Failed,
120    /// Terminal: cancelled (interrupt, cancel, or host-shutdown drain).
121    Cancelled,
122    /// Terminal: denied by approval, or a rejected subagent spawn.
123    Rejected,
124    /// Terminal: the task timed out (`TaskTerminalKind` vocabulary).
125    TimedOut,
126    /// A value from a newer host, kept verbatim so an older client decodes the
127    /// rest of the message. Never construct it with a known word.
128    Unknown(String),
129}
130
131/// `hookRun` durable outcome. Open: new outcomes are additive, and clients MUST
132/// render unknown values generically.
133#[derive(Debug, Clone, PartialEq, Eq)]
134#[non_exhaustive]
135pub enum HookRunStatus {
136    /// The run finished normally.
137    Completed,
138    /// The run was blocked; the payload keeps `blocked`. The item settles
139    /// `rejected`, except an unapplied `UserPromptSubmit` block, which settles
140    /// `completed`.
141    Blocked,
142    /// The run failed.
143    Failed,
144    /// The run timed out.
145    TimedOut,
146    /// The run was cancelled.
147    Cancelled,
148    /// A value from a newer host, kept verbatim so an older client decodes the
149    /// rest of the message. Never construct it with a known word.
150    Unknown(String),
151}