| import type { RenderProgress } from "@/types"; | |
| const progressMap = new Map<string, RenderProgress>(); | |
| export function setProgress(id: string, progress: RenderProgress) { | |
| progressMap.set(id, progress); | |
| // ponytail: every pipeline stage already routes through here, so one line here | |
| // logs the whole run instead of scattering console.log across the pipeline | |
| console.log( | |
| `[reel ${id.slice(0, 8)}] ${progress.percent}% ${progress.stage} — ${progress.message}`, | |
| ); | |
| } | |
| export function getProgress(id: string): RenderProgress | null { | |
| return progressMap.get(id) ?? null; | |
| } | |
| export function clearProgress(id: string) { | |
| progressMap.delete(id); | |
| } | |