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-resultturn-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-finisherrortool-calltool-result