-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Bump specification stable to v0.9 and draft to v0.10 #1419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,29 +104,27 @@ MCP Apps are typically delivered as a single HTML resource from the MCP Server. | |
| 2. Use a post-build script (like the [`inline.js`](https://github.com/google/A2UI/blob/main/samples/mcp/a2ui-in-mcpapps/server/apps/src/inline.js) script in the sample) to read the `index.html` and replace external `<script src="...">` and `<link rel="stylesheet" href="...">` tags with inline `<script>` and `<style>` tags containing the actual file contents. | ||
| 3. This produces a self-contained HTML file that can be safely loaded via `srcdoc` in the restricted iframe. | ||
|
|
||
| > [!TIP] | ||
| > **Using Vite to inline** | ||
| > | ||
| > If your project uses Vite (common for React, Vue, or Lit), you can achieve the same single-file output automatically using plugins like `vite-plugin-singlefile`. This eliminates the need for a custom post-build script by handling the inlining during the build process itself. | ||
| > | ||
| > **How to use it:** | ||
| > | ||
| > 1. **Install the plugin**: | ||
| > ```bash | ||
| > npm install -D vite-plugin-singlefile | ||
| > ``` | ||
| > 2. **Configure Vite**: Add the plugin to your `vite.config.ts` (or `.js`): | ||
| > | ||
| > ```typescript | ||
| > import {defineConfig} from 'vite'; | ||
| > import {viteSingleFile} from 'vite-plugin-singlefile'; | ||
| > | ||
| > export default defineConfig({ | ||
| > plugins: [viteSingleFile()], | ||
| > }); | ||
| > ``` | ||
| > | ||
| > This will ensure that all JS and CSS assets are inlined into the `index.html` file on build, making it ready to be served by your MCP server as a single resource. | ||
| !!! tip "Using Vite to inline" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What caused this reformat? Is this the prettier plugin? |
||
| If your project uses Vite (common for React, Vue, or Lit), you can achieve the same single-file output automatically using plugins like `vite-plugin-singlefile`. This eliminates the need for a custom post-build script by handling the inlining during the build process itself. | ||
|
|
||
| **How to use it:** | ||
|
|
||
| 1. **Install the plugin**: | ||
| ```bash | ||
| npm install -D vite-plugin-singlefile | ||
| ``` | ||
| 2. **Configure Vite**: Add the plugin to your `vite.config.ts` (or `.js`): | ||
|
|
||
| ```typescript | ||
| import {defineConfig} from 'vite'; | ||
| import {viteSingleFile} from 'vite-plugin-singlefile'; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [viteSingleFile()], | ||
| }); | ||
| ``` | ||
|
|
||
| This will ensure that all JS and CSS assets are inlined into the `index.html` file on build, making it ready to be served by your MCP server as a single resource. | ||
|
|
||
| ### Step 2: Leveraging A2UI-over-MCP | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ A2UI: JSON messages describing UI that: | |
|
|
||
| ### Example | ||
|
|
||
| === "v0.8 (Stable)" | ||
| === "v0.9 (Stable)" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, I don't think that updating the version numbers of the headers here is the right thing to do, because now the jsonl underneath doesn't match the version of the protocol on the title. |
||
|
|
||
| ```jsonl | ||
| { | ||
|
|
@@ -110,14 +110,14 @@ A2UI: JSON messages describing UI that: | |
|
|
||
| ```jsonl | ||
| { | ||
| "version": "v0.9", | ||
| "version": "v0.10", | ||
| "createSurface": { | ||
| "surfaceId": "booking", | ||
| "catalogId": "https://a2ui.org/specification/v0_9/basic_catalog.json" | ||
| } | ||
| } | ||
| { | ||
| "version": "v0.9", | ||
| "version": "v0.10", | ||
| "updateComponents": { | ||
| "surfaceId": "booking", | ||
| "components": [ | ||
|
|
@@ -151,7 +151,7 @@ A2UI: JSON messages describing UI that: | |
| } | ||
| } | ||
| { | ||
| "version": "v0.9", | ||
| "version": "v0.10", | ||
| "updateDataModel": { | ||
| "surfaceId": "booking", | ||
| "path": "/booking", | ||
|
|
@@ -162,7 +162,7 @@ A2UI: JSON messages describing UI that: | |
| } | ||
| ``` | ||
|
|
||
| Key differences in v0.9: `createSurface` replaces `beginRendering`, components use a flatter structure with `"component": "Text"` instead of nested objects, and all messages include a `version` field. | ||
| In v0.9 (Stable), `createSurface` replaces `beginRendering`, components use a flatter structure with `"component": "Text"` instead of nested objects, and all messages include a `version` field. | ||
|
|
||
| Client renders these messages as native components (Angular, Flutter, React, etc.). | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # A2UI Protocol <span class="version-badge draft">v0.10 — Draft</span> | ||
|
|
||
| > Version 0.10 is currently in draft status. For production use, consider [v0.9 (Stable)](v0.9-a2ui.md). | ||
|
|
||
| > NOTE: Living Document | ||
| > | ||
| > This specification is automatically included from `specification/v0_10/docs/a2ui_protocol.md`. Any updates to the specification will automatically appear here. | ||
|
|
||
| For more information, see the following related documentation: | ||
|
|
||
| - [v0.9 Protocol Specification](v0.9-a2ui.md) (Stable). | ||
| - [Evolution Guide: v0.9 → v0.10](v0.10-evolution-guide.md). | ||
|
|
||
| --- | ||
|
|
||
| --8<-- "specification/v0_10/docs/a2ui_protocol.md" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Evolution Guide <span class="version-badge info">v0.9 → v0.10</span> | ||
|
|
||
| > This guide is automatically included from `specification/v0_10/docs/evolution_guide.md`. Any updates will automatically appear here. | ||
|
|
||
| For more information, see the following related documentation: | ||
|
|
||
| - [A2UI Protocol v0.9](v0.9-a2ui.md) (Stable - what you're migrating from). | ||
| - [A2UI Protocol v0.10](v0.10-a2ui.md) (Draft - what you're migrating to). | ||
|
|
||
| --- | ||
|
|
||
| --8<-- "specification/v0_10/docs/evolution_guide.md" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the diff being weird? Otherwise this is wrong, I think that the messages that were under 0.9 earlier should be here now, because these are 0.8 right?