import { logError } from "@/lib/logger"; import { NextResponse } from "next/server"; import { syncModels } from "@/lib/adminrpc/client"; export const runtime = "nodejs"; /** * Trigger AI model sync via adminrpc gRPC. */ export async function POST() { try { const data = await syncModels(); return NextResponse.json(data); } catch (e) { const msg = e instanceof Error ? e.message : String(e); logError("AI sync error:", e); return NextResponse.json({ error: `同步失败: ${msg}` }, { status: 500 }); } }