import { RENDER_MODE_REMINDER, clockOf, describeRenderPriority, readRenderPriority, renderPriorityFile, } from "yt-dlp-transcript-common/lib/renderPriority.mjs"; import { REPO_ROOT } from "@/lib/paths.mjs"; export const dynamic = "force-dynamic"; // RENDER MODE as it stands (common/lib/renderPriority.mjs; AGENTS.md "Render // mode"), for the take panel's banner. Read only: it is turned on by a take // started with "Give renders the machine" (`umtool take … --priority`), by // `umtool render-mode on`, or by `pnpm ops render-mode`. The token is not // answered — a page has no use for it. // // GET -> { held, what, since, until, take, lanesHeld, lanesSkipped, lanesError, note, reminder } export async function GET() { const s = readRenderPriority(renderPriorityFile(process.env, { root: REPO_ROOT })); const st = s.held ? s.state : null; return Response.json( { held: Boolean(st), what: st ? describeRenderPriority(st) : null, since: st ? clockOf(st.since) : null, until: st?.until ? clockOf(st.until) : null, take: st?.holder ? { project: st.holder.project ?? null, take: st.holder.take ?? null } : null, lanesHeld: st?.lanesHeld ?? [], lanesSkipped: st?.lanesSkipped ?? [], lanesError: st?.lanesError ?? null, note: st?.note ?? null, reminder: RENDER_MODE_REMINDER, }, { headers: { "cache-control": "no-store" } }, ); }