Agent Zero AI framework
Integrate Launcher hosts into sync status
Alessandro8fed806a1f9d
diff --git a/plugins/_a0_connector/AGENTS.md b/plugins/_a0_connector/AGENTS.mdindex 69dd2b7d2..4d7fb2df7 100644--- a/plugins/_a0_connector/AGENTS.md+++ b/plugins/_a0_connector/AGENTS.md@@ -39,14 +39,16 @@- Launcher gateway scopes expose file reading and writing separately. Filewriting depends on reading, and Code execution depends on file writing. Keepolder gateway declarations without `file_write` read/write compatible.-- The `chat-top-end` Launcher gateway extension renders only when the user agent+- The `sync-status-end` Launcher gateway extension renders only when the user agentincludes `A0-Launcher/`. It may show status, master/scope controls,preparation errors, and Emergency disconnect; standard browser sessions must- not expose it. Keep its trigger icon-only at rest and reveal the status label- on hover, keyboard focus, or while open. Connected and disconnected states- share the computer glyph; the adjacent status dot communicates connectivity.+ not expose it. Keep its trigger inside the existing sync indicator, render one+ computer glyph per connected Launcher gateway, and retain one muted glyph+ while disconnected so the control remains reachable. Do not add a native+ tooltip, visible status label, count badge, or animated expansion.Keep the open popover above the compact right-canvas rail and report control- failures through the shared notification system.+ failures through the shared notification system. Use the standard WebUI+ border-radius tokens for its controls and popover.- File operation results may arrive as chunked JSON/base64`connector_file_op_result` frames; resolve the pending file operation onlyafter all chunks for the `op_id` are assembled.diff --git a/plugins/_a0_connector/extensions/webui/chat-top-end/launcher-gateway.html b/plugins/_a0_connector/extensions/webui/sync-status-end/launcher-gateway.htmlsimilarity index 79%rename from plugins/_a0_connector/extensions/webui/chat-top-end/launcher-gateway.htmlrename to plugins/_a0_connector/extensions/webui/sync-status-end/launcher-gateway.htmlindex aa8764bca..4dae0c5d8 100644--- a/plugins/_a0_connector/extensions/webui/chat-top-end/launcher-gateway.html+++ b/plugins/_a0_connector/extensions/webui/sync-status-end/launcher-gateway.html@@ -16,15 +16,19 @@type="button"class="launcher-gateway-trigger":class="`is-${$store.launcherGateway.state}${$store.launcherGateway.open ? ' is-open' : ''}`"- :title="`Host access: ${$store.launcherGateway.stateLabel}`":aria-label="`Host access: ${$store.launcherGateway.stateLabel}`"aria-haspopup="dialog":aria-expanded="$store.launcherGateway.open.toString()"@click.stop="$store.launcherGateway.open = !$store.launcherGateway.open">- <span class="launcher-gateway-dot" aria-hidden="true"></span>- <span class="material-symbols-outlined" aria-hidden="true" x-text="$store.launcherGateway.stateIcon"></span>- <span class="launcher-gateway-trigger-label" x-text="$store.launcherGateway.stateLabel"></span>+ <template x-for="(gateway, index) in ($store.launcherGateway.status?.gateways || [])" :key="gateway.id || index">+ <span class="material-symbols-outlined launcher-gateway-host-icon" aria-hidden="true">computer</span>+ </template>+ <span+ class="material-symbols-outlined launcher-gateway-host-icon is-placeholder"+ x-show="!($store.launcherGateway.status?.gateways || []).length"+ aria-hidden="true"+ >computer</span></button><section@@ -115,35 +119,24 @@<style>#time-date-container:has(.launcher-gateway-trigger.is-open) { z-index: 3500; }- .launcher-gateway-root { position: relative; }+ .launcher-gateway-root { position: relative; display: inline-flex; align-items: center; }.launcher-gateway-trigger {- display: inline-flex; align-items: center; gap: 0; min-height: 2rem;- padding: .25rem .55rem; border: 1px solid var(--color-border); border-radius: 999px;- color: var(--color-text); background: color-mix(in srgb, var(--color-panel) 92%, transparent);- cursor: pointer; font: inherit; font-size: .75rem;- }- .launcher-gateway-trigger .material-symbols-outlined { font-size: 1rem; }- .launcher-gateway-trigger-label {- max-width: 0; margin-left: 0; overflow: hidden; opacity: 0; white-space: nowrap;- transition: max-width 180ms cubic-bezier(.4, 0, .2, 1),- margin-left 180ms cubic-bezier(.4, 0, .2, 1),- opacity 120ms ease-out;+ display: inline-flex; align-items: center; gap: .12rem; min-height: 1.4rem;+ padding: .08rem; border: 0; border-radius: var(--border-radius-sm);+ color: var(--color-text-secondary); background: transparent; cursor: pointer;}- .launcher-gateway-root:hover .launcher-gateway-trigger-label,- .launcher-gateway-trigger:focus-visible .launcher-gateway-trigger-label,- .launcher-gateway-trigger.is-open .launcher-gateway-trigger-label {- max-width: 8rem; margin-left: .35rem; opacity: 1;- }- .launcher-gateway-dot { width: .45rem; height: .45rem; margin-right: .35rem; border-radius: 50%; background: #7b8491; }- .launcher-gateway-trigger.is-connected .launcher-gateway-dot { background: #45b86b; }- .launcher-gateway-trigger.is-connecting .launcher-gateway-dot { background: #5b9cff; }- .launcher-gateway-trigger.is-paused .launcher-gateway-dot { background: #d6a43d; }- .launcher-gateway-trigger.is-needs_action .launcher-gateway-dot,- .launcher-gateway-trigger.is-multiple_hosts .launcher-gateway-dot { background: #e49a35; }- .launcher-gateway-trigger.is-error .launcher-gateway-dot { background: #db5b61; }+ .launcher-gateway-trigger:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }+ .launcher-gateway-host-icon { font-size: 1rem; }+ .launcher-gateway-trigger.is-connected .launcher-gateway-host-icon { color: #00c340; }+ .launcher-gateway-trigger.is-connecting .launcher-gateway-host-icon { color: #5b9cff; }+ .launcher-gateway-trigger.is-paused .launcher-gateway-host-icon { color: #d6a43d; }+ .launcher-gateway-trigger.is-needs_action .launcher-gateway-host-icon,+ .launcher-gateway-trigger.is-multiple_hosts .launcher-gateway-host-icon { color: #e49a35; }+ .launcher-gateway-trigger.is-error .launcher-gateway-host-icon { color: #db5b61; }+ .launcher-gateway-host-icon.is-placeholder { opacity: .55; }.launcher-gateway-popover {position: absolute; top: calc(100% + .45rem); right: 0; z-index: 1200; width: min(20rem, calc(100vw - 2rem));- padding: .8rem; border: 1px solid var(--color-border); border-radius: .7rem;+ padding: .8rem; border: 1px solid var(--color-border); border-radius: var(--border-radius);background: var(--color-panel); box-shadow: 0 16px 42px rgba(0, 0, 0, .24);}.launcher-gateway-header { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }@@ -164,9 +157,6 @@.launcher-gateway-notices p { display: flex; gap: .35rem; margin: 0; color: #d79b35; font-size: .75rem; line-height: 1.3; }.launcher-gateway-notices .material-symbols-outlined { font-size: .95rem; }.launcher-gateway-empty { margin: .7rem 0 0; color: var(--color-text-secondary); font-size: .78rem; }- .launcher-gateway-disconnect { width: 100%; margin-top: .75rem; padding: .48rem .65rem; border: 1px solid color-mix(in srgb, #db5b61 55%, var(--color-border)); border-radius: .45rem; background: transparent; color: #db5b61; cursor: pointer; }+ .launcher-gateway-disconnect { width: 100%; margin-top: .75rem; padding: .48rem .65rem; border: 1px solid color-mix(in srgb, #db5b61 55%, var(--color-border)); border-radius: var(--border-radius-sm); background: transparent; color: #db5b61; cursor: pointer; }.launcher-gateway-disconnect:disabled { opacity: .55; cursor: default; }- @media (prefers-reduced-motion: reduce) {- .launcher-gateway-trigger-label { transition: none; }- }</style>diff --git a/plugins/_a0_connector/webui/launcher-gateway-store.js b/plugins/_a0_connector/webui/launcher-gateway-store.jsindex 7073593db..d57130efc 100644--- a/plugins/_a0_connector/webui/launcher-gateway-store.js+++ b/plugins/_a0_connector/webui/launcher-gateway-store.js@@ -37,19 +37,6 @@ const model = {return labels[this.state] || "Disconnected";},- get stateIcon() {- const icons = {- connecting: "sync",- connected: "computer",- paused: "pause_circle",- needs_action: "warning",- error: "error",- multiple_hosts: "devices",- disconnected: "computer",- };- return icons[this.state] || "computer";- },-get hostLabel() {return this.gateway?.host_label || "Launcher host";},diff --git a/tests/test_a0_connector_launcher_gateway.py b/tests/test_a0_connector_launcher_gateway.pyindex ee6947148..1bf3d212d 100644--- a/tests/test_a0_connector_launcher_gateway.py+++ b/tests/test_a0_connector_launcher_gateway.py@@ -57,6 +57,30 @@ def test_launcher_gateway_control_errors_use_webui_notifications() -> None:assert 'void toastFrontendError(' in source+def test_launcher_gateway_indicator_joins_sync_status_without_visual_noise() -> None:+ root = Path(__file__).parents[1]+ source = (+ root+ / "plugins"+ / "_a0_connector"+ / "extensions"+ / "webui"+ / "sync-status-end"+ / "launcher-gateway.html"+ ).read_text(encoding="utf-8")+ sync_status = (root / "webui" / "components" / "sync" / "sync-status.html").read_text(+ encoding="utf-8"+ )++ assert '<x-extension id="sync-status-end"></x-extension>' in sync_status+ assert ":title=" not in sync_status+ assert 'x-for="(gateway, index)' in source+ assert "launcher-gateway-trigger-label" not in source+ assert "launcher-gateway-dot" not in source+ assert ":title=" not in source+ assert "border-radius: var(--border-radius);" in source++def test_launcher_gateway_is_fallback_after_context_bound_cli() -> None:context_id = f"ctx-{uuid.uuid4()}"cli_sid = _sid("cli")diff --git a/tests/test_webui_extension_surfaces.py b/tests/test_webui_extension_surfaces.pyindex 0536c4905..f672066f6 100644--- a/tests/test_webui_extension_surfaces.py+++ b/tests/test_webui_extension_surfaces.py@@ -52,6 +52,7 @@ SURFACE_SCENARIOS: list[tuple[str, str]] = [("chat-input-bottom-actions-end", "webui/components/chat/input/bottom-actions-bar.html"),("chat-top-start", "webui/components/chat/top-section/chat-top.html"),("chat-top-end", "webui/components/chat/top-section/chat-top.html"),+ ("sync-status-end", "webui/components/sync/sync-status.html"),("welcome-screen-start", "webui/components/welcome/welcome-screen.html"),("welcome-screen-end", "webui/components/welcome/welcome-screen.html"),("welcome-actions-start", "webui/components/welcome/welcome-screen.html"),diff --git a/webui/components/sync/AGENTS.md b/webui/components/sync/AGENTS.mdindex d47d46b80..e01f8ec82 100644--- a/webui/components/sync/AGENTS.md+++ b/webui/components/sync/AGENTS.md@@ -7,12 +7,15 @@## Ownership- `sync-store.js` owns sync status state.-- `sync-status.html` owns sync indicator markup.+- `sync-status.html` owns sync indicator markup and the `sync-status-end`+ extension point for connection-related controls.## Local Contracts- Keep sync state compatible with WebSocket state-sync events.- Avoid noisy user-facing alerts for transient sync state unless existing UX expects them.+- Keep the compact status cluster free of native title tooltips; interactive+ extensions must provide accessible names directly.## Work Guidancediff --git a/webui/components/sync/sync-status.html b/webui/components/sync/sync-status.htmlindex 1a5d2fba5..a443abf09 100644--- a/webui/components/sync/sync-status.html+++ b/webui/components/sync/sync-status.html@@ -10,12 +10,17 @@.status-icon {display: inline-flex;align-items: center;+ gap: 0.1rem;}.status-icon svg {pointer-events: none;}+ .status-icon > x-extension {+ display: contents;+ }+.pending-ring {animation: pendingPulse 1.2s infinite ease-in-out;}@@ -45,13 +50,6 @@<divclass="status-icon"x-create="$store.sync.init()"- :title="$store.sync.mode === 'HEALTHY'- ? 'Connected (push sync healthy)'- : $store.sync.mode === 'HANDSHAKE_PENDING'- ? 'Connecting (waiting for state handshake)'- : $store.sync.mode === 'DEGRADED'- ? 'Degraded (polling fallback)'- : 'Disconnected (waiting to reconnect)'"><svg viewBox="0 0 30 30" width="20" height="20" aria-label="sync status"><!-- HEALTHY (filled circle) -->@@ -68,6 +66,7 @@<circle x-show="$store.sync.mode === 'DISCONNECTED'" cx="15" cy="15" r="12"fill="none" stroke="#e40138" stroke-width="3" /></svg>+ <x-extension id="sync-status-end"></x-extension></div></template></div>