RuntimeEvent
Report confirmed lifecycle changes with serializable runtime events.
Dispatch an event
Use the same response ID for its start, appended text, and terminal event.
import type { RuntimeEvent } from "@generative-a11y/core";
const event: RuntimeEvent = {
type: "response.started",
responseId: "report",
};
runtime.dispatch(event);See the complete response lifecycle for text deltas and completion.
Event families
Events describe actions and changes your app can confirm. They contain serializable data, not rendered components or private framework state.
| Family | Events | Required identity |
|---|---|---|
| Run | started, completed, interrupted, failed, retrying | runId |
| Step | started, progress, completed, interrupted, failed, retrying | runId; stepId when stable identity exists |
| Response | started, text.delta, completed, interrupted, failed, retrying | responseId |
| Tool | started, progress, completed, failed | toolId |
| Interaction | requested, resolved | interactionId |
| Approval | requested, resolved | approvalId |
| Connection | lost, restored | none |
| Citation | available | responseId |
Response replacement example
Use responseInstanceId when one logical response can be replaced. Late events from the old instance are suppressed as stale.
runtime.dispatch({
type: "response.retrying",
responseId: "report",
responseInstanceId: "attempt-1",
nextResponseInstanceId: "attempt-2",
attempt: 2,
});Keep responseId stable across regeneration and use the replacement
nextResponseInstanceId on later deltas and terminal events. A later
response.started with the same responseId also replaces the active attempt
and makes events from older instance IDs stale.
Common fields
ID fields connect related events. Labels and messages contain translated text for users.
Prop
Type
Localized announcements
See catalogs and adapter copy for the typed
messages and copy options, language ownership, validation, construction
lifetime, and replay requirements. Existing lifecycle evidence and timing remain
unchanged.