feat: migrate to A2UI protocol v1.0#996
Open
sethgw wants to merge 4 commits into
Open
Conversation
- Bump protocol version to v1.0 in message envelopes and capabilities - Rename createSurface 'theme' to 'surfaceProperties'; support inline 'components' and 'dataModel' for single-message UI instantiation - Add CallFunctionMessage/ActionResponseMessage (server-to-client) and A2uiFunctionResponse (client-to-server) with actionId correlation - Add callableFrom execution boundaries with INVALID_FUNCTION_CALL rejection for remote calls to clientOnly/unregistered functions - Serialize catalog functions as a map keyed by name with static returnType/callableFrom metadata; move surfaceProperties under $defs - Remove wire-level returnType from FunctionCall payloads - Serialize explicit null in updateDataModel for key deletion - Add @index system function (with offset) scoped to template loops - Enforce UAX flutter#31 identifier rules for catalog entity names - Add optional catalog 'instructions' (replaces external rules text) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Emit v1.0 envelopes for actions, errors, and message schemas - Rename theme to surfaceProperties in SurfaceDefinition and schemas - Add createSurface inline components/dataModel to message schema - Add callFunction/actionResponse message schemas for prompting - Send functionResponse and processor errors from SurfaceController - Serialize catalog functions as a v1.0 map with returnType/callableFrom; embed systemPromptFragments as catalog 'instructions' - Add callableFrom to ClientFunction (default clientOnly) - Add TextField.placeholder, Slider.steps, Video.posterUrl - Support @index system function in template loops (list/row/column) - Point basicCatalogId at the v1.0 basic catalog; refresh prompt goldens Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Bump A2A extension URI to a2ui/v1.0 - Define the standardized application/a2ui+json MIME type constant - Send v1.0 client event envelopes with actionId/wantResponse - Route incoming callFunction and actionResponse data parts Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Bump 46 catalog_gallery samples, simple_chat integration samples, and composer kProtocolVersion to v1.0 envelopes and the v1.0 basic catalog id - Add migration guide docs/usage/migration/migration_a2ui_v0.9_to_v1.0.md - Add CHANGELOG entries for a2ui_core, genui, and genui_a2a - Update README and contributing docs version references Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tracking issue: a2ui-project/a2ui#1959. Also resolves a2ui-project/a2ui#1896 (explicit-null deletion in
updateDataModel).Migrates the repository's A2UI implementation from protocol v0.9/v0.9.1 to v1.0, following the v1.0 evolution guide and the
specification/v1_0schemas in google/A2UI.Wire format (a2ui_core)
version: "v1.0"; the version constant is exported asa2uiProtocolVersion.createSurface:theme→surfaceProperties, plus optional inlinecomponentsanddataModelfor single-message UI instantiation.updateDataModel: explicitnulldeletion semantics —toJson()serializes"value": nullinstead of omitting it.returnTyperemoved fromFunctionCallpayloads (and from the expression parser output); boundaries/return types live in catalog definitions and are checked at runtime.New v1.0 RPC messages
CallFunctionMessage(functionCallId,wantResponse,callFunction) andActionResponseMessage(actionId,valueXORerror).A2uiFunctionResponse;A2uiClientActiongainswantResponse/actionId(generated when a component action setswantResponse: true, withactionResponsevalues written back to the data model atresponsePath);A2uiClientErrorsupportsfunctionCallIdXORsurfaceId.MessageProcessorexecutes remote calls withcallableFromboundary checks, rejectingclientOnly/unregistered functions withINVALID_FUNCTION_CALL, and exposesonFunctionResponse/onErrorchannels (wired throughSurfaceControllerto the outbound stream).Catalogs
functionsserialized as an object map keyed by function name (v1.0FunctionDefinitionshape: FunctionCall validation schema + staticreturnType/callableFrom).$defs/surfacePropertiesreplacestheme(primaryColorremoved); inline catalogs also emit$defs/anyComponent/$defs/anyFunction.instructionsfield (genui embedssystemPromptFragmentsthere, replacing external rules text).isValidA2uiIdentifier).ClientFunction.callableFromadded (defaults toclientOnly).Components & evaluation
TextField.placeholder,Slider.steps,Video.posterUrlper the v1.0 basic catalog.@indexbuilt-in system function (with optionaloffset) scoped to template instantiation loops, in both thea2ui_corebinder and the genuiList/Row/Columntemplate builders; the@prefix is reserved and errors outside Collection Scope.basicCatalogIdnow points athttps://a2ui.org/specification/v1_0/catalogs/basic/catalog.json.Transport (genui_a2a)
https://a2ui.org/a2a-extension/a2ui/v1.0; capabilities/data-model envelopes namespaced underv1.0.application/a2ui+jsonMIME type constant.callFunction/actionResponsedata parts routed to the message stream; outgoing action events carryactionId/wantResponse.Docs, samples, tooling
docs/usage/migration/migration_a2ui_v0.9_to_v1.0.md.a2ui_core,genui, andgenui_a2a.simple_chatintegration samples,catalog_gallerysamples (46), and composer constants updated to v1.0.Not included (n/a to this codebase today)
svgPath→pathrename: genui'sIconuses a Material icon-name enum and has no custom-SVG definition object.ClientFunctionexecution intoa2ui_coreremote calls: all built-in genui functions areclientOnly, so remote calls to them are correctly rejected per spec; execution bridging can follow as a separate change.Testing
./tool/run_all_tests_and_fixes.sh(repo-wide analyze + format + tests) passes.a2ui_core: 101 tests (was 69) — new coverage forcallFunction/actionResponseround-trips,callableFromrejection, explicit-null deletion, duplicate-surface errors, inline create,@index(offset, outside-scope error, nested inheritance), and UAX Update GEMINI instructions for catalog items, add implementation descriptions. #31 validation.genui: 279 tests,genui_a2a: 234 tests,catalog_gallery: 55 tests.🤖 Generated with Claude Code