Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

store: add Godogen Game Studio with live playable versions

dee26a0fba8a84b
diff --git a/store/agents/godogen/.gitignore b/store/agents/godogen/.gitignore
new file mode 100644
index 000000000..a130a0f42
--- /dev/null
+++ b/store/agents/godogen/.gitignore
@@ -0,0 +1,4 @@
+/upstream/
+/runtime/
+/node_modules/
+test-results/
diff --git a/store/agents/godogen/AGENTS.md b/store/agents/godogen/AGENTS.md
new file mode 100644
index 000000000..5851f5769
--- /dev/null
+++ b/store/agents/godogen/AGENTS.md
@@ -0,0 +1,29 @@
+# Godogen in OpenHarness
+
+You are the game maker in a two-pane studio. The user talks with you on the right. On the left,
+Game Viewer builds their game on each save, shows real progress, and lets them explore and play.
+The time spent making it is part of the experience. Give them something worth watching immediately.
+
+Read `$GODOGEN_RUNTIME/CLAUDE.md` and `$GODOGEN_RUNTIME/babylon.md` for Godogen's workflow, then the
+`studio` skill for this integration. **The viewer is already running.** Its loopback server and
+immutable previews replace upstream's standalone server/capture setup. Do not start another server,
+change its port, open a browser for the user, or replace the studio with another chat interface.
+
+Start by playing with the existing world or replace it for the user's idea. Build one visible step
+at a time: shape, movement, a rule, feedback, polish. Save after each meaningful step so the viewer
+updates. Keep `studio.json` current with the game's actual title, description, and controls.
+
+Use Babylon.js/TypeScript. The pinned tools are already installed. `npm run check` checks types;
+`npm run build` creates a standalone build. Use Godogen's asset-gen skill for generated art when
+the user wants it and has approved the provider spend. Procedural geometry is enough to start;
+never block the first playable result on an image service.
+
+Keep the `harness:ready` event and `window.harnessGame` bridge. Report ready only after the scene
+has rendered and its required assets loaded. Preserve play/explore, pause, restart, and keyboard
+support. Every visible button must work. Do not call the task done based on compilation alone:
+test input, movement, the goal, losing/restarting where appropriate, and browser runtime errors.
+
+Use `.harness/progress.json` for short, truthful progress messages. Do not invent percentages or
+rewrite `.harness/verdict.json`: the viewer writes that from its build and runtime checks.
+Explain creative decisions in chat; the viewer shows the game. Finish with a playable result,
+the controls, and what changed. Keep the user's existing project files and assets.
diff --git a/store/agents/godogen/LICENSE b/store/agents/godogen/LICENSE
new file mode 100644
index 000000000..a499cd17e
--- /dev/null
+++ b/store/agents/godogen/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Autonomous, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/agents/godogen/LICENSE-godogen b/store/agents/godogen/LICENSE-godogen
new file mode 100644
index 000000000..0a0509efc
--- /dev/null
+++ b/store/agents/godogen/LICENSE-godogen
@@ -0,0 +1,9 @@
+The MIT License
+
+Copyright 2026 Alex Ermolov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/store/agents/godogen/README.md b/store/agents/godogen/README.md
new file mode 100644
index 000000000..d8f53660a
--- /dev/null
+++ b/store/agents/godogen/README.md
@@ -0,0 +1,95 @@
+# Godogen · Game Studio
+
+A Babylon.js game workspace using [Godogen](https://github.com/htdt/godogen)'s game-making workflow
+and asset-generation skill. Claude Code runs in the agent pane; Game Viewer builds the workspace
+on each save in the other pane.
+
+The starter, **Alpine Drift**, is a small playable snowboarding course. Orbit the mountain in
+Explore, then switch to Play: steer, jump, collect gates, reach the finish, and restart. Its
+geometry is procedural; opening and changing the starter needs no asset-service account.
+
+Use the desktop app on the machine running this harness. The current app loads viewer URLs
+directly; forwarding a viewer from a linked remote machine is a platform requirement still
+to implement. This limitation also applies to the other local web viewers.
+
+## Use
+
+```sh
+harness dsh install autonomous/godogen
+```
+
+Open Godogen in New Harness and describe the game you want to make. For example:
+
+> Turn this mountain into an autumn forest. Keep the snowboard controls, add a jump ramp,
+> and make the gates easier to see.
+
+The agent saves small steps, updates the progress message, and checks its work. Builds become
+versions only after the browser reports a rendered scene. An error keeps the previous working
+game visible. While you play or inspect an older version, a new version waits behind **View update**.
+The studio log has activity, versions, imported assets, and **Export game**, which writes the
+selected playable build to a new folder under `out/`.
+
+## What is installed
+
+- Godogen's pinned upstream instructions and asset skill, fetched into `upstream/` and rendered
+ into `runtime/`. This wrapper targets Godogen's **Babylon.js** workflow; it does not install
+ Godot or Bevy.
+- Pinned Babylon.js, TypeScript, and Vite, local to this package.
+- The shared `autonomous/game-viewer` dependency, reused if another harness already installed it.
+
+Setup uses the machine's Node or Harness's managed Node; Node 22.12 or newer is required. Its
+small Node publisher renders the same Babylon/Claude documents as upstream's publisher, without
+requiring Python or rsync to install the starter. Git and network access are needed at install.
+Subsequent starter builds use local dependencies.
+
+Generated art is optional. Godogen's asset-generation tools have their own Python dependencies,
+provider credentials, and charges. The agent must establish the provider budget before using them.
+No provider call is required or made by setup.
+
+## Develop
+
+```sh
+harness dsh check "$PWD/store/agents/godogen"
+harness dsh install "$PWD/store/viewers/game-viewer" --link
+harness dsh install "$PWD/store/agents/godogen" --link
+```
+
+The workspace contains `src/main.ts`, `src/style.css`, `index.html`, and `studio.json`.
+`npm run check` checks TypeScript; `npm run build` writes a standalone build to `dist/`.
+Use relative asset URLs so each revision and exported game can run independently.
+
+The `studio` skill documents the viewer bridge and progress file. The viewer owns
+`.harness/verdict.json`; a successful render is a preview check, not proof that every game rule
+works. Play-test the controls, goal, failure, and restart after changing behavior.
+
+Versions and dependencies are in [VERSIONS](VERSIONS) and [package-lock.json](package-lock.json).
+
+### Browser checks
+
+From this package after setup:
+
+```sh
+npm ci
+npm run test:browser
+npx playwright install webkit
+GODOGEN_BROWSER=webkit npm run test:browser
+```
+
+The test creates a disposable workspace and viewer. It exercises controls, a full game loop,
+live source edits, build and runtime failures, version retention, export, and a narrow layout.
+Screenshots go to ignored `test-results/`. Chrome is used if installed on macOS; otherwise
+run `npx playwright install chromium` first. `GAME_VIEWER_DIR` can point at a separate viewer
+checkout; by default the test uses the sibling package in this repository. Browser tooling is
+a development dependency and is omitted by normal harness installation.
+
+## Credit and stewardship
+
+[Godogen](https://github.com/htdt/godogen) is Alex Ermolov's project, licensed under MIT. Its
+instructions and asset-generation tools are fetched unchanged at the commit in `VERSIONS`.
+[LICENSE-godogen](LICENSE-godogen) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) preserve
+its credit.
+
+OpenHarness contributors wrote this wrapper, Game Viewer, and the Alpine Drift starter. This is
+an independent integration, not an upstream endorsement. Wrapper issues belong in OpenHarness;
+Godogen issues belong upstream. Upstream maintainers are welcome to take over the package or
+move it into a repository they maintain.
diff --git a/store/agents/godogen/TESTING.md b/store/agents/godogen/TESTING.md
new file mode 100644
index 000000000..69588faaf
--- /dev/null
+++ b/store/agents/godogen/TESTING.md
@@ -0,0 +1,31 @@
+# Verification
+
+The reproducible browser test is [test/studio.e2e.mjs](test/studio.e2e.mjs). It runs the real
+Babylon.js starter and Vite builds in a disposable workspace. It does not substitute fake
+readiness reports for browser renders.
+
+It checks keyboard steering and jumping, pause and restart, playing through the finish,
+play-again, source updates during a run, syntax errors, browser errors, recovery, selecting
+older versions, a narrow viewport, expand/Escape, and a playable exported static site.
+The single injected runtime error is expected; other uncaught browser errors fail the test.
+
+The shared viewer's Node tests cover readiness gating, build/runtime recovery, retaining a
+running revision beyond the ten-version history, non-overwriting exports, request and path
+boundaries, and metadata updates that preserve readiness.
+
+Installation was exercised through the CLI's real `installDsh` and `materializeWorkspace`
+functions, with a separate temporary package directory and workspace. Setup and doctor passed.
+Both package doctors also passed with Node absent from PATH and only Harness's recorded Node
+available. The wrapper's Node publisher produced the same ten runtime files as Godogen's
+upstream Babylon/Claude publisher.
+
+## Scope
+
+These tests exercise the local agent workspace and the live viewer. They do not run a paid
+asset-generation service or assert the quality of an arbitrary model-generated game. Agent
+chat and the application's terminal transport use the existing platform implementation.
+
+The app's current `WebPanePanel` loads the supplied viewer URL directly. Remote-machine viewer
+forwarding is not implemented there, so opening a remote harness's loopback URL from a different
+desktop is not covered or supported by this package. That requires a shared platform transport,
+not a different server bundled with every harness.
diff --git a/store/agents/godogen/THIRD_PARTY_NOTICES.md b/store/agents/godogen/THIRD_PARTY_NOTICES.md
new file mode 100644
index 000000000..7666aa76c
--- /dev/null
+++ b/store/agents/godogen/THIRD_PARTY_NOTICES.md
@@ -0,0 +1,14 @@
+# Third-party notices
+
+Godogen — Copyright (c) 2026 Alex Ermolov. MIT license; see [LICENSE-godogen](LICENSE-godogen).
+Source: https://github.com/htdt/godogen, commit `05cebffc8b10c5817e8a3db495b82e7b6004ab84`.
+Setup fetches its workflow, Babylon.js guide, and asset-generation skill. The wrapper's Node
+publisher implements the Babylon/Claude portion of Godogen's `publish.sh` and `render_dir.py`;
+the original source remains unchanged in the fetched checkout.
+
+Babylon.js — Apache-2.0. Vite and TypeScript — MIT and Apache-2.0, respectively.
+Their exact package versions and integrity hashes are recorded in `package-lock.json`; npm
+installs their license files with the dependencies. These projects do not endorse this wrapper.
+
+Alpine Drift's terrain, trees, rider, hut, and gates are original procedural geometry written
+for OpenHarness. The starter contains no generated or third-party image, model, or audio assets.
diff --git a/store/agents/godogen/VERSIONS b/store/agents/godogen/VERSIONS
new file mode 100644
index 000000000..10e715f34
--- /dev/null
+++ b/store/agents/godogen/VERSIONS
@@ -0,0 +1,4 @@
+GODOGEN_COMMIT=05cebffc8b10c5817e8a3db495b82e7b6004ab84
+BABYLON=9.26.2
+VITE=6.4.3
+TYPESCRIPT=5.9.3
diff --git a/store/agents/godogen/harness.json b/store/agents/godogen/harness.json
new file mode 100644
index 000000000..cc78d6ed1
--- /dev/null
+++ b/store/agents/godogen/harness.json
@@ -0,0 +1,28 @@
+{
+ "spec": 1,
+ "id": "autonomous/godogen",
+ "name": "Godogen",
+ "category": "Games",
+ "author": "Alex Ermolov",
+ "description": "Build a world you can play. Watch your game take shape in a live studio, explore each version, and play while the agent keeps creating.",
+ "engine": "claude",
+ "workspace": {
+ "template": "template",
+ "marker": "studio.json",
+ "init": "toolchain/init-workspace.mjs"
+ },
+ "agent": {
+ "instructions": "AGENTS.md",
+ "skills": ["skills", "runtime/.claude/skills"],
+ "env": {
+ "GODOGEN_TOOLS": "${dsh}/toolchain",
+ "GODOGEN_RUNTIME": "${dsh}/runtime"
+ }
+ },
+ "toolchain": {
+ "setup": "toolchain/setup.sh",
+ "doctor": "toolchain/doctor.sh"
+ },
+ "viewer": { "use": "autonomous/game-viewer" },
+ "verdict": ".harness/verdict.json"
+}
diff --git a/store/agents/godogen/package-lock.json b/store/agents/godogen/package-lock.json
new file mode 100644
index 000000000..f1ec56bed
--- /dev/null
+++ b/store/agents/godogen/package-lock.json
@@ -0,0 +1,1128 @@
+{
+ "name": "openharness-godogen",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "openharness-godogen",
+ "license": "MIT",
+ "dependencies": {
+ "@babylonjs/core": "9.26.2",
+ "@babylonjs/loaders": "9.26.2",
+ "typescript": "5.9.3",
+ "vite": "6.4.3"
+ },
+ "devDependencies": {
+ "playwright": "1.63.0"
+ }
+ },
+ "node_modules/@babylonjs/core": {
+ "version": "9.26.2",
+ "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-9.26.2.tgz",
+ "integrity": "sha512-9FJZqQrzUpPx74APmzKgdtqdwC/20QYJDQ2lkAnG54SQv60ShTChS2B6btXe1Q36/WmPhZEO+j57WFILs3/KLw==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@babylonjs/loaders": {
+ "version": "9.26.2",
+ "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-9.26.2.tgz",
+ "integrity": "sha512-MQTnJuWcLDxB5mlDQJH/V1S2Cd0aPxVSateiT6c8Ms1+2OkU0/YKrrXJ7Zj4o7S17PuSuQ8TUFAJmceKhtOwbA==",
+ "license": "Apache-2.0",
+ "peerDependencies": {
+ "@babylonjs/core": "^9.0.0",
+ "babylonjs-gltf2interface": "^9.0.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
+ "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
+ "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
+ "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
+ "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
+ "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
+ "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
+ "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
+ "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
+ "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
+ "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
+ "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
+ "cpu": [
+ "loong64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
+ "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
+ "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
+ "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
+ "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
+ "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
+ "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
+ "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
+ "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
+ "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
+ "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
+ "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
+ "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@napi-rs/lzma-linux-x64-gnu": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz",
+ "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^22.20 || ^24.12 || >=25"
+ }
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.3.tgz",
+ "integrity": "sha512-w3Jnvi1ocaVm/c7yVPpfB98XeSRBMyzp6njL5MVVbGyXjpmUkN+s6Hp4t0PqhGCCaI1ZHMKXt/w0lA1RCaLVcw==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.3.tgz",
+ "integrity": "sha512-uI/ESiaIbbRYAEhzy8PCUWDp1hB0bjAqM06mW9flOoNO4Q8DQpeoREhBR5Hegfl+wpXiguyJv6XSPzEN7OxyHQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.3.tgz",
+ "integrity": "sha512-oxhrd1jmXLwWZ83eQYDXxuqRdkqkzrjR3JobKeuUyfdNZo11FuQIvqEOZhyIT7OBHxXoGslDDjN0cQcM6T0TqQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.3.tgz",
+ "integrity": "sha512-7/YiIMghVE8DrxKvNdorAaJVdriOFgOIpdStnPx8ppx5zfTwC3jBCSEAIzB7JD5404m65THl6H93UTTVUvypmg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.3.tgz",
+ "integrity": "sha512-GXFZRRoMAytaI5z6N3Zhfw0WL18Q0M8r95D5hlC4GqE/lGk8pbSJNUBoOWDfbm6dTciqHj2nU87tI5f6XhQiOg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.3.tgz",
+ "integrity": "sha512-77W+8X3ddYgPxUpB8nZFQs2Mq+wc4HVlcSRtApXLjYBcnPMkttrSnU8VwKQjeWYhMsITHFs5cWBQ8vz1Q+5RHQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.3.tgz",
+ "integrity": "sha512-FVkwK+iUC+mq+GipVK46rRVticfAPtvPUNlqlGXUDxdVk/UGjQiiiUVPUrEXdSpU2ufU0XxLGyTqDtBidDOVmg==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.3.tgz",
+ "integrity": "sha512-+aGU1t3398yQOVj1Bz8o3e+KtswxAPvO+mtxtNdfXYMkXIHu7XhhkCD7/DEH9q8tF8uhDnMWvfpUKI8y1sZJsg==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.3.tgz",
+ "integrity": "sha512-cR0kjpRXR2KJ2oQK8E2KTPtphs+b9hZ8IhTZubNryt/RsqgdOZBQ2Zq0q5UedtiIi0rs3jVhJh55RE1ZHUVGUA==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.3.tgz",
+ "integrity": "sha512-y1RYi4Q3/9ByVWSSt9kX2ustE0B7kFYbJ6zZdVZVyqopZs3yhCTwRfrjIX4vezUJInma/Gs6BOFDJg7yZmJ0IQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.3.tgz",
+ "integrity": "sha512-DNhEA5viIj3Z5bZLE4z4oV8N5ozWqDwyt7T6KG7VdLDJ0nW+rNOYlphBl4/3HQkK75qipPLsVOfStHHOwN9WSg==",
+ "cpu": [
+ "loong64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.3.tgz",
+ "integrity": "sha512-17gQCqrIpXBX2Cmi9/TygnVOqGbzsba/iaqcYSL8FY7lNugg+7AiYNs5c5nKWD+NRQha36Sa0CqkJqH4XVHwnQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.3.tgz",
+ "integrity": "sha512-6LwVnZRIyINpdku/yOcI8Tm9YqLmhHK5emmlOOnW9tO0SYEm1FmKPcsSAGp0NBlqR2P04xaND4jvN6sTHqhq8A==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.3.tgz",
+ "integrity": "sha512-xMUqkTXlEUtI/p5AAukMwBRr1enU3efsTeF+bskeFfk8t1C9rcC8sLREcZXmTfAXEbvRdJVSonVJez3TMlbR3w==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.3.tgz",
+ "integrity": "sha512-S3E94co9F9WRRqEaUoQZ38K1gCz6KiM+nL7/3ijq7fDGF3OznjS5TasgYITlvl27GQKtu4lOAOsr5MFwkijvOA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.3.tgz",
+ "integrity": "sha512-1QtRDwG42x5BJI3s9mxu5rEjDnfbSnk20HQ9/ylTAYnSwYwxMVb+Vgu34wzzTQ7ogqBybebgQNUDAvZVQ38DbA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.3.tgz",
+ "integrity": "sha512-BQhejF6ZXOpxbngiNTP12GCGQeaDVL2QXGeBVViKIYzFHM5RKxTxwUMB1fr1BeNFphFMpnRqC5QSXFSa4z6UQw==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.3.tgz",
+ "integrity": "sha512-SXagRwnI2Wlwlitllu59UK/nGVbD1CKPcNqDplHwIC4BqJcpXFjD32d1R/RbuISa95HdQrZM3/7v4bKiowFaLA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.3.tgz",
+ "integrity": "sha512-2IPozoEALRCziGqE8O9KMK60PMu5TS1huv4fwoeCexj+WjmcwFtX9CTOVbfXCUqcELAubEwRFPYlzb/WvwY2HQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.3.tgz",
+ "integrity": "sha512-AoxqosUHT9IX54hFn2TiN6A7d6ZKTtE6pd2bqWtqkkNJ6HJGaU6FRouGX8L1O7R/ZwsnCnpQrHzb4pDEx+UHRQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.3.tgz",
+ "integrity": "sha512-d+CaftKgmkFBzCwezMqqy1d0QNNYugqLCMcYVQWBy5SS2YfeMP8Q8ripkgx9O8IyBXXLHrJ+aaCV4U96usv6Yg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.3.tgz",
+ "integrity": "sha512-xXlDF6nR1eOuXbdDy5Hl5fmtY7teUDevF/k0O7IPoZe4Tpmdv+lgdE5JRsnhQtt37ql9P0VF2kAN9a0OCZdo+Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.3.tgz",
+ "integrity": "sha512-YtXAgLN+JP7Ay6qG3eWhc7IHMQPzLc8r3uvhAvlJIoCz/4Q32+Bl9Fmnywidh8v1GOIMmymjovfqY9ETAtysvA==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.3.tgz",
+ "integrity": "sha512-WuWtSJRNo549vzcfZyEgfqb6zeSgn1F+UE5kQ+BCjzz0W4MGCjntUHkZVc1VRuAM7+ULaSyhiPxD1spyewFvkQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.3.tgz",
+ "integrity": "sha512-+lIKX7O0+IGe7WuhATaAMMeT7B76vfhXH/l9wLQL+nvyhbw2ohYCKIdWL56JfDu75CWt5oKRP4QFH/jkMtBquA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
+ "license": "MIT"
+ },
+ "node_modules/babylonjs-gltf2interface": {
+ "version": "9.26.2",
+ "resolved": "https://registry.npmjs.org/babylonjs-gltf2interface/-/babylonjs-gltf2interface-9.26.2.tgz",
+ "integrity": "sha512-Zwod3rnvOIiU1cKqRCA9pSea/b+vyAhyUJ+CKleiqbBHuwyVabO5KR0Ou3+II8uqPo5l/6HzVJRXNahYFQd9sg==",
+ "license": "Apache-2.0",
+ "peer": true
+ },
+ "node_modules/esbuild": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
+ "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.25.12",
+ "@esbuild/android-arm": "0.25.12",
+ "@esbuild/android-arm64": "0.25.12",
+ "@esbuild/android-x64": "0.25.12",
+ "@esbuild/darwin-arm64": "0.25.12",
+ "@esbuild/darwin-x64": "0.25.12",
+ "@esbuild/freebsd-arm64": "0.25.12",
+ "@esbuild/freebsd-x64": "0.25.12",
+ "@esbuild/linux-arm": "0.25.12",
+ "@esbuild/linux-arm64": "0.25.12",
+ "@esbuild/linux-ia32": "0.25.12",
+ "@esbuild/linux-loong64": "0.25.12",
+ "@esbuild/linux-mips64el": "0.25.12",
+ "@esbuild/linux-ppc64": "0.25.12",
+ "@esbuild/linux-riscv64": "0.25.12",
+ "@esbuild/linux-s390x": "0.25.12",
+ "@esbuild/linux-x64": "0.25.12",
+ "@esbuild/netbsd-arm64": "0.25.12",
+ "@esbuild/netbsd-x64": "0.25.12",
+ "@esbuild/openbsd-arm64": "0.25.12",
+ "@esbuild/openbsd-x64": "0.25.12",
+ "@esbuild/openharmony-arm64": "0.25.12",
+ "@esbuild/sunos-x64": "0.25.12",
+ "@esbuild/win32-arm64": "0.25.12",
+ "@esbuild/win32-ia32": "0.25.12",
+ "@esbuild/win32-x64": "0.25.12"
+ }
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.19",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz",
+ "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",
+ "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/playwright": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz",
+ "integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "playwright-core": "1.63.0"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/playwright-core": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz",
+ "integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "playwright-core": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.28",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz",
+ "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.18",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "4.63.3",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.3.tgz",
+ "integrity": "sha512-1i2XreiAoMMXuPGD6Msj2xWrMMkHojNRKivInxGQcg7/1KuPuYlfUutLyh4drnOxUTHX9cHI4wFoat8D/NKaBw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.9"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@napi-rs/lzma-linux-x64-gnu": "1.5.1",
+ "@rollup/rollup-android-arm-eabi": "4.63.3",
+ "@rollup/rollup-android-arm64": "4.63.3",
+ "@rollup/rollup-darwin-arm64": "4.63.3",
+ "@rollup/rollup-darwin-x64": "4.63.3",
+ "@rollup/rollup-freebsd-arm64": "4.63.3",
+ "@rollup/rollup-freebsd-x64": "4.63.3",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.63.3",
+ "@rollup/rollup-linux-arm-musleabihf": "4.63.3",
+ "@rollup/rollup-linux-arm64-gnu": "4.63.3",
+ "@rollup/rollup-linux-arm64-musl": "4.63.3",
+ "@rollup/rollup-linux-loong64-gnu": "4.63.3",
+ "@rollup/rollup-linux-loong64-musl": "4.63.3",
+ "@rollup/rollup-linux-ppc64-gnu": "4.63.3",
+ "@rollup/rollup-linux-ppc64-musl": "4.63.3",
+ "@rollup/rollup-linux-riscv64-gnu": "4.63.3",
+ "@rollup/rollup-linux-riscv64-musl": "4.63.3",
+ "@rollup/rollup-linux-s390x-gnu": "4.63.3",
+ "@rollup/rollup-linux-x64-gnu": "4.63.3",
+ "@rollup/rollup-linux-x64-musl": "4.63.3",
+ "@rollup/rollup-openbsd-x64": "4.63.3",
+ "@rollup/rollup-openharmony-arm64": "4.63.3",
+ "@rollup/rollup-win32-arm64-msvc": "4.63.3",
+ "@rollup/rollup-win32-ia32-msvc": "4.63.3",
+ "@rollup/rollup-win32-x64-gnu": "4.63.3",
+ "@rollup/rollup-win32-x64-msvc": "4.63.3",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.17",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/vite": {
+ "version": "6.4.3",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz",
+ "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==",
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "^0.25.0",
+ "fdir": "^6.4.4",
+ "picomatch": "^4.0.2",
+ "postcss": "^8.5.3",
+ "rollup": "^4.34.9",
+ "tinyglobby": "^0.2.13"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+ "jiti": ">=1.21.0",
+ "less": "*",
+ "lightningcss": "^1.21.0",
+ "sass": "*",
+ "sass-embedded": "*",
+ "stylus": "*",
+ "sugarss": "*",
+ "terser": "^5.16.0",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ }
+ }
+}
diff --git a/store/agents/godogen/package.json b/store/agents/godogen/package.json
new file mode 100644
index 000000000..11cf819b4
--- /dev/null
+++ b/store/agents/godogen/package.json
@@ -0,0 +1,18 @@
+{
+ "name": "openharness-godogen",
+ "private": true,
+ "type": "module",
+ "license": "MIT",
+ "dependencies": {
+ "@babylonjs/core": "9.26.2",
+ "@babylonjs/loaders": "9.26.2",
+ "typescript": "5.9.3",
+ "vite": "6.4.3"
+ },
+ "devDependencies": {
+ "playwright": "1.63.0"
+ },
+ "scripts": {
+ "test:browser": "node test/studio.e2e.mjs"
+ }
+}
diff --git a/store/agents/godogen/screenshots/explore.png b/store/agents/godogen/screenshots/explore.png
new file mode 100644
index 000000000..47b08c65d
Binary files /dev/null and b/store/agents/godogen/screenshots/explore.png differ
diff --git a/store/agents/godogen/screenshots/play.png b/store/agents/godogen/screenshots/play.png
new file mode 100644
index 000000000..a04da50b3
Binary files /dev/null and b/store/agents/godogen/screenshots/play.png differ
diff --git a/store/agents/godogen/skills/studio/SKILL.md b/store/agents/godogen/skills/studio/SKILL.md
new file mode 100644
index 000000000..9ffff2de4
--- /dev/null
+++ b/store/agents/godogen/skills/studio/SKILL.md
@@ -0,0 +1,44 @@
+---
+name: studio
+description: Build and verify a Babylon.js game progressively in OpenHarness's live Game Viewer.
+---
+
+# The live game studio
+
+The viewer compiles saves into isolated versions. A broken edit cannot replace the last working
+game. While the user plays, a new version waits behind **View update** so it never resets their run.
+
+## Loop
+
+1. Update `.harness/progress.json`: `{"phase":"world","message":"Shaping the mountain"}`.
+ Phases are `concept`, `world`, `play`, `polish`, `check`. Report real work, with no invented timings.
+2. Edit `src/`, `public/`, and `index.html`. The viewer watches these files. Import generated assets
+ using Vite URLs (`import treeUrl from './assets/tree.glb?url'`); avoid absolute `/assets/` paths.
+3. After every small milestone, `npm run check`. Inspect the preview, then test the game.
+4. `node "$GODOGEN_TOOLS/check.mjs"` checks the actual viewer's current build/runtime state.
+ It requires an open viewer. Its success means the preview rendered without reported errors;
+ it does not replace gameplay testing. Never fabricate a successful runtime report.
+
+## Bridge
+
+Define `window.harnessGame` with `setMode('explore'|'play')`, `setPaused(boolean)`, `restart()`,
+and `stats()` returning real values. `stats()` may include `fps`, `objects`, `score`, `distance`.
+The starter demonstrates all of these. After the first successful render, dispatch
+`new CustomEvent('harness:ready')`. Game Viewer captures errors before that event and keeps the
+previous version visible. Do not remove the error bridge or signal success before rendering.
+
+Keyboard listeners should use `event.code`, release input on blur, and prevent arrow/space scroll
+only when the game has focus. Progress must use elapsed seconds, not an assumed frame rate.
+Respect pause, reduce motion, and audio muting. Use clear focus styles and readable contrast.
+
+## Project facts
+
+`studio.json` contains `title`, `description`, and `controls` (short text). Keep those accurate.
+Put the current brief, completed features, remaining work, and asset attribution in `README.md`.
+For external services, get the user's budget before the first paid generation and retain provenance.
+
+## Verification
+
+Use browser capture on the running preview. Exercise Play, movement, restart, and a full game loop.
+Check the canvas is nonblank, there are no runtime errors, and controls also work at a narrow size.
+Finish by setting phase `check` with a factual message describing the checks that actually passed.
diff --git a/store/agents/godogen/store.json b/store/agents/godogen/store.json
new file mode 100644
index 000000000..d916f0428
--- /dev/null
+++ b/store/agents/godogen/store.json
@@ -0,0 +1,9 @@
+{
+ "homepage": "https://github.com/htdt/godogen",
+ "upstream": "https://github.com/htdt/godogen",
+ "license": "MIT",
+ "screenshots": [
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/agents/godogen/screenshots/explore.png",
+ "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/agents/godogen/screenshots/play.png"
+ ]
+}
diff --git a/store/agents/godogen/template/.gitignore b/store/agents/godogen/template/.gitignore
new file mode 100644
index 000000000..730880ba4
--- /dev/null
+++ b/store/agents/godogen/template/.gitignore
@@ -0,0 +1,4 @@
+node_modules/
+dist/
+.harness/
+out/
diff --git a/store/agents/godogen/template/README.md b/store/agents/godogen/template/README.md
new file mode 100644
index 000000000..4112d6884
--- /dev/null
+++ b/store/agents/godogen/template/README.md
@@ -0,0 +1,20 @@
+# Alpine Drift
+
+A small Babylon.js snowboarding world to explore, play, and change with Godogen.
+Press Play in Game Studio. A / D or left / right carve, Space jumps, W accelerates, S brakes,
+and R restarts. Collect six gates before the finish. Trees can end a run; jump over them or turn.
+
+Everything in this starter is procedural: terrain, trees, rider, hut, and gates. No asset-service
+credentials are needed. Original OpenHarness starter code, MIT licensed.
+
+## Files
+
+- `src/main.ts`: world geometry, controls, gameplay, and the viewer bridge.
+- `src/style.css`: the in-game HUD and finish screen.
+- `studio.json`: project name and controls shown in the studio.
+
+`npm run check` checks TypeScript. `npm run build` writes a standalone game in `dist/`.
+Game Studio builds every save, preserves the previous working version on errors, and records
+playable versions. Export copies the selected build into `out/` for you to host with a static server.
+
+Try changing the season, adding a jump ramp, making another course, or replacing this with your own game.
diff --git a/store/agents/godogen/template/index.html b/store/agents/godogen/template/index.html
new file mode 100644
index 000000000..e79d4f15d
--- /dev/null
+++ b/store/agents/godogen/template/index.html
@@ -0,0 +1,43 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
+ <title>Alpine Drift</title>
+ </head>
+ <body>
+ <canvas id="world" aria-label="Alpine mountain game" tabindex="0"></canvas>
+ <div id="intro" class="intro">
+ <span>FIRST TRACKS</span>
+ <h1>A little mountain.<br />A lot of possibilities.</h1>
+ <p>
+ Explore the world, then press Play in the studio.<br />Carve through six
+ golden gates on your way down.
+ </p>
+ </div>
+ <div id="hud" class="hud" hidden>
+ <div>
+ <span>GATES</span><b id="gates">0 <small>/ 6</small></b>
+ </div>
+ <div>
+ <span>DISTANCE</span><b id="distance">0<small> m</small></b>
+ </div>
+ <div>
+ <span>TIME</span><b id="time">0.0<small> s</small></b>
+ </div>
+ </div>
+ <div id="end" class="end" hidden>
+ <span id="end-label">THE FINISH LINE</span>
+ <h2 id="end-title">Fresh tracks.</h2>
+ <p id="end-summary"></p>
+ <button id="again">One more run ↗</button>
+ </div>
+ <div id="touch" class="touch" hidden>
+ <button data-key="ArrowLeft" aria-label="Carve left">←</button
+ ><button data-key="Space" aria-label="Jump">Jump</button
+ ><button data-key="ArrowRight" aria-label="Carve right">→</button>
+ </div>
+ <div id="pause-label" class="pause-label" hidden>Paused</div>
+ <script type="module" src="/src/main.ts"></script>
+ </body>
+</html>
diff --git a/store/agents/godogen/template/package.json b/store/agents/godogen/template/package.json
new file mode 100644
index 000000000..adada8b30
--- /dev/null
+++ b/store/agents/godogen/template/package.json
@@ -0,0 +1,18 @@
+{
+ "name": "my-godogen-world",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "dev": "vite --host 127.0.0.1",
+ "build": "vite build --base ./",
+ "check": "tsc --noEmit"
+ },
+ "dependencies": {
+ "@babylonjs/core": "9.26.2",
+ "@babylonjs/loaders": "9.26.2"
+ },
+ "devDependencies": {
+ "typescript": "5.9.3",
+ "vite": "6.4.3"
+ }
+}
diff --git a/store/agents/godogen/template/src/main.ts b/store/agents/godogen/template/src/main.ts
new file mode 100644
index 000000000..ff867adc3
--- /dev/null
+++ b/store/agents/godogen/template/src/main.ts
@@ -0,0 +1,540 @@
+import "./style.css";
+import { Engine } from "@babylonjs/core/Engines/engine";
+import { Scene } from "@babylonjs/core/scene";
+import { ArcRotateCamera } from "@babylonjs/core/Cameras/arcRotateCamera";
+import { Vector3 } from "@babylonjs/core/Maths/math.vector";
+import { Color3, Color4 } from "@babylonjs/core/Maths/math.color";
+import { HemisphericLight } from "@babylonjs/core/Lights/hemisphericLight";
+import { DirectionalLight } from "@babylonjs/core/Lights/directionalLight";
+import { StandardMaterial } from "@babylonjs/core/Materials/standardMaterial";
+import { MeshBuilder } from "@babylonjs/core/Meshes/meshBuilder";
+import { Mesh } from "@babylonjs/core/Meshes/mesh";
+import { VertexData } from "@babylonjs/core/Meshes/mesh.vertexData";
+import { TransformNode } from "@babylonjs/core/Meshes/transformNode";
+import { ShadowGenerator } from "@babylonjs/core/Lights/Shadows/shadowGenerator";
+import "@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent";
+import "@babylonjs/core/Rendering/outlineRenderer";
+
+type Mode = "explore" | "play";
+declare global {
+ interface Window {
+ harnessGame: {
+ setMode: (value: Mode) => void;
+ setPaused: (value: boolean) => void;
+ restart: () => void;
+ stats: () => Record<string, string | number>;
+ };
+ }
+}
+const $ = (id: string) => document.getElementById(id)!;
+const canvas = $("world") as HTMLCanvasElement;
+const engine = new Engine(canvas, true, {
+ preserveDrawingBuffer: true,
+ stencil: true,
+ antialias: true,
+});
+engine.setHardwareScalingLevel(1 / Math.min(devicePixelRatio || 1, 1.5));
+const scene = new Scene(engine);
+scene.clearColor = new Color4(0.76, 0.87, 0.86, 1);
+scene.fogMode = Scene.FOGMODE_EXP2;
+scene.fogDensity = 0.0037;
+scene.fogColor = new Color3(0.76, 0.87, 0.86);
+const camera = new ArcRotateCamera(
+ "Studio camera",
+ -Math.PI / 2.8,
+ 1.05,
+ 160,
+ new Vector3(0, 4, 22),
+ scene,
+);
+camera.lowerRadiusLimit = 24;
+camera.upperRadiusLimit = 270;
+camera.lowerBetaLimit = 0.25;
+camera.upperBetaLimit = 1.45;
+camera.wheelPrecision = 9;
+camera.pinchPrecision = 90;
+camera.panningSensibility = 100;
+camera.minZ = 0.1;
+camera.maxZ = 1000;
+camera.attachControl(canvas, true);
+const ambient = new HemisphericLight("Sky", new Vector3(0, 1, 0), scene);
+ambient.intensity = 0.8;
+ambient.groundColor = new Color3(0.22, 0.4, 0.39);
+const sun = new DirectionalLight(
+ "Afternoon sun",
+ new Vector3(-0.6, -1, 0.35),
+ scene,
+);
+sun.position = new Vector3(80, 130, -70);
+sun.intensity = 1.35;
+sun.diffuse = new Color3(1, 0.94, 0.8);
+const shadows = new ShadowGenerator(1024, sun);
+shadows.useBlurExponentialShadowMap = true;
+shadows.blurKernel = 24;
+shadows.darkness = 0.28;
+function material(name: string, hex: string) {
+ const mat = new StandardMaterial(name, scene);
+ mat.diffuseColor = Color3.FromHexString(hex);
+ mat.specularColor = new Color3(0.05, 0.05, 0.05);
+ return mat;
+}
+const snow = material("Fresh snow", "#e6f0e4"),
+ pine = material("Pine needles", "#397674"),
+ pineDark = material("Forest shadows", "#235955"),
+ bark = material("Tree trunks", "#6a7462");
+const stone = material("Blue granite", "#90aaa5"),
+ sunny = material("Golden gates", "#ebaf53"),
+ cloth = material("Ochre jacket", "#f0ae48"),
+ dark = material("Deep teal", "#204b4e");
+const red = material("Coral flags", "#db795d"),
+ white = material("Warm white", "#f8f6df");
+sunny.emissiveColor = new Color3(0.16, 0.09, 0.01);
+const groundY = (x: number, z: number) =>
+ 10 -
+ (z + 115) * 0.045 +
+ Math.sin(z * 0.026) * 1.3 +
+ Math.pow(Math.abs(x) / 65, 2) * 12;
+let seed = 42;
+const random = () => {
+ seed = (seed * 1664525 + 1013904223) >>> 0;
+ return seed / 4294967296;
+};
+const terrain = new Mesh("The mountain", scene),
+ positions: number[] = [],
+ indices: number[] = [],
+ normals: number[] = [];
+const nx = 30,
+ nz = 60;
+for (let z = 0; z <= nz; z++)
+ for (let x = 0; x <= nx; x++) {
+ const px = (x / nx - 0.5) * 160,
+ pz = (z / nz) * 330 - 135;
+ positions.push(px, groundY(px, pz), pz);
+ }
+for (let z = 0; z < nz; z++)
+ for (let x = 0; x < nx; x++) {
+ const a = z * (nx + 1) + x,
+ b = a + nx + 1;
+ indices.push(a, a + 1, b, a + 1, b + 1, b);
+ }
+VertexData.ComputeNormals(positions, indices, normals);
+const data = new VertexData();
+data.positions = positions;
+data.indices = indices;
+data.normals = normals;
+data.applyToMesh(terrain);
+terrain.material = snow;
+terrain.receiveShadows = true;
+function box(
+ name: string,
+ size: [number, number, number],
+ position: Vector3,
+ mat: StandardMaterial,
+ parent?: TransformNode,
+) {
+ const mesh = MeshBuilder.CreateBox(
+ name,
+ { width: size[0], height: size[1], depth: size[2] },
+ scene,
+ );
+ mesh.position = position;
+ mesh.material = mat;
+ if (parent) mesh.parent = parent;
+ shadows.addShadowCaster(mesh);
+ return mesh;
+}
+const obstacles: { x: number; z: number; r: number }[] = [];
+function tree(x: number, z: number, size: number, obstacle = false) {
+ const y = groundY(x, z),
+ trunk = MeshBuilder.CreateCylinder(
+ "Pine trunk",
+ { height: size * 0.45, diameter: size * 0.13, tessellation: 5 },
+ scene,
+ );
+ trunk.position.set(x, y + size * 0.2, z);
+ trunk.material = bark;
+ for (let level = 0; level < 3; level++) {
+ const crown = MeshBuilder.CreateCylinder(
+ "Pine canopy",
+ {
+ height: size * 0.67,
+ diameterTop: 0,
+ diameterBottom: size * (0.65 - level * 0.14),
+ tessellation: 6,
+ },
+ scene,
+ );
+ crown.position.set(x, y + size * (0.43 + level * 0.24), z);
+ crown.material = level === 2 ? pine : pineDark;
+ crown.rotation.y = random();
+ shadows.addShadowCaster(crown);
+ }
+ if (obstacle) obstacles.push({ x, z, r: size * 0.22 });
+}
+for (let i = 0; i < 95; i++) {
+ const z = -125 + random() * 310,
+ side = i % 2 ? 1 : -1,
+ x = side * (18 + random() * 45);
+ tree(x, z, 4 + random() * 7);
+}
+for (const [x, z] of [
+ [-12, -48],
+ [11, -12],
+ [-11, 47],
+ [12, 86],
+ [-12, 116],
+])
+ tree(x, z, 5, true);
+for (let i = 0; i < 22; i++) {
+ const x = (i % 2 ? 1 : -1) * (25 + random() * 48),
+ z = -130 + random() * 320;
+ const rock = MeshBuilder.CreateIcoSphere(
+ "Glacial rock",
+ { radius: 1 + random() * 3, subdivisions: 1, flat: true },
+ scene,
+ );
+ rock.position.set(x, groundY(x, z), z);
+ rock.scaling.y = 0.65;
+ rock.material = stone;
+ shadows.addShadowCaster(rock);
+}
+for (const [x, z, height, width] of [
+ [-96, 143, 78, 130],
+ [88, 192, 100, 140],
+ [-36, 230, 120, 170],
+ [142, 84, 76, 115],
+ [-123, -65, 88, 130],
+]) {
+ const baseY = groundY(x * 0.4, z);
+ const mountain = MeshBuilder.CreateCylinder(
+ "Distant peak",
+ { height, diameterTop: 0, diameterBottom: width, tessellation: 5 },
+ scene,
+ );
+ mountain.position.set(x, baseY + height / 2 - 12, z);
+ mountain.material = stone;
+ mountain.rotation.y = 0.4;
+ const cap = MeshBuilder.CreateCylinder(
+ "Snow cap",
+ {
+ height: height * 0.4,
+ diameterTop: 0,
+ diameterBottom: width * 0.4,
+ tessellation: 5,
+ },
+ scene,
+ );
+ cap.position.set(x, baseY + height * 0.8 - 12, z);
+ cap.material = snow;
+ cap.rotation.y = 0.4;
+}
+// The start hut and flags make the course readable from the orbit camera.
+const hut = new TransformNode("Mountain hut", scene);
+hut.position.set(-15, groundY(-15, -99), -99);
+box("Cabin", [7, 4, 5], new Vector3(0, 2, 0), dark, hut);
+const roof = MeshBuilder.CreateCylinder(
+ "Snow roof",
+ { height: 8, diameter: 7, tessellation: 3 },
+ scene,
+);
+roof.rotation.z = Math.PI / 2;
+roof.rotation.x = Math.PI / 2;
+roof.position.set(0, 4.5, 0);
+roof.parent = hut;
+roof.material = snow;
+shadows.addShadowCaster(roof);
+box("Door", [1.7, 2.6, 0.1], new Vector3(0, 1.3, -2.56), sunny, hut);
+box("Window", [1.5, 1.3, 0.12], new Vector3(2, 2.4, -2.6), white, hut);
+function flag(x: number, z: number, finish = false) {
+ const y = groundY(x, z);
+ box("Flag pole", [0.16, 5, 0.16], new Vector3(x, y + 2.5, z), dark);
+ box(
+ finish ? "Finish pennant" : "Trail pennant",
+ [1.8, 1, 0.08],
+ new Vector3(x + 0.85, y + 4.15, z),
+ finish ? dark : red,
+ );
+}
+flag(-7, -100);
+flag(7, -100);
+flag(-8, 144, true);
+flag(8, 144, true);
+const finish = box(
+ "Finish banner",
+ [16, 0.8, 0.1],
+ new Vector3(0, groundY(0, 144) + 4.5, 144),
+ dark,
+);
+const gates: { mesh: Mesh; x: number; z: number; taken: boolean }[] = [];
+for (let i = 0; i < 6; i++) {
+ const x = Math.sin(i * 1.55) * 7,
+ z = -67 + i * 37;
+ const mesh = MeshBuilder.CreateTorus(
+ `Gate ${i + 1}`,
+ { diameter: 4.1, thickness: 0.23, tessellation: 32 },
+ scene,
+ );
+ mesh.rotation.x = Math.PI / 2;
+ mesh.position.set(x, groundY(x, z) + 2.1, z);
+ mesh.material = sunny;
+ gates.push({ mesh, x, z, taken: false });
+}
+const rider = new TransformNode("Rider", scene);
+const board = box(
+ "Snowboard",
+ [1.15, 0.14, 2.8],
+ new Vector3(0, 0.18, 0),
+ red,
+ rider,
+);
+board.rotation.y = 0.18;
+box(
+ "Back leg",
+ [0.35, 0.8, 0.35],
+ new Vector3(-0.22, 0.65, -0.45),
+ dark,
+ rider,
+);
+box("Front leg", [0.35, 0.8, 0.35], new Vector3(0.22, 0.65, 0.35), dark, rider);
+const torso = box(
+ "Jacket",
+ [0.95, 1, 0.58],
+ new Vector3(0, 1.45, 0),
+ cloth,
+ rider,
+);
+torso.rotation.z = -0.13;
+const head = MeshBuilder.CreateSphere(
+ "Helmet",
+ { diameter: 0.68, segments: 8 },
+ scene,
+);
+head.parent = rider;
+head.position.set(0, 2.22, 0);
+head.material = dark;
+shadows.addShadowCaster(head);
+box("Goggles", [0.6, 0.18, 0.12], new Vector3(0, 2.23, 0.29), sunny, rider);
+const arm1 = box(
+ "Left sleeve",
+ [0.35, 0.9, 0.35],
+ new Vector3(-0.65, 1.48, 0),
+ cloth,
+ rider,
+);
+arm1.rotation.z = -0.8;
+const arm2 = box(
+ "Right sleeve",
+ [0.35, 0.9, 0.35],
+ new Vector3(0.65, 1.48, 0),
+ cloth,
+ rider,
+);
+arm2.rotation.z = 0.8;
+const keys = new Set<string>();
+let mode: Mode = "explore",
+ paused = false,
+ running = true,
+ x = 0,
+ z = -95,
+ vx = 0,
+ jump = 0,
+ jumpVelocity = 0,
+ elapsed = 0,
+ score = 0,
+ ready = false;
+let outcome = "running";
+function hud() {
+ $("gates").innerHTML = `${score} <small>/ 6</small>`;
+ $("distance").innerHTML =
+ `${Math.max(0, Math.floor(z + 95))}<small> m</small>`;
+ $("time").innerHTML = `${elapsed.toFixed(1)}<small> s</small>`;
+}
+function reset() {
+ x = 0;
+ z = -95;
+ vx = 0;
+ jump = 0;
+ jumpVelocity = 0;
+ elapsed = 0;
+ score = 0;
+ running = true;
+ outcome = "running";
+ keys.clear();
+ rider.rotation.set(0, 0, 0);
+ $("end").hidden = true;
+ for (const gate of gates) {
+ gate.taken = false;
+ gate.mesh.isVisible = true;
+ }
+ hud();
+ positionRider();
+}
+function positionRider() {
+ rider.position.set(x, groundY(x, z) + jump, z);
+}
+function end(crashed: boolean) {
+ running = false;
+ outcome = crashed ? "crashed" : "finished";
+ keys.clear();
+ $("end-label").textContent = crashed ? "A FRESH START" : "THE FINISH LINE";
+ $("end-title").textContent = crashed ? "Found a tree." : "Fresh tracks.";
+ $("end-summary").textContent =
+ `${score} of 6 gates · ${elapsed.toFixed(1)} seconds`;
+ $("end").hidden = false;
+ if (crashed) rider.rotation.z = 1.1;
+}
+function setMode(value: Mode) {
+ mode = value;
+ keys.clear();
+ $("intro").hidden = value === "play";
+ $("hud").hidden = value !== "play";
+ $("touch").hidden = value !== "play";
+ if (value === "play") {
+ camera.detachControl();
+ if (!running) reset();
+ } else {
+ camera.attachControl(canvas, true);
+ camera.setTarget(new Vector3(0, 4, 22));
+ camera.alpha = -Math.PI / 2.8;
+ camera.beta = 1.05;
+ camera.radius = 160;
+ $("end").hidden = true;
+ }
+}
+function setPaused(value: boolean) {
+ paused = value;
+ keys.clear();
+ $("pause-label").hidden = !value;
+}
+function handleKey(event: KeyboardEvent, down: boolean) {
+ if (mode !== "play") return;
+ if (
+ [
+ "ArrowLeft",
+ "ArrowRight",
+ "ArrowUp",
+ "ArrowDown",
+ "Space",
+ "KeyA",
+ "KeyD",
+ "KeyW",
+ "KeyS",
+ "KeyR",
+ ].includes(event.code)
+ ) {
+ event.preventDefault();
+ if (down) {
+ keys.add(event.code);
+ if (event.code === "KeyR") reset();
+ if (event.code === "Space" && jump === 0 && running && !paused)
+ jumpVelocity = 8.6;
+ } else keys.delete(event.code);
+ }
+}
+addEventListener("keydown", (event) => handleKey(event, true));
+addEventListener("keyup", (event) => handleKey(event, false));
+addEventListener("blur", () => keys.clear());
+for (const button of document.querySelectorAll<HTMLButtonElement>(
+ "[data-key]",
+)) {
+ button.onpointerdown = (event) => {
+ event.preventDefault();
+ button.setPointerCapture(event.pointerId);
+ const code = button.dataset.key!;
+ keys.add(code);
+ if (code === "Space" && jump === 0 && running && !paused)
+ jumpVelocity = 8.6;
+ };
+ button.onpointerup = button.onpointercancel = () =>
+ keys.delete(button.dataset.key!);
+}
+$("again").onclick = () => {
+ reset();
+ canvas.focus();
+};
+const reducedMotion = matchMedia("(prefers-reduced-motion: reduce)").matches;
+scene.onBeforeRenderObservable.add(() => {
+ const dt = Math.min(engine.getDeltaTime() / 1000, 0.05);
+ if (mode === "play" && running && !paused) {
+ elapsed += dt;
+ const steer =
+ (keys.has("ArrowRight") || keys.has("KeyD") ? 1 : 0) -
+ (keys.has("ArrowLeft") || keys.has("KeyA") ? 1 : 0);
+ vx += (steer * 11 - vx) * Math.min(dt * 7, 1);
+ x = Math.max(-15, Math.min(15, x + vx * dt));
+ const speed =
+ keys.has("ArrowDown") || keys.has("KeyS")
+ ? 8
+ : keys.has("ArrowUp") || keys.has("KeyW")
+ ? 23
+ : 15;
+ z += speed * dt;
+ jumpVelocity -= 20 * dt;
+ jump = Math.max(0, jump + jumpVelocity * dt);
+ if (jump === 0) jumpVelocity = 0;
+ rider.rotation.y = vx * 0.045;
+ rider.rotation.z = -vx * 0.025;
+ positionRider();
+ for (const gate of gates)
+ if (
+ !gate.taken &&
+ Math.abs(z - gate.z) < 2.4 &&
+ Math.abs(x - gate.x) < 2.5
+ ) {
+ gate.taken = true;
+ gate.mesh.isVisible = false;
+ score++;
+ }
+ if (
+ jump < 1.5 &&
+ obstacles.some(
+ (item) => Math.hypot(x - item.x, z - item.z) < item.r + 0.55,
+ )
+ )
+ end(true);
+ if (z >= 146) end(false);
+ hud();
+ }
+ if (mode === "play") {
+ const target = new Vector3(x, groundY(x, z) + 2, z + 7);
+ camera.setTarget(Vector3.Lerp(camera.target, target, Math.min(dt * 6, 1)));
+ camera.alpha = -Math.PI / 2;
+ camera.beta = 1.03;
+ camera.radius = 20;
+ }
+ if (!paused && !reducedMotion)
+ for (const gate of gates)
+ if (!gate.taken)
+ gate.mesh.rotation.z =
+ Math.sin(performance.now() * 0.0009 + gate.z) * 0.045;
+});
+window.harnessGame = {
+ setMode,
+ setPaused,
+ restart: reset,
+ stats: () => ({
+ fps: engine.getFps(),
+ objects: scene.meshes.length,
+ score,
+ distance: Math.max(0, z + 95),
+ positionX: x,
+ jumpHeight: jump,
+ time: elapsed,
+ mode,
+ state: outcome,
+ }),
+};
+reset();
+engine.runRenderLoop(() => {
+ scene.render();
+ if (!ready && scene.isReady()) {
+ ready = true;
+ dispatchEvent(new CustomEvent("harness:ready"));
+ }
+});
+addEventListener("resize", () => engine.resize());
+// Standalone exports start in play mode; the studio chooses the mode when embedded.
+if (parent === window) {
+ setMode("play");
+ canvas.focus();
+}
diff --git a/store/agents/godogen/template/src/style.css b/store/agents/godogen/template/src/style.css
new file mode 100644
index 000000000..37e5115c7
--- /dev/null
+++ b/store/agents/godogen/template/src/style.css
@@ -0,0 +1,185 @@
+* {
+ box-sizing: border-box;
+}
+html,
+body {
+ margin: 0;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ background: #cce0df;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
+ color: #1c3c41;
+}
+canvas {
+ display: block;
+ width: 100%;
+ height: 100%;
+ touch-action: none;
+ outline: none;
+}
+canvas:focus-visible {
+ outline: 2px solid #c77a40;
+ outline-offset: -3px;
+}
+[hidden] {
+ display: none !important;
+}
+.intro {
+ position: absolute;
+ left: 30px;
+ bottom: 28px;
+ pointer-events: none;
+ text-shadow: 0 1px 15px #eef6ed99;
+}
+.intro > span,
+.end > span {
+ font-size: 9px;
+ letter-spacing: 2.5px;
+ font-weight: 700;
+ color: #477a79;
+}
+.intro h1 {
+ font-size: clamp(23px, 3.8vw, 41px);
+ letter-spacing: -1.5px;
+ line-height: 1.08;
+ margin: 10px 0 12px;
+ font-weight: 600;
+}
+.intro p {
+ font-size: 11px;
+ line-height: 1.65;
+ color: #42666b;
+ margin: 0;
+}
+.hud {
+ position: absolute;
+ top: 17px;
+ left: 18px;
+ display: flex;
+ gap: 24px;
+ padding: 13px 18px;
+ background: #edf7eae6;
+ border: 1px solid #ffffffb0;
+ border-radius: 10px;
+ box-shadow: 0 5px 20px #33564f0d;
+ pointer-events: none;
+}
+.hud > div {
+ display: flex;
+ flex-direction: column;
+ gap: 5px;
+}
+.hud span {
+ font-size: 8px;
+ letter-spacing: 1.8px;
+ color: #61847f;
+}
+.hud b {
+ font-size: 22px;
+ font-variant-numeric: tabular-nums;
+ font-weight: 600;
+ letter-spacing: -0.8px;
+}
+.hud small {
+ font-size: 11px;
+ font-weight: 500;
+ color: #75938c;
+ letter-spacing: 0;
+}
+.end {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ background: #f4f8eefa;
+ padding: 30px 38px;
+ text-align: center;
+ border: 1px solid #fff;
+ border-radius: 15px;
+ box-shadow: 0 15px 70px #214b4d33;
+ min-width: 270px;
+ backdrop-filter: blur(12px);
+}
+.end h2 {
+ font-size: 35px;
+ letter-spacing: -1.3px;
+ margin: 12px 0 8px;
+ font-weight: 550;
+}
+.end p {
+ font-size: 12px;
+ color: #547772;
+ line-height: 1.6;
+ margin: 0 0 22px;
+}
+.end button {
+ border: 0;
+ border-radius: 7px;
+ background: #285b51;
+ color: #e7f8e9;
+ font: inherit;
+ font-size: 12px;
+ padding: 12px 18px;
+ cursor: pointer;
+}
+.end button:hover {
+ background: #367465;
+}
+.end button:focus-visible {
+ outline: 2px solid #a4713c;
+ outline-offset: 3px;
+}
+.pause-label {
+ position: absolute;
+ right: 16px;
+ top: 16px;
+ padding: 7px 12px;
+ background: #edf7eae6;
+ border-radius: 6px;
+ font-size: 11px;
+}
+.touch {
+ position: absolute;
+ left: 20px;
+ right: 20px;
+ bottom: 17px;
+ justify-content: space-between;
+ display: none;
+ gap: 10px;
+}
+.touch button {
+ background: #244941ba;
+ border: 1px solid #a0b8a1;
+ color: #eef8e9;
+ border-radius: 12px;
+ font: inherit;
+ padding: 14px 22px;
+ touch-action: none;
+ user-select: none;
+}
+@media (pointer: coarse) {
+ .touch {
+ display: flex;
+ }
+}
+@media (max-width: 480px) {
+ .intro {
+ left: 21px;
+ bottom: 25px;
+ }
+ .intro h1 {
+ font-size: 27px;
+ }
+ .intro p {
+ font-size: 10px;
+ max-width: 270px;
+ }
+ .hud {
+ gap: 19px;
+ padding: 10px 14px;
+ }
+ .hud b {
+ font-size: 19px;
+ }
+}
diff --git a/store/agents/godogen/template/studio.json b/store/agents/godogen/template/studio.json
new file mode 100644
index 000000000..a4a1e9d87
--- /dev/null
+++ b/store/agents/godogen/template/studio.json
@@ -0,0 +1,5 @@
+{
+ "title": "Alpine Drift",
+ "description": "A little mountain. An open invitation.",
+ "controls": "A / D or ← / → to carve · Space to jump · R to restart"
+}
diff --git a/store/agents/godogen/template/tsconfig.json b/store/agents/godogen/template/tsconfig.json
new file mode 100644
index 000000000..aaf28523a
--- /dev/null
+++ b/store/agents/godogen/template/tsconfig.json
@@ -0,0 +1,12 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
+ "strict": true,
+ "skipLibCheck": true,
+ "noEmit": true,
+ "lib": ["ES2022", "DOM", "DOM.Iterable"]
+ },
+ "include": ["src"]
+}
diff --git a/store/agents/godogen/test/studio.e2e.mjs b/store/agents/godogen/test/studio.e2e.mjs
new file mode 100644
index 000000000..26f6ab8fe
--- /dev/null
+++ b/store/agents/godogen/test/studio.e2e.mjs
@@ -0,0 +1,296 @@
+import assert from "node:assert/strict";
+import { chromium, webkit } from "playwright";
+import {
+ readFileSync,
+ writeFileSync,
+ mkdirSync,
+ mkdtempSync,
+ cpSync,
+ symlinkSync,
+ rmSync,
+ existsSync,
+} from "node:fs";
+import { join, resolve, dirname } from "node:path";
+import { fileURLToPath, pathToFileURL } from "node:url";
+import { tmpdir } from "node:os";
+import { createServer } from "node:http";
+const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
+const viewerDir =
+ process.env.GAME_VIEWER_DIR || resolve(root, "../../viewers/game-viewer");
+const { startGameViewer } = await import(
+ pathToFileURL(join(viewerDir, "viewer.mjs")).href
+);
+const workspace = mkdtempSync(join(tmpdir(), "godogen-browser-test-"));
+cpSync(join(root, "template"), workspace, { recursive: true });
+symlinkSync(join(root, "node_modules"), join(workspace, "node_modules"), "dir");
+const artifacts =
+ process.env.GODOGEN_TEST_ARTIFACTS || join(root, "test-results");
+mkdirSync(artifacts, { recursive: true });
+const viewer = await startGameViewer({ workspace, toolchain: root });
+const { url } = viewer;
+const source = join(workspace, "src/main.ts"),
+ original = readFileSync(source, "utf8");
+const useWebKit = process.env.GODOGEN_BROWSER === "webkit";
+const browser = await (useWebKit ? webkit : chromium)
+ .launch({
+ headless: true,
+ ...(useWebKit
+ ? {}
+ : {
+ executablePath:
+ process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH ||
+ (existsSync(
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
+ )
+ ? "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
+ : undefined),
+ args: ["--enable-unsafe-swiftshader"],
+ }),
+ })
+ .catch(async (error) => {
+ await viewer.close();
+ rmSync(workspace, { recursive: true, force: true });
+ throw error;
+ });
+const page = await browser.newPage({
+ viewport: { width: 1060, height: 800 },
+ deviceScaleFactor: 1,
+});
+const errors = [];
+page.on("pageerror", (error) => errors.push(error.message));
+const wait = (ms) => page.waitForTimeout(ms);
+let awaitSrc = "";
+async function game() {
+ awaitSrc = await page.locator("#frames iframe.active").getAttribute("src");
+ return page.frames().find((frame) => frame.url() === url + awaitSrc);
+}
+const stats = async () =>
+ await (await game()).evaluate(() => window.harnessGame.stats());
+const version = () => page.locator("#version").innerText();
+const state = async () =>
+ await (await page.request.get(url + "/api/state")).json();
+const checkpoint = (message) => console.log("PASS " + message);
+let exportServer;
+try {
+ await page.goto(url);
+ await page.waitForFunction(
+ () =>
+ document.querySelector("#frames iframe.active") &&
+ !document.querySelector("#play").disabled,
+ null,
+ { timeout: 45000 },
+ );
+ assert.equal((await state()).status, "ready");
+ assert.ok((await stats()).objects > 100);
+ const originalVersion = await version();
+ await page.screenshot({
+ path: join(artifacts, "game-explore.png"),
+ fullPage: true,
+ });
+ await page.locator("#play").click();
+ await wait(500);
+ await page.keyboard.down("KeyD");
+ await wait(350);
+ await page.keyboard.up("KeyD");
+ assert.ok((await stats()).positionX > 1);
+ await page.keyboard.press("Space");
+ await wait(200);
+ assert.ok((await stats()).jumpHeight > 0.4);
+ await page.locator("#pause").click();
+ await wait(60);
+ const paused = await stats();
+ await wait(350);
+ assert.equal((await stats()).time, paused.time);
+ await page.locator("#restart").click();
+ await wait(80);
+ assert.ok((await stats()).distance < 3);
+ checkpoint("keyboard steering, jumping, pause, and restart");
+ await page.screenshot({
+ path: join(artifacts, "game-play.png"),
+ fullPage: true,
+ });
+
+ // Compile a real source edit while the user is playing.
+ const beforeUpdate = await stats();
+ writeFileSync(source, original.replace("#397674", "#50755b"));
+ await page.locator("#update").waitFor({ state: "visible", timeout: 45000 });
+ assert.equal(await version(), originalVersion);
+ assert.ok((await stats()).time > beforeUpdate.time);
+ assert.ok((await page.locator("#frames iframe").count()) <= 2);
+ await page.locator("#update").click();
+ assert.notEqual(await version(), originalVersion);
+ assert.equal((await stats()).mode, "explore");
+ const workingVersion = await version();
+ checkpoint(
+ "new builds wait without resetting a running game, then apply on request",
+ );
+
+ writeFileSync(source, original + "\nTHIS IS NOT TYPESCRIPT !\n");
+ await page.waitForFunction(
+ () => !document.querySelector("#error").hidden,
+ null,
+ { timeout: 45000 },
+ );
+ assert.equal(await version(), workingVersion);
+ assert.equal((await state()).status, "error");
+ assert.ok((await stats()).fps > 0);
+ await page.screenshot({
+ path: join(artifacts, "game-recovery.png"),
+ fullPage: true,
+ });
+ checkpoint("syntax errors preserve the last playable version");
+
+ writeFileSync(
+ source,
+ original + '\nthrow new Error("Deliberate QA runtime failure");\n',
+ );
+ await page.waitForFunction(
+ () =>
+ document
+ .querySelector("#error-message")
+ .textContent.includes("Deliberate QA runtime failure"),
+ null,
+ { timeout: 45000 },
+ );
+ assert.equal(await version(), workingVersion);
+ assert.ok((await stats()).fps > 0);
+ writeFileSync(source, original + "\n// Recovery checkpoint\n");
+ await page.waitForFunction(
+ (old) =>
+ document.querySelector("#error").hidden &&
+ document.querySelector("#version").textContent !== old,
+ workingVersion,
+ { timeout: 45000 },
+ );
+ checkpoint(
+ "browser runtime failures preserve the game and recover on the next edit",
+ );
+
+ await page.locator("#details").click();
+ await page.locator("#tab-versions").click();
+ const newest = await version();
+ await page.locator("#versions .checkpoint").last().click();
+ await page.waitForFunction(
+ (latest) => document.querySelector("#version").textContent !== latest,
+ newest,
+ { timeout: 30000 },
+ );
+ const historyVersion = await version();
+ await wait(300);
+ assert.equal(await version(), historyVersion);
+ writeFileSync(
+ source,
+ original + "\n// One more edit while inspecting history\n",
+ );
+ await page.locator("#update").waitFor({ state: "visible", timeout: 45000 });
+ assert.equal(await version(), historyVersion);
+ await page.locator("#update").click();
+ assert.ok((await page.locator("#frames iframe").count()) <= 2);
+ checkpoint(
+ "history selection stays selected while new versions arrive; discarded frames are removed",
+ );
+
+ await page.locator("#play").click();
+ await page.locator("#restart").click();
+ await (
+ await game()
+ ).waitForFunction(
+ () => window.harnessGame.stats().state === "finished",
+ null,
+ { timeout: 60000 },
+ );
+ assert.ok((await stats()).distance >= 240);
+ assert.ok((await stats()).score >= 2);
+ await (await game()).locator("#again").click();
+ await wait(100);
+ assert.ok((await stats()).distance < 5);
+ checkpoint("full course, finish screen, and play-again loop");
+
+ // Host an exported build exactly as an ordinary static website.
+ await page.locator("#export").click();
+ await page.locator("#toast").waitFor({ state: "visible" });
+ const exported = (await page.locator("#toast").innerText()).replace(
+ "Saved to ",
+ "",
+ );
+ const exportDir = join(workspace, exported);
+ exportServer = createServer((req, res) => {
+ try {
+ const path = join(
+ exportDir,
+ new URL(req.url, "http://localhost").pathname,
+ );
+ res.setHeader(
+ "content-type",
+ path.endsWith(".js")
+ ? "text/javascript"
+ : path.endsWith(".css")
+ ? "text/css"
+ : "text/html",
+ );
+ res.end(
+ readFileSync(path.endsWith("/") ? join(path, "index.html") : path),
+ );
+ } catch {
+ res.statusCode = 404;
+ res.end();
+ }
+ });
+ await new Promise((resolve) => exportServer.listen(0, "127.0.0.1", resolve));
+ const exportedPage = await browser.newPage();
+ await exportedPage.goto(
+ "http://127.0.0.1:" + exportServer.address().port + "/",
+ );
+ await exportedPage.waitForFunction(
+ () => window.harnessGame?.stats().distance > 5,
+ null,
+ { timeout: 30000 },
+ );
+ assert.equal(
+ await exportedPage.evaluate(() => window.harnessGame.stats().mode),
+ "play",
+ );
+ await exportedPage.close();
+ checkpoint("selected version exports as a standalone playable site");
+
+ await page.setViewportSize({ width: 430, height: 740 });
+ assert.ok(
+ await page.evaluate(
+ () => document.documentElement.scrollWidth <= innerWidth,
+ ),
+ );
+ await page.locator("#fullscreen").click();
+ assert.ok(
+ await page
+ .locator(".studio")
+ .evaluate((el) => el.classList.contains("expanded")),
+ );
+ await (await game()).locator("canvas").click();
+ await page.keyboard.press("Escape");
+ await page.waitForFunction(
+ () => !document.querySelector(".studio").classList.contains("expanded"),
+ );
+ assert.equal(
+ await page.locator("#fullscreen").getAttribute("aria-label"),
+ "Expand preview",
+ );
+ await page.screenshot({
+ path: join(artifacts, "game-narrow.png"),
+ fullPage: true,
+ });
+ assert.deepEqual(
+ [...new Set(errors.map((message) => message.replace(/^Error: /, "")))],
+ ["Deliberate QA runtime failure"],
+ );
+ checkpoint("narrow layout, expand/escape, and no uncaught studio errors");
+ console.log(
+ "RESULT " +
+ JSON.stringify({ status: "passed", checks: 8, workspace, exported }),
+ );
+} finally {
+ writeFileSync(source, original);
+ await browser.close();
+ if (exportServer) await new Promise((resolve) => exportServer.close(resolve));
+ await viewer.close();
+ rmSync(workspace, { recursive: true, force: true });
+}
diff --git a/store/agents/godogen/toolchain/check.mjs b/store/agents/godogen/toolchain/check.mjs
new file mode 100755
index 000000000..e50286927
--- /dev/null
+++ b/store/agents/godogen/toolchain/check.mjs
@@ -0,0 +1,29 @@
+#!/usr/bin/env node
+import { readFileSync } from "node:fs";
+try {
+ const runtime = JSON.parse(
+ readFileSync(".harness/studio-runtime.json", "utf8"),
+ );
+ const url = new URL(runtime.url);
+ if (url.hostname !== "127.0.0.1")
+ throw new Error("The game viewer must be on loopback");
+ const state = await (
+ await fetch(new URL("/api/state", url), {
+ signal: AbortSignal.timeout(5000),
+ })
+ ).json();
+ if (state.status !== "ready" || state.error || !state.latest?.ready)
+ throw new Error(
+ state.error?.message ||
+ `Preview is ${state.status}. Open the viewer and wait for its first rendered frame.`,
+ );
+ console.log(
+ `ok Version ${state.latest.number} compiled and rendered without reported runtime errors`,
+ );
+ console.log(
+ "info Play-test controls, goals, and restart before calling the game complete.",
+ );
+} catch (error) {
+ console.error(`fail ${error.message}`);
+ process.exitCode = 1;
+}
diff --git a/store/agents/godogen/toolchain/doctor.sh b/store/agents/godogen/toolchain/doctor.sh
new file mode 100755
index 000000000..635d24bd0
--- /dev/null
+++ b/store/agents/godogen/toolchain/doctor.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+set -euo pipefail
+cd "$(dirname "$0")/.."
+. ./VERSIONS
+. toolchain/runtimes.sh
+harness_node 22.12 || exit 1
+[ "$(git -C upstream rev-parse HEAD)" = "$GODOGEN_COMMIT" ]
+[ -f runtime/babylon.md ] && [ -f runtime/.claude/skills/asset-gen/SKILL.md ]
+node --input-type=module -e 'await import("vite"); await import("@babylonjs/core/Engines/engine.js"); console.log("ok Babylon.js and Vite")'
+[ -x node_modules/.bin/tsc ]
+echo 'ok Godogen workflow, asset skill, TypeScript, and playable starter'
+echo 'info Generated assets are optional; provider keys and budget are needed only when you request them.'
diff --git a/store/agents/godogen/toolchain/init-workspace.mjs b/store/agents/godogen/toolchain/init-workspace.mjs
new file mode 100755
index 000000000..ba15645e1
--- /dev/null
+++ b/store/agents/godogen/toolchain/init-workspace.mjs
@@ -0,0 +1,24 @@
+#!/usr/bin/env node
+import { existsSync, mkdirSync, symlinkSync, writeFileSync } from "node:fs";
+import { join } from "node:path";
+const root = process.env.HARNESS_DSH_DIR;
+if (!root) throw new Error("HARNESS_DSH_DIR is required");
+mkdirSync(".harness", { recursive: true });
+if (!existsSync("node_modules"))
+ symlinkSync(join(root, "node_modules"), "node_modules", "dir");
+if (!existsSync(".harness/progress.json"))
+ writeFileSync(
+ ".harness/progress.json",
+ JSON.stringify({ phase: "world", message: "" }),
+ );
+writeFileSync(
+ ".harness/verdict.json",
+ JSON.stringify({
+ spec: 1,
+ ready: false,
+ summary: "Opening your first world",
+ findings: [],
+ artifact: "index.html",
+ updatedAt: new Date().toISOString(),
+ }),
+);
diff --git a/store/agents/godogen/toolchain/publish-runtime.mjs b/store/agents/godogen/toolchain/publish-runtime.mjs
new file mode 100644
index 000000000..8709a39e3
--- /dev/null
+++ b/store/agents/godogen/toolchain/publish-runtime.mjs
@@ -0,0 +1,68 @@
+#!/usr/bin/env node
+// The Babylon/Claude subset of Godogen's publish.sh, expressed with Node's standard library so
+// installing the game does not require rsync or Python. The upstream checkout remains untouched.
+// Godogen is MIT licensed, copyright 2026 Alex Ermolov. See LICENSE-godogen.
+import {
+ cpSync,
+ existsSync,
+ mkdirSync,
+ readFileSync,
+ readdirSync,
+ rmSync,
+ writeFileSync,
+} from "node:fs";
+import { dirname, join, resolve } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
+const source = join(root, "upstream"),
+ target = join(root, "runtime");
+const render = (value, replacements) =>
+ Object.entries(replacements).reduce(
+ (text, [key, replacement]) =>
+ text.replaceAll("$" + "{" + key + "}", replacement),
+ value,
+ );
+const replacements = {
+ AGENT_NAME: "Claude",
+ ASSET_GEN_SKILL_DIR: ".claude/skills/asset-gen",
+ ASSET_SKILL_COMMAND: "/asset-gen",
+ RUNTIME_ASSET_DIR: "src/assets",
+};
+if (!existsSync(join(source, "asset-gen/SKILL.md")))
+ throw new Error("Pinned Godogen checkout is missing");
+const skills = join(target, ".claude/skills");
+rmSync(skills, { recursive: true, force: true });
+mkdirSync(skills, { recursive: true });
+cpSync(join(source, "asset-gen"), join(skills, "asset-gen"), {
+ recursive: true,
+ filter: (path) => !path.split("/").includes("__pycache__"),
+});
+function renderTree(folder) {
+ for (const entry of readdirSync(folder, { withFileTypes: true })) {
+ const path = join(folder, entry.name);
+ if (entry.isDirectory()) renderTree(path);
+ else if (entry.isFile()) {
+ const bytes = readFileSync(path);
+ let original;
+ try {
+ original = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
+ } catch {
+ continue;
+ }
+ const result = render(original, replacements);
+ if (result !== original) writeFileSync(path, result);
+ }
+ }
+}
+renderTree(skills);
+writeFileSync(
+ join(target, "CLAUDE.md"),
+ render(readFileSync(join(source, "prompts/runtime.md"), "utf8"), {
+ ENGINE_NAME: "Babylon.js",
+ ENGINE_GUIDE_FILE: "babylon.md",
+ ASSET_SKILL_COMMAND: "/asset-gen",
+ }),
+);
+cpSync(join(source, "engines/babylon.md"), join(target, "babylon.md"));
+console.log("ok Godogen Babylon.js workflow and asset-generation skill");
diff --git a/store/agents/godogen/toolchain/runtimes.sh b/store/agents/godogen/toolchain/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/agents/godogen/toolchain/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/agents/godogen/toolchain/setup.sh b/store/agents/godogen/toolchain/setup.sh
new file mode 100755
index 000000000..a2683878f
--- /dev/null
+++ b/store/agents/godogen/toolchain/setup.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+set -euo pipefail
+cd "$(dirname "$0")/.."
+. ./VERSIONS
+. toolchain/runtimes.sh
+harness_node 22.12 || exit 1
+if [ ! -d upstream/.git ]; then
+ git init -q upstream
+ git -C upstream remote add origin https://github.com/htdt/godogen.git
+fi
+if [ "$(git -C upstream rev-parse HEAD 2>/dev/null || true)" != "$GODOGEN_COMMIT" ]; then
+ git -C upstream fetch --depth 1 origin "$GODOGEN_COMMIT"
+ git -C upstream checkout --detach "$GODOGEN_COMMIT"
+fi
+echo 'Preparing Godogen’s Babylon.js instructions and asset-generation skill'
+node toolchain/publish-runtime.mjs
+npm ci --omit=dev --no-audit --no-fund
+exec toolchain/doctor.sh
diff --git a/store/viewers/game-viewer/LICENSE b/store/viewers/game-viewer/LICENSE
new file mode 100644
index 000000000..a499cd17e
--- /dev/null
+++ b/store/viewers/game-viewer/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Autonomous, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/store/viewers/game-viewer/README.md b/store/viewers/game-viewer/README.md
new file mode 100644
index 000000000..164792411
--- /dev/null
+++ b/store/viewers/game-viewer/README.md
@@ -0,0 +1,64 @@
+# Game Viewer
+
+A shared viewer for Vite-based browser games. It compiles a workspace on each save and displays
+the result beside its agent. Godogen is its first consumer.
+
+The viewer keeps the last ten rendered versions. A syntax error or a reported browser error
+preserves the last working game. A new build waits while someone is playing or inspecting a
+previous version. Active previews retain their files beyond the history limit, so a long run
+does not lose its assets when the agent keeps editing.
+
+Explore, Play, pause, and restart call the game's bridge. The studio also provides a build log,
+version selection, an asset browser, and export to a new `out/game-N/` folder. Export does not
+overwrite earlier exports. Versions are temporary; exported files stay in the workspace.
+
+## Use from a harness
+
+```json
+{
+ "viewer": { "use": "autonomous/game-viewer" },
+ "verdict": ".harness/verdict.json"
+}
+```
+
+The consumer supplies a Vite installation in its package, a workspace `index.html`, and
+its game dependencies. Harness passes the consumer's directory as `HARNESS_DSH_DIR`.
+The server uses Vite's API with a fixed build configuration; a project `vite.config.*`
+is not loaded.
+
+`studio.json` provides `title`, `description`, and `controls`. The agent can write
+`.harness/progress.json` with `phase` (`concept`, `world`, `play`, `polish`, or `check`)
+and a short `message`. No percentages are inferred.
+
+The game dispatches `harness:ready` after a real rendered frame and required assets have loaded.
+It defines `window.harnessGame` with:
+
+- `setMode('explore' | 'play')`
+- `setPaused(boolean)`
+- `restart()`
+- `stats()`, optionally returning real `fps` and `objects` counts
+
+The injected bridge reports readiness and errors. The viewer writes the verdict from those
+reports; compilation alone does not set `ready`. A ready preview still needs gameplay testing.
+Standalone exports do not depend on the studio server.
+
+## Run and test
+
+```sh
+npm test
+HARNESS_WORKSPACE=/path/to/game HARNESS_DSH_DIR=/path/to/consumer \
+ HARNESS_VIEWER_PORT=4111 bash viewer.sh
+```
+
+Node 22.12 or newer is found on the machine or through Harness's managed runtime. The viewer
+itself has no npm dependencies; Vite belongs to the consuming harness.
+
+The server binds to loopback. Mutation requests require its per-process token and reject
+foreign browser origins. Served files and exports stay within their designated directories.
+It runs the local project's code, as any local game development server does.
+
+## Credit and stewardship
+
+Game Viewer is original MIT-licensed code by OpenHarness contributors. It uses Vite through
+the consuming package and supports browser games that implement its small bridge. Game engines,
+assets, and their licenses remain the consuming harness's responsibility.
diff --git a/store/viewers/game-viewer/doctor.sh b/store/viewers/game-viewer/doctor.sh
new file mode 100644
index 000000000..2fca3362f
--- /dev/null
+++ b/store/viewers/game-viewer/doctor.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+set -euo pipefail
+. "$(dirname "$0")/runtimes.sh"
+harness_node 22.12 || exit 1
+echo "ok node $(node --version)"
diff --git a/store/viewers/game-viewer/harness.json b/store/viewers/game-viewer/harness.json
new file mode 100644
index 000000000..98640468f
--- /dev/null
+++ b/store/viewers/game-viewer/harness.json
@@ -0,0 +1,11 @@
+{
+ "spec": 1,
+ "kind": "viewer",
+ "id": "autonomous/game-viewer",
+ "name": "Game Viewer",
+ "category": "Games",
+ "author": "OpenHarness contributors",
+ "description": "A live game studio: playable previews, real build progress, versions, and an uninterrupted last working game while the next one takes shape.",
+ "toolchain": { "doctor": "bash doctor.sh" },
+ "viewer": { "command": "bash viewer.sh", "url": "http://127.0.0.1:${port}/" }
+}
diff --git a/store/viewers/game-viewer/package.json b/store/viewers/game-viewer/package.json
new file mode 100644
index 000000000..395f9362f
--- /dev/null
+++ b/store/viewers/game-viewer/package.json
@@ -0,0 +1,9 @@
+{
+ "name": "openharness-game-viewer",
+ "private": true,
+ "type": "module",
+ "license": "MIT",
+ "scripts": {
+ "test": "node --test test/*.test.mjs"
+ }
+}
diff --git a/store/viewers/game-viewer/runtimes.sh b/store/viewers/game-viewer/runtimes.sh
new file mode 100644
index 000000000..7223c78dc
--- /dev/null
+++ b/store/viewers/game-viewer/runtimes.sh
@@ -0,0 +1,192 @@
+# shellcheck shell=bash
+# runtimes.sh — the interpreters a store package runs on, found on this machine or fetched, never
+# asked of the person who pressed Get.
+#
+# Sourced (not run) by a package's setup, doctor and viewer scripts. A new Mac has Apple's Python 3.9,
+# no Homebrew and, for most people, no Node on PATH; a package that answers "brew install [email protected]"
+# has failed its install. So:
+#
+# harness_node 18 node >= 18 on PATH, with npm: the machine's own, else the Node Harness
+# itself runs on (~/.harness/runtime/current-node, laid down with the CLI)
+# harness_uv uv on PATH: the machine's own, else a pinned, checksummed release
+# fetched into ~/.harness/runtime
+# harness_venv DIR 3.12 [MIN [BELOW]]
+# DIR is a venv on CPython 3.12, which uv downloads when the machine
+# has none. A venv already there on a Python in [MIN, BELOW) is kept.
+# harness_pip DIR PKG… install into that venv, through uv
+# harness_micromamba micromamba, pinned and checksummed, for native libraries PyPI has
+# no wheel for (pycairo on macOS)
+# harness_conda_env DIR SPEC… DIR is a conda-forge environment with those packages
+#
+# Every function prints `miss …` and returns 1 when it cannot deliver, so `harness_node 18 || exit 1`
+# reads like the rest of a setup script. Nothing here touches the user's shell profile; what it
+# installs lands in ~/.harness/runtime or the package's own directory (uv keeps its download cache
+# where it always does, which a venv does not depend on).
+#
+# ONE copy is written by hand: store/tools/runtimes.sh in the OpenHarness repository. Each package
+# carries an identical copy (a package installs alone, so it cannot reach this one);
+# `node store/tools/sync-runtimes.mjs` rewrites them and the CLI's store spec fails when one drifts.
+
+HARNESS_RUNTIME="${ADAPTER_RUNTIME_DIR:-${HOME:-}/.harness/runtime}"
+# The Pythons uv downloads live with Harness's other runtimes, not in uv's own ~/.local/share/uv:
+# a package's venv points at its interpreter, and `uv python uninstall` there must not break it.
+UV_PYTHON_INSTALL_DIR="${UV_PYTHON_INSTALL_DIR:-$HARNESS_RUNTIME/python}"
+export UV_PYTHON_INSTALL_DIR
+HARNESS_UV_VERSION=0.12.15
+HARNESS_MICROMAMBA_VERSION=2.9.0-0
+
+_harness_platform() {
+ case "$(uname -s)-$(uname -m)" in
+ Darwin-arm64) echo darwin-arm64 ;;
+ Darwin-x86_64) echo darwin-x64 ;;
+ Linux-x86_64) echo linux-x64 ;;
+ Linux-aarch64 | Linux-arm64) echo linux-arm64 ;;
+ *) return 1 ;;
+ esac
+}
+
+_harness_sha256() {
+ if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | cut -d' ' -f1
+ else sha256sum "$1" | cut -d' ' -f1; fi
+}
+
+# _harness_fetch URL DEST SHA256 — DEST exists only if what arrived matches the pinned checksum.
+_harness_fetch() {
+ local part="$2.part.$$"
+ if ! curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$part" "$1"; then
+ rm -f "$part"; echo "miss could not download $1 — check this machine's internet connection"; return 1
+ fi
+ if [ "$(_harness_sha256 "$part")" != "$3" ]; then
+ rm -f "$part"; echo "miss $1 did not match its pinned checksum; nothing was installed"; return 1
+ fi
+ mv -f "$part" "$2"
+}
+
+_harness_node_at_least() {
+ command -v node >/dev/null 2>&1 || return 1
+ node -e '
+ const [a, b = 0] = process.argv[1].split(".").map(Number)
+ const [x, y] = process.versions.node.split(".").map(Number)
+ process.exit(x > a || (x === a && y >= b) ? 0 : 1)
+ ' "$1" >/dev/null 2>&1
+}
+
+harness_node() {
+ local min="${1:-18}" recorded saved="$PATH" own=0
+ _harness_node_at_least "$min" && own=1
+ # A node without npm beside it (a distro's nodejs package) cannot run a setup's `npm ci`.
+ if [ "$own" = 1 ] && command -v npm >/dev/null 2>&1; then return 0; fi
+ recorded="$(cat "$HARNESS_RUNTIME/current-node" 2>/dev/null || true)"
+ # Already Harness's own (a second call, or a wrapper calling a script that asks again): nothing to add.
+ if [ "$own" = 1 ] && [ -n "$recorded" ] && [ "$(command -v node)" = "${recorded%/*}/node" ]; then return 0; fi
+ if [ -n "$recorded" ] && [ -x "${recorded%/*}/node" ]; then
+ PATH="${recorded%/*}:$PATH"; export PATH; hash -r 2>/dev/null || true
+ _harness_node_at_least "$min" && return 0
+ PATH="$saved"; export PATH; hash -r 2>/dev/null || true
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min — this machine's newest is $("${recorded%/*}/node" -v), Harness's own; update Harness"
+ return 1
+ fi
+ [ "$own" = 1 ] && return 0
+ echo "miss node >= $min, and Harness's own Node is not in $HARNESS_RUNTIME — run \`harness start\` once to lay it down"
+ return 1
+}
+
+harness_uv() {
+ local dir asset sum tmp
+ command -v uv >/dev/null 2>&1 && return 0
+ for dir in "${HOME:-}/.local/bin" "${HOME:-}/.cargo/bin"; do
+ [ -n "${HOME:-}" ] || break
+ if [ -x "$dir/uv" ]; then PATH="$dir:$PATH"; export PATH; return 0; fi
+ done
+ dir="$HARNESS_RUNTIME/uv-$HARNESS_UV_VERSION"
+ if [ ! -x "$dir/uv" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=uv-aarch64-apple-darwin sum=dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d ;;
+ darwin-x64) asset=uv-x86_64-apple-darwin sum=e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b ;;
+ linux-x64) asset=uv-x86_64-unknown-linux-gnu sum=f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638 ;;
+ linux-arm64) asset=uv-aarch64-unknown-linux-gnu sum=0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08 ;;
+ *) echo "miss uv — there is no uv release for $(uname -s) $(uname -m); install it from https://docs.astral.sh/uv/"; return 1 ;;
+ esac
+ echo " fetching uv $HARNESS_UV_VERSION into $HARNESS_RUNTIME (it brings Python and the packages)"
+ mkdir -p "$HARNESS_RUNTIME" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ tmp="$(mktemp -d "$HARNESS_RUNTIME/.uv.XXXXXX")" || { echo "miss cannot write $HARNESS_RUNTIME"; return 1; }
+ if ! _harness_fetch "https://github.com/astral-sh/uv/releases/download/$HARNESS_UV_VERSION/$asset.tar.gz" "$tmp/uv.tar.gz" "$sum"; then
+ rm -rf "$tmp"; return 1
+ fi
+ tar -xzf "$tmp/uv.tar.gz" -C "$tmp" && chmod +x "$tmp/$asset/uv" "$tmp/$asset/uvx" \
+ || { rm -rf "$tmp"; echo "miss the uv archive would not unpack"; return 1; }
+ # Two installs at once both get here; whichever renames first wins and the other's copy goes.
+ # (mv onto a directory that exists would nest the copy inside it, hence the test.)
+ [ -e "$dir" ] || mv "$tmp/$asset" "$dir" 2>/dev/null || true
+ rm -rf "$tmp"
+ [ -x "$dir/uv" ] || { echo "miss uv did not land in $dir"; return 1; }
+ fi
+ PATH="$dir:$PATH"; export PATH
+}
+
+# harness_venv DIR VERSION [MIN [BELOW]] — MIN defaults to VERSION; BELOW is exclusive and optional.
+harness_venv() {
+ local dir="${1:?harness_venv needs a directory}" want="${2:?harness_venv needs a Python version}"
+ local min="${3:-$2}" below="${4:-}"
+ if [ -x "$dir/bin/python" ] && "$dir/bin/python" -c '
+import sys
+at = lambda s: tuple(int(p) for p in s.split("."))
+v = sys.version_info[:2]
+sys.exit(0 if v >= at(sys.argv[1]) and (not sys.argv[2] or v < at(sys.argv[2])) else 1)
+' "$min" "$below" 2>/dev/null; then
+ echo "ok $("$dir/bin/python" --version) in $dir"
+ return 0
+ fi
+ harness_uv || return 1
+ echo " python $want in $dir (uv downloads it when this machine has none)"
+ rm -rf "$dir"
+ # only-managed: the same python-build-standalone interpreter on every machine, so a package tested
+ # once is tested everywhere — not whichever Homebrew or pyenv Python happened to be first on PATH.
+ uv venv --quiet --seed --python "$want" --python-preference only-managed "$dir" \
+ || { echo "miss could not make a Python $want environment in $dir"; return 1; }
+ echo "ok $("$dir/bin/python" --version) in $dir"
+}
+
+harness_pip() {
+ local dir="${1:?harness_pip needs a venv}"
+ shift
+ harness_uv || return 1
+ # uv's own error comes first; the miss line is last, so it is the line the store shows.
+ uv pip install --quiet --python "$dir/bin/python" "$@" \
+ || { echo "miss could not install $* into $dir"; return 1; }
+}
+
+harness_micromamba() {
+ local dir asset sum
+ dir="$HARNESS_RUNTIME/micromamba-$HARNESS_MICROMAMBA_VERSION"
+ if [ ! -x "$dir/micromamba" ]; then
+ case "$(_harness_platform)" in
+ darwin-arm64) asset=micromamba-osx-arm64 sum=ec2a072f028e1a7cf20f3e2e74d5a8127cf5a5f27636375b5359811565f4e5be ;;
+ darwin-x64) asset=micromamba-osx-64 sum=1e71054bb3ac9a076e21f7ec48acfef536f9b3f1408f371a942784bf5ef83d8a ;;
+ linux-x64) asset=micromamba-linux-64 sum=366cd9cd8be14df1ab8ed50352a82111082a36686b2d389fdb79a92c3fafb3e3 ;;
+ linux-arm64) asset=micromamba-linux-aarch64 sum=9f93b974adcb4d166996af969b6cd371287d1a3e52733704727884d9b74cb7a7 ;;
+ *) echo "miss micromamba — there is no release for $(uname -s) $(uname -m)"; return 1 ;;
+ esac
+ echo " fetching micromamba $HARNESS_MICROMAMBA_VERSION into $HARNESS_RUNTIME (native libraries PyPI has no wheel for)"
+ mkdir -p "$dir" || { echo "miss cannot write $dir"; return 1; }
+ _harness_fetch "https://github.com/mamba-org/micromamba-releases/releases/download/$HARNESS_MICROMAMBA_VERSION/$asset" "$dir/micromamba.$$" "$sum" || return 1
+ chmod +x "$dir/micromamba.$$" && mv -f "$dir/micromamba.$$" "$dir/micromamba" \
+ || { rm -f "$dir/micromamba.$$"; echo "miss micromamba would not install into $dir"; return 1; }
+ fi
+ HARNESS_MICROMAMBA="$dir/micromamba"
+ export HARNESS_MICROMAMBA
+}
+
+# harness_conda_env DIR SPEC… — conda-forge only, packages cached under ~/.harness/runtime/mamba.
+harness_conda_env() {
+ local dir="${1:?harness_conda_env needs a directory}"
+ shift
+ # micromamba takes a relative --prefix as a name under its root prefix and "succeeds" there.
+ case "$dir" in /*) ;; *) dir="$PWD/$dir" ;; esac
+ harness_micromamba || return 1
+ MAMBA_ROOT_PREFIX="$HARNESS_RUNTIME/mamba" "$HARNESS_MICROMAMBA" create --yes --quiet \
+ --prefix "$dir" --override-channels --channel conda-forge "$@" >/dev/null \
+ && [ -d "$dir/conda-meta" ] \
+ || { echo "miss could not make the conda-forge environment in $dir ($*)"; return 1; }
+}
diff --git a/store/viewers/game-viewer/store.json b/store/viewers/game-viewer/store.json
new file mode 100644
index 000000000..891e0b1e4
--- /dev/null
+++ b/store/viewers/game-viewer/store.json
@@ -0,0 +1,5 @@
+{
+ "homepage": "https://github.com/autonomous-ai/openharness",
+ "license": "MIT",
+ "screenshots": []
+}
diff --git a/store/viewers/game-viewer/test/viewer.test.mjs b/store/viewers/game-viewer/test/viewer.test.mjs
new file mode 100644
index 000000000..462d2ff93
--- /dev/null
+++ b/store/viewers/game-viewer/test/viewer.test.mjs
@@ -0,0 +1,227 @@
+import test from "node:test";
+import assert from "node:assert/strict";
+import {
+ mkdirSync,
+ mkdtempSync,
+ writeFileSync,
+ readFileSync,
+ existsSync,
+ rmSync,
+ symlinkSync,
+} from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { get } from "node:http";
+import { startGameViewer } from "../viewer.mjs";
+
+const until = async (predicate) => {
+ for (let i = 0; i < 120; i++) {
+ if (predicate()) return;
+ await new Promise((resolve) => setTimeout(resolve, 10));
+ }
+ throw new Error("Condition did not arrive");
+};
+async function fixture(t) {
+ const workspace = mkdtempSync(join(tmpdir(), "game-viewer-test-"));
+ writeFileSync(
+ join(workspace, "studio.json"),
+ JSON.stringify({ title: "Fixture world" }),
+ );
+ let fail = false;
+ const build = async (options) => {
+ mkdirSync(options.build.outDir, { recursive: true });
+ writeFileSync(
+ join(options.build.outDir, "index.html"),
+ "<h1>A playable fixture</h1>",
+ );
+ writeFileSync(
+ join(options.build.outDir, "version.js"),
+ "export const ready=true;",
+ );
+ if (fail) throw new Error("Syntax error in src/main.ts");
+ };
+ const viewer = await startGameViewer({ workspace, build });
+ t.after(async () => {
+ await viewer.close();
+ rmSync(workspace, { recursive: true, force: true });
+ });
+ await until(() => viewer.state.status === "preview");
+ const post = async (path, body, headers = {}) =>
+ fetch(viewer.url + path, {
+ method: "POST",
+ headers: {
+ "content-type": "application/json",
+ "x-studio-token": viewer.token,
+ ...headers,
+ },
+ body: JSON.stringify(body),
+ });
+ const ready = async () => {
+ const id = viewer.state.candidate.id;
+ assert.equal(
+ (await post("/api/report", { id, type: "ready" })).status,
+ 200,
+ );
+ return id;
+ };
+ return {
+ workspace,
+ viewer,
+ post,
+ ready,
+ setFail: (value) => {
+ fail = value;
+ },
+ };
+}
+
+test("a build is not ready until a browser reports a rendered frame", async (t) => {
+ const { viewer, workspace, ready } = await fixture(t);
+ assert.equal(
+ JSON.parse(readFileSync(join(workspace, ".harness/verdict.json"))).ready,
+ false,
+ );
+ await ready();
+ assert.equal(viewer.state.status, "ready");
+ assert.equal(
+ JSON.parse(readFileSync(join(workspace, ".harness/verdict.json"))).ready,
+ true,
+ );
+});
+
+test("build and runtime failures retain the last working revision and recover on the next edit", async (t) => {
+ const { viewer, ready, post, setFail } = await fixture(t);
+ const original = await ready();
+ setFail(true);
+ await viewer.rebuild();
+ assert.equal(viewer.state.status, "error");
+ assert.equal(viewer.state.latest.id, original);
+ assert.equal(
+ (await fetch(viewer.url + `/__game/${original}/index.html`)).status,
+ 200,
+ );
+ setFail(false);
+ await viewer.rebuild();
+ const broken = viewer.state.candidate.id;
+ await post("/api/report", {
+ id: broken,
+ type: "error",
+ message: "Required model failed to load",
+ });
+ assert.equal(viewer.state.latest.id, original);
+ assert.equal(viewer.state.status, "error");
+ assert.equal(
+ viewer.state.history.some((item) => item.id === broken),
+ false,
+ );
+ await viewer.rebuild();
+ await ready();
+ assert.equal(viewer.state.status, "ready");
+ assert.equal(viewer.state.error, null);
+});
+
+test("a player can keep an old revision beyond the ten-version history limit", async (t) => {
+ const { viewer, ready, post } = await fixture(t);
+ const original = await ready();
+ assert.equal(
+ (await post("/api/retain", { client: "player-one", ids: [original] }))
+ .status,
+ 200,
+ );
+ for (let i = 0; i < 12; i++) {
+ await viewer.rebuild();
+ await ready();
+ }
+ assert.equal(viewer.state.history.length, 10);
+ assert.equal(
+ viewer.state.history.some((item) => item.id === original),
+ false,
+ );
+ assert.equal(
+ (await fetch(viewer.url + `/__game/${original}/version.js`)).status,
+ 200,
+ );
+ await post("/api/retain", { client: "player-one", ids: [] });
+ assert.equal(
+ (await fetch(viewer.url + `/__game/${original}/version.js`)).status,
+ 404,
+ );
+});
+
+test("export writes a complete chosen version and never overwrites an earlier export", async (t) => {
+ const { viewer, workspace, ready, post } = await fixture(t);
+ assert.equal(
+ (await post("/api/export", { id: viewer.state.candidate.id })).status,
+ 409,
+ );
+ const id = await ready();
+ const first = await (await post("/api/export", { id })).json();
+ const second = await (await post("/api/export", { id })).json();
+ assert.notEqual(first.path, second.path);
+ assert.equal(
+ readFileSync(join(workspace, first.path, "version.js"), "utf8"),
+ "export const ready=true;",
+ );
+ assert.equal(existsSync(join(workspace, second.path, "index.html")), true);
+});
+
+test("rejects cross-origin writes, invalid hosts, traversal and exports outside the project", async (t) => {
+ const { viewer, workspace, ready, post } = await fixture(t);
+ const id = await ready();
+ assert.equal(
+ (await post("/api/export", { id }, { origin: "https://other.example" }))
+ .status,
+ 403,
+ );
+ assert.equal(
+ (await post("/api/export", { id }, { "x-studio-token": "wrong" })).status,
+ 403,
+ );
+ const hostStatus = await new Promise((resolve, reject) =>
+ get(
+ viewer.url + "/api/state",
+ { headers: { host: "other.example" } },
+ (res) => {
+ res.resume();
+ resolve(res.statusCode);
+ },
+ ).on("error", reject),
+ );
+ assert.equal(hostStatus, 403);
+ assert.equal(
+ (await fetch(viewer.url + "/api/asset?path=../../etc/passwd")).status,
+ 404,
+ );
+ const outside = mkdtempSync(join(tmpdir(), "game-outside-"));
+ t.after(() => rmSync(outside, { recursive: true, force: true }));
+ symlinkSync(outside, join(workspace, "out"), "dir");
+ assert.equal((await post("/api/export", { id })).status, 403);
+});
+
+test("studio metadata updates without rebuilding the game or clearing readiness", async (t) => {
+ const { viewer, workspace, ready } = await fixture(t);
+ await ready();
+ const number = viewer.state.latest.number;
+ writeFileSync(
+ join(workspace, ".harness/progress.json"),
+ JSON.stringify({ phase: "play", message: "Adding the jump controls" }),
+ );
+ await until(
+ () => viewer.state.progress.message === "Adding the jump controls",
+ );
+ writeFileSync(
+ join(workspace, "studio.json"),
+ JSON.stringify({ title: "A new title", controls: "Arrow keys" }),
+ );
+ await until(() => viewer.state.project.title === "A new title");
+ await new Promise((resolve) => setTimeout(resolve, 400));
+ assert.equal(viewer.state.latest.number, number);
+ assert.equal(viewer.state.status, "ready");
+ const verdict = JSON.parse(
+ readFileSync(join(workspace, ".harness/verdict.json")),
+ );
+ assert.equal(
+ verdict.phases.find((phase) => phase.id === "play").state,
+ "active",
+ );
+});
diff --git a/store/viewers/game-viewer/viewer.mjs b/store/viewers/game-viewer/viewer.mjs
new file mode 100644
index 000000000..16e60e12a
--- /dev/null
+++ b/store/viewers/game-viewer/viewer.mjs
@@ -0,0 +1,608 @@
+import { createServer } from "node:http";
+import {
+ watch,
+ existsSync,
+ mkdirSync,
+ mkdtempSync,
+ readFileSync,
+ writeFileSync,
+ renameSync,
+ readdirSync,
+ statSync,
+ realpathSync,
+ rmSync,
+ cpSync,
+} from "node:fs";
+import { dirname, join, resolve, relative, extname, sep } from "node:path";
+import { tmpdir } from "node:os";
+import { createRequire } from "node:module";
+import { fileURLToPath, pathToFileURL } from "node:url";
+import { randomBytes } from "node:crypto";
+
+const HERE = dirname(fileURLToPath(import.meta.url));
+const MIME = {
+ ".html": "text/html; charset=utf-8",
+ ".js": "text/javascript; charset=utf-8",
+ ".css": "text/css; charset=utf-8",
+ ".json": "application/json",
+ ".png": "image/png",
+ ".jpg": "image/jpeg",
+ ".jpeg": "image/jpeg",
+ ".webp": "image/webp",
+ ".svg": "image/svg+xml",
+ ".glb": "model/gltf-binary",
+ ".gltf": "model/gltf+json",
+ ".wasm": "application/wasm",
+ ".mp3": "audio/mpeg",
+ ".ogg": "audio/ogg",
+ ".wav": "audio/wav",
+ ".woff2": "font/woff2",
+};
+const PHASES = [
+ ["concept", "Imagine"],
+ ["world", "Build"],
+ ["play", "Play"],
+ ["polish", "Polish"],
+ ["check", "Check"],
+];
+const clean = (value) =>
+ String(value ?? "")
+ .replace(/\x1b\[[0-9;]*m/g, "")
+ .slice(0, 4000);
+const inside = (root, path) => path === root || path.startsWith(root + sep);
+function jsonFile(path, fallback) {
+ try {
+ if (statSync(path).size > 65536) return fallback;
+ return JSON.parse(readFileSync(path, "utf8"));
+ } catch {
+ return fallback;
+ }
+}
+function fileWithin(root, path) {
+ try {
+ const full = realpathSync(resolve(root, path));
+ return inside(realpathSync(root), full) && statSync(full).isFile()
+ ? full
+ : null;
+ } catch {
+ return null;
+ }
+}
+function send(res, status, body, type = "application/json") {
+ res.writeHead(status, {
+ "content-type": type,
+ "cache-control": "no-store",
+ "x-content-type-options": "nosniff",
+ });
+ res.end(type === "application/json" ? JSON.stringify(body) : body);
+}
+
+/** The package owns the studio. Its consumer owns the pinned Vite/game dependencies. */
+export async function startGameViewer({
+ workspace,
+ toolchain = workspace,
+ port = 0,
+ build: suppliedBuild,
+} = {}) {
+ workspace = realpathSync(workspace);
+ mkdirSync(join(workspace, ".harness"), { recursive: true });
+ const scratch = mkdtempSync(join(tmpdir(), "openharness-game-"));
+ const token = randomBytes(24).toString("hex");
+ const clients = new Set();
+ const revisions = new Map();
+ const leases = new Map();
+ let stopped = false,
+ timer,
+ watching,
+ building = false,
+ dirty = false,
+ sequence = 0,
+ sourceVersion = 0;
+ let base = "";
+ const state = {
+ status: "opening",
+ connected: true,
+ project: {},
+ progress: {},
+ candidate: null,
+ latest: null,
+ history: [],
+ activity: [],
+ error: null,
+ };
+ const build =
+ suppliedBuild ??
+ (
+ await import(
+ pathToFileURL(
+ join(
+ dirname(
+ createRequire(join(toolchain, "package.json")).resolve(
+ "vite/package.json",
+ ),
+ ),
+ "dist/node/index.js",
+ ),
+ ).href
+ )
+ ).build;
+ const guard = readFileSync(join(HERE, "web/bridge.js"), "utf8");
+
+ function facts() {
+ const project = jsonFile(join(workspace, "studio.json"), {});
+ state.project = {
+ title: clean(project.title || "Your world").slice(0, 80),
+ description: clean(project.description).slice(0, 180),
+ controls: clean(project.controls).slice(0, 220),
+ };
+ const progress = jsonFile(join(workspace, ".harness/progress.json"), {});
+ state.progress = {
+ phase: PHASES.some(([id]) => id === progress.phase)
+ ? progress.phase
+ : "world",
+ message: clean(progress.message).slice(0, 180),
+ };
+ }
+ function record(kind, message) {
+ state.activity.unshift({
+ id: randomBytes(5).toString("hex"),
+ kind,
+ message: clean(message).slice(0, 240),
+ at: new Date().toISOString(),
+ });
+ state.activity.length = Math.min(state.activity.length, 60);
+ }
+ function publish() {
+ facts();
+ const phase = PHASES.findIndex(([id]) => id === state.progress.phase);
+ const ready = state.status === "ready" && !state.error && !dirty;
+ const verdict = {
+ spec: 1,
+ ready,
+ artifact: "index.html",
+ summary: state.error
+ ? "Update needs a fix"
+ : building
+ ? "Building the next version"
+ : ready
+ ? `Playable preview · version ${state.latest?.number}`
+ : "Waiting for the game to render",
+ findings: state.error
+ ? [
+ {
+ severity: "error",
+ kind: state.error.kind,
+ message: state.error.message,
+ },
+ ]
+ : [],
+ phases: PHASES.map(([id, name], i) => ({
+ id,
+ name,
+ state:
+ i < phase
+ ? "done"
+ : i === phase
+ ? state.error
+ ? "failed"
+ : "active"
+ : "pending",
+ })),
+ updatedAt: new Date().toISOString(),
+ };
+ const file = join(workspace, ".harness/verdict.json");
+ writeFileSync(file + ".tmp", JSON.stringify(verdict));
+ renameSync(file + ".tmp", file);
+ const runtime = {
+ url: base,
+ pid: process.pid,
+ status: state.status,
+ latest: state.latest,
+ error: state.error,
+ updatedAt: verdict.updatedAt,
+ };
+ writeFileSync(
+ join(workspace, ".harness/studio-runtime.json"),
+ JSON.stringify(runtime),
+ );
+ const event = `event: state\ndata: ${JSON.stringify(state)}\n\n`;
+ for (const client of clients) client.write(event);
+ }
+ async function rebuild() {
+ if (stopped) return;
+ if (building) {
+ dirty = true;
+ return;
+ }
+ building = true;
+ dirty = false;
+ const revision = {
+ id: randomBytes(7).toString("hex"),
+ number: ++sequence,
+ sourceVersion,
+ at: new Date().toISOString(),
+ label: state.progress.message || state.project.title,
+ ready: false,
+ };
+ revision.url = `/__game/${revision.id}/index.html`;
+ revision.dir = join(scratch, revision.id);
+ state.status = "building";
+ state.error = null;
+ record("build", `Building version ${revision.number}`);
+ publish();
+ try {
+ await build({
+ root: workspace,
+ configFile: false,
+ base: "./",
+ logLevel: "silent",
+ publicDir: "public",
+ plugins: [
+ {
+ name: "openharness-game-bridge",
+ transformIndexHtml: {
+ order: "pre",
+ handler: () => [
+ {
+ tag: "script",
+ children: `window.__studioRevision=${JSON.stringify(revision.id)};\n${guard}`,
+ injectTo: "head-prepend",
+ },
+ ],
+ },
+ },
+ ],
+ build: {
+ outDir: revision.dir,
+ emptyOutDir: true,
+ sourcemap: false,
+ minify: false,
+ chunkSizeWarningLimit: 10000,
+ reportCompressedSize: false,
+ },
+ });
+ if (stopped) return;
+ revisions.set(revision.id, revision);
+ state.candidate = publicRevision(revision);
+ state.status = dirty ? "building" : "preview";
+ record(
+ "compiled",
+ `Version ${revision.number} compiled · checking the live game`,
+ );
+ } catch (error) {
+ rmSync(revision.dir, { recursive: true, force: true });
+ state.error = {
+ kind: "build",
+ message: clean(error.message).replaceAll(workspace + sep, ""),
+ file: clean(error.loc?.file || error.id).replaceAll(
+ workspace + sep,
+ "",
+ ),
+ line: error.loc?.line || null,
+ frame: clean(error.frame),
+ };
+ state.status = "error";
+ state.candidate = null;
+ record("error", state.error.message);
+ } finally {
+ building = false;
+ if (!stopped) {
+ prune();
+ publish();
+ if (dirty) schedule(50);
+ }
+ }
+ }
+ function publicRevision(item) {
+ const { dir, sourceVersion: _, ...publicItem } = item;
+ return publicItem;
+ }
+ function prune() {
+ const keep = new Set([
+ state.candidate?.id,
+ state.latest?.id,
+ ...state.history.map((item) => item.id),
+ ]);
+ for (const [client, lease] of leases) {
+ if (lease.until < Date.now()) {
+ leases.delete(client);
+ continue;
+ }
+ for (const id of lease.ids) keep.add(id);
+ }
+ for (const [id, item] of revisions)
+ if (!keep.has(id)) {
+ rmSync(item.dir, { recursive: true, force: true });
+ revisions.delete(id);
+ }
+ }
+ function schedule(delay = 350) {
+ clearTimeout(timer);
+ timer = setTimeout(rebuild, delay);
+ }
+ function report(body) {
+ const item = revisions.get(body.id);
+ if (!item) return false;
+ if (body.type === "ready" && !item.failed) {
+ if (!item.ready) {
+ item.ready = true;
+ state.history.unshift(publicRevision(item));
+ state.history.sort((a, b) => b.number - a.number);
+ record("ready", `Version ${item.number} is ready to explore`);
+ }
+ if (!state.latest || item.number > state.latest.number)
+ state.latest = publicRevision(item);
+ if (
+ state.candidate?.id === item.id &&
+ !building &&
+ !dirty &&
+ item.sourceVersion === sourceVersion
+ ) {
+ state.status = "ready";
+ state.error = null;
+ }
+ state.history.length = Math.min(state.history.length, 10);
+ } else if (body.type === "error") {
+ item.failed = true;
+ item.ready = false;
+ state.history = state.history.filter((entry) => entry.id !== item.id);
+ if (state.latest?.id === item.id) state.latest = state.history[0] || null;
+ if (state.candidate?.id === item.id) {
+ state.candidate = null;
+ state.status = "error";
+ state.error = {
+ kind: "runtime",
+ message: clean(body.message),
+ file: clean(body.file),
+ line: Number(body.line) || null,
+ };
+ }
+ record("error", `Version ${item.number}: ${clean(body.message)}`);
+ }
+ prune();
+ publish();
+ return true;
+ }
+ function assets() {
+ const files = [];
+ function scan(dir) {
+ if (!existsSync(dir) || files.length >= 120) return;
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ if (
+ entry.name.startsWith(".") ||
+ entry.isSymbolicLink() ||
+ files.length >= 120
+ )
+ continue;
+ const path = join(dir, entry.name);
+ if (entry.isDirectory()) scan(path);
+ else if (entry.isFile())
+ files.push({
+ name: entry.name,
+ path: relative(workspace, path).split(sep).join("/"),
+ size: statSync(path).size,
+ type: extname(path).slice(1),
+ });
+ }
+ }
+ scan(join(workspace, "src/assets"));
+ scan(join(workspace, "public"));
+ return files;
+ }
+ async function bodyOf(req) {
+ let body = "";
+ for await (const chunk of req) {
+ body += chunk;
+ if (body.length > 16384) throw new Error("Request too large");
+ }
+ return JSON.parse(body || "{}");
+ }
+ function serveFile(req, res, file) {
+ if (!file || statSync(file).size > 64 * 1024 * 1024)
+ return send(res, 404, { error: "Not found" });
+ res.writeHead(200, {
+ "content-type": MIME[extname(file)] || "application/octet-stream",
+ "cache-control": "no-store",
+ "x-content-type-options": "nosniff",
+ });
+ res.end(req.method === "HEAD" ? undefined : readFileSync(file));
+ }
+ const server = createServer(async (req, res) => {
+ try {
+ if (
+ !["127.0.0.1", "localhost"].includes(
+ (req.headers.host || "").split(":")[0],
+ )
+ )
+ return send(res, 403, { error: "Loopback host required" });
+ const url = new URL(req.url, base);
+ if (req.method === "POST") {
+ if (
+ req.headers["x-studio-token"] !== token ||
+ (req.headers.origin && req.headers.origin !== base)
+ )
+ return send(res, 403, { error: "Invalid studio request" });
+ const body = await bodyOf(req);
+ if (url.pathname === "/api/report") {
+ const accepted = report(body);
+ return send(res, accepted ? 200 : 404, { ok: accepted });
+ }
+ if (url.pathname === "/api/retain") {
+ if (
+ !/^[a-z0-9-]{1,80}$/i.test(body.client) ||
+ !Array.isArray(body.ids) ||
+ body.ids.length > 4
+ )
+ return send(res, 400, { error: "Invalid preview lease" });
+ if (leases.size >= 64 && !leases.has(body.client))
+ return send(res, 429, { error: "Too many preview clients" });
+ leases.set(body.client, {
+ ids: body.ids.filter(
+ (id) => typeof id === "string" && revisions.has(id),
+ ),
+ until: Date.now() + 90_000,
+ });
+ prune();
+ return send(res, 200, { ok: true });
+ }
+ if (url.pathname === "/api/export") {
+ const item = revisions.get(body.id);
+ if (!item?.ready || item.failed)
+ return send(res, 409, { error: "Choose a working version first" });
+ const out = join(workspace, "out");
+ mkdirSync(out, { recursive: true });
+ if (!inside(workspace, realpathSync(out)))
+ return send(res, 403, {
+ error: "Export folder must stay in the project",
+ });
+ let folder = `game-${item.number}`,
+ suffix = 1;
+ while (existsSync(join(out, folder)))
+ folder = `game-${item.number}-${++suffix}`;
+ cpSync(item.dir, join(out, folder), {
+ recursive: true,
+ errorOnExist: true,
+ force: false,
+ });
+ // The proof bridge is a spectator outside the studio; exports are otherwise standalone.
+ record("export", `Saved playable game to out/${folder}`);
+ publish();
+ return send(res, 200, { path: `out/${folder}` });
+ }
+ return send(res, 404, { error: "Not found" });
+ }
+ if (!["GET", "HEAD"].includes(req.method))
+ return send(res, 405, { error: "Method not allowed" });
+ if (url.pathname === "/favicon.ico") {
+ res.writeHead(204);
+ res.end();
+ return;
+ }
+ if (url.pathname === "/api/state") return send(res, 200, state);
+ if (url.pathname === "/api/assets") return send(res, 200, assets());
+ if (url.pathname === "/api/events") {
+ res.writeHead(200, {
+ "content-type": "text/event-stream",
+ "cache-control": "no-store",
+ connection: "keep-alive",
+ });
+ res.write(`event: state\ndata: ${JSON.stringify(state)}\n\n`);
+ clients.add(res);
+ req.on("close", () => clients.delete(res));
+ return;
+ }
+ if (url.pathname === "/") {
+ const html = readFileSync(join(HERE, "web/index.html"), "utf8").replace(
+ "__STUDIO_TOKEN__",
+ token,
+ );
+ return send(res, 200, html, "text/html; charset=utf-8");
+ }
+ if (url.pathname.startsWith("/__game/")) {
+ const [id, ...path] = decodeURIComponent(url.pathname.slice(8)).split(
+ "/",
+ );
+ const item = revisions.get(id);
+ return serveFile(
+ req,
+ res,
+ item && fileWithin(item.dir, path.join("/") || "index.html"),
+ );
+ }
+ if (url.pathname === "/api/asset") {
+ const path = url.searchParams.get("path") || "";
+ if (!assets().some((file) => file.path === path))
+ return send(res, 404, { error: "Not found" });
+ return serveFile(req, res, fileWithin(workspace, path));
+ }
+ if (["/studio.css", "/studio.js"].includes(url.pathname))
+ return serveFile(
+ req,
+ res,
+ fileWithin(join(HERE, "web"), url.pathname.slice(1)),
+ );
+ return send(res, 404, { error: "Not found" });
+ } catch (error) {
+ if (!res.headersSent) send(res, 400, { error: clean(error.message) });
+ else res.end();
+ }
+ });
+ await new Promise((resolve, reject) => {
+ server.once("error", reject);
+ server.listen(port, "127.0.0.1", resolve);
+ });
+ base = `http://127.0.0.1:${server.address().port}`;
+ facts();
+ record("open", "Studio opened");
+ publish();
+ watching = watch(workspace, { recursive: true }, (_, file) => {
+ if (!file) return;
+ const name = String(file).split(sep).join("/");
+ if (name === ".harness/progress.json" || name === "studio.json") {
+ facts();
+ publish();
+ // Studio labels and progress are metadata, not game source. Rebuilding here also turns
+ // delayed startup file events into a second, unnecessary game build on macOS.
+ return;
+ }
+ if (
+ /^(node_modules|\.git|\.harness|dist|out)(\/|$)/.test(name) ||
+ name.startsWith(".") ||
+ /(^|\/)\./.test(name)
+ )
+ return;
+ if (
+ !/\.(tsx?|jsx?|mjs|cjs|html|css|json|glsl|vert|frag|glb|gltf|png|jpe?g|webp|svg|mp3|wav|ogg|bin|wasm)$/i.test(
+ name,
+ )
+ )
+ return;
+ sourceVersion++;
+ if (building) dirty = true;
+ record("edit", name);
+ schedule();
+ });
+ const heartbeat = setInterval(() => {
+ prune();
+ for (const client of clients) client.write(": connected\n\n");
+ }, 15000);
+ heartbeat.unref();
+ schedule(0);
+ return {
+ url: base,
+ state,
+ token,
+ rebuild,
+ async close() {
+ stopped = true;
+ clearTimeout(timer);
+ clearInterval(heartbeat);
+ watching.close();
+ for (const client of clients) client.end();
+ server.closeAllConnections();
+ await new Promise((resolve) => server.close(resolve));
+ while (building) await new Promise((resolve) => setTimeout(resolve, 50));
+ rmSync(scratch, { recursive: true, force: true });
+ },
+ };
+}
+
+if (
+ process.argv[1] &&
+ resolve(process.argv[1]) === fileURLToPath(import.meta.url)
+) {
+ const workspace = process.env.HARNESS_WORKSPACE;
+ const port = Number(process.env.HARNESS_VIEWER_PORT);
+ if (!workspace || !Number.isInteger(port) || port < 1 || port > 65535)
+ throw new Error(
+ "HARNESS_WORKSPACE and a valid HARNESS_VIEWER_PORT are required",
+ );
+ const viewer = await startGameViewer({
+ workspace,
+ toolchain: process.env.HARNESS_DSH_DIR || workspace,
+ port,
+ });
+ console.log(`Game Viewer listening on ${viewer.url}`);
+ for (const signal of ["SIGTERM", "SIGINT"])
+ process.once(signal, () => viewer.close().then(() => process.exit(0)));
+}
diff --git a/store/viewers/game-viewer/viewer.sh b/store/viewers/game-viewer/viewer.sh
new file mode 100644
index 000000000..e5fd1d7ef
--- /dev/null
+++ b/store/viewers/game-viewer/viewer.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -euo pipefail
+here="$(cd "$(dirname "$0")" && pwd)"
+. "$here/runtimes.sh"
+harness_node 22.12 || exit 1
+exec node "$here/viewer.mjs"
diff --git a/store/viewers/game-viewer/web/bridge.js b/store/viewers/game-viewer/web/bridge.js
new file mode 100644
index 000000000..dbe5bc2e1
--- /dev/null
+++ b/store/viewers/game-viewer/web/bridge.js
@@ -0,0 +1,83 @@
+(() => {
+ if (window.parent === window) return;
+ const id = window.__studioRevision;
+ const tell = (type, detail = {}) =>
+ window.parent.postMessage(
+ { studio: true, id, type, ...detail },
+ location.origin,
+ );
+ let failed = false,
+ ready = false;
+ const fail = (message, file = "", line = 0) => {
+ failed = true;
+ tell("error", { message: String(message), file, line });
+ };
+ addEventListener(
+ "error",
+ (event) => {
+ if (event.target && event.target !== window)
+ fail(
+ `Could not load ${event.target.src || event.target.href || "an asset"}`,
+ );
+ else fail(event.message, event.filename, event.lineno);
+ },
+ true,
+ );
+ addEventListener("unhandledrejection", (event) =>
+ fail(
+ event.reason?.message || event.reason || "Unhandled promise rejection",
+ ),
+ );
+ addEventListener("harness:ready", () => {
+ requestAnimationFrame(() =>
+ requestAnimationFrame(() => {
+ if (!failed && !ready) {
+ ready = true;
+ tell("ready");
+ }
+ }),
+ );
+ });
+ addEventListener("message", (event) => {
+ if (
+ event.source !== parent ||
+ event.origin !== location.origin ||
+ !event.data?.studioCommand
+ )
+ return;
+ const game = window.harnessGame;
+ try {
+ if (event.data.action === "mode") game?.setMode?.(event.data.value);
+ if (event.data.action === "pause") game?.setPaused?.(!!event.data.value);
+ if (event.data.action === "restart") game?.restart?.();
+ } catch (error) {
+ fail(error.message);
+ }
+ });
+ addEventListener("keydown", (event) => {
+ if (event.code === "Escape")
+ queueMicrotask(() => {
+ if (!event.defaultPrevented) tell("escape");
+ });
+ });
+ setInterval(() => {
+ if (!ready || failed) return;
+ try {
+ const game = window.harnessGame;
+ tell("stats", {
+ stats: game?.stats?.() || {},
+ features: {
+ play: typeof game?.setMode === "function",
+ pause: typeof game?.setPaused === "function",
+ restart: typeof game?.restart === "function",
+ },
+ });
+ } catch {
+ /* statistics never stop the game */
+ }
+ }, 1000);
+ setTimeout(() => {
+ if (!ready && !failed)
+ tell("waiting", { message: "Waiting for the first rendered frame" });
+ }, 15000);
+})();
diff --git a/store/viewers/game-viewer/web/index.html b/store/viewers/game-viewer/web/index.html
new file mode 100644
index 000000000..11540dd72
--- /dev/null
+++ b/store/viewers/game-viewer/web/index.html
@@ -0,0 +1,119 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
+ <meta name="studio-token" content="__STUDIO_TOKEN__" />
+ <title>Game Studio</title>
+ <link rel="stylesheet" href="/studio.css" />
+ </head>
+ <body>
+ <main class="studio">
+ <header class="masthead">
+ <div>
+ <div class="eyebrow">
+ <svg viewBox="0 0 24 24" aria-hidden="true">
+ <path d="m12 2 9 5v10l-9 5-9-5V7Zm0 0v10m9-5-9 5-9-5m9 5v10" />
+ </svg>
+ GAME STUDIO
+ </div>
+ <h1 id="title">Your world</h1>
+ <p id="description">A place to make something playable.</p>
+ </div>
+ <span class="connection"><i></i><span id="connection">Live</span></span>
+ </header>
+ <section class="workbench" aria-label="Interactive game studio">
+ <div class="toolbar">
+ <div class="mode" aria-label="Preview mode">
+ <button id="explore" aria-pressed="true">Explore</button
+ ><button id="play" aria-pressed="false" disabled>
+ <svg viewBox="0 0 20 20"><path d="m6 3 11 7-11 7Z" /></svg>Play
+ </button>
+ </div>
+ <span class="version" id="version">Opening</span>
+ <div class="tools">
+ <button id="pause" class="icon" aria-label="Pause game" disabled>
+ <svg viewBox="0 0 24 24"><path d="M8 5v14M16 5v14" /></svg>
+ </button>
+ <button
+ id="restart"
+ class="icon"
+ aria-label="Restart game"
+ disabled
+ >
+ <svg viewBox="0 0 24 24">
+ <path d="M4 10a8 8 0 1 1 1 8M4 4v6h6" />
+ </svg>
+ </button>
+ <button
+ id="fit"
+ class="icon"
+ aria-label="Use widescreen preview"
+ aria-pressed="false"
+ >
+ <svg viewBox="0 0 24 24">
+ <rect x="3" y="5" width="18" height="14" rx="2" />
+ <path d="M8 9H6v2m10 4h2v-2" />
+ </svg>
+ </button>
+ <button id="fullscreen" class="icon" aria-label="Expand preview">
+ <svg viewBox="0 0 24 24">
+ <path d="M4 9V4h5m6 0h5v5m0 6v5h-5M9 20H4v-5" />
+ </svg>
+ </button>
+ </div>
+ </div>
+ <div id="stage" class="stage">
+ <div id="empty" class="empty">
+ <div class="orbit"><span></span><span></span><span></span></div>
+ <h2>Opening your world</h2>
+ <p>Your first playable preview is being built.</p>
+ </div>
+ <div id="frames" class="frames"></div>
+ <button id="update" class="update" hidden>
+ <i></i> A new version is ready <strong>View update ↗</strong>
+ </button>
+ <div id="notice" class="notice" role="status" hidden></div>
+ </div>
+ <div class="game-footer">
+ <span id="controls">Drag to explore the world</span
+ ><span id="stats"></span>
+ </div>
+ </section>
+ <section class="progress" aria-label="Build progress">
+ <div class="progress-heading">
+ <span id="status-dot" class="status-dot"></span
+ ><span id="progress-message">Opening the studio</span
+ ><button id="details" aria-expanded="false" aria-controls="drawer">
+ Studio log <span id="log-count"></span
+ ><span class="chevron">⌄</span>
+ </button>
+ </div>
+ <div class="phases" id="phases" aria-label="Current stage"></div>
+ <details id="error" class="error" hidden>
+ <summary>Update needs a fix</summary>
+ <p id="error-message"></p>
+ <pre id="error-frame"></pre>
+ </details>
+ </section>
+ <section id="drawer" class="drawer" hidden>
+ <div class="drawer-head" role="tablist">
+ <button role="tab" id="tab-activity" aria-selected="true">
+ Activity</button
+ ><button role="tab" id="tab-versions" aria-selected="false">
+ Versions</button
+ ><button role="tab" id="tab-assets" aria-selected="false">
+ Assets</button
+ ><button id="export" class="export" disabled>
+ Export game <span>↗</span>
+ </button>
+ </div>
+ <div id="activity" class="activity" role="tabpanel"></div>
+ <div id="versions" class="versions" role="tabpanel" hidden></div>
+ <div id="assets" class="assets" role="tabpanel" hidden></div>
+ </section>
+ <div id="toast" class="toast" role="status" hidden></div>
+ </main>
+ <script src="/studio.js" type="module"></script>
+ </body>
+</html>
diff --git a/store/viewers/game-viewer/web/studio.css b/store/viewers/game-viewer/web/studio.css
new file mode 100644
index 000000000..6981b925b
--- /dev/null
+++ b/store/viewers/game-viewer/web/studio.css
@@ -0,0 +1,666 @@
+:root {
+ color-scheme: dark;
+ --bg: #171a1d;
+ --surface: #202529;
+ --line: #ffffff12;
+ --text: #eef3f3;
+ --muted: #95a2a8;
+ --accent: #b3efd9;
+ --bad: #ffc198;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
+ font-synthesis: none;
+}
+* {
+ box-sizing: border-box;
+}
+body {
+ margin: 0;
+ background: var(--bg);
+ color: var(--text);
+}
+button {
+ font: inherit;
+ color: inherit;
+ cursor: pointer;
+ border: 0;
+ background: none;
+}
+button:disabled {
+ opacity: 0.35;
+ cursor: default;
+}
+button:focus-visible,
+summary:focus-visible {
+ outline: 2px solid var(--accent);
+ outline-offset: 3px;
+}
+button:not(:disabled):hover {
+ background: #ffffff0c;
+}
+svg {
+ width: 18px;
+ height: 18px;
+ fill: none;
+ stroke: currentColor;
+ stroke-width: 1.6;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ flex-shrink: 0;
+}
+[hidden] {
+ display: none !important;
+}
+.studio {
+ padding: 25px 25px 16px;
+ min-height: 100svh;
+ display: flex;
+ flex-direction: column;
+ gap: 15px;
+}
+.masthead {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 12px;
+}
+.eyebrow {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ color: var(--accent);
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 1.6px;
+}
+.eyebrow svg {
+ width: 16px;
+ height: 16px;
+}
+.eyebrow span {
+ color: #66767d;
+ border-left: 1px solid #425057;
+ margin-left: 5px;
+ padding-left: 12px;
+ font-weight: 500;
+ letter-spacing: 1.2px;
+}
+h1 {
+ font-size: clamp(22px, 3vw, 32px);
+ font-weight: 590;
+ letter-spacing: -1.1px;
+ margin: 12px 0 5px;
+}
+.masthead p {
+ font-size: 12px;
+ color: var(--muted);
+ margin: 0;
+ line-height: 1.5;
+}
+.connection {
+ font-size: 11px;
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ color: var(--accent);
+ margin-top: 3px;
+}
+.connection i,
+.update i {
+ width: 5px;
+ height: 5px;
+ border-radius: 50%;
+ background: currentColor;
+}
+.workbench {
+ border: 1px solid #ffffff14;
+ border-radius: 14px;
+ overflow: hidden;
+ box-shadow: 0 12px 35px #0002;
+ background: #10191e;
+ display: flex;
+ flex-direction: column;
+ min-height: 300px;
+ flex: 1;
+}
+.toolbar {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 8px 11px;
+ background: #202529;
+ min-height: 47px;
+ border-bottom: 1px solid var(--line);
+}
+.mode {
+ padding: 3px;
+ background: #141a1d;
+ border-radius: 8px;
+ display: flex;
+ gap: 2px;
+}
+.mode button {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ padding: 5px 12px;
+ border-radius: 5px;
+ font-size: 11px;
+ font-weight: 600;
+}
+.mode button[aria-pressed="true"] {
+ background: #35453f;
+ color: #cbffe8;
+}
+.mode button svg {
+ width: 11px;
+ height: 11px;
+ fill: currentColor;
+ stroke-width: 0;
+}
+.version {
+ font-size: 10px;
+ color: var(--muted);
+ white-space: nowrap;
+}
+.tools {
+ display: flex;
+ align-items: center;
+ margin-left: auto;
+ gap: 3px;
+}
+.icon {
+ display: grid;
+ place-items: center;
+ width: 29px;
+ height: 29px;
+ border-radius: 6px;
+ color: #b5c1c6;
+}
+.icon[aria-pressed="true"] {
+ background: #39483f;
+ color: var(--accent);
+}
+.icon svg {
+ width: 16px;
+ height: 16px;
+}
+.stage {
+ position: relative;
+ min-height: 330px;
+ flex: 1;
+ height: calc(100svh - 290px);
+ background: radial-gradient(ellipse at center, #25323a, #111b21);
+ overflow: hidden;
+}
+.frames {
+ position: absolute;
+ inset: 0;
+}
+.frames iframe {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ inset: 0;
+ border: 0;
+ opacity: 0;
+ pointer-events: none;
+ background: #18262c;
+ transition: opacity 0.2s;
+}
+.frames iframe.active {
+ opacity: 1;
+ pointer-events: auto;
+}
+.stage.widescreen .frames {
+ aspect-ratio: 16/9;
+ height: auto;
+ max-height: 100%;
+ inset: 50% 0 auto;
+ transform: translateY(-50%);
+}
+.game-footer {
+ padding: 9px 13px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 14px;
+ font-size: 10px;
+ line-height: 1.5;
+ color: #9cabb3;
+ background: #202529;
+ border-top: 1px solid var(--line);
+ min-height: 35px;
+}
+.game-footer #stats {
+ white-space: nowrap;
+ font-variant-numeric: tabular-nums;
+ color: #657c82;
+}
+.empty {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ color: #b9cdd3;
+ gap: 3px;
+ text-align: center;
+ padding: 30px;
+}
+.empty h2 {
+ font-size: 20px;
+ font-weight: 500;
+ letter-spacing: -0.4px;
+ margin: 15px 0 2px;
+}
+.empty p {
+ font-size: 12px;
+ color: #7e98a3;
+}
+.orbit {
+ width: 70px;
+ height: 70px;
+ position: relative;
+ transform: rotate(-22deg);
+}
+.orbit span {
+ position: absolute;
+ inset: 7px;
+ border: 1px solid #82bbaa60;
+ border-radius: 16px;
+ transform: rotate(45deg);
+}
+.orbit span:nth-child(2) {
+ inset: 19px;
+ border-color: #b3efd998;
+}
+.orbit span:nth-child(3) {
+ inset: 31px;
+ background: var(--accent);
+ border-radius: 3px;
+}
+.update {
+ position: absolute;
+ bottom: 17px;
+ left: 50%;
+ transform: translateX(-50%);
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding: 12px 15px;
+ border: 1px solid #a8ebce66;
+ background: #18362ef2 !important;
+ border-radius: 9px;
+ color: #d3ffe9;
+ box-shadow: 0 8px 28px #0005;
+ font-size: 11px;
+ white-space: nowrap;
+}
+.update strong {
+ font-weight: 650;
+ margin-left: 8px;
+}
+.notice {
+ position: absolute;
+ left: 14px;
+ right: 14px;
+ top: 13px;
+ padding: 10px 14px;
+ background: #3d2c20f2;
+ color: #ffe0b8;
+ font-size: 11px;
+ border-radius: 8px;
+ border: 1px solid #ffa44833;
+ pointer-events: none;
+}
+.progress {
+ padding: 0 2px;
+}
+.progress-heading {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ min-height: 24px;
+ font-size: 11px;
+ color: #b7c6cb;
+}
+.status-dot {
+ width: 5px;
+ height: 5px;
+ background: var(--accent);
+ border-radius: 50%;
+ flex-shrink: 0;
+}
+.status-dot.building {
+ animation: breathe 1.1s infinite;
+}
+.status-dot.error {
+ background: var(--bad);
+}
+#progress-message {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.progress-heading button {
+ margin-left: auto;
+ flex-shrink: 0;
+ font-size: 10px;
+ color: var(--muted);
+ padding: 5px 8px;
+ border-radius: 5px;
+}
+#log-count {
+ font-size: 9px;
+ padding-left: 5px;
+ color: #5e737c;
+}
+.chevron {
+ margin-left: 8px;
+}
+.phases {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ margin-top: 8px;
+ color: #62727a;
+ font-size: 9px;
+ letter-spacing: 0.1px;
+}
+.phase {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+}
+.phase:before {
+ content: "";
+ width: 4px;
+ height: 4px;
+ border-radius: 50%;
+ border: 1px solid #566872;
+}
+.phase.done {
+ color: #92b3a9;
+}
+.phase.done:before {
+ background: #729b8d;
+ border-color: #729b8d;
+}
+.phase.active {
+ color: #d6f8e8;
+}
+.phase.active:before {
+ background: var(--accent);
+ border-color: var(--accent);
+}
+.phase-line {
+ height: 1px;
+ background: #ffffff10;
+ flex: 1;
+ max-width: 28px;
+}
+details.error {
+ margin-top: 10px;
+ background: #392c2344;
+ border: 1px solid #e79b4026;
+ border-radius: 7px;
+ padding: 10px;
+ font-size: 11px;
+ color: var(--bad);
+}
+details.error summary {
+ cursor: pointer;
+}
+details.error p {
+ white-space: pre-wrap;
+ line-height: 1.5;
+ margin-bottom: 5px;
+}
+details.error pre {
+ color: #c9b5a4;
+ font-size: 10px;
+ white-space: pre-wrap;
+ max-height: 180px;
+ overflow: auto;
+}
+.drawer {
+ background: #202529;
+ border: 1px solid var(--line);
+ border-radius: 10px;
+ overflow: hidden;
+}
+.drawer-head {
+ padding: 7px 10px;
+ display: flex;
+ gap: 5px;
+ align-items: center;
+ border-bottom: 1px solid var(--line);
+}
+.drawer-head button {
+ border-radius: 5px;
+ padding: 6px 9px;
+ color: var(--muted);
+ font-size: 11px;
+}
+.drawer-head button[aria-selected="true"] {
+ background: #35453f;
+ color: var(--accent);
+}
+.drawer-head .export {
+ margin-left: auto;
+ color: var(--accent);
+}
+.export span {
+ margin-left: 8px;
+}
+.activity {
+ max-height: 205px;
+ overflow: auto;
+ padding: 7px 13px;
+}
+.event {
+ display: flex;
+ align-items: baseline;
+ gap: 10px;
+ font-size: 11px;
+ padding: 8px 0;
+ border-bottom: 1px solid #ffffff06;
+ line-height: 1.4;
+}
+.event:before {
+ content: "";
+ width: 4px;
+ height: 4px;
+ flex-shrink: 0;
+ border-radius: 50%;
+ background: #637982;
+}
+.event.ready:before {
+ background: var(--accent);
+}
+.event.error:before {
+ background: var(--bad);
+}
+.event span {
+ overflow-wrap: anywhere;
+}
+.event time {
+ margin-left: auto;
+ color: #637982;
+ font-size: 10px;
+ white-space: nowrap;
+ font-variant-numeric: tabular-nums;
+}
+.versions {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
+ gap: 9px;
+ padding: 12px;
+ max-height: 240px;
+ overflow: auto;
+}
+.checkpoint {
+ padding: 12px;
+ text-align: left;
+ border: 1px solid #ffffff12;
+ border-radius: 7px;
+ background: #182127;
+}
+.checkpoint.current {
+ border-color: #8fdab485;
+ background: #293d35;
+}
+.checkpoint b {
+ font-size: 12px;
+ display: block;
+ font-weight: 550;
+}
+.checkpoint p {
+ font-size: 10px;
+ line-height: 1.5;
+ color: var(--muted);
+ margin: 7px 0;
+}
+.checkpoint time {
+ font-size: 9px;
+ color: #657e89;
+}
+.assets {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
+ gap: 10px;
+ padding: 12px;
+ max-height: 240px;
+ overflow: auto;
+}
+.asset {
+ border: 1px solid var(--line);
+ border-radius: 6px;
+ overflow: hidden;
+ color: #c2d0d5;
+ text-decoration: none;
+ font-size: 10px;
+}
+.asset img {
+ width: 100%;
+ height: 85px;
+ object-fit: contain;
+ background: #11191e;
+ display: block;
+}
+.asset .file {
+ height: 62px;
+ display: grid;
+ place-items: center;
+ background: #182027;
+ font-size: 16px;
+ color: #8baaaf;
+}
+.asset span {
+ display: block;
+ padding: 8px;
+ overflow-wrap: anywhere;
+}
+.drawer-empty {
+ color: #758b94;
+ font-size: 11px;
+ padding: 12px;
+ grid-column: 1/-1;
+ line-height: 1.6;
+}
+.toast {
+ position: fixed;
+ left: 50%;
+ bottom: 22px;
+ transform: translateX(-50%);
+ max-width: 90%;
+ z-index: 10;
+ background: #d3f8e5;
+ color: #213a30;
+ padding: 12px 17px;
+ box-shadow: 0 5px 30px #0005;
+ border-radius: 8px;
+ font-size: 12px;
+}
+.studio.expanded .masthead,
+.studio.expanded .progress,
+.studio.expanded .drawer {
+ display: none;
+}
+.studio.expanded {
+ padding: 0;
+ gap: 0;
+ height: 100svh;
+}
+.studio.expanded .workbench {
+ border-radius: 0;
+ height: 100%;
+}
+.studio.expanded .stage {
+ height: auto;
+}
+@keyframes breathe {
+ 50% {
+ opacity: 0.35;
+ }
+}
+@media (prefers-reduced-motion: reduce) {
+ * {
+ animation: none !important;
+ transition: none !important;
+ }
+}
+@media (max-width: 600px) {
+ .studio {
+ padding: 16px 13px 12px;
+ gap: 12px;
+ }
+ .eyebrow span {
+ display: none;
+ }
+ .masthead p {
+ font-size: 11px;
+ }
+ .toolbar {
+ gap: 7px;
+ padding: 7px;
+ }
+ .tools {
+ gap: 0;
+ }
+ .icon {
+ width: 26px;
+ }
+ .mode button {
+ padding: 5px 9px;
+ }
+ .version {
+ font-size: 9px;
+ }
+ .game-footer {
+ font-size: 9px;
+ padding: 8px 10px;
+ }
+ .stage {
+ height: calc(100svh - 250px);
+ min-height: 270px;
+ }
+ .update {
+ gap: 6px;
+ font-size: 10px;
+ padding: 10px;
+ }
+ .update strong {
+ margin-left: 0;
+ }
+ .phases {
+ gap: 6px;
+ }
+ .phase-line {
+ max-width: 15px;
+ }
+ #stats {
+ display: none;
+ }
+}
diff --git a/store/viewers/game-viewer/web/studio.js b/store/viewers/game-viewer/web/studio.js
new file mode 100644
index 000000000..867c37256
--- /dev/null
+++ b/store/viewers/game-viewer/web/studio.js
@@ -0,0 +1,429 @@
+const $ = (id) => document.getElementById(id);
+const token = document.querySelector("meta[name=studio-token]").content;
+const frames = new Map();
+const offered = new Set(),
+ client = crypto.randomUUID();
+let state,
+ active = null,
+ mode = "explore",
+ paused = false,
+ pending = null,
+ requested = null,
+ selectedTab = "activity",
+ toastTimer,
+ lastLease = "",
+ followLatest = true;
+const phases = [
+ ["concept", "Imagine"],
+ ["world", "Build"],
+ ["play", "Play"],
+ ["polish", "Polish"],
+ ["check", "Check"],
+];
+const time = (value) =>
+ new Date(value).toLocaleTimeString([], {
+ hour: "2-digit",
+ minute: "2-digit",
+ second: "2-digit",
+ });
+function text(tag, value, className) {
+ const el = document.createElement(tag);
+ el.textContent = String(value ?? "");
+ if (className) el.className = className;
+ return el;
+}
+function toast(message) {
+ $("toast").textContent = message;
+ $("toast").hidden = false;
+ clearTimeout(toastTimer);
+ toastTimer = setTimeout(() => ($("toast").hidden = true), 4000);
+}
+async function post(path, body) {
+ const response = await fetch(path, {
+ method: "POST",
+ headers: { "content-type": "application/json", "x-studio-token": token },
+ body: JSON.stringify(body),
+ });
+ const data = await response.json();
+ if (!response.ok) throw new Error(data.error || "Request failed");
+ return data;
+}
+function command(action, value) {
+ frames
+ .get(active)
+ ?.frame.contentWindow?.postMessage(
+ { studioCommand: true, action, value },
+ location.origin,
+ );
+}
+function retain(force = false) {
+ const ids = [
+ ...new Set(
+ [active, pending, requested, state?.candidate?.id].filter(
+ (id) => id && frames.has(id),
+ ),
+ ),
+ ];
+ const key = ids.slice().sort().join(",");
+ if (!force && key === lastLease) return;
+ lastLease = key;
+ void post("/api/retain", { client, ids }).catch(() => {
+ lastLease = "";
+ });
+}
+function cleanup() {
+ const keep = new Set([active, pending, requested, state?.candidate?.id]);
+ for (const [id, entry] of frames)
+ if (!keep.has(id)) {
+ entry.frame.remove();
+ frames.delete(id);
+ }
+ retain();
+}
+setInterval(() => retain(true), 30000);
+function ensure(revision) {
+ if (!revision || frames.has(revision.id)) return;
+ offered.add(revision.id);
+ const frame = document.createElement("iframe");
+ frame.src = revision.url;
+ frame.title = `Game preview, version ${revision.number}`;
+ frame.tabIndex = -1;
+ frame.setAttribute("inert", "");
+ frame.setAttribute("allow", "autoplay; fullscreen; gamepad");
+ frames.set(revision.id, { frame, revision, ready: false, failed: false });
+ $("frames").append(frame);
+ retain();
+}
+function activate(id) {
+ const entry = frames.get(id);
+ if (!entry?.ready) return;
+ for (const [key, item] of frames) {
+ const show = key === id;
+ item.frame.classList.toggle("active", show);
+ item.frame.tabIndex = show ? 0 : -1;
+ if (show) item.frame.removeAttribute("inert");
+ else {
+ item.frame.setAttribute("inert", "");
+ item.frame.contentWindow?.postMessage(
+ { studioCommand: true, action: "pause", value: true },
+ location.origin,
+ );
+ }
+ }
+ active = id;
+ pending = null;
+ requested = null;
+ $("update").hidden = true;
+ $("empty").hidden = true;
+ $("version").textContent = `Version ${entry.revision.number}`;
+ $("export").disabled = false;
+ setMode("explore");
+ setPaused(false);
+ renderVersions();
+ cleanup();
+}
+function setMode(value) {
+ mode = value;
+ $("explore").setAttribute("aria-pressed", String(value === "explore"));
+ $("play").setAttribute("aria-pressed", String(value === "play"));
+ command("mode", value);
+ $("controls").textContent =
+ value === "play"
+ ? state?.project.controls || "Click the game to use its controls"
+ : "Drag to orbit · Scroll to look closer";
+ if (value === "play") frames.get(active)?.frame.contentWindow?.focus();
+}
+function setPaused(value) {
+ paused = value;
+ command("pause", value);
+ $("pause").setAttribute("aria-label", value ? "Resume game" : "Pause game");
+ $("pause").setAttribute("aria-pressed", String(value));
+}
+$("explore").onclick = () => setMode("explore");
+$("play").onclick = () => setMode("play");
+$("pause").onclick = () => setPaused(!paused);
+$("restart").onclick = () => {
+ command("restart");
+ setPaused(false);
+ if (mode === "play") frames.get(active)?.frame.contentWindow?.focus();
+};
+$("update").onclick = () => {
+ followLatest = true;
+ activate(pending);
+};
+$("fit").onclick = () => {
+ const on = $("stage").classList.toggle("widescreen");
+ $("fit").setAttribute("aria-pressed", String(on));
+ $("fit").setAttribute(
+ "aria-label",
+ on ? "Fit preview to pane" : "Use widescreen preview",
+ );
+};
+function setExpanded(on) {
+ document.querySelector(".studio").classList.toggle("expanded", on);
+ $("fullscreen").setAttribute(
+ "aria-label",
+ on ? "Restore studio" : "Expand preview",
+ );
+}
+$("fullscreen").onclick = () =>
+ setExpanded(
+ !document.querySelector(".studio").classList.contains("expanded"),
+ );
+addEventListener("keydown", (event) => {
+ if (event.code === "Escape") setExpanded(false);
+});
+$("details").onclick = () => {
+ const show = $("drawer").hidden;
+ $("drawer").hidden = !show;
+ $("details").setAttribute("aria-expanded", String(show));
+ if (show && selectedTab === "assets") loadAssets();
+};
+for (const tab of ["activity", "versions", "assets"])
+ $("tab-" + tab).onclick = () => {
+ selectedTab = tab;
+ for (const other of ["activity", "versions", "assets"]) {
+ $(other).hidden = other !== tab;
+ $("tab-" + other).setAttribute("aria-selected", String(other === tab));
+ }
+ if (tab === "assets") loadAssets();
+ };
+$("export").onclick = async () => {
+ try {
+ const result = await post("/api/export", { id: active });
+ toast(`Saved to ${result.path}`);
+ } catch (error) {
+ toast(error.message);
+ }
+};
+function renderVersions() {
+ $("versions").replaceChildren();
+ if (!state?.history.length) {
+ $("versions").append(
+ text(
+ "p",
+ "Working versions appear here after they render.",
+ "drawer-empty",
+ ),
+ );
+ return;
+ }
+ for (const version of state.history) {
+ const button = document.createElement("button");
+ button.className = "checkpoint" + (active === version.id ? " current" : "");
+ button.append(
+ text("b", `Version ${version.number}`),
+ text("p", version.label),
+ text("time", time(version.at)),
+ );
+ button.onclick = () => {
+ followLatest = false;
+ requested = version.id;
+ ensure(version);
+ activate(version.id);
+ };
+ $("versions").append(button);
+ }
+}
+async function loadAssets() {
+ try {
+ const files = await (await fetch("/api/assets")).json();
+ $("assets").replaceChildren();
+ if (!files.length) {
+ $("assets").append(
+ text(
+ "p",
+ "This world uses procedural geometry. Imported images, models, and audio will appear here.",
+ "drawer-empty",
+ ),
+ );
+ return;
+ }
+ for (const file of files) {
+ const link = document.createElement("a");
+ link.className = "asset";
+ link.href = "/api/asset?path=" + encodeURIComponent(file.path);
+ link.download = file.name;
+ if (["png", "jpg", "jpeg", "webp", "svg"].includes(file.type)) {
+ const img = document.createElement("img");
+ img.src = link.href;
+ img.alt = file.name;
+ link.append(img);
+ } else
+ link.append(text("div", file.type.toUpperCase() || "FILE", "file"));
+ link.append(text("span", file.name));
+ $("assets").append(link);
+ }
+ } catch {
+ $("assets").replaceChildren(
+ text(
+ "p",
+ "Could not load assets. Reopen this tab to try again.",
+ "drawer-empty",
+ ),
+ );
+ }
+}
+function render(next) {
+ state = next;
+ $("title").textContent = state.project.title;
+ $("description").textContent = state.project.description;
+ document.title = state.project.title + " · Game Studio";
+ $("connection").textContent = "Live";
+ document.querySelector(".connection").style.color = "";
+ const building = state.status === "building";
+ $("status-dot").className =
+ "status-dot" + (building ? " building" : state.error ? " error" : "");
+ $("progress-message").textContent = state.error
+ ? "Update needs a fix"
+ : building
+ ? "Building the next version"
+ : state.progress.message ||
+ (state.latest
+ ? "Your world is ready to explore"
+ : "Checking the first rendered frame");
+ const phaseIndex = phases.findIndex(([id]) => id === state.progress.phase);
+ $("phases").replaceChildren();
+ phases.forEach(([id, name], index) => {
+ if (index) $("phases").append(text("span", "", "phase-line"));
+ const step = text(
+ "span",
+ name,
+ "phase" +
+ (index < phaseIndex ? " done" : index === phaseIndex ? " active" : ""),
+ );
+ if (index === phaseIndex) step.setAttribute("aria-current", "step");
+ $("phases").append(step);
+ });
+ $("error").hidden = !state.error;
+ if (state.error) {
+ $("error-message").textContent = state.error.message;
+ $("error-frame").textContent =
+ state.error.frame ||
+ [state.error.file, state.error.line].filter(Boolean).join(":");
+ }
+ $("notice").hidden = !state.error || !active;
+ if (state.error && active)
+ $("notice").textContent =
+ "The next update needs a fix. You can keep playing this version.";
+ if (state.error && !active) {
+ $("empty").querySelector("h2").textContent = "The first build needs a fix";
+ $("empty").querySelector("p").textContent =
+ "The details below are available to your agent.";
+ }
+ $("activity").replaceChildren();
+ for (const event of state.activity) {
+ const row = text("div", "", `event ${event.kind}`);
+ row.append(text("span", event.message), text("time", time(event.at)));
+ $("activity").append(row);
+ }
+ $("log-count").textContent = state.activity.length;
+ renderVersions();
+ if (state.candidate && !offered.has(state.candidate.id))
+ ensure(state.candidate);
+ else if (
+ !active &&
+ !state.candidate &&
+ state.latest &&
+ !offered.has(state.latest.id)
+ ) {
+ requested = state.latest.id;
+ ensure(state.latest);
+ }
+ cleanup();
+}
+addEventListener("message", async (event) => {
+ if (event.origin !== location.origin || !event.data?.studio) return;
+ const data = event.data,
+ entry = frames.get(data.id);
+ if (!entry || event.source !== entry.frame.contentWindow) return;
+ if (data.type === "escape" && data.id === active) setExpanded(false);
+ if (data.type === "ready") {
+ if (entry.failed) return;
+ entry.ready = true;
+ try {
+ await post("/api/report", { id: data.id, type: "ready" });
+ } catch {
+ return;
+ }
+ if (entry.failed || frames.get(data.id) !== entry) return;
+ const newer =
+ entry.revision.number > (frames.get(active)?.revision.number || 0);
+ if (
+ !active ||
+ requested === data.id ||
+ (newer && mode !== "play" && followLatest)
+ )
+ activate(data.id);
+ else if (
+ newer &&
+ entry.revision.number > (frames.get(pending)?.revision.number || 0)
+ ) {
+ pending = data.id;
+ $("update").hidden = false;
+ }
+ cleanup();
+ }
+ if (data.type === "error") {
+ entry.failed = true;
+ entry.ready = false;
+ try {
+ await post("/api/report", {
+ id: data.id,
+ type: "error",
+ message: data.message,
+ file: data.file,
+ line: data.line,
+ });
+ } catch {}
+ if (pending === data.id) {
+ pending = null;
+ $("update").hidden = true;
+ }
+ if (requested === data.id) {
+ requested = null;
+ toast("That version could not start. Your current preview is unchanged.");
+ }
+ if (active === data.id) {
+ active = null;
+ $("empty").hidden = false;
+ $("export").disabled = true;
+ for (const id of ["play", "pause", "restart"]) $(id).disabled = true;
+ const fallback = state?.history.find((version) => version.id !== data.id);
+ if (fallback) {
+ requested = fallback.id;
+ ensure(fallback);
+ activate(fallback.id);
+ $("empty").querySelector("h2").textContent =
+ `Restoring version ${fallback.number}`;
+ toast("The preview stopped. Restoring the last working version.");
+ } else {
+ $("empty").querySelector("h2").textContent = "The preview needs a fix";
+ $("empty").querySelector("p").textContent =
+ "The details below are available to your agent.";
+ }
+ }
+ cleanup();
+ }
+ if (data.type === "stats" && data.id === active) {
+ const fps = Number(data.stats?.fps),
+ objects = Number(data.stats?.objects);
+ $("stats").textContent = [
+ Number.isFinite(objects) ? `${objects} objects` : "",
+ Number.isFinite(fps) ? `${Math.round(fps)} fps` : "",
+ ]
+ .filter(Boolean)
+ .join(" · ");
+ $("play").disabled = !data.features.play;
+ $("pause").disabled = !data.features.pause;
+ $("restart").disabled = !data.features.restart;
+ }
+ if (data.type === "waiting" && !active)
+ $("empty").querySelector("p").textContent = data.message;
+});
+const events = new EventSource("/api/events");
+events.addEventListener("state", (event) => render(JSON.parse(event.data)));
+events.onerror = () => {
+ $("connection").textContent = "Reconnecting";
+ document.querySelector(".connection").style.color = "#ffc198";
+};