import { NextResponse } from "next/server"; import { auth } from "@/app/(auth)/auth"; import { findKittyCadProviderConfig } from "@/lib/kittycad/server"; export const runtime = "nodejs"; export async function GET() { const session = await auth(); if (!session?.user?.id) { return NextResponse.json( { success: false, error: "未登录" }, { status: 401 } ); } const config = await findKittyCadProviderConfig(); return NextResponse.json({ success: true, data: { configured: Boolean(config), source: config?.source || "none", providerName: config?.providerName || null, baseUrl: config?.baseUrl || null, }, }); }