A small Phaser + TypeScript visualizer that turns Codex processes into 8-bit characters. Each agent animates while working and shows a completion emote when done.
bun install
bun run devOpen the dev server URL printed by Vite.
- Phaser renders a simple 2D scene with pixel-art sprites.
- Agents are managed by a small state machine (
idle,working,done). - Events drive the visuals. You can emit events from the console or via WebSocket.
type CodexEvent =
| { type: 'spawn'; id: string; name?: string }
| { type: 'work'; id: string; label?: string }
| { type: 'idle'; id: string; label?: string }
| { type: 'done'; id: string; label?: string }
| { type: 'remove'; id: string }window.codexViz.spawn('codex-1', 'Builder')
window.codexViz.work('codex-1', 'Compiling')
window.codexViz.done('codex-1', 'Complete')
window.codexViz.remove('codex-1')Add ?ws=ws://localhost:8787 to the URL. The visualizer expects JSON messages containing either a single CodexEvent object or an array of events.
Example message payload:
{"type":"spawn","id":"codex-2","name":"Planner"}?mock=0- disable the built-in mock generator.?ws=ws://localhost:8787- stream events from a WebSocket server.?icon=7- select a different icon tile frompublic/assets/icons.png.
Sprites are CC0 and sourced from OpenGameArt. See ASSET_LICENSES.md.
src/main.ts- Phaser bootstrap, mock generator, WebSocket bridge.src/visualizer.ts- Phaser scene, agent logic, asset slicing.public/assets/- sprite sheets and icons.