pub enum EventData {
Show 54 variants
InputMessage(InputMessageData),
OutputMessageDelta(OutputMessageDeltaData),
OutputMessageStarted(OutputMessageStartedData),
OutputMessageReplaced(OutputMessageReplacedData),
OutputMessageCompleted(OutputMessageCompletedData),
TurnStarted(TurnStartedData),
TurnCompleted(TurnCompletedData),
TurnFailed(TurnFailedData),
ReasonStarted(ReasonStartedData),
ReasonCompleted(ReasonCompletedData),
ReasonRecovered(ReasonRecoveredData),
CapabilityUsage(CapabilityUsageData),
ActStarted(ActStartedData),
ActCompleted(ActCompletedData),
ToolStarted(ToolStartedData),
ToolCompleted(ToolCompletedData),
ToolProgress(ToolProgressData),
ToolOutputDelta(ToolOutputDeltaData),
ToolCallRequested(ToolCallRequestedData),
TranscriptRepaired(TranscriptRepairedData),
ToolCallRepaired(ToolCallRepairedData),
LlmGeneration(LlmGenerationData),
ReasonThinkingDelta(ReasonThinkingDeltaData),
ReasonItem(ReasonItemData),
ReasonThinkingStarted(ReasonThinkingStartedData),
ReasonThinkingCompleted(ReasonThinkingCompletedData),
TurnSealed(TurnSealedData),
TurnCancelled(TurnCancelledData),
SessionStarted(SessionStartedData),
SessionActivated(SessionActivatedData),
SessionIdled(SessionIdledData),
SessionTitleUpdated(SessionTitleUpdatedData),
SessionModelChanged(SessionModelChangedData),
TaskCreated(SessionTaskEventData),
TaskUpdated(SessionTaskEventData),
TaskMessageSent(TaskMessageEventData),
TaskMessageReceived(TaskMessageEventData),
ContextCompacting(ContextCompactingData),
ContextCompacted(ContextCompactedData),
ContextCompactionSkipped(ContextCompactionSkippedData),
ContextCompactionFailed(ContextCompactionFailedData),
FileWritten(FileWrittenData),
BudgetWarning(BudgetEventData),
BudgetPaused(BudgetEventData),
BudgetExhausted(BudgetEventData),
BudgetResumed(BudgetEventData),
VoiceSessionStarted(VoiceSessionStartedData),
VoiceInputTranscriptDelta(VoiceTranscriptData),
VoiceInputTranscriptCompleted(VoiceTranscriptData),
VoiceOutputTranscriptDelta(VoiceTranscriptData),
VoiceOutputTranscriptCompleted(VoiceTranscriptData),
VoiceSessionEnded(VoiceSessionEndedData),
VoiceSessionFailed(VoiceSessionFailedData),
Unsupported {
event_type: String,
data: Value,
},
}Expand description
Typed event data enum for all event payloads
This enum provides type safety for event data. Each variant corresponds
to a specific event type and contains the appropriate data structure.
The Raw variant is used for backward compatibility with legacy events
or unknown event types.
The data type depends on the event type field:
input.message→ InputMessageDataoutput.message.started→ OutputMessageStartedDataoutput.message.delta→ OutputMessageDeltaDataoutput.message.completed→ OutputMessageCompletedDataturn.started→ TurnStartedDataturn.completed→ TurnCompletedDataturn.failed→ TurnFailedDataturn.cancelled→ TurnCancelledDatareason.started→ ReasonStartedDatareason.completed→ ReasonCompletedDatacapability.usage→ CapabilityUsageDataact.started→ ActStartedDataact.completed→ ActCompletedDatatool.started→ ToolStartedDatatool.completed→ ToolCompletedDatatool.output.delta→ ToolOutputDeltaDatatool.call_requested→ ToolCallRequestedDatallm.generation→ LlmGenerationDatareason.thinking.started→ ReasonThinkingStartedDatareason.thinking.delta→ ReasonThinkingDeltaDatareason.thinking.completed→ ReasonThinkingCompletedDatareason.item→ ReasonItemDatasession.started→ SessionStartedDatasession.activated→ SessionActivatedDatasession.idled→ SessionIdledDatasession.title.updated→ SessionTitleUpdatedDatasession.model.changed→ SessionModelChangedDatafile.written→ FileWrittenData
Variants§
InputMessage(InputMessageData)
OutputMessageDelta(OutputMessageDeltaData)
OutputMessageStarted(OutputMessageStartedData)
OutputMessageReplaced(OutputMessageReplacedData)
OutputMessageCompleted(OutputMessageCompletedData)
TurnStarted(TurnStartedData)
TurnCompleted(TurnCompletedData)
TurnFailed(TurnFailedData)
ReasonStarted(ReasonStartedData)
ReasonCompleted(ReasonCompletedData)
ReasonRecovered(ReasonRecoveredData)
CapabilityUsage(CapabilityUsageData)
ActStarted(ActStartedData)
ActCompleted(ActCompletedData)
ToolStarted(ToolStartedData)
ToolCompleted(ToolCompletedData)
ToolProgress(ToolProgressData)
ToolOutputDelta(ToolOutputDeltaData)
ToolCallRequested(ToolCallRequestedData)
TranscriptRepaired(TranscriptRepairedData)
ToolCallRepaired(ToolCallRepairedData)
LlmGeneration(LlmGenerationData)
ReasonThinkingDelta(ReasonThinkingDeltaData)
ReasonItem(ReasonItemData)
ReasonThinkingStarted(ReasonThinkingStartedData)
ReasonThinkingCompleted(ReasonThinkingCompletedData)
TurnSealed(TurnSealedData)
TurnCancelled(TurnCancelledData)
SessionStarted(SessionStartedData)
SessionActivated(SessionActivatedData)
SessionIdled(SessionIdledData)
SessionTitleUpdated(SessionTitleUpdatedData)
SessionModelChanged(SessionModelChangedData)
TaskCreated(SessionTaskEventData)
TaskUpdated(SessionTaskEventData)
TaskMessageSent(TaskMessageEventData)
TaskMessageReceived(TaskMessageEventData)
ContextCompacting(ContextCompactingData)
ContextCompacted(ContextCompactedData)
ContextCompactionSkipped(ContextCompactionSkippedData)
Evaluation ran but installed nothing (context.compaction.skipped).
ContextCompactionFailed(ContextCompactionFailedData)
Attempt errored before installing (context.compaction.failed).
FileWritten(FileWrittenData)
BudgetWarning(BudgetEventData)
BudgetPaused(BudgetEventData)
BudgetExhausted(BudgetEventData)
BudgetResumed(BudgetEventData)
VoiceSessionStarted(VoiceSessionStartedData)
VoiceInputTranscriptDelta(VoiceTranscriptData)
VoiceInputTranscriptCompleted(VoiceTranscriptData)
VoiceOutputTranscriptDelta(VoiceTranscriptData)
VoiceOutputTranscriptCompleted(VoiceTranscriptData)
VoiceSessionEnded(VoiceSessionEndedData)
VoiceSessionFailed(VoiceSessionFailedData)
Unsupported
Internal-only variant for unknown event types. Never serialized to API responses - filtered out before transmission. Logs a warning when created to alert developers of unknown types.
Implementations§
Source§impl EventData
impl EventData
Sourcepub fn needs_public_projection(&self) -> bool
pub fn needs_public_projection(&self) -> bool
Replace every carried message with its publishable projection, dropping the opaque provider replay state on reasoning parts.
The message read path already does this via Message::into_public, so
without it here GET /v1/sessions/{id}/events would hand a client
exactly the signature / encrypted material that
GET /v1/sessions/{id}/messages withholds (EVE-933).
This is a read projection. The stored event must keep the replay state,
because replaying a turn reconstructs the message from the event log.
Whether Self::into_public would change this payload.
Lets a hot read path (the SSE stream) skip cloning for the many variants
that carry no message. Keep in step with into_public.
pub fn into_public(self) -> Self
Sourcepub fn is_unsupported(&self) -> bool
pub fn is_unsupported(&self) -> bool
Check if this is an unsupported event type. Unsupported events should be filtered before API responses.
Sourcepub fn unsupported(event_type: String, data: Value) -> Self
pub fn unsupported(event_type: String, data: Value) -> Self
Create an unsupported event data with warning log. This is used when deserializing unknown event types.
Source§impl EventData
impl EventData
Sourcepub fn event_type(&self) -> &'static str
pub fn event_type(&self) -> &'static str
Get the event type constant for this data. For Unsupported events, returns “unsupported” (internal use only).