import { listMissions, runMission } from '../../../lib/missions.js';
export const dynamic='force-dynamic'; export const runtime='nodejs';
export async function GET(request){ const u=new URL(request.url); return Response.json(listMissions(u.searchParams.get('project_id'))); }
export async function POST(request){ try{ const b=await request.json(); const out=runMission(b.slug,b.project_id,b.opts||{}); return Response.json(out, {status:out.ok===false?400:201}); }catch(e){ return Response.json({error:e.message},{status:400}); } }
