noracu 0.1.3 → 0.2.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,488 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.0] — 2026-11-06
4
+
5
+ ### Added
6
+ - The Mac layer reads and acts through a new accessibility engine,
7
+ `src/mac-ax.js`: a static JXA script that calls the macOS Accessibility API
8
+ (`AXUIElement*`) directly instead of going through System Events. Reading a
9
+ Finder window of about 500 elements took about 0.15 s on the test Mac
10
+ (macOS 27.2), so the default depth is now 12 instead of 3. Requests reach it
11
+ as JSON on stdin, never in argv.
12
+ - `mac_ax_state` takes `interactive` (only actionable elements), `compact`
13
+ (default true: skips empty layout wrappers), `skeleton` plus `root` (map a
14
+ dense app shallowly, then drill into one element; the drill extends the same
15
+ snapshot), `surface` (`window`, `menubar`, `menu`, `sheet`, `alert`,
16
+ `dialog`, `popover`, `focused`, `app`), `window` (index or title) and
17
+ `max_nodes`. Each element carries `d` (depth), `states` and `actions`; the
18
+ result carries `snapshot_id` and `complete`. Several windows and none focused
19
+ is `ambiguous_window` with the list, instead of reading an arbitrary one.
20
+ - Electron and Chromium apps get their web accessibility tree switched on
21
+ (`AXManualAccessibility` only — never `AXEnhancedUserInterface`, which alters
22
+ window behaviour) when read unless `web_accessibility: false` or
23
+ `NORACU_READ_ONLY=1`; `mac_ax_state` and `mac_find` take `web_accessibility`
24
+ and report the outcome.
25
+ - New tools: `mac_find` (search by role, title, value, text or AXIdentifier),
26
+ `mac_get` (read one element live: full value, states, actions, settable
27
+ attributes), `mac_status` (Accessibility and Screen Recording permission,
28
+ cliclick, displays), `mac_apps` (running apps) and `mac_windows` (windows
29
+ with CGWindowID and bounds, plus displays). All five are observation tools
30
+ and are allowed under `NORACU_READ_ONLY=1`.
31
+
32
+ - `mac_click` with an `element_index` uses the element's own accessibility
33
+ action when it has one (press, show menu, select): no pointer movement, no
34
+ focus change, and it works on windows in the background. Without one it
35
+ clicks physically, but only after a hit test shows that the point reaches the
36
+ element; otherwise it returns `occluded` with what is on top and sends
37
+ nothing. `mechanism` (`auto`, `semantic`, `physical`) forces one path; a
38
+ semantic attempt that fails is reported, not retried physically.
39
+ - Every Mac action result says whether it was delivered
40
+ (`delivered_verified` when a change was observed, `delivered_unverified`,
41
+ `not_delivered`, `unknown`) and whether a retry is safe, and names sheets,
42
+ dialogs or menus it opened. The engine reads the element and its app again
43
+ after acting, because accessibility return codes alone do not prove an
44
+ effect (Finder reports success for an action that does not exist).
45
+ - `mac_type` inserts text through accessibility (`AXSelectedText` at the
46
+ caret, or the whole value with `replace: true`) into an `element_index` or
47
+ the focused element: IME-safe, the clipboard is untouched, it works in a
48
+ background app, and the value is read back. It falls back to keystrokes only
49
+ when accessibility reports no focused element or the focus is a text view it
50
+ cannot write (such as a terminal); a focused button, list or sheet gets no
51
+ keystrokes.
52
+ - New tool `mac_set_value`: text fields, checkboxes, switches and radio
53
+ buttons (idempotent: nothing is sent when the state already matches),
54
+ disclosure triangles and expandable rows, selectable rows, cells and tabs,
55
+ pop-up and menu buttons and combo boxes (picks exactly one matching option,
56
+ else closes the menu again and lists the options), sliders and steppers.
57
+ - `mac_scroll` takes an `element_index`: a scroll area is scrolled at its own
58
+ center (and the result says when the position did not change); any other
59
+ element is scrolled into view.
60
+ - `mac_key` refuses chords that quit, log out, lock, force-quit, delete
61
+ immediately or empty the Trash (`cmd-q`, `alt-cmd-q`, `cmd-shift-q`,
62
+ `cmd-alt-esc`, `ctrl-cmd-q`, `alt-cmd-delete`, `cmd-shift-delete`, …) unless
63
+ `force: true`.
64
+
65
+ - New tool `mac_wait`: waits for a window, text, an element state, a menu, a
66
+ sheet or dialog, an app starting or ending, or a new notification, polling
67
+ accessibility inside one process instead of sleeping; on timeout it returns
68
+ what it last saw.
69
+ - New tool `mac_app`: launch (attaches to a running instance; starts in the
70
+ background unless `activate`; waits for a window), activate, hide, unhide,
71
+ quit. Quit is verified by the process ending; a save dialog that keeps the app
72
+ running is reported, and `force: true` force-quits. Finder, the Dock,
73
+ loginwindow and other session processes, and the MCP host itself, are never
74
+ quit.
75
+ - `mac_app` launch with `cdp_port` (needs `NORACU_ALLOW_CDP=1`) starts a
76
+ Chromium or Electron app fresh with a DevTools port on 127.0.0.1, and
77
+ `browser_launch` with `cdp_port` attaches Playwright to it, so `browser_*`
78
+ drive its web contents while menus, dialogs and windows stay on `mac_*`.
79
+ `browser_close` then only disconnects. Chrome-family browsers get a profile
80
+ of their own under `~/.noracu/cdp-profiles/` (Chrome refuses remote debugging
81
+ on the default profile); an Electron app keeps its own data. An app that is
82
+ already running is refused rather than quit.
83
+ - New tool `mac_window`: focus, raise, minimize, restore, move, resize,
84
+ maximize (the display's visible area), fullscreen, exit fullscreen — by
85
+ CGWindowID from `mac_windows` or by app + window; verified by reading the
86
+ window again.
87
+ - `mac_screenshot` captures one window (`window_id`, also when covered) or a
88
+ given display (`display`).
89
+ - New tool `mac_clipboard_read`: file paths, an image, or text (capped).
90
+ An item marked concealed by a password manager
91
+ (`org.nspasteboard.ConcealedType`) is never returned.
92
+ - New tool `mac_notifications`: lists banners, alerts and an open Notification
93
+ Center (id, app, title, subtitle, body, actions, plus `center_opened` and
94
+ `center_was_open` when `open_center: true`), and dismisses or acts on one by
95
+ its non-empty id (`notification_not_found` when gone), or by index plus a
96
+ non-empty expected app or title that is re-checked.
97
+ - `mac_ax_state` and `mac_find` take `window_id`.
98
+
99
+ - `mac_menu_command` presses the item through the accessibility engine, by
100
+ title or by a `Menu > Item` path, without the app being frontmost, and
101
+ reports delivery; an unknown item is now an error. `phone_home` and
102
+ `phone_app_switcher` use the same path for the iPhone Mirroring menu.
103
+ - `initialize` returns `instructions`: the observe → act → verify loop and the
104
+ delivery / retry rules, for clients that show them to the model.
105
+ - `NORACU_TRACE=<file>` writes one JSON line per tool call (`{ts, tool, args,
106
+ ms, error, code}`): tool, argument names and sizes (never their text),
107
+ duration, error flag and error code prefix — never result text or error
108
+ messages — opening the file `0600` with `O_NOFOLLOW` so a symlink is refused.
109
+
110
+ ### Changed
111
+ - An element is re-identified only inside the window it was seen in, by that
112
+ window's CGWindowID: an index from a window that has since closed is
113
+ `element_no_longer_valid`, even when another window of the app looks the
114
+ same.
115
+ - `mac_click` / `mac_drag` with an index no longer require the snapshot's app
116
+ to be frontmost; the element is re-identified and, for a physical click,
117
+ hit-tested instead.
118
+ - An `element_index` is backed by identity evidence instead of a stored point:
119
+ process, container (window by CGWindowID, open menu, menu bar or app), child
120
+ path, role, subrole, AXIdentifier, label (never the value), frame relative to
121
+ the container, the labels of its ancestors, the child count along its path,
122
+ and the texts of its item (static text and link labels under it or its
123
+ nearest ancestor below the page, toolbar or pane level; a text field's value
124
+ only when it is table content such as a file name; an item that two
125
+ look-alikes share is not used). An element found at its path must agree on
126
+ all of it (the child counts may differ only when its own item vouches for
127
+ it); a labelled element may be found by search only near where it was and in
128
+ the same item (a re-sorted list resolves to the same item; a look-alike that
129
+ arrived since is not taken for it), an unlabelled one never. Digits in a
130
+ unique element's item are ignored, so a character counter next to Send does
131
+ not invalidate it. A drilled (`root`) snapshot or a filtered `mac_find` cannot know
132
+ whether an element is unique, so its elements are checked as look-alikes. So
133
+ a row inserted above, a closed panel or a closed pop-up menu gives
134
+ `element_no_longer_valid`, never a look-alike (a search no longer enters the
135
+ menu bar, whose closed items can still be pressed).
136
+ - Mac `element_index` values are unique for the life of the server: every
137
+ snapshot continues one counter, so an index from an earlier snapshot keeps
138
+ naming its own element after a later `mac_find` or `mac_ax_state`.
139
+ `snapshot_id` is optional and must match the index. A drill (`root`) numbers
140
+ the children from where the root is now.
141
+ - `mac_ax_state` / `mac_find` with `window_id` alone read that window's app;
142
+ `mac_find` `text` with `exact:true` matches the label or the value as a whole
143
+ string, and `id` is a substring match unless
144
+ `exact:true`, as documented.
145
+ - A window or root that does not answer accessibility is `app_unresponsive`, not
146
+ an empty tree reported as complete.
147
+ - Physical clicks fail closed: when the accessibility hit test is inconclusive (an
148
+ error, nothing there, or only a container of the element), the click is sent
149
+ only if the topmost on-screen window at the point belongs to the element's
150
+ app; otherwise `occluded` / `not_actionable`, nothing sent.
151
+ - `mac_drag` with indexes re-identifies and hit-tests the drop target as well as
152
+ the start point.
153
+ - The focus guard (`app` on `mac_key`, `mac_paste`, `mac_type`) compares
154
+ processes, so a bundle id or `.app` path works; it reads the frontmost app
155
+ through the accessibility engine instead of System Events (no Automation
156
+ prompt, no blocking call). `mac_type` with `mechanism: "physical"` and an
157
+ `element_index` types only if the click left the element's app in front.
158
+ - cliclick runs asynchronously under a timer; a cliclick that fails after it
159
+ started is reported `action_failed` with `delivery=unknown, retry=unsafe`
160
+ (only a cliclick that never started is `not_delivered`).
161
+ - The stale-server note also fires when `src/mac-ax.js` changed on disk.
162
+ - `NORACU_READ_ONLY=1` allows 18 tools (the six new Mac observation tools,
163
+ `mac_wait` included, except `mac_wait` with `condition: "notification"` is
164
+ refused and `mac_ax_state` / `mac_find` do not enable `web_accessibility` on
165
+ apps); `mac_clipboard_read` and `mac_notifications` stay outside it.
166
+ - `tools/list` emits a `required` array derived from non-optional arguments on
167
+ every tool that has any, and every tool checks its arguments (types, ranges,
168
+ allowed values, string lengths) before anything runs.
169
+ - Accessibility failures read `permission_denied: …` instead of the raw
170
+ AppleScript error -1719.
171
+
172
+ ### Fixed
173
+ - The server never blocks on a child process any more: screenshots, scroll
174
+ wheel events, `open`, `ps` and the Chromium download run asynchronously under
175
+ a timer, so `ping`, `tools/list` and other calls keep being answered while
176
+ one runs. Two `browser_launch` calls during a first-run Chromium download
177
+ share one download.
178
+ - Observation tools (`mac_ax_state`, `mac_find`, `mac_get`, `mac_windows`,
179
+ `mac_apps`, `mac_screenshot`, `mac_status`) and `mac_wait` no longer join
180
+ the input queue: they wait only for the inputs queued before them, so they
181
+ see the state after those inputs, and later inputs are not held up behind
182
+ them; if those inputs keep the queue busy past the queue limit they return
183
+ `input_busy` instead of reading too early. `mac_wait`'s timeout starts after
184
+ that wait.
185
+ - The server stops when the client closes its stdin instead of lingering, and
186
+ on SIGTERM / SIGINT / SIGHUP shuts down in order: queued calls are dropped
187
+ without acting, no new child process starts (a fallback step cannot act),
188
+ child processes get SIGTERM then SIGKILL after 1.5 s, browsers — also one
189
+ still starting — are closed, and it exits within 3 s. Two `browser_launch`
190
+ calls at once share one launch.
191
+ - A line that is not JSON gets a JSON-RPC parse error (-32700) and a batch
192
+ gets -32600 ("batch is not supported") instead of no answer.
193
+ - With `NORACU_PHONE_TIMEOUT_MS` above 45 s, a queued call waits as long as
194
+ the longest phone call ahead of it before giving up with `input_busy`.
195
+ - An accessibility call to an app that does not answer gives up after 3 s for
196
+ every element, not only for the app element.
197
+ - Accessibility engine timeouts report `delivery=unknown, retry=unsafe` on
198
+ every mutating operation (`mac_click`, `mac_set_value`, `mac_type`,
199
+ `mac_menu_command`, `mac_window`, `mac_app`, `mac_scroll` into view, and
200
+ mutating `mac_notifications` actions), while observation timeouts omit
201
+ delivery fields because nothing was sent.
202
+ - Outer accessibility engine process timeouts include a 12 s margin above
203
+ `timeout_ms` so the engine is not killed while waiting for an element to
204
+ become actionable and settle.
205
+ - Action verification ignores environment-only shifts (`frontmost`,
206
+ `focusedWindow`, `focus`) unless an element or surface property also changed,
207
+ reporting `delivered_unverified` instead of `delivered_verified`.
208
+ - Post-action observation after a physical click or wheel scroll counts an
209
+ element as `gone` only when the element, window or app is actually absent;
210
+ unresponsive or failed reads report `delivered_unverified` with a note
211
+ instead.
212
+ - Wheel scrolling on an element verifies delivery solely from `vscroll` /
213
+ `hscroll` changes, and notes an unchanged scroll position only when that
214
+ scroll check is unverified.
215
+ - Accessibility writes and steps that already executed never report
216
+ `not_delivered` / `retry=safe`: `mac_type` and `mac_set_value` look for the
217
+ value to change for about 0.4 s before returning `not_confirmed`
218
+ (`delivery=delivered_unverified, retry=unsafe`); a caret that moved while the
219
+ value reads the same is `delivered_unverified`, never verified; partial slider/stepper loops
220
+ report `delivered_unverified` with the step count completed, and `mac_window`
221
+ `maximize` reports `delivered_unverified` if moving succeeded before resizing
222
+ failed.
223
+ - `mac_window` `focus` reports `delivered_verified` only when the app is
224
+ frontmost and the target window itself reads focused or main.
225
+ - `mac_set_value` treats mixed-state checkboxes as neither on nor off, pressing
226
+ up to twice until the requested state is reached instead of answering
227
+ "already off".
228
+ - Pop-up and menu-button option matching in `mac_set_value` drops substring
229
+ matching (so `"One"` never picks `"None"`), matching exact, case-insensitive,
230
+ then normalized titles (collapsed whitespace and trailing ellipsis stripped).
231
+ - `mac_wait` fails immediately with `app_not_found` on `window_gone`,
232
+ `text_gone`, `menu_closed` and `sheet_gone` when the app is not running at the
233
+ first check, keeps polling on `text_gone` when window selection is ambiguous,
234
+ and counts `element` `gone` as met only on absent-target errors rather than a
235
+ hung app.
236
+ - `mac_key` states `delivery=delivered_unverified, retry=unsafe` in its result
237
+ text, and `mac_menu_command` documents that items reading disabled in closed
238
+ menus are still pressed and judged by before/after observation.
239
+ - `phone_home` and `phone_app_switcher` require the iPhone Mirroring menu item
240
+ to be enabled (`require_enabled`), refuse with `mirror_not_live` when the
241
+ mirror is paused or not running, return `menu_unknown`
242
+ (`delivery=unknown, retry=unsafe`) without falling back to a swipe when the
243
+ menu call times out, and fall back to the `imctl` gesture only when the
244
+ English menu item is absent. Success output states only that the command or
245
+ gesture was `sent` (`screen not verified`), never that the phone is on the
246
+ Home Screen.
247
+ - Non-import Python tracebacks from `imctl` are reported as
248
+ `imctl_error: <last line>` instead of `imctl unavailable` (kept for missing
249
+ Python or `pyobjc`), and `phone_longpress` passes `--duration` cleanly while
250
+ `imctl longpress` accepts both optional positional and `--duration` syntax.
251
+ - Every `imctl` press/release pair (`tap`, `long_press`, `swipe`,
252
+ `app_switcher`, `scroll_trackpad` phase end, `press_key`, `clear_text`, and
253
+ Command chords) posts its release event in `finally:` so an exception or
254
+ `SIGTERM` never leaves a mouse button, key, `⌘` or trackpad scroll phase held
255
+ down.
256
+
257
+ - Physical clicks and drags on a display left of or above the main one go to
258
+ the right place: cliclick reads a bare negative coordinate as relative to
259
+ the pointer, so negative coordinates are now written absolute (`=-N`).
260
+ - When the accessibility hit test is inconclusive, a physical click is also
261
+ refused when another window of the same app (a floating panel, another
262
+ document) is on top at the point; the Dock's own platter counts as covering,
263
+ only its full-display overlay lets clicks through.
264
+ - `mac_drag` takes `from_index` / `to_index` only (an undocumented coordinate
265
+ form skipped both hit tests); `mac_type` with `element_index` and `app`
266
+ refuses when the element belongs to another app.
267
+ - Results state delivery where they did not: refusals before anything is sent
268
+ (validation, focus guard, unknown or expired index, read-only mode,
269
+ `input_busy`, stopping) say `delivery=not_delivered, retry=safe`; an engine
270
+ that crashed or answered garbage during an action says `delivery=unknown`;
271
+ a failed scroll wheel says `unknown` unless the script never started;
272
+ `mac_window` is verified only by the state asked for (minimized, position,
273
+ size, full screen…), and a pop-up option only when the control shows it;
274
+ `mac_app` launch of a running app with `activate: true` reports the
275
+ activation; `phone_*` input results state delivery and retry too (a refusal
276
+ such as `mirror_not_live` or `expect_not_found` sent nothing; a timeout,
277
+ `type_not_confirmed`, `open_not_confirmed`, `capture_failed` or `focus_lost`
278
+ may have acted).
279
+ - `phone_home` / `phone_app_switcher` find iPhone Mirroring by bundle id, so a
280
+ non-English macOS (where the app's name is localized) still gets the menu
281
+ command or the gesture fallback instead of `mirror_not_live`.
282
+ - Phone input refuses when the mirror stops being live while it is brought
283
+ forward from another Space, and reports `mirror_state_unknown` instead of a
284
+ Python traceback when bringing it forward times out. A long swipe and the app
285
+ switcher's hold stop (and release the button) when the mirror loses focus;
286
+ an invalid long-press or swipe duration sends nothing.
287
+ - A `phone_open` stopped by SIGTERM no longer runs its own trip to the Home
288
+ Screen (it brought the mirror forward and sent a Cmd chord while the server
289
+ may be stopping); after a timeout the server goes Home through the menu.
290
+ - `phone_launch` results state delivery; a call refused because the server is
291
+ stopping, or `phone_type` refused because the clipboard changed before
292
+ anything was typed, says `delivery=not_delivered`.
293
+ - `browser_click` by `element_index` no longer falls back to a synthetic
294
+ JavaScript `click()` when Playwright's actionability checks fail: a covered,
295
+ disabled or detached element returns `occluded`, `not_actionable` or
296
+ `element_no_longer_valid` (`delivery=not_delivered, retry=safe`).
297
+ - Each browser session keeps the tab it is driving as the active page instead
298
+ of taking the last tab: a tab the page opens itself (`window.open`,
299
+ `target=_blank`) is never switched to (another tab becomes active only after
300
+ the active one closes), and an `element_index` used on a different tab, even
301
+ one at the same URL, returns `element_no_longer_valid`. When attaching over
302
+ CDP the session picks a context with non-`devtools://` pages; a standalone
303
+ `browser_launch` is refused while a CDP session is open instead of reusing
304
+ the attached app; a browser or app that closes or disconnects on its own is
305
+ forgotten.
306
+ - `browser_snapshot` names `<input>`, `<textarea>` and `<select>` fields from
307
+ ARIA labels, `<label>`, `placeholder`, the value of button-type inputs, the
308
+ selected option, `name` and `type` (text a user or agent typed is never part
309
+ of a name), and reports truncation — with how many interactive elements were
310
+ left out — past 100; `browser_scroll` accepts `up|down|left|right`, wheels at
311
+ the viewport center and reports the `scrollX`/`scrollY` change (or
312
+ `"did not move"`); `browser_navigate` includes the HTTP status (or
313
+ `"no response"` for same-document navigations); `browser_screenshot` over CDP
314
+ uses CSS pixels; every browser call runs under a time limit; `browser_type`
315
+ takes at most 2000 characters (use `browser_fill` for longer values), so its
316
+ time limit always covers the typing; every `browser_*` input tool (`click`,
317
+ `fill`, `type`, `press_key`, `scroll`, `navigate`, `evaluate`) states
318
+ `delivery=…, retry=…` in its success and error text.
319
+ - `phone_open` that ends in "app not found" says
320
+ `delivery=delivered_unverified` (it had already gone Home and searched
321
+ Spotlight); a screen capture that fails while checking `expect` says nothing
322
+ was sent; an `expect` value that starts with `-` reaches the iPhone driver as
323
+ one `--expect=…` argument and is never read as an option; an invalid
324
+ long-press or swipe duration is refused before iPhone Mirroring is brought
325
+ forward.
326
+ - `mac_window` `focus` / `raise`: when `AXRaise` fails after the window was
327
+ already unminimized or made main, the result follows the state asked for
328
+ instead of reporting `not_delivered`; a physical Mac click whose element does
329
+ not report its window id is checked against its window's (or the snapshot
330
+ window's) id, so another window of the same app on top is still `occluded`.
331
+ - A physical Mac click on an element that reports no window of its own is
332
+ checked against the window found through its parents, also when it came
333
+ from an app-wide snapshot; `mac_app` launch resolves `~/…` and symlinked
334
+ `.app` paths for every launch, not only with `cdp_port`; `browser_launch`
335
+ refusals before anything starts (profile in use, Chromium missing) say
336
+ `delivery=not_delivered, retry=safe`.
337
+ - `phone_type` no longer reports `typed` when only the picture changed after
338
+ the paste (a selection highlight or a results list redraw) and OCR never
339
+ saw the text: it keeps watching for the text and otherwise reports
340
+ `type_not_confirmed`; a one-character paste that OCR cannot read back says
341
+ `delivery=delivered_unverified` (device run 2026-11-06, macOS 27.2,
342
+ iOS 27).
343
+ - `mac_notifications` with `open_center: true` checks positive evidence that
344
+ Notification Center's panel is already open (the menu-bar clock reads selected
345
+ or a Notification Center panel element is present; desktop widgets do not
346
+ count) before clicking the clock, reporting `center_was_open` when
347
+ already open and `center_opened` when opened by the call; empty `id`,
348
+ `expected_app` or `expected_title` strings fail validation; a notification
349
+ that is no longer there returns `notification_not_found`
350
+ (`delivery=not_delivered, retry=safe`), while other accessibility errors keep
351
+ their delivery state and note when the notification is no longer on screen.
352
+
353
+ ### Security
354
+ - `mac_set_value` on an `AXSecureTextField` never reads back or echoes the
355
+ value (`(secure field — value not shown)`), `imctl type` reports character
356
+ count instead of echoing typed text, and `NORACU_TRACE` omits result previews
357
+ and error messages (recording only `code`) and opens the trace file `0600`
358
+ with `O_NOFOLLOW`.
359
+ - `phone_type`, `phone_find` and `phone_open` pass their text to imctl on
360
+ stdin instead of in the process arguments, where every local user could read
361
+ it while the call ran.
362
+ - `imctl` `_require_live` (now also guarding `imctl home`, `imctl app-switcher`,
363
+ and `imctl verify`) probes the mirror overlay before activating iPhone
364
+ Mirroring so a paused or closed mirror refuses (`mirror_not_live`) without
365
+ stealing focus, retries once after bringing the window forward when the state
366
+ is unknown, and fails closed with `mirror_state_unknown` instead of sending
367
+ blind input; `gestures.app_switcher` also verifies that iPhone Mirroring is
368
+ frontmost before mouse-down.
369
+ - `phone_*` argument validation and `imctl` argv hygiene: `phone_key` validates
370
+ allowed key names, `phone_swipe` validates normalized `[0, 1]` coordinates and
371
+ `ms` (`50–5000`), `phone_longpress` validates `duration`, `phone_find`
372
+ (`≤ 200`) and `phone_type` (`≤ 2000`) enforce per-tool text limits, and
373
+ `phone_find`, `phone_open` and `phone_key` pass `--` before positional values
374
+ so leading `-` strings are never parsed as `imctl` options.
375
+ - `mac_paste` no longer loses non-text clipboard contents or re-publishes a
376
+ password manager's concealed item: the whole paste runs in one engine call
377
+ that copies every clipboard item and type aside, writes the text marked
378
+ transient, sends ⌘V only if the clipboard and the frontmost app (by process)
379
+ are unchanged, and puts the items back once the paste shows in the same
380
+ focused element (held at least 0.3 s; else after a 1 s hold) and only if
381
+ nothing else wrote to the clipboard meanwhile; a concealed item (on any of
382
+ the clipboard's items) is not copied and the clipboard is cleared instead.
383
+ When the ⌘V keystroke may not have completed, the clipboard is not put back
384
+ (a late paste can only repeat the text) and ⌘ is released. Universal Clipboard content or more than 64 MB is refused
385
+ unless `force: true`. The result reports what happened to the clipboard
386
+ (`restored: true`, `cleared (previous_concealed)`, `false (changed_externally)`, …).
387
+ - `mac_clipboard_read` withholds the whole clipboard when any of its items is
388
+ marked concealed (not only the first).
389
+ - `mac_key` treats an uppercase ASCII letter in a chord as adding `shift`
390
+ (matching how `cliclick` types it, so `alt-cmd-Q` is recognized as
391
+ `alt-cmd-shift-q` log-out) and ignores an `fn-` prefix when checking refused
392
+ chords; `alt-cmd-q` (Quit and Close All Windows) and `alt-cmd-delete` (Finder
393
+ Delete Immediately) are now refused unless `force: true`.
394
+ - `mac_menu_command` applies the same refused-chord list to menu shortcuts and
395
+ refuses items under the Apple menu (Sleep, Lock Screen, Log Out, Restart,
396
+ Shut Down, Force Quit) unless `force: true`; quitting the MCP host process or
397
+ a macOS session process (Finder, Dock, loginwindow, …) is always refused.
398
+ - `mac_app` force-quit re-checks the target PID's start time before its
399
+ `SIGKILL` fallback so a reused PID is never signalled, and walks up to 32
400
+ ancestor processes when identifying the MCP host.
401
+ - CDP isolation and directory permissions: `browser_launch` with `cdp_port` is
402
+ refused under `NORACU_READ_ONLY=1` even when `NORACU_ALLOW_CDP=1` is set
403
+ (before any network access); `mac_app` launch with `cdp_port` canonicalizes
404
+ `.app` paths (`realpath`, trailing slash stripped) before checking whether the
405
+ app is running, creates `~/.noracu` and `~/.noracu/cdp-profiles` (plus
406
+ `browser-profile`) with mode `0700`, and records `{ pid, wsUrl }` in memory so
407
+ `browser_launch` with `NORACU_ALLOW_CDP=1` attaches only when the port was
408
+ opened by this `noracu` process, its PID is still alive and `/json/version`'s
409
+ `webSocketDebuggerUrl` matches (attaching to any other loopback port requires
410
+ `NORACU_ALLOW_CDP=any`).
411
+
412
+ ## [0.1.4] — 2026-11-05
413
+
414
+ ### Fixed
415
+ - `phone_open` only taps an exact label inside Spotlight's Top Hit card. A web
416
+ suggestion, website or Settings row with the same name could be tapped
417
+ before: in testing, opening "Pinduoduo" opened a Chrome search and reported
418
+ success. A name the Top Hit card does not show now returns app not found —
419
+ use the label the phone shows under the icon (e.g. `拼多多`). The error says
420
+ whether a Top Hit was seen at all. `phone_open` reads Spotlight's English
421
+ "Top Hit" label; for an iPhone set to another language, set
422
+ `NORACU_TOPHIT_LABELS` to the label it shows. When tapping the label
423
+ does nothing, the icon is tapped only above where the label is now, not where
424
+ it was a moment earlier. `phone_open` also keeps its own time budget and goes
425
+ back to the Home Screen when it runs out, or when it is stopped or hits its
426
+ time limit, instead of leaving Spotlight open, and says so when it could not
427
+ get back.
428
+ - OCR reads Chinese. Vision ran English-first and returned almost no Chinese
429
+ text, so Chinese app names, `phone_find` and `expect` checks failed; Chinese
430
+ and English are now both read. `NORACU_OCR_LANGUAGES` sets other languages
431
+ (unsupported codes are skipped).
432
+ - `phone_launch` never clicks through a setup or welcome screen. After a
433
+ macOS 27 upgrade, iPhone Mirroring's welcome screen was reported as a paused
434
+ session, `phone_launch` said to lock the iPhone, and a lone button there
435
+ would have been clicked as if it were Resume. noracu now reports
436
+ `mirror_setup_required` and leaves the screen to you, and `phone_status` adds
437
+ a `setup` field. A paused mirror is still resumed in portrait or landscape.
438
+ - A stuck iPhone-layer subprocess can no longer freeze the server. iPhone
439
+ commands, including the menu commands behind `phone_home` and
440
+ `phone_app_switcher`, now run asynchronously under a time limit: on expiry
441
+ the command and everything it started are stopped, the call returns
442
+ `imctl_timeout` at once, and other requests — including `ping` — keep being
443
+ answered. `phone_open` and `phone_type` get 45 seconds (was 30);
444
+ `NORACU_PHONE_TIMEOUT_MS` sets another limit. A slow first check for the
445
+ iPhone driver's Python no longer disables the iPhone layer until restart.
446
+ - Phone and Mac actions run one at a time, in the order they arrive, even when
447
+ an MCP client sends tool calls in parallel, so taps, typing and the clipboard
448
+ of two calls never interleave. A queued action the client cancels, or one that
449
+ waited more than 60 seconds (`input_busy`), is dropped without acting, and the
450
+ server stops its iPhone-layer processes when it exits.
451
+ - `phone_type` keeps watching up to 15 more seconds for a paste that lands late
452
+ before reporting `type_not_confirmed`, and then says to read the screen before
453
+ retrying: retrying after a late paste typed the text twice. The text must be
454
+ seen in two consecutive screen reads.
455
+ - `phone_type` no longer reports `typed` while the iPhone is still fetching a
456
+ slow paste: the "Pasting from …" box the phone shows meanwhile was taken for
457
+ the text arriving. While that box shows, the paste does not count; the
458
+ 15-second check above then confirms it from the text itself, or the result is
459
+ `type_not_confirmed`. The box is recognized on an iPhone set to English.
460
+ - A paste can reach the iPhone seconds after it was sent (from 1.5 s to more
461
+ than 10 s on the test device). When `phone_open` does not see the name arrive,
462
+ it keeps reading Spotlight for up to 15 seconds, and if the name never shows up
463
+ it reports `open_not_confirmed` (retry) instead of app not found.
464
+ - `phone_open` right after another successful `phone_open` no longer fails. On
465
+ iOS 27, going Home from an app that was opened from Spotlight lands back in
466
+ Spotlight, and the Spotlight command then closed it, so the name was pasted
467
+ onto the Home Screen.
468
+ - `phone_screenshot` deletes its temporary image on every path, including
469
+ timeouts.
470
+
471
+ ### Security
472
+ - `phone_type` no longer gives your clipboard back just because the typed text
473
+ was already somewhere on the screen (for example a search-history entry with
474
+ the same words). It now counts the text before pasting and restores your
475
+ clipboard only when two screen reads afterwards both show it more often; until
476
+ then the clipboard keeps the typed text. Before, a paste that the phone read
477
+ late could have pasted your original clipboard contents instead.
478
+ - `phone_open` no longer gives your clipboard back after pasting the app name:
479
+ the name can reach the iPhone seconds after it was sent, and a restore before
480
+ then could paste your previous clipboard into Spotlight. The clipboard keeps
481
+ the app name.
482
+ - `phone_type` never gives your clipboard back while the iPhone still shows its
483
+ "Pasting from …" box: a paste is still on its way then and could fetch your
484
+ restored clipboard. The words in that box never count as the typed text.
485
+
3
486
  ## [0.1.3] — 2026-11-04
4
487
 
5
488
  ### Fixed