import Link from "next/link"; import { listDocuments, readDocument } from "@/lib/wiki"; import { ChatBubble } from "@/components/chat-bubble"; import { AuthBar } from "@/components/auth-bar"; import { BatchProgressBanner } from "@/components/batch-progress-banner"; import { getLocale } from "@/components/locale-toggle"; import { summarize, pickPitch } from "@/lib/doc-summary"; import { DocListFilters } from "@/components/doc-list-filters"; import { BureauSnapshot } from "@/components/bureau-snapshot"; // Read wiki/ filesystem at request time, not build time. export const dynamic = "force-dynamic"; export default async function Home() { const ids = await listDocuments(); const locale = await getLocale(); const summaryLang: "pt" | "en" = locale === "en" ? "en" : "pt"; const docs = await Promise.all( ids.map(async (id) => { const f = await readDocument(id); return { id, title: (f?.fm.canonical_title as string) ?? id, pages: (f?.fm.page_count as number) ?? 0, collection: (f?.fm.collection as string) ?? "uncategorized", classification: (f?.fm.highest_classification as string) ?? "โ€”", summary: pickPitch(f?.fm as Record | undefined, summaryLang) ?? (f?.body ? summarize(f.body, summaryLang) : ""), }; }), ); return (
// THE DISCLOSURE BUREAU // CLASSIFIED ARCHIVE //
๐Ÿ” search ๐Ÿ“… timeline ๐Ÿ•ธ graph ๐Ÿ“Š stats ๐Ÿ”Ž bureau ๐Ÿ“ˆ batch

โ– The Disclosure Bureau

{docs.length} declassified documents ยท {docs.reduce((s, d) => s + d.pages, 0)} pages ยท investigated by 8 AI detectives (Holmes ยท Locard ยท Dupin ยท Schneier ยท Poirot ยท Taleb ยท Tetlock ยท Case-Writer)

); }