Agent Zero AI framework
Add WebUI slots for plugin controls
Alessandrofe86e99a3446
diff --git a/plugins/_model_config/AGENTS.md b/plugins/_model_config/AGENTS.mdindex dd699df4a..f3ba7d529 100644--- a/plugins/_model_config/AGENTS.md+++ b/plugins/_model_config/AGENTS.md@@ -28,6 +28,8 @@- `modelConfig.createPresetEditor()` owns local preset drafts, row actions, and stable UI-only row keys so deletion or renaming cannot rebind nested model fields.- The preset editor maps each model provider's API-key field to the shared API-key store; saving the editor persists dirty keys separately and never writes secrets into preset YAML.- The compact chat selector label combines the effective preset with only the leaf name of its main model; utility and provider text stay out of the closed selector.+- The compact selector strip exposes `model-context-strip-end` after the agent+ profile selector so adjacent bundled controls can stay plugin-owned.- The adjacent agent-profile selector reads the always-enabled Agent Editor listendpoint directly so the active profile shows its effective title and avatar,and omits profiles disabled in the chat's current scope plus the exactdiff --git a/plugins/_model_config/extensions/webui/chat-input-progress-start/model-switcher.html b/plugins/_model_config/extensions/webui/chat-input-progress-start/model-switcher.htmlindex 40efc579a..460bdfe72 100644--- a/plugins/_model_config/extensions/webui/chat-input-progress-start/model-switcher.html+++ b/plugins/_model_config/extensions/webui/chat-input-progress-start/model-switcher.html@@ -177,6 +177,8 @@</div></div></template>++ <x-extension id="model-context-strip-end"></x-extension></div></div></template>@@ -196,6 +198,11 @@min-width: 0;flex-wrap: wrap;}+ .model-context-strip > x-extension,+ .model-context-strip > x-extension > x-component,+ .model-context-strip > x-extension > x-component > div[x-data] {+ display: contents;+ }.agent-profile-avatar {width: 1.35rem;height: 1.35rem;diff --git a/tests/test_ui_control_visibility.py b/tests/test_ui_control_visibility.pyindex 0bb3cae75..91b57aa25 100644--- a/tests/test_ui_control_visibility.py+++ b/tests/test_ui_control_visibility.py@@ -25,6 +25,9 @@ def test_ui_controls_have_independent_mobile_and_desktop_visibility() -> None:assert control in preferencesassert control in settings_store+ assert "registerUiControlVisibility" in preferences+ assert 'id="interface-controls-end"' in interface+assert "section-interface" in settings_storeassert 'settings/agent/interface.html' in settingsassert "smartphone" in interfacediff --git a/webui/components/settings/AGENTS.md b/webui/components/settings/AGENTS.mdindex b4b8ec83a..05954bae5 100644--- a/webui/components/settings/AGENTS.md+++ b/webui/components/settings/AGENTS.md@@ -18,6 +18,9 @@- Do not store secrets in localStorage, URLs, or console output.- Preserve Store Gating and modal footer conventions in settings components.- Interface control visibility is edited as a Save/Cancel draft, persisted with instance settings, and applied through the shared frontend preference store after Settings saves successfully.+- Bundled controls contributed by plugins add their Interface row through+ `interface-controls-end` and register visibility defaults with the shared+ preference store.- MCP manager tool toggles write `disabled_tools` into the draft JSON and require Apply before changing the running MCP tool set.- Confirmed MCP server removals apply immediately and refresh server status; other MCP manager draft edits still require Apply.- MCP manager local command forms accept shell-style command and argument lines; quote argument values that intentionally contain spaces.diff --git a/webui/components/settings/agent/interface.html b/webui/components/settings/agent/interface.htmlindex db66c5868..7e804792a 100644--- a/webui/components/settings/agent/interface.html+++ b/webui/components/settings/agent/interface.html@@ -51,6 +51,7 @@</div></div></template>+ <x-extension id="interface-controls-end"></x-extension></div></div></template>@@ -80,6 +81,12 @@border-bottom: 0;}+ .ui-visibility-list > x-extension,+ .ui-visibility-list > x-extension > x-component,+ .ui-visibility-list > x-extension > x-component > div[x-data] {+ display: contents;+ }+.ui-visibility-control {display: flex;align-items: center;diff --git a/webui/components/sidebar/bottom/preferences/preferences-store.js b/webui/components/sidebar/bottom/preferences/preferences-store.jsindex 32e964cbb..ed16a437c 100644--- a/webui/components/sidebar/bottom/preferences/preferences-store.js+++ b/webui/components/sidebar/bottom/preferences/preferences-store.js@@ -2,12 +2,12 @@ import { createStore } from "/js/AlpineStore.js";import { ttsService } from "/js/tts-service.js";import { applyModeSteps } from "/components/messages/process-group/process-group-dom.js";-const UI_VISIBILITY_DEFAULTS = Object.freeze({+const UI_VISIBILITY_DEFAULTS = {projectSelector: { mobile: true, desktop: true },time: { mobile: false, desktop: true },connectionStatus: { mobile: true, desktop: true },rightCanvasRail: { mobile: true, desktop: true },-});+};function normalizeUiVisibility(value = {}) {return Object.fromEntries(@@ -93,6 +93,19 @@ const model = {_uiVisibility: normalizeUiVisibility(globalThis.runtimeInfo?.uiControlVisibility),_isMobileViewport: false,+ registerUiControlVisibility(control, defaults = {}) {+ const id = String(control || "").trim();+ if (!id) return;+ UI_VISIBILITY_DEFAULTS[id] = {+ mobile: defaults.mobile !== false,+ desktop: defaults.desktop !== false,+ };+ this._uiVisibility = normalizeUiVisibility({+ ...(globalThis.runtimeInfo?.uiControlVisibility || {}),+ ...(this._uiVisibility || {}),+ });+ },+uiVisibilitySnapshot() {return normalizeUiVisibility(this._uiVisibility);},