Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
[codex] docs(cua-driver): pivot to rust-first driver (#1738)
Francesco Bonacci61cbd03768df
diff --git a/.github/workflows/cd-rust-cua-driver.yml b/.github/workflows/cd-rust-cua-driver.ymlindex 1f38482fb3..2cc238130b 100644--- a/.github/workflows/cd-rust-cua-driver.yml+++ b/.github/workflows/cd-rust-cua-driver.yml@@ -408,8 +408,7 @@ jobs:# macos-15 and uses the BSD form (`sed -i ''`).# The Rust install logic now lives at# libs/cua-driver/scripts/_install-rust.sh (a private helper- # invoked by libs/cua-driver/scripts/install.sh on- # --backend=rust / non-macOS auto-detect).+ # invoked by libs/cua-driver/scripts/install.sh by default).sed -i \"s/^CUA_DRIVER_RS_BAKED_VERSION=.*/CUA_DRIVER_RS_BAKED_VERSION=\"${VERSION}\"/" \libs/cua-driver/scripts/_install-rust.sh@@ -442,24 +441,21 @@ jobs:# what gets copied here, so the per-tag release assets carry the# current version's baked default — not the previous version's.# Both user-facing installers live under libs/cua-driver/scripts/:- # install.sh is the Swift driver's installer that- # auto-delegates to the Rust _install-rust.sh helper on- # --experimental-rust / non-macOS hosts. install.ps1 is the- # canonical Windows installer (Rust port; Swift has no- # Windows build). The Rust install logic itself lives at- # _install-rust.sh — published as a release asset alongside- # the installers so curl|bash flows can fetch it.+ # install.sh is the canonical macOS/Linux installer and delegates+ # to the Rust _install-rust.sh helper by default. install.ps1 is+ # the canonical Windows installer. The Rust install logic itself+ # lives at _install-rust.sh — published as a release asset+ # alongside the installers so curl|bash flows can fetch it.cp libs/cua-driver/scripts/install.sh release-upload/install.shcp libs/cua-driver/scripts/install.ps1 release-upload/install.ps1cp libs/cua-driver/scripts/_install-rust.sh release-upload/_install-rust.sh# Uninstaller scripts — single canonical file per shell (no- # `_uninstall-rust.sh` helper). uninstall.sh handles both Swift- # (macOS default) and Rust (Linux auto-select, macOS opt-in via- # --experimental-rust / --backend=rust) inline. uninstall.ps1- # is the Windows uninstaller (cua-driver-rs only — no Swift- # Windows build) and self-elevates via UAC when an -AutoStart- # install (RunLevel=Highest task) needs to be torn down.+ # `_uninstall-rust.sh` helper). uninstall.sh handles Rust by+ # default and keeps an explicit --backend=swift legacy path for+ # retired macOS installs. uninstall.ps1 is the Windows uninstaller+ # and self-elevates via UAC when an -AutoStart install+ # (RunLevel=Highest task) needs to be torn down.cp libs/cua-driver/scripts/uninstall.sh release-upload/uninstall.shcp libs/cua-driver/scripts/uninstall.ps1 release-upload/uninstall.ps1@@ -529,43 +525,33 @@ jobs:uses: softprops/action-gh-release@v2with:files: release-upload/*- # The `prerelease: true` flag + the explicit BETA banner make it- # clear to anyone landing on the release page that cua-driver-rs- # is the cross-platform Rust port of the Swift cua-driver and is- # still in BETA — the Swift cua-driver remains the production- # macOS binary.prerelease: truebody: |- > ⚠️ **BETA — cua-driver-rs**+ > **cua-driver-rs**>- > `cua-driver-rs` is the **cross-platform Rust port** of the original Swift+ > `cua-driver-rs` is the Rust implementation of> [`cua-driver`](https://github.com/trycua/cua/tree/main/libs/cua-driver),- > introducing **Windows and Linux support** to the cua-driver tool surface.- >- > - **Windows** and **Linux**: feature-complete, recommended for testing /- > integration work.- > - **macOS**: parity with the Swift cua-driver is in progress; for production- > macOS automation prefer the Swift binary- > (`cua-driver-v*` releases, installed via the Swift `install.sh`).+ > shipping the same user-facing `cua-driver` binary for macOS and+ > Windows, plus Linux pre-release artifacts for early testing.>> The Rust port and the Swift driver publish to the same GitHub repo under> **distinct tag prefixes** (`cua-driver-rs-v*` vs `cua-driver-v*`), so their- > installers do not collide.+ > release artifacts do not collide.${{ steps.notes.outputs.RELEASE_NOTES }}${{ steps.checksums.outputs.checksums }}- ### Install (Linux / macOS)+ ### Install (macOS / Linux pre-release)```bash/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"```- On macOS the installer defaults to the Swift driver; pass- `--experimental-rust` to get the cua-driver-rs Rust port.- On Linux it auto-detects the non-macOS host and installs- the Rust port directly.+ The shell installer covers macOS and the Linux pre-release backend+ and installs the Rust implementation by default. Linux artifacts are+ published for early testing and are not yet an official supported+ release tier.### Install (Windows)@@ -585,7 +571,7 @@ jobs:- `cua-driver-rs-${{ steps.version.outputs.version }}-darwin-x86_64.tar.gz` — same payload, named for x86_64 callers- `cua-driver-rs-${{ steps.version.outputs.version }}-darwin-universal-binary.tar.gz` — bare universal binary (single file at archive root; **no** .app — bypasses the TCC auto-relaunch path)- **Linux**+ **Linux pre-release**- `cua-driver-rs-${{ steps.version.outputs.version }}-linux-x86_64.tar.gz` — directory tarball- `cua-driver-rs-${{ steps.version.outputs.version }}-linux-x86_64-binary.tar.gz` — bare binary@@ -596,9 +582,9 @@ jobs:- `cua-driver-rs-${{ steps.version.outputs.version }}-windows-arm64-binary.zip` — bare `cua-driver.exe` (Windows on ARM)**Installer scripts**- - `install.sh` — Linux / macOS one-liner installer+ - `install.sh` — macOS / Linux pre-release one-liner installer- `install.ps1` — Windows one-liner installer- - `uninstall.sh` — Linux / macOS one-liner uninstaller (mirrors the install flag set: Swift by default; `--experimental-rust` for the Rust port; non-macOS auto-detects)+ - `uninstall.sh` — macOS / Linux pre-release one-liner uninstaller- `uninstall.ps1` — Windows one-liner uninstallergenerate_release_notes: falsemake_latest: false@@ -651,7 +637,7 @@ jobs:# (`sed -i ''`).# Rust install logic lives at libs/cua-driver/scripts/_install-rust.sh# (private helper invoked by the canonical libs/cua-driver/scripts/install.sh- # on --backend=rust / non-macOS auto-detect).+ # by default).sed -i \"s/^CUA_DRIVER_RS_BAKED_VERSION=.*/CUA_DRIVER_RS_BAKED_VERSION=\"${VERSION}\"/" \libs/cua-driver/scripts/_install-rust.shdiff --git a/.github/workflows/ci-check-docs.yml b/.github/workflows/ci-check-docs.ymlindex b7b78a27e6..15c1301164 100644--- a/.github/workflows/ci-check-docs.yml+++ b/.github/workflows/ci-check-docs.yml@@ -3,8 +3,10 @@ name: "CI: Check Docs"on:pull_request:paths:- # Cua Driver (Swift)- - "libs/cua-driver/Sources/**"+ # Cua Driver (Rust)+ - "libs/cua-driver/rust/crates/**"+ - "libs/cua-driver/rust/Cargo.toml"+ - "libs/cua-driver/rust/Cargo.lock"# Lume (Swift)- "libs/lume/src/**"# Cua CLI (TypeScript)@@ -69,7 +71,7 @@ jobs:GENERATORS=""# Source changes- if echo "$CHANGED_FILES" | grep -q "^libs/cua-driver/Sources/\|^docs/content/docs/cua-driver/reference/"; then+ if echo "$CHANGED_FILES" | grep -q "^libs/cua-driver/rust/crates/\|^libs/cua-driver/rust/Cargo.toml\|^libs/cua-driver/rust/Cargo.lock\|^docs/content/docs/cua-driver/reference/"; thenGENERATORS="$GENERATORS cua-driver"fiif echo "$CHANGED_FILES" | grep -q "^libs/lume/src/"; then@@ -115,8 +117,8 @@ jobs:- name: Build cua-driver (if needed)if: contains(steps.changed.outputs.generators, 'cua-driver') || steps.changed.outputs.generators == 'all'- run: swift build --configuration release- working-directory: libs/cua-driver+ run: cargo build -p cua-driver --release+ working-directory: libs/cua-driver/rust- name: Build Lume (if needed)if: contains(steps.changed.outputs.generators, 'lume') || steps.changed.outputs.generators == 'all'diff --git a/.github/workflows/ci-swift-cua-driver.yml b/.github/workflows/ci-swift-cua-driver.ymlindex 7469b812e0..5243f0b159 100644--- a/.github/workflows/ci-swift-cua-driver.yml+++ b/.github/workflows/ci-swift-cua-driver.yml@@ -20,7 +20,7 @@ jobs:- run: uname -a- run: sudo xcode-select -s /Applications/Xcode_16.3.app # Swift 6.1- run: swift test- working-directory: ./libs/cua-driver+ working-directory: ./libs/cua-driver/swiftbuild:name: Release buildruns-on: macos-15@@ -29,4 +29,4 @@ jobs:- run: uname -a- run: sudo xcode-select -s /Applications/Xcode_16.3.app # Swift 6.1- run: swift build --configuration release- working-directory: ./libs/cua-driver+ working-directory: ./libs/cua-driver/swiftdiff --git a/README.md b/README.mdindex 7a0cf5963c..3dfe9a86d0 100644--- a/README.md+++ b/README.md@@ -26,7 +26,7 @@<table><tr><td colspan="3" align="center">- <a href="#cua-driver---background-computer-use-on-macos">+ <a href="#cua-driver---background-computer-use-on-macos-and-windows-with-linux-pre-release"><img src="img/card-cua-driver.png" alt="Cua Driver — The background computer-use agent" width="888"></a></td>@@ -53,17 +53,23 @@----## Cua Driver - Background computer-use on macOS+## Cua Driver - Background computer-use on macOS and Windows, with Linux pre-release-Drive any native macOS app **in the background** — agents click, type, and verify without stealing the cursor, focus, or Space, even on non-AX surfaces like Chromium web content and canvas-based tools (Blender, Figma, DAWs, game engines). Use with the CLI or MCP server for Claude Code, Cursor, and custom clients. Every session records as a replayable trajectory.+Drive native desktop apps **in the background** — agents click, type, and verify without stealing the cursor or focus. Use the same CLI and MCP server on macOS and Windows from Claude Code, Cursor, Codex, OpenClaw, and custom clients. Linux support is available as a pre-release backend while platform testing is still in progress.++**macOS / Linux pre-release**```sh/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"```-> Want to try the cross-platform Rust port early? Add `-- --experimental-rust` to the line above — it delegates to the [`cua-driver-rs`](libs/cua-driver/rust/) installer (separate bundle, coexists with the Swift binary).+**Windows (PowerShell)**++```powershell+irm https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.ps1 | iex+```-Full tool reference, architecture notes, and the Claude Code skill ship with the package: [`libs/cua-driver/README.md`](libs/cua-driver/README.md).+Full tool reference, architecture notes, and the optional agent skill pack live here: [`libs/cua-driver/README.md`](libs/cua-driver/README.md).---diff --git a/docs/content/docs/cua-driver/guide/getting-started/autostart.mdx b/docs/content/docs/cua-driver/guide/getting-started/autostart.mdxindex 44a2ea0023..a2fd7c9617 100644--- a/docs/content/docs/cua-driver/guide/getting-started/autostart.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/autostart.mdx@@ -1,11 +1,11 @@---title: Autostart-description: Keep cua-driver's daemon running in the user's interactive session across logons, RDP disconnects, and reboots.+description: Keep Cua Driver's daemon running in the user's interactive session across logons, RDP disconnects, and reboots.---import { Callout } from 'fumadocs-ui/components/callout';-`cua-driver autostart` registers the platform-native "run at logon" mechanism that keeps a `cua-driver serve` daemon alive in the user's interactive session. On Windows this is the difference between GUI tools that work over SSH and GUI tools that return empty arrays — see [Running cua-driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) for the full reasoning.+`cua-driver autostart` registers the platform-native "run at logon" mechanism that keeps a `cua-driver serve` daemon alive in the user's interactive session. On Windows this is the difference between GUI tools that work over SSH and GUI tools that return empty arrays — see [Running Cua Driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) for the full reasoning.```bashcua-driver autostart enable # register the platform entry@@ -16,14 +16,17 @@ cua-driver autostart disable # remove the entry## What it does per platform-| Platform | Mechanism | Where it lives |-|---|---|---|-| Windows | Scheduled Task `cua-driver-serve` with `LogonType: Interactive` | Task Scheduler (`schtasks /Query /TN cua-driver-serve`) |-| macOS | Not yet implemented in the Rust port — use the manual `LaunchAgent` recipe ([`scripts/install-local.sh --autostart`](https://github.com/trycua/cua/blob/main/libs/cua-driver/scripts/install-local.sh)) | `~/Library/LaunchAgents/com.trycua.cua-driver-rs.plist` |-| Linux | Not yet implemented in the Rust port — use the manual `systemd --user` unit ([`scripts/install-local.sh --autostart`](https://github.com/trycua/cua/blob/main/libs/cua-driver/scripts/install-local.sh)) | `~/.config/systemd/user/cua-driver-rs.service` |+| Platform | Mechanism | Where it lives |+| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |+| Windows | Scheduled Task `cua-driver-serve` with `LogonType: Interactive` | Task Scheduler (`schtasks /Query /TN cua-driver-serve`) |+| macOS | Not yet implemented in the Rust port — use the manual `LaunchAgent` recipe ([`scripts/install-local.sh --autostart`](https://github.com/trycua/cua/blob/main/libs/cua-driver/scripts/install-local.sh)) | `~/Library/LaunchAgents/com.trycua.cua-driver-rs.plist` |+| Linux | Not yet implemented in the Rust port — use the manual `systemd --user` unit ([`scripts/install-local.sh --autostart`](https://github.com/trycua/cua/blob/main/libs/cua-driver/scripts/install-local.sh)) | `~/.config/systemd/user/cua-driver-rs.service` |<Callout type="info">-**Platform parity status.** `cua-driver autostart` is currently a Windows-only verb in the Rust port — the macOS / Linux cases return an error pointing at the manual recipe. A cross-platform native impl is tracked as a follow-up. The verb is documented as the cross-platform interface so existing scripts and skill-pack instructions land in the right place once parity ships.+ **Platform parity status.** `cua-driver autostart` is currently a Windows-only verb in the Rust+ port — the macOS / Linux cases return an error pointing at the manual recipe. A cross-platform+ native impl is tracked as a follow-up. The verb is documented as the cross-platform interface so+ existing scripts and skill-pack instructions land in the right place once parity ships.</Callout>## The four verbs@@ -73,22 +76,22 @@ cua-driver autostart disable## Worked example: `enable && kick` from an interactive shell-The canonical first-time recipe — run this once from an interactive shell (RDP, local console, Windows Terminal under your logged-in user) and the daemon is up immediately *and* will come back after every logon:+The canonical first-time recipe — run this once from an interactive shell (RDP, local console, Windows Terminal under your logged-in user) and the daemon is up immediately _and_ will come back after every logon:```powershellcua-driver autostart enablecua-driver autostart kickcua-driver status-# cua-driver daemon is running+# Cua Driver daemon is running# socket: \\.\pipe\cua-driver# pid: 12345```-After this, you can SSH into the box and `cua-driver mcp` / `cua-driver call <tool>` will proxy through the running daemon — see [Running cua-driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh).+After this, you can SSH into the box and `cua-driver mcp` / `cua-driver call <tool>` will proxy through the running daemon — see [Running Cua Driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh).## The "daemon survives RDP disconnect" property-Scheduled Tasks registered with `LogonType: Interactive` are *session-attached* — the task and any processes it spawned live and die with the interactive session, not with the RDP client window. Disconnecting the RDP client leaves the session in `Disc` (disconnected) state, which is still a live interactive session as far as Windows is concerned:+Scheduled Tasks registered with `LogonType: Interactive` are _session-attached_ — the task and any processes it spawned live and die with the interactive session, not with the RDP client window. Disconnecting the RDP client leaves the session in `Disc` (disconnected) state, which is still a live interactive session as far as Windows is concerned:```powershellquery session@@ -102,7 +105,11 @@ The daemon keeps running in session `2`. A subsequent SSH connection (which landThe session only dies on explicit logoff (`logoff` / Start menu → Sign out) or reboot. On reboot, the next interactive logon re-triggers the Scheduled Task and a fresh daemon comes back up.<Callout type="info">-**Prerequisite — an active interactive session must exist.** `kick` runs the task in *some* session, but Task Scheduler only triggers it when an interactive logon is present. If you've never logged in via RDP / console on a fresh box, `kick` has nowhere to land the daemon. The fix is to RDP in once (the logon trigger fires `serve` automatically) — after that, even an RDP-disconnect keeps the session alive in `Disc` state and the daemon along with it.+ **Prerequisite — an active interactive session must exist.** `kick` runs the task in *some*+ session, but Task Scheduler only triggers it when an interactive logon is present. If you've never+ logged in via RDP / console on a fresh box, `kick` has nowhere to land the daemon. The fix is to+ RDP in once (the logon trigger fires `serve` automatically) — after that, even an RDP-disconnect+ keeps the session alive in `Disc` state and the daemon along with it.</Callout>## UWP automation and the uiAccess worker (Windows)@@ -115,10 +122,10 @@ cua-driver-rs satisfies these constraints with a **second sibling binary**, `cua### How it works at runtime-| Component | Integrity | Pipe |-|---|---|---|-| `cua-driver.exe serve` | Medium | `\\.\pipe\cua-driver` |-| `cua-driver-uia.exe` (auto-spawned by `serve`) | UIAccess | `\\.\pipe\cua-driver-uia` |+| Component | Integrity | Pipe |+| ---------------------------------------------- | --------- | ------------------------- |+| `cua-driver.exe serve` | Medium | `\\.\pipe\cua-driver` |+| `cua-driver-uia.exe` (auto-spawned by `serve`) | UIAccess | `\\.\pipe\cua-driver-uia` |When `cua-driver serve` starts, it checks for `cua-driver-uia.exe` next to its own binary and `ShellExecute`s it as a child. The OS elevates the child to UIAccess integrity (provided the signing + secure-location requirements are met) and the child binds the second pipe. `cua-driver call ...` and `cua-driver mcp` both prefer `\\.\pipe\cua-driver-uia` over the main daemon pipe when both are listening — tool calls land in the uiAccess process, UIPI doesn't block them.@@ -143,12 +150,21 @@ Some apps (Calculator, Settings, older UWPs) host their top-level window as a `W- Cross-session injection (the worker still has to live in the same interactive session as the target app)<Callout type="warn">-**Signing prerequisite.** `uiAccess` apps must be Authenticode-signed by a cert trusted on the machine — Microsoft does not honor the manifest otherwise. Until the production CD pipeline ships a signed `cua-driver-uia.exe` ([GH #1602](https://github.com/trycua/cua/issues/1602)), the worker fails to elevate on default-policy machines, and UWP automation falls back to the Medium-integrity behavior (UIPI blocking). The main CLI / MCP daemon is unaffected — only the worker depends on the signature. Until then, the daemon logs `uia spawn failed` to stderr and proceeds without it.+ **Signing prerequisite.** `uiAccess` apps must be Authenticode-signed by a cert trusted on the+ machine — Microsoft does not honor the manifest otherwise. Until the production CD pipeline ships+ a signed `cua-driver-uia.exe` ([GH #1602](https://github.com/trycua/cua/issues/1602)), the worker+ fails to elevate on default-policy machines, and UWP automation falls back to the Medium-integrity+ behavior (UIPI blocking). The main CLI / MCP daemon is unaffected — only the worker depends on the+ signature. Until then, the daemon logs `uia spawn failed` to stderr and proceeds without it.</Callout>## Why not just `cua-driver serve &` over SSH?-A `cua-driver serve &` spawned over SSH inherits the SSH session — Session 0 on Windows OpenSSH — which has no interactive desktop, so every GUI tool returns empty. `autostart enable && kick` runs the daemon under the user's interactive logon (Session 1+) instead, so it has a real desktop attached. [Running cua-driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) has the full reasoning and the end-to-end workflow.+A naively-spawned `cua-driver serve &` over SSH inherits the SSH session — which on Windows OpenSSH is **Session 0**, the non-interactive services session. The daemon comes up, but every GUI tool it answers (`list_windows`, `click`, `screenshot`, ...) bottoms out in Win32 APIs scoped to the calling session's WindowStation + Desktop, which Session 0 doesn't have. Tools silently return empty arrays.++`autostart enable && kick` sidesteps this by running the daemon under the user's interactive logon (Session 1+) instead of inheriting whatever session called `serve`. The daemon then has a real desktop attached and GUI tools work.++See [Running Cua Driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) for the end-to-end SSH workflow.## Uninstall behaviourdiff --git a/docs/content/docs/cua-driver/guide/getting-started/comparison.mdx b/docs/content/docs/cua-driver/guide/getting-started/comparison.mdxindex 0da2ee5b0d..06238cef0b 100644--- a/docs/content/docs/cua-driver/guide/getting-started/comparison.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/comparison.mdx@@ -5,7 +5,7 @@ description: How Cua Driver compares to other computer-use toolsimport { Callout } from 'fumadocs-ui/components/callout';-This page compares Cua Driver with other computer-use tools. The best choice depends on your workload. (Several of the alternatives below are macOS-specific; Cua Driver itself runs on macOS, Windows, and Linux.)+This page compares Cua Driver with other computer-use tools. The best choice depends on your workload. Several of the alternatives below are macOS-specific; Cua Driver runs on macOS and Windows, with Linux available as a pre-release backend.## Quick comparisondiff --git a/docs/content/docs/cua-driver/guide/getting-started/installation.mdx b/docs/content/docs/cua-driver/guide/getting-started/installation.mdxindex e73df49099..b94a3bbac5 100644--- a/docs/content/docs/cua-driver/guide/getting-started/installation.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/installation.mdx@@ -1,95 +1,64 @@---title: Installation-description: Install Cua Driver on your Mac+description: Install Cua Driver on macOS, Windows, or the Linux pre-release backend---import { Callout } from 'fumadocs-ui/components/callout';-Install Cua Driver with a single command:+Install Cua Driver with the command for your platform. macOS and Windows are the official install targets; Linux is available as a pre-release backend while platform testing is still in progress.-```bash-/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"-```+| Platform | Command |+| ----------------- | ------------------------------------------------------------------------------------------------------------------- |+| macOS | `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"` |+| Linux pre-release | `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"` |+| Windows | `irm https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.ps1 \| iex` |-The installer drops `CuaDriver.app` into `/Applications` and symlinks the binary at `~/.local/bin/cua-driver`. The bundle is signed under `com.trycua.driver`, so TCC grants survive every release.--The install runs **without sudo**: `/Applications` is user-writable on personal Macs, and the CLI symlink lives under `$HOME`. If `~/.local/bin` is not on your PATH, the installer detects your shell (`zsh` / `bash` / `fish`) and appends an `export PATH=...` line to the right rc file. Reload with `source ~/.zshrc` (or restart your terminal).--<Callout type="info">-**Power users:** override the install path with `--bin-dir` (or `CUA_DRIVER_BIN_DIR`). Use `--no-modify-path` if you'd rather edit your shell rc yourself.+**macOS / Linux pre-release**```bash-/bin/bash -c "$(curl -fsSL .../install.sh)" -- --bin-dir=/usr/local/bin # legacy system path (needs sudo)-/bin/bash -c "$(curl -fsSL .../install.sh)" -- --no-modify-path # don't touch shell rc+/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"```-</Callout>-<Callout type="warn">-**Upgrading from v0.0.x?** The new installer puts the CLI at `~/.local/bin/cua-driver`. Any existing `/usr/local/bin/cua-driver` symlink is left in place so existing MCP client configs (Claude Code, Codex, etc.) keep working. Re-register them at your leisure to use the new path.-</Callout>--### Try the Rust backend (experimental)--<Callout type="info">-**`cua-driver-rs` is a cross-platform Rust port of Cua Driver** — same MCP tool surface, with native Windows and Linux support and macOS parity in progress. Opt in with a single flag to help us soak-test it ahead of GA:+**Windows (PowerShell)**-```bash-/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)" -- --experimental-rust+```powershell+irm https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.ps1 | iex```-(Equivalent long form: `--backend=rust`.)--The flag delegates to [`libs/cua-driver/scripts/_install-rust.sh`](https://github.com/trycua/cua/blob/main/libs/cua-driver/scripts/_install-rust.sh) (a private helper colocated with the canonical `install.sh`), which:--- Installs `CuaDriver.app` to `/Applications/` with bundle id `com.trycua.driver` — the same bundle id the Swift driver uses. If `/Applications/CuaDriver.app` already holds the Swift bundle, the installer replaces it in place. macOS TCC keys grants on bundle id, so the user's prior Accessibility / Screen Recording grants survive the upgrade and apply to the new binary; a one-time re-grant prompt may fire on first action because the cdhash differs.-- Points `~/.local/bin/cua-driver` at the Rust binary.-- Same `--bin-dir` / `--no-modify-path` flags as the Swift installer — anything you put after `--experimental-rust` is forwarded to the Rust installer verbatim.+On macOS, the installer drops `CuaDriver.app` into `/Applications` and symlinks the binary at `~/.local/bin/cua-driver`. The bundle is signed under `com.trycua.driver`, so TCC grants survive every release.-**Switch back to Swift:** the Swift driver still ships under its own release-tag prefix (`cua-driver-v*`). Re-run the canonical install script without `--experimental-rust` and it'll fetch the latest Swift release and replace the `.app` at `/Applications/CuaDriver.app` the same way (TCC grants survive, since bundle id is shared).+On Linux, the pre-release backend installer downloads the release into `~/.cua-driver-rs/packages/releases/`, retargets `~/.cua-driver-rs/packages/current`, and symlinks `~/.local/bin/cua-driver`.-```bash-/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"-```+<Callout type="warn">+ **Linux is pre-release.** Linux artifacts and install paths are published for early testing, but+ Linux has not completed the same official release and platform validation pass as macOS and+ Windows. Expect gaps, report issues, and avoid treating Linux as a supported production target+ until it is promoted out of pre-release.</Callout>-### Install `cua-driver-rs` directly (Linux / Windows / macOS)+On Windows, the installer downloads the release into `%USERPROFILE%\.cua-driver\packages\releases\`, retargets the `current` junction, and exposes `cua-driver.exe` through `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin`.-Both canonical installers live under `libs/cua-driver/scripts/`. On macOS the `.sh` installer defaults to the Swift driver; pass `--experimental-rust` to get the Rust port. On Linux it auto-detects the non-macOS host and installs the Rust port directly.+The install runs **without sudo/admin**. On macOS and Linux the CLI symlink lives under `$HOME`; on Windows the script updates the User-scope `Path`. If `~/.local/bin` is not on your PATH, the shell installer detects your shell (`zsh` / `bash` / `fish`) and appends an `export PATH=...` line to the right rc file. Reload with `source ~/.zshrc` (or restart your terminal).-**Linux**+<Callout type="info">+**Power users:** override the install path with `--bin-dir` (or `CUA_DRIVER_RS_INSTALL_DIR`). Use `--no-modify-path` if you'd rather edit your shell rc yourself.```bash-/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"+/bin/bash -c "$(curl -fsSL .../install.sh)" -- --bin-dir=/usr/local/bin # legacy system path (needs sudo)+/bin/bash -c "$(curl -fsSL .../install.sh)" -- --no-modify-path # don't touch shell rc```-**Windows (PowerShell)**--```powershell-irm https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.ps1 | iex-```+</Callout><Callout type="warn">- **If `install.ps1` fails to parse on stock Windows PowerShell 5.1** (the version shipped with Windows 10 / Server 2019 / Server 2025; see [#1626](https://github.com/trycua/cua/issues/1626)), fall back to a manual zip install:-- ```powershell- $version = "0.3.2"- $arch = if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq 'Arm64') { 'arm64' } else { 'x86_64' }- $url = "https://github.com/trycua/cua/releases/download/cua-driver-rs-v$version/cua-driver-rs-$version-windows-$arch-binary.zip"- iwr $url -OutFile $env:TEMP\cua.zip -UseBasicParsing- $dest = "$env:LOCALAPPDATA\Programs\Cua\cua-driver\bin"- New-Item -ItemType Directory -Force -Path $dest | Out-Null- Expand-Archive -Force -Path $env:TEMP\cua.zip -DestinationPath $dest- # Idempotent User PATH update — only add $dest if not already present.- $userPath = [Environment]::GetEnvironmentVariable('Path', 'User')- $parts = @($userPath -split ';' | Where-Object { $_ -ne '' })- if ($parts -notcontains $dest) {- [Environment]::SetEnvironmentVariable('Path', "$dest;$userPath", 'User')- }- ```-- PowerShell 7+ (`pwsh`) parses `install.ps1` correctly, so the one-liner works there.+ **Upgrading from the retired Swift driver?** The Rust implementation uses the same+ `/Applications/CuaDriver.app` bundle id (`com.trycua.driver`). Existing Accessibility / Screen+ Recording grants usually transfer; macOS may ask for a one-time re-grant because the binary cdhash+ changed.</Callout>+Both canonical installers live under `libs/cua-driver/scripts/`. The shell installer covers macOS and the Linux pre-release backend; `install.ps1` covers Windows.+The Windows installer auto-detects host architecture (x64 / arm64) via `[System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture` and downloads the matching `cua-driver-rs-<v>-windows-{x86_64,arm64}.zip` from GitHub Releases.It runs **without admin** and **without Developer Mode**.@@ -168,13 +137,13 @@ Clear `$env:CUA_DRIVER_RS_VERSION` and re-run to roll forward to the newest rele#### Env-var overrides-| Env var | Default (Linux/macOS) | Default (Windows) | What it controls |-|---|---|---|---|-| `CUA_DRIVER_RS_VERSION` | unset → use baked version | unset → use baked version | Pin a specific release (e.g. `0.2.0`). |-| `CUA_DRIVER_RS_INSTALL_DIR` | `~/.local/bin` | `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin` | The visible PATH-entry directory. On Windows this is itself a junction. |-| `CUA_DRIVER_RS_HOME` | `~/.cua-driver-rs` | `%USERPROFILE%\.cua-driver` | Package home — holds `packages/releases/<v>/` and `packages/current`. |-| `CUA_DRIVER_RS_NO_MODIFY_PATH` *(Linux/macOS only)* | `0` | use `-NoPathUpdate` switch on `install.ps1` | Skip the PATH append. On Windows the installer appends `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin` to the User-scope `Path` by default; use the fetch+invoke form with `-NoPathUpdate` to opt out (see the Windows install section above for the exact one-liner). |-| `CUA_DRIVER_RS_KEEP_VERSIONS` *(Linux/Windows only)* | `5` | `5` | Keep the N most recent per-version release dirs after install (`0` disables GC). See the **Old-version cleanup** callout below for per-target and active-install invariants. |+| Env var | Default (Linux/macOS) | Default (Windows) | What it controls |+| ---------------------------------------------------- | ------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `CUA_DRIVER_RS_VERSION` | unset → use baked version | unset → use baked version | Pin a specific release (e.g. `0.2.0`). |+| `CUA_DRIVER_RS_INSTALL_DIR` | `~/.local/bin` | `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin` | The visible PATH-entry directory. On Windows this is itself a junction. |+| `CUA_DRIVER_RS_HOME` | `~/.cua-driver-rs` | `%USERPROFILE%\.cua-driver` | Package home — holds `packages/releases/<v>/` and `packages/current`. |+| `CUA_DRIVER_RS_NO_MODIFY_PATH` _(Linux/macOS only)_ | `0` | use `-NoPathUpdate` switch on `install.ps1` | Skip the PATH append. On Windows the installer appends `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin` to the User-scope `Path` by default; use the fetch+invoke form with `-NoPathUpdate` to opt out (see the Windows install section above for the exact one-liner). |+| `CUA_DRIVER_RS_KEEP_VERSIONS` _(Linux/Windows only)_ | `5` | `5` | Keep the N most recent per-version release dirs after install (`0` disables GC). See the **Old-version cleanup** callout below for per-target and active-install invariants. |<Callout type="info">**How the installer picks a version.** Resolution order is:@@ -184,6 +153,7 @@ Clear `$env:CUA_DRIVER_RS_VERSION` and re-run to roll forward to the newest rele3. GitHub Releases API — fallback only, hit when the env override is absent **and** the baked line hasn't been updated yet (e.g. installing from a dev branch before its first release).So an API outage, an unauthenticated-rate-limit (60 req/hr per IP), or a transient network blip never breaks a default install from `main`. Power users who want the very latest tip (rather than the baked default) can set `CUA_DRIVER_RS_VERSION=<x.y.z>` explicitly.+</Callout><Callout type="info">@@ -205,6 +175,7 @@ Two invariants worth knowing:- **Per-target filtering** — a multi-arch dev with both `aarch64-apple-darwin` and `x86_64-unknown-linux-gnu` directories under the same `$CUA_DRIVER_RS_HOME` (rare, but possible with shared/NFS homes) gets each target's history GC'd independently of the other.The macOS install path is unaffected — `/Applications/CuaDriver.app` is an in-place replacement with no per-version accumulation.+</Callout><Callout type="info">@@ -225,7 +196,7 @@ cat ~/.cua-driver-rs/packages/.install.lock.d/info``````powershell-Get-Content $env:USERPROFILE\.cua-driver\install.lock+Get-Content $env:CUA_DRIVER_RS_HOME\install.lock# pid=43210# started=2026-05-17T09:14:22.123Z# invocation=install.ps1 -Release latest@@ -235,29 +206,30 @@ Get-Content $env:USERPROFILE\.cua-driver\install.lockLock locations:-| Platform | Lock |-|---|---|-| Linux | `$CUA_DRIVER_RS_HOME/packages/.install.lock.d/` (mkdir-based mutex) |-| Windows | `$env:CUA_DRIVER_RS_HOME\install.lock` (`FileShare::None` mutex) |+| Platform | Lock |+| -------- | ------------------------------------------------------------------- |+| Linux | `$CUA_DRIVER_RS_HOME/packages/.install.lock.d/` (mkdir-based mutex) |+| Windows | `$env:CUA_DRIVER_RS_HOME\install.lock` (`FileShare::None` mutex) |Both primitives are unprivileged — no sudo, no admin elevation, no Developer Mode. The lock is released on every script exit path (success, error, Ctrl-C, `exit`).+</Callout>### Verify it worked```bashcua-driver --version-# cua-driver 0.3.2+# cua-driver 0.1.0cua-driver --help-# cua-driver 0.3.2 — cross-platform computer-use automation driver+# OVERVIEW: macOS Accessibility-driven computer-use agent — MCP stdio server.```For a structured environment + install report on any platform, run:```bashcua-driver doctor-# [ok ] binary: cua-driver 0.3.2 (aarch64-macos)+# [ok ] binary: cua-driver 0.2.1 (aarch64-macos)# [ok ] install dir: /Users/you/.local/bin/cua-driver# [ok ] home dir: /Users/you/.cua-driver-rs (3 release dirs cached)# [ok ] telemetry: enabled (install-id present)@@ -272,7 +244,7 @@ Window-driving tools — `list_windows`, `click`, `type_text`, `screenshot`, `ge**Windows session model in one paragraph.** Every Windows process runs inside a numbered session. Session `0` is reserved for services and has no interactive desktop attached. Sessions `1`, `2`, ... are interactive logons — one per console / RDP user. SSH-launched processes (OpenSSH server) **default to Session 0** unless the SSH server is explicitly configured to spawn the shell inside the interactive session. The same applies to most Windows service hosts, scheduled tasks running under SYSTEM, and background invocations from CI agents.-If `cua-driver` lands in Session 0, the window tools will silently return empty arrays and "no windows found" — that's the APIs working as designed against a session with no desktop, not a cua-driver bug.+If `cua-driver` lands in Session 0, the window tools will silently return empty arrays and "no windows found" — that's the APIs working as designed against a session with no desktop, not a Cua Driver bug.**Diagnose with `cua-driver doctor`.** The Windows session probe surfaces this directly:@@ -297,8 +269,8 @@ A healthy interactive logon reports the inverse:- **Run from RDP or the local console** — the simplest fix; both put your shell in your own interactive session, not Session 0.- **Run from a Windows Terminal / PowerShell launched by your logged-in user** — same effect.- **Register a logon Scheduled Task** (recommended, equivalent to macOS LaunchAgent) — see [Auto-start at logon](#auto-start-at-logon-windows) below, or the [Autostart concept page](/cua-driver/guide/getting-started/autostart) for the `cua-driver autostart enable` one-liner.-- **Driving over SSH?** Register the autostart task once from an interactive session, then `cua-driver mcp` and `cua-driver call` over SSH proxy through the running daemon automatically. See [Running cua-driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) for the full workflow.-- **Use a session-launcher utility** — if you must invoke from a service / SSH context *without* the daemon-proxy path, run the binary through a launcher that spawns it inside an explicit interactive session id rather than inheriting Session 0.+- **Driving over SSH?** Register the autostart task once from an interactive session, then `cua-driver mcp` and `cua-driver call` over SSH proxy through the running daemon automatically. See [Running Cua Driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) for the full workflow.+- **Use a session-launcher utility** — if you must invoke from a service / SSH context _without_ the daemon-proxy path, run the binary through a launcher that spawns it inside an explicit interactive session id rather than inheriting Session 0.Run `cua-driver doctor` after switching contexts to confirm the warning has cleared.@@ -307,7 +279,12 @@ Run `cua-driver doctor` after switching contexts to confirm the warning has cleaThe Windows-native equivalent of macOS's LaunchAgent is a **Scheduled Task triggered at logon, running as your user, with `Run only when user is logged on`** (i.e. `LogonType: Interactive`). Once registered, `cua-driver serve` starts automatically every time you sign in via RDP or the console — no more pasting a startup one-liner.<Callout type="info">-**One-liner:** `cua-driver autostart enable && cua-driver autostart kick` does everything the manual block below does. See the [Autostart concept page](/cua-driver/guide/getting-started/autostart) for the full `enable / disable / kick / status` verb family, and [Running cua-driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) for the recommended headless workflow on top of it.+ **One-liner:** `cua-driver autostart enable && cua-driver autostart kick` does everything the+ manual block below does. See the [Autostart concept+ page](/cua-driver/guide/getting-started/autostart) for the full `enable / disable / kick / status`+ verb family, and [Running Cua Driver under SSH on+ Windows](/cua-driver/guide/getting-started/windows-ssh) for the recommended headless workflow on+ top of it.</Callout>`install.ps1` prints the exact one-shot registration block on a successful install. To register it manually (substitute your install path if you built from source):@@ -355,23 +332,23 @@ open -n -g -a CuaDriver --args serveThen trigger the prompts:```bash-cua-driver call check_permissions+cua-driver check_permissions```macOS raises the Accessibility and Screen Recording system dialogs. Grant both, then re-run the command to confirm:```bash-cua-driver call check_permissions+cua-driver check_permissions# ✅ Accessibility: granted.# ✅ Screen Recording: granted.```<Callout type="info">- `check_permissions` reports the TCC status of the *calling* process. Inside an IDE terminal (Claude- Code, Cursor, VS Code, Conductor) the shell inherits the IDE's TCC responsibility chain, so results- can read "NOT granted" even when you've granted both to `CuaDriver.app`. The daemon-first recipe- above sidesteps this because the CLI forwards through the daemon, which runs under- `CuaDriver.app`'s bundle id.+ `check_permissions` reports the TCC status of the *calling* process. Inside an IDE terminal+ (Claude Code, Cursor, VS Code, Conductor) the shell inherits the IDE's TCC responsibility chain,+ so results can read "NOT granted" even when you've granted both to `CuaDriver.app`. The+ daemon-first recipe above sidesteps this because the CLI forwards through the daemon, which runs+ under `CuaDriver.app`'s bundle id.</Callout>If a grant still reads `NOT granted` after granting in the dialog, open **System Settings → Privacy & Security**, find `CuaDriver.app` under Accessibility and Screen Recording, and flip the toggle.@@ -384,38 +361,39 @@ If a grant still reads `NOT granted` after granting in the dialog, open **Systemsecond until you grant the missing items. When both grants are alreadyactive the gate is a transparent no-op.- **Experimental native panel.** A `CuaDriver Permissions` NSPanel with- live status rows + auto-dismiss is also available behind an opt-in env- var. The terminal flow is the safer default because the panel relies on- a chain of macOS behaviours that are easy to break in dev environments- (TCC responsible-process attribution, session-level TCC caches that- survive `tccutil reset`, ad-hoc codesign identity mismatches, AppKit- modal-run-loop modes). Opt in with:-- ```bash- CUA_DRIVER_RS_PERMISSIONS_PANEL=1 cua-driver serve- ```-- Accepted "on" values (case-insensitive): `1`, `true`, `yes`, `on`. Any- other value (or unset) keeps the terminal flow. The panel also requires- the daemon to be launched from the bundled `.app` (e.g.- `open -n -g -a CuaDriver --args serve`); bare-binary launches always- use the terminal flow regardless of the env var.-- **CI / headless runners** should skip the entire gate so the daemon- does not block waiting for a TTY-attached human:-- ```bash- # As a flag …- cua-driver serve --no-permissions-gate-- # … or as an env-var.- CUA_DRIVER_RS_PERMISSIONS_GATE=0 cua-driver serve- ```-- Accepted "off" values for the gate env-var (case-insensitive): `0`,- `false`, `no`, `off` — so `FALSE`, `Off`, `NO` etc. all work. Any- other value (including unset) leaves the gate active.+**Experimental native panel.** A `CuaDriver Permissions` NSPanel with+live status rows + auto-dismiss is also available behind an opt-in env+var. The terminal flow is the safer default because the panel relies on+a chain of macOS behaviours that are easy to break in dev environments+(TCC responsible-process attribution, session-level TCC caches that+survive `tccutil reset`, ad-hoc codesign identity mismatches, AppKit+modal-run-loop modes). Opt in with:++```bash+CUA_DRIVER_RS_PERMISSIONS_PANEL=1 cua-driver serve+```++Accepted "on" values (case-insensitive): `1`, `true`, `yes`, `on`. Any+other value (or unset) keeps the terminal flow. The panel also requires+the daemon to be launched from the bundled `.app` (e.g.+`open -n -g -a CuaDriver --args serve`); bare-binary launches always+use the terminal flow regardless of the env var.++**CI / headless runners** should skip the entire gate so the daemon+does not block waiting for a TTY-attached human:++```bash+# As a flag …+cua-driver serve --no-permissions-gate++# … or as an env-var.+CUA_DRIVER_RS_PERMISSIONS_GATE=0 cua-driver serve+```++Accepted "off" values for the gate env-var (case-insensitive): `0`,+`false`, `no`, `off` — so `FALSE`, `Off`, `NO` etc. all work. Any+other value (including unset) leaves the gate active.+</Callout><Callout type="info">@@ -424,72 +402,97 @@ If a grant still reads `NOT granted` after granting in the dialog, open **Systemcheck against the GitHub releases API at startup and print a smalltwo-line banner to stderr when a newer `cua-driver-rs-v*` release exists:- ```- ✨ cua-driver v0.3.2 is available (you have v0.3.1).- Update with: cua-driver update- Release notes: https://github.com/trycua/cua/releases/tag/cua-driver-rs-v0.3.2- ```+```+✨ cua-driver v0.1.4 is available (you have v0.1.3).+ Update with: cua-driver update+ Release notes: https://github.com/trycua/cua/releases/tag/cua-driver-rs-v0.1.4+```++The answer is cached at `~/.cua-driver-rs/version_check.json` for ~20+hours, so subsequent launches reuse the cached result without a network+call. Network failures are silent — the next launch retries.- The answer is cached at `~/.cua-driver-rs/version_check.json` for ~20- hours, so subsequent launches reuse the cached result without a network- call. Network failures are silent — the next launch retries.+**Scripted / machine-readable entry points are NOT instrumented.**+The banner only fires from the long-running entry points (`mcp`,+`serve`, `doctor`). One-shot and machine-readable subcommands —+`--version`, `list-tools`, `describe`, `call`, `dump-docs`,+`mcp-config`, `update`, `stop`, `status`, `recording`, `config`,+`diagnose`, and `telemetry install-event` — all skip it so piped+output (`cua-driver list-tools | jq …`) stays clean.- **Scripted / machine-readable entry points are NOT instrumented.**- The banner only fires from the long-running entry points (`mcp`,- `serve`, `doctor`). One-shot and machine-readable subcommands —- `--version`, `list-tools`, `describe`, `call`, `dump-docs`,- `mcp-config`, `update`, `stop`, `status`, `recording`, `config`,- `diagnose`, and `telemetry install-event` — all skip it so piped- output (`cua-driver list-tools | jq …`) stays clean.+**Disable per-invocation:**- **Disable per-invocation:**+```bash+CUA_DRIVER_RS_UPDATE_CHECK=false cua-driver serve+```- ```bash- CUA_DRIVER_RS_UPDATE_CHECK=false cua-driver serve- ```+Accepted "off" values (case-insensitive): `0`, `false`, `no`, `off`.- Accepted "off" values (case-insensitive): `0`, `false`, `no`, `off`.+**Disable permanently** via the persisted config:- **Disable permanently** via the persisted config:+```bash+cua-driver config set update_check_enabled false+```- ```bash- cua-driver config set update_check_enabled false- ```+Source / dev builds (any `CARGO_PKG_VERSION` with a pre-release suffix+like `-dev`) auto-skip the check — there is no matching published+release for them to recommend.- Source / dev builds (any `CARGO_PKG_VERSION` with a pre-release suffix- like `-dev`) auto-skip the check — there is no matching published- release for them to recommend.</Callout>## Requirements-- macOS 14 (Sonoma) or later-- Apple Silicon (M1/M2/M3/M4) or Intel Mac (x86_64)-- 50 MB free disk space for the app bundle+| Platform | Requirements |+| ----------------- | ---------------------------------------------------------------------------------------------------------- |+| macOS | macOS 14 (Sonoma) or later; Apple Silicon or Intel; Accessibility and Screen Recording grants. |+| Linux pre-release | x86_64 Linux desktop session; X11 or XWayland; AT-SPI for accessibility-tree tools. |+| Windows | Windows 10/11 or Server with an interactive desktop session; PowerShell; UI Automation enabled by default. |++Plan for roughly 50 MB for the app bundle or package directory, plus any retained old versions on Linux / Windows.## Run the daemonMost workflows benefit from a persistent daemon. Element-indexed workflows require one: the per-pid element cache lives in-process, so one-shot CLI invocations lose it between calls.+**macOS**+```bash-# Start the daemon in the background.open -n -g -a CuaDriver --args serve+```-# Confirm it's up.+**Linux pre-release**++```bash+cua-driver serve &+```++**Windows**++```powershell+cua-driver autostart enable+cua-driver autostart kick+```++Confirm it is up:++```bashcua-driver status-# cua-driver daemon is running+# Cua Driver daemon is running# socket: /Users/you/Library/Caches/cua-driver/cua-driver.sock# pid: 12345+```++Stop it cleanly when done:-# Stop it cleanly when done.+```bashcua-driver stop```-`open -n -g -a CuaDriver --args serve` is the recommended form because LaunchServices attributes the process to `CuaDriver.app`'s bundle id, which is what the user actually granted TCC against. `cua-driver serve &` also works and auto-relaunches itself via `open` when it detects the wrong TCC context.+On macOS, `open -n -g -a CuaDriver --args serve` is the recommended form because LaunchServices attributes the process to `CuaDriver.app`'s bundle id, which is what the user actually granted TCC against. `cua-driver serve &` also works and auto-relaunches itself via `open` when it detects the wrong TCC context.## Register with an MCP client (optional)-The MCP server is one of two ways to use cua-driver — skip this section if you only want the CLI (`cua-driver call list_apps`, etc.). You can register both later, MCP and CLI work side-by-side.+The MCP server is one of two ways to use Cua Driver — skip this section if you only want the CLI (`cua-driver list_apps`, etc.). You can register both later, MCP and CLI work side-by-side.Cua Driver speaks MCP over stdio. Use `cua-driver mcp-config --client <name>` to print the right command for your client, or copy one of the snippets below directly:@@ -536,20 +539,21 @@ cua-driver mcp-config | pbcopy```<Callout type="info">-**Pi (badlogic/pi-mono)** does not support MCP natively. Use cua-driver as a plain CLI from inside Pi instead — `cua-driver call list_apps`, `cua-driver call click '{...}'`, etc. — which is exactly the shape Pi is built around. Run `cua-driver mcp-config --client pi` for the full guidance, or see the [Quickstart](/cua-driver/guide/getting-started/quickstart) for CLI usage.+**Pi (badlogic/pi-mono)** does not support MCP natively. Use cua-driver as a plain CLI from inside Pi instead — `cua-driver list_apps`, `cua-driver click '{...}'`, etc. — which is exactly the shape Pi is built around. Run `cua-driver mcp-config --client pi` for the full guidance, or see the [Quickstart](/cua-driver/guide/getting-started/quickstart) for CLI usage.</Callout>The client spawns `cua-driver mcp` on demand once registered.<Callout type="info">- **TCC auto-delegation.** When MCP clients spawn `cua-driver mcp` from an IDE terminal (Claude Code,- Cursor, VS Code, Warp), macOS attributes the subprocess to the terminal — not `CuaDriver.app` — so- AX probes would silently fail against the wrong bundle id. `mcp` detects this and auto-launches a- `cua-driver serve` daemon via `open -n -g -a CuaDriver --args serve`, then proxies every tool call- through the daemon's Unix socket. The client sees an ordinary stdio MCP server; the daemon runs- under LaunchServices with the right TCC context. No Python bridge, no manual `serve` step required.- Pass `--no-daemon-relaunch` (or set `CUA_DRIVER_MCP_NO_RELAUNCH=1`) to opt out, e.g. when MCP is- launched from CuaDriver.app directly and already has the right TCC grants.+ **TCC auto-delegation.** When MCP clients spawn `cua-driver mcp` from an IDE terminal (Claude+ Code, Cursor, VS Code, Warp), macOS attributes the subprocess to the terminal — not+ `CuaDriver.app` — so AX probes would silently fail against the wrong bundle id. `mcp` detects this+ and auto-launches a `cua-driver serve` daemon via `open -n -g -a CuaDriver --args serve`, then+ proxies every tool call through the daemon's Unix socket. The client sees an ordinary stdio MCP+ server; the daemon runs under LaunchServices with the right TCC context. No Python bridge, no+ manual `serve` step required. Pass `--no-daemon-relaunch` (or set `CUA_DRIVER_MCP_NO_RELAUNCH=1`)+ to opt out, e.g. when MCP is launched from CuaDriver.app directly and already has the right TCC+ grants.</Callout><Callout type="info">@@ -557,29 +561,29 @@ The client spawns `cua-driver mcp` on demand once registered.Windows and Linux, addressing the Session 0 / interactive-session problem rather than TCC: when`cua-driver mcp` starts up and detects a daemon already listening on the default socket, itproxies every tool call through to it instead of running in-process. Crucial for SSH on Windows,- where the SSH session lands in Session 0 (no desktop) but the daemon — registered via- `cua-driver autostart enable` — lives in the user's Session 1+ interactive logon. Same- `--no-daemon-relaunch` / `CUA_DRIVER_RS_MCP_NO_RELAUNCH=1` opt-out as macOS. See- [Running cua-driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) for the- full workflow.+ where the SSH session lands in Session 0 (no desktop) but the daemon — registered via `cua-driver+ autostart enable` — lives in the user's Session 1+ interactive logon. Same `--no-daemon-relaunch`+ / `CUA_DRIVER_RS_MCP_NO_RELAUNCH=1` opt-out as macOS. See [Running Cua Driver under SSH on+ Windows](/cua-driver/guide/getting-started/windows-ssh) for the full workflow.</Callout>-## Agent skills (auto-wired)+## Agent skills (optional)-The bundle ships an Anthropic-format SKILL.md pack at `/Applications/CuaDriver.app/Contents/Resources/Skills/cua-driver/`. The installer detects the agents you have and creates symlinks pointing them at the bundle so the skill auto-loads:+The installer does not modify agent instruction directories by default. To fetch the matching Anthropic-format skill pack and link it into detected agents, run:-| Agent | Skills directory | Auto-wired by installer |-|---|---|---|-| Claude Code | `~/.claude/skills/cua-driver` | when `~/.claude/skills/` exists |-| Codex | `~/.agents/skills/cua-driver` | when `~/.codex/` exists |-| OpenClaw | `~/.openclaw/skills/cua-driver` | when `~/.openclaw/` exists |-| OpenCode | `~/.config/opencode/skills/cua-driver` | when `~/.config/opencode/` exists |+```bash+cua-driver skills install+```-The installer creates the `skills/` subdirectory if missing, then drops the symlink. Symlinks survive auto-updates because `/Applications/CuaDriver.app` is replaced atomically — the link target stays valid across releases.+| Agent | Skills directory | Linked by `skills install` when present |+| ----------- | ---------------------------------------------------------------------------------------------------------- | --------------------------------------- |+| Claude Code | `~/.claude/skills/cua-driver` | yes |+| Codex | `~/.agents/skills/cua-driver` | yes |+| OpenClaw | `~/.openclaw/skills/cua-driver` | yes |+| OpenCode | `~/.config/opencode/skills/cua-driver` on macOS / Linux, `%APPDATA%\opencode\skills\cua-driver` on Windows | yes |+| Antigravity | `~/.gemini/skills/cua-driver` | yes |-<Callout type="info">-OpenCode also reads `~/.claude/skills/` natively, so users who have both Claude Code and OpenCode get the skill via the Claude path automatically.-</Callout>+`skills install` never overwrites an existing user-managed `cua-driver` link or directory. Use `cua-driver skills status`, `cua-driver skills update`, and `cua-driver skills uninstall` to inspect, refresh, or remove the pack.### Agents without a SKILL.md auto-loader@@ -588,38 +592,41 @@ Cursor, Hermes, and Pi each use a single-file system prompt (different format) i- **Cursor** (`~/.cursor/rules/*.mdc`): rules expect a different frontmatter shape (`description`/`globs`/`alwaysApply`), not Anthropic's `name`/`description`. Symlinking the SKILL.md as `.mdc` works but the frontmatter renders as a noisy comment block.- **Hermes** (`~/.hermes/SOUL.md`) and **Pi** (`~/.pi/agent/SYSTEM.md`): replace the entire system prompt — symlinking would clobber any custom prompt you've set.-For these, paste the skill content manually into whatever instructions file the agent uses:+For these, install the skill pack and paste its content manually into whatever instructions file the agent uses:```bash-cat /Applications/CuaDriver.app/Contents/Resources/Skills/cua-driver/SKILL.md | pbcopy+cua-driver skills install+cat "$(cua-driver skills path)/SKILL.md" | pbcopy```## Uninstall-One canonical uninstall URL per platform mirrors the install side. Flag handling and auto-detection match `install.sh` exactly:+One canonical uninstall URL per platform mirrors the install side:-| Platform | Backend | Command |-|---|---|---|-| macOS | Swift (default) | `bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.sh)"` |-| macOS | Rust port (`cua-driver-rs`) | `bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.sh)" -- --experimental-rust` |-| Linux | Rust port (auto-detected — Swift binary is macOS-only) | `bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.sh)"` |-| Windows | Rust port | `irm https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.ps1 \| iex` |+| Platform | Command |+| -------- | ---------------------------------------------------------------------------------------------------------------- |+| macOS | `bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.sh)"` |+| Linux | `bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.sh)"` |+| Windows | `irm https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.ps1 \| iex` |-`uninstall.sh` parses the same `--experimental-rust` / `--backend=rust` / `--backend=swift` flag set as `install.sh` and handles both backends inline — single file, no `_uninstall-rust.sh` helper (mirrors the one-file-per-shell shape of `uninstall.ps1`). On Linux (and any non-macOS `bash` host) it auto-detects and runs the Rust uninstall without any flag.+`uninstall.sh` removes the Rust implementation by default on macOS and Linux. A legacy `--backend=swift` path remains for users explicitly removing an old Swift install.`uninstall.ps1` self-elevates via UAC when it detects an `-AutoStart` install — the `cua-driver-serve` Scheduled Task is registered at `RunLevel=Highest` (see [Autostart](../autostart)), so the daemon spawned by it runs at High IL and a non-elevated process (even the same user that installed it) can't terminate it or delete the task. The script detects either condition upfront and re-spawns itself elevated; the in-place path runs without UAC when no autostart artifacts are present.**What each uninstall removes**-| Backend | Symlink / bin | App bundle / package home | Autostart entry | Skill links | Claude MCP registrations |-|---|---|---|---|---|---|-| Swift (macOS) | `~/.local/bin/cua-driver`, `/usr/local/bin/cua-driver` (legacy) | `/Applications/CuaDriver.app`, `~/.cua-driver`, `~/Library/Application Support/Cua Driver`, `~/Library/Caches/cua-driver` | `~/Library/LaunchAgents/com.trycua.cua_driver_updater.plist` (legacy ≤ 0.0.5) | `cua-driver` symlinks under `~/.claude/skills`, `~/.agents/skills`, `~/.openclaw/skills`, `~/.config/opencode/skills` | Scrubbed from `~/.claude.json` |-| Rust — macOS | `~/.local/bin/cua-driver` *(only when it resolves into `CuaDriver.app` and `~/.cua-driver-rs/` exists)* | `/Applications/CuaDriver.app` (current), `/Applications/CuaDriverRs.app` (legacy, pre-rename), `~/.cua-driver-rs/` (entire tree) | `~/Library/LaunchAgents/com.trycua.cua-driver-rs.plist` | `cua-driver-rs` symlinks under the same agent dirs | Scrubbed from `~/.claude.json` |-| Rust — Linux | `~/.local/bin/cua-driver` *(when it resolves into `~/.cua-driver-rs/`)* | `~/.cua-driver-rs/` (entire tree) | `~/.config/systemd/user/cua-driver-rs.service` (stop + disable + remove) | Same as above | Scrubbed from `~/.claude.json` |-| Rust — Windows | `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin` *(directory junction; legacy `Programs\trycua\cua-driver-rs\bin` also swept)* | `%USERPROFILE%\.cua-driver\` (entire tree, including `packages\current` junction; legacy `~\.cua-driver-rs\` also swept) | Scheduled Task `cua-driver-serve` (`schtasks /Delete`; needs UAC — script self-elevates) | Junctions under `%USERPROFILE%\.claude\skills`, `.agents\skills`, `.openclaw\skills`, `%APPDATA%\opencode\skills` | Not auto-edited — closing message prints `claude mcp remove cua-driver-rs` |+| Platform | Symlink / bin | App bundle / package home | Autostart entry | Skill links | Claude MCP registrations |+| -------- | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |+| macOS | `~/.local/bin/cua-driver` _(when it resolves into `CuaDriver.app` and `~/.cua-driver-rs/` exists)_ | `/Applications/CuaDriver.app` (current), `/Applications/CuaDriverRs.app` (legacy), `~/.cua-driver-rs/` | `~/Library/LaunchAgents/com.trycua.cua-driver-rs.plist` | `cua-driver` and legacy `cua-driver-rs` links under agent skill dirs | Scrubbed from `~/.claude.json` |+| Linux | `~/.local/bin/cua-driver` _(when it resolves into `~/.cua-driver-rs/`)_ | `~/.cua-driver-rs/` | `~/.config/systemd/user/cua-driver-rs.service` (stop + disable + remove) | Same as macOS | Scrubbed from `~/.claude.json` |+| Windows | `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin` _(directory junction; legacy `Programs\trycua\cua-driver-rs\bin` also swept)_ | `%USERPROFILE%\.cua-driver\` (entire tree, including `packages\current` junction; legacy `~\.cua-driver-rs\` also swept) | Scheduled Task `cua-driver-serve` (`schtasks /Delete`; script self-elevates when needed) | Junctions under `%USERPROFILE%\.claude\skills`, `.agents\skills`, `.openclaw\skills`, `%APPDATA%\opencode\skills`, `.gemini\skills` | Not auto-edited — closing message prints the manual `claude mcp remove` command |<Callout type="info">-**Safety invariants** — every uninstall script (`uninstall.sh`, `uninstall.ps1`) refuses to clobber a real directory at a path where the matching installer could have only created a symlink / junction (Linux/macOS use `[[ -L ]]`; Windows checks `IO_REPARSE_TAG_MOUNT_POINT`). A user who hand-managed any of these dirs keeps theirs untouched. Re-running an uninstall on an already-clean system prints `nothing to remove` per item — never errors.+ **Safety invariants** — every uninstall script (`uninstall.sh`, `uninstall.ps1`) refuses to+ clobber a real directory at a path where the matching installer could have only created a symlink+ / junction (Linux/macOS use `[[ -L ]]`; Windows checks `IO_REPARSE_TAG_MOUNT_POINT`). A user who+ hand-managed any of these dirs keeps theirs untouched. Re-running an uninstall on an already-clean+ system prints `nothing to remove` per item — never errors.</Callout><Callout type="info">@@ -638,6 +645,7 @@ Pre-rename Rust installs (`cua-driver-rs ≤ 0.2.3`) used a separate bundle id `tccutil reset Accessibility com.trycua.cuadriverrs 2>/dev/nulltccutil reset ScreenCapture com.trycua.cuadriverrs 2>/dev/null```+</Callout><Callout type="warn">@@ -647,7 +655,8 @@ tccutil reset ScreenCapture com.trycua.cuadriverrs 2>/dev/null& ([scriptblock]::Create((irm https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.ps1))) -Force```-It also doesn't auto-edit `%USERPROFILE%\.claude.json` — the closing message prints the exact `claude mcp remove cua-driver-rs` command instead. The macOS / Linux uninstaller does auto-edit `~/.claude.json` when `python3` is on `PATH`; the Windows uninstaller skips the auto-edit unconditionally to keep the script dependency-free.+It also doesn't auto-edit `%USERPROFILE%\.claude.json` — the closing message prints the manual `claude mcp remove` command instead. The macOS / Linux uninstaller does auto-edit `~/.claude.json` when `python3` is on `PATH`; the Windows uninstaller skips the auto-edit unconditionally to keep the script dependency-free.+</Callout>## Troubleshootingdiff --git a/docs/content/docs/cua-driver/guide/getting-started/integrations.mdx b/docs/content/docs/cua-driver/guide/getting-started/integrations.mdxindex fb6ab861d8..8eb7b84d12 100644--- a/docs/content/docs/cua-driver/guide/getting-started/integrations.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/integrations.mdx@@ -1,6 +1,6 @@---title: Integrations-description: Connect cua-driver to your AI coding agent+description: Connect Cua Driver to your AI coding agent---import { Callout } from 'fumadocs-ui/components/callout';@@ -40,7 +40,8 @@ This mode still exposes the normal CuaDriver tools. The only changed tool is `scFor this Claude Code vision/computer-use-style path, use MCP rather than shelling out to the CLI. CLI screenshots can still capture windows, but they do not expose the `mcp__cua-computer-use__screenshot` tool name that Claude Code appears to use as the image-grounding cue.<Callout type="info">- This does not call Anthropic APIs or expose Anthropic's native computer-use API tool. It is a CuaDriver MCP compatibility mode for Claude Code.+ This does not call Anthropic APIs or expose Anthropic's native computer-use API tool. It is a+ CuaDriver MCP compatibility mode for Claude Code.</Callout>## GitHub Copilot CLI@@ -111,7 +112,11 @@ cua-driver mcp-config --client opencodePaste the output into `~/.config/opencode/config.json` (global) or `opencode.json` at the project root.<Callout type="warn">-**Always configure cua-driver as an MCP server — never rely on the CLI fallback.** If MCP is not wired up, OpenCode calls `cua-driver` as a shell subprocess. The `get_window_state` response no longer includes base64 by default, but the screenshot image block is silently dropped — the model receives only the AX tree with no visual context. Use `--screenshot-out-file` or the `screenshot_out_file` param to preserve the image when using the CLI path.+ **Always configure Cua Driver as an MCP server — never rely on the CLI fallback.** If MCP is not+ wired up, OpenCode calls `cua-driver` as a shell subprocess. The `get_window_state` response no+ longer includes base64 by default, but the screenshot image block is silently dropped — the model+ receives only the AX tree with no visual context. Use `--screenshot-out-file` or the+ `screenshot_out_file` param to preserve the image when using the CLI path.</Callout>### Local vision models (Ollama)diff --git a/docs/content/docs/cua-driver/guide/getting-started/introduction.mdx b/docs/content/docs/cua-driver/guide/getting-started/introduction.mdxindex 5220526e27..03167aab62 100644--- a/docs/content/docs/cua-driver/guide/getting-started/introduction.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/introduction.mdx@@ -1,13 +1,11 @@---title: What is Cua Driver?-description: Background computer-use driver for any agent — macOS, Windows, and Linux+description: Background computer-use driver for any agent on macOS, Windows, and Linux pre-release.---import { Callout } from 'fumadocs-ui/components/callout';-Cua Driver is a computer-use driver that speaks MCP over stdio. It lets any agent (Claude, GPT, Gemini, Codex, custom loops) click, type, scroll, and snapshot a native app without bringing the target to the foreground. Your frontmost app stays where it is; you keep typing in your editor while the agent drives something else in the background.--It runs on macOS, Windows, and Linux from one tool surface. macOS ships the Swift driver (Accessibility / `CGEvent` / ScreenCaptureKit); Windows and Linux ship `cua-driver-rs`, the Rust port (UI Automation / `PostMessage` / AT-SPI). The tool names and arguments are the same everywhere — see the [MCP tools reference](/cua-driver/reference/mcp-tools).+Cua Driver is a computer-use driver that speaks MCP over stdio and exposes the same tools as a direct CLI. It lets agents click, type, scroll, inspect accessibility trees, and capture window state on macOS and Windows while preserving the user's working context. A Linux backend is available as a pre-release target while platform testing is still in progress.<Callout type="info" title="MIT License">Cua Driver is open-source and MIT licensed. If you find it useful, we'd appreciate a [star on@@ -15,57 +13,55 @@ It runs on macOS, Windows, and Linux from one tool surface. macOS ships the Swif</Callout>```bash-cua-driver call launch_app '{"name":"Calculator"}'-cua-driver call get_window_state '{"pid":844,"window_id":10725}'-cua-driver call click '{"pid":844,"window_id":10725,"element_index":14}'+cua-driver launch_app '{"bundle_id":"com.apple.calculator"}'+cua-driver get_window_state '{"pid":844,"window_id":10725}'+cua-driver click '{"pid":844,"window_id":10725,"element_index":14}'```-A single binary. Run it as an MCP stdio server (`cua-driver mcp`), a long-running daemon (`cua-driver serve`), or invoke any tool from the shell (`cua-driver call <tool>`).+A single binary can run as an MCP stdio server, a long-running daemon, or a one-shot shell command.## The no-foreground contract-One rule: the user's frontmost window does not change. Not during launch, not during a click, not during a keystroke, not during a re-snapshot. So:+The user's frontmost app should not change. Not during launch, not during a click, not during a keystroke, not during a re-snapshot. Three corollaries follow:- The real cursor stays where the user left it. No warp.-- The target window stays at its current z-order. No raise, no focus steal.-- On macOS, the user's Space does not follow the target. No bounce.+- The target window stays at its current z-rank unless a platform requires explicit activation for a foreground-only fallback.+- The user's desktop or Space does not follow the target.-Backgrounded dispatch is the default. `launch_app` runs hidden; element-indexed actions go through the accessibility API directly (no event synthesis); keyboard and pixel events are posted to a specific target rather than the system input queue. When a target's input stack would silently drop a backgrounded event — Chromium DOM content, some GTK widgets — the tool says so (`background_unavailable`) instead of failing quietly, and you opt into a one-time foreground swap with [`bring_to_front`](/cua-driver/reference/mcp-tools#bring_to_front) plus `dispatch: "foreground"`.+Every dispatch path is designed around those invariants. On macOS that means scoped CoreGraphics, Accessibility, and SkyLight paths such as `CGEvent.postToPid`, `AXUIElementPerformAction`, and pid-routed mouse delivery. On Windows it means UI Automation, window-targeted messages, and `SendInput` only when the OS requires a foreground dispatch path. On Linux it means AT-SPI for element addressing and X11/XWayland for window state, capture, and input delivery.-## Three capture modes+## Three modalities`capture_mode` controls what `get_window_state` returns. Pick based on what the agent needs:-- **`som`** (default) — set-of-mark: both the accessibility tree and a screenshot. The tree for element addressing, the screenshot for visual disambiguation when labels repeat or are empty.-- **`ax`** — accessibility tree only. No screenshot cost; deterministic element addressing. Best for structured loops over apps with real accessibility coverage.-- **`vision`** — window screenshot only, no tree walk. Best for vision-first models that ground on pixels. Pair with pixel-addressed clicks.--Switch with `cua-driver config set capture_mode som`.+- **`som`** (default) — set-of-mark. Accessibility tree plus screenshot. Tree for dispatch, screenshot for visual disambiguation when labels repeat or stay empty.+- **`ax`** — accessibility tree only. No screen-capture cost, deterministic element addressing. Best for structured loops over apps with real accessibility coverage.+- **`vision`** — window image only. No accessibility walk. Best for vision-first models that ground on pixels and don't use `element_index`.-## How it works+Backgrounded drive is the default across all three, not a mode you toggle. Switch modalities with `cua-driver config set capture_mode som`.-The accessibility tree is the primary addressing surface on every platform; the driver walks it, tags each actionable node with an index, and caches the element against `(pid, window_id)`. Element-indexed clicks then dispatch through the accessibility API with no cursor move and no focus steal.+## Platform backends-- **macOS** — the public Accessibility API for the tree and `AXUIElementPerformAction` for clicks; keyboard via `CGEvent.postToPid`; backgrounded pixel events via SkyLight's per-pid path. Chromium and Electron trees stay populated while occluded via an AX observer SPI.-- **Windows** — UI Automation for the tree, `PostMessage` for input. XAML / WinUI3 / UWP hosts (Calculator, Settings, modern Notepad) are driven through a focus-steal bypass; an optional UIAccess worker (`cua-driver-uia.exe`) lifts UIPI for packaged apps.-- **Linux** — AT-SPI for the tree over X11 / XWayland. See [Running on Linux](/cua-driver/guide/getting-started/linux).+- **macOS** uses Accessibility, ScreenCaptureKit, LaunchServices, and a signed `CuaDriver.app` bundle so TCC grants attach to the driver instead of the parent terminal.+- **Windows** uses UI Automation, Win32 window APIs, named pipes, and an optional logon Scheduled Task so GUI tools run in the user's interactive session rather than Session 0.+- **Linux pre-release** uses AT-SPI, X11/XWayland, XTest-style input, and normal user-session processes. Native Wayland-only apps remain a known platform limit because Wayland intentionally blocks cross-app automation. Treat this backend as pre-release until Linux testing and release coverage are complete.-Non-accessible surfaces (canvas, WebGL, custom-drawn controls) fall back to pixel coordinates against the same window-local screenshot space.+The tool names stay stable across platforms. A flow that uses `list_windows`, `get_window_state`, `click`, `type_text`, and `hotkey` can keep the same shape while the backend handles each OS's process, permission, and input model. Linux follows the same surface, but it is not yet an officially released or fully tested support tier.## Who it's for-- **Agent builders** who want their agent to operate a desktop without stealing the user's focus. Any MCP-capable client works: Claude Code, Cursor, Codex, Gemini, custom loops.-- **Dev-loop automation.** An agent drives an app, reads the pixels or the accessibility tree, edits source, rebuilds, verifies — while the editor stays frontmost.-- **Demo capture.** Record a trajectory while the user works elsewhere. Because the clicks are backgrounded, the overlay cursor the driver paints is the only cursor in the final video.+- **Agent builders** who want a local desktop driver with MCP and shell entry points.+- **Dev-loop automation** where an agent drives an app, reads pixels or accessibility state, edits source, rebuilds, and verifies while the editor stays usable.+- **Remote Windows workflows** where the daemon runs in the interactive session and SSH-side MCP clients proxy through it.+- **Trajectory capture** for replay, inspection, and training data.## What it doesn't do-- Not a VM. Cua Driver operates the real host, so grant accessibility permissions with intent. (macOS also needs Screen Recording for screenshots; Windows and Linux have no equivalent prompt.)-- Right-click on Chromium **web content** via pixel coordinates fires as a left-click — the renderer drops the right-click subtype on synthetic paths. Use element-indexed `right_click` on accessible targets. See [Limits](/cua-driver/reference/limits).-- Canvas apps (Blender, Unity, games) filter per-target events, so they need a brief foreground activation. Everything else stays backgrounded.--See [Installation](/cua-driver/guide/getting-started/installation) for per-platform requirements.+- Not a VM or sandbox. Cua Driver operates the real host, so grant Accessibility, Screen Recording, UI Automation, and desktop-session access with intent.+- Not a Wayland security bypass. Linux apps that bypass XWayland may be invisible to the current backend.+- Canvas, game-engine, and GPU-heavy apps can require a foreground-only fallback on some platforms because their event loops filter backgrounded synthetic input.+- macOS off-Space SwiftUI windows can strip their accessibility tree by OS design. See [Limits](/cua-driver/reference/limits).## Get started-[Install Cua Driver](/cua-driver/guide/getting-started/installation), then drive your first app in the [Quickstart](/cua-driver/guide/getting-started/quickstart).+Ready to try it? [Install Cua Driver](/cua-driver/guide/getting-started/installation) and drive your first app in the [Quickstart](/cua-driver/guide/getting-started/quickstart).diff --git a/docs/content/docs/cua-driver/guide/getting-started/linux.mdx b/docs/content/docs/cua-driver/guide/getting-started/linux.mdxindex dd89cffcd2..47ffbf8ae6 100644--- a/docs/content/docs/cua-driver/guide/getting-started/linux.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/linux.mdx@@ -1,35 +1,41 @@----title: Running cua-driver on Linux-description: Display server (X11 / Wayland), AT-SPI prerequisites, autostart, and headless workflows for cua-driver on Linux.+title: Linux pre-release+description: Display server (X11 / Wayland), AT-SPI prerequisites, autostart, and headless workflows for the Linux pre-release backend.---import { Callout } from 'fumadocs-ui/components/callout';-cua-driver-rs supports Linux as a first-class target — every action tool (`click`, `type_text`, `hotkey`, `drag`, `scroll`, `screenshot`, `launch_app`, `list_windows`, etc.) has a Linux implementation under [`crates/platform-linux/`](https://github.com/trycua/cua/tree/main/libs/cua-driver/rust/crates/platform-linux/src). This page covers the bits that diverge from the macOS / Windows quickstart: which display server you're running, what accessibility plumbing needs to be alive, how to keep the daemon up at logon, and how headless / CI workflows look.+The Linux backend is available as a **pre-release** target. It has Linux implementations under [`crates/platform-linux/`](https://github.com/trycua/cua/tree/main/libs/cua-driver/rust/crates/platform-linux/src), but it has not completed the same official release and platform validation pass as macOS and Windows. Use it for early testing, expect gaps, and report issues before relying on it in production workflows.-For the install one-liner itself, see [Installation](/cua-driver/guide/getting-started/installation) — the canonical script auto-detects Linux and routes to the Rust port.+For the install one-liner itself, see [Installation](/cua-driver/guide/getting-started/installation) — the canonical script auto-detects Linux and routes to the pre-release Rust backend.## Display server: X11 vs Wayland vs XWayland-cua-driver's window enumeration, input synthesis, and screen capture talk to your display server directly. The Linux backend supports **X11** (including the XWayland compatibility server on Wayland sessions), and probes which one you're on at startup:+Cua Driver's window enumeration, input synthesis, and screen capture talk to your display server directly. The Linux pre-release backend targets **X11** (including the XWayland compatibility server on Wayland sessions), and probes which one you're on at startup:```bashcua-driver doctor```The `display server` probe surfaces:-- **`DISPLAY` set, `WAYLAND_DISPLAY` unset** — pure X11 session. Everything works.++- **`DISPLAY` set, `WAYLAND_DISPLAY` unset** — pure X11 session. This is the expected path for the current pre-release backend.- **`WAYLAND_DISPLAY` set, `DISPLAY` set** — Wayland session with XWayland. cua-driver talks to XWayland (treats the session as X11). Native-Wayland-only apps that bypass XWayland aren't visible to the tools — call this out as a known limitation.- **`WAYLAND_DISPLAY` set, `DISPLAY` unset** — pure Wayland session, no XWayland. **Not supported today**. Run an X11 session, or install / enable XWayland.- **Neither set** — headless. Window-driving tools will return errors. See [Headless workflow](#headless-workflow) for `Xvfb`.<Callout type="warn">-**Wayland caveat.** Wayland's security model deliberately isolates apps from each other's window state and input — exactly what cua-driver needs to do its job. The Rust port works around this by talking to XWayland, which acts as an X11 proxy for Wayland clients. **Apps that render natively against Wayland** (no XWayland) — most modern Firefox builds, GTK4 apps, etc. — won't show up in `list_windows` and aren't clickable. If your target app is one of those, run an X11 session (most distros let you pick X11 vs Wayland at the login screen).+ **Wayland caveat.** Wayland's security model deliberately isolates apps from each other's window+ state and input — exactly what cua-driver needs to do its job. The Rust port works around this by+ talking to XWayland, which acts as an X11 proxy for Wayland clients. **Apps that render natively+ against Wayland** (no XWayland) — most modern Firefox builds, GTK4 apps, etc. — won't show up in+ `list_windows` and aren't clickable. If your target app is one of those, run an X11 session (most+ distros let you pick X11 vs Wayland at the login screen).</Callout>## AT-SPI prerequisite-The accessibility-tree tools (`get_window_state`, `click` with `element_index`, anything that walks UIA-equivalent structure) talk to the **AT-SPI 2** D-Bus bus. AT-SPI is the Linux accessibility framework — same role as macOS's AX or Windows' UI Automation. cua-driver expects the AT-SPI bus to be reachable on your session bus.+The accessibility-tree tools (`get_window_state`, `click` with `element_index`, anything that walks UIA-equivalent structure) talk to the **AT-SPI 2** D-Bus bus. AT-SPI is the Linux accessibility framework — same role as macOS's AX or Windows' UI Automation. Cua Driver expects the AT-SPI bus to be reachable on your session bus.cua-driver probes this at startup via `gdbus`:@@ -44,17 +50,21 @@ cua-driver doctorIf the probe fails, install the AT-SPI service and enable accessibility:-| Distro | Package | Enable |-|---|---|---|-| Ubuntu / Debian | `at-spi2-core` (usually pre-installed under GNOME) | `gsettings set org.gnome.desktop.interface toolkit-accessibility true` |-| Fedora | `at-spi2-core` | same `gsettings` command |-| Arch | `at-spi2-core` (extra) | `gsettings set …` if running GNOME; KDE has its own toggle |-| Alpine / minimal | `at-spi2-core dbus dbus-x11` | run `dbus-launch --exit-with-session` from your X startup script |+| Distro | Package | Enable |+| ---------------- | -------------------------------------------------- | ---------------------------------------------------------------------- |+| Ubuntu / Debian | `at-spi2-core` (usually pre-installed under GNOME) | `gsettings set org.gnome.desktop.interface toolkit-accessibility true` |+| Fedora | `at-spi2-core` | same `gsettings` command |+| Arch | `at-spi2-core` (extra) | `gsettings set …` if running GNOME; KDE has its own toggle |+| Alpine / minimal | `at-spi2-core dbus dbus-x11` | run `dbus-launch --exit-with-session` from your X startup script |-You don't need accessibility enabled *system-wide* — it needs to be on for the user session that's running cua-driver. Most desktop environments toggle this automatically when an accessibility client connects.+You don't need accessibility enabled _system-wide_ — it needs to be on for the user session that's running Cua Driver. Most desktop environments toggle this automatically when an accessibility client connects.<Callout type="info">-**Why AT-SPI and not raw X11 properties?** Many Linux apps don't expose their UI structure through X11 window manager hints — only through AT-SPI. Without AT-SPI, `click` would have to fall back to raw pixel coordinates from screenshots (the same vision-only mode that works as a fallback). With AT-SPI, cua-driver can address elements by their accessible name / role / index, matching the agent ergonomics on macOS (AX) and Windows (UIA).+ **Why AT-SPI and not raw X11 properties?** Many Linux apps don't expose their UI structure through+ X11 window manager hints — only through AT-SPI. Without AT-SPI, `click` would have to fall back to+ raw pixel coordinates from screenshots (the same vision-only mode that works as a fallback). With+ AT-SPI, Cua Driver can address elements by their accessible name / role / index, matching the+ agent ergonomics on macOS (AX) and Windows (UIA).</Callout>## Autostart on Linux@@ -110,7 +120,7 @@ See the [Autostart](/cua-driver/guide/getting-started/autostart) concept page fo## Headless workflow-Linux doesn't have Windows' Session 0 isolation — `sshd` spawns processes that inherit the user's environment cleanly, including `DISPLAY` / `WAYLAND_DISPLAY` when they're set. So the "SSH + daemon proxy" dance that's necessary on Windows ([Running cua-driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh)) is *not* needed on Linux: as long as a display server is running on your session, `cua-driver serve` over SSH connects to it.+Linux doesn't have Windows' Session 0 isolation — `sshd` spawns processes that inherit the user's environment cleanly, including `DISPLAY` / `WAYLAND_DISPLAY` when they're set. So the "SSH + daemon proxy" dance that's necessary on Windows ([Running Cua Driver under SSH on Windows](/cua-driver/guide/getting-started/windows-ssh)) is _not_ needed on Linux: as long as a display server is running on your session, `cua-driver serve` over SSH connects to it.For **pure headless** (no display server at all — typical CI runner), use `Xvfb` to provide a virtual X server:@@ -118,7 +128,7 @@ For **pure headless** (no display server at all — typical CI runner), use `Xvf# Install Xvfb (Ubuntu/Debian: xvfb; Fedora: xorg-x11-server-Xvfb; Arch: xorg-server-xvfb)sudo apt-get install -y xvfb at-spi2-core dbus-x11-# Run cua-driver under a virtual X server:+# Run Cua Driver under a virtual X server:xvfb-run -a cua-driver serve# Or, more explicitly, launch Xvfb yourself + point cua-driver at it:@@ -127,15 +137,18 @@ export DISPLAY=:99dbus-launch --exit-with-session cua-driver serve```-This is the same recipe used by CI integrations that test cua-driver on Linux runners.+This is a useful recipe for local CI experiments with the Linux pre-release backend.<Callout type="info">-**Tools that don't need a display.** Even without `DISPLAY` set, the non-graphical tools (`list_apps`, `launch_app` via PATH lookup, `read_clipboard` if a clipboard daemon is up) still work. Only the desktop-touching tools (`click`, `screenshot`, `list_windows`, `get_window_state`) require a display server. `cua-driver doctor` makes this explicit per-tool.+ **Tools that don't need a display.** Even without `DISPLAY` set, the non-graphical tools+ (`list_apps`, `launch_app` via PATH lookup, `read_clipboard` if a clipboard daemon is up) still+ work. Only the desktop-touching tools (`click`, `screenshot`, `list_windows`, `get_window_state`)+ require a display server. `cua-driver doctor` makes this explicit per-tool.</Callout>## Distro-specific notes-The canonical install script (`/bin/bash -c "$(curl -fsSL …/install.sh)"`) is distro-neutral — it downloads a static-linked binary tarball from GitHub Releases, drops it into `~/.cua-driver-rs/packages/releases/<v>-x86_64-unknown-linux-gnu/`, and symlinks `~/.local/bin/cua-driver`. The same one-liner works on every modern distro.+The canonical install script (`/bin/bash -c "$(curl -fsSL …/install.sh)"`) downloads a Linux x86_64 binary tarball from GitHub Releases, drops it into `~/.cua-driver-rs/packages/releases/<v>-x86_64-unknown-linux-gnu/`, and symlinks `~/.local/bin/cua-driver`. Because Linux support is pre-release, expect distro-specific gaps and prerequisites.The bit that varies is **what accessibility / display tooling is pre-installed**:@@ -144,15 +157,15 @@ The bit that varies is **what accessibility / display tooling is pre-installed**- **Arch / Manjaro** — minimal install; you'll likely need to explicitly install `at-spi2-core` and ensure `dbus-launch` runs as part of your session startup.- **Alpine / busybox-style** — slimmest of all; needs `dbus`, `dbus-x11`, `at-spi2-core` plus likely an explicit `dbus-launch --exit-with-session` wrapper.-If `cua-driver doctor` is happy after install, you're set.+If `cua-driver doctor` is happy after install, you have a reasonable starting point for testing the pre-release backend.-## Per-tool Linux verification matrix+## Per-tool Linux implementation matrix-See [`libs/cua-driver/rust/PARITY.md`](https://github.com/trycua/cua/blob/main/libs/cua-driver/rust/PARITY.md) for the per-tool Linux-VERIFIED matrix — every action tool is annotated with its Linux source file (`crates/platform-linux/src/tools/impl_.rs`) and which platform features it depends on (X11 root window for `get_cursor_position`, AT-SPI for accessibility tree, `xtest` for synthetic input, etc.).+See [`libs/cua-driver/rust/PARITY.md`](https://github.com/trycua/cua/blob/main/libs/cua-driver/rust/PARITY.md) for the per-tool Linux implementation matrix. Treat it as implementation tracking, not an official support certification; the backend remains pre-release until Linux testing and release coverage are complete.## See also-- [Installation](/cua-driver/guide/getting-started/installation) — canonical one-liner that handles Linux automatically+- [Installation](/cua-driver/guide/getting-started/installation) — canonical one-liner that handles the Linux pre-release backend- [Autostart](/cua-driver/guide/getting-started/autostart) — concept page (Windows-only verb family; Linux uses systemd)-- Process attribution — Linux has none of the macOS-TCC or Windows-Session-0 weirdness. The [macOS process model](/cua-driver/guide/getting-started/process-model) and [SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) pages explain those problems and why Linux sidesteps them-- [`PARITY.md`](https://github.com/trycua/cua/blob/main/libs/cua-driver/rust/PARITY.md) — per-tool platform verification matrix+- [Process model](/cua-driver/guide/getting-started/process-model) — Linux has none of the macOS-TCC or Windows-Session-0 weirdness; this page explains what those problems are and why Linux sidesteps them+- [`PARITY.md`](https://github.com/trycua/cua/blob/main/libs/cua-driver/rust/PARITY.md) — per-tool platform implementation matrixdiff --git a/docs/content/docs/cua-driver/guide/getting-started/meta.json b/docs/content/docs/cua-driver/guide/getting-started/meta.jsonindex 5ee98b9fea..ec601a3a38 100644--- a/docs/content/docs/cua-driver/guide/getting-started/meta.json+++ b/docs/content/docs/cua-driver/guide/getting-started/meta.json@@ -3,5 +3,18 @@"description": "Get up and running with Cua Driver","icon": "Rocket","defaultOpen": true,- "pages": ["introduction", "installation", "updating", "quickstart", "windows-ssh", "linux", "autostart", "pip-preview", "integrations", "swift-integration", "process-model", "comparison", "faq"]+ "pages": [+ "introduction",+ "installation",+ "updating",+ "quickstart",+ "windows-ssh",+ "linux",+ "autostart",+ "pip-preview",+ "integrations",+ "process-model",+ "comparison",+ "faq"+ ]}diff --git a/docs/content/docs/cua-driver/guide/getting-started/process-model.mdx b/docs/content/docs/cua-driver/guide/getting-started/process-model.mdxindex c6bd667258..daed11b70d 100644--- a/docs/content/docs/cua-driver/guide/getting-started/process-model.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/process-model.mdx@@ -1,6 +1,6 @@---title: MCP process model-description: How cua-driver mcp runs — in-process vs daemon-proxy modes, lifecycles, failure modes, and wrapper-author guidance+description: How the `cua-driver mcp` command runs — in-process vs daemon-proxy modes, lifecycles, failure modes, and wrapper-author guidance---import { Callout } from 'fumadocs-ui/components/callout';@@ -71,7 +71,7 @@ You can also infer the mode from the heuristic the code uses. Daemon-proxy mode- `--no-daemon-relaunch` is not set.- `CUA_DRIVER_MCP_NO_RELAUNCH` is not truthy (`1`, `true`, `yes`, `on`).- The binary's `Bundle.main.bundlePath` does not end in `.app` (i.e. we're invoked through the `~/.local/bin/cua-driver` symlink, not the bundle's main executable directly).-- The binary resolves into an installed `CuaDriver.app` bundle via `realpath` (raw `swift run` dev invocations fail this check and stay in-process).+- The binary resolves into an installed `CuaDriver.app` bundle via `realpath` (raw `cargo run` dev invocations fail this check because the binary's parent path is not `/Applications/CuaDriver.app/Contents/MacOS/`, and stay in-process).- `getppid() != 1` (a ppid of 1 means launchd reparented us — we already have the right TCC context).## Process lifecycles@@ -93,7 +93,7 @@ Run `cua-driver status` at any point to verify:```bashcua-driver status-# cua-driver daemon is running+# Cua Driver daemon is running# socket: /Users/you/Library/Caches/cua-driver/cua-driver.sock# pid: 12345```@@ -133,11 +133,11 @@ If `open` itself fails (CuaDriver.app not installed at all), the error is reportIf the daemon is killed (user quits CuaDriver.app, `killall`, crash) while an mcp client is connected, the proxy can't tell until the next `CallTool` lands. That call raises:```text-MCPError.internalError("cua-driver daemon not reachable on <socket>. Start it with+MCPError.internalError("Cua Driver daemon not reachable on <socket>. Start it with`open -n -g -a CuaDriver --args serve` and retry.")```-The MCP client surfaces this as a tool error. The mcp-client process **does not** auto-restart the daemon mid-session. The recommended client behavior is: catch the error, optionally restart the daemon yourself (`open -n -g -a CuaDriver --args serve`), reconnect the MCP transport, and retry.+The MCP client surfaces this as a tool error. The mcp-client process **does not** auto-restart the daemon mid-session. The recommended client behavior is: catch the error, optionally restart the daemon yourself (`open -n -g -a CuaDriver --args serve`), reconnect the MCP transport, and retry. Hermes' wrapper in trycua/hermes#22821 implements exactly this pattern.### Socket path ownershipdiff --git a/docs/content/docs/cua-driver/guide/getting-started/quickstart.mdx b/docs/content/docs/cua-driver/guide/getting-started/quickstart.mdxindex f3bddee9fc..b0ecc3dbe7 100644--- a/docs/content/docs/cua-driver/guide/getting-started/quickstart.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/quickstart.mdx@@ -1,6 +1,6 @@---title: Quickstart-description: Drive your first macOS app with Cua Driver+description: Drive your first desktop app with Cua Driver---import { Callout } from 'fumadocs-ui/components/callout';@@ -21,7 +21,7 @@ Element-indexed workflows require a persistent daemon. The per-pid element cache```bashopen -n -g -a CuaDriver --args servecua-driver status-# cua-driver daemon is running+# Cua Driver daemon is running# socket: /Users/you/Library/Caches/cua-driver/cua-driver.sock# pid: 12345```@@ -120,8 +120,9 @@ cua-driver call click '{"pid":844,"window_id":10725,"x":120,"y":240}'The PNG is capped at 1568 px long-side by default (matching Anthropic's multimodal-vision downsampling limit), so the image you reason over and the coordinate space the click tool expects are the same resolution. No scaling math.<Callout type="warn">- The `window_id` field is optional on pixel clicks but recommended. It pins the coordinate conversion- to the window whose screenshot produced the pixel, rather than letting the driver pick heuristically.+ The `window_id` field is optional on pixel clicks but recommended. It pins the coordinate+ conversion to the window whose screenshot produced the pixel, rather than letting the driver pick+ heuristically.</Callout>## Cleanupdiff --git a/docs/content/docs/cua-driver/guide/getting-started/swift-integration.mdx b/docs/content/docs/cua-driver/guide/getting-started/swift-integration.mdxdeleted file mode 100644index e5e981ddfe..0000000000--- a/docs/content/docs/cua-driver/guide/getting-started/swift-integration.mdx+++ /dev/null@@ -1,151 +0,0 @@-----title: Swift Integration-description: Embed CuaDriverCore or CuaDriverServer in a Swift package------import { Callout } from 'fumadocs-ui/components/callout';--`CuaDriverCore` and `CuaDriverServer` are available as Swift library products directly from the `trycua/cua` repository. Use this when you want to embed accessibility automation, window capture, or MCP tool handling into your own macOS Swift app or package — without shelling out to the `cua-driver` CLI.--## Add the dependency--In your `Package.swift`:--```swift-dependencies: [- .package(- url: "https://github.com/trycua/cua.git",- from: "cua-driver-v0.1.0"- ),-],-```--Then add the products you need to your target:--```swift-targets: [- .target(- name: "MyApp",- dependencies: [- // Accessibility, input synthesis, window capture, recording.- // No external dependencies — system frameworks only.- .product(name: "CuaDriverCore", package: "cua"),-- // MCP tool handlers and daemon layer (adds swift-sdk dependency).- // Use this if you want to expose cua-driver tools over MCP.- .product(name: "CuaDriverServer", package: "cua"),- ]- ),-]-```--<Callout type="info">- `CuaDriverCore` depends only on system frameworks (AppKit, CoreGraphics, ScreenCaptureKit, etc.). `CuaDriverServer` adds [modelcontextprotocol/swift-sdk](https://github.com/modelcontextprotocol/swift-sdk) for the MCP protocol types.-</Callout>--## What's in each product--### CuaDriverCore--Low-level macOS automation primitives:--| Module area | What it gives you |-|---|---|-| `AppStateEngine` | AX tree snapshots with element-index caching |-| `AppLauncher` | Launch apps without focus steal |-| `AXInput` | Perform AX actions, read attributes |-| `MouseInput` / `KeyboardInput` | Synthesize CGEvents |-| `WindowCapture` | Per-window screenshots via ScreenCaptureKit |-| `RecordingSession` | Trajectory recording and replay |-| `AgentCursor` | Animated overlay cursor |-| `BrowserJS` / `ElectronJS` | Execute JS in browser tabs via Apple Events or CDP |-| `AXPageReader` | Extract text / query DOM from WKWebView AX trees |--### CuaDriverServer--Ready-made MCP tool handlers built on `CuaDriverCore`:--```swift-import CuaDriverServer--let registry = ToolRegistry.default-// registry.handlers["click"], ["get_window_state"], ["page"], etc.-```--Embed the full tool set in your own MCP server:--```swift-import MCP-import CuaDriverServer--let server = MCPServer(tools: ToolRegistry.default.allTools) { name, args in- try await ToolRegistry.default.call(name, arguments: args)-}-```--## Minimum requirements--- macOS 14 (Sonoma) or later-- Swift 6.0+--## TCC permissions--Calling AX or screen-capture APIs from an embedded library still requires the host app to hold the relevant TCC grants:--- **Accessibility** — for any `AXUIElement` work (snapshots, clicks, AX actions).-- **Screen Recording** — for `WindowCapture` screenshots.--Grant these under **System Settings → Privacy & Security** against your app's bundle identifier, the same as for the standalone `CuaDriver.app`.--## Cursor customization--`AgentCursorRenderer.shared` drives the visual style applied to every click animation. Set it at app startup from the `@MainActor` context — changes take effect on the next rendered frame.--### Custom gradient colors--```swift-import CuaDriverCore--await MainActor.run {- AgentCursorRenderer.shared.style = AgentCursorStyle(- strokeGradientStops: [- AgentCursorGradientStop(color: NSColor(hex: "#A855F7")!, location: 0),- AgentCursorGradientStop(color: NSColor(hex: "#6366F1")!, location: 1),- ],- bloomColor: NSColor(hex: "#A855F7")!- )-}-```--### Custom PNG / SVG cursor image--Replace the default arrow with any image `NSImage` can load (PNG, JPEG, PDF, SVG on macOS 12+):--```swift-import CuaDriverCore--await MainActor.run {- let img = NSImage(contentsOf: Bundle.main.url(forResource: "cursor", withExtension: "png")!)- AgentCursorRenderer.shared.style = AgentCursorStyle(image: img)-}-```--The image is drawn at `shapeSize × shapeSize` points (default 22 pt), centered on the cursor position and rotated to track the motion heading. To suppress the bloom halo behind it, pass `bloomCenterAlpha: 0`.--### Revert to default--```swift-await MainActor.run {- AgentCursorRenderer.shared.style = .default-}-```--### All style knobs--| Parameter | Type | Default | Description |-|---|---|---|---|-| `image` | `NSImage?` | `nil` | Custom cursor image (replaces arrow when non-nil) |-| `strokeGradientStops` | `[AgentCursorGradientStop]` | ice-blue → cyan → mint | Arrow fill gradient |-| `bloomColor` | `NSColor` | cyan `#5EC0E8` | Bloom halo and focus-rect color |-| `bloomCenterAlpha` | `CGFloat` | `0.55` | Center opacity of the bloom glow |-| `shapeSize` | `CGFloat` | `22` | Width and height of the cursor shape (points) |diff --git a/docs/content/docs/cua-driver/guide/getting-started/updating.mdx b/docs/content/docs/cua-driver/guide/getting-started/updating.mdxindex 043c3c0cad..1047111b4c 100644--- a/docs/content/docs/cua-driver/guide/getting-started/updating.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/updating.mdx@@ -1,19 +1,19 @@---title: Updating-description: Check whether a newer cua-driver release is available, then apply it on your terms — from the CLI, an MCP client, or a script.+description: Check whether a newer Cua Driver release is available, then apply it on your terms — from the CLI, an MCP client, or a script.---import { Callout } from 'fumadocs-ui/components/callout';-cua-driver ships three update surfaces, all reading from the same GitHub releases endpoint and 20-hour on-disk cache:+Cua Driver ships three update surfaces, all reading from the same GitHub releases endpoint and 20-hour on-disk cache:-| Surface | Verb | Use case |-| --- | --- | --- |-| Passive banner | (automatic) | Friendly nudge on every `mcp` / `serve` / `doctor` start. |-| CLI check | `cua-driver check-update` | Human-readable "am I outdated?" probe. |+| Surface | Verb | Use case |+| -------------- | -------------------------------- | ------------------------------------------------------------------------------- |+| Passive banner | (automatic) | Friendly nudge on every `mcp` / `serve` / `doctor` start. |+| CLI check | `cua-driver check-update` | Human-readable "am I outdated?" probe. || Scripted check | `cua-driver check-update --json` | Hermes / CI / wrapper scripts. Same payload as the `check_for_update` MCP tool. |-| MCP tool | `check_for_update` | Agents that want to ask programmatically, without spawning a subprocess. |-| Apply | `cua-driver update --apply` | Download and install the latest release. |+| MCP tool | `check_for_update` | Agents that want to ask programmatically, without spawning a subprocess. |+| Apply | `cua-driver update --apply` | Download and install the latest release. |`check-update` and `check_for_update` are **read-only** — they never modify your install. Apply is a separate step on purpose.@@ -70,7 +70,7 @@ The non-zero-on-outdated convention (à la `brew outdated`) is intentionally not## `cua-driver check-update --json` — scripted path-Same check, JSON output. Use this when wiring cua-driver updates into Hermes, CI, or any wrapper script.+Same check, JSON output. Use this when wiring Cua Driver updates into Hermes, CI, or any wrapper script.```bash$ cua-driver check-update --json@@ -81,7 +81,7 @@ $ cua-driver check-update --json"source": "github_releases","checked_at": "2026-05-27T14:30:00Z","cache_hit": false,- "install_command": "curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh | bash -s -- install --backend=rust",+ "install_command": "curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh | bash","release_notes_url": "https://github.com/trycua/cua/releases/tag/cua-driver-rs-v0.3.2","error": null}@@ -106,23 +106,23 @@ $ cua-driver check-update --json### JSON schema-| Field | Type | Notes |-| --- | --- | --- |-| `current_version` | string | The running binary's `CARGO_PKG_VERSION`. |-| `latest_version` | string \| null | Highest non-draft non-prerelease `cua-driver-rs-v*` tag on GitHub. `null` if the fetch failed and no cache exists. |-| `update_available` | bool | `latest > current` under strict semver. `false` when `latest_version` is `null`. |-| `source` | string | Always `"github_releases"` today. Pinned so future alternate sources can be slotted in without breaking consumers. |-| `checked_at` | string | ISO-8601 UTC timestamp of this check (not the cached fetch). |-| `cache_hit` | bool | `true` when we short-circuited via the cache, `false` when we hit GitHub. |-| `install_command` | string \| null | Shell one-liner to apply the update. `null` when up-to-date or the check failed. |-| `release_notes_url` | string \| null | Release notes page on GitHub. `null` when up-to-date or the check failed. |-| `error` | string \| null | Human-readable reason when the fetch failed and no cache was available. |+| Field | Type | Notes |+| ------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------ |+| `current_version` | string | The running binary's `CARGO_PKG_VERSION`. |+| `latest_version` | string \| null | Highest non-draft non-prerelease `cua-driver-rs-v*` tag on GitHub. `null` if the fetch failed and no cache exists. |+| `update_available` | bool | `latest > current` under strict semver. `false` when `latest_version` is `null`. |+| `source` | string | Always `"github_releases"` today. Pinned so future alternate sources can be slotted in without breaking consumers. |+| `checked_at` | string | ISO-8601 UTC timestamp of this check (not the cached fetch). |+| `cache_hit` | bool | `true` when we short-circuited via the cache, `false` when we hit GitHub. |+| `install_command` | string \| null | Shell one-liner to apply the update. `null` when up-to-date or the check failed. |+| `release_notes_url` | string \| null | Release notes page on GitHub. `null` when up-to-date or the check failed. |+| `error` | string \| null | Human-readable reason when the fetch failed and no cache was available. |### Example consumer snippet (bash)```bashif cua-driver check-update --json | jq -e '.update_available' > /dev/null; then- echo "cua-driver is outdated — applying update"+ echo "Cua Driver is outdated — applying update"cua-driver update --applyfi```@@ -140,7 +140,7 @@ $ cua-driver call check_for_update '{}'"source": "github_releases","checked_at": "2026-05-27T14:30:00Z","cache_hit": false,- "install_command": "curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh | bash -s -- install --backend=rust",+ "install_command": "curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh | bash","release_notes_url": "https://github.com/trycua/cua/releases/tag/cua-driver-rs-v0.3.2","error": null}@@ -149,7 +149,9 @@ $ cua-driver call check_for_update '{}'The tool is registered as `read_only`, `idempotent`, and `open_world` (the network can change the answer between calls). MCP clients see both a human summary in `content[0].text` and the JSON above in `structuredContent`.<Callout>-The MCP tool intentionally has no `apply` variant. Installing over MCP would force a self-replacement of the running MCP server — a UX boundary we want explicit. If your agent needs to apply, shell out to `cua-driver update --apply` or run the `install_command` from the payload.+ The MCP tool intentionally has no `apply` variant. Installing over MCP would force a+ self-replacement of the running MCP server — a UX boundary we want explicit. If your agent needs+ to apply, shell out to `cua-driver update --apply` or run the `install_command` from the payload.</Callout>## `cua-driver update --apply` — installing@@ -161,8 +163,8 @@ $ cua-driver update --applyCurrent version: 0.3.1Checking for updates…New version available: 0.3.2-Downloading and installing cua-driver 0.3.2…-Installed cua-driver 0.3.2.+Downloading and installing Cua Driver 0.3.2…+Installed Cua Driver 0.3.2.```If a daemon was already running, restart it to pick up the new binary:diff --git a/docs/content/docs/cua-driver/guide/getting-started/windows-ssh.mdx b/docs/content/docs/cua-driver/guide/getting-started/windows-ssh.mdxindex b20b8e2df8..9a6edc65b3 100644--- a/docs/content/docs/cua-driver/guide/getting-started/windows-ssh.mdx+++ b/docs/content/docs/cua-driver/guide/getting-started/windows-ssh.mdx@@ -1,11 +1,11 @@----title: Running cua-driver under SSH on Windows-description: The "daemon in interactive session + SSH-side proxy" workflow that makes cua-driver work headlessly over SSH on Windows.+title: Running Cua Driver under SSH on Windows+description: The "daemon in interactive session + SSH-side proxy" workflow that makes Cua Driver work headlessly over SSH on Windows.---import { Callout } from 'fumadocs-ui/components/callout';-The canonical headless / remote-driving setup for cua-driver on Windows is:+The canonical headless / remote-driving setup for Cua Driver on Windows is:1. A `cua-driver serve` daemon runs in the user's **interactive session** (Session 1+), kept alive by [`cua-driver autostart`](/cua-driver/guide/getting-started/autostart).2. You SSH into the same box (which lands in Session 0).@@ -18,7 +18,7 @@ This page explains why the proxy is necessary, how to wire it up, and the opt-ouWindows OpenSSH server runs in **Session 0** — the non-interactive services session. Sessions `1`, `2`, ... are interactive logons (one per console / RDP user). Every process inherits the session of its parent, so a shell spawned from `sshd` lands in Session 0 too.-The Win32 APIs that cua-driver's window tools bottom out in — `EnumWindows`, `GetForegroundWindow`, `PrintWindow`, UIA, `BitBlt` over the screen DC — are all scoped to the **calling process's WindowStation + Desktop**. Session 0 has no interactive desktop attached. So:+The Win32 APIs that Cua Driver's window tools bottom out in — `EnumWindows`, `GetForegroundWindow`, `PrintWindow`, UIA, `BitBlt` over the screen DC — are all scoped to the **calling process's WindowStation + Desktop**. Session 0 has no interactive desktop attached. So:```powershell# Over SSH (Session 0), with no daemon helper:@@ -26,7 +26,7 @@ cua-driver call list_windows# [] ← empty. The user's RDP session has 12 windows open.```-That's not a cua-driver bug — those APIs are working as designed against a session with no desktop. The same thing would happen to any native Win32 tool spawned the same way.+That's not a Cua Driver bug — those APIs are working as designed against a session with no desktop. The same thing would happen to any native Win32 tool spawned the same way.<Callout type="info">**Confirm with `cua-driver doctor`.** The Windows session probe surfaces this directly:@@ -37,6 +37,7 @@ That's not a cua-driver bug — those APIs are working as designed against a seswill return empty results — these APIs need an attached interactivedesktop.```+</Callout>## The fix: daemon in Session 1+, proxy from Session 0@@ -73,7 +74,7 @@ cua-driver autostart kick # start it now, don't wait for next logon# ── from SSH (or any session) ────────────────────────────────────────cua-driver status-# cua-driver daemon is running+# Cua Driver daemon is running# socket: \\.\pipe\cua-driver# pid: 12345# session: 2 ← daemon's in your interactive session@@ -88,7 +89,7 @@ claude # Claude Code's MCP tool calls proxy through**Prerequisite — the user must have an active interactive session.** Either:- An RDP client is connected, OR-- An RDP client *was* connected and has disconnected without logging off (the session stays in `Disc` state and is still considered active), OR+- An RDP client _was_ connected and has disconnected without logging off (the session stays in `Disc` state and is still considered active), OR- The user is logged in at the local console.Confirm with `query session` from any shell — the user row should show `Active` or `Disc`:@@ -102,6 +103,7 @@ query session```No interactive session means `autostart kick` has no Session 1+ to land the daemon in — `kick` will report success but the daemon won't have a desktop attached. Open an RDP session once and the autostart trigger will fire `serve` automatically next logon.+</Callout>## How the proxy decides whether to forward@@ -115,7 +117,7 @@ No interactive session means `autostart kick` has no Session 1+ to land the daemThere's no auto-spawn on Windows / Linux — unlike macOS, there's no `open -a CuaDriver` equivalent that could land a fresh daemon in the right session. If no daemon is listening when you run `cua-driver mcp`, the CLI bails with an actionable error:```text-no cua-driver daemon listening on \\.\pipe\cua-driver. Start one in your+no Cua Driver daemon listening on \\.\pipe\cua-driver. Start one in yourinteractive session — on Windows run `cua-driver autostart enable &&cua-driver autostart kick`; on Linux run `cua-driver serve &` in the user'ssession. Then re-run `cua-driver mcp`. To skip the proxy and run in-process@@ -127,6 +129,7 @@ anyway (Session 0 attribution, GUI tools will return empty), pass**Why `call` worked over SSH before v0.2.7 but `mcp` didn't.** The `call` CLI had its own daemon-proxy shortcut baked in from the start (the daemon is the only place the per-pid element cache lives, so `call` had to proxy to share state across invocations anyway). The `mcp` entrypoint was hardcoded to run in-process on Windows / Linux on the assumption that MCP clients spawn fresh subprocesses — true, but irrelevant: a fresh subprocess over SSH is still in Session 0. `cua-driver-rs` v0.2.7 ([PR #1580](https://github.com/trycua/cua/pull/1580)) lined the two entrypoints up so `mcp` proxies on the same conditions `call` does.If you're on v0.2.6 or earlier and saw empty MCP results over SSH while `cua-driver call list_apps` worked, upgrade — `irm https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.ps1 | iex`.+</Callout>## Wiring Claude Code over SSH@@ -159,7 +162,7 @@ Either form keeps `cua-driver mcp` in-process and the tool calls execute againstWalk this list before opening an issue:-1. **`cua-driver --version` on the SSH side reports `0.2.7` or later.** Earlier versions don't proxy `mcp` on Windows / Linux. Upgrade with the [install one-liner](/cua-driver/guide/getting-started/installation#install-cua-driver-rs-directly-linux--windows--macos).+1. **`cua-driver --version` on the SSH side reports `0.2.7` or later.** Earlier versions don't proxy `mcp` on Windows / Linux. Upgrade with the [install one-liner](/cua-driver/guide/getting-started/installation).2. **`cua-driver status` from SSH reports a running daemon.** If not, `cua-driver autostart status` will tell you whether the Scheduled Task is registered. Re-run `enable && kick` from an RDP session if not.3. **`query session` shows an `Active` or `Disc` row for your user.** No interactive session means no Session 1+ for the daemon to land in.4. **`cua-driver doctor` from RDP reports `[ok] interactive session: session N has an attached interactive desktop`** — confirms the daemon's session has a desktop attached. Run from the same session you registered autostart in.diff --git a/docs/content/docs/cua-driver/reference/cli-reference.mdx b/docs/content/docs/cua-driver/reference/cli-reference.mdxindex 99366a7493..c2fbb50c49 100644--- a/docs/content/docs/cua-driver/reference/cli-reference.mdx+++ b/docs/content/docs/cua-driver/reference/cli-reference.mdx@@ -4,9 +4,10 @@ description: Command Line Interface reference for Cua Driver---{/*- Synced to the cua-driver-rs 0.3.2 binary (cross-platform).- Source of truth: `cua-driver --help`. Per-verb flag introspection is not- exposed by the Rust CLI, so this page is maintained by hand against --help.+ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY+ Generated by: npx tsx scripts/docs-generators/cua-driver.ts+ Source: cua-driver dump-docs+ Version: 0.3.2*/}import { Callout } from 'fumadocs-ui/components/callout';@@ -20,173 +21,351 @@ import { VersionHeader } from '@/components/version-selector';installCommand="curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh | bash"/>-Cross-platform computer-use automation driver — MCP stdio server plus a shell CLI. The same binary serves macOS (Swift driver) and Windows / Linux (`cua-driver-rs`).+Cross-platform computer-use automation driver.-`cua-driver --help` prints the authoritative subcommand list; `cua-driver --version` prints the version. The subcommands are: `mcp`, `list-tools`, `describe`, `call`, `serve`, `stop`, `status`, `mcp-config`, `config`, `recording`, `update`, `check-update`, `doctor`, `diagnose`, `autostart`, `skills`.+## Tool dispatch-<Callout type="warn">-**Passing JSON on Windows PowerShell 5.1.** PowerShell 5.1 strips the quotes around JSON field names in multi-field arguments. Pipe the JSON via stdin instead, or use PowerShell 7+ (`pwsh`):+### cua-driver list-tools-```powershell-'{"pid":1234,"window_id":5678}' | cua-driver call get_window_state-```-</Callout>+List every registered MCP tool with a one-line description.-## Tool dispatch+### cua-driver describe-### cua-driver call+Print a tool's full description and JSON input schema.-Invoke an MCP tool directly from the shell — the same code path the MCP server uses.+**Arguments:**-```bash-cua-driver call <tool-name> '<json-args>'-```+| Name | Type | Required | Description |+| ---- | ---- | -------- | ----------- |+| `<tool-name>` | String | Yes | Name of the MCP tool to describe. |-`<json-args>` is a JSON object matching the tool's input schema. When it's omitted and stdin is a pipe, the JSON is read from stdin; when neither is provided, the tool is called with no arguments. When a daemon is running, `call` forwards to it (so the per-pid `element_index` cache is shared across invocations); use `--socket` to target a non-default daemon socket / pipe.+### cua-driver call-```bash-cua-driver call list_apps-cua-driver call launch_app '{"name":"Calculator"}'-echo '{"pid":844,"window_id":10725}' | cua-driver call get_window_state-```+Invoke an MCP tool directly from the shell.-### cua-driver list-tools+Runs the same handler the MCP server uses. JSON arguments may be passed as a positional JSON object or through stdin.-List every MCP tool with its one-line description.+**Arguments:**-### cua-driver describe+| Name | Type | Required | Description |+| ---- | ---- | -------- | ----------- |+| `<tool-name>` | String | Yes | Name of the MCP tool to invoke. |+| `<json-args>` | String | No | JSON object for the tool input schema. If omitted, stdin is read when piped. |-Print a tool's full description and JSON input schema.+**Options:**-```bash-cua-driver describe click-```+| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--screenshot-out-file` | String | — | Write the first image content block from the response to this path. |+| `--socket` | String | — | Override the daemon socket or named-pipe path. |## Daemon management### cua-driver mcp-Run the stdio MCP server. When spawned from an IDE terminal, `mcp` may proxy tool calls to a running `cua-driver serve` daemon so they execute under the right process identity — on macOS to inherit `CuaDriver.app`'s TCC grants, on Windows to reach the interactive desktop from a Session 0 SSH login. Tool semantics are identical to the in-process path. See the [process model](/cua-driver/guide/getting-started/process-model) and [SSH on Windows](/cua-driver/guide/getting-started/windows-ssh).+Run the stdio MCP server.++On macOS, shell-spawned MCP processes can auto-launch and proxy through a CuaDriver.app daemon so TCC grants attach to the bundle. On Windows and Linux, MCP proxies through an already-running daemon when one is listening.-**Flags / options:**+**Options:**++| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--socket` | String | — | Override the daemon socket or named-pipe path used by the proxy fallback. |++**Flags:**| Name | Description || ---- | ----------- |-| `--no-daemon-relaunch` | Stay in-process; skip the daemon proxy. Also settable via `CUA_DRIVER_RS_MCP_NO_RELAUNCH=1`. |-| `--socket <path>` | Override the daemon socket / pipe path used by the proxy. |-| `--experimental-pip` | Show an always-on-top window with the latest post-action screenshot + a one-line label. macOS only today; Windows / Linux print a not-yet-implemented notice. See [PiP Preview](/cua-driver/guide/getting-started/pip-preview). |-| `--experimental-pip-geometry <WxH[+X+Y]>` | Override the PiP window size / position. Default `480x360` in the top-right corner. |+| `--no-daemon-relaunch` | Stay in-process instead of proxying through a daemon. |+| `--claude-code-computer-use-compat` | Expose the Claude Code computer-use compatibility screenshot surface. |### cua-driver serve-Run cua-driver as a long-running daemon. Subsequent `cua-driver call` / `mcp` invocations auto-detect the daemon and forward to it, so the per-pid `element_index` cache survives across CLI calls. Accepts the same `--experimental-pip` / `--experimental-pip-geometry` flags as `mcp`.+Run Cua Driver as a long-running daemon.++The daemon owns per-process state such as element-index caches, recording state, and cursor overlay state.++**Options:**++| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--socket` | String | — | Override the daemon socket or named-pipe path. |+| `--pid-file` | String | — | Override the pid-file path on Unix targets. |++**Flags:**++| Name | Description |+| ---- | ----------- |+| `--no-permissions-gate` | Skip the macOS first-launch permissions gate. |### cua-driver stopAsk the running daemon to exit gracefully.+**Options:**++| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--socket` | String | — | Override the daemon socket or named-pipe path. |+### cua-driver status-Report whether a daemon is running, and its socket / pipe path and pid.+Report whether a Cua Driver daemon is running.++**Options:**++| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--socket` | String | — | Override the daemon socket or named-pipe path. |+| `--pid-file` | String | — | Override the pid-file path on Unix targets. |### cua-driver mcp-config-Print the MCP server config JSON, or a client-specific snippet with `--client <name>` (`claude`, `codex`, `cursor`, `antigravity`, `openclaw`, `opencode`, `hermes`, `pi`; `gemini` is a legacy alias for `antigravity`). See [Integrations](/cua-driver/guide/getting-started/integrations).+Print MCP server config or a client-specific install command.-```bash-cua-driver mcp-config --client cursor-```+Supported clients include claude, codex, cursor, antigravity, openclaw, opencode, hermes, and pi.++**Options:**++| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--client` | String | — | Client name to print configuration for. |## Trajectory recording### cua-driver recording-Control the trajectory recorder on a running daemon (recording state lives in the daemon, so these require `cua-driver serve`). Wraps the `start_recording` / `stop_recording` / `get_recording_state` tools with human-friendly output.+Control trajectory recording on a running daemon.++Recording state lives in-process, so use a daemon for multi-call sessions.-```bash-cua-driver recording start ~/cua-trajectories/demo1 # video on by default-cua-driver recording status-cua-driver recording stop-```+**Options:**-Video capture is on by default (macOS uses ScreenCaptureKit; Windows / Linux use an ffmpeg subprocess). See the [`start_recording` tool](/cua-driver/reference/mcp-tools#start_recording) for the per-turn folder layout and the `record_video` opt-out.+| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--socket` | String | — | Override the daemon socket or named-pipe path. |++#### cua-driver recording start++Start trajectory recording to a directory.++**Arguments:**++| Name | Type | Required | Description |+| ---- | ---- | -------- | ----------- |+| `<output-dir>` | String | Yes | Directory to write turn folders into. |++#### cua-driver recording stop++Stop trajectory recording.++#### cua-driver recording status++Print the current recording state.++#### cua-driver recording render++Render a recorded trajectory directory to an MP4.++This pure file-to-file path does not require a running daemon.++**Arguments:**++| Name | Type | Required | Description |+| ---- | ---- | -------- | ----------- |+| `<input-dir>` | String | Yes | Trajectory directory containing recorded turn folders. |+| `<out-mp4>` | String | Yes | Output MP4 path. |++**Options:**++| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--scale` | Number | — | Scale factor for rendered frames. |++**Flags:**++| Name | Description |+| ---- | ----------- |+| `--no-zoom` | Disable cursor/action zoom effects in the rendered video. |## Configuration### cua-driver config-Read and write the persistent driver config. Values take effect immediately and survive daemon restarts.+Read or mutate persistent driver configuration.++Without a subcommand, prints the full config.++**Options:**++| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--socket` | String | — | Override the daemon socket or named-pipe path. |++#### cua-driver config show++Print the full config.++#### cua-driver config get++Print one config key.-```bash-cua-driver config get capture_mode-cua-driver config set capture_mode som-cua-driver config set update_check_enabled false-```+**Arguments:**-Known keys: `capture_mode` (`vision` | `ax` | `som`), `max_image_dimension` (integer), `update_check_enabled` (boolean), `experimental_pip` (boolean), `experimental_pip_geometry` (string). Telemetry can also be toggled per-environment with `CUA_DRIVER_RS_TELEMETRY_ENABLED=0`.+| Name | Type | Required | Description |+| ---- | ---- | -------- | ----------- |+| `<key>` | String | Yes | Config key to read. |-## Updating+#### cua-driver config set++Set one config key.++**Arguments:**++| Name | Type | Required | Description |+| ---- | ---- | -------- | ----------- |+| `<key>` | String | Yes | Config key to write. |+| `<value>` | String | Yes | Value to store. |++#### cua-driver config reset++Reset config to defaults.++## Diagnostics### cua-driver check-update-Ask GitHub whether a newer release is available. Read-only — never installs. Human-friendly text by default.+Check whether a newer cua-driver release is available.++Read-only. Uses the same update-state payload as the check_for_update MCP tool.++**Flags:**| Name | Description || ---- | ----------- |-| `--json` | Emit a machine-readable payload (same shape as the `check_for_update` MCP tool). |-| `--no-cache` | Skip the 20-hour on-disk cache and force a fresh GitHub round-trip. |+| `--json` | Emit a machine-readable JSON payload. |+| `--no-cache` | Skip the 20-hour on-disk cache and force a GitHub request. |### cua-driver update-The same check as `check-update`, then suggests `--apply` when outdated.+Check for an update and optionally apply it.++The apply path delegates to the canonical platform installer scripts.++**Flags:**| Name | Description || ---- | ----------- |-| `--apply` | Download and install the latest release via the canonical installer. |-| `--json` | Emit the structured check payload (does not change `--apply` behavior). |+| `--apply` | Download and install the latest release when one is available. |+| `--json` | Emit the structured update-state payload. |-See [Updating](/cua-driver/guide/getting-started/updating) for the full workflow.+### cua-driver doctor-## Diagnostics+Run platform-aware diagnostic probes.-### cua-driver doctor+Exit code is non-zero when any probe is an error.-Run a structured environment + install-health report — version, install layout, telemetry, and platform-specific probes (TCC + LaunchAgent on macOS; UI Automation + interactive desktop session on Windows; X11/Wayland + AT-SPI on Linux). Pass `--json` for a scripting-friendly shape; the exit code is non-zero only when a probe reports an error.+**Flags:**++| Name | Description |+| ---- | ----------- |+| `--json` | Emit the probe report as JSON. |### cua-driver diagnose-Print a paste-able support report (bundle path / cdhash / TCC status on macOS; equivalent identity + permission details elsewhere) for attaching to issues.+Print a pasteable install-layout and permission-attribution report.-## Autostart+## Other commands### cua-driver autostart-Keep a `cua-driver serve` daemon running in the user's interactive session across logons (Windows-only today; macOS / Linux point at the manual recipe). See [Autostart](/cua-driver/guide/getting-started/autostart).+Manage platform-native daemon autostart.-| Subcommand | Description |-| ---- | ----------- |-| `enable` | Register a logon Scheduled Task so `serve` starts at every interactive logon. |-| `disable` | Remove the autostart entry. No-op if not registered. |-| `status` | Print whether the entry is registered and whether the daemon is running. |-| `kick` | Start the entry now without re-logging. |+Windows registers a logon Scheduled Task. macOS and Linux currently print manual-recipe guidance.++#### cua-driver autostart enable++Register the autostart entry.++#### cua-driver autostart disable-## Skills+Remove the autostart entry.++#### cua-driver autostart status++Print whether autostart is registered and running.++#### cua-driver autostart kick++Start the autostart entry now without re-logging.### cua-driver skills-Manage the agent skill pack — symlink the versioned SKILL.md into each detected agent's skills directory (Claude Code, Codex, OpenClaw, OpenCode).+Install, update, inspect, or remove the optional agent skill pack.++The install script never touches agent skill directories automatically.++#### cua-driver skills install-| Subcommand | Description |+Fetch the versioned skill pack and link detected agents.++**Options:**++| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--agent` | String | — | Restrict linking to one agent. |+| `--from` | String | — | Fetch from a source such as main instead of the tagged release. |++**Flags:**++| Name | Description |+| ---- | ----------- |+| `--all-platforms` | Keep platform-specific skill files for every platform. |++#### cua-driver skills update++Refresh the local skill pack and links.++#### cua-driver skills uninstall++Remove agent skill links.++**Flags:**++| Name | Description |+| ---- | ----------- |+| `--all` | Also delete the local skill-pack copy. |++#### cua-driver skills status++Report local skill-pack and per-agent link state.++#### cua-driver skills path++Print the local skill-pack path.++### cua-driver dump-docs++Output machine-readable CLI and MCP documentation JSON.++Used by the docs generator to keep reference pages in sync with the live binary.++**Options:**++| Name | Type | Default | Description |+| ---- | ---- | ------- | ----------- |+| `--type` | String | all | Which docs to emit: all, cli, or mcp. |++**Flags:**++| Name | Description || ---- | ----------- |-| `install` | Fetch the skill pack from GitHub Releases and symlink it into each agent. Idempotent; never overwrites existing user links. Add `--from main` to fetch from the main branch instead of the tagged release. |-| `update` | Re-fetch the skill pack, refreshing the local copy and links. |-| `uninstall` | Remove the agent symlinks. Add `--all` to also delete the local copy. |-| `status` | Report local install state and per-agent link state. Read-only. |-| `path` | Print where the local skill pack lives. |+| `-p`, `--pretty` | Pretty-print JSON. |## Global optionsAvailable on all commands:-- `--help` — Show help information (the authoritative subcommand + flag list).-- `--version` — Show the version number.+- `--help` — Show help information.+- `--version` — Show version number.diff --git a/docs/content/docs/cua-driver/reference/limits.mdx b/docs/content/docs/cua-driver/reference/limits.mdxindex ff49a65d56..5216f57cac 100644--- a/docs/content/docs/cua-driver/reference/limits.mdx+++ b/docs/content/docs/cua-driver/reference/limits.mdx@@ -1,11 +1,11 @@---title: Known limits-description: What cua-driver can't do, and the workarounds+description: What Cua Driver can't do, and the workarounds---import { Callout } from 'fumadocs-ui/components/callout';-cua-driver's no-foreground contract holds for every app the driver reaches via AX or via the SkyLight-routed pixel click. Four categories of target fall outside that envelope. Each is documented here with the workaround.+Cua Driver's no-foreground contract holds for every app the driver reaches via AX or via the SkyLight-routed pixel click. Four categories of target fall outside that envelope. Each is documented here with the workaround.## Chromium coerces synthetic right-clicks on web content@@ -19,7 +19,8 @@ cua-driver's no-foreground contract holds for every app the driver reaches via A2. For context menus on pure web content (nothing in the AX tree), activate Chrome briefly and fall back to a HID-tap right-click. Breaks the no-foreground-steal promise for that one click.<Callout type="info">-Element-indexed right-click (`right_click({pid, element_index})`) works fine. The limit is specifically pixel right-click on non-AX Chromium web content.+ Element-indexed right-click (`right_click({(pid, element_index)})`) works fine. The limit is+ specifically pixel right-click on non-AX Chromium web content.</Callout>## Canvas apps need brief frontmost activation@@ -28,12 +29,14 @@ Element-indexed right-click (`right_click({pid, element_index})`) works fine. Th**Symptom:** `click({pid, x, y})` on a Blender viewport silently no-ops. `launch_app` works, the window is visible, the tree says nothing actionable is there. Clicks vanish.-**Cause:** These apps only accept events from `cghidEventTap` with a leading `mouseMoved`. They explicitly filter out per-pid-routed events, which is the path cua-driver uses for its backgrounded dispatch. There's no per-pid recipe that reaches them.+**Cause:** These apps only accept events from `cghidEventTap` with a leading `mouseMoved`. They explicitly filter out per-pid-routed events, which is the path Cua Driver uses for its backgrounded dispatch. There's no per-pid recipe that reaches them.**Workaround:** The driver auto-detects these targets and falls back to a brief activation + HID-tap click. The cursor visibly warps. The activation is the shortest possible and the click fires within the same event loop turn, so focus returns to the user's previous app within a frame or two, but the warp is noticeable.<Callout type="warn">-If you're automating Blender or a game, the no-foreground-steal contract does not apply. The driver will tell you: the `click` response includes `dispatch: "hid_tap"` when the HID fallback fired.+ If you're automating Blender or a game, the no-foreground-steal contract does not apply. The+ driver will tell you: the `click` response includes `dispatch: "hid_tap"` when the HID fallback+ fired.</Callout>## Off-Space SwiftUI windows strip their AX tree@@ -42,7 +45,7 @@ If you're automating Blender or a game, the no-foreground-steal contract does no**Cause:** macOS 14+ strips AX detail from non-current-Space SwiftUI windows as a privacy / performance tradeoff. AppKit apps are not affected. This is an Apple design decision; no workaround exists that keeps the window off-Space.-**Response shape:** cua-driver surfaces this explicitly. Every `get_window_state` response on an off-current-Space window carries `off_space: true` plus the `window_space_ids` array, so callers can decide to switch Space, pick a different window, or skip the turn.+**Response shape:** Cua Driver surfaces this explicitly. Every `get_window_state` response on an off-current-Space window carries `off_space: true` plus the `window_space_ids` array, so callers can decide to switch Space, pick a different window, or skip the turn.**Workarounds:**@@ -63,16 +66,17 @@ If you're automating Blender or a game, the no-foreground-steal contract does no3. Un-minimize the window (`hotkey({pid, keys: ["cmd", "m"]})` or click the Dock icon). Breaks the background contract for that window.<Callout type="info">-`set_value` is usually the right answer. It sidesteps both the minimized-focus issue and the general "which event commits this field" ambiguity.+ `set_value` is the right answer 90% of the time. It sidesteps both the minimized-focus issue and+ the general "which event commits this field" ambiguity.</Callout>## Permission boundaries-cua-driver is constrained by the usual macOS permission model. Two relevant grants:+Cua Driver is constrained by the usual macOS permission model. Two relevant grants:- **Accessibility** (System Settings → Privacy & Security → Accessibility) is required for every AX read, every element-indexed click, every keyboard / text primitive. Without it, `check_permissions` returns `accessibility: false` and every tool returns a structured error.- **Screen Recording** is required for screenshots and for the `som` / `vision` capture modes. Without it, `get_window_state` in those modes returns a tree but no PNG; pure `ax` mode still works.-Grants are tied to the `CuaDriver.app` bundle identity. Rebuilding cua-driver from source preserves the grants because `build-app.sh` pins a stable bundle id (`com.trycua.driver`).+Grants are tied to the `CuaDriver.app` bundle identity. Rebuilding Cua Driver from source preserves the grants because `build-app.sh` pins a stable bundle id (`com.trycua.driver`).See [Installation](/cua-driver/guide/getting-started/installation) for the grant flow.diff --git a/docs/content/docs/cua-driver/reference/mcp-tools.mdx b/docs/content/docs/cua-driver/reference/mcp-tools.mdxindex 6b797b36cc..0becf40005 100644--- a/docs/content/docs/cua-driver/reference/mcp-tools.mdx+++ b/docs/content/docs/cua-driver/reference/mcp-tools.mdx@@ -1,55 +1,91 @@---title: MCP Tools-description: Reference for every MCP tool cua-driver exposes+description: Reference for every MCP tool Cua Driver exposes---{/*- Synced to the cua-driver-rs 0.3.2 binary (cross-platform).- Regenerate with: cua-driver list-tools + cua-driver describe <tool>- Tool descriptions are emitted by the running binary, so they reflect the- platform you introspected on (this file was synced from the Windows build).- Where the macOS Swift driver differs, it is called out inline.+ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY+ Generated by: npx tsx scripts/docs-generators/cua-driver.ts+ Source: cua-driver dump-docs+ Version: 0.3.2*/}import { Callout } from 'fumadocs-ui/components/callout';-`cua-driver` exposes 34 MCP tools through a single stdio server (`cua-driver mcp`). Every tool is also callable from the shell as `cua-driver call <name> '<JSON-args>'`.+`cua-driver` exposes 33 MCP tools through a single stdio server (`cua-driver mcp`). Every tool is also callable from the shell as `cua-driver <name> '<JSON-args>'`.-Tool names are `snake_case`. Responses are MCP `CallTool.Result` envelopes: a text block prefixed with a `✅` summary (or the error reason on failure), plus optional image or structured-content blocks on tools that produce them. See the [CLI reference](/cua-driver/reference/cli-reference) for shell flags like `--raw` and `--screenshot-out-file`.+Tool names are `snake_case`. Responses are MCP `CallTool.Result` envelopes: a text content block prefixed with a `✅` summary (or the error reason on failure), plus optional image or structured-content blocks on tools that produce them. See the [CLI reference](/cua-driver/reference/cli-reference) for CLI-specific options like `--socket` and `--screenshot-out-file`.<Callout type="info">- Tool names match the CLI form exactly. `cua-driver call list_apps` and the MCP `list_apps` tool run the same code path.+ Tool names here match the CLI form exactly. `cua-driver list_apps` and the MCP `list_apps` tool run the same code path.</Callout><Callout type="info">- **Two backends, one tool surface.** macOS ships the Swift driver by default (Accessibility / `CGEvent` / ScreenCaptureKit); Windows and Linux ship `cua-driver-rs` (UI Automation / `PostMessage` / ffmpeg). The tool names, arguments, and response shapes are the same on both. Descriptions below are synced from the Rust port and note the macOS-Swift behavior where it diverges. A few tools (`bring_to_front`, `kill_app`, `debug_window_info`, `get_accessibility_tree`) are Windows-first; the macOS Swift driver returns a pointer to the platform-native alternative.+ **TCC auto-delegation.** When an MCP client spawns `cua-driver mcp` from an IDE terminal (Claude Code, Cursor, VS Code, Warp), macOS attributes the subprocess to the parent terminal — not `CuaDriver.app` — so AX probes fail against the wrong bundle id. `mcp` detects this and auto-launches a `cua-driver serve` daemon via `open -n -g -a CuaDriver --args serve`, then proxies every tool call through the daemon's Unix socket. Tool semantics are identical to the in-process path; no Python bridge is needed. Pass `--no-daemon-relaunch` (or set `CUA_DRIVER_MCP_NO_RELAUNCH=1`) to force in-process execution. See the [process model guide](/cua-driver/guide/getting-started/process-model) for the full lifecycle, failure modes, and wrapper-author guidance.</Callout>-<Callout type="info">- **Daemon proxy.** When an MCP client spawns `cua-driver mcp` from an IDE terminal, the call may need to run under a different process identity than the spawning shell — on macOS to inherit `CuaDriver.app`'s TCC grants, on Windows to reach the interactive desktop from a Session 0 SSH login. `mcp` handles this by proxying to a running `cua-driver serve` daemon; tool semantics are unchanged. See the [process model](/cua-driver/guide/getting-started/process-model) (macOS) and [SSH on Windows](/cua-driver/guide/getting-started/windows-ssh) guides.-</Callout>+## Inspection tools++### list_apps-## Dispatch modes+List macOS apps — both currently running and installed-but-not-running — with per-app state flags:-Every pointer and keyboard tool on the Rust port takes an optional `dispatch` field controlling how the event is delivered:+- running: is a process for this app live? (pid is 0 when false)+- active: is it the system-frontmost app? (implies running)+- launch_path: filesystem path to the `.app` bundle, when known. Pass this to `launch_app` to start the app cold.+- kind: `"desktop"` for `.app` bundles on macOS.+- last_used: RFC3339 timestamp from the bundle's filesystem mtime, when readable; otherwise null.-- **`background`** (default) — never swaps the foreground window. Element-indexed actions and UIA-hit-tested pixel clicks deliver through the accessibility channel with no focus steal or visible flash. If a target's input stack would silently drop a backgrounded event (Chromium DOM content, GTK button widgets), the tool returns a structured `background_unavailable` error rather than failing silently.-- **`foreground`** — accepts a brief `SetForegroundWindow` swap (the `SendInput` path). Required to drive Chromium-content or GTK-widget targets reliably. Pair with [`bring_to_front`](#bring_to_front) to pay the foreground cost once for a sequence of calls instead of per call.-- **`auto`** — the driver's internal heuristics, with silent fallback to `SendInput` on known-problematic targets.+Only apps with NSApplicationActivationPolicyRegular are included — background helpers and system UI agents are filtered out. Installed apps come from scanning /Applications, /Applications/Utilities, ~/Applications, /System/Applications, and /System/Applications/Utilities.-The macOS Swift driver keeps everything backgrounded by default and exposes the same field for parity.+Use 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.-## Permissions and discovery+**Arguments:** none.-### check_permissions+### list_windows++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.++Per-record fields: window_id, pid, app_name, title, bounds (x/y/width/height, top-left origin), z_index (higher = frontmost), is_on_screen, on_current_space.++**Arguments:**++- `on_screen_only` (boolean, optional): When true, drop windows not on the current Space. Default false.+- `pid` (integer, optional): Optional pid filter. When set, only this pid's windows are returned.++### get_window_state++Walk a running app's AX tree and return a Markdown rendering of its UI, tagging every actionable element with [element_index N]. Pass those indices to click, type_text, press_key, etc.++INVARIANT: call get_window_state once per turn per (pid, window_id) before any element-indexed action. The index map is replaced by the next snapshot.++Also captures a PNG screenshot of the specified window.++Optional `query` filters the tree_markdown to matching lines plus their ancestor chain (case-insensitive substring). The element_index values are unchanged — filtering only trims the rendered Markdown.++**Arguments:**++- `capture_mode` (string, optional): som=AX+screenshot (default), vision=screenshot only (no AX walk), ax=AX only (no screenshot).+- `pid` (integer, required): Target process ID.+- `query` (string, optional): Case-insensitive filter for tree_markdown.+- `screenshot_out_file` (string, optional): 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.+- `window_id` (integer, required): Target window ID from list_windows.++```json+{"pid":844,"window_id":10725}+```-Check required permissions. On Windows this reports UI Automation availability, PostMessage access, and the daemon's integrity level; on macOS it reports the Accessibility and Screen Recording TCC grants and raises the system prompts for any that are missing.+### get_accessibility_tree++Return a lightweight snapshot of the desktop: running regular apps and on-screen visible windows with their bounds, z-order, and owner pid.++For 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.**Arguments:** none.### get_screen_size-Return the logical size of the main display in points plus its backing scale factor. Agents click in points; Retina displays report `scale_factor` 2.0. Requires no special permissions.+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.**Arguments:** none.@@ -59,488 +95,498 @@ Return the current mouse cursor position in screen points (origin top-left).**Arguments:** none.-### list_apps+### get_config-List apps — both currently running and installed-but-not-running — with per-app state flags: `running`, `active` (system-frontmost), `kind` (`"desktop"` or `"uwp"`), `launch_path` (what `launch_app` consumes), and `last_used`. Use it for "is X installed?" as well as "is X running?". For per-window state, call `list_windows` instead. Opening an app does not require this first — call `launch_app` directly.+Return the current cua-driver-rs configuration.**Arguments:** none.-### list_windows+### get_recording_state-List every top-level window known to the window manager. Each record self-contains its owning app identity, so callers never join back against `list_apps`. Per-record fields: `window_id` (HWND on Windows, CGWindowID on macOS), `pid` + `app_name`, `title`, `bounds`, `layer`, `z_index`, `is_on_screen`. The macOS-only `on_current_space` / `space_ids` fields are omitted on Windows.+Report the current trajectory recorder state: whether recording is enabled, the output directory (when enabled), and the 1-based counter for the next turn folder that will be written. Counter increments on every recorded action tool call and resets to 1 each time recording is (re-)enabled.-**Arguments:**+Pure read-only.-- `pid` (integer, optional): Restrict the result to one pid's windows.-- `on_screen_only` (boolean, optional): Drop windows that aren't currently on-screen. Default false.+**Arguments:** none.-### get_accessibility_tree+### get_agent_cursor_state-Return a lightweight snapshot of the desktop: running processes and on-screen visible windows with their bounds and owner pid. This is a fast discovery read — for the full UIA subtree of a single window with clickable element indices, use [`get_window_state`](#get_window_state). Windows-first.+Return the current state of all agent cursor instances: position, config (color, icon, label, size, opacity), enabled flag.**Arguments:** none.-### get_window_state+## Action tools++### launch_app++Launch a macOS app in the background — the target does NOT come to the foreground.++Provide either `bundle_id` (preferred — unambiguous, e.g. `com.apple.calculator`) or `name` (e.g. "Calculator"). If both are given, bundle_id wins.-Walk a running app's UIA tree (AX tree on macOS) and return a Markdown rendering of its UI, tagging every actionable element with `[element_index N]`. Pass those indices to `click`, `type_text`, `scroll`, etc. — those tools resolve the index to the cached element on the server.+Optional `urls` are handed to the app as open targets — for Finder, pass a folder path to open a backgrounded Finder window there.-INVARIANT: call `get_window_state` once per turn per `(pid, window_id)` before any element-indexed action against that window. The index map is replaced by the next snapshot of the same `(pid, window_id)`.+Optional `electron_debugging_port`: opens a Chrome DevTools Protocol (CDP) server on the specified port (appends --remote-debugging-port=N to the app's argv). Use this to automate Electron/VS Code/Cursor via CDP.-The tree walked is the window's tree (HWND-scoped); the screenshot and bounds come from the same `window_id`. `window_id` must belong to `pid`, or the call returns `isError: true` — the driver never picks a window implicitly. Set `query` to a case-insensitive substring to trim `tree_markdown` to matching lines plus their ancestor chain; element indices and `element_count` are unchanged.+Optional `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.-`capture_mode` controls the response shape (default `som`):+Optional `creates_new_application_instance`: when true, forces a new app instance even if one is already running (passes -n to open).-- `som` — walks the tree **and** captures a screenshot. Element-indexed clicks work out of the box; the screenshot is there for disambiguation.-- `vision` — screenshot only; the tree walk is skipped and the element cache is not updated. Pair with pixel-addressed `click({pid, x, y})`.-- `ax` — tree only; no screenshot (no Screen Recording cost on macOS).+Optional `additional_arguments`: extra argv strings appended after --args.-On Windows the Rust port has no standalone `screenshot` tool — the window screenshot is delivered inside `get_window_state` (`som` / `vision`). The macOS Swift driver still exposes a separate `screenshot` tool.+Returns 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)`. 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.**Arguments:**-- `pid` (integer, required): Process ID from `list_apps`.-- `window_id` (integer, required): HWND of the target window. Must belong to `pid`. Enumerate via `list_windows` or read from `launch_app`'s `windows` array.-- `capture_mode` (string, optional): `som` (default), `vision`, or `ax`.-- `query` (string, optional): Case-insensitive substring filter on `tree_markdown`.+- `additional_arguments` (array of string, optional): Extra arguments appended after --args when launching.+- `bundle_id` (string, optional): App bundle identifier, e.g. com.apple.calculator. Preferred over name.+- `creates_new_application_instance` (boolean, optional): When true, force a new app instance even if already running (open -n).+- `electron_debugging_port` (integer, optional): Open a Chrome DevTools Protocol server on this port (appends --remote-debugging-port=N).+- `name` (string, optional): App display name. Used only when bundle_id is absent.+- `urls` (array of string, optional): Optional file paths or URLs to open with the app (e.g. a folder path for Finder).+- `webkit_inspector_port` (integer, optional): Open a WebKit inspector server on this port (sets WEBKIT_INSPECTOR_SERVER env var).++### kill_app++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.++**Arguments:**++- `pid` (integer, required): PID of the process to terminate.```json-{"pid":844,"window_id":10725}+{"pid":844}```-### debug_window_info+### bring_to_front-Diagnostic: dump everything cua-driver sees about a pid's top-level windows from the daemon's session perspective — window class names, owning `.exe` basename + path, and (when UI Automation succeeds) the focused element with the list of patterns it supports (`ValuePattern`, `InvokePattern`, `TextPattern`, `TogglePattern`, …). Used to design and debug input routing for XAML / UWP / WinUI3 targets. Windows-only.+Activate a window so subsequent input tools with `dispatch:"foreground"` land on it without a per-call SetForegroundWindow flash. **Windows-only:** on macOS this tool returns an error pointing to the platform-native `NSRunningApplication.activate` (which the macOS input tools don't need because CGEvent.postToPid reaches backgrounded windows). On Linux this tool also stubs out; use `wmctrl -a` or `xdotool windowactivate` if you need explicit activation.**Arguments:**-- `pid` (integer, required): PID of the process to inspect.+- `pid` (integer, required)+- `window_id` (integer, optional)```json{"pid":844}```-## Pointer input-### click-Left-click against a target pid. **Prefer `element_index` over pixel coordinates** — it works on backgrounded / minimized / hidden / off-desktop windows, surfaces a stable handle, and tells you what you're clicking via the cached element's role + label. Reach for `x, y` only on a canvas / video / WebGL / custom-drawn surface that doesn't appear in the UIA tree.+Left-click against a target pid. **Prefer `element_index` over pixel coordinates** — element_index works on backgrounded / minimized / hidden / off-Space windows, surfaces a stable handle that survives rebuilds, 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.-- `element_index` + `window_id` (from the last `get_window_state` of that window) — performs the UIA Invoke pattern on the cached element via PostMessage. No cursor move, no focus steal. Requires a prior `get_window_state(pid, window_id)` this turn.-- `x`, `y` (window-local screenshot pixels) — on `dispatch:"background"` / `"auto"`, the driver first does a UIA hit-test at the resolved position: if the deepest invokable element exposes `InvokePattern`, it's invoked through the accessibility channel (flash-free, even on UWP / WinUI3 / Win11 packaged apps). The `PostMessage(WM_LBUTTONDOWN/UP)` fallback only runs when the hit-test misses, and returns `background_unavailable` if PostMessage is known to drop on that target — at which point switch to `dispatch:"foreground"`.+Two addressing modes:-Exactly one of `element_index` or (`x` AND `y`) must be provided; `pid` is required in both. After a `zoom` call, pass `from_zoom=true` to translate zoom-image coords back to full-window space.+- element_index + window_id (from last get_window_state): AX action path. Works on backgrounded/hidden windows. No cursor move, no focus steal. element_index cache is scoped per (pid, window_id) and is replaced by the next snapshot of the same window — re-snapshot every turn before clicking.++- 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.++action: press (default), show_menu, pick, confirm, cancel, open.+from_zoom: set true after a zoom call to auto-translate zoom-image pixel coordinates to full-window space.**Arguments:**+- `action` (string, optional): AX action: press, show_menu, pick, confirm, cancel, open.+- `count` (integer, optional): Click count (pixel path only). Default 1.+- `debug_image_out` (string, optional): 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.+- `element_index` (integer, optional): Element index from last get_window_state.+- `from_zoom` (boolean, optional): When true, x and y are in the last zoom image for this pid; driver translates back to full-window coordinates.+- `modifier` (array of string, optional): Modifier keys: cmd, shift, option/alt, ctrl.- `pid` (integer, required): Target process ID.-- `element_index` (integer, optional): Index from the last `get_window_state` for the same `(pid, window_id)`.-- `window_id` (integer, optional): HWND for the window that produced the `element_index`. Required when `element_index` is used.-- `x` (number, optional): X in window-local screenshot pixels. Provide together with `y`.-- `y` (number, optional): Y in window-local screenshot pixels. Provide together with `x`.-- `button` (string, optional): `left` (default), `right`, or `middle`. Windows-only convenience; macOS exposes right-click as a separate `right_click` tool.-- `count` (integer, optional): 1 (single), 2 (double), 3 (triple). Default 1.-- `dispatch` (string, optional): `background` (default), `foreground`, or `auto`. See [Dispatch modes](#dispatch-modes).-- `from_zoom` (boolean, optional): Coordinates are in the last `zoom` image for this pid.+- `window_id` (integer, optional): Target window ID. Required for element_index.+- `x` (number, optional): Window-local screenshot X coordinate.+- `y` (number, optional): Window-local screenshot Y coordinate.```json-{"pid":844,"window_id":10725,"element_index":14}+{"pid":844}```### double_click-Double-click against a target pid. `element_index` + `window_id` synthesizes a stamped pixel double-click at the element's cached on-screen center; `x`, `y` posts two `WM_LBUTTONDOWN/UP` pairs to the deepest child window at that point. Exactly one addressing mode; `pid` required in both. The `modifier` field is accepted for macOS parity (no-op on Windows — PostMessage doesn't propagate modifier-key state).+Double-click at (x, y) or on an AX element identified by element_index + window_id.++AX path (element_index 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.++Pixel path (x, y provided): two down/up pairs ~80 ms apart at the given coordinates.**Arguments:**-- `pid` (integer, required): Target process ID.-- `element_index` (integer, optional): Index from the last `get_window_state`. Requires `window_id`.-- `window_id` (integer, optional): HWND for the target window.-- `x` / `y` (number, optional): Window-local screenshot pixels; provide together.-- `dispatch` (string, optional): See [Dispatch modes](#dispatch-modes).-- `from_zoom` (boolean, optional): Coordinates are in the last `zoom` image for this pid.-- `modifier` (array of string, optional): Accepted for parity; no-op on Windows.+- `element_index` (integer, optional): Element index from last get_window_state. Uses AX path.+- `pid` (integer, required)+- `window_id` (integer, optional): CGWindowID. Required when element_index is used.+- `x` (number, optional): Screen X coordinate (pixel path).+- `y` (number, optional): Screen Y coordinate (pixel path).```json-{"pid":844,"window_id":10725,"element_index":14}+{"pid":844}```### right_click-Right-click against a target pid. `element_index` + `window_id` posts `WM_RBUTTONDOWN/UP` at the element's cached on-screen center; `x`, `y` posts to the deepest child window at that point. Exactly one addressing mode; `pid` required in both. `modifier` is accepted for macOS parity (no-op on Windows).+Right-click against a target pid. Two addressing modes:-<Callout type="info">- Right-click on Chromium **web content** via pixel coordinates is coerced to a left-click by the renderer on every synthetic path. Use `element_index` on AX/UIA-addressable targets (links, buttons, toolbar items). See [Limits](/cua-driver/reference/limits).-</Callout>+- `element_index` + `window_id` (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.++- `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).++Exactly one of `element_index` or (`x` AND `y`) must be provided. `pid` always required. `window_id` required when `element_index` is used.**Arguments:**+- `element_index` (integer, optional): Element index from last get_window_state. Routes through AXShowMenu. Requires window_id.+- `modifier` (array of string, optional): Modifier keys held during the right-click: cmd/shift/option/ctrl. Pixel path only.- `pid` (integer, required): Target process ID.-- `element_index` (integer, optional): Index from the last `get_window_state`. Requires `window_id`.-- `window_id` (integer, optional): HWND for the target window.-- `x` / `y` (number, optional): Window-local screenshot pixels; provide together.-- `dispatch` (string, optional): See [Dispatch modes](#dispatch-modes).-- `from_zoom` (boolean, optional): Coordinates are in the last `zoom` image for this pid.-- `modifier` (array of string, optional): Accepted for parity; no-op on Windows.+- `window_id` (integer, optional): CGWindowID. Required when element_index is used.+- `x` (number, optional): X in window-local screenshot pixels. Must be provided together with y.+- `y` (number, optional): Y in window-local screenshot pixels. Must be provided together with x.```json-{"pid":844,"window_id":10725,"element_index":14}+{"pid":844}```### drag-Press-drag-release gesture from (`from_x`, `from_y`) to (`to_x`, `to_y`) in window-local screenshot pixels. Use it for marquee selection, drag-and-drop, resizing via a handle, or scrubbing a slider. `duration_ms` (default 500) is the wall-clock budget; `steps` (default 20) interpolates intermediate `WM_MOUSEMOVE` events along the path. No focus steal. After a `zoom`, pass `from_zoom=true`.+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.-**Arguments:**--- `pid` (integer, required): Target process ID.-- `from_x` (number, required): Drag-start X in window-local screenshot pixels.-- `from_y` (number, required): Drag-start Y.-- `to_x` (number, required): Drag-end X.-- `to_y` (number, required): Drag-end Y.-- `button` (string, optional): `left` (default), `right`, `middle`.-- `duration_ms` (integer, optional): Wall-clock duration of the path. Default 500.-- `steps` (integer, optional): Intermediate move events. Default 20.-- `dispatch` (string, optional): See [Dispatch modes](#dispatch-modes).-- `from_zoom` (boolean, optional): Coordinates are in the last `zoom` image for this pid.-- `modifier` (array of string, optional): Modifier keys held across the gesture.-- `window_id` (integer, optional): HWND the coordinates were measured against. Driver picks the frontmost window of `pid` when omitted.+Use for: marquee/lasso selection, drag-and-drop, resizing via a handle, scrubbing a slider, repositioning a panel.-```json-{"pid":844,"from_x":120,"from_y":240,"to_x":420,"to_y":520}-```+`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.-### scroll+`modifier` keys (cmd/shift/option/ctrl) are held across the entire gesture.-Scroll the target pid's focused region. On Windows the transport is `WM_VSCROLL` / `WM_HSCROLL` posted to the window — the same events the OS sends for scrollbar / trackpad scrolling, so any window that handles scrollbars responds. (macOS synthesizes PageDown / arrow keystrokes; both reach backgrounded windows.) `by: "page"` maps to `SB_PAGE*` × amount; `by: "line"` to `SB_LINE*` × amount.+When `from_zoom` is true, coordinates are in the last zoom image for this pid; the driver maps them back to window coordinates before dispatching.**Arguments:**+- `button` (string, optional): Mouse button used for the drag. Default: left.+- `duration_ms` (integer, optional): Wall-clock duration of the drag path between mouseDown and mouseUp. Default: 500.+- `from_x` (number, required): Drag-start X in window-local screenshot pixels. Top-left origin.+- `from_y` (number, required): Drag-start Y in window-local screenshot pixels. Top-left origin.+- `from_zoom` (boolean, optional): When true, coordinates are in the last zoom image for this pid; driver maps back to window coordinates.+- `modifier` (array of string, optional): Modifier keys held across the entire gesture: cmd/shift/option/ctrl.- `pid` (integer, required): Target process ID.-- `direction` (string, required): `up`, `down`, `left`, or `right`.-- `amount` (integer, optional): Number of scroll ticks (1–50). Default 3.-- `by` (string, optional): `line` (default) or `page`.-- `dispatch` (string, optional): See [Dispatch modes](#dispatch-modes).-- `element_index` (integer, optional): Accepted for cross-platform parity; currently no-op on Windows (UIA SetFocus not wired up yet).-- `window_id` (integer, optional): HWND of the target window. Required when `element_index` is used; otherwise auto-resolves the pid's first visible window.+- `steps` (integer, optional): Number of intermediate mouseDragged events linearly interpolated along the path. Default: 20.+- `to_x` (number, required): Drag-end X in window-local screenshot pixels.+- `to_y` (number, required): Drag-end Y in window-local screenshot pixels.+- `window_id` (integer, optional): CGWindowID for the window the pixel coordinates were measured against. Optional — when omitted the driver picks the frontmost window of pid.```json-{"pid":844,"direction":"down"}+{"from_x":100,"from_y":200,"pid":844,"to_x":100,"to_y":200}```-### move_cursor--Move the **agent cursor overlay** to (x, y). Does NOT move the real mouse cursor — this is purely a visual cue for demos and recordings.--**Arguments:**--- `x` (number, required): X in screen points.-- `y` (number, required): Y in screen points.-- `cursor_id` (string, optional): Multi-cursor instance id. Default `default`.--```json-{"x":100,"y":200}-```+### type_text-### zoom+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.-Zoom into a rectangular region of a window screenshot at full (native) resolution. Use it when `get_window_state` returned a resized image and you need to read small text or verify UI details. Coordinates `x1, y1, x2, y2` are in the same pixel space as the `get_window_state` screenshot; the maximum region width is 500 px in scaled-image coordinates. A 20% padding is added on every side. After zooming, pass `from_zoom=true` to `click` / `type_text` to translate coordinates back to full-window space.+Optional `element_index` + `window_id` (from the last `get_window_state` snapshot) directs the write to a specific field. Without `element_index`, the write goes to the pid's currently focused element.**Arguments:**-- `pid` (integer, required): Target process ID (scopes the zoom-translation registry).-- `window_id` (integer, required): HWND of the target window.-- `x1` (number, required): Left edge (resized-image pixels).-- `y1` (number, required): Top edge.-- `x2` (number, required): Right edge.-- `y2` (number, required): Bottom edge.+- `delay_ms` (integer, optional): Milliseconds between characters in the CGEvent fallback path. Default 30. Ignored when the AX path succeeds.+- `element_index` (integer, optional): Element index from last get_window_state. Directs the write to a specific field. Requires window_id.+- `pid` (integer, required): Target process ID.+- `text` (string, required): Text to insert at the target's cursor.+- `window_id` (integer, optional): CGWindowID. Required when element_index is used.```json-{"pid":844,"window_id":10725,"x1":120,"y1":240,"x2":520,"y2":480}+{"pid":844,"text":"hello"}```-## Keyboard and text input-### press_key-Press and release a single key, delivered to the target pid's top-level window via `PostMessage(WM_KEYDOWN/WM_KEYUP)`. The target does NOT need to be frontmost — no focus steal. Key vocabulary: return, tab, escape, up/down/left/right, space, delete, home, end, pageup, pagedown, f1-f12, plus any letter or digit. For true combinations (ctrl+c) use [`hotkey`](#hotkey).+Press and release a single key, delivered to the target pid via CGEventPostToPid. No focus steal.++Two delivery paths:+• window_id + element_index: focuses the AX element first, then posts via the auth-message path (Chromium-safe).+• window_id only (no element_index): NSMenu path — briefly activates the window WindowServer-frontmost via SLPSSetFrontProcessWithOptions (kCPSNoWindows, < 1 ms), posts WITHOUT the auth envelope so IOHIDPostEvent fires and NSApplication.sendEvent: dispatches NSMenu key equivalents. Restores prior frontmost immediately.+• No window_id: standard auth-message path.++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.**Arguments:**-- `pid` (integer, required): Target process ID.-- `key` (string, required): Key name.-- `modifiers` (array of string, optional): Modifier names held while the key is pressed (ctrl/shift/alt/win on Windows; cmd/shift/option/ctrl/fn on macOS).-- `dispatch` (string, optional): See [Dispatch modes](#dispatch-modes).-- `element_index` (integer, optional): Accepted for parity; currently no-op on Windows.-- `window_id` (integer, optional): HWND for the target window. Auto-resolves the pid's first visible window when omitted.+- `element_index` (integer, optional)+- `key` (string, required): Key name: return, tab, escape, up, down, etc.+- `modifiers` (array of string, optional): Modifier keys: cmd, shift, option/alt, ctrl, fn.+- `pid` (integer, required)+- `window_id` (integer, optional)```json-{"pid":844,"key":"return"}+{"key":"return","pid":844}```### hotkey-Press a combination of keys simultaneously — e.g. `["ctrl", "c"]` for Copy. Dispatch is target-aware on Windows:+Press a combination of keys simultaneously — e.g. `["cmd", "c"]` for Copy, `["cmd", "shift", "4"]` for screenshot selection. The combo is posted directly to the target pid's event queue; the target does NOT need to be frontmost.-- **Modern XAML / WinUI / UWP targets** route through UI Automation: the driver finds a descendant whose `AcceleratorKey` matches the combo and invokes it. No focus steal.-- **Legacy Win32 targets with modifiers** (Ctrl+S, etc.) route through `SendInput` with a brief `SetForegroundWindow` swap, because `PostMessage(WM_KEYDOWN, VK_CONTROL)` doesn't update the OS-wide modifier state that `TranslateAccelerator` reads. Requires the daemon to have UIAccess integrity (the MCP proxy auto-prefers the `cua-driver-uia.exe` worker when both pipes are up).-- **Legacy Win32 targets without modifiers** (plain `enter`, `f5`) route through `PostMessage` — no focus steal.+Two delivery paths:+• Default (no window_id): auth-message envelope — Chromium/Electron apps accept the keystrokes as trusted live input on macOS 14+.+• With window_id: NSMenu path — briefly activates the target WindowServer-frontmost via SLPSSetFrontProcessWithOptions (kCPSNoWindows, < 1 ms), posts WITHOUT the auth envelope so IOHIDPostEvent fires and NSApplication.sendEvent: dispatches NSMenu key equivalents (e.g. Cmd+Z undo, Cmd+W close). Restores prior frontmost immediately. Use this path when you need native menu-bar actions on non-Chromium apps.-Recognized modifiers: ctrl/control, shift, alt, win/windows (cmd/command, shift, option/alt, ctrl/control, fn on macOS). Order: modifiers first, one non-modifier last.+Recognized modifiers: cmd/command, shift, option/alt, ctrl/control, fn. Non-modifier keys use the same vocabulary as `press_key` (return, tab, escape, up/down/left/right, space, delete, home, end, pageup, pagedown, f1-f12, letters, digits). Order: modifiers first, one non-modifier last.**Arguments:**+- `keys` (array of string, required): Modifier(s) and one non-modifier key, e.g. ["cmd", "c"].- `pid` (integer, required): Target process ID.-- `keys` (array of string, required): Modifier(s) and one non-modifier key, e.g. `["ctrl", "c"]`.-- `dispatch` (string, optional): See [Dispatch modes](#dispatch-modes).-- `window_id` (integer, optional): Explicit HWND when the pid owns multiple windows.+- `window_id` (integer, optional): When set, uses NSMenu path: briefly activates the window for menu key dispatch, then restores prior frontmost.```json-{"pid":844,"keys":["ctrl","c"]}+{"keys":["cmd","c"],"pid":844}```-### type_text+### set_value-Insert text into the target pid via character-by-character `PostMessage(WM_CHAR)` to the focused window. No focus steal. Special keys (Return, Escape, arrows, Tab) go through `press_key` / `hotkey` — they are not text.+Set a value on a UI element. Two modes depending on element role:-When the target is a XAML / WinUI3 / UWP host (modern Notepad, Calculator, Photos, Settings, …), the tool requires `element_index` + `window_id` and routes through UI Automation's `ValuePattern.SetValue` — the same backend as `set_value` — because `WM_CHAR` doesn't reach those hosts. Calling `type_text(pid, text)` on a XAML host without `element_index` returns an actionable error pointing you at `get_window_state` first. Legacy Win32 apps keep the PostMessage path.+- **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.-**Arguments:**+- **All other elements**: writes AXValue directly (sliders, steppers, date pickers, native text fields that expose settable AXValue).-- `pid` (integer, required): Target process ID.-- `text` (string, required): Text to insert at the focused element's cursor.-- `delay_ms` (integer, optional): Milliseconds between characters on the PostMessage path (0–200). Default 30. Ignored on the UIA path (SetValue is atomic).-- `dispatch` (string, optional): See [Dispatch modes](#dispatch-modes).-- `element_index` (integer, optional): Required for XAML / UWP hosts (UIA path); accepted-but-optional elsewhere.-- `window_id` (integer, optional): HWND of the target window. Required when `element_index` is used.--```json-{"pid":844,"text":"hello"}-```--### set_value--Set a value on a UIA element via the `ValuePattern` interface (`AXValue` on macOS). Two modes: **standard input** (text fields, sliders, combo-box edit) writes directly through `IUIAutomationValuePattern::SetValue`; **ComboBox / select dropdown** picks the option whose text matches `value`. For free-form text that the target only accepts via keystrokes, prefer `type_text` — ValuePattern writes are ignored by some web inputs.+For free-form text entry into web inputs, prefer `type_text_chars` which synthesises key events — AXValue writes are ignored by WebKit.**Arguments:**-- `pid` (integer, required): Target process ID.-- `window_id` (integer, required): HWND of the window. Scopes the `element_index` cache per `(pid, window_id)`.-- `element_index` (integer, required): Index from the last `get_window_state`.-- `value` (string, required): New value. UIA coerces it to the element's native type.+- `element_index` (integer, required)+- `pid` (integer, required)+- `value` (string, required): New value. AX will coerce to the element's native type.+- `window_id` (integer, required): CGWindowID for the window whose get_window_state produced the element_index.```json-{"pid":844,"window_id":10725,"element_index":14,"value":"42"}+{"element_index":14,"pid":844,"value":"42","window_id":10725}```-## App and window lifecycle--### launch_app+### scroll-Launch an app hidden — the driver never brings the target to the foreground (`SW_SHOWNOACTIVATE` on Windows), so it does not steal focus from whatever is currently frontmost. Returns the launched pid, name, active flag, and a `windows` array (same shape as `list_windows`), so callers can skip a `list_windows` round-trip before `get_window_state`. When the launch settles but no window has materialized yet (rare), `windows` comes back empty — call `list_windows(pid)` a moment later.+Scroll the target pid's focused region by synthesized keystrokes.-Targeting:+Mapping: by='page' → PageDown/PageUp × amount; by='line' → DownArrow/UpArrow × amount. Horizontal variants use Left/Right arrow keys.-- **Windows:** provide `bundle_id` / `name` / `aumid` (packaged apps) or `path` (full `.exe` path). An `aumid` (or `bundle_id` containing `!`) activates the packaged app via `IApplicationActivationManager` and returns the real packaged-process pid — required on Win11 for built-in apps like Notepad, Calculator, and Paint, whose `System32` `.exe` is a stub. `path` wins over `name`.-- **macOS:** provide `bundle_id` (preferred, e.g. `com.apple.calculator`) or `name`.-- `urls` opens each URL without activating the app.+Optional element_index + window_id pre-focuses the element before scrolling.**Arguments:**-- `name` (string, optional): App display name.-- `bundle_id` (string, optional): macOS bundle id, or a Windows AUMID (`{PackageFamilyName}!{ApplicationId}`).-- `aumid` (string, optional): Explicit Windows AUMID. Takes precedence over `bundle_id` / `name`.-- `path` (string, optional): Full path to an executable (Windows). Wins over name/bundle_id/aumid.-- `launch_path` (string, optional): Round-trip the `launch_path` from `list_apps`. Highest precedence.-- `urls` (array of string, optional): URLs to open without activation.-- `additional_arguments` (array of string, optional): Extra command-line / activation arguments.-- `start_minimized` (boolean, optional): Launch minimized to the taskbar so the user's frontmost window stays visually on top. UIA / background dispatch still work; only screenshots and `dispatch:"foreground"` need it restored.--The macOS-specific `electron_debugging_port`, `webkit_inspector_port`, and `creates_new_application_instance` fields are accepted on Windows for parity but currently no-op.+- `amount` (integer, optional): Number of keystroke repetitions. Default: 3.+- `by` (string, optional): Scroll granularity. Default: line.+- `direction` (string, required): Scroll direction.+- `element_index` (integer, optional)+- `pid` (integer, required)+- `window_id` (integer, optional)```json-{"name":"Calculator"}+{"direction":"down","pid":844}```-### bring_to_front+### move_cursor-Activate `pid`'s window (or `window_id` if specified) — bring it to the OS foreground. **This deliberately breaks the no-foreground contract.** Use it only when an agent is about to drive a sequence of operations against a target whose input stack drops backgrounded events (Chromium DOM content, GTK widgets) and wants to pay the foreground cost once instead of per call: call `bring_to_front`, then issue subsequent input calls with `dispatch:"foreground"` (the `SendInput` swap is then a no-op since the target is already foreground). Returns `{previous_fg_hwnd, now_fg_hwnd}` so callers can restore. Windows-only; macOS / Linux return a pointer to the platform-native alternative.+Move the agent cursor overlay to (x, y). Does NOT move the real mouse cursor — the user's cursor stays where it is. Useful for showing the agent's attention without interrupting the user.**Arguments:**-- `pid` (integer, required): Target process ID.-- `window_id` (integer, optional): HWND. Defaults to the pid's first visible top-level window.+- `cursor_id` (string, optional): Cursor instance to move. Default: 'default'.+- `x` (number, required)+- `y` (number, required)```json-{"pid":844}+{"x":100,"y":200}```-### kill_app+### zoom++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.-Force-terminate a process by pid. Use it when the polite close path (Alt+F4 / clicking the X) fails to make the process exit — typical for UWP / WinUI3 apps (Calculator, Photos, modern Notepad) that route `WM_CLOSE` into a suspended-but-resident state. Equivalent to `taskkill /F /PID <pid>`. Unsaved state is lost; prefer the click-the-X path first.+After a zoom, pass `from_zoom=true` to click/type_text to auto-translate coordinates back to full-window space.**Arguments:**-- `pid` (integer, required): PID of the process to terminate.+- `pid` (integer, optional): Target pid — required for from_zoom click/type translation.+- `window_id` (integer, required): CGWindowID from list_windows.+- `x1` (number, required): Left edge of region in screenshot pixels.+- `x2` (number, required): Right edge of region in screenshot pixels.+- `y1` (number, required): Top edge of region in screenshot pixels.+- `y2` (number, required): Bottom edge of region in screenshot pixels.```json-{"pid":844}+{"window_id":10725,"x1":100,"x2":100,"y1":200,"y2":200}```-## Browser pages+## Browser tools### page-Interact with the browser page loaded in a running app. Supports Chrome, Brave, Edge, and Safari (AppleScript on macOS), Electron apps (CDP), Chromium/Firefox on Windows (UIA for reads; CDP for `execute_javascript` when launched with `--remote-debugging-port`), and WKWebView / Tauri / AT-SPI fallbacks. The browser does not need to be frontmost for read actions.+Interact with the browser page loaded in a running app. Supports Chrome, Brave, Edge, Safari (via AppleScript on macOS), Electron apps (via CDP), Chromium/Firefox on Windows (via UIA for read; CDP for execute_javascript when --remote-debugging-port is set), and WKWebView/Tauri/AT-SPI fallbacks.Actions:--- `execute_javascript` — run JS and return the result.-- `get_text` — extract visible page text.-- `query_dom` — find elements matching a CSS selector.-- `click_element` — click a CSS-selected element and animate the agent cursor to its center first (visible feedback). Prefer over `execute_javascript('el.click()')` when you want the cursor cue.-- `enable_javascript_apple_events` — macOS-only; patches the browser's Preferences to allow JS from Apple Events (requires user confirmation and a browser restart).+- execute_javascript: Run JS and return the result.+- get_text: Extract visible text from the page.+- query_dom: Find elements matching a CSS selector.+- click_element: Click a CSS-selected element AND animate the agent cursor to its on-screen center first (so the user sees what the agent is doing). Prefer over `execute_javascript('el.click()')` whenever you want visible cursor feedback.+- enable_javascript_apple_events: macOS-only — patch the browser's Preferences to allow JS from Apple Events (Chrome/Brave/Edge, requires user confirmation and a browser restart).**Arguments:**-- `action` (string, required): One of the actions above.+- `action` (string, required): Action to perform.+- `attributes` (array of string, optional): Element attributes to include in query_dom results.+- `bundle_id` (string, optional): Bundle ID of the browser. Required for enable_javascript_apple_events (macOS only).+- `css_selector` (string, optional): CSS selector for query_dom (e.g. 'a', 'button', 'input', 'h1'-'h6', 'p', 'img', 'select', '*').+- `javascript` (string, optional): JavaScript to execute. Required for execute_javascript.- `pid` (integer, optional): Target process ID.-- `window_id` (integer, optional): Target window from `list_windows`.-- `javascript` (string, optional): JS for `execute_javascript`.-- `css_selector` (string, optional): Selector for `query_dom`.-- `selector` (string, optional): Selector for `click_element`.-- `attributes` (array of string, optional): Element attributes to include in `query_dom` results.-- `bundle_id` (string, optional): Browser bundle id (required for `enable_javascript_apple_events`, macOS only).-- `user_has_confirmed_enabling` (boolean, optional): Must be true to proceed with `enable_javascript_apple_events`.+- `selector` (string, optional): CSS selector for click_element (e.g. 'button.submit', '#login a').+- `user_has_confirmed_enabling` (boolean, optional): Must be true to proceed with enable_javascript_apple_events. This will quit and relaunch the browser.+- `window_id` (integer, optional): Target window ID from list_windows.```json-{"action":"get_text","pid":844,"window_id":10725}+{"action":"get_text"}```-## Agent cursor+## Recording tools-### set_agent_cursor_enabled+### start_recording-Toggle the visual agent-cursor overlay. When enabled, pointer actions animate a floating arrow to the target's on-screen position before firing — purely visual, the dispatch itself is unchanged. Default: enabled. Disable with `{"enabled": false}` for headless / CI runs.+Start trajectory recording. Every subsequent action-tool invocation (click, right_click, scroll, type_text, press_key, hotkey, set_value) writes a turn folder under `output_dir`:-**Arguments:**+- `app_state.json` — post-action AX/UIA snapshot for the target pid.+- `screenshot.png` — post-action per-window screenshot of the target's frontmost on-screen window.+- `action.json` — tool name, full input arguments, result summary, pid, click point (when applicable), ISO-8601 timestamp.+- `click.png` — for click-family actions only, `screenshot.png` with a red dot drawn at the click point.-- `enabled` (boolean, required): True to show the overlay; false to hide.-- `cursor_id` (string, optional): Multi-cursor instance id. Default `default`.--```json-{"enabled":false}-```+Turn folders are named `turn-00001/`, `turn-00002/`, etc. Turn numbering restarts at 1 each time recording is (re-)started.-### set_agent_cursor_motion+**Video is on by default** — the main display is captured to `<output_dir>/recording.mp4` (H.264 / 30 fps) for the lifetime of the session. Pass `record_video: false` to opt out.-Configure a cursor instance's appearance and motion curve. All fields optional; only the knobs you pass change.+**macOS uses native ScreenCaptureKit** (in-process SCStream + SCRecordingOutput) so video inherits Cua Driver's own Screen Recording grant — no extra TCC prompt, no ffmpeg subprocess. Requires macOS 15.0+.-Appearance: `cursor_icon` (built-in `arrow`/`crosshair`/`hand`/`dot` or a PNG/SVG path), `cursor_color` (hex or CSS name), `cursor_label`, `cursor_size` (default 16), `cursor_opacity` (0.0–1.0, default 0.85).+**Windows + Linux use an ffmpeg subprocess** (`gdigrab` / `x11grab` + libx264). Requires ffmpeg on PATH (winget install Gyan.FFmpeg / apt install ffmpeg); when ffmpeg is missing or fails on startup the per-turn capture (screenshots + action.json) still runs and the session's `last_error` field carries the diagnostic.-Motion (cubic Bezier + settle spring): `arc_size` (default 0.25), `arc_flow` (asymmetry bias [-1,1], default 0), `start_handle` / `end_handle` (default 0.3), `spring` (settle damping [0.3,1.0], default 0.72), `glide_duration_ms` (flight per move [50,5000], default 160), `dwell_after_click_ms` (default 80), `idle_hide_ms` (auto-hide delay [0,60000], 0 = never, default 20000).+State persists for the life of the daemon / MCP session; a restart resets to disabled with no on-disk state. Call `stop_recording` to disable + finalize the mp4.**Arguments:**-- `cursor_id` (string, optional): Instance name. Default `default`.-- `cursor_icon` / `cursor_color` / `cursor_label` (string, optional): Appearance.-- `cursor_size` / `cursor_opacity` (number, optional): Appearance.-- `arc_size` / `arc_flow` / `start_handle` / `end_handle` / `spring` (number, optional): Motion-curve knobs.-- `glide_duration_ms` / `dwell_after_click_ms` / `idle_hide_ms` (number, optional): Timing knobs.--### set_agent_cursor_style+- `output_dir` (string, required): Absolute or ~-rooted directory where turn folders and (when enabled) the video file are written.+- `record_video` (boolean, optional): Capture the main display to <output_dir>/recording.mp4. Default: true. Set to false to record only the per-turn screenshots + JSON. On macOS this uses native ScreenCaptureKit (no extra TCC prompt, macOS 15.0+); on Windows + Linux it requires ffmpeg on PATH.-Update the cursor overlay's visual style. All fields optional.--**Arguments:**--- `gradient_colors` (array of string, optional): CSS hex stops tip→tail (e.g. `["#FF0000","#0000FF"]`). `[]` reverts to default.-- `bloom_color` (string, optional): Hex color for the halo/bloom. `""` reverts to default.-- `image_path` (string, optional): Path to a PNG/JPEG/SVG/ICO icon to use instead of the gradient arrow. `""` reverts to the arrow.-- `cursor_id` (string, optional): Instance. Default `default`.+```json+{"output_dir":"~/cua-trajectories/demo1"}+```-### get_agent_cursor_state+### stop_recording-Report the current agent-cursor configuration: enabled flag, motion knobs, glide duration, post-click dwell, and idle-hide delay. Durations come back in milliseconds. Read-only.+Stop trajectory recording. Disables further per-turn capture and, when video was enabled, gracefully terminates the ffmpeg subprocess so the mp4's moov atom is finalized (the file is playable). Calling stop on an already-stopped session is a no-op. The response carries `last_video_path` pointing at the finalized mp4 (when video was on).**Arguments:** none.-## Recording and replay--### start_recording+### replay_trajectory-Start trajectory recording. Every subsequent action-tool call (click, right_click, scroll, type_text, press_key, hotkey, set_value) writes a turn folder under `output_dir`: `app_state.json` (post-action snapshot), `screenshot.png`, `action.json` (tool name, arguments, result, pid, click point, timestamp), and `click.png` (click-family actions, with a dot at the click point). Turn folders are `turn-00001/`, `turn-00002/`, …; numbering restarts each time recording starts.+Replay a recorded trajectory by re-invoking every turn's tool call in lexical order. `dir` must point at a directory previously written by `start_recording`. Each `turn-NNNNN/` is parsed for `action.json`, and the recorded tool is called with its recorded `arguments` via the same dispatch path an MCP / CLI call uses.-**Video is on by default** — the main display is captured to `<output_dir>/recording.mp4` (H.264 / 30 fps). Pass `record_video: false` to opt out. macOS uses native ScreenCaptureKit (no extra TCC prompt, macOS 15.0+); Windows and Linux use an ffmpeg subprocess (`gdigrab` / `x11grab` + libx264, ffmpeg on PATH). When ffmpeg is missing, per-turn capture still runs and the session's `last_error` carries the diagnostic. Call `stop_recording` to finalize the mp4.+Caveats:+- Element-indexed actions (`click({pid, element_index})` etc.) will fail because element indices are per-snapshot and don't survive across sessions. Pixel clicks (`click({pid, x, y})`) and all keyboard tools replay cleanly. Failures are reported but don't stop replay unless `stop_on_error` is true.+- `get_window_state` and other read-only tools are NOT currently recorded, so replays do not re-populate the per-(pid, window_id) element cache.+- If recording is ENABLED while replay runs, the replay itself is recorded into the currently configured output directory. That's deliberate: recording a replay against a new build and diffing the two trajectories is the regression-test workflow.**Arguments:**-- `output_dir` (string, required): Absolute or `~`-rooted directory for turn folders and the video.-- `record_video` (boolean, optional): Capture the main display to `recording.mp4`. Default true.+- `delay_ms` (integer, optional): Milliseconds to sleep between turns, for human-observable pacing. Default 500.+- `dir` (string, required): Trajectory directory previously written by `set_recording`. Absolute or ~-rooted.+- `stop_on_error` (boolean, optional): Stop replay on the first tool-call error. Default true — set false to best-effort through the full trajectory.```json-{"output_dir":"~/cua-trajectories/demo1"}+{"dir":"~/cua-trajectories/demo1"}```-### stop_recording+## Configuration tools-Stop trajectory recording. Disables further per-turn capture and, when video was enabled, gracefully terminates ffmpeg so the mp4 is playable. A no-op on an already-stopped session. The response carries `last_video_path` when video was on.--**Arguments:** none.+### set_config-### get_recording_state+Update cua-driver-rs configuration. Changes to capture_mode and max_image_dimension take effect immediately. The experimental_pip keys are persisted to ~/.cua-driver/config.json and take effect on the next daemon restart (the PiP backend is initialised once at startup).-Report the recorder state: whether recording is enabled, the output directory, and the 1-based counter for the next turn folder. Read-only.+**Arguments:**-**Arguments:** none.+- `capture_mode` (string, optional): Default capture mode for get_window_state.+- `experimental_pip` (boolean, optional): Enable the experimental picture-in-picture preview window. Applies on next daemon restart.+- `experimental_pip_geometry` (string, optional): PiP window size + optional position in `WxH` or `WxH+X+Y` form (e.g. `320x200+24+24`). Applies on next daemon restart.+- `max_image_dimension` (integer, optional): Max dimension for screenshot resizing (0 = no limit).-### replay_trajectory--Replay a recorded trajectory by re-invoking every turn's tool call in lexical order. `dir` must point at a directory written by `start_recording`; each `turn-NNNNN/action.json` is replayed through the same dispatch path a live call uses.+### set_agent_cursor_enabled-Caveats: element-indexed actions fail (indices are per-snapshot and don't survive sessions) — pixel clicks and keyboard tools replay cleanly. Read-only tools aren't recorded, so the element cache isn't repopulated. If recording is enabled during replay, the replay is itself recorded — deliberate, for diffing a trajectory against a new build.+Show or hide the agent cursor overlay for a cursor instance.**Arguments:**-- `dir` (string, required): Trajectory directory from `start_recording`. Absolute or `~`-rooted.-- `delay_ms` (integer, optional): Milliseconds between turns. Default 500.-- `stop_on_error` (boolean, optional): Stop on the first error. Default true.+- `cursor_id` (string, optional): Cursor instance. Default: 'default'.+- `enabled` (boolean, required): true = show, false = hide.```json-{"dir":"~/cua-trajectories/demo1"}+{"enabled":false}```-## Config and updates+### set_agent_cursor_motion-### get_config+Configure the visual appearance and motion curve of an agent cursor instance.++Appearance (multi-cursor customization):+- cursor_id: instance name (default='default')+- cursor_icon: built-in ('arrow','crosshair','hand','dot') or PNG/SVG file path+- cursor_color: hex color e.g. '#00FFFF' or CSS name+- cursor_label: short text shown near the cursor+- cursor_size: dot radius in points (default=16)+- cursor_opacity: 0.0–1.0 (default=0.85)++Motion curve (Bezier path shape):+- start_handle: departure control-point fraction [0,1]. Default 0.3+- end_handle: arrival control-point fraction [0,1]. Default 0.3+- arc_size: perpendicular deflection as fraction of path length [0,1]. Default 0.25+- arc_flow: asymmetry [-1,1]; positive bulges toward destination. Default 0.0+- spring: settle damping [0.3,1.0]; 1.0=no overshoot. Default 0.72+- glide_duration_ms: flight duration per move [50,5000]. Default 160+- dwell_after_click_ms: pause after click ripple [0,5000]. Default 80+- idle_hide_ms: auto-hide delay [0,60000]; 0=never. Default 20000-Report the current persistent driver config. Read-only; returns defaults when unset. On Windows the shape is `{schema_version, version, platform, capture_mode, max_image_dimension}`.+**Arguments:**-**Arguments:** none.+- `arc_flow` (number, optional): Asymmetry bias in [-1, 1]. Default 0.0.+- `arc_size` (number, optional): Arc deflection as fraction of path length [0, 1]. Default 0.25.+- `cursor_color` (string, optional): Hex color (e.g. '#00FFFF') or CSS color name.+- `cursor_icon` (string, optional): Built-in icon name or file path to PNG/SVG.+- `cursor_id` (string, optional): Cursor instance name. Default: 'default'.+- `cursor_label` (string, optional): Short label near the cursor dot.+- `cursor_opacity` (number, optional): Opacity 0.0–1.0. Default: 0.85.+- `cursor_size` (number, optional): Dot radius in points. Default: 16.+- `dwell_after_click_ms` (number, optional): Pause after click ripple in ms. Default 80.+- `end_handle` (number, optional): End-handle fraction in [0, 1]. Default 0.3.+- `glide_duration_ms` (number, optional): Flight duration per move in ms. Default 160.+- `idle_hide_ms` (number, optional): Auto-hide delay in ms. 0 = never hide. Default 20000.+- `spring` (number, optional): Settle damping in [0.3, 1.0]. Default 0.72.+- `start_handle` (number, optional): Start-handle fraction in [0, 1]. Default 0.3.-### set_config+### set_agent_cursor_style-Write a setting into the persistent config; values take effect immediately. Two input shapes: the dotted-path form `{"key": "capture_mode", "value": "som"}` (preferred), or the bulk per-field form `{"capture_mode": "som", "max_image_dimension": 0}`.+Update the visual style of the agent cursor overlay.-Known keys: `capture_mode` (`vision` | `ax` | `som`), `max_image_dimension` (integer), `experimental_pip` (boolean; applies on next daemon restart — Windows backend stubbed today), `experimental_pip_geometry` (string `WxH` or `WxH+X+Y`). Returns the full updated config.+- gradient_colors: array of CSS hex strings (e.g. ["#FF0000","#0000FF"]) used as the arrow fill gradient from tip to tail. Empty array reverts to the default palette colours.+- bloom_color: hex string for the radial halo/bloom behind the cursor (e.g. "#00FFFF"). Empty string reverts to the default.+- image_path: path to a PNG, JPEG, SVG, or ICO file to use as the cursor icon instead of the default gradient arrow. Empty string reverts to the procedural arrow.+All parameters are optional; omit any you do not want to change.**Arguments:**-- `key` (string, optional): Dotted-path leaf field. Pair with `value`.-- `value` (any, optional): New value for `key`.-- `capture_mode` / `max_image_dimension` / `experimental_pip` / `experimental_pip_geometry` (optional): Per-field shape.+- `bloom_color` (string, optional): Hex bloom/halo colour (e.g. '#00FFFF'). '' = revert to default.+- `cursor_id` (string, optional): Cursor instance. Default: 'default'.+- `gradient_colors` (array of string, optional): CSS hex gradient stops tip→tail. [] = revert to default.+- `image_path` (string, optional): Path to PNG/JPEG/SVG/ICO cursor image. '' = revert to arrow.-```json-{"key":"capture_mode","value":"som"}-```+## Maintenance tools-### check_for_update+### check_permissions-Check whether a newer `cua-driver-rs` release is available on GitHub. Returns current and latest versions, an `update_available` boolean, the install one-liner, and the release-notes URL. Read-only — never installs. Mirror of `cua-driver check-update --json`. See [Updating](/cua-driver/guide/getting-started/updating).+Report TCC permission status for Accessibility and Screen Recording. By default also raises the system permission dialogs for any missing grants — Apple's request APIs are no-ops when the grant is already active, so this is safe to call repeatedly. Pass {"prompt": false} for a purely read-only status check.-**Arguments:** none.+**Arguments:**++- `prompt` (boolean, optional): Raise the system permission prompts for missing grants. Default true.-## Platform notes+### check_for_update-- **UWP / WinUI3 / XAML targets** (Calculator, Settings, modern Notepad) self-foreground during a naive UIA Invoke. The driver wraps Invoke / Expand / Toggle in an `EnableWindow(host, FALSE)`-gated call so the pattern still delivers through the accessibility channel without the target stealing z-order. CoreWindow-hosted apps are reached via a UIA root-walk fallback. See [Autostart → UWP automation and the uiAccess worker](/cua-driver/guide/getting-started/autostart#uwp-automation-and-the-uiaccess-worker-windows).-- **Chromium browsers** launched hidden need anti-throttling flags so the occluded renderer keeps rendering and exposing its DOM; the driver auto-injects them. For coord clicks into DOM content, `SendInput` (`dispatch:"foreground"`) or a `--remote-debugging-port` + the `page` tool (CDP) is required — `PostMessage` doesn't reach Chromium's input thread.-- **macOS Swift driver** uses Accessibility, `CGEvent` / SkyLight, and ScreenCaptureKit, and exposes a standalone `screenshot` tool plus Space-aware fields (`on_current_space`, `space_ids`). See the [process model](/cua-driver/guide/getting-started/process-model) and [Limits](/cua-driver/reference/limits).+Check whether a newer cua-driver-rs release is available on GitHub. Returns the current and latest versions, an `update_available` boolean, the install one-liner, and the release notes URL. Read-only — never installs. Mirror of `cua-driver check-update --json`.++**Arguments:** none.diff --git a/docs/content/docs/meta.json b/docs/content/docs/meta.jsonindex c3849ca9b9..4cd2e7bcab 100644--- a/docs/content/docs/meta.json+++ b/docs/content/docs/meta.json@@ -1,5 +1,5 @@{"title": "Home","description": "Documentation Home",- "pages": ["cua", "cua-driver", "cuabench", "cuabot", "lume"]+ "pages": ["cua-driver", "cua", "cuabench", "cuabot", "lume"]}diff --git a/docs/src/components/custom-header.tsx b/docs/src/components/custom-header.tsxindex f1715fe813..0beb6b9eab 100644--- a/docs/src/components/custom-header.tsx+++ b/docs/src/components/custom-header.tsx@@ -22,31 +22,12 @@ import CuaDriverIconBlack from '@/assets/cua-driver-icon-black.png';import CuaDriverIconWhite from '@/assets/cua-driver-icon-white.png';const docsSites = [- {- name: 'Cua',- label: 'Docs',- href: '/cua/guide/get-started/what-is-cua',- prefix: '/cua',- isDefault: true,- description: 'Computer Use Agent SDK',- logoBlack: LogoBlack,- logoWhite: LogoWhite,- iconWidth: 24,- iconHeight: 24,- dropdownIconWidth: 28,- dropdownIconHeight: 28,- navTabs: [- { name: 'Guide', href: '/cua/guide/get-started/what-is-cua', prefix: '/cua/guide' },- { name: 'Examples', href: '/cua/examples/automation/form-filling', prefix: '/cua/examples' },- { name: 'Reference', href: '/cua/reference/computer-sdk', prefix: '/cua/reference' },- ],- },{name: 'Cua Driver',label: 'Docs',href: '/cua-driver/guide/getting-started/introduction',prefix: '/cua-driver',- isDefault: false,+ isDefault: true,description: 'Background computer-use',logoBlack: CuaDriverIconBlack,logoWhite: CuaDriverIconWhite,@@ -67,6 +48,25 @@ const docsSites = [},],},+ {+ name: 'Cua',+ label: 'Docs',+ href: '/cua/guide/get-started/what-is-cua',+ prefix: '/cua',+ isDefault: false,+ description: 'Computer Use Agent SDK',+ logoBlack: LogoBlack,+ logoWhite: LogoWhite,+ iconWidth: 24,+ iconHeight: 24,+ dropdownIconWidth: 28,+ dropdownIconHeight: 28,+ navTabs: [+ { name: 'Guide', href: '/cua/guide/get-started/what-is-cua', prefix: '/cua/guide' },+ { name: 'Examples', href: '/cua/examples/automation/form-filling', prefix: '/cua/examples' },+ { name: 'Reference', href: '/cua/reference/computer-sdk', prefix: '/cua/reference' },+ ],+ },{name: 'Cua Bench',label: 'Docs',@@ -317,9 +317,7 @@ export function CustomHeader() {data-active={isActive ? 'true' : undefined}className={cn('cds-header-link text-sm font-medium transition-colors',- isActive- ? 'text-white'- : 'text-[var(--ink-muted)] hover:text-white'+ isActive ? 'text-white' : 'text-[var(--ink-muted)] hover:text-white')}>{tab.name}diff --git a/libs/cua-driver/rust/Cargo.lock b/libs/cua-driver/rust/Cargo.lockindex a3bc25f107..0236f3a857 100644--- a/libs/cua-driver/rust/Cargo.lock+++ b/libs/cua-driver/rust/Cargo.lock@@ -34,11 +34,10 @@ dependencies = [[[package]]name = "apple-metal"-version = "0.8.7"+version = "0.6.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "770ed47ba948122fc9ce0bc10a433cf9fabcf1c2ed6d44db5b7ad0d70ffede15"+checksum = "c18fb446e23d198c984f319fe2a60c6db36141096c286765b9cbab283b4e218b"dependencies = [- "doom-fish-utils","libc",]@@ -276,7 +275,7 @@ dependencies = [[[package]]name = "cua-driver"-version = "0.3.1"+version = "0.3.2"dependencies = ["anyhow","async-trait",@@ -306,7 +305,7 @@ dependencies = [[[package]]name = "cua-driver-core"-version = "0.3.1"+version = "0.3.2"dependencies = ["anyhow","async-trait",@@ -321,7 +320,7 @@ dependencies = [[[package]]name = "cua-driver-uia"-version = "0.3.1"+version = "0.3.2"dependencies = ["anyhow","cua-driver-core",@@ -336,7 +335,7 @@ dependencies = [[[package]]name = "cursor-overlay"-version = "0.3.1"+version = "0.3.2"dependencies = ["anyhow","image",@@ -489,7 +488,7 @@ checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"[[package]]name = "focus-monitor-win"-version = "0.3.1"+version = "0.3.2"dependencies = ["windows 0.58.0",]@@ -1193,7 +1192,7 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"[[package]]name = "pip-preview"-version = "0.3.1"+version = "0.3.2"dependencies = ["anyhow","serde_json",@@ -1208,7 +1207,7 @@ checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"[[package]]name = "platform-linux"-version = "0.3.1"+version = "0.3.2"dependencies = ["anyhow","async-trait",@@ -1229,7 +1228,7 @@ dependencies = [[[package]]name = "platform-macos"-version = "0.3.1"+version = "0.3.2"dependencies = ["anyhow","async-trait",@@ -1261,7 +1260,7 @@ dependencies = [[[package]]name = "platform-windows"-version = "0.3.1"+version = "0.3.2"dependencies = ["anyhow","async-trait",diff --git a/libs/cua-driver/rust/PARITY.md b/libs/cua-driver/rust/PARITY.mdindex 4b420307bc..3e441fe2ee 100644--- a/libs/cua-driver/rust/PARITY.md+++ b/libs/cua-driver/rust/PARITY.md@@ -1470,15 +1470,15 @@ older clients that only read name/description still work.- Test: `crates/platform-windows/examples/daemon_lifecycle_parity.rs`### Fixed-**`stop` silent on success** — Rust was printing `"cua-driver daemon stopped."`+**`stop` silent on success** — Rust was printing a daemon-stopped lineon stdout after a successful stop. Swift's `stop` exits silently withstatus 0. Now matches Swift byte-for-byte.### Already correct-- `status` output: `"cua-driver daemon is running\n socket: <path>\n pid: <N>\n"` ✓+- `status` output: `"Cua Driver daemon is running\n socket: <path>\n pid: <N>\n"` ✓- `status` exit code: 0 when running, 1 when not ✓- `stop` exit code: 0 when ran, 1 when no daemon ✓-- Error wording on stderr: `"cua-driver daemon is not running"` ✓+- Error wording on stderr: `"Cua Driver daemon is not running"` ✓### Verified on Windows`daemon_lifecycle_parity.exe`:@@ -1743,7 +1743,7 @@ setup per client / docs link) is sourced from a single shared file:raw.githubusercontent.com (remote install path) + bash `sed`.- `libs/cua-driver/scripts/install.ps1` — `Invoke-WebRequest` fromraw.githubusercontent.com + PowerShell `-replace`.- - `libs/cua-driver/rust/scripts/install-local.sh` — direct disk read+ - `libs/cua-driver/scripts/install-local.sh` — direct disk readfrom `../cua-driver/scripts/post-install-hints.txt` + `sed`.- `libs/cua-driver/rust/scripts/install-local.ps1` — direct disk readfrom `..\cua-driver\scripts\post-install-hints.txt` + `-replace`.@@ -1765,7 +1765,7 @@ only branching case). The OS-specific block is 4-6 lines, naturallyfits in the script that targets that OS, and is the only part thatwould need conditional rendering in a single-file design.-**Status**: VERIFIED on macOS via `bash libs/cua-driver/rust/scripts/install-local.sh`+**Status**: VERIFIED on macOS via `bash libs/cua-driver/scripts/install-local.sh`end-to-end. Windows VM verification pending.---diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/recording_tools.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/recording_tools.rsindex e4fbc9b16e..2875339704 100644--- a/libs/cua-driver/rust/crates/cua-driver-core/src/recording_tools.rs+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/recording_tools.rs@@ -72,7 +72,7 @@ impl Tool for StartRecordingTool {`<output_dir>/recording.mp4` (H.264 / 30 fps) for the lifetime of \the session. Pass `record_video: false` to opt out.\n\n\**macOS uses native ScreenCaptureKit** (in-process SCStream + \- SCRecordingOutput) so video inherits cua-driver's own Screen \+ SCRecordingOutput) so video inherits Cua Driver's own Screen \Recording grant — no extra TCC prompt, no ffmpeg subprocess. \Requires macOS 15.0+.\n\n\**Windows + Linux use an ffmpeg subprocess** (`gdigrab` / \diff --git a/libs/cua-driver/rust/crates/cua-driver/src/autostart.rs b/libs/cua-driver/rust/crates/cua-driver/src/autostart.rsindex 3e6d84a870..1d96d736f5 100644--- a/libs/cua-driver/rust/crates/cua-driver/src/autostart.rs+++ b/libs/cua-driver/rust/crates/cua-driver/src/autostart.rs@@ -355,7 +355,7 @@ mod platform {const NOT_YET: &str ="cua-driver autostart is currently Windows-only. macOS users: see \- libs/cua-driver/rust/scripts/install-local.sh --autostart for the \+ libs/cua-driver/scripts/install-local.sh --autostart for the \LaunchAgent recipe. Linux users: same script registers a systemd \--user unit. A cross-platform impl is tracked as a follow-up.";diff --git a/libs/cua-driver/rust/crates/cua-driver/src/cli.rs b/libs/cua-driver/rust/crates/cua-driver/src/cli.rsindex 32d4844b38..0a7889e3f4 100644--- a/libs/cua-driver/rust/crates/cua-driver/src/cli.rs+++ b/libs/cua-driver/rust/crates/cua-driver/src/cli.rs@@ -673,7 +673,7 @@ pub fn run_mcp_via_daemon_proxy(socket: Option<String>) -> anyhow::Result<()> {#[cfg(not(target_os = "macos"))]{anyhow::bail!(- "no cua-driver daemon listening on {socket_path}. Start one in \+ "no Cua Driver daemon listening on {socket_path}. Start one in \your interactive session — on Windows run \`cua-driver autostart enable && cua-driver autostart kick`; \on Linux run `cua-driver serve &` in the user's session. \@@ -1113,7 +1113,7 @@ pub fn run_recording_cmd(subcommand: &str, args: &[String], socket: Option<&str>if !crate::serve::is_daemon_listening(&socket_path) {eprintln!(- "cua-driver daemon is not running.\n\+ "Cua Driver daemon is not running.\n\Start it first with: cua-driver serve");process::exit(1);@@ -1454,10 +1454,258 @@ pub fn run_check_update_cmd(json: bool, no_cache: bool) {}}+fn cli_docs_json() -> serde_json::Value {+ let no_args: Vec<serde_json::Value> = Vec::new();+ let no_options: Vec<serde_json::Value> = Vec::new();+ let no_flags: Vec<serde_json::Value> = Vec::new();+ let no_subcommands: Vec<serde_json::Value> = Vec::new();++ serde_json::json!({+ "name": "cua-driver",+ "version": env!("CARGO_PKG_VERSION"),+ "abstract": "Cross-platform computer-use automation driver.",+ "commands": [+ {+ "name": "mcp",+ "abstract": "Run the stdio MCP server.",+ "discussion": "On macOS, shell-spawned MCP processes can auto-launch and proxy through a CuaDriver.app daemon so TCC grants attach to the bundle. On Windows and Linux, MCP proxies through an already-running daemon when one is listening.",+ "arguments": no_args,+ "options": [+ {"name":"socket","short_name":null,"help":"Override the daemon socket or named-pipe path used by the proxy fallback.","type":"String","default_value":null,"is_optional":true}+ ],+ "flags": [+ {"name":"no-daemon-relaunch","short_name":null,"help":"Stay in-process instead of proxying through a daemon.","default_value":false},+ {"name":"claude-code-computer-use-compat","short_name":null,"help":"Expose the Claude Code computer-use compatibility screenshot surface.","default_value":false}+ ],+ "subcommands": no_subcommands+ },+ {+ "name": "list-tools",+ "abstract": "List every registered MCP tool with a one-line description.",+ "discussion": "",+ "arguments": no_args,+ "options": no_options,+ "flags": no_flags,+ "subcommands": no_subcommands+ },+ {+ "name": "describe",+ "abstract": "Print a tool's full description and JSON input schema.",+ "discussion": "",+ "arguments": [{"name":"tool-name","help":"Name of the MCP tool to describe.","type":"String","is_optional":false}],+ "options": no_options,+ "flags": no_flags,+ "subcommands": no_subcommands+ },+ {+ "name": "call",+ "abstract": "Invoke an MCP tool directly from the shell.",+ "discussion": "Runs the same handler the MCP server uses. JSON arguments may be passed as a positional JSON object or through stdin.",+ "arguments": [+ {"name":"tool-name","help":"Name of the MCP tool to invoke.","type":"String","is_optional":false},+ {"name":"json-args","help":"JSON object for the tool input schema. If omitted, stdin is read when piped.","type":"String","is_optional":true}+ ],+ "options": [+ {"name":"screenshot-out-file","short_name":null,"help":"Write the first image content block from the response to this path.","type":"String","default_value":null,"is_optional":true},+ {"name":"socket","short_name":null,"help":"Override the daemon socket or named-pipe path.","type":"String","default_value":null,"is_optional":true}+ ],+ "flags": no_flags,+ "subcommands": no_subcommands+ },+ {+ "name": "serve",+ "abstract": "Run Cua Driver as a long-running daemon.",+ "discussion": "The daemon owns per-process state such as element-index caches, recording state, and cursor overlay state.",+ "arguments": no_args,+ "options": [+ {"name":"socket","short_name":null,"help":"Override the daemon socket or named-pipe path.","type":"String","default_value":null,"is_optional":true},+ {"name":"pid-file","short_name":null,"help":"Override the pid-file path on Unix targets.","type":"String","default_value":null,"is_optional":true}+ ],+ "flags": [+ {"name":"no-permissions-gate","short_name":null,"help":"Skip the macOS first-launch permissions gate.","default_value":false}+ ],+ "subcommands": no_subcommands+ },+ {+ "name": "stop",+ "abstract": "Ask the running daemon to exit gracefully.",+ "discussion": "",+ "arguments": no_args,+ "options": [{"name":"socket","short_name":null,"help":"Override the daemon socket or named-pipe path.","type":"String","default_value":null,"is_optional":true}],+ "flags": no_flags,+ "subcommands": no_subcommands+ },+ {+ "name": "status",+ "abstract": "Report whether a Cua Driver daemon is running.",+ "discussion": "",+ "arguments": no_args,+ "options": [+ {"name":"socket","short_name":null,"help":"Override the daemon socket or named-pipe path.","type":"String","default_value":null,"is_optional":true},+ {"name":"pid-file","short_name":null,"help":"Override the pid-file path on Unix targets.","type":"String","default_value":null,"is_optional":true}+ ],+ "flags": no_flags,+ "subcommands": no_subcommands+ },+ {+ "name": "mcp-config",+ "abstract": "Print MCP server config or a client-specific install command.",+ "discussion": "Supported clients include claude, codex, cursor, antigravity, openclaw, opencode, hermes, and pi.",+ "arguments": no_args,+ "options": [{"name":"client","short_name":null,"help":"Client name to print configuration for.","type":"String","default_value":null,"is_optional":true}],+ "flags": no_flags,+ "subcommands": no_subcommands+ },+ {+ "name": "recording",+ "abstract": "Control trajectory recording on a running daemon.",+ "discussion": "Recording state lives in-process, so use a daemon for multi-call sessions.",+ "arguments": no_args,+ "options": [{"name":"socket","short_name":null,"help":"Override the daemon socket or named-pipe path.","type":"String","default_value":null,"is_optional":true}],+ "flags": no_flags,+ "subcommands": [+ {+ "name":"start",+ "abstract":"Start trajectory recording to a directory.",+ "discussion":"",+ "arguments":[{"name":"output-dir","help":"Directory to write turn folders into.","type":"String","is_optional":false}],+ "options":[],+ "flags":[],+ "subcommands":[]+ },+ {+ "name":"stop",+ "abstract":"Stop trajectory recording.",+ "discussion":"",+ "arguments":[],+ "options":[],+ "flags":[],+ "subcommands":[]+ },+ {+ "name":"status",+ "abstract":"Print the current recording state.",+ "discussion":"",+ "arguments":[],+ "options":[],+ "flags":[],+ "subcommands":[]+ },+ {+ "name":"render",+ "abstract":"Render a recorded trajectory directory to an MP4.",+ "discussion":"This pure file-to-file path does not require a running daemon.",+ "arguments":[+ {"name":"input-dir","help":"Trajectory directory containing recorded turn folders.","type":"String","is_optional":false},+ {"name":"out-mp4","help":"Output MP4 path.","type":"String","is_optional":false}+ ],+ "options":[{"name":"scale","short_name":null,"help":"Scale factor for rendered frames.","type":"Number","default_value":null,"is_optional":true}],+ "flags":[{"name":"no-zoom","short_name":null,"help":"Disable cursor/action zoom effects in the rendered video.","default_value":false}],+ "subcommands":[]+ }+ ]+ },+ {+ "name": "config",+ "abstract": "Read or mutate persistent driver configuration.",+ "discussion": "Without a subcommand, prints the full config.",+ "arguments": no_args,+ "options": [{"name":"socket","short_name":null,"help":"Override the daemon socket or named-pipe path.","type":"String","default_value":null,"is_optional":true}],+ "flags": no_flags,+ "subcommands": [+ {"name":"show","abstract":"Print the full config.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]},+ {"name":"get","abstract":"Print one config key.","discussion":"","arguments":[{"name":"key","help":"Config key to read.","type":"String","is_optional":false}],"options":[],"flags":[],"subcommands":[]},+ {"name":"set","abstract":"Set one config key.","discussion":"","arguments":[{"name":"key","help":"Config key to write.","type":"String","is_optional":false},{"name":"value","help":"Value to store.","type":"String","is_optional":false}],"options":[],"flags":[],"subcommands":[]},+ {"name":"reset","abstract":"Reset config to defaults.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]}+ ]+ },+ {+ "name": "check-update",+ "abstract": "Check whether a newer cua-driver release is available.",+ "discussion": "Read-only. Uses the same update-state payload as the check_for_update MCP tool.",+ "arguments": no_args,+ "options": no_options,+ "flags": [+ {"name":"json","short_name":null,"help":"Emit a machine-readable JSON payload.","default_value":false},+ {"name":"no-cache","short_name":null,"help":"Skip the 20-hour on-disk cache and force a GitHub request.","default_value":false}+ ],+ "subcommands": no_subcommands+ },+ {+ "name": "update",+ "abstract": "Check for an update and optionally apply it.",+ "discussion": "The apply path delegates to the canonical platform installer scripts.",+ "arguments": no_args,+ "options": no_options,+ "flags": [+ {"name":"apply","short_name":null,"help":"Download and install the latest release when one is available.","default_value":false},+ {"name":"json","short_name":null,"help":"Emit the structured update-state payload.","default_value":false}+ ],+ "subcommands": no_subcommands+ },+ {+ "name": "doctor",+ "abstract": "Run platform-aware diagnostic probes.",+ "discussion": "Exit code is non-zero when any probe is an error.",+ "arguments": no_args,+ "options": no_options,+ "flags": [{"name":"json","short_name":null,"help":"Emit the probe report as JSON.","default_value":false}],+ "subcommands": no_subcommands+ },+ {+ "name": "diagnose",+ "abstract": "Print a pasteable install-layout and permission-attribution report.",+ "discussion": "",+ "arguments": no_args,+ "options": no_options,+ "flags": no_flags,+ "subcommands": no_subcommands+ },+ {+ "name": "autostart",+ "abstract": "Manage platform-native daemon autostart.",+ "discussion": "Windows registers a logon Scheduled Task. macOS and Linux currently print manual-recipe guidance.",+ "arguments": no_args,+ "options": no_options,+ "flags": no_flags,+ "subcommands": [+ {"name":"enable","abstract":"Register the autostart entry.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]},+ {"name":"disable","abstract":"Remove the autostart entry.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]},+ {"name":"status","abstract":"Print whether autostart is registered and running.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]},+ {"name":"kick","abstract":"Start the autostart entry now without re-logging.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]}+ ]+ },+ {+ "name": "skills",+ "abstract": "Install, update, inspect, or remove the optional agent skill pack.",+ "discussion": "The install script never touches agent skill directories automatically.",+ "arguments": no_args,+ "options": no_options,+ "flags": no_flags,+ "subcommands": [+ {"name":"install","abstract":"Fetch the versioned skill pack and link detected agents.","discussion":"","arguments":[],"options":[{"name":"agent","short_name":null,"help":"Restrict linking to one agent.","type":"String","default_value":null,"is_optional":true},{"name":"from","short_name":null,"help":"Fetch from a source such as main instead of the tagged release.","type":"String","default_value":null,"is_optional":true}],"flags":[{"name":"all-platforms","short_name":null,"help":"Keep platform-specific skill files for every platform.","default_value":false}],"subcommands":[]},+ {"name":"update","abstract":"Refresh the local skill pack and links.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]},+ {"name":"uninstall","abstract":"Remove agent skill links.","discussion":"","arguments":[],"options":[],"flags":[{"name":"all","short_name":null,"help":"Also delete the local skill-pack copy.","default_value":false}],"subcommands":[]},+ {"name":"status","abstract":"Report local skill-pack and per-agent link state.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]},+ {"name":"path","abstract":"Print the local skill-pack path.","discussion":"","arguments":[],"options":[],"flags":[],"subcommands":[]}+ ]+ },+ {+ "name": "dump-docs",+ "abstract": "Output machine-readable CLI and MCP documentation JSON.",+ "discussion": "Used by the docs generator to keep reference pages in sync with the live binary.",+ "arguments": no_args,+ "options": [{"name":"type","short_name":null,"help":"Which docs to emit: all, cli, or mcp.","type":"String","default_value":"all","is_optional":true}],+ "flags": [{"name":"pretty","short_name":"p","help":"Pretty-print JSON.","default_value":false}],+ "subcommands": no_subcommands+ }+ ]+ })+}+/// Output documentation as JSON. `doc_type` is one of:/// - `"mcp"` — only MCP tool docs (`{version, tools: [...]}`)-/// - `"cli"` — CLI docs (stub on Rust — Swift extracts via swift-argument-parser-/// introspection which has no clap analogue without a bigger refactor)+/// - `"cli"` — CLI docs/// - `"all"` — `{cli, mcp}` matching Swift `CombinedDocs`pub fn run_dump_docs_with_type(registry: &ToolRegistry, pretty: bool, doc_type: &str) {// Each MCP tool: `{name, description, input_schema}` (Swift's MCPToolDoc@@ -1478,19 +1726,12 @@ pub fn run_dump_docs_with_type(registry: &ToolRegistry, pretty: bool, doc_type:"tools": tools,});- // CLI docs are intentionally a thin stub on Rust — full extraction- // would require introspecting clap's command graph which we don't use- // (cli.rs uses hand-rolled arg matching). Documented in PARITY.md.- let cli_stub = serde_json::json!({- "version": env!("CARGO_PKG_VERSION"),- "commands": [],- "_note": "CLI introspection not implemented on Rust port. Use `cua-driver --help` for CLI docs.",- });+ let cli_docs = cli_docs_json();let doc = match doc_type {- "cli" => cli_stub,+ "cli" => cli_docs,"mcp" => mcp,- _ => serde_json::json!({ "cli": cli_stub, "mcp": mcp }),+ _ => serde_json::json!({ "cli": cli_docs, "mcp": mcp }),};let out = if pretty {serde_json::to_string_pretty(&doc)diff --git a/libs/cua-driver/rust/crates/cua-driver/src/serve.rs b/libs/cua-driver/rust/crates/cua-driver/src/serve.rsindex 2b606b45e1..30dbad8e83 100644--- a/libs/cua-driver/rust/crates/cua-driver/src/serve.rs+++ b/libs/cua-driver/rust/crates/cua-driver/src/serve.rs@@ -260,7 +260,7 @@ pub async fn run_serve(let listener = UnixListener::bind(socket_path).map_err(|e| anyhow::anyhow!("bind {socket_path}: {e}"))?;- eprintln!("cua-driver daemon listening on {socket_path}");+ eprintln!("Cua Driver daemon listening on {socket_path}");// Write PID file.if let Some(pid_path) = pid_file_path {@@ -421,7 +421,7 @@ pub async fn run_serve(});}_ = &mut shutdown_rx => {- eprintln!("cua-driver daemon shutting down.");+ eprintln!("Cua Driver daemon shutting down.");break;}}@@ -615,7 +615,7 @@ pub async fn run_serve(use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};use tokio::net::windows::named_pipe::ServerOptions;- eprintln!("cua-driver daemon listening on {socket_path}");+ eprintln!("Cua Driver daemon listening on {socket_path}");// Build the cross-IL security descriptor once, reuse on every pipe// instance. If this fails we fall back to the default-ACL `create`@@ -789,7 +789,7 @@ pub async fn run_serve(});}_ = &mut shutdown_rx => {- eprintln!("cua-driver daemon shutting down.");+ eprintln!("Cua Driver daemon shutting down.");break;}}@@ -828,7 +828,7 @@ pub fn run_serve_cmd(.map(|pid| format!(" (pid {pid})")).unwrap_or_default();eprintln!(- "cua-driver daemon is already running on {socket_path}{pid_hint}. \+ "Cua Driver daemon is already running on {socket_path}{pid_hint}. \Run `cua-driver stop` first.");std::process::exit(1);@@ -877,7 +877,7 @@ pub fn run_serve_cmd(/// `cua-driver stop` implementation.pub fn run_stop_cmd(socket_path: &str) {if !is_daemon_listening(socket_path) {- eprintln!("cua-driver daemon is not running");+ eprintln!("Cua Driver daemon is not running");std::process::exit(1);}@@ -899,7 +899,7 @@ pub fn run_stop_cmd(socket_path: &str) {return;}if std::time::Instant::now() >= deadline {- eprintln!("cua-driver daemon did not release socket within 2s");+ eprintln!("Cua Driver daemon did not release socket within 2s");std::process::exit(1);}std::thread::sleep(std::time::Duration::from_millis(50));@@ -915,7 +915,7 @@ pub fn run_stop_cmd(socket_path: &str) {/// `cua-driver status` implementation.pub fn run_status_cmd(socket_path: &str, pid_file_path: &str) {if is_daemon_listening(socket_path) {- println!("cua-driver daemon is running");+ println!("Cua Driver daemon is running");println!(" socket: {socket_path}");if let Some(pid) = read_pid_file(pid_file_path) {println!(" pid: {pid}");@@ -923,7 +923,7 @@ pub fn run_status_cmd(socket_path: &str, pid_file_path: &str) {println!(" pid: unknown (no pid file)");}} else {- eprintln!("cua-driver daemon is not running");+ eprintln!("Cua Driver daemon is not running");std::process::exit(1);}}diff --git a/libs/cua-driver/rust/crates/cua-driver/src/updater.rs b/libs/cua-driver/rust/crates/cua-driver/src/updater.rsindex eda7f021de..9dc6fac785 100644--- a/libs/cua-driver/rust/crates/cua-driver/src/updater.rs+++ b/libs/cua-driver/rust/crates/cua-driver/src/updater.rs@@ -2,7 +2,7 @@//!//! Delegates the actual install work to the canonical installer scripts://! - Unix: `libs/cua-driver/scripts/install.sh` (delegates to-//! `_install-rust.sh` when `--backend=rust`)+//! `_install-rust.sh` by default)//! - Windows: `libs/cua-driver/scripts/install.ps1`//!//! Why not reimplement the download / atomic-swap / GC in Rust? Those scripts@@ -64,12 +64,9 @@ pub fn run_install_script(version: &str) -> std::io::Result<ExitStatus> {#[cfg(not(windows))]{- // Match the canonical curl-piped-to-bash invocation. `--backend=rust`- // is the explicit selector — without it the canonical install.sh- // auto-detects on macOS and would install the Swift driver instead.- let bash_cmd = format!(- "curl -fsSL {CANONICAL_INSTALL_SH} | bash -s -- install --backend=rust"- );+ // Match the canonical curl-piped-to-bash invocation. install.sh+ // delegates to the Rust implementation by default.+ let bash_cmd = format!("curl -fsSL {CANONICAL_INSTALL_SH} | bash");Command::new("bash").env(VERSION_PIN_ENV, version).args(["-c", &bash_cmd])@@ -94,6 +91,6 @@ pub fn manual_install_one_liner() -> String {}#[cfg(not(windows))]{- format!("curl -fsSL {CANONICAL_INSTALL_SH} | bash -s -- install --backend=rust")+ format!("curl -fsSL {CANONICAL_INSTALL_SH} | bash")}}diff --git a/libs/cua-driver/rust/crates/cua-driver/src/version_check.rs b/libs/cua-driver/rust/crates/cua-driver/src/version_check.rsindex 6f266a85f0..add61d1e4e 100644--- a/libs/cua-driver/rust/crates/cua-driver/src/version_check.rs+++ b/libs/cua-driver/rust/crates/cua-driver/src/version_check.rs@@ -146,8 +146,7 @@ pub struct UpdateState {////// Lives here (rather than in the `cua-driver` crate's `updater.rs`) so the/// MCP tool in this crate doesn't pull a circular dep. Both call sites-/// emit the same string — the canonical install URL and the same-/// `--backend=rust` flag the docs print.+/// emit the same string as the docs' canonical install URL.fn install_one_liner() -> String {#[cfg(windows)]{@@ -155,7 +154,7 @@ fn install_one_liner() -> String {}#[cfg(not(windows))]{- "curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh | bash -s -- install --backend=rust".to_owned()+ "curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh | bash".to_owned()}}diff --git a/libs/cua-driver/rust/crates/platform-windows/examples/daemon_lifecycle_parity.rs b/libs/cua-driver/rust/crates/platform-windows/examples/daemon_lifecycle_parity.rsindex 634d447894..6ecb143808 100644--- a/libs/cua-driver/rust/crates/platform-windows/examples/daemon_lifecycle_parity.rs+++ b/libs/cua-driver/rust/crates/platform-windows/examples/daemon_lifecycle_parity.rs@@ -17,7 +17,7 @@ fn main() {let stdout = String::from_utf8_lossy(&out.stdout);let lines: Vec<&str> = stdout.lines().collect();assert!(lines.len() >= 2, "status should print at least 2 lines, got: {stdout:?}");- assert_eq!(lines[0], "cua-driver daemon is running",+ assert_eq!(lines[0], "Cua Driver daemon is running","first line wrong: {:?}", lines[0]);assert!(lines[1].trim_start().starts_with("socket:"),"second line should start with 'socket:': {:?}", lines[1]);@@ -39,7 +39,7 @@ fn main() {let out3 = Command::new(&exe).arg("status").output().expect("status2");assert_eq!(out3.status.code(), Some(1), "status after stop should exit 1");let stderr3 = String::from_utf8_lossy(&out3.stderr);- assert!(stderr3.contains("cua-driver daemon is not running"),+ assert!(stderr3.contains("Cua Driver daemon is not running"),"stderr should say 'not running': {stderr3:?}");println!("status-not-running OK");@@ -47,7 +47,7 @@ fn main() {let out4 = Command::new(&exe).arg("stop").output().expect("stop2");assert_eq!(out4.status.code(), Some(1), "stop on dead daemon should exit 1");let stderr4 = String::from_utf8_lossy(&out4.stderr);- assert!(stderr4.contains("cua-driver daemon is not running"),+ assert!(stderr4.contains("Cua Driver daemon is not running"),"stderr should say 'not running': {stderr4:?}");println!("stop-not-running OK");diff --git a/libs/cua-driver/scripts/_install-rust.sh b/libs/cua-driver/scripts/_install-rust.shindex 5e05fd7e1f..9626324556 100644--- a/libs/cua-driver/scripts/_install-rust.sh+++ b/libs/cua-driver/scripts/_install-rust.sh@@ -1,7 +1,7 @@#!/usr/bin/env bash# _install-rust.sh — private helper invoked by libs/cua-driver/scripts/install.sh-# (the canonical user-facing installer) when --backend=rust is selected or-# the script auto-detects a non-macOS host. Not intended for direct+# (the canonical user-facing installer) for the default Rust implementation.+# Not intended for direct# invocation; user-facing one-liners always go through the parent# install.sh, which forwards args + sets up the lockfile.#@@ -9,14 +9,12 @@# and drops the binary into ~/.local/bin (or a path given via --bin-dir /# CUA_DRIVER_RS_INSTALL_DIR). Sudo-free.#-# This is the Rust port of cua-driver — cross-platform (macOS / Linux /-# Windows via WSL or git-bash) computer-use automation. The Swift-# cua-driver (macOS only) ships separately under tag prefix `cua-driver-v*`-# and is installed via the same `libs/cua-driver/scripts/install.sh` (no-# flag); this helper is hard-pinned to `cua-driver-rs-v*` and will never-# pick up the Swift binary.+# This is the cross-platform cua-driver implementation for macOS / Linux /+# Windows via WSL or git-bash. The retired Swift implementation (macOS+# only) still ships separately under tag prefix `cua-driver-v*`; this+# helper is hard-pinned to `cua-driver-rs-v*` and will never pick it up.#-# Canonical user-facing invocation (forwards here on Linux / --backend=rust):+# Canonical user-facing invocation (forwards here by default):# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"## Flags:@@ -65,9 +63,6 @@# it off the list. GC runs after the atomic swap so the about-to-be-active# version is never a deletion candidate.#-# ⚠️ This is a BETA release. The Rust port is feature-complete on Windows-# and Linux; macOS parity with the Swift cua-driver is in progress. For-# production macOS automation prefer `libs/cua-driver/scripts/install.sh`.set -euo pipefail# --- Load shared daemon-cleanup helpers ---------------------------------@@ -745,10 +740,3 @@ case "$(uname -s)" inecho " Re-run the local installer with --autostart to register a systemd user unit.";;esac--echo ""-echo "⚠️ BETA: cua-driver-rs is a cross-platform Rust port of the Swift"-echo " cua-driver. Windows and Linux support is feature-complete; macOS"-echo " parity with the Swift binary is in progress. For production macOS"-echo " use, prefer the original install:"-echo " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)\""diff --git a/libs/cua-driver/scripts/install-local.sh b/libs/cua-driver/scripts/install-local.shindex 39cfc1b965..31baeab48a 100755--- a/libs/cua-driver/scripts/install-local.sh+++ b/libs/cua-driver/scripts/install-local.sh@@ -11,16 +11,15 @@# _install-local-swift.sh Builds CuaDriver.app from libs/cua-driver/swift# and installs to /Applications + ~/.local/bin#-# Defaults (this script only — install.sh keeps the Swift default on macOS):+# Defaults:# all hosts → Rust backend#-# Why the local installer defaults to Rust while the production install.sh-# still gates it behind --experimental-rust: this script is for developers-# working on the checked-out tree, where the Rust port is the active-# development target across all three platforms (Windows / Linux / macOS)-# and has the full integration-test surface attached (see-# crates/cua-driver/tests/harness_*_test.rs). The production curl-pipe-bash-# stays on Swift on macOS until the Rust port flips experimental → stable.+# This script is for developers working on the checked-out tree, where the+# Rust implementation is the active development target across all three+# platforms (Windows / Linux / macOS) and has the full integration-test+# surface attached (see crates/cua-driver/tests/harness_*_test.rs). The+# production curl-pipe-bash path now delegates to the same Rust installer+# unless --backend=swift is explicitly requested for legacy testing.## Flags (forwarded verbatim to whichever helper runs):# --backend=swift|rust explicit backend selector (defaults to rust here)diff --git a/libs/cua-driver/scripts/install.ps1 b/libs/cua-driver/scripts/install.ps1index f4110cefd0..80265c3a00 100644--- a/libs/cua-driver/scripts/install.ps1+++ b/libs/cua-driver/scripts/install.ps1@@ -71,9 +71,7 @@# repo, group policy). Idempotent either way: if the dir is# already on PATH, nothing changes.#-# WARNING — BETA: cua-driver-rs is the cross-platform Rust port of the-# Swift cua-driver. Windows and Linux support is feature-complete;-# macOS parity is in progress and tracked separately.+# Windows installer for the cross-platform cua-driver Rust implementation.[CmdletBinding()]param(@@ -1294,11 +1292,6 @@ if ($AutoStart) {Write-Host " cua-driver autostart status (inspect)" -ForegroundColor CyanWrite-Host " cua-driver autostart disable (remove)" -ForegroundColor Cyan}-Write-Host ""-Write-Host "WARNING -- BETA: cua-driver-rs is a cross-platform Rust port of the Swift" -ForegroundColor Yellow-Write-Host " cua-driver. Windows and Linux support is feature-complete; macOS" -ForegroundColor Yellow-Write-Host " parity is in progress." -ForegroundColor Yellow-}finally {# Always release the lock — success, error, Ctrl-C, or `exit` alldiff --git a/libs/cua-driver/scripts/install.sh b/libs/cua-driver/scripts/install.shindex 6076170493..fa5f92f8d3 100755--- a/libs/cua-driver/scripts/install.sh+++ b/libs/cua-driver/scripts/install.sh@@ -1,8 +1,8 @@#!/usr/bin/env bash-# cua-driver installer — download the latest signed + notarized tarball-# from GitHub Releases, move CuaDriver.app to /Applications, and symlink-# the `cua-driver` binary into ~/.local/bin so shell users can invoke-# it without typing the bundle path. Sudo-free.+# cua-driver installer — download the latest Rust implementation from+# GitHub Releases and wire it into the user's PATH. On macOS this moves+# CuaDriver.app to /Applications and symlinks the `cua-driver` binary+# into ~/.local/bin. Sudo-free.## Usage (from README + release body):# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/install.sh)"@@ -12,18 +12,18 @@# ~/.local/bin (e.g. /usr/local/bin — that target needs sudo)# --no-modify-path skip auto-appending an `export PATH=...` line to your# shell rc when ~/.local/bin is missing from PATH-# --experimental-rust opt into the experimental cua-driver-rs (Rust port)-# backend instead of the Swift binary. Delegates to-# libs/cua-driver/scripts/_install-rust.sh — see that-# script for backend-specific env vars. Installs to a-# separate bundle (CuaDriver.app) so the Swift-# binary is left untouched. Also accepted as-# --backend=rust.+# --backend=swift install the retired Swift macOS implementation+# instead of the Rust implementation. Legacy escape+# hatch only; unsupported on non-macOS hosts.+# --experimental-rust legacy no-op alias for the default Rust path.+# Also accepted as --backend=rust.## Env overrides:-# CUA_DRIVER_VERSION=0.1.0 pin a specific release tag-# CUA_DRIVER_BIN_DIR=PATH same as --bin-dir-# CUA_DRIVER_NO_MODIFY_PATH=1 same as --no-modify-path+# CUA_DRIVER_RS_VERSION=0.3.1 pin a specific Rust release tag+# CUA_DRIVER_VERSION=0.3.1 legacy alias for CUA_DRIVER_RS_VERSION+# CUA_DRIVER_RS_INSTALL_DIR=PATH same as --bin-dir+# CUA_DRIVER_BIN_DIR=PATH legacy alias for --bin-dir+# CUA_DRIVER_NO_MODIFY_PATH=1 same as --no-modify-path## Uninstall:# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.sh)"@@ -37,10 +37,10 @@ APP_DEST="/Applications/$APP_NAME"BIN_DIR="${CUA_DRIVER_BIN_DIR:-$HOME/.local/bin}"NO_MODIFY_PATH="${CUA_DRIVER_NO_MODIFY_PATH:-0}"-# Rust-backend delegation target. The Rust install logic is a private+# Rust implementation delegation target. The Rust install logic is a private# helper script colocated with this one — _install-rust.sh — so that# this directory holds the single user-facing install.sh per platform.-# `--experimental-rust` below either execs the on-disk helper (dev /+# The Rust path below either execs the on-disk helper (dev /# checked-out-tree case) or curls this URL and pipes it to bash# (`curl ... | bash` install case).RUST_INSTALLER_URL="https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/_install-rust.sh"@@ -49,18 +49,16 @@ RUST_INSTALLER_URL="https://raw.githubusercontent.com/trycua/cua/main/libs/cua-d## Two-pass shape:# 1. Walk all argv and collect every unrecognised arg into FORWARDED_ARGS.-# That bucket is what we'd hand off to the Rust installer if the user-# opted in. Recognised Swift-only flags (--bin-dir, --no-modify-path)-# are consumed in this pass and applied to local state.-# 2. If --experimental-rust (or --backend=rust) was seen anywhere in argv,-# exec into the Rust installer with FORWARDED_ARGS and never reach the-# Swift install path below.+# That bucket is what we'd hand off to the Rust installer. Recognised+# shared flags (--bin-dir, --no-modify-path) are consumed in this pass+# and applied to local state.+# 2. Unless --backend=swift was seen, exec into the Rust installer with+# FORWARDED_ARGS and never reach the legacy Swift install path below.#-# This lets the experimental flag appear at any position, lets `--` end-# Swift-flag parsing without breaking forwarding, and keeps both installers'-# argv shapes (--bin-dir, --no-modify-path) bit-compatible so the same-# command works regardless of backend.-USE_RUST_BACKEND=0+# This lets legacy backend flags appear at any position, lets `--` end flag+# parsing without breaking forwarding, and keeps both installers' argv shapes+# (--bin-dir, --no-modify-path) bit-compatible.+USE_RUST_BACKEND=1FORWARDED_ARGS=()PASSTHROUGH=0while [[ $# -gt 0 ]]; do@@ -68,9 +66,9 @@ while [[ $# -gt 0 ]]; doFORWARDED_ARGS+=("$1"); shift; continueficase "$1" in- --experimental-rust) USE_RUST_BACKEND=1; shift ;;- --backend=rust) USE_RUST_BACKEND=1; shift ;;- --backend=swift) shift ;; # explicit default — no-op+ --experimental-rust) shift ;; # legacy alias for default Rust path+ --backend=rust) shift ;; # explicit default — no-op+ --backend=swift) USE_RUST_BACKEND=0; shift ;;--backend=*)printf 'error: unknown backend %q; supported: swift, rust\n' "${1#*=}" >&2exit 2@@ -88,40 +86,26 @@ while [[ $# -gt 0 ]]; doesacdone-# --- Auto-delegate to Rust on non-macOS ---------------------------------+# --- Default delegation to the Rust implementation ----------------------#-# The Swift binary is macOS-only. On Linux (and anywhere else this script-# happens to run that has `bash` + `curl`), there is no Swift install-# path to fall through to — the canonical install becomes cua-driver-rs.-# Auto-set USE_RUST_BACKEND=1 so a single canonical URL works on every-# platform: `curl … cua-driver/scripts/install.sh | bash` gives macOS-# users the Swift driver (today's default) and Linux users the Rust-# port. macOS users who want the Rust port still pass `--experimental-rust`-# / `--backend=rust` explicitly.-AUTO_RUST=0-if [[ "$USE_RUST_BACKEND" == "0" && "$(uname -s 2>/dev/null)" != "Darwin" ]]; then- USE_RUST_BACKEND=1- AUTO_RUST=1- printf 'note: detected non-macOS host (%s); auto-selecting the cua-driver-rs Rust backend.\n' \- "$(uname -s 2>/dev/null || echo unknown)" >&2- printf ' Pass --backend=swift to force the Swift install path (will fail on non-Darwin).\n' >&2-fi--# --- Optional delegation to the experimental Rust backend ----------------#-# If the user opted in with --experimental-rust / --backend=rust, hand the-# rest of argv to _install-rust.sh and exit. The Swift-# install path below is never touched in this case, so the Swift binary-# (if present) is left exactly as-is — users can roll back by deleting-# /Applications/CuaDriver.app and re-running this script without the flag.+# Hand the rest of argv to _install-rust.sh and exit. The legacy Swift+# install path below is only reached when --backend=swift is explicit.if [[ "$USE_RUST_BACKEND" == "1" ]]; then- if [[ "$AUTO_RUST" == "0" ]]; then- # Explicit opt-in on macOS — flag the "experimental" framing.- printf 'note: installing experimental Rust backend (cua-driver-rs). The Swift binary won'"'"'t be touched.\n' >&2+ OS="$(uname -s 2>/dev/null || echo unknown)"+ if [[ "$OS" != "Darwin" ]]; then+ printf 'note: detected non-macOS host (%s); installing cua-driver via the Rust implementation.\n' "$OS" >&2else- # Auto-selected on Linux/other — drop the "experimental" qualifier- # (Rust is the canonical install path on every non-macOS platform).- printf 'note: installing cua-driver-rs (the Rust port — canonical on non-macOS).\n' >&2+ printf 'note: installing cua-driver via the Rust implementation.\n' >&2+ fi++ if [[ -n "${CUA_DRIVER_BIN_DIR:-}" && -z "${CUA_DRIVER_RS_INSTALL_DIR:-}" ]]; then+ export CUA_DRIVER_RS_INSTALL_DIR="$BIN_DIR"+ fi+ if [[ -n "${CUA_DRIVER_VERSION:-}" && -z "${CUA_DRIVER_RS_VERSION:-}" ]]; then+ export CUA_DRIVER_RS_VERSION="$CUA_DRIVER_VERSION"+ fi+ if [[ -n "${CUA_DRIVER_NO_MODIFY_PATH:-}" && -z "${CUA_DRIVER_RS_NO_MODIFY_PATH:-}" ]]; then+ export CUA_DRIVER_RS_NO_MODIFY_PATH="$CUA_DRIVER_NO_MODIFY_PATH"fi# Prefer the on-disk copy when this script is running from a checked-outdiff --git a/libs/cua-driver/scripts/post-install-hints.txt b/libs/cua-driver/scripts/post-install-hints.txtindex 4ea16018f2..851b2ce533 100644--- a/libs/cua-driver/scripts/post-install-hints.txt+++ b/libs/cua-driver/scripts/post-install-hints.txt@@ -6,7 +6,7 @@ Next steps:{{BINARY}} list-tools2. Agent skill pack (optional):- {{BINARY}} skills install # fetch + link the cua-driver-rs skill pack+ {{BINARY}} skills install # fetch + link the cua-driver skill pack# into Claude Code / Codex / OpenClaw / OpenCode.# The install never touches your agent dirs.diff --git a/libs/cua-driver/scripts/uninstall.sh b/libs/cua-driver/scripts/uninstall.shindex a53141f670..342d872170 100755--- a/libs/cua-driver/scripts/uninstall.sh+++ b/libs/cua-driver/scripts/uninstall.sh@@ -1,16 +1,15 @@#!/usr/bin/env bash-# cua-driver uninstaller (Swift driver + Rust port, all platforms in a-# single file). Mirrors uninstall.ps1 on Windows: one canonical script-# per shell, no private `_uninstall-rust.sh` helper.+# cua-driver uninstaller (Rust implementation by default, retired Swift+# driver as an explicit legacy path on macOS). Mirrors uninstall.ps1 on+# Windows: one canonical script per shell, no private `_uninstall-rust.sh`+# helper.## Behaviour by host + flag:-# macOS + no flag → Swift uninstall (today's default)-# macOS + --backend=swift → Swift uninstall (explicit no-op default)-# macOS + --experimental-rust → Rust port uninstall (Swift binary untouched)-# macOS + --backend=rust → same as --experimental-rust-# Linux/ + no flag → auto-selects Rust uninstall-# other (Swift binary is macOS-only; nothing to remove on Linux)-# Linux/ + --backend=swift → no-op (still allowed for compatibility)+# macOS/Linux + no flag → Rust uninstall+# macOS + --backend=swift → retired Swift uninstall+# macOS + --experimental-rust → same as no flag (legacy alias)+# macOS + --backend=rust → same as no flag+# Linux/other + --backend=swift → no-op (still allowed for compatibility)## Swift uninstall removes:# - ~/.local/bin/cua-driver symlink (+ legacy /usr/local/bin/cua-driver)@@ -53,11 +52,6 @@# Usage:# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.sh)"#-# # cua-driver-rs (Rust port) — explicit opt-in on macOS:-# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/cua-driver/scripts/uninstall.sh)" -- --experimental-rust-#-# # Linux auto-detects and removes the Rust port without any flag.-## Env overrides (mirror install side):# CUA_DRIVER_RS_HOME Rust package home to remove (default ~/.cua-driver-rs)set -euo pipefail@@ -67,12 +61,7 @@ set -euo pipefail# stay bit-compatible across install/uninstall and a future Rust-only# flag flows through without edits.# -----------------------------------------------------------------------USE_RUST_BACKEND=0-# Tracks whether the user explicitly named a backend. Needed so that-# `--backend=swift` on Linux suppresses the auto-Rust dispatch below-# (the doc says `--backend=swift` is an "explicit no-op default" —-# without this flag the auto-Rust branch silently overrode it).-BACKEND_EXPLICIT=0+USE_RUST_BACKEND=1FORWARDED_ARGS=()PASSTHROUGH=0while [[ $# -gt 0 ]]; do@@ -80,9 +69,9 @@ while [[ $# -gt 0 ]]; doFORWARDED_ARGS+=("$1"); shift; continueficase "$1" in- --experimental-rust) USE_RUST_BACKEND=1; BACKEND_EXPLICIT=1; shift ;;- --backend=rust) USE_RUST_BACKEND=1; BACKEND_EXPLICIT=1; shift ;;- --backend=swift) BACKEND_EXPLICIT=1; shift ;; # explicit default — no-op+ --experimental-rust) shift ;; # legacy alias for default Rust path+ --backend=rust) shift ;;+ --backend=swift) USE_RUST_BACKEND=0; shift ;;--backend=*)printf 'error: unknown backend %q; supported: swift, rust\n' "${1#*=}" >&2exit 2@@ -92,24 +81,16 @@ while [[ $# -gt 0 ]]; doesacdone-# Auto-select Rust on non-macOS — but only when the user didn't pin a-# backend. The Swift binary is macOS-only, so `--backend=swift` on-# Linux is a deliberate no-op (the script reaches the Swift branch-# below, finds nothing, exits clean). Same logic as install.sh so a-# single canonical URL works on every platform.+# The Swift binary is macOS-only, so `--backend=swift` on Linux is a+# deliberate no-op (the script reaches the Swift branch below, finds+# nothing, exits clean).OS="$(uname -s 2>/dev/null || echo unknown)"-AUTO_RUST=0-if [[ "$BACKEND_EXPLICIT" == "0" && "$USE_RUST_BACKEND" == "0" && "$OS" != "Darwin" ]]; then- USE_RUST_BACKEND=1- AUTO_RUST=1- printf 'note: detected non-macOS host (%s); auto-selecting the cua-driver-rs Rust uninstall.\n' "$OS" >&2- printf ' Pass --backend=swift to force the Swift uninstall path (will be a no-op on non-Darwin).\n' >&2-fi--if [[ "$USE_RUST_BACKEND" == "1" && "$AUTO_RUST" == "0" ]]; then- printf 'note: uninstalling cua-driver-rs (Rust port). The Swift binary won'"'"'t be touched.\n' >&2-elif [[ "$USE_RUST_BACKEND" == "1" && "$AUTO_RUST" == "1" ]]; then- printf 'note: uninstalling cua-driver-rs (the Rust port — canonical on non-macOS).\n' >&2+if [[ "$USE_RUST_BACKEND" == "1" ]]; then+ if [[ "$OS" != "Darwin" ]]; then+ printf 'note: detected non-macOS host (%s); uninstalling cua-driver via the Rust implementation.\n' "$OS" >&2+ else+ printf 'note: uninstalling cua-driver via the Rust implementation.\n' >&2+ fifi# ----------------------------------------------------------------------@@ -139,7 +120,7 @@ resolve_link() {}# -----------------------------------------------------------------------# Rust uninstall branch (Linux + opt-in on macOS).+# Rust uninstall branch (default on Linux + macOS).# ----------------------------------------------------------------------if [[ "$USE_RUST_BACKEND" == "1" ]]; thenUSER_BIN_LINK="$HOME/.local/bin/cua-driver"@@ -296,24 +277,28 @@ if [[ "$USE_RUST_BACKEND" == "1" ]]; then# writes platform-dependent targets (the local copy under $HOME_DIR/# skills/cua-driver-rs/). The [[ -L ]] check is the load-bearing# safety bar.- for SKILL_LINK in \- "$HOME/.claude/skills/$SKILL_PACK_NAME" \- "$HOME/.agents/skills/$SKILL_PACK_NAME" \- "$HOME/.openclaw/skills/$SKILL_PACK_NAME" \- "$HOME/.config/opencode/skills/$SKILL_PACK_NAME" \- "$HOME/.claude/skills/$LEGACY_SKILL_PACK_NAME" \- "$HOME/.agents/skills/$LEGACY_SKILL_PACK_NAME" \- "$HOME/.openclaw/skills/$LEGACY_SKILL_PACK_NAME" \- "$HOME/.config/opencode/skills/$LEGACY_SKILL_PACK_NAME"; do- if [[ -L "$SKILL_LINK" ]]; then- rm -f "$SKILL_LINK"- log "removed skill symlink $SKILL_LINK"- elif [[ -d "$SKILL_LINK" ]]; then- log "$SKILL_LINK is a real directory, not a symlink (skipping)"- else- log "no skill symlink at $SKILL_LINK (skipping)"- fi- done+ if [[ "$RUST_INSTALL_PRESENT" == "1" ]]; then+ for SKILL_LINK in \+ "$HOME/.claude/skills/$SKILL_PACK_NAME" \+ "$HOME/.agents/skills/$SKILL_PACK_NAME" \+ "$HOME/.openclaw/skills/$SKILL_PACK_NAME" \+ "$HOME/.config/opencode/skills/$SKILL_PACK_NAME" \+ "$HOME/.claude/skills/$LEGACY_SKILL_PACK_NAME" \+ "$HOME/.agents/skills/$LEGACY_SKILL_PACK_NAME" \+ "$HOME/.openclaw/skills/$LEGACY_SKILL_PACK_NAME" \+ "$HOME/.config/opencode/skills/$LEGACY_SKILL_PACK_NAME"; do+ if [[ -L "$SKILL_LINK" ]]; then+ rm -f "$SKILL_LINK"+ log "removed skill symlink $SKILL_LINK"+ elif [[ -d "$SKILL_LINK" ]]; then+ log "$SKILL_LINK is a real directory, not a symlink (skipping)"+ else+ log "no skill symlink at $SKILL_LINK (skipping)"+ fi+ done+ else+ log "no Rust install marker; leaving agent skill symlinks untouched"+ fi# --- Claude Code MCP registrations ---# Same scrub shape as the Swift branch, keyed on the cua-driver-rs@@ -361,9 +346,9 @@ def invokes_cua_driver_rs(server):# explicit ".cua-driver-rs" segment. Plain "cua-driver" alone is# ambiguous (the Swift binary uses the same filename). The shared# /Applications/CuaDriver.app path is ALSO ambiguous (Rust took- # over Swift's bundle id) — only count it as Rust when a Rust- # install marker is on disk; otherwise it's almost certainly a- # Swift registration we shouldn't scrub.+ # over the Swift bundle id) — only count it as Rust when a Rust+ # install marker is on disk; otherwise it is almost certainly a+ # Swift registration we should not scrub.if home_dir and home_dir in joined:return Trueif "CuaDriverRs.app" in joined or ".cua-driver-rs" in joined or "cua-driver-rs" in joined:@@ -450,7 +435,7 @@ PYif [[ "$OS" == "Darwin" ]]; thencat << 'FINALUNMSG'-cua-driver-rs uninstalled.+cua-driver uninstalled.TCC grants (Accessibility + Screen Recording) remain in SystemSettings > Privacy & Security. Reset them explicitly if you want a@@ -467,15 +452,20 @@ FINALUNMSGelsecat << 'FINALUNMSG'-cua-driver-rs uninstalled.+cua-driver uninstalled.FINALUNMSGfiexit 0fi# -----------------------------------------------------------------------# Swift uninstall branch (macOS, default).+# Swift uninstall branch (macOS legacy, explicit --backend=swift only).# ----------------------------------------------------------------------+if [[ "$OS" != "Darwin" ]]; then+ log "legacy Swift uninstall requested on non-macOS host ($OS); nothing to remove"+ exit 0+fi+USER_BIN_LINK="$HOME/.local/bin/cua-driver"SYSTEM_BIN_LINK="/usr/local/bin/cua-driver"APP_BUNDLE="/Applications/CuaDriver.app"diff --git a/scripts/docs-generators/README.md b/scripts/docs-generators/README.mdindex f853b0fd68..4cdf269350 100644--- a/scripts/docs-generators/README.md+++ b/scripts/docs-generators/README.md@@ -8,6 +8,7 @@ This directory contains auto-documentation generators for the Cua libraries. Thescripts/docs-generators/├── config.json # Central configuration for all generators├── runner.ts # Main orchestrator that runs generators+├── cua-driver.ts # cua-driver (Rust) generator├── lume.ts # Lume (Swift) generator├── cua-cli.ts # Cua CLI (TypeScript) generator (planned)├── mcp-server.ts # MCP Server (Python) generator (planned)@@ -86,6 +87,7 @@ Different libraries use different extraction methods:| Language | Method | Description || ---------- | ------------------------ | ---------------------------------- |+| Rust | `dump-docs` | Built-in command that outputs JSON || Swift | `dump-docs` | Built-in command that outputs JSON || TypeScript | `yargs-parse` | Parse yargs CLI definitions || Python | `argparse-introspection` | Introspect argparse commands |@@ -105,6 +107,7 @@ The `.github/workflows/docs-sync-check.yml` workflow:| Generator | Status | Notes || ----------------------- | -------------- | ------------------------- |+| cua-driver | ✅ Implemented | CLI + MCP tools || lume | ✅ Implemented | CLI + HTTP API || cua-cli | ⏸️ Planned | Needs yargs introspection || mcp-server | ⏸️ Planned | Needs MCP tool extraction |diff --git a/scripts/docs-generators/config.json b/scripts/docs-generators/config.jsonindex ec5c33ed12..069564f415 100644--- a/scripts/docs-generators/config.json+++ b/scripts/docs-generators/config.json@@ -4,26 +4,28 @@"generators": {"cua-driver": {"name": "Cua Driver",- "language": "swift",- "sourcePath": "libs/cua-driver/Sources",+ "language": "rust",+ "sourcePath": "libs/cua-driver/rust/crates","docsOutputPath": "docs/content/docs/cua-driver/reference","generatorScript": "scripts/docs-generators/cua-driver.ts","watchPaths": [- "libs/cua-driver/Sources/**/*.swift"+ "libs/cua-driver/rust/crates/**/*.rs",+ "libs/cua-driver/rust/Cargo.toml",+ "libs/cua-driver/rust/Cargo.lock"],- "buildCommand": "swift build --configuration release",- "buildDirectory": "libs/cua-driver",+ "buildCommand": "cargo build -p cua-driver --release",+ "buildDirectory": "libs/cua-driver/rust","extractionMethod": "dump-docs","outputs": [{"type": "mcp","outputFile": "mcp-tools.mdx",- "extractCommand": ".build/release/cua-driver dump-docs --type mcp"+ "extractCommand": "target/release/cua-driver dump-docs --type mcp"},{"type": "cli","outputFile": "cli-reference.mdx",- "extractCommand": ".build/release/cua-driver dump-docs --type cli"+ "extractCommand": "target/release/cua-driver dump-docs --type cli"}],"enabled": false,diff --git a/scripts/docs-generators/cua-driver.ts b/scripts/docs-generators/cua-driver.tsindex fcf98444ba..37f949f576 100644--- a/scripts/docs-generators/cua-driver.ts+++ b/scripts/docs-generators/cua-driver.ts@@ -11,8 +11,9 @@* npx tsx scripts/docs-generators/cua-driver.ts --check # Check for drift (CI mode)*/-import { execSync } from 'child_process';+import { execFileSync, execSync } from 'child_process';import * as fs from 'fs';+import * as os from 'os';import * as path from 'path';// ============================================================================@@ -92,21 +93,44 @@ export interface DumpDocsOutput {// ============================================================================const ROOT_DIR = path.resolve(__dirname, '../..');-const CUA_DRIVER_DIR = path.join(ROOT_DIR, 'libs', 'cua-driver');-const DOCS_OUTPUT_DIR = path.join(- ROOT_DIR,- 'docs',- 'content',- 'docs',- 'cua-driver',- 'reference'+const CUA_DRIVER_DIR = path.join(ROOT_DIR, 'libs', 'cua-driver', 'rust');+const CUA_DRIVER_BIN = path.join(+ CUA_DRIVER_DIR,+ 'target',+ 'release',+ process.platform === 'win32' ? 'cua-driver.exe' : 'cua-driver');-const TAG_PREFIX = 'cua-driver-v';+const DOCS_OUTPUT_DIR = path.join(ROOT_DIR, 'docs', 'content', 'docs', 'cua-driver', 'reference');+const TAG_PREFIX = 'cua-driver-rs-v';// ============================================================================// Version Discovery// ============================================================================+function resolveCargoCommand(): string {+ if (process.env.CARGO) {+ return process.env.CARGO;+ }++ const candidates = [+ 'cargo',+ path.join(os.homedir() || '', '.cargo', 'bin', 'cargo'),+ '/opt/homebrew/bin/cargo',+ '/usr/local/bin/cargo',+ ];++ for (const candidate of candidates) {+ try {+ execFileSync(candidate, ['--version'], { stdio: 'ignore' });+ return candidate;+ } catch {+ // Try the next candidate.+ }+ }++ throw new Error('cargo not found on PATH; install Rust or set CARGO=/path/to/cargo');+}+interface VersionInfo {version: string;href: string;@@ -190,7 +214,8 @@ async function main() {// Step 1: Build cua-driverconsole.log('Building cua-driver...');try {- execSync('swift build --configuration release', {+ const cargo = resolveCargoCommand();+ execFileSync(cargo, ['build', '-p', 'cua-driver', '--release'], {cwd: CUA_DRIVER_DIR,stdio: 'inherit',});@@ -201,13 +226,11 @@ async function main() {// Step 2: Extract all docs in a single invocationconsole.log('\nExtracting documentation...');- const dumpDocsJson = execSync(- '.build/release/cua-driver dump-docs --type all --pretty',- {- cwd: CUA_DRIVER_DIR,- encoding: 'utf-8',- }- );+ const binary = process.env.CUA_DRIVER_BINARY || CUA_DRIVER_BIN;+ const dumpDocsJson = execFileSync(binary, ['dump-docs', '--type', 'all', '--pretty'], {+ cwd: CUA_DRIVER_DIR,+ encoding: 'utf-8',+ });const dumpDocs: DumpDocsOutput = JSON.parse(dumpDocsJson);console.log(` Found ${dumpDocs.cli.commands.length} CLI commands`);console.log(` Found ${dumpDocs.mcp.tools.length} MCP tools`);@@ -261,7 +284,9 @@ async function main() {}if (hasDrift) {- console.error("\nRun 'npx tsx scripts/docs-generators/cua-driver.ts' to update documentation");+ console.error(+ "\nRun 'npx tsx scripts/docs-generators/cua-driver.ts' to update documentation"+ );process.exit(1);}@@ -299,7 +324,7 @@ export function generateCLIReferenceMDX(docs: CLIDocumentation, releasedVersion:lines.push(`{/*AUTO-GENERATED FILE - DO NOT EDIT DIRECTLYGenerated by: npx tsx scripts/docs-generators/cua-driver.ts- Source: recursive Swift sources under libs/cua-driver/Sources+ Source: cua-driver dump-docsVersion: ${releasedVersion}*/}`);lines.push('');@@ -328,7 +353,7 @@ export function generateCLIReferenceMDX(docs: CLIDocumentation, releasedVersion:const daemonManagement = ['serve', 'stop', 'status', 'mcp', 'mcp-config'];const trajectoryRecording = ['recording'];const configuration = ['config'];- const diagnostics = ['diagnose', 'update', 'doctor'];+ const diagnostics = ['diagnose', 'update', 'check-update', 'doctor'];lines.push('## Tool dispatch');lines.push('');@@ -410,7 +435,9 @@ export function generateCommandDoc(cmd: CommandDoc): string[] {lines.push('| ---- | ---- | -------- | ----------- |');for (const arg of cmd.arguments) {const required = arg.is_optional ? 'No' : 'Yes';- lines.push(`| \`<${arg.name}>\` | ${escapeTableCell(arg.type)} | ${required} | ${escapeTableCell(arg.help)} |`);+ lines.push(+ `| \`<${arg.name}>\` | ${escapeTableCell(arg.type)} | ${required} | ${escapeTableCell(arg.help)} |`+ );}lines.push('');}@@ -426,7 +453,9 @@ export function generateCommandDoc(cmd: CommandDoc): string[] {? `\`-${opt.short_name}\`, \`--${opt.name}\``: `\`--${opt.name}\``;const defaultVal = opt.default_value != null ? opt.default_value : '—';- lines.push(`| ${nameCell} | ${escapeTableCell(opt.type)} | ${escapeTableCell(defaultVal)} | ${escapeTableCell(opt.help)} |`);+ lines.push(+ `| ${nameCell} | ${escapeTableCell(opt.type)} | ${escapeTableCell(defaultVal)} | ${escapeTableCell(opt.help)} |`+ );}lines.push('');}@@ -466,7 +495,9 @@ export function generateCommandDoc(cmd: CommandDoc): string[] {lines.push('| ---- | ---- | -------- | ----------- |');for (const arg of sub.arguments) {const required = arg.is_optional ? 'No' : 'Yes';- lines.push(`| \`<${arg.name}>\` | ${escapeTableCell(arg.type)} | ${required} | ${escapeTableCell(arg.help)} |`);+ lines.push(+ `| \`<${arg.name}>\` | ${escapeTableCell(arg.type)} | ${required} | ${escapeTableCell(arg.help)} |`+ );}lines.push('');}@@ -481,7 +512,9 @@ export function generateCommandDoc(cmd: CommandDoc): string[] {? `\`-${opt.short_name}\`, \`--${opt.name}\``: `\`--${opt.name}\``;const defaultVal = opt.default_value != null ? opt.default_value : '—';- lines.push(`| ${nameCell} | ${escapeTableCell(opt.type)} | ${escapeTableCell(defaultVal)} | ${escapeTableCell(opt.help)} |`);+ lines.push(+ `| ${nameCell} | ${escapeTableCell(opt.type)} | ${escapeTableCell(defaultVal)} | ${escapeTableCell(opt.help)} |`+ );}lines.push('');}@@ -520,7 +553,9 @@ export function generateCommandDoc(cmd: CommandDoc): string[] {lines.push('| ---- | ---- | -------- | ----------- |');for (const arg of nested.arguments) {const required = arg.is_optional ? 'No' : 'Yes';- lines.push(`| \`<${arg.name}>\` | ${escapeTableCell(arg.type)} | ${required} | ${escapeTableCell(arg.help)} |`);+ lines.push(+ `| \`<${arg.name}>\` | ${escapeTableCell(arg.type)} | ${required} | ${escapeTableCell(arg.help)} |`+ );}lines.push('');}@@ -535,7 +570,9 @@ export function generateCommandDoc(cmd: CommandDoc): string[] {? `\`-${opt.short_name}\`, \`--${opt.name}\``: `\`--${opt.name}\``;const defaultVal = opt.default_value != null ? opt.default_value : '—';- lines.push(`| ${nameCell} | ${escapeTableCell(opt.type)} | ${escapeTableCell(defaultVal)} | ${escapeTableCell(opt.help)} |`);+ lines.push(+ `| ${nameCell} | ${escapeTableCell(opt.type)} | ${escapeTableCell(defaultVal)} | ${escapeTableCell(opt.help)} |`+ );}lines.push('');}@@ -571,13 +608,13 @@ export function generateMCPToolsMDX(docs: MCPDocumentation, releasedVersion: str// Frontmatter — must be at the very beginning of the filelines.push('---');lines.push('title: MCP Tools');- lines.push('description: Reference for every MCP tool cua-driver exposes');+ lines.push('description: Reference for every MCP tool Cua Driver exposes');lines.push('---');lines.push('');lines.push(`{/*AUTO-GENERATED FILE - DO NOT EDIT DIRECTLYGenerated by: npx tsx scripts/docs-generators/cua-driver.ts- Source: recursive Swift sources under libs/cua-driver/Sources+ Source: cua-driver dump-docsVersion: ${releasedVersion}*/}`);lines.push('');@@ -590,7 +627,7 @@ export function generateMCPToolsMDX(docs: MCPDocumentation, releasedVersion: str);lines.push('');lines.push(- "Tool names are `snake_case`. Responses are MCP `CallTool.Result` envelopes: a text content block prefixed with a `✅` summary (or the error reason on failure), plus optional image or structured-content blocks on tools that produce them. See the [CLI reference](/cua-driver/reference/cli-reference) for CLI-specific flags like `--raw` and `--screenshot-out-file`."+ 'Tool names are `snake_case`. Responses are MCP `CallTool.Result` envelopes: a text content block prefixed with a `✅` summary (or the error reason on failure), plus optional image or structured-content blocks on tools that produce them. See the [CLI reference](/cua-driver/reference/cli-reference) for CLI-specific options like `--socket` and `--screenshot-out-file`.');lines.push('');lines.push('<Callout type="info">');@@ -601,14 +638,92 @@ export function generateMCPToolsMDX(docs: MCPDocumentation, releasedVersion: strlines.push('');lines.push('<Callout type="info">');lines.push(- ' **TCC auto-delegation.** When an MCP client spawns `cua-driver mcp` from an IDE terminal (Claude Code, Cursor, VS Code, Warp), macOS attributes the subprocess to the parent terminal — not `CuaDriver.app` — so AX probes fail against the wrong bundle id. `mcp` detects this and auto-launches a `cua-driver serve` daemon via `open -n -g -a CuaDriver --args serve`, then proxies every tool call through the daemon\'s Unix socket. Tool semantics are identical to the in-process path; no Python bridge is needed. Pass `--no-daemon-relaunch` (or set `CUA_DRIVER_MCP_NO_RELAUNCH=1`) to force in-process execution. See the [process model guide](/cua-driver/guide/getting-started/process-model) for the full lifecycle, failure modes, and wrapper-author guidance.'+ " **TCC auto-delegation.** When an MCP client spawns `cua-driver mcp` from an IDE terminal (Claude Code, Cursor, VS Code, Warp), macOS attributes the subprocess to the parent terminal — not `CuaDriver.app` — so AX probes fail against the wrong bundle id. `mcp` detects this and auto-launches a `cua-driver serve` daemon via `open -n -g -a CuaDriver --args serve`, then proxies every tool call through the daemon's Unix socket. Tool semantics are identical to the in-process path; no Python bridge is needed. Pass `--no-daemon-relaunch` (or set `CUA_DRIVER_MCP_NO_RELAUNCH=1`) to force in-process execution. See the [process model guide](/cua-driver/guide/getting-started/process-model) for the full lifecycle, failure modes, and wrapper-author guidance.");lines.push('</Callout>');lines.push('');- // Emit each tool- for (const tool of docs.tools) {- lines.push(...generateMCPToolDoc(tool));+ const categories: Array<{ title: string; tools: string[] }> = [+ {+ title: 'Inspection tools',+ tools: [+ 'list_apps',+ 'list_windows',+ 'get_window_state',+ 'get_accessibility_tree',+ 'get_screen_size',+ 'get_cursor_position',+ 'get_config',+ 'get_recording_state',+ 'get_agent_cursor_state',+ ],+ },+ {+ title: 'Action tools',+ tools: [+ 'launch_app',+ 'kill_app',+ 'bring_to_front',+ 'click',+ 'double_click',+ 'right_click',+ 'drag',+ 'type_text',+ 'press_key',+ 'hotkey',+ 'set_value',+ 'scroll',+ 'move_cursor',+ 'zoom',+ ],+ },+ {+ title: 'Browser tools',+ tools: ['page'],+ },+ {+ title: 'Recording tools',+ tools: ['start_recording', 'stop_recording', 'replay_trajectory'],+ },+ {+ title: 'Configuration tools',+ tools: [+ 'set_config',+ 'set_agent_cursor_enabled',+ 'set_agent_cursor_motion',+ 'set_agent_cursor_style',+ ],+ },+ {+ title: 'Maintenance tools',+ tools: ['check_permissions', 'check_for_update'],+ },+ ];++ const byName = new Map(docs.tools.map((tool) => [tool.name, tool]));+ const emitted = new Set<string>();++ for (const category of categories) {+ const tools = category.tools+ .map((name) => byName.get(name))+ .filter((tool): tool is MCPToolDoc => Boolean(tool));+ if (tools.length === 0) continue;++ lines.push(`## ${category.title}`);+ lines.push('');+ for (const tool of tools) {+ emitted.add(tool.name);+ lines.push(...generateMCPToolDoc(tool));+ }+ }++ const uncategorised = docs.tools.filter((tool) => !emitted.has(tool.name));+ if (uncategorised.length > 0) {+ lines.push('## Other tools');+ lines.push('');+ for (const tool of uncategorised) {+ lines.push(...generateMCPToolDoc(tool));+ }}return lines.join('\n');@@ -637,7 +752,9 @@ export function generateMCPToolDoc(tool: MCPToolDoc): string[] {const isRequired = required.has(propName);const requiredLabel = isRequired ? 'required' : 'optional';const typeLabel = formatPropertyType(prop);- lines.push(`- \`${propName}\` (${typeLabel}, ${requiredLabel}): ${escapeMdxText(prop.description ?? '')}`);+ const description = escapeMdxText(prop.description ?? '');+ const suffix = description ? `: ${description}` : '';+ lines.push(`- \`${propName}\` (${typeLabel}, ${requiredLabel})${suffix}`);}lines.push('');}@@ -698,12 +815,16 @@ function syntheticExampleValue(name: string, prop: MCPPropertyDoc): unknown {if (name === 'pid') return 844;if (name === 'window_id') return 10725;if (name === 'element_index') return 14;- if (name === 'x' || name === 'x1' || name === 'x2' || name === 'from_x' || name === 'to_x') return 100;- if (name === 'y' || name === 'y1' || name === 'y2' || name === 'from_y' || name === 'to_y') return 200;+ if (name === 'x' || name === 'x1' || name === 'x2' || name === 'from_x' || name === 'to_x')+ return 100;+ if (name === 'y' || name === 'y1' || name === 'y2' || name === 'from_y' || name === 'to_y')+ return 200;return 1;case 'number':- if (name === 'x' || name === 'x1' || name === 'x2' || name === 'from_x' || name === 'to_x') return 100;- if (name === 'y' || name === 'y1' || name === 'y2' || name === 'from_y' || name === 'to_y') return 200;+ if (name === 'x' || name === 'x1' || name === 'x2' || name === 'from_x' || name === 'to_x')+ return 100;+ if (name === 'y' || name === 'y1' || name === 'y2' || name === 'from_y' || name === 'to_y')+ return 200;return 0.5;case 'boolean':return false;