Files
cadSet/text-to-cad/apps/cad-agent-studio/src/app/api/tasks/route.ts
T
2026-07-27 16:00:36 +08:00

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 });
}