//! Native item lifecycle envelopes and the item fields used by typed events. use prost::Message; #[derive(Clone, Message)] pub(super) struct Started { #[prost(message, optional, tag = "1")] pub item: Option, #[prost(int64, optional, tag = "2")] pub at_ms: Option, #[prost(string, optional, tag = "3")] pub thread_id: Option, #[prost(string, optional, tag = "4")] pub turn_id: Option, } #[derive(Clone, Message)] pub(super) struct Completed { #[prost(int64, optional, tag = "1")] pub at_ms: Option, #[prost(message, optional, tag = "2")] pub item: Option, #[prost(string, optional, tag = "3")] pub thread_id: Option, #[prost(string, optional, tag = "4")] pub turn_id: Option, } #[derive(Clone, Message)] pub(super) struct Item { #[prost( oneof = "Value", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19" )] pub value: Option, } #[derive(Clone, prost::Oneof)] pub(super) enum Value { #[prost(message, tag = "1")] UserMessage(UserMessage), #[prost(bytes, tag = "2")] HookPrompt(Vec), #[prost(message, tag = "3")] AgentMessage(AgentMessage), #[prost(bytes, tag = "4")] FunctionCallOutput(Vec), #[prost(bytes, tag = "5")] Plan(Vec), #[prost(message, tag = "6")] Reasoning(Reasoning), #[prost(message, tag = "7")] Command(Command), #[prost(message, tag = "8")] FileChange(FileChange), #[prost(bytes, tag = "9")] Mcp(Vec), #[prost(bytes, tag = "10")] DynamicTool(Vec), #[prost(bytes, tag = "11")] CollabAgent(Vec), #[prost(bytes, tag = "12")] SubAgent(Vec), #[prost(bytes, tag = "13")] WebSearch(Vec), #[prost(bytes, tag = "14")] ImageView(Vec), #[prost(bytes, tag = "15")] Sleep(Vec), #[prost(bytes, tag = "16")] ImageGeneration(Vec), #[prost(bytes, tag = "17")] EnterReview(Vec), #[prost(bytes, tag = "18")] ExitReview(Vec), #[prost(bytes, tag = "19")] Compaction(Vec), } #[derive(Clone, Message)] pub(super) struct AgentMessage { #[prost(string, optional, tag = "2")] pub id: Option, #[prost(message, optional, tag = "5")] pub questions: Option, #[prost(string, optional, tag = "6")] pub text: Option, } #[derive(Clone, Message)] pub(super) struct AgentQuestionList { #[prost(message, repeated, tag = "1")] pub values: Vec, } #[derive(Clone, Message)] pub(super) struct AgentQuestion { #[prost(message, optional, tag = "1")] pub options: Option, #[prost(string, optional, tag = "2")] pub title: Option, } #[derive(Clone, Message)] pub(super) struct Command { #[prost(string, optional, tag = "1")] pub output: Option, #[prost(string, optional, tag = "2")] pub command: Option, #[prost(message, optional, tag = "3")] pub actions: Option, #[prost(string, optional, tag = "4")] pub cwd: Option, #[prost(int64, optional, tag = "5")] pub duration_ms: Option, #[prost(int64, optional, tag = "6")] pub exit_code: Option, #[prost(string, optional, tag = "7")] pub id: Option, #[prost(int32, optional, tag = "11")] pub source: Option, #[prost(int32, optional, tag = "12")] pub status: Option, } #[derive(Clone, Message)] pub(super) struct Reasoning { #[prost(message, optional, tag = "1")] pub content: Option, #[prost(string, optional, tag = "2")] pub id: Option, #[prost(message, optional, tag = "3")] pub summary: Option, } #[derive(Clone, Message)] pub(super) struct StringList { #[prost(string, repeated, tag = "1")] pub values: Vec, } #[derive(Clone, Message)] pub(super) struct CommandActionList { #[prost(message, repeated, tag = "1")] pub values: Vec, } #[derive(Clone, Message)] pub(super) struct CommandAction { #[prost(oneof = "command_action::Value", tags = "1, 2, 3, 4")] pub value: Option, } pub(super) mod command_action { #[derive(Clone, prost::Oneof)] pub enum Value { #[prost(message, tag = "1")] Read(super::ReadAction), #[prost(message, tag = "2")] ListFiles(super::ListFilesAction), #[prost(message, tag = "3")] Search(super::SearchAction), #[prost(message, tag = "4")] Unknown(super::UnknownAction), } } #[derive(Clone, Message)] pub(super) struct ReadAction { #[prost(string, optional, tag = "1")] pub command: Option, #[prost(string, optional, tag = "2")] pub name: Option, #[prost(string, optional, tag = "3")] pub path: Option, } #[derive(Clone, Message)] pub(super) struct ListFilesAction { #[prost(string, optional, tag = "1")] pub command: Option, #[prost(string, optional, tag = "2")] pub path: Option, } #[derive(Clone, Message)] pub(super) struct SearchAction { #[prost(string, optional, tag = "1")] pub command: Option, #[prost(string, optional, tag = "2")] pub path: Option, #[prost(string, optional, tag = "3")] pub query: Option, } #[derive(Clone, Message)] pub(super) struct UnknownAction { #[prost(string, optional, tag = "1")] pub command: Option, } #[derive(Clone, Message)] pub(super) struct FileChange { #[prost(message, optional, tag = "1")] pub changes: Option, #[prost(string, optional, tag = "2")] pub id: Option, #[prost(int32, optional, tag = "3")] pub status: Option, } #[derive(Clone, Message)] pub(super) struct UserMessage { #[prost(string, optional, tag = "1")] pub client_id: Option, #[prost(message, optional, tag = "2")] pub content: Option, #[prost(string, optional, tag = "3")] pub id: Option, }