@amaster.ai/pi-computer-use 0.1.2-beta.5 → 0.1.2-beta.6
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/README.md +44 -30
- package/bin/darwin-arm64/.version +2 -0
- package/bin/darwin-arm64/cua-driver +0 -0
- package/bin/darwin-x64/.version +2 -0
- package/bin/darwin-x64/cua-driver +0 -0
- package/bin/linux-x64/.version +2 -0
- package/bin/linux-x64/cua-driver +0 -0
- package/bin/win32-arm64/.version +2 -0
- package/bin/win32-arm64/cua-driver-uia.exe +0 -0
- package/bin/win32-arm64/cua-driver.exe +0 -0
- package/bin/win32-x64/.version +2 -0
- package/bin/win32-x64/cua-driver-uia.exe +0 -0
- package/bin/win32-x64/cua-driver.exe +0 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +422 -38
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@ pi-coding-agent extension that wraps [cua-driver-rs](https://github.com/trycua/c
|
|
|
6
6
|
|
|
7
7
|
- **Zero external dependencies** — pre-compiled cua-driver-rs binaries bundled for all platforms
|
|
8
8
|
- **MCP stdio communication** — spawns `cua-driver mcp` via `StdioClientTransport`, JSON-RPC over stdio
|
|
9
|
-
- **Dynamic tool discovery** — auto-discovers upstream MCP tools and registers with `computer_use_` prefix
|
|
10
|
-
- **Smart tool filtering** — excludes non-essential tools (agent cursor, recording, config), exposes
|
|
9
|
+
- **Dynamic tool discovery** — auto-discovers upstream MCP tools and registers with `computer_use_` prefix; falls back to a built-in tool list when cua-driver fails to start
|
|
10
|
+
- **Smart tool filtering** — excludes non-essential tools (agent cursor, recording, config, raw screenshot), exposes 17 action tools + 1 vision tool
|
|
11
11
|
- **Optional visual analysis** — `computer_use_analyze_screenshot` via configurable vision model
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
12
|
+
- **Cross-platform permission handling** — detects platform-specific permission issues (macOS TCC, Windows UAC, Linux display server access) and returns actionable guidance
|
|
13
|
+
- **Graceful degradation** — tools are always registered even when cua-driver cannot connect; lazy reconnect is attempted on each tool call
|
|
14
14
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
@@ -60,50 +60,64 @@ Enable `computer_use_analyze_screenshot` by referencing a model already configur
|
|
|
60
60
|
|
|
61
61
|
The extension resolves API key, base URL, and headers from the model registry automatically — no need to duplicate credentials here.
|
|
62
62
|
|
|
63
|
-
## Exposed Tools (
|
|
63
|
+
## Exposed Tools (17 + 1 vision)
|
|
64
64
|
|
|
65
|
-
###
|
|
65
|
+
### Input
|
|
66
66
|
|
|
67
67
|
| Tool | Description |
|
|
68
68
|
|------|-------------|
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `computer_use_hotkey` | Press key combination |
|
|
69
|
+
| `computer_use_click` | Left-click via element_index or x/y coordinates |
|
|
70
|
+
| `computer_use_double_click` | Double-click at x/y or on an AX element |
|
|
71
|
+
| `computer_use_right_click` | Right-click (context menu) |
|
|
72
|
+
| `computer_use_type_text` | Insert text via AX or CGEvent fallback |
|
|
73
|
+
| `computer_use_press_key` | Press and release a single key |
|
|
74
|
+
| `computer_use_hotkey` | Press a key combination (e.g. Cmd+C) |
|
|
75
|
+
| `computer_use_scroll` | Scroll by line or page in a direction |
|
|
76
|
+
| `computer_use_drag` | Press-drag-release gesture between two points |
|
|
77
|
+
| `computer_use_set_value` | Set value on UI elements (popups, sliders, steppers) |
|
|
75
78
|
|
|
76
|
-
###
|
|
79
|
+
### Query
|
|
77
80
|
|
|
78
81
|
| Tool | Description |
|
|
79
82
|
|------|-------------|
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `computer_use_get_cursor_position` | Get current cursor position |
|
|
83
|
+
| `computer_use_get_screen_size` | Get display dimensions and scale factor |
|
|
84
|
+
| `computer_use_get_cursor_position` | Get current mouse cursor position |
|
|
85
|
+
| `computer_use_get_accessibility_tree` | Lightweight desktop snapshot (apps, windows, bounds) |
|
|
86
|
+
| `computer_use_get_window_state` | Full AX tree of a window with actionable element indices |
|
|
87
|
+
| `computer_use_list_windows` | List all top-level windows with bounds and z-order |
|
|
88
|
+
| `computer_use_list_apps` | List running and installed apps with state flags |
|
|
87
89
|
|
|
88
|
-
###
|
|
90
|
+
### App Lifecycle
|
|
89
91
|
|
|
90
92
|
| Tool | Description |
|
|
91
93
|
|------|-------------|
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `computer_use_get_window_state` | Get window state/position |
|
|
95
|
-
| `computer_use_launch_app` | Launch an application |
|
|
96
|
-
| `computer_use_kill_app` | Kill an application |
|
|
94
|
+
| `computer_use_launch_app` | Launch an app in the background without focus steal |
|
|
95
|
+
| `computer_use_kill_app` | Force-terminate a process by pid |
|
|
97
96
|
|
|
98
|
-
|
|
97
|
+
### Vision (requires `visionModel` config)
|
|
99
98
|
|
|
100
|
-
|
|
99
|
+
| Tool | Description |
|
|
100
|
+
|------|-------------|
|
|
101
|
+
| `computer_use_analyze_screenshot` | Take a screenshot and analyze it with a vision model |
|
|
102
|
+
|
|
103
|
+
## Excluded Tools (16)
|
|
104
|
+
|
|
105
|
+
Agent cursor styling, recording/replay, config management, zoom, raw screenshot (use `analyze_screenshot` instead), and browser-specific operations are filtered out.
|
|
101
106
|
|
|
102
107
|
## Permissions
|
|
103
108
|
|
|
104
|
-
On `session_start`, the extension checks
|
|
109
|
+
On `session_start`, the extension checks permissions via cua-driver's `check_permissions` tool. Platform-specific guidance is provided:
|
|
110
|
+
|
|
111
|
+
| Platform | Accessibility | Screen Capture |
|
|
112
|
+
|----------|--------------|----------------|
|
|
113
|
+
| macOS | System Settings → Privacy & Security → Accessibility | System Settings → Privacy & Security → Screen & System Audio Recording |
|
|
114
|
+
| Windows | Run as Administrator / UI Automation access | Check DRM or security policy |
|
|
115
|
+
| Linux | AT-SPI accessibility service | PipeWire portal or X11 access |
|
|
105
116
|
|
|
106
|
-
When
|
|
117
|
+
When cua-driver fails to connect (missing permissions, binary not found, etc.):
|
|
118
|
+
1. User is notified with a platform-appropriate warning
|
|
119
|
+
2. Tools are still registered using a built-in fallback schema
|
|
120
|
+
3. On each tool call, lazy reconnect is attempted; if it still fails, a friendly error with permission instructions is returned
|
|
107
121
|
|
|
108
122
|
## Supported Platforms
|
|
109
123
|
|
|
Binary file
|
|
Binary file
|
package/bin/linux-x64/cua-driver
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,iCAAiC,CAAC;AAEtF,OAAO,EAAE,KAAK,iBAAiB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIxF,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,iCAAiC,CAAC;AAEtF,OAAO,EAAE,KAAK,iBAAiB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIxF,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC;AAsY7C,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA6MnE"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,37 @@ import { CuaDriverClient } from './mcp-client.js';
|
|
|
4
4
|
import { createPiVisionCaller } from './vision.js';
|
|
5
5
|
export { loadConfigFromFile, resolveConfig };
|
|
6
6
|
const TOOL_PREFIX = 'computer_use_';
|
|
7
|
+
const PLATFORM = process.platform;
|
|
8
|
+
function permissionHint() {
|
|
9
|
+
switch (PLATFORM) {
|
|
10
|
+
case 'darwin':
|
|
11
|
+
return 'Check that Accessibility and Screen Recording permissions are granted in System Settings → Privacy & Security.';
|
|
12
|
+
case 'win32':
|
|
13
|
+
return 'Try running the application as Administrator, or check that UI Automation access is not blocked by security software.';
|
|
14
|
+
default:
|
|
15
|
+
return 'Check that the process has access to the display server (X11/Wayland) and required input permissions are configured.';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function accessibilityHint() {
|
|
19
|
+
switch (PLATFORM) {
|
|
20
|
+
case 'darwin':
|
|
21
|
+
return 'Accessibility permission not granted. The user needs to enable it in System Settings → Privacy & Security → Accessibility, then restart the app.';
|
|
22
|
+
case 'win32':
|
|
23
|
+
return 'UI Automation access denied. Try running the application as Administrator.';
|
|
24
|
+
default:
|
|
25
|
+
return 'Input automation access denied. Check that AT-SPI or equivalent accessibility service is available.';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function screenRecordingHint() {
|
|
29
|
+
switch (PLATFORM) {
|
|
30
|
+
case 'darwin':
|
|
31
|
+
return 'Screen Recording permission not granted. The user needs to enable it in System Settings → Privacy & Security → Screen & System Audio Recording, then restart the app.';
|
|
32
|
+
case 'win32':
|
|
33
|
+
return 'Screen capture failed. Try running the application as Administrator, or check that screen capture is not blocked by DRM or security policy.';
|
|
34
|
+
default:
|
|
35
|
+
return 'Screen capture failed. Check that the compositor allows screen capture (PipeWire portal or X11 access).';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
7
38
|
const EXCLUDED_TOOLS = new Set([
|
|
8
39
|
'set_agent_cursor_enabled',
|
|
9
40
|
'set_agent_cursor_motion',
|
|
@@ -20,7 +51,336 @@ const EXCLUDED_TOOLS = new Set([
|
|
|
20
51
|
'type_text_chars',
|
|
21
52
|
'page',
|
|
22
53
|
'browser_eval',
|
|
54
|
+
'screenshot',
|
|
23
55
|
]);
|
|
56
|
+
const FALLBACK_TOOLS = [
|
|
57
|
+
{
|
|
58
|
+
name: 'click',
|
|
59
|
+
description: 'Left-click against a target pid via element_index or x/y coordinates',
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
additionalProperties: false,
|
|
63
|
+
properties: {
|
|
64
|
+
pid: { type: 'integer', description: 'Target process ID' },
|
|
65
|
+
x: { type: 'number', description: 'Window-local screenshot X coordinate' },
|
|
66
|
+
y: { type: 'number', description: 'Window-local screenshot Y coordinate' },
|
|
67
|
+
element_index: { type: 'integer', description: 'Element index from last get_window_state' },
|
|
68
|
+
window_id: { type: 'integer', description: 'Target window ID. Required for element_index' },
|
|
69
|
+
action: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
description: 'AX action: press, show_menu, pick, confirm, cancel, open',
|
|
72
|
+
},
|
|
73
|
+
modifier: {
|
|
74
|
+
type: 'array',
|
|
75
|
+
items: { type: 'string' },
|
|
76
|
+
description: 'Modifier keys: cmd, shift, option/alt, ctrl',
|
|
77
|
+
},
|
|
78
|
+
from_zoom: {
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
description: 'When true, x/y are in last zoom image coordinates',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
required: ['pid'],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'double_click',
|
|
88
|
+
description: 'Double-click at x/y or on an AX element via element_index',
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
additionalProperties: false,
|
|
92
|
+
properties: {
|
|
93
|
+
pid: { type: 'integer' },
|
|
94
|
+
x: { type: 'number', description: 'Screen X coordinate (pixel path)' },
|
|
95
|
+
y: { type: 'number', description: 'Screen Y coordinate (pixel path)' },
|
|
96
|
+
element_index: { type: 'integer', description: 'Element index from last get_window_state' },
|
|
97
|
+
window_id: {
|
|
98
|
+
type: 'integer',
|
|
99
|
+
description: 'CGWindowID. Required when element_index is used',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
required: ['pid'],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'right_click',
|
|
107
|
+
description: 'Right-click against a target pid via element_index or x/y coordinates',
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: 'object',
|
|
110
|
+
additionalProperties: false,
|
|
111
|
+
properties: {
|
|
112
|
+
pid: { type: 'integer', description: 'Target process ID' },
|
|
113
|
+
x: { type: 'number', description: 'X in window-local screenshot pixels' },
|
|
114
|
+
y: { type: 'number', description: 'Y in window-local screenshot pixels' },
|
|
115
|
+
element_index: {
|
|
116
|
+
type: 'integer',
|
|
117
|
+
description: 'Element index from last get_window_state. Routes through AXShowMenu',
|
|
118
|
+
},
|
|
119
|
+
window_id: {
|
|
120
|
+
type: 'integer',
|
|
121
|
+
description: 'CGWindowID. Required when element_index is used',
|
|
122
|
+
},
|
|
123
|
+
modifier: {
|
|
124
|
+
type: 'array',
|
|
125
|
+
items: { type: 'string' },
|
|
126
|
+
description: 'Modifier keys held during the right-click (pixel path only)',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
required: ['pid'],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'type_text',
|
|
134
|
+
description: 'Insert text into the target pid via AX or CGEvent fallback',
|
|
135
|
+
inputSchema: {
|
|
136
|
+
type: 'object',
|
|
137
|
+
additionalProperties: false,
|
|
138
|
+
properties: {
|
|
139
|
+
pid: { type: 'integer', description: 'Target process ID' },
|
|
140
|
+
text: { type: 'string', description: 'Text to insert at the target cursor' },
|
|
141
|
+
element_index: { type: 'integer', description: 'Element index from last get_window_state' },
|
|
142
|
+
window_id: {
|
|
143
|
+
type: 'integer',
|
|
144
|
+
description: 'CGWindowID. Required when element_index is used',
|
|
145
|
+
},
|
|
146
|
+
delay_ms: {
|
|
147
|
+
type: 'integer',
|
|
148
|
+
minimum: 0,
|
|
149
|
+
maximum: 200,
|
|
150
|
+
description: 'Milliseconds between characters in CGEvent fallback. Default 30',
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
required: ['pid', 'text'],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'press_key',
|
|
158
|
+
description: 'Press and release a single key, delivered to the target pid',
|
|
159
|
+
inputSchema: {
|
|
160
|
+
type: 'object',
|
|
161
|
+
additionalProperties: false,
|
|
162
|
+
properties: {
|
|
163
|
+
pid: { type: 'integer' },
|
|
164
|
+
key: {
|
|
165
|
+
type: 'string',
|
|
166
|
+
description: 'Key name: return, tab, escape, up, down, left, right, space, delete, etc.',
|
|
167
|
+
},
|
|
168
|
+
modifiers: {
|
|
169
|
+
type: 'array',
|
|
170
|
+
items: { type: 'string' },
|
|
171
|
+
description: 'Modifier keys: cmd, shift, option/alt, ctrl, fn',
|
|
172
|
+
},
|
|
173
|
+
element_index: { type: 'integer' },
|
|
174
|
+
window_id: { type: 'integer' },
|
|
175
|
+
},
|
|
176
|
+
required: ['pid', 'key'],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'hotkey',
|
|
181
|
+
description: 'Press a combination of keys simultaneously, e.g. ["cmd", "c"] for Copy',
|
|
182
|
+
inputSchema: {
|
|
183
|
+
type: 'object',
|
|
184
|
+
additionalProperties: false,
|
|
185
|
+
properties: {
|
|
186
|
+
pid: { type: 'integer', description: 'Target process ID' },
|
|
187
|
+
keys: {
|
|
188
|
+
type: 'array',
|
|
189
|
+
items: { type: 'string' },
|
|
190
|
+
minItems: 2,
|
|
191
|
+
description: 'Modifier(s) and one non-modifier key, e.g. ["cmd", "c"]',
|
|
192
|
+
},
|
|
193
|
+
window_id: {
|
|
194
|
+
type: 'integer',
|
|
195
|
+
description: 'When set, uses NSMenu path for native menu key dispatch',
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
required: ['pid', 'keys'],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: 'scroll',
|
|
203
|
+
description: 'Scroll the target pid focused region by synthesized keystrokes',
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: 'object',
|
|
206
|
+
additionalProperties: false,
|
|
207
|
+
properties: {
|
|
208
|
+
pid: { type: 'integer' },
|
|
209
|
+
direction: {
|
|
210
|
+
type: 'string',
|
|
211
|
+
enum: ['up', 'down', 'left', 'right'],
|
|
212
|
+
description: 'Scroll direction',
|
|
213
|
+
},
|
|
214
|
+
amount: {
|
|
215
|
+
type: 'integer',
|
|
216
|
+
minimum: 1,
|
|
217
|
+
maximum: 50,
|
|
218
|
+
description: 'Number of keystroke repetitions. Default: 3',
|
|
219
|
+
},
|
|
220
|
+
by: {
|
|
221
|
+
type: 'string',
|
|
222
|
+
enum: ['line', 'page'],
|
|
223
|
+
description: 'Scroll granularity. Default: line',
|
|
224
|
+
},
|
|
225
|
+
element_index: { type: 'integer' },
|
|
226
|
+
window_id: { type: 'integer' },
|
|
227
|
+
},
|
|
228
|
+
required: ['pid', 'direction'],
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: 'drag',
|
|
233
|
+
description: 'Press-drag-release gesture from one point to another in window-local pixels',
|
|
234
|
+
inputSchema: {
|
|
235
|
+
type: 'object',
|
|
236
|
+
additionalProperties: false,
|
|
237
|
+
properties: {
|
|
238
|
+
pid: { type: 'integer', description: 'Target process ID' },
|
|
239
|
+
from_x: { type: 'number', description: 'Drag-start X in window-local screenshot pixels' },
|
|
240
|
+
from_y: { type: 'number', description: 'Drag-start Y in window-local screenshot pixels' },
|
|
241
|
+
to_x: { type: 'number', description: 'Drag-end X in window-local screenshot pixels' },
|
|
242
|
+
to_y: { type: 'number', description: 'Drag-end Y in window-local screenshot pixels' },
|
|
243
|
+
button: {
|
|
244
|
+
type: 'string',
|
|
245
|
+
enum: ['left', 'right', 'middle'],
|
|
246
|
+
description: 'Mouse button. Default: left',
|
|
247
|
+
},
|
|
248
|
+
duration_ms: {
|
|
249
|
+
type: 'integer',
|
|
250
|
+
minimum: 0,
|
|
251
|
+
maximum: 10000,
|
|
252
|
+
description: 'Duration of drag path. Default: 500',
|
|
253
|
+
},
|
|
254
|
+
steps: {
|
|
255
|
+
type: 'integer',
|
|
256
|
+
minimum: 1,
|
|
257
|
+
maximum: 200,
|
|
258
|
+
description: 'Intermediate drag events. Default: 20',
|
|
259
|
+
},
|
|
260
|
+
modifier: {
|
|
261
|
+
type: 'array',
|
|
262
|
+
items: { type: 'string' },
|
|
263
|
+
description: 'Modifier keys held across the gesture',
|
|
264
|
+
},
|
|
265
|
+
window_id: { type: 'integer' },
|
|
266
|
+
from_zoom: { type: 'boolean' },
|
|
267
|
+
},
|
|
268
|
+
required: ['pid', 'from_x', 'from_y', 'to_x', 'to_y'],
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'set_value',
|
|
273
|
+
description: 'Set a value on a UI element (popups, sliders, steppers, date pickers)',
|
|
274
|
+
inputSchema: {
|
|
275
|
+
type: 'object',
|
|
276
|
+
additionalProperties: false,
|
|
277
|
+
properties: {
|
|
278
|
+
pid: { type: 'integer' },
|
|
279
|
+
window_id: {
|
|
280
|
+
type: 'integer',
|
|
281
|
+
description: 'CGWindowID for the window whose get_window_state produced the element_index',
|
|
282
|
+
},
|
|
283
|
+
element_index: { type: 'integer' },
|
|
284
|
+
value: {
|
|
285
|
+
type: 'string',
|
|
286
|
+
description: 'New value. AX will coerce to the element native type',
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
required: ['pid', 'window_id', 'element_index', 'value'],
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: 'get_screen_size',
|
|
294
|
+
description: 'Return the logical size of the main display in points plus backing scale factor',
|
|
295
|
+
inputSchema: { type: 'object', additionalProperties: false, properties: {} },
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: 'get_cursor_position',
|
|
299
|
+
description: 'Return the current mouse cursor position in screen points',
|
|
300
|
+
inputSchema: { type: 'object', additionalProperties: false, properties: {} },
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: 'get_accessibility_tree',
|
|
304
|
+
description: 'Return a lightweight desktop snapshot: running apps and visible windows with bounds and z-order',
|
|
305
|
+
inputSchema: { type: 'object', additionalProperties: false, properties: {} },
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: 'get_window_state',
|
|
309
|
+
description: 'Walk an app AX tree and return a Markdown rendering of its UI with actionable element indices',
|
|
310
|
+
inputSchema: {
|
|
311
|
+
type: 'object',
|
|
312
|
+
additionalProperties: false,
|
|
313
|
+
properties: {
|
|
314
|
+
pid: { type: 'integer', description: 'Target process ID' },
|
|
315
|
+
window_id: { type: 'integer', description: 'Target window ID from list_windows' },
|
|
316
|
+
query: { type: 'string', description: 'Case-insensitive filter for tree_markdown' },
|
|
317
|
+
capture_mode: {
|
|
318
|
+
type: 'string',
|
|
319
|
+
enum: ['som', 'vision', 'ax'],
|
|
320
|
+
description: 'som=AX+screenshot (default), vision=screenshot only, ax=AX only',
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
required: ['pid', 'window_id'],
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: 'list_windows',
|
|
328
|
+
description: 'List all layer-0 top-level windows known to WindowServer',
|
|
329
|
+
inputSchema: {
|
|
330
|
+
type: 'object',
|
|
331
|
+
additionalProperties: false,
|
|
332
|
+
properties: {
|
|
333
|
+
pid: { type: 'integer', description: 'Optional pid filter' },
|
|
334
|
+
on_screen_only: {
|
|
335
|
+
type: 'boolean',
|
|
336
|
+
description: 'When true, drop windows not on current Space. Default false',
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: 'list_apps',
|
|
343
|
+
description: 'List macOS apps (running and installed) with state flags, pid, bundle_id',
|
|
344
|
+
inputSchema: { type: 'object', additionalProperties: false, properties: {} },
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: 'launch_app',
|
|
348
|
+
description: 'Launch a macOS app in the background without stealing focus',
|
|
349
|
+
inputSchema: {
|
|
350
|
+
type: 'object',
|
|
351
|
+
additionalProperties: false,
|
|
352
|
+
properties: {
|
|
353
|
+
bundle_id: {
|
|
354
|
+
type: 'string',
|
|
355
|
+
description: 'App bundle identifier, e.g. com.apple.calculator. Preferred over name',
|
|
356
|
+
},
|
|
357
|
+
name: {
|
|
358
|
+
type: 'string',
|
|
359
|
+
description: 'App display name. Used only when bundle_id is absent',
|
|
360
|
+
},
|
|
361
|
+
urls: {
|
|
362
|
+
type: 'array',
|
|
363
|
+
items: { type: 'string' },
|
|
364
|
+
description: 'File paths or URLs to open with the app',
|
|
365
|
+
},
|
|
366
|
+
creates_new_application_instance: {
|
|
367
|
+
type: 'boolean',
|
|
368
|
+
description: 'Force a new app instance even if already running',
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: 'kill_app',
|
|
375
|
+
description: 'Force-terminate a process by pid (kill -9 equivalent)',
|
|
376
|
+
inputSchema: {
|
|
377
|
+
type: 'object',
|
|
378
|
+
additionalProperties: false,
|
|
379
|
+
properties: { pid: { type: 'integer', description: 'PID of the process to terminate' } },
|
|
380
|
+
required: ['pid'],
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
];
|
|
24
384
|
export default function computerUseExtension(pi) {
|
|
25
385
|
let config;
|
|
26
386
|
let client;
|
|
@@ -33,10 +393,8 @@ export default function computerUseExtension(pi) {
|
|
|
33
393
|
connected = true;
|
|
34
394
|
}
|
|
35
395
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const upstreamTools = await client.listAllTools();
|
|
39
|
-
for (const tool of upstreamTools) {
|
|
396
|
+
function registerTools(tools) {
|
|
397
|
+
for (const tool of tools) {
|
|
40
398
|
if (EXCLUDED_TOOLS.has(tool.name))
|
|
41
399
|
continue;
|
|
42
400
|
const prefixedName = `${TOOL_PREFIX}${tool.name}`;
|
|
@@ -47,7 +405,23 @@ export default function computerUseExtension(pi) {
|
|
|
47
405
|
description: tool.description ?? '',
|
|
48
406
|
parameters: Type.Unsafe(tool.inputSchema),
|
|
49
407
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
50
|
-
|
|
408
|
+
try {
|
|
409
|
+
await ensureConnected();
|
|
410
|
+
}
|
|
411
|
+
catch (connErr) {
|
|
412
|
+
const msg = connErr instanceof Error ? connErr.message : String(connErr);
|
|
413
|
+
ctx.ui.notify(`pi-computer-use: cannot connect to cua-driver — ${msg}`, 'warning');
|
|
414
|
+
return {
|
|
415
|
+
content: [
|
|
416
|
+
{
|
|
417
|
+
type: 'text',
|
|
418
|
+
text: `Failed to connect to cua-driver: ${msg}. ${permissionHint()}`,
|
|
419
|
+
},
|
|
420
|
+
],
|
|
421
|
+
details: undefined,
|
|
422
|
+
isError: true,
|
|
423
|
+
};
|
|
424
|
+
}
|
|
51
425
|
const result = await client.callTool(originalName, params);
|
|
52
426
|
if (result.isError) {
|
|
53
427
|
const errorText = result.content?.map((c) => c.text ?? '').join('') ?? '';
|
|
@@ -60,17 +434,6 @@ export default function computerUseExtension(pi) {
|
|
|
60
434
|
};
|
|
61
435
|
}
|
|
62
436
|
}
|
|
63
|
-
if (originalName === 'screenshot' && config?.visionModel) {
|
|
64
|
-
const imageContent = result.content?.find((c) => c.type === 'image' && c.data);
|
|
65
|
-
if (imageContent?.data) {
|
|
66
|
-
const callVision = createPiVisionCaller(config.visionModel, ctx);
|
|
67
|
-
const analysis = await callVision('Describe the full screen: identify all visible windows, UI elements, buttons, text fields, and their positions.', imageContent.data, imageContent.mimeType ?? 'image/png');
|
|
68
|
-
return {
|
|
69
|
-
content: [{ type: 'text', text: analysis }],
|
|
70
|
-
details: undefined,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
437
|
const content = [];
|
|
75
438
|
if (result.content) {
|
|
76
439
|
for (const item of result.content) {
|
|
@@ -89,7 +452,7 @@ export default function computerUseExtension(pi) {
|
|
|
89
452
|
});
|
|
90
453
|
}
|
|
91
454
|
}
|
|
92
|
-
|
|
455
|
+
function registerVisionTool() {
|
|
93
456
|
if (!config?.visionModel)
|
|
94
457
|
return;
|
|
95
458
|
const visionConfig = config.visionModel;
|
|
@@ -103,7 +466,23 @@ export default function computerUseExtension(pi) {
|
|
|
103
466
|
})),
|
|
104
467
|
}),
|
|
105
468
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
106
|
-
|
|
469
|
+
try {
|
|
470
|
+
await ensureConnected();
|
|
471
|
+
}
|
|
472
|
+
catch (connErr) {
|
|
473
|
+
const msg = connErr instanceof Error ? connErr.message : String(connErr);
|
|
474
|
+
ctx.ui.notify(`pi-computer-use: cannot connect to cua-driver — ${msg}`, 'warning');
|
|
475
|
+
return {
|
|
476
|
+
content: [
|
|
477
|
+
{
|
|
478
|
+
type: 'text',
|
|
479
|
+
text: `Failed to connect to cua-driver: ${msg}. ${permissionHint()}`,
|
|
480
|
+
},
|
|
481
|
+
],
|
|
482
|
+
details: undefined,
|
|
483
|
+
isError: true,
|
|
484
|
+
};
|
|
485
|
+
}
|
|
107
486
|
const screenshotResult = await client.callTool('screenshot', {});
|
|
108
487
|
const imageContent = screenshotResult.content?.find((c) => c.type === 'image' && c.data);
|
|
109
488
|
if (!imageContent?.data) {
|
|
@@ -128,29 +507,34 @@ export default function computerUseExtension(pi) {
|
|
|
128
507
|
config = resolveConfig(loadConfigFromFile({ cwd: ctx.cwd }));
|
|
129
508
|
client = new CuaDriverClient(config);
|
|
130
509
|
connected = false;
|
|
510
|
+
let upstreamTools;
|
|
131
511
|
try {
|
|
132
|
-
await
|
|
133
|
-
|
|
512
|
+
await client.connect();
|
|
513
|
+
connected = true;
|
|
514
|
+
upstreamTools = await client.listAllTools();
|
|
134
515
|
}
|
|
135
516
|
catch (err) {
|
|
136
517
|
const msg = err instanceof Error ? err.message : String(err);
|
|
137
|
-
ctx.ui.notify(`pi-computer-use: failed to
|
|
138
|
-
return;
|
|
518
|
+
ctx.ui.notify(`pi-computer-use: cua-driver failed to start — ${msg}. Tools registered but may fail until permissions are granted.`, 'warning');
|
|
139
519
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
520
|
+
registerTools(upstreamTools ?? FALLBACK_TOOLS);
|
|
521
|
+
registerVisionTool();
|
|
522
|
+
if (connected) {
|
|
523
|
+
try {
|
|
524
|
+
const permResult = await client.callTool('check_permissions', {});
|
|
525
|
+
const structured = permResult.structuredContent;
|
|
526
|
+
if (structured) {
|
|
527
|
+
if (!structured.accessibility) {
|
|
528
|
+
ctx.ui.notify(`pi-computer-use: ${accessibilityHint()}`, 'warning');
|
|
529
|
+
}
|
|
530
|
+
if (!structured.screen_recording) {
|
|
531
|
+
ctx.ui.notify(`pi-computer-use: ${screenRecordingHint()}`, 'warning');
|
|
532
|
+
}
|
|
149
533
|
}
|
|
150
534
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
535
|
+
catch {
|
|
536
|
+
// permission check is best-effort
|
|
537
|
+
}
|
|
154
538
|
}
|
|
155
539
|
});
|
|
156
540
|
pi.on('session_shutdown', async () => {
|
|
@@ -162,10 +546,10 @@ export default function computerUseExtension(pi) {
|
|
|
162
546
|
}
|
|
163
547
|
function formatToolError(toolName, errorText, params) {
|
|
164
548
|
if (errorText.includes('ax_not_granted')) {
|
|
165
|
-
return
|
|
549
|
+
return accessibilityHint();
|
|
166
550
|
}
|
|
167
551
|
if (errorText.includes('sc_not_granted')) {
|
|
168
|
-
return
|
|
552
|
+
return screenRecordingHint();
|
|
169
553
|
}
|
|
170
554
|
if (toolName === 'screenshot' || errorText.includes('screencapture failed')) {
|
|
171
555
|
const windowId = params.window_id;
|
|
@@ -173,7 +557,7 @@ function formatToolError(toolName, errorText, params) {
|
|
|
173
557
|
if (errorText.includes('screencapture failed')) {
|
|
174
558
|
return [
|
|
175
559
|
`Screenshot failed for window ${windowId}. Possible causes:`,
|
|
176
|
-
|
|
560
|
+
`1. ${screenRecordingHint()}`,
|
|
177
561
|
'2. The window_id is stale — the window may have been closed or recreated (e.g. after navigation in Electron apps). Re-fetch window list to get current IDs.',
|
|
178
562
|
'3. The window is minimized or not yet rendered.',
|
|
179
563
|
`Try capturing without window_id (full screen) as a fallback, or verify the window still exists.`,
|
|
@@ -185,7 +569,7 @@ function formatToolError(toolName, errorText, params) {
|
|
|
185
569
|
}
|
|
186
570
|
else {
|
|
187
571
|
if (errorText.includes('screencapture failed')) {
|
|
188
|
-
return
|
|
572
|
+
return `Screenshot failed for the main display. ${screenRecordingHint()}`;
|
|
189
573
|
}
|
|
190
574
|
}
|
|
191
575
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAA0B,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC;AAE7C,MAAM,WAAW,GAAG,eAAe,CAAC;AAEpC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,0BAA0B;IAC1B,yBAAyB;IACzB,wBAAwB;IACxB,wBAAwB;IACxB,eAAe;IACf,q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,eAAe,CACtB,QAAgB,EAChB,SAAiB,EACjB,MAA+B;IAE/B,IAAI,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzC,OAAO,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzC,OAAO,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IAED,IAAI,QAAQ,KAAK,YAAY,IAAI,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;QAC5E,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAI,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;gBAC/C,OAAO;oBACL,gCAAgC,QAAQ,oBAAoB;oBAC5D,MAAM,mBAAmB,EAAE,EAAE;oBAC7B,6JAA6J;oBAC7J,iDAAiD;oBACjD,iGAAiG;iBAClG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACf,CAAC;YACD,IAAI,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;gBACvC,OAAO,iDAAiD,QAAQ,kGAAkG,CAAC;YACrK,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;gBAC/C,OAAO,2CAA2C,mBAAmB,EAAE,EAAE,CAAC;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amaster.ai/pi-computer-use",
|
|
3
|
-
"version": "0.1.2-beta.
|
|
3
|
+
"version": "0.1.2-beta.6",
|
|
4
4
|
"description": "Pi extension for desktop automation via cua-driver-rs with computer_use_ prefixed tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
49
|
-
"@amaster.ai/pi-shared": "0.1.2-beta.
|
|
49
|
+
"@amaster.ai/pi-shared": "0.1.2-beta.6"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@earendil-works/pi-ai": ">=0.74.0",
|