import { apiRoute } from '@/lib/api/handler'
import { getLiveReadiness } from '@/lib/services/integration-service'

export const dynamic = 'force-dynamic'

/**
 * What each source would need before it could carry live decisions (§9).
 *
 * A read-only report over configuration that already exists. It contains no credential —
 * only the *name* of the environment variable each connector reads one from — and it
 * describes a connector as live only when a real endpoint is reachable and delivering.
 */
export const GET = apiRoute({ permission: 'integrations.read', limit: 60 }, async () =>
  getLiveReadiness(),
)
