Add read-only production runtime audit

This commit is contained in:
2026-08-17 11:17:40 +07:00
parent 057d4ed9dc
commit a1de4715a4
106 changed files with 6869 additions and 1782 deletions
+3
View File
@@ -227,11 +227,13 @@ function toCitations(raw: RagCitation[]): Citation[] {
export async function POST(request: Request) {
let content: string;
let conversationId: string | null = null;
let responseMode: "ai" | "monograph" = "ai";
try {
const body = await request.json();
content = typeof body?.content === "string" ? body.content.trim() : "";
conversationId =
typeof body?.conversationId === "string" ? body.conversationId : null;
responseMode = body?.responseMode === "monograph" ? "monograph" : "ai";
} catch {
return NextResponse.json({ error: "invalid_body" }, { status: 400 });
}
@@ -277,6 +279,7 @@ export async function POST(request: Request) {
subject_scope: "human",
intent: "fact_lookup",
conversation_id: conversationId,
response_mode: responseMode,
}),
cache: "no-store",
// Propagate a browser disconnect/Stop action to the upstream fetch.