Module routes

Module routes 

Source
Expand description

Axum route handlers for /agentmux/browser/*.

Functions§

authorized 🔒
back
POST /agentmux/browser/back — walk the pane’s history one step back. Routed through CDP (Page.goBack) rather than BrowserPaneManager::go_back to keep the resolver cache honest: the target URL changes after the hop, so we invalidate the cache entry.
click_element
POST /agentmux/browser/click_element — synthesize a real mouse click on the first element matching selector. Dispatches Input.dispatchMouseEvent (mousePressed + mouseReleased) at the element’s centroid.
dispatch_key
POST /agentmux/browser/dispatch_key — send text or a named key to whatever has focus in the pane. Optionally focuses a selector first.
eval
POST /agentmux/browser/eval — run arbitrary JS in the pane’s renderer, return the serialized value.
focus_element
POST /agentmux/browser/focus_element — call .focus() on the first matching element. Does not synthesize a mouse event; use click_element when you want the full mouse-gesture semantics.
focus_info
POST /agentmux/browser/focus_info — report the current document.activeElement of the pane as an Element. See §5.2.
forward
POST /agentmux/browser/forward — walk the pane’s history one step forward. See back for the target-cache rationale.
navigate
POST /agentmux/browser/navigate — navigate the pane to a new URL via CDP Page.navigate. (We could call BrowserPaneManager::navigate directly, but routing through CDP keeps the resolver’s URL cache consistent — a subsequent request will re-probe /json if the target id changes.)
ok_body 🔒
open_cdp_for_block 🔒
query
POST /agentmux/browser/query — find DOM elements matching a CSS selector in the specified pane. See SPEC_BROWSER_DOM_API.md §5.2 for response shape.
reload
POST /agentmux/browser/reload — reload the current page. ignore_cache (default false) maps to the CDP flag — true is the equivalent of Ctrl+F5 (bypass the http cache). The pane’s current URL is preserved, so no target-cache invalidation is needed.
screenshot
POST /agentmux/browser/screenshot — capture a PNG of the pane’s rendered viewport. Uses CDP Page.captureScreenshot.