import { useEffect, useMemo, useState, type ReactNode } from "react"; import { BrainCircuit, Code2, Globe2, SearchCheck, ShieldCheck, UsersRound } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { ScrollArea } from "@/components/ui/scroll-area"; type JsonMap = Record; async function fetchJson(url: string): Promise { try { const response = await fetch(url, { cache: "no-store" }); if (!response.ok) return {}; return await response.json(); } catch { return {}; } } function fmt(value: unknown): string { const number = Number(value || 0); return Number.isFinite(number) ? number.toLocaleString() : String(value || "0"); } export function AureonCodingAgentSkillBaseConsole() { const [profile, setProfile] = useState({}); useEffect(() => { let cancelled = false; fetchJson("/aureon_coding_agent_skill_base.json").then((payload) => { if (!cancelled) setProfile(payload); }); return () => { cancelled = true; }; }, []); const summary = profile.summary || {}; const agents = Array.isArray(profile.coder_agents) ? profile.coder_agents : []; const orders = Array.isArray(profile.coding_work_orders) ? profile.coding_work_orders : []; const tools = profile.tool_registry || {}; const repoCode = profile.repo_code || {}; const domains = repoCode.by_domain || {}; const languages = repoCode.by_language || {}; const logicMap = profile.coding_logic_map || {}; const logicRules = Array.isArray(logicMap.rules) ? logicMap.rules : []; const sources = Array.isArray(profile.official_learning_sources) ? profile.official_learning_sources : []; const visibleOrders = useMemo(() => orders.slice(0, 30), [orders]); return ( Aureon Coding Agent Skill Base
{profile.status || "pending"} updated {profile.generated_at ? new Date(profile.generated_at).toLocaleTimeString() : "pending"} web tools {summary.web_tools_ready ? "ready" : "attention"} {logicMap.status || "logic pending"}
{agents.slice(0, 6).map((agent: JsonMap) => (
{agent.name}
{agent.purpose}
))}
{sources.slice(0, 7).map((source: JsonMap) => (
{source.title}
{source.url}
))}
{logicMap.principle || "Coding route pending."}
{logicRules.slice(0, 6).map((rule: JsonMap) => (
{rule.id}
{(rule.who || []).slice(0, 2).join(" + ")}
{rule.what}
{(rule.where || []).slice(0, 3).join(" | ")}
))}
{visibleOrders.map((order: JsonMap) => (
{order.title}
{order.reason}
{order.owner_agent}
{order.proposed_action}
))}
); } function Stat({ icon: Icon, label, value }: { icon: any; label: string; value: unknown }) { return (
{label}
{fmt(value)}
); } function Panel({ title, children }: { title: string; children: ReactNode }) { return (
{title}
{children}
); } function Mini({ label, value }: { label: string; value: unknown }) { return (
{label} {fmt(value)}
); }