Agent Zero AI framework
align plugin schema, config API actions, and plugin list UI
Alessandro604078376f6f
diff --git a/AGENTS.md b/AGENTS.mdindex 92fc209e6..529362c2a 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -72,10 +72,10 @@ Modals in A0 are "stacked" and loaded dynamically via `openModal(path)`.Plugins get a dedicated settings modal with **Project** and **Agent profile** context selectors. To enable it:-1. Add `webui/settings.html` to your plugin (auto-detected).+1. Add `webui/config.html` to your plugin (auto-detected).2. Set `"settings_sections": ["agent"]` in `plugin.json` - this places a subsection with a Settings button in the chosen tab.-Your `settings.html` binds to `$store.pluginSettings.settings` (a plain object persisted as `settings.json`). The modal's Save/Cancel footer handles persistence automatically. See `plugins/README.md` for the full contract and settings resolution priority chain.+Your `config.html` binds to `$store.pluginSettings.settings` (a plain object persisted as `config.json`). The modal's Save/Cancel footer handles persistence automatically. See `plugins/README.md` for the full contract and settings resolution priority chain.For plugins that surface **existing core settings** (e.g. wrapping `settings/agent/memory.html`), set `$store.pluginSettings.saveMode = 'core'` in `x-init` to route Save through the core settings API instead.@@ -105,7 +105,7 @@ usr/plugins/my-plugin/│ ├── python/agent_init/ # Auto-start logic│ └── webui/ # sidebar-quick-actions-main-start/└── webui/- ├── settings.html # Optional: plugin settings UI+ ├── config.html # Optional: plugin settings UI└── my-modal.html # Full plugin pages + stores```diff --git a/plugins/README.md b/plugins/README.mdindex 8871736c2..68772935e 100644--- a/plugins/README.md+++ b/plugins/README.md@@ -53,7 +53,7 @@ usr/plugins/python/<extension_point>/ # Python lifecycle extensionswebui/<extension_point>/ # WebUI HTML/JS hook contributionswebui/- settings.html # Optional: plugin settings UI+ config.html # Optional: plugin settings UI... # Full plugin-owned UI pages/components```@@ -70,7 +70,7 @@ Capability discovery is based on these paths:- `extensions/python/<extension_point>/*.py` - backend lifecycle extensions- `extensions/webui/<extension_point>/*` - WebUI extension assets (HTML/JS)- `webui/**` - full plugin-owned UI pages/components (loaded directly by path)-- `webui/settings.html` - if present, a Settings button appears for this plugin in the relevant settings tabs+- `webui/config.html` - if present, a Settings button appears for this plugin in the relevant settings tabs- `prompts/**/*.md` - prompt templates- `agents/` - agent profiles@@ -133,18 +133,18 @@ Runtime code calls:If your plugin needs user-configurable settings:-1. Add `webui/settings.html` to your plugin. The system detects this file automatically.+1. Add `webui/config.html` to your plugin. The system detects this file automatically.2. Declare which settings tabs should show a subsection for your plugin via `settings_sections` in `plugin.json`.3. The plugin settings modal provides **Project** and **Agent profile** context selectors (same as the Skills list). Settings are scoped per-project and per-agent.-### Settings HTML contract+### Config HTML contract-Your `settings.html` receives context from `$store.pluginSettings`:+Your `config.html` receives context from `$store.pluginSettings`:```html<html><head>- <title>My Plugin Settings</title>+ <title>My Plugin Config</title><script type="module">import { store } from "/components/plugins/plugin-settings-store.js";</script>@@ -158,19 +158,19 @@ Your `settings.html` receives context from `$store.pluginSettings`:</html>```-- `$store.pluginSettings.settings` - plain object loaded from `settings.json`, save-scoped to the selected project/agent.-- The modal's **Save** button calls `POST /plugins` (`action: save_settings`) automatically.+- `$store.pluginSettings.settings` - plain object loaded from `config.json`, save-scoped to the selected project/agent.+- The modal's **Save** button calls `POST /plugins` (`action: save_config`) automatically.- For plugins that surface **core settings** (like memory), set `saveMode = 'core'` in `x-init` so Save delegates to the core settings API instead.### Settings resolution priority (highest first)```-project/.a0proj/agents/<profile>/plugins/<name>/settings.json-project/.a0proj/plugins/<name>/settings.json-usr/agents/<profile>/plugins/<name>/settings.json-agents/<profile>/plugins/<name>/settings.json-usr/plugins/<name>/settings.json-plugins/<name>/settings.json+project/.a0proj/agents/<profile>/plugins/<name>/config.json+project/.a0proj/plugins/<name>/config.json+usr/agents/<profile>/plugins/<name>/config.json+agents/<profile>/plugins/<name>/config.json+usr/plugins/<name>/config.json+plugins/<name>/config.json```## Plugin Author Flow@@ -182,14 +182,14 @@ plugins/<name>/settings.json5. For HTML UI entries: place files under `extensions/webui/<extension_point>/`, use root `x-data` + one `x-move-*` directive.6. For JS hooks: place `*.js` files under `extensions/webui/<extension_point>/`, export a default async function.7. Place full plugin pages/components in `webui/` and open them directly by path.-8. Optionally add `webui/settings.html` and set `settings_sections` in `plugin.json` to expose settings in the UI.+8. Optionally add `webui/config.html` and set `settings_sections` in `plugin.json` to expose settings in the UI.## Routes- Plugin static assets: `GET /plugins/<plugin_name>/<path>`- Plugin APIs: `POST /api/plugins/<plugin_name>/<handler>`- WebUI extension discovery: `POST /api/load_webui_extensions`-- Plugin management (list, get/save settings): `POST /plugins`+- Plugin management (get/save config): `POST /plugins`## Notesdiff --git a/plugins/example_agent/plugin.json b/plugins/example_agent/plugin.jsonindex a3e026759..c5c599690 100644--- a/plugins/example_agent/plugin.json+++ b/plugins/example_agent/plugin.json@@ -1,10 +1,8 @@{- "description": "Example Agent Plugin",- "per_project_config": true,- "per_agent_config": false-}"name": "Example Agent","description": "Example agent plugin demonstrating the Agent Zero plugin system.","version": "1.0.0",- "settings_sections": []+ "settings_sections": [],+ "per_project_config": true,+ "per_agent_config": false}diff --git a/plugins/memory/plugin.json b/plugins/memory/plugin.jsonindex e0e205bf3..c4a671ee3 100644--- a/plugins/memory/plugin.json+++ b/plugins/memory/plugin.json@@ -1,10 +1,8 @@{- "description": "Memory Plugin",- "per_project_config": true,- "per_agent_config": true-}"name": "Memory","description": "Provides persistent memory capabilities to Agent Zero agents.","version": "1.0.0",- "settings_sections": ["agent"]+ "settings_sections": ["agent"],+ "per_project_config": true,+ "per_agent_config": true}diff --git a/plugins/memory/webui/config.html b/plugins/memory/webui/config.htmlindex 6503585d0..379a8817c 100644--- a/plugins/memory/webui/config.html+++ b/plugins/memory/webui/config.html@@ -1,3 +1,24 @@+<html>+<head>+ <title>Memory Settings</title>+ <script type="module">+ import { store } from "/components/settings/settings-store.js";+ </script>+</head>+<body>+ <!--+ This file surfaces the existing core memory settings inside the plugin settings modal.+ It sets saveMode='core' so the modal's Save button delegates to $store.settings.saveSettings().+ -->+ <div x-data+ x-init="+ $store.pluginSettings.saveMode = 'core';+ if ($store.settings && !$store.settings.settings) $store.settings.onOpen();+ ">+ <x-component path="settings/agent/memory.html"></x-component>+ </div>+</body>+</html><!DOCTYPE html><html lang="en"><head>diff --git a/plugins/memory/webui/settings.html b/plugins/memory/webui/settings.htmldeleted file mode 100644index a9310d822..000000000--- a/plugins/memory/webui/settings.html+++ /dev/null@@ -1,21 +0,0 @@-<html>-<head>- <title>Memory Settings</title>- <script type="module">- import { store } from "/components/settings/settings-store.js";- </script>-</head>-<body>- <!--- This file surfaces the existing core memory settings inside the plugin settings modal.- It sets saveMode='core' so the modal's Save button delegates to $store.settings.saveSettings().- -->- <div x-data- x-init="- $store.pluginSettings.saveMode = 'core';- if ($store.settings && !$store.settings.settings) $store.settings.onOpen();- ">- <x-component path="settings/agent/memory.html"></x-component>- </div>-</body>-</html>diff --git a/python/api/plugins.py b/python/api/plugins.pyindex 0f9a66adb..97f4683c1 100644--- a/python/api/plugins.py+++ b/python/api/plugins.py@@ -1,40 +1,50 @@from python.helpers.api import ApiHandler, Request, Response-from python.helpers import plugins+from python.helpers import plugins, filesclass Plugins(ApiHandler):"""Core plugin management API.- Actions: list, get_settings, save_settings+ Actions: get_config, save_config"""async def process(self, input: dict, request: Request) -> dict | Response:- action = input.get("action", "list")+ action = input.get("action", "get_config")- if action == "list":- tab = input.get("tab") # optional: filter by settings_tab- data = plugins.list_plugins_with_metadata(tab_filter=tab or None)- return {"ok": True, "data": data}-- if action == "get_settings":+ # Accept legacy aliases during migration.+ if action in {"get_config", "get_settings"}:plugin_name = input.get("plugin_name", "")project_name = input.get("project_name", "")agent_profile = input.get("agent_profile", "")if not plugin_name:return Response(status=400, response="Missing plugin_name")- settings = plugins.get_plugin_settings(plugin_name,- project_name=project_name,- agent_profile=agent_profile)++ settings = None+ if project_name or agent_profile:+ file_path = plugins.determine_plugin_asset_path(+ plugin_name,+ project_name,+ agent_profile,+ plugins.CONFIG_FILE_NAME,+ )+ if files.exists(file_path):+ settings = files.read_file_json(file_path)++ if settings is None:+ settings = plugins.get_plugin_config(plugin_name, agent=None)+return {"ok": True, "data": settings or {}}- if action == "save_settings":+ if action in {"save_config", "save_settings"}:plugin_name = input.get("plugin_name", "")project_name = input.get("project_name", "")agent_profile = input.get("agent_profile", "")settings = input.get("settings", {})if not plugin_name:return Response(status=400, response="Missing plugin_name")- plugins.save_plugin_settings(plugin_name, project_name, agent_profile, settings)+ if not isinstance(settings, dict):+ return Response(status=400, response="settings must be an object")+ plugins.save_plugin_config(plugin_name, project_name, agent_profile, settings)return {"ok": True}return Response(status=400, response=f"Unknown action: {action}")diff --git a/python/helpers/plugins.py b/python/helpers/plugins.pyindex a2c8008b6..33d7be738 100644--- a/python/helpers/plugins.py+++ b/python/helpers/plugins.py@@ -5,7 +5,7 @@ from pathlib import Pathfrom typing import Any, Dict, List, Optional, TYPE_CHECKINGfrom python.helpers import files, print_style-from pydantic import BaseModel+from pydantic import BaseModel, Fieldif TYPE_CHECKING:from agent import Agent@@ -23,13 +23,24 @@ ENABLED_FILE_NAME = ".enabled"class PluginMetadata(BaseModel):+ name: str = ""description: str = ""+ version: str = ""+ settings_sections: List[str] = Field(default_factory=list)+ per_project_config: bool = False+ per_agent_config: bool = Falseclass PluginListItem(BaseModel):name: strpath: str+ display_name: str = ""description: str = ""+ version: str = ""+ settings_sections: List[str] = Field(default_factory=list)+ per_project_config: bool = False+ per_agent_config: bool = False+ is_custom: bool = Falsehas_main_screen: bool = Falsehas_config_screen: bool = False@@ -64,7 +75,7 @@ def get_enhanced_plugins_list("""Discover plugins by directory convention. First root wins on ID conflict."""results = []- def load_plugins(root_path: str):+ def load_plugins(root_path: str, is_custom: bool):for d in sorted(Path(root_path).iterdir(), key=lambda p: p.name):try:if not d.is_dir() or d.name.startswith("."):@@ -78,7 +89,13 @@ def get_enhanced_plugins_list(PluginListItem(name=d.name,path=str(d),+ display_name=meta.name or d.name,description=meta.description,+ version=meta.version,+ settings_sections=meta.settings_sections,+ per_project_config=meta.per_project_config,+ per_agent_config=meta.per_agent_config,+ is_custom=is_custom,has_main_screen=has_main_screen,has_config_screen=has_config_screen,)@@ -87,9 +104,9 @@ def get_enhanced_plugins_list(passif custom:- load_plugins(files.get_abs_path(files.USER_DIR, files.PLUGINS_DIR))+ load_plugins(files.get_abs_path(files.USER_DIR, files.PLUGINS_DIR), True)if builtin:- load_plugins(files.get_abs_path(files.PLUGINS_DIR))+ load_plugins(files.get_abs_path(files.PLUGINS_DIR), False)return resultsdiff --git a/skills/a0-create-plugin/SKILL.md b/skills/a0-create-plugin/SKILL.mdindex 79a501c85..8a02d5adb 100644--- a/skills/a0-create-plugin/SKILL.md+++ b/skills/a0-create-plugin/SKILL.md@@ -63,11 +63,11 @@ Import it in the HTML `<head>`:## ⚙️ Plugin Settings-If your plugin needs user-configurable settings, add `webui/settings.html`. The system detects it automatically and shows a Settings button in the relevant tabs (per `settings_sections` in `plugin.json`).+If your plugin needs user-configurable settings, add `webui/config.html`. The system detects it automatically and shows a Settings button in the relevant tabs (per `settings_sections` in `plugin.json`).### Settings modal contract-The modal provides Project + Agent profile context selectors. Your `settings.html` binds to `$store.pluginSettings.settings`:+The modal provides Project + Agent profile context selectors. Your `config.html` binds to `$store.pluginSettings.settings`:```html<html>@@ -86,7 +86,7 @@ The modal provides Project + Agent profile context selectors. Your `settings.htm</html>```-The modal's Save button persists `$store.pluginSettings.settings` to `settings.json` in the correct scope (project/agent/global).+The modal's Save button persists `$store.pluginSettings.settings` to `config.json` in the correct scope (project/agent/global).### Surfacing core settings (e.g. memory pattern)@@ -124,13 +124,18 @@ response = await task.result()### Reading Plugin Settings (backend)```python-from python.helpers.plugins import get_plugin_settings+from python.helpers.plugins import get_plugin_config, save_plugin_config# Runtime (with running agent - resolves project/profile from context)-settings = get_plugin_settings("my-plugin", agent=agent)--# UI path (explicit strings, no agent instance needed)-settings = get_plugin_settings("my-plugin", project_name="my-project", agent_profile="default")+settings = get_plugin_config("my-plugin", agent=agent) or {}++# Explicit write target (project/profile scope)+save_plugin_config(+ "my-plugin",+ project_name="my-project",+ agent_profile="default",+ settings=settings,+)```## 📁 Directory Layout@@ -143,7 +148,7 @@ usr/plugins/<name>/python/agent_init/ # Python lifecycle extensionswebui/<point>/ # HTML/JS hook extensionswebui/- settings.html # Optional: plugin settings UI+ config.html # Optional: plugin settings UImy-modal.html # Full plugin pagesmy-store.js # Alpine stores```diff --git a/webui/components/plugins/list/plugin-list.html b/webui/components/plugins/list/plugin-list.htmlindex 6e9109d8f..f949c8f29 100644--- a/webui/components/plugins/list/plugin-list.html+++ b/webui/components/plugins/list/plugin-list.html@@ -9,138 +9,95 @@<body><div x-data><template x-if="$store.pluginListStore">- <div x-init="$store.pluginListStore.loadPluginList && $store.pluginListStore.loadPluginList({ builtin: false, custom: true, search: '' })">+ <div x-init="$store.pluginListStore.setTab && $store.pluginListStore.setTab('custom')"><ul class="nav nav-tabs" id="plugin-list-tabs" role="tablist"><li class="nav-item" role="presentation">- <button class="nav-link active" id="plugins-custom-tab" data-bs-toggle="tab"- data-bs-target="#plugins-custom" type="button" role="tab"- aria-controls="plugins-custom" aria-selected="true"- @click="$store.pluginListStore.loadPluginList && $store.pluginListStore.loadPluginList({ builtin: false, custom: true, search: '' })">+ <button class="nav-link"+ :class="{ active: $store.pluginListStore.activeTab === 'custom' }"+ id="plugins-custom-tab"+ type="button"+ role="tab"+ aria-controls="plugins-custom"+ :aria-selected="$store.pluginListStore.activeTab === 'custom'"+ @click="$store.pluginListStore.setTab('custom')">Custom</button></li><li class="nav-item" role="presentation">- <button class="nav-link" id="plugins-builtin-tab" data-bs-toggle="tab"- data-bs-target="#plugins-builtin" type="button" role="tab"- aria-controls="plugins-builtin" aria-selected="false"- @click="$store.pluginListStore.loadPluginList && $store.pluginListStore.loadPluginList({ builtin: true, custom: false, search: '' })">+ <button class="nav-link"+ :class="{ active: $store.pluginListStore.activeTab === 'builtin' }"+ id="plugins-builtin-tab"+ type="button"+ role="tab"+ aria-controls="plugins-builtin"+ :aria-selected="$store.pluginListStore.activeTab === 'builtin'"+ @click="$store.pluginListStore.setTab('builtin')">Builtin</button></li></ul>- <div class="tab-content" id="plugin-list-tabs-content">- <div class="tab-pane fade show active" id="plugins-custom" role="tabpanel"- aria-labelledby="plugins-custom-tab">- <div>- <div class="plugins-toolbar">- <div class="plugins-toolbar-actions">- <button type="button" class="button confirm" title="Refresh"- @click="$store.pluginListStore.loadPluginList && $store.pluginListStore.loadPluginList({ builtin: false, custom: true, search: '' })"- :disabled="$store.pluginListStore.loading">- <span class="icon material-symbols-outlined">refresh</span> Refresh- </button>- </div>- </div>-- <div x-show="$store.pluginListStore.loading" class="loading">- <span>Loading plugins...</span>- </div>-- <div class="plugins-list">- <template x-for="plugin in ($store.pluginListStore.plugins || [])" :key="plugin.path || plugin.name">- <div class="plugin-card">- <div class="plugin-header">- <div class="plugin-heading">- <div class="plugin-title" x-text="plugin.name || '(unnamed plugin)'"></div>- <code class="plugin-path" x-text="plugin.path"></code>- </div>- <div class="plugin-actions">- <template x-if="plugin.has_main_screen">- <button type="button" class="button" title="Open"- @click="$store.pluginListStore.openPlugin && $store.pluginListStore.openPlugin(plugin)">- <span class="icon material-symbols-outlined">assistant_on_hub</span> Open- </button>- </template>- <template x-if="plugin.has_config_screen">- <button type="button" class="button" title="Config"- @click="$store.pluginListStore.openPluginConfig && $store.pluginListStore.openPluginConfig(plugin)">- <span class="icon material-symbols-outlined">settings</span> Config- </button>- </template>- <button type="button" class="button" title="Info"- @click="$store.pluginListStore.openPluginInfo && $store.pluginListStore.openPluginInfo(plugin)">- <span class="icon material-symbols-outlined">info</span> Info- </button>- <button type="button" class="button cancel icon-button" title="Delete"- @click="$confirmClick($event, () => $store.pluginListStore.deletePlugin && $store.pluginListStore.deletePlugin(plugin))">- <span class="icon material-symbols-outlined">delete</span>- </button>- </div>- </div>- <div class="plugin-description" x-text="plugin.description || 'No description provided.'"></div>- </div>- </template>- </div>- </div>+ <div class="plugins-toolbar">+ <div class="plugins-toolbar-actions">+ <button type="button"+ class="button confirm"+ title="Refresh"+ @click="$store.pluginListStore.refresh()"+ :disabled="$store.pluginListStore.loading">+ <span class="icon material-symbols-outlined">refresh</span> Refresh+ </button></div>+ </div>- <div class="tab-pane fade" id="plugins-builtin" role="tabpanel" aria-labelledby="plugins-builtin-tab">- <div>- <div class="plugins-toolbar">- <div class="plugins-toolbar-actions">- <button type="button" class="button confirm" title="Refresh"- @click="$store.pluginListStore.loadPluginList && $store.pluginListStore.loadPluginList({ builtin: true, custom: false, search: '' })"- :disabled="$store.pluginListStore.loading">- <span class="icon material-symbols-outlined">refresh</span> Refresh+ <div x-show="$store.pluginListStore.loading" class="loading">+ <span>Loading plugins...</span>+ </div>++ <div class="plugins-list">+ <template x-for="plugin in ($store.pluginListStore.plugins || [])" :key="plugin.path || plugin.name">+ <div class="plugin-card">+ <div class="plugin-header">+ <div class="plugin-heading">+ <div class="plugin-title" x-text="plugin.display_name || plugin.name || '(unnamed plugin)'"></div>+ <code class="plugin-path" x-text="plugin.path"></code>+ </div>+ <div class="plugin-actions">+ <template x-if="plugin.has_main_screen">+ <button type="button"+ class="button"+ title="Open"+ @click="$store.pluginListStore.openPlugin(plugin)">+ <span class="icon material-symbols-outlined">folder_open</span> Open+ </button>+ </template>+ <template x-if="plugin.has_config_screen">+ <button type="button"+ class="button"+ title="Config"+ @click="$store.pluginListStore.openPluginConfig(plugin)">+ <span class="icon material-symbols-outlined">settings</span> Config+ </button>+ </template>+ <button type="button"+ class="button"+ title="Info"+ @click="$store.pluginListStore.openPluginInfo(plugin)">+ <span class="icon material-symbols-outlined">info</span> Info+ </button>+ <button type="button"+ class="button cancel icon-button"+ :title="plugin.is_custom ? 'Delete' : 'Builtin plugins cannot be deleted'"+ :disabled="!plugin.is_custom"+ @click="$confirmClick($event, () => $store.pluginListStore.deletePlugin(plugin))">+ <span class="icon material-symbols-outlined">delete</span></button></div></div>-- <div x-show="$store.pluginListStore.loading" class="loading">- <span>Loading plugins...</span>- </div>-- <div class="plugins-list">- <template x-for="plugin in ($store.pluginListStore.plugins || [])" :key="plugin.path || plugin.name">- <div class="plugin-card">- <div class="plugin-header">- <div class="plugin-heading">- <div class="plugin-title" x-text="plugin.name || '(unnamed plugin)'"></div>- <code class="plugin-path" x-text="plugin.path"></code>- </div>- <div class="plugin-actions">- <template x-if="plugin.has_main_screen">- <button type="button" class="button" title="Open"- @click="$store.pluginListStore.openPlugin && $store.pluginListStore.openPlugin(plugin)">- <span class="icon material-symbols-outlined">assistant_on_hub</span> Open- </button>- </template>- <template x-if="plugin.has_config_screen">- <button type="button" class="button" title="Config"- @click="$store.pluginListStore.openPluginConfig && $store.pluginListStore.openPluginConfig(plugin)">- <span class="icon material-symbols-outlined">settings</span> Config- </button>- </template>- <button type="button" class="button" title="Info"- @click="$store.pluginListStore.openPluginInfo && $store.pluginListStore.openPluginInfo(plugin)">- <span class="icon material-symbols-outlined">info</span> Info- </button>- <button type="button" class="button cancel icon-button" title="Delete"- @click="$confirmClick($event, () => $store.pluginListStore.deletePlugin && $store.pluginListStore.deletePlugin(plugin))">- <span class="icon material-symbols-outlined">delete</span>- </button>- </div>- </div>- <div class="plugin-description" x-text="plugin.description || 'No description provided.'"></div>- </div>- </template>- </div>+ <div class="plugin-description" x-text="plugin.description || 'No description provided.'"></div></div>- </div>+ </template></div>-</div></template></div>@@ -172,24 +129,12 @@background: var(--color-bg-primary);}- .tab-content {- padding-top: 0.75rem;- }-- .tab-pane {- display: none;- }-- .tab-pane.active {- display: block;- }-.plugins-toolbar {display: flex;align-items: center;gap: 0.75rem;flex-wrap: wrap;- margin-top: 0.25rem;+ margin-top: 0.5rem;margin-bottom: 0.75rem;}@@ -238,47 +183,13 @@align-items: center;gap: 0.5rem;padding-bottom: var(--spacing-sm);- flex-wrap: nowrap;+ flex-wrap: wrap;min-width: 0;- flex: 0 0 auto;+ flex: 0 1 11.5rem;max-width: 100%;justify-content: flex-end;}- @media (max-width: 640px) {- .plugin-header {- flex-direction: column;- align-items: stretch;- }-- .plugin-heading {- width: 100%;- flex: 0 0 auto;- }-- .plugin-actions {- width: 100%;- justify-content: flex-start;- padding-bottom: 0;- flex-wrap: wrap;- }-- .plugin-path {- white-space: normal;- word-break: break-word;- }- }-- .plugin-actions .button {- padding: 0.25rem 0.5rem;- font-size: 0.85rem;- line-height: 1.1;- }-- .plugin-actions .button .icon {- font-size: 1.1rem;- }-.plugin-description {margin-top: 0.35rem;color: var(--color-text-secondary);@@ -303,6 +214,30 @@margin-bottom: 0.75rem;color: var(--color-secondary);}++ @media (max-width: 640px) {+ .plugin-header {+ flex-direction: column;+ align-items: stretch;+ }++ .plugin-heading {+ width: 100%;+ flex: 0 0 auto;+ }++ .plugin-actions {+ width: 100%;+ justify-content: flex-start;+ padding-bottom: 0;+ flex-wrap: wrap;+ }++ .plugin-path {+ white-space: normal;+ word-break: break-word;+ }+ }</style></body>diff --git a/webui/components/plugins/list/pluginListStore.js b/webui/components/plugins/list/pluginListStore.jsindex 4cfba8747..2a7d5491d 100644--- a/webui/components/plugins/list/pluginListStore.js+++ b/webui/components/plugins/list/pluginListStore.js@@ -1,5 +1,6 @@import { createStore } from "/js/AlpineStore.js";import * as api from "/js/api.js";+import "/components/plugins/plugin-settings-store.js";import {store as notificationStore,defaultPriority,@@ -9,19 +10,88 @@ import {const model = {loading: false,plugins: [],+ selectedPlugin: null,+ activeTab: "custom",async loadPluginList(filter) {this.loading = true;- this.plugins = [];+ this.selectedPlugin = null;try {const response = await api.callJsonApi("plugins_list", { filter });- this.plugins = response.plugins;+ this.plugins = Array.isArray(response.plugins) ? response.plugins : [];} catch (e) {+ this.plugins = [];showErrorNotification(e, "Failed to load plugins list");} finally {this.loading = false;}},++ async setTab(tab) {+ this.activeTab = tab === "builtin" ? "builtin" : "custom";+ const filter =+ this.activeTab === "builtin"+ ? { builtin: true, custom: false, search: "" }+ : { builtin: false, custom: true, search: "" };+ await this.loadPluginList(filter);+ },++ async refresh() {+ await this.setTab(this.activeTab);+ },++ openPlugin(plugin) {+ if (!plugin?.name || !plugin?.has_main_screen) return;+ window.openModal?.(`/plugins/${plugin.name}/webui/main.html`);+ },++ async openPluginConfig(plugin) {+ if (!plugin?.name || !plugin?.has_config_screen) return;+ try {+ const pluginSettingsStore = Alpine.store("pluginSettings");+ if (!pluginSettingsStore?.open) {+ throw new Error("Plugin settings store is unavailable.");+ }+ await pluginSettingsStore.open(plugin.name);+ window.openModal?.("components/plugins/plugin-settings.html");+ } catch (e) {+ showErrorNotification(e, "Failed to open plugin config");+ }+ },++ openPluginInfo(plugin) {+ if (!plugin) return;+ this.selectedPlugin = plugin;+ window.openModal?.("components/plugins/plugin-info.html");+ },++ async deletePlugin(plugin) {+ if (!plugin?.path) return;++ if (!plugin.is_custom) {+ showErrorNotification(+ new Error("Only custom plugins can be deleted from this modal."),+ "Delete blocked",+ );+ return;+ }++ try {+ const response = await api.callJsonApi("delete_work_dir_file", {+ path: plugin.path,+ currentPath: "/",+ });+ if (response?.error) {+ throw new Error(response.error);+ }+ if (window.toastFrontendSuccess) {+ window.toastFrontendSuccess("Plugin deleted", "Plugins");+ }+ await this.refresh();+ } catch (e) {+ showErrorNotification(e, "Failed to delete plugin");+ }+ },};function showErrorNotification(error, heading) {diff --git a/webui/components/plugins/plugin-info.html b/webui/components/plugins/plugin-info.htmlnew file mode 100644index 000000000..eade01797--- /dev/null+++ b/webui/components/plugins/plugin-info.html@@ -0,0 +1,119 @@+<html>+<head>+ <title>Plugin Info</title>+ <script type="module">+ import { store } from "/components/plugins/list/pluginListStore.js";+ </script>+</head>+<body>+ <div x-data>+ <template x-if="$store.pluginListStore && $store.pluginListStore.selectedPlugin">+ <div class="plugin-info-view">+ <div class="plugin-info-header">+ <h2 class="plugin-info-title"+ x-text="$store.pluginListStore.selectedPlugin.display_name || $store.pluginListStore.selectedPlugin.name"></h2>+ <div class="plugin-info-source"+ x-text="$store.pluginListStore.selectedPlugin.is_custom ? 'Custom plugin' : 'Builtin plugin'"></div>+ </div>++ <div class="plugin-info-description"+ x-text="$store.pluginListStore.selectedPlugin.description || 'No description provided.'"></div>++ <div class="plugin-info-grid">+ <div class="plugin-info-label">Plugin ID:</div>+ <div class="plugin-info-value">+ <code x-text="$store.pluginListStore.selectedPlugin.name"></code>+ </div>++ <div class="plugin-info-label">Version:</div>+ <div class="plugin-info-value"+ x-text="$store.pluginListStore.selectedPlugin.version || 'n/a'"></div>++ <div class="plugin-info-label">Path:</div>+ <div class="plugin-info-value">+ <code x-text="$store.pluginListStore.selectedPlugin.path"></code>+ </div>++ <div class="plugin-info-label">Settings sections:</div>+ <div class="plugin-info-value"+ x-text="($store.pluginListStore.selectedPlugin.settings_sections || []).length ? $store.pluginListStore.selectedPlugin.settings_sections.join(', ') : 'None'"></div>++ <div class="plugin-info-label">Per-project config:</div>+ <div class="plugin-info-value"+ x-text="$store.pluginListStore.selectedPlugin.per_project_config ? 'Yes' : 'No'"></div>++ <div class="plugin-info-label">Per-agent config:</div>+ <div class="plugin-info-value"+ x-text="$store.pluginListStore.selectedPlugin.per_agent_config ? 'Yes' : 'No'"></div>++ <div class="plugin-info-label">Main screen:</div>+ <div class="plugin-info-value"+ x-text="$store.pluginListStore.selectedPlugin.has_main_screen ? 'Available' : 'Not available'"></div>++ <div class="plugin-info-label">Config screen:</div>+ <div class="plugin-info-value"+ x-text="$store.pluginListStore.selectedPlugin.has_config_screen ? 'Available' : 'Not available'"></div>+ </div>+ </div>+ </template>+ </div>++ <div class="modal-footer" data-modal-footer>+ <button class="btn btn-cancel" @click="window.closeModal?.()">Close</button>+ </div>++ <style>+ .plugin-info-header {+ display: flex;+ flex-wrap: wrap;+ align-items: baseline;+ justify-content: space-between;+ gap: 0.75rem;+ margin-bottom: 0.5rem;+ }++ .plugin-info-title {+ margin: 0;+ font-size: 1.1rem;+ }++ .plugin-info-source {+ color: var(--color-text-secondary);+ font-size: var(--font-size-small);+ }++ .plugin-info-description {+ margin-bottom: 1rem;+ color: var(--color-text-secondary);+ }++ .plugin-info-grid {+ display: grid;+ grid-template-columns: 12rem 1fr;+ gap: 0.5rem 0.75rem;+ }++ .plugin-info-label {+ font-weight: 600;+ color: var(--color-text-secondary);+ }++ .plugin-info-value {+ min-width: 0;+ word-break: break-word;+ overflow-wrap: anywhere;+ }++ @media (max-width: 640px) {+ .plugin-info-grid {+ grid-template-columns: 1fr;+ gap: 0.25rem;+ }++ .plugin-info-label {+ margin-top: 0.5rem;+ }+ }+ </style>+</body>+</html>diff --git a/webui/components/plugins/plugin-settings-store.js b/webui/components/plugins/plugin-settings-store.jsindex edc80724d..5a47a0de3 100644--- a/webui/components/plugins/plugin-settings-store.js+++ b/webui/components/plugins/plugin-settings-store.js@@ -79,7 +79,7 @@ const model = {method: "POST",headers: { "Content-Type": "application/json" },body: JSON.stringify({- action: "get_settings",+ action: "get_config",plugin_name: this.pluginName,project_name: this.projectName || "",agent_profile: this.agentProfileKey || "",@@ -117,7 +117,7 @@ const model = {method: "POST",headers: { "Content-Type": "application/json" },body: JSON.stringify({- action: "save_settings",+ action: "save_config",plugin_name: this.pluginName,project_name: this.projectName || "",agent_profile: this.agentProfileKey || "",@@ -144,7 +144,7 @@ const model = {// Reactive URL for the plugin's settings component (used with x-html injection)get settingsComponentHtml() {if (!this.pluginName) return "";- return `<x-component path="/plugins/${this.pluginName}/webui/settings.html"></x-component>`;+ return `<x-component path="/plugins/${this.pluginName}/webui/config.html"></x-component>`;},};diff --git a/webui/components/plugins/plugin-settings.html b/webui/components/plugins/plugin-settings.htmlindex a8bbab5bb..88b669779 100644--- a/webui/components/plugins/plugin-settings.html+++ b/webui/components/plugins/plugin-settings.html@@ -52,7 +52,7 @@<span>Loading settings...</span></div>- <!-- Plugin settings body: plugin provides /plugins/<name>/webui/settings.html -->+ <!-- Plugin settings body: plugin provides /plugins/<name>/webui/config.html --><div x-show="!$store.pluginSettings.isLoading"class="plugin-settings-body"x-html="$store.pluginSettings.settingsComponentHtml">diff --git a/webui/components/settings/plugins/plugins-subsection.html b/webui/components/settings/plugins/plugins-subsection.htmlindex 78b1542f3..d654a4271 100644--- a/webui/components/settings/plugins/plugins-subsection.html+++ b/webui/components/settings/plugins/plugins-subsection.html@@ -25,21 +25,30 @@if (!this.tab) return;this.loading = true;try {- const r = await globalThis.fetchApi('/plugins', {+ const r = await globalThis.fetchApi('/plugins_list', {method: 'POST',headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ action: 'list', tab: this.tab }),+ body: JSON.stringify({+ filter: { custom: true, builtin: true },+ }),});const data = await r.json().catch(() => ({}));- this.plugins = (data.ok ? data.data || [] : []).filter(p => p.has_settings_ui);+ const plugins = data.ok ? (data.plugins || []) : [];+ this.plugins = plugins.filter((plugin) => {+ const sections = Array.isArray(plugin.settings_sections)+ ? plugin.settings_sections+ : [];+ return plugin.has_config_screen && sections.includes(this.tab);+ });} catch {this.plugins = [];} finally {this.loading = false;}},- async openSettings(pluginName) {- await Alpine.store('pluginSettings')?.open(pluginName);+ async openSettings(plugin) {+ if (!plugin?.name) return;+ await Alpine.store('pluginSettings')?.open(plugin.name);window.openModal?.('components/plugins/plugin-settings.html');}}" x-init="init()">@@ -55,13 +64,13 @@<span>Loading...</span></div>- <template x-for="plugin in plugins" :key="plugin.name">+ <template x-for="plugin in plugins" :key="plugin.path || plugin.name"><div class="plugin-subsection-row"><div class="plugin-subsection-info"><span class="plugin-subsection-name" x-text="plugin.display_name || plugin.name"></span><span class="plugin-subsection-desc" x-text="plugin.description"></span></div>- <button class="button" @click="openSettings(plugin.name)">+ <button class="button" @click="openSettings(plugin)"><span class="icon material-symbols-outlined">settings</span>Settings</button>