peppa/apps/web/app/api/agent/[...path]/route.ts
Асель ca57f9543b PEP-17/40: agent sandbox per runner (docker + agent relay) and runner hosts over SSH
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 07:57:28 +05:00

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;