import { NextRequest, NextResponse } from 'next/server'; import { createSupervisorClient } from '@/lib/supervisor/client'; // POST - Send signal to all processes export async function POST(request: NextRequest) { try { const body = await request.json(); const { signal } = body; if (!signal) { return NextResponse.json( { error: 'Signal is required' }, { status: 400 } ); } const client = createSupervisorClient(); const results = await client.signalAllProcesses(signal); return NextResponse.json({ success: true, message: `Signal ${signal} sent to all processes`, results, }); } catch (error: any) { console.error('Supervisor signal all processes error:', error); return NextResponse.json( { error: error.message || 'Failed to send signal to all processes' }, { status: 500 } ); } }