@agent-sh/computer-use-linux 0.7.8 → 0.7.10
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 +3 -2
- package/package.json +1 -1
- package/pi/extension/generated-tools.ts +5 -3
- package/pi/extension/index.ts +19 -6
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
|
-
>
|
|
12
|
+
> Running open models for your company? [**Tiyuvta**](https://tiyuvta.ai/services/) helps with model choice, deployment and optimization, and fine-tuning on your hardware or cloud account.
|
|
13
13
|
|
|
14
14
|
`computer-use-linux` reads accessibility trees, takes screenshots, and drives clicks, scrolls, and keystrokes across GNOME, KDE/KWin, Hyprland, niri, i3, and COSMIC — Wayland-first, X11 best-effort.
|
|
15
15
|
|
|
@@ -417,6 +417,7 @@ Most setups need none of these — `doctor` and the installers pick sensible def
|
|
|
417
417
|
| `COMPUTER_USE_LINUX_FORCE_PORTAL_POINTER` / `…_KEYBOARD` | Always route pointer / keyboard through the RemoteDesktop portal on Wayland, skipping auto-detection. |
|
|
418
418
|
| `COMPUTER_USE_LINUX_PERSIST_REMOTE_DESKTOP` | Set exactly to `1` to ask the RemoteDesktop portal to remember pointer and keyboard grants across processes. The first dialog still appears (on GNOME the remember box starts checked). Later processes reuse the single-use restore token from `Start`, stored mode `0600` under `$XDG_STATE_HOME/computer-use-linux/` (or `~/.local/state/computer-use-linux/`). Pointer and keyboard tokens are separate. Needs interface version 2. Unset, every new process is prompted. No effect when input is not using the portal. |
|
|
419
419
|
| `COMPUTER_USE_LINUX_FORCE_YDOTOOL_POINTER` / `…_KEYBOARD` | Always route pointer / keyboard through `ydotool`, skipping the portal and KDE clipboard paths; pointer forcing also skips native-X11 `xdotool` coordinate clicks and scrolls. |
|
|
420
|
+
| `YDOTOOL_SOCKET` | Explicit ydotool socket path. When unset, only an owner-only `.ydotool_socket` in the user's private runtime directory is accepted; the legacy shared `/tmp/.ydotool_socket` is never selected automatically. Setting this variable is an operator trust override for custom layouts. |
|
|
420
421
|
| `COMPUTER_USE_LINUX_FORCE_XDOTOOL_KEYBOARD` | Prefer `xdotool`/XTEST keyboard input when `DISPLAY` is available. `COMPUTER_USE_LINUX_FORCE_YDOTOOL_KEYBOARD=1` takes precedence. |
|
|
421
422
|
| `COMPUTER_USE_LINUX_XDOTOOL_TYPE_DELAY_MS` | Per-character delay for `xdotool type` in milliseconds (default `12`). `0` is faster but can deliver characters out of order on some X servers. |
|
|
422
423
|
| `COMPUTER_USE_LINUX_SCREENSHOT_BACKEND` | Force a single screenshot backend, skipping the fallback chain. Accepts `gnome-shell`, `portal`, `x11`, or `gnome-screenshot`. `x11` works only on a native X11 session. Pin `gnome-screenshot` for background/systemd contexts where the GNOME Shell and portal DBus paths are denied. |
|
|
@@ -432,7 +433,7 @@ files.
|
|
|
432
433
|
|
|
433
434
|
| Variable | Effect |
|
|
434
435
|
| --- | --- |
|
|
435
|
-
| `COMPUTER_USE_LINUX_BIN` | Run this binary instead of the one bundled by the npm package. |
|
|
436
|
+
| `COMPUTER_USE_LINUX_BIN` | Run this absolute binary path instead of the one bundled by the npm package. Relative paths are ignored. |
|
|
436
437
|
| `COMPUTER_USE_LINUX_DOWNLOAD_BASE` | Override the GitHub release base URL the installer downloads from (mirrors, air-gapped hosts). |
|
|
437
438
|
| `COMPUTER_USE_LINUX_SKIP_DOWNLOAD=1` | Skip the post-install binary download entirely. |
|
|
438
439
|
| `COMPUTER_USE_LINUX_LOCAL_BINARY` / `…_LOCAL_COSMIC_HELPER` | Install from a local build instead of downloading (used by CI and local testing). |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-sh/computer-use-linux",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.10",
|
|
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.7.
|
|
11
|
-
export const GENERATED_TOOL_CATALOG_HASH = "
|
|
12
|
-
export const GENERATED_SHELL_TOOL_CATALOG_HASH = "
|
|
10
|
+
export const GENERATED_SERVER_VERSION = "0.7.10";
|
|
11
|
+
export const GENERATED_TOOL_CATALOG_HASH = "b65768d5f3112b43fcde1344223f5354557c871969987a0a49b58ebe5605eb70";
|
|
12
|
+
export const GENERATED_SHELL_TOOL_CATALOG_HASH = "984f033a6045848f85209b7e74bf881f7810bcfe1fce820e2c3967fee52a6714";
|
|
13
13
|
export const GENERATED_MCP_TOOLS =
|
|
14
14
|
[
|
|
15
15
|
{
|
|
@@ -1030,6 +1030,8 @@ export const GENERATED_MCP_TOOLS =
|
|
|
1030
1030
|
"pages": {
|
|
1031
1031
|
"default": null,
|
|
1032
1032
|
"format": "double",
|
|
1033
|
+
"maximum": 100,
|
|
1034
|
+
"minimum": -100,
|
|
1033
1035
|
"type": [
|
|
1034
1036
|
"number",
|
|
1035
1037
|
"null"
|
package/pi/extension/index.ts
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "node:fs";
|
|
23
23
|
import { createRequire } from "node:module";
|
|
24
24
|
import { homedir } from "node:os";
|
|
25
|
-
import { delimiter, join } from "node:path";
|
|
25
|
+
import { delimiter, isAbsolute, join } from "node:path";
|
|
26
26
|
import { Type, type TSchema } from "typebox";
|
|
27
27
|
import {
|
|
28
28
|
GENERATED_MCP_TOOLS,
|
|
@@ -47,6 +47,7 @@ const DEFAULT_TOOLS = [
|
|
|
47
47
|
const MAX_RESULT_TEXT_CHARS = 200_000;
|
|
48
48
|
const MAX_RESULT_IMAGE_BYTES = 2 * 1024 * 1024;
|
|
49
49
|
const MAX_RESULT_IMAGES = 4;
|
|
50
|
+
const SAFE_CHILD_PATH = ["/usr/local/bin", "/usr/bin", "/bin"].join(delimiter);
|
|
50
51
|
const TRUNCATION_NOTICE =
|
|
51
52
|
"[Result truncated by the Pi extension. Request a smaller/bounded result.]";
|
|
52
53
|
const SHELL_ENABLED = process.env.COMPUTER_USE_LINUX_ENABLE_SHELL === "1";
|
|
@@ -164,16 +165,23 @@ function executable(path: string): boolean {
|
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
167
|
|
|
168
|
+
export function sanitizeExecutablePath(pathValue: string | undefined): string {
|
|
169
|
+
return (pathValue ?? "")
|
|
170
|
+
.split(delimiter)
|
|
171
|
+
.filter((dir) => dir.length > 0 && isAbsolute(dir))
|
|
172
|
+
.join(delimiter);
|
|
173
|
+
}
|
|
174
|
+
|
|
167
175
|
/**
|
|
168
|
-
* First executable `name` in a PATH-style list, or `null`. Empty
|
|
169
|
-
* skipped rather than read
|
|
176
|
+
* First executable `name` in a PATH-style list, or `null`. Empty and relative
|
|
177
|
+
* segments are skipped rather than read relative to the current directory.
|
|
170
178
|
*/
|
|
171
179
|
export function findExecutableOnPath(
|
|
172
180
|
pathValue: string | undefined,
|
|
173
181
|
name: string,
|
|
174
182
|
isExecutable: (path: string) => boolean = executable,
|
|
175
183
|
): string | null {
|
|
176
|
-
for (const dir of (pathValue
|
|
184
|
+
for (const dir of sanitizeExecutablePath(pathValue).split(delimiter)) {
|
|
177
185
|
if (!dir) continue;
|
|
178
186
|
const candidate = join(dir, name);
|
|
179
187
|
if (isExecutable(candidate)) return candidate;
|
|
@@ -228,19 +236,24 @@ function runtimeEnvironment(): Record<string, string> {
|
|
|
228
236
|
"COMPUTER_USE_LINUX_SCREENSHOT_BACKEND",
|
|
229
237
|
"CU_DISABLE_ABS_POINTER",
|
|
230
238
|
]);
|
|
231
|
-
|
|
239
|
+
const env = Object.fromEntries(
|
|
232
240
|
Object.entries(process.env).filter(
|
|
233
241
|
(entry): entry is [string, string] =>
|
|
234
242
|
typeof entry[1] === "string" &&
|
|
235
243
|
(allowed.has(entry[0]) || entry[0].startsWith("LC_")),
|
|
236
244
|
),
|
|
237
245
|
);
|
|
246
|
+
const sanitizedPath = sanitizeExecutablePath(env.PATH);
|
|
247
|
+
env.PATH = sanitizedPath || SAFE_CHILD_PATH;
|
|
248
|
+
return env;
|
|
238
249
|
}
|
|
239
250
|
|
|
240
251
|
function defaultFindBinary(): BinaryLaunch | null {
|
|
241
252
|
const env = runtimeEnvironment();
|
|
242
253
|
const override = process.env.COMPUTER_USE_LINUX_BIN?.trim();
|
|
243
|
-
|
|
254
|
+
// Relative overrides would be resolved from Pi's potentially untrusted
|
|
255
|
+
// project directory. Ignore them and continue with bundled/global discovery.
|
|
256
|
+
if (override && isAbsolute(override) && executable(override)) {
|
|
244
257
|
return { binaryPath: override, env };
|
|
245
258
|
}
|
|
246
259
|
|