/**
 * Health check endpoint — includes LiteLLM proxy status.
 */

import { NextResponse } from "next/server";
import { checkLlmReachable, llmStatus } from "@optage/sdk";

export async function GET() {
  await checkLlmReachable();
  return NextResponse.json({
    status: "ok",
    agent: "repopilot",
    version: "1.0.0",
    llm_proxy_reachable: llmStatus.proxyReachable,
    llm_proxy_url: llmStatus.proxyUrl,
    llm_model: llmStatus.model,
  });
}
