import { getLLMText, getSource } from '@/lib/source';
import { getCurrentSession } from '@/lib/session';

export async function GET() {
  const session = await getCurrentSession();
  if (!session) return new Response('Unauthorized', { status: 401 });

  const scan = getSource('member').getPages().map(getLLMText);
  const scanned = await Promise.all(scan);

  return new Response(scanned.join('\n\n'));
}
