/**
 * DELETE /api/terminal/[sessionId]
 *
 * Kills and removes a terminal session. Idempotent.
 */
import { resolve } from '../../../../lib/server-container.js';
export const dynamic = 'force-dynamic';
export async function DELETE(_request, { params }) {
    const { sessionId } = await params;
    try {
        const service = resolve('ITerminalSessionService');
        service.close(sessionId);
        return Response.json({ ok: true });
    }
    catch (error) {
        // eslint-disable-next-line no-console
        console.error('[DELETE /api/terminal/:sessionId]', error);
        return Response.json({ error: String(error) }, { status: 500 });
    }
}
