Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(computer): exit embedded Cua Driver after parent loss (#2614)

Max8867543866a5
diff --git a/core/computer_use.py b/core/computer_use.py
index 8ba87bbd6..e96a5860f 100644
--- a/core/computer_use.py
+++ b/core/computer_use.py
@@ -36,7 +36,7 @@ COMPUTER_USE_LOCK_FILE = "computer-use.lock"
COMPUTER_USE_LEASE_FILE = "computer-lease.json"
COMPUTER_USE_LEASE_LOCK_FILE = "computer-lease.lock"
COMPUTER_USE_TOOL_SNAPSHOT_SHA256 = (
- "4c6a9c351f9ead8dac182ee8b9e4bb2ec5b9f66f35e4d36373643792e97a8d67"
+ "edf496838092b2fa21807724b30308c4e9a90a404c9a9b7783a299b71e427144"
)
COMPUTER_USE_TOOL_NAMES = (
diff --git a/desktop/cua-driver/PATCHES.md b/desktop/cua-driver/PATCHES.md
index bb9270557..50f1de036 100644
--- a/desktop/cua-driver/PATCHES.md
+++ b/desktop/cua-driver/PATCHES.md
@@ -30,10 +30,15 @@ alone.
For embedded serve mode, the patch also makes parent-liveness shutdown
terminal: stdin EOF removes only the socket bound by that process, removes its
PID file, aborts accepted connection tasks, and drops the Tokio runtime without
-waiting for non-cancellable platform work. The terminal path leaves process
-globals intact because abandoned tasks may still reference them until process
-exit. Explicit daemon shutdown keeps the existing graceful drain and global
-teardown.
+waiting for non-cancellable platform work. After that cleanup,
+`std::process::exit(0)` terminates the helper even when the macOS cursor
+overlay owns the main AppKit run loop. Its shutdown diagnostic is best-effort
+because parent death also closes the shell-owned stderr pipe. The terminal path
+leaves process globals intact because abandoned tasks may still reference them
+until process exit. Explicit daemon shutdown keeps the existing graceful drain
+and global teardown. The default process test keeps the cursor overlay disabled
+so ordinary `cargo test` runs remain hermetic; the overlay-enabled macOS variant
+is ignored and reserved for an explicit logged-in GUI acceptance run.
The upstream investigation found no consumable maintainer-accepted contract
with these semantics. The relevant discussions are:
diff --git a/desktop/cua-driver/patches/0001-macos-raw-single-click.patch b/desktop/cua-driver/patches/0001-macos-raw-single-click.patch
index bad40b002..9bb38f8e8 100644
--- a/desktop/cua-driver/patches/0001-macos-raw-single-click.patch
+++ b/desktop/cua-driver/patches/0001-macos-raw-single-click.patch
@@ -432,8 +432,12 @@ index b9637489..51b62d4c 100644
- break;
+ break ServeShutdown::Requested;
}
-@@ -1385,5 +1391,18 @@ pub async fn run_serve(
- eprintln!("Cua Driver embedded host closed its lifetime pipe; shutting down.");
+@@ -1385,5 +1391,21 @@ pub async fn run_serve(
+- eprintln!("Cua Driver embedded host closed its lifetime pipe; shutting down.");
++ let _ = std::io::Write::write_all(
++ &mut std::io::stderr(),
++ b"Cua Driver embedded host closed its lifetime pipe; shutting down.\n",
++ );
- break;
+ break ServeShutdown::ParentLiveness;
}
@@ -472,7 +476,7 @@ index b9637489..51b62d4c 100644
-) -> anyhow::Result<()> {
+) -> anyhow::Result<ServeShutdown> {
anyhow::bail!("cua-driver serve is not supported on this platform");
-@@ -2285,5 +2304,12 @@ pub fn run_serve_cmd(
+@@ -2285,5 +2304,15 @@ pub fn run_serve_cmd(
let result = rt.block_on(run_serve(sdk, &socket_path, pid_file_path.as_deref()));
- rt.shutdown_timeout(std::time::Duration::from_secs(30));
- cua_driver_core::session_authorization::release_configured_registry_for_shutdown();
@@ -482,13 +486,16 @@ index b9637489..51b62d4c 100644
+ // globals. The owning host is gone, so abandon the runtime and let
+ // process exit reclaim those globals instead of clearing them first.
+ rt.shutdown_background();
++ // AppKit's cursor overlay may own the main thread's run loop, so
++ // returning from serve is not sufficient to terminate this process.
++ std::process::exit(0);
+ } else {
+ rt.shutdown_timeout(std::time::Duration::from_secs(30));
+ cua_driver_core::session_authorization::release_configured_registry_for_shutdown();
+ cua_driver_core::session::release_process_state_for_shutdown();
+ }
if let Err(e) = result {
-@@ -2571,2 +2595,169 @@ mod socket_tests {
+@@ -2571,2 +2598,183 @@ mod socket_tests {
-
+#[cfg(all(test, unix))]
+mod parent_liveness_tests {
@@ -505,6 +512,7 @@ index b9637489..51b62d4c 100644
+ const SOCKET_ENV: &str = "CUA_DRIVER_PARENT_LIVENESS_TEST_SOCKET";
+ const PID_FILE_ENV: &str = "CUA_DRIVER_PARENT_LIVENESS_TEST_PID_FILE";
+ const STARTED_ENV: &str = "CUA_DRIVER_PARENT_LIVENESS_TEST_STARTED";
++ const CURSOR_OVERLAY_ENV: &str = "CUA_DRIVER_PARENT_LIVENESS_TEST_CURSOR_OVERLAY";
+
+ struct BlockingTool;
+
@@ -558,7 +566,7 @@ index b9637489..51b62d4c 100644
+ let driver =
+ cua_driver_sdk::CuaDriver::create_for_host(cua_driver_sdk::DriverHostOptions {
+ cursor: cursor_overlay::CursorConfig {
-+ enabled: false,
++ enabled: std::env::var(CURSOR_OVERLAY_ENV).ok().as_deref() == Some("1"),
+ ..cursor_overlay::CursorConfig::default()
+ },
+ host_owns_permission_ux: true,
@@ -574,8 +582,7 @@ index b9637489..51b62d4c 100644
+ run_serve_cmd(driver, &socket, Some(&pid_file));
+ }
+
-+ #[test]
-+ fn parent_liveness_exits_without_waiting_for_blocked_calls_and_unlinks_only_its_socket() {
++ fn run_parent_liveness_test(cursor_overlay: bool) {
+ let directory = tempfile::tempdir().expect("temporary directory");
+ let socket = directory.path().join("driver.sock");
+ let pid_file = directory.path().join("driver.pid");
@@ -598,6 +605,7 @@ index b9637489..51b62d4c 100644
+ .env(SOCKET_ENV, &socket)
+ .env(PID_FILE_ENV, &pid_file)
+ .env(STARTED_ENV, &started)
++ .env(CURSOR_OVERLAY_ENV, u8::from(cursor_overlay).to_string())
+ .env("HOME", &home)
+ .env("XDG_CACHE_HOME", home.join(".cache"))
+ .env("XDG_CONFIG_HOME", home.join(".config"))
@@ -608,7 +616,7 @@ index b9637489..51b62d4c 100644
+ .env("CUA_DRIVER_RS_UPDATE_CHECK", "0")
+ .stdin(Stdio::piped())
+ .stdout(Stdio::null())
-+ .stderr(Stdio::inherit())
++ .stderr(Stdio::piped())
+ .spawn()
+ .expect("spawn test daemon");
+
@@ -631,6 +639,7 @@ index b9637489..51b62d4c 100644
+ });
+ wait_for_path(&started, Duration::from_secs(10));
+
++ drop(child.stderr.take());
+ drop(child.stdin.take());
+ let deadline = Instant::now() + Duration::from_secs(5);
+ let status = loop {
@@ -656,6 +665,18 @@ index b9637489..51b62d4c 100644
+ "preserve\n"
+ );
+ }
++
++ #[test]
++ fn parent_liveness_exits_without_waiting_for_blocked_calls_and_unlinks_only_its_socket() {
++ run_parent_liveness_test(false);
++ }
++
++ #[cfg(target_os = "macos")]
++ #[test]
++ #[ignore = "requires a logged-in macOS GUI session"]
++ fn parent_liveness_with_cursor_overlay_exits_after_parent_loss() {
++ run_parent_liveness_test(true);
++ }
+}
+
#[cfg(all(test, unix))]
diff --git a/desktop/cua-driver/sources.json b/desktop/cua-driver/sources.json
index 0093429ea..e860301ec 100644
--- a/desktop/cua-driver/sources.json
+++ b/desktop/cua-driver/sources.json
@@ -4,7 +4,7 @@
"version": "0.31.0",
"tag": "cua-driver-rs-v0.31.0",
"source_commit": "5272e492d61b96caf08e3bf434d91126c1f3dccc",
- "tool_snapshot_sha256": "4c6a9c351f9ead8dac182ee8b9e4bb2ec5b9f66f35e4d36373643792e97a8d67",
+ "tool_snapshot_sha256": "edf496838092b2fa21807724b30308c4e9a90a404c9a9b7783a299b71e427144",
"license": "MIT",
"release_base_url": "https://github.com/trycua/cua/releases/download/cua-driver-rs-v0.31.0",
"release_checksums_asset": "checksums.txt",
@@ -22,7 +22,7 @@
"patch": {
"variant": "avibe-raw-single-click-v1",
"file": "patches/0001-macos-raw-single-click.patch",
- "sha256": "b720fb0e80a5fcc7796de175c905d73208ce8a53716a517074087f50d09ed584",
+ "sha256": "4409c946b353bedf3846af5b58dc32ed7cce792e9188842f3fa7d49cc01f011b",
"contract": "click.click_mode=raw; embedded parent-liveness cleanup",
"upstream_refs": [
"https://github.com/trycua/cua/pull/3922",
diff --git a/desktop/cua-driver/tools-v0.31.0.json b/desktop/cua-driver/tools-v0.31.0.json
index c1e81b505..779a9f8c5 100644
--- a/desktop/cua-driver/tools-v0.31.0.json
+++ b/desktop/cua-driver/tools-v0.31.0.json
@@ -1 +1 @@
-{"driver_version":"0.31.0","patch_sha256":"b720fb0e80a5fcc7796de175c905d73208ce8a53716a517074087f50d09ed584","schema_version":1,"source_commit":"5272e492d61b96caf08e3bf434d91126c1f3dccc","source_tag":"cua-driver-rs-v0.31.0","source_variant":"avibe-raw-single-click-v1","tools":[{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["app.list"],"description":"List macOS apps — both currently running and installed-but-not-running — with per-app state flags:\n\n- running: is a process for this app live? (pid is 0 when false)\n- active: is it the system-frontmost app? (implies running)\n- launch_path: filesystem path to the `.app` bundle, when known. Pass this to `launch_app` to start the app cold.\n- kind: `\"desktop\"` for `.app` bundles on macOS.\n- last_used: RFC3339 timestamp from the bundle's filesystem mtime, when readable; otherwise null.\n\nStandalone running entries include only apps with NSApplicationActivationPolicyRegular — background helpers and system UI agents are filtered out. Installed apps resolve their running/pid state against all live processes by bundle identifier, so an installed app whose process runs as an accessory (LSUIElement / menu-bar apps, e.g. Cua Driver itself) still reports its live pid. Installed apps come from scanning /Applications, /Applications/Utilities, ~/Applications, /System/Applications, and /System/Applications/Utilities.\n\nUse this for \"is X installed?\" as well as \"is X running?\". For per-window state — on-screen, on-current-Space, minimized, window titles — call list_windows instead. For just opening an app — running or not — call launch_app({bundle_id: ...}) directly; list_apps is not a prerequisite.","inputSchema":{"additionalProperties":false,"properties":{"session":{"description":"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.","type":"string"}},"type":"object"},"name":"list_apps","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"apps":{"items":{"properties":{"active":{"type":"boolean"},"bundle_id":{"type":["string","null"]},"kind":{"type":["string","null"]},"last_used":{"type":["string","null"]},"launch_path":{"type":["string","null"]},"name":{"type":"string"},"pid":{"minimum":0,"type":"integer"},"running":{"type":"boolean"}},"required":["pid","name","running","active"],"type":"object"},"type":"array"}},"required":["apps"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["window.list"],"description":"List all layer-0 top-level windows currently known to WindowServer. Includes off-screen windows (minimized, on another Space, hidden-launched). Use this to find a window_id before calling get_window_state.\n\nPer-record fields: window_id, pid, app_name, title, bounds (x/y/width/height, top-left origin), z_index (integer or null; higher values are closer to the front; null means stacking order is unavailable and callers must not infer one), is_on_screen, space_ids, current_space_id (the active Space on that window's display), and on_current_space. The top-level current_space_id is WindowServer's main/global active Space and can differ from a record's current_space_id when displays use independent Spaces. To select a frontmost candidate, take the maximum integer z_index; if every value is null, use an explicit fallback instead of relying on array order.","inputSchema":{"additionalProperties":false,"properties":{"on_screen_only":{"description":"When true, drop windows not on the current Space. Default false.","type":"boolean"},"pid":{"description":"Optional pid filter. When set, only this pid's windows are returned.","type":"integer"},"session":{"description":"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.","type":"string"}},"type":"object"},"name":"list_windows","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"current_space_id":{"minimum":0,"type":["integer","null"]},"windows":{"items":{"properties":{"app_name":{"type":"string"},"bounds":{"properties":{"height":{"type":"number"},"width":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y","width","height"],"type":"object"},"current_space_id":{"minimum":0,"type":["integer","null"]},"is_on_screen":{"type":"boolean"},"layer":{"format":"int32","type":["integer","null"]},"minimized":{"type":["boolean","null"]},"on_current_space":{"type":["boolean","null"]},"pid":{"maximum":4294967295,"minimum":0,"type":["integer","null"]},"space_ids":{"items":{"minimum":0,"type":"integer"},"type":["array","null"]},"title":{"type":"string"},"window_id":{"minimum":0,"type":"integer"},"z_index":{"description":"Higher values are closer to the front. Null means the provider cannot observe stacking order; callers must not infer an order from array position or treat null as zero.","type":["integer","null"]}},"required":["window_id","pid","app_name","title","bounds","is_on_screen","z_index"],"type":"object"},"type":"array"}},"required":["windows"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"capabilities":["accessibility.window_state","accessibility.tree","accessibility.tree.structured","accessibility.tree.bounded","accessibility.element_tokens","screen.capture","screen.capture.window"],"description":"Walk a running app's AX tree and return BOTH a structured `elements` array (preferred) AND a Markdown rendering of the same tree (back-compat). Every actionable element is tagged with [element_index N] in the markdown and as `element_index` in the structured array; pass each element's `element_token` to click, type_text, press_key, etc.\n\nINVARIANT: call get_window_state once per turn per (pid, window_id) before any element action. The next snapshot of the window replaces this one, stales its element tokens, and lists the replaced ids in `invalidated_snapshot_ids`.\n\nPREFERRED CONSUMERS read `structuredContent.elements` (one entry per indexed row with `element_index`, `role`, `label`, `value` (the element's text/AXValue when present — use it to verify what a field holds), `actions` (names of AX actions exposed by the element, omitted when empty), `frame: {x,y,w,h}`, `parent_index`, `depth`). The markdown `tree_markdown` stays available and unchanged in shape for existing text-parsing callers — but new fields will only be added to the structured side.\n\nAlways returns BOTH the element tree AND a screenshot — ground on both and cross-check (the tree lies on some surfaces: Electron echo-confirms, Catalyst null values, virtualized off-viewport rows with `h:1` frames). You choose the modality at ACTION time, not here: an element ax action (pass `element_token` → the accessibility rung) or an element px action (pass `x`,`y` → the pixel rung, read straight off this screenshot). `capture_mode` is deprecated and ignored. Pass `include_screenshot:false` to skip the grab and get the tree only — the cheap path when you're just re-indexing before an element ax action.\n\nThe mirror image: pass `include_accessibility_tree:false` to SKIP the AX walk entirely (the expensive part, bounded by timeout_ms) and return just the screenshot plus window metadata — `window_bounds`, `screenshot_scale`, `screenshot_width`/`screenshot_height`, `app_name`, and `window_title` — the capture-only path for rendering a live window preview / picture-in-picture without paying for perception. Setting BOTH `include_accessibility_tree:false` and `include_screenshot:false` is an error (nothing to return). Optional `max_image_dimension` overrides the configured screenshot long-edge limit for this call; use 0 for native resolution. The legacy `max_dimension` remains a tighter cap for compatibility.\n\nThe snapshot is SCOPED to `window_id`: a window_id that no longer exists is refused with `window_id_not_found`, and one owned by another process is refused with `window_owner_pid_mismatch` naming the real `owner_pid` to retry with (macOS hosts a sandboxed app's Open/Save panel out-of-process, so its window belongs to the panel service, not the app). If the window is live under this pid but its accessibility surface can't be resolved, the tree comes back EMPTY with `degraded_reason: ax_window_unresolved` and the screenshot of the requested window; background input is refused until it resolves, so re-snapshot or act with `delivery_mode:\"foreground\"`. When that pid is an app still launching (its window exists before it answers accessibility), the walk first waits up to `timeout_ms` for it; if it never answers, the tree comes back EMPTY with `degraded_reason: ax_app_launching`, `truncated: true` and `truncation_reason: app_lookup_timeout`. A window on another Space still resolves by its exact CGWindowID. This tool never returns another surface's elements under your window_id. Before exposing a screenshot, its raw dimensions are validated as a coherent 1x/2x representation of the requested WindowServer bounds. `px_frame_mismatch` or `px_capture_unavailable` omits an unprovable screenshot/pixel frame instead of guessing a transform; the truthful AX payload remains available.\n\nOptional `query` projects both tree_markdown and structured `elements` to matching lines plus their ancestor chain (case-insensitive substring). The element_index values are unchanged, the complete snapshot remains actionable, and `element_count` continues to report its total size; `filtered_element_count` reports the projected response size.\n\nOptional `max_elements` / `max_depth` bound the AX walk to mitigate context-window blow-up on Electron / Obsidian / large web apps that produce 10k+ element trees. When applied, BOTH the markdown and the structured elements are truncated identically. Omit both for current default behaviour (≤2 000 elements, depth ≤25).","inputSchema":{"additionalProperties":false,"properties":{"capture_mode":{"description":"DEPRECATED and ignored. get_window_state always returns BOTH the element tree and a screenshot — ground on both. The modality is chosen at action time by how you address the target: an element ax action (element_token) or an element px action (x,y). Any value (including the old \"som\"/\"screenshot\" aliases) is accepted but has no effect.","enum":["ax","vision"],"type":"string"},"include_accessibility_tree":{"description":"Default true — walk the AX tree and return `elements` + `tree_markdown` alongside the screenshot. Set false to SKIP the AX walk entirely (the expensive part, bounded by timeout_ms) and return just the screenshot plus window metadata (bounds, scale, app_name, window_title) — the capture-only path for rendering a live window preview / picture-in-picture. Mirrors include_screenshot. Setting BOTH include_accessibility_tree:false AND include_screenshot:false is an error (nothing to return).","type":"boolean"},"include_screenshot":{"description":"Default true — returns a grounding screenshot alongside the tree. Set false to skip the grab and return the tree only (the cheap path when you're just re-indexing before an element ax action; saves the image tokens + screen-grab latency). screenshot_out_file still forces a capture to disk.","type":"boolean"},"max_depth":{"description":"Cap on the AX-tree walk depth. Nodes whose rendered indent would exceed this are omitted. Omit for the default (25). Lower this for deep menu/Electron trees.","minimum":1,"type":"integer"},"max_dimension":{"description":"Optional cap on the returned screenshot's long edge, in pixels (aspect ratio preserved) — the cheap path for a small preview / thumbnail. Applied on top of the session/global max_image_dimension ceiling; the tighter of the two wins. Omit for the configured default.","minimum":1,"type":"integer"},"max_elements":{"description":"Cap on the total number of AX nodes walked. Truncates depth-first; markdown and structured elements truncate together. Omit for the default (2 000). Lower this for Electron / Obsidian / large web apps that produce 10k+ element trees and blow context windows.","minimum":1,"type":"integer"},"max_image_dimension":{"description":"Per-call override for the returned screenshot's long edge in pixels. An explicit value wins over the session/global setting; 0 returns native resolution. Omit to preserve configured behavior.","minimum":0,"type":"integer"},"pid":{"description":"Target process ID.","type":"integer"},"query":{"description":"Case-insensitive filter for tree_markdown and structured elements. Returns matching actionable rows plus their actionable ancestors without renumbering element_index values.","type":"string"},"screenshot_out_file":{"description":"When set, write the PNG to this file path (~ expanded) instead of embedding base64 in the response. The structured output will contain screenshot_file_path instead.","type":"string"},"session":{"description":"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.","type":"string"},"timeout_ms":{"default":1000,"description":"Wall-clock budget in milliseconds for the accessibility-tree walk (default 1000, min 100, max 120000). Bounds the WHOLE walk. When the budget runs out the tool returns the PARTIAL tree it has, flagged with `truncated: true`, `truncation_reason`, `nodes_visited`, `nodes_pending` and `elements_complete: false`; retry with a larger value (e.g. 5000) or narrow with `query` / `max_depth`.","maximum":120000,"minimum":100,"type":"integer"},"window_id":{"description":"Target window ID from list_windows.","type":"integer"}},"required":["pid","window_id"],"type":"object"},"name":"get_window_state","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"app_name":{"type":["string","null"]},"degraded":{"type":["boolean","null"]},"degraded_reason":{"type":["string","null"]},"element_count":{"minimum":0,"type":["integer","null"]},"elements":{"items":{"properties":{"actions":{"items":{"type":"string"},"type":["array","null"]},"depth":{"minimum":0,"type":"integer"},"element_index":{"minimum":0,"type":"integer"},"element_token":{"type":["string","null"]},"enabled":{"type":["boolean","null"]},"frame":{"properties":{"h":{"type":"number"},"w":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y","w","h"],"type":["object","null"]},"in_web_content":{"type":["boolean","null"]},"label":{"type":["string","null"]},"max":{"type":["number","null"]},"min":{"type":["number","null"]},"parent_index":{"minimum":0,"type":["integer","null"]},"role":{"type":"string"},"selected":{"type":["boolean","null"]},"value":{"type":["string","null"]},"value_description":{"type":["string","null"]}},"required":["element_index","role","depth"],"type":"object"},"type":["array","null"]},"elements_complete":{"type":["boolean","null"]},"filtered_element_count":{"minimum":0,"type":["integer","null"]},"pid":{"minimum":0,"type":"integer"},"returned_element_count":{"minimum":0,"type":["integer","null"]},"screenshot_file_path":{"type":["string","null"]},"screenshot_frame_valid":{"type":["boolean","null"]},"screenshot_height":{"minimum":0,"type":["integer","null"]},"screenshot_mime_type":{"type":["string","null"]},"screenshot_scale":{"type":["number","null"]},"screenshot_width":{"minimum":0,"type":["integer","null"]},"snapshot_id":{"type":["string","null"]},"total_element_count":{"minimum":0,"type":["integer","null"]},"tree_markdown":{"type":["string","null"]},"truncated":{"type":["boolean","null"]},"truncation_reason":{"type":["string","null"]},"window_bounds":{"properties":{"height":{"type":"number"},"width":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y","width","height"],"type":["object","null"]},"window_id":{"minimum":0,"type":"integer"},"window_title":{"type":["string","null"]}},"required":["pid","window_id"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r3","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"capabilities":["state.verify","state.verify.window","state.verify.element","state.observe.visual_evidence"],"description":"Deterministically verify bounded predicates against one exact window. The driver evaluates structured window/accessibility state and may return the final screenshot as uninterpreted visual evidence for a multimodal caller. Predicate results are satisfied, unsatisfied, or unknown; unknown never implies success. Accessibility projections are conservative: absence remains unknown unless the observed search domain is proven exhaustive.","inputSchema":{"additionalProperties":false,"properties":{"expect":{"description":"One to eight predicates, combined with logical AND.","items":{"additionalProperties":false,"properties":{"element":{"additionalProperties":false,"properties":{"enabled":{"type":["boolean","null"]},"exists":{"description":"Assert that at least one trusted element matches the selector.\n\nElement walks are not yet exhaustive on every platform, so absence\ncannot be proven. `false` is rejected instead of returning an\nindefinitely-unknown predicate.","type":"boolean"},"selected":{"type":["boolean","null"]},"selector":{"additionalProperties":false,"properties":{"label_contains":{"minLength":1,"type":"string"},"role":{"minLength":1,"type":"string"}},"required":[],"type":"object"},"value_equals":{"type":["string","null"]}},"required":["selector"],"type":["object","null"]},"window":{"additionalProperties":false,"properties":{"bounds":{"additionalProperties":false,"properties":{"height":{"type":"number"},"tolerance_px":{"maximum":100,"minimum":0,"type":"number"},"width":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y","width","height"],"type":["object","null"]},"exists":{"type":["boolean","null"]}},"type":["object","null"]}},"required":[],"type":"object"},"maxItems":8,"minItems":1,"type":"array"},"include_screenshot":{"description":"Return the final window screenshot as image content for a multimodal\ncaller. The driver does not interpret that image.","type":["boolean","null"]},"pid":{"description":"Exact process whose window may be observed.","minimum":1,"type":"integer"},"session":{"description":"For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session. This\nfield never selects capture modality or authorization.","type":"string"},"stable_samples":{"default":2,"description":"Consecutive satisfied samples required before returning success.","maximum":5,"minimum":1,"type":"integer"},"timeout_ms":{"default":5000,"description":"Bounded wait. Zero performs one sample.","maximum":10000,"minimum":0,"type":"integer"},"window_id":{"description":"Exact native window identifier.","type":"integer"}},"required":["pid","window_id","expect"],"type":"object"},"name":"verify_state","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"elapsed_ms":{"minimum":0,"type":"integer"},"predicates":{"items":{"properties":{"index":{"minimum":0,"type":"integer"},"observed_json":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["satisfied","unsatisfied","unknown"],"type":"string"},"unknown_reason":{"anyOf":[{"enum":["invalid_predicate","unsupported_predicate","untrusted_source","multi_match","target_missing","observation_unavailable","stability_unproven"],"type":"string"},{"type":"null"}]}},"required":["index","status","unknown_reason","observed_json"],"type":"object"},"type":"array"},"samples":{"minimum":0,"type":"integer"},"stable":{"type":"boolean"},"status":{"enum":["satisfied","unsatisfied","unknown"],"type":"string"}},"required":["status","stable","elapsed_ms","samples","predicates"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":false},"capabilities":["app.launch"],"description":"Launch a macOS app in the background — the target does NOT come to the foreground.\n\nProvide either `bundle_id` (preferred — unambiguous, e.g. `com.apple.calculator`) or `name` (e.g. \"Calculator\"). If both are given, bundle_id wins.\n\nOptional `urls` are handed to the app as open targets — for Finder, pass a folder path to open a backgrounded Finder window there.\n\nBrowser DevTools setup belongs to `browser_prepare`, which can prove that a separate isolated profile is driver-owned before enabling CDP.\n\nOptional `webkit_inspector_port`: opens a WebKit inspector server on the specified port (sets WEBKIT_INSPECTOR_SERVER=127.0.0.1:N + TAURI_WEBVIEW_AUTOMATION=1). Use this for Tauri/WebKit-based apps.\n\nOptional `creates_new_application_instance`: when true, forces a new app instance even if one is already running (passes -n to open). Reach for this when another agent or session may drive the SAME app concurrently — it returns a fresh pid + window so each session acts on its own isolated window instead of clobbering one shared instance. Without it, single-instance apps (Calculator, many utilities) hand every caller the same window, so two sessions fight over it.\n\nOptional `additional_arguments`: extra argv strings appended after --args.\n\nReturns the launched app's pid, bundle_id, name, and a `windows` array (same shape as `list_windows`) so callers can skip an extra round-trip before `get_window_state(pid, window_id)`. `launch_state` distinguishes whether the request was sent, the process is running, and a window is ready. When the focus-steal belt-and-braces demotion check ran (target pid ≠ prior frontmost), the response also includes `self_activation_suppressed: bool` — true if focus stayed with the prior frontmost, false if the launched app held focus despite the re-demote attempt.","inputSchema":{"additionalProperties":false,"properties":{"additional_arguments":{"description":"Extra arguments appended after --args when launching.","items":{"type":"string"},"type":"array"},"bundle_id":{"description":"App bundle identifier, e.g. com.apple.calculator. Preferred over name.","type":"string"},"creates_new_application_instance":{"description":"When true, force a new app instance even if already running (open -n). Use for concurrent multi-agent/multi-session work so each session gets an isolated instance + window instead of sharing one — on single-instance apps (e.g. Calculator) every caller otherwise gets the same window and the sessions clobber each other.","type":"boolean"},"name":{"description":"App display name. Used only when bundle_id is absent.","type":"string"},"session":{"description":"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.","type":"string"},"urls":{"description":"Optional file paths or URLs to open with the app (e.g. a folder path for Finder).","items":{"type":"string"},"type":"array"},"webkit_inspector_port":{"description":"Open a WebKit inspector server on this port (sets WEBKIT_INSPECTOR_SERVER env var).","type":"integer"}},"type":"object"},"name":"launch_app","risk":{"class":"r1","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["app.kill"],"description":"Force-terminate a process by pid (kill -9 equivalent on macOS / Linux; taskkill /F equivalent on Windows). Use as escalation when the cooperative close path (hotkey cmd+q on macOS, click-the-X on Windows) failed to make the process exit. Unsaved state is lost — prefer the cooperative path first.","inputSchema":{"additionalProperties":false,"properties":{"pid":{"description":"PID of the process to terminate.","type":"integer"},"session":{"description":"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.","type":"string"}},"required":["pid"],"type":"object"},"name":"kill_app","risk":{"class":"r3","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["window.frame.set"],"description":"Set one exact top-level window's frame in the desktop-coordinate space reported by list_windows and verify the resulting geometry through an independent readback.","inputSchema":{"additionalProperties":false,"properties":{"height":{"minimum":1,"type":"number"},"pid":{"minimum":1,"type":"integer"},"session":{"description":"For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.","type":"string"},"width":{"minimum":1,"type":"number"},"window_id":{"minimum":1,"type":"integer"},"x":{"type":"number"},"y":{"type":"number"}},"required":["pid","window_id","x","y","width","height"],"type":"object"},"name":"set_window_frame","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.click","input.pointer.click.left","accessibility.element_tokens","input.delivery_mode"],"description":"Click against a target pid. **Prefer `element_token` over pixel coordinates** — the token works on backgrounded / minimized / hidden / off-Space windows, identifies one exact snapshot element, and tells you what you're clicking via the cached element's role + label. Reach for `x, y` only when the target is a canvas / video / WebGL / custom-drawn surface that doesn't appear in the AX tree.\n\nTwo addressing modes:\n\n- element_token (from get_window_state): AX action path. Works on backgrounded/hidden windows. No cursor move, no focus steal. The snapshot cache is scoped per (pid, window_id) and is replaced by the next snapshot of the same window — re-snapshot every turn before clicking.\n\n- x, y (window-local screenshot pixels, top-left origin of the PNG returned by get_window_state): CGEvent path. Synthesizes mouse events and posts to pid. Use modifier for cmd/shift/option/ctrl. Needs a visible on-screen window to anchor the conversion.\n\nbutton: \"left\" (default), \"right\", or \"middle\". Defaults to left so the field is fully back-compat — omit it and you get the legacy left-click behaviour. Pixel path: routes through the CGEvent left/right/middle mouse-button primitives. AX path: \"right\" maps to AXShowMenu (same surface as the dedicated `right_click` tool); \"middle\" has no AX equivalent and falls back to a pixel middle-click at the element's center. For a window-addressed background pixel left-click, click_mode:\"raw\" bypasses the AX hit-test optimization and posts exactly one routed mouse down/up pair. Keep the default click_mode:\"auto\" unless AXPress was observed to return a hollow success.\naction: press (default), show_menu, pick, confirm, cancel, open.\nfrom_zoom: set true after a zoom call to auto-translate zoom-image pixel coordinates to full-window space.","inputSchema":{"additionalProperties":false,"properties":{"action":{"description":"AX action: press, show_menu, pick, confirm, cancel, open.","type":"string"},"button":{"description":"Mouse button. Default: \"left\" — omit for legacy left-click behaviour. Pixel path uses the matching CGEvent primitive; AX path maps \"right\" to AXShowMenu and falls back to a pixel middle-click at the element's center for \"middle\".","enum":["left","right","middle"],"type":"string"},"capture_id":{"description":"Optional immutable source capture ID returned by get_window_state or get_desktop_state. With x,y, Driver atomically admits and consumes that exact capture before dispatch; stale, mismatched, or out-of-bounds captures are refused without fallback.","type":"string"},"click_mode":{"description":"Pixel single-click delivery selector. Default \"auto\" preserves the AX-first background optimization. \"raw\" is opt-in and valid only for an exact pid + window_id background left-click with x/y, count=1, and no modifiers; it bypasses AX hit-testing and uses the existing routed CGEvent path.","enum":["auto","raw"],"type":"string"},"count":{"description":"Click count (pixel path only). Default 1.","type":"integer"},"debug_image_out":{"description":"Optional file path. When set on a pixel-addressed click, captures a fresh screenshot, draws a red crosshair at (x, y), and writes the PNG. Use to verify coordinate spaces. Requires window_id; incompatible with from_zoom.","type":"string"},"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": perform the AX action or post the CGEvent without fronting. \"foreground\": briefly front the window, act, let transient UI settle, then restore the prior frontmost app. Requires window_id. Modified clicks require \"foreground\" so macOS observes physical modifier-key state. A generic click has no independent postcondition read-back, except selection of list-like AX rows whose AXSelected state can be confirmed; otherwise confirm the effect from a fresh state snapshot. Use the agent loop: background AX (element_token) → snapshot → background pixel (x/y) → snapshot → delivery_mode:\"foreground\".","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"from_zoom":{"description":"When true, x and y are in the last zoom image for this pid; driver translates back to full-window coordinates.","type":"boolean"},"modifier":{"description":"Modifier keys: cmd, shift, option/alt, ctrl.","items":{"type":"string"},"type":"array"},"pid":{"description":"Target process ID.","type":"integer"},"scope":{"description":"Coordinate frame for a windowless screen-absolute click (default \"window\"). Pass \"desktop\" when sending x,y with NO pid/window_id — the coordinates are then true screen pixels (read from get_desktop_state with scope=\"desktop\"). Per-call; not a setting.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},"window_id":{"description":"Target window ID. Omit when element_token is supplied (the token carries it).","type":"integer"},"x":{"description":"X in screenshot pixels. A window target uses the get_window_state PNG; a desktop target uses the native get_desktop_state PNG. The driver reverses Retina backing scale and any window-image downscale.","type":"number"},"y":{"description":"Y in screenshot pixels from the image selected by target.","type":"number"}},"required":[],"type":"object"},"name":"click","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.click","input.pointer.click.left","input.pointer.click.double","accessibility.element_tokens","input.delivery_mode"],"description":"Double-click at (x, y) or on an AX element identified by element_token.\n\nAX path (element_token provided): performs `AXOpen` when the element advertises it (Finder items, openable list rows/cells); otherwise resolves the element's on-screen center and falls back to a pixel double-click there.\n\nPixel path (x, y provided): two down/up pairs ~80 ms apart at the given coordinates.","inputSchema":{"additionalProperties":false,"properties":{"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"pid":{"type":"integer"},"session":{"description":"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.","type":"string"},"window_id":{"description":"CGWindowID. Omit when element_token is supplied (the token carries it).","type":"integer"},"x":{"description":"Screen X coordinate (pixel path).","type":"number"},"y":{"description":"Screen Y coordinate (pixel path).","type":"number"}},"required":["pid"],"type":"object"},"name":"double_click","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.click","input.pointer.click.right","accessibility.element_tokens","input.delivery_mode"],"description":"Right-click against a target pid. Two addressing modes:\n\n- `element_token` (from the last `get_window_state` snapshot) — performs `AXShowMenu` on the cached element. Pure AX RPC, works on backgrounded / hidden windows, no cursor move or focus steal. Requires a prior `get_window_state(pid, window_id)` in this turn.\n\n- `x`, `y` — synthesizes `rightMouseDown` / `rightMouseUp` CGEvent pair posted to the pid. Driver converts image-pixel → screen-point internally. `modifier` forces the CGEvent path (AX actions don't propagate modifier keys).\n\nExactly one of `element_token` or (`x` AND `y`) must be provided. `pid` always required.","inputSchema":{"additionalProperties":false,"properties":{"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"modifier":{"description":"Modifier keys held during the right-click: cmd/shift/option/ctrl. Pixel path only.","items":{"type":"string"},"type":"array"},"pid":{"description":"Target process ID.","type":"integer"},"session":{"description":"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.","type":"string"},"window_id":{"description":"CGWindowID. Omit when element_token is supplied (the token carries it).","type":"integer"},"x":{"description":"X in window-local screenshot pixels. Must be provided together with y.","type":"number"},"y":{"description":"Y in window-local screenshot pixels. Must be provided together with x.","type":"number"}},"required":["pid"],"type":"object"},"name":"right_click","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.drag","input.delivery_mode"],"description":"Press-drag-release gesture from (from_x, from_y) to (to_x, to_y) in window-local screenshot pixels — the same space get_window_state returns. Top-left origin of the target's window.\n\nUse for: marquee/lasso selection, drag-and-drop, resizing via a handle, scrubbing a slider, repositioning a panel.\n\n`duration_ms` (default 500) is the wall-clock budget for the path between mouse-down and mouse-up; `steps` (default 20) is the number of intermediate mouseDragged events linearly interpolated along the path. Increase both for slower, more human drags; decrease for snap gestures.\n\n`modifier` keys (cmd/shift/option/ctrl) are held across the entire gesture.\n\nWhen `from_zoom` is true, coordinates are in the last zoom image for this pid; the driver maps them back to window coordinates before dispatching.","inputSchema":{"additionalProperties":false,"properties":{"button":{"description":"Mouse button used for the drag. Default: left.","enum":["left","right","middle"],"type":"string"},"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"duration_ms":{"description":"Wall-clock duration of the drag path between mouseDown and mouseUp. Default: 500.","maximum":10000,"minimum":0,"type":"integer"},"from_x":{"description":"Drag-start X in window-local screenshot pixels. Top-left origin.","type":"number"},"from_y":{"description":"Drag-start Y in window-local screenshot pixels. Top-left origin.","type":"number"},"from_zoom":{"description":"When true, coordinates are in the last zoom image for this pid; driver maps back to window coordinates.","type":"boolean"},"modifier":{"description":"Modifier keys held across the entire gesture: cmd/shift/option/ctrl.","items":{"type":"string"},"type":"array"},"pid":{"description":"Target process ID.","type":"integer"},"scope":{"default":"window","description":"Use desktop with no pid/window_id for native get_desktop_state screenshot coordinates.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"steps":{"description":"Number of intermediate mouseDragged events linearly interpolated along the path. Default: 20.","maximum":200,"minimum":1,"type":"integer"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"to_x":{"description":"Drag-end X in window-local screenshot pixels.","type":"number"},"to_y":{"description":"Drag-end Y in window-local screenshot pixels.","type":"number"},"window_id":{"description":"CGWindowID for the window the pixel coordinates were measured against. Optional only when pid owns exactly one eligible top-level window; otherwise the action refuses with ambiguous_window_target.","type":"integer"}},"required":["from_x","from_y","to_x","to_y"],"type":"object"},"name":"drag","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.keyboard.type","input.keyboard.type.terminal_safe","accessibility.element_tokens","input.delivery_mode"],"description":"Insert text into the target pid via `AXSetAttribute(kAXSelectedText)`. Works for standard Cocoa text fields and text views. No keystrokes are synthesized — special keys (Return / Escape / arrows) go through `press_key` / `hotkey`. For Chromium / Electron inputs that don't implement `kAXSelectedText`, the tool falls back to CGEvent character synthesis automatically when the estimated route stays within the daemon transport budget. Longer synthesized routes are refused before character events and return a safe chunk size; one-call AX insertion remains uncapped.\n\nOptional `element_token` (from the last `get_window_state` snapshot) directs the write to a specific field. Without `element_token`, the write goes to the pid's currently focused element.\n\nWEB CONTENT (Chromium/WebKit/Electron — browser tabs, Slack, VS Code, X's compose box): AXValue is not independent proof that the renderer/DOM observed an AX write or synthesized keystrokes. The driver detects this at the element level (an AXWebArea ancestor) and refuses to trust AXValue-only read-back there. Electron AX targets that are web content or cannot be proven native refuse background delivery before mutation because the AX route cannot establish exact renderer focus; use the px form or explicit foreground delivery. Other web-content paths return effect:\"unverifiable\" + escalation, never a false \"confirmed\" (a browser's own native address bar/toolbar stays trusted). For a browser TAB the reliable path is the `page` tool (drives the DOM via CDP); for an embedded web view use this tool's px form: pass x,y (no element_token) to pixel-click the field then type, in one call. NOTE: a px focus-click won't reliably open+focus a CLOSED control; AX-press to open/activate it first (works in the background), then px-type. Always confirm via the screenshot; if px-background still drops, escalate to delivery_mode:\"foreground\".","inputSchema":{"additionalProperties":false,"properties":{"delay_ms":{"description":"Milliseconds between characters in the CGEvent fallback path. Default 30. Ignored when the AX path succeeds.","maximum":200,"minimum":0,"type":"integer"},"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": AX insert, then CGEvent keystrokes if needed — no focus steal; native controls can be confirmed via AXValue read-back, while web-content writes remain effect:\"unverifiable\". \"foreground\": briefly front the window, type, restore the prior frontmost — the explicit last resort for focus-sensitive surfaces (e.g. WhatsApp/Catalyst) where background keystrokes don't land. Re-call with \"foreground\" when a background attempt remains unverifiable and a fresh snapshot shows the text did not appear.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"pid":{"description":"Target process ID.","type":"integer"},"scope":{"default":"window","description":"Use desktop with no pid/window_id to type into the frontmost application.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"text":{"description":"Text to insert at the target's cursor.","type":"string"},"window_id":{"description":"CGWindowID. Omit when element_token is supplied (the token carries it).","type":"integer"},"x":{"description":"Screenshot-pixel X of the field to type into — the element px action form. Pass x,y (no element_token) and the tool pixel-clicks there to establish real renderer focus, then types. Use for Chromium/Electron inputs the AX path can't reach. Read straight off the get_window_state PNG, same convention as click.","type":"number"},"y":{"description":"Screenshot-pixel Y of the field (see x).","type":"number"}},"required":["text"],"type":"object"},"name":"type_text","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.keyboard.press","accessibility.element_tokens","input.delivery_mode"],"description":"Press and release a single key. Follows the same `delivery_mode` ladder as click/type_text — it does NOT raise the window by default:\n• `background` (default): post to the pid WITHOUT fronting/raising — the auth-message path (Chromium-safe). With element_token it focuses that AX element first. `window_id` only targets; it does not raise.\n• `foreground`: guard and briefly front the exact window, focus an addressed AX element when supplied, send a genuine HID key transition so Chromium content, inline editors, and native menu equivalents receive it, then restore prior frontmost. Requires window_id.\n\nA key press is confirmed only when a bounded native AX value/selection read-back changes on the same control. Otherwise a successfully attempted post remains effect:\"unverifiable\" without implying delivery failure or recommending foreground. Key names: return, tab, escape, up/down/left/right, space, delete, home, end, pageup, pagedown, f1-f12, plus any letter or digit. Modifiers array: cmd, shift, option/alt, ctrl, fn.","inputSchema":{"additionalProperties":false,"properties":{"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"key":{"description":"Key name: return, tab, escape, up, down, etc.","type":"string"},"modifiers":{"description":"Modifier keys: cmd, shift, option/alt, ctrl, fn.","items":{"type":"string"},"type":"array"},"pid":{"type":"integer"},"scope":{"default":"window","description":"Use desktop with no pid/window_id to send the key to the frontmost application.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"window_id":{"description":"Target window. Required for delivery_mode:\"foreground\". Does NOT itself raise the window — raising is gated on delivery_mode.","type":"integer"},"x":{"description":"Screenshot-pixel X — the element px action form: pixel-click there to focus, then send the key. Use when the key must go to a Chromium/Electron surface the AX path can't focus. Pass with y, no element_token.","type":"number"},"y":{"description":"Screenshot-pixel Y (see x).","type":"number"}},"required":["key"],"type":"object"},"name":"press_key","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.keyboard.hotkey","input.delivery_mode"],"description":"Press a key combination — e.g. `[\"cmd\", \"c\"]` for Copy, `[\"cmd\", \"shift\", \"4\"]` for screenshot selection. Follows the same `delivery_mode` ladder as click/type_text — it does NOT raise the window by default:\n• `background` (default): post the combo to the target pid WITHOUT fronting or raising it — uses the macOS 14+ auth-message envelope so Chromium/Electron accept it as trusted live input. With an AX target, focus that exact element first. No top-level focus steal. `window_id` here only targets the combo; it does not raise.\n• `foreground`: briefly front the window (NSMenu path, < 1 ms via SLPSSetFrontProcessWithOptions) so native menu key-equivalents (Cmd+Z, Cmd+W) dispatch, then restore the prior frontmost — the explicit escalation for menu-bar shortcuts on non-Chromium apps that ignore a background combo. With an AX target or x,y, the focused field receives the chord through the foreground HID queue (needed by native Chromium fields such as the omnibox). Requires window_id.\n\nA combo is never driver-verifiable (no read-back) → effect:\"unverifiable\"; confirm via screenshot. NOTE: a keyboard combo does NOT focus a text field — to type into a backgrounded Electron input, establish real renderer focus with a PIXEL click first, then `type_text`. If an app only accepts paste, call `clipboard_write`, then `clipboard_read` and verify its types (and text when applicable) before selecting or replacing editor content; only then send Cmd+V.\n\nRecognized modifiers: cmd/command, shift, option/alt, ctrl/control, fn. Non-modifier keys use the same vocabulary as `press_key`. Order: modifiers first, one non-modifier last.","inputSchema":{"additionalProperties":false,"properties":{"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"keys":{"description":"Modifier(s) and one non-modifier key, e.g. [\"cmd\", \"c\"].","items":{"type":"string"},"minItems":2,"type":"array"},"pid":{"description":"Target process ID.","type":"integer"},"scope":{"default":"window","description":"Use desktop with no pid/window_id to send the chord to the frontmost application.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"window_id":{"description":"Target window. Required for delivery_mode:\"foreground\" (the NSMenu activation needs a window). Does NOT itself raise the window — raising is gated on delivery_mode.","type":"integer"},"x":{"description":"Screenshot-pixel X — the element px action form: pixel-click there to focus, then send the combo (so e.g. Cmd+V pastes into that field). Pass with y. Use for Chromium/Electron surfaces the background combo can't reach.","type":"number"},"y":{"description":"Screenshot-pixel Y (see x).","type":"number"}},"required":["keys"],"type":"object"},"name":"hotkey","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.keyboard.type","accessibility.element_tokens"],"description":"Set a value on a UI element. Two modes depending on element role:\n\n- **AXPopUpButton / select dropdown**: finds the child option whose title or value matches `value` (case-insensitive) and AXPresses it directly — the native macOS popup menu is never opened, so focus is never stolen. Use this for HTML <select> elements in Safari or any native NSPopUpButton.\n\n- **All other elements**: writes AXValue directly (sliders, steppers, date pickers, native text fields that expose settable AXValue).\n\nFor free-form text entry into web inputs, prefer `type_text_chars` which synthesises key events — AXValue writes are ignored by WebKit.","inputSchema":{"additionalProperties":false,"properties":{"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"pid":{"type":"integer"},"session":{"description":"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.","type":"string"},"value":{"description":"New value. AX will coerce to the element's native type.","type":"string"},"window_id":{"description":"CGWindowID. Omit when element_token is supplied (the token carries it).","type":"integer"}},"required":["pid","value"],"type":"object"},"name":"set_value","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.scroll","accessibility.element_tokens","input.delivery_mode"],"description":"Scroll the target pid. Two paths, picked by how you address the scroll:\n\n• **Targeted wheel path** — when you pass a target, either `element_token` (preferred) or window-local `x, y` pixels: the driver synthesizes a real mouse-wheel event (CGEventCreateScrollWheelEvent, at that screen point. The renderer hit-tests the wheel at the cursor, so the scroll lands on whatever element is under the point — exactly like physically rolling the wheel over it. This is the ONLY way to scroll a nested `overflow:auto` region (e.g. a scrollable <div> with no tabindex): such regions never take keyboard focus, so the keystroke path below no-ops on them. Use this for inner/nested scrollers in web views.\n\n• **Keystroke path (focused region)** — when you pass NO target (just pid + direction): synthesizes PageDown/PageUp (by='page') or Down/Up arrows (by='line'); horizontal uses Left/Right arrows. Drives the focused / page scroller only.\n\nMapping: by='page' → larger step; by='line' → smaller step; amount = number of wheel notches (targeted path) or keystroke repetitions (keystroke path).","inputSchema":{"additionalProperties":false,"properties":{"amount":{"description":"Pixel-wheel path: number of wheel notches. Keystroke path: number of keystroke repetitions. Larger requests are clamped to the maximum. Default: 3.","maximum":50,"minimum":1,"type":"integer"},"by":{"description":"Scroll granularity. Default: line.","enum":["line","page"],"type":"string"},"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"direction":{"description":"Scroll direction.","enum":["up","down","left","right"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"pid":{"type":"integer"},"scope":{"default":"window","description":"Use desktop with x,y and no pid/window_id for native get_desktop_state screenshot coordinates.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"window_id":{"type":"integer"},"x":{"description":"Window-local screenshot X (top-left origin of the PNG from get_window_state). With `y`, routes through the pixel-wheel path at this point — use for a scrollable surface that isn't in the AX tree. Requires window_id to anchor the window→screen conversion.","type":"number"},"y":{"description":"Window-local screenshot Y. See `x`.","type":"number"}},"required":["direction"],"type":"object"},"name":"scroll","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"capabilities":["clipboard.read","clipboard.types"],"description":"List available system clipboard types and optionally return privacy-sensitive plain text. Clipboard content is never retained in telemetry.","inputSchema":{"additionalProperties":false,"properties":{"include_text":{"default":false,"description":"Return plain-text clipboard content in addition to the available types.\nClipboard content is privacy-sensitive and is never retained in telemetry.","type":"boolean"},"session":{"description":"For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.","type":"string"}},"required":[],"type":"object"},"name":"clipboard_read","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"content_redacted_from_telemetry":{"type":"boolean"},"privacy_sensitive":{"type":"boolean"},"supported":{"type":"boolean"},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"types":{"items":{"type":"string"},"type":"array"}},"required":["supported","types","text","privacy_sensitive","content_redacted_from_telemetry"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["clipboard.write","clipboard.write.text","clipboard.write.image","clipboard.write.file_url","clipboard.types"],"description":"Replace the system clipboard with exactly one value: plain text, an image from an absolute local path, or a file URL from an absolute local path. Returns the available types for read-back before paste.","inputSchema":{"additionalProperties":false,"properties":{"file_path":{"description":"Absolute path to a local file to place on the clipboard as a file URL.","type":"string"},"image_path":{"description":"Absolute path to a local image to place on the clipboard.","type":"string"},"session":{"description":"For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.","type":"string"},"text":{"description":"Plain text to place on the clipboard.","type":"string"}},"required":[],"type":"object"},"name":"clipboard_write","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"content_redacted_from_telemetry":{"type":"boolean"},"privacy_sensitive":{"type":"boolean"},"supported":{"type":"boolean"},"types":{"items":{"type":"string"},"type":"array"},"written_type":{"type":"string"}},"required":["supported","written_type","types","privacy_sensitive","content_redacted_from_telemetry"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["screen.dimensions"],"description":"Return the logical size of the main display in points plus its backing scale factor. Agents click in points; Retina displays have scale_factor 2.0. Requires no TCC permissions.","inputSchema":{"additionalProperties":false,"properties":{"session":{"description":"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.","type":"string"}},"type":"object"},"name":"get_screen_size","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"height":{"type":"number"},"scale_factor":{"type":"number"},"width":{"type":"number"}},"required":["width","height","scale_factor"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"capabilities":["screen.capture","screen.dimensions"],"description":"Capture the full display in true screen pixels, full size unless `max_image_dimension` caps it. Use its PNG as the coordinate source for actions whose target is {kind:\"desktop\",display_id:\"primary\"}. Returns the true screen size and backing scale factor. Vision-only: no AX tree walk.","inputSchema":{"additionalProperties":false,"properties":{"max_image_dimension":{"description":"Optional long-edge cap for the returned PNG, in pixels (aspect ratio preserved). Omitted or 0 returns the full-size capture. When the cap downsizes the image, the response reports `screenshot_original_width/height`, and x/y read off it for this session's later scope:\"desktop\" actions (or passed with its `capture_id`) are mapped back to the full-size frame automatically.","minimum":0,"type":"integer"},"screenshot_out_file":{"description":"Write PNG here instead of base64.","type":"string"},"session":{"description":"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.","type":"string"}},"type":"object"},"name":"get_desktop_state","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"agent_overlay_capture":{"additionalProperties":false,"properties":{"method":{"type":["string","null"]},"reason":{"type":["string","null"]},"status":{"oneOf":[{"const":"excluded","type":"string"},{"const":"not_present","type":"string"},{"const":"not_excluded","type":"string"}]}},"required":["status"],"type":["object","null"]},"display":{"type":"string"},"platform":{"enum":["macos","linux","windows"],"type":"string"},"scale_factor":{"type":"number"},"screen_height":{"type":"integer"},"screen_width":{"type":"integer"},"screenshot_file_path":{"type":"string"},"screenshot_height":{"type":"integer"},"screenshot_mime_type":{"const":"image/png"},"screenshot_width":{"type":"integer"}},"required":["platform","display","screenshot_width","screenshot_height","screen_width","screen_height","scale_factor","screenshot_mime_type"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r3","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["screen.cursor.position"],"description":"Return the current mouse cursor position in screen points (origin top-left).","inputSchema":{"additionalProperties":false,"properties":{"session":{"description":"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.","type":"string"}},"type":"object"},"name":"get_cursor_position","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"available":{"type":"boolean"},"source":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":[],"description":"Single-call end-to-end driver diagnostics. Designed to let downstream consumers ship one stable call instead of stitching together check_permissions, doctor, version, bundle attribution, and platform capability status. On macOS, prompt-capable direct capture is deliberately skipped; use `cua-driver permissions grant` to verify it explicitly. cua-driver owns the health model; consumers stay thin.\n\nInput — all optional:\n {\n \"include\": [\"<check_name>\", ...], // run only these\n \"skip\": [\"<check_name>\", ...] // skip these\n }\nIf both are given, `include` wins.\n\nCanonical check names:\n macOS : binary_version, platform_supported, session_active,\n bundle_identity, tcc_accessibility, tcc_screen_recording,\n ax_capability, screen_capture_capability\n Windows: binary_version, platform_supported, session_active,\n ax_capability (via UIA), screen_capture_capability (via DXGI)\n Linux : binary_version, platform_supported, session_active,\n ax_capability (via AT-SPI), screen_capture_capability (via X11)\n\nOutput — stable contract, schema_version=\"1\":\n {\n \"schema_version\": \"1\",\n \"platform\": \"darwin\" | \"win32\" | \"linux\",\n \"driver_version\": \"<semver>\",\n \"overall\": \"ok\" | \"degraded\" | \"failed\",\n \"checks\": [\n {\n \"name\": \"<one of the canonical names above>\",\n \"status\": \"pass\" | \"fail\" | \"skip\",\n \"message\": \"<one-line summary, always present>\",\n \"hint\": \"<remediation step, present when status=fail>\",\n \"data\": { /* check-specific structured fields */ }\n },\n ...\n ]\n }\n\n`overall` rules:\n - `ok` — every non-skipped check passes\n - `degraded` — at least one non-core check fails (binary is still usable)\n - `failed` — any core check fails (binary_version, platform_supported, session_active)\n\nStability: schema_version=\"1\" is the contract. Future breaking changes will be `\"2\"`. Adding new check names under the same schema_version is non-breaking; consumers must tolerate unknown check names.","inputSchema":{"additionalProperties":false,"properties":{"include":{"description":"Only run these checks (canonical names). Wins over `skip`.","items":{"type":"string"},"type":"array"},"session":{"description":"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.","type":"string"},"skip":{"description":"Skip these checks (canonical names). Ignored when `include` is set.","items":{"type":"string"},"type":"array"}},"type":"object"},"name":"health_report","risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["accessibility.tree","accessibility.tree.structured"],"description":"Return a lightweight snapshot of the desktop: running regular apps and on-screen visible windows with their bounds, z-order, and owner pid.\n\nFor the full AX subtree of a single window (with interactive element indices you can click by), use `get_window_state` instead — that's the heavy per-window tool. This one is a fast discovery read that needs no TCC grants.","inputSchema":{"additionalProperties":false,"properties":{"session":{"description":"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.","type":"string"}},"type":"object"},"name":"get_accessibility_tree","risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["screen.capture","screen.capture.window","screen.capture.region"],"description":"Capture a cropped JPEG of a window region (x1,y1)–(x2,y2) in screenshot pixel coordinates, with 20% padding added on each side. The output image is at most 500 px wide.\n\nAfter a zoom, pass `from_zoom=true` to click/type_text to auto-translate coordinates back to full-window space. Coordinate actions return `screenshot_context_missing` when no current snapshot contains a screenshot owned by this session. `from_zoom` actions return `zoom_context_missing` when the zoom was never created or was replaced; call `get_window_state`, then `zoom`, again on the same connection.","inputSchema":{"additionalProperties":false,"properties":{"pid":{"description":"Optional target pid. When omitted, the driver resolves the unique current snapshot for this session and window.","type":"integer"},"session":{"description":"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.","type":"string"},"window_id":{"description":"CGWindowID from list_windows.","type":"integer"},"x1":{"description":"Left edge of region in screenshot pixels.","type":"number"},"x2":{"description":"Right edge of region in screenshot pixels.","type":"number"},"y1":{"description":"Top edge of region in screenshot pixels.","type":"number"},"y2":{"description":"Bottom edge of region in screenshot pixels.","type":"number"}},"required":["window_id","x1","y1","x2","y2"],"type":"object"},"name":"zoom","risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["session.lifecycle.start","session.capture_scope"],"description":"Optionally create or return a lifecycle session before acting. For multi-call work, prefer a short public `session` label and repeat it on every call that accepts it; an omitted value uses the authenticated transport lease's implicit session instead. This tool is optional because an ordinary action can create or reuse a named run directly. Use it to set the initial cursor theme before acting or to revive a public name after it has ended; ordinary actions never revive ended names. `capture_scope` is deprecated compatibility input; new callers select window or desktop modality per action. Idempotent.","inputSchema":{"additionalProperties":true,"properties":{"capture_scope":{"description":"Deprecated compatibility policy. New callers select window or desktop\nmodality on each action instead of storing it on the session.","enum":["auto","window","desktop"],"type":"string"},"cursor_theme":{"description":"Optional initial cursor theme. The host applies it before the cursor is\nfirst made visible, avoiding a flash of the default theme.","properties":{"reduced_motion":{"default":"auto","enum":["auto","on","off"],"type":"string"},"theme_id":{"type":"string"}},"required":["theme_id"],"type":["object","null"]},"session":{"description":"Optional stable public label for this run (e.g. \"research-run-1\").\nWhen omitted, the authenticated transport lease's implicit session is\ncreated or returned.","type":"string"}},"required":[],"type":"object"},"name":"start_session","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"active":{"type":"boolean"},"capture_scope":{"enum":["auto","window","desktop"],"type":"string"},"desktop_capture_authorized":{"type":"boolean"},"desktop_unlocked":{"type":"boolean"},"effective_scope":{"enum":["window","desktop"],"type":"string"},"escalation_detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"escalation_reason":{"anyOf":[{"enum":["ax_tree_pixel_mismatch","background_delivery_failed","foreground_ineffective","no_window_target","other"],"type":"string"},{"type":"null"}]},"revived":{"type":"boolean"},"session":{"type":"string"}},"required":["session","capture_scope","effective_scope","desktop_capture_authorized","desktop_unlocked","escalation_reason","escalation_detail","active","revived"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["session.lifecycle.read"],"description":"Read content-free lifecycle, cursor, recording, and idle status for one session visible to this authenticated transport. Omit `session` to inspect its implicit session.","inputSchema":{"additionalProperties":true,"properties":{"session":{"description":"Optional public label. When omitted, inspect the caller's attached\nimplicit session.","type":"string"}},"required":[],"type":"object"},"name":"get_session","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"client_kind":{"enum":["cli","direct","mcp","python_sdk","typescript_sdk"],"type":"string"},"cursor_visible":{"type":"boolean"},"expires_in_seconds":{"minimum":0,"type":"integer"},"idle_seconds":{"minimum":0,"type":"integer"},"implicit":{"type":"boolean"},"recording_active":{"type":"boolean"},"session":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"enum":["active","ending"],"type":"string"},"transport":{"enum":["cli","daemon","mcp_stdio","mcp_http"],"type":"string"}},"required":["session","implicit","state","client_kind","transport","cursor_visible","recording_active","idle_seconds","expires_in_seconds"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["session.lifecycle.list"],"description":"List content-free lifecycle summaries attached to this authenticated transport lease. It does not enumerate other callers' sessions.","inputSchema":{"additionalProperties":true,"properties":{"cursor":{"description":"Opaque continuation cursor returned by a previous call.","type":"string"},"limit":{"description":"Maximum number of content-free summaries to return (default 50, max\n100). Ordinary agent transports are scoped to their own lease.","minimum":0,"type":["integer","null"]}},"required":[],"type":"object"},"name":"list_sessions","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sessions":{"items":{"properties":{"client_kind":{"enum":["cli","direct","mcp","python_sdk","typescript_sdk"],"type":"string"},"cursor_visible":{"type":"boolean"},"expires_in_seconds":{"minimum":0,"type":"integer"},"idle_seconds":{"minimum":0,"type":"integer"},"implicit":{"type":"boolean"},"recording_active":{"type":"boolean"},"session":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"enum":["active","ending"],"type":"string"},"transport":{"enum":["cli","daemon","mcp_stdio","mcp_http"],"type":"string"}},"required":["session","implicit","state","client_kind","transport","cursor_visible","recording_active","idle_seconds","expires_in_seconds"],"type":"object"},"type":"array"}},"required":["sessions","next_cursor"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["session.lifecycle.end"],"description":"End one visible lifecycle session and run its cursor, recording, configuration, and other cleanup hooks exactly once. Omit `session` to end the authenticated transport's implicit session. Idempotent.","inputSchema":{"additionalProperties":true,"properties":{"session":{"description":"Optional public label to end. When omitted, end the caller's attached\nimplicit session.","type":"string"}},"required":[],"type":"object"},"name":"end_session","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"active":{"const":false},"session":{"type":"string"}},"required":["session","active"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}}]}
+{"driver_version":"0.31.0","patch_sha256":"4409c946b353bedf3846af5b58dc32ed7cce792e9188842f3fa7d49cc01f011b","schema_version":1,"source_commit":"5272e492d61b96caf08e3bf434d91126c1f3dccc","source_tag":"cua-driver-rs-v0.31.0","source_variant":"avibe-raw-single-click-v1","tools":[{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["app.list"],"description":"List macOS apps — both currently running and installed-but-not-running — with per-app state flags:\n\n- running: is a process for this app live? (pid is 0 when false)\n- active: is it the system-frontmost app? (implies running)\n- launch_path: filesystem path to the `.app` bundle, when known. Pass this to `launch_app` to start the app cold.\n- kind: `\"desktop\"` for `.app` bundles on macOS.\n- last_used: RFC3339 timestamp from the bundle's filesystem mtime, when readable; otherwise null.\n\nStandalone running entries include only apps with NSApplicationActivationPolicyRegular — background helpers and system UI agents are filtered out. Installed apps resolve their running/pid state against all live processes by bundle identifier, so an installed app whose process runs as an accessory (LSUIElement / menu-bar apps, e.g. Cua Driver itself) still reports its live pid. Installed apps come from scanning /Applications, /Applications/Utilities, ~/Applications, /System/Applications, and /System/Applications/Utilities.\n\nUse this for \"is X installed?\" as well as \"is X running?\". For per-window state — on-screen, on-current-Space, minimized, window titles — call list_windows instead. For just opening an app — running or not — call launch_app({bundle_id: ...}) directly; list_apps is not a prerequisite.","inputSchema":{"additionalProperties":false,"properties":{"session":{"description":"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.","type":"string"}},"type":"object"},"name":"list_apps","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"apps":{"items":{"properties":{"active":{"type":"boolean"},"bundle_id":{"type":["string","null"]},"kind":{"type":["string","null"]},"last_used":{"type":["string","null"]},"launch_path":{"type":["string","null"]},"name":{"type":"string"},"pid":{"minimum":0,"type":"integer"},"running":{"type":"boolean"}},"required":["pid","name","running","active"],"type":"object"},"type":"array"}},"required":["apps"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["window.list"],"description":"List all layer-0 top-level windows currently known to WindowServer. Includes off-screen windows (minimized, on another Space, hidden-launched). Use this to find a window_id before calling get_window_state.\n\nPer-record fields: window_id, pid, app_name, title, bounds (x/y/width/height, top-left origin), z_index (integer or null; higher values are closer to the front; null means stacking order is unavailable and callers must not infer one), is_on_screen, space_ids, current_space_id (the active Space on that window's display), and on_current_space. The top-level current_space_id is WindowServer's main/global active Space and can differ from a record's current_space_id when displays use independent Spaces. To select a frontmost candidate, take the maximum integer z_index; if every value is null, use an explicit fallback instead of relying on array order.","inputSchema":{"additionalProperties":false,"properties":{"on_screen_only":{"description":"When true, drop windows not on the current Space. Default false.","type":"boolean"},"pid":{"description":"Optional pid filter. When set, only this pid's windows are returned.","type":"integer"},"session":{"description":"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.","type":"string"}},"type":"object"},"name":"list_windows","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"current_space_id":{"minimum":0,"type":["integer","null"]},"windows":{"items":{"properties":{"app_name":{"type":"string"},"bounds":{"properties":{"height":{"type":"number"},"width":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y","width","height"],"type":"object"},"current_space_id":{"minimum":0,"type":["integer","null"]},"is_on_screen":{"type":"boolean"},"layer":{"format":"int32","type":["integer","null"]},"minimized":{"type":["boolean","null"]},"on_current_space":{"type":["boolean","null"]},"pid":{"maximum":4294967295,"minimum":0,"type":["integer","null"]},"space_ids":{"items":{"minimum":0,"type":"integer"},"type":["array","null"]},"title":{"type":"string"},"window_id":{"minimum":0,"type":"integer"},"z_index":{"description":"Higher values are closer to the front. Null means the provider cannot observe stacking order; callers must not infer an order from array position or treat null as zero.","type":["integer","null"]}},"required":["window_id","pid","app_name","title","bounds","is_on_screen","z_index"],"type":"object"},"type":"array"}},"required":["windows"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"capabilities":["accessibility.window_state","accessibility.tree","accessibility.tree.structured","accessibility.tree.bounded","accessibility.element_tokens","screen.capture","screen.capture.window"],"description":"Walk a running app's AX tree and return BOTH a structured `elements` array (preferred) AND a Markdown rendering of the same tree (back-compat). Every actionable element is tagged with [element_index N] in the markdown and as `element_index` in the structured array; pass each element's `element_token` to click, type_text, press_key, etc.\n\nINVARIANT: call get_window_state once per turn per (pid, window_id) before any element action. The next snapshot of the window replaces this one, stales its element tokens, and lists the replaced ids in `invalidated_snapshot_ids`.\n\nPREFERRED CONSUMERS read `structuredContent.elements` (one entry per indexed row with `element_index`, `role`, `label`, `value` (the element's text/AXValue when present — use it to verify what a field holds), `actions` (names of AX actions exposed by the element, omitted when empty), `frame: {x,y,w,h}`, `parent_index`, `depth`). The markdown `tree_markdown` stays available and unchanged in shape for existing text-parsing callers — but new fields will only be added to the structured side.\n\nAlways returns BOTH the element tree AND a screenshot — ground on both and cross-check (the tree lies on some surfaces: Electron echo-confirms, Catalyst null values, virtualized off-viewport rows with `h:1` frames). You choose the modality at ACTION time, not here: an element ax action (pass `element_token` → the accessibility rung) or an element px action (pass `x`,`y` → the pixel rung, read straight off this screenshot). `capture_mode` is deprecated and ignored. Pass `include_screenshot:false` to skip the grab and get the tree only — the cheap path when you're just re-indexing before an element ax action.\n\nThe mirror image: pass `include_accessibility_tree:false` to SKIP the AX walk entirely (the expensive part, bounded by timeout_ms) and return just the screenshot plus window metadata — `window_bounds`, `screenshot_scale`, `screenshot_width`/`screenshot_height`, `app_name`, and `window_title` — the capture-only path for rendering a live window preview / picture-in-picture without paying for perception. Setting BOTH `include_accessibility_tree:false` and `include_screenshot:false` is an error (nothing to return). Optional `max_image_dimension` overrides the configured screenshot long-edge limit for this call; use 0 for native resolution. The legacy `max_dimension` remains a tighter cap for compatibility.\n\nThe snapshot is SCOPED to `window_id`: a window_id that no longer exists is refused with `window_id_not_found`, and one owned by another process is refused with `window_owner_pid_mismatch` naming the real `owner_pid` to retry with (macOS hosts a sandboxed app's Open/Save panel out-of-process, so its window belongs to the panel service, not the app). If the window is live under this pid but its accessibility surface can't be resolved, the tree comes back EMPTY with `degraded_reason: ax_window_unresolved` and the screenshot of the requested window; background input is refused until it resolves, so re-snapshot or act with `delivery_mode:\"foreground\"`. When that pid is an app still launching (its window exists before it answers accessibility), the walk first waits up to `timeout_ms` for it; if it never answers, the tree comes back EMPTY with `degraded_reason: ax_app_launching`, `truncated: true` and `truncation_reason: app_lookup_timeout`. A window on another Space still resolves by its exact CGWindowID. This tool never returns another surface's elements under your window_id. Before exposing a screenshot, its raw dimensions are validated as a coherent 1x/2x representation of the requested WindowServer bounds. `px_frame_mismatch` or `px_capture_unavailable` omits an unprovable screenshot/pixel frame instead of guessing a transform; the truthful AX payload remains available.\n\nOptional `query` projects both tree_markdown and structured `elements` to matching lines plus their ancestor chain (case-insensitive substring). The element_index values are unchanged, the complete snapshot remains actionable, and `element_count` continues to report its total size; `filtered_element_count` reports the projected response size.\n\nOptional `max_elements` / `max_depth` bound the AX walk to mitigate context-window blow-up on Electron / Obsidian / large web apps that produce 10k+ element trees. When applied, BOTH the markdown and the structured elements are truncated identically. Omit both for current default behaviour (≤2 000 elements, depth ≤25).","inputSchema":{"additionalProperties":false,"properties":{"capture_mode":{"description":"DEPRECATED and ignored. get_window_state always returns BOTH the element tree and a screenshot — ground on both. The modality is chosen at action time by how you address the target: an element ax action (element_token) or an element px action (x,y). Any value (including the old \"som\"/\"screenshot\" aliases) is accepted but has no effect.","enum":["ax","vision"],"type":"string"},"include_accessibility_tree":{"description":"Default true — walk the AX tree and return `elements` + `tree_markdown` alongside the screenshot. Set false to SKIP the AX walk entirely (the expensive part, bounded by timeout_ms) and return just the screenshot plus window metadata (bounds, scale, app_name, window_title) — the capture-only path for rendering a live window preview / picture-in-picture. Mirrors include_screenshot. Setting BOTH include_accessibility_tree:false AND include_screenshot:false is an error (nothing to return).","type":"boolean"},"include_screenshot":{"description":"Default true — returns a grounding screenshot alongside the tree. Set false to skip the grab and return the tree only (the cheap path when you're just re-indexing before an element ax action; saves the image tokens + screen-grab latency). screenshot_out_file still forces a capture to disk.","type":"boolean"},"max_depth":{"description":"Cap on the AX-tree walk depth. Nodes whose rendered indent would exceed this are omitted. Omit for the default (25). Lower this for deep menu/Electron trees.","minimum":1,"type":"integer"},"max_dimension":{"description":"Optional cap on the returned screenshot's long edge, in pixels (aspect ratio preserved) — the cheap path for a small preview / thumbnail. Applied on top of the session/global max_image_dimension ceiling; the tighter of the two wins. Omit for the configured default.","minimum":1,"type":"integer"},"max_elements":{"description":"Cap on the total number of AX nodes walked. Truncates depth-first; markdown and structured elements truncate together. Omit for the default (2 000). Lower this for Electron / Obsidian / large web apps that produce 10k+ element trees and blow context windows.","minimum":1,"type":"integer"},"max_image_dimension":{"description":"Per-call override for the returned screenshot's long edge in pixels. An explicit value wins over the session/global setting; 0 returns native resolution. Omit to preserve configured behavior.","minimum":0,"type":"integer"},"pid":{"description":"Target process ID.","type":"integer"},"query":{"description":"Case-insensitive filter for tree_markdown and structured elements. Returns matching actionable rows plus their actionable ancestors without renumbering element_index values.","type":"string"},"screenshot_out_file":{"description":"When set, write the PNG to this file path (~ expanded) instead of embedding base64 in the response. The structured output will contain screenshot_file_path instead.","type":"string"},"session":{"description":"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.","type":"string"},"timeout_ms":{"default":1000,"description":"Wall-clock budget in milliseconds for the accessibility-tree walk (default 1000, min 100, max 120000). Bounds the WHOLE walk. When the budget runs out the tool returns the PARTIAL tree it has, flagged with `truncated: true`, `truncation_reason`, `nodes_visited`, `nodes_pending` and `elements_complete: false`; retry with a larger value (e.g. 5000) or narrow with `query` / `max_depth`.","maximum":120000,"minimum":100,"type":"integer"},"window_id":{"description":"Target window ID from list_windows.","type":"integer"}},"required":["pid","window_id"],"type":"object"},"name":"get_window_state","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"app_name":{"type":["string","null"]},"degraded":{"type":["boolean","null"]},"degraded_reason":{"type":["string","null"]},"element_count":{"minimum":0,"type":["integer","null"]},"elements":{"items":{"properties":{"actions":{"items":{"type":"string"},"type":["array","null"]},"depth":{"minimum":0,"type":"integer"},"element_index":{"minimum":0,"type":"integer"},"element_token":{"type":["string","null"]},"enabled":{"type":["boolean","null"]},"frame":{"properties":{"h":{"type":"number"},"w":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y","w","h"],"type":["object","null"]},"in_web_content":{"type":["boolean","null"]},"label":{"type":["string","null"]},"max":{"type":["number","null"]},"min":{"type":["number","null"]},"parent_index":{"minimum":0,"type":["integer","null"]},"role":{"type":"string"},"selected":{"type":["boolean","null"]},"value":{"type":["string","null"]},"value_description":{"type":["string","null"]}},"required":["element_index","role","depth"],"type":"object"},"type":["array","null"]},"elements_complete":{"type":["boolean","null"]},"filtered_element_count":{"minimum":0,"type":["integer","null"]},"pid":{"minimum":0,"type":"integer"},"returned_element_count":{"minimum":0,"type":["integer","null"]},"screenshot_file_path":{"type":["string","null"]},"screenshot_frame_valid":{"type":["boolean","null"]},"screenshot_height":{"minimum":0,"type":["integer","null"]},"screenshot_mime_type":{"type":["string","null"]},"screenshot_scale":{"type":["number","null"]},"screenshot_width":{"minimum":0,"type":["integer","null"]},"snapshot_id":{"type":["string","null"]},"total_element_count":{"minimum":0,"type":["integer","null"]},"tree_markdown":{"type":["string","null"]},"truncated":{"type":["boolean","null"]},"truncation_reason":{"type":["string","null"]},"window_bounds":{"properties":{"height":{"type":"number"},"width":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y","width","height"],"type":["object","null"]},"window_id":{"minimum":0,"type":"integer"},"window_title":{"type":["string","null"]}},"required":["pid","window_id"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r3","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"capabilities":["state.verify","state.verify.window","state.verify.element","state.observe.visual_evidence"],"description":"Deterministically verify bounded predicates against one exact window. The driver evaluates structured window/accessibility state and may return the final screenshot as uninterpreted visual evidence for a multimodal caller. Predicate results are satisfied, unsatisfied, or unknown; unknown never implies success. Accessibility projections are conservative: absence remains unknown unless the observed search domain is proven exhaustive.","inputSchema":{"additionalProperties":false,"properties":{"expect":{"description":"One to eight predicates, combined with logical AND.","items":{"additionalProperties":false,"properties":{"element":{"additionalProperties":false,"properties":{"enabled":{"type":["boolean","null"]},"exists":{"description":"Assert that at least one trusted element matches the selector.\n\nElement walks are not yet exhaustive on every platform, so absence\ncannot be proven. `false` is rejected instead of returning an\nindefinitely-unknown predicate.","type":"boolean"},"selected":{"type":["boolean","null"]},"selector":{"additionalProperties":false,"properties":{"label_contains":{"minLength":1,"type":"string"},"role":{"minLength":1,"type":"string"}},"required":[],"type":"object"},"value_equals":{"type":["string","null"]}},"required":["selector"],"type":["object","null"]},"window":{"additionalProperties":false,"properties":{"bounds":{"additionalProperties":false,"properties":{"height":{"type":"number"},"tolerance_px":{"maximum":100,"minimum":0,"type":"number"},"width":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y","width","height"],"type":["object","null"]},"exists":{"type":["boolean","null"]}},"type":["object","null"]}},"required":[],"type":"object"},"maxItems":8,"minItems":1,"type":"array"},"include_screenshot":{"description":"Return the final window screenshot as image content for a multimodal\ncaller. The driver does not interpret that image.","type":["boolean","null"]},"pid":{"description":"Exact process whose window may be observed.","minimum":1,"type":"integer"},"session":{"description":"For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session. This\nfield never selects capture modality or authorization.","type":"string"},"stable_samples":{"default":2,"description":"Consecutive satisfied samples required before returning success.","maximum":5,"minimum":1,"type":"integer"},"timeout_ms":{"default":5000,"description":"Bounded wait. Zero performs one sample.","maximum":10000,"minimum":0,"type":"integer"},"window_id":{"description":"Exact native window identifier.","type":"integer"}},"required":["pid","window_id","expect"],"type":"object"},"name":"verify_state","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"elapsed_ms":{"minimum":0,"type":"integer"},"predicates":{"items":{"properties":{"index":{"minimum":0,"type":"integer"},"observed_json":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["satisfied","unsatisfied","unknown"],"type":"string"},"unknown_reason":{"anyOf":[{"enum":["invalid_predicate","unsupported_predicate","untrusted_source","multi_match","target_missing","observation_unavailable","stability_unproven"],"type":"string"},{"type":"null"}]}},"required":["index","status","unknown_reason","observed_json"],"type":"object"},"type":"array"},"samples":{"minimum":0,"type":"integer"},"stable":{"type":"boolean"},"status":{"enum":["satisfied","unsatisfied","unknown"],"type":"string"}},"required":["status","stable","elapsed_ms","samples","predicates"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":false},"capabilities":["app.launch"],"description":"Launch a macOS app in the background — the target does NOT come to the foreground.\n\nProvide either `bundle_id` (preferred — unambiguous, e.g. `com.apple.calculator`) or `name` (e.g. \"Calculator\"). If both are given, bundle_id wins.\n\nOptional `urls` are handed to the app as open targets — for Finder, pass a folder path to open a backgrounded Finder window there.\n\nBrowser DevTools setup belongs to `browser_prepare`, which can prove that a separate isolated profile is driver-owned before enabling CDP.\n\nOptional `webkit_inspector_port`: opens a WebKit inspector server on the specified port (sets WEBKIT_INSPECTOR_SERVER=127.0.0.1:N + TAURI_WEBVIEW_AUTOMATION=1). Use this for Tauri/WebKit-based apps.\n\nOptional `creates_new_application_instance`: when true, forces a new app instance even if one is already running (passes -n to open). Reach for this when another agent or session may drive the SAME app concurrently — it returns a fresh pid + window so each session acts on its own isolated window instead of clobbering one shared instance. Without it, single-instance apps (Calculator, many utilities) hand every caller the same window, so two sessions fight over it.\n\nOptional `additional_arguments`: extra argv strings appended after --args.\n\nReturns the launched app's pid, bundle_id, name, and a `windows` array (same shape as `list_windows`) so callers can skip an extra round-trip before `get_window_state(pid, window_id)`. `launch_state` distinguishes whether the request was sent, the process is running, and a window is ready. When the focus-steal belt-and-braces demotion check ran (target pid ≠ prior frontmost), the response also includes `self_activation_suppressed: bool` — true if focus stayed with the prior frontmost, false if the launched app held focus despite the re-demote attempt.","inputSchema":{"additionalProperties":false,"properties":{"additional_arguments":{"description":"Extra arguments appended after --args when launching.","items":{"type":"string"},"type":"array"},"bundle_id":{"description":"App bundle identifier, e.g. com.apple.calculator. Preferred over name.","type":"string"},"creates_new_application_instance":{"description":"When true, force a new app instance even if already running (open -n). Use for concurrent multi-agent/multi-session work so each session gets an isolated instance + window instead of sharing one — on single-instance apps (e.g. Calculator) every caller otherwise gets the same window and the sessions clobber each other.","type":"boolean"},"name":{"description":"App display name. Used only when bundle_id is absent.","type":"string"},"session":{"description":"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.","type":"string"},"urls":{"description":"Optional file paths or URLs to open with the app (e.g. a folder path for Finder).","items":{"type":"string"},"type":"array"},"webkit_inspector_port":{"description":"Open a WebKit inspector server on this port (sets WEBKIT_INSPECTOR_SERVER env var).","type":"integer"}},"type":"object"},"name":"launch_app","risk":{"class":"r1","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["app.kill"],"description":"Force-terminate a process by pid (kill -9 equivalent on macOS / Linux; taskkill /F equivalent on Windows). Use as escalation when the cooperative close path (hotkey cmd+q on macOS, click-the-X on Windows) failed to make the process exit. Unsaved state is lost — prefer the cooperative path first.","inputSchema":{"additionalProperties":false,"properties":{"pid":{"description":"PID of the process to terminate.","type":"integer"},"session":{"description":"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.","type":"string"}},"required":["pid"],"type":"object"},"name":"kill_app","risk":{"class":"r3","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["window.frame.set"],"description":"Set one exact top-level window's frame in the desktop-coordinate space reported by list_windows and verify the resulting geometry through an independent readback.","inputSchema":{"additionalProperties":false,"properties":{"height":{"minimum":1,"type":"number"},"pid":{"minimum":1,"type":"integer"},"session":{"description":"For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.","type":"string"},"width":{"minimum":1,"type":"number"},"window_id":{"minimum":1,"type":"integer"},"x":{"type":"number"},"y":{"type":"number"}},"required":["pid","window_id","x","y","width","height"],"type":"object"},"name":"set_window_frame","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.click","input.pointer.click.left","accessibility.element_tokens","input.delivery_mode"],"description":"Click against a target pid. **Prefer `element_token` over pixel coordinates** — the token works on backgrounded / minimized / hidden / off-Space windows, identifies one exact snapshot element, and tells you what you're clicking via the cached element's role + label. Reach for `x, y` only when the target is a canvas / video / WebGL / custom-drawn surface that doesn't appear in the AX tree.\n\nTwo addressing modes:\n\n- element_token (from get_window_state): AX action path. Works on backgrounded/hidden windows. No cursor move, no focus steal. The snapshot cache is scoped per (pid, window_id) and is replaced by the next snapshot of the same window — re-snapshot every turn before clicking.\n\n- x, y (window-local screenshot pixels, top-left origin of the PNG returned by get_window_state): CGEvent path. Synthesizes mouse events and posts to pid. Use modifier for cmd/shift/option/ctrl. Needs a visible on-screen window to anchor the conversion.\n\nbutton: \"left\" (default), \"right\", or \"middle\". Defaults to left so the field is fully back-compat — omit it and you get the legacy left-click behaviour. Pixel path: routes through the CGEvent left/right/middle mouse-button primitives. AX path: \"right\" maps to AXShowMenu (same surface as the dedicated `right_click` tool); \"middle\" has no AX equivalent and falls back to a pixel middle-click at the element's center. For a window-addressed background pixel left-click, click_mode:\"raw\" bypasses the AX hit-test optimization and posts exactly one routed mouse down/up pair. Keep the default click_mode:\"auto\" unless AXPress was observed to return a hollow success.\naction: press (default), show_menu, pick, confirm, cancel, open.\nfrom_zoom: set true after a zoom call to auto-translate zoom-image pixel coordinates to full-window space.","inputSchema":{"additionalProperties":false,"properties":{"action":{"description":"AX action: press, show_menu, pick, confirm, cancel, open.","type":"string"},"button":{"description":"Mouse button. Default: \"left\" — omit for legacy left-click behaviour. Pixel path uses the matching CGEvent primitive; AX path maps \"right\" to AXShowMenu and falls back to a pixel middle-click at the element's center for \"middle\".","enum":["left","right","middle"],"type":"string"},"capture_id":{"description":"Optional immutable source capture ID returned by get_window_state or get_desktop_state. With x,y, Driver atomically admits and consumes that exact capture before dispatch; stale, mismatched, or out-of-bounds captures are refused without fallback.","type":"string"},"click_mode":{"description":"Pixel single-click delivery selector. Default \"auto\" preserves the AX-first background optimization. \"raw\" is opt-in and valid only for an exact pid + window_id background left-click with x/y, count=1, and no modifiers; it bypasses AX hit-testing and uses the existing routed CGEvent path.","enum":["auto","raw"],"type":"string"},"count":{"description":"Click count (pixel path only). Default 1.","type":"integer"},"debug_image_out":{"description":"Optional file path. When set on a pixel-addressed click, captures a fresh screenshot, draws a red crosshair at (x, y), and writes the PNG. Use to verify coordinate spaces. Requires window_id; incompatible with from_zoom.","type":"string"},"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": perform the AX action or post the CGEvent without fronting. \"foreground\": briefly front the window, act, let transient UI settle, then restore the prior frontmost app. Requires window_id. Modified clicks require \"foreground\" so macOS observes physical modifier-key state. A generic click has no independent postcondition read-back, except selection of list-like AX rows whose AXSelected state can be confirmed; otherwise confirm the effect from a fresh state snapshot. Use the agent loop: background AX (element_token) → snapshot → background pixel (x/y) → snapshot → delivery_mode:\"foreground\".","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"from_zoom":{"description":"When true, x and y are in the last zoom image for this pid; driver translates back to full-window coordinates.","type":"boolean"},"modifier":{"description":"Modifier keys: cmd, shift, option/alt, ctrl.","items":{"type":"string"},"type":"array"},"pid":{"description":"Target process ID.","type":"integer"},"scope":{"description":"Coordinate frame for a windowless screen-absolute click (default \"window\"). Pass \"desktop\" when sending x,y with NO pid/window_id — the coordinates are then true screen pixels (read from get_desktop_state with scope=\"desktop\"). Per-call; not a setting.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},"window_id":{"description":"Target window ID. Omit when element_token is supplied (the token carries it).","type":"integer"},"x":{"description":"X in screenshot pixels. A window target uses the get_window_state PNG; a desktop target uses the native get_desktop_state PNG. The driver reverses Retina backing scale and any window-image downscale.","type":"number"},"y":{"description":"Y in screenshot pixels from the image selected by target.","type":"number"}},"required":[],"type":"object"},"name":"click","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.click","input.pointer.click.left","input.pointer.click.double","accessibility.element_tokens","input.delivery_mode"],"description":"Double-click at (x, y) or on an AX element identified by element_token.\n\nAX path (element_token provided): performs `AXOpen` when the element advertises it (Finder items, openable list rows/cells); otherwise resolves the element's on-screen center and falls back to a pixel double-click there.\n\nPixel path (x, y provided): two down/up pairs ~80 ms apart at the given coordinates.","inputSchema":{"additionalProperties":false,"properties":{"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"pid":{"type":"integer"},"session":{"description":"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.","type":"string"},"window_id":{"description":"CGWindowID. Omit when element_token is supplied (the token carries it).","type":"integer"},"x":{"description":"Screen X coordinate (pixel path).","type":"number"},"y":{"description":"Screen Y coordinate (pixel path).","type":"number"}},"required":["pid"],"type":"object"},"name":"double_click","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.click","input.pointer.click.right","accessibility.element_tokens","input.delivery_mode"],"description":"Right-click against a target pid. Two addressing modes:\n\n- `element_token` (from the last `get_window_state` snapshot) — performs `AXShowMenu` on the cached element. Pure AX RPC, works on backgrounded / hidden windows, no cursor move or focus steal. Requires a prior `get_window_state(pid, window_id)` in this turn.\n\n- `x`, `y` — synthesizes `rightMouseDown` / `rightMouseUp` CGEvent pair posted to the pid. Driver converts image-pixel → screen-point internally. `modifier` forces the CGEvent path (AX actions don't propagate modifier keys).\n\nExactly one of `element_token` or (`x` AND `y`) must be provided. `pid` always required.","inputSchema":{"additionalProperties":false,"properties":{"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"modifier":{"description":"Modifier keys held during the right-click: cmd/shift/option/ctrl. Pixel path only.","items":{"type":"string"},"type":"array"},"pid":{"description":"Target process ID.","type":"integer"},"session":{"description":"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.","type":"string"},"window_id":{"description":"CGWindowID. Omit when element_token is supplied (the token carries it).","type":"integer"},"x":{"description":"X in window-local screenshot pixels. Must be provided together with y.","type":"number"},"y":{"description":"Y in window-local screenshot pixels. Must be provided together with x.","type":"number"}},"required":["pid"],"type":"object"},"name":"right_click","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.drag","input.delivery_mode"],"description":"Press-drag-release gesture from (from_x, from_y) to (to_x, to_y) in window-local screenshot pixels — the same space get_window_state returns. Top-left origin of the target's window.\n\nUse for: marquee/lasso selection, drag-and-drop, resizing via a handle, scrubbing a slider, repositioning a panel.\n\n`duration_ms` (default 500) is the wall-clock budget for the path between mouse-down and mouse-up; `steps` (default 20) is the number of intermediate mouseDragged events linearly interpolated along the path. Increase both for slower, more human drags; decrease for snap gestures.\n\n`modifier` keys (cmd/shift/option/ctrl) are held across the entire gesture.\n\nWhen `from_zoom` is true, coordinates are in the last zoom image for this pid; the driver maps them back to window coordinates before dispatching.","inputSchema":{"additionalProperties":false,"properties":{"button":{"description":"Mouse button used for the drag. Default: left.","enum":["left","right","middle"],"type":"string"},"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"duration_ms":{"description":"Wall-clock duration of the drag path between mouseDown and mouseUp. Default: 500.","maximum":10000,"minimum":0,"type":"integer"},"from_x":{"description":"Drag-start X in window-local screenshot pixels. Top-left origin.","type":"number"},"from_y":{"description":"Drag-start Y in window-local screenshot pixels. Top-left origin.","type":"number"},"from_zoom":{"description":"When true, coordinates are in the last zoom image for this pid; driver maps back to window coordinates.","type":"boolean"},"modifier":{"description":"Modifier keys held across the entire gesture: cmd/shift/option/ctrl.","items":{"type":"string"},"type":"array"},"pid":{"description":"Target process ID.","type":"integer"},"scope":{"default":"window","description":"Use desktop with no pid/window_id for native get_desktop_state screenshot coordinates.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"steps":{"description":"Number of intermediate mouseDragged events linearly interpolated along the path. Default: 20.","maximum":200,"minimum":1,"type":"integer"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"to_x":{"description":"Drag-end X in window-local screenshot pixels.","type":"number"},"to_y":{"description":"Drag-end Y in window-local screenshot pixels.","type":"number"},"window_id":{"description":"CGWindowID for the window the pixel coordinates were measured against. Optional only when pid owns exactly one eligible top-level window; otherwise the action refuses with ambiguous_window_target.","type":"integer"}},"required":["from_x","from_y","to_x","to_y"],"type":"object"},"name":"drag","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.keyboard.type","input.keyboard.type.terminal_safe","accessibility.element_tokens","input.delivery_mode"],"description":"Insert text into the target pid via `AXSetAttribute(kAXSelectedText)`. Works for standard Cocoa text fields and text views. No keystrokes are synthesized — special keys (Return / Escape / arrows) go through `press_key` / `hotkey`. For Chromium / Electron inputs that don't implement `kAXSelectedText`, the tool falls back to CGEvent character synthesis automatically when the estimated route stays within the daemon transport budget. Longer synthesized routes are refused before character events and return a safe chunk size; one-call AX insertion remains uncapped.\n\nOptional `element_token` (from the last `get_window_state` snapshot) directs the write to a specific field. Without `element_token`, the write goes to the pid's currently focused element.\n\nWEB CONTENT (Chromium/WebKit/Electron — browser tabs, Slack, VS Code, X's compose box): AXValue is not independent proof that the renderer/DOM observed an AX write or synthesized keystrokes. The driver detects this at the element level (an AXWebArea ancestor) and refuses to trust AXValue-only read-back there. Electron AX targets that are web content or cannot be proven native refuse background delivery before mutation because the AX route cannot establish exact renderer focus; use the px form or explicit foreground delivery. Other web-content paths return effect:\"unverifiable\" + escalation, never a false \"confirmed\" (a browser's own native address bar/toolbar stays trusted). For a browser TAB the reliable path is the `page` tool (drives the DOM via CDP); for an embedded web view use this tool's px form: pass x,y (no element_token) to pixel-click the field then type, in one call. NOTE: a px focus-click won't reliably open+focus a CLOSED control; AX-press to open/activate it first (works in the background), then px-type. Always confirm via the screenshot; if px-background still drops, escalate to delivery_mode:\"foreground\".","inputSchema":{"additionalProperties":false,"properties":{"delay_ms":{"description":"Milliseconds between characters in the CGEvent fallback path. Default 30. Ignored when the AX path succeeds.","maximum":200,"minimum":0,"type":"integer"},"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": AX insert, then CGEvent keystrokes if needed — no focus steal; native controls can be confirmed via AXValue read-back, while web-content writes remain effect:\"unverifiable\". \"foreground\": briefly front the window, type, restore the prior frontmost — the explicit last resort for focus-sensitive surfaces (e.g. WhatsApp/Catalyst) where background keystrokes don't land. Re-call with \"foreground\" when a background attempt remains unverifiable and a fresh snapshot shows the text did not appear.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"pid":{"description":"Target process ID.","type":"integer"},"scope":{"default":"window","description":"Use desktop with no pid/window_id to type into the frontmost application.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"text":{"description":"Text to insert at the target's cursor.","type":"string"},"window_id":{"description":"CGWindowID. Omit when element_token is supplied (the token carries it).","type":"integer"},"x":{"description":"Screenshot-pixel X of the field to type into — the element px action form. Pass x,y (no element_token) and the tool pixel-clicks there to establish real renderer focus, then types. Use for Chromium/Electron inputs the AX path can't reach. Read straight off the get_window_state PNG, same convention as click.","type":"number"},"y":{"description":"Screenshot-pixel Y of the field (see x).","type":"number"}},"required":["text"],"type":"object"},"name":"type_text","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.keyboard.press","accessibility.element_tokens","input.delivery_mode"],"description":"Press and release a single key. Follows the same `delivery_mode` ladder as click/type_text — it does NOT raise the window by default:\n• `background` (default): post to the pid WITHOUT fronting/raising — the auth-message path (Chromium-safe). With element_token it focuses that AX element first. `window_id` only targets; it does not raise.\n• `foreground`: guard and briefly front the exact window, focus an addressed AX element when supplied, send a genuine HID key transition so Chromium content, inline editors, and native menu equivalents receive it, then restore prior frontmost. Requires window_id.\n\nA key press is confirmed only when a bounded native AX value/selection read-back changes on the same control. Otherwise a successfully attempted post remains effect:\"unverifiable\" without implying delivery failure or recommending foreground. Key names: return, tab, escape, up/down/left/right, space, delete, home, end, pageup, pagedown, f1-f12, plus any letter or digit. Modifiers array: cmd, shift, option/alt, ctrl, fn.","inputSchema":{"additionalProperties":false,"properties":{"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"key":{"description":"Key name: return, tab, escape, up, down, etc.","type":"string"},"modifiers":{"description":"Modifier keys: cmd, shift, option/alt, ctrl, fn.","items":{"type":"string"},"type":"array"},"pid":{"type":"integer"},"scope":{"default":"window","description":"Use desktop with no pid/window_id to send the key to the frontmost application.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"window_id":{"description":"Target window. Required for delivery_mode:\"foreground\". Does NOT itself raise the window — raising is gated on delivery_mode.","type":"integer"},"x":{"description":"Screenshot-pixel X — the element px action form: pixel-click there to focus, then send the key. Use when the key must go to a Chromium/Electron surface the AX path can't focus. Pass with y, no element_token.","type":"number"},"y":{"description":"Screenshot-pixel Y (see x).","type":"number"}},"required":["key"],"type":"object"},"name":"press_key","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.keyboard.hotkey","input.delivery_mode"],"description":"Press a key combination — e.g. `[\"cmd\", \"c\"]` for Copy, `[\"cmd\", \"shift\", \"4\"]` for screenshot selection. Follows the same `delivery_mode` ladder as click/type_text — it does NOT raise the window by default:\n• `background` (default): post the combo to the target pid WITHOUT fronting or raising it — uses the macOS 14+ auth-message envelope so Chromium/Electron accept it as trusted live input. With an AX target, focus that exact element first. No top-level focus steal. `window_id` here only targets the combo; it does not raise.\n• `foreground`: briefly front the window (NSMenu path, < 1 ms via SLPSSetFrontProcessWithOptions) so native menu key-equivalents (Cmd+Z, Cmd+W) dispatch, then restore the prior frontmost — the explicit escalation for menu-bar shortcuts on non-Chromium apps that ignore a background combo. With an AX target or x,y, the focused field receives the chord through the foreground HID queue (needed by native Chromium fields such as the omnibox). Requires window_id.\n\nA combo is never driver-verifiable (no read-back) → effect:\"unverifiable\"; confirm via screenshot. NOTE: a keyboard combo does NOT focus a text field — to type into a backgrounded Electron input, establish real renderer focus with a PIXEL click first, then `type_text`. If an app only accepts paste, call `clipboard_write`, then `clipboard_read` and verify its types (and text when applicable) before selecting or replacing editor content; only then send Cmd+V.\n\nRecognized modifiers: cmd/command, shift, option/alt, ctrl/control, fn. Non-modifier keys use the same vocabulary as `press_key`. Order: modifiers first, one non-modifier last.","inputSchema":{"additionalProperties":false,"properties":{"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"keys":{"description":"Modifier(s) and one non-modifier key, e.g. [\"cmd\", \"c\"].","items":{"type":"string"},"minItems":2,"type":"array"},"pid":{"description":"Target process ID.","type":"integer"},"scope":{"default":"window","description":"Use desktop with no pid/window_id to send the chord to the frontmost application.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"window_id":{"description":"Target window. Required for delivery_mode:\"foreground\" (the NSMenu activation needs a window). Does NOT itself raise the window — raising is gated on delivery_mode.","type":"integer"},"x":{"description":"Screenshot-pixel X — the element px action form: pixel-click there to focus, then send the combo (so e.g. Cmd+V pastes into that field). Pass with y. Use for Chromium/Electron surfaces the background combo can't reach.","type":"number"},"y":{"description":"Screenshot-pixel Y (see x).","type":"number"}},"required":["keys"],"type":"object"},"name":"hotkey","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.keyboard.type","accessibility.element_tokens"],"description":"Set a value on a UI element. Two modes depending on element role:\n\n- **AXPopUpButton / select dropdown**: finds the child option whose title or value matches `value` (case-insensitive) and AXPresses it directly — the native macOS popup menu is never opened, so focus is never stolen. Use this for HTML <select> elements in Safari or any native NSPopUpButton.\n\n- **All other elements**: writes AXValue directly (sliders, steppers, date pickers, native text fields that expose settable AXValue).\n\nFor free-form text entry into web inputs, prefer `type_text_chars` which synthesises key events — AXValue writes are ignored by WebKit.","inputSchema":{"additionalProperties":false,"properties":{"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"pid":{"type":"integer"},"session":{"description":"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.","type":"string"},"value":{"description":"New value. AX will coerce to the element's native type.","type":"string"},"window_id":{"description":"CGWindowID. Omit when element_token is supplied (the token carries it).","type":"integer"}},"required":["pid","value"],"type":"object"},"name":"set_value","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":true,"readOnlyHint":false},"capabilities":["input.pointer.scroll","accessibility.element_tokens","input.delivery_mode"],"description":"Scroll the target pid. Two paths, picked by how you address the scroll:\n\n• **Targeted wheel path** — when you pass a target, either `element_token` (preferred) or window-local `x, y` pixels: the driver synthesizes a real mouse-wheel event (CGEventCreateScrollWheelEvent, at that screen point. The renderer hit-tests the wheel at the cursor, so the scroll lands on whatever element is under the point — exactly like physically rolling the wheel over it. This is the ONLY way to scroll a nested `overflow:auto` region (e.g. a scrollable <div> with no tabindex): such regions never take keyboard focus, so the keystroke path below no-ops on them. Use this for inner/nested scrollers in web views.\n\n• **Keystroke path (focused region)** — when you pass NO target (just pid + direction): synthesizes PageDown/PageUp (by='page') or Down/Up arrows (by='line'); horizontal uses Left/Right arrows. Drives the focused / page scroller only.\n\nMapping: by='page' → larger step; by='line' → smaller step; amount = number of wheel notches (targeted path) or keystroke repetitions (keystroke path).","inputSchema":{"additionalProperties":false,"properties":{"amount":{"description":"Pixel-wheel path: number of wheel notches. Keystroke path: number of keystroke repetitions. Larger requests are clamped to the maximum. Default: 3.","maximum":50,"minimum":1,"type":"integer"},"by":{"description":"Scroll granularity. Default: line.","enum":["line","page"],"type":"string"},"delivery_mode":{"description":"Best-effort-background ladder rung (default \"background\"). \"background\": inject without fronting or raising the target — no focus steal. \"foreground\": briefly front the target, act, then restore the prior frontmost — the explicit last resort when a background attempt didn't land. Re-call with \"foreground\" only for the action that needs it.","enum":["background","foreground"],"type":"string"},"direction":{"description":"Scroll direction.","enum":["up","down","left","right"],"type":"string"},"element_token":{"description":"Opaque per-snapshot element handle from `structuredContent.elements[].element_token`. Returns an explicit stale error naming the current snapshots once a newer read supersedes it.","type":"string"},"pid":{"type":"integer"},"scope":{"default":"window","description":"Use desktop with x,y and no pid/window_id for native get_desktop_state screenshot coordinates.","enum":["window","desktop"],"type":"string"},"session":{"description":"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.","type":"string"},"target":{"anyOf":[{"description":"Exact capture/input target selected independently for each action.\n\n`display_id=\"primary\"` is the portable desktop target in this release.\nPlatforms that cannot address another display reject it explicitly rather\nthan silently changing coordinate spaces.","oneOf":[{"additionalProperties":true,"properties":{"kind":{"const":"window","type":"string"},"pid":{"minimum":0,"type":"integer"},"window_id":{"minimum":0,"type":"integer"}},"required":["kind","pid","window_id"],"type":"object"},{"additionalProperties":true,"properties":{"display_id":{"type":"string"},"kind":{"const":"desktop","type":"string"}},"required":["kind","display_id"],"type":"object"}]},{"type":"null"}]},"window_id":{"type":"integer"},"x":{"description":"Window-local screenshot X (top-left origin of the PNG from get_window_state). With `y`, routes through the pixel-wheel path at this point — use for a scrollable surface that isn't in the AX tree. Requires window_id to anchor the window→screen conversion.","type":"number"},"y":{"description":"Window-local screenshot Y. See `x`.","type":"number"}},"required":["direction"],"type":"object"},"name":"scroll","outputSchema":{"anyOf":[{"additionalProperties":false,"properties":{"delivery":{"additionalProperties":false,"properties":{"delivered_count":{"minimum":0,"type":["integer","null"]},"mode":{"enum":["background","foreground","not_applicable","unknown"],"type":"string"}},"required":["mode"],"type":["object","null"]},"effect":{"enum":["confirmed","partial","unverifiable","suspected_noop","refused"],"type":"string"},"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"hint":{"type":["string","null"]}},"required":["code"],"type":["object","null"]},"escalation":{"additionalProperties":false,"properties":{"reason":{"enum":["route_unavailable","delivery_failed","effect_unconfirmed","suspected_noop","permission_required"],"type":"string"},"target":{"enum":["pixel","foreground","page","session"],"type":"string"}},"required":["target","reason"],"type":["object","null"]},"evidence":{"items":{"additionalProperties":false,"properties":{"detail":{"type":["string","null"]},"kind":{"enum":["value_readback","window_change"],"type":"string"}},"required":["kind"],"type":"object"},"type":["array","null"]},"route":{"enum":["accessibility","synthetic_events","global_input","system_api","dom","trusted_input"],"type":"string"},"summary":{"type":["string","null"]}},"required":["effect","route"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"capabilities":["clipboard.read","clipboard.types"],"description":"List available system clipboard types and optionally return privacy-sensitive plain text. Clipboard content is never retained in telemetry.","inputSchema":{"additionalProperties":false,"properties":{"include_text":{"default":false,"description":"Return plain-text clipboard content in addition to the available types.\nClipboard content is privacy-sensitive and is never retained in telemetry.","type":"boolean"},"session":{"description":"For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.","type":"string"}},"required":[],"type":"object"},"name":"clipboard_read","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"content_redacted_from_telemetry":{"type":"boolean"},"privacy_sensitive":{"type":"boolean"},"supported":{"type":"boolean"},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"types":{"items":{"type":"string"},"type":"array"}},"required":["supported","types","text","privacy_sensitive","content_redacted_from_telemetry"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["clipboard.write","clipboard.write.text","clipboard.write.image","clipboard.write.file_url","clipboard.types"],"description":"Replace the system clipboard with exactly one value: plain text, an image from an absolute local path, or a file URL from an absolute local path. Returns the available types for read-back before paste.","inputSchema":{"additionalProperties":false,"properties":{"file_path":{"description":"Absolute path to a local file to place on the clipboard as a file URL.","type":"string"},"image_path":{"description":"Absolute path to a local image to place on the clipboard.","type":"string"},"session":{"description":"For multi-call work, prefer a short public session label and repeat it on every call that\naccepts it. Omit it to use the authenticated transport's implicit lifecycle session.","type":"string"},"text":{"description":"Plain text to place on the clipboard.","type":"string"}},"required":[],"type":"object"},"name":"clipboard_write","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"content_redacted_from_telemetry":{"type":"boolean"},"privacy_sensitive":{"type":"boolean"},"supported":{"type":"boolean"},"types":{"items":{"type":"string"},"type":"array"},"written_type":{"type":"string"}},"required":["supported","written_type","types","privacy_sensitive","content_redacted_from_telemetry"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"active","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["screen.dimensions"],"description":"Return the logical size of the main display in points plus its backing scale factor. Agents click in points; Retina displays have scale_factor 2.0. Requires no TCC permissions.","inputSchema":{"additionalProperties":false,"properties":{"session":{"description":"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.","type":"string"}},"type":"object"},"name":"get_screen_size","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"height":{"type":"number"},"scale_factor":{"type":"number"},"width":{"type":"number"}},"required":["width","height","scale_factor"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"capabilities":["screen.capture","screen.dimensions"],"description":"Capture the full display in true screen pixels, full size unless `max_image_dimension` caps it. Use its PNG as the coordinate source for actions whose target is {kind:\"desktop\",display_id:\"primary\"}. Returns the true screen size and backing scale factor. Vision-only: no AX tree walk.","inputSchema":{"additionalProperties":false,"properties":{"max_image_dimension":{"description":"Optional long-edge cap for the returned PNG, in pixels (aspect ratio preserved). Omitted or 0 returns the full-size capture. When the cap downsizes the image, the response reports `screenshot_original_width/height`, and x/y read off it for this session's later scope:\"desktop\" actions (or passed with its `capture_id`) are mapped back to the full-size frame automatically.","minimum":0,"type":"integer"},"screenshot_out_file":{"description":"Write PNG here instead of base64.","type":"string"},"session":{"description":"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.","type":"string"}},"type":"object"},"name":"get_desktop_state","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"agent_overlay_capture":{"additionalProperties":false,"properties":{"method":{"type":["string","null"]},"reason":{"type":["string","null"]},"status":{"oneOf":[{"const":"excluded","type":"string"},{"const":"not_present","type":"string"},{"const":"not_excluded","type":"string"}]}},"required":["status"],"type":["object","null"]},"display":{"type":"string"},"platform":{"enum":["macos","linux","windows"],"type":"string"},"scale_factor":{"type":"number"},"screen_height":{"type":"integer"},"screen_width":{"type":"integer"},"screenshot_file_path":{"type":"string"},"screenshot_height":{"type":"integer"},"screenshot_mime_type":{"const":"image/png"},"screenshot_width":{"type":"integer"}},"required":["platform","display","screenshot_width","screenshot_height","screen_width","screen_height","scale_factor","screenshot_mime_type"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r3","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["screen.cursor.position"],"description":"Return the current mouse cursor position in screen points (origin top-left).","inputSchema":{"additionalProperties":false,"properties":{"session":{"description":"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.","type":"string"}},"type":"object"},"name":"get_cursor_position","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"available":{"type":"boolean"},"source":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":[],"description":"Single-call end-to-end driver diagnostics. Designed to let downstream consumers ship one stable call instead of stitching together check_permissions, doctor, version, bundle attribution, and platform capability status. On macOS, prompt-capable direct capture is deliberately skipped; use `cua-driver permissions grant` to verify it explicitly. cua-driver owns the health model; consumers stay thin.\n\nInput — all optional:\n {\n \"include\": [\"<check_name>\", ...], // run only these\n \"skip\": [\"<check_name>\", ...] // skip these\n }\nIf both are given, `include` wins.\n\nCanonical check names:\n macOS : binary_version, platform_supported, session_active,\n bundle_identity, tcc_accessibility, tcc_screen_recording,\n ax_capability, screen_capture_capability\n Windows: binary_version, platform_supported, session_active,\n ax_capability (via UIA), screen_capture_capability (via DXGI)\n Linux : binary_version, platform_supported, session_active,\n ax_capability (via AT-SPI), screen_capture_capability (via X11)\n\nOutput — stable contract, schema_version=\"1\":\n {\n \"schema_version\": \"1\",\n \"platform\": \"darwin\" | \"win32\" | \"linux\",\n \"driver_version\": \"<semver>\",\n \"overall\": \"ok\" | \"degraded\" | \"failed\",\n \"checks\": [\n {\n \"name\": \"<one of the canonical names above>\",\n \"status\": \"pass\" | \"fail\" | \"skip\",\n \"message\": \"<one-line summary, always present>\",\n \"hint\": \"<remediation step, present when status=fail>\",\n \"data\": { /* check-specific structured fields */ }\n },\n ...\n ]\n }\n\n`overall` rules:\n - `ok` — every non-skipped check passes\n - `degraded` — at least one non-core check fails (binary is still usable)\n - `failed` — any core check fails (binary_version, platform_supported, session_active)\n\nStability: schema_version=\"1\" is the contract. Future breaking changes will be `\"2\"`. Adding new check names under the same schema_version is non-breaking; consumers must tolerate unknown check names.","inputSchema":{"additionalProperties":false,"properties":{"include":{"description":"Only run these checks (canonical names). Wins over `skip`.","items":{"type":"string"},"type":"array"},"session":{"description":"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.","type":"string"},"skip":{"description":"Skip these checks (canonical names). Ignored when `include` is set.","items":{"type":"string"},"type":"array"}},"type":"object"},"name":"health_report","risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["accessibility.tree","accessibility.tree.structured"],"description":"Return a lightweight snapshot of the desktop: running regular apps and on-screen visible windows with their bounds, z-order, and owner pid.\n\nFor the full AX subtree of a single window (with interactive element indices you can click by), use `get_window_state` instead — that's the heavy per-window tool. This one is a fast discovery read that needs no TCC grants.","inputSchema":{"additionalProperties":false,"properties":{"session":{"description":"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.","type":"string"}},"type":"object"},"name":"get_accessibility_tree","risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["screen.capture","screen.capture.window","screen.capture.region"],"description":"Capture a cropped JPEG of a window region (x1,y1)–(x2,y2) in screenshot pixel coordinates, with 20% padding added on each side. The output image is at most 500 px wide.\n\nAfter a zoom, pass `from_zoom=true` to click/type_text to auto-translate coordinates back to full-window space. Coordinate actions return `screenshot_context_missing` when no current snapshot contains a screenshot owned by this session. `from_zoom` actions return `zoom_context_missing` when the zoom was never created or was replaced; call `get_window_state`, then `zoom`, again on the same connection.","inputSchema":{"additionalProperties":false,"properties":{"pid":{"description":"Optional target pid. When omitted, the driver resolves the unique current snapshot for this session and window.","type":"integer"},"session":{"description":"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.","type":"string"},"window_id":{"description":"CGWindowID from list_windows.","type":"integer"},"x1":{"description":"Left edge of region in screenshot pixels.","type":"number"},"x2":{"description":"Right edge of region in screenshot pixels.","type":"number"},"y1":{"description":"Top edge of region in screenshot pixels.","type":"number"},"y2":{"description":"Bottom edge of region in screenshot pixels.","type":"number"}},"required":["window_id","x1","y1","x2","y2"],"type":"object"},"name":"zoom","risk":{"class":"r2","enforcement":"active","operation_sensitive":true,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["session.lifecycle.start","session.capture_scope"],"description":"Optionally create or return a lifecycle session before acting. For multi-call work, prefer a short public `session` label and repeat it on every call that accepts it; an omitted value uses the authenticated transport lease's implicit session instead. This tool is optional because an ordinary action can create or reuse a named run directly. Use it to set the initial cursor theme before acting or to revive a public name after it has ended; ordinary actions never revive ended names. `capture_scope` is deprecated compatibility input; new callers select window or desktop modality per action. Idempotent.","inputSchema":{"additionalProperties":true,"properties":{"capture_scope":{"description":"Deprecated compatibility policy. New callers select window or desktop\nmodality on each action instead of storing it on the session.","enum":["auto","window","desktop"],"type":"string"},"cursor_theme":{"description":"Optional initial cursor theme. The host applies it before the cursor is\nfirst made visible, avoiding a flash of the default theme.","properties":{"reduced_motion":{"default":"auto","enum":["auto","on","off"],"type":"string"},"theme_id":{"type":"string"}},"required":["theme_id"],"type":["object","null"]},"session":{"description":"Optional stable public label for this run (e.g. \"research-run-1\").\nWhen omitted, the authenticated transport lease's implicit session is\ncreated or returned.","type":"string"}},"required":[],"type":"object"},"name":"start_session","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"active":{"type":"boolean"},"capture_scope":{"enum":["auto","window","desktop"],"type":"string"},"desktop_capture_authorized":{"type":"boolean"},"desktop_unlocked":{"type":"boolean"},"effective_scope":{"enum":["window","desktop"],"type":"string"},"escalation_detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"escalation_reason":{"anyOf":[{"enum":["ax_tree_pixel_mismatch","background_delivery_failed","foreground_ineffective","no_window_target","other"],"type":"string"},{"type":"null"}]},"revived":{"type":"boolean"},"session":{"type":"string"}},"required":["session","capture_scope","effective_scope","desktop_capture_authorized","desktop_unlocked","escalation_reason","escalation_detail","active","revived"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["session.lifecycle.read"],"description":"Read content-free lifecycle, cursor, recording, and idle status for one session visible to this authenticated transport. Omit `session` to inspect its implicit session.","inputSchema":{"additionalProperties":true,"properties":{"session":{"description":"Optional public label. When omitted, inspect the caller's attached\nimplicit session.","type":"string"}},"required":[],"type":"object"},"name":"get_session","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"client_kind":{"enum":["cli","direct","mcp","python_sdk","typescript_sdk"],"type":"string"},"cursor_visible":{"type":"boolean"},"expires_in_seconds":{"minimum":0,"type":"integer"},"idle_seconds":{"minimum":0,"type":"integer"},"implicit":{"type":"boolean"},"recording_active":{"type":"boolean"},"session":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"enum":["active","ending"],"type":"string"},"transport":{"enum":["cli","daemon","mcp_stdio","mcp_http"],"type":"string"}},"required":["session","implicit","state","client_kind","transport","cursor_visible","recording_active","idle_seconds","expires_in_seconds"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"capabilities":["session.lifecycle.list"],"description":"List content-free lifecycle summaries attached to this authenticated transport lease. It does not enumerate other callers' sessions.","inputSchema":{"additionalProperties":true,"properties":{"cursor":{"description":"Opaque continuation cursor returned by a previous call.","type":"string"},"limit":{"description":"Maximum number of content-free summaries to return (default 50, max\n100). Ordinary agent transports are scoped to their own lease.","minimum":0,"type":["integer","null"]}},"required":[],"type":"object"},"name":"list_sessions","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sessions":{"items":{"properties":{"client_kind":{"enum":["cli","direct","mcp","python_sdk","typescript_sdk"],"type":"string"},"cursor_visible":{"type":"boolean"},"expires_in_seconds":{"minimum":0,"type":"integer"},"idle_seconds":{"minimum":0,"type":"integer"},"implicit":{"type":"boolean"},"recording_active":{"type":"boolean"},"session":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"enum":["active","ending"],"type":"string"},"transport":{"enum":["cli","daemon","mcp_stdio","mcp_http"],"type":"string"}},"required":["session","implicit","state","client_kind","transport","cursor_visible","recording_active","idle_seconds","expires_in_seconds"],"type":"object"},"type":"array"}},"required":["sessions","next_cursor"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r0","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"capabilities":["session.lifecycle.end"],"description":"End one visible lifecycle session and run its cursor, recording, configuration, and other cleanup hooks exactly once. Omit `session` to end the authenticated transport's implicit session. Idempotent.","inputSchema":{"additionalProperties":true,"properties":{"session":{"description":"Optional public label to end. When omitted, end the caller's attached\nimplicit session.","type":"string"}},"required":[],"type":"object"},"name":"end_session","outputSchema":{"anyOf":[{"additionalProperties":true,"properties":{"active":{"const":false},"session":{"type":"string"}},"required":["session","active"],"type":"object"},{"additionalProperties":true,"anyOf":[{"required":["refusal"]},{"required":["status"]},{"required":["code"]}],"type":"object"}],"type":"object"},"risk":{"class":"r1","enforcement":"metadata_only","operation_sensitive":false,"version":"1"}}]}
diff --git a/desktop/runtime-host/src/computer_use.rs b/desktop/runtime-host/src/computer_use.rs
index 0814ee8a0..574a61843 100644
--- a/desktop/runtime-host/src/computer_use.rs
+++ b/desktop/runtime-host/src/computer_use.rs
@@ -18,7 +18,7 @@ pub const COMPUTER_USE_STATE_FILE: &str = "computer-use.json";
pub const COMPUTER_USE_LOCK_FILE: &str = "computer-use.lock";
pub const COMPUTER_USE_SOCKET_FILE: &str = "cua-driver.sock";
pub const COMPUTER_USE_DRIVER_VERSION: &str = "0.31.0";
-pub const COMPUTER_USE_TOOL_SNAPSHOT_SHA256: &str = "4c6a9c351f9ead8dac182ee8b9e4bb2ec5b9f66f35e4d36373643792e97a8d67";
+pub const COMPUTER_USE_TOOL_SNAPSHOT_SHA256: &str = "edf496838092b2fa21807724b30308c4e9a90a404c9a9b7783a299b71e427144";
pub const RUNTIME_TOO_OLD_REASON: &str = "runtime_too_old";
pub const RUNTIME_UNAVAILABLE_REASON: &str = "runtime_unavailable";
pub const FAILURE_LIMIT: usize = 3;