import { NextRequest, NextResponse } from 'next/server'; import { createSupervisorClient } from '@/lib/supervisor/client'; // POST - Start all processes export async function POST(request: NextRequest) { try { const body = await request.json().catch(() => ({})); const wait = body.wait ?? true; const client = createSupervisorClient(); const results = await client.startAllProcesses(wait); return NextResponse.json({ success: true, message: 'Started all processes', results, }); } catch (error: any) { console.error('Supervisor start all processes error:', error); return NextResponse.json( { error: error.message || 'Failed to start all processes' }, { status: 500 } ); } }