agentivity_ag_ui 0.2.0 copy "agentivity_ag_ui: ^0.2.0" to clipboard
agentivity_ag_ui: ^0.2.0 copied to clipboard

Flutter package for AI agent UIs — AG-UI protocol, SSE streaming, chat panel, HIL forms, AI assistant, and agent run monitor. Bring your own backend.

Changelog #

0.2.0 #

Generative UI, protocol alignment, state sync, and frontend tools.

New capabilities #

  • Generative UIAgUiGenerativeController processes Stream<AgUiEvent> and maintains a sealed AgUiGenerativeItem list (AgUiTextItem, AgUiReasoningItem, AgUiComponentItem, AgUiToolCallItem). AgUiGenerativeView renders it reactively with streaming indicators, collapsible reasoning blocks, and tool-call status cards.
  • Widget registryAgUiWidgetRegistry maps component names to Flutter widget builders. The agent calls a tool whose name matches a registered component → the controller seamlessly replaces the placeholder with the live widget. Also supported via CUSTOM events with name == 'render'.
  • Frontend toolsAgUiFrontendToolRegistry / AgUiFrontendTool let the agent call client-side code (no backend round-trip). Results are shown inline. Use toApiDescriptions() to include frontend tools in the agent's tool list.
  • State syncAgUiStateController applies STATE_SNAPSHOT and STATE_DELTA (RFC 6902 JSON Patch: add, remove, replace, move, copy) to a reactive state map. AgUiStateBuilder provides a ListenableBuilder wrapper.

Protocol alignment (breaking if you used internal names) #

  • ToolCallStartEvent: JSON key changed from toolNametoolCallName (legacy toolName still read as fallback).
  • ToolCallArgsDeltaEvent: now handles both spec name TOOL_CALL_ARGS and legacy TOOL_CALL_ARGS_DELTA.
  • ToolCallResultEvent: field renamed resultcontent (legacy result read as fallback); messageId is now a required String.
  • RunStartedEvent: added threadId, parentRunId.
  • RunFinishedEvent: added threadId, outcome (AgUiSuccessOutcome or AgUiInterruptOutcome with List<AgUiInterrupt>). isInterrupted convenience getter.
  • Added event types: TextMessageChunkEvent, ToolCallChunkEvent, ReasoningMessageStartEvent, ReasoningMessageContentEvent, ReasoningMessageEndEvent, ReasoningStartEvent, ReasoningEndEvent, ActivitySnapshotEvent, ActivityDeltaEvent, RawEvent.
  • StateDeltaEvent.delta is now typed List<dynamic> (RFC 6902 patch array).

Tests #

  • 150 unit tests covering protocol parsing, JSON Patch operations (including ~0/~1 escaping and - array append), generative controller event handling, and controller notification behaviour.

0.1.0 #

Initial release.

  • AG-UI protocol — sealed AgUiEvent hierarchy covering all standard event types (run lifecycle, text messages, tool calls, state, custom). Ready-made agUiEventParser for use with AgUiSseChannel.
  • SSE channelAgUiSseChannel<T> with RFC 8895 frame parsing, exponential backoff reconnection, Last-Event-ID tracking, and a 45-second watchdog timer.
  • Abstract provider interfacesIChatProvider, IHilProvider, IAiAssistantProvider, IAgentRunProvider. Implement against your backend; the package stays backend-agnostic.
  • ChangeNotifier controllersChatController, HilController, AiAssistantController, AgentRunController. Drop into any Flutter state management setup (Riverpod, Provider, BLoC, raw ListenableBuilder).
  • Flutter widgetsAgUiChatPanel, AgUiHilForm, AgUiAssistantPanel, AgUiRunPanel, AgUiRunStatusBadge.
  • ThemeExtension stylingAgUiChatTheme, AgUiHilTheme, AgUiAssistantTheme integrate with your existing ThemeData. Each widget also accepts a per-instance style override and builder callbacks for full structural replacement.
1
likes
0
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter package for AI agent UIs — AG-UI protocol, SSE streaming, chat panel, HIL forms, AI assistant, and agent run monitor. Bring your own backend.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter, flutter_markdown_plus

More

Packages that depend on agentivity_ag_ui