import type { Frame, Page } from 'playwright'; type Vec3 = [number, number, number]; /** Emissive intensity (x the brightest channel of the emissive colour) at which a lens counts as lit. Off reads 0; lit reads 0.8 to 3. */ export declare const LAMP_LIT_MIN = 0.15; /** An indicator lens that never drops below this over a full blink period (>= 2.2 s, see runLampSweep) does not blink. */ export declare const LAMP_BLINK_OFF_MAX = 0.15; /** A lit indicator must reach the front and the rear quarter of the car's length (same fraction as the static check). */ export declare const LAMP_END_QUARTER = 0.25; /** Emissive snapshots per blinking state, 100 ms apart: >= 2.2 s, one full period at 0.5 Hz plus margin. */ export declare const BLINK_SNAPSHOTS = 23; /** ... and at least this many RENDERED frames (a stalled page advances its blink phase in frames, not in wall-clock time): 2.3 s at 60 fps. */ export declare const BLINK_MIN_FRAMES = 138; export declare const INSTALL_LAMP_PROBE = "(() => {\n const G = globalThis;\n if (G.__vqaLamps) return true;\n if (!G.__vqaVeh) return false;\n const L = {};\n const rd = (v) => Math.round(v * 1000) / 1000;\n /**\n * Every mesh under the car that can light (an emissive colour or map) or that a row addresses (slots), with the aliases\n * the runtime indexes it by (its name, its material names, its named ancestors), the emissive it is drawing now, and its\n * body-frame box. A batched part keeps its real mesh in the graph (hidden) and the batch reads it, so the mesh's own\n * material is what the presenter drives; the instance's original/hidden materials are read too and the brightest wins.\n */\n L.snapshot = (slots) => {\n const P = G.__vqaVeh; const root = P.root(); root.updateMatrixWorld(true);\n const inv = P.inv(); const proxies = P.proxies(); const want = new Set(slots);\n const meshes = [];\n root.traverse((o) => {\n if (!o.isMesh || o.isBatchedMesh || !o.geometry) return;\n const ms = (Array.isArray(o.material) ? o.material : [o.material]).filter(Boolean);\n const inst = proxies.get(o);\n const alt = inst ? [inst.originalMaterial, inst.hiddenMaterial].filter(Boolean) : [];\n const aliases = [];\n if (o.name) aliases.push(o.name);\n for (const m of ms.concat(alt)) if (m.name && !aliases.includes(m.name)) aliases.push(m.name);\n for (let a = o.parent; a && a !== root; a = a.parent) if (a.name && !aliases.includes(a.name)) aliases.push(a.name);\n let capable = false, own = 0, other = 0;\n const lumOf = (m) => { if (!m || !m.emissive) return 0; const mx = Math.max(m.emissive.r, m.emissive.g, m.emissive.b); if (mx > 0.001 || m.emissiveMap) capable = true; return (typeof m.emissiveIntensity === 'number' ? m.emissiveIntensity : 1) * mx; };\n for (const m of ms) own = Math.max(own, lumOf(m));\n for (const m of alt) other = Math.max(other, lumOf(m));\n const addressed = aliases.some((a) => want.has(a));\n if (!capable && !addressed) return;\n let box = null;\n try {\n const pts = []; P.meshPoints(o, inv, 300, pts);\n if (pts.length) { const mn = [Infinity, Infinity, Infinity], mx = [-Infinity, -Infinity, -Infinity]; for (let j = 0; j < pts.length; j += 3) for (let a = 0; a < 3; a++) { mn[a] = Math.min(mn[a], pts[j + a]); mx[a] = Math.max(mx[a], pts[j + a]); } box = { min: mn.map(rd), max: mx.map(rd) }; }\n } catch (err) { box = null; }\n meshes.push({ name: o.name || '', aliases, capable, lum: rd(Math.max(own, other)), own: rd(own), inst: rd(other), box });\n });\n let lights = [], bits = null;\n try { const e = P.e(); lights = Object.entries(e.lightState || {}).filter(([, v]) => v === true).map(([k]) => k); bits = e.switchBits; } catch (err) { /* none */ }\n return { meshes, lights, bits };\n };\n G.__vqaLamps = L;\n return true;\n})()"; export interface LampMesh { name: string; aliases: string[]; capable: boolean; lum: number; own?: number; inst?: number; box: { min: Vec3; max: Vec3; } | null; } export interface LampSnapshot { meshes: LampMesh[]; lights: string[]; bits: number | null; } export interface LampSample { state: string; snaps: LampSnapshot[]; /** the car could not be put in this state (a manual gearbox does not select reverse from the brake key): not measured, not a failure */ unreached?: string; } /** Which runtime state lights each signal of the platform's control bundle, and what to call it. */ export interface LampSignalPlan { signal: string; label: string; states: string[]; kind: 'steady' | 'blink'; } export declare function planForSignal(signal: string): LampSignalPlan | undefined; export interface LampPlan { /** Every slot a lamp row addresses. */ slots: string[]; /** signal -> plan + the slots driven by it */ functions: Array; /** rows whose signal is not a lamp signal this sweep knows (wipers, cabin light, ...): not judged */ skipped: string[]; } export declare function planLamps(pkg: Record | null): LampPlan; export interface LampFunctionVerdict { signal: string; label: string; state: string; slots: Array<{ slot: string; nodes: Array<{ name: string; peak: number; trough: number; zMin: number | null; zMax: number | null; lit: boolean; }>; lit: boolean; why: string | null; }>; pass: boolean; blinks?: boolean; /** body-frame z reach of the lit nodes (indicators/hazards) */ reach?: { zMin: number; zMax: number; front: boolean; rear: boolean; } | null; failures: string[]; } export interface LampJudgement { pass: boolean; detail: string; functions: LampFunctionVerdict[]; darkLenses: Array<{ name: string; peak: number; }>; failures: string[]; skipped: string[]; /** functions whose state the car could not be put in; named, never failed */ unmeasured: string[]; } /** * Judge the recorded lamp states. `bounds` is the car's body-frame box (z forward). Every blocking rule names the lamp * that stayed dark; an indicator must blink and, per side, light geometry that reaches the front AND the rear quarter. */ export declare function judgeLamps(input: { plan: LampPlan; samples: LampSample[]; bounds: { min: Vec3; max: Vec3; } | null; }): LampJudgement; export interface LampSweep { samples: LampSample[]; /** facts for the brake-at-standstill decision: what the brake lens and the runtime's brake lamp said at rest, parked with the driver seated */ atRest: { lights: string[]; bits: number | null; } | null; errors: string[]; } /** * Press the lamp keys as the seated driver and record the lens emissive per state. `plan.slots` empty means the * package has no lamp rows: nothing to sweep. Leaves headlamps, fog and indicators off. */ export declare function runLampSweep(page: Page, frame: Frame, plan: LampPlan): Promise; export {};