Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

expose browser tool execution in cua

Sarina Lifda7c65ccd42
diff --git a/libs/python/agent/agent/computers/cua.py b/libs/python/agent/agent/computers/cua.py
index 4037452886..6f928402cb 100644
--- a/libs/python/agent/agent/computers/cua.py
+++ b/libs/python/agent/agent/computers/cua.py
@@ -130,3 +130,22 @@ class cuaComputerHandler(AsyncComputerHandler):
"""Left mouse up at coordinates."""
assert self.interface is not None
await self.interface.mouse_up(x, y, button="left")
+
+ # ==== Browser Control Methods (via Playwright) ====
+ async def playwright_exec(
+ self, command: str, params: Optional[Dict[str, Any]] = None
+ ) -> Dict[str, Any]:
+ """Execute a Playwright browser command.
+
+ Supports: visit_url, click, type, scroll, web_search, screenshot,
+ get_current_url, go_back, go_forward
+
+ Args:
+ command: The browser command to execute
+ params: Command parameters
+
+ Returns:
+ Dict containing the command result
+ """
+ assert self.interface is not None
+ return await self.interface.playwright_exec(command, params or {})