import { AlertCircleIcon, CheckCircle2Icon, DownloadIcon, HardDriveIcon, PackageIcon, ServerCogIcon, } from "lucide-react"; import type { AppStatusResponse } from "../../status-model"; import { buildConnectorActivationCheck } from "../../activation-health"; import { Button } from "./ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "./ui/card"; interface BootstrapStatusProps { bootstrap: AppStatusResponse["bootstrap"]; activation: AppStatusResponse["activation"]; onDownloadModels: () => void; } function formatRole( role: AppStatusResponse["bootstrap"]["models"]["entries"][number]["role"] ): string { switch (role) { case "gen": return "Answer"; case "expand": return "Expand"; case "embed": return "Embed"; case "rerank": return "Rerank"; } } export function BootstrapStatus({ activation, bootstrap, onDownloadModels, }: BootstrapStatusProps) { const missingModels = bootstrap.models.totalCount - bootstrap.models.cachedCount; const displayedConnectorCount = Math.min(activation.connectors.length, 8); const hiddenProjectedConnectorCount = activation.connectorProjection.projected - displayedConnectorCount; const omittedConnectorCount = activation.connectorProjection.total - activation.connectorProjection.projected; const connectorHealth = buildConnectorActivationCheck(activation); const connectorsHealthy = connectorHealth === null || connectorHealth.status === "ok"; return (

Bootstrap & Storage

Runtime, download policy, and cache state for the current beta install.

{missingModels > 0 && !bootstrap.models.downloading && ( )}
Runtime
{bootstrap.runtime.summary}

{bootstrap.runtime.detail}

Required: {bootstrap.runtime.requiredVersion}

Cache
{bootstrap.policy.summary}

Total cache: {bootstrap.cache.totalSizeLabel}

{bootstrap.cache.path}

Active preset
{bootstrap.models.summary}

{bootstrap.models.activePresetName} {bootstrap.models.estimatedFootprint ? ` (${bootstrap.models.estimatedFootprint})` : ""}

{bootstrap.models.entries.map((entry) => (
{formatRole(entry.role)} {entry.statusLabel}
))}
{activation.healthy && connectorsHealthy ? ( ) : activation.usable ? ( ) : ( )} Retrieval proof
{activation.healthy ? "Lexical retrieval proven" : activation.usable ? `Search usable in ${activation.collections.filter(({ ready }) => ready).length}/${activation.collections.length} folders` : "Retrieval proof failed"}
{activation.collections.length === 0 ? (

Add and index a text folder to prove retrieval.

) : ( activation.collections.map((collection) => (

{collection.collection}

{collection.ready ? `Lexical passed; semantic ${collection.semanticAvailability.code}` : `${collection.remediation?.stage ?? "index"}/${collection.remediation?.code ?? "index_query_failed"}`}

{collection.remediation && (

{collection.remediation.command}

)}
)) )} {(activation.connectors.length > 0 || activation.connectorProjection.truncated) && (

Connector proof

{activation.connectors.slice(0, 8).map((connector) => (
{connector.target} {" "} · {connector.collection} · {connector.status} {connector.code ? `/${connector.code}` : ""}
))} {hiddenProjectedConnectorCount > 0 && (

+{hiddenProjectedConnectorCount} more projected checks

)} {activation.connectorProjection.truncated && (

{omittedConnectorCount} additional target/collection checks omitted from this bounded status view

)}
)}
); }