spb/autoscholar
Public
1import { listProjects, listTemplates } from "@autoscholar/core";2import { db } from "@/lib/server/db";3import { NewResearchForm } from "./NewResearchForm";45export const dynamic = "force-dynamic";67export default async function NewResearch({8 searchParams,9}: {10 searchParams: Promise<{ template?: string; project?: string }>;11}) {12 const sp = await searchParams;13 const d = db();14 const projects = (await listProjects(d)).map((p) => ({15 id: p.project.id,16 title: p.project.title,17 discipline: p.project.discipline,18 }));19 const templates = (await listTemplates(d)).map((t) => ({20 slug: t.slug,21 name: t.name,22 mode: t.mode,23 content: t.content,24 }));25 const env = {26 defaultBudget: Number(process.env.DEFAULT_MAX_BUDGET_USD ?? 25),27 defaultRuntime: Number(process.env.DEFAULT_MAX_RUNTIME_MINUTES ?? 240),28 model: process.env.ANTHROPIC_MODEL ?? "claude-opus-5-5",29 };30 return (31 <div className="space-y-6">32 <header>33 <p className="eyebrow">Launch</p>34 <h1 className="serif mt-1 text-2xl font-semibold">New research</h1>35 <p className="muted mt-1 max-w-2xl text-sm">36 Upload or paste the paper-specific CLAUDE.md. The platform validates it, freezes it as an immutable37 version, builds a server-side manifest and launches an idempotent run on a MacLustr worker.38 </p>39 </header>40 <NewResearchForm41 projects={projects}42 templates={templates}43 initialTemplate={sp.template}44 initialProject={sp.project}45 defaults={env}46 />47 </div>48 );49}50