Skip to main content

ItemKind

Enum ItemKind 

Source
#[non_exhaustive]
pub enum ItemKind {
Show 25 variants UserMessage, AgentMessage, Reasoning, ToolCall, UserShell, Subagent, Workflow, ReminderChild, Compaction, HookRun, SideChat, SkillRead, WebSearch, MonitorFeed, DamagedRange, ScheduledFire, BackgroundTerminalCompletion, OverdueNotice, EarlierHistory, PeerMessage, SubagentInput, SubagentResult, SystemNotice, BodyCompletion, Unknown(String),
}
Expand description

The eleven v1 item kinds plus post-v1 kinds. Open: a new kind is additive evolution, and clients MUST render unknown kinds generically.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

UserMessage

A submitted user prompt. Single-shot.

§

AgentMessage

A committed assistant message. Delta-streamed.

§

Reasoning

Reasoning summary/text. Delta-streamed.

§

ToolCall

A committed tool call joined to its task lifecycle.

§

UserShell

The user shell escape hatch, item-ified; turnId is null.

§

Subagent

A subagent child lifecycle.

§

Workflow

A workflow run.

§

ReminderChild

A reminder agent’s child session: opened inProgress at the link record, settled with the child task’s real terminal outcome.

§

Compaction

A context compaction.

§

HookRun

A hook run folding its started/terminal records.

§

SideChat

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.

§

SkillRead

A skill-read notice: single-shot only, status completed — a notice has no progress. Experimental: stripped per-connection for unopted callers.

§

WebSearch

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.

§

MonitorFeed

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.

§

DamagedRange

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.

§

ScheduledFire

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.

§

BackgroundTerminalCompletion

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.

§

OverdueNotice

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.

§

EarlierHistory

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.

§

PeerMessage

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.

§

SubagentInput

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.

§

SubagentResult

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.

§

SystemNotice

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.

§

BodyCompletion

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.

§

Unknown(String)

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.

Implementations§

Source§

impl ItemKind

Source

pub fn as_str(&self) -> &str

The exact wire spelling, including an unknown word kept verbatim.

Trait Implementations§

Source§

impl Clone for ItemKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ItemKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ItemKind

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ItemKind

Source§

impl PartialEq for ItemKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ItemKind

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ItemKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.