noracu 0.2.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,494 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.0] — 2026-11-15
4
+
5
+ Background input, a stop switch and per-app input rules, and clicks by
6
+ screenshot pixels.
7
+
8
+ ### Added
9
+ - **Background input (bgpost).** Under `mechanism: "auto"`, a physical click
10
+ on a native app, and a named key for a native frontmost app, are posted
11
+ straight to the app's process (`CGEventPostToPid`): the pointer does not
12
+ move and the app need not be in front. Web-engine apps (Chromium/Electron,
13
+ whose event loops drop such events) and `mechanism: "physical"` use the
14
+ real pointer; every result's `route` says which path delivered. A posted
15
+ click is never re-sent another way: no visible change is reported as
16
+ `delivered_unverified` with a note, a timeout as `delivery=unknown`. Double
17
+ and triple clicks carry their click count. `NORACU_NO_BGPOST=1` turns the
18
+ layer off.
19
+ - **Your own Chrome (opt-in).** `browser_launch` with `chrome: true` works
20
+ in the Chrome you use, with its sign-ins, through Chrome's own
21
+ remote-debugging switch (`chrome://inspect/#remote-debugging`, Chrome
22
+ 144+); Chrome asks you to allow each connection. It needs
23
+ `NORACU_ALLOW_CHROME=1`. noracu opens a window of its own there, in the
24
+ background, and lists, reads and acts only on the tabs it opened (and
25
+ tabs those open); `browser_tabs` `new` opens a tab in that window. Your
26
+ other tabs are never touched unless `NORACU_CHROME_TABS=all` is also
27
+ set: then your tabs on http(s) pages are listed and can be selected, read
28
+ and acted on (never `file://`, whatever `NORACU_ALLOW_FILE_URL` says; never
29
+ closed or sent to another kind of address; one becomes the active page only
30
+ when selected and stops being it when it leaves http(s)). `browser_evaluate` never runs there. `browser_close` closes
31
+ noracu's tabs and disconnects. `NORACU_CHROME_DIR` points at another
32
+ profile folder (Chrome Beta, Canary, another Chromium-based browser). `mac_status`
33
+ reports whether it is allowed.
34
+ - **Stop switch.** While the file named by `NORACU_STOP_FILE` exists, every
35
+ input tool — Mac and iPhone (semantic actions included) and the browser's
36
+ input tools (navigate, click, type, fill, press_key, scroll, evaluate,
37
+ `browser_tabs` new/close) — returns `user_stopped` and sends nothing. It is
38
+ checked when a call leaves the input queue and again right before events go
39
+ out. A set but blank `NORACU_STOP_FILE` refuses all input, and a set but blank
40
+ `NORACU_APPROVAL_FILE` all Mac and iPhone input, until it is removed or given a path.
41
+ - **Per-app input rules.** `NORACU_DENY_APPS` names apps that never get
42
+ input; by default the common terminal apps (Terminal, iTerm2, WezTerm,
43
+ Ghostty, Warp, Alacritty, kitty, Hyper) and the IDEs with a built-in
44
+ terminal (VS Code, Cursor, Windsurf, Zed, JetBrains IDEs, Android Studio,
45
+ with their preview and nightly editions), by bundle id and by name, so an
46
+ agent cannot type into those shells. A list of your own adds to it; a list
47
+ that starts with `none` drops it (`none` alone: no deny list). Warp Preview,
48
+ Tabby, Rio and Wave are on it too. The name `Code`
49
+ and `com.jetbrains.*` are broad on purpose: they also deny any app named
50
+ exactly Code, and JetBrains Toolbox. `NORACU_APPROVAL_FILE` (opt-in) names a `0600`
51
+ JSON file `{allow, ask, deny}` of bundle-id or app-name patterns: an app
52
+ under `ask`, or not listed, gets `approval_required` and nothing is sent;
53
+ noracu never writes the file; once the variable is set, a missing,
54
+ malformed, symlinked, group-readable or foreign-owned file, an unknown key
55
+ or an empty pattern refuses all input. An app whose bundle id cannot be
56
+ read gets nothing while either rule is in force. Both are judged
57
+ on the app that receives the input — the element's app, both ends of a
58
+ drag, the named app, or the app on top at an x,y point — and an app that
59
+ cannot be identified gets nothing.
60
+ - **Clicks by screenshot pixels.** A `mac_screenshot` of one window returns a
61
+ `screenshot_id` (valid 30 s); `mac_click` takes `screenshot_id` + `x,y` in
62
+ that image's pixels for targets accessibility cannot name (canvas, custom
63
+ drawing). The point is the window's origin plus the pixels at the scale of
64
+ the window's own display; the window's position and size are re-checked
65
+ first, and a window that moved, resized or was rebuilt is refused as
66
+ `stale`; pixels outside the image are refused.
67
+ - **iPhone: an XCUITest backend (experimental, opt-in).** With
68
+ `NORACU_PHONE_BACKEND=xcuitest` the `phone_*` tools are replaced by nine
69
+ `ios_*` tools that drive the phone itself instead of the iPhone Mirroring
70
+ window: a small UI-test bundle (the "runner", source in `ios-runner/`,
71
+ protocol in `docs/ios-runner-protocol.md`) runs on the iPhone and executes
72
+ one command at a time. `ios_snapshot` returns an app's accessibility
73
+ elements with an `element_index` (unique across snapshots, valid 30 s);
74
+ `ios_tap` and `ios_type` read the app again before acting and return
75
+ `element_no_longer_valid` when the element moved, changed, or its app left
76
+ the front; `ios_home` and `ios_launch` end earlier indexes. `ios_type`
77
+ types as keyboard input — no clipboard — and is `delivered_verified` only
78
+ when the field that took the text (the one tapped, or the only one of its
79
+ kind whose value changed) afterwards holds its old value with the text put
80
+ in at one place, for text of four characters or more (`type_not_confirmed`
81
+ when the fields were read and do not show that; `delivered_unverified`
82
+ when the two reads cannot settle it: the fields could not be read, are not
83
+ the same ones in both reads, several changed at once and one of those
84
+ gained the text, or no field changed and an empty one has the text as
85
+ its placeholder); `ios_launch` opens an app by bundle id through
86
+ `devicectl`.
87
+ Coordinates are screen points. Every input first passes the stop file, the
88
+ per-app rules (matched on the iOS bundle id) and a lock check: a locked
89
+ iPhone, or one whose lock state cannot be read, gets nothing — and is not
90
+ read either (no snapshot, no screenshot); the lock is read again before
91
+ any command sent to the runner more than a second after the last
92
+ unlocked answer. While an approval file or a `NORACU_DENY_APPS` of your
93
+ own is set, no input that names `com.apple.springboard` is sent — not
94
+ even one tap on a button of a system prompt; it is `input_denied`: sent
95
+ by screen coordinates it would land on whichever app is in front, a tap
96
+ on a Home Screen icon would open an app the rules were not asked about
97
+ (apps are opened with `ios_launch`; `ios_home` still goes out), and text
98
+ goes wherever the keyboard focus is. The refusal comes before a runner is
99
+ started, so it changes nothing on the phone. An input the
100
+ runner does not answer in time ends the runner, so the gesture cannot go
101
+ out later; a failure XCTest records during a gesture is reported as
102
+ `xctest_issue`, never as sent, and ends the runner too. The runner
103
+ listens only on the device's own CoreDevice tunnel address (`127.0.0.1` on
104
+ a simulator), accepts only its peer on that tunnel, and requires a token
105
+ made new at every start. Needs Xcode, a developer team, a paired iPhone
106
+ with Developer Mode (cable or local network) or a booted simulator, and one
107
+ build per device: `npx noracu ios-setup --team <TeamID>` — an explicit
108
+ command, never run on install. The iPhone must stay unlocked. The Mirroring
109
+ backend remains the default and is unchanged. Under `NORACU_READ_ONLY=1` the
110
+ backend answers `ios_status` only and never starts the runner: `ios_snapshot`
111
+ and `ios_screenshot` return `runner_not_started`. `noracu ios-setup` stops a
112
+ build that has not finished in 15 minutes and says so. A runner that was
113
+ stopped is given up to 4 seconds to exit before the next one starts —
114
+ while it is still there, every call says so instead of starting a second
115
+ one — and `devicectl` calls still running end with the server. The runner
116
+ names the sources it was built from when it starts, and one built from
117
+ other sources than the installed noracu's — an older build left on the
118
+ phone — is not used: `runner_version_mismatch`, run `ios-setup` again
119
+ (the start is tried once more first: the first start after a rebuild was
120
+ seen running the previous build).
121
+ - **`mac_drag` timing:** `hold_ms` (0–2000) holds after mouse-down before the
122
+ move; `step_ms` (1–500) moves in steps of about 20 points. A drag whose
123
+ waits add up to more than 10 s is refused, and a drag that fails midway
124
+ sends a mouse-up so the button is not left held.
125
+ - **`permission_pending`:** when the Accessibility grant is missing,
126
+ `mac_status` returns a structured object to poll, naming the settings pane.
127
+ - **`NORACU_LAYERS`:** a comma-separated list of `mac`, `browser`, `iphone`
128
+ narrows what a server offers: a tool of a layer that is left out is
129
+ neither listed nor callable, and the `initialize` instructions name only
130
+ the listed tools — for instance `NORACU_LAYERS=iphone` for a client entry
131
+ that carries the iPhone tools only. Unset or blank lists the Mac and
132
+ browser layers (see Changed). A name that is not one of the three stops
133
+ the server at start (exit code 2) instead of falling back. A call to a
134
+ tool of a layer that is off says which layer and how to turn it on.
135
+ - **iPhone Mirroring: reading confidence.** `phone_open`'s result line names
136
+ the confidence (0–1) the recognizer gave the label it tapped; `phone_ocr`
137
+ and `phone_find` end each line with it, as before, and now say so.
138
+ Opt-in, off by default: with `NORACU_OCR_MIN_CONFIDENCE` set to a number
139
+ above 0 and at most 1, `phone_open` does not tap a label read below it and
140
+ answers `open_not_confirmed` with nothing tapped; a value that is set and
141
+ is not such a number makes `phone_open` refuse (`invalid_args`) rather
142
+ than run without the check. While it is unset, what
143
+ is tapped does not change.
144
+ - **`browser_tabs`.** One tool for the tabs of the browser session: `list`
145
+ (the default), `new` (optionally with a url), `select` and `close`, by a
146
+ `tab_id` that stays the same while the tab lives. The active page changes
147
+ only when asked: a tab the page itself opens is listed and not followed.
148
+ `select` takes only a tab on an http(s) page, or one still on the blank
149
+ page that `browser_launch` or `browser_tabs` opened it on (`file://` with
150
+ `NORACU_ALLOW_FILE_URL=1`; `tab_not_selectable` otherwise): a tab someone
151
+ opened on a local file or a browser page, a blank tab that a page opened
152
+ (it can read that page), and a tab that shows a blank page after it has
153
+ loaded something, are listed (url and title), not read.
154
+ `close` only closes a tab `browser_tabs` opened (`tab_not_owned`
155
+ otherwise) and never the last open tab. A tab whose page does not answer
156
+ is listed with `title: null`. Not available under `NORACU_READ_ONLY=1`.
157
+
158
+ ### Changed
159
+ - **Breaking:** the experimental iPhone layer is off by default. With
160
+ `NORACU_LAYERS` unset the server lists the Mac and browser tools only;
161
+ `NORACU_LAYERS=mac,browser,iphone` gives the 0.2.7 set (and is needed for
162
+ the `ios_*` tools of `NORACU_PHONE_BACKEND=xcuitest`). A server started
163
+ with `NORACU_PHONE_BACKEND` but without the iPhone layer says so on
164
+ stderr.
165
+ - **Breaking:** `browser_evaluate` is off by default. It runs any script in
166
+ the page, so it returns `eval_disabled` and runs nothing unless the server
167
+ was started with `NORACU_ENABLE_EVAL=1`. `NORACU_DISABLE_EVAL=1` still
168
+ turns it off and wins over `NORACU_ENABLE_EVAL`. The tool stays listed;
169
+ `mac_status` reports whether it is on.
170
+ - Terminal apps and IDEs with a built-in terminal get no input by default
171
+ (see `NORACU_DENY_APPS` above); set `NORACU_DENY_APPS=none` for the 0.2.7
172
+ behaviour.
173
+ - `mechanism: "physical"` on `mac_click` always uses the real pointer.
174
+ - `mac_status` reports `bgpost`, `stop_file`, `approval_file` and
175
+ `deny_apps`.
176
+ - `phone_tap` and `phone_longpress` refuse a point on the iPhone Mirroring
177
+ window's transparent margin — the strip above the phone screen, which
178
+ holds the window's own controls, and the thin edge around it — with
179
+ `out_of_screen`; nothing is sent. While the screen's edges are not known
180
+ (see Fixed), a point where the margin may be — near the top of the window
181
+ or along its other sides — is refused as well, and a tap that goes out
182
+ says the edges were not known. When nothing is remembered and the window's
183
+ image cannot be read, or the window is gone by the time its edges are
184
+ looked up, a tap or long press is refused with `capture_failed`, as a
185
+ swipe is.
186
+ - The note that a server process is older than the files on disk now looks
187
+ at every source file in `src/` — it used to look at `server.mjs` and
188
+ `mac-ax.js` only — and names the files that changed. A file put back to
189
+ its earlier content does not count.
190
+
191
+ ### Fixed
192
+
193
+ - **Deep code audit (S5A), 2026-11-14.**
194
+ - The stop file, a cancelled request and a server shutdown are checked
195
+ again right before an input runs: after the read of the time since the
196
+ last keyboard or mouse event, and after waiting for an earlier phone
197
+ command to end. A stop file made, or a cancel sent, during those seconds
198
+ now stops the input; before, it went out.
199
+ - `mac_click` with `count` 2 or 3 through cliclick sends one double or
200
+ triple click (cliclick `dc:` / `tc:`); before, it sent separate single
201
+ clicks, which apps do not take for a double click.
202
+ - `mac_screenshot` with `display` uses that display's own scale for
203
+ `scale` and `logical_size`; before, it used the main display's, which
204
+ is wrong next to a screen of another scale.
205
+ - `mac_app` launch with `cdp_port` asks the app rules first: an app the
206
+ deny list or the approval file rules out (Cursor is on the default list)
207
+ is not launched with a DevTools port, because the browser tools that
208
+ would drive it are not judged by app rules. An app that is not running is
209
+ named by its bundle on disk.
210
+ - Semantic actions: an element that cannot be read after the action (the
211
+ app did not answer in time) no longer counts as gone, so it is not
212
+ reported `delivered_verified`; only an element that is really gone
213
+ is evidence.
214
+ - `mac_set_value` on a checkbox, radio button or switch waits up to 1 s for
215
+ the control to show a new state before deciding on a second press (and
216
+ again after a second press, for a mixed checkbox); a
217
+ control that showed its new state late was pressed twice, which undid
218
+ the first press. One that never changes is reported `NOT_CONFIRMED` and
219
+ not pressed again.
220
+ - Typing into a secure (password) field that takes text only by rewriting
221
+ its whole value is refused unless the field is known to be empty;
222
+ before, what was already typed there was replaced by the new text.
223
+ - App rules match the bundle id and app name without surrounding spaces,
224
+ as the check before them reads them; a FIFO named by
225
+ `NORACU_APPROVAL_FILE` is refused at once (not a regular file) instead
226
+ of blocking the server until something writes to it.
227
+ - Browser: when a persistent profile opens but no page can be made in it,
228
+ noracu closes it again, so the profile lock does not stay held.
229
+ - `phone_open` after a timeout: the Home Screen tidy-up is skipped while
230
+ the stop file exists, and the result says the Home Screen command was
231
+ sent; it no longer says the phone was returned to the Home Screen, which
232
+ was not checked.
233
+ - When a result's first text block is JSON (a screenshot's metadata,
234
+ `mac_status`), the note that the server is older than its files on disk
235
+ now comes in a text block of its own after it; before, it was put in
236
+ front of the JSON, which then no longer parsed.
237
+ - **Formal pre-release review (S4A), 2026-11-13.**
238
+ - iPhone, XCUITest backend: no input goes to an app while a system alert (a
239
+ permission prompt) is up, or while SpringBoard cannot be read
240
+ (`system_alert`, nothing sent); the runner listens only on loopback or the
241
+ CoreDevice tunnel's unique-local address; `ios_home` says the app left the
242
+ front only when it was read in front before the press and in the background
243
+ after it; input never starts a runner, and a runner that had to start
244
+ during a call refuses that call's input (`runner_restarted`); an app's state
245
+ on a locked phone is not taken as an answer; secure text fields are
246
+ reported as `secureTextField`.
247
+ - The person at the Mac goes first: only keyboard and mouse events noracu
248
+ posts through the HID system count as its own, so an AXPress, a set_value
249
+ or a background post no longer hides a key the person pressed meanwhile.
250
+ - App rules: a pid that was not read is refused instead of judging the
251
+ frontmost app; an app with no name, or with no bundle id while a rule is in
252
+ force, gets nothing; `mac_click` with `screenshot_id` and `app` needs the
253
+ screenshot's window to be that app's, and the window is read again right
254
+ before the click (`stale` if it moved).
255
+ - Background posting refuses a missing, fractional or out-of-range pid, key
256
+ or point instead of turning it into 0; a posted click carries no modifier
257
+ someone holds; Safari, Firefox and Arc take the real pointer.
258
+ - Browser: `browser_tabs` new reports the tab's real address, and says
259
+ `delivered_unverified` (a blank tab may be left) or `active_page_not_allowed`
260
+ instead of verified when it did not see it; closing in your Chrome waits for
261
+ the disconnect and counts only tabs noracu's close reached; a session with
262
+ no tab left answers `no_active_page` with what to do.
263
+ - **Second review (S4B) and the device run of 2026-11-14** (iPhone 16 Pro, iOS 27.2.1).
264
+ - iPhone, XCUITest backend: taps, long presses and drags go out without
265
+ XCTest's wait for the app to go idle — with a context menu up (a
266
+ long-pressed note in Notes), a tap went out in about a second instead of
267
+ timing out unsent after 20 s; a runner that ends while the iPhone turns on
268
+ UI automation (seen right after an iOS update) says to unlock the iPhone and
269
+ check Settings › Developer › Enable UI Automation; an input whose runner
270
+ went away after the element was read answers `runner_unreachable`.
271
+ - `noracu ios-setup` removes a build made for another `--bundle-prefix`
272
+ before building, and fails instead of reporting "Built" when the build
273
+ still names a runner under another prefix; when no runner bundle id can
274
+ be read back from the build, "Built" comes with a line saying the prefix
275
+ was not checked.
276
+ - `system_alert` says a system prompt is up on the iPhone only when the
277
+ runner saw one; when SpringBoard could not be read, the answer says
278
+ noracu could not tell, and still sends nothing.
279
+ - iPhone Mirroring: a swipe whose end was moved off the mirror window's
280
+ margin and that is left shorter than about 10 pt is refused
281
+ (`out_of_screen`) instead of landing as a tap; a phone input that imctl
282
+ refused before sending anything no longer counts as noracu's own keyboard
283
+ or mouse event, so the person's input of that moment is not taken for it.
284
+ - `mac_screenshot` with `display` and `region`: `region` is in the screen
285
+ points `mac_windows` reports (not relative to the display), and a region
286
+ outside the display named is refused instead of returning another
287
+ display's pixels.
288
+ - Playwright is held at 1.65.x (`~1.65.1`; it was `^1.58.0`), the version this
289
+ release was tested with, so a fresh install gets the Playwright the tests
290
+ ran on rather than any later 1.x. With 1.65.1, `browser_launch` with
291
+ `cdp_port` was tried against Chrome for Testing 156 and 159, and with
292
+ `chrome: true` against 159 (2026-11-14).
293
+ - Browser: when the active tab closes, the tab that takes over is the first
294
+ open one that shows an http(s) page — or is still on the blank page
295
+ that `browser_launch` or `browser_tabs` opened it on (`file://` with
296
+ `NORACU_ALLOW_FILE_URL=1`). Before, it was the first open tab whatever it
297
+ showed: in a headed session that could be a tab someone had opened on a
298
+ local file, and `browser_read` then returned the file. When no such tab
299
+ is open the page tools return `no_active_page`; `browser_tabs` still
300
+ works and can open or select one. The tab that already is the active
301
+ page is held to the same rule on every call: once it shows something
302
+ else — a blob the page made, Chromium's page for a load that failed, a
303
+ blank page after another page, a local file opened in it by hand — the
304
+ page tools return
305
+ `active_page_not_allowed` and the tab stays the active page;
306
+ `browser_navigate` takes it to an http(s) page again, and `browser_tabs`
307
+ can open or select another. (After a load that failed, `browser_read`
308
+ used to return the empty text of Chromium's error page and
309
+ `browser_screenshot` a picture of it.) What `browser_read`,
310
+ `browser_snapshot`, `browser_screenshot` or `browser_evaluate` got back —
311
+ a result or an error — is dropped as well when the page stopped passing,
312
+ or went through a page that does not pass, while they worked; and
313
+ `browser_snapshot`, whose tree, element list and address are read one
314
+ after the other, returns `page_changed` when the page navigated in
315
+ between — to another address, by a fragment, a reload or
316
+ `history.pushState`. `browser_read` does the same without a selector;
317
+ with one it hands its text over under a first line that says the page
318
+ navigated and gives both addresses; a script's result and a screenshot
319
+ are handed over with a note that says so. An `element_index` is not used
320
+ after the page navigated, a reload of the same address included. The
321
+ session's first tab is Chromium's own: noracu sends it to `about:blank`
322
+ itself at launch and empties `window.name` before it counts as that
323
+ blank page, and any navigation it reports afterwards ends that; when
324
+ the tab does not count, `browser_launch` says so in its result.
325
+ A session attached to an app with `cdp_port` keeps that app's own
326
+ pages, whatever they show.
327
+ - Before a physical click or drag the person-goes-first check is made a
328
+ second time, right before the pointer is taken: someone who started using
329
+ the keyboard or mouse after the call left the queue keeps the pointer —
330
+ `user_active`, nothing is sent. The check used to be made once, when the
331
+ call left the queue.
332
+ - A Mac or iPhone input call that sent nothing — refused with
333
+ `delivery=not_delivered` — no longer counts as noracu's own last input.
334
+ Before, the person's keyboard or mouse event of that moment could be taken
335
+ for noracu's own, and the next call went ahead instead of returning
336
+ `user_active`.
337
+ - `phone_swipe` keeps both points inside the phone screen. The iPhone
338
+ Mirroring window has a transparent margin around the screen (a strip
339
+ above it and a thin edge on the other sides: x 0.029–0.971, y 0.061–0.987
340
+ of a 280×620 pt window in a device run on macOS 27.2), and iOS cancels a
341
+ drag that starts or ends there. An App Switcher card swiped up to y 0.03
342
+ stayed put (no pixel changed) while the same swipe ending at y 0.12 closed
343
+ it, and a share sheet dragged down to y 0.995 stayed open; `phone_swipe`
344
+ reported `swiped` each time. The screen's edges are now read from the
345
+ window's own pixels (from their transparency, so a black app edge still
346
+ counts as screen); a point on the margin is moved 0.01 inside the edge and
347
+ the result names it. The edges are measured once per window size and
348
+ macOS version and remembered in
349
+ `~/Library/Caches/noracu/phone-screen-rect.json`, because phone apps treat
350
+ every capture of the mirror window as a screenshot (see Known issues). A
351
+ measurement that shows no strip above the screen — what the capture gives
352
+ while the pointer rests on that strip — is neither used nor remembered:
353
+ both points are then kept clear of where the margin may be, and the
354
+ result says so. A swipe whose two points would become one point once
355
+ moved inside — a press, not a swipe — is refused with `out_of_screen`.
356
+ When nothing is
357
+ remembered and the window's image cannot be read, or the window is gone
358
+ by the time its edges are looked up, the swipe is refused with
359
+ `capture_failed` and nothing is sent.
360
+
361
+ ### Known issues
362
+ - XCUITest backend: what was run, and what was not. Run: iPhone 16 Pro on
363
+ iOS 27.2 (paired; over the local network through the CoreDevice tunnel,
364
+ and with the cable connected, which `devicectl` reports as a wired
365
+ transport) and an iPhone 17 Pro simulator on iOS 26.5, Xcode 27.2, in the
366
+ Settings app and on the Home Screen — every `ios_*` tool through the MCP
367
+ server. Measured on the
368
+ iPhone: the first call that needs the phone takes about 9 s (the runner
369
+ starts); each input then takes about 0.8 s more than on the simulator,
370
+ because the lock check asks `devicectl` every time; a list dragged 150 pt
371
+ moved 136–140 pt. A locked iPhone was run twice: `ios_status` reports it,
372
+ `ios_home`, `ios_launch`, `ios_snapshot` and `ios_screenshot` return
373
+ `device_locked`, and the runner is not started. Not run: a phone that
374
+ locks while the runner is up, a tap into a system prompt on a real
375
+ iPhone (on the simulator only), apps that ask for a login, a phone with
376
+ Wi-Fi off, and iPhone models or iOS versions other than the two above. An
377
+ app that has just come to the front keeps filling in its rows for a
378
+ second or two, so an index from a
379
+ snapshot taken in that moment can come back as `element_no_longer_valid`.
380
+ - iPhone Mirroring margin. While the phone screen's edges are not known
381
+ (the pointer resting on the strip above the screen when the window is
382
+ measured), a point is sent only when it is clear of a band along the
383
+ window's edges: the top 8 % of its height or 48 pt, whichever is more;
384
+ 4 % of its width or 12 pt at each side; 2 % or 12 pt at the bottom. The
385
+ bands were sized from one window: 280×620 pt on macOS 27.2, where the
386
+ strip is 38 pt and the side margins 8 pt. A window whose strip is taller
387
+ than its band would let a tap near the top reach the window's own
388
+ controls while the edges are not known. Not run: other window sizes, and
389
+ this path on a real mirror window (unit tests only).
390
+ - Phone apps see a capture of the iPhone Mirroring window as a screenshot.
391
+ In a device run (iPhone 17 Pro Max on iOS 27, Mac on macOS 27.2) LinkedIn
392
+ and rednote each showed their after-screenshot share sheet 1–4 s after
393
+ every capture, one more sheet per capture. Every tool that reads the
394
+ screen captures it: `phone_screenshot`, `phone_ocr`, `phone_find`, any
395
+ `expect` check, the checks inside `phone_type`, `phone_open` and
396
+ `phone_scroll`, and a phone input that first has to bring iPhone Mirroring
397
+ to the front. Ruled out: a stray tap (the sheets appeared in a run that
398
+ sent no input) and the capture method (`CGWindowListCreateImage` and
399
+ `screencapture -l` both raised them). X and the Home Screen showed no
400
+ reaction. Not tested: other apps, and whether an app that reports
401
+ screenshots to someone else does so here. See SECURITY.md, threat 21.
402
+
403
+ ## [0.2.7] — 2026-11-08
404
+
405
+ ### Changed
406
+ - The person at the Mac goes first. Before a Mac or iPhone input tool acts,
407
+ noracu reads how long ago the Mac's keyboard or mouse was last used; when
408
+ that was less than 2 s ago and not noracu's own input, the call returns
409
+ `user_active` and sends nothing (`delivery=not_delivered, retry=safe`) —
410
+ retry after a pause. Read-only tools (screenshots, accessibility reads,
411
+ `phone_status`, OCR) and the browser layer are not held up. After a
412
+ physical Mac click, drag or scroll, and after a phone gesture, the pointer
413
+ goes back where it was — moved back without an event, and only while it
414
+ is still where noracu left it, so a pointer someone moved meanwhile stays
415
+ where they put it. `NORACU_USER_IDLE_S` sets the wait (default 2, 0 to
416
+ 60); `0` turns both off, for a Mac dedicated to the agent. `mac_status`
417
+ reports the value as `user_idle_s`. macOS keeps one idle time, and
418
+ noracu's own events reset it too (measured on macOS 27.2), so an event
419
+ counts as the person's only when it came after noracu's previous input
420
+ had ended: a key pressed or mouse moved while that input was running is
421
+ not seen, and the check runs once, before the call acts.
422
+
423
+ ### Fixed
424
+ - `phone_type` (and the name `phone_open` types into Spotlight) waits at
425
+ least 1.5 s between writing the Mac clipboard and sending ⌘V. iPhone
426
+ Mirroring pastes through Universal Clipboard, which tells the phone
427
+ about new clipboard content with a delay. In a device run (macOS 27.2),
428
+ once in about 30 pastes, a ⌘V sent about 0.5 s after the write pasted
429
+ the text the Mac clipboard held before the write instead of the new
430
+ text. The 1.5 s is a judgement, not a measured delay: it is meant to let
431
+ the new text reach the phone first and does not rule the race out, and
432
+ it does not help when the phone shows "Pasting from …" and then pastes
433
+ nothing, which was also seen. `type_not_confirmed` now says the field
434
+ may hold the phone's older clipboard, so read it before typing again,
435
+ and `phone_open`'s `open_not_confirmed` no longer says the name was
436
+ pasted. A clipboard change during the wait still stops the paste before
437
+ ⌘V. The screen count that decides whether the paste showed up (and
438
+ whether your clipboard is put back) is now read after the wait, right
439
+ before ⌘V, so text that appears during the wait cannot pass for the
440
+ paste. Each `phone_type` and `phone_open` call takes about 1.5 s longer.
441
+ - If another app (or another Space) comes to the front during that wait,
442
+ ⌘V is called off — checked right after the wait, before any screen read,
443
+ and again right before ⌘V — instead of bringing iPhone Mirroring back to
444
+ the front, and your clipboard is put back unless something else copied
445
+ meanwhile: `phone_type` returns `focus_lost` saying nothing was sent
446
+ (or, with `replace`, that only the select-all went out), and
447
+ `phone_open` returns `focus_lost` without going back to the Home Screen,
448
+ which would also bring iPhone Mirroring forward (Spotlight may stay
449
+ open). When another app or device writes the clipboard before ⌘V,
450
+ `phone_open` now goes back to the Home Screen and says the name was not
451
+ pasted, instead of ending with an input error. `phone_type` results that
452
+ OCR cannot confirm (a text of one to three characters, or one seen only
453
+ in the top strip) now say the field may hold the phone's older
454
+ clipboard, and the phone's "Pasting from …" box also counts when OCR
455
+ splits it over two lines.
456
+ - `phone_open` opens apps again on iPhones whose Spotlight puts the search
457
+ field at the top and shows no "Top Hit" card (iOS 27's "Search or Ask").
458
+ There every `phone_open` failed with `open_not_confirmed: … never showed
459
+ up on the phone` although the name had been pasted (0.2.6 too). It now
460
+ reads the field, which shows the query completed as "<name> — Open", and
461
+ taps the exact label just under the field (above the first section
462
+ header) only when that completion names exactly this app; any other
463
+ completion, or none, is `app not found` with nothing tapped. In a device
464
+ run (iOS 27, macOS 27.2): Calculator 2/2 and Clock 2/2 back to back
465
+ opened, an unknown name returned `app not found`. The "Open" completion
466
+ is read in English only; `NORACU_TOPHIT_LABELS` covers the Top Hit
467
+ label, not this word.
468
+ - The iPhone layer no longer loses the mirror window while the phone's
469
+ keyboard is composing (for example a Pinyin letter that is still
470
+ underlined). iPhone Mirroring then shows a small candidate-bar window
471
+ (397×28 in a device run on macOS 27.2), and the window lookup took that
472
+ one: `phone_status` reported its size with `live: null`, and `phone_key`,
473
+ `phone_tap` and the other inputs returned `mirror_state_unknown` and sent
474
+ nothing — so even the `delete` that ends the composition could not go
475
+ out. The bounds, overlay and Resume lookups now use the iPhone Mirroring
476
+ window itself (the first standard window, found by its position in the
477
+ window list on every call) and fall back to the old lookup only when
478
+ there is none. A failed bounds read is retried once after 0.3 s (a read
479
+ sends nothing to the phone): during a connection blip System Events
480
+ briefly could not find the window.
481
+
482
+ ### Docs
483
+ - SECURITY.md threat 18 (clipboard on the phone path) now describes the
484
+ wait before ⌘V and the `focus_lost` call-off, and lists what remains: an
485
+ early ⌘V can still paste the phone's own older clipboard, an older
486
+ clipboard that contains the typed text can pass for the paste, and the
487
+ "Pasting from" box is recognized only in English.
488
+ - README (both languages): `open_not_confirmed: … never showed up` no
489
+ longer reads as "the name did not arrive" only, and the known limits
490
+ describe the top-field Spotlight.
491
+
3
492
  ## [0.2.6] — 2026-11-07
4
493
 
5
494
  ### Changed