import { useState } from 'react' import { Plus, Trash2, Copy, Save, RotateCcw, ArrowLeft } from 'lucide-react' import { useStore } from '../../store/useStore' import { BUILTIN_TOOLS } from '../../lib/tools' import { uid } from '../../lib/providers' import { Btn, Field, Section, inputCls } from '../ui' function AgentEditor({ agent, onBack }) { const customTools = useStore((s) => s.customTools) const { saveAgent, removeAgent } = useStore.getState() const [d, setD] = useState({ ...agent, tools: [...(agent.tools || [])] }) const all = [...BUILTIN_TOOLS.map((t) => ({ name: t.name, label: t.label })), ...customTools.map((t) => ({ name: t.name, label: `${t.name}(自訂)` }))] const toggle = (name) => setD({ ...d, tools: d.tools.includes(name) ? d.tools.filter((x) => x !== name) : [...d.tools, name] }) return (
每個角色有自己的 system prompt 與工具組合。點一下編輯。