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 `qa-control` 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/// QA-only in-app control server. Compiled only with the explicit `qa-control` feature, which no shipped
32/// build may enable (see the README section "QA control never ships"). `tauri-plugin` alone does not
33/// expose it.
34#[cfg(feature = "qa-control")]
35pub mod embedded;
36pub mod events;
37pub mod json;
38pub mod keys;
39pub mod lease;
40pub mod lease_store;
41#[cfg(target_os = "macos")]
42pub mod mac;
43pub mod offscreen;
44pub mod webdriver;