/**
 * GET /api/settings/print-agents/status  (session) — { enabled } : whether this instance has
 * any Print Agent / binding at all. The client plugin only starts polling job states when true,
 * so an instance without agents (our own prod) pays nothing.
 */
import { requireAdminSession } from '../../../utils/printAgentAuth'
import { hasAnyBindings, listAgents } from '../../../utils/printSpoolDb'

export default defineEventHandler(async (event) => {
  const session = await requireAdminSession(event)
  const enabled = hasAnyBindings() || listAgents(session.clientId).length > 0
  return { status: 200, enabled }
})
