Function: groupByTurn()
groupByTurn(
segments):SegmentGroup[]
Defined in: packages/core/src/segments/selectors.ts:38
Group segments into turns for rendering.
Works identically for single-agent and multi-agent chat:
- UserSegments start a new 'user' turn
- All other segments are 'assistant' turns
- In multi-agent mode, agent boundaries create new groups
- DoneSegments are skipped (they're metadata, not content)