Skip to content

feat(embed): add the a2ui-embed build command - #4300

Draft
josemontespg wants to merge 1 commit into
embed/3-viewfrom
embed/4-build
Draft

josemontespg wants to merge 1 commit into
embed/3-viewfrom
embed/4-build

Conversation

@josemontespg

@josemontespg josemontespg commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Problem: Serving an @a2ui/embed app under the default MCP Apps Content Security Policy requires bundling the renderer and catalogs into a single network-free HTML file alongside a matching catalog schema file for server validation and agent prompt generation.

This PR adds the a2ui-embed build CLI and @a2ui/embed/build (defineConfig, build, basicCatalog). One build produces both the self-contained HTML bundle (rejecting external network URLs) and *.catalog.json containing each catalog's validation schema, protocolVersion, and optional instructions.

Changes

  1. src/builder/build.ts, html.ts, and catalog_schema.ts: single-file HTML bundling and catalog schema output preserving protocolVersion and instructions.
  2. src/builder/config.ts, config_api.ts, and load_config.ts: defineConfig, basicCatalog, and Node/browser config loading.
  3. src/builder/cli.ts and typescript/scripts/prepare-publish.mjs: the a2ui-embed executable and published bin wiring.
  4. src/builder/*.test.ts, README.md, and CHANGELOG.md: unit, validator-compatibility, CLI, and CSP end-to-end tests plus documentation.

Verification

  1. WIREIT_CACHE=none yarn workspace @a2ui/embed test: 195 Node tests (including Chromium CSP end-to-end tests) and 29 Karma tests pass.
  2. yarn workspace @a2ui/embed lint, yarn workspace @a2ui/embed format:check, and ./scripts/fix_licenses.py --check pass.

@josemontespg
josemontespg added this pull request to stack #4301 November 18, 2026 21:14

@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-embed build command and @a2ui/embed/build module, which bundles an A2UI app and its catalogs into a single self-contained HTML file and generates a corresponding catalog schema JSON file. Feedback on the changes includes importing basename from node:path and using relative paths for config imports to prevent Windows path resolution issues, refining the static import regex to avoid false positives, and expanding ASSET_EXTENSIONS to inline common web font and media formats.

Comment thread typescript/embed/src/builder/build.ts Resolved
Comment thread typescript/embed/src/builder/build.ts Resolved
Comment thread typescript/embed/src/builder/html.ts Resolved
@josemontespg
josemontespg force-pushed the embed/4-build branch 2 times, most recently from 96003f2 to af64a53 Compare December 2, 2026 21:28
@josemontespg
josemontespg removed this pull request from stack #4333 December 2, 2026 22:12
@josemontespg
josemontespg added this pull request to stack #4548 December 2, 2026 22:13

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