Files
wyucandClaude Code 0128212da4 feat(render-service): add POST /preview endpoint (fixes render_scene_preview 404) (#1285)
* feat(render-service): add PreviewGate admission control for previews

Independent admission gate (global in-flight cap + per-identity cap) so
synchronous previews never compete with the MP4 export queue. Release is
idempotent so every route exit path can call it safely.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* feat(render-service): add single-page preview renderer

Renders a scene to a PNG via SlideCanvas + static markup using the existing
Chromium executable configuration, egress policy, and semaphore
infrastructure, with a deadline/AbortSignal.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* feat(render-service): add preview config and resource pixel limits

Adds previewDeadlineMs / previewMaxInFlight / previewMaxPerUser config and
resource-profile viewport pixel limits for previews; declares the renderer
runtime dependencies installed with the render-service container.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* feat(render-service): add POST /preview endpoint

Wires the preview endpoint: declared-size rejection, gate admission before
buffering, byte-capped payload parsing, scene/stage/viewport validation,
deadline/cancellation, PNG response, and 400/413/429/504/500 mapping. Fixes
the render_scene_preview tool's broken link (previously 404).

Co-Authored-By: Claude Code <noreply@anthropic.com>

* fix preview rendering and deadlines

* fix(render-service): enforce preview deadline, memory bound, and shared Chromium limit

- Stalled preview uploads now observe the deadline signal, error the consumer,
  and cancel the reader; deadline aborts map to 504 and release the permit.
- Previews retain the extraction permit through rendering so parsed payloads
  cannot accumulate beyond the memory admission bound.
- RenderCoordinator owns a shared execution semaphore so previews and MP4
  renders respect the same global Chromium concurrency limit.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* fix(render-service): harden preview admission and rendering

* docs(render-service): define the preview deployment contract

* fix(render-service): enforce self-contained previews

* fix(render-service): allow fragment CSS URLs in previews

* fix(render-service): allow background-only previews

* fix(render-service): control malformed preview rejections

* style(render-service): apply prettier formatting after rebase

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-03 07:00:27 -04:00

20 lines
446 B
JSON

{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"lib": ["ES2022", "DOM"],
"moduleResolution": "bundler",
"outDir": "dist",
"rootDir": "src",
"strict": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"isolatedModules": true,
"skipLibCheck": true,
"types": ["node"]
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}