Skip to content

[WIP] Native A2UI Support#866

Draft
KetanReddy wants to merge 8 commits into
mainfrom
feture/a2ui
Draft

[WIP] Native A2UI Support#866
KetanReddy wants to merge 8 commits into
mainfrom
feture/a2ui

Conversation

@KetanReddy
Copy link
Copy Markdown
Member

@KetanReddy KetanReddy commented May 12, 2026

What and Why

With the emergence of A2UI and other agent driven standards; Player, in its mission to serve the broader SDUI space, should expand support for more formats beyond its own in order to broaden the scopes of what Player solves for. Furthermore this lets capabilities be built against Player itself, regardless of input format, allowing for the decoupling of implementation from the server driving it.

Core

Player's existing ingestion expects an authored Flow { id, views, schema, data, navigation } representing a nested asset tree with a state machine. The A2UI v0.9 protocol is shaped differently: a flat adjacency list of components keyed by id, with one id: "root", JSON Pointer (/user/name) bindings, and polymorphic Dynamic* fields (literal | {path} | {call, args}). It has no navigation and no data schema. To let agent-emitted A2UI snapshots run on Player without any platform changes, core/player/src/a2ui/ ships a content adapter wired into Player.start(payload, { format: "a2ui" }). The adapter walks from root, inlines child references into Player's nested {asset: ...} shape, translates {path}"{{x.y}}" template strings on display props (and bare bindings on input props like TextField.value so transforms can write back), turns formatString into Player's {{...}} interpolation and other function calls into @[fn({{...}})]@ expressions, lifts component checks into a synthesized Player schema with the standard required/regex/email/length/numeric validators, and synthesizes a single-VIEW navigation with one END_<event> state per action: {event: {name}} so agent dispatch becomes a Player transition. The synthesized Flow then flows through Player's existing parser/resolver/data/validation pipeline unchanged. Benchmarks (vitest bench at adapter.bench.ts) cover tiny/flat/deep/mixed/bindings-heavy/templates-heavy snapshots.

A2UI plugin

plugins/a2ui/ ships the platform side. core/ provides A2UIPlugin which composes A2UITransformPlugin (per-component asset transforms wiring currentValue / set() / format() / validation onto input components — TextField, CheckBox, Slider, DateTimeInput, ChoicePicker, Button) and A2UIExpressionsPlugin which registers the standard A2UI catalog functions (format.ts formatString/formatNumber/formatCurrency/formatDate/pluralize, validation.ts required/regex/length/numeric/email, logic.ts and/or/not, action.ts openUrl) so adapter-emitted @[fn(...)]@ expressions evaluate via Intl/standard handlers. react/ provides the rendering layer (Text, Row, Column, List, Card, Modal, Tabs, Button, TextField, CheckBox, Slider, DateTimeInput, ChoicePicker, Image, Icon, Divider) — assets just read their already-resolved props since Player Core handles all binding/expression resolution upstream. The mocks/ package contains end-to-end snapshots (text/list/template/expressions-showcase/text-field-validation) used by both storybook and integration tests.

To Do

  • Harden binding logic for paths vs static elements (works now but relies on internal assumptions)
  • Build out consolidated entry point for A2UI (platform components preconfigured with plugins)
  • Build out Android JPC Assets
  • Build out iOS SwiftUI components

To Align On

Overall Approach

  • Do we want to have this switch inside of Player or do we want to offer two exports from core, one per input format, to minimize bundle size

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major
  • N/A

Does your PR have any documentation updates?

  • Updated docs
  • No Update needed
  • Unable to update docs

Release Notes

TBD

📦 Published PR as canary version: 0.16.0--canary.866.36538

Try this version out locally by upgrading relevant packages to 0.16.0--canary.866.36538

@KetanReddy KetanReddy added the minor Increment the minor version when merged label May 12, 2026
@KetanReddy
Copy link
Copy Markdown
Member Author

/docs

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Bundle Report

Changes will increase total bundle size by 941.65kB (16.74%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
tools/storybook 113.95kB 1.85kB (1.65%) ⬆️
plugins/common-expressions/core 433.84kB 27.24kB (6.7%) ⬆️⚠️
plugins/check-path/core 447.69kB 27.24kB (6.48%) ⬆️⚠️
plugins/stage-revert-data/core 411.37kB 27.24kB (7.09%) ⬆️⚠️
plugins/async-node/core 485.64kB 27.24kB (5.94%) ⬆️⚠️
plugins/markdown/core 694.93kB 27.25kB (4.08%) ⬆️
plugins/reference-assets/core 490.88kB 27.24kB (5.87%) ⬆️⚠️
plugins/beacon/core 429.06kB 27.24kB (6.78%) ⬆️⚠️
react/player 73.42kB 72 bytes (0.1%) ⬆️
plugins/metrics/core 465.52kB 27.24kB (6.21%) ⬆️⚠️
plugins/common-types/core 508.3kB 27.24kB (5.66%) ⬆️⚠️
core/player 1.04MB 80.98kB (8.49%) ⬆️⚠️
plugins/a2ui/core 484.48kB 484.48kB (100%) ⬆️⚠️
plugins/a2ui/mocks 40.76kB 40.76kB (100%) ⬆️⚠️
plugins/a2ui/react 88.36kB 88.36kB (100%) ⬆️⚠️

Affected Assets, Files, and Routes:

view changes for bundle: plugins/metrics/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
MetricsPlugin.native.js 27.24kB 433.18kB 6.71% ⚠️
view changes for bundle: plugins/stage-revert-data/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
StageRevertDataPlugin.native.js 27.24kB 404.55kB 7.22% ⚠️
view changes for bundle: plugins/async-node/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
AsyncNodePlugin.native.js 27.24kB 437.79kB 6.63% ⚠️
view changes for bundle: plugins/common-types/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
CommonTypesPlugin.native.js 27.24kB 437.13kB 6.64% ⚠️
view changes for bundle: core/player

Assets Changed:

Asset Name Size Change Total Size Change (%)
Player.native.js 30.33kB 433.51kB 7.52% ⚠️
cjs/index.cjs 17.17kB 205.14kB 9.13% ⚠️
index.legacy-esm.js 16.74kB 198.31kB 9.22% ⚠️
index.mjs 16.74kB 198.31kB 9.22% ⚠️
view changes for bundle: react/player

Assets Changed:

Asset Name Size Change Total Size Change (%)
cjs/index.cjs 24 bytes 26.73kB 0.09%
index.legacy-esm.js 24 bytes 23.35kB 0.1%
index.mjs 24 bytes 23.35kB 0.1%
view changes for bundle: tools/storybook

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.js 974 bytes 58.81kB 1.68%
index.mjs 879 bytes 55.13kB 1.62%
view changes for bundle: plugins/markdown/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
MarkdownPlugin.native.js 27.25kB 669.77kB 4.24%
view changes for bundle: plugins/beacon/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
BeaconPlugin.native.js 27.24kB 414.6kB 7.03% ⚠️
view changes for bundle: plugins/common-expressions/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
CommonExpressionsPlugin.native.js 27.24kB 412.6kB 7.07% ⚠️
view changes for bundle: plugins/reference-assets/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
ReferenceAssetsPlugin.native.js 27.24kB 460.98kB 6.28% ⚠️
view changes for bundle: plugins/check-path/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
CheckPathPlugin.native.js 27.24kB 418.21kB 6.97% ⚠️

intuit-svc added a commit to player-ui/player-ui.github.io that referenced this pull request May 12, 2026
@intuit-svc
Copy link
Copy Markdown
Contributor

Docs Preview

A preview of your PR docs was deployed by CircleCI #36492 on Tue, 12 May 2026 07:39:49 GMT

📖 Docs (View site)

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (23a98a4) to head (0186f1b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #866   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KetanReddy
Copy link
Copy Markdown
Member Author

/canary

intuit-svc added a commit to player-ui/player-ui.github.io that referenced this pull request May 12, 2026
@intuit-svc
Copy link
Copy Markdown
Contributor

Build Preview

Your PR was deployed by CircleCI #36538 on Tue, 12 May 2026 23:31:09 GMT with this version:

0.16.0--canary.866.36538

📖 Docs (View site)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants