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