Repository navigation
feat(examples): add A2UI Express to the playground - #7976
contextablemark wants to merge 3 commits into
Conversation
…nd Gemini A research desk at examples/showcases/a2ui. A Google ADK agent on Gemini answers in prose and, when a view helps, in A2UI from the standard catalog over the markdown transport, with Intelligence threads. Every view decompiles into its A2UI; a catalog page shows each standard component rendered from A2UI; Solarized light and dark follow the system. Also carries the react-core fixes the demo needs (some are open as separate PRs): horizontal bar value labels, Table headers for templated rows, Select padding without an icon, custom chat input layouts that grow their textarea, the app's error fallback for every failed node, pow() in calc, and markdown surfaces that show again on a thread revisit. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 1
Please check the settings in the CodeRabbit UI or the
|
|
Size Change: 0 B Total Size: 2.27 MB ℹ️ View Unchanged
|
b15bbfe to
0f6522a
Compare
|
Closing as superseded by #7965. Both logical changes are incorporated there with authorship preserved: Express selection/streaming (2e83469 → 15e3b1d) and nested-contract guidance (e6fe4c9 → 0f6522a). Verification against #7965 head f8b14a7 found no subsequent feature removal. The five transport follow-ups explicitly excluded from this PR remain open in scope: repeated chat surface IDs, retained incremental component/data state, embedded backticks in ordinary-code fences, omitted/null normalization, and delete/recreate consistency. This closure does not mark those issues resolved or imply #7965 has merged or completed its review and CI. No separate merge or conflict resolution is needed for this PR. |
…nd Gemini (#7965) ## What this is **A2UI Playground** (`examples/showcases/a2ui`) is a demo of native generative UI. It runs a TanStack Start app with a Google ADK agent on Gemini over AG-UI, CopilotKit Intelligence threads, and the standard catalog (`standardUI`) over the markdown transport. - **Answers with views.** The agent answers in prose and draws a view from the standard catalog when one helps. The prompt never names a component. - **Views stream in.** Each component arrives as soon as its JSON closes. `agent/src/research_desk/fences.py` repairs and streams fence lines. - **Decompile.** Every view has an **A2UI** button that pixelates the view into the A2UI that made it, and back again. - **Catalog.** A bento gallery of the standard catalog in its seven groups, at `?catalog`. Each specimen is real A2UI with its own A2UI button and info panel. - **Works signed out, sign in to keep it (Clerk).** By default nothing is kept. Signing in keeps a reader's threads in Intelligence (`identifyUser` returns the Clerk user) and unlocks Connections. The runtime route serves a signed-out runtime and a signed-in runtime. - **Actions in the reader's Google apps (Composio).** - Readers connect Gmail, Calendar, Drive, Docs and Sheets. - The agent loads a short list of tools for each connected app, per reader. The reader is named by the runtime in a header the agent trusts over run state. - Anything that sends, creates, changes or deletes pauses for an in-chat Confirm card. That uses ADK tool confirmation, which reaches the chat as an AG-UI interrupt handled by `useInterrupt`. - **Date and time.** The agent knows the reader's local date and time, from the browser's time zone. - **Look.** Solarized light and dark, following the system setting. - **Also included:** a report sheet, pictures (`find_images`), grounded research with favicons, a model picker, and the + menu. ### From Mark (folded in from his stacked PRs, with authorship kept) - **#7973:** a view picked from the + menu leaves its icon as a badge on the sent question. It's saved as AG-UI message metadata, so it survives reloads. - **#7976:** **A2UI Express** as a second authoring format next to JSON. It's compiled with Google's A2UI SDK, and the server streams validated JSON fences. Changing format starts a new thread. ## Library changes carried here | Change | Where | Also in | | --- | --- | --- | | Horizontal bar value labels beside the bars | `standard/Chart.tsx` | #7961 | | Table header for templated rows | `standard/data.tsx` | #7962 | | Select padding without an icon | `standard/inputs.tsx` | #7963 | | `errorBoundary.fallback` covers cyclic refs, unknown components and invalid props | `boundaries.tsx`, `SurfaceView.tsx` | n/a | | `pow(x, n)` in `calc`, and the prompt says what calc takes | `calc.ts`, `shared/.../prompt.ts` | n/a | | Markdown surfaces show again on a thread revisit (`forgetSurface`) | `markdown/source.ts`, `surface-manager.ts` | n/a | The custom chat input textarea fix landed separately in #7964, so it is no longer carried here. ## Run it See `examples/showcases/a2ui/README.md`. Keys go in a gitignored `.env`; `.env.example` lists them, all empty. Clerk and Composio are optional: without Composio, Connections is off. ## Checks - react-core and shared tests pass. - Agent tests pass (117). - The example type-checks. - Mark's badge tests pass (7, via `tsx --test`). - Lint and format are clean. - A live signed-out run works. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added an A2UI research desk showcase with web and image research, generated reports, selectable views and models, and JSON or Express display formats. * Browse a component catalog, inspect generated A2UI source, save notes, manage connected Google apps, and confirm sensitive actions. Stateful mode adds sign-in and thread history; stateless mode remains available by default. * Added deployment configuration for the showcase. * **Bug Fixes** * Improved horizontal chart labels and axis sizing, table headers for child-based rows, and select-control padding. * Corrected how removed surfaces are cleared so they can be recreated. * **Documentation** * Added setup instructions and product and design guides. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Stacked on #7965 (
tylerslaton/a2ui-playground). The requested-view badge feature is in #7973, independently based on #7965. Neither follow-up PR depends on the other.The playground now lets readers choose JSON or A2UI Express while using the same A2UI v1.0 renderer, bindings, actions and persisted threads. JSON remains the default. Changing formats starts a fresh thread; the choice persists in the browser and cannot change during a run.
Express integration
Nested-schema guidance fix
SDK-generated signatures omitted nested object/array contracts behind dynamic-value unions. A Map request consequently generated an unsupported marker field and failed compilation. Append the received literal schemas generically, preserving required fields, enums and closed-object restrictions. Validation and component schemas are unchanged. This fix is tracked as its own logical change with a regression covering custom component names and nullable properties.
For the captured standard catalog, the full Express guide increases from 63,258 to 83,647 characters. The compact-shape prototype and broader behavior tuning are excluded. The README explains the tradeoff and why the guidance is necessary.
Validation
Fresh scoped Nx formatting, lint, explicit typecheck, 106 agent tests, client/SSR example build, and frozen JavaScript/Python lock checks passed. All 20 committed file hashes match the checked tree. Ordinary commit hooks passed, including affected-package tests/publint/attw after selecting the existing local .NET, Ruby and Python toolchains. Existing live coverage includes Express calculator bindings, saveNote, form events, report routing and a three-marker keyless Map, plus a JSON calculator. These are targeted checks, not protocol-wide conformance claims.
No badge implementation, telemetry-test changes, local staging configuration or private benchmark artifacts are included.
Separate follow-ups
Further transport hardening is tracked separately: repeated chat surface IDs can affect earlier replies; incremental component/data updates can lose retained state; embedded backticks can disrupt ordinary-code fencing; valid omitted/null request fields need normalization; and delete/recreate sequences need consistent renderer handling. These review findings remain open and are excluded from this integration-and-guidance change.