{ if (editTerminalIdx !== null) { updateTerminalConnection(editTerminalIdx, c); editTerminalIdx = null; } else { addTerminalConnection(c); } }} onDelete={() => { if (editTerminalIdx !== null) { removeTerminalConnection(editTerminalIdx); editTerminalIdx = null; } }} />
{ updateHandler(); }} >
{#if servers !== null}
{$i18n.t("General")}

{$i18n.t("Manage Tool Servers")}
{#each servers as server, idx} { updateHandler(); }} onDelete={() => { servers = servers.filter( (_, i) => i !== idx, ); updateHandler(); }} /> {/each}
{#if servers.length === 0}
{$i18n.t( "No tool server connections configured.", )}
{/if}
{$i18n.t( "Connect to your own OpenAPI compatible external tool servers.", )}

{$i18n.t("Open Terminal")}
{$i18n.t("Experimental")}
{#each terminalConnections as connection, idx}
{connection.name || connection.url || $i18n.t("New Terminal")}
{ terminalConnections = terminalConnections.map( (c, i) => i === idx ? { ...c, enabled: !( c?.enabled !== false ), } : c, ); saveTerminalServers(); }} />
{/each}
{#if terminalConnections.length === 0}
{$i18n.t("No terminal connections configured.")}
{/if}
{$i18n.t( "Connect to Open Terminal instances. All users will have access to file browsing and terminal tools through these servers.", )}
{:else}
{/if}