@agent-sh/computer-use-linux 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,7 +48,7 @@ MCP tools exposed by the server:
48
48
  - `list_apps` — running desktop apps visible to the AT-SPI registry
49
49
  - `list_windows` — compositor windows with title, app id, wm_class, focus state, client type (Wayland/X11), and bounds
50
50
  - `focused_window` — the window currently holding keyboard focus
51
- - `get_app_state` — combined screenshot + accessibility tree for a chosen app, with element indices that the input tools accept
51
+ - `get_app_state` — combined screenshot + accessibility tree for a chosen app, with element indices that the input tools accept. Scope it with `app_name_or_bundle_identifier` or a window target; an unscoped call returns the whole desktop tree, reports `tree_scoped: false`, and warns
52
52
  - `screenshot` — capture the screen as a bounded PNG or JPEG image; can target a window, which is raised to the front and cropped to just that window
53
53
 
54
54
  Screenshot payloads are size-bounded by default before they are returned to the MCP host: max 1920 px width/height and 2 MiB image bytes, with hard caps even when callers request more. Agents that need more detail can pass `max_width`, `max_height`, `max_bytes`, `scale`, `format: "jpeg"`, or `quality`, preferably with a window target or crop. PNG remains the default; JPEG lets callers trade lossless pixels for a smaller payload before the byte cap forces further resizing. Returned screenshot metadata includes `coordinate_width`, `coordinate_height`, `scale`, `format`, and `quality` so callers can convert from a downscaled preview to desktop coordinate pixels.
@@ -78,7 +78,7 @@ and measure from its clipped screenshot crop origin. Divide preview `x` and
78
78
  GDK surface or widget-local coordinates; decorations and clipping can change
79
79
  the origin. A missing window target is rejected.
80
80
 
81
- Targeted `press_key`/`type_text` results append focused-element feedback from AT-SPI (role, name, editable) and warn when no editable element holds focus. Click/screenshot/input results warn when the target window or coordinate is partially or fully off-screen. `get_app_state` returns a compact readiness block by default; pass `verbose: true` for the full diagnostics report.
81
+ Targeted `press_key`/`type_text` results append focused-element feedback from AT-SPI (role, name, editable) and warn when no editable element holds focus. Click/screenshot/input results warn when the target window or coordinate is partially or fully off-screen. `get_app_state` returns a compact readiness block by default; pass `verbose: true` for the full diagnostics report. It also reports `tree_scoped` (false when no app target narrowed the AT-SPI tree, with a warning in `message`) and `accessibility_tree_truncated` (true when the node, depth, or read budget stopped traversal with unread elements left).
82
82
 
83
83
  **Semantic actions**
84
84
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-sh/computer-use-linux",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Linux desktop-control MCP server: AT-SPI accessibility trees, Wayland/X11 input, screenshots, and compositor window targeting.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -7,9 +7,9 @@ export interface GeneratedMcpToolDefinition {
7
7
  annotations: Record<string, unknown>;
8
8
  }
9
9
 
10
- export const GENERATED_SERVER_VERSION = "0.6.0";
11
- export const GENERATED_TOOL_CATALOG_HASH = "9107297df765ce3b907540db172cc7823b7664586255db1064a40a44483d6fd6";
12
- export const GENERATED_SHELL_TOOL_CATALOG_HASH = "e0bc41db617ea6d10d812cbddce6ef78036e44251360f5fac9c207dd0d5ce392";
10
+ export const GENERATED_SERVER_VERSION = "0.7.0";
11
+ export const GENERATED_TOOL_CATALOG_HASH = "c0c1e9d0e200637ff286baec47b6ee8a6798c7e17f29a9cb71a62a8c292a47ed";
12
+ export const GENERATED_SHELL_TOOL_CATALOG_HASH = "f2ebf4164a8a92893933b674bf761430251dce068d7944ce363c99eb88d316ff";
13
13
  export const GENERATED_MCP_TOOLS =
14
14
  [
15
15
  {
@@ -298,7 +298,7 @@ export const GENERATED_MCP_TOOLS =
298
298
  "openWorldHint": true,
299
299
  "readOnlyHint": true
300
300
  },
301
- "description": "Start an app use session if needed, then get a size-bounded screenshot and accessibility state for a Linux app. Screenshot results include coordinate_width, coordinate_height, scale, format, and quality when the returned image is downscaled or compressed; callers can request jpeg/quality for compression before resizing.",
301
+ "description": "Start an app use session if needed, then get a size-bounded screenshot and accessibility state for a Linux app. Scope the accessibility tree with app_name_or_bundle_identifier or a window_id/pid/app_id/wm_class/title target; omitting a target returns the whole desktop tree and can flood context. Screenshot results include coordinate_width, coordinate_height, scale, format, and quality when the returned image is downscaled or compressed; callers can request jpeg/quality for compression before resizing.",
302
302
  "inputSchema": {
303
303
  "$defs": {
304
304
  "ScreenshotOutputFormat": {
@@ -313,6 +313,7 @@ export const GENERATED_MCP_TOOLS =
313
313
  "properties": {
314
314
  "app_id": {
315
315
  "default": null,
316
+ "description": "Application id. Also scopes the accessibility tree when it matches an\nAT-SPI root.",
316
317
  "type": [
317
318
  "string",
318
319
  "null"
@@ -320,6 +321,7 @@ export const GENERATED_MCP_TOOLS =
320
321
  },
321
322
  "app_name_or_bundle_identifier": {
322
323
  "default": null,
324
+ "description": "App name or AT-SPI id that limits the accessibility tree. Omit only when\nyou need the whole desktop tree; unscoped results can flood context.",
323
325
  "type": [
324
326
  "string",
325
327
  "null"
@@ -339,6 +341,7 @@ export const GENERATED_MCP_TOOLS =
339
341
  },
340
342
  "include_screenshot": {
341
343
  "default": null,
344
+ "description": "Include a size-bounded screenshot (default true). Set false when the\naccessibility tree is enough.",
342
345
  "type": [
343
346
  "boolean",
344
347
  "null"
@@ -391,6 +394,7 @@ export const GENERATED_MCP_TOOLS =
391
394
  },
392
395
  "pid": {
393
396
  "default": null,
397
+ "description": "Process id. Also scopes the accessibility tree to that process when it\nexposes AT-SPI.",
394
398
  "minimum": 0,
395
399
  "type": [
396
400
  "integer",
@@ -418,6 +422,7 @@ export const GENERATED_MCP_TOOLS =
418
422
  },
419
423
  "terminal_command": {
420
424
  "default": null,
425
+ "description": "Terminal command substring. Resolves a window target and scopes the tree\nwhen possible.",
421
426
  "type": [
422
427
  "string",
423
428
  "null"
@@ -425,6 +430,7 @@ export const GENERATED_MCP_TOOLS =
425
430
  },
426
431
  "terminal_cwd": {
427
432
  "default": null,
433
+ "description": "Terminal working directory. Resolves a window target and scopes the tree\nwhen possible.",
428
434
  "type": [
429
435
  "string",
430
436
  "null"
@@ -432,6 +438,7 @@ export const GENERATED_MCP_TOOLS =
432
438
  },
433
439
  "terminal_pid": {
434
440
  "default": null,
441
+ "description": "Terminal emulator pid. Resolves a window target and scopes the tree when\npossible.",
435
442
  "minimum": 0,
436
443
  "type": [
437
444
  "integer",
@@ -440,6 +447,7 @@ export const GENERATED_MCP_TOOLS =
440
447
  },
441
448
  "title": {
442
449
  "default": null,
450
+ "description": "Window title substring. Also scopes the accessibility tree when it\nmatches an AT-SPI root.",
443
451
  "type": [
444
452
  "string",
445
453
  "null"
@@ -447,6 +455,7 @@ export const GENERATED_MCP_TOOLS =
447
455
  },
448
456
  "tty": {
449
457
  "default": null,
458
+ "description": "Terminal tty device (for example /dev/pts/3). Resolves a window target\nand scopes the tree when possible.",
450
459
  "type": [
451
460
  "string",
452
461
  "null"
@@ -462,6 +471,7 @@ export const GENERATED_MCP_TOOLS =
462
471
  },
463
472
  "window_id": {
464
473
  "default": null,
474
+ "description": "Compositor window id. Also scopes the accessibility tree to that window's\napplication when possible.",
465
475
  "minimum": 0,
466
476
  "type": [
467
477
  "integer",
@@ -470,6 +480,7 @@ export const GENERATED_MCP_TOOLS =
470
480
  },
471
481
  "wm_class": {
472
482
  "default": null,
483
+ "description": "Window manager class. Also scopes the accessibility tree when it matches\nan AT-SPI root.",
473
484
  "type": [
474
485
  "string",
475
486
  "null"
@@ -24,13 +24,23 @@ Do not use this for remote browsers, websites, or headless automation when a bro
24
24
 
25
25
  ## Install
26
26
 
27
- Pi users need only the package:
27
+ Pick the install that matches how you will run this skill. You can use both.
28
+
29
+ ### Pi native tools
28
30
 
29
31
  ```bash
30
32
  pi install npm:@agent-sh/computer-use-linux
31
33
  ```
32
34
 
33
- Preferred install:
35
+ This enables Pi's `computer_use_linux_*` tools. It does not put
36
+ `computer-use-linux` on `PATH`. Shell commands in this skill (`doctor`,
37
+ `setup`, `setup-window-targeting`, `guard-accessibility`, the MCP `command`
38
+ config, and Verification) need the CLI install below.
39
+
40
+ ### Shell CLI / MCP server
41
+
42
+ Use this when you need `computer-use-linux` on `PATH` for the commands in this
43
+ skill.
34
44
 
35
45
  ```bash
36
46
  npm install -g @agent-sh/computer-use-linux
@@ -93,6 +103,7 @@ The `computer-use-linux` binary is an MCP server. Configure it as a stdio MCP se
93
103
  ```
94
104
 
95
105
  If the binary is not on `PATH`, use the absolute path (typically `~/.local/bin/computer-use-linux` or the npm global bin directory).
106
+ Pi native tools skip this MCP `command` config; see [Pi setup](references/pi-setup.md).
96
107
 
97
108
  ### Host-specific guides
98
109
 
@@ -102,7 +113,7 @@ If the binary is not on `PATH`, use the absolute path (typically `~/.local/bin/c
102
113
  ## Procedure
103
114
 
104
115
  1. In Pi, call `computer_use_linux_tools` with the exact tools or capability you need. Enabled tools use the `computer_use_linux_<name>` prefix, appear starting on the next model turn, and remain active for the session.
105
- 2. Begin every desktop-control turn with `get_app_state`; use `include_screenshot: false` when the accessibility tree is sufficient. Its compact readiness block identifies missing setup.
116
+ 2. Begin every desktop-control turn with `get_app_state`, scoped to the app you are working in: pass `app_name_or_bundle_identifier` or a window target (`window_id`, `pid`, `app_id`, `wm_class`, `title`). Without a target the result is the whole desktop AT-SPI tree, `tree_scoped` is `false`, and `message` warns; that can flood context. Use `include_screenshot: false` when the accessibility tree is sufficient. If `accessibility_tree_truncated` is `true`, the tree is incomplete: scope to a narrower target and raise `max_nodes` or `max_depth` (hard caps 2000 and 64) rather than lowering them. The compact readiness block identifies missing setup.
106
117
  3. Use `doctor` only when you need the full diagnostic report.
107
118
  4. If `can_build_accessibility_tree` is false, run `setup_accessibility` and restart the target app.
108
119
  5. If `can_query_windows` is false on GNOME Wayland, run `setup_window_targeting` and ask the user to log out and back in if setup says the shell extension needs a reload.
@@ -145,6 +156,10 @@ directly to a window-relative click.
145
156
 
146
157
  ## Verification
147
158
 
159
+ Pi-only installs: enable and call `computer_use_linux_doctor` as in
160
+ [Pi setup](references/pi-setup.md). Shell `computer-use-linux doctor` needs
161
+ the CLI on `PATH`.
162
+
148
163
  Run:
149
164
 
150
165
  ```bash
@@ -14,7 +14,10 @@ pi install npm:@agent-sh/computer-use-linux
14
14
  ```
15
15
 
16
16
  Restart Pi or run `/reload`. No separate MCP adapter or MCP configuration is
17
- required.
17
+ required. This does not put `computer-use-linux` on `PATH`. For shell `doctor`,
18
+ `setup`, or MCP hosts, also install the CLI with
19
+ `npm install -g @agent-sh/computer-use-linux` or
20
+ `cargo install computer-use-linux`.
18
21
 
19
22
  The integration is designed for current Pi releases with additive dynamic tool
20
23
  loading. Update Pi and installed packages when needed:
@@ -59,8 +62,11 @@ session so `get_app_state` element indices and portal sessions remain valid.
59
62
  ## Safe operating loop
60
63
 
61
64
  1. Enable `get_app_state`, `list_windows`, and any likely action tools.
62
- 2. Call `computer_use_linux_get_app_state`, using
63
- `include_screenshot: false` when accessibility data is enough.
65
+ 2. Call `computer_use_linux_get_app_state` scoped to the target app
66
+ (`app_name_or_bundle_identifier`, or `window_id`/`pid`/`app_id`/`wm_class`/
67
+ `title`), using `include_screenshot: false` when accessibility data is
68
+ enough. An unscoped call returns the whole desktop tree, reports
69
+ `tree_scoped: false`, and warns; that can exhaust a small context window.
64
70
  3. Inspect the returned readiness block; enable/call `doctor` only for full
65
71
  diagnostics.
66
72
  4. Identify the target with `computer_use_linux_list_windows` or