[taskboard] add heartbeat task pickup

This commit is contained in:
2026-03-07 14:41:29 -08:00
parent 01c9a206ab
commit 0a312dc733
5 changed files with 244 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
import { NextResponse } from "next/server";
import { processAgentHeartbeat } from "@/lib/heartbeat";
export async function GET(
_request: Request,
{ params }: { params: Promise<{ agent: string }> },
) {
const { agent } = await params;
try {
const result = await processAgentHeartbeat(agent);
return NextResponse.json(result);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
const status = message === "agent_not_found" ? 404 : 500;
return NextResponse.json({ error: message }, { status });
}
}