Add headless CLI render surface for agent authoring - #20
Conversation
Agents can inspect curated Look/Camera/Motion Presets and dump an offline kit (schema, catalog, annotated examples) without opening the editor or launching Chromium.
Materialize Scene Documents from curated Looks / files / default with optional camera, motion, and RFC 7396 merge-patch; validate returns stable schema and semantic codes under --json without silent recovery.
Pass PNG/JPEG dimensions into core semantic checks so texture_too_large surfaces under --json, and share JSON file reads across compose/validate.
Mounts the existing Exporter path without editor chrome and exposes a thin bridge so the CLI driver can load a Scene Document, bind Source Media, and capture on a secure 127.0.0.1 origin.
Wire `mockstudio render` through Playwright + the minimal capture page so agents get Stage-sized PNG/JPG/WebP ingredients with the CLI feedback envelope.
…ity. One render grammar now exports H.264 MP4 at Stage size, accepts Source Video with --at/--preview, and emits sparse progress plus the full exit-code contract.
Agents can request VP9+alpha WebM (and MOV ProRes when Chromium can encode it) via the shared Exporter, with a clear Stage-transparency gate so opaque Mockups never yield silent opaque files under alpha extensions.
Catch Look/Device/Artboard regressions with MAE soft-compare on GPU runners while non-GPU CI keeps encode/export smoke only.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 995676b. Configure here.
| height: size.height, | ||
| format, | ||
| transparent: false, | ||
| } |
There was a problem hiding this comment.
Transparent stage stills stay opaque
Medium Severity
buildStillExportRequest always sets transparent: false, so headless still exports never ask the shared Exporter for alpha even when the Scene Document uses a transparent Stage and the format supports it (PNG/WebP). Output keeps an opaque backdrop instead of matching editor transparent still behavior.
Reviewed by Cursor Bugbot for commit 995676b. Configure here.
| document: loaded.document, | ||
| probedWidth: probed.media.width, | ||
| probedHeight: probed.media.height, | ||
| }) |
There was a problem hiding this comment.
Still render ignores interrupt
Medium Severity
Video render forwards AbortSignal through capture and maps SIGINT to exit 130, but the still path never passes the signal into runStillRender or captureStillInBrowser / withHeadlessPage. A long Playwright still can keep running after interrupt instead of exiting with the documented interrupted code.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 995676b. Configure here.
| unsubscribe() | ||
| resolve() | ||
| }) | ||
| }) |
There was a problem hiding this comment.
Ready gate may hang forever
Medium Severity
waitForDisplayedSourceMedia waits until displayedSourceAspect becomes non-null whenever Source Media is bound, with no timeout or failure path. If the texture never publishes an aspect (slow decode, GPU upload failure, or a load error without updating aspect), whenReady and CLI capture never resolve.
Reviewed by Cursor Bugbot for commit 995676b. Configure here.
… render (#21) ## Summary - Transparent Stage + PNG/WebP stills now ask the Exporter for alpha (same gate as the editor; JPEG stays opaque). - Still capture forwards `AbortSignal` and maps abort to exit 130, matching video encode. - Headless ready gate times out after 30s if bound Source Media never publishes a display aspect (was an unbounded hang). These were local follow-ups left uncommitted when #20 merged. ## Test plan - [x] Unit coverage for still `transparent`, still abort → 130, and ready-gate timeout - [ ] `pnpm test` locally (or CI) on this branch - [ ] Optional smoke: `mockstudio render` a transparent-Stage PNG and Ctrl+C a still render <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes export alpha semantics and CLI interrupt/headless readiness behavior on the render path; risk is mitigated by unit tests and parity with existing video abort handling. > > **Overview** > Headless still rendering now matches the editor for **transparency**: `buildStillExportRequest` sets `transparent` when the Stage is transparent and the format is PNG or WebP (JPEG stays opaque). > > **Still capture** accepts an `AbortSignal`, passes it through Playwright’s `withHeadlessPage`, and maps abort to **exit 130** with the same interrupted JSON envelope as video encode. > > The headless **ready gate** no longer waits forever when bound Source Media never publishes a display aspect—it **rejects after 30s** (configurable in tests via `displayedMediaTimeoutMs`). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e2140bc. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->


Summary
mockstudioCLI (compose/validate/render/presets/kit) so agents can author Scene Documents and export framed still/video ingredients without the editor UI.--jsonfeedback, sparse progress, exit codes, optional alpha WebM/MOV, and Stage-sized defaults.Closes the implementation track under
.scratch/headless-render/(issues 01–07).Test plan
pnpm typecheck && pnpm lint && pnpm test && pnpm buildpnpm exec mockstudio --helpand per-command help for compose/validate/render/presets/kit--mediaand--json--fps,--at,--preview, and stderr progressNote
Medium Risk
Large new render/encode surface and Playwright boot path, but output still goes through the shared Exporter with broad contract tests; GPU goldens are opt-in only.
Overview
Introduces a
mockstudiobinary withcompose,validate,render,presets, andkitso Scene Documents can be built and exported without the editor.renderdrives the same Exporter as the UI via a localhost?renderpage, Playwright, andwindow.__mockstudio(document load, media bind, ready gate, capture bytes).Core gains compose/validate/learning-kit/merge-patch helpers plus CLI-oriented export rules: Stage short-edge sizing, WebP stills, WebM/MOV alpha video gated on a transparent Stage, and structured
--json/ exit codes for agents.CI splits non-GPU verify (Playwright + ffmpeg encode smoke) from an opt-in GPU job for soft still goldens (MAE vs committed PNGs); goldens are skipped on default runners.
Reviewed by Cursor Bugbot for commit 995676b. Bugbot is set up for automated code reviews on this repo. Configure here.