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
627 B
TypeScript
17 lines
627 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { withAuth } from "@/lib/api-auth";
|
|
import { apiError, handleApiError } from "@/lib/api-errors";
|
|
import { decideSweep, SweepRequestError } from "@/lib/sweeps";
|
|
|
|
/** Let a sweep an API token asked for. */
|
|
export const POST = withAuth<RouteContext<"/api/sweeps/[id]/approve">>(async (_req, { params }) => {
|
|
try {
|
|
const id = (await params).id;
|
|
await decideSweep(id, true);
|
|
return NextResponse.json({ ok: true });
|
|
} catch (err) {
|
|
if (err instanceof SweepRequestError) return apiError(err.status, err.code, err.message);
|
|
return handleApiError(err);
|
|
}
|
|
});
|