import { NextResponse } from "next/server";
import { killAllAutomation } from "@/lib/automation/engine";
import { apiRouteErrorResponse } from "@/lib/auth/api";

export async function POST() {
  try {
    const count = await killAllAutomation();
    return NextResponse.json({ success: true, disabledAccounts: count });
  } catch (error) {
    return apiRouteErrorResponse(error, "automation/kill");
  }
}
