import Link from "next/link"; import AppHeader from "@/components/shell/AppHeader"; import AppRail from "@/components/shell/AppRail"; import RunView from "@/components/research/RunView"; import { EmptyState } from "@/components/ui/empty-state"; import { researchHref } from "@/lib/research/hrefs"; import { readRunView } from "@/lib/research/runs"; import { runsHref } from "@/lib/research/runs-hrefs"; import type { RunView as View } from "@/lib/research/runs-types"; export const dynamic = "force-dynamic"; // A TRANSPARENT RUN (plans/umtool-redesign.md, R3; canvas "Transparent run"): // one sweep iteration of the article store, step by step -- live while it // runs, a replay when it is done (components/research/RunView.tsx). `?run=k` // picks one of several runs; `?view=model` opens the model log (every call // the run made, demo epic D3) instead of the steps. Read only. A static segment under /research, so // it wins over the case page (`runs` is a reserved case id). export default async function RunPage({ params, searchParams, }: { params: Promise<{ article: string; n: string }>; searchParams: Promise>; }) { const { article: raw, n } = await params; const sp = await searchParams; const article = decodeURIComponent(raw); const want = Number(typeof sp.run === "string" ? sp.run : ""); let view: View | null = null; let error: { status: number; message: string } | null = null; try { view = await readRunView(article, Number(n), Number.isInteger(want) && want > 0 ? want : null); } catch (e) { error = { status: (e as { status?: number }).status ?? 500, message: (e as Error).message }; } return (
{view ? ( ) : ( <>
{error?.message}{" "} Every run
)}
); }