noracu 0.3.2 → 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/CHANGELOG.md +111 -0
- package/README.md +94 -119
- package/SECURITY.md +148 -91
- package/docs/README.zh-CN.md +75 -102
- package/docs/apps.md +4 -6
- package/docs/architecture.md +17 -53
- package/docs/iphone.md +242 -54
- package/docs/known-issues.md +27 -11
- package/docs/tools.md +57 -57
- package/docs/troubleshooting.md +82 -25
- package/docs/usage.md +193 -241
- package/imctl/src/imctl/cli.py +21 -17
- package/imctl/src/imctl/gestures.py +85 -4
- package/imctl/src/imctl/verify.py +1 -2
- package/package.json +12 -8
- package/src/approval.js +28 -23
- package/src/doctor.js +60 -12
- package/src/ios-session.js +15 -14
- package/src/ios-setup.js +15 -6
- package/src/mac-ax.js +17 -3
- package/src/mcpb-entry.js +3 -0
- package/src/server.mjs +360 -235
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.
|
|
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
|
|
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
|
|
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
|
|
15
|
-
| `mac_drag` | **from_index**:integer, **to_index**:integer, snapshot_id:string?, hold_ms:integer?, step_ms:integer? | – – – O | Drag
|
|
16
|
-
| `mac_scroll` | direction:string?, pages:number?, element_index:integer?, snapshot_id:string? | – – – O | Scroll up
|
|
17
|
-
| `mac_key` | **key**:string, app:string?, force:boolean? | – D – O | Press a key or
|
|
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)
|
|
19
|
-
| `mac_paste` | **text**:string, app:string?, force:boolean? | – – – O | Paste text
|
|
20
|
-
| `mac_menu_command` | **app**:string, **command**:string, force:boolean? | – D – O | Run an app's menu bar
|
|
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
|
|
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 (
|
|
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
|
|
24
|
-
| `mac_clipboard_read` | format:string?, max_chars:integer? | R – I – | Read the clipboard: format auto (
|
|
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
|
|
26
|
-
| `mac_set_value` | **element_index**:integer, **value**:string, snapshot_id:string?, timeout_ms:integer? | – – I O | Set
|
|
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
|
|
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
|
|
29
|
-
| `mac_status` | — | R – I – |
|
|
30
|
-
| `mac_apps` | filter:string?, all:boolean? | R – I – | List running apps
|
|
31
|
-
| `mac_windows` | app:string?, include_offscreen:boolean? | R – I O | List on-screen windows
|
|
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
|
|
40
|
-
| `browser_navigate` | **url**:string | – – – O | Navigate the active page to an http(s) URL (file://
|
|
41
|
-
| `browser_snapshot` | browser_id:string? | R – I O |
|
|
42
|
-
| `browser_screenshot` | fullPage:boolean?, format:string?, quality:number?, clip:object? | R – I O |
|
|
43
|
-
| `browser_click` | element_index:integer?, selector:string?, xy:array?, button:string? | – – – O | Click an element on the active page
|
|
44
|
-
| `browser_fill` | **selector**:string, **value**:string | – – – O |
|
|
45
|
-
| `browser_press_key` | **key**:string | – – – O | Press a key or chord, e.g. 'Enter'
|
|
46
|
-
| `browser_type` | **text**:string | – – – O |
|
|
47
|
-
| `browser_scroll` | direction:string?, pages:number? | – – – O | Scroll the active page up, down, left
|
|
48
|
-
| `browser_read` | selector:string? | R – I O | Read the active page
|
|
49
|
-
| `browser_evaluate` | **js**:string | – D – O | Evaluate JavaScript in the active page
|
|
50
|
-
| `browser_tabs` | action:string?, tab_id:string?, url:string?, browser_id:string? | – D – O |
|
|
51
|
-
| `browser_close` | — | – – I – | Close the browser
|
|
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
|
|
60
|
-
| `phone_launch` | — | – – – – | EXPERIMENTAL.
|
|
61
|
-
| `phone_screenshot` | — | R – I O | EXPERIMENTAL.
|
|
62
|
-
| `phone_ocr` | — | R – I O | EXPERIMENTAL.
|
|
63
|
-
| `phone_find` | **text**:string | R – I O | EXPERIMENTAL.
|
|
64
|
-
| `phone_tap` | **x**:number, **y**:number, expect:string? | – – – O | EXPERIMENTAL.
|
|
65
|
-
| `phone_longpress` | **x**:number, **y**:number, duration:number?, expect:string? | – – – O | EXPERIMENTAL.
|
|
66
|
-
| `phone_swipe` | **from**:array, **to**:array, ms:number?, expect:string? | – – – O | EXPERIMENTAL.
|
|
67
|
-
| `phone_home` | — | – – – O | EXPERIMENTAL.
|
|
68
|
-
| `phone_app_switcher` | — | – – – O | EXPERIMENTAL.
|
|
69
|
-
| `phone_scroll` | direction:string?, distance:number?, expect:string? | – – – O | EXPERIMENTAL.
|
|
70
|
-
| `phone_type` | **text**:string, replace:boolean?, expect:string? | – – – O | EXPERIMENTAL.
|
|
71
|
-
| `phone_key` | **key**:string, expect:string? | – – – O | EXPERIMENTAL.
|
|
72
|
-
| `phone_open` | **app**:string | – – – O | EXPERIMENTAL.
|
|
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.
|
|
82
|
-
| `ios_snapshot` | bundle_id:string?, interactive:boolean?, max_nodes:integer? | R – I O | EXPERIMENTAL. Read an app's accessibility tree
|
|
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)
|
|
85
|
-
| `ios_type` | **text**:string, element_index:integer?, snapshot_id:string?, bundle_id:string? | – – – O | EXPERIMENTAL. Type text (1-2000 characters)
|
|
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.
|
|
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
|
|
88
|
-
| `ios_home` | — | – – – O | EXPERIMENTAL. Press the Home button
|
|
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
|
|
package/docs/troubleshooting.md
CHANGED
|
@@ -1,29 +1,86 @@
|
|
|
1
1
|
# Troubleshooting
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
| `
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
| `spawn node` / `npx` `ENOENT`
|
|
11
|
-
| `
|
|
12
|
-
| `claude mcp add`
|
|
13
|
-
| `
|
|
14
|
-
| `
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
| `
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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.
|