pub enum ThreadItemPayload {
Show 19 variants
UserMessage {
client_id: Option<String>,
content: Vec<UserInput>,
id: String,
},
HookPrompt {
fragments: Vec<HookPromptFragment>,
id: String,
},
AgentMessage {
delivery: Option<AgentMessageDelivery>,
id: String,
memory_citation: Option<MemoryCitation>,
moderation: Option<AgentMessageModeration>,
phase: Option<MessagePhase>,
questions: Option<Vec<AsyncUserInputQuestion>>,
text: String,
},
Plan {
id: String,
text: String,
},
Reasoning {
content: Option<Vec<String>>,
id: String,
summary: Option<Vec<String>>,
},
CommandExecution {
aggregated_output: Option<String>,
command: String,
command_actions: Vec<CommandAction>,
cwd: Value,
duration_ms: Option<i64>,
exit_code: Option<i64>,
id: String,
plugin_id: Option<String>,
process_id: Option<String>,
script_path: Option<String>,
source: Option<Value>,
status: CommandExecutionStatus,
},
FileChange {
changes: Vec<FileUpdateChange>,
id: String,
status: PatchApplyStatus,
},
McpToolCall {Show 13 fields
app_context: Option<McpToolCallAppContext>,
arguments: Value,
duration_ms: Option<i64>,
error: Option<McpToolCallError>,
id: String,
mcp_app_resource_uri: Option<String>,
mcp_app_ui: Option<McpAppUi>,
plugin_id: Option<String>,
read_only_hint: Option<bool>,
result: Option<McpToolCallResult>,
server: String,
status: McpToolCallStatus,
tool: String,
},
DynamicToolCall {
arguments: Value,
content_items: Option<Vec<DynamicToolCallOutputContentItem>>,
duration_ms: Option<i64>,
id: String,
namespace: Option<String>,
status: DynamicToolCallStatus,
success: Option<bool>,
tool: String,
},
CollabAgentToolCall {
agents_states: BTreeMap<String, CollabAgentState>,
id: String,
model: Option<String>,
prompt: Option<String>,
reasoning_effort: Option<ReasoningEffort>,
receiver_thread_ids: Vec<String>,
sender_thread_id: String,
status: Value,
tool: Value,
},
SubAgentActivity {
agent_path: String,
agent_thread_id: String,
id: String,
kind: SubAgentActivityKind,
model: Option<String>,
reasoning_effort: Option<ReasoningEffort>,
},
WebSearch {
action: Option<WebSearchAction>,
id: String,
query: String,
results: Option<Vec<Value>>,
},
ImageView {
id: String,
path: LegacyAppPathString,
},
Sleep {
duration_ms: i64,
id: String,
},
ImageGeneration {
failure: Option<ImageGenerationFailure>,
generation_id: Option<String>,
id: String,
image: GeneratedImageRef,
input_images: Option<Vec<ImageGenerationInputImage>>,
revised_prompt: Option<String>,
saved_path: Option<AbsolutePathBuf>,
status: String,
transparent_background: Option<bool>,
},
EnteredReviewMode {
id: String,
review: String,
},
ExitedReviewMode {
id: String,
review: String,
},
ContextCompaction {
id: String,
},
FunctionCallOutput {
id: String,
name: String,
namespace: Option<String>,
output: FunctionCallOutputBody,
},
}Expand description
The type-tagged body of a ThreadItem, flattened into it on the wire.
Variants§
UserMessage
HookPrompt
AgentMessage
Fields
§
delivery: Option<AgentMessageDelivery>§
memory_citation: Option<MemoryCitation>§
moderation: Option<AgentMessageModeration>§
phase: Option<MessagePhase>§
questions: Option<Vec<AsyncUserInputQuestion>>Plan
Reasoning
CommandExecution
FileChange
McpToolCall
Fields
§
app_context: Option<McpToolCallAppContext>§
error: Option<McpToolCallError>§
mcp_app_resource_uri: Option<String>Legacy compatibility field; prefer mcp_app_ui.resource_uri when
available.
§
mcp_app_ui: Option<McpAppUi>Presentation captured from the invoked descriptor; absent in older history.
§
result: Option<McpToolCallResult>§
status: McpToolCallStatusDynamicToolCall
CollabAgentToolCall
SubAgentActivity
Fields
§
kind: SubAgentActivityKind§
model: Option<String>Resolved model at sub-agent creation; absent from older records and other activities.
§
reasoning_effort: Option<ReasoningEffort>Resolved reasoning effort at sub-agent creation, when known.
WebSearch
ImageView
Sleep
ImageGeneration
Fields
§
failure: Option<ImageGenerationFailure>§
image: GeneratedImageRef§
input_images: Option<Vec<ImageGenerationInputImage>>Observed local inputs for a completed generation, absent on older items.
§
saved_path: Option<AbsolutePathBuf>EnteredReviewMode
ExitedReviewMode
ContextCompaction
FunctionCallOutput
Trait Implementations§
Source§impl Clone for ThreadItemPayload
impl Clone for ThreadItemPayload
Source§impl Debug for ThreadItemPayload
impl Debug for ThreadItemPayload
Source§impl<'de> Deserialize<'de> for ThreadItemPayload
impl<'de> Deserialize<'de> for ThreadItemPayload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 From<ThreadItemPayload> for ThreadItem
impl From<ThreadItemPayload> for ThreadItem
Source§fn from(payload: ThreadItemPayload) -> Self
fn from(payload: ThreadItemPayload) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ThreadItemPayload
impl PartialEq for ThreadItemPayload
Source§impl Serialize for ThreadItemPayload
impl Serialize for ThreadItemPayload
impl StructuralPartialEq for ThreadItemPayload
Auto Trait Implementations§
impl Forget for ThreadItemPayload
impl Freeze for ThreadItemPayload
impl Move for ThreadItemPayload
impl RefUnwindSafe for ThreadItemPayload
impl Send for ThreadItemPayload
impl Sync for ThreadItemPayload
impl Unpin for ThreadItemPayload
impl UnsafeUnpin for ThreadItemPayload
impl UnwindSafe for ThreadItemPayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more