import Link from "next/link"; import AppShell from "@/components/shell/AppShell"; import { IndexPanel, RootsPanel, StoragePanel } from "@/components/system/Maintenance"; import { ActivityPanel, DeliverablesPanel, ProjectsPanel, SourcesPanel } from "@/components/system/Status"; import ToolsPanel from "@/components/system/ToolsPanel"; import { listActivity, runningActivity } from "@/lib/activity"; import { projectsNote, sourceBuckets, stateRows } from "@/lib/system/status"; import { toolsCache } from "@/lib/doctor"; import { generationPolicyHref, settingsHref } from "@/lib/hrefs"; import { freeBytesUnder } from "@/lib/machine"; import { MEDIA_ROOT, MEDIA_TIERED, REPORTS_ROOT } from "@/lib/paths"; import { KINDS, decisionCounts, indexPrunePlan, listProjects } from "@/lib/projects"; import { rootsReport } from "@/lib/system/roots.mjs"; import { storageRows } from "@/lib/system/storage-rows"; export const dynamic = "force-dynamic"; // SETTINGS · SYSTEM (plans/umtool-redesign.md, P3, P5, P6): the machine and // the collection at a glance -- whether this machine can build, its roots and // index, what ran, where every project stands, which sources nobody has // checked, what has been built; then storage. What in them is a CALL (a // required tool missing, a disk nearly full) is an Inbox card instead. // // Everything is read from the index, the job registries and a few stats; // nothing here shells out -- the tools panel shows a cache or "not checked", // and probing is its button. // // P5: the maintenance a terminal did -- the doctor's roots, `umtool index // --rebuild | --prune`, `umtool storage move-out | move-back | deliverables` // (lib/system/actions.ts) -- each one that changes or moves anything a plan // first, then Confirm or Keep it (components/system/ActionPlan.tsx); the long // ones run as umtool jobs, in the rail's Running list. export default async function SystemPage() { const projects = await listProjects(); const counts = await decisionCounts(); const running = runningActivity(); const recent = listActivity(8); const tools = toolsCache(); const free = await freeBytesUnder(REPORTS_ROOT); const [roots, prune, storage] = await Promise.all([rootsReport({ measureOld: false }), indexPrunePlan(), storageRows()]); const blocking = [...counts.values()].reduce((n, c) => n + c.blocking, 0); const openN = [...counts.values()].reduce((n, c) => n + c.open, 0); const buckets = sourceBuckets(projects); return (
Generation → } />
); }