Skip to content

[iFrame] Add the @a2ui/catalog-iframe package and frame bridge - #2797

Draft
josemontespg wants to merge 1 commit into
catalogs-iframe-mcp-schemasfrom
catalogs-shared-sandbox-iframe-package
Draft

josemontespg wants to merge 1 commit into
catalogs-iframe-mcp-schemasfrom
catalogs-shared-sandbox-iframe-package

Conversation

@josemontespg

@josemontespg josemontespg commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds the @a2ui/catalog-iframe package (typescript/catalogs/iframe/) for the v1.0 iframe catalog, building on typescript/catalogs/shared/sandbox/ to implement the host side of the a2ui_* message protocol (WebAppFrameBridge, payload_validation, messages) and bundle the sandbox proxy into dist/sandbox/. The WebAppFrameUrl and WebAppFrameSrcdoc components follow in #2798.

Changes

  • typescript/catalogs/iframe/: the @a2ui/catalog-iframe workspace. Copies catalogs/iframe/catalog.json and typescript/catalogs/shared/ into src/ at build time, bundles the proxy into dist/sandbox/ with esbuild, and exports IFRAME_CATALOG_ID, the sandbox configuration API, FrameHost, and WebAppFrameBridge.
  • typescript/catalogs/iframe/src/bridge/: WebAppFrameBridge, messages.ts, and payload_validation.ts validating actions, data changes, and function calls against the component allowlists and JSON Schemas, with Karma unit tests.
  • typescript/catalogs/iframe/README.md & CHANGELOG.md: documents sandbox asset deployment (/a2ui-sandbox/ and configureSandbox) and the bridge API.

Verification

  • yarn --cwd typescript/catalogs/iframe test: Karma reports 192 SUCCESS.
  • yarn --cwd typescript/catalogs/iframe lint, ./scripts/fix_format.sh --check, and python3 scripts/fix_licenses.py --check pass.

Related to #3157

@github-project-automation github-project-automation Bot moved this to Todo in A2UI Sep 25, 2026
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 963297d to 88e7b37 Compare September 25, 2026 02:36

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the @a2ui/catalog-iframe package, which implements the A2UI iframe catalog for web renderers. It includes the sandbox proxy assets, configuration utilities, and the WebAppFrameBridge host-side protocol bridge that manages data model synchronization, allowlist validation, function calls, and frame sizing. Feedback on the changes highlights a correctness bug in DataModelSync where deleted properties or removed array elements are ignored, potentially causing state desynchronization. Additionally, it is recommended to replace the multi-pass string replacements used for unescaping JSON Pointer escape sequences in both payload_validation.ts and fake_frame_host.ts with a single-pass regex to prevent order-of-operations bugs.

Comment thread typescript/catalogs/shared/sandbox/data_model_sync.ts
Comment thread typescript/catalogs/iframe/src/bridge/payload_validation.ts
Comment thread typescript/catalogs/shared/sandbox/testing/fake_frame_host.ts Outdated
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 88e7b37 to 6ec8017 Compare September 25, 2026 06:22
@josemontespg
josemontespg added this pull request to stack #2804 September 25, 2026 18:11
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch 2 times, most recently from 695e3fc to a30511e Compare September 25, 2026 20:21
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from a30511e to 7e497bd Compare October 1, 2026 20:11
@josemontespg
josemontespg removed this pull request from stack #2804 October 1, 2026 20:12
@josemontespg
josemontespg added this pull request to stack #2940 October 1, 2026 20:12
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 7e497bd to 86a2e7b Compare October 1, 2026 20:43
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 86a2e7b to 5f1cc69 Compare October 1, 2026 21:42
@josemontespg
josemontespg removed this pull request from stack #2940 October 1, 2026 21:56
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 5f1cc69 to ba0153a Compare October 1, 2026 21:56
@josemontespg
josemontespg added this pull request to stack #2946 October 1, 2026 21:56
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from ba0153a to 5988e56 Compare October 1, 2026 22:14
josemontespg added a commit that referenced this pull request Oct 1, 2026
### Summary

`ResolveA2uiProp` turns every prop whose type matches `ActionLike` into a `() => Promise<void>` thunk. Since #2859 added `V1Action` to `ActionLike`, whose function-call variant infers as the weak type `{functionCall?: any}`, every object type matches it, so props declared as `z.record(z.unknown())` (or any `Record<string, ...>`) now resolve to an action thunk instead of their data type. The runtime binder is unaffected (it reads the zod schema), so this is a type-only regression, but it breaks `tsc` for catalogs that read such props, for example the iframe and MCP catalogs in #2797 and #2799.

Object types with a string index signature now resolve as data, as before #2859. Props shaped like an action (`{event: ...}`, `{functionCall: ...}`, `V1Action`) still resolve to the thunk.

### Changes

* `typescript/web_core/src/resolution/generic-binder.ts`: add `HasStringIndex<T>` and check it inside the `ActionLike` branch of `ResolveA2uiProp` before producing the thunk type.
* `typescript/web_core/CHANGELOG.md`: Unreleased entry.

### Verification

* `yarn --cwd typescript/web_core test` (842 tests) and `./scripts/fix_format.sh --check` pass locally.
* The iframe and MCP catalog packages of the stack above typecheck again with this change.
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 5988e56 to ec968bd Compare October 1, 2026 22:41
@josemontespg
josemontespg removed this pull request from stack #2946 October 2, 2026 00:35
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from ec968bd to 4dd00a0 Compare October 2, 2026 00:35
@josemontespg
josemontespg added this pull request to stack #3011 October 5, 2026 20:45
@josemontespg
josemontespg removed this pull request from stack #3011 October 7, 2026 23:18
@josemontespg
josemontespg changed the base branch from catalogs-iframe-mcp-schemas to main October 7, 2026 23:19
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from bbf025e to 77599be Compare October 7, 2026 23:19
@josemontespg
josemontespg changed the base branch from main to catalogs-iframe-mcp-schemas October 7, 2026 23:19
@josemontespg
josemontespg added this pull request to stack #3055 October 7, 2026 23:19
@josemontespg
josemontespg removed this pull request from stack #3055 October 7, 2026 23:32
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 77599be to a56a4d4 Compare October 7, 2026 23:33
@josemontespg josemontespg changed the title feat(catalogs): add the shared sandbox code and the @a2ui/catalog-iframe package [iFrame] feat(catalogs): add the @a2ui/catalog-iframe package and frame bridge Oct 7, 2026
@josemontespg
josemontespg added this pull request to stack #3057 October 7, 2026 23:34
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from a56a4d4 to e08c4d2 Compare October 8, 2026 19:25
@josemontespg josemontespg changed the title [iFrame] feat(catalogs): add the @a2ui/catalog-iframe package and frame bridge [iFrame] Add the @a2ui/catalog-iframe package and frame bridge Oct 8, 2026
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from e08c4d2 to eff4666 Compare October 8, 2026 20:22
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from eff4666 to 5dd2e62 Compare October 8, 2026 20:31
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 5dd2e62 to 6d7b8c9 Compare October 8, 2026 20:47
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 6d7b8c9 to a802168 Compare October 8, 2026 21:17
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from a802168 to 143f826 Compare October 8, 2026 21:34
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 143f826 to 4ece69e Compare October 8, 2026 22:05
@josemontespg
josemontespg force-pushed the catalogs-shared-sandbox-iframe-package branch from 4ece69e to a79f181 Compare October 8, 2026 22:58

This branch has not been deployed

No deployments
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