diff --git a/src/components/panels/agent-detail-tabs.tsx b/src/components/panels/agent-detail-tabs.tsx index 7f95ed2..c09be4d 100644 --- a/src/components/panels/agent-detail-tabs.tsx +++ b/src/components/panels/agent-detail-tabs.tsx @@ -1241,6 +1241,8 @@ export function ConfigTab({ const [jsonInput, setJsonInput] = useState('') const [availableModels, setAvailableModels] = useState([]) const [newFallbackModel, setNewFallbackModel] = useState('') + const [newAllowTool, setNewAllowTool] = useState('') + const [newDenyTool, setNewDenyTool] = useState('') useEffect(() => { setConfig(agent.config || {}) @@ -1289,6 +1291,40 @@ export function ConfigTab({ setNewFallbackModel('') } + const updateIdentityField = (field: string, value: string) => { + setConfig((prev: any) => ({ + ...prev, + identity: { ...(prev.identity || {}), [field]: value }, + })) + } + + const updateSandboxField = (field: string, value: string) => { + setConfig((prev: any) => ({ + ...prev, + sandbox: { ...(prev.sandbox || {}), [field]: value }, + })) + } + + const addTool = (list: 'allow' | 'deny', value: string) => { + const trimmed = value.trim() + if (!trimmed) return + setConfig((prev: any) => { + const tools = prev.tools || {} + const existing = Array.isArray(tools[list]) ? tools[list] : [] + if (existing.includes(trimmed)) return prev + return { ...prev, tools: { ...tools, [list]: [...existing, trimmed] } } + }) + } + + const removeTool = (list: 'allow' | 'deny', index: number) => { + setConfig((prev: any) => { + const tools = prev.tools || {} + const existing = Array.isArray(tools[list]) ? [...tools[list]] : [] + existing.splice(index, 1) + return { ...prev, tools: { ...tools, [list]: existing } } + }) + } + const handleSave = async (writeToGateway: boolean = false) => { setSaving(true) setError(null) @@ -1476,60 +1512,205 @@ export function ConfigTab({ {/* Identity */}
Identity
-
- {identityEmoji} -
-
{identityName}
-
{identityTheme}
+ {editing ? ( +
+
+
+ + updateIdentityField('emoji', e.target.value)} + className="w-full bg-surface-1 text-foreground rounded px-3 py-2 text-sm text-center focus:outline-none focus:ring-1 focus:ring-primary/50" + placeholder="🤖" + /> +
+
+ + updateIdentityField('name', e.target.value)} + className="w-full bg-surface-1 text-foreground rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary/50" + placeholder="Agent name" + /> +
+
+ + updateIdentityField('theme', e.target.value)} + className="w-full bg-surface-1 text-foreground rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary/50" + placeholder="e.g. backend engineer" + /> +
+
+
+ +