From 01981707479b3ff575074f0826d07366a1ae3f91 Mon Sep 17 00:00:00 2001 From: Ava Mattie <6314286+ava-cassiopeia@users.noreply.github.com> Date: Fri, 21 Nov 2025 22:48:50 +0000 Subject: [PATCH 1/5] Fix web builds from a cold-cached setup --- web/contact/package.json | 3 ++- web/editor/package.json | 3 ++- web/inspector/package.json | 3 ++- web/lib/package.json | 8 ++++---- web/lib/src/0.8/schemas/.gitignore | 4 ++++ web/package.json | 6 +----- web/restaurant/package.json | 3 ++- web/tests/package.json | 3 ++- 8 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 web/lib/src/0.8/schemas/.gitignore diff --git a/web/contact/package.json b/web/contact/package.json index 7d49f2791..f6261bab9 100644 --- a/web/contact/package.json +++ b/web/contact/package.json @@ -39,7 +39,8 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "../lib#build:tsc" + "../lib:build:tsc", + "../lib:copy-spec" ], "files": [ "**/*.ts", diff --git a/web/editor/package.json b/web/editor/package.json index 63c4bbedc..e94d93bea 100644 --- a/web/editor/package.json +++ b/web/editor/package.json @@ -39,7 +39,8 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "#build:tsc" + "../lib:build", + "../lib:copy-spec" ], "files": [ "**/*.ts", diff --git a/web/inspector/package.json b/web/inspector/package.json index 16b4bf766..5cfd35898 100644 --- a/web/inspector/package.json +++ b/web/inspector/package.json @@ -39,7 +39,8 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "#build:tsc" + "../lib:build:tsc", + "../lib:copy-spec" ], "files": [ "**/*.ts", diff --git a/web/lib/package.json b/web/lib/package.json index 0bdf8b4ad..3a0ffb21a 100644 --- a/web/lib/package.json +++ b/web/lib/package.json @@ -27,12 +27,12 @@ }, "wireit": { "copy-spec": { - "command": "cp ../../specification/0.8/json/*.json ./src/0.8/schemas", + "command": "mkdir -p src/0.8/schemas && cp ../../specification/0.8/json/*.json src/0.8/schemas", "files": [ - "src/config.prod.js" + "../../specification/0.8/json/*.json" ], "output": [ - "dist/config.js" + "src/0.8/schemas/*.json" ] }, "serve": { @@ -100,4 +100,4 @@ "markdown-it": "^14.1.0", "signal-utils": "^0.21.1" } -} \ No newline at end of file +} diff --git a/web/lib/src/0.8/schemas/.gitignore b/web/lib/src/0.8/schemas/.gitignore new file mode 100644 index 000000000..496d370a3 --- /dev/null +++ b/web/lib/src/0.8/schemas/.gitignore @@ -0,0 +1,4 @@ +# Copied schema files +# (needed for the build but otherwise redundant) +*.json +!server_to_client_with_standard_catalog.json diff --git a/web/package.json b/web/package.json index 448d4cb3c..9adef0c67 100644 --- a/web/package.json +++ b/web/package.json @@ -3,12 +3,8 @@ "private": true, "version": "0.1.0", "description": "AI-first UI Toolkit Demo", - "main": "./dist/index.js", - "scripts": { - "build": "wireit" - }, "repository": { - "directory": "packages/a2ui", + "directory": "web", "type": "git", "url": "git+https://github.com/google/A2UI.git" }, diff --git a/web/restaurant/package.json b/web/restaurant/package.json index 32d79e66c..2d682fc18 100644 --- a/web/restaurant/package.json +++ b/web/restaurant/package.json @@ -39,7 +39,8 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "#build:tsc" + "../lib:build:tsc", + "../lib:copy-spec" ], "files": [ "**/*.ts", diff --git a/web/tests/package.json b/web/tests/package.json index ab751e156..fd4aed2b3 100644 --- a/web/tests/package.json +++ b/web/tests/package.json @@ -37,7 +37,8 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "#build:tsc" + "../lib:build:tsc", + "../lib:copy-spec" ], "files": [ "0.8/**/*.ts", From 059a88c82fdb9653e7d6ebdc7e1e0bca99c2a863 Mon Sep 17 00:00:00 2001 From: Ava Mattie <6314286+ava-cassiopeia@users.noreply.github.com> Date: Fri, 21 Nov 2025 22:59:56 +0000 Subject: [PATCH 2/5] Remove redundant deps --- web/contact/package.json | 3 +-- web/editor/package.json | 3 +-- web/inspector/package.json | 3 +-- web/restaurant/package.json | 3 +-- web/tests/package.json | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/web/contact/package.json b/web/contact/package.json index f6261bab9..f0c101c5e 100644 --- a/web/contact/package.json +++ b/web/contact/package.json @@ -39,8 +39,7 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "../lib:build:tsc", - "../lib:copy-spec" + "../lib:build:tsc" ], "files": [ "**/*.ts", diff --git a/web/editor/package.json b/web/editor/package.json index e94d93bea..0aec0b2e8 100644 --- a/web/editor/package.json +++ b/web/editor/package.json @@ -39,8 +39,7 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "../lib:build", - "../lib:copy-spec" + "../lib:build" ], "files": [ "**/*.ts", diff --git a/web/inspector/package.json b/web/inspector/package.json index 5cfd35898..a7f482910 100644 --- a/web/inspector/package.json +++ b/web/inspector/package.json @@ -39,8 +39,7 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "../lib:build:tsc", - "../lib:copy-spec" + "../lib:build:tsc" ], "files": [ "**/*.ts", diff --git a/web/restaurant/package.json b/web/restaurant/package.json index 2d682fc18..272a96c85 100644 --- a/web/restaurant/package.json +++ b/web/restaurant/package.json @@ -39,8 +39,7 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "../lib:build:tsc", - "../lib:copy-spec" + "../lib:build:tsc" ], "files": [ "**/*.ts", diff --git a/web/tests/package.json b/web/tests/package.json index fd4aed2b3..9fd7df9d9 100644 --- a/web/tests/package.json +++ b/web/tests/package.json @@ -37,8 +37,7 @@ "FORCE_COLOR": "1" }, "dependencies": [ - "../lib:build:tsc", - "../lib:copy-spec" + "../lib:build:tsc" ], "files": [ "0.8/**/*.ts", From a9e8f127f18bbf17fa7905f8065b296458539087 Mon Sep 17 00:00:00 2001 From: Ava Mattie <6314286+ava-cassiopeia@users.noreply.github.com> Date: Fri, 21 Nov 2025 23:12:37 +0000 Subject: [PATCH 3/5] Add very basic GH workflow for web/ --- .github/workflows/web_build_and_test.yml | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/web_build_and_test.yml diff --git a/.github/workflows/web_build_and_test.yml b/.github/workflows/web_build_and_test.yml new file mode 100644 index 000000000..c71996e49 --- /dev/null +++ b/.github/workflows/web_build_and_test.yml @@ -0,0 +1,43 @@ +name: Web directory build and test + +on: + push: + branches: [ main ] + paths: + - 'web/**' + pull_request: + branches: [ main ] + paths: + - 'web/**' + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Cache .wireit + uses: actions/cache@v4 + with: + path: web/.wireit + key: ${{ runner.os }}-wireit-${{ hashFiles('web/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-wireit- + + - name: Install all workspaces' dependencies + working-directory: ./web + run: npm install --workspaces + + - name: Build all workspaces + working-directory: ./web + run: npm run build --workspaces + + - name: Run all tests + working-directory: ./web + run: npm run test --workspace=tests From 548a96b269307b0cc6aaed439d218dcff9cbdc89 Mon Sep 17 00:00:00 2001 From: Ava Mattie <6314286+ava-cassiopeia@users.noreply.github.com> Date: Fri, 21 Nov 2025 23:15:43 +0000 Subject: [PATCH 4/5] Make a trivial change in web/ to trigger the workflow --- web/editor/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/editor/README.md b/web/editor/README.md index a6b522fee..eda8a7c44 100644 --- a/web/editor/README.md +++ b/web/editor/README.md @@ -1,4 +1,4 @@ -# A2UI Generator +# A2UI Editor / Generator This is a UI to generate and visualize A2UI responses. From 2f55e3fe73aaecfe11d154dc79ca4322ce87f3e2 Mon Sep 17 00:00:00 2001 From: Ava Mattie <6314286+ava-cassiopeia@users.noreply.github.com> Date: Fri, 21 Nov 2025 23:22:10 +0000 Subject: [PATCH 5/5] Fix build (caught by workflow!) --- web/editor/client.ts | 2 +- web/editor/middleware/prompts.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/editor/client.ts b/web/editor/client.ts index aee97650d..bdfc62cc2 100644 --- a/web/editor/client.ts +++ b/web/editor/client.ts @@ -18,7 +18,7 @@ import { v0_8 } from "@a2ui/web-lib"; const catalog: v0_8.Types.ClientCapabilitiesDynamic = { components: - v0_8.Schemas.A2UIProtocolMessage["properties"]["surfaceUpdate"][ + v0_8.Schemas.A2UIClientEventMessage["properties"]["surfaceUpdate"][ "properties" ]["components"]["items"]["properties"]["component"]["properties"], styles: {}, diff --git a/web/editor/middleware/prompts.ts b/web/editor/middleware/prompts.ts index 304be21f9..420f3acf4 100644 --- a/web/editor/middleware/prompts.ts +++ b/web/editor/middleware/prompts.ts @@ -98,7 +98,7 @@ export function createA2UIPrompt( `The user's layout request is: "${combinedInstructions.join('" and "')}"`, `The Component Catalog you can use is: ${JSON.stringify(catalog)}`, `The A2UI Protocol Message Schema: "${JSON.stringify( - v0_8.Schemas.A2UIProtocolMessage + v0_8.Schemas.A2UIClientEventMessage )}"`, `Please return a valid A2UI Protocol Message object necessary to build the