API Reference
Session Events
Which event types session.subscribe() emits and what each one means
Session Events
session.subscribe() currently emits these core event types:
turn-starttext-deltareasoning-deltatool-calltool-resultassistant-stepturn-finisherror
The most common one is text-delta
If you only need real-time text output, this is usually enough to handle first:
if (event.type === "text-delta") {
process.stdout.write(event.text);
}If you want a fuller experience, you will usually also handle:
turn-startturn-finisherrorassistant-steptool-calltool-result
assistant-step is especially useful for transports such as chat bridges that want step-level visible reply chunks without owning Session history persistence themselves.