Intelligence
Artifacts
Browse the repository, read documents, and manage the governance folders. Source, runtime, and infrastructure are read-only.
Repository
repositories/aaf-holdings/hq01/app/api/router/route/route.ts
942 B
import { NextResponse } from "next/server";
import { route } from "@/lib/executives/router";
import type { RoutingInput } from "@/lib/executives/types";
/**
* Classify a CEO instruction and recommend an executive office.
*
* POST /api/router/route { instruction, repository?, preferredExecutiveId?, mode? }
*
* Deterministic, no LLM, no side effects — pure preview of where work would go.
*/
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
export async function POST(request: Request) {
let body: RoutingInput;
try {
body = (await request.json()) as RoutingInput;
} catch {
return NextResponse.json({ error: "Invalid JSON." }, { status: 400 });
}
if (!body.instruction || !body.instruction.trim()) {
return NextResponse.json(
{ error: "An instruction is required." },
{ status: 400 },
);
}
const result = route(body);
return NextResponse.json({ result });
}
root · /srv/aaf