// A live pre-clip project's record, `/live-preclip.json` // (lib/report/clipsLive.mjs writes it; plans/live-preclip.md). Its own small // module so the clip editor's view reads it without the scaffold behind it. import { readFile } from "node:fs/promises"; import path from "node:path"; export const LIVE_PROJECT_FILE = "live-preclip.json"; /** The project's live record, or null (not a live project). */ export async function readLiveProject(dir) { try { const d = JSON.parse(await readFile(path.join(dir, LIVE_PROJECT_FILE), "utf8")); return d && typeof d === "object" && !Array.isArray(d) && d.version === 1 ? d : null; } catch { return null; } }