import { Download, RefreshCw } from "lucide-react"; import type { AgentInfo, AgentModeInfo } from "sandbox-agent"; import FeatureCoverageBadges from "../agents/FeatureCoverageBadges"; import { emptyFeatureCoverage } from "../../types/agents"; const AgentsTab = ({ agents, defaultAgents, modesByAgent, onRefresh, onInstall, loading, error }: { agents: AgentInfo[]; defaultAgents: string[]; modesByAgent: Record; onRefresh: () => void; onInstall: (agentId: string, reinstall: boolean) => void; loading: boolean; error: string | null; }) => { return ( <>
{error &&
{error}
} {loading &&
Loading agents...
} {!loading && agents.length === 0 && (
No agents reported. Click refresh to check.
)} {(agents.length ? agents : defaultAgents.map((id) => ({ id, installed: false, version: undefined, path: undefined, capabilities: emptyFeatureCoverage }))).map((agent) => (
{agent.id} {agent.installed ? "Installed" : "Missing"}
{agent.version ? `v${agent.version}` : "Version unknown"} {agent.path && {agent.path}}
Feature coverage
{modesByAgent[agent.id] && modesByAgent[agent.id].length > 0 && (
Modes: {modesByAgent[agent.id].map((mode) => mode.id).join(", ")}
)}
))} ); }; export default AgentsTab;