async function renderPlugins() { const content = document.getElementById('pageContent'); content.innerHTML = `
`; try { const data = await api.getPlugins(); const plugins = data.plugins || []; const container = document.getElementById('pluginList'); if (plugins.length === 0) { container.innerHTML = '
🔌
No plugins installed
Install plugins from the registry or create your own
'; return; } container.innerHTML = `
${plugins.map(p => ` `).join('')}
PluginVersionTypeInstalled
${p.name} ${p.version || '1.0.0'} ${p.type || 'skill'} ${formatDate(p.installed)}
${plugins.length} plugin${plugins.length !== 1 ? 's' : ''}
`; } catch (err) { document.getElementById('pluginList').innerHTML = `
âš 
${escapeHtml(err.message)}
`; } } function showInstallPlugin() { showModal('Install Plugin', `
Enter the name of the plugin to install from the registry
`, ` `); } async function installPlugin() { const name = document.getElementById('pluginNameInput').value.trim(); if (!name) { showToast('Plugin name required', 'warning'); return; } try { const r = await api.installPlugin(name); closeModal(); showToast(r.status === 'already_installed' ? 'Already installed' : `"${name}" installed`, r.status === 'already_installed' ? 'info' : 'success'); renderPlugins(); } catch (err) { showToast(`Error: ${err.message}`, 'error'); } }