Skip to content

armgit / cua

Public Imported from GitHub
0

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

fix(cua-driver): fail loudly when the unbundled daemon has no WindowServer connection (CUA-1777) (#5333)

Francesco Bonacci73c3f0b836d3
diff --git a/docs/content/docs/cua-driver/reference/mcp-tools/maintenance.mdx b/docs/content/docs/cua-driver/reference/mcp-tools/maintenance.mdx
index cb9f50e0eb..27e351ecf7 100644
--- a/docs/content/docs/cua-driver/reference/mcp-tools/maintenance.mdx
+++ b/docs/content/docs/cua-driver/reference/mcp-tools/maintenance.mdx
@@ -215,7 +215,7 @@ If both are given, `include` wins.
Canonical check names:
macOS : binary_version, platform_supported, session_active,
bundle_identity, tcc_accessibility, tcc_screen_recording,
- ax_capability, screen_capture_capability
+ ax_capability, screen_capture_capability, windowserver_connection
Windows: binary_version, platform_supported, session_active,
ax_capability (via UIA), screen_capture_capability (via DXGI)
Linux : binary_version, platform_supported, session_active,
diff --git a/libs/cua-driver/rust/crates/cua-driver-core/src/health_report.rs b/libs/cua-driver/rust/crates/cua-driver-core/src/health_report.rs
index e9a8e80f3d..81f7d2738d 100644
--- a/libs/cua-driver/rust/crates/cua-driver-core/src/health_report.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-core/src/health_report.rs
@@ -49,6 +49,7 @@ pub const NAME_TCC_ACCESSIBILITY: &str = "tcc_accessibility";
pub const NAME_TCC_SCREEN_RECORDING: &str = "tcc_screen_recording";
pub const NAME_AX_CAPABILITY: &str = "ax_capability";
pub const NAME_SCREEN_CAPTURE_CAPABILITY: &str = "screen_capture_capability";
+pub const NAME_WINDOWSERVER_CONNECTION: &str = "windowserver_connection";
/// Checks whose failure marks the whole report as `failed` (vs
/// `degraded`). Binary, platform, and the MCP session itself are
@@ -385,7 +386,7 @@ If both are given, `include` wins.
Canonical check names:
macOS : binary_version, platform_supported, session_active,
bundle_identity, tcc_accessibility, tcc_screen_recording,
- ax_capability, screen_capture_capability
+ ax_capability, screen_capture_capability, windowserver_connection
Windows: binary_version, platform_supported, session_active,
ax_capability (via UIA), screen_capture_capability (via DXGI)
Linux : binary_version, platform_supported, session_active,
diff --git a/libs/cua-driver/rust/crates/cua-driver/src/main.rs b/libs/cua-driver/rust/crates/cua-driver/src/main.rs
index 88e78472ec..6636979ee0 100644
--- a/libs/cua-driver/rust/crates/cua-driver/src/main.rs
+++ b/libs/cua-driver/rust/crates/cua-driver/src/main.rs
@@ -595,6 +595,7 @@ fn main() {
std::process::exit(64);
}
responsibility::reexec_disclaimed_if_needed();
+ responsibility::warn_if_unbundled();
if let Err(error) = history_runtime::configure_admission(history_admission_requested(
experimental_history,
history_runtime::preview_admitted_preference(),
@@ -1015,6 +1016,7 @@ fn main() -> anyhow::Result<()> {
&grants,
)?;
responsibility::reexec_disclaimed_if_needed();
+ responsibility::warn_if_unbundled();
history_runtime::configure_admission(history_admission_requested(
experimental_history,
history_runtime::preview_admitted_preference(),
diff --git a/libs/cua-driver/rust/crates/cua-driver/src/responsibility.rs b/libs/cua-driver/rust/crates/cua-driver/src/responsibility.rs
index 7baf4cfa48..ae0649d824 100644
--- a/libs/cua-driver/rust/crates/cua-driver/src/responsibility.rs
+++ b/libs/cua-driver/rust/crates/cua-driver/src/responsibility.rs
@@ -170,10 +170,48 @@ pub fn reexec_disclaimed_if_needed() {
#[cfg(not(target_os = "macos"))]
pub fn reexec_disclaimed_if_needed() {}
+/// The startup warning for a daemon running outside CuaDriver.app, or `None`
+/// when it is embedded or bundled (CUA-1777).
+#[cfg(target_os = "macos")]
+fn unbundled_warning(embedded: bool, inside_bundle: bool) -> Option<&'static str> {
+ if embedded || inside_bundle {
+ return None;
+ }
+ Some(
+ "warning: running unbundled (outside CuaDriver.app). The daemon is its own responsible \
+ process, so macOS gives it no valid WindowServer connection: background (no-raise) \
+ focus steps fail with status 1002 and background actions will be refused. Run the \
+ app-bundle daemon instead: `open -n -g -a CuaDriver --args serve`.",
+ )
+}
+
+/// Print the unbundled warning once at daemon startup.
+#[cfg(target_os = "macos")]
+pub fn warn_if_unbundled() {
+ if let Some(message) = unbundled_warning(
+ cua_driver_core::embedded_mode(),
+ crate::bundle::is_executable_inside_cuadriver_app(),
+ ) {
+ eprintln!("cua-driver: {message}");
+ tracing::warn!("{message}");
+ }
+}
+
+#[cfg(not(target_os = "macos"))]
+pub fn warn_if_unbundled() {}
+
#[cfg(all(test, target_os = "macos"))]
mod tests {
use super::*;
+ #[test]
+ fn unbundled_daemon_gets_a_startup_warning_and_bundled_or_embedded_does_not() {
+ let message = unbundled_warning(false, false).expect("warns when unbundled");
+ assert!(message.contains("open -n -g -a CuaDriver --args serve"));
+ assert!(unbundled_warning(false, true).is_none());
+ assert!(unbundled_warning(true, false).is_none());
+ }
+
#[test]
fn embedded_mode_skips_disclaim_reexec() {
assert!(should_skip_disclaim(true, false, false));
diff --git a/libs/cua-driver/rust/crates/platform-macos/src/input/skylight.rs b/libs/cua-driver/rust/crates/platform-macos/src/input/skylight.rs
index a87be59c2b..70e87b39bd 100644
--- a/libs/cua-driver/rust/crates/platform-macos/src/input/skylight.rs
+++ b/libs/cua-driver/rust/crates/platform-macos/src/input/skylight.rs
@@ -257,8 +257,9 @@ pub fn post_window_key_records(pid: pid_t, current: Option<u32>, target: u32) ->
if !get_process_psn_for_window(target, pid, &mut psn) {
return false;
}
- let send =
- |record: &[u8; 0xF8]| unsafe { post(psn.as_ptr() as *const c_void, record.as_ptr()) == 0 };
+ let send = |record: &[u8; 0xF8]| {
+ note_post_status(unsafe { post(psn.as_ptr() as *const c_void, record.as_ptr()) })
+ };
let mut ok = true;
if let Some(current) = current {
let mut defocus = focus_record(current);
@@ -333,6 +334,38 @@ type GetWindowOwnerFn = unsafe extern "C" fn(u32, u32, *mut u32) -> i32;
/// `OSStatus SLSGetConnectionPSN(uint32_t cid, void *psn)`
type GetConnectionPSNFn = unsafe extern "C" fn(u32, *mut c_void) -> i32;
+// ── WindowServer connection health (CUA-1777) ───────────────────────────────
+
+/// `SLPSPostEventRecordTo` result for "invalid connection". The daemon gets it
+/// when it runs as its own responsible process (a bare binary outside
+/// CuaDriver.app, which relaunches itself disclaimed): the process has no
+/// usable WindowServer connection for the target, so every no-raise focus
+/// record is dropped.
+pub const WINDOWSERVER_INVALID_CONNECTION: i32 = 1002;
+
+static WINDOWSERVER_CONNECTION_INVALID: std::sync::atomic::AtomicBool =
+ std::sync::atomic::AtomicBool::new(false);
+
+/// Record the status of one `SLPSPostEventRecordTo` and report success. A
+/// 1002 is remembered for the life of the process so tools and `health_report`
+/// can fail loudly instead of continuing without the focus step.
+pub(crate) fn note_post_status(status: i32) -> bool {
+ if status == WINDOWSERVER_INVALID_CONNECTION {
+ WINDOWSERVER_CONNECTION_INVALID.store(true, std::sync::atomic::Ordering::Relaxed);
+ }
+ status == 0
+}
+
+/// True once any focus-record post returned the invalid-connection status.
+pub fn windowserver_connection_invalid() -> bool {
+ WINDOWSERVER_CONNECTION_INVALID.load(std::sync::atomic::Ordering::Relaxed)
+}
+
+#[cfg(test)]
+pub(crate) fn reset_windowserver_connection_invalid_for_test() {
+ WINDOWSERVER_CONNECTION_INVALID.store(false, std::sync::atomic::Ordering::Relaxed);
+}
+
// ── Focus-without-raise SPIs ──────────────────────────────────────────────────
/// `OSStatus SLPSPostEventRecordTo(const void *psn, const uint8_t *bytes)`
@@ -992,12 +1025,13 @@ pub fn activate_without_raise_with(
// Step 3: defocus previous front.
buf[0x8A] = 0x02;
- let defocus_ok =
- !defocus_front || unsafe { post_fn(prev_psn.as_ptr() as *const c_void, buf.as_ptr()) == 0 };
+ let defocus_ok = !defocus_front
+ || note_post_status(unsafe { post_fn(prev_psn.as_ptr() as *const c_void, buf.as_ptr()) });
// Step 4: focus target.
buf[0x8A] = 0x01;
- let focus_ok = unsafe { post_fn(target_psn.as_ptr() as *const c_void, buf.as_ptr()) == 0 };
+ let focus_ok =
+ note_post_status(unsafe { post_fn(target_psn.as_ptr() as *const c_void, buf.as_ptr()) });
defocus_ok && focus_ok
}
@@ -1032,11 +1066,13 @@ pub fn restore_focus_after_without_raise(
let mut buf = focus_record(target_wid);
buf[0x8A] = 0x02;
- let defocus_ok = unsafe { post_fn(target_psn.as_ptr() as *const c_void, buf.as_ptr()) == 0 };
+ let defocus_ok =
+ note_post_status(unsafe { post_fn(target_psn.as_ptr() as *const c_void, buf.as_ptr()) });
let mut buf = focus_record(previous_wid);
buf[0x8A] = 0x01;
- let focus_ok = unsafe { post_fn(previous_psn.as_ptr() as *const c_void, buf.as_ptr()) == 0 };
+ let focus_ok =
+ note_post_status(unsafe { post_fn(previous_psn.as_ptr() as *const c_void, buf.as_ptr()) });
defocus_ok && focus_ok
}
@@ -1184,7 +1220,8 @@ pub fn make_exact_window_key(target_pid: libc::pid_t, target_wid: u32) -> bool {
}
for event_kind in [0x01, 0x02] {
let record = make_key_window_record(target_wid, event_kind);
- if unsafe { post(target_psn.as_ptr() as *const c_void, record.as_ptr()) } != 0 {
+ if !note_post_status(unsafe { post(target_psn.as_ptr() as *const c_void, record.as_ptr()) })
+ {
return false;
}
}
@@ -1532,10 +1569,22 @@ pub fn with_menu_shortcut_activation(
#[cfg(test)]
mod tests {
use super::{
- focus_failure_hint_from, foreground_turn, make_key_window_record,
- preserves_exact_existing_focus,
+ focus_failure_hint_from, foreground_turn, make_key_window_record, note_post_status,
+ preserves_exact_existing_focus, reset_windowserver_connection_invalid_for_test,
+ windowserver_connection_invalid, WINDOWSERVER_INVALID_CONNECTION,
};
+ #[test]
+ fn a_1002_post_status_is_remembered_and_other_failures_are_not() {
+ reset_windowserver_connection_invalid_for_test();
+ assert!(note_post_status(0));
+ assert!(!note_post_status(-1));
+ assert!(!windowserver_connection_invalid());
+ assert!(!note_post_status(WINDOWSERVER_INVALID_CONNECTION));
+ assert!(windowserver_connection_invalid());
+ reset_windowserver_connection_invalid_for_test();
+ }
+
#[test]
fn focus_failure_names_the_dialog_that_holds_focus() {
let hint = focus_failure_hint_from(Some(true), Some((3991, "Delete Contents".into())));
diff --git a/libs/cua-driver/rust/crates/platform-macos/src/tools/click.rs b/libs/cua-driver/rust/crates/platform-macos/src/tools/click.rs
index 70105d483c..67bfae23e4 100644
--- a/libs/cua-driver/rust/crates/platform-macos/src/tools/click.rs
+++ b/libs/cua-driver/rust/crates/platform-macos/src/tools/click.rs
@@ -1277,30 +1277,34 @@ impl Tool for ClickTool {
// is required by Chromium gates and remote-HID proxies such as
// iPhone Mirroring. Re-pin after the focus record because changing
// AppKit active state can disturb overlay ordering.
- let focus_without_raise =
- if activation_policy == PixelActivationPolicy::AllowTargetWithoutRaise {
- let wid = window_id.expect("activation policy requires window_id");
- match tokio::task::spawn_blocking(move || {
- crate::input::mouse::prepare_background_pixel_click(pid, wid)
- })
- .await
- {
- Ok(activated) => {
- crate::cursor::overlay::send_command(
- cursor_key.clone(),
- cursor_overlay::OverlayCommand::PinAbove(wid as u64),
- );
- activated
- }
- Err(error) => {
- return ToolResult::error(format!(
- "Background click activation task failed: {error}"
- ));
+ let focus_without_raise = if activation_policy
+ == PixelActivationPolicy::AllowTargetWithoutRaise
+ {
+ let wid = window_id.expect("activation policy requires window_id");
+ match tokio::task::spawn_blocking(move || {
+ crate::input::mouse::prepare_background_pixel_click(pid, wid)
+ })
+ .await
+ {
+ Ok(activated) => {
+ if !activated && crate::input::skylight::windowserver_connection_invalid() {
+ return super::windowserver_connection_refusal(pid, Some(wid));
}
+ crate::cursor::overlay::send_command(
+ cursor_key.clone(),
+ cursor_overlay::OverlayCommand::PinAbove(wid as u64),
+ );
+ activated
}
- } else {
- false
- };
+ Err(error) => {
+ return ToolResult::error(format!(
+ "Background click activation task failed: {error}"
+ ));
+ }
+ }
+ } else {
+ false
+ };
// Pulse only after the activation settle so it visually coincides
// with the real target click rather than the private focus prelude.
diff --git a/libs/cua-driver/rust/crates/platform-macos/src/tools/drag.rs b/libs/cua-driver/rust/crates/platform-macos/src/tools/drag.rs
index ff00ff8d2c..24db90a04a 100644
--- a/libs/cua-driver/rust/crates/platform-macos/src/tools/drag.rs
+++ b/libs/cua-driver/rust/crates/platform-macos/src/tools/drag.rs
@@ -377,6 +377,9 @@ impl Tool for DragTool {
.await
{
Ok(activated) => {
+ if !activated && crate::input::skylight::windowserver_connection_invalid() {
+ return super::windowserver_connection_refusal(pid, Some(wid));
+ }
crate::cursor::overlay::send_command(
cursor_key.clone(),
cursor_overlay::OverlayCommand::PinAbove(wid as u64),
diff --git a/libs/cua-driver/rust/crates/platform-macos/src/tools/health_report.rs b/libs/cua-driver/rust/crates/platform-macos/src/tools/health_report.rs
index 9cbadeada9..15e27369a7 100644
--- a/libs/cua-driver/rust/crates/platform-macos/src/tools/health_report.rs
+++ b/libs/cua-driver/rust/crates/platform-macos/src/tools/health_report.rs
@@ -14,6 +14,7 @@ use cua_driver_core::health_report::{
CheckData, CheckEntry, HealthCheckProvider, NAME_AX_CAPABILITY, NAME_BINARY_VERSION,
NAME_BUNDLE_IDENTITY, NAME_PLATFORM_SUPPORTED, NAME_SCREEN_CAPTURE_CAPABILITY,
NAME_SESSION_ACTIVE, NAME_TCC_ACCESSIBILITY, NAME_TCC_SCREEN_RECORDING,
+ NAME_WINDOWSERVER_CONNECTION,
};
use crate::permissions::status::{accessibility_granted, current_status, screen_recording_granted};
@@ -29,6 +30,7 @@ pub const MACOS_CHECK_NAMES: &[&str] = &[
NAME_TCC_SCREEN_RECORDING,
NAME_AX_CAPABILITY,
NAME_SCREEN_CAPTURE_CAPABILITY,
+ NAME_WINDOWSERVER_CONNECTION,
];
/// The canonical bundle identifier whose TCC grants matter for the
@@ -58,6 +60,7 @@ impl HealthCheckProvider for MacosHealthProvider {
NAME_TCC_SCREEN_RECORDING => check_tcc_screen_recording(),
NAME_AX_CAPABILITY => check_ax_capability(),
NAME_SCREEN_CAPTURE_CAPABILITY => check_screen_capture_capability(),
+ NAME_WINDOWSERVER_CONNECTION => check_windowserver_connection(),
// Defensive: the dispatcher only forwards names in
// `check_names()`, so this branch should be unreachable.
other => CheckEntry::skip(
@@ -70,6 +73,49 @@ impl HealthCheckProvider for MacosHealthProvider {
// ── Individual checks ────────────────────────────────────────────────────────
+/// True when this daemon is neither embedded in a host app nor inside
+/// CuaDriver.app: it relaunched itself disclaimed, as its own responsible
+/// process (CUA-1777).
+pub fn is_unbundled(embedded: bool, exe_path: &str) -> bool {
+ !embedded
+ && !(exe_path.contains("/CuaDriver.app/Contents/MacOS/")
+ || exe_path.contains("/CuaDriverLocal.app/Contents/MacOS/"))
+}
+
+fn check_windowserver_connection() -> CheckEntry {
+ let exe = std::env::current_exe()
+ .ok()
+ .and_then(|p| std::fs::canonicalize(p).ok())
+ .and_then(|p| p.to_str().map(str::to_owned))
+ .unwrap_or_default();
+ windowserver_connection_entry(
+ is_unbundled(cua_driver_core::embedded_mode(), &exe),
+ crate::input::skylight::windowserver_connection_invalid(),
+ )
+}
+
+fn windowserver_connection_entry(unbundled: bool, invalid_seen: bool) -> CheckEntry {
+ let hint = super::WINDOWSERVER_INVALID_HINT;
+ if invalid_seen {
+ return CheckEntry::fail(
+ NAME_WINDOWSERVER_CONNECTION,
+ "SLPSPostEventRecordTo returned 1002 (invalid connection): background focus steps are failing.",
+ hint,
+ );
+ }
+ if unbundled {
+ return CheckEntry::fail(
+ NAME_WINDOWSERVER_CONNECTION,
+ "Running unbundled (outside CuaDriver.app): the daemon is its own responsible process and its no-raise focus steps are expected to fail with 1002.",
+ hint,
+ );
+ }
+ CheckEntry::pass(
+ NAME_WINDOWSERVER_CONNECTION,
+ "No invalid WindowServer connection observed.",
+ )
+}
+
pub(crate) fn check_platform_supported() -> CheckEntry {
// Reaching this code path on macOS implies a supported platform —
// the macOS build is gated behind `cfg(target_os = "macos")`.
@@ -367,6 +413,32 @@ fn arch_label() -> &'static str {
#[cfg(test)]
mod tests {
use super::*;
+
+ #[test]
+ fn unbundled_detection_follows_embedding_and_bundle_path() {
+ assert!(is_unbundled(false, "/usr/local/bin/cua-driver"));
+ assert!(!is_unbundled(true, "/usr/local/bin/cua-driver"));
+ assert!(!is_unbundled(
+ false,
+ "/Applications/CuaDriver.app/Contents/MacOS/cua-driver"
+ ));
+ }
+
+ #[test]
+ fn windowserver_check_fails_loudly_when_invalid_or_unbundled() {
+ let seen = windowserver_connection_entry(false, true);
+ assert_eq!(seen.status, CheckStatus::Fail);
+ assert!(seen.message.contains("1002"));
+ assert!(seen.hint.unwrap().contains("open -n -g -a CuaDriver"));
+ assert_eq!(
+ windowserver_connection_entry(true, false).status,
+ CheckStatus::Fail
+ );
+ assert_eq!(
+ windowserver_connection_entry(false, false).status,
+ CheckStatus::Pass
+ );
+ }
use cua_driver_core::health_report::{CheckStatus, HealthReportTool};
use cua_driver_core::tool::Tool;
use std::sync::Arc;
diff --git a/libs/cua-driver/rust/crates/platform-macos/src/tools/mod.rs b/libs/cua-driver/rust/crates/platform-macos/src/tools/mod.rs
index 8fb4c66b76..cd39cdd64f 100644
--- a/libs/cua-driver/rust/crates/platform-macos/src/tools/mod.rs
+++ b/libs/cua-driver/rust/crates/platform-macos/src/tools/mod.rs
@@ -302,6 +302,35 @@ pub(crate) fn background_refusal_result(
.with_structured(structured)
}
+/// Hint shown with every `windowserver_connection_invalid` refusal.
+pub(crate) const WINDOWSERVER_INVALID_HINT: &str = "This daemon runs without its own app-bundle identity (a bare `cua-driver serve`), so macOS gives it no valid WindowServer connection and every no-raise focus step fails. Run the app-bundle daemon: `open -n -g -a CuaDriver --args serve`.";
+
+/// Structured refusal for a background action whose no-raise focus step got
+/// `SLPSPostEventRecordTo` status 1002 (invalid connection). Nothing was sent
+/// to the target.
+pub(crate) fn windowserver_connection_refusal(
+ pid: i32,
+ window_id: Option<u32>,
+) -> cua_driver_core::protocol::ToolResult {
+ cua_driver_core::delivery::background_unavailable_result(
+ format!(
+ "Background input is not available for pid {pid}: the WindowServer connection is \
+ invalid (SLPSPostEventRecordTo returned 1002). {WINDOWSERVER_INVALID_HINT}"
+ ),
+ "background_unavailable",
+ "the daemon has no valid WindowServer connection, so no-raise focus cannot work; \
+ run the app-bundle daemon, or retry with delivery_mode:\"foreground\".",
+ serde_json::json!({
+ "reason": "windowserver_connection_invalid",
+ "status": crate::input::skylight::WINDOWSERVER_INVALID_CONNECTION,
+ "effect": "refused",
+ "pid": pid,
+ "window_id": window_id,
+ "hint": WINDOWSERVER_INVALID_HINT,
+ }),
+ )
+}
+
/// Exclusive per-process ownership of one background mutation. Callers must
/// keep this value alive through actuator dispatch, focus restoration, and
/// target-bound verification.
@@ -433,6 +462,9 @@ pub(crate) async fn acquire_key_scope(
};
match tokio::task::spawn_blocking(move || key_scope(pid, Some(wid))).await {
Ok(Ok(scope)) => Ok(scope),
+ Ok(Err(_)) if crate::input::skylight::windowserver_connection_invalid() => {
+ Err(windowserver_connection_refusal(pid, Some(wid)))
+ }
Ok(Err(reason)) => Err(background_refusal_result(
pid,
wid,
@@ -1370,3 +1402,23 @@ mod recording_start_guard_tests {
let _ = rec.stop_owner(None);
}
}
+
+#[cfg(test)]
+mod windowserver_refusal_tests {
+ use super::*;
+
+ #[test]
+ fn refusal_names_the_reason_and_the_app_bundle_daemon() {
+ let result = windowserver_connection_refusal(42, Some(7));
+ assert_eq!(result.is_error, Some(true));
+ let structured = result.structured_content.expect("structured");
+ assert_eq!(structured["code"], "background_unavailable");
+ assert_eq!(structured["reason"], "windowserver_connection_invalid");
+ assert_eq!(structured["status"], 1002);
+ assert_eq!(structured["window_id"], 7);
+ assert!(structured["hint"]
+ .as_str()
+ .unwrap()
+ .contains("open -n -g -a CuaDriver --args serve"));
+ }
+}
diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json
index 13b3cb7df8..3c2ba4fa3f 100644
--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json
+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-linux.json
@@ -2074,7 +2074,7 @@
"read_only": true
},
{
- "description": "Single-call end-to-end driver diagnostics. Designed to let downstream consumers ship one stable call instead of stitching together check_permissions, doctor, version, bundle attribution, and platform capability status. On macOS, prompt-capable direct capture is deliberately skipped. For standalone CuaDriver, use `cua-driver permissions grant` to verify it explicitly. For an embedded or linked driver, use the host's permission flow for the app or executable macOS attributes this process's permission request to; the standalone command does not verify the host's capture readiness. cua-driver owns the health model; consumers stay thin.\n\nInput — all optional:\n {\n \"include\": [\"<check_name>\", ...], // run only these\n \"skip\": [\"<check_name>\", ...] // skip these\n }\nIf both are given, `include` wins.\n\nCanonical check names:\n macOS : binary_version, platform_supported, session_active,\n bundle_identity, tcc_accessibility, tcc_screen_recording,\n ax_capability, screen_capture_capability\n Windows: binary_version, platform_supported, session_active,\n ax_capability (via UIA), screen_capture_capability (via DXGI)\n Linux : binary_version, platform_supported, session_active,\n ax_capability (via AT-SPI), screen_capture_capability (via X11)\n\nOutput — stable contract, schema_version=\"1\":\n {\n \"schema_version\": \"1\",\n \"platform\": \"darwin\" | \"win32\" | \"linux\",\n \"driver_version\": \"<semver>\",\n \"overall\": \"ok\" | \"degraded\" | \"failed\",\n \"checks\": [\n {\n \"name\": \"<one of the canonical names above>\",\n \"status\": \"pass\" | \"fail\" | \"skip\",\n \"message\": \"<one-line summary, always present>\",\n \"hint\": \"<remediation step, present when status=fail>\",\n \"data\": { /* check-specific structured fields */ }\n },\n ...\n ]\n }\n\n`overall` rules:\n - `ok` — every non-skipped check passes\n - `degraded` — at least one non-core check fails (binary is still usable)\n - `failed` — any core check fails (binary_version, platform_supported, session_active)\n\nStability: schema_version=\"1\" is the contract. Future breaking changes will be `\"2\"`. Adding new check names under the same schema_version is non-breaking; consumers must tolerate unknown check names.",
+ "description": "Single-call end-to-end driver diagnostics. Designed to let downstream consumers ship one stable call instead of stitching together check_permissions, doctor, version, bundle attribution, and platform capability status. On macOS, prompt-capable direct capture is deliberately skipped. For standalone CuaDriver, use `cua-driver permissions grant` to verify it explicitly. For an embedded or linked driver, use the host's permission flow for the app or executable macOS attributes this process's permission request to; the standalone command does not verify the host's capture readiness. cua-driver owns the health model; consumers stay thin.\n\nInput — all optional:\n {\n \"include\": [\"<check_name>\", ...], // run only these\n \"skip\": [\"<check_name>\", ...] // skip these\n }\nIf both are given, `include` wins.\n\nCanonical check names:\n macOS : binary_version, platform_supported, session_active,\n bundle_identity, tcc_accessibility, tcc_screen_recording,\n ax_capability, screen_capture_capability, windowserver_connection\n Windows: binary_version, platform_supported, session_active,\n ax_capability (via UIA), screen_capture_capability (via DXGI)\n Linux : binary_version, platform_supported, session_active,\n ax_capability (via AT-SPI), screen_capture_capability (via X11)\n\nOutput — stable contract, schema_version=\"1\":\n {\n \"schema_version\": \"1\",\n \"platform\": \"darwin\" | \"win32\" | \"linux\",\n \"driver_version\": \"<semver>\",\n \"overall\": \"ok\" | \"degraded\" | \"failed\",\n \"checks\": [\n {\n \"name\": \"<one of the canonical names above>\",\n \"status\": \"pass\" | \"fail\" | \"skip\",\n \"message\": \"<one-line summary, always present>\",\n \"hint\": \"<remediation step, present when status=fail>\",\n \"data\": { /* check-specific structured fields */ }\n },\n ...\n ]\n }\n\n`overall` rules:\n - `ok` — every non-skipped check passes\n - `degraded` — at least one non-core check fails (binary is still usable)\n - `failed` — any core check fails (binary_version, platform_supported, session_active)\n\nStability: schema_version=\"1\" is the contract. Future breaking changes will be `\"2\"`. Adding new check names under the same schema_version is non-breaking; consumers must tolerate unknown check names.",
"destructive": false,
"idempotent": true,
"input_schema": {
diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json
index 974143df62..f8a25b66f4 100644
--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json
+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-macos.json
@@ -1725,7 +1725,7 @@
"read_only": false
},
{
- "description": "Single-call end-to-end driver diagnostics. Designed to let downstream consumers ship one stable call instead of stitching together check_permissions, doctor, version, bundle attribution, and platform capability status. On macOS, prompt-capable direct capture is deliberately skipped. For standalone CuaDriver, use `cua-driver permissions grant` to verify it explicitly. For an embedded or linked driver, use the host's permission flow for the app or executable macOS attributes this process's permission request to; the standalone command does not verify the host's capture readiness. cua-driver owns the health model; consumers stay thin.\n\nInput — all optional:\n {\n \"include\": [\"<check_name>\", ...], // run only these\n \"skip\": [\"<check_name>\", ...] // skip these\n }\nIf both are given, `include` wins.\n\nCanonical check names:\n macOS : binary_version, platform_supported, session_active,\n bundle_identity, tcc_accessibility, tcc_screen_recording,\n ax_capability, screen_capture_capability\n Windows: binary_version, platform_supported, session_active,\n ax_capability (via UIA), screen_capture_capability (via DXGI)\n Linux : binary_version, platform_supported, session_active,\n ax_capability (via AT-SPI), screen_capture_capability (via X11)\n\nOutput — stable contract, schema_version=\"1\":\n {\n \"schema_version\": \"1\",\n \"platform\": \"darwin\" | \"win32\" | \"linux\",\n \"driver_version\": \"<semver>\",\n \"overall\": \"ok\" | \"degraded\" | \"failed\",\n \"checks\": [\n {\n \"name\": \"<one of the canonical names above>\",\n \"status\": \"pass\" | \"fail\" | \"skip\",\n \"message\": \"<one-line summary, always present>\",\n \"hint\": \"<remediation step, present when status=fail>\",\n \"data\": { /* check-specific structured fields */ }\n },\n ...\n ]\n }\n\n`overall` rules:\n - `ok` — every non-skipped check passes\n - `degraded` — at least one non-core check fails (binary is still usable)\n - `failed` — any core check fails (binary_version, platform_supported, session_active)\n\nStability: schema_version=\"1\" is the contract. Future breaking changes will be `\"2\"`. Adding new check names under the same schema_version is non-breaking; consumers must tolerate unknown check names.",
+ "description": "Single-call end-to-end driver diagnostics. Designed to let downstream consumers ship one stable call instead of stitching together check_permissions, doctor, version, bundle attribution, and platform capability status. On macOS, prompt-capable direct capture is deliberately skipped. For standalone CuaDriver, use `cua-driver permissions grant` to verify it explicitly. For an embedded or linked driver, use the host's permission flow for the app or executable macOS attributes this process's permission request to; the standalone command does not verify the host's capture readiness. cua-driver owns the health model; consumers stay thin.\n\nInput — all optional:\n {\n \"include\": [\"<check_name>\", ...], // run only these\n \"skip\": [\"<check_name>\", ...] // skip these\n }\nIf both are given, `include` wins.\n\nCanonical check names:\n macOS : binary_version, platform_supported, session_active,\n bundle_identity, tcc_accessibility, tcc_screen_recording,\n ax_capability, screen_capture_capability, windowserver_connection\n Windows: binary_version, platform_supported, session_active,\n ax_capability (via UIA), screen_capture_capability (via DXGI)\n Linux : binary_version, platform_supported, session_active,\n ax_capability (via AT-SPI), screen_capture_capability (via X11)\n\nOutput — stable contract, schema_version=\"1\":\n {\n \"schema_version\": \"1\",\n \"platform\": \"darwin\" | \"win32\" | \"linux\",\n \"driver_version\": \"<semver>\",\n \"overall\": \"ok\" | \"degraded\" | \"failed\",\n \"checks\": [\n {\n \"name\": \"<one of the canonical names above>\",\n \"status\": \"pass\" | \"fail\" | \"skip\",\n \"message\": \"<one-line summary, always present>\",\n \"hint\": \"<remediation step, present when status=fail>\",\n \"data\": { /* check-specific structured fields */ }\n },\n ...\n ]\n }\n\n`overall` rules:\n - `ok` — every non-skipped check passes\n - `degraded` — at least one non-core check fails (binary is still usable)\n - `failed` — any core check fails (binary_version, platform_supported, session_active)\n\nStability: schema_version=\"1\" is the contract. Future breaking changes will be `\"2\"`. Adding new check names under the same schema_version is non-breaking; consumers must tolerate unknown check names.",
"destructive": false,
"idempotent": true,
"input_schema": {
diff --git a/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json b/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json
index 9689095724..6d2e3b3c6c 100644
--- a/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json
+++ b/scripts/docs-generators/cli-specs/cua-driver-mcp-windows.json
@@ -1769,7 +1769,7 @@
"read_only": true
},
{
- "description": "Single-call end-to-end driver diagnostics. Designed to let downstream consumers ship one stable call instead of stitching together check_permissions, doctor, version, bundle attribution, and platform capability status. On macOS, prompt-capable direct capture is deliberately skipped. For standalone CuaDriver, use `cua-driver permissions grant` to verify it explicitly. For an embedded or linked driver, use the host's permission flow for the app or executable macOS attributes this process's permission request to; the standalone command does not verify the host's capture readiness. cua-driver owns the health model; consumers stay thin.\n\nInput — all optional:\n {\n \"include\": [\"<check_name>\", ...], // run only these\n \"skip\": [\"<check_name>\", ...] // skip these\n }\nIf both are given, `include` wins.\n\nCanonical check names:\n macOS : binary_version, platform_supported, session_active,\n bundle_identity, tcc_accessibility, tcc_screen_recording,\n ax_capability, screen_capture_capability\n Windows: binary_version, platform_supported, session_active,\n ax_capability (via UIA), screen_capture_capability (via DXGI)\n Linux : binary_version, platform_supported, session_active,\n ax_capability (via AT-SPI), screen_capture_capability (via X11)\n\nOutput — stable contract, schema_version=\"1\":\n {\n \"schema_version\": \"1\",\n \"platform\": \"darwin\" | \"win32\" | \"linux\",\n \"driver_version\": \"<semver>\",\n \"overall\": \"ok\" | \"degraded\" | \"failed\",\n \"checks\": [\n {\n \"name\": \"<one of the canonical names above>\",\n \"status\": \"pass\" | \"fail\" | \"skip\",\n \"message\": \"<one-line summary, always present>\",\n \"hint\": \"<remediation step, present when status=fail>\",\n \"data\": { /* check-specific structured fields */ }\n },\n ...\n ]\n }\n\n`overall` rules:\n - `ok` — every non-skipped check passes\n - `degraded` — at least one non-core check fails (binary is still usable)\n - `failed` — any core check fails (binary_version, platform_supported, session_active)\n\nStability: schema_version=\"1\" is the contract. Future breaking changes will be `\"2\"`. Adding new check names under the same schema_version is non-breaking; consumers must tolerate unknown check names.",
+ "description": "Single-call end-to-end driver diagnostics. Designed to let downstream consumers ship one stable call instead of stitching together check_permissions, doctor, version, bundle attribution, and platform capability status. On macOS, prompt-capable direct capture is deliberately skipped. For standalone CuaDriver, use `cua-driver permissions grant` to verify it explicitly. For an embedded or linked driver, use the host's permission flow for the app or executable macOS attributes this process's permission request to; the standalone command does not verify the host's capture readiness. cua-driver owns the health model; consumers stay thin.\n\nInput — all optional:\n {\n \"include\": [\"<check_name>\", ...], // run only these\n \"skip\": [\"<check_name>\", ...] // skip these\n }\nIf both are given, `include` wins.\n\nCanonical check names:\n macOS : binary_version, platform_supported, session_active,\n bundle_identity, tcc_accessibility, tcc_screen_recording,\n ax_capability, screen_capture_capability, windowserver_connection\n Windows: binary_version, platform_supported, session_active,\n ax_capability (via UIA), screen_capture_capability (via DXGI)\n Linux : binary_version, platform_supported, session_active,\n ax_capability (via AT-SPI), screen_capture_capability (via X11)\n\nOutput — stable contract, schema_version=\"1\":\n {\n \"schema_version\": \"1\",\n \"platform\": \"darwin\" | \"win32\" | \"linux\",\n \"driver_version\": \"<semver>\",\n \"overall\": \"ok\" | \"degraded\" | \"failed\",\n \"checks\": [\n {\n \"name\": \"<one of the canonical names above>\",\n \"status\": \"pass\" | \"fail\" | \"skip\",\n \"message\": \"<one-line summary, always present>\",\n \"hint\": \"<remediation step, present when status=fail>\",\n \"data\": { /* check-specific structured fields */ }\n },\n ...\n ]\n }\n\n`overall` rules:\n - `ok` — every non-skipped check passes\n - `degraded` — at least one non-core check fails (binary is still usable)\n - `failed` — any core check fails (binary_version, platform_supported, session_active)\n\nStability: schema_version=\"1\" is the contract. Future breaking changes will be `\"2\"`. Adding new check names under the same schema_version is non-breaking; consumers must tolerate unknown check names.",
"destructive": false,
"idempotent": true,
"input_schema": {