Repository navigation
chore!: depend on a2ui_core 0.2.2; bump genui and genui_a2a to 0.11.0 - #1054
andrewkolos wants to merge 20 commits into
Conversation
a2ui_agent 0.0.1-wip004 requires a2ui_core ^0.2.2, and genui's ^0.1.0 constraint keeps an app that depends on both from resolving. - A2uiMessage is AgentToRendererMessage, Catalog takes a function type parameter, and MessageProcessor takes the protocol version and a message payload. The controller runs it with the relaxed graph checks, because a surface reaches it one message at a time. - The processor validates each message before applying it, so a schema error now arrives as a core A2uiValidationError. The controller reports it with the component path genui's own validation gave, and maps every other core error to VALIDATION_FAILED. - Tests follow the core's contracts: a write below a primitive throws, a surface naming an unknown catalog is reported instead of rendered as a fallback, and surfaces name a catalog the controller holds. Four catalog_gallery samples that do not match genui's schemas (spec-named Tabs items, an icon outside the enum) are skipped with the reason.
Keeps 0.11.0 above main's 0.10.6 and 0.10.5 in the genui CHANGELOG, and version 0.11.0 in its pubspec.
VALIDATION_FAILED requires a path, but duplicate ids, cycles and invalid path syntax reached the agent without one. Report the component an error names, else the data path, else the part of the message that failed.
…docs The CHANGELOG now lists every behavior change the a2ui_core 0.2.2 upgrade brings to genui and links the migration guide. The READMEs, genui_a2a's design notes and the contributing design doc use AgentToRendererMessage.
genui's Tabs schema named the item fields label and content, while the v0.9 basic catalog names them title and child. Now that a2ui_core rejects a message that does not match the schema, Tabs from an agent following the specification were dropped. The three gallery samples that use the specification's names render again.
Keeps 0.11.0 above main's 0.10.7 in the genui CHANGELOG, and version 0.11.0 in its pubspec.
A message with one invalid component leaves the surface unchanged, and an update that omits the component type is still applied.
The Tabs entry says what changed rather than implying 0.10.x rejected the specification's names, the rejection list names the cycle, depth and nesting limits and that cycles through children lists go undetected, and data model updates to an unknown catalog still apply. The migration guide says every app should check its agent's output against the stricter validation.
# Conflicts: # packages/genui/CHANGELOG.md # packages/genui/pubspec.yaml
The sample's day icons used names that are in no catalog (cloud, wbSunny, rainy), so a2ui_core rejected the message and the sample rendered nothing. Show each day's condition as a Text label instead, in both the gallery and composer copies, and render every sample again.
The state, validation and data error branches built the same report as the A2uiError branch below them.
The schema requires title and child, and a2ui_core rejects any other spelling before the widget builds, so the label and content fallbacks could not run.
…d child The schema now takes either the specification's title and child or the label and content genui used before, so agents that learned genui's earlier schema keep working. The specification's names come first.
…y validation is for processMessages throws only a2ui_core errors, so the A2uiValidationException branch never ran.
…ough them genui's children schema was an inline list-or-template that a2ui_core did not recognize as component references, so a cycle through Row, Column or List children passed validation and overflowed the stack when built. It now references the specification's ChildList, which accepts the same shapes, and the cycle is rejected and reported.
There was a problem hiding this comment.
Code Review
This pull request upgrades the a2ui_core dependency to ^0.2.2 and updates genui and genui_a2a to version 0.11.0. The key changes include renaming A2uiMessage to AgentToRendererMessage across the codebase, introducing stricter message validation in SurfaceController with detailed error path reporting, and updating the Tabs component to support title and child properties while maintaining backward compatibility for label and content. Feedback on the changes suggests correcting a test description in error_reporting_test.dart to accurately reflect that AgentToRendererMessage.fromJson asserts A2uiValidationError rather than A2uiValidationException.
Note: Security Review did not run due to the size of the PR.
The workspace constraint check counted packages/archive/a2ui_core (0.1.0) as the local a2ui_core, so raising genui's constraint to ^0.2.2 failed it. The archived packages are not workspace members.
a2ui_agent 0.0.1-wip004 requires
a2ui_core: ^0.2.2and genui requires^0.1.0, so an app that depends on both cannot resolve. This moves genui, genui_a2a and the workspace apps to a2ui_core 0.2.2, and bumps genui and genui_a2a up anothe minor version because the message type in their API is renamed.What changes for users is in the genui CHANGELOG and the new migration guide (
docs/usage/migration/migration_0.10.x_to_0.11.0.md). In short:A2uiMessageisAgentToRendererMessageinA2uiMessageSink,Transport,A2uiTransportAdapter,A2uiMessageEventandA2uiAgentConnector.stream.childorchildren, over-deep nesting and invalid data paths are rejected too. Each is reported to the agent asVALIDATION_FAILEDwith a path.Tabsitems accept the specification'stitle/childas well as genui'slabel/content.Misc: The
weatherForecastsample (catalog_gallery and composer) used icon names that are in no catalog (cloud,wbSunny,rainy), so a2ui_core rejected it; it now shows each day's condition as text.Tested:
flutter analyze --fatal-infosandflutter testpass in every workspace package, andtool/e2epasses.///).