Skip to main content

Item

Struct Item 

Source
#[non_exhaustive]
pub struct Item {
Show 76 fields pub item_id: String, pub kind: ItemKind, pub turn_id: Option<String>, pub revision: u64, pub status: ItemStatus, pub recorded_at: Option<String>, pub fallback_text: Option<String>, pub text: Option<String>, pub display_text: Option<String>, pub command_id: Option<String>, pub steered: Option<bool>, pub retracted: Option<bool>, pub attachments: Option<Vec<MessageAttachment>>, pub truncated: Option<bool>, pub message_phase: Option<MessagePhase>, pub cut_off: Option<bool>, pub summary: Option<Vec<String>>, pub provider_item_id: Option<String>, pub tool_call: ToolCallMembers, pub command_text: Option<String>, pub exit_code: Option<i64>, pub exit_signal: Option<i64>, pub duration_ms: Option<u64>, pub subagent_id: Option<String>, pub agent_path: Option<String>, pub depth: Option<u32>, pub role: Option<String>, pub objective: Option<String>, pub child_session_id: Option<String>, pub control_status: Option<SubagentControlStatus>, pub workflow_run_id: Option<String>, pub usage: Option<TokenUsage>, pub result: Option<SubagentResult>, pub entry_id: Option<String>, pub script_id: Option<String>, pub trigger_source: Option<String>, pub resume_from_run_id: Option<String>, pub paused: Option<bool>, pub children: Option<Vec<WorkflowChild>>, pub message: Option<String>, pub token_budget: Option<WorkflowTokenBudget>, pub declared_phase: Option<String>, pub final_summary: Option<String>, pub stop_available: Option<bool>, pub child_prompt_refs: Option<Vec<OutputRef>>, pub reminder_agent_id: Option<String>, pub generation_id: Option<u64>, pub task_id: Option<String>, pub child_session_log_path: Option<String>, pub blocking: Option<bool>, pub side_session_id: Option<String>, pub selector: Option<String>, pub source: Option<String>, pub outcome: Option<CompactionOutcome>, pub trigger: Option<CompactionTrigger>, pub strategy_id: Option<String>, pub summarized_through: Option<String>, pub tokens_before: Option<u64>, pub tokens_after: Option<u64>, pub reason: Option<String>, pub hook_key: Option<String>, pub event: Option<HookEventName>, pub run_status: Option<HookRunStatus>, pub label: Option<String>, pub action: Option<String>, pub query: Option<String>, pub url: Option<String>, pub pattern: Option<String>, pub provider_status: Option<String>, pub results: Option<Vec<WebSearchHit>>, pub raw_item: Option<String>, pub monitor_id: Option<String>, pub monitor_description: Option<String>, pub damaged_range: Option<DamagedRange>, pub background_terminal_completion: Option<BackgroundTerminalCompletion>, pub scheduled_fire: ScheduledFireMembers,
}
Expand description

One transcript item at one revision. item/started, item/updated, and item/completed carry the full object; item/delta appends to it by field path.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§item_id: String

Bare UUIDv7; the item’s identity across its whole lifecycle. Identity rule: the task id for task-backed kinds (toolCall, subagent), the pre-minted commit message_id for delta-streamed kinds (agentMessage, reasoning), EventId::derive over the session id and the range’s starting sequence number for damagedRange, and the opening durable record’s event id for everything else. Opaque to clients.

§kind: ItemKind

The item kind (open enum): clients MUST render unknown kinds generically — kind name plus status plus fallbackText.

§turn_id: Option<String>

The owning turn. null for the kinds outside a turn: userShell always, hookRun for session-boundary runs, monitorFeed always, sideChat always, damagedRange always.

§revision: u64

Integer >= 1, strictly monotonic per item; apply rule is replace-iff-higher. item/delta never bumps it.

§status: ItemStatus

Open enum; terminal = anything other than "inProgress". Unknown values MUST be treated as terminal-unknown and rendered generically.

§recorded_at: Option<String>

RFC3339 timestamp of the item’s driving durable record. Absent on ephemeral-opened items until first durable re-emission.

§fallback_text: Option<String>

Server-provided one-line human summary any kind MAY carry, for generic rendering of kinds a client does not recognize; new kinds SHOULD carry it during their first release cycle.

§text: Option<String>

userMessage: the prompt text as submitted. agentMessage: the accumulated reply, streamed via item/delta field "text". reasoning: raw committed reasoning text where the provider exposes it.

§display_text: Option<String>

userMessage: presentation form; absent when the client sent none.

§command_id: Option<String>

userMessage/userShell: the submitting command — multi-client UIs de-duplicate their local echo on it.

§steered: Option<bool>

userMessage: true when injected mid-turn via turn/steer or ifBusy: "steer"; absent otherwise.

§retracted: Option<bool>

userMessage: true after an accepted retract; re-emitted via item/updated.

§attachments: Option<Vec<MessageAttachment>>

userMessage: image attachment metadata only — base64 payloads are not echoed back on the view.

§truncated: Option<bool>

true when the server’s per-surface text budget saturated a streamed surface (agentMessage.text, reasoning.summary[*], toolCall.visibleOutput, userShell.visibleOutput), cut a subagent surface (objective, fallbackText, result.summary, result.text), or cut a monitorFeed surface (text, fallbackText, monitorDescription). On a subagent item the flag is item-level and never cleared: once any of those four is cut, every later update keeps it, even when result.text arrives whole. The durable full text remains in the log.

§message_phase: Option<MessagePhase>

agentMessage: the phase the model declared on the commit; see MessagePhase.

§cut_off: Option<bool>

agentMessage: true when the provider stream died mid-reply and the run failed with this partial text committed — the wire mark for the gate-off “incomplete response” rule. Absent otherwise; never cleared once set.

§summary: Option<Vec<String>>

reasoning: one entry per summary part; part n streams via item/delta field "summary.n" (part boundary = index change).

§provider_item_id: Option<String>

reasoning: provider reasoning item id (e.g. rs_...), for provider-side correlation.

§tool_call: ToolCallMembers

toolCall members, flattened beside the other optional members.

§command_text: Option<String>

userShell: the command text as submitted.

§exit_code: Option<i64>

userShell: the process exit code, when it exited by code.

§exit_signal: Option<i64>

userShell: the terminating signal NUMBER, when signalled (e.g. 9) — the durable payload verbatim; nothing maps numbers to names, and the fold never invents one.

§duration_ms: Option<u64>

userShell/subagent: observed wall-clock duration. workflow: the run’s wall time from launch to reconciliation, set only on the settling item/completed — never a sum of child durations. toolCall: the Backgrounded row’s duration — the open→update record delta in whole ms, served on the backgroundStatus re-emission and frozen there; absent otherwise.

§subagent_id: Option<String>

subagent: durable child identity (subagent_id).

§agent_path: Option<String>

subagent: agent definition path.

§depth: Option<u32>

subagent: nesting depth.

§role: Option<String>

subagent: role as spawned.

§objective: Option<String>

subagent: objective as spawned, bounded on the wire at the 64 KiB retained-text budget; a cut sets truncated. The durable record stays verbatim.

§child_session_id: Option<String>

subagent/reminderChild: the child’s own session id, readable via session/read/view/page — child transcript drill-down without a second protocol.

§control_status: Option<SubagentControlStatus>

subagent: camelCased SubagentControlStatus (open enum); status stays the generic item vocabulary.

§workflow_run_id: Option<String>

subagent/workflow: the owning durable workflow run id (opaque string — not a UUID family).

§usage: Option<TokenUsage>

subagent: transitive observed usage — the child and its own descendants; updated in place, absent until first observation; never folded into session/tokenUsage.cumulative.

§result: Option<SubagentResult>

subagent: the result envelope from ResultReady.

§entry_id: Option<String>

workflow: launched entry identity.

§script_id: Option<String>

workflow: launched script identity.

§trigger_source: Option<String>

workflow: camelCased WorkflowLaunchTriggerSource, verbatim (durable runtime vocabulary, e.g. "modelProposal").

§resume_from_run_id: Option<String>

workflow: set on resumed launches.

§paused: Option<bool>

workflow: true only while a durable pause fact is in force for the run’s generation; absent otherwise, never false.

§children: Option<Vec<WorkflowChild>>

workflow: folded per-child state, keyed by (childId, attempt), re-emitted whole on every change — the item revision is the ordering guard.

§message: Option<String>

workflow: the reconciled terminal message, set on completion.

§token_budget: Option<WorkflowTokenBudget>

workflow: the run’s launch token budget, set from the launch fact; absent when the launch carried none.

§declared_phase: Option<String>

workflow: the run-level declared-phase label — the last Phase detail-row label of the reconciled projection; terminal-only, absent while live.

§final_summary: Option<String>

workflow: the human terminal summary projected from the reconciled Launch envelope, bounded at the 64 KiB surface budget; terminal-only.

§stop_available: Option<bool>

workflow: display-only stop affordance — true while the run is open, false once settled; stopping rides workflow/cancel. Authorizes nothing.

§child_prompt_refs: Option<Vec<OutputRef>>

workflow: one outputRef-shaped link per recorded child spawn with an objective (kind: "workflow_child_prompt"), fetched via item/readOutput.

§reminder_agent_id: Option<String>

reminderChild: the reminder agent’s id.

§generation_id: Option<u64>

reminderChild: the reminder generation.

§task_id: Option<String>

reminderChild: the linked task id.

§child_session_log_path: Option<String>

reminderChild: parent-session-dir-relative child log path; absent when no filesystem log.

§blocking: Option<bool>

reminderChild: true when this child is a blocking reminder (it holds the turn open until it settles); absent otherwise, never false. The status word stays off the wire; clients name the reminder from reminderAgentId.

§side_session_id: Option<String>

sideChat: the side’s own session id, readable via session/read/view/page — drill-down without a second protocol.

§selector: Option<String>

skillRead: the read skill’s catalog selector (matches the skill/list row; the raw observed id when the read resolved to no catalog row). Set on every skillRead item; old clients render it beside the kind name.

§source: Option<String>

skillRead: the catalog source (matches the skill/list row); empty when the host could not resolve the read to a catalog row (replay without the tool result, context-only evidence). Set on every skillRead item; each client composes the notice line from selector + source.

§outcome: Option<CompactionOutcome>

compaction: terminal only — folds installed/fallback status.

§trigger: Option<CompactionTrigger>

compaction: what initiated the compaction.

§strategy_id: Option<String>

compaction: summarizer strategy (installed only).

§summarized_through: Option<String>

compaction: opaque provenance string naming the compaction boundary. Also a compaction-anchored read anchor, accepted by session/resume and view/page. Still opaque — clients relay it, never parse it.

§tokens_before: Option<u64>

compaction: token budget snapshot before, when measured.

§tokens_after: Option<u64>

compaction: token budget snapshot after, when measured.

§reason: Option<String>

compaction: noop/failure reason, verbatim (snake_case durable vocabulary, e.g. "no_compactable_history"). hookRun: terminal-only capped terminal reason.

§hook_key: Option<String>

hookRun: the durable hook_key.

§event: Option<HookEventName>

hookRun: the hook event in Q2 camelCase vocabulary.

§run_status: Option<HookRunStatus>

hookRun: terminal-only durable outcome; stays blocked when the item settles rejected.

§label: Option<String>

hookRun: capped display label.

§action: Option<String>

webSearch: the search action as an open-enum string — search | openPage | findInPage, else tolerated unknown. Absent while the call is open (the action is not final until the item completes).

§query: Option<String>

webSearch: the search query, verbatim — present iff action == "search" with a query to carry.

§url: Option<String>

webSearch: the page URL, verbatim — present iff action == "openPage" or "findInPage".

§pattern: Option<String>

webSearch: the in-page pattern, verbatim — present iff action == "findInPage".

§provider_status: Option<String>

webSearch: the provider’s terminal status, verbatim ("completed" | "failed" | "cancelled" | other) — present on the completed item.

§results: Option<Vec<WebSearchHit>>

webSearch: the typed result hits, verbatim, never truncated — clients read results.length for the count.

§raw_item: Option<String>

webSearch: the verbatim raw provider JSON frame under the 64 KiB per-surface budget; past-budget frames cut here and ride whole behind outputRef.

§monitor_id: Option<String>

monitorFeed: the monitor task id — the same value as that monitor’s toolCall itemId.

§monitor_description: Option<String>

monitorFeed: the monitor’s arm-time description with the durable "Monitor event: " summary prefix stripped; model- controlled tool input under the 64 KiB per-surface budget — sanitize before render.

§damaged_range: Option<DamagedRange>

damagedRange: what the damaged range cost.

§background_terminal_completion: Option<BackgroundTerminalCompletion>

backgroundTerminalCompletion: the five facts the Finished cell renders.

§scheduled_fire: ScheduledFireMembers

scheduledFire members, flattened beside the other optional members.

Trait Implementations§

Source§

impl Clone for Item

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 Item

Source§

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

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

impl<'de> Deserialize<'de> for Item

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

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

impl PartialEq for Item

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 Item

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

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

impl StructuralPartialEq for Item

Auto Trait Implementations§

§

impl Freeze for Item

§

impl RefUnwindSafe for Item

§

impl Send for Item

§

impl Sync for Item

§

impl Unpin for Item

§

impl UnsafeUnpin for Item

§

impl UnwindSafe for Item

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.