Skip to content

Agent Zero AI framework

Expose scoped plugin configuration indexes

Alessandrob5006d571cd7
diff --git a/plugins/_tool_access/AGENTS.md b/plugins/_tool_access/AGENTS.md
index c46f3324c..28193e00e 100644
--- a/plugins/_tool_access/AGENTS.md
+++ b/plugins/_tool_access/AGENTS.md
@@ -12,10 +12,9 @@
## Local Contracts
-- This plugin has no independent settings UI; the Agent Editor writes sparse
- profile `config.json` files, projects may own project or project-profile
- configs through the standard plugin scope paths, and the runtime remains
- authoritative.
+- This plugin has no independent settings form; the generic plugin settings
+ shell exposes its scoped configuration index, while Agent Editor writes
+ sparse profile `config.json` files and the runtime remains authoritative.
- Custom configuration stores independent `default` and `mcp_default`
fallbacks; explicit canonical IDs remain shared in `allowed` and `blocked`.
- Required final-response capability is never disabled.
diff --git a/plugins/_tool_access/README.md b/plugins/_tool_access/README.md
index 9de78ea7c..fff1ef71a 100644
--- a/plugins/_tool_access/README.md
+++ b/plugins/_tool_access/README.md
@@ -5,6 +5,8 @@ Policies use the standard plugin precedence: active project profile, active
project, user profile, bundled/plugin profile, then the default. Sparse project
policy lives under `.a0proj/plugins/_tool_access/config.json`; profile policy
lives under `usr/agents/<profile>/plugins/_tool_access/config.json`.
+The Plugins screen exposes these scoped files through its existing
+configuration list; policy choices remain owned by Agent Editor.
One resolver filters textual prompts and provider-native schemas, rejects local
and MCP execution, and keeps delegated agents bound to their own effective scope.
diff --git a/tests/test_plugin_activation_ui.py b/tests/test_plugin_activation_ui.py
index afb21486b..43505b715 100644
--- a/tests/test_plugin_activation_ui.py
+++ b/tests/test_plugin_activation_ui.py
@@ -124,6 +124,29 @@ def test_config_scope_activation_toggle_saves_immediately_for_selected_scope():
assert "action: \"toggle_plugin\"" in toggle_store
+def test_scoped_plugin_without_settings_form_exposes_configuration_index():
+ list_html = (
+ PROJECT_ROOT / "webui/components/plugins/list/plugin-list.html"
+ ).read_text(encoding="utf-8")
+ list_store = (
+ PROJECT_ROOT / "webui/components/plugins/list/pluginListStore.js"
+ ).read_text(encoding="utf-8")
+ settings_html = (
+ PROJECT_ROOT / "webui/components/plugins/plugin-settings.html"
+ ).read_text(encoding="utf-8")
+ settings_store = (
+ PROJECT_ROOT / "webui/components/plugins/plugin-settings-store.js"
+ ).read_text(encoding="utf-8")
+
+ assert "canOpenPluginConfig(plugin)" in list_html
+ assert "plugin?.per_project_config" in list_store
+ assert "plugin?.per_agent_config" in list_store
+ assert "!pluginMeta.per_project_config" in settings_store
+ assert "!pluginMeta.per_agent_config" in settings_store
+ assert "Scoped configurations" in settings_html
+ assert "context.pluginMeta?.has_config_screen" in settings_html
+
+
def test_toggle_plugin_writes_project_scope_file_immediately(tmp_path, monkeypatch):
monkeypatch.setattr(files, "_base_dir", str(tmp_path))
monkeypatch.setattr(plugins, "after_plugin_change", lambda *_args, **_kwargs: None)
diff --git a/webui/components/plugins/AGENTS.md b/webui/components/plugins/AGENTS.md
index eb921b78a..4b35fd614 100644
--- a/webui/components/plugins/AGENTS.md
+++ b/webui/components/plugins/AGENTS.md
@@ -17,6 +17,9 @@
- Preserve global and scoped toggle semantics using `.toggle-1` and `.toggle-0`.
- Use notification helpers for plugin UI feedback.
- Label reset actions `Reset to default` and resolve notification globals when the action runs so late WebUI initialization cannot abort the reset lifecycle.
+- Scoped plugins without a custom settings form still expose the standard scope
+ selectors and existing-configuration list; do not show inert Save or Reset
+ actions for them.
## Work Guidance
diff --git a/webui/components/plugins/list/plugin-list.html b/webui/components/plugins/list/plugin-list.html
index e5e95966d..b86a49718 100644
--- a/webui/components/plugins/list/plugin-list.html
+++ b/webui/components/plugins/list/plugin-list.html
@@ -105,7 +105,7 @@
<x-icon class="icon" name="dashboard"></x-icon> Open
</button>
</template>
- <template x-if="plugin.has_config_screen">
+ <template x-if="$store.pluginListStore.canOpenPluginConfig(plugin)">
<button type="button"
class="button"
title="Config"
diff --git a/webui/components/plugins/list/pluginListStore.js b/webui/components/plugins/list/pluginListStore.js
index 89d3751b0..7d260d30d 100644
--- a/webui/components/plugins/list/pluginListStore.js
+++ b/webui/components/plugins/list/pluginListStore.js
@@ -93,14 +93,23 @@ const model = {
pluginExecuteStore.open(plugin);
},
+ canOpenPluginConfig(plugin) {
+ return !!(
+ plugin?.has_config_screen ||
+ plugin?.per_project_config ||
+ plugin?.per_agent_config
+ );
+ },
+
async openPluginConfig(pluginOrName) {
const pluginName =
typeof pluginOrName === "string" ? pluginOrName : pluginOrName?.name;
if (!pluginName) return;
- // If it's an object, we can check has_config_screen.
- // If it's a name, we just try to open it and let pluginSettingsStore handle errors.
- if (typeof pluginOrName === "object" && !pluginOrName.has_config_screen)
+ if (
+ typeof pluginOrName === "object" &&
+ !this.canOpenPluginConfig(pluginOrName)
+ )
return;
try {
diff --git a/webui/components/plugins/plugin-settings-store.js b/webui/components/plugins/plugin-settings-store.js
index 064d2edb2..3c0a546eb 100644
--- a/webui/components/plugins/plugin-settings-store.js
+++ b/webui/components/plugins/plugin-settings-store.js
@@ -278,8 +278,12 @@ const model = {
if (!pluginMeta) {
throw new Error(`Plugin "${pluginName}" not found.`);
}
- if (!pluginMeta.has_config_screen) {
- throw new Error(`Plugin "${pluginName}" has no config screen.`);
+ if (
+ !pluginMeta.has_config_screen &&
+ !pluginMeta.per_project_config &&
+ !pluginMeta.per_agent_config
+ ) {
+ throw new Error(`Plugin "${pluginName}" has no configurable scope.`);
}
await Promise.all([this.loadProjects(), this.loadAgentProfiles()]);
@@ -432,7 +436,7 @@ const model = {
// Reactive URL for the plugin's settings component (used with x-html injection)
get settingsComponentHtml() {
- if (!this.pluginName) return "";
+ if (!this.pluginName || !this.pluginMeta?.has_config_screen) return "";
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.html
index 49251f57c..3516556cc 100644
--- a/webui/components/plugins/plugin-settings.html
+++ b/webui/components/plugins/plugin-settings.html
@@ -117,6 +117,13 @@
class="plugin-settings-body"
x-html="context.settingsComponentHtml">
</div>
+ <div x-show="!context.isLoading && !context.pluginMeta?.has_config_screen"
+ class="plugin-settings-body">
+ <div class="section-title">Scoped configurations</div>
+ <div class="section-description">
+ Use the scope controls and list button above to review or remove existing configurations.
+ </div>
+ </div>
</div>
@@ -136,7 +143,7 @@
<div class="plugin-settings-footer-actions">
<button class="btn"
- x-show="!context.hideSettingsActions"
+ x-show="!context.hideSettingsActions && context.pluginMeta?.has_config_screen"
@click="context.resetToDefault()"
:disabled="context?.isSaving || context?.isLoading">
Reset to default
@@ -148,7 +155,7 @@
<span x-text="context.wizardFooter?.nextLabel?.() || 'Next'"></span>
</button>
<button class="btn btn-ok"
- x-show="!context.hideSettingsActions && (!context.wizardFooter || context.wizardFooter?.showSave?.())"
+ x-show="!context.hideSettingsActions && context.pluginMeta?.has_config_screen && (!context.wizardFooter || context.wizardFooter?.showSave?.())"
@click="context.save()"
:disabled="context?.isSaving || context?.isLoading">
Save