Skip to content

Native A2UI Support#866

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

Native A2UI Support#866
KetanReddy wants to merge 12 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 Changes

  • New transformContent waterfall hook on Player's hooks. Fires at the top of start(), after plugins are registered and before resolveFlowContent. Plugins inspect a ContentMeta { format, version } and either convert the payload or pass it through.
  • Player.start() signature widened from (payload: Flow) to (payload: unknown, options?: StartOptions). Default format is "player", which preserves existing behavior (a plain Flow flows through untouched). version is free-form, so a single format plugin can dispatch across versions.

React Changes

  • ReactPlayer.start() mirrors the same signature (react/player/src/player.tsx) and forwards options to
    the underlying Player.start().

Plugins

Core: @player-ui/a2ui-plugin

Includes three sub-plugins:

  • A2UIContentPlugin: Only activates when meta.format === "a2ui". Calls adaptA2UIToFlow(snapshot) to transform content
  • A2UITransformPlugin: Per-asset transforms (Button/TextField/CheckBox/Slider/DateTimeInput/ChoicePicker/Text) that attach run()/set()/value helpers consumed by the React layer.
  • A2UIExpressionsPlugin: Registers the A2UI v0.9.1 standard library: validation (required, regex, length, numeric, email), formatters (formatString, formatNumber, formatCurrency, formatDate, pluralize), openUrl, and logic (and/or/not).

Adapter Logic

Walks the flat components[] list from id: "root", inlines child references into a nested asset tree matching Player's {asset: ...} shape, and produces a Flow with a single VIEW state plus one END per unique event name encountered. Translation rules:

  • {path: "/x/y"} → "x.y" (Player binding)
  • formatString(...) → "Hello, {{x.y}}!" template
  • Other {call, args} → @[fn(...)]@ expression
  • checks: [...] on inputs → lifted into a synthesized Flow.schema via synthesizeSchema so Player's
    existing SchemaController/ValidationController pick them up unchanged
  • Templated children: {path, componentId} blocks become indexed paths scoped to .index
  • Cycle detection throws on non-tree component graphs

React: @player-ui/a2ui-plugin-react

Assets

A2UI v0.9.1 reference catalog: Row, Column, List, Text, Image, Icon, Divider, Card, Modal, Tabs, Button, TextField, CheckBox, Slider, DateTimeInput, ChoicePicker.

Packages

A new folder in the repo! The goal for this folder is to ship preconfigured Player entrypoints so consumers don't have to assemble plugins themselves. The plugins/ directory exports building blocks; packages/ exports ready-to-use Players for specific content formats.

@player-ui/a2ui

import { A2UIReactPlayer } from "@player-ui/a2ui";
  • Comes with the A2UI plugin pre-added

Storybook

New A2UI stories with one story per asset, driven by a createA2UIStory helper in the Player storybook extension that can render A2UI content.

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.36801

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

@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 640.55kB (11.39%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
tools/storybook 113.95kB 1.85kB (1.65%) ⬆️
plugins/common-expressions/core 407.14kB 535 bytes (0.13%) ⬆️
plugins/check-path/core 420.99kB 535 bytes (0.13%) ⬆️
plugins/stage-revert-data/core 384.67kB 535 bytes (0.14%) ⬆️
plugins/async-node/core 458.94kB 535 bytes (0.12%) ⬆️
plugins/markdown/core 668.22kB 542 bytes (0.08%) ⬆️
plugins/reference-assets/core 464.18kB 535 bytes (0.12%) ⬆️
plugins/beacon/core 402.36kB 535 bytes (0.13%) ⬆️
react/player 73.42kB 72 bytes (0.1%) ⬆️
plugins/metrics/core 438.82kB 535 bytes (0.12%) ⬆️
plugins/common-types/core 481.6kB 535 bytes (0.11%) ⬆️
core/player 955.48kB 1.19kB (0.12%) ⬆️
packages/a2ui/react 3.2kB 3.2kB (100%) ⬆️⚠️
plugins/a2ui/core 541.06kB 541.06kB (100%) ⬆️⚠️
plugins/a2ui/react 88.36kB 88.36kB (100%) ⬆️⚠️

Affected Assets, Files, and Routes:

view changes for bundle: plugins/markdown/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
MarkdownPlugin.native.js 542 bytes 643.07kB 0.08%
view changes for bundle: core/player

Assets Changed:

Asset Name Size Change Total Size Change (%)
Player.native.js 535 bytes 403.72kB 0.13%
cjs/index.cjs 230 bytes 188.21kB 0.12%
index.legacy-esm.js 212 bytes 181.78kB 0.12%
index.mjs 212 bytes 181.78kB 0.12%
view changes for bundle: plugins/async-node/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
AsyncNodePlugin.native.js 535 bytes 411.09kB 0.13%
view changes for bundle: plugins/check-path/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
CheckPathPlugin.native.js 535 bytes 391.5kB 0.14%
view changes for bundle: plugins/common-expressions/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
CommonExpressionsPlugin.native.js 535 bytes 385.9kB 0.14%
view changes for bundle: plugins/common-types/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
CommonTypesPlugin.native.js 535 bytes 410.43kB 0.13%
view changes for bundle: plugins/reference-assets/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
ReferenceAssetsPlugin.native.js 535 bytes 434.28kB 0.12%
view changes for bundle: plugins/stage-revert-data/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
StageRevertDataPlugin.native.js 535 bytes 377.84kB 0.14%
view changes for bundle: plugins/beacon/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
BeaconPlugin.native.js 535 bytes 387.89kB 0.14%
view changes for bundle: plugins/metrics/core

Assets Changed:

Asset Name Size Change Total Size Change (%)
MetricsPlugin.native.js 535 bytes 406.48kB 0.13%
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: 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%

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 (55defef) to head (8014781).

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

intuit-svc commented May 12, 2026

Build Preview

Your PR was deployed by CircleCI #36801 on Fri, 22 May 2026 04:41:49 GMT with this version:

0.16.0--canary.866.36801

📖 Docs (View site)

@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 22, 2026
@KetanReddy KetanReddy changed the title [WIP] Native A2UI Support Native A2UI Support May 22, 2026
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