Release 0.13.0: agent API for deployments and benchmarks
Release / release (push) Successful in 3m0s
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>
This commit is contained in:
1 parent
e007a35143
commit
716bd8f2f0
62 files changed
+6091
-219
No files matched your search
@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { approveJob, rejectJob } from "@/components/job-actions";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { toast } from "sonner";
|
||||
import { formatBytes } from "@/lib/format";
|
||||
|
||||
/** A download requested through the API that waits for approval: who asked, how much, approve/reject. */
|
||||
@@ -54,3 +55,46 @@ export function ApprovalBar({ job, onRemoved }: { job: { id: string; requestedBy
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** Something else an API token asked for (a deployment start, a run, a sweep): approve or reject. */
|
||||
export function AgentApprovalBar({ requestedBy, what, base }: { requestedBy: string | null; what: string; base: string }) {
|
||||
const router = useRouter();
|
||||
const [busy, setBusy] = useState(false);
|
||||
|
||||
async function decide(kind: "approve" | "reject") {
|
||||
setBusy(true);
|
||||
try {
|
||||
const res = await fetch(`${base}/${kind}`, { method: "POST" });
|
||||
if (!res.ok) {
|
||||
const body = await res.json().catch(() => ({}));
|
||||
toast.error(body.error?.message ?? `Request failed (${res.status})`);
|
||||
return;
|
||||
}
|
||||
toast.success(kind === "approve" ? "Approved" : "Rejected");
|
||||
router.refresh();
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2.5 text-sm">
|
||||
<p className="flex items-center gap-1.5">
|
||||
<BotIcon className="size-4 shrink-0 text-amber-700 dark:text-amber-300" />
|
||||
<span>
|
||||
<strong>{requestedBy ?? "An API token"}</strong> asks to {what}. It goes ahead once you approve it.
|
||||
</span>
|
||||
</p>
|
||||
<div className="flex gap-2">
|
||||
<Button size="sm" disabled={busy} onClick={() => decide("approve")}>
|
||||
<CheckIcon />
|
||||
Approve
|
||||
</Button>
|
||||
<Button size="sm" variant="outline" disabled={busy} onClick={() => decide("reject")}>
|
||||
<XIcon />
|
||||
Reject
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { LoaderCircleIcon } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const STYLE: Record<string, string> = {
|
||||
pending_approval: "border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300",
|
||||
queued: "border-foreground/15 text-muted-foreground",
|
||||
running: "border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",
|
||||
completed: "border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",
|
||||
@@ -10,7 +11,7 @@ const STYLE: Record<string, string> = {
|
||||
};
|
||||
|
||||
export function BenchmarkStateBadge({ state, cancelling, className }: { state: string; cancelling?: boolean; className?: string }) {
|
||||
const label = state === "running" && cancelling ? "cancelling" : state;
|
||||
const label = state === "running" && cancelling ? "cancelling" : state === "pending_approval" ? "awaiting approval" : state;
|
||||
return (
|
||||
<span className={cn("inline-flex h-5 shrink-0 items-center gap-1 rounded-4xl border px-2 text-xs font-medium whitespace-nowrap", STYLE[state] ?? STYLE.queued, className)}>
|
||||
{state === "running" && <LoaderCircleIcon className="size-3 animate-spin" />}
|
||||
|
||||
Reference in new issue
Block a user