Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
fix(cua-driver): document macOS trusted background limitation (#4986)
injaneitya130c4d48d83
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/browser-input.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/browser-input.mdxindex 466897696b..004fdcea3b 100644--- a/docs/content/docs/cua-driver/reference/mcp-tools/browser-input.mdx+++ b/docs/content/docs/cua-driver/reference/mcp-tools/browser-input.mdx@@ -23,13 +23,13 @@ Served by `cua-driver mcp`; see [MCP tools](/cua-driver/reference/mcp-tools) for## `browser_click`-Click a page element (by ref) or viewport coordinates in an exactly-bound tab. Default route is trusted hardware-like input (Input.dispatchMouseEvent), and refuses where that route cannot preserve standalone-browser background posture unless delivery_mode="foreground" accepts that the browser window may activate (Linux Chromium; for example a browser inside a sandbox). input_route="dom_event" (synthetic el.click(), ref required) is used only when explicitly requested; it proves dispatch, not control activation, because trust-gated controls may ignore synthetic events. Refused for heuristic bindings.+Click a page element (by ref) or viewport coordinates in an exactly-bound tab. Default route is trusted hardware-like input (Input.dispatchMouseEvent), and refuses where that route cannot preserve standalone-browser background posture unless delivery_mode="foreground" accepts that the browser window may activate (including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background; for example a browser inside a sandbox). input_route="dom_event" (synthetic el.click(), ref required) is used only when explicitly requested; it proves dispatch, not control activation, because trust-gated controls may ignore synthetic events. Refused for heuristic bindings.Effect: mutating. Platforms: macOS, Linux, Windows.| Parameter | Type | Default | Description || --- | --- | --- | --- |-| <span id="browser_click--delivery_mode"></span>`delivery_mode` | `"background" \| "foreground"` | `"background"` | background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox). |+| <span id="browser_click--delivery_mode"></span>`delivery_mode` | `"background" \| "foreground"` | `"background"` | background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox). || <span id="browser_click--input_route"></span>`input_route` | `"trusted" \| "dom_event"` | | "trusted" (default): Input.dispatchMouseEvent. It refuses rather than foregrounding a standalone browser. "dom_event": synthetic full-background DOM click, only when explicitly requested. Dispatch does not prove the control activated; refresh page state and verify the expected postcondition. || <span id="browser_click--ref"></span>`ref` | `string` | | Page element ref in the p<snapshot>:<index> namespace from get_browser_state. Refs are invalidated by navigation and by newer snapshots of the same tab. || <span id="browser_click--session"></span>`session` | `string` | | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. Omit it to use the authenticated transport's implicit lifecycle session. Browser targets, tabs, and refs belong to the resolved lifecycle session. |@@ -75,7 +75,7 @@ Effect: mutating. Platforms: macOS, Linux, Windows.| Parameter | Type | Default | Description || --- | --- | --- | --- || <span id="browser_pointer--action"></span>`action` | `"hover" \| "right_click" \| "double_click" \| "scroll" \| "drag"` | required | Pointer gesture. scroll needs delta_x or delta_y; drag needs destination_ref or to_x/to_y. |-| <span id="browser_pointer--delivery_mode"></span>`delivery_mode` | `"background" \| "foreground"` | `"background"` | background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox). |+| <span id="browser_pointer--delivery_mode"></span>`delivery_mode` | `"background" \| "foreground"` | `"background"` | background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox). || <span id="browser_pointer--delta_x"></span>`delta_x` | `number` | | Horizontal scroll delta in CSS pixels. || <span id="browser_pointer--delta_y"></span>`delta_y` | `number` | | Vertical scroll delta in CSS pixels. || <span id="browser_pointer--destination_ref"></span>`destination_ref` | `string` | | Drag destination page ref in the exact same frame. |diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/browser/pointer.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/browser/pointer.rsindex ebe3f53f40..fc4615a8af 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/browser/pointer.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/browser/pointer.rs@@ -309,7 +309,7 @@ impl BrowserPointerTool {"session": required_session_schema(),"action": { "type": "string", "enum": ["hover", "right_click", "double_click", "scroll", "drag"], "description": "Pointer gesture. scroll needs delta_x or delta_y; drag needs destination_ref or to_x/to_y." },"input_route": { "type": "string", "enum": ["trusted", "dom_event"], "default": "trusted", "description": "trusted sends CDP Input events; dom_event synthesizes DOM events in the page and requires ref." },- "delivery_mode": { "type": "string", "enum": ["background", "foreground"], "default": "background", "description": "background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox)." },+ "delivery_mode": { "type": "string", "enum": ["background", "foreground"], "default": "background", "description": "background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox)." },"ref": { "type": "string", "description": "Origin page ref. Alternative to x/y." },"x": { "type": "number", "description": "Origin viewport x in CSS pixels." },"y": { "type": "number", "description": "Origin viewport y in CSS pixels." },diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/browser/tools.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/browser/tools.rsindex 59594eb83a..b9ed700eab 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/browser/tools.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/browser/tools.rs@@ -81,7 +81,7 @@ fn schema_delivery_mode() -> Value {"type": "string","enum": ["background", "foreground"],"default": "background",- "description": "background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox)."+ "description": "background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox)."})}@@ -907,7 +907,8 @@ impl BrowserClickTool {(Input.dispatchMouseEvent), and refuses where that route cannot \preserve standalone-browser background posture unless \delivery_mode=\"foreground\" accepts that the browser window may \- activate (Linux Chromium; for example a browser inside a sandbox). \+ activate (including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background; \+ for example a browser inside a sandbox). \input_route=\"dom_event\" (synthetic \el.click(), ref required) is used only when explicitly requested; \it proves dispatch, not control activation, because trust-gated \diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/protocol_schema_test.rs b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_schema_test.rsindex 08e814b34e..5113fca3b4 100644--- a/libs/cua-driver/rust/crates/cua-driver/tests/protocol_schema_test.rs+++ b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_schema_test.rs@@ -251,6 +251,31 @@ fn assert_tools_list_schema_shape(mut d: RawDriver) {"{tool}.delivery_mode should advertise background and foreground: {delivery:?}");}+ for tool in ["browser_click", "browser_pointer"] {+ let tool = tools+ .iter()+ .find(|candidate| candidate["name"] == tool)+ .unwrap_or_else(|| panic!("{tool} not found in tools/list"));+ let description = tool["inputSchema"]["properties"]["delivery_mode"]["description"]+ .as_str()+ .unwrap_or_else(|| panic!("{tool}.delivery_mode description missing"));+ assert!(+ description.contains("including Linux Chromium and macOS Chromium configurations"),+ "{tool}.delivery_mode should name macOS and Linux: {description}"+ );+ }+ let browser_click = tools+ .iter()+ .find(|tool| tool["name"] == "browser_click")+ .expect("browser_click not found in tools/list");+ assert!(+ browser_click["description"]+ .as_str()+ .is_some_and(|description| description+ .contains("including Linux Chromium and macOS Chromium configurations")),+ "browser_click description should name macOS and Linux: {}",+ browser_click["description"]+ );let schema_tools: BTreeSet<&str> = tools.iter().filter(|tool| tool["inputSchema"]["properties"]["delivery_mode"].is_object())diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.jsonindex 557bb970de..637b37bb29 100644--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json@@ -2535,7 +2535,7 @@"read_only": false},{- "description": "Click a page element (by ref) or viewport coordinates in an exactly-bound tab. Default route is trusted hardware-like input (Input.dispatchMouseEvent), and refuses where that route cannot preserve standalone-browser background posture unless delivery_mode=\"foreground\" accepts that the browser window may activate (Linux Chromium; for example a browser inside a sandbox). input_route=\"dom_event\" (synthetic el.click(), ref required) is used only when explicitly requested; it proves dispatch, not control activation, because trust-gated controls may ignore synthetic events. Refused for heuristic bindings.",+ "description": "Click a page element (by ref) or viewport coordinates in an exactly-bound tab. Default route is trusted hardware-like input (Input.dispatchMouseEvent), and refuses where that route cannot preserve standalone-browser background posture unless delivery_mode=\"foreground\" accepts that the browser window may activate (including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background; for example a browser inside a sandbox). input_route=\"dom_event\" (synthetic el.click(), ref required) is used only when explicitly requested; it proves dispatch, not control activation, because trust-gated controls may ignore synthetic events. Refused for heuristic bindings.","destructive": false,"idempotent": false,"input_schema": {@@ -2543,7 +2543,7 @@"properties": {"delivery_mode": {"default": "background",- "description": "background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).",+ "description": "background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).","enum": ["background","foreground"@@ -2804,7 +2804,7 @@},"delivery_mode": {"default": "background",- "description": "background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).",+ "description": "background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).","enum": ["background","foreground"diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.jsonindex d40d8bbd9f..1becbc02a7 100644--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json@@ -2174,7 +2174,7 @@"read_only": false},{- "description": "Click a page element (by ref) or viewport coordinates in an exactly-bound tab. Default route is trusted hardware-like input (Input.dispatchMouseEvent), and refuses where that route cannot preserve standalone-browser background posture unless delivery_mode=\"foreground\" accepts that the browser window may activate (Linux Chromium; for example a browser inside a sandbox). input_route=\"dom_event\" (synthetic el.click(), ref required) is used only when explicitly requested; it proves dispatch, not control activation, because trust-gated controls may ignore synthetic events. Refused for heuristic bindings.",+ "description": "Click a page element (by ref) or viewport coordinates in an exactly-bound tab. Default route is trusted hardware-like input (Input.dispatchMouseEvent), and refuses where that route cannot preserve standalone-browser background posture unless delivery_mode=\"foreground\" accepts that the browser window may activate (including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background; for example a browser inside a sandbox). input_route=\"dom_event\" (synthetic el.click(), ref required) is used only when explicitly requested; it proves dispatch, not control activation, because trust-gated controls may ignore synthetic events. Refused for heuristic bindings.","destructive": false,"idempotent": false,"input_schema": {@@ -2182,7 +2182,7 @@"properties": {"delivery_mode": {"default": "background",- "description": "background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).",+ "description": "background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).","enum": ["background","foreground"@@ -2443,7 +2443,7 @@},"delivery_mode": {"default": "background",- "description": "background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).",+ "description": "background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).","enum": ["background","foreground"diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.jsonindex 8ac9540a9c..a094c36299 100644--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json@@ -2230,7 +2230,7 @@"read_only": false},{- "description": "Click a page element (by ref) or viewport coordinates in an exactly-bound tab. Default route is trusted hardware-like input (Input.dispatchMouseEvent), and refuses where that route cannot preserve standalone-browser background posture unless delivery_mode=\"foreground\" accepts that the browser window may activate (Linux Chromium; for example a browser inside a sandbox). input_route=\"dom_event\" (synthetic el.click(), ref required) is used only when explicitly requested; it proves dispatch, not control activation, because trust-gated controls may ignore synthetic events. Refused for heuristic bindings.",+ "description": "Click a page element (by ref) or viewport coordinates in an exactly-bound tab. Default route is trusted hardware-like input (Input.dispatchMouseEvent), and refuses where that route cannot preserve standalone-browser background posture unless delivery_mode=\"foreground\" accepts that the browser window may activate (including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background; for example a browser inside a sandbox). input_route=\"dom_event\" (synthetic el.click(), ref required) is used only when explicitly requested; it proves dispatch, not control activation, because trust-gated controls may ignore synthetic events. Refused for heuristic bindings.","destructive": false,"idempotent": false,"input_schema": {@@ -2238,7 +2238,7 @@"properties": {"delivery_mode": {"default": "background",- "description": "background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).",+ "description": "background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).","enum": ["background","foreground"@@ -2499,7 +2499,7 @@},"delivery_mode": {"default": "background",- "description": "background (default) refuses trusted input where it would activate the browser window (Linux Chromium). foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).",+ "description": "background (default) refuses trusted input where it would activate the browser window, including Linux Chromium and macOS Chromium configurations whose trusted route cannot stay in the background. foreground accepts that activation, for a browser whose window nobody else is using (for example inside a sandbox).","enum": ["background","foreground"