import { NextResponse } from 'next/server';
import { FileDialogService, } from '../../../../../../../packages/core/src/infrastructure/services/file-dialog.service.js';
export async function POST() {
    const service = new FileDialogService();
    try {
        const files = service.pickFiles();
        return NextResponse.json({ files, cancelled: files === null });
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to open file dialog';
        return NextResponse.json({ files: null, cancelled: false, error: message }, { status: 500 });
    }
}
