Normalized runtime event envelope emitted by the core session layer.
Summary
Functions
Returns the supported normalized event kinds in stable order.
Builds a normalized runtime event.
Parses an event envelope through the canonical schema and projects it to the ergonomic struct.
Parses an event envelope and raises on invalid data.
Returns the payload module associated with a normalized kind.
Returns the shared event schema for the normalized envelope.
Projects the event back into its normalized map shape, preserving unknown keys.
Returns true when the kind is part of the normalized vocabulary.
Types
@type kind() ::
:run_started
| :assistant_delta
| :assistant_message
| :user_message
| :thinking
| :tool_use
| :tool_result
| :approval_requested
| :approval_resolved
| :cost_update
| :result
| :error
| :stderr
| :raw
@type payload() :: CliSubprocessCore.Payload.RunStarted.t() | CliSubprocessCore.Payload.AssistantDelta.t() | CliSubprocessCore.Payload.AssistantMessage.t() | CliSubprocessCore.Payload.UserMessage.t() | CliSubprocessCore.Payload.Thinking.t() | CliSubprocessCore.Payload.ToolUse.t() | CliSubprocessCore.Payload.ToolResult.t() | CliSubprocessCore.Payload.ApprovalRequested.t() | CliSubprocessCore.Payload.ApprovalResolved.t() | CliSubprocessCore.Payload.CostUpdate.t() | CliSubprocessCore.Payload.Result.t() | CliSubprocessCore.Payload.Error.t() | CliSubprocessCore.Payload.Stderr.t() | CliSubprocessCore.Payload.Raw.t()
@type t() :: %CliSubprocessCore.Event{ extra: map(), id: pos_integer(), kind: kind(), metadata: map(), payload: payload(), provider: atom() | nil, provider_session_id: String.t() | nil, raw: term(), sequence: non_neg_integer() | nil, timestamp: DateTime.t() }
Functions
@spec kinds() :: [kind(), ...]
Returns the supported normalized event kinds in stable order.
Builds a normalized runtime event.
@spec parse(keyword() | map() | t()) :: {:ok, t()} | {:error, {:invalid_event, CliSubprocessCore.Schema.error_detail()}} | {:error, {:invalid_event_payload, kind(), CliSubprocessCore.Schema.error_detail()}}
Parses an event envelope through the canonical schema and projects it to the ergonomic struct.
Parses an event envelope and raises on invalid data.
Returns the payload module associated with a normalized kind.
@spec schema() :: Zoi.schema()
Returns the shared event schema for the normalized envelope.
Projects the event back into its normalized map shape, preserving unknown keys.
Returns true when the kind is part of the normalized vocabulary.