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): remove dead macOS active-Space helper and single-use snapshot wrapper (#6094)

injaneity6c018fb3b486
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 136e0c977f..6ead6b733b 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
@@ -684,15 +684,6 @@ pub fn main_connection_id() -> Option<u32> {
connection_id_fn().map(|f| unsafe { f() })
}
-/// Return the current active macOS Space (desktop) ID.
-///
-/// Uses the private `CGSGetActiveSpace` SPI from SkyLight. Returns `None`
-/// when the symbol is unavailable (future macOS version that removes it).
-pub fn get_active_space() -> Option<u64> {
- let cid = main_connection_id()?;
- nonzero_space_id(get_active_space_fn().map(|f| unsafe { f(cid) }))
-}
-
fn nonzero_space_id(space_id: Option<u64>) -> Option<u64> {
space_id.filter(|id| *id != 0)
}
diff --git a/libs/cua-driver/rust/crates/platform-macos/src/recording_hooks.rs b/libs/cua-driver/rust/crates/platform-macos/src/recording_hooks.rs
index bb28e4b64f..1e61619c96 100644
--- a/libs/cua-driver/rust/crates/platform-macos/src/recording_hooks.rs
+++ b/libs/cua-driver/rust/crates/platform-macos/src/recording_hooks.rs
@@ -1,13 +1,8 @@
use crate::ax::bindings::{element_screen_center, AXUIElementRef};
-use crate::ax::snapshot::{AxSnapshot, Snapshots};
+use crate::ax::snapshot::AxSnapshot;
use cua_driver_core::element_token::ResolvedElement;
-use cua_driver_core::snapshot_store::{current_runtime_store, register_runtime_store};
+use cua_driver_core::snapshot_store::current_runtime_store;
use serde_json::Value;
-use std::sync::Arc;
-
-pub fn set_snapshots(cache: Arc<Snapshots>) {
- register_runtime_store(&cache);
-}
/// Per-turn application state for trajectory recording. The walk shares the
/// `get_window_state` budget semantics: it stops when `budget.timeout_ms` runs
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 7b0efb0d9e..c0753b186f 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
@@ -1057,7 +1057,7 @@ pub fn register_all(
}
// Share the element cache with the recording-hook layer so it can
// resolve element_index → window-local screenshot coords for click.png.
- crate::recording_hooks::set_snapshots(state.snapshots.clone());
+ cua_driver_core::snapshot_store::register_runtime_store(&state.snapshots);
// Drop a disconnecting session's config overrides + owned cursor on
// `session_end`. The daemon fans the session id out to this hook;