Repository navigation
noracu 0.2.2
noracu 0.2.2
A patch release that closes the gap between a physical click's hit test and the click itself, and stops an element_index from outliving its window. Prompted by a review comment on the r/mcp launch post.
Fixed
- A physical click is not reported
delivered_verifiedwhen the target changed in between. Formac_clickon an element without a semantic action, or withmechanism: "physical", the window on top at the point is checked again right before the click is sent; anything that came on top since makes the call returnoccluded, and nothing is sent. After the click,delivered_verifiedneeds the element to still be there, to have changed, and its own window to still be on top at the click point; a vanished element or another window there givesdelivered_unverifiedwith a note.mac_dragre-checks both ends the same way.
On a device run that covered, moved or closed the target in that gap, 0.2.1 reported all three asdelivered_verified; 0.2.2 reports them asdelivered_unverified, and an undisturbed click is stilldelivered_verified.
Security
element_indexis bound to its window. An index read withsurface: "app"(or found bymac_findwithsurface: "app") records the CGWindowID of its window. A window that is closed and reopened with the same name, text and position now giveselement_no_longer_valid.- Windows without a CGWindowID are refused. An element in such a window returns
policy_deniedinstead of being matched by title and frame, because a closed and reopened window could not be told apart. Finder's desktop, the only such window seen on the test Mac, is exempt.mac_ax_stateandmac_findmark such a window withwindow_identity: "unverifiable"and a hint. A physical click whose hit test is inconclusive and whose window has no CGWindowID is refused withoccluded.
Tests
NORACU_TEST_PHYSICAL_GAP_MSis a test hook, never set in normal use. It waits between the last check and the click and reports the wait on stderr. The local test suite uses it to cover, move and close the target in that gap, and to close and reopen a window under an app-level index.
Tested
- macOS 27.2, cliclick 5.1, Node 26.10.0: the full test suite including hardware cases passed 147/147 in the repository and again from the packed tarball installed in an empty directory; engine unit tests 129/129; imctl smoke tests 47/47.
Known limits
- A short gap remains between the last check and the click.
- A click that opens another window of the same app at the click point is reported
delivered_unverified. mac_scrollwithout anelement_indexscrolls the frontmost window's centre without the topmost-window check.