Skip to main content

Event shape

Every event, from Events and Changes, is the same envelope:
Event envelope

Event types (type)

data is an open object shaped by type. This list is representative: other types such as DelayAgentStartEvent may appear.
Event data by type

Agent activity (AgentEvent.data)

The agent’s step-by-step trace lives inside AgentEvent. Its data is the step event, and data.kind tells you what happened:
AgentEvent data by kind
Parsing a stream means switching on the outer type, then for AgentEvent, on data.kind:
AgentEvent

Observation shapes

An observation_event is flat: type names the environment that produced it, image is the screenshot (if any), and metadata is that environment’s snapshot, shaped by type (an open object, so switch on type to read it). The Browser emits one of two types, depending on the environment’s mode. The page text lives in metadata, not in the top-level text: read metadata.text for web and metadata.page_markdown (or page_html) for textual_web. The top-level text carries only occasional step notices (for example [page unchanged since previous observation]) and is null for most observations. In visual mode the Browser emits web: a screenshot (top-level image) plus page metadata. In text mode it emits textual_web: paginated page text under metadata, no screenshot.

Images

The image on an observation_event, and any image inside message_event.content[], is { source, type, media_type }. type is url for platform-served screenshots (fetch source with your API key) or base64 for inline images. Images embedded in a tool_result.result or an answer_event.answer stay inline as base64 within that opaque payload, never as URLs.