import type { ResolvedItem } from './resolve'; import type { VisualQaAssert, VisualQaFrame } from './types'; import type { PreviewCandidate } from './vehiclePreview'; export interface RenderContext { resolved: ResolvedItem; /** Backend API origin, e.g. https://helix-backend-api-helix3.up.railway.app */ apiBase: string; /** Website origin, e.g. https://new.helixgame.com */ webBase: string; /** Directory frames are written to (bundle directory). Frame `file` paths are relative to it. */ outDir: string; /** Playwright storageState of a signed-in QA account (Try Now and the customiser need one). */ storageState?: string; executablePath?: string; /** Restrict to these host/base item ids (add-ons, wearables). Default: every declared host/base. */ hostIds?: string[]; /** The signed-in account's own copy of the item, when the item is not Published (held for visual QA, delisted): Try Now * serves such an item only to its owner, from their copy (`&tryInstance=`). */ ownedInstanceId?: string | null; /** The world-walk stage (wearables, character add-ons, avatars): false = skipped (`--no-world-walk`). Default on. */ worldWalk?: boolean; log: (key: string, value: unknown) => void; /** `helix vehicle preview`: render this on-disk candidate (package + GLB) through the proxy item named by `resolved` * instead of the proxy's own car. Vehicles only; changes nothing about the published route. */ preview?: { candidate: PreviewCandidate; /** Route phases to run (exterior, poses, articulation, steering, cabin, drive, occupants). Default: everything but occupants. */ phases?: string[]; /** Also render the daylight paint-sample frames (paint/paint.*.jpg: body paint only, lit as Try Now lights it) for the paint gate. */ paint?: boolean; /** Also render the candidate's front-left wheel face square-on (wheelface/candidate.jpg: the tyre centred, filling WHEEL_FACE_FILL of the half-height) for the wheel-design gate. */ wheelFace?: boolean; /** `--addon`: measure the fitted add-ons only (no boarding, no stance); `baselineOnly` is the stock car's tuning pass * that the tune-op judgement compares against. */ baselineOnly?: boolean; stockTuning?: Record | null; toleranceCm?: number; }; } export interface RenderResult { route: 'test-grounds' | 'customizer' | 'item-viewer' | 'emote-preview' | 'home-preview'; url: string; frames: VisualQaFrame[]; asserts: VisualQaAssert[]; facts: Record; subjects: Array<{ id: string; title: string; role: 'host' | 'base' | 'addon'; }>; /** Anything that prevented a complete, trustworthy render. Non-empty => the run fails closed. */ errors: string[]; renderer: string | null; engineVersion: string | null; fetchedAssets: string[]; } export type RenderRoute = (ctx: RenderContext) => Promise;