/** * Agent Configuration Panel * UI for viewing and managing AI agents in the registry */ import { useState } from 'react'; import { useAgentRegistry } from '@/lib/orchestration/registry/store'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'; import { PlusIcon, Trash2Icon, EditIcon } from 'lucide-react'; export function AgentConfigPanel() { const { listAgents, deleteAgent } = useAgentRegistry(); const agents = listAgents(); const [selectedAgent, setSelectedAgent] = useState(null); const handleDelete = (agentId: string) => { if (confirm('确定要删除这个智能体吗?')) { deleteAgent(agentId); if (selectedAgent === agentId) { setSelectedAgent(null); } } }; return (

智能体配置

管理课堂讨论的AI智能体

{agents.map((agent) => ( setSelectedAgent(agent.id)} >
{agent.name.charAt(0)}
{agent.name} {agent.role}
优先级 {agent.priority} {agent.isDefault && ( 默认 )}

能力描述

{agent.persona}

可用动作 ({agent.allowedActions.length})

{agent.allowedActions.slice(0, 3).map((tool) => ( {tool} ))} {agent.allowedActions.length > 3 && ( +{agent.allowedActions.length - 3} )}
{!agent.isDefault && (
)}
))}
{agents.length === 0 && (

还没有配置智能体

)}
); }