# PRESSING PLANT — the engine editor / prompt assembler (spec for build) The tool that turns "describe an idea" into consistent Flow clips wired into a playable game. One editor, many game projects (Record Store Guy, Beyond Morp: The Movie: The Game, ...). Name: a pressing plant is where records get made. ## Architecture (match house style: zero-build, stdlib only) - `editor/server.py` — python3 stdlib HTTP server. Static-serves `editor/` UI + the active project dir, plus JSON API: - `GET /api/projects` — list projects (see registry below) - `GET /api/project//` / `POST .../save` — read/write JSON + files inside that project only (path-traversal guarded, `.json`/`.md`/media only) - `POST /api/llm` — proxy to LLM for the assistant (see LLM section; keeps keys server-side, avoids CORS) - `POST /api/flux` — submit a still to MODELBEAST `flux_local` and poll (uses MB_TOKEN from env/.env on disk; concept art + ingredient stills stay free) - `POST /api/clip` — accept an uploaded/downloaded Flow clip, run ffmpeg normalize (tools/postprocess.sh behaviour inline: 1280x720/24fps/h264+aac, +faststart), store to `engine/clips/_.mp4`, return duration - `editor/index.html` + `editor.js` + `editor.css` — vanilla SPA, tabs below. Reuses the game's arcade styling language so it feels like one product. ## Project registry `projects.json` at repo root: `{ "recordstoreguy": ".", "beyondmorp": "../beyondmorp" }`. A project dir must contain: `production/prompts/{blocks.json,looks/,shots/}`, `engine/scenes.json`, `engine/clips/`, `bible/concept/`. `POST /api/projects/new` scaffolds that tree (this is how beyondmorp gets born; its seeder — see BEYONDMORP.md — imports morpquest room JSONs into location blocks). ## Tabs (build in this order — each is independently useful) ### 1. Cast & Places (blocks.json editor) Card grid of characters and locations/sets. Each card: name, the verbatim prompt block (textarea), and attached reference images (from `bible/concept/`, displayed; "Generate still" button → `/api/flux` with the block + chosen look via promptc logic; "this is the Flow ingredient" checkbox per look — tracks which ingredient stills exist per look, warns when a shot uses a character with no ingredient for the active look). Images can also be dragged IN (John's own refs/sketches) — they become inputs: "Describe this into a block" button sends the image to the LLM (vision-capable route) to draft the prompt block. ### 2. Map (story graph) Node canvas (drag boxes, draw arrows — SVG, no lib): nodes = scenes, arrows = onSuccess flow; death branches implicit. Node color = status: idea → shot-spec'd → generated → inserted → tuned. This IS the game's structure editor: saving writes both `map.json` (positions) and the scene skeletons into `engine/scenes.json`. Adventure-game projects (beyondmorp) can import an existing room map as the starting graph. ### 3. Shot desk (the assembler — the heart) Left: shot list (from `production/prompts/shots/`). Middle: the shot JSON as a form (world, set, characters, action sentence, camera, duration, qte windows, kind action|death, notes). Right, live-updating: - **Compiled Flow prompt** for the active look (port promptc.py's compile to JS — same blocks, identical output; keep promptc.py the CLI twin) - **Flow checklist**: which ingredient stills to attach (by name, with thumbnails), Veo tier to use (fast/quality per shot flag), "copy prompt" button, and a "log gen" mini-form that appends to `production/SHOTLOG.csv` (scene, take, credits, verdict) so the budget ledger stays honest without leaving the editor. - Alt-look preview: dropdown re-compiles the same shot in any look. ### 4. Ingest & QTE tuner Drop a downloaded Flow clip onto a shot → `/api/clip` normalizes + names + wires it into scenes.json → embedded `