import { listPieces } from "@/lib/pieces"; import { listCases } from "@/lib/research/boards"; import { researchCaseHref } from "@/lib/research/hrefs"; export const dynamic = "force-dynamic"; // What the ⌘K palette can jump to that is not a fixed place: every piece, as // { id, title, href, kind, stage, lifecycle }, and every research case (R2: // `c:`, its board). The places, tools and create actions are the // palette's own (components/shell/JumpPalette.tsx). export async function GET() { const [pieces, cases] = await Promise.all([listPieces(), listCases().catch(() => [])]); return Response.json( { pieces: [ ...pieces.map((p) => ({ id: p.id, title: p.title, href: p.href, kind: p.kind, site: p.site, stage: p.stage, lifecycle: p.lifecycle, })), ...cases.map((c) => ({ id: c.piece, title: c.title, href: researchCaseHref(c.id), kind: "case", site: null, stage: "research", lifecycle: "active" })), ], }, { headers: { "cache-control": "no-store" } }, ); }