import { NextResponse } from 'next/server';
import {
  CHARACTER_SPEC_FIELDS,
  FILENAME_SCHEMA,
  PACK_LABELS,
  PACK_ORDER,
  PACK_TEMPLATES,
  VIDEO_TEMPLATES,
} from '@/lib/templates';

export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';

export async function GET() {
  return NextResponse.json({
    filenameSchema: FILENAME_SCHEMA,
    characterSpecFields: CHARACTER_SPEC_FIELDS,
    packs: PACK_ORDER.map(kind => ({
      kind,
      label: PACK_LABELS[kind],
      templates: PACK_TEMPLATES[kind],
      requiredCount: PACK_TEMPLATES[kind].filter(template => template.required).length,
      totalCount: PACK_TEMPLATES[kind].length,
    })),
    videos: VIDEO_TEMPLATES,
  });
}
