Skip to main content

ai_ui_stream 1.0.1 copy "ai_ui_stream: ^1.0.1" to clipboard
ai_ui_stream: ^1.0.1 copied to clipboard

Transport-agnostic Dart client for the AI SDK UI Message Stream protocol: SSE parser, message reducer and chat controller with tool approval.

Changelog #

1.0.1 - 2026-11-01 #

  • Package description and library docs reworded. No code changes.

1.0.0 - 2026-10-31 #

First public release. Covers every chunk type of the AI SDK v7 UI Message Stream, verified against byte-exact fixtures generated from ai@7.0.133.

  • ChatController with useChat parity: sendText / sendMessage, regenerate, continueTurn, resumeStream, stop, addToolOutput / addToolOutputError, respondToApprovals / addToolApprovalResponse, clearError, onFinish / onError callbacks, dataEvents stream.
  • Spec tool-approval flow (tool-approval-request / -response, ToolApproval, outputDenied). The old finish-time heuristic is opt-in via inferApprovalOnFinish.
  • All part types: text, reasoning, tool (static and dynamic), step-start, source-url, source-document, file, data, unknown. Serialization matches the AI SDK's own UIMessage byte for byte.
  • Frame-based SSE decoder (WHATWG EventSource rules, [DONE]), response validation (ChatProtocolException), abort signal to the transport.
  • Optional HttpChatTransport behind package:ai_ui_stream/http.dart.

Upgrading from 0.1.0 #

0.1.0 was never published; these notes are for git-ref users.

  • ChatTransport.send(request, {required abort}) returns Future<ChatResponse>; extends ChatTransport to inherit reconnect.
  • ToolUIPart.approved is now approval?.approved; ApprovalDecision and PendingApproval require approvalId; PendingApproval.input is Object?.
  • respondToApprovals without userText continues the last assistant message instead of adding a placeholder.
  • removeLastExchange returns ({String? userText, List<UIMessage> removed}).
  • ToolState.inputError is gone: tool-input-error ends in outputError. ToolUIPart.input is Object?. Unknown state throws FormatException.
  • start-step inserts StepStartUIPart; abort leaves open parts streaming.
  • Finish-time approval inference is off unless inferApprovalOnFinish: true.

0.1.0 #

Initial unpublished version.

1
likes
160
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Transport-agnostic Dart client for the AI SDK UI Message Stream protocol: SSE parser, message reducer and chat controller with tool approval.

Repository (GitHub)
View/report issues

Topics

#ai #sse #streaming #chat #vercel-ai-sdk

License

Apache-2.0 (license)

Dependencies

http

More

Packages that depend on ai_ui_stream