17 lines
574 B
TypeScript
17 lines
574 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
import { ensureTask, upsertManifest } from "@/lib/task-store";
|
|
|
|
export const runtime = "nodejs";
|
|
|
|
export async function POST(request: NextRequest) {
|
|
const body = await request.json().catch(() => ({}));
|
|
const task = await ensureTask(body.taskId);
|
|
const manifest = await upsertManifest(task.taskId, {
|
|
request: String(body.request || "CAD Agent Studio task"),
|
|
studio: {
|
|
createdAt: new Date().toISOString(),
|
|
},
|
|
});
|
|
return NextResponse.json({ taskId: task.taskId, dir: task.dir, manifest });
|
|
}
|