ucu-mcp 0.5.2 → 0.6.2

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ucu-mcp",
3
- "version": "0.5.2",
3
+ "version": "0.6.2",
4
4
  "description": "MCP server for Universal Computer Use — desktop automation for AI agents via Model Context Protocol",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "test:macos-gui": "UCU_MACOS_GUI_SMOKE=1 vitest run tests/integration/macos-gui-smoke.test.ts",
29
29
  "test:client-cli": "UCU_CLIENT_CLI_SMOKE=1 vitest run tests/integration/client-cli-smoke.test.ts",
30
30
  "prepublishOnly": "npx vitest run tests/unit/ && npm run build",
31
- "build:native": "cd native/cgevent && swiftc -O -o cgevent-helper main.swift -framework CoreGraphics -framework Foundation && cd ../ocr && swiftc -O -o ocr-helper main.swift -framework Vision -framework AppKit && cd ../windowlist && swiftc -O -o windowlist-helper main.swift -framework CoreGraphics -framework Foundation"
31
+ "build:native": "cd native/cgevent && swiftc -O -o cgevent-helper main.swift -framework CoreGraphics -framework Foundation && cd ../ocr && swiftc -O -o ocr-helper main.swift -framework Vision -framework AppKit && cd ../windowlist && swiftc -O -o windowlist-helper main.swift -framework CoreGraphics -framework Foundation && cd ../skylight && swiftc -O -o skylight-helper main.swift -framework CoreGraphics -framework Foundation -framework AppKit -framework Cocoa"
32
32
  },
33
33
  "keywords": [
34
34
  "mcp",
@@ -63,6 +63,20 @@ whether your click actually landed:
63
63
  A `warnings[]` array in the receipt explains the fallback. Never assume a
64
64
  coordinate-fallback click succeeded without checking.
65
65
 
66
+ ### Dispatch method (v0.6.0+) — background operation
67
+
68
+ Every input tool (`click`, `double_click`, `scroll`, `drag`, `move`, `type_text`,
69
+ `press_key`) returns a `result.dispatch` field:
70
+
71
+ | `dispatch` | Meaning |
72
+ |---|---|
73
+ | `"per-pid"` | Event posted to the target process via SLEventPostToPid/CGEventPostToPid — **no global cursor move, no foreground theft**. This is the default when `focus_app` has established a target. |
74
+ | `"hid-tap"` | Event posted to the global HID event tap (moves the cursor, may disturb foreground). Happens when: no active target (call `focus_app` first), the target is frontmost, or the app is a canvas/GPU app (Blender/Unity/games) that filters per-pid events. |
75
+
76
+ When `dispatch:"hid-tap"`, a `warnings[]` entry explains it. To avoid cursor
77
+ movement, always `focus_app` the target before input actions, so events route
78
+ per-process (Codex-style background operation).
79
+
66
80
  ## Tool selection — AX vs vision vs tray
67
81
 
68
82
  **AX-first** (precise, survives layout shifts):
@@ -112,6 +126,9 @@ also opaque.
112
126
 
113
127
  ## Operating Rules
114
128
 
129
+ - **`focus_app` before input.** Input events route per-process (no cursor move,
130
+ no foreground theft) only when an active target with a pid is established.
131
+ Without `focus_app`, events fall back to HID-tap (moves the cursor).
115
132
  - **Re-observe before every action.** The screen changes between your calls.
116
133
  A `focus_app` from 5 calls ago may be stale; a window may have closed.
117
134
  - **AX-first, coordinates only as fallback.** AX clicks are precise and