/**
 * Feature-scoped stop API — kills the active agent session.
 *
 * `featureId` is a polymorphic scope key: a feature UUID, "repo-<id>", or "global".
 */
import { NextResponse } from 'next/server';
import { resolve } from '../../../../../../lib/server-container.js';
export const dynamic = 'force-dynamic';
export async function POST(_request, { params }) {
    try {
        const { featureId } = await params;
        const useCase = resolve('StopInteractiveSessionUseCase');
        await useCase.execute({ featureId });
        return NextResponse.json({ ok: true });
    }
    catch (error) {
        // eslint-disable-next-line no-console
        console.error('[POST /api/interactive/chat/:featureId/stop]', error);
        return NextResponse.json({ error: error instanceof Error ? error.message : 'Internal server error' }, { status: 500 });
    }
}
