19 lines
726 B
TypeScript
19 lines
726 B
TypeScript
import { agentRelayMcp } from "@peppa/mcp/relay";
|
|
import { handleAgentRelay } from "@peppa/runner";
|
|
import { db } from "@/lib/db";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
// A blocking hook (question to the PM) is answered in ≤25 s chunks (`wait` + `rid`).
|
|
export const maxDuration = 60;
|
|
|
|
/**
|
|
* PEP-17: the agent relay — hooks, MCP and git of agents in runner containers (here or on
|
|
* runner hosts, PEP-40). No web login: Bearer = the run's own token.
|
|
*/
|
|
async function handle(req: Request, { params }: { params: Promise<{ path: string[] }> }) {
|
|
const { path } = await params;
|
|
return handleAgentRelay(db, req, `/${path.join("/")}`, { mcp: agentRelayMcp });
|
|
}
|
|
export const GET = handle;
|
|
export const POST = handle;
|