Repository navigation
XYZLCU 0.7.1: single-window background control + global input safety gate
0.7.1 — 2026-11-14
- Add an unlocked global input safety gate across CLI, daemon and MCP: HID/session keyboard events, HID mouse click/move/drag/scroll, and activation (including implicit/open-to-front) require explicit
--allow-globalor an intended--app/--pidalready frontmost. Recheck immediately before each event batch and stop if the frontmost target changes. Refuse before creating a global CGEvent with non-zero status,ok:false,GLOBAL_INPUT_REFUSED, and the actual frontmost app. AX-only andpostToPidroutes are unchanged; auto routing cannot bypass the gate. - Never accept
XYZLCU_ALLOW_GLOBAL=1as authorization. MCP tools that can emit global input exposeallowGlobal(boolean, defaultfalse) and use the same gate. - A failed
lock, including bad/empty window IDs, unknown options or missing targets, writes a persistentlock-failedtombstone and updates daemon state. Subsequent input fails withLOCK_FAILEDuntil explicitunlockor a successfullock. Empty/missing option values are hard argument errors and never consume the next option. - Keep health/check/probe diagnostics passive: they never emit global keyboard/mouse input.
- Extend permission-free selftests with CLI/C-client/MCP refusal paths, failed-lock chaining, option validation and rejected environment bypass. Tests never emit global input or activate apps. Keep background AX/pid routes intact; GUI acceptance remains a separate check.
0.7.0 — 2026-11-14
- Make Single-window background control the headline feature.
lock/ MCPlockdefault to strict process+window scope: AX/pid only, no activation/raise, pointer warp, global HID, clipboard fallback, broad app menus or silent foreground fallback. Reject conflicting target selectors and unsafe--no-lockbypasses; corrupt/unreadable lock state fails closed, and an exited target retains its lock until explicit recovery. Errors includeerror: "refused: would use global input"and an actionablehint. - Add command-local
--allow-foreground/--allow-global(MCPallow_foreground/allow_global) and persistentlock --unsafe/ MCPunsafe. Global HID still checks the intended frontmost target. Strict menus allow only scoped edit commands; app-wide/unknown menus,check --probe, permission requests, open/activate/hide/movewin/replay/move/drag are refused unless explicitly relaxed. Both READMEs contain the side-effect audit. - Use ScreenCaptureKit
SCContentFilter(desktopIndependentWindow:)exclusively for every targeted/locked window screenshot, including pid/window-id targeting. Covered and partly off-screen windows use the OS backing surface. Window screenshots/diffs report window-relative coordinates and a separate global window frame. No desktop crop, full-display or CLI capture fallback. Window capture supports macOS 13 through a one-frame SCStream and macOS 14+ through SCScreenshotManager/live streams;--cliwith a window target is refused. Minimized/other-Space capture remains OS-dependent. - Harden public
CGEvent.postToPidmouse/Unicode/key/scroll routes: confirm the target AX key window, convert window points to event global locations, tag window-number fields, hold down/up events, and avoid shared HID event state. No private SLEvent posting symbols. Reportroute,verifiedand a reason when delivery/effect cannot be verified; bounded AX state change does not prove the semantic outcome of a command. - Add
set-text(aliassettext): AX-focus within the target app, AXValue write/readback, then AXSelectedText or pid Unicode where supported; backgroundtypeuses the same focus-first routes. Stop on an ambiguous accepted AX write instead of risking duplicate fallback. Pid replacement requires readable text and verified full selection. Explicit paste is globally guarded before touching the clipboard. - Add
frontmostBefore,frontmostAfterandcontentionsnapshots to JSON objects.--assert-no-contention/ MCPassert_no_contentionfails on observed pointer/frontmost changes. Snapshots do not prove continuous isolation or prevent an app from activating itself; async worker completion and later app effects/contending input are outside the parent response's observation interval; list/plain/binary formats keep their existing shape. - Add isolated manual
scripts/bg_selftest.sh:open -ga temporary TextEdit document, strict lock, AX text, pid Unicode, AX range selection/readback, window capture and value/frontmost/pointer assertions with a PASS/FAIL/SKIP table. Disabled inactive-app menus are an expected SKIP. Poll a unique document title, handle a blocking Open panel, and close only the disposable AX window without quitting TextEdit. It never sends global input, does not overwrite an existing lock and retains artifacts. Run only with real GUI/TCC permissions. - Fix pid-only screenshot selector conflicts; rank app owners and windows by usable on-screen layer-0 windows, title and area, excluding transparent/tiny/off-screen helpers. Retain explicit window-ID targeting and report chosen ID/title/frame. Add synthetic ranking and conflict regressions.
- Add
--pidtargeting; deeppress --nth/--list/--async, native popupselect,scroll-to/scroll --ax,wait-textand text-onlyobserve; preserve old command forms and JSON fields where safety permits. - Add click/key holds (60 ms click, 75 ms hover, 30 ms key by default), structured responsible-process TCC diagnostics,
request --open, focused compact AX output, half-scale JPEG MCP screenshots andmax_side. - Add permission-free CLI/C-client/MCP selftests for parsing, targeting and safety policy. GUI behavior remains a separate acceptance gate.
Build and pure-logic tests are separate from real-app acceptance. GUI behavior and timing need verification on a Mac with the appropriate AX/TCC permissions; historical benchmark tables are not v0.7.0 measurements.