Events
All events live incom.agui.community.core.event. Event is a sealed interface, and each event type is a record that implements it. Every event has these base fields:
Each record has a short constructor that leaves out
timestamp and rawEvent, and usually other optional fields too. Use the canonical constructor when you need them.
Handling events
BecauseEvent is sealed, you can handle events with a switch:
default branch to have the compiler check that you handle every event type.
Pattern matching for
switch requires Java 21. On Java 17, use instanceof patterns instead: if (event instanceof TextMessageContentEvent e) { ... }.Lifecycle events
RunFinishedEvent.outcome is a RunOutcome (SuccessOutcome or InterruptOutcome). See Interrupts.
Text message events
Tool call events
ToolCallArgsEvent.delta values are fragments of a JSON string. Concatenate them to get the full arguments.
Reasoning events
ReasoningMessageStartEvent defaults role to REASONING and rejects any other role.
State management events
StateDeltaEvent carries an RFC 6902 JSON Patch:
Activity events
Special events
EventType
EventType lists every type: RUN_STARTED, RUN_FINISHED, RUN_ERROR, STEP_STARTED, STEP_FINISHED, TEXT_MESSAGE_START, TEXT_MESSAGE_CONTENT, TEXT_MESSAGE_END, TEXT_MESSAGE_CHUNK, TOOL_CALL_START, TOOL_CALL_ARGS, TOOL_CALL_END, TOOL_CALL_CHUNK, TOOL_CALL_RESULT, REASONING_START, REASONING_END, REASONING_MESSAGE_START, REASONING_MESSAGE_CONTENT, REASONING_MESSAGE_END, REASONING_MESSAGE_CHUNK, REASONING_ENCRYPTED_VALUE, STATE_SNAPSHOT, STATE_DELTA, MESSAGES_SNAPSHOT, ACTIVITY_SNAPSHOT, ACTIVITY_DELTA, RAW, CUSTOM and META_EVENT.
The wire value of each constant is its name. EventType.fromValue("RUN_STARTED") converts a wire value back to the constant.
For what each event means in the protocol, see Events.