Release / release (push) Successful in 3m0s
Scopes deployments:read/write and benchmarks:read/run; /api/v1 endpoints for runtimes, deployments (create with dry run, edit, start, stop, delete own ones), benchmark runs, A/B, sweeps and comparisons; ?wait= on all status endpoints. Guardrails: approval, agent deployments at once, one GPU job at a time, time limits, sweep variants, runtime and argument allowlists, host port range, memory/CPU caps, protected deployments with a VRAM check. Requested-by filters, approval bars, per-token activity log, scope editing, docs/agent/SKILL-tuning.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
664 B
TypeScript
17 lines
664 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { withAuth } from "@/lib/api-auth";
|
|
import { apiError, handleApiError } from "@/lib/api-errors";
|
|
import { DeploymentError, setDesiredState } from "@/lib/deployments";
|
|
|
|
/** Let the start of a deployment an API token asked for. */
|
|
export const POST = withAuth<RouteContext<"/api/deployments/[id]/approve">>(async (_req, { params }) => {
|
|
try {
|
|
const id = (await params).id;
|
|
await setDesiredState(id, "running");
|
|
return NextResponse.json({ ok: true });
|
|
} catch (err) {
|
|
if (err instanceof DeploymentError) return apiError(err.status, err.code, err.message);
|
|
return handleApiError(err);
|
|
}
|
|
});
|