noracu 0.3.1 → 0.3.3

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/docs/tools.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Tool reference
2
2
 
3
3
  > Auto-generated from the running server (`node scripts/gen-tools.mjs`) — always in sync with the implementation. Hints are the four MCP tool annotations each tool reports — R read-only, D destructive, I idempotent, O open-world, – false — hints for the client, not permissions.
4
- > noracu v0.3.1 · 33 tools listed by default (the Mac and browser layers; NORACU_LAYERS unset), 47 with NORACU_LAYERS=mac,browser,iphone (iPhone Mirroring backend), 42 with NORACU_PHONE_BACKEND=xcuitest as well (the ios_* group replaces phone_*)
4
+ > noracu v0.3.3 · 33 tools listed by default (the Mac and browser layers; NORACU_LAYERS unset), 47 with NORACU_LAYERS=mac,browser,iphone (the iPhone layer, experimental and off by default, on its iPhone Mirroring backend), 42 with NORACU_PHONE_BACKEND=xcuitest as well (the ios_* group replaces phone_*)
5
5
 
6
6
  ## Mac layer (computer-use)
7
7
 
@@ -9,26 +9,26 @@
9
9
 
10
10
  | Tool | Arguments | Hints | Description |
11
11
  |---|---|---|---|
12
- | `mac_screenshot` | region:object?, window_id:integer?, display:integer? | R – I O | Capture the Mac screen as PNG base64: the main display, display (index from mac_windows), or one window by window_id (CGWindowID from mac_windows; works when covered). A display capture can be cropped to region {x,y,w,h} in screen points as mac_windows reports them (the main display's top-left is 0,0; a display to its left has negative x), not relative to the display; with display given, a region not inside that display is refused. Returns {scale, logical_size, screen, screenshot_id}; click coordinates are in points (pixels / scale). screenshot_id (valid 30 s) lets mac_click take x,y in screenshot pixels: the window's geometry is re-checked first and a window that moved, resized or was rebuilt since the capture is refused as stale. |
13
- | `mac_ax_state` | app:string?, interactive:boolean?, compact:boolean?, skeleton:boolean?, root:integer?, snapshot_id:string?, surface:string?, window:string?, window_id:integer?, depth:integer?, max_nodes:integer?, web_accessibility:boolean? | R – I O | Read an app's accessibility tree (default: the frontmost app's focused window). app: a name, a bundle id, a .app path or pid:<n> — ambiguous_app when several running apps match; pick one by pid:<n> from its list. Returns {app, snapshot_id, window, complete, elements:[{i, d, role, title, value, states, actions, frame}]}; i is the element_index for mac_click, mac_get, mac_set_value, mac_type, mac_scroll and mac_drag — unique across snapshots, valid 30 s; an action re-identifies the element first (element_no_longer_valid if gone, moved or replaced). Options: interactive (actionable elements only), compact (default true: skip empty layout wrappers), skeleton (a shallow map with children_count), then root (an element_index to drill into, given alone: not with app, window, window_id or surface; adds indexes to the same snapshot), surface (window\|menubar\|menu\|sheet\|alert\|dialog\|popover\|focused\|app), window (index or title) or window_id (from mac_windows), depth (default 12, 1-40), max_nodes (default 400), web_accessibility (default true; false under NORACU_READ_ONLY=1): sets AXManualAccessibility on Electron/Chromium apps, never AXEnhancedUserInterface; the result says enabled, already_on, exposed (refused, but the pages are in the tree) or unsupported with a web_accessibility_hint (Google Chrome refuses it) — unknown, with the hint, when the window was too large to look through. window_identity unverifiable marks a window without a window ID: element_index actions in it are refused. ax_empty when the app has no readable window. |
14
- | `mac_click` | element_index:integer?, snapshot_id:string?, x:number?, y:number?, screenshot_id:string?, app:string?, force:boolean?, button:string?, count:number?, mechanism:string?, timeout_ms:integer? | – – – O | Click a UI element by element_index (from mac_ax_state / mac_find; valid 30 s; snapshot_id only with it: the snapshot the index came from) or at raw {x,y}. The element is re-identified first (element_no_longer_valid if gone or changed). mechanism auto (default): the element's own accessibility action (press / show menu / select — no pointer, works in background windows) when it has one, else a physical click, sent only if a hit test shows the point reaches the element (occluded otherwise); semantic / physical force one path. count 2-3 and button middle are physical. Under auto a physical click on a native app is posted to its pid (route bgpost: no pointer move; never re-sent another way — no visible change is delivered_unverified with a note, a timeout delivery=unknown); web-engine apps (Chromium/Electron) and mechanism physical use the real pointer (route cliclick), re-checked right before it is sent. A physical click is delivered_verified only if the element is still there, changed, and its window is still on top at the point. A raw {x,y} click is sent only when the window on top at that point belongs to app (default: the frontmost app; the menu bar counts as its) — otherwise occluded names what covers it; force:true skips that check. screenshot_id + x,y: pixels of a mac_screenshot window capture, relative to its top-left corner; a window that moved, resized or was rebuilt since is refused as stale. Results state delivery (delivered_verified / delivered_unverified / not_delivered / unknown) and whether a retry is safe, plus newly opened sheets, dialogs or menus. |
15
- | `mac_drag` | **from_index**:integer, **to_index**:integer, snapshot_id:string?, hold_ms:integer?, step_ms:integer? | – – – O | Drag from one UI element to another (sliders, selections, list items) with the physical pointer; from_index/to_index come from mac_ax_state or mac_find (valid 30 s). Both ends are re-identified and hit-tested first (either one gone or covered: nothing sent). hold_ms (0-2000) presses and holds after mouse-down before the move starts (timeline editors use it to tell clip-move from marquee selection); step_ms (1-500) moves in steps of about 20 points with that many ms between them. A drag whose holds and steps add up to more than 10 s is refused; a drag that fails midway gets a mouse-up so the button is not left held. Check the drop target afterwards. |
16
- | `mac_scroll` | direction:string?, pages:number?, element_index:integer?, snapshot_id:string? | – – – O | Scroll up/down/left/right by a number of pages (default 1). Without element_index: the center of the frontmost app's front window (the pointer moves there), only when that app's window is on top at that point (else occluded, nothing scrolled). With element_index: a scroll area is scrolled at its own center (hit-tested; reports when the position did not change), any other element is scrolled into view (AXScrollToVisible). |
17
- | `mac_key` | **key**:string, app:string?, force:boolean? | – D – O | Press a key or modifier chord, e.g. 'return', 'esc', 'cmd-c', 'cmd-shift-v', 'arrow-up'. Named keys (return, esc, tab, space, delete, arrows, home/end, page keys, F1-F16), with or without modifiers, go out as HID key events with each modifier pressed and released around the key; a chord with cmd or ctrl on a character key (cmd-c, cmd-shift-v) goes out the same way on the key that types that character in the current keyboard layout (no such key: not_delivered, keyboard_layout); a plain character or a shift/alt-only chord is typed through cliclick. Pass app to refuse input unless that app is frontmost (focus guard). A named key for a native frontmost app is posted straight to its pid (route: bgpost — no focus theft); web-engine apps and layout-dependent chords use the engine HID path. Chords that quit, log out, lock, force-quit, delete immediately or empty the Trash (cmd-q, alt-cmd-q, cmd-shift-q, cmd-alt-esc, ctrl-cmd-q, cmd-alt-delete, cmd-shift-delete…) are refused unless force:true. |
18
- | `mac_type` | **text**:string, element_index:integer?, snapshot_id:string?, app:string?, replace:boolean?, mechanism:string?, timeout_ms:integer? | – – – O | Type text into element_index, or into the focused element (of app, if given). mechanism auto (default): inserted through accessibility at the caret (AXSelectedText) — IME-safe, clipboard untouched, works in a background app; delivered_verified only when the value reads back as exactly the old value with the text over the selection that was there (unreadable caret: delivered_unverified). replace:true sets the whole value instead (already that text: nothing sent). If the focused element is a text view that takes no text through accessibility (a terminal), auto falls back to physical keystrokes (not IME-safe; app is then a focus guard: refused unless that app is frontmost); a focused button, list or sheet gets none. When the app reports no focused element, auto sends keystrokes only if app names that app (else no_focus, nothing sent). The result names the app it typed into. mechanism physical forces keystrokes (clicking element_index first). |
19
- | `mac_paste` | **text**:string, app:string?, force:boolean? | – – – O | Paste text with Cmd+V through the clipboard (⌘V goes out on the key that types V in the current keyboard layout; no such key: not_delivered, keyboard_layout), then put the user's clipboard back: every item and type is copied aside and restored within one call, only after the paste shows in the focused element (else after a 1 s hold) and only if nothing else wrote to the clipboard meanwhile — not while the app does not answer, so a late paste cannot insert the user's own clipboard; delivered_verified only when the focused field's value becomes exactly the text pasted over its selection; a password manager's concealed item is never copied — the clipboard is cleared after the paste instead. The pasted text is marked transient for clipboard managers. Pass app to refuse input unless that app is frontmost (focus guard). Refused when the clipboard holds Universal Clipboard content or more than 64 MB (force:true pastes anyway and leaves the pasted text on the clipboard). mac_type does not touch the clipboard. |
20
- | `mac_menu_command` | **app**:string, **command**:string, force:boolean? | – D – O | Run an app's menu bar command through accessibility (AXPress on the item: no pointer, the app need not be frontmost). command is the item title as the app shows it (unique in the menu bar) or a path such as "File > Export > PDF…"; an item that reads disabled is still pressed (closed menus report stale state) and the result says whether anything changed; reports delivery and any sheet or dialog it opened. Menu items under the Apple menu and items whose keyboard shortcut is one of the refused chords need force:true; Quit of the MCP host or of a macOS session process is always refused. |
21
- | `mac_wait` | **condition**:string, app:string?, title:string?, text:string?, exact:boolean?, window:string?, element_index:integer?, snapshot_id:string?, predicate:string?, value:string?, timeout_ms:integer? | R – I O | Wait (instead of sleeping) until a condition holds, polling accessibility: window / window_gone (title substring, app), text / text_gone (in app's window), element (element_index + predicate exists\|gone\|enabled\|focused\|value_equals\|value_contains, value), menu / menu_closed, sheet / sheet_gone (sheet, alert or dialog), app_running / app_gone, notification (a new one, optional app / text; refused under NORACU_READ_ONLY=1). For window_gone, text_gone, menu_closed and sheet_gone the app must be running when the wait starts (a misspelled or non-running app fails immediately with app_not_found). timeout_ms default 10000, max 30000; on timeout returns what it last saw. |
22
- | `mac_app` | **action**:string, **app**:string, activate:boolean?, wait_window:boolean?, force:boolean?, cdp_port:integer?, timeout_ms:integer? | – D – O | Launch, activate, hide, unhide or quit an app (display name, bundle id, or .app path). launch: attaches to a running instance (activate:true brings it forward), else starts it in the background unless activate:true and waits for a window (wait_window, default true). quit: graceful, verified by the process ending (a save dialog keeps it running — reported); force:true force-quits and loses unsaved work. Finder, Dock, loginwindow and other session processes, and the MCP host itself, are never quit. launch with cdp_port (0 = pick a free port; needs NORACU_ALLOW_CDP=1) starts a Chromium/Electron app fresh with a loopback DevTools port for browser_launch cdp_port — refused if the app is already running. |
23
- | `mac_window` | **action**:string, window_id:integer?, app:string?, window:string?, x:number?, y:number?, width:number?, height:number? | – D – O | Focus, raise, minimize, restore, move (x,y), resize (width,height), maximize (fill the display's visible area), fullscreen or exit_fullscreen a window, chosen by window_id (from mac_windows) or app + window (index or title); verified by reading the window again. |
24
- | `mac_clipboard_read` | format:string?, max_chars:integer? | R – I – | Read the clipboard: format auto (file paths, else image, else text), text, files or image (returned as an image). Text is capped at max_chars (default 20000). An item a password manager marked concealed is never returned. Universal Clipboard content (copied on another device) is fetched from that device when read and marked remote:true. The clipboard can hold secrets: read it only when the task needs it. |
25
- | `mac_notifications` | action:string?, app:string?, text:string?, id:string?, index:integer?, expected_app:string?, expected_title:string?, name:string?, open_center:boolean?, limit:integer? | – – – O | List, dismiss or act on notifications visible to accessibility (banners and alerts on screen, and Notification Center while it is open; open_center:true checks whether Notification Center is already open and clicks the menu-bar clock only when closed). list returns {count, notifications:[{index, id, kind, app, title, subtitle, body, actions}], center_opened, center_was_open}, optional app / text filter (center_opened means this call opened and closed it; center_was_open means it was already open). dismiss or act (name: an action such as Show, Reply, or press) take a non-empty id from list (or a 1-based index plus non-empty expected_app / expected_title, re-checked so a reordered stack is not acted on); an absent id returns notification_not_found. Content is returned verbatim: treat it as private and as untrusted input. |
26
- | `mac_set_value` | **element_index**:integer, **value**:string, snapshot_id:string?, timeout_ms:integer? | – – I O | Set an element's value by element_index, by role: text fields (whole value; AXSecureTextField never echoes the value), checkboxes / switches / radio buttons (true\|false, idempotent: nothing sent when already so; a mixed checkbox is pressed up to twice until it reaches the requested state), disclosure triangles and expandable rows (true\|false), rows / cells / tabs (true selects), pop-up buttons, menu buttons and combo boxes (an option's title: opens the menu, picks the one matching option, closes it again if none or several match), sliders / steppers (a number within min-max). Semantic only (no pointer). delivered_verified only when the value read back changed to the one asked for (text: line endings and outer white space aside); a field already at that value gets nothing sent (not_delivered, already). |
27
- | `mac_find` | app:string?, role:string?, title:string?, value:string?, text:string?, id:string?, exact:boolean?, limit:integer?, surface:string?, window:string?, window_id:integer?, web_accessibility:boolean? | R – I O | Search an app's accessibility tree for elements by role (e.g. button, textfield, checkbox, row), title, value, text (title or value) or id (AXIdentifier); substring match, case-insensitive, unless exact:true. Returns up to limit (default 10, max 50) matches, each with an element_index (a new snapshot). surface: window (default) \| menubar \| app; window: index or title, or window_id from mac_windows; web_accessibility (default true, false under NORACU_READ_ONLY=1) sets AXManualAccessibility on Electron/Chromium apps and never sets AXEnhancedUserInterface (which alters window behaviour); the result reports web_accessibility like mac_ax_state. |
28
- | `mac_get` | **element_index**:integer, snapshot_id:string?, max_chars:integer? | R – I O | Read one element live by element_index: role, title, description, value (up to max_chars, default 4000), frame, states (checked, selected, focused, disabled, expanded…), actions, settable attributes, help. Use it to read long text or to check a state before or after acting. |
29
- | `mac_status` | — | R – I – | Report what the Mac layer can do here: Accessibility and Screen Recording permission for the MCP host app, cliclick, the frontmost app, macOS version, displays (frame, scale), read-only mode. Run it first when mac_* tools fail. |
30
- | `mac_apps` | filter:string?, all:boolean? | R – I – | List running apps: name, pid, bundle_id, presentation (foreground = Dock app, background = menu-bar or agent app), frontmost, hidden. filter matches the name or bundle id; all:true adds helper processes. |
31
- | `mac_windows` | app:string?, include_offscreen:boolean? | R – I O | List on-screen windows (include_offscreen:true adds hidden and minimized ones): id (CGWindowID), app, pid, title, bounds [x,y,w,h], plus displays. Titles come from accessibility when Screen Recording is not granted. app filters by app name. |
12
+ | `mac_screenshot` | region:object?, window_id:integer?, display:integer? | R – I O | Capture the Mac screen as PNG: the main display (default), display (index from mac_windows), or one window by window_id (from mac_windows; works when covered); prefer mac_ax_state to read and act on controls. region {x,y,w,h} crops a display capture, in global screen points as mac_windows reports them (main display top-left 0,0; inside display, if given). Returns {scale, logical_size, screen, screenshot_id}; raw mac_click takes points (pixels / scale), while screenshot_id (valid 30 s, window captures) lets mac_click take {x,y} in that window's pixels. |
13
+ | `mac_ax_state` | app:string?, interactive:boolean?, compact:boolean?, skeleton:boolean?, root:integer?, snapshot_id:string?, surface:string?, window:string?, window_id:integer?, depth:integer?, max_nodes:integer?, web_accessibility:boolean? | R – I O | Read an app's accessibility tree (default: the frontmost app's focused window); use mac_find to search for elements, mac_get to read one live. app: a name, a bundle id, a .app path or pid:<n>. Target window (index or title), window_id (from mac_windows) or surface (window\|menubar\|menu\|sheet\|alert\|dialog\|popover\|focused\|app). Options: interactive (actionable elements only), compact (default true: skip layout wrappers), skeleton (a shallow map with children_count), root (an element_index to drill into, given without app, window, window_id or surface; extends that snapshot), depth (default 12, 1-40), max_nodes (default 400), web_accessibility (default true, false under NORACU_READ_ONLY=1: exposes Electron/Chromium web content; Google Chrome refuses; the result says which). Returns {app, snapshot_id, window, complete, elements:[{i, d, role, title, value, states, actions, frame}]}; i is the element_index (unique across snapshots, valid 30 s). A window marked window_identity unverifiable takes no indexed actions. |
14
+ | `mac_click` | element_index:integer?, snapshot_id:string?, x:number?, y:number?, screenshot_id:string?, app:string?, force:boolean?, button:string?, count:number?, mechanism:string?, timeout_ms:integer? | – – – O | Click an element by element_index (from mac_ax_state or mac_find; valid 30 s; snapshot_id only with it) or at {x,y}. mechanism auto (default) uses the element's accessibility action when it has one (no pointer, works in background windows), otherwise a hit-tested click (no pointer move on native apps, the real pointer on Chromium/Electron); semantic forces the accessibility action, physical the real pointer (count 2-3 and button middle are physical). Raw {x,y} is in screen points, and the window on top there must belong to app (default: the frontmost app, its menu bar included; force:true skips this check); with screenshot_id (from a mac_screenshot window capture), {x,y} is in pixels from that window's top-left. Reports delivery (delivered_verified, delivered_unverified, not_delivered or unknown) and retry, plus any sheet, dialog or menu that opened. |
15
+ | `mac_drag` | **from_index**:integer, **to_index**:integer, snapshot_id:string?, hold_ms:integer?, step_ms:integer? | – – – O | Drag with the physical pointer from from_index to to_index (from mac_ax_state or mac_find, valid 30 s; prefer mac_set_value for sliders). Both ends must be uncovered. hold_ms (0-2000) pauses after mouse-down; step_ms (1-500) sets ms per ~20-point step (over 10 s in total: refused). Reports delivery and retry; check the drop target afterwards. |
16
+ | `mac_scroll` | direction:string?, pages:number?, element_index:integer?, snapshot_id:string? | – – – O | Scroll a Mac app up, down, left or right by pages (default 1); use browser_scroll for web pages in the Playwright browser. With element_index: a scroll area is scrolled at its hit-tested center (reports when nothing moved), any other element is scrolled into view. Without element_index: the pointer moves to the center of the frontmost app's front window, which must be on top there. Reports delivery and retry. |
17
+ | `mac_key` | **key**:string, app:string?, force:boolean? | – D – O | Press a key or hyphenated chord in the frontmost app: named keys ('return', 'esc', 'tab', 'space', 'delete', 'arrow-up', 'home', 'end', page keys, F1-F16) or plain characters, with or without modifiers ('cmd-c', 'cmd-shift-v'); cmd/ctrl character chords use the current keyboard layout. Use mac_type for text. Pass app as a focus guard (refused unless that app is frontmost). Chords that quit, force-quit, lock, log out, delete immediately or empty the Trash (e.g. cmd-q, cmd-shift-delete) require force:true. Reports delivery and retry. |
18
+ | `mac_type` | **text**:string, element_index:integer?, snapshot_id:string?, app:string?, replace:boolean?, mechanism:string?, timeout_ms:integer? | – – – O | Type text into element_index, or into the focused element (of app, if given). Prefer mac_set_value for whole values and controls, mac_key for keys, mac_paste for a clipboard paste. mechanism auto (default) inserts at the caret through accessibility: IME-safe, clipboard untouched, works in a background app; replace:true replaces the whole value (nothing sent if already equal). A text view that refuses accessibility text, such as a terminal, falls back to keystrokes (not IME-safe; app then has to be frontmost). If the app reports no focused element, keystrokes go out only when app names that app. mechanism physical forces keystrokes, clicking element_index first. Reports delivery and retry, and the app typed into. |
19
+ | `mac_paste` | **text**:string, app:string?, force:boolean? | – – – O | Paste text into the frontmost app with Cmd+V, saving the clipboard first and restoring it after (a password manager's concealed item is not copied: the clipboard is cleared instead); prefer mac_type, which leaves the clipboard untouched. Pass app as a focus guard (refused unless that app is frontmost). Refused when the clipboard holds Universal Clipboard data or more than 64 MB, unless force:true (which leaves the pasted text on the clipboard). Reports delivery and retry. |
20
+ | `mac_menu_command` | **app**:string, **command**:string, force:boolean? | – D – O | Run an app's menu bar item semantically (no pointer, need not be frontmost; prefer it over mac_key shortcuts). command is a unique item title or a path like "File > Export > PDF…". Apple-menu items and items with guarded shortcuts (see mac_key) need force:true; host or session-process Quit is always refused. Reports delivery and retry and any opened sheet or dialog. |
21
+ | `mac_wait` | **condition**:string, app:string?, title:string?, text:string?, exact:boolean?, window:string?, element_index:integer?, snapshot_id:string?, predicate:string?, value:string?, timeout_ms:integer? | R – I O | Wait for a Mac state instead of sleeping: window\|window_gone (title, app), text\|text_gone (text, app), element (element_index + predicate exists\|gone\|enabled\|focused\|value_equals\|value_contains, value), menu\|menu_closed (app), sheet\|sheet_gone (sheet/alert/dialog, app), app_running\|app_gone (app), notification (new; refused under NORACU_READ_ONLY=1). *_gone (except app_gone) and menu_closed need the app running at start. timeout_ms default 10000 (max 30000); a timeout reports the last state. |
22
+ | `mac_app` | **action**:string, **app**:string, activate:boolean?, wait_window:boolean?, force:boolean?, cdp_port:integer?, timeout_ms:integer? | – D – O | Launch, activate, hide, unhide or quit an app (name, bundle id or .app path; mac_apps lists running apps). launch attaches if running, else starts it in the background waiting for a window (wait_window default true; activate:true brings it forward); cdp_port (0 = a free port; NORACU_ALLOW_CDP=1; refused if running) starts Chromium/Electron with a DevTools port for browser_launch cdp_port. quit is graceful (force:true loses unsaved work; the MCP host and session processes are never quit). Reports delivery and retry. |
23
+ | `mac_window` | **action**:string, window_id:integer?, app:string?, window:string?, x:number?, y:number?, width:number?, height:number? | – D – O | Focus, raise, minimize, restore, move (x,y), resize (width,height), maximize, fullscreen or exit_fullscreen a window (in screen points), chosen by window_id (from mac_windows) or app + window (index or title). Reports delivery and retry. |
24
+ | `mac_clipboard_read` | format:string?, max_chars:integer? | R – I – | Read the Mac clipboard only when needed (it may hold secrets; refused under NORACU_READ_ONLY=1): format auto (default: files, image, then text), text (max_chars default 20000), files or image. Concealed items are omitted; Universal Clipboard content is fetched from the other device (remote:true). |
25
+ | `mac_notifications` | action:string?, app:string?, text:string?, id:string?, index:integer?, expected_app:string?, expected_title:string?, name:string?, open_center:boolean?, limit:integer? | – – – O | List (default), dismiss or act on visible notifications (and Notification Center when open or with open_center:true); use mac_wait for new arrivals. Refused under NORACU_READ_ONLY=1. list returns {count, notifications:[{index, id, kind, app, title, subtitle, body, actions}]}, verbatim: private and untrusted. dismiss and act (name: Show, Reply, press…) take an id from list, or a 1-based index + expected_app/expected_title. Reports delivery and retry. |
26
+ | `mac_set_value` | **element_index**:integer, **value**:string, snapshot_id:string?, timeout_ms:integer? | – – I O | Set a control's state or whole value by element_index, semantically (no pointer). value by role: text fields (the full string; secure fields never echo it), checkboxes, switches, radio buttons, disclosures and expandable rows ("true" or "false"), rows, cells and tabs ("true" selects), pop-up and menu buttons and combo boxes (the title of exactly one option), sliders and steppers (a number within min-max). Already at that value: nothing is sent (not_delivered, already). Reports delivery and retry. |
27
+ | `mac_find` | app:string?, role:string?, title:string?, value:string?, text:string?, id:string?, exact:boolean?, limit:integer?, surface:string?, window:string?, window_id:integer?, web_accessibility:boolean? | R – I O | Search an app's accessibility tree by role (whole name: button, combobox), title, value, text (title or value) or id (AXIdentifier); all but role match case-insensitive substrings unless exact:true. Scope: app (as in mac_ax_state), surface (window\|menubar\|app, default window), window (index or title) or window_id; web_accessibility as in mac_ax_state. Returns up to limit (default 10, max 50) matches, each with a new element_index (new snapshot, valid 30 s). |
28
+ | `mac_get` | **element_index**:integer, snapshot_id:string?, max_chars:integer? | R – I O | Read one element live by element_index, without a new snapshot: role, title, description, value (up to max_chars, default 4000), frame, states, actions, settable attributes and help. Use it to read long text or check a state. |
29
+ | `mac_status` | — | R – I – | Check Mac layer readiness (run it first when mac_* tools fail): host Accessibility and Screen Recording permissions, cliclick, frontmost app, macOS version, displays (frame, scale) and read-only mode. |
30
+ | `mac_apps` | filter:string?, all:boolean? | R – I – | List running apps ({name, pid, bundle_id, presentation, frontmost, hidden}; use mac_app to launch or quit). filter matches name or bundle_id; all:true includes helper processes. |
31
+ | `mac_windows` | app:string?, include_offscreen:boolean? | R – I O | List on-screen windows and displays ({id, app, pid, title, bounds:[x,y,w,h]} in screen points; use mac_window to move, resize or focus). app filters by app name; include_offscreen:true adds hidden and minimized windows. |
32
32
 
33
33
  ## Browser layer (browser-use)
34
34
 
@@ -36,54 +36,54 @@
36
36
 
37
37
  | Tool | Arguments | Hints | Description |
38
38
  |---|---|---|---|
39
- | `browser_launch` | headless:boolean?, cdp_port:integer?, chrome:boolean? | – – – O | Launch the browser with a persistent profile (headed by default; pass headless:true for headless). With cdp_port: attach to a Chromium/Electron app started by this server's mac_app launch cdp_port (needs NORACU_ALLOW_CDP=1; attaching to any other loopback port needs NORACU_ALLOW_CDP=any; refused under NORACU_READ_ONLY=1 and while another session is open; standalone browser_launch is also refused while a CDP session is open). browser_close then only disconnects. With chrome:true: work in your own Chrome, with its sign-ins (needs NORACU_ALLOW_CHROME=1 and Chrome's remote debugging switched on at chrome://inspect/#remote-debugging; Chrome asks you to allow the connection). noracu opens a window of its own there and lists, reads and acts only on the tabs it opened (and tabs those open) — with NORACU_CHROME_TABS=all on the server, on your other tabs too (http(s) pages); browser_close closes only noracu's tabs and disconnects, and Chrome keeps running. |
40
- | `browser_navigate` | **url**:string | – – – O | Navigate the active page to an http(s) URL (file:// is disabled unless NORACU_ALLOW_FILE_URL=1). Reports the final URL, HTTP status (or "no response" for same-document navigations), title, and delivery/retry. |
41
- | `browser_snapshot` | browser_id:string? | R – I O | Return the active page's ARIA accessibility snapshot (about 14000 characters with the list; a longer snapshot is cut and marked) plus up to 100 indexed interactive elements (reporting truncation and omitted count beyond 100, or that the list could not be read); indexes feed browser_click. When the page navigates while the snapshot is being taken it returns page_changed and nothing else (ask again); an element_index is not used after the page navigated. The active page stays the tab noracu is driving: a tab the page opens itself (window.open, target=_blank) is never switched to; another tab becomes active only after the active one closes. |
42
- | `browser_screenshot` | fullPage:boolean?, format:string?, quality:number?, clip:object? | R – I O | Screenshot the active page with optional fullPage, format png\|jpeg, quality (1-100, jpeg) and clip {x,y,width,height} (uses scale:"css" when attached over CDP); returns the image plus DPR/viewport metadata (with a navigated note when the page navigated while the picture was taken). |
43
- | `browser_click` | element_index:integer?, selector:string?, xy:array?, button:string? | – – – O | Click an element on the active page. Give exactly one of element_index (from the latest browser_snapshot of that page; valid 30 s; page, URL, tag, name, href and position are re-checked, element_no_longer_valid when stale), selector (a fallback) or xy (pixel coordinates; not recommended). Real Playwright pointer input with actionability checks: occluded or not_actionable when covered or disabled — never a synthetic JS .click(). Reports delivery and retry. |
44
- | `browser_fill` | **selector**:string, **value**:string | – – – O | Fill an input field matched by selector with value; fill replaces the whole value — pass "" to clear the field (browser_type appends keystrokes). Reports delivery and retry. |
45
- | `browser_press_key` | **key**:string | – – – O | Press a key or chord, e.g. 'Enter' or 'Control+A'. Reports delivery and retry. |
46
- | `browser_type` | **text**:string | – – – O | Type up to 2000 characters via the keyboard into the focused element; type appends keystrokes (browser_fill replaces the whole value and suits longer text). Reports delivery and retry. |
47
- | `browser_scroll` | direction:string?, pages:number? | – – – O | Scroll the active page up, down, left, or right by a number of pages (default: down, 1 page) via mouse wheel at the viewport center; reports the scrollX/scrollY change (or "did not move") plus delivery and retry. |
48
- | `browser_read` | selector:string? | R – I O | Read the active page's visible text (up to 12000 characters; 8000 with a selector; longer text is cut and marked), optionally scoped to a selector. When the page navigated while it was read: without a selector it returns page_changed (ask again); with one — a read that waits for a selector goes on across the page's own move to the next page — the first line of the result says so and gives both addresses. |
49
- | `browser_evaluate` | **js**:string | – D – O | Evaluate JavaScript in the active page and return the result plus delivery and retry. Off by default: runs only when the server was started with NORACU_ENABLE_EVAL=1 (eval_disabled otherwise), and never when NORACU_DISABLE_EVAL=1 or in your own Chrome (browser_launch chrome:true). When the page navigated while the script ran, a line after the result says so. |
50
- | `browser_tabs` | action:string?, tab_id:string?, url:string?, browser_id:string? | – D – O | List, open, select or close the tabs of the browser session. list (the default): each tab's tab_id, url, title (null when the page did not answer in 3 s; a tab on a page the tools do not read has not_read:true, no title and the start of its address), whether it is the active page and whether browser_tabs opened it. new: opens a tab (url: http(s); file:// needs NORACU_ALLOW_FILE_URL=1) and makes it the active page. select: makes tab_id the active page — only a tab on an http(s) page (or file:// with NORACU_ALLOW_FILE_URL=1), or one still on the blank page it was opened on (tab_not_selectable otherwise). The other browser_* tools act on the active page only; a tab the page opens itself is listed, never followed. close: only a tab browser_tabs opened (tab_not_owned otherwise), never the last one. After new, select or closing the active tab, earlier element_index values no longer apply; when the active tab goes, the first tab select would take becomes the active page (none: no_active_page). An active tab that comes to show a page select would refuse stays the active page, and the other tools answer active_page_not_allowed — browser_navigate can take it to an http(s) page. new, select and close report delivery and retry. |
51
- | `browser_close` | — | – – I – | Close the browser (or disconnect from an attached CDP session). |
39
+ | `browser_launch` | headless:boolean?, cdp_port:integer?, chrome:boolean? | – – – O | Launch Playwright with a separate persistent profile (default headed; headless:true). cdp_port attaches to a loopback DevTools port (NORACU_ALLOW_CDP=1 for mac_app launch cdp_port, =any for other ports; exclusive of other sessions; browser_close only disconnects). chrome:true uses the person's own Chrome (NORACU_ALLOW_CHROME=1 + Chrome remote debugging): noracu opens its own window and accesses only tabs it opened and tabs they open (plus the person's http(s) tabs with NORACU_CHROME_TABS=all); browser_close closes only noracu's tabs and disconnects. cdp_port and chrome:true are refused under NORACU_READ_ONLY=1. |
40
+ | `browser_navigate` | **url**:string | – – – O | Navigate the active page to an http(s) URL (or file:// with NORACU_ALLOW_FILE_URL=1; use browser_tabs to open a new tab). Reports the final URL, HTTP status, title, and delivery and retry. |
41
+ | `browser_snapshot` | browser_id:string? | R – I O | Read the active page's ARIA tree (~14000 chars) plus up to 100 interactive elements with element_index (valid 30 s, ended by navigation); use browser_read for plain visible text. Indexes feed browser_click (to type by index: browser_click, then browser_type). Page-opened tabs are not followed (see browser_tabs). |
42
+ | `browser_screenshot` | fullPage:boolean?, format:string?, quality:number?, clip:object? | R – I O | Capture the active page (prefer browser_snapshot to read and act on controls): optional fullPage, format png\|jpeg, quality (1-100, jpeg only) and clip {x,y,width,height}. Returns the image plus viewport and DPR metadata. |
43
+ | `browser_click` | element_index:integer?, selector:string?, xy:array?, button:string? | – – – O | Click an element on the active page with actionability-checked pointer input (to type by element_index, click the field, then browser_type). Pass exactly one of element_index (from the page's latest browser_snapshot, valid 30 s), selector (fallback) or xy ([x,y] pixels, last resort). Reports delivery and retry. |
44
+ | `browser_fill` | **selector**:string, **value**:string | – – – O | Set a field's whole value by selector ("" clears; no element_index — to type by index, browser_click, then browser_type). Reports delivery and retry. |
45
+ | `browser_press_key` | **key**:string | – – – O | Press a page key or chord, e.g. 'Enter', 'Control+A'. Reports delivery and retry. |
46
+ | `browser_type` | **text**:string | – – – O | Append up to 2000 chars by keyboard to the focused element (no element_index: browser_click first; browser_fill takes a selector to replace or exceed 2000). Reports delivery and retry. |
47
+ | `browser_scroll` | direction:string?, pages:number? | – – – O | Scroll the active page up, down, left or right by pages (default down, 1) at the viewport center; use mac_scroll for Mac apps. Reports the scrollX/scrollY change, and delivery and retry. |
48
+ | `browser_read` | selector:string? | R – I O | Read visible text from the active page (up to 12000 chars, or 8000 scoped to selector, waiting for selector across navigation); use browser_snapshot for interactive elements and element_index. |
49
+ | `browser_evaluate` | **js**:string | – D – O | Evaluate JavaScript in the active page (prefer browser_snapshot or browser_read when possible). Off by default: needs NORACU_ENABLE_EVAL=1, and never runs when NORACU_DISABLE_EVAL=1 or with chrome:true. Returns the result, and delivery and retry. |
50
+ | `browser_tabs` | action:string?, tab_id:string?, url:string?, browser_id:string? | – D – O | Manage session tabs (other browser_* tools act on the active page only; page-opened tabs are listed, never followed; refused under NORACU_READ_ONLY=1). Allowed URLs: http(s), plus file:// when NORACU_ALLOW_FILE_URL=1. list (default) returns tab_id, url, title, active state and ownership. new opens and activates a tab (optional url). select activates tab_id (allowed URL or initial blank page). close closes a browser_tabs-owned tab, never the last (if active, the first selectable tab becomes active). Changing the active page ends element_index values; use browser_navigate if the active page lands on a disallowed URL. new, select and close report delivery and retry. |
51
+ | `browser_close` | — | – – I – | Close the browser or disconnect a CDP/Chrome session. |
52
52
 
53
- ## iPhone layer (device-use)
53
+ ## iPhone layer (device-use; experimental, off by default)
54
54
 
55
55
  *listed when NORACU_LAYERS includes iphone (off by default) · imctl / iPhone Mirroring — the default iPhone backend*
56
56
 
57
57
  | Tool | Arguments | Hints | Description |
58
58
  |---|---|---|---|
59
- | `phone_status` | — | R – I – | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Return the iPhone Mirroring session status as JSON (running, window, onscreen, frontmost, live, overlay, paused, setup — true when a setup or welcome screen is showing that the user must finish). |
60
- | `phone_launch` | — | – – – – | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Ensure iPhone Mirroring is running, brought to the front, and clicks Resume when the connection is paused. Never clicks through a setup or welcome screen: reports mirror_setup_required instead. Reports delivery and retry. |
61
- | `phone_screenshot` | — | R – I O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Screenshot the iPhone screen (the Mirroring window, captured by window id so it works even when covered). Fails with capture_failed instead of returning another window's pixels. Some phone apps treat a capture of the mirror window as a screenshot and show their after-screenshot sheet a moment later; that holds for every tool and every expect check that reads the phone screen. |
62
- | `phone_ocr` | — | R – I O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. OCR the iPhone screen into text with coordinates: one line per reading, (x,y) 'text' [confidence] — the normalized 0-1 centre, then the recognizer's own 0-1 confidence in that reading. Fails with capture_failed instead of returning another window's pixels. The capture can make a phone app show its after-screenshot sheet (see phone_screenshot). |
63
- | `phone_find` | **text**:string | R – I O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Locate text on the iPhone screen: the first reading that contains it, as (x,y) 'text' [confidence] — the normalized 0-1 centre, then the recognizer's own 0-1 confidence. Fails with capture_failed instead of returning another window's pixels. The capture can make a phone app show its after-screenshot sheet (see phone_screenshot). |
64
- | `phone_tap` | **x**:number, **y**:number, expect:string? | – – – O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Tap at {x, y} in normalized 0-1 coordinates of the mirror window. A point on the window's transparent margin (the strip above the phone screen, which holds the window's own controls, or the thin edge around it) is refused with out_of_screen and nothing is sent; while the screen's edges cannot be trusted (the pointer resting on that strip), so is a point near the top of the window or along its other sides, where the margin may be, and a tap that goes out says the edges were not known; when nothing is remembered and the window's image cannot be read, the tap is refused with capture_failed. Refused with mirror_not_live or mirror_state_unknown when the mirror is not live or its state cannot be confirmed. Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
65
- | `phone_longpress` | **x**:number, **y**:number, duration:number?, expect:string? | – – – O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Long-press at {x, y} for an optional duration in seconds. A point on the mirror window's transparent margin is refused with out_of_screen and nothing is sent, as in phone_tap. Refused with mirror_not_live or mirror_state_unknown when the mirror is not live or its state cannot be confirmed. Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
66
- | `phone_swipe` | **from**:array, **to**:array, ms:number?, expect:string? | – – – O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Swipe (mouse drag) from [x,y] to [x,y] over an optional duration in ms; to move a list use phone_scroll. The mirror delivers a drag as pointer input, so a swipe that starts on an app icon picks the icon up and moves it (it can rearrange the Home Screen or make a folder): page the Home Screen from the empty strip just above the Dock (y about 0.80), never across the icon rows. Both points are kept inside the phone screen: the mirror window has a transparent margin around it (a strip above, a thin edge on the other sides) and iOS cancels a drag that starts or ends there, so a point on it is moved just inside the screen's edge and the result names it. The screen's edges are measured from one capture of the window and remembered per window size; a measurement that cannot be trusted (the pointer resting on the strip above the screen) is not used: both points are then kept clear of where the margin may be — the top of the window and a band along its other sides — and the result says so; a swipe whose two points would become one point once moved inside is refused with out_of_screen; when nothing is remembered and the window's image cannot be read, the swipe is refused with capture_failed and nothing is sent. Refused with mirror_not_live or mirror_state_unknown when the mirror is not live or its state cannot be confirmed. Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
67
- | `phone_home` | — | – – – O | EXPERIMENTAL. Send the Home Screen command via the iPhone Mirroring menu (works without python/pyobjc on English macOS while the mirror is live), falling back to an imctl swipe (needs python/pyobjc) only when that English menu item is absent (non-English macOS). Reports only that the command or gesture was sent — nothing on the iPhone screen is verified; refuses with mirror_not_live or mirror_state_unknown (or menu_unknown on timeout) when the mirror is not live or its state cannot be confirmed. Reports delivery and retry. |
68
- | `phone_app_switcher` | — | – – – O | EXPERIMENTAL. Send the App Switcher command via the iPhone Mirroring menu (works without python/pyobjc on English macOS while the mirror is live), falling back to an imctl gesture (needs python/pyobjc) only when that English menu item is absent (non-English macOS). Reports only that the command or gesture was sent — nothing on the iPhone screen is verified; refuses with mirror_not_live or mirror_state_unknown (or menu_unknown on timeout) when the mirror is not live or its state cannot be confirmed. Reports delivery and retry. |
69
- | `phone_scroll` | direction:string?, distance:number?, expect:string? | – – – O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Scroll up or down by `distance` window heights (0 < distance <= 3, default 0.5) using trackpad-style scroll events. Refused with mirror_not_live or mirror_state_unknown when the mirror is not live or its state cannot be confirmed; reports scroll_no_effect when the screen did not change (list end, or the view does not scroll); a scroll that changed the screen is delivered_unverified, since a notification or an animation changes it too — take phone_screenshot to see where the list is. Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
70
- | `phone_type` | **text**:string, replace:boolean?, expect:string? | – – – O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Type text via the clipboard (IME-safe; never echoes the typed text). Waits at least 1.5 s after writing the Mac clipboard before ⌘V, because the phone reads it through Universal Clipboard and an earlier ⌘V can paste the phone's own older clipboard instead; after type_not_confirmed, read the field — it may hold that older text. If another app comes to the front during the wait: focus_lost, no ⌘V; the clipboard is put back unless something else copied during the wait. Refused with mirror_not_live or mirror_state_unknown when the mirror is not live or its state cannot be confirmed. Saves every clipboard item and type, clearing concealed or transient items instead of copying, and restores only after OCR sees the text appear within its 2.5 s check at a spot where it was not before, below the status bar and notification strip — only that sighting makes the result delivered_verified (Universal Clipboard or >64 MB items are not copied and leave the typed text on the clipboard; a text under four characters, spaces and case aside, a paste seen only after the 2.5 s check, and type_not_confirmed are never verified and also leave the typed text on the clipboard). replace=true selects all and overwrites the field. Refused with keyboard_layout (nothing sent, clipboard untouched) when the Mac's keyboard layout types another character on the key ⌘V or ⌘A is sent from (AZERTY, Dvorak). Optional expect: on-screen text (OCR), else nothing is sent. Reports delivery and retry. |
71
- | `phone_key` | **key**:string, expect:string? | – – – O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Press a key: return, delete, up, down, left, or right. Refused with mirror_not_live or mirror_state_unknown when the mirror is not live or its state cannot be confirmed. Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
72
- | `phone_open` | **app**:string | – – – O | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Refused with mirror_not_live or mirror_state_unknown when the mirror is not live or its state cannot be confirmed. Open an app: Home Screen, Spotlight via the menu, clear, type the name the way phone_type does (the clipboard keeps it), then tap only an exact label inside the Spotlight Top Hit card — or, where Spotlight shows its search field at the top and no Top Hit card, the exact label just under the field, and only when the field completes the name as "<name> — Open" — (suggestion, website and Settings rows of the same name are ignored, so a name the Top Hit card does not show is app not found, and one it shows at two or more spots is open_not_confirmed with nothing tapped; reads the English "Top Hit" label unless NORACU_TOPHIT_LABELS names the phone's own, and the "— Open" completion in English only; a name that never shows up in Spotlight after ⌘V, even after up to 15 s, is open_not_confirmed — retry; a one- or two-letter name such as "X" that OCR cannot read in the Top Hit card is open_not_confirmed without the 15 s wait, nothing tapped — open it from its Home Screen icon); confirms the app opened (frame diff + OCR), taps the Top Hit icon when the label tap does nothing, else open_not_confirmed, back on the Home Screen. If another app comes to the front before ⌘V: focus_lost, nothing pasted or tapped, no trip Home (Spotlight may stay open); if another app or device changes the clipboard before ⌘V: open_not_confirmed, nothing pasted or tapped, back on the Home Screen. The result line names the confidence (0-1) the tapped label was read with; with NORACU_OCR_MIN_CONFIDENCE set, a label read below it is not tapped: open_not_confirmed, back on the Home Screen. Reports delivery and retry. |
59
+ | `phone_status` | — | R – I – | EXPERIMENTAL. Needs iPhone Mirroring and a python3 with pyobjc. Return the Mirroring session status as JSON: running, window, onscreen, frontmost, live, overlay, paused, setup (a setup or welcome screen that only the person can finish). Call it when an action returns mirror_not_live or mirror_state_unknown. |
60
+ | `phone_launch` | — | – – – – | EXPERIMENTAL. Make sure iPhone Mirroring is running, in front and live (clicks Resume when the connection is paused); call it when an action returns mirror_not_live. Never clicks through a setup or welcome screen: reports mirror_setup_required instead. Reports delivery and retry. |
61
+ | `phone_screenshot` | — | R – I O | EXPERIMENTAL. Screenshot the iPhone screen (the Mirroring window, captured by window id, so it works even when covered); capture_failed rather than another window's pixels. Some iOS apps react to each capture as to a screenshot (an after-screenshot sheet a moment later) — the captures of phone_ocr, phone_find and expect checks included. |
62
+ | `phone_ocr` | — | R – I O | EXPERIMENTAL. OCR the iPhone screen into text with coordinates: one line per reading, (x,y) 'text' [confidence] — the normalized 0-1 centre, then the recognizer's 0-1 confidence. capture_failed rather than another window's pixels. Each call captures the screen (see phone_screenshot). |
63
+ | `phone_find` | **text**:string | R – I O | EXPERIMENTAL. Locate text on the iPhone screen: the first reading that contains it, as (x,y) 'text' [confidence] — the normalized 0-1 centre, then the recognizer's 0-1 confidence. capture_failed rather than another window's pixels. Each call captures the screen (see phone_screenshot). |
64
+ | `phone_tap` | **x**:number, **y**:number, expect:string? | – – – O | EXPERIMENTAL. Tap at {x, y} in normalized 0-1 coordinates of the mirror window. A point on the window's margin (the strip above the phone screen, the thin edge around it) is refused with out_of_screen and nothing is sent; while the screen's edges are not known, points near the top or the sides are refused too, and a tap that goes out says so. Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
65
+ | `phone_longpress` | **x**:number, **y**:number, duration:number?, expect:string? | – – – O | EXPERIMENTAL. Long-press at {x, y} (normalized 0-1, as in phone_tap) for an optional duration in seconds; a point on the window's margin is refused with out_of_screen. Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
66
+ | `phone_swipe` | **from**:array, **to**:array, ms:number?, expect:string? | – – – O | EXPERIMENTAL. Drag from [x,y] to [x,y] in normalized 0-1 coordinates of the mirror window, over an optional duration in ms (to move a list, use phone_scroll). The Mac pointer moves; starting on an app icon can move it or create a folder, so page the Home Screen from the empty strip just above the Dock (y about 0.80). A point on the window's margin is moved just inside the phone screen and the result names it (out_of_screen if both points become one). Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
67
+ | `phone_home` | — | – – – O | EXPERIMENTAL. Go to the Home Screen through the iPhone Mirroring menu (on English macOS without python3/pyobjc; elsewhere through a swipe that needs them). Says only that the command was sent — nothing on the phone is verified. Reports delivery and retry. |
68
+ | `phone_app_switcher` | — | – – – O | EXPERIMENTAL. Open the App Switcher through the iPhone Mirroring menu (on English macOS without python3/pyobjc; elsewhere through a gesture that needs them). Says only that the command was sent — nothing on the phone is verified. Reports delivery and retry. |
69
+ | `phone_scroll` | direction:string?, distance:number?, expect:string? | – – – O | EXPERIMENTAL. Scroll up or down by distance window heights (0 < distance <= 3, default 0.5) with trackpad-style scroll events. scroll_no_effect when the screen did not change (a list's end, or a view that does not scroll); a scroll that changed the screen is delivered_unverified, since a notification or an animation changes it too — take phone_screenshot to see where the list is. Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
70
+ | `phone_type` | **text**:string, replace:boolean?, expect:string? | – – – O | EXPERIMENTAL. Paste text into the focused iPhone field through Universal Clipboard (focus the field with phone_tap first; brings Mirroring to the front; IME-safe; never echoes the text). replace:true overwrites the field; expect requires matching OCR text on screen first. The Mac clipboard is restored when OCR confirms the paste (a text under 4 characters or an unconfirmed paste leaves it on the clipboard); after type_not_confirmed, read the field before typing again. Reports delivery and retry. |
71
+ | `phone_key` | **key**:string, expect:string? | – – – O | EXPERIMENTAL. Press a key: return, delete, up, down, left or right. Optional expect: text that must be on screen (OCR) first, else nothing is sent. Reports delivery and retry. |
72
+ | `phone_open` | **app**:string | – – – O | EXPERIMENTAL. Open an iPhone app by its exact display name through Spotlight (brings Mirroring to the front; the name can stay on the Mac clipboard). Taps only an exact label in the Spotlight Top Hit card — never suggestion, website or Settings rows (reads the English "Top Hit" label unless NORACU_TOPHIT_LABELS names the phone's own; the "— Open" completion is English-only) — and confirms the app opened, else open_not_confirmed, back on the Home Screen. For a one- or two-letter name OCR misses, use phone_home and phone_tap on its icon. Reports the label's OCR confidence, delivery and retry. |
73
73
 
74
- ## iPhone layer, XCUITest backend (device-use)
74
+ ## iPhone layer, XCUITest backend (device-use; experimental, off by default)
75
75
 
76
76
  *listed instead of the phone_* tools when NORACU_LAYERS includes iphone and NORACU_PHONE_BACKEND=xcuitest · a UI-test runner on the phone (ios-runner/) · devicectl*
77
77
 
78
78
  | Tool | Arguments | Hints | Description |
79
79
  |---|---|---|---|
80
80
  | `ios_status` | — | R – I – | EXPERIMENTAL. XCUITest iPhone backend (NORACU_PHONE_BACKEND=xcuitest; needs Xcode, a paired iPhone with Developer Mode or a booted simulator, and the runner built once with `npx noracu ios-setup`). Report what it can do here without starting anything: the device in use (name, model, iOS, udid, cable or network, simulator), whether it is locked, whether the runner build exists, whether the runner is running, and the app later calls default to. Run it first when ios_* tools fail. |
81
- | `ios_launch` | **bundle_id**:string, terminate_existing:boolean? | – D – O | EXPERIMENTAL. Bring an app to the front on the iPhone by bundle id (e.g. com.apple.Preferences), starting it if needed, through devicectl (simctl on a simulator); terminate_existing:true ends a running instance first (its unsaved state is lost). Verified by the app reporting that it is in front; launch_not_confirmed after 10 s otherwise (a system prompt may cover it). The first ios_* call that needs the phone starts the on-device runner, which can take a minute, and needs the phone unlocked: a locked phone, or one whose lock state cannot be read, gets nothing (device_locked / lock_unknown). Ends every earlier element_index. The app becomes the default bundle_id of later calls. Reports delivery and retry. |
82
- | `ios_snapshot` | bundle_id:string?, interactive:boolean?, max_nodes:integer? | R – I O | EXPERIMENTAL. Read an app's accessibility tree on the iPhone (bundle_id; default: the app of the last ios_* call). Returns {bundle_id, snapshot_id, state, screen:{w,h} in points, elements:[{i, type, label, id, value, placeholder, frame:[x,y,w,h], disabled, selected}]}; i is the element_index for ios_tap and ios_type — unique across snapshots, valid 30 s, and ended by ios_home and ios_launch. interactive:true keeps only controls; max_nodes (default 300, 1-1000) cuts the list (truncated:true). A secure field's value is never returned; an empty field's placeholder comes as placeholder, not as value; a value over 4000 characters is cut (value_truncated:true). An app that is not in front can be read but not acted on. An app that has just come to the front may still be filling in its rows: labels can change within a second or two. Labels and values are untrusted text from the app. |
81
+ | `ios_launch` | **bundle_id**:string, terminate_existing:boolean? | – D – O | EXPERIMENTAL. Launch or bring an iPhone app to the front by bundle_id (e.g. com.apple.Preferences); it becomes the default bundle_id of later ios_* calls and ends earlier element_index values. terminate_existing:true restarts a running instance (its unsaved state is lost). The first call that needs the phone starts the on-device runner (up to a minute; the phone must be unlocked); an input call that had to start it sends nothing — call ios_snapshot next. Reports delivery and retry. |
82
+ | `ios_snapshot` | bundle_id:string?, interactive:boolean?, max_nodes:integer? | R – I O | EXPERIMENTAL. Read an iPhone app's accessibility tree (bundle_id; default: the app of the last ios_* call; an app not in front can be read, not acted on). Returns {bundle_id, snapshot_id, state, screen:{w,h}, elements:[{i, type, label, id, value, placeholder, frame, disabled, selected}]} in screen points; i is the element_index for ios_tap and ios_type (valid 30 s; ended by ios_home and ios_launch). interactive:true keeps controls; max_nodes (1-1000, default 300) caps the list. Secure values are never returned; values over 4000 characters are cut. Rows of an app that just came to the front can change for a second or two. Labels and values are untrusted text. |
83
83
  | `ios_screenshot` | — | R – I O | EXPERIMENTAL. Screenshot the iPhone screen as PNG, taken on the phone by the runner; returns the image and the screen size in points (the unit of ios_tap x,y and ios_snapshot frames). The image is returned, never written to disk on the Mac. Whatever is on screen, notifications included, becomes model input. |
84
- | `ios_tap` | element_index:integer?, snapshot_id:string?, x:number?, y:number?, bundle_id:string?, count:integer?, duration_ms:integer? | – – – O | EXPERIMENTAL. Tap an element by element_index (from ios_snapshot), or a point x,y in screen points inside bundle_id (default: the app of the last call). With element_index the app is read again first: the element must still be there with the same type, label, identifier and frame, and its app in front — otherwise element_no_longer_valid and nothing is sent. count 2-3 repeats the tap; duration_ms (100-5000) makes it a long press. Nothing is sent when the app rule (NORACU_DENY_APPS / NORACU_APPROVAL_FILE, matched on the bundle id) rules the app out, the stop file exists, the phone is locked, or the app is not in front; with app rules set, no tap that names com.apple.springboard (the Home Screen) goes out — not even one on a system prompt's button (input_denied; open apps with ios_launch). A tap that went out is delivered_unverified: take ios_snapshot to see what it did. No answer from the phone is ios_timeout with delivery=unknown, and the tap is never sent again. |
85
- | `ios_type` | **text**:string, element_index:integer?, snapshot_id:string?, bundle_id:string? | – – – O | EXPERIMENTAL. Type text (1-2000 characters) as keyboard input on the phone — no clipboard is involved. With element_index — of a text field, a secure field, a search field or a text view; anything else is refused (not_a_text_field) and nothing is tapped — the field is re-checked and tapped first and the keyboard is waited for; without it the text goes to whatever holds the keyboard in bundle_id (default: the app of the last call; no_keyboard, nothing sent, when none is up). delivered_verified only when the field that took the text — the one tapped, or the only one whose value changed — afterwards holds its old value with the text put in at one place; type_not_confirmed when it does not (autocorrection or completion changed it, the field hides its value, part of the text was lost, or the text went elsewhere) — read the field before typing again. With app rules set, text that names com.apple.springboard is not sent (input_denied). Text shorter than 4 characters, a secure field, text that contains a return, and text typed while the app's fields could not be read, are not read back (delivered_unverified). The result never repeats the text. |
86
- | `ios_key` | **key**:string, count:integer?, bundle_id:string? | – – – O | EXPERIMENTAL. Press return or delete (count 1-50) on the phone's keyboard in bundle_id (default: the app of the last call); no_keyboard, nothing sent, when no keyboard is up. With app rules set, keys that name com.apple.springboard are not sent (input_denied). Reports delivery and retry. |
87
- | `ios_swipe` | **from**:array, **to**:array, bundle_id:string?, hold_ms:integer?, end_hold_ms:integer?, velocity:string? | – – – O | EXPERIMENTAL. Drag from [x,y] to [x,y] in screen points inside bundle_id (default: the app of the last call), to scroll a list or move something: hold_ms (0-2000, default 50) is the press before the move — a long hold picks an item up; end_hold_ms (0-2000, default 300) is the pause before lifting; velocity slow (default), default or fast. A list usually moves a little less than the finger. With app rules set, a swipe that names com.apple.springboard is not sent (input_denied). Reports delivery and retry; take ios_snapshot to see the result. |
88
- | `ios_home` | — | – – – O | EXPERIMENTAL. Press the Home button (go to the Home Screen). Ends every earlier element_index; the Home Screen (com.apple.springboard) becomes the default app of later calls. delivered_verified when the app that was in front is seen to leave it. The app rule judges it as com.apple.springboard. Reports delivery and retry. |
84
+ | `ios_tap` | element_index:integer?, snapshot_id:string?, x:number?, y:number?, bundle_id:string?, count:integer?, duration_ms:integer? | – – – O | EXPERIMENTAL. Tap an element by element_index (from ios_snapshot; valid 30 s; re-checked first: element_no_longer_valid if it changed or its app left the front) or at x,y in screen points inside bundle_id (default: the app of the last call). count 2-3 repeats the tap; duration_ms (100-5000) makes it a long press. With app rules active, Home Screen taps are refused — use ios_launch. A tap that went out is delivered_unverified: call ios_snapshot to see what it did. Reports delivery and retry. |
85
+ | `ios_type` | **text**:string, element_index:integer?, snapshot_id:string?, bundle_id:string? | – – – O | EXPERIMENTAL. Type text (1-2000 characters) with the iPhone keyboard (no clipboard; the result never repeats the text). With element_index (from ios_snapshot; valid 30 s; a text, secure or search field, or a text view) the field is re-checked and tapped first; without it, the text goes to the keyboard that is up in bundle_id (default: the app of the last call; no_keyboard when none is) — for a field in a transient pop-up, ios_tap it, then ios_type without element_index. After type_not_confirmed, call ios_snapshot and read the field before typing again. Reports delivery and retry. |
86
+ | `ios_key` | **key**:string, count:integer?, bundle_id:string? | – – – O | EXPERIMENTAL. Press return or delete (count 1-50) on the phone's keyboard in bundle_id (default: the app of the last call); no_keyboard, nothing sent, when no keyboard is up. Reports delivery and retry. |
87
+ | `ios_swipe` | **from**:array, **to**:array, bundle_id:string?, hold_ms:integer?, end_hold_ms:integer?, velocity:string? | – – – O | EXPERIMENTAL. Drag from [x,y] to [x,y] in screen points inside bundle_id (default: the app of the last call), to scroll a list or move an item. hold_ms 0-2000 (default 50) presses before moving; a long hold can pick an item up. end_hold_ms 0-2000 (default 300) pauses before lifting. velocity is slow (default), default or fast. Lists usually move a little less than the drag. With app rules active, Home Screen swipes are refused. Reports delivery and retry; call ios_snapshot to see the result. |
88
+ | `ios_home` | — | – – – O | EXPERIMENTAL. Press the Home button. Ends every earlier element_index; the Home Screen (com.apple.springboard) becomes the default app of later calls, and app rules judge it as that app. Reports delivery and retry. |
89
89
 
@@ -1,27 +1,86 @@
1
1
  # Troubleshooting
2
2
 
3
- Install, permission and first-run problems. For what each error means, see the error reference in [usage.md](usage.md#8-error-reference).
3
+ Configuring a client by hand, permissions, start-up, updating and uninstalling. For what a tool's error means
4
+ (`element_no_longer_valid`, `occluded`, `user_active`, `active_page_not_allowed`, …), see the
5
+ [error reference in usage.md](usage.md#error-reference).
4
6
 
5
- | Symptom | Cause / fix |
7
+ ## Configure a client by hand
8
+
9
+ GUI MCP clients (Claude Desktop, Cursor) do not inherit the shell's `PATH` shims (nvm, fnm, volta, Homebrew), so a
10
+ bare `"node"` or `"npx"` often fails with `spawn ENOENT`. Run `npx noracu doctor` in the folder where you installed
11
+ noracu: it prints the exact paths on your Mac, ready to paste. By hand, with your own paths in place of the
12
+ placeholders:
13
+
14
+ **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`) or **Cursor**
15
+ (`~/.cursor/mcp.json`):
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "noracu": {
21
+ "command": "/absolute/path/to/node",
22
+ "args": ["/absolute/path/to/noracu-folder/node_modules/noracu/src/server.mjs"],
23
+ "env": {
24
+ "NORACU_READ_ONLY": "1"
25
+ }
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ **Claude Code** (the `-e` options go right after `noracu`, before `--`):
32
+
33
+ ```bash
34
+ claude mcp add -s user noracu -e NORACU_READ_ONLY=1 -- \
35
+ /absolute/path/to/node \
36
+ /absolute/path/to/noracu-folder/node_modules/noracu/src/server.mjs
37
+ ```
38
+
39
+ `NORACU_READ_ONLY=1` refuses all input on the first run; pages still load in noracu's own browser. Remove it when you want input tools, then quit the MCP client
40
+ completely (⌘Q) and reopen it.
41
+
42
+ ## Permissions and start-up
43
+
44
+ | Symptom | Cause and fix |
6
45
  |---|---|
7
- | `mac_*` fails with `permission_denied: Accessibility permission is missing…` (before 0.2: error **-1719**) | Accessibility not granted to the **host** app — grant it, then quit + reopen the host; `mac_status` shows the state |
8
- | Screenshots show only the desktop picture (no other app's windows), or come back black | Screen Recording (Screen & System Audio Recording on macOS 15 and later) not granted to the host — grant it, then quit + reopen |
9
- | `ENOENT` mentioning cliclick | `brew install cliclick` (or set `NORACU_CLICLICK`) |
10
- | `spawn node` / `npx` `ENOENT` from a GUI host | use an absolute `node` path in the config — nvm/volta/homebrew shims are not on the GUI `PATH` |
11
- | `browser_launch` answers `browser_installing` on first use | the one-time Chromium download is under way — call it again in a minute; with auto-install disabled (`NORACU_DISABLE_AUTO_INSTALL=1`) run `npx playwright install chromium` |
12
- | `phone_*` says `imctl unavailable: no python3 with pyobjc found` | install pyobjc for a python3 (`python3 -m pip install pyobjc-framework-Quartz pyobjc-framework-Vision pyobjc-framework-Cocoa`; Homebrew python3 is the usual choice) or set `NORACU_PYTHON` — see [iPhone layer](iphone.md) |
13
- | `phone_*` refused with `mirror_not_live: …` ("Connection Paused", "iPhone in Use", "not running") or `mirror_state_unknown: …` | the mirror is not running, paused, or its state could not be read — lock the iPhone, keep it near the Mac, check `phone_status`, and call `phone_launch` (it starts Mirroring and clicks Resume) |
14
- | `phone_launch` says `mirror_setup_required` | iPhone Mirroring shows a setup or welcome screen (e.g. the first launch after a macOS upgrade) — finish it yourself in the iPhone Mirroring window; noracu never clicks through it |
15
- | `imctl_timeout: phone … did not finish within …s` | the Mac is under heavy load or the system is stuck — the action may have partly run, so check `phone_status` / `phone_screenshot` before retrying (after `phone_open`, noracu goes back to the Home Screen); the server keeps answering other calls meanwhile |
16
- | `input_busy: …` | an earlier phone or Mac action held the input queue for over 60 s (or `NORACU_PHONE_TIMEOUT_MS` + 15 s); the call did nothing — retry |
17
- | `user_active: …` | someone used this Mac's keyboard or mouse in the last 2 s, and again while noracu waited out the rest of the 2 s — nothing was sent; retry after a pause. On a Mac nobody else uses, `NORACU_USER_IDLE_S=0` turns the check off |
18
- | `phone_open` returns app not found for an installed app | it only taps the app's label in Spotlight's Top Hit card, or — where Spotlight shows its search field at the top and no Top Hit card — the label just under the field when the field completes the name as "<name> — Open" — use the name exactly as the phone shows it under the icon (e.g. `拼多多`, not `Pinduoduo`). "Spotlight showed no Top Hit" on an installed app usually means the iPhone's language is not English: `phone_open` reads Spotlight's "Top Hit" label — set `NORACU_TOPHIT_LABELS` to the label your iPhone shows (it covers the Top Hit label only; the "— Open" completion is read in English only). `open_not_confirmed: … never showed up on the phone` means the name did not show up in Spotlight after ⌘V: the paste may not have arrived (it can take several seconds) or the phone may have pasted its own older clipboard into the search field — retry; `phone_open` clears the field first. A one- or two-letter name such as `X` is often unreadable to OCR, so `phone_open` reports `open_not_confirmed` without tapping — open that app from its Home Screen icon (`phone_screenshot`, then `phone_tap`). `phone_open` leaves the app name on the clipboard |
19
- | Typed text comes out re-spaced (e.g. "no ra cu") | it went in as keystrokes (`mac_type` with `mechanism: "physical"`, or a focused element that takes no accessibility text) while a CJK input method was active — use the default `mac_type` mechanism, or `mac_paste` |
20
- | `element_no_longer_valid` | the snapshot is older than 30 s, or the element is gone, changed or in a window that closed — re-run `mac_ax_state` / `browser_snapshot` and use a fresh index |
21
- | `occluded: … — on top: {…}` | a physical click would land on something else (another window, a sheet) — bring the target forward or close what covers it; nothing was sent |
22
- | `ambiguous_window: … windows: […]` | the app has several windows and none is focused — pass `window` (index or title) or `window_id` from `mac_windows` |
23
- | `policy_denied: "cmd-q" …` | `mac_key` refuses quit / log-out / lock / force-quit / delete-immediately / empty-Trash chords unless `force: true`; to quit an app use `mac_app` |
24
-
25
- Node 18 is rejected at startup — use Node ≥ 20. Claude Desktop may start one noracu process per surface (e.g. chat and a second surface); they share the browser profile, so launch the browser from only one at a time.
26
-
27
- Full worked examples: [docs/usage.md](usage.md).
46
+ | `permission_denied: Accessibility …` | Turn on **Accessibility** for what macOS counts for noracu: with Claude Desktop, the `node` in its configuration (Claude Desktop starts each server as a process of its own; if `node` is not in the list, add it with **+**, ⌘⇧G and that path); for the Claude Desktop extension, **Claude Helper (Plugin)**; with Cursor or a terminal, that app. Then quit (⌘Q) and reopen the client; `mac_status` shows the state and names what to turn on |
47
+ | `mac_screenshot` shows only the desktop picture, or comes back black | Turn on **Screen & System Audio Recording** (Screen Recording before macOS 15) for the same one, then quit and reopen the client |
48
+ | The server refuses to start on Node 18 | Install Node 20 or later and point `command` at that `node` |
49
+ | `spawn node` / `npx` `ENOENT` in a GUI client | Replace `"node"` / `"npx"` with the absolute paths `npx noracu doctor` prints |
50
+ | `ENOENT` mentioning `cliclick` | `brew install cliclick`, or set `NORACU_CLICLICK` to its path |
51
+ | `claude mcp add` fails with `Invalid environment variable format: noracu, …` | `-e` came before the server name and took the name as one more variable — put `-e NAME=value` right after `noracu` |
52
+ | `claude mcp add` says a server named `noracu` already exists | An earlier install left its entry: `claude mcp remove noracu` (add `-s user` if it was added for all your projects), then add it again; in Claude Desktop's or Cursor's JSON, change the path in `args` |
53
+ | `browser_launch` answers `browser_installing` the first time | Playwright's one-time Chromium download is under way — call it again in a minute; with `NORACU_DISABLE_AUTO_INSTALL=1`, run `npx playwright install chromium` |
54
+ | A second `browser_launch` fails while Claude Desktop has two surfaces open | Claude Desktop can start one noracu process per surface, and they share `~/.noracu/browser-profile`: keep the browser open in one surface at a time |
55
+ | Typed text comes out re-spaced ("no ra cu") | It went in as keystrokes (`mechanism: "physical"`, or a view that takes no accessibility text) while a CJK input method was on — use the default `mac_type`, or `mac_paste` |
56
+ | `phone_*` (experimental, off by default) says `imctl_unavailable: no python3 with pyobjc was found` | Install PyObjC for a `python3` (`python3 -m pip install pyobjc-framework-Quartz pyobjc-framework-Vision pyobjc-framework-Cocoa`; Homebrew's python3 is the usual choice) or set `NORACU_PYTHON` — see [iphone.md](iphone.md) |
57
+
58
+ ## Update noracu
59
+
60
+ 1. In the folder where you installed noracu:
61
+ ```bash
62
+ npm install noracu@latest
63
+ npx noracu --version
64
+ npx noracu doctor
65
+ ```
66
+ 2. Quit the MCP client completely (⌘Q) and reopen it, so the server restarts on the new code.
67
+ 3. Same install folder and same `node`: the client configuration needs no change. If either path changed, remove the
68
+ old entry first (in Claude Code: `claude mcp remove -s user noracu`), then add the configuration `npx noracu doctor`
69
+ prints.
70
+ 4. If Playwright's Chromium revision changed, the next `browser_launch` downloads it (with
71
+ `NORACU_DISABLE_AUTO_INSTALL=1`, run `npx playwright install chromium`).
72
+ 5. With the experimental XCUITest backend (`NORACU_PHONE_BACKEND=xcuitest`), `runner_version_mismatch` means the runner
73
+ on the phone is from another version: rebuild it with `npx noracu ios-setup` ([iphone.md](iphone.md)).
74
+
75
+ ## Uninstall noracu
76
+
77
+ 1. Remove the server entry (`claude mcp remove -s user noracu`, or delete `"noracu"` from
78
+ `claude_desktop_config.json` / `~/.cursor/mcp.json`) and restart the client. The Claude Desktop extension is
79
+ uninstalled in Claude Desktop's Settings → Extensions.
80
+ 2. In the install folder: `npm uninstall noracu`. Delete the folder itself only if it holds nothing else.
81
+ 3. Optional: remove `~/.noracu` (the browser profile, and an XCUITest runner build if you made one),
82
+ `~/Library/Caches/noracu` (the experimental Mirroring layer's screen-bounds cache), and — only if nothing else on
83
+ this Mac uses Playwright — `~/Library/Caches/ms-playwright`.
84
+ 4. Optional: in **System Settings → Privacy & Security**, under **Accessibility** and **Screen & System Audio
85
+ Recording**, turn off what you turned on for noracu if nothing else needs it: with Claude Desktop, the `node` of its
86
+ configuration, or **Claude Helper (Plugin)** for the extension; with Cursor or a terminal, that app.