@agent-sh/computer-use-linux 0.7.2 → 0.7.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-sh/computer-use-linux",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
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,7 +7,7 @@ export interface GeneratedMcpToolDefinition {
7
7
  annotations: Record<string, unknown>;
8
8
  }
9
9
 
10
- export const GENERATED_SERVER_VERSION = "0.7.2";
10
+ export const GENERATED_SERVER_VERSION = "0.7.4";
11
11
  export const GENERATED_TOOL_CATALOG_HASH = "a28811e528ada60c60d5e493d3680249428a65037cbd741ab0efa4711dd91837";
12
12
  export const GENERATED_SHELL_TOOL_CATALOG_HASH = "3e5700e7be824d965170c202204cb512ee41b7162088050a8d7f479d617d15d3";
13
13
  export const GENERATED_MCP_TOOLS =
@@ -18,10 +18,11 @@ import {
18
18
  constants,
19
19
  existsSync,
20
20
  readFileSync,
21
+ statSync,
21
22
  } from "node:fs";
22
23
  import { createRequire } from "node:module";
23
24
  import { homedir } from "node:os";
24
- import { join } from "node:path";
25
+ import { delimiter, join } from "node:path";
25
26
  import { Type, type TSchema } from "typebox";
26
27
  import {
27
28
  GENERATED_MCP_TOOLS,
@@ -154,6 +155,8 @@ function isRecord(value: unknown): value is Record<string, unknown> {
154
155
 
155
156
  function executable(path: string): boolean {
156
157
  try {
158
+ // A directory on PATH also passes X_OK; only a regular file can be spawned.
159
+ if (!statSync(path).isFile()) return false;
157
160
  accessSync(path, constants.X_OK);
158
161
  return true;
159
162
  } catch {
@@ -161,6 +164,23 @@ function executable(path: string): boolean {
161
164
  }
162
165
  }
163
166
 
167
+ /**
168
+ * First executable `name` in a PATH-style list, or `null`. Empty segments are
169
+ * skipped rather than read as the current directory.
170
+ */
171
+ export function findExecutableOnPath(
172
+ pathValue: string | undefined,
173
+ name: string,
174
+ isExecutable: (path: string) => boolean = executable,
175
+ ): string | null {
176
+ for (const dir of (pathValue ?? "").split(delimiter)) {
177
+ if (!dir) continue;
178
+ const candidate = join(dir, name);
179
+ if (isExecutable(candidate)) return candidate;
180
+ }
181
+ return null;
182
+ }
183
+
164
184
  function runtimeEnvironment(): Record<string, string> {
165
185
  const allowed = new Set([
166
186
  "PATH",
@@ -247,6 +267,15 @@ function defaultFindBinary(): BinaryLaunch | null {
247
267
  return { binaryPath: bundledBinary, env };
248
268
  }
249
269
 
270
+ // A temporary extension (`pi -e npm:@agent-sh/computer-use-linux`) is staged
271
+ // without the postinstall-downloaded platform binary, so fall back to a
272
+ // global npm or cargo install. The MCP client still checks the server
273
+ // version and tool catalog, so a mismatched install fails with that reason.
274
+ const onPath = findExecutableOnPath(process.env.PATH, "computer-use-linux");
275
+ if (onPath) {
276
+ return { binaryPath: onPath, env };
277
+ }
278
+
250
279
  return null;
251
280
  }
252
281
 
@@ -504,7 +533,7 @@ export function createComputerUseLinuxExtension(
504
533
  if (!resolved) {
505
534
  throw new Error(
506
535
  "computer-use-linux binary was not found. Reinstall " +
507
- `${PACKAGE_NAME} or set COMPUTER_USE_LINUX_BIN.`,
536
+ `${PACKAGE_NAME}, install computer-use-linux on PATH, or set COMPUTER_USE_LINUX_BIN.`,
508
537
  );
509
538
  }
510
539
  const { ComputerUseMcpClient } = loadClientModule();
@@ -622,7 +651,7 @@ export function createComputerUseLinuxExtension(
622
651
 
623
652
  if (!resolveLaunch() && ctx.hasUI) {
624
653
  ctx.ui.notify(
625
- `${PACKAGE_NAME}: binary not found; reinstall the package or set COMPUTER_USE_LINUX_BIN.`,
654
+ `${PACKAGE_NAME}: binary not found; reinstall the package, install computer-use-linux on PATH, or set COMPUTER_USE_LINUX_BIN.`,
626
655
  "warning",
627
656
  );
628
657
  }
@@ -102,6 +102,12 @@ The extension looks for `computer-use-linux` in this order:
102
102
 
103
103
  1. `COMPUTER_USE_LINUX_BIN`
104
104
  2. The binary downloaded inside the installed npm package
105
+ 3. `computer-use-linux` on `PATH`, from `npm install -g` or `cargo install`
106
+
107
+ A temporary extension (`pi -e npm:@agent-sh/computer-use-linux`) is staged
108
+ without the downloaded binary, so it relies on the `PATH` step. The extension
109
+ still checks that the server version and tool catalog match, so a mismatched
110
+ install fails with that reason instead of starting.
105
111
 
106
112
  Reinstall the package if the bundled binary is missing:
107
113