@vm0/cli 9.221.6 → 9.221.7
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/{chunk-ZOZTDOZE.js → chunk-VODAZPIN.js} +3 -3
- package/{computer-use-JWVNMBIM.js → computer-use-DSI7XSVO.js} +120 -18
- package/computer-use-DSI7XSVO.js.map +1 -0
- package/index.js +9 -9
- package/package.json +1 -1
- package/zero.js +3 -3
- package/computer-use-JWVNMBIM.js.map +0 -1
- /package/{chunk-ZOZTDOZE.js.map → chunk-VODAZPIN.js.map} +0 -0
|
@@ -50,7 +50,7 @@ if (DSN) {
|
|
|
50
50
|
Sentry.init({
|
|
51
51
|
dsn: DSN,
|
|
52
52
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
53
|
-
release: "9.221.
|
|
53
|
+
release: "9.221.7",
|
|
54
54
|
sendDefaultPii: false,
|
|
55
55
|
tracesSampleRate: 0,
|
|
56
56
|
shutdownTimeout: 500,
|
|
@@ -69,7 +69,7 @@ if (DSN) {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
Sentry.setContext("cli", {
|
|
72
|
-
version: "9.221.
|
|
72
|
+
version: "9.221.7",
|
|
73
73
|
command: process.argv.slice(2).join(" ")
|
|
74
74
|
});
|
|
75
75
|
Sentry.setContext("runtime", {
|
|
@@ -146,4 +146,4 @@ async function configureGlobalProxyFromEnv() {
|
|
|
146
146
|
export {
|
|
147
147
|
configureGlobalProxyFromEnv
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
149
|
+
//# sourceMappingURL=chunk-VODAZPIN.js.map
|
|
@@ -25,10 +25,117 @@ import {
|
|
|
25
25
|
|
|
26
26
|
// src/commands/zero/computer-use/index.ts
|
|
27
27
|
init_esm_shims();
|
|
28
|
-
import { mkdir, writeFile } from "fs/promises";
|
|
29
28
|
import { join } from "path";
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
|
|
30
|
+
// src/commands/zero/computer-use/output-artifacts.ts
|
|
31
|
+
init_esm_shims();
|
|
32
|
+
import { randomUUID } from "crypto";
|
|
33
|
+
import {
|
|
34
|
+
chmod,
|
|
35
|
+
lstat,
|
|
36
|
+
mkdir,
|
|
37
|
+
readdir,
|
|
38
|
+
rename,
|
|
39
|
+
rm,
|
|
40
|
+
writeFile
|
|
41
|
+
} from "fs/promises";
|
|
42
|
+
import { tmpdir } from "os";
|
|
43
|
+
import path from "path";
|
|
44
|
+
var COMPUTER_USE_OUTPUT_DIR_MODE = 448;
|
|
45
|
+
var COMPUTER_USE_OUTPUT_FILE_MODE = 384;
|
|
46
|
+
var COMPUTER_USE_OUTPUT_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
47
|
+
var DEFAULT_COMPUTER_USE_OUTPUT_DIR = path.join(
|
|
48
|
+
tmpdir(),
|
|
49
|
+
"vm0",
|
|
50
|
+
"computer-use"
|
|
51
|
+
);
|
|
52
|
+
function computerUseOutputDir() {
|
|
53
|
+
const configured = process.env.VM0_COMPUTER_OUTPUT_DIR?.trim();
|
|
54
|
+
return configured && configured.length > 0 ? configured : DEFAULT_COMPUTER_USE_OUTPUT_DIR;
|
|
55
|
+
}
|
|
56
|
+
async function ensurePrivateDirectory(directory) {
|
|
57
|
+
await mkdir(directory, {
|
|
58
|
+
recursive: true,
|
|
59
|
+
mode: COMPUTER_USE_OUTPUT_DIR_MODE
|
|
60
|
+
});
|
|
61
|
+
const stats = await lstat(directory);
|
|
62
|
+
if (!stats.isDirectory() || stats.isSymbolicLink()) {
|
|
63
|
+
throw new Error(
|
|
64
|
+
`Computer-use output path is not a directory: ${directory}`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
await chmod(directory, COMPUTER_USE_OUTPUT_DIR_MODE);
|
|
68
|
+
}
|
|
69
|
+
async function removeStaleEntries(directory, cutoffMs) {
|
|
70
|
+
let entries;
|
|
71
|
+
try {
|
|
72
|
+
entries = await readdir(directory, { withFileTypes: true });
|
|
73
|
+
} catch (error) {
|
|
74
|
+
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
for (const entry of entries) {
|
|
80
|
+
const entryPath = path.join(directory, entry.name);
|
|
81
|
+
const stats = await lstat(entryPath).catch(() => {
|
|
82
|
+
return null;
|
|
83
|
+
});
|
|
84
|
+
if (!stats) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (entry.isDirectory() && !stats.isSymbolicLink()) {
|
|
88
|
+
await removeStaleEntries(entryPath, cutoffMs);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (stats.mtimeMs < cutoffMs) {
|
|
92
|
+
await rm(entryPath, { force: true, recursive: entry.isDirectory() });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function prepareComputerUseOutputDir() {
|
|
97
|
+
const outputDir = computerUseOutputDir();
|
|
98
|
+
await ensurePrivateDirectory(outputDir);
|
|
99
|
+
await removeStaleEntries(outputDir, Date.now() - COMPUTER_USE_OUTPUT_TTL_MS);
|
|
100
|
+
return outputDir;
|
|
101
|
+
}
|
|
102
|
+
async function ensureOutputPathDirectory(outputPath) {
|
|
103
|
+
const outputDir = await prepareComputerUseOutputDir();
|
|
104
|
+
const directory = path.dirname(outputPath);
|
|
105
|
+
const relative = path.relative(outputDir, directory);
|
|
106
|
+
if (relative.startsWith("..") || path.isAbsolute(relative)) {
|
|
107
|
+
throw new Error(`Computer-use artifact path escapes output directory`);
|
|
108
|
+
}
|
|
109
|
+
let current = outputDir;
|
|
110
|
+
for (const part of relative.split(path.sep).filter(Boolean)) {
|
|
111
|
+
current = path.join(current, part);
|
|
112
|
+
await ensurePrivateDirectory(current);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async function writeComputerUseArtifact(outputPath, data) {
|
|
116
|
+
await ensureOutputPathDirectory(outputPath);
|
|
117
|
+
const tempPath = path.join(
|
|
118
|
+
path.dirname(outputPath),
|
|
119
|
+
`.${path.basename(outputPath)}.${process.pid.toString()}.${randomUUID()}.tmp`
|
|
120
|
+
);
|
|
121
|
+
let moved = false;
|
|
122
|
+
try {
|
|
123
|
+
await writeFile(tempPath, data, {
|
|
124
|
+
flag: "wx",
|
|
125
|
+
mode: COMPUTER_USE_OUTPUT_FILE_MODE
|
|
126
|
+
});
|
|
127
|
+
await chmod(tempPath, COMPUTER_USE_OUTPUT_FILE_MODE);
|
|
128
|
+
await rename(tempPath, outputPath);
|
|
129
|
+
moved = true;
|
|
130
|
+
await chmod(outputPath, COMPUTER_USE_OUTPUT_FILE_MODE);
|
|
131
|
+
} finally {
|
|
132
|
+
if (!moved) {
|
|
133
|
+
await rm(tempPath, { force: true });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// src/commands/zero/computer-use/index.ts
|
|
32
139
|
var DATA_URL_PATTERN = /^data:([^;,]+);base64,(.*)$/s;
|
|
33
140
|
var COMPUTER_USE_REQUIRED_CAPABILITY_MESSAGE = "Missing required capability: computer-use:write";
|
|
34
141
|
var COMPUTER_USE_AUTHORIZATION_REQUIRED_ERROR = "COMPUTER_USE_AUTHORIZATION_REQUIRED";
|
|
@@ -193,11 +300,10 @@ async function writeScreenshotDataUrl(result, dataUrl) {
|
|
|
193
300
|
const appName = sanitizeFilenamePart(result.app, "app");
|
|
194
301
|
const snapshotId = sanitizeFilenamePart(result.snapshotId, "snapshot");
|
|
195
302
|
const outputPath = join(
|
|
196
|
-
|
|
303
|
+
computerUseOutputDir(),
|
|
197
304
|
`${appName}-${snapshotId}.${extensionForMimeType(mimeType)}`
|
|
198
305
|
);
|
|
199
|
-
await
|
|
200
|
-
await writeFile(outputPath, Buffer.from(base64Data, "base64"));
|
|
306
|
+
await writeComputerUseArtifact(outputPath, Buffer.from(base64Data, "base64"));
|
|
201
307
|
return outputPath;
|
|
202
308
|
}
|
|
203
309
|
function screenshotPointerType(value) {
|
|
@@ -211,22 +317,20 @@ async function writeScreenshotBytes(result, buffer, mimeType) {
|
|
|
211
317
|
const appName = sanitizeFilenamePart(result.app, "app");
|
|
212
318
|
const snapshotId = sanitizeFilenamePart(result.snapshotId, "snapshot");
|
|
213
319
|
const outputPath = join(
|
|
214
|
-
|
|
320
|
+
computerUseOutputDir(),
|
|
215
321
|
`${appName}-${snapshotId}.${extensionForMimeType(mimeType)}`
|
|
216
322
|
);
|
|
217
|
-
await
|
|
218
|
-
await writeFile(outputPath, buffer);
|
|
323
|
+
await writeComputerUseArtifact(outputPath, buffer);
|
|
219
324
|
return outputPath;
|
|
220
325
|
}
|
|
221
326
|
async function writeAppStateText(result, appState) {
|
|
222
327
|
const appName = sanitizeFilenamePart(result.app, "app");
|
|
223
328
|
const snapshotId = sanitizeFilenamePart(result.snapshotId, "snapshot");
|
|
224
329
|
const outputPath = join(
|
|
225
|
-
|
|
330
|
+
computerUseOutputDir(),
|
|
226
331
|
`${appName}-${snapshotId}.appState.txt`
|
|
227
332
|
);
|
|
228
|
-
await
|
|
229
|
-
await writeFile(outputPath, appState, "utf8");
|
|
333
|
+
await writeComputerUseArtifact(outputPath, appState);
|
|
230
334
|
return outputPath;
|
|
231
335
|
}
|
|
232
336
|
function compactActionResult(action) {
|
|
@@ -299,17 +403,15 @@ async function writePluginContent(commandId, result) {
|
|
|
299
403
|
const pointerFileName = pluginContentFileName(result.pluginContent);
|
|
300
404
|
const directoryName = sanitizeFilenamePart(commandId, "command");
|
|
301
405
|
const outputPath = join(
|
|
302
|
-
|
|
406
|
+
computerUseOutputDir(),
|
|
407
|
+
"plugins",
|
|
303
408
|
directoryName,
|
|
304
409
|
sanitizeFilenamePart(
|
|
305
410
|
downloaded.fileName || pointerFileName,
|
|
306
411
|
pointerFileName
|
|
307
412
|
)
|
|
308
413
|
);
|
|
309
|
-
await
|
|
310
|
-
recursive: true
|
|
311
|
-
});
|
|
312
|
-
await writeFile(outputPath, downloaded.buffer);
|
|
414
|
+
await writeComputerUseArtifact(outputPath, downloaded.buffer);
|
|
313
415
|
return outputPath;
|
|
314
416
|
}
|
|
315
417
|
function formatHumanValue(value) {
|
|
@@ -779,4 +881,4 @@ export {
|
|
|
779
881
|
formatComputerUseResultForConsole,
|
|
780
882
|
zeroComputerUseCommand
|
|
781
883
|
};
|
|
782
|
-
//# sourceMappingURL=computer-use-
|
|
884
|
+
//# sourceMappingURL=computer-use-DSI7XSVO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/zero/computer-use/index.ts","../src/commands/zero/computer-use/output-artifacts.ts"],"sourcesContent":["import { join } from \"node:path\";\nimport { Command } from \"commander\";\nimport type {\n ComputerUseCommandResponse,\n ComputerUseReadCommandKind,\n ComputerUseWriteCommandKind,\n} from \"@vm0/api-contracts/contracts/zero-computer-use\";\nimport {\n COMPUTER_USE_FILESYSTEM_PLUGIN,\n type ComputerUseFilesystemTool,\n type ComputerUsePluginCallBody,\n} from \"@vm0/api-contracts/contracts/zero-computer-use-plugins\";\nimport {\n ApiRequestError,\n createComputerUsePluginCommand,\n createComputerUseReadCommand,\n createComputerUseWriteCommand,\n fetchComputerUsePluginContent,\n fetchComputerUseScreenshot,\n getComputerUseCommand,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command/with-error-handler\";\nimport {\n computerUseOutputDir,\n writeComputerUseArtifact,\n} from \"./output-artifacts\";\n\ninterface ComputerUseCommandOptions {\n readonly timeout?: string;\n}\n\ninterface ComputerUseAppOptions extends ComputerUseCommandOptions {\n readonly app: string;\n}\n\ninterface ComputerUseClickOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly element?: string;\n readonly elementIndex?: string;\n readonly x?: string;\n readonly y?: string;\n readonly button?: \"left\" | \"right\" | \"middle\";\n readonly clickCount?: string;\n}\n\ninterface ComputerUseScrollOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly element?: string;\n readonly elementIndex?: string;\n readonly direction: \"up\" | \"down\" | \"left\" | \"right\";\n readonly pages?: string;\n}\n\ninterface ComputerUseSetValueOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly element?: string;\n readonly elementIndex?: string;\n readonly value: string;\n}\n\ninterface ComputerUsePerformActionOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly element?: string;\n readonly elementIndex?: string;\n readonly action: string;\n}\n\ninterface ComputerUseTypeTextOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly text: string;\n}\n\ninterface ComputerUsePressKeyOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly key: string;\n}\n\ninterface ComputerUsePluginOptions extends ComputerUseCommandOptions {\n readonly argumentsJson?: string;\n}\n\ninterface FilesystemPathOptions extends ComputerUsePluginOptions {\n readonly path: string;\n}\n\ninterface FilesystemReadTextOptions extends FilesystemPathOptions {\n readonly head?: string;\n readonly tail?: string;\n}\n\ninterface FilesystemReadMultipleFilesOptions extends ComputerUsePluginOptions {\n readonly path: readonly string[];\n}\n\ninterface FilesystemWriteFileOptions extends FilesystemPathOptions {\n readonly content: string;\n}\n\ninterface FilesystemEditFileOptions extends FilesystemPathOptions {\n readonly oldText?: string;\n readonly newText?: string;\n readonly dryRun?: boolean;\n}\n\ninterface FilesystemListDirectoryWithSizesOptions extends FilesystemPathOptions {\n readonly sortBy?: \"name\" | \"size\";\n}\n\ninterface FilesystemDirectoryTreeOptions extends FilesystemPathOptions {\n readonly excludePattern?: readonly string[];\n}\n\ninterface FilesystemMoveFileOptions extends ComputerUsePluginOptions {\n readonly source: string;\n readonly destination: string;\n}\n\ninterface FilesystemSearchFilesOptions extends FilesystemPathOptions {\n readonly pattern: string;\n readonly excludePattern?: readonly string[];\n}\n\nconst DATA_URL_PATTERN = /^data:([^;,]+);base64,(.*)$/s;\nconst COMPUTER_USE_REQUIRED_CAPABILITY_MESSAGE =\n \"Missing required capability: computer-use:write\";\nconst COMPUTER_USE_AUTHORIZATION_REQUIRED_ERROR =\n \"COMPUTER_USE_AUTHORIZATION_REQUIRED\";\nconst COMPUTER_USE_HELP_TEXT = `\nWorkflow:\n 1. Start the Zero Desktop app and make sure Computer Use is online.\n 2. Run \"zero computer-use list-apps\" to find the target app's bundleId.\n --app accepts a bundle id only (e.g. com.google.Chrome); the name is for\n display. Apps listed without a bundleId cannot be targeted.\n 3. Run \"zero computer-use get-app-state --app <bundleId>\" to get a screenshot,\n snapshotId, visible element indexes, and accessibility state.\n 4. Prefer element actions with --snapshot-id and --element-index. Use --x/--y\n only when the target is visible in the returned screenshot but has no useful\n accessibility element.\n 5. Read the JSON result. Screenshot and App State data are saved under\n /tmp/vm0/computer-use and replaced with local file paths in CLI output.\n Files are named from app and snapshotId; rerunning the same snapshot\n overwrites the same files.\n\nNotes:\n Write commands are sent to the connected Desktop host. Coordinate fallbacks use\n screenshot coordinates from get-app-state; pass the matching --snapshot-id when\n acting on a prior snapshot.\n type-text sends literal keyboard input to the target app's current focus. It\n first verifies the focused element is editable and fails with\n element_not_editable when it is not (for example a focused table or list), so\n click into a text field before typing. Use set-value when you need\n deterministic accessibility value assignment.\n press-key accepts xdotool-style names such as shift+semicolon, Control_L+J,\n ctrl+alt+n, and BackSpace, plus existing macOS-style forms such as Command+L.\n type-text and press-key accept the same --snapshot-id as the element actions:\n pass it to deliver keyboard input to that snapshot's window. Without it, the\n most relevant window for the app is picked, which is ambiguous for multi-window\n apps.\n\nExamples:\n List available apps:\n zero computer-use list-apps\n\n Inspect Safari state:\n zero computer-use get-app-state --app com.apple.Safari\n\n Click element index 7 from snapshot desktop_abc:\n zero computer-use click --app com.apple.Safari --snapshot-id desktop_abc --element-index 7\n\n Click screenshot coordinate (320, 240) from snapshot desktop_abc:\n zero computer-use click --app com.apple.Safari --snapshot-id desktop_abc --x 320 --y 240\n\n Type text into the snapshot desktop_abc window in Safari:\n zero computer-use type-text --app com.apple.Safari --snapshot-id desktop_abc --text \"Hello\"\n\n Press a keyboard shortcut in the snapshot desktop_abc window:\n zero computer-use press-key --app com.apple.Safari --snapshot-id desktop_abc --key shift+semicolon\n\n Open an app without activating the current foreground app:\n zero computer-use open-app --app com.culturedcode.ThingsMac`;\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n\nfunction throwComputerUseAuthorizationGuidanceError(error: unknown): never {\n if (\n error instanceof ApiRequestError &&\n error.status === 403 &&\n error.code === \"FORBIDDEN\" &&\n error.message === COMPUTER_USE_REQUIRED_CAPABILITY_MESSAGE\n ) {\n throw new ApiRequestError(\n \"Computer Use authorization required\",\n COMPUTER_USE_AUTHORIZATION_REQUIRED_ERROR,\n 403,\n );\n }\n\n throw error;\n}\n\nfunction parseTimeoutSeconds(value: string | undefined): number {\n if (!value) return 30;\n const seconds = Number.parseInt(value, 10);\n if (!Number.isFinite(seconds) || seconds <= 0) {\n throw new Error(\"Timeout must be a positive number of seconds\");\n }\n return seconds;\n}\n\nfunction parseOptionalNonNegativeInteger(\n value: string | undefined,\n label: string,\n): number | undefined {\n if (value === undefined) return undefined;\n const parsed = Number.parseInt(value, 10);\n if (!Number.isFinite(parsed) || parsed < 0) {\n throw new Error(`${label} must be a non-negative integer`);\n }\n return parsed;\n}\n\nfunction parsePositiveInteger(\n value: string | undefined,\n label: string,\n): number {\n if (value === undefined) {\n throw new Error(`${label} is required`);\n }\n const parsed = Number.parseInt(value, 10);\n if (!Number.isFinite(parsed) || parsed <= 0) {\n throw new Error(`${label} must be a positive integer`);\n }\n return parsed;\n}\n\nfunction parsePositiveNumber(\n value: string | undefined,\n label: string,\n): number | undefined {\n if (value === undefined) return undefined;\n const parsed = Number.parseFloat(value);\n if (!Number.isFinite(parsed) || parsed <= 0) {\n throw new Error(`${label} must be a positive number`);\n }\n return parsed;\n}\n\nfunction parseMouseButton(\n value: string | undefined,\n): \"left\" | \"right\" | \"middle\" {\n if (value === \"left\" || value === \"right\" || value === \"middle\") {\n return value;\n }\n throw new Error(\"button must be left, right, or middle\");\n}\n\nfunction elementTargetPayload(options: {\n readonly element?: string;\n readonly elementIndex?: string;\n}): { readonly elementId?: string; readonly elementIndex?: number } {\n const elementIndex = parseOptionalNonNegativeInteger(\n options.elementIndex,\n \"element-index\",\n );\n if (!options.element && elementIndex === undefined) {\n throw new Error(\"element or element-index is required\");\n }\n return {\n ...(options.element ? { elementId: options.element } : {}),\n ...(elementIndex !== undefined ? { elementIndex } : {}),\n };\n}\n\nfunction sanitizeFilenamePart(value: unknown, fallback: string): string {\n if (typeof value !== \"string\") {\n return fallback;\n }\n const sanitized = value\n .trim()\n .replace(/[^A-Za-z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 80);\n return sanitized.length > 0 ? sanitized : fallback;\n}\n\nfunction extensionForMimeType(mimeType: string): string {\n if (mimeType === \"image/png\") {\n return \"png\";\n }\n if (mimeType === \"image/jpeg\") {\n return \"jpg\";\n }\n if (mimeType === \"image/webp\") {\n return \"webp\";\n }\n const suffix = mimeType.startsWith(\"image/\") ? mimeType.slice(6) : \"bin\";\n return sanitizeFilenamePart(suffix, \"bin\").toLowerCase();\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction stringField(\n value: Record<string, unknown>,\n key: string,\n): string | undefined {\n const field = value[key];\n return typeof field === \"string\" ? field : undefined;\n}\n\nasync function writeScreenshotDataUrl(\n result: Record<string, unknown>,\n dataUrl: string,\n): Promise<string | null> {\n const match = DATA_URL_PATTERN.exec(dataUrl);\n if (!match) {\n return null;\n }\n\n const mimeType = match[1] ?? \"\";\n if (!mimeType.startsWith(\"image/\")) {\n throw new Error(`Unsupported screenshot MIME type: ${mimeType}`);\n }\n\n const base64Data = match[2] ?? \"\";\n const appName = sanitizeFilenamePart(result.app, \"app\");\n const snapshotId = sanitizeFilenamePart(result.snapshotId, \"snapshot\");\n const outputPath = join(\n computerUseOutputDir(),\n `${appName}-${snapshotId}.${extensionForMimeType(mimeType)}`,\n );\n\n await writeComputerUseArtifact(outputPath, Buffer.from(base64Data, \"base64\"));\n return outputPath;\n}\n\nfunction screenshotPointerType(value: unknown): \"s3\" | \"expired\" | null {\n if (typeof value !== \"object\" || value === null) {\n return null;\n }\n const type = (value as { readonly type?: unknown }).type;\n return type === \"s3\" || type === \"expired\" ? type : null;\n}\n\nasync function writeScreenshotBytes(\n result: Record<string, unknown>,\n buffer: Buffer,\n mimeType: string,\n): Promise<string> {\n const appName = sanitizeFilenamePart(result.app, \"app\");\n const snapshotId = sanitizeFilenamePart(result.snapshotId, \"snapshot\");\n const outputPath = join(\n computerUseOutputDir(),\n `${appName}-${snapshotId}.${extensionForMimeType(mimeType)}`,\n );\n\n await writeComputerUseArtifact(outputPath, buffer);\n return outputPath;\n}\n\nasync function writeAppStateText(\n result: Record<string, unknown>,\n appState: string,\n): Promise<string> {\n const appName = sanitizeFilenamePart(result.app, \"app\");\n const snapshotId = sanitizeFilenamePart(result.snapshotId, \"snapshot\");\n const outputPath = join(\n computerUseOutputDir(),\n `${appName}-${snapshotId}.appState.txt`,\n );\n\n await writeComputerUseArtifact(outputPath, appState);\n return outputPath;\n}\n\nfunction compactActionResult(\n action: Record<string, unknown>,\n): Record<string, unknown> {\n const compact: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(action)) {\n if (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n ) {\n compact[key] = value;\n }\n }\n return compact;\n}\n\nexport async function formatComputerUseResultForConsole(\n result: Record<string, unknown>,\n commandId: string,\n): Promise<string> {\n const printable: Record<string, unknown> = { status: \"succeeded\" };\n const apps = result.apps;\n if (Array.isArray(apps)) {\n printable.apps = apps;\n }\n const snapshotId = stringField(result, \"snapshotId\");\n if (snapshotId) {\n printable.snapshotId = snapshotId;\n }\n const appState = stringField(result, \"appState\");\n if (appState) {\n printable.appState = await writeAppStateText(result, appState);\n }\n const screenshot = result.screenshot;\n if (typeof screenshot === \"string\") {\n const screenshotPath = await writeScreenshotDataUrl(result, screenshot);\n printable.screenshot = screenshotPath ?? screenshot;\n } else {\n const pointerType = screenshotPointerType(screenshot);\n if (pointerType === \"s3\") {\n const { buffer, mimeType } = await fetchComputerUseScreenshot(commandId);\n printable.screenshot = await writeScreenshotBytes(\n result,\n buffer,\n mimeType,\n );\n } else if (pointerType === \"expired\") {\n printable.screenshot = \"[screenshot expired]\";\n }\n }\n const action = result.action;\n if (isRecord(action)) {\n printable.action = compactActionResult(action);\n }\n return JSON.stringify(printable, null, 2);\n}\n\nasync function commandOutputText(\n command: ComputerUseCommandResponse,\n): Promise<string> {\n if (!command.result) {\n return \"\";\n }\n return await formatComputerUseResultForConsole(command.result, command.id);\n}\n\nfunction pluginContentPointerType(value: unknown): \"s3\" | \"expired\" | null {\n if (!isRecord(value)) {\n return null;\n }\n const type = value.type;\n return type === \"s3\" || type === \"expired\" ? type : null;\n}\n\nfunction pluginContentFileName(value: unknown): string {\n if (!isRecord(value) || typeof value.fileName !== \"string\") {\n return \"plugin-content.bin\";\n }\n return sanitizeFilenamePart(value.fileName, \"plugin-content.bin\");\n}\n\nasync function writePluginContent(\n commandId: string,\n result: Record<string, unknown>,\n): Promise<string> {\n const downloaded = await fetchComputerUsePluginContent(commandId);\n const pointerFileName = pluginContentFileName(result.pluginContent);\n const directoryName = sanitizeFilenamePart(commandId, \"command\");\n const outputPath = join(\n computerUseOutputDir(),\n \"plugins\",\n directoryName,\n sanitizeFilenamePart(\n downloaded.fileName || pointerFileName,\n pointerFileName,\n ),\n );\n await writeComputerUseArtifact(outputPath, downloaded.buffer);\n return outputPath;\n}\n\nfunction formatHumanValue(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n if (Array.isArray(value)) {\n return value.map(formatHumanValue).join(\"\\n\");\n }\n if (value === null || value === undefined) {\n return \"\";\n }\n return JSON.stringify(value, null, 2);\n}\n\nasync function pluginCommandOutputText(\n command: ComputerUseCommandResponse,\n): Promise<string> {\n const result = command.result;\n if (!result) {\n return \"\";\n }\n const content = stringField(result, \"content\");\n if (content) {\n return content;\n }\n\n const pluginContentType = pluginContentPointerType(result.pluginContent);\n if (pluginContentType === \"s3\") {\n const outputPath = await writePluginContent(command.id, result);\n const sizeBytes =\n typeof result.sizeBytes === \"number\"\n ? ` (${result.sizeBytes} bytes)`\n : \"\";\n return `Saved plugin content${sizeBytes}: ${outputPath}`;\n }\n if (pluginContentType === \"expired\") {\n return \"Plugin content expired.\";\n }\n\n const lines: string[] = [];\n for (const [key, value] of Object.entries(result)) {\n if (key === \"pluginContent\") {\n continue;\n }\n const formatted = formatHumanValue(value);\n if (formatted) {\n lines.push(`${key}: ${formatted}`);\n }\n }\n return lines.join(\"\\n\");\n}\n\nasync function waitForCommand(\n commandId: string,\n timeoutSeconds: number,\n formatter: (\n command: ComputerUseCommandResponse,\n ) => Promise<string> = commandOutputText,\n): Promise<void> {\n const deadline = Date.now() + timeoutSeconds * 1000;\n while (Date.now() <= deadline) {\n const command = await getComputerUseCommand(commandId);\n if (command.status === \"queued\" || command.status === \"running\") {\n if (process.stdout.isTTY) {\n process.stdout.write(\".\");\n }\n await sleep(1_000);\n continue;\n }\n\n if (process.stdout.isTTY) {\n process.stdout.write(\"\\n\");\n }\n\n if (command.status === \"failed\") {\n throw new Error(\n command.error\n ? `${command.error.code}: ${command.error.message}`\n : \"Computer-use command failed\",\n );\n }\n\n const text = await formatter(command);\n if (text) {\n console.log(text);\n }\n return;\n }\n\n throw new Error(`Computer-use command timed out: ${commandId}`);\n}\n\nasync function runReadCommand(\n kind: ComputerUseReadCommandKind,\n options: ComputerUseCommandOptions,\n payload: { readonly app?: string } = {},\n): Promise<void> {\n const timeoutSeconds = parseTimeoutSeconds(options.timeout);\n try {\n const created = await createComputerUseReadCommand({\n kind,\n timeoutMs: timeoutSeconds * 1000,\n ...payload,\n });\n await waitForCommand(created.commandId, timeoutSeconds);\n } catch (error) {\n throwComputerUseAuthorizationGuidanceError(error);\n }\n}\n\nasync function runWriteCommand(\n kind: ComputerUseWriteCommandKind,\n options: ComputerUseCommandOptions,\n payload: {\n readonly app: string;\n readonly snapshotId?: string;\n readonly elementId?: string;\n readonly elementIndex?: number;\n readonly x?: number;\n readonly y?: number;\n readonly button?: \"left\" | \"right\" | \"middle\";\n readonly clickCount?: number;\n readonly direction?: \"up\" | \"down\" | \"left\" | \"right\";\n readonly pages?: number;\n readonly value?: string;\n readonly text?: string;\n readonly key?: string;\n readonly action?: string;\n },\n): Promise<void> {\n const timeoutSeconds = parseTimeoutSeconds(options.timeout);\n try {\n const created = await createComputerUseWriteCommand({\n kind,\n timeoutMs: timeoutSeconds * 1000,\n ...payload,\n });\n await waitForCommand(created.commandId, timeoutSeconds);\n } catch (error) {\n throwComputerUseAuthorizationGuidanceError(error);\n }\n}\n\nfunction parseArgumentsJson(\n value: string | undefined,\n): Record<string, unknown> {\n if (!value) {\n return {};\n }\n const parsed: unknown = JSON.parse(value);\n if (!isRecord(parsed)) {\n throw new Error(\"arguments-json must be a JSON object\");\n }\n return parsed;\n}\n\nfunction withArgumentsJson(\n options: ComputerUsePluginOptions,\n fallback: Record<string, unknown>,\n): Record<string, unknown> {\n return options.argumentsJson\n ? parseArgumentsJson(options.argumentsJson)\n : fallback;\n}\n\nfunction parseOptionalPositiveInteger(\n value: string | undefined,\n label: string,\n): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n return parsePositiveInteger(value, label);\n}\n\nasync function runFilesystemPluginCommand(\n tool: ComputerUseFilesystemTool,\n options: ComputerUsePluginOptions,\n args: Record<string, unknown>,\n): Promise<void> {\n const timeoutSeconds = parseTimeoutSeconds(options.timeout);\n const body: ComputerUsePluginCallBody = {\n plugin: COMPUTER_USE_FILESYSTEM_PLUGIN,\n tool,\n arguments: args,\n timeoutMs: timeoutSeconds * 1000,\n };\n try {\n const created = await createComputerUsePluginCommand(body);\n await waitForCommand(\n created.commandId,\n timeoutSeconds,\n pluginCommandOutputText,\n );\n } catch (error) {\n throwComputerUseAuthorizationGuidanceError(error);\n }\n}\n\nfunction addTargetOptions(command: Command): Command {\n return command.option(\"--timeout <seconds>\", \"Maximum time to wait\", \"30\");\n}\n\nfunction addPluginOptions(command: Command): Command {\n return addTargetOptions(command).option(\n \"--arguments-json <json>\",\n \"Raw tool arguments object for advanced cases\",\n );\n}\n\nfunction appOption(command: Command): Command {\n return command.requiredOption(\n \"--app <bundleId>\",\n \"Target app bundle id (e.g. com.google.Chrome); run list-apps to find it\",\n );\n}\n\nconst listAppsCommand = addTargetOptions(\n new Command()\n .name(\"list-apps\")\n .description(\"List apps available to the Desktop Computer Use host\")\n .action(\n withErrorHandler(async (options: ComputerUseCommandOptions) => {\n await runReadCommand(\"apps.list\", options);\n }),\n ),\n);\n\nconst getAppStateCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"get-app-state\")\n .description(\n \"Get screenshot and accessibility state without activating an app\",\n )\n .action(\n withErrorHandler(async (options: ComputerUseAppOptions) => {\n await runReadCommand(\"app.state\", options, { app: options.app });\n }),\n ),\n ),\n);\n\nconst clickCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"click\")\n .description(\n \"Click an accessibility element or background screenshot coordinate\",\n )\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .option(\"--element <id>\", \"Element id from get-app-state\")\n .option(\"--element-index <index>\", \"Element index from get-app-state\")\n .option(\"--x <points>\", \"Screenshot x coordinate fallback\")\n .option(\"--y <points>\", \"Screenshot y coordinate fallback\")\n .option(\"--button <button>\", \"Mouse button\", \"left\")\n .option(\"--click-count <count>\", \"Number of clicks\", \"1\")\n .action(\n withErrorHandler(async (options: ComputerUseClickOptions) => {\n const x = parseOptionalNonNegativeInteger(options.x, \"x\");\n const y = parseOptionalNonNegativeInteger(options.y, \"y\");\n const elementIndex = parseOptionalNonNegativeInteger(\n options.elementIndex,\n \"element-index\",\n );\n await runWriteCommand(\"element.click\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n ...(options.element ? { elementId: options.element } : {}),\n ...(elementIndex !== undefined ? { elementIndex } : {}),\n ...(x !== undefined ? { x } : {}),\n ...(y !== undefined ? { y } : {}),\n button: parseMouseButton(options.button),\n clickCount: parsePositiveInteger(options.clickCount, \"click-count\"),\n });\n }),\n ),\n ),\n);\n\nconst scrollCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"scroll\")\n .description(\"Scroll an accessibility element\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .option(\"--element <id>\", \"Element id from get-app-state\")\n .option(\"--element-index <index>\", \"Element index from get-app-state\")\n .requiredOption(\n \"--direction <direction>\",\n \"Scroll direction: up, down, left, or right\",\n )\n .option(\"--pages <count>\", \"Number of pages to scroll\", \"1\")\n .action(\n withErrorHandler(async (options: ComputerUseScrollOptions) => {\n await runWriteCommand(\"element.scroll\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n ...elementTargetPayload(options),\n direction: options.direction,\n pages: parsePositiveNumber(options.pages, \"pages\"),\n });\n }),\n ),\n ),\n);\n\nconst setValueCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"set-value\")\n .description(\"Set the value of a settable accessibility element\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .option(\"--element <id>\", \"Element id from get-app-state\")\n .option(\"--element-index <index>\", \"Element index from get-app-state\")\n .requiredOption(\"--value <text>\", \"Value to assign\")\n .action(\n withErrorHandler(async (options: ComputerUseSetValueOptions) => {\n await runWriteCommand(\"element.set_value\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n ...elementTargetPayload(options),\n value: options.value,\n });\n }),\n ),\n ),\n);\n\nconst typeTextCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"type-text\")\n .description(\"Type literal keyboard input into the target app\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .requiredOption(\"--text <text>\", \"Text to type\")\n .action(\n withErrorHandler(async (options: ComputerUseTypeTextOptions) => {\n await runWriteCommand(\"keyboard.type_text\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n text: options.text,\n });\n }),\n ),\n ),\n);\n\nconst pressKeyCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"press-key\")\n .description(\"Send a background key or key combination to the target app\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .requiredOption(\n \"--key <key>\",\n \"Key or xdotool-style combination, for example Command+K, shift+semicolon, or Control_L+J\",\n )\n .action(\n withErrorHandler(async (options: ComputerUsePressKeyOptions) => {\n await runWriteCommand(\"keyboard.press_key\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n key: options.key,\n });\n }),\n ),\n ),\n);\n\nconst performActionCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"perform-action\")\n .description(\"Invoke a secondary accessibility action\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .option(\"--element <id>\", \"Element id from get-app-state\")\n .option(\"--element-index <index>\", \"Element index from get-app-state\")\n .requiredOption(\"--action <name>\", \"Accessibility action name\")\n .action(\n withErrorHandler(async (options: ComputerUsePerformActionOptions) => {\n await runWriteCommand(\"element.perform_action\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n ...elementTargetPayload(options),\n action: options.action,\n });\n }),\n ),\n ),\n);\n\nconst openAppCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"open-app\")\n .description(\"Open an app on the Desktop host without activating it\")\n .action(\n withErrorHandler(async (options: ComputerUseAppOptions) => {\n await runWriteCommand(\"app.open\", options, { app: options.app });\n }),\n ),\n ),\n);\n\nconst filesystemListAllowedDirectoriesCommand = addPluginOptions(\n new Command()\n .name(\"list_allowed_directories\")\n .description(\"List directories enabled in Zero Desktop\")\n .action(\n withErrorHandler(async (options: ComputerUsePluginOptions) => {\n await runFilesystemPluginCommand(\n \"list_allowed_directories\",\n options,\n withArgumentsJson(options, {}),\n );\n }),\n ),\n);\n\nconst filesystemReadTextFileCommand = addPluginOptions(\n new Command()\n .name(\"read_text_file\")\n .description(\"Read a text file\")\n .requiredOption(\"--path <path>\", \"File path\")\n .option(\"--head <lines>\", \"Read the first N lines\")\n .option(\"--tail <lines>\", \"Read the last N lines\")\n .action(\n withErrorHandler(async (options: FilesystemReadTextOptions) => {\n await runFilesystemPluginCommand(\n \"read_text_file\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n ...(options.head\n ? { head: parseOptionalPositiveInteger(options.head, \"head\") }\n : {}),\n ...(options.tail\n ? { tail: parseOptionalPositiveInteger(options.tail, \"tail\") }\n : {}),\n }),\n );\n }),\n ),\n);\n\nconst filesystemReadMediaFileCommand = addPluginOptions(\n new Command()\n .name(\"read_media_file\")\n .description(\"Read an image or audio file\")\n .requiredOption(\"--path <path>\", \"File path\")\n .action(\n withErrorHandler(async (options: FilesystemPathOptions) => {\n await runFilesystemPluginCommand(\n \"read_media_file\",\n options,\n withArgumentsJson(options, { path: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemReadMultipleFilesCommand = addPluginOptions(\n new Command()\n .name(\"read_multiple_files\")\n .description(\"Read multiple text files\")\n .requiredOption(\"--path <path...>\", \"File paths\")\n .action(\n withErrorHandler(async (options: FilesystemReadMultipleFilesOptions) => {\n await runFilesystemPluginCommand(\n \"read_multiple_files\",\n options,\n withArgumentsJson(options, { paths: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemWriteFileCommand = addPluginOptions(\n new Command()\n .name(\"write_file\")\n .description(\"Write a file\")\n .requiredOption(\"--path <path>\", \"File path\")\n .requiredOption(\"--content <text>\", \"File content\")\n .action(\n withErrorHandler(async (options: FilesystemWriteFileOptions) => {\n await runFilesystemPluginCommand(\n \"write_file\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n content: options.content,\n }),\n );\n }),\n ),\n);\n\nconst filesystemEditFileCommand = addPluginOptions(\n new Command()\n .name(\"edit_file\")\n .description(\"Edit a file\")\n .requiredOption(\"--path <path>\", \"File path\")\n .option(\"--old-text <text>\", \"Text to replace\")\n .option(\"--new-text <text>\", \"Replacement text\")\n .option(\"--dry-run\", \"Preview changes without writing\")\n .action(\n withErrorHandler(async (options: FilesystemEditFileOptions) => {\n if (\n !options.argumentsJson &&\n (!options.oldText || options.newText === undefined)\n ) {\n throw new Error(\n \"edit_file requires --old-text and --new-text, or --arguments-json\",\n );\n }\n await runFilesystemPluginCommand(\n \"edit_file\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n edits: [\n {\n oldText: options.oldText,\n newText: options.newText,\n },\n ],\n dryRun: options.dryRun === true,\n }),\n );\n }),\n ),\n);\n\nconst filesystemCreateDirectoryCommand = addPluginOptions(\n new Command()\n .name(\"create_directory\")\n .description(\"Create a directory\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .action(\n withErrorHandler(async (options: FilesystemPathOptions) => {\n await runFilesystemPluginCommand(\n \"create_directory\",\n options,\n withArgumentsJson(options, { path: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemListDirectoryCommand = addPluginOptions(\n new Command()\n .name(\"list_directory\")\n .description(\"List directory entries\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .action(\n withErrorHandler(async (options: FilesystemPathOptions) => {\n await runFilesystemPluginCommand(\n \"list_directory\",\n options,\n withArgumentsJson(options, { path: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemListDirectoryWithSizesCommand = addPluginOptions(\n new Command()\n .name(\"list_directory_with_sizes\")\n .description(\"List directory entries with sizes\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .option(\"--sort-by <field>\", \"Sort by name or size\", \"name\")\n .action(\n withErrorHandler(\n async (options: FilesystemListDirectoryWithSizesOptions) => {\n await runFilesystemPluginCommand(\n \"list_directory_with_sizes\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n sortBy: options.sortBy ?? \"name\",\n }),\n );\n },\n ),\n ),\n);\n\nconst filesystemDirectoryTreeCommand = addPluginOptions(\n new Command()\n .name(\"directory_tree\")\n .description(\"Return a directory tree\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .option(\"--exclude-pattern <pattern...>\", \"Patterns to exclude\")\n .action(\n withErrorHandler(async (options: FilesystemDirectoryTreeOptions) => {\n await runFilesystemPluginCommand(\n \"directory_tree\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n ...(options.excludePattern\n ? { excludePatterns: options.excludePattern }\n : {}),\n }),\n );\n }),\n ),\n);\n\nconst filesystemMoveFileCommand = addPluginOptions(\n new Command()\n .name(\"move_file\")\n .description(\"Move or rename a file\")\n .requiredOption(\"--source <path>\", \"Source path\")\n .requiredOption(\"--destination <path>\", \"Destination path\")\n .action(\n withErrorHandler(async (options: FilesystemMoveFileOptions) => {\n await runFilesystemPluginCommand(\n \"move_file\",\n options,\n withArgumentsJson(options, {\n source: options.source,\n destination: options.destination,\n }),\n );\n }),\n ),\n);\n\nconst filesystemSearchFilesCommand = addPluginOptions(\n new Command()\n .name(\"search_files\")\n .description(\"Search files by name\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .requiredOption(\"--pattern <pattern>\", \"Search pattern\")\n .option(\"--exclude-pattern <pattern...>\", \"Patterns to exclude\")\n .action(\n withErrorHandler(async (options: FilesystemSearchFilesOptions) => {\n await runFilesystemPluginCommand(\n \"search_files\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n pattern: options.pattern,\n ...(options.excludePattern\n ? { excludePatterns: options.excludePattern }\n : {}),\n }),\n );\n }),\n ),\n);\n\nconst filesystemGetFileInfoCommand = addPluginOptions(\n new Command()\n .name(\"get_file_info\")\n .description(\"Get file metadata\")\n .requiredOption(\"--path <path>\", \"File or directory path\")\n .action(\n withErrorHandler(async (options: FilesystemPathOptions) => {\n await runFilesystemPluginCommand(\n \"get_file_info\",\n options,\n withArgumentsJson(options, { path: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemPluginCommand = new Command()\n .name(\"filesystem\")\n .description(\"Use the Zero Desktop filesystem plugin\")\n .addCommand(filesystemListAllowedDirectoriesCommand)\n .addCommand(filesystemReadTextFileCommand)\n .addCommand(filesystemReadMediaFileCommand)\n .addCommand(filesystemReadMultipleFilesCommand)\n .addCommand(filesystemWriteFileCommand)\n .addCommand(filesystemEditFileCommand)\n .addCommand(filesystemCreateDirectoryCommand)\n .addCommand(filesystemListDirectoryCommand)\n .addCommand(filesystemListDirectoryWithSizesCommand)\n .addCommand(filesystemDirectoryTreeCommand)\n .addCommand(filesystemMoveFileCommand)\n .addCommand(filesystemSearchFilesCommand)\n .addCommand(filesystemGetFileInfoCommand);\n\nconst pluginCommand = addTargetOptions(\n new Command()\n .name(\"plugin\")\n .description(\"Use Desktop Computer Use plugins\")\n .addCommand(filesystemPluginCommand),\n);\n\nexport const zeroComputerUseCommand = new Command()\n .name(\"computer-use\")\n .description(\"Desktop app computer use through Zero CLI\")\n .addHelpText(\"after\", COMPUTER_USE_HELP_TEXT)\n .addCommand(listAppsCommand)\n .addCommand(getAppStateCommand)\n .addCommand(clickCommand)\n .addCommand(scrollCommand)\n .addCommand(setValueCommand)\n .addCommand(typeTextCommand)\n .addCommand(pressKeyCommand)\n .addCommand(performActionCommand)\n .addCommand(openAppCommand)\n .addCommand(pluginCommand);\n","import { randomUUID } from \"node:crypto\";\nimport type { Dirent } from \"node:fs\";\nimport {\n chmod,\n lstat,\n mkdir,\n readdir,\n rename,\n rm,\n writeFile,\n} from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport path from \"node:path\";\n\nconst COMPUTER_USE_OUTPUT_DIR_MODE = 0o700;\nconst COMPUTER_USE_OUTPUT_FILE_MODE = 0o600;\nconst COMPUTER_USE_OUTPUT_TTL_MS = 24 * 60 * 60 * 1000;\nconst DEFAULT_COMPUTER_USE_OUTPUT_DIR = path.join(\n tmpdir(),\n \"vm0\",\n \"computer-use\",\n);\n\nexport function computerUseOutputDir(): string {\n const configured = process.env.VM0_COMPUTER_OUTPUT_DIR?.trim();\n return configured && configured.length > 0\n ? configured\n : DEFAULT_COMPUTER_USE_OUTPUT_DIR;\n}\n\nasync function ensurePrivateDirectory(directory: string): Promise<void> {\n await mkdir(directory, {\n recursive: true,\n mode: COMPUTER_USE_OUTPUT_DIR_MODE,\n });\n const stats = await lstat(directory);\n if (!stats.isDirectory() || stats.isSymbolicLink()) {\n throw new Error(\n `Computer-use output path is not a directory: ${directory}`,\n );\n }\n await chmod(directory, COMPUTER_USE_OUTPUT_DIR_MODE);\n}\n\nasync function removeStaleEntries(\n directory: string,\n cutoffMs: number,\n): Promise<void> {\n let entries: Dirent[];\n try {\n entries = await readdir(directory, { withFileTypes: true });\n } catch (error) {\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return;\n }\n throw error;\n }\n\n for (const entry of entries) {\n const entryPath = path.join(directory, entry.name);\n const stats = await lstat(entryPath).catch(() => {\n return null;\n });\n if (!stats) {\n continue;\n }\n if (entry.isDirectory() && !stats.isSymbolicLink()) {\n await removeStaleEntries(entryPath, cutoffMs);\n continue;\n }\n if (stats.mtimeMs < cutoffMs) {\n await rm(entryPath, { force: true, recursive: entry.isDirectory() });\n }\n }\n}\n\nasync function prepareComputerUseOutputDir(): Promise<string> {\n const outputDir = computerUseOutputDir();\n await ensurePrivateDirectory(outputDir);\n await removeStaleEntries(outputDir, Date.now() - COMPUTER_USE_OUTPUT_TTL_MS);\n return outputDir;\n}\n\nasync function ensureOutputPathDirectory(outputPath: string): Promise<void> {\n const outputDir = await prepareComputerUseOutputDir();\n const directory = path.dirname(outputPath);\n const relative = path.relative(outputDir, directory);\n if (relative.startsWith(\"..\") || path.isAbsolute(relative)) {\n throw new Error(`Computer-use artifact path escapes output directory`);\n }\n\n let current = outputDir;\n for (const part of relative.split(path.sep).filter(Boolean)) {\n current = path.join(current, part);\n await ensurePrivateDirectory(current);\n }\n}\n\nexport async function writeComputerUseArtifact(\n outputPath: string,\n data: string | Buffer,\n): Promise<void> {\n await ensureOutputPathDirectory(outputPath);\n const tempPath = path.join(\n path.dirname(outputPath),\n `.${path.basename(outputPath)}.${process.pid.toString()}.${randomUUID()}.tmp`,\n );\n let moved = false;\n try {\n await writeFile(tempPath, data, {\n flag: \"wx\",\n mode: COMPUTER_USE_OUTPUT_FILE_MODE,\n });\n await chmod(tempPath, COMPUTER_USE_OUTPUT_FILE_MODE);\n await rename(tempPath, outputPath);\n moved = true;\n await chmod(outputPath, COMPUTER_USE_OUTPUT_FILE_MODE);\n } finally {\n if (!moved) {\n await rm(tempPath, { force: true });\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,YAAY;;;ACArB;AAAA,SAAS,kBAAkB;AAE3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,OAAO,UAAU;AAEjB,IAAM,+BAA+B;AACrC,IAAM,gCAAgC;AACtC,IAAM,6BAA6B,KAAK,KAAK,KAAK;AAClD,IAAM,kCAAkC,KAAK;AAAA,EAC3C,OAAO;AAAA,EACP;AAAA,EACA;AACF;AAEO,SAAS,uBAA+B;AAC7C,QAAM,aAAa,QAAQ,IAAI,yBAAyB,KAAK;AAC7D,SAAO,cAAc,WAAW,SAAS,IACrC,aACA;AACN;AAEA,eAAe,uBAAuB,WAAkC;AACtE,QAAM,MAAM,WAAW;AAAA,IACrB,WAAW;AAAA,IACX,MAAM;AAAA,EACR,CAAC;AACD,QAAM,QAAQ,MAAM,MAAM,SAAS;AACnC,MAAI,CAAC,MAAM,YAAY,KAAK,MAAM,eAAe,GAAG;AAClD,UAAM,IAAI;AAAA,MACR,gDAAgD,SAAS;AAAA,IAC3D;AAAA,EACF;AACA,QAAM,MAAM,WAAW,4BAA4B;AACrD;AAEA,e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js
CHANGED
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
} from "./chunk-JUTUEPIR.js";
|
|
97
97
|
import {
|
|
98
98
|
configureGlobalProxyFromEnv
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-VODAZPIN.js";
|
|
100
100
|
import "./chunk-LRHXR7JT.js";
|
|
101
101
|
import {
|
|
102
102
|
Command,
|
|
@@ -434,7 +434,7 @@ function getConfigPath() {
|
|
|
434
434
|
return join(os.homedir(), ".vm0", "config.json");
|
|
435
435
|
}
|
|
436
436
|
var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
|
|
437
|
-
console.log(source_default.bold(`VM0 CLI v${"9.221.
|
|
437
|
+
console.log(source_default.bold(`VM0 CLI v${"9.221.7"}`));
|
|
438
438
|
console.log();
|
|
439
439
|
const config = await loadConfig();
|
|
440
440
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -1137,7 +1137,7 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
1137
1137
|
options.autoUpdate = false;
|
|
1138
1138
|
}
|
|
1139
1139
|
if (options.autoUpdate !== false) {
|
|
1140
|
-
await startSilentUpgrade("9.221.
|
|
1140
|
+
await startSilentUpgrade("9.221.7");
|
|
1141
1141
|
}
|
|
1142
1142
|
try {
|
|
1143
1143
|
const { config, agentName, agent, basePath } = await loadAndValidateConfig(resolvedConfigFile);
|
|
@@ -1234,7 +1234,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
1234
1234
|
withErrorHandler(
|
|
1235
1235
|
async (identifier, prompt, options) => {
|
|
1236
1236
|
if (options.autoUpdate !== false) {
|
|
1237
|
-
await startSilentUpgrade("9.221.
|
|
1237
|
+
await startSilentUpgrade("9.221.7");
|
|
1238
1238
|
}
|
|
1239
1239
|
const { name, version } = parseIdentifier(identifier);
|
|
1240
1240
|
let composeId;
|
|
@@ -3093,13 +3093,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
3093
3093
|
if (latestVersion === null) {
|
|
3094
3094
|
throw new Error("Could not check for updates. Please try again later.");
|
|
3095
3095
|
}
|
|
3096
|
-
if (latestVersion === "9.221.
|
|
3097
|
-
console.log(source_default.green(`\u2713 Already up to date (${"9.221.
|
|
3096
|
+
if (latestVersion === "9.221.7") {
|
|
3097
|
+
console.log(source_default.green(`\u2713 Already up to date (${"9.221.7"})`));
|
|
3098
3098
|
return;
|
|
3099
3099
|
}
|
|
3100
3100
|
console.log(
|
|
3101
3101
|
source_default.yellow(
|
|
3102
|
-
`Current version: ${"9.221.
|
|
3102
|
+
`Current version: ${"9.221.7"} -> Latest version: ${latestVersion}`
|
|
3103
3103
|
)
|
|
3104
3104
|
);
|
|
3105
3105
|
console.log();
|
|
@@ -3126,7 +3126,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
3126
3126
|
const success = await performUpgrade(packageManager);
|
|
3127
3127
|
if (success) {
|
|
3128
3128
|
console.log(
|
|
3129
|
-
source_default.green(`\u2713 Upgraded from ${"9.221.
|
|
3129
|
+
source_default.green(`\u2713 Upgraded from ${"9.221.7"} to ${latestVersion}`)
|
|
3130
3130
|
);
|
|
3131
3131
|
return;
|
|
3132
3132
|
}
|
|
@@ -3193,7 +3193,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
|
|
|
3193
3193
|
|
|
3194
3194
|
// src/index.ts
|
|
3195
3195
|
var program = new Command();
|
|
3196
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.221.
|
|
3196
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.221.7");
|
|
3197
3197
|
program.addCommand(authCommand);
|
|
3198
3198
|
program.addCommand(infoCommand);
|
|
3199
3199
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
configureGlobalProxyFromEnv
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VODAZPIN.js";
|
|
7
7
|
import {
|
|
8
8
|
decodeZeroTokenPayload
|
|
9
9
|
} from "./chunk-LRHXR7JT.js";
|
|
@@ -219,7 +219,7 @@ var ZERO_COMMAND_DEFINITIONS = [
|
|
|
219
219
|
name: "computer-use",
|
|
220
220
|
description: "Desktop app computer use through Zero CLI",
|
|
221
221
|
load: async () => {
|
|
222
|
-
return (await import("./computer-use-
|
|
222
|
+
return (await import("./computer-use-DSI7XSVO.js")).zeroComputerUseCommand;
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
225
|
{
|
|
@@ -370,7 +370,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
370
370
|
var program = new Command();
|
|
371
371
|
program.name("zero").description(
|
|
372
372
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
373
|
-
).version("9.221.
|
|
373
|
+
).version("9.221.7").addHelpText("after", () => {
|
|
374
374
|
return buildZeroHelpText();
|
|
375
375
|
});
|
|
376
376
|
if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/zero/computer-use/index.ts"],"sourcesContent":["import { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { Command } from \"commander\";\nimport type {\n ComputerUseCommandResponse,\n ComputerUseReadCommandKind,\n ComputerUseWriteCommandKind,\n} from \"@vm0/api-contracts/contracts/zero-computer-use\";\nimport {\n COMPUTER_USE_FILESYSTEM_PLUGIN,\n type ComputerUseFilesystemTool,\n type ComputerUsePluginCallBody,\n} from \"@vm0/api-contracts/contracts/zero-computer-use-plugins\";\nimport {\n ApiRequestError,\n createComputerUsePluginCommand,\n createComputerUseReadCommand,\n createComputerUseWriteCommand,\n fetchComputerUsePluginContent,\n fetchComputerUseScreenshot,\n getComputerUseCommand,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command/with-error-handler\";\n\ninterface ComputerUseCommandOptions {\n readonly timeout?: string;\n}\n\ninterface ComputerUseAppOptions extends ComputerUseCommandOptions {\n readonly app: string;\n}\n\ninterface ComputerUseClickOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly element?: string;\n readonly elementIndex?: string;\n readonly x?: string;\n readonly y?: string;\n readonly button?: \"left\" | \"right\" | \"middle\";\n readonly clickCount?: string;\n}\n\ninterface ComputerUseScrollOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly element?: string;\n readonly elementIndex?: string;\n readonly direction: \"up\" | \"down\" | \"left\" | \"right\";\n readonly pages?: string;\n}\n\ninterface ComputerUseSetValueOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly element?: string;\n readonly elementIndex?: string;\n readonly value: string;\n}\n\ninterface ComputerUsePerformActionOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly element?: string;\n readonly elementIndex?: string;\n readonly action: string;\n}\n\ninterface ComputerUseTypeTextOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly text: string;\n}\n\ninterface ComputerUsePressKeyOptions extends ComputerUseAppOptions {\n readonly snapshotId?: string;\n readonly key: string;\n}\n\ninterface ComputerUsePluginOptions extends ComputerUseCommandOptions {\n readonly argumentsJson?: string;\n}\n\ninterface FilesystemPathOptions extends ComputerUsePluginOptions {\n readonly path: string;\n}\n\ninterface FilesystemReadTextOptions extends FilesystemPathOptions {\n readonly head?: string;\n readonly tail?: string;\n}\n\ninterface FilesystemReadMultipleFilesOptions extends ComputerUsePluginOptions {\n readonly path: readonly string[];\n}\n\ninterface FilesystemWriteFileOptions extends FilesystemPathOptions {\n readonly content: string;\n}\n\ninterface FilesystemEditFileOptions extends FilesystemPathOptions {\n readonly oldText?: string;\n readonly newText?: string;\n readonly dryRun?: boolean;\n}\n\ninterface FilesystemListDirectoryWithSizesOptions extends FilesystemPathOptions {\n readonly sortBy?: \"name\" | \"size\";\n}\n\ninterface FilesystemDirectoryTreeOptions extends FilesystemPathOptions {\n readonly excludePattern?: readonly string[];\n}\n\ninterface FilesystemMoveFileOptions extends ComputerUsePluginOptions {\n readonly source: string;\n readonly destination: string;\n}\n\ninterface FilesystemSearchFilesOptions extends FilesystemPathOptions {\n readonly pattern: string;\n readonly excludePattern?: readonly string[];\n}\n\nconst COMPUTER_USE_OUTPUT_DIR = \"/tmp/vm0/computer-use\";\nconst COMPUTER_USE_PLUGIN_OUTPUT_DIR = `${COMPUTER_USE_OUTPUT_DIR}/plugins`;\nconst DATA_URL_PATTERN = /^data:([^;,]+);base64,(.*)$/s;\nconst COMPUTER_USE_REQUIRED_CAPABILITY_MESSAGE =\n \"Missing required capability: computer-use:write\";\nconst COMPUTER_USE_AUTHORIZATION_REQUIRED_ERROR =\n \"COMPUTER_USE_AUTHORIZATION_REQUIRED\";\nconst COMPUTER_USE_HELP_TEXT = `\nWorkflow:\n 1. Start the Zero Desktop app and make sure Computer Use is online.\n 2. Run \"zero computer-use list-apps\" to find the target app's bundleId.\n --app accepts a bundle id only (e.g. com.google.Chrome); the name is for\n display. Apps listed without a bundleId cannot be targeted.\n 3. Run \"zero computer-use get-app-state --app <bundleId>\" to get a screenshot,\n snapshotId, visible element indexes, and accessibility state.\n 4. Prefer element actions with --snapshot-id and --element-index. Use --x/--y\n only when the target is visible in the returned screenshot but has no useful\n accessibility element.\n 5. Read the JSON result. Screenshot and App State data are saved under\n /tmp/vm0/computer-use and replaced with local file paths in CLI output.\n Files are named from app and snapshotId; rerunning the same snapshot\n overwrites the same files.\n\nNotes:\n Write commands are sent to the connected Desktop host. Coordinate fallbacks use\n screenshot coordinates from get-app-state; pass the matching --snapshot-id when\n acting on a prior snapshot.\n type-text sends literal keyboard input to the target app's current focus. It\n first verifies the focused element is editable and fails with\n element_not_editable when it is not (for example a focused table or list), so\n click into a text field before typing. Use set-value when you need\n deterministic accessibility value assignment.\n press-key accepts xdotool-style names such as shift+semicolon, Control_L+J,\n ctrl+alt+n, and BackSpace, plus existing macOS-style forms such as Command+L.\n type-text and press-key accept the same --snapshot-id as the element actions:\n pass it to deliver keyboard input to that snapshot's window. Without it, the\n most relevant window for the app is picked, which is ambiguous for multi-window\n apps.\n\nExamples:\n List available apps:\n zero computer-use list-apps\n\n Inspect Safari state:\n zero computer-use get-app-state --app com.apple.Safari\n\n Click element index 7 from snapshot desktop_abc:\n zero computer-use click --app com.apple.Safari --snapshot-id desktop_abc --element-index 7\n\n Click screenshot coordinate (320, 240) from snapshot desktop_abc:\n zero computer-use click --app com.apple.Safari --snapshot-id desktop_abc --x 320 --y 240\n\n Type text into the snapshot desktop_abc window in Safari:\n zero computer-use type-text --app com.apple.Safari --snapshot-id desktop_abc --text \"Hello\"\n\n Press a keyboard shortcut in the snapshot desktop_abc window:\n zero computer-use press-key --app com.apple.Safari --snapshot-id desktop_abc --key shift+semicolon\n\n Open an app without activating the current foreground app:\n zero computer-use open-app --app com.culturedcode.ThingsMac`;\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n\nfunction throwComputerUseAuthorizationGuidanceError(error: unknown): never {\n if (\n error instanceof ApiRequestError &&\n error.status === 403 &&\n error.code === \"FORBIDDEN\" &&\n error.message === COMPUTER_USE_REQUIRED_CAPABILITY_MESSAGE\n ) {\n throw new ApiRequestError(\n \"Computer Use authorization required\",\n COMPUTER_USE_AUTHORIZATION_REQUIRED_ERROR,\n 403,\n );\n }\n\n throw error;\n}\n\nfunction parseTimeoutSeconds(value: string | undefined): number {\n if (!value) return 30;\n const seconds = Number.parseInt(value, 10);\n if (!Number.isFinite(seconds) || seconds <= 0) {\n throw new Error(\"Timeout must be a positive number of seconds\");\n }\n return seconds;\n}\n\nfunction parseOptionalNonNegativeInteger(\n value: string | undefined,\n label: string,\n): number | undefined {\n if (value === undefined) return undefined;\n const parsed = Number.parseInt(value, 10);\n if (!Number.isFinite(parsed) || parsed < 0) {\n throw new Error(`${label} must be a non-negative integer`);\n }\n return parsed;\n}\n\nfunction parsePositiveInteger(\n value: string | undefined,\n label: string,\n): number {\n if (value === undefined) {\n throw new Error(`${label} is required`);\n }\n const parsed = Number.parseInt(value, 10);\n if (!Number.isFinite(parsed) || parsed <= 0) {\n throw new Error(`${label} must be a positive integer`);\n }\n return parsed;\n}\n\nfunction parsePositiveNumber(\n value: string | undefined,\n label: string,\n): number | undefined {\n if (value === undefined) return undefined;\n const parsed = Number.parseFloat(value);\n if (!Number.isFinite(parsed) || parsed <= 0) {\n throw new Error(`${label} must be a positive number`);\n }\n return parsed;\n}\n\nfunction parseMouseButton(\n value: string | undefined,\n): \"left\" | \"right\" | \"middle\" {\n if (value === \"left\" || value === \"right\" || value === \"middle\") {\n return value;\n }\n throw new Error(\"button must be left, right, or middle\");\n}\n\nfunction elementTargetPayload(options: {\n readonly element?: string;\n readonly elementIndex?: string;\n}): { readonly elementId?: string; readonly elementIndex?: number } {\n const elementIndex = parseOptionalNonNegativeInteger(\n options.elementIndex,\n \"element-index\",\n );\n if (!options.element && elementIndex === undefined) {\n throw new Error(\"element or element-index is required\");\n }\n return {\n ...(options.element ? { elementId: options.element } : {}),\n ...(elementIndex !== undefined ? { elementIndex } : {}),\n };\n}\n\nfunction sanitizeFilenamePart(value: unknown, fallback: string): string {\n if (typeof value !== \"string\") {\n return fallback;\n }\n const sanitized = value\n .trim()\n .replace(/[^A-Za-z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 80);\n return sanitized.length > 0 ? sanitized : fallback;\n}\n\nfunction extensionForMimeType(mimeType: string): string {\n if (mimeType === \"image/png\") {\n return \"png\";\n }\n if (mimeType === \"image/jpeg\") {\n return \"jpg\";\n }\n if (mimeType === \"image/webp\") {\n return \"webp\";\n }\n const suffix = mimeType.startsWith(\"image/\") ? mimeType.slice(6) : \"bin\";\n return sanitizeFilenamePart(suffix, \"bin\").toLowerCase();\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction stringField(\n value: Record<string, unknown>,\n key: string,\n): string | undefined {\n const field = value[key];\n return typeof field === \"string\" ? field : undefined;\n}\n\nasync function writeScreenshotDataUrl(\n result: Record<string, unknown>,\n dataUrl: string,\n): Promise<string | null> {\n const match = DATA_URL_PATTERN.exec(dataUrl);\n if (!match) {\n return null;\n }\n\n const mimeType = match[1] ?? \"\";\n if (!mimeType.startsWith(\"image/\")) {\n throw new Error(`Unsupported screenshot MIME type: ${mimeType}`);\n }\n\n const base64Data = match[2] ?? \"\";\n const appName = sanitizeFilenamePart(result.app, \"app\");\n const snapshotId = sanitizeFilenamePart(result.snapshotId, \"snapshot\");\n const outputPath = join(\n COMPUTER_USE_OUTPUT_DIR,\n `${appName}-${snapshotId}.${extensionForMimeType(mimeType)}`,\n );\n\n await mkdir(COMPUTER_USE_OUTPUT_DIR, { recursive: true });\n await writeFile(outputPath, Buffer.from(base64Data, \"base64\"));\n return outputPath;\n}\n\nfunction screenshotPointerType(value: unknown): \"s3\" | \"expired\" | null {\n if (typeof value !== \"object\" || value === null) {\n return null;\n }\n const type = (value as { readonly type?: unknown }).type;\n return type === \"s3\" || type === \"expired\" ? type : null;\n}\n\nasync function writeScreenshotBytes(\n result: Record<string, unknown>,\n buffer: Buffer,\n mimeType: string,\n): Promise<string> {\n const appName = sanitizeFilenamePart(result.app, \"app\");\n const snapshotId = sanitizeFilenamePart(result.snapshotId, \"snapshot\");\n const outputPath = join(\n COMPUTER_USE_OUTPUT_DIR,\n `${appName}-${snapshotId}.${extensionForMimeType(mimeType)}`,\n );\n\n await mkdir(COMPUTER_USE_OUTPUT_DIR, { recursive: true });\n await writeFile(outputPath, buffer);\n return outputPath;\n}\n\nasync function writeAppStateText(\n result: Record<string, unknown>,\n appState: string,\n): Promise<string> {\n const appName = sanitizeFilenamePart(result.app, \"app\");\n const snapshotId = sanitizeFilenamePart(result.snapshotId, \"snapshot\");\n const outputPath = join(\n COMPUTER_USE_OUTPUT_DIR,\n `${appName}-${snapshotId}.appState.txt`,\n );\n\n await mkdir(COMPUTER_USE_OUTPUT_DIR, { recursive: true });\n await writeFile(outputPath, appState, \"utf8\");\n return outputPath;\n}\n\nfunction compactActionResult(\n action: Record<string, unknown>,\n): Record<string, unknown> {\n const compact: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(action)) {\n if (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n ) {\n compact[key] = value;\n }\n }\n return compact;\n}\n\nexport async function formatComputerUseResultForConsole(\n result: Record<string, unknown>,\n commandId: string,\n): Promise<string> {\n const printable: Record<string, unknown> = { status: \"succeeded\" };\n const apps = result.apps;\n if (Array.isArray(apps)) {\n printable.apps = apps;\n }\n const snapshotId = stringField(result, \"snapshotId\");\n if (snapshotId) {\n printable.snapshotId = snapshotId;\n }\n const appState = stringField(result, \"appState\");\n if (appState) {\n printable.appState = await writeAppStateText(result, appState);\n }\n const screenshot = result.screenshot;\n if (typeof screenshot === \"string\") {\n const screenshotPath = await writeScreenshotDataUrl(result, screenshot);\n printable.screenshot = screenshotPath ?? screenshot;\n } else {\n const pointerType = screenshotPointerType(screenshot);\n if (pointerType === \"s3\") {\n const { buffer, mimeType } = await fetchComputerUseScreenshot(commandId);\n printable.screenshot = await writeScreenshotBytes(\n result,\n buffer,\n mimeType,\n );\n } else if (pointerType === \"expired\") {\n printable.screenshot = \"[screenshot expired]\";\n }\n }\n const action = result.action;\n if (isRecord(action)) {\n printable.action = compactActionResult(action);\n }\n return JSON.stringify(printable, null, 2);\n}\n\nasync function commandOutputText(\n command: ComputerUseCommandResponse,\n): Promise<string> {\n if (!command.result) {\n return \"\";\n }\n return await formatComputerUseResultForConsole(command.result, command.id);\n}\n\nfunction pluginContentPointerType(value: unknown): \"s3\" | \"expired\" | null {\n if (!isRecord(value)) {\n return null;\n }\n const type = value.type;\n return type === \"s3\" || type === \"expired\" ? type : null;\n}\n\nfunction pluginContentFileName(value: unknown): string {\n if (!isRecord(value) || typeof value.fileName !== \"string\") {\n return \"plugin-content.bin\";\n }\n return sanitizeFilenamePart(value.fileName, \"plugin-content.bin\");\n}\n\nasync function writePluginContent(\n commandId: string,\n result: Record<string, unknown>,\n): Promise<string> {\n const downloaded = await fetchComputerUsePluginContent(commandId);\n const pointerFileName = pluginContentFileName(result.pluginContent);\n const directoryName = sanitizeFilenamePart(commandId, \"command\");\n const outputPath = join(\n COMPUTER_USE_PLUGIN_OUTPUT_DIR,\n directoryName,\n sanitizeFilenamePart(\n downloaded.fileName || pointerFileName,\n pointerFileName,\n ),\n );\n await mkdir(join(COMPUTER_USE_PLUGIN_OUTPUT_DIR, directoryName), {\n recursive: true,\n });\n await writeFile(outputPath, downloaded.buffer);\n return outputPath;\n}\n\nfunction formatHumanValue(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n if (Array.isArray(value)) {\n return value.map(formatHumanValue).join(\"\\n\");\n }\n if (value === null || value === undefined) {\n return \"\";\n }\n return JSON.stringify(value, null, 2);\n}\n\nasync function pluginCommandOutputText(\n command: ComputerUseCommandResponse,\n): Promise<string> {\n const result = command.result;\n if (!result) {\n return \"\";\n }\n const content = stringField(result, \"content\");\n if (content) {\n return content;\n }\n\n const pluginContentType = pluginContentPointerType(result.pluginContent);\n if (pluginContentType === \"s3\") {\n const outputPath = await writePluginContent(command.id, result);\n const sizeBytes =\n typeof result.sizeBytes === \"number\"\n ? ` (${result.sizeBytes} bytes)`\n : \"\";\n return `Saved plugin content${sizeBytes}: ${outputPath}`;\n }\n if (pluginContentType === \"expired\") {\n return \"Plugin content expired.\";\n }\n\n const lines: string[] = [];\n for (const [key, value] of Object.entries(result)) {\n if (key === \"pluginContent\") {\n continue;\n }\n const formatted = formatHumanValue(value);\n if (formatted) {\n lines.push(`${key}: ${formatted}`);\n }\n }\n return lines.join(\"\\n\");\n}\n\nasync function waitForCommand(\n commandId: string,\n timeoutSeconds: number,\n formatter: (\n command: ComputerUseCommandResponse,\n ) => Promise<string> = commandOutputText,\n): Promise<void> {\n const deadline = Date.now() + timeoutSeconds * 1000;\n while (Date.now() <= deadline) {\n const command = await getComputerUseCommand(commandId);\n if (command.status === \"queued\" || command.status === \"running\") {\n if (process.stdout.isTTY) {\n process.stdout.write(\".\");\n }\n await sleep(1_000);\n continue;\n }\n\n if (process.stdout.isTTY) {\n process.stdout.write(\"\\n\");\n }\n\n if (command.status === \"failed\") {\n throw new Error(\n command.error\n ? `${command.error.code}: ${command.error.message}`\n : \"Computer-use command failed\",\n );\n }\n\n const text = await formatter(command);\n if (text) {\n console.log(text);\n }\n return;\n }\n\n throw new Error(`Computer-use command timed out: ${commandId}`);\n}\n\nasync function runReadCommand(\n kind: ComputerUseReadCommandKind,\n options: ComputerUseCommandOptions,\n payload: { readonly app?: string } = {},\n): Promise<void> {\n const timeoutSeconds = parseTimeoutSeconds(options.timeout);\n try {\n const created = await createComputerUseReadCommand({\n kind,\n timeoutMs: timeoutSeconds * 1000,\n ...payload,\n });\n await waitForCommand(created.commandId, timeoutSeconds);\n } catch (error) {\n throwComputerUseAuthorizationGuidanceError(error);\n }\n}\n\nasync function runWriteCommand(\n kind: ComputerUseWriteCommandKind,\n options: ComputerUseCommandOptions,\n payload: {\n readonly app: string;\n readonly snapshotId?: string;\n readonly elementId?: string;\n readonly elementIndex?: number;\n readonly x?: number;\n readonly y?: number;\n readonly button?: \"left\" | \"right\" | \"middle\";\n readonly clickCount?: number;\n readonly direction?: \"up\" | \"down\" | \"left\" | \"right\";\n readonly pages?: number;\n readonly value?: string;\n readonly text?: string;\n readonly key?: string;\n readonly action?: string;\n },\n): Promise<void> {\n const timeoutSeconds = parseTimeoutSeconds(options.timeout);\n try {\n const created = await createComputerUseWriteCommand({\n kind,\n timeoutMs: timeoutSeconds * 1000,\n ...payload,\n });\n await waitForCommand(created.commandId, timeoutSeconds);\n } catch (error) {\n throwComputerUseAuthorizationGuidanceError(error);\n }\n}\n\nfunction parseArgumentsJson(\n value: string | undefined,\n): Record<string, unknown> {\n if (!value) {\n return {};\n }\n const parsed: unknown = JSON.parse(value);\n if (!isRecord(parsed)) {\n throw new Error(\"arguments-json must be a JSON object\");\n }\n return parsed;\n}\n\nfunction withArgumentsJson(\n options: ComputerUsePluginOptions,\n fallback: Record<string, unknown>,\n): Record<string, unknown> {\n return options.argumentsJson\n ? parseArgumentsJson(options.argumentsJson)\n : fallback;\n}\n\nfunction parseOptionalPositiveInteger(\n value: string | undefined,\n label: string,\n): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n return parsePositiveInteger(value, label);\n}\n\nasync function runFilesystemPluginCommand(\n tool: ComputerUseFilesystemTool,\n options: ComputerUsePluginOptions,\n args: Record<string, unknown>,\n): Promise<void> {\n const timeoutSeconds = parseTimeoutSeconds(options.timeout);\n const body: ComputerUsePluginCallBody = {\n plugin: COMPUTER_USE_FILESYSTEM_PLUGIN,\n tool,\n arguments: args,\n timeoutMs: timeoutSeconds * 1000,\n };\n try {\n const created = await createComputerUsePluginCommand(body);\n await waitForCommand(\n created.commandId,\n timeoutSeconds,\n pluginCommandOutputText,\n );\n } catch (error) {\n throwComputerUseAuthorizationGuidanceError(error);\n }\n}\n\nfunction addTargetOptions(command: Command): Command {\n return command.option(\"--timeout <seconds>\", \"Maximum time to wait\", \"30\");\n}\n\nfunction addPluginOptions(command: Command): Command {\n return addTargetOptions(command).option(\n \"--arguments-json <json>\",\n \"Raw tool arguments object for advanced cases\",\n );\n}\n\nfunction appOption(command: Command): Command {\n return command.requiredOption(\n \"--app <bundleId>\",\n \"Target app bundle id (e.g. com.google.Chrome); run list-apps to find it\",\n );\n}\n\nconst listAppsCommand = addTargetOptions(\n new Command()\n .name(\"list-apps\")\n .description(\"List apps available to the Desktop Computer Use host\")\n .action(\n withErrorHandler(async (options: ComputerUseCommandOptions) => {\n await runReadCommand(\"apps.list\", options);\n }),\n ),\n);\n\nconst getAppStateCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"get-app-state\")\n .description(\n \"Get screenshot and accessibility state without activating an app\",\n )\n .action(\n withErrorHandler(async (options: ComputerUseAppOptions) => {\n await runReadCommand(\"app.state\", options, { app: options.app });\n }),\n ),\n ),\n);\n\nconst clickCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"click\")\n .description(\n \"Click an accessibility element or background screenshot coordinate\",\n )\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .option(\"--element <id>\", \"Element id from get-app-state\")\n .option(\"--element-index <index>\", \"Element index from get-app-state\")\n .option(\"--x <points>\", \"Screenshot x coordinate fallback\")\n .option(\"--y <points>\", \"Screenshot y coordinate fallback\")\n .option(\"--button <button>\", \"Mouse button\", \"left\")\n .option(\"--click-count <count>\", \"Number of clicks\", \"1\")\n .action(\n withErrorHandler(async (options: ComputerUseClickOptions) => {\n const x = parseOptionalNonNegativeInteger(options.x, \"x\");\n const y = parseOptionalNonNegativeInteger(options.y, \"y\");\n const elementIndex = parseOptionalNonNegativeInteger(\n options.elementIndex,\n \"element-index\",\n );\n await runWriteCommand(\"element.click\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n ...(options.element ? { elementId: options.element } : {}),\n ...(elementIndex !== undefined ? { elementIndex } : {}),\n ...(x !== undefined ? { x } : {}),\n ...(y !== undefined ? { y } : {}),\n button: parseMouseButton(options.button),\n clickCount: parsePositiveInteger(options.clickCount, \"click-count\"),\n });\n }),\n ),\n ),\n);\n\nconst scrollCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"scroll\")\n .description(\"Scroll an accessibility element\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .option(\"--element <id>\", \"Element id from get-app-state\")\n .option(\"--element-index <index>\", \"Element index from get-app-state\")\n .requiredOption(\n \"--direction <direction>\",\n \"Scroll direction: up, down, left, or right\",\n )\n .option(\"--pages <count>\", \"Number of pages to scroll\", \"1\")\n .action(\n withErrorHandler(async (options: ComputerUseScrollOptions) => {\n await runWriteCommand(\"element.scroll\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n ...elementTargetPayload(options),\n direction: options.direction,\n pages: parsePositiveNumber(options.pages, \"pages\"),\n });\n }),\n ),\n ),\n);\n\nconst setValueCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"set-value\")\n .description(\"Set the value of a settable accessibility element\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .option(\"--element <id>\", \"Element id from get-app-state\")\n .option(\"--element-index <index>\", \"Element index from get-app-state\")\n .requiredOption(\"--value <text>\", \"Value to assign\")\n .action(\n withErrorHandler(async (options: ComputerUseSetValueOptions) => {\n await runWriteCommand(\"element.set_value\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n ...elementTargetPayload(options),\n value: options.value,\n });\n }),\n ),\n ),\n);\n\nconst typeTextCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"type-text\")\n .description(\"Type literal keyboard input into the target app\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .requiredOption(\"--text <text>\", \"Text to type\")\n .action(\n withErrorHandler(async (options: ComputerUseTypeTextOptions) => {\n await runWriteCommand(\"keyboard.type_text\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n text: options.text,\n });\n }),\n ),\n ),\n);\n\nconst pressKeyCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"press-key\")\n .description(\"Send a background key or key combination to the target app\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .requiredOption(\n \"--key <key>\",\n \"Key or xdotool-style combination, for example Command+K, shift+semicolon, or Control_L+J\",\n )\n .action(\n withErrorHandler(async (options: ComputerUsePressKeyOptions) => {\n await runWriteCommand(\"keyboard.press_key\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n key: options.key,\n });\n }),\n ),\n ),\n);\n\nconst performActionCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"perform-action\")\n .description(\"Invoke a secondary accessibility action\")\n .option(\"--snapshot-id <id>\", \"Snapshot id returned by get-app-state\")\n .option(\"--element <id>\", \"Element id from get-app-state\")\n .option(\"--element-index <index>\", \"Element index from get-app-state\")\n .requiredOption(\"--action <name>\", \"Accessibility action name\")\n .action(\n withErrorHandler(async (options: ComputerUsePerformActionOptions) => {\n await runWriteCommand(\"element.perform_action\", options, {\n app: options.app,\n ...(options.snapshotId ? { snapshotId: options.snapshotId } : {}),\n ...elementTargetPayload(options),\n action: options.action,\n });\n }),\n ),\n ),\n);\n\nconst openAppCommand = appOption(\n addTargetOptions(\n new Command()\n .name(\"open-app\")\n .description(\"Open an app on the Desktop host without activating it\")\n .action(\n withErrorHandler(async (options: ComputerUseAppOptions) => {\n await runWriteCommand(\"app.open\", options, { app: options.app });\n }),\n ),\n ),\n);\n\nconst filesystemListAllowedDirectoriesCommand = addPluginOptions(\n new Command()\n .name(\"list_allowed_directories\")\n .description(\"List directories enabled in Zero Desktop\")\n .action(\n withErrorHandler(async (options: ComputerUsePluginOptions) => {\n await runFilesystemPluginCommand(\n \"list_allowed_directories\",\n options,\n withArgumentsJson(options, {}),\n );\n }),\n ),\n);\n\nconst filesystemReadTextFileCommand = addPluginOptions(\n new Command()\n .name(\"read_text_file\")\n .description(\"Read a text file\")\n .requiredOption(\"--path <path>\", \"File path\")\n .option(\"--head <lines>\", \"Read the first N lines\")\n .option(\"--tail <lines>\", \"Read the last N lines\")\n .action(\n withErrorHandler(async (options: FilesystemReadTextOptions) => {\n await runFilesystemPluginCommand(\n \"read_text_file\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n ...(options.head\n ? { head: parseOptionalPositiveInteger(options.head, \"head\") }\n : {}),\n ...(options.tail\n ? { tail: parseOptionalPositiveInteger(options.tail, \"tail\") }\n : {}),\n }),\n );\n }),\n ),\n);\n\nconst filesystemReadMediaFileCommand = addPluginOptions(\n new Command()\n .name(\"read_media_file\")\n .description(\"Read an image or audio file\")\n .requiredOption(\"--path <path>\", \"File path\")\n .action(\n withErrorHandler(async (options: FilesystemPathOptions) => {\n await runFilesystemPluginCommand(\n \"read_media_file\",\n options,\n withArgumentsJson(options, { path: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemReadMultipleFilesCommand = addPluginOptions(\n new Command()\n .name(\"read_multiple_files\")\n .description(\"Read multiple text files\")\n .requiredOption(\"--path <path...>\", \"File paths\")\n .action(\n withErrorHandler(async (options: FilesystemReadMultipleFilesOptions) => {\n await runFilesystemPluginCommand(\n \"read_multiple_files\",\n options,\n withArgumentsJson(options, { paths: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemWriteFileCommand = addPluginOptions(\n new Command()\n .name(\"write_file\")\n .description(\"Write a file\")\n .requiredOption(\"--path <path>\", \"File path\")\n .requiredOption(\"--content <text>\", \"File content\")\n .action(\n withErrorHandler(async (options: FilesystemWriteFileOptions) => {\n await runFilesystemPluginCommand(\n \"write_file\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n content: options.content,\n }),\n );\n }),\n ),\n);\n\nconst filesystemEditFileCommand = addPluginOptions(\n new Command()\n .name(\"edit_file\")\n .description(\"Edit a file\")\n .requiredOption(\"--path <path>\", \"File path\")\n .option(\"--old-text <text>\", \"Text to replace\")\n .option(\"--new-text <text>\", \"Replacement text\")\n .option(\"--dry-run\", \"Preview changes without writing\")\n .action(\n withErrorHandler(async (options: FilesystemEditFileOptions) => {\n if (\n !options.argumentsJson &&\n (!options.oldText || options.newText === undefined)\n ) {\n throw new Error(\n \"edit_file requires --old-text and --new-text, or --arguments-json\",\n );\n }\n await runFilesystemPluginCommand(\n \"edit_file\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n edits: [\n {\n oldText: options.oldText,\n newText: options.newText,\n },\n ],\n dryRun: options.dryRun === true,\n }),\n );\n }),\n ),\n);\n\nconst filesystemCreateDirectoryCommand = addPluginOptions(\n new Command()\n .name(\"create_directory\")\n .description(\"Create a directory\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .action(\n withErrorHandler(async (options: FilesystemPathOptions) => {\n await runFilesystemPluginCommand(\n \"create_directory\",\n options,\n withArgumentsJson(options, { path: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemListDirectoryCommand = addPluginOptions(\n new Command()\n .name(\"list_directory\")\n .description(\"List directory entries\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .action(\n withErrorHandler(async (options: FilesystemPathOptions) => {\n await runFilesystemPluginCommand(\n \"list_directory\",\n options,\n withArgumentsJson(options, { path: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemListDirectoryWithSizesCommand = addPluginOptions(\n new Command()\n .name(\"list_directory_with_sizes\")\n .description(\"List directory entries with sizes\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .option(\"--sort-by <field>\", \"Sort by name or size\", \"name\")\n .action(\n withErrorHandler(\n async (options: FilesystemListDirectoryWithSizesOptions) => {\n await runFilesystemPluginCommand(\n \"list_directory_with_sizes\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n sortBy: options.sortBy ?? \"name\",\n }),\n );\n },\n ),\n ),\n);\n\nconst filesystemDirectoryTreeCommand = addPluginOptions(\n new Command()\n .name(\"directory_tree\")\n .description(\"Return a directory tree\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .option(\"--exclude-pattern <pattern...>\", \"Patterns to exclude\")\n .action(\n withErrorHandler(async (options: FilesystemDirectoryTreeOptions) => {\n await runFilesystemPluginCommand(\n \"directory_tree\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n ...(options.excludePattern\n ? { excludePatterns: options.excludePattern }\n : {}),\n }),\n );\n }),\n ),\n);\n\nconst filesystemMoveFileCommand = addPluginOptions(\n new Command()\n .name(\"move_file\")\n .description(\"Move or rename a file\")\n .requiredOption(\"--source <path>\", \"Source path\")\n .requiredOption(\"--destination <path>\", \"Destination path\")\n .action(\n withErrorHandler(async (options: FilesystemMoveFileOptions) => {\n await runFilesystemPluginCommand(\n \"move_file\",\n options,\n withArgumentsJson(options, {\n source: options.source,\n destination: options.destination,\n }),\n );\n }),\n ),\n);\n\nconst filesystemSearchFilesCommand = addPluginOptions(\n new Command()\n .name(\"search_files\")\n .description(\"Search files by name\")\n .requiredOption(\"--path <path>\", \"Directory path\")\n .requiredOption(\"--pattern <pattern>\", \"Search pattern\")\n .option(\"--exclude-pattern <pattern...>\", \"Patterns to exclude\")\n .action(\n withErrorHandler(async (options: FilesystemSearchFilesOptions) => {\n await runFilesystemPluginCommand(\n \"search_files\",\n options,\n withArgumentsJson(options, {\n path: options.path,\n pattern: options.pattern,\n ...(options.excludePattern\n ? { excludePatterns: options.excludePattern }\n : {}),\n }),\n );\n }),\n ),\n);\n\nconst filesystemGetFileInfoCommand = addPluginOptions(\n new Command()\n .name(\"get_file_info\")\n .description(\"Get file metadata\")\n .requiredOption(\"--path <path>\", \"File or directory path\")\n .action(\n withErrorHandler(async (options: FilesystemPathOptions) => {\n await runFilesystemPluginCommand(\n \"get_file_info\",\n options,\n withArgumentsJson(options, { path: options.path }),\n );\n }),\n ),\n);\n\nconst filesystemPluginCommand = new Command()\n .name(\"filesystem\")\n .description(\"Use the Zero Desktop filesystem plugin\")\n .addCommand(filesystemListAllowedDirectoriesCommand)\n .addCommand(filesystemReadTextFileCommand)\n .addCommand(filesystemReadMediaFileCommand)\n .addCommand(filesystemReadMultipleFilesCommand)\n .addCommand(filesystemWriteFileCommand)\n .addCommand(filesystemEditFileCommand)\n .addCommand(filesystemCreateDirectoryCommand)\n .addCommand(filesystemListDirectoryCommand)\n .addCommand(filesystemListDirectoryWithSizesCommand)\n .addCommand(filesystemDirectoryTreeCommand)\n .addCommand(filesystemMoveFileCommand)\n .addCommand(filesystemSearchFilesCommand)\n .addCommand(filesystemGetFileInfoCommand);\n\nconst pluginCommand = addTargetOptions(\n new Command()\n .name(\"plugin\")\n .description(\"Use Desktop Computer Use plugins\")\n .addCommand(filesystemPluginCommand),\n);\n\nexport const zeroComputerUseCommand = new Command()\n .name(\"computer-use\")\n .description(\"Desktop app computer use through Zero CLI\")\n .addHelpText(\"after\", COMPUTER_USE_HELP_TEXT)\n .addCommand(listAppsCommand)\n .addCommand(getAppStateCommand)\n .addCommand(clickCommand)\n .addCommand(scrollCommand)\n .addCommand(setValueCommand)\n .addCommand(typeTextCommand)\n .addCommand(pressKeyCommand)\n .addCommand(performActionCommand)\n .addCommand(openAppCommand)\n .addCommand(pluginCommand);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,OAAO,iBAAiB;AACjC,SAAS,YAAY;AAsHrB,IAAM,0BAA0B;AAChC,IAAM,iCAAiC,GAAG,uBAAuB;AACjE,IAAM,mBAAmB;AACzB,IAAM,2CACJ;AACF,IAAM,4CACJ;AACF,IAAM,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsD/B,SAAS,MAAM,IAA2B;AACxC,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,eAAW,SAAS,EAAE;AAAA,EACxB,CAAC;AACH;AAEA,SAAS,2CAA2C,OAAuB;AACzE,MACE,iBAAiB,mBACjB,MAAM,WAAW,OACjB,MAAM,SAAS,eACf,MAAM,YAAY,0CAClB;AACA,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM;AACR;AAEA,SAAS,oBA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