import { listWorkers, workerTelemetry } from "@autoscholar/core"; import { StatusBadge } from "@/components/StatusBadge"; import { ago, fmtBytes, fmtDateTime } from "@/lib/format"; import { db } from "@/lib/server/db"; import { WorkerActions } from "./WorkerActions"; export const dynamic = "force-dynamic"; export default async function MacLustrPage() { const d = db(); const workers = await listWorkers(d); const tele = await Promise.all(workers.map((w) => workerTelemetry(d, w.id, 20))); return (

Compute

MacLustr workers

Authenticated worker telemetry. Workers connect outbound over the private network; nothing here is exposed publicly.

{workers.length === 0 && (

No worker enrolled.

Install the worker daemon on a MacLustr node with the enrollment secret (docs/OPERATIONS.md). It appears here after its first heartbeat.

)} {workers.map((w, i) => { const nm = (w.nodeMeta ?? {}) as Record; const hb = tele[i] ?? []; const last = hb[0]?.load as Record | undefined; return (

{w.name}

worker {w.version ?? "?"} · protocol {w.protocolVersion} · enrolled{" "} {fmtDateTime(w.enrolledAt)} · heartbeat {ago(w.lastHeartbeatAt)} {w.quarantineReason ? ` · quarantined: ${w.quarantineReason}` : ""}

Running / capacity
{w.running} / {w.capacity}
Machine
{String(nm.arch ?? "?")} · {String(nm.cpuCores ?? "?")} cores ·{" "} {nm.memoryBytes ? fmtBytes(Number(nm.memoryBytes)) : "?"}
OS / user
{String(nm.osVersion ?? "?")} · {String(nm.user ?? "?")}
Sandbox
{nm.sandboxAvailable ? ( available (required for dispatch) ) : ( unavailable — no jobs dispatched )}
Profiles
{w.profiles.join(", ")}
SDK
{String(nm.sdkVersion ?? "?")}
Load / free mem / free disk
{last ? `${last.load1?.toFixed?.(2) ?? "?"} · ${last.memFreeBytes ? fmtBytes(last.memFreeBytes) : "?"} · ${last.diskFreeBytes ? fmtBytes(last.diskFreeBytes) : "?"}` : "—"}
Tools
{nm.tools && typeof nm.tools === "object" ? Object.entries(nm.tools as Record) .map(([k, v]) => `${k} ${v}`) .join(" · ") : "—"}
{hb.length > 1 && (

Last {hb.length} heartbeats:{" "} {hb .map((h) => `${(h.load as { load1?: number }).load1?.toFixed?.(1) ?? "?"}`) .reverse() .join(" ")}

)}
); })}
); }