Skip to content

noracu 0.2.2

Choose a tag to compare

@sgInnora sgInnora released this 06 Nov 12:56
· 9 commits to main since this release

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_verified when the target changed in between. For mac_click on an element without a semantic action, or with mechanism: "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 return occluded, and nothing is sent. After the click, delivered_verified needs 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 gives delivered_unverified with a note. mac_drag re-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 as delivered_verified; 0.2.2 reports them as delivered_unverified, and an undisturbed click is still delivered_verified.

Security

  • element_index is bound to its window. An index read with surface: "app" (or found by mac_find with surface: "app") records the CGWindowID of its window. A window that is closed and reopened with the same name, text and position now gives element_no_longer_valid.
  • Windows without a CGWindowID are refused. An element in such a window returns policy_denied instead 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_state and mac_find mark such a window with window_identity: "unverifiable" and a hint. A physical click whose hit test is inconclusive and whose window has no CGWindowID is refused with occluded.

Tests

  • NORACU_TEST_PHYSICAL_GAP_MS is 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_scroll without an element_index scrolls the frontmost window's centre without the topmost-window check.