# Assistant demo catalogue

Open `/mcp/demo/` on RCWeb, or run `node src/main/site/mcp/demo/serve.cjs` and open the printed loopback URL. The page reuses `/docs/architecture/style.css` and its small navigation script; those shared files are not modified.

## Provenance

The initial `codex-simulation` run is assistant-authored. Codex implements each original prompt using retained ES5 canvas scenes, then the capture runner executes an assistant-style `execute_javascript` call in an isolated browser viewer. It records the actual tool return value and a completion message. The local fixture implements view reset and resource cleanup, without joining a real RCWeb room. These are real browser screenshots, not generated pictures, but are not outputs from Gemini or another externally called model. They are reviewed reference examples, not an untouched first attempt or a benchmark. Model version, API latency and usage are deliberately not invented.

The screenshot freezes the implementation at its recorded `sampleTime`. Replay links run its animation. Time-based signage such as a ten-minute countdown follows its original timing. The clock has a fixed capture-date origin to make its replay reproducible. Static signs remain static when requested.

## Refresh this collection

From the repository root:

```powershell
node src/main/site/mcp/demo/capture.cjs
node src/main/site/mcp/tests/demo-catalog.browser.test.cjs
```

Capture can be restricted to one category (`demo`, `signage`, `education`) or a full scene ID, for example `education/moon-phases`. A successful capture automatically rebuilds the catalogue so new screenshots appear immediately after a browser refresh. It uses the project's existing Playwright/Edge setup, starts a temporary loopback static server and closes both afterward. No packages, credentials or paid calls are needed. All foreign-origin browser requests are blocked. Only screenshots and conversation records belonging to the selected run are written. The catalogue builder reads the current three idea arrays from `../index.html`; `education-ideas.json` adds learning objectives.

## Add a model run

### Recorded Gemini Flash Lite run

`runs/gemini-flash-lite/` records a live run through the built-in Google demo using `models/gemini-flash-lite-latest`. The demo is now called Demo (Google) and defaults to Gemini 3.5 Flash Lite. Before using `capture-gemini.cjs` for a new model, adapt it to select that model explicitly and write to a new run directory. Live capture requires explicit authorisation.

The recorded run contains screenshots, provider responses, tool payloads and results, and reported model IDs. The published conversations omit reasoning metadata. Failed generations are documented in `failures.json` and their individual conversation files. Initial screenshots were taken five seconds after completion, and motion detection compared two frames two seconds apart. The recorded JavaScript preserves the original viewer-context guards and requires that context to run.

### Other runs

Run `node src/main/site/mcp/demo/capture-gemini.cjs --luna` to capture `openai/gpt-6-luna` through Demo (OpenRouter). Results are saved in `runs/gpt-6-luna/` and added to the catalogue after each successful capture.

Run `node src/main/site/mcp/demo/capture-gemini.cjs --haiku` to capture `anthropic/claude-haiku-5.5` through Demo (OpenRouter). The runner saves results separately under `runs/claude-haiku-5-5/` and supports the same category and demo ID filters. Use `--16k --low-reasoning` for retries that reached the 8K output limit. The retry requests and settings are preserved in the conversation records.

With a local RCWeb server running, `node src/main/site/mcp/demo/capture-gemini.cjs --hydrogen` captures the Gemini 4 Hydrogen run through Demo (Google). The runner selects `models/gemini-4-hydrogen` explicitly, opens dedicated viewer rooms and skips already captured prompts. Add a category or demo ID to restrict the batch. The catalogue is rebuilt after each successful capture.

For timeout retries, `--shorter-replies` sets the assistant’s output limit to 8K and `--low-reasoning` adds `reasoning_effort: "low"` to requests sent through the local proxy. The original prompt and request settings are recorded with each capture. The batch runner stops on HTTP 429, so it can be resumed after the proxy rate window resets.

Use a new directory under `runs/`; never overwrite another model's records. Add a `run.json` with a stable directory-matching `id`, a display `label`, `model` identity (exact provider-returned model ID when available), `method`, `date`, `description`, `viewport` and honest `notes`.

Add `results.json` as an array of result objects. Each result identifies `demoId` (`category/slug`), the exact `prompt` and its SHA-256 `promptSha256`, and catalogue-relative `screenshot`, `conversation`, `source` and optional `preview` links. Include `capturedAt`, `viewport`, `sampleTime`, `duration`, `animated`, `reply` and `toolSummary`. Keep implementation files and transcripts for the new run separate. Do not point a new model result at the Codex replay. Record failed or missing results honestly; omit an unsuccessful result from this success gallery rather than supplying a substitute image. Preserve failure evidence with the run and explain it in its notes.

Run `build-catalog.cjs` to discover every run automatically. The model/run selector shows each independently, labels missing captures and flags results generated with older prompts. The builder never calls a model or fabricates missing results. Result asset links must remain local to this directory.

## Files

- `index.html`: generated static catalogue, readable without JavaScript.
- `catalogue.js`, `style.css`: search, category/run selection, copy buttons and layout refinements.
- `catalogue.json`: generated idea and run index for inspection.
- `scenes/`: the retained Codex implementations, organised by category.
- `preview.html`, `preview.css`, `player.js`: local animation replay with Pause and Restart.
- `runs/`: separately attributed screenshots, exact conversation records and metadata.
- `read-ideas.cjs`, `build-catalog.cjs`: read the live prompts and rebuild the static page.
- `capture.cjs`, `serve.cjs`: isolated browser capture and loopback preview.

Keep browser code ES5, simple CSS and local artwork. The QR scenes use RCWeb's existing approved QR helper. Never replace functional QR codes with decorative patterns.
