Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `get_app_state` with `interactive_only: true` also keeps the whole compacted tree beside the interactive view, for `get_tree_page` only: actions still resolve against the interactive view exactly as before.
- `get_tree_page` searches the cached snapshot with `query` (case-insensitive text in a node's name, text or description), `role` and `within` (an `element_index` subtree, bounded on the whole tree), and takes `interactive_only` and `tree_detail`. Measured over an eBay search and listing sequence, tool results fell from about 404 KB (20 calls) to about 41 KB (15 calls).
- Background `click` and `scroll` take `relative: true`: `x` and `y` measured from the target window's screenshot crop are mapped through the window's bounds and the capture scale to capture pixels, and then go through the same checks as any background point (on the target window, not covered). A client that works in window coordinates, such as a desktop bridge sending window-relative clicks, no longer converts them itself ([#480](https://github.com/agent-sh/computer-use-linux/issues/480)). A relative background call without a window target is refused with nothing sent. Elements and `coordinate_space: "atspi"` still have no background route.
- `run_batch` runs 1 to 100 desktop tool calls in order in one call. It cannot reach `run_shell`, `js` or itself.
- `js` and `js_reset`: a persistent Node.js REPL with a `desktop` API for multi-step scripts, opt-in on stdio with `COMPUTER_USE_LINUX_ENABLE_REPL=1` (or `COMPUTER_USE_LINUX_REPL_ONLY=1` for only these two tools). It is never registered over HTTP. Enabling it lets the model run code as the user, like `COMPUTER_USE_LINUX_ENABLE_SHELL=1`. The worker's empty environment, string code generation block and Node permission flag are defence in depth, not a sandbox. Contributed by [@bvolpato](https://github.com/bvolpato) ([#505](https://github.com/agent-sh/computer-use-linux/pull/505)).

## [0.7.60] - 2026-11-22

Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@ file.

## Releases

A release changes these ten files:
A release changes these nine files:

- `Cargo.toml` and `Cargo.lock`: the package version.
- `package.json`: the npm version.
- `src/server.rs`: the MCP server version.
- `plugins/computer-use-linux/bin/computer-use-linux`: the launcher's pinned version.
- `plugins/computer-use-linux/.claude-plugin/plugin.json` and `plugins/computer-use-linux/.codex-plugin/plugin.json`.
- `.claude-plugin/marketplace.json`.
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ The crate was extracted from [`codex-desktop-linux`](https://github.com/avifenes
| | `type_text` | Literal text entry, optionally targeted at a window or terminal (`tty`, `terminal_pid`, `terminal_command`, `terminal_cwd`), or with `delivery: "background"` to an element, browser tab or terminal without moving keyboard focus. |
| **Semantic actions** | `perform_action` | Invoke any AT-SPI action exposed by an element (`Press`, `Activate`, `Toggle`, `Jump`, …); defaults to the primary action. |
| | `set_value` | Write directly to a settable accessibility element (text fields, sliders, spinners). |
| **Batching** | `run_batch` | Run 1 to 100 desktop tool calls (and `sleep_ms` pauses) in order in one call, passing the latest `snapshot_id` along. It cannot call `run_shell`, `js`, `complete_interaction` or itself. |
| **Window management** | `activate_window` | Focus a window by `window_id`, `pid`, `app_id`, `wm_class`, `title`, or terminal selectors. |
| | `move_window` / `resize_window` | Reposition or resize a window in desktop coordinates (GNOME Shell extension and X11/EWMH backends). |
| **Opt-in host tools** | `complete_interaction` | Parameter-free desktop completion notification (`notify-send`); registered only when `COMPUTER_USE_LINUX_NOTIFY_ON_COMPLETE=1`. |
| | `run_shell` | Bounded non-login `/bin/sh -c` execution; registered only when `COMPUTER_USE_LINUX_ENABLE_SHELL=1` (absent by default). |
| | `js` / `js_reset` | A persistent Node.js REPL with a `desktop` API over the tools above, for multi-step scripts in one call. Registered only on stdio with `COMPUTER_USE_LINUX_ENABLE_REPL=1`, or alone with `COMPUTER_USE_LINUX_REPL_ONLY=1`; never over HTTP. Needs Node.js. |

Every tree result carries a `snapshot_id`: `get_app_state`, an `include_tree` observation, and `get_tree_page`. The server caches one tree, and each new tree replaces it. Pass the `snapshot_id` with an `element_index` (or a selector, except on `scroll`) to `click`, `scroll`, `perform_action` or `set_value`, and to `get_tree_page`: if a later tree replaced that snapshot, the call is refused before any window is raised or input is sent, since the index could name another element by then. A full capture-space `x`/`y` point does not come from the tree, so it is not checked. A `coordinate_space: "atspi"` click maps through its element, so it is checked. Without `snapshot_id`, the element resolves in the latest tree. An `element_identifier` names the AT-SPI object itself and is not checked against a snapshot. Ids differ between server processes, so an id from before a restart is refused.

Expand Down Expand Up @@ -228,14 +230,17 @@ Captures require the shared capture lock and, when an overlay is running, its ac
| Read-only observation | `doctor`, `list_apps`, `list_windows`, `focused_window`, `get_app_state`, `get_tree_page` | `readOnlyHint=true`; may reveal app, window, accessibility, and screenshot contents. `get_app_state` may trigger the desktop screenshot portal prompt. Its `screenshot_file_path` file output creates a new file and never replaces one. |
| Local setup mutators | `setup_accessibility`, `setup_window_targeting` | `readOnlyHint=false`, `destructiveHint=false`, `idempotentHint=true`; modifies user desktop configuration by enabling accessibility or installing/enabling the GNOME window-targeting extension. |
| UI state mutators | `activate_window`, `move_window`, `resize_window`, `scroll`, `screenshot` | `readOnlyHint=false`, `destructiveHint=false`; changes focus, geometry, or scroll position in the live desktop, or raises a window to capture it. `screenshot_file_path` file output creates a new file and never replaces one. |
| Desktop action mutators | `click`, `drag`, `press_key`, `type_text`, `perform_action`, `set_value` | `readOnlyHint=false`, `destructiveHint=true`, `openWorldHint=true`; can trigger arbitrary actions in whatever local application is targeted. |
| Desktop action mutators | `click`, `drag`, `press_key`, `type_text`, `perform_action`, `set_value`, `run_batch` | `readOnlyHint=false`, `destructiveHint=true`, `openWorldHint=true`; can trigger arbitrary actions in whatever local application is targeted. |
| Conditional notification | `complete_interaction` | Absent unless `COMPUTER_USE_LINUX_NOTIFY_ON_COMPLETE=1`; when enabled, `readOnlyHint=false`, `destructiveHint=false`, `idempotentHint=false`, `openWorldHint=true`. Sends a desktop notification. |
| Conditional host-code execution | `run_shell` | Absent unless `COMPUTER_USE_LINUX_ENABLE_SHELL=1`; when enabled, `readOnlyHint=false`, `destructiveHint=true`, `idempotentHint=false`, `openWorldHint=true`. Runs with the MCP server user's host permissions. |
| Conditional host-code execution | `js`, `js_reset` | Absent unless `COMPUTER_USE_LINUX_ENABLE_REPL=1` or `COMPUTER_USE_LINUX_REPL_ONLY=1`, and never registered over HTTP. `js` is `destructiveHint=true`, `openWorldHint=true`; `js_reset` is idempotent. Runs code as the MCP server user. |

Annotations are safety hints, not an authorization system. MCP hosts should still ask the user before calls that could submit, delete, send, purchase, overwrite, or otherwise commit state.

`run_shell` is an explicit trust-boundary opt-in, not a restricted command runner. Enabling it grants an approved MCP call the same file and network authority as the user running the server. The tool clears the ambient environment and inherits only a small desktop/runtime allowlist (`PATH`, home/user/locale fields, display/session-bus fields); additional variables must be supplied in the visible call payload. Commands use a fixed non-login `/bin/sh`, an existing canonical working directory, a 30-second default / 120-second hard timeout, process-group cleanup, and stderr audit records keyed by the command SHA-256 rather than command text. Collected streams up to 8 MiB are returned with a 512 KiB per-stream response cap and truncation flag; exceeding 8 MiB on either stream fails the call without partial output. These controls bound accidental leakage and runaway work; they do not make arbitrary shell code safe.

`js` is host code execution at the same trust level as `run_shell`. Enabling it lets the model run code as the user running the server. The worker starts with an empty environment, refuses code generation from strings, and passes Node's permission flag when the installed Node supports it. These are defence in depth, not a sandbox: Node's `vm` module is not a security mechanism. A cancelled or timed-out call kills the worker, and the next call starts a fresh one.

The binary also exposes the same capabilities from the CLI for scripting and debugging:

```
Expand Down Expand Up @@ -608,6 +613,9 @@ Most setups need none of these: the server and installers detect backends and pa
| `COMPUTER_USE_LINUX_MCP_TOKEN_FILE` | Path of a file holding the `mcp --listen` bearer token, such as a mounted Kubernetes Secret. Surrounding whitespace is trimmed. Setting both this and `COMPUTER_USE_LINUX_MCP_TOKEN` is an error. |
| `COMPUTER_USE_LINUX_MCP_TOKEN` | The `mcp --listen` bearer token, when no token file is used. Clients send `Authorization: Bearer <token>`. The token is never logged, and both variables are removed from the environment so child processes do not inherit them. Prefer `COMPUTER_USE_LINUX_MCP_TOKEN_FILE`: a token passed here stays readable in `/proc/<pid>/environ` for the server's lifetime. |
| `COMPUTER_USE_LINUX_ENABLE_SHELL` | Set exactly to `1` before starting the MCP server to register the destructive `run_shell` tool. Unset by default. Do not enable for untrusted or unattended MCP hosts. |
| `COMPUTER_USE_LINUX_ENABLE_REPL` | Set exactly to `1` to register `js` and `js_reset` next to the other tools on stdio. Unset by default. This lets the model run code as you, like `COMPUTER_USE_LINUX_ENABLE_SHELL=1`. Ignored over HTTP. |
| `COMPUTER_USE_LINUX_REPL_ONLY` | Set exactly to `1` to register only `js` and `js_reset` on stdio; every other tool stays reachable through the `desktop` API. Same trust as `COMPUTER_USE_LINUX_ENABLE_REPL`. Ignored over HTTP. |
| `COMPUTER_USE_LINUX_NODE_BIN` | Node.js binary for the `js` worker. Default: the first `node` on `PATH`, then `~/.local/bin`, Linuxbrew, `/usr/local/bin` and `/usr/bin`. |

**Build-time identity overrides** (set while compiling a downstream embedded
bundle): `CUL_GNOME_EXTENSION_UUID`, `CUL_DBUS_SERVICE`, and
Expand Down
83 changes: 81 additions & 2 deletions pi/extension/generated-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export interface GeneratedMcpToolDefinition {
}

export const GENERATED_SERVER_VERSION = "0.7.60";
export const GENERATED_TOOL_CATALOG_HASH = "509ad3e43b288d00f791273b3734ea65dc26704434184d27fac7d523936fcd06";
export const GENERATED_SHELL_TOOL_CATALOG_HASH = "960958257bdf01ff82ff1ff06ac351b24ad37cdb632e26e6255accef4011d6c8";
export const GENERATED_TOOL_CATALOG_HASH = "f897bce2fba7006d108f5b06b85f47f3683584a23cfa0992f270a06a25f52345";
export const GENERATED_SHELL_TOOL_CATALOG_HASH = "5f1f8a876f1520b98260319d3ef5b752f4d215052b48499350c04a7d3369d572";
export const GENERATED_MCP_TOOLS =
[
{
Expand Down Expand Up @@ -2263,6 +2263,85 @@ export const GENERATED_MCP_TOOLS =
},
"name": "resize_window"
},
{
"annotations": {
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": true,
"readOnlyHint": false
},
"description": "Execute an ordered sequence of desktop actions (click, type_text, press_key, set_value, scroll, drag, activate_window, get_app_state, screenshot, or sleep_ms) strictly sequentially in a single tool call. Keeps the AT-SPI snapshot_id cache warm and propagates snapshot_id across steps by default. Stops on the first error unless stop_on_error=false, and returns compact step results plus up to the last 2 captured screenshots.",
"inputSchema": {
"$defs": {
"BatchStep": {
"properties": {
"args": {
"default": null,
"description": "JSON object of arguments for `tool`."
},
"sleep_ms": {
"default": null,
"description": "Pause for this many milliseconds (0 to 30000) instead of calling a tool.",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"tool": {
"default": null,
"description": "Name of a computer-use-linux tool to invoke (e.g. click, type_text, press_key, set_value, scroll, get_app_state, screenshot).\nOmit when using `sleep_ms`.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"auto_snapshot_id": {
"default": null,
"description": "Automatically pass the latest `snapshot_id` returned by `get_app_state` or `include_tree` to subsequent element-targeted steps that omit `snapshot_id` (default true).",
"type": [
"boolean",
"null"
]
},
"delay_ms": {
"default": null,
"description": "Optional delay in milliseconds inserted between steps (default 0, max 5000).",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"steps": {
"description": "Ordered list of desktop steps (1 to 100) executed strictly sequentially.",
"items": {
"$ref": "#/$defs/BatchStep"
},
"type": "array"
},
"stop_on_error": {
"default": null,
"description": "Stop immediately on the first failed step (default true).",
"type": [
"boolean",
"null"
]
}
},
"required": [
"steps"
],
"type": "object"
},
"name": "run_batch"
},
{
"annotations": {
"destructiveHint": false,
Expand Down
1 change: 1 addition & 0 deletions pi/extension/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ const FORWARDED_ENVIRONMENT = [
"COMPUTER_USE_LINUX_INDICATOR",
"COMPUTER_USE_LINUX_INDICATOR_BIN",
"COMPUTER_USE_LINUX_INDICATOR_HIDE_TEXT",
"COMPUTER_USE_LINUX_NODE_BIN",
"COMPUTER_USE_LINUX_PERSIST_REMOTE_DESKTOP",
"COMPUTER_USE_LINUX_PORTAL_SCROLL_INVERT",
"COMPUTER_USE_LINUX_SCREENSHOT_BACKEND",
Expand Down
3 changes: 3 additions & 0 deletions plugins/computer-use-linux/codex-mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"COMPUTER_USE_LINUX_COSMIC_HELPER",
"COMPUTER_USE_LINUX_DEVTOOLS",
"COMPUTER_USE_LINUX_DOWNLOAD_BASE",
"COMPUTER_USE_LINUX_ENABLE_REPL",
"COMPUTER_USE_LINUX_ENABLE_SHELL",
"COMPUTER_USE_LINUX_FORCE_PORTAL_KEYBOARD",
"COMPUTER_USE_LINUX_FORCE_PORTAL_POINTER",
Expand All @@ -50,9 +51,11 @@
"COMPUTER_USE_LINUX_INDICATOR",
"COMPUTER_USE_LINUX_INDICATOR_BIN",
"COMPUTER_USE_LINUX_INDICATOR_HIDE_TEXT",
"COMPUTER_USE_LINUX_NODE_BIN",
"COMPUTER_USE_LINUX_NOTIFY_ON_COMPLETE",
"COMPUTER_USE_LINUX_PERSIST_REMOTE_DESKTOP",
"COMPUTER_USE_LINUX_PORTAL_SCROLL_INVERT",
"COMPUTER_USE_LINUX_REPL_ONLY",
"COMPUTER_USE_LINUX_SCREENSHOT_BACKEND",
"COMPUTER_USE_LINUX_XDOTOOL_TYPE_DELAY_MS",
"PIXELFLUX_CU",
Expand Down
2 changes: 2 additions & 0 deletions scripts/check_env_forwarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@

# Variables one host leaves out on purpose.
PI_NOT_PASSED = {
"COMPUTER_USE_LINUX_ENABLE_REPL": "adds js/js_reset to tools/list, and the Pi client refuses a catalog that differs from its generated one",
"COMPUTER_USE_LINUX_NOTIFY_ON_COMPLETE": "adds complete_interaction to tools/list, and the Pi client refuses a catalog that differs from its generated one",
"COMPUTER_USE_LINUX_REPL_ONLY": "restricts tools/list to js/js_reset, and the Pi client refuses a catalog that differs from its generated one",
}
CODEX_NOT_PASSED = {
"LC_": "prefix for run_shell's inherited locale; Codex passes LANG and LC_ALL only",
Expand Down
Loading
Loading