Skip to main content

BROWSER_EVAL_TOOL

Constant BROWSER_EVAL_TOOL 

Source
pub(crate) const BROWSER_EVAL_TOOL: &str = r#"{
  "name": "BrowserEval",
  "description": "Run arbitrary JavaScript in your OWN browser pane's page and return the serialized result — the general-purpose way to read page text/state (e.g. `document.body.innerText`), fill a form field, or wait for app-specific state, without a dedicated tool for every action. Only works if your own pane is a browser pane: the script runs in that page's own JS world, never the shared AgentMux window. Returns {result, type, exception} — exception is set (and result null) if the script threw. Pass pane (from OpenBrowser) to act on a browser pane you opened; without it this acts on your own pane.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "pane": { "type": "string", "description": "Optional: the pane id OpenBrowser returned, to act on a browser pane you opened instead of your own pane. Only panes you opened are accepted." },
      "script": { "type": "string", "description": "JavaScript expression to evaluate" },
      "await_promise": { "type": "boolean", "description": "If the script returns a Promise, wait for it to resolve before returning. Default false." }
    },
    "required": ["script"]
  }
}"#;