Close the window. Args: optional { "label": string }; defaults to “main”.
(Linux/macOS need the label to act on the right window when called from
a non-main window. Windows resolves per-process via find_own_top_level_window.)
Close a specific window by label. Used by the tear-off Phase 4
merge path: after the candidate window pulls the dragged tab into
its own workspace via MoveTabToWorkspace, the dragged window is
empty and should be destroyed. Posts WM_CLOSE on Win32; uses the
existing UI-thread close task on other platforms.
Find the top-level window belonging to this process.
In CEF Views mode, browser.host().window_handle() returns NULL,
so we enumerate windows and find ours by process ID.
Return the OS double-click interval in milliseconds.
On Windows: GetDoubleClickTime() — typically 500ms, user-configurable
via Mouse settings. On non-Windows: hardcoded 500ms (the Win32 default,
also a common cross-platform default; Phase 7 can refine per platform).
List all open window instances with their backend window IDs.
Same filtering as list_windows (excludes unpromoted pool windows
and browser-pane child HWNDs), but returns [{label, windowId}]
pairs so the frontend can resolve per-window backend objects
(Window record → meta[“window:displayname”], etc.) without an
extra round-trip per row.
List all open window labels, excluding unpromoted pool windows.
Pool windows are pre-warmed tear-off scratch windows kept hidden
from the user (WS_EX_TOOLWINDOW, no taskbar entry). Including them
in list_windows inflates the frontend’s InstancePanel row count
with phantom entries the user can’t see or focus.
Open a new full AgentMux instance (status-bar version click, Ctrl+Shift+N,
second agentmux.exe launch). Independent top-level window, own taskbar
entry, independent lifecycle. See
docs/specs/SPEC_MULTIWINDOW_TASKBAR_GROUPING.md.
Open a sub-window tied to parent_instance_id. Not exposed to users —
reserved for agent / backend callers that need a transient auxiliary
top-level window (tool-spawned panels, diff views, etc.). Sub-windows are
hidden from the taskbar via ITaskbarList::DeleteTab and close when their
parent full instance closes.
Register the backend window ID for a window label.
Called by the frontend after it has initialized its backend Window object.
Used by on_before_close to notify the backend when a secondary window closes.
Resolve the base URL for the frontend.
Production: IPC server serves static files from frontend/ next to the exe.
Dev: Vite dev server at http://localhost:5173.
Move the window to an absolute screen position (x, y).
Each call is self-contained — no read-modify-write — so concurrent in-flight
calls are idempotent: the last write wins, which is exactly correct for drag.
Initiate window drag (for frameless windows).
Windows: sends WM_NCLBUTTONDOWN/HTCAPTION via Win32 — find_own_top_level_window
resolves the per-process HWND so multi-window works without a label.
Linux/macOS: dispatches CefWindow::BeginWindowDrag on the UI thread; needs
the source window’s label so non-main windows drag themselves rather than
the main window. Frontend reads ?windowLabel=… from its URL and passes
it here; missing → “main” for backward compatibility.