A2uiStreamParser class

Incremental A2UI extractor. Create one per model response, push text deltas as they arrive, and flush at the end to drain any trailing block.

Surface ids are the model's own (surface("tokyo-weather")). Rendering a surface id that already exists replaces that surface: every createSurface is preceded by a deleteSurface for the same id, which renderers treat as a no-op when the surface is new. That way a re-render never depends on the server knowing which surfaces the client holds. The Express source is never edited, so it can be replayed verbatim.

Constructors

A2uiStreamParser({required A2uiCatalog catalog, A2uiValidateMode validate = A2uiValidateMode.strict, Iterable<A2uiEnvelope> history = const []})
Creates an A2uiStreamParser.

Properties

catalog → A2uiCatalog
Catalog the blocks are compiled and validated against.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
validate → A2uiValidateMode
What to do with a block that fails to compile or validate.
final

Methods

flush() → ParseResult
Drains any remaining buffered content at end of stream.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
push(String text) → ParseResult
Feeds a chunk of model text, returning prose + any completed blocks.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited