rightkit_control/lib.rs
1//! rightkit-control: drive a real desktop app like a human, in the background.
2//!
3//! macOS: embedded targets receive main-thread AppKit `NSEvent`s through the
4//! WKWebView responder, including hidden, non-key windows. Non-embedded targets
5//! use per-pid `CGEventPostToPid` (never the global HID tap); inactive-window
6//! first-mouse handling can discard their press. Neither path activates apps
7//! or moves the user's cursor.
8//! State is read through the Accessibility API and window captures.
9//!
10//! Control-plane guarantees (CodeRight EFF-001 / PTY-002):
11//! - [`admission::EffectGate`]: every effectful request is validated, approved
12//! by a host [`admission::AdmissionHook`], executed, and settled; a denial
13//! happens before any side effect.
14//! - [`lease::InputLease`]: input carries `(epoch, sequence)`; stale epochs are
15//! fenced, duplicates are deduplicated, unacknowledged input must be
16//! explicitly reconciled. [`lease::ControlSession`] composes both.
17//! - [`events::ControlEvent`]: content-free lifecycle events for the journal.
18//!
19//! - [`offscreen`]: `launch_offscreen` for recording scenarios (placement outside all
20//! displays, qualification, process-activity/EcoQoS defences).
21//!
22//! - [`lease_store`]: optional durable lease state (store trait plus an
23//! atomic file store), execution identity and `Running | Exited | Unknown`.
24//!
25//! Every effectful entry point routes through the gate: `webdriver::Server`,
26//! the `tauri-plugin` server, `mac::Gated` and the `rightkit-control` CLI
27//! ([`cli`]). The raw macOS primitives are reachable only through the
28//! explicitly named `mac::unsafe_ungated` opt-in.
29pub mod admission;
30pub mod cli;
31#[cfg(feature = "tauri-plugin")]
32pub mod embedded;
33pub mod events;
34pub mod json;
35pub mod keys;
36pub mod lease;
37pub mod lease_store;
38#[cfg(target_os = "macos")]
39pub mod mac;
40pub mod offscreen;
41pub mod webdriver;