import { NextResponse } from 'next/server'
import { getSystemConfig } from '@/lib/config'

export async function GET() {
  try {
    const config = await getSystemConfig()
    const available = !!(
      config.WEB_SEARCH_PROVIDER ||
      config.BRAVE_SEARCH_API_KEY ||
      config.SEARXNG_URL ||
      config.JINA_API_KEY
    )
    return NextResponse.json({ available })
  } catch {
    return NextResponse.json({ available: false })
  }
}
