// PRESENT MODE (lib/report/present.mjs; present.spec.ts): a cut to present as slides. // // present-fixture c01 a clip (playvid, the fixture's synthetic window, cached in out/clips-raw) // -- a marker after c01 opens "The posts" -- // p-1 presentchan-x/1: a reply to a PRIVATE account (its parent drawn above it, blurred), a // made-up name in its words ("Quentin Example", redacted by render.posts.redact), a // picture (posts-media/…/1_1.png) censored below its middle, NARRATED by a 2 s take // p-2 presentchan-x/2: words only, a day later // t01 a teaser, two lines // the deck on. Never written by the spec. // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, writeFileSync } from "node:fs"; import { spawnSync } from "node:child_process"; import path from "node:path"; const ff = (args) => { const r = spawnSync("ffmpeg", ["-v", "error", "-y", ...args]); if (r.status !== 0) throw new Error(`ffmpeg ${args.join(" ")}: ${String(r.stderr)}`); }; export const PRESENT_CHANNEL = "presentchan-x"; /** @param {{ reports: string, deckManifest: Function, cachedWindow: string }} o */ export function makePresentFixture({ reports, deckManifest, cachedWindow }) { const name = "present-fixture"; const dir = path.join(reports, name); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", "playvid_0.00-9.00.mp4")); const media = path.join(dir, "posts-media", PRESENT_CHANNEL, "1"); mkdirSync(media, { recursive: true }); ff(["-f", "lavfi", "-i", "testsrc=size=320x180:rate=1:duration=1", "-frames:v", "1", path.join(media, "1_1.png")]); const takes = path.join(dir, "narration", "posts", "1"); mkdirSync(takes, { recursive: true }); ff(["-f", "lavfi", "-i", "sine=frequency=262:sample_rate=48000:duration=2", "-ac", "1", "-c:a", "pcm_s16le", path.join(takes, "take-1.orpheus-zac.wav")]); const base = (id, o) => ({ type: "post", id: `p-${id}`, post: `${PRESENT_CHANNEL}/${id}`, platform: "x", author: "Present Subject", handle: "presentsubject", url: `https://x.com/presentsubject/status/${id}`, engagement: { likes: 7, reposts: 2 }, subjects: ["presentsubject"], ...o, }); const timeline = [ { type: "clip", id: "c01", video: "playvid", start: 1.0, end: 3.0, cite: 1, section: 0, lock: true, quote: "This is a complete sentence.", onscreen: { title: "24 Oct 2020" } }, base("1", { date: "2026-10-30T12:00:00.000Z", text: "@someone_private Yes, and Quentin Example was there too. Here is the picture.", parents: [{ id: "9", author: "Private Person", handle: "someone_private", date: "2026-10-30T11:30:00.000Z", text: "is this really true?", url: "https://x.com/someone_private/status/9" }], media: [{ src: `posts-media/${PRESENT_CHANNEL}/1/1_1.png`, kind: "image", width: 320, height: 180, blur: { on: true, band: { below: 0.5 } } }], narration: { script: "Yes, and he was there too. Here is the picture.", takes: [{ file: "narration/posts/1/take-1.orpheus-zac.wav", engine: "orpheus", voice: "zac", seconds: 2, script: "Yes, and he was there too.", at: "2026-11-02T00:00:00.000Z" }], pick: 0, }, }), base("2", { date: "2026-10-31T09:00:00.000Z", text: "One more post, a day later, with nothing but words in it." }), { type: "teaser", id: "t01", seconds: 4, lines: ["Next Season", "The Big Build"], tail: "?" }, ]; const m = deckManifest(name, "The Present Fixture", timeline); m.provenance = { ...m.provenance, channelSlug: PRESENT_CHANNEL }; m.render.fetchPad = 0; m.render.lockedEdges = false; m.render.posts = { redact: [{ term: "Quentin Example", note: "a made-up name" }] }; m.render.chrome = { ...m.render.chrome, deck: { ...(m.render.chrome?.deck ?? {}), markers: [{ after: "c01", label: "The posts" }] } }; writeFileSync(path.join(dir, "video.manifest.json"), JSON.stringify(m, null, 2) + "\n"); return { dir }; }