import { seenPress } from "@/lib/library/presses.mjs"; import { ask, press } from "@/lib/library/route"; import { markSeen } from "@/lib/library/seen.mjs"; import { REPORTS_ROOT } from "@/lib/paths.mjs"; export const dynamic = "force-dynamic"; // POST { lib, topics: [, …] } -> { ok, slug, topics: { : { seenAt, previous? } } } // // MARK SEEN (lane posts-library): the one thing that moves "new since last // visit", and the operator's (the page's press only: lib/library/route.ts). // umtool's OWN state (REPORTS_ROOT/.umtool/posts-library.json, // lib/library/seen.mjs), never a file of the library. The library and every // topic are checked through the editor's listing first: a name the editor // does not hold is refused and nothing is marked. export async function POST(request: Request) { return press(request, (body) => seenPress(ask, body, { mark: (lib: string, topics: string[]) => markSeen(REPORTS_ROOT, { slug: lib, topics }) })); }