Skip to content

feat(react-core): bring generative UI to the A2UI 1.0 basic catalog: names, child references, dynamic values, checks, calc - #7879

Merged
mme merged 7 commits into
feat/generative-ui-prototypefrom
mme/genui-a2ui-1-0
Oct 20, 2026
Merged

mme merged 7 commits into
feat/generative-ui-prototypefrom
mme/genui-a2ui-1-0

Conversation

@mme

@mme mme commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Brings standardUI and the generative UI engine to the A2UI 1.0 basic catalog, in seven commits, one per area: shared protocol pieces, the core prose lift, the react-core engine, the standard catalog, the runtime prompt, the demo, the docs. Additive to the engine: createGenerativeUI, slots, events and the surface model keep working as they are.

1. Catalog aligned with the 1.0 basic catalog

The 18 basic components carry their A2UI names and props, no aliases, and the five we lacked are added (Video, AudioPlayer, Tabs, Modal, ChoicePicker). 73 components.

Component Change
Row, Column, Box… justify: spaceBetween / spaceAround / spaceEvenly (+ stretch)
all basic components weight = flex-grow in a Row/Column; font weight is fontWeight, Icon stroke strokeWeight
Image url, description; fit with the five object-fit values; variant (icon … header). Same for CarouselMediaItem and ImageGrid items
Icon the A2UI icon names (arrowBack, shoppingCart, …) map to Lucide; { svgPath }
Button variants default / primary / borderless (+ soft); child slot
TextField variant (shortText, longText, number, obscured, email, url, tel)
CheckBox value is the boolean state
Slider / DateTimeInput / Divider / Card / List steps; enableDate / enableTime with ISO values; axis; child slot; direction + align

2. Typed child references

child() and childList() mark a prop as a component reference anywhere in the props schema, like A2UI's ComponentId / ChildList types. The JSON Schema carries the A2UI $ref, the compact schema shows componentId, and the engine renders every referenced id at any depth (lists and templates included) and hands the component the nodes. slots stays as top-level sugar. Tabs takes tabs: [{ title, child }] exactly as in 1.0.

3. Dynamic values, the whole 1.0 model

  • {"@path"} and {"@call"} resolve at any depth of props, event context, userMessage and function args.
  • All 14 basic functions are built in, plus @index: required, regex, length, numeric, email, formatString (${/path}, ${relative}, ${fn(arg: value)}, \${ escape), formatNumber, formatCurrency, formatDate (TR35), pluralize, and, or, not, openUrl.
  • Reactive per prop: a node subscribes to the paths it read and re-resolves only the prop whose inputs changed; literals keep their identity.
  • ValidationResult coerces to a boolean except under a check condition.
  • openUrl runs only from an event binding; the agent's callRendererFunction gets invalid_function_call for it. Other basic functions are callable by the agent.
  • A bad call is a node fallback plus reportError, never a crash. The validator and the guideline know the rules, including that 1.0 has no operators in ${...} (no arithmetic, no conditions): a derived number is the model's job.
  • Guideline nudge from the live runs: keep dataModel flat. With one wrapper object around everything the model dropped a closing brace twice in a row, which made the whole surface invisible.

4. checks

Every input and Button take the Checkable rules. An input shows the first failed message once touched (or when it has a value) and sets aria-invalid; a Button with checks is disabled while one fails.

5. calc and series: arithmetic and computed lists

1.0 has no operators at all, so a price that follows a slider has no spelling in the basic catalog. A catalog may declare its own functions, so standardUI adds two, listed to the model like formatCurrency:

  • calc: one expression over named args ("expression": "seats * 29 * (annual ? 0.8 : 1)", with "seats": {"@path": "/seats"}). Closed language: arithmetic, comparisons, && || !, ?:, min/max/round/floor/ceil/abs, text +. No property access, no code.
  • series: a list of count items from an item template with ${...} expressions over a loop variable, for chart data and template lists.

Both are reactive through the resolver. In the demo the model now writes calc for the monthly price and a series (with a nested calc) for the 12-month chart; moving the slider or toggling annual billing updates both with no round trip.

6. Fix: a generated event is sent only when the agent is idle

A model-generated Button with an event binding sent its event on every click; a double click or a click during a streaming reply started a second run that interrupted the first. forwardEvent now drops an event while the agent runs or another event is on its way (agent_busy result to the component, nothing reported). Chat input and the chat's own suggestion pills are untouched.

Deviations from 1.0

calc and series are CopilotKit catalog functions, not basic-catalog ones; a renderer without them rejects the call cleanly.

Button keeps onClick (1.0: action); defaults differ where ours look better in chat (Image.fit → cover).

Context cost

Compact schema + run guideline: 13.2K tokens (o200k), up from 11.0K on the base: four new components, weight on 18 components, the Icon names and the 14 function signatures.

Demo suggestions

Three pills in examples/v2/a2ui-markdown exercise the new features end to end: Table booking (a formatString sentence with pluralize and formatDate that updates live from a name field, a date picker and a slider), Sign-up with validation (per-field checks, Create account disabled until valid), and the sharpened Team plan estimator (calc price and series chart following the slider and the annual checkbox, plus a Request quote button gated by checks). All three were run against the built-in agent and rendered as intended.

Review

Nine rounds of codex review (gpt-6-astra, xhigh) against the base, each round's findings fixed and folded into the feature commit they belong to. Highlights: failed function values keep their subscriptions and recover; the prose lift follows typed child references, declared slots and a Card's child, and leaves bound references and horizontal lists alone; the resolution cache is scoped by template item and cleared on data notifications; calc short-circuits ?:, &&, ||; formatDate tokenizes TR35 fields; built-ins are in the forwarded catalog and never shadow a declared app function; openUrl is never a value and needs the browser's user activation; the Modal is portaled with its theme, keyboard-operable, respects disabled triggers and shares one Escape stack with the Lightbox; the tool-transport prompt matches the markdown guideline. Declined as disproportionate: detecting an in-place data-model mutation made by a layout effect in the window before a node subscribes.

Verification

Each commit was type-checked and tested on its own. At the head: shared 98/98, react-core generative-ui 526/526 (new suites: resolve, functions, calc, child-refs, dynamic-values, checks), react-ui 79/79; tsc clean for shared, react-core and the example. /catalog in examples/v2/a2ui-markdown renders every sample; Tabs from typed ids, the reactive formatString sample and the checks sample were exercised in the browser.

Replaces #7873 and #7878.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 1
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: CopilotKit/CopilotKit/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2e8d8333-a21a-4660-b79a-28aeae0b2449

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Production Digest-Pinning Audit

All 43 services digest-pinned.

Run 2026-10-20 03:43:02 PDT — 0 finding(s).

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
@copilotkit/a2ui-renderer

pnpm add https://pkg.pr.new/@copilotkit/a2ui-renderer@7879

@copilotkit/agentcore-runner

pnpm add https://pkg.pr.new/@copilotkit/agentcore-runner@7879

@copilotkit/angular

pnpm add https://pkg.pr.new/@copilotkit/angular@7879

@copilotkit/channels

pnpm add https://pkg.pr.new/@copilotkit/channels@7879

@copilotkit/channels-core

pnpm add https://pkg.pr.new/@copilotkit/channels-core@7879

@copilotkit/channels-discord

pnpm add https://pkg.pr.new/@copilotkit/channels-discord@7879

@copilotkit/channels-intelligence

pnpm add https://pkg.pr.new/@copilotkit/channels-intelligence@7879

@copilotkit/channels-slack

pnpm add https://pkg.pr.new/@copilotkit/channels-slack@7879

@copilotkit/channels-teams

pnpm add https://pkg.pr.new/@copilotkit/channels-teams@7879

@copilotkit/channels-telegram

pnpm add https://pkg.pr.new/@copilotkit/channels-telegram@7879

@copilotkit/channels-ui

pnpm add https://pkg.pr.new/@copilotkit/channels-ui@7879

@copilotkit/channels-whatsapp

pnpm add https://pkg.pr.new/@copilotkit/channels-whatsapp@7879

@copilotkit/core

pnpm add https://pkg.pr.new/@copilotkit/core@7879

@copilotkit/intelligence-langgraph

pnpm add https://pkg.pr.new/@copilotkit/intelligence-langgraph@7879

@copilotkit/intelligence-mastra

pnpm add https://pkg.pr.new/@copilotkit/intelligence-mastra@7879

@copilotkit/learning

pnpm add https://pkg.pr.new/@copilotkit/learning@7879

@copilotkit/mcp-apps-renderer

pnpm add https://pkg.pr.new/@copilotkit/mcp-apps-renderer@7879

@copilotkit/react-core

pnpm add https://pkg.pr.new/@copilotkit/react-core@7879

@copilotkit/react-native

pnpm add https://pkg.pr.new/@copilotkit/react-native@7879

@copilotkit/react-textarea

pnpm add https://pkg.pr.new/@copilotkit/react-textarea@7879

@copilotkit/react-ui

pnpm add https://pkg.pr.new/@copilotkit/react-ui@7879

@copilotkit/runtime

pnpm add https://pkg.pr.new/@copilotkit/runtime@7879

@copilotkit/runtime-client-gql

pnpm add https://pkg.pr.new/@copilotkit/runtime-client-gql@7879

@copilotkit/sdk-js

pnpm add https://pkg.pr.new/@copilotkit/sdk-js@7879

@copilotkit/shared

pnpm add https://pkg.pr.new/@copilotkit/shared@7879

@copilotkit/sqlite-runner

pnpm add https://pkg.pr.new/@copilotkit/sqlite-runner@7879

@copilotkit/voice

pnpm add https://pkg.pr.new/@copilotkit/voice@7879

@copilotkit/vue

pnpm add https://pkg.pr.new/@copilotkit/vue@7879

@copilotkit/web-components

pnpm add https://pkg.pr.new/@copilotkit/web-components@7879

@copilotkit/web-inspector

pnpm add https://pkg.pr.new/@copilotkit/web-inspector@7879

commit: be78046

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: +48.9 kB (+2.31%)

Total Size: 2.17 MB

📦 View Changed
Filename Size Change
packages/react-core/dist/copilotkit-DiGMoERE.cjs 133 kB +133 kB (new file) 🆕
packages/react-core/dist/copilotkit-DViMG5wO.mjs 0 B -136 kB (removed) 🏆
packages/react-core/dist/copilotkit-nH2sHty1.mjs 136 kB +136 kB (new file) 🆕
packages/react-core/dist/copilotkit-yQjRmaol.cjs 0 B -132 kB (removed) 🏆
packages/react-core/dist/index.cjs 17.7 kB +2 B (+0.01%)
packages/react-core/dist/index.umd.js 103 kB +5.41 kB (+5.52%) 🔍
packages/react-core/dist/MarkdownSurfaces-71akOcOq.cjs 30.3 kB +30.3 kB (new file) 🆕
packages/react-core/dist/MarkdownSurfaces-BaBvbEqW.mjs 29.8 kB +29.8 kB (new file) 🆕
packages/react-core/dist/MarkdownSurfaces-C3WoGGEn.mjs 0 B -24.7 kB (removed) 🏆
packages/react-core/dist/MarkdownSurfaces-Cs-cktTt.cjs 0 B -25.3 kB (removed) 🏆
packages/react-core/dist/v2/generative-ui.cjs 61.1 kB +7.4 kB (+13.78%) ⚠️
packages/react-core/dist/v2/generative-ui.mjs 60.5 kB +7.38 kB (+13.91%) ⚠️
packages/react-core/dist/v2/index.mjs 4.29 kB +3 B (+0.07%)
packages/react-core/dist/v2/index.umd.js 161 kB +5.47 kB (+3.51%)
packages/shared/dist/a2ui-prompts.cjs 6.65 kB +531 B (+8.68%) 🔍
packages/shared/dist/a2ui-prompts.mjs 6.6 kB +524 B (+8.62%) 🔍
packages/shared/dist/generative-ui/basic-functions.cjs 1.3 kB +1.3 kB (new file) 🆕
packages/shared/dist/generative-ui/basic-functions.mjs 1.28 kB +1.28 kB (new file) 🆕
packages/shared/dist/generative-ui/child-refs.cjs 1.65 kB +1.65 kB (new file) 🆕
packages/shared/dist/generative-ui/child-refs.mjs 1.61 kB +1.61 kB (new file) 🆕
packages/shared/dist/generative-ui/validate-operation.cjs 4.78 kB +832 B (+21.08%) 🚨
packages/shared/dist/generative-ui/validate-operation.mjs 4.74 kB +820 B (+20.93%) 🚨
packages/shared/dist/index.cjs 3.66 kB +205 B (+5.94%) 🔍
packages/shared/dist/index.mjs 3.07 kB +147 B (+5.04%) 🔍
packages/shared/dist/index.umd.js 45.5 kB +3.46 kB (+8.23%) 🔍
ℹ️ View Unchanged
Filename Size
packages/a2ui-renderer/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/a2ui-renderer/dist/a2ui-types.cjs 472 B
packages/a2ui-renderer/dist/a2ui-types.mjs 469 B
packages/a2ui-renderer/dist/index.cjs 959 B
packages/a2ui-renderer/dist/index.mjs 637 B
packages/a2ui-renderer/dist/index.umd.js 13.4 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/A2uiSurface.cjs 1.52 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/A2uiSurface.mjs 1.46 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/adapter.cjs 1.57 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/adapter.mjs 1.5 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/AudioPlayer.cjs 904 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/AudioPlayer.mjs 492 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Button.cjs 1.01 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Button.mjs 603 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Card.cjs 829 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Card.mjs 419 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/CheckBox.cjs 1.1 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/CheckBox.mjs 1.02 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChildList.cjs 799 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChildList.mjs 737 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChoicePicker.cjs 1.64 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChoicePicker.mjs 1.57 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Column.cjs 856 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Column.mjs 802 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/DateTimeInput.cjs 1.12 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/DateTimeInput.mjs 1.05 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Divider.cjs 842 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Divider.mjs 432 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Icon.cjs 877 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Icon.mjs 469 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Image.cjs 995 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Image.mjs 587 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/List.cjs 920 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/List.mjs 508 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Modal.cjs 1.2 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Modal.mjs 1.14 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Row.cjs 855 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Row.mjs 801 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Slider.cjs 1.06 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Slider.mjs 984 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Tabs.cjs 1.1 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Tabs.mjs 1.04 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Text.cjs 903 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Text.mjs 489 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/TextField.cjs 1.21 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/TextField.mjs 1.14 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Video.cjs 788 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Video.mjs 378 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/index.cjs 928 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/index.mjs 855 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/utils.cjs 579 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/utils.mjs 556 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Button.cjs 989 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Button.mjs 584 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/ChildList.cjs 800 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/ChildList.mjs 735 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Column.cjs 1.08 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Column.mjs 1.02 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Row.cjs 1.07 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Row.mjs 1.01 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Text.cjs 894 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Text.mjs 839 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/TextField.cjs 1.21 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/TextField.mjs 802 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/index.cjs 849 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/index.mjs 804 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/index.cjs 310 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/index.mjs 325 B
packages/a2ui-renderer/dist/react-renderer/catalog-utils.cjs 1.59 kB
packages/a2ui-renderer/dist/react-renderer/catalog-utils.mjs 1.52 kB
packages/a2ui-renderer/dist/react-renderer/core/A2UIProvider.cjs 1.5 kB
packages/a2ui-renderer/dist/react-renderer/core/A2UIProvider.mjs 1.42 kB
packages/a2ui-renderer/dist/react-renderer/core/A2UIRenderer.cjs 728 B
packages/a2ui-renderer/dist/react-renderer/core/A2UIRenderer.mjs 671 B
packages/a2ui-renderer/dist/react-renderer/create-catalog.cjs 1.35 kB
packages/a2ui-renderer/dist/react-renderer/create-catalog.mjs 1.28 kB
packages/a2ui-renderer/dist/react-renderer/filter-catalog.cjs 622 B
packages/a2ui-renderer/dist/react-renderer/filter-catalog.mjs 569 B
packages/a2ui-renderer/dist/react-renderer/hooks/useA2UI.cjs 316 B
packages/a2ui-renderer/dist/react-renderer/hooks/useA2UI.mjs 309 B
packages/a2ui-renderer/dist/react-renderer/index.cjs 409 B
packages/a2ui-renderer/dist/react-renderer/index.mjs 568 B
packages/a2ui-renderer/dist/react-renderer/lib/utils.cjs 236 B
packages/a2ui-renderer/dist/react-renderer/lib/utils.mjs 188 B
packages/a2ui-renderer/dist/react-renderer/styles/index.cjs 239 B
packages/a2ui-renderer/dist/react-renderer/styles/index.mjs 231 B
packages/a2ui-renderer/dist/react-renderer/theme/ThemeContext.cjs 436 B
packages/a2ui-renderer/dist/react-renderer/theme/ThemeContext.mjs 381 B
packages/core/dist/index.cjs 98.4 kB
packages/core/dist/index.mjs 97.8 kB
packages/core/dist/index.umd.js 104 kB
packages/mcp-apps-renderer/dist/activity.cjs 259 B
packages/mcp-apps-renderer/dist/activity.mjs 170 B
packages/mcp-apps-renderer/dist/activity.umd.js 2.24 kB
packages/mcp-apps-renderer/dist/constants.cjs 714 B
packages/mcp-apps-renderer/dist/constants.mjs 712 B
packages/mcp-apps-renderer/dist/content-schema.cjs 768 B
packages/mcp-apps-renderer/dist/content-schema.mjs 765 B
packages/mcp-apps-renderer/dist/follow-up.cjs 796 B
packages/mcp-apps-renderer/dist/follow-up.mjs 794 B
packages/mcp-apps-renderer/dist/index.mjs 354 B
packages/mcp-apps-renderer/dist/request-queue.mjs 2.39 kB
packages/mcp-apps-renderer/dist/sandbox.mjs 1.14 kB
packages/mcp-apps-renderer/dist/session.mjs 6.86 kB
packages/react-core/dist/index.mjs 17.6 kB
packages/react-core/dist/v2/context.cjs 1.58 kB
packages/react-core/dist/v2/context.mjs 1.5 kB
packages/react-core/dist/v2/headless.cjs 16.3 kB
packages/react-core/dist/v2/headless.mjs 15.7 kB
packages/react-core/dist/v2/index.cjs 4.3 kB
packages/react-native/dist/chunk-C0xms8kb.cjs 546 B
packages/react-native/dist/components/index.cjs 8.65 kB
packages/react-native/dist/components/index.mjs 8.45 kB
packages/react-native/dist/CopilotKitProvider-CjoPnabW.cjs 1.55 kB
packages/react-native/dist/CopilotKitProvider-D8sn7G_C.mjs 1.43 kB
packages/react-native/dist/headless.cjs 632 B
packages/react-native/dist/headless.mjs 373 B
packages/react-native/dist/index.cjs 6.52 kB
packages/react-native/dist/index.mjs 6.14 kB
packages/react-native/dist/polyfills.cjs 195 B
packages/react-native/dist/polyfills.mjs 195 B
packages/react-native/dist/polyfills/crypto.cjs 373 B
packages/react-native/dist/polyfills/crypto.mjs 381 B
packages/react-native/dist/polyfills/dom.cjs 540 B
packages/react-native/dist/polyfills/dom.mjs 550 B
packages/react-native/dist/polyfills/encoding.cjs 332 B
packages/react-native/dist/polyfills/encoding.mjs 307 B
packages/react-native/dist/polyfills/location.cjs 236 B
packages/react-native/dist/polyfills/location.mjs 244 B
packages/react-native/dist/polyfills/streams.cjs 371 B
packages/react-native/dist/polyfills/streams.mjs 339 B
packages/react-native/dist/streaming-fetch-BnQh3vBz.mjs 2.22 kB
packages/react-native/dist/streaming-fetch-BTESzLKX.cjs 2.27 kB
packages/react-textarea/dist/index.cjs 17.6 kB
packages/react-textarea/dist/index.mjs 16.9 kB
packages/react-textarea/dist/index.umd.js 18.4 kB
packages/react-ui/dist/index.cjs 25.3 kB
packages/react-ui/dist/index.mjs 24.6 kB
packages/react-ui/dist/index.umd.js 26.6 kB
packages/runtime-client-gql/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/runtime-client-gql/dist/client/conversion.cjs 1.52 kB
packages/runtime-client-gql/dist/client/conversion.mjs 1.45 kB
packages/runtime-client-gql/dist/client/CopilotRuntimeClient.cjs 1.58 kB
packages/runtime-client-gql/dist/client/CopilotRuntimeClient.mjs 1.54 kB
packages/runtime-client-gql/dist/client/types.cjs 701 B
packages/runtime-client-gql/dist/client/types.mjs 642 B
packages/runtime-client-gql/dist/graphql/@generated/gql.cjs 850 B
packages/runtime-client-gql/dist/graphql/@generated/gql.mjs 850 B
packages/runtime-client-gql/dist/graphql/@generated/graphql.cjs 2.4 kB
packages/runtime-client-gql/dist/graphql/@generated/graphql.mjs 2.36 kB
packages/runtime-client-gql/dist/graphql/definitions/mutations.cjs 740 B
packages/runtime-client-gql/dist/graphql/definitions/mutations.mjs 732 B
packages/runtime-client-gql/dist/graphql/definitions/queries.cjs 316 B
packages/runtime-client-gql/dist/graphql/definitions/queries.mjs 304 B
packages/runtime-client-gql/dist/index.cjs 679 B
packages/runtime-client-gql/dist/index.mjs 495 B
packages/runtime-client-gql/dist/index.umd.js 9.58 kB
packages/runtime-client-gql/dist/message-conversion/agui-to-gql.cjs 1.72 kB
packages/runtime-client-gql/dist/message-conversion/agui-to-gql.mjs 1.7 kB
packages/runtime-client-gql/dist/message-conversion/gql-to-agui.cjs 1.56 kB
packages/runtime-client-gql/dist/message-conversion/gql-to-agui.mjs 1.53 kB
packages/runtime-client-gql/dist/package.cjs 181 B
packages/runtime-client-gql/dist/package.mjs 116 B
packages/shared/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/shared/dist/a2ui-envelope.cjs 2.2 kB
packages/shared/dist/a2ui-envelope.mjs 2.19 kB
packages/shared/dist/attachments/content.cjs 255 B
packages/shared/dist/attachments/content.mjs 253 B
packages/shared/dist/attachments/utils.cjs 1.83 kB
packages/shared/dist/attachments/utils.mjs 1.79 kB
packages/shared/dist/constants/index.cjs 362 B
packages/shared/dist/constants/index.mjs 345 B
packages/shared/dist/debug.cjs 454 B
packages/shared/dist/debug.mjs 452 B
packages/shared/dist/event-transforms/index.cjs 335 B
packages/shared/dist/event-transforms/index.mjs 165 B
packages/shared/dist/event-transforms/open-generative-ui-middleware.cjs 2.42 kB
packages/shared/dist/event-transforms/open-generative-ui-middleware.mjs 2.35 kB
packages/shared/dist/event-transforms/recorded-events.cjs 988 B
packages/shared/dist/event-transforms/recorded-events.mjs 925 B
packages/shared/dist/finalize-events.cjs 1.94 kB
packages/shared/dist/finalize-events.mjs 1.88 kB
packages/shared/dist/generative-ui/render-ui-args.cjs 1.2 kB
packages/shared/dist/generative-ui/render-ui-args.mjs 1.2 kB
packages/shared/dist/generative-ui/types.cjs 769 B
packages/shared/dist/generative-ui/types.mjs 729 B
packages/shared/dist/intelligence-routing-fields.cjs 778 B
packages/shared/dist/intelligence-routing-fields.mjs 775 B
packages/shared/dist/logger.cjs 112 B
packages/shared/dist/logger.mjs 112 B
packages/shared/dist/open-generative-ui-prompts.cjs 1.59 kB
packages/shared/dist/open-generative-ui-prompts.mjs 1.59 kB
packages/shared/dist/package.cjs 181 B
packages/shared/dist/package.mjs 116 B
packages/shared/dist/standard-schema.cjs 740 B
packages/shared/dist/standard-schema.mjs 737 B
packages/shared/dist/telemetry/index.cjs 358 B
packages/shared/dist/telemetry/index.mjs 250 B
packages/shared/dist/telemetry/lambda-client.cjs 1.59 kB
packages/shared/dist/telemetry/lambda-client.mjs 1.58 kB
packages/shared/dist/telemetry/model-host.cjs 1.63 kB
packages/shared/dist/telemetry/model-host.mjs 1.63 kB
packages/shared/dist/telemetry/sampling.cjs 956 B
packages/shared/dist/telemetry/sampling.mjs 935 B
packages/shared/dist/telemetry/telemetry-client.cjs 1.88 kB
packages/shared/dist/telemetry/telemetry-client.mjs 1.83 kB
packages/shared/dist/telemetry/telemetry-disabled.cjs 454 B
packages/shared/dist/telemetry/telemetry-disabled.mjs 451 B
packages/shared/dist/telemetry/utils.cjs 321 B
packages/shared/dist/telemetry/utils.mjs 277 B
packages/shared/dist/transcription-errors.cjs 951 B
packages/shared/dist/transcription-errors.mjs 944 B
packages/shared/dist/utils/clipboard.cjs 407 B
packages/shared/dist/utils/clipboard.mjs 405 B
packages/shared/dist/utils/conditions.cjs 540 B
packages/shared/dist/utils/conditions.mjs 536 B
packages/shared/dist/utils/console-styling.cjs 1.23 kB
packages/shared/dist/utils/console-styling.mjs 1.21 kB
packages/shared/dist/utils/errors.cjs 4.51 kB
packages/shared/dist/utils/errors.mjs 4.41 kB
packages/shared/dist/utils/index.cjs 1.45 kB
packages/shared/dist/utils/index.mjs 1.77 kB
packages/shared/dist/utils/inspector-learning.cjs 2.38 kB
packages/shared/dist/utils/inspector-learning.mjs 2.38 kB
packages/shared/dist/utils/inspector-metadata.cjs 1.46 kB
packages/shared/dist/utils/inspector-metadata.mjs 1.45 kB
packages/shared/dist/utils/inspector-visibility.cjs 285 B
packages/shared/dist/utils/inspector-visibility.mjs 282 B
packages/shared/dist/utils/json-schema.cjs 1.97 kB
packages/shared/dist/utils/json-schema.mjs 1.91 kB
packages/shared/dist/utils/random-id.cjs 618 B
packages/shared/dist/utils/random-id.mjs 559 B
packages/shared/dist/utils/requests.cjs 706 B
packages/shared/dist/utils/requests.mjs 704 B
packages/shared/dist/utils/row-render-keys.cjs 3.38 kB
packages/shared/dist/utils/row-render-keys.mjs 3.36 kB
packages/shared/dist/utils/types.cjs 161 B
packages/shared/dist/utils/types.mjs 160 B
packages/voice/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/voice/dist/index.cjs 175 B
packages/voice/dist/index.mjs 95 B
packages/voice/dist/index.umd.js 1.5 kB
packages/voice/dist/transcription/transcription-service-openai.cjs 495 B
packages/voice/dist/transcription/transcription-service-openai.mjs 434 B
packages/web-inspector/dist/assets/inspector-logo-kite.cjs 2.36 kB
packages/web-inspector/dist/assets/inspector-logo-kite.mjs 2.3 kB
packages/web-inspector/dist/assets/inspector-logo.cjs 4.32 kB
packages/web-inspector/dist/assets/inspector-logo.mjs 4.23 kB
packages/web-inspector/dist/components/learning-view.cjs 9.47 kB
packages/web-inspector/dist/components/learning-view.mjs 9.47 kB
packages/web-inspector/dist/index.cjs 132 kB
packages/web-inspector/dist/index.mjs 132 kB
packages/web-inspector/dist/index.umd.js 198 kB
packages/web-inspector/dist/lib/context-helpers.cjs 866 B
packages/web-inspector/dist/lib/context-helpers.mjs 835 B
packages/web-inspector/dist/lib/home-briefing.cjs 2.8 kB
packages/web-inspector/dist/lib/home-briefing.mjs 2.79 kB
packages/web-inspector/dist/lib/hud-config.cjs 1.34 kB
packages/web-inspector/dist/lib/hud-config.mjs 1.33 kB
packages/web-inspector/dist/lib/hud-defaults.cjs 287 B
packages/web-inspector/dist/lib/hud-defaults.mjs 285 B
packages/web-inspector/dist/lib/hud-loader.cjs 557 B
packages/web-inspector/dist/lib/hud-loader.mjs 546 B
packages/web-inspector/dist/lib/inspector-learning.cjs 754 B
packages/web-inspector/dist/lib/inspector-learning.mjs 732 B
packages/web-inspector/dist/lib/inspector-metadata.cjs 760 B
packages/web-inspector/dist/lib/inspector-metadata.mjs 750 B
packages/web-inspector/dist/lib/inspector-nav.cjs 674 B
packages/web-inspector/dist/lib/inspector-nav.mjs 652 B
packages/web-inspector/dist/lib/learning-setup.cjs 1.12 kB
packages/web-inspector/dist/lib/learning-setup.mjs 1.09 kB
packages/web-inspector/dist/lib/notification-loader.cjs 792 B
packages/web-inspector/dist/lib/notification-loader.mjs 786 B
packages/web-inspector/dist/lib/notifications.cjs 2.39 kB
packages/web-inspector/dist/lib/notifications.mjs 2.37 kB
packages/web-inspector/dist/lib/onboarding-prompt.cjs 2.38 kB
packages/web-inspector/dist/lib/onboarding-prompt.mjs 2.37 kB
packages/web-inspector/dist/lib/persistence.cjs 3.61 kB
packages/web-inspector/dist/lib/persistence.mjs 3.52 kB
packages/web-inspector/dist/lib/pop-out.cjs 1.07 kB
packages/web-inspector/dist/lib/pop-out.mjs 1.05 kB
packages/web-inspector/dist/lib/telemetry.cjs 5.59 kB
packages/web-inspector/dist/lib/telemetry.mjs 5.38 kB
packages/web-inspector/dist/lib/thread-selection.cjs 566 B
packages/web-inspector/dist/lib/thread-selection.mjs 563 B
packages/web-inspector/dist/package.cjs 181 B
packages/web-inspector/dist/package.mjs 116 B
packages/web-inspector/dist/styles/generated.cjs 20.1 kB
packages/web-inspector/dist/styles/generated.mjs 20 kB
packages/web-inspector/dist/styles/notification-article.cjs 1.44 kB
packages/web-inspector/dist/styles/notification-article.mjs 1.44 kB

compressed-size-action

@mme
mme force-pushed the mme/genui-a2ui-1-0 branch from 7bbe270 to 445c6a1 Compare October 19, 2026 14:49
@mme mme changed the title feat(react-core): bring generative UI to the A2UI 1.0 basic catalog: names, child references, dynamic values, checks feat(react-core): bring generative UI to the A2UI 1.0 basic catalog: names, child references, dynamic values, checks, calc Oct 19, 2026
@mme
mme force-pushed the mme/genui-a2ui-1-0 branch 11 times, most recently from 4df0c46 to 0756742 Compare October 20, 2026 10:24
mme added 7 commits October 20, 2026 12:39
The protocol-level definitions that the renderer, the runtime and the
validator share:

- `A2UI_BASIC_FUNCTIONS`: the 14 functions of the A2UI 1.0 basic catalog
  (required, regex, length, numeric, email, formatString, formatNumber,
  formatCurrency, formatDate, pluralize, openUrl, and, or, not) with
  their short signatures and return types, `openUrl` marked as needing
  a user gesture; `COPILOTKIT_FUNCTIONS`: `calc` and `series`, the two
  catalog functions CopilotKit adds because 1.0 has no arithmetic.
- `child-refs`: the `ComponentId` / `ChildList` `$ref` markers of A2UI,
  `collectChildRefs` to find every component reference in a props schema
  at any depth (a union counts only when all of its branches agree),
  `childIdsAtRefs`, `hasBoundChildRef` and `mapAtChildRef`.
- The operation validator accepts function values in data props, event
  contexts and userMessages (`@index` included), refuses app functions
  and `openUrl` there, lets an event binding call any built-in, leaves
  the gesture restriction of a built-in to the dispatcher when the app
  functions are not known, and checks the ids at typed child references,
  also inside lists, skipping bound ones.
- `GenerativeUIActionBinding.userMessage` takes a function value.
- The markdown guideline explains function values, the `formatString`
  grammar (no operators), `calc` and `series`, `checks`, typed child
  references and a flat `dataModel`; the `checks` rule group is on when
  a component has a `checks` prop, and the `functions` group counts app
  functions only.
… prose lift

The prose lift of a chat surface walks the component tree to split it
around titles and paragraphs. It followed `child`, `children` and table
cells only, so a Tabs panel referenced through `tabs[].child`, or the
trigger and content of a Modal, were cut off when prose was lifted.

- `segmentSurfaceProse`, `classifySurfaceCards` and
  `flattenInformationalCards` take a `childIds` reader that the catalog
  supplies for typed references and declared slots; a component whose
  references are bound ("unknown") keeps its surface whole.
- A stack's `child` is folded in before its `children`, and not copied
  onto a sub-surface root a second time.
- A List with a direction other than a literal "vertical" is a layout,
  not a text list; `ChoicePicker` counts as an interactive control.
… built-in functions in the generative UI engine

Typed child references: `child()` and `childList()` mark a prop as a
component reference anywhere in the props schema, like the
`ComponentId` and `ChildList` types of A2UI 1.0. The JSON Schema carries
the A2UI `$ref`, the compact schema shows `componentId`, and the renderer
puts the rendered component in place of each id, in lists and templates
too. `slots` stays for the top-level case. The markdown source gives the
prose lift a reader for these references and for declared slots.

Dynamic values: a prop, an event context, a userMessage or a function
argument can hold `{"@path"}` bindings and `{"@call"}` function values
at any depth. `resolve.ts` walks the value, reads the data model, runs
the functions, interpolates `formatString` with its `${...}` grammar and
reports the paths it read. A node subscribes to those paths and resolves
a prop again only when its raw value, its template item or a value it
read has changed; a data notification clears the cache, because web_core
changes lists in place. A failed function value keeps its subscriptions,
so the node recovers once the data arrives. A validator result becomes a
boolean everywhere but as the condition of a check.

Functions: `functions.ts` implements the 14 basic functions (TR35 date
fields, Intl formatting, the validators), `calc.ts` adds `calc` (a
closed arithmetic expression language over named args, with
short-circuit `?:`, `&&`, `||`) and `series` (a computed list). The
dispatcher runs a built-in for an undeclared name, refuses `openUrl` for
the agent and without the browser's user activation; a gesture-only
function is never a value. The manifest lists the built-ins (never under
a name the app declares), and the compact schema reads them from there.

Event forwarding: an event is dropped while the agent runs or another
event is on its way (`agent_busy`), so a double click or a click during
a streaming reply does not start a second run.
…catalog

The 18 components of the basic catalog carry their A2UI names and props
in standardUI, instead of our own spellings, and the five we did not
have are added. 73 components.

- Row/Column/Box justify: "spaceBetween" | "spaceAround" | "spaceEvenly"
  (+ "stretch"). Every basic component takes `weight` (flex-grow); the
  font weight prop is `fontWeight`, the Icon stroke `strokeWeight`.
- Image: `url`, `description`, the five `fit` values, `variant`. The
  same `url` / `description` for CarouselMediaItem and ImageGrid items.
  Icon: the A2UI icon names map to Lucide; `{ svgPath }`.
- Button: variants "default" | "primary" | "borderless" (+ "soft"),
  `child` slot. TextField: `variant` replaces inputType; longText is a
  textarea. CheckBox: boolean `value`. Slider: `steps`. DateTimeInput:
  `enableDate` / `enableTime`, ISO values. Divider: `axis`. Card:
  `child` slot. List: `direction`, `align`.
- New: Video (a file, or a YouTube link with the poster-first privacy
  embed; replaces YouTube), AudioPlayer, Tabs (`tabs: [{ title, child }]`
  through typed child references), Modal (portaled with the surface
  theme, keyboard-operable, respects disabled triggers, one Escape stack
  shared with the Lightbox), ChoicePicker (required takes part in form
  validation).
- Every input and the Button take `checks`, the `Checkable` rules of
  A2UI 1.0: an input shows the first failed message once touched and
  sets aria-invalid; a Button with checks is disabled while one fails.
…lc, series and checks

The default tool transport builds its own guide from the manifest. It
still told the model never to put `{"@call"}` in a data prop, while the
manifest now advertises the built-in functions. It now explains function
values, the `formatString` grammar, `calc` and `series`, and `checks`,
and prints the signature of each built-in.
…i-markdown demo

The catalog page shows every component under its 1.0 name, Tabs from
typed child ids, a Slider that drives a `calc` price and a `series`
chart, and a form whose Send button enables once its checks pass. The
suggestion pills gain Table booking (live `formatString`), Sign-up with
validation (`checks`), and a Team plan estimator whose price and chart
follow the slider and the annual checkbox with no round trip.
@mme
mme force-pushed the mme/genui-a2ui-1-0 branch from 0756742 to f170331 Compare October 20, 2026 10:42
@mme
mme merged commit f832d33 into feat/generative-ui-prototype Oct 20, 2026
23 of 28 checks passed
@mme
mme deleted the mme/genui-a2ui-1-0 branch October 20, 2026 10:43
mme added a commit that referenced this pull request Oct 20, 2026
…sions, component envelope, checks severity, Video, catalog export, adoption guide (#7888)

## Summary

The remaining A2UI 1.0 items from the pre-release review, on top of
#7879, one commit per area. Nothing here changes how
`createGenerativeUI`, slots, events or the surface model work; every
addition is opt-in or fills a gap of the 1.0 spec.

### 1. Structured action events

A click on an `{ "event" }` action still becomes a visible user message.
The run it starts now also carries the A2UI 1.0 **action message**
(`name`, `surfaceId`, `sourceComponentId`, ISO `timestamp`,
`userMessage`, resolved `context`) in the envelope, as
`forwardedProps.copilotkit.ui.metadata.extensions.copilotkit_action`.
`envelopeToManifest` gives it back as `action`. The action is a
scoped-properties entry for the acting agent only, set when the event is
forwarded (so it is there even when another agent is running and no
run-start fires) and dropped when that agent's run ends (so a
frontend-tool follow-up, a suggestion request or a typed message never
carries it again).

This needed one change outside the generative UI code:
`CopilotKitCore.addScopedProperties` now keeps every entry distinct even
when `randomUUID` repeats itself. react-core's test setup mocks it to a
constant, and the per-agent action entry silently replaced the shared
envelope entry in the Map. Two lines in core, with a core test.

### 2. Function permissions

Declarations take the 1.0 `FunctionDefinition` fields: `allowedCallers`
(`rendererOnly` | `agentOnly` | `rendererOrAgent`),
`requiresUserActivation` (implies `rendererOnly`) and `returnType`. The
dispatcher and the validator refuse the other caller with
`invalid_function_call`; an event cannot match an `agentOnly` function;
a `requiresUserActivation` function needs a real gesture. The manifests
always write the effective `allowedCallers`, both prompts mark
restricted functions, and the compact schema says `callers`.

Two decisions to be aware of:

- **The default stays `rendererOrAgent`**, where A2UI 1.0 defaults to
`rendererOnly`. `callRendererFunction` keeps working without a
declaration, which is how the engine's tests and docs use it. The
manifest and the exported catalog write the value out, so a 1.0 reader
sees the same thing. Flipping it is one constant
(`GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS`).
- **The built-ins are `rendererOnly`**, as in the basic catalog. The
agent can no longer `callRendererFunction` `formatCurrency` or `calc`;
it gets `invalid_function_call` back. They are value functions of the
UI.

### 3. The component envelope

A component may carry `catalogId`, `accessibility` and `metadata` next
to `id` and `component`. The validator checks them (own catalog only;
`label`, `description` and `hidden` may be bindings or function values;
`live` is an ARIA value), `createGenerativeUI` refuses props with those
names, and the renderer keeps all three out of the props, so a strict
props schema still passes. `accessibility` is resolved field by field
like a prop. `hidden` and `live` apply to every component through a
wrapper element the engine renders (`display: contents`); a `label` or
`description` needs an element with a role, so the standard components
set them themselves: containers and `Card` become a named `group`, every
input control carries its name, `Icon` and `Svg` take it like `label`,
the `Modal` and `Lightbox` portals carry it, a table row or cell applies
it directly (`accessibility: "self"`, no wrapper inside a table). A
custom component calls `useGenerativeUIAccessibility()`. In markdown
mode, text with an envelope, or inside a container with one, is not
lifted to prose. Both prompts mention the field (one rule).

### 4. `ValidationResult` `code` and `severity`

The built-in validators set a `code` (`required`, `pattern`, `tooShort`,
`tooLong`, `notANumber`, `tooSmall`, `tooLarge`, `email`). A check reads
the `severity` of its result: an error stays an alert that makes the
input invalid and holds a Button back; a `warning` or an `info` shows
its message as a status in its own colour and blocks nothing. Extra keys
of a result are kept, as the spec allows.

### 5. Video

A page on another video site (Vimeo, Loom, TikTok, …) or a YouTube URL
without a plain id shows a link card instead of a dead native player; so
does a file that fails to load. A video file takes `captions` as WebVTT
tracks. YouTube stays the only embedded provider; another one is an
override of the component.

### 6. `exportA2UICatalog(ui)`

Writes the `catalog_definition.json` shape: components with `component`
as a `const`, model props that take a value, a `DataBinding` or a
`FunctionCall`, child references and slots as `ComponentId` /
`ChildList`, events as `Action`; built-in and declared functions with
`returnType`, `allowedCallers` and typed args (the built-ins from their
signatures); `$defs.anyComponent` / `anyFunction`.

### 7. Docs

A new page, **Adopt from A2UI**: before and after for the provider and
the runtime, converting a `createCatalog` catalog, the v0.9 → 1.0
mapping of bindings and actions, what the agent receives, the
markdown-mode transformations, Map and `route`, and a support matrix.
The other pages got the paragraphs for 1 to 6.

### 6. `exportA2UICatalog(ui)` (details)

Nested values at any depth, record values and pattern properties, tuples
(as `prefixItems`), intersections, unions, converter `$defs` with their
references rebased, `requiresUserActivation` always written out (the
metaschema's activation rule has no `required`), `args` required only
when an arg is, names escaped in references.

## Verification

Rebased onto the branch head after the web-inspector pane landed. `tsc
--noEmit` in shared, core, react-core, runtime and web-inspector; `oxfmt
--check` on every touched file. Suites: react-core generative UI 581,
shared 647, core 1356, runtime v2 2070, web-inspector 893, react-ui 79,
all green; the demo example type-checks.

Codex review (gpt-6-astra, xhigh, plain `codex review --base`) ran
eleven rounds on this branch: 6, 4, 6, 6, 5, 3, 3, 3, 4, 5, 3 findings,
one P1 (a bound `hidden` remounted the component; fixed), all folded
into the area commits. Declined, with reasons:

- Rebasing `#/properties/...` self-references around the exporter's
`anyOf` wrappers (raised in five rounds): no converter we support emits
them; ours inlines, zod 4 uses `$defs`.
- Wrapping every component so that an envelope added or removed by a
later `updateComponents` never remounts it: a wrapper on every node
breaks the stylesheet's child selectors (table rows and cells, the last
text of a spaceBetween row), and bound inputs keep their values in the
data model anyway.
mme added a commit that referenced this pull request Oct 21, 2026
…names, child references, dynamic values, checks, calc (#7879)

## Summary

Brings `standardUI` and the generative UI engine to the **A2UI 1.0 basic
catalog**, in seven commits, one per area: shared protocol pieces, the
core prose lift, the react-core engine, the standard catalog, the
runtime prompt, the demo, the docs. Additive to the engine:
`createGenerativeUI`, `slots`, events and the surface model keep working
as they are.

### 1. Catalog aligned with the 1.0 basic catalog 

The 18 basic components carry their A2UI names *and* props, no aliases,
and the five we lacked are added (Video, AudioPlayer, Tabs, Modal,
ChoicePicker). 73 components.

| Component | Change |
| --- | --- |
| Row, Column, Box… | `justify`: `spaceBetween` / `spaceAround` /
`spaceEvenly` (+ `stretch`) |
| all basic components | `weight` = flex-grow in a Row/Column; font
weight is `fontWeight`, Icon stroke `strokeWeight` |
| Image | `url`, `description`; `fit` with the five object-fit values;
`variant` (icon … header). Same for `CarouselMediaItem` and `ImageGrid`
items |
| Icon | the A2UI icon names (`arrowBack`, `shoppingCart`, …) map to
Lucide; `{ svgPath }` |
| Button | variants `default` / `primary` / `borderless` (+ `soft`);
`child` slot |
| TextField | `variant` (`shortText`, `longText`, `number`, `obscured`,
`email`, `url`, `tel`) |
| CheckBox | `value` is the boolean state |
| Slider / DateTimeInput / Divider / Card / List | `steps`; `enableDate`
/ `enableTime` with ISO values; `axis`; `child` slot; `direction` +
`align` |

### 2. Typed child references 

`child()` and `childList()` mark a prop as a component reference
anywhere in the props schema, like A2UI's `ComponentId` / `ChildList`
types. The JSON Schema carries the A2UI `$ref`, the compact schema shows
`componentId`, and the engine renders every referenced id at any depth
(lists and templates included) and hands the component the nodes.
`slots` stays as top-level sugar. `Tabs` takes `tabs: [{ title, child
}]` exactly as in 1.0.

### 3. Dynamic values, the whole 1.0 model 

- `{"@path"}` and `{"@call"}` resolve at any depth of props, event
`context`, `userMessage` and function args.
- All 14 basic functions are built in, plus `@index`: `required`,
`regex`, `length`, `numeric`, `email`, `formatString` (`${/path}`,
`${relative}`, `${fn(arg: value)}`, `\${` escape), `formatNumber`,
`formatCurrency`, `formatDate` (TR35), `pluralize`, `and`, `or`, `not`,
`openUrl`.
- Reactive per prop: a node subscribes to the paths it read and
re-resolves only the prop whose inputs changed; literals keep their
identity.
- `ValidationResult` coerces to a boolean except under a check
`condition`.
- `openUrl` runs only from an event binding; the agent's
`callRendererFunction` gets `invalid_function_call` for it. Other basic
functions are callable by the agent.
- A bad call is a node fallback plus `reportError`, never a crash. The
validator and the guideline know the rules, including that 1.0 has **no
operators** in `${...}` (no arithmetic, no conditions): a derived number
is the model's job.
- Guideline nudge from the live runs: keep `dataModel` flat. With one
wrapper object around everything the model dropped a closing brace twice
in a row, which made the whole surface invisible.

### 4. `checks` 

Every input and `Button` take the `Checkable` rules. An input shows the
first failed message once touched (or when it has a value) and sets
`aria-invalid`; a Button with checks is disabled while one fails.

### 5. `calc` and `series`: arithmetic and computed lists

1.0 has no operators at all, so a price that follows a slider has no
spelling in the basic catalog. A catalog may declare its own functions,
so `standardUI` adds two, listed to the model like `formatCurrency`:

- `calc`: one expression over named args (`"expression": "seats * 29 *
(annual ? 0.8 : 1)"`, with `"seats": {"@path": "/seats"}`). Closed
language: arithmetic, comparisons, `&& || !`, `?:`,
`min/max/round/floor/ceil/abs`, text `+`. No property access, no code.
- `series`: a list of `count` items from an `item` template with
`${...}` expressions over a loop variable, for chart data and template
lists.

Both are reactive through the resolver. In the demo the model now writes
`calc` for the monthly price and a `series` (with a nested `calc`) for
the 12-month chart; moving the slider or toggling annual billing updates
both with no round trip.

### 6. Fix: a generated event is sent only when the agent is idle

A model-generated Button with an event binding sent its event on every
click; a double click or a click during a streaming reply started a
second run that interrupted the first. `forwardEvent` now drops an event
while the agent runs or another event is on its way (`agent_busy` result
to the component, nothing reported). Chat input and the chat's own
suggestion pills are untouched.

### Deviations from 1.0

`calc` and `series` are CopilotKit catalog functions, not basic-catalog
ones; a renderer without them rejects the call cleanly.

`Button` keeps `onClick` (1.0: `action`); defaults differ where ours
look better in chat (`Image.fit` → `cover`).

### Context cost

Compact schema + run guideline: **13.2K tokens** (o200k), up from 11.0K
on the base: four new components, `weight` on 18 components, the Icon
names and the 14 function signatures.

### Demo suggestions

Three pills in `examples/v2/a2ui-markdown` exercise the new features end
to end: **Table booking** (a `formatString` sentence with `pluralize`
and `formatDate` that updates live from a name field, a date picker and
a slider), **Sign-up with validation** (per-field `checks`, Create
account disabled until valid), and the sharpened **Team plan estimator**
(`calc` price and `series` chart following the slider and the annual
checkbox, plus a Request quote button gated by checks). All three were
run against the built-in agent and rendered as intended.

## Review

Nine rounds of `codex review` (gpt-6-astra, xhigh) against the base,
each round's findings fixed and folded into the feature commit they
belong to. Highlights: failed function values keep their subscriptions
and recover; the prose lift follows typed child references, declared
slots and a Card's `child`, and leaves bound references and horizontal
lists alone; the resolution cache is scoped by template item and cleared
on data notifications; `calc` short-circuits `?:`, `&&`, `||`;
`formatDate` tokenizes TR35 fields; built-ins are in the forwarded
catalog and never shadow a declared app function; `openUrl` is never a
value and needs the browser's user activation; the Modal is portaled
with its theme, keyboard-operable, respects disabled triggers and shares
one Escape stack with the Lightbox; the tool-transport prompt matches
the markdown guideline. Declined as disproportionate: detecting an
in-place data-model mutation made by a layout effect in the window
before a node subscribes.

## Verification

Each commit was type-checked and tested on its own. At the head: shared
98/98, react-core generative-ui 526/526 (new suites: `resolve`,
`functions`, `calc`, `child-refs`, `dynamic-values`, `checks`), react-ui
79/79; `tsc` clean for shared, react-core and the example. `/catalog` in
`examples/v2/a2ui-markdown` renders every sample; Tabs from typed ids,
the reactive formatString sample and the checks sample were exercised in
the browser.

Replaces #7873 and #7878.
mme added a commit that referenced this pull request Oct 21, 2026
…sions, component envelope, checks severity, Video, catalog export, adoption guide (#7888)

## Summary

The remaining A2UI 1.0 items from the pre-release review, on top of
#7879, one commit per area. Nothing here changes how
`createGenerativeUI`, slots, events or the surface model work; every
addition is opt-in or fills a gap of the 1.0 spec.

### 1. Structured action events

A click on an `{ "event" }` action still becomes a visible user message.
The run it starts now also carries the A2UI 1.0 **action message**
(`name`, `surfaceId`, `sourceComponentId`, ISO `timestamp`,
`userMessage`, resolved `context`) in the envelope, as
`forwardedProps.copilotkit.ui.metadata.extensions.copilotkit_action`.
`envelopeToManifest` gives it back as `action`. The action is a
scoped-properties entry for the acting agent only, set when the event is
forwarded (so it is there even when another agent is running and no
run-start fires) and dropped when that agent's run ends (so a
frontend-tool follow-up, a suggestion request or a typed message never
carries it again).

This needed one change outside the generative UI code:
`CopilotKitCore.addScopedProperties` now keeps every entry distinct even
when `randomUUID` repeats itself. react-core's test setup mocks it to a
constant, and the per-agent action entry silently replaced the shared
envelope entry in the Map. Two lines in core, with a core test.

### 2. Function permissions

Declarations take the 1.0 `FunctionDefinition` fields: `allowedCallers`
(`rendererOnly` | `agentOnly` | `rendererOrAgent`),
`requiresUserActivation` (implies `rendererOnly`) and `returnType`. The
dispatcher and the validator refuse the other caller with
`invalid_function_call`; an event cannot match an `agentOnly` function;
a `requiresUserActivation` function needs a real gesture. The manifests
always write the effective `allowedCallers`, both prompts mark
restricted functions, and the compact schema says `callers`.

Two decisions to be aware of:

- **The default stays `rendererOrAgent`**, where A2UI 1.0 defaults to
`rendererOnly`. `callRendererFunction` keeps working without a
declaration, which is how the engine's tests and docs use it. The
manifest and the exported catalog write the value out, so a 1.0 reader
sees the same thing. Flipping it is one constant
(`GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS`).
- **The built-ins are `rendererOnly`**, as in the basic catalog. The
agent can no longer `callRendererFunction` `formatCurrency` or `calc`;
it gets `invalid_function_call` back. They are value functions of the
UI.

### 3. The component envelope

A component may carry `catalogId`, `accessibility` and `metadata` next
to `id` and `component`. The validator checks them (own catalog only;
`label`, `description` and `hidden` may be bindings or function values;
`live` is an ARIA value), `createGenerativeUI` refuses props with those
names, and the renderer keeps all three out of the props, so a strict
props schema still passes. `accessibility` is resolved field by field
like a prop. `hidden` and `live` apply to every component through a
wrapper element the engine renders (`display: contents`); a `label` or
`description` needs an element with a role, so the standard components
set them themselves: containers and `Card` become a named `group`, every
input control carries its name, `Icon` and `Svg` take it like `label`,
the `Modal` and `Lightbox` portals carry it, a table row or cell applies
it directly (`accessibility: "self"`, no wrapper inside a table). A
custom component calls `useGenerativeUIAccessibility()`. In markdown
mode, text with an envelope, or inside a container with one, is not
lifted to prose. Both prompts mention the field (one rule).

### 4. `ValidationResult` `code` and `severity`

The built-in validators set a `code` (`required`, `pattern`, `tooShort`,
`tooLong`, `notANumber`, `tooSmall`, `tooLarge`, `email`). A check reads
the `severity` of its result: an error stays an alert that makes the
input invalid and holds a Button back; a `warning` or an `info` shows
its message as a status in its own colour and blocks nothing. Extra keys
of a result are kept, as the spec allows.

### 5. Video

A page on another video site (Vimeo, Loom, TikTok, …) or a YouTube URL
without a plain id shows a link card instead of a dead native player; so
does a file that fails to load. A video file takes `captions` as WebVTT
tracks. YouTube stays the only embedded provider; another one is an
override of the component.

### 6. `exportA2UICatalog(ui)`

Writes the `catalog_definition.json` shape: components with `component`
as a `const`, model props that take a value, a `DataBinding` or a
`FunctionCall`, child references and slots as `ComponentId` /
`ChildList`, events as `Action`; built-in and declared functions with
`returnType`, `allowedCallers` and typed args (the built-ins from their
signatures); `$defs.anyComponent` / `anyFunction`.

### 7. Docs

A new page, **Adopt from A2UI**: before and after for the provider and
the runtime, converting a `createCatalog` catalog, the v0.9 → 1.0
mapping of bindings and actions, what the agent receives, the
markdown-mode transformations, Map and `route`, and a support matrix.
The other pages got the paragraphs for 1 to 6.

### 6. `exportA2UICatalog(ui)` (details)

Nested values at any depth, record values and pattern properties, tuples
(as `prefixItems`), intersections, unions, converter `$defs` with their
references rebased, `requiresUserActivation` always written out (the
metaschema's activation rule has no `required`), `args` required only
when an arg is, names escaped in references.

## Verification

Rebased onto the branch head after the web-inspector pane landed. `tsc
--noEmit` in shared, core, react-core, runtime and web-inspector; `oxfmt
--check` on every touched file. Suites: react-core generative UI 581,
shared 647, core 1356, runtime v2 2070, web-inspector 893, react-ui 79,
all green; the demo example type-checks.

Codex review (gpt-6-astra, xhigh, plain `codex review --base`) ran
eleven rounds on this branch: 6, 4, 6, 6, 5, 3, 3, 3, 4, 5, 3 findings,
one P1 (a bound `hidden` remounted the component; fixed), all folded
into the area commits. Declined, with reasons:

- Rebasing `#/properties/...` self-references around the exporter's
`anyOf` wrappers (raised in five rounds): no converter we support emits
them; ours inlines, zod 4 uses `$defs`.
- Wrapping every component so that an envelope added or removed by a
later `updateComponents` never remounts it: a wrapper on every node
breaks the stylesheet's child selectors (table rows and cells, the last
text of a spaceBetween row), and bound inputs keep their values in the
data model anyway.
NathanTarbert pushed a commit to vvlrff/CopilotKit that referenced this pull request Oct 27, 2026
…nsports, standard catalog, inspector pane) (CopilotKit#7819)

Try it: run `examples/v2/generative-ui-shop` (setup in its README) and
ask the chat for "Top rated" products. The home row on the page changes
to what the agent picked. This PR makes generative UI one feature: an
agent streams React components into the chat or into named areas of the
page, with the `render_ui` tool (tool transport) or with a2ui code
fences in its reply (markdown transport). It includes a standard catalog
of 69 components (the A2UI 1.0 basic catalog, from CopilotKit#7879, with the
follow-ups of CopilotKit#7888, CopilotKit#7890 and CopilotKit#7898), the work of CopilotKit#7829 and CopilotKit#7848, two
new examples, and a Generative UI pane in the inspector.

## What does this PR do?

### Catalog (`@copilotkit/react-core/v2/generative-ui`)

- `createGenerativeUI({ id, extends, state, functions, overrides,
components })` declares the components, the app state, and the
functions. Schemas can be any Standard Schema (zod 3, zod 4.2+, Valibot,
ArkType). Props need a JSON Schema, and props and state must validate
synchronously.
- Binding: a prop with the name of a state key, or a `bind` selector,
gets its value from app state. An event with the name of a function (or
`onX` for `x`) calls it. An event that no function matches becomes a
visible user message.
- `writable: ["value"]` gives a component a typed `setValue`. A path
that the user wrote becomes user-owned: later agent writes to it are
ignored.
- `extends` merges catalogs, with full types for every component.
`overrides: { Card: { component: MyCard } }` replaces the React
component of a base component and keeps what the model sees.
`standardUI.omit(["Map"])` drops components, also from the prompt.
- `useGenerativeUIState(ui, key, value)` and
`useGenerativeUIFunction(ui, name, handler)` connect app state and
handlers, with types from `ui`.

### Surfaces

- `<GenerativeUISurface id description ui components fallback />` is a
named area of the page. The fallback shows until the agent renders into
it.
- The `ui` prop types `components`, so a wrong component name is a `tsc`
error. `components` needs `ui`.
- `components` limits the area to those components. Other components are
rejected, and the model gets the reason.
- The page scrolls to a surface when the agent starts to render into it,
unless the surface is already on screen. `autoScroll={false}` turns this
off for one surface.

### Standard catalog and theme

- `standardUI`: 69 components for layout, text, inputs, feedback, data,
media, and composites (the a2ui-renderer catalog, ported in CopilotKit#7848).
Chart uses `recharts`. Map loads `maplibre-gl` (an optional peer).
- Built-in dark mode: the components switch to dark values under a
`.dark` class, like the CopilotKit chat. The map uses a dark basemap.
- `theme` keys are the exact `--a2ui-*` variables, so a wrong name is a
type error. Top-level values apply in both modes, and `dark: { … }`
replaces them in dark mode. The theme is a stylesheet on the surface
root.

### Wire and runtime (`@copilotkit/shared`, `@copilotkit/core`, runtime)

- A2UI v1.0 only, in both transports: `createSurface` with inline
`components` and `dataModel`, `{"@path"}` bindings, `{"@call"}` function
calls in events, `{"@call":"@index"}` in templates, `userMessage` on
events, and `"value": null` deletes. `catalogId` is optional.
- `supportedCatalogIds` lists the id of the UI first, then the id of
every catalog in its `extends`. An operation can name any of these ids
in `catalogId`, and the surface keeps that id. An unknown id on a
component or a function call is rejected with a reason. An unknown id on
`createSurface` is replaced with the id of the UI.
- `callRendererFunction` is off for now (CopilotKit#7890): the prompts do not
mention it, and the validator rejects it with a reason. The code and its
tests stay behind `GENERATIVE_UI_AGENT_FUNCTION_CALLS`.
- The manifest goes to `forwardedProps.copilotkit.ui` (format 3, the
v1.0 renderer capabilities shape), only to the agents in `agentIds`. The
guide sends only the rules that the catalog needs (about 575 tokens for
a small catalog, 930 with all rules).
- `CopilotRuntime({ generativeUI: true })` gives tool-transport runs
`render_ui` through `GenerativeUIMiddleware`. A markdown-transport run
never gets it.
- Markdown transport: the fence parser from CopilotKit#7829 streams operations
component by component. A fence with `target=<id>` renders in that
surface, and the v1 chat (`@copilotkit/react-ui`) renders a2ui fences
too.

### Inspector (`@copilotkit/web-inspector`)

A new **Generative UI** pane, with three tabs:

- **Surfaces**: each surface with its status, target, rejected
operations, data model, and user values. A tree shows the rendered
components and their props. It follows `slots` and the `child()` /
`childList()` refs at any depth. Hover over the card of a page surface
to outline it on the page and scroll to it.
- **Catalog**: the components, split by the catalog that declared them.
The provider catalog comes first. A base catalog from `extends` has an
"extended" tag and starts closed. A small search filters components and
functions.
- **Prompt**: what the last run sent and what the next run will send:
the envelope and the `render_ui` guide. The large text is drawn only
when you open it.

React-core gives core an internal debug source
(`ɵGenerativeUIDebugSource`), and the pane reads it. The prompt builder
moved from runtime to `@copilotkit/shared`, so the pane shows the same
guide that the runtime builds.

### Examples

- `examples/v2/generative-ui-shop` (new, React Router): the shop from
the AI-powered apps workshop, with Prisma and SQLite. A TanStack AI
agent with server tools fills four page surfaces: the home row, the
product recommendations, the cart items, and the cart suggestions.
- `examples/v2/a2ui-markdown` (Next.js): both transports, page surfaces
with pills, and `/catalog` with every standard component.
- `examples/v2/react/demo` `/generative-ui`: a storefront with `bind`,
`writable`, and a limited surface.

### Known gaps

- Agent-called functions (`callRendererFunction`) are off. Their result
goes back as a developer message, and not every backend keeps that
message where the model reads it in order.
- In markdown mode, a surface cannot be created again after
`deleteSurface`.
- `HtmlView` content stays light-styled in dark mode: it is a sandboxed
iframe that the theme cannot reach.
- From A2UI v1.0, not supported yet: catalogs by id (without an inline
catalog), and `sendDataModel`. `extends` merges catalogs into one
namespace, and overrides replace by name.
- Several catalogs in one surface work only in part. A component is not
checked against the catalog that the surface names, and the prompt does
not tell the agent to set `catalogId`.
- `callAgentFunction` and `agentFunctionResponse` are not implemented. A
user event starts a new run instead.
- `@a2ui/web_core` stays 0.10.4: the engine uses its `v0_9` surface and
data models. Version 0.14 has `v1_0` models, and the move is a separate
integration task.
- `@ag-ui/a2ui-toolkit` 0.0.5 writes v0.9 operations, so agent tools
built with it do not work with this engine. The `render_ui` route does
not use the toolkit, and it works with a LangGraph Python agent (see
Testing).
- The standard catalog keeps each React component and its schema in one
entry. `exportA2UICatalog` gives the portable JSON, but definitions
without React are not split out yet.

## Related PRs and Issues

- Contains the work of CopilotKit#7829 (A2UI markdown mode), ported to this
engine. CopilotKit#7829 itself is not changed.
- Contains CopilotKit#7848 by @mme: the a2ui-renderer standard catalog and
markdown-mode behavior on `createGenerativeUI`.
- Contains CopilotKit#7879: the A2UI 1.0 basic catalog names, typed child
references, dynamic values, checks, and `calc`.
- Contains CopilotKit#7888: A2UI 1.0 follow-ups: action events, function
permissions, the component envelope, checks severity, Video,
`exportA2UICatalog`, and an adoption guide.
- Contains CopilotKit#7890: no agent-called renderer functions for now, the A2UI
default for `allowedCallers`, the experimental callout, and two prompt
rules.
- Contains CopilotKit#7898: drops `Loading`, `LoadingIndicator`, `LoadingBlock`
and `Celebration`.

## Checklist

- [ ] I have read the [Contribution
Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md)
- [x] If the PR changes or adds functionality, I have updated the
relevant documentation
- [ ] If the PR contains a breaking change, the title has `!` (for
example `feat(react-core)!: ...`) and the description has a `BREAKING
CHANGE:` line with migration steps. See
[VERSIONING.md](https://github.com/CopilotKit/CopilotKit/blob/main/VERSIONING.md)
- [ ] "Allow edits by maintainers" is checked (lets us help iterate on
your PR directly — faster turnaround for everyone)

Docs: a new "Components and surfaces" section under Generative UI, in
the Declarative group
(`showcase/shell-docs/src/content/docs/generative-ui/components/`), with
9 pages, and an adoption guide from the `a2ui` renderer is one of them.
Its support matrix lists these limits. The quickstart has a "When
something does not render" table that points to the tab of the inspector
pane to open. The Inspector page, `surfaces.mdx`, and `catalogs.mdx`
link to the pane too. Reference pages for `createGenerativeUI`,
`GenerativeUISurface`, and the hooks come in a later PR. There is no
breaking change for users: none of these APIs is on `main`.

## Testing

**Commands run**

- `tsc --noEmit` passes in react-core and in the three examples
(`generative-ui-shop`, `a2ui-markdown`, `react/demo`), after a rebuild
of react-core.
- The generative UI tests of react-core pass: 457 tests in 29 files.
They include tests for Standard Schema with a non-zod schema, the theme
stylesheet, overrides, `omit`, and the type rules.
- `pnpm install --frozen-lockfile --lockfile-only` passes for all 86
workspace projects.
- The lefthook pre-commit hook ran on every commit, except the package
test step of three lockfile commits (`032d695e21`, `89ec79e649`,
`ae485ca8bf`). A lockfile change makes that step run the Go and Ruby
runtime tests, which cannot run on the author's machine. CI runs them.
- Inspector pane and its merge with CopilotKit#7879: builds of shared, core,
react-core, and web-inspector, then `tsc --noEmit` in those four and in
runtime. These tests pass: `generative-ui-view.spec.ts` and
`hud-conformance.test.ts` (69), `use-generative-ui-root.test.tsx` and
`catalog.test.tsx` (46), `generative-ui-debug.test.ts` (2),
`generative-ui-middleware.test.ts` (44), and `shared/src/generative-ui`
(76).
- The inspector commits skipped the package test step of the pre-commit
hook. In the full hook run, 3 react-core chart tests and 1 vue SSR test
timed out under load. They are not in changed files, and all 4 pass
alone. CI runs the full suites.
- Merge of CopilotKit#7888 into this branch: builds of shared, core, react-core,
and web-inspector, `tsc --noEmit` in web-inspector, and the 69 inspector
tests pass. The docs commit has no code.
- Real backend: the LangGraph Python agent of
`examples/v2/a2ui-markdown` (`CopilotKitMiddleware`, `uv sync` from its
`uv.lock`) with an OpenAI model, on both transports. With the tool
transport, it rendered a dashboard into a page target, then updated the
same surface in place. A sign-up form showed its checks, and Create
account stayed disabled until every field was valid. The submit event
started a new run, and the agent repeated the 4 values. The inspector
showed 2 surfaces and no rejected operations. With the markdown
transport, a fence rendered a checklist in the `notes` target, and no
fence text appeared in the chat. The agent and the runtime logged no
errors.
- The catalog ids of `extends` (`2ac89b6e67`), after a rebase on CopilotKit#7898:
builds of shared and core, then `tsc --noEmit` in shared, core,
react-core and runtime. The touched test files pass:
`validate-operation.test.ts` and `a2ui-envelope.test.ts` (102),
`a2ui-markdown-operations.test.ts` (74), `catalog.test.tsx`,
`markdown-source.test.ts`, `surface-manager.test.ts` and
`use-generative-ui-root.test.tsx` (130), and
`generative-ui-middleware.test.ts` (42). The full pre-commit hook
passed. In one earlier hook run, the react-core `Chart` test in
`standard/__tests__/data.test.tsx` timed out under load. It passes
alone.
- Not run locally: full package suites and e2e. CI runs them.

**Manual test**

1. Follow the setup in `examples/v2/generative-ui-shop/README.md`, then
run `pnpm example-dev` and open http://localhost:3012.
2. On the home page, click **Top rated**. The Featured Products row
changes, and the page scrolls to it. Click **Featured again** to bring
the original row back.
3. Open a product and click **Cheaper alternatives**. The "You Might
Also Like" row changes.
4. Add a product to the cart, open the cart, and click **Show my cart
differently**. The cart items change to detailed cards.
5. Add the `dark` class to `<html>` in the devtools of
`examples/v2/a2ui-markdown` `/catalog`. Every standard component
switches to dark.
6. In the shop, open the CopilotKit inspector and click **Generative
UI**. Open **Catalog**, and type `button` in the search: the standard
catalog opens with its matches. On **Surfaces**, hover over a page
surface card: the surface gets an outline on the page.
7. Run the LangGraph agent of `examples/v2/a2ui-markdown` (see
`agent/README.md`), then open
http://localhost:3011/?agent=langgraph&transport=tool. Click **Dashboard
on the page**, then **Update the dashboard**: the same surface changes.
Click **Sign-up with validation**, fill the form, and submit it: the
agent repeats what you entered.

**How this PR makes testing easy**

- Unit and type tests in
`packages/web-inspector/src/components/generative-ui-view.spec.ts`,
`packages/react-core/src/v2/generative-ui/**/__tests__`,
`packages/shared/src/__tests__/a2ui-*.test.ts`,
`packages/core/src/__tests__/a2ui-markdown-*.test.ts`, and
`packages/runtime/src/v2/runtime/__tests__/generative-ui-*.test.ts`.
- Three example apps (see Examples above). The shop and a2ui-markdown
were tested with a real model, and `/catalog` renders with no model.
- The docs section walks through each feature with copyable code:
surfaces, catalogs, the standard catalog, state and actions, theming,
transports, markdown mode, and the adoption guide from A2UI.

## Risk / rollback

Low risk for current users. All new APIs are experimental and opt-in,
and the `a2ui` prop path does not change. react-core gets `recharts` as
a dependency and `maplibre-gl` as an optional peer; apps that do not
import the subpath do not bundle them. The new shop example adds Prisma,
TanStack AI React, and Faker to the lockfile. To undo, revert the PR.

## Public API change

New experimental exports. Nothing that exists on `main` changes.

**Before**

```tsx
<CopilotKitProvider runtimeUrl="/api/copilotkit" a2ui={{ catalog }}>
  <CopilotChat />
</CopilotKitProvider>
```

**After**

```tsx
import { createGenerativeUI, GenerativeUISurface, standardUI } from "@copilotkit/react-core/v2/generative-ui";

const ui = createGenerativeUI({
  id: "acme/app@1",
  extends: [standardUI.omit(["Map"])],
  overrides: { Card: { component: MyCard } },
  components: { ProductCard: { component: ProductCard, props: productSchema } },
});

<CopilotKitProvider
  runtimeUrl="/api/copilotkit"
  generativeUI={{ ui, theme: { "--a2ui-color-accent": "#d97706", dark: { "--a2ui-color-panel": "#1f2937" } } }}
>
  <GenerativeUISurface id="featured" ui={ui} components={["ProductCard"]} fallback={<Featured />} />
  <CopilotChat />
</CopilotKitProvider>

// Server
new CopilotRuntime({ agents, generativeUI: true });
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added v2 Generative UI with interactive surfaces, custom catalogs,
state bindings, actions, theming, validation, charts, maps, media, and
responsive standard components.
* Added tool and Markdown transports with streamed `a2ui` content,
targeted surfaces, inline rendering, and chat integration.
* Added Generative UI inspection in the web Inspector, showing catalogs,
surfaces, prompts, state, and rejected operations.
* Added generative UI examples, including a Markdown demo, storefront,
catalog gallery, shopping assistant, cart, and product comparison
experience.

* **Documentation**
* Added setup and reference guides for catalogs, surfaces, transports,
theming, state, actions, and Inspector workflows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant