"use client"; import { useState, useEffect } from "react"; import { AISkill, ApiConfig, CronJob, defaultSkills, defaultApis, defaultCronJobs } from "@/lib/ai-management/types"; const STORAGE_KEYS = { skills: "horus:skills", apis: "horus:apis", crons: "horus:crons", }; export default function AIManagement() { const [skills, setSkills] = useState(defaultSkills); const [apis, setApis] = useState(defaultApis); const [crons, setCrons] = useState(defaultCronJobs); const [activeTab, setActiveTab] = useState<"skills" | "apis" | "crons">("skills"); // Load from localStorage useEffect(() => { if (typeof window === "undefined") return; const savedSkills = localStorage.getItem(STORAGE_KEYS.skills); if (savedSkills) setSkills(JSON.parse(savedSkills)); const savedApis = localStorage.getItem(STORAGE_KEYS.apis); if (savedApis) setApis(JSON.parse(savedApis)); const savedCrons = localStorage.getItem(STORAGE_KEYS.crons); if (savedCrons) setCrons(JSON.parse(savedCrons)); }, []); // Save changes const toggleSkill = (id: string) => { const updated = skills.map(s => s.id === id ? { ...s, enabled: !s.enabled } : s); setSkills(updated); localStorage.setItem(STORAGE_KEYS.skills, JSON.stringify(updated)); }; const toggleCron = (id: string) => { const updated = crons.map(c => c.id === id ? { ...c, enabled: !c.enabled } : c); setCrons(updated); localStorage.setItem(STORAGE_KEYS.crons, JSON.stringify(updated)); }; const categoryColors: Record = { development: "bg-blue-500/20 text-blue-400", research: "bg-purple-500/20 text-purple-400", automation: "bg-green-500/20 text-green-400", communication: "bg-yellow-500/20 text-yellow-400", }; return (
{/* Header */}

🤖 Horus AI Management

Configure skills, APIs, and automation for your AI assistant

{/* Tabs */}
{[ { id: "skills", label: "Skills", icon: "🧩" }, { id: "apis", label: "APIs", icon: "🔑" }, { id: "crons", label: "Automation", icon: "⏰" }, ].map((tab) => ( ))}
{/* Skills Tab */} {activeTab === "skills" && (
{skills.map((skill) => (
{skill.category}

{skill.name}

{skill.description}

))}
)} {/* APIs Tab */} {activeTab === "apis" && (
{apis.map((api) => (

{api.name} {api.configured && ✓ Configured}

{api.description}

))}

💡 To configure APIs, give me the keys or run: openclaw configure --section auth --set KEY=value

)} {/* Automation/Crons Tab */} {activeTab === "crons" && (
{crons.map((cron) => (

{cron.name}

{cron.schedule} {cron.nextRun && Next: {cron.nextRun}}

))}
)}
); }