token_stream_controller 0.1.0
token_stream_controller: ^0.1.0 copied to clipboard
Pure Dart asynchronous token stream controller with transient reasoning phases, throughput telemetry, cancellation, and guaranteed cleanup.
0.1.0 #
- Initial release of
token_stream_controller. - Pure Dart zero-dependency asynchronous token streaming engine.
- Deterministic lifecycle phases:
idle,thinking,streaming,completed,cancelled, andfailed. - Transient reasoning status tracking with automatic cleanup upon output token arrival or termination.
- Real-time throughput telemetry (
tokensPerSecond) and elapsed duration tracking. - Guaranteed try-finally loading-state cleanup across all completion, cancellation, error, and timeout paths.
- Deterministic text simulation via
simulateTextfor offline copilots, widget tests, and demos. - Robust chunk timeout handling with
TokenStreamException. - Explicit mid-stream cancellation with
cancel(). - State reset via
reset()and controller lifecycle management viadispose(). - Multi-turn stream accumulation support with
appendToExisting.