Downcity
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-start
  • text-delta
  • reasoning-delta
  • tool-call
  • tool-result
  • turn-finish
  • error

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-start
  • turn-finish
  • error
  • tool-call
  • tool-result