@vm0/cli 9.147.2 → 9.148.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-EFG3ZEWH.js → chunk-7S6FB5HX.js} +757 -382
- package/{chunk-EFG3ZEWH.js.map → chunk-7S6FB5HX.js.map} +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/zero.js +208 -26
- package/zero.js.map +1 -1
package/index.js
CHANGED
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
source_default,
|
|
68
68
|
volumeConfigSchema,
|
|
69
69
|
withErrorHandler
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-7S6FB5HX.js";
|
|
71
71
|
import {
|
|
72
72
|
__toESM,
|
|
73
73
|
init_esm_shims
|
|
@@ -386,7 +386,7 @@ function getConfigPath() {
|
|
|
386
386
|
return join(os.homedir(), ".vm0", "config.json");
|
|
387
387
|
}
|
|
388
388
|
var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
|
|
389
|
-
console.log(source_default.bold(`VM0 CLI v${"9.
|
|
389
|
+
console.log(source_default.bold(`VM0 CLI v${"9.148.0"}`));
|
|
390
390
|
console.log();
|
|
391
391
|
const config = await loadConfig();
|
|
392
392
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -4279,7 +4279,7 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
4279
4279
|
options.autoUpdate = false;
|
|
4280
4280
|
}
|
|
4281
4281
|
if (options.autoUpdate !== false) {
|
|
4282
|
-
await startSilentUpgrade("9.
|
|
4282
|
+
await startSilentUpgrade("9.148.0");
|
|
4283
4283
|
}
|
|
4284
4284
|
try {
|
|
4285
4285
|
let result;
|
|
@@ -4371,7 +4371,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4371
4371
|
withErrorHandler(
|
|
4372
4372
|
async (identifier, prompt, options) => {
|
|
4373
4373
|
if (options.autoUpdate !== false) {
|
|
4374
|
-
await startSilentUpgrade("9.
|
|
4374
|
+
await startSilentUpgrade("9.148.0");
|
|
4375
4375
|
}
|
|
4376
4376
|
const { name, version } = parseIdentifier(identifier);
|
|
4377
4377
|
let composeId;
|
|
@@ -6158,13 +6158,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6158
6158
|
if (latestVersion === null) {
|
|
6159
6159
|
throw new Error("Could not check for updates. Please try again later.");
|
|
6160
6160
|
}
|
|
6161
|
-
if (latestVersion === "9.
|
|
6162
|
-
console.log(source_default.green(`\u2713 Already up to date (${"9.
|
|
6161
|
+
if (latestVersion === "9.148.0") {
|
|
6162
|
+
console.log(source_default.green(`\u2713 Already up to date (${"9.148.0"})`));
|
|
6163
6163
|
return;
|
|
6164
6164
|
}
|
|
6165
6165
|
console.log(
|
|
6166
6166
|
source_default.yellow(
|
|
6167
|
-
`Current version: ${"9.
|
|
6167
|
+
`Current version: ${"9.148.0"} -> Latest version: ${latestVersion}`
|
|
6168
6168
|
)
|
|
6169
6169
|
);
|
|
6170
6170
|
console.log();
|
|
@@ -6191,7 +6191,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6191
6191
|
const success = await performUpgrade(packageManager);
|
|
6192
6192
|
if (success) {
|
|
6193
6193
|
console.log(
|
|
6194
|
-
source_default.green(`\u2713 Upgraded from ${"9.
|
|
6194
|
+
source_default.green(`\u2713 Upgraded from ${"9.148.0"} to ${latestVersion}`)
|
|
6195
6195
|
);
|
|
6196
6196
|
return;
|
|
6197
6197
|
}
|
|
@@ -6258,7 +6258,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
|
|
|
6258
6258
|
|
|
6259
6259
|
// src/index.ts
|
|
6260
6260
|
var program = new Command();
|
|
6261
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
6261
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.148.0");
|
|
6262
6262
|
program.addCommand(authCommand);
|
|
6263
6263
|
program.addCommand(infoCommand);
|
|
6264
6264
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
MODEL_PROVIDER_TYPES,
|
|
10
10
|
Option,
|
|
11
11
|
allowsCustomModel,
|
|
12
|
+
completePhoneFileUpload,
|
|
12
13
|
completeSlackFileUpload,
|
|
13
14
|
completeTelegramFileUpload,
|
|
14
15
|
configureGlobalProxyFromEnv,
|
|
@@ -29,6 +30,7 @@ import {
|
|
|
29
30
|
deleteZeroVariable,
|
|
30
31
|
deployZeroSchedule,
|
|
31
32
|
disableZeroSchedule,
|
|
33
|
+
downloadPhoneFile,
|
|
32
34
|
downloadSlackFile,
|
|
33
35
|
downloadTelegramFile,
|
|
34
36
|
downloadWebFile,
|
|
@@ -67,6 +69,7 @@ import {
|
|
|
67
69
|
hasAuthMethods,
|
|
68
70
|
hasModelSelection,
|
|
69
71
|
hasRequiredScopes,
|
|
72
|
+
initPhoneFileUpload,
|
|
70
73
|
initSlackFileUpload,
|
|
71
74
|
initTelegramFileUpload,
|
|
72
75
|
inviteZeroOrgMember,
|
|
@@ -107,6 +110,7 @@ import {
|
|
|
107
110
|
searchZeroConnectors,
|
|
108
111
|
searchZeroLogs,
|
|
109
112
|
sendChatMessage,
|
|
113
|
+
sendPhoneMessage,
|
|
110
114
|
sendSlackMessage,
|
|
111
115
|
sendTelegramMessage,
|
|
112
116
|
setZeroOrgModelProviderDefault,
|
|
@@ -129,7 +133,7 @@ import {
|
|
|
129
133
|
withErrorHandler,
|
|
130
134
|
zeroAgentCustomSkillNameSchema,
|
|
131
135
|
zeroRemoteAgentCommand
|
|
132
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-7S6FB5HX.js";
|
|
133
137
|
import {
|
|
134
138
|
__toESM,
|
|
135
139
|
init_esm_shims
|
|
@@ -5097,6 +5101,179 @@ Examples:
|
|
|
5097
5101
|
Download a file: zero telegram download-file <file-id> --bot-id <bot-id> -o /tmp/out.jpg`
|
|
5098
5102
|
);
|
|
5099
5103
|
|
|
5104
|
+
// src/commands/zero/phone/index.ts
|
|
5105
|
+
init_esm_shims();
|
|
5106
|
+
|
|
5107
|
+
// src/commands/zero/phone/download-file.ts
|
|
5108
|
+
init_esm_shims();
|
|
5109
|
+
import { basename as basename5, join as join3 } from "path";
|
|
5110
|
+
import { tmpdir as tmpdir3 } from "os";
|
|
5111
|
+
function defaultOutPath3(fileId) {
|
|
5112
|
+
return join3(tmpdir3(), `phone-${basename5(fileId)}`);
|
|
5113
|
+
}
|
|
5114
|
+
var downloadFileCommand3 = new Command().name("download-file").description("Download an AgentPhone media file by id").argument(
|
|
5115
|
+
"<file-id>",
|
|
5116
|
+
"AgentPhone message id from an [AgentPhone file] block"
|
|
5117
|
+
).option(
|
|
5118
|
+
"-o, --out <path>",
|
|
5119
|
+
"Output path for the downloaded file (default: /tmp/phone-<file-id>)"
|
|
5120
|
+
).addHelpText(
|
|
5121
|
+
"after",
|
|
5122
|
+
`
|
|
5123
|
+
Examples:
|
|
5124
|
+
Download to default temp path: zero phone download-file msg_123
|
|
5125
|
+
Download to explicit path: zero phone download-file msg_123 -o /tmp/photo.jpg
|
|
5126
|
+
|
|
5127
|
+
Output:
|
|
5128
|
+
Prints a JSON object to stdout on success:
|
|
5129
|
+
{"path":"/tmp/phone-msg_123","mimetype":"image/jpeg","size":12345}
|
|
5130
|
+
|
|
5131
|
+
How to read the downloaded file:
|
|
5132
|
+
- Images (png/jpg/gif/webp/svg): open the file path with your image viewing tool
|
|
5133
|
+
- Videos (mp4/mov/webm): extract frames first with
|
|
5134
|
+
ffmpeg -i <path> -vf "fps=1" -q:v 2 /tmp/<file-id>_frame_%03d.jpg
|
|
5135
|
+
then view the extracted frames
|
|
5136
|
+
- PDF/text/csv/json/markdown: read the file directly`
|
|
5137
|
+
).action(
|
|
5138
|
+
withErrorHandler(async (fileId, options) => {
|
|
5139
|
+
const outPath = options.out ?? defaultOutPath3(fileId);
|
|
5140
|
+
const result = await downloadPhoneFile(fileId, outPath);
|
|
5141
|
+
console.log(JSON.stringify(result));
|
|
5142
|
+
})
|
|
5143
|
+
);
|
|
5144
|
+
|
|
5145
|
+
// src/commands/zero/phone/message.ts
|
|
5146
|
+
init_esm_shims();
|
|
5147
|
+
import { readFileSync as readFileSync9 } from "fs";
|
|
5148
|
+
var messageCommand = new Command().name("message").description("Send an AgentPhone text message").requiredOption("--to <phone>", "Connected phone handle to message").option("--agent-id <id>", "AgentPhone agent ID (inferred when omitted)").option("-t, --text <message>", "Message text").addHelpText(
|
|
5149
|
+
"after",
|
|
5150
|
+
`
|
|
5151
|
+
Examples:
|
|
5152
|
+
Send a message: zero phone message --to +15551234567 -t "Hello!"
|
|
5153
|
+
From stdin: printf "Hello!" | zero phone message --to +15551234567
|
|
5154
|
+
|
|
5155
|
+
Notes:
|
|
5156
|
+
- The phone handle must already be connected to the authenticated VM0 user
|
|
5157
|
+
- AgentPhone agent ID is inferred from the conversation when omitted`
|
|
5158
|
+
).action(
|
|
5159
|
+
withErrorHandler(
|
|
5160
|
+
async (options) => {
|
|
5161
|
+
let text = options.text;
|
|
5162
|
+
if (!text && process.stdin.isTTY === false) {
|
|
5163
|
+
text = readFileSync9("/dev/stdin", "utf8").trim();
|
|
5164
|
+
}
|
|
5165
|
+
if (!text) {
|
|
5166
|
+
throw new Error("Either --text or piped stdin must be provided", {
|
|
5167
|
+
cause: new Error(
|
|
5168
|
+
'Usage: zero phone message --to +15551234567 -t "your message"'
|
|
5169
|
+
)
|
|
5170
|
+
});
|
|
5171
|
+
}
|
|
5172
|
+
const result = await sendPhoneMessage({
|
|
5173
|
+
toNumber: options.to,
|
|
5174
|
+
text,
|
|
5175
|
+
agentphoneAgentId: options.agentId
|
|
5176
|
+
});
|
|
5177
|
+
console.log(
|
|
5178
|
+
source_default.green(`\u2713 Message sent (message_id: ${result.messageId})`)
|
|
5179
|
+
);
|
|
5180
|
+
}
|
|
5181
|
+
)
|
|
5182
|
+
);
|
|
5183
|
+
|
|
5184
|
+
// src/commands/zero/phone/upload-file.ts
|
|
5185
|
+
init_esm_shims();
|
|
5186
|
+
import { readFileSync as readFileSync10, statSync as statSync3 } from "fs";
|
|
5187
|
+
import { basename as basename6, extname as extname2 } from "path";
|
|
5188
|
+
var MIME_BY_EXTENSION2 = {
|
|
5189
|
+
".png": "image/png",
|
|
5190
|
+
".jpg": "image/jpeg",
|
|
5191
|
+
".jpeg": "image/jpeg",
|
|
5192
|
+
".gif": "image/gif",
|
|
5193
|
+
".webp": "image/webp",
|
|
5194
|
+
".svg": "image/svg+xml",
|
|
5195
|
+
".mp4": "video/mp4",
|
|
5196
|
+
".webm": "video/webm",
|
|
5197
|
+
".mov": "video/quicktime",
|
|
5198
|
+
".pdf": "application/pdf",
|
|
5199
|
+
".txt": "text/plain",
|
|
5200
|
+
".csv": "text/csv",
|
|
5201
|
+
".md": "text/markdown",
|
|
5202
|
+
".json": "application/json"
|
|
5203
|
+
};
|
|
5204
|
+
function inferContentType2(localPath) {
|
|
5205
|
+
const ext = extname2(localPath).toLowerCase();
|
|
5206
|
+
return MIME_BY_EXTENSION2[ext] ?? "application/octet-stream";
|
|
5207
|
+
}
|
|
5208
|
+
var uploadFileCommand3 = new Command().name("upload-file").description("Upload a local file to an AgentPhone conversation").requiredOption("-f, --file <path>", "Local file path to upload").requiredOption("--to <phone>", "Connected phone handle to message").option("--agent-id <id>", "AgentPhone agent ID (inferred when omitted)").option("--caption <text>", "Caption to accompany the file").option("--content-type <mime>", "Override inferred content type").addHelpText(
|
|
5209
|
+
"after",
|
|
5210
|
+
`
|
|
5211
|
+
Examples:
|
|
5212
|
+
Upload a file: zero phone upload-file -f /tmp/report.pdf --to +15551234567
|
|
5213
|
+
With a caption: zero phone upload-file -f /tmp/photo.jpg --to +15551234567 --caption "Here it is"
|
|
5214
|
+
|
|
5215
|
+
Output:
|
|
5216
|
+
Prints a JSON object to stdout on success:
|
|
5217
|
+
{"messageId":"msg_123","toNumber":"+15551234567","filename":"report.pdf","mimetype":"application/pdf","size":12345,"url":"https://..."}`
|
|
5218
|
+
).action(
|
|
5219
|
+
withErrorHandler(
|
|
5220
|
+
async (options) => {
|
|
5221
|
+
let fileSize;
|
|
5222
|
+
try {
|
|
5223
|
+
const stat = statSync3(options.file);
|
|
5224
|
+
if (!stat.isFile()) {
|
|
5225
|
+
throw new Error(`Not a regular file: ${options.file}`);
|
|
5226
|
+
}
|
|
5227
|
+
fileSize = stat.size;
|
|
5228
|
+
} catch (error) {
|
|
5229
|
+
if (error instanceof Error && error.message.startsWith("Not ")) {
|
|
5230
|
+
throw error;
|
|
5231
|
+
}
|
|
5232
|
+
throw new Error(`File not found: ${options.file}`);
|
|
5233
|
+
}
|
|
5234
|
+
if (fileSize === 0) {
|
|
5235
|
+
throw new Error("File is empty");
|
|
5236
|
+
}
|
|
5237
|
+
const filename = basename6(options.file);
|
|
5238
|
+
const contentType = options.contentType ?? inferContentType2(options.file);
|
|
5239
|
+
const prepared = await initPhoneFileUpload({
|
|
5240
|
+
filename,
|
|
5241
|
+
contentType,
|
|
5242
|
+
length: fileSize
|
|
5243
|
+
});
|
|
5244
|
+
const fileContent = readFileSync10(options.file);
|
|
5245
|
+
const uploadResponse = await fetch(prepared.uploadUrl, {
|
|
5246
|
+
method: "PUT",
|
|
5247
|
+
headers: { "Content-Type": prepared.contentType },
|
|
5248
|
+
body: new Uint8Array(fileContent)
|
|
5249
|
+
});
|
|
5250
|
+
if (!uploadResponse.ok) {
|
|
5251
|
+
throw new Error(
|
|
5252
|
+
`File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`
|
|
5253
|
+
);
|
|
5254
|
+
}
|
|
5255
|
+
const result = await completePhoneFileUpload({
|
|
5256
|
+
uploadId: prepared.uploadId,
|
|
5257
|
+
toNumber: options.to,
|
|
5258
|
+
agentphoneAgentId: options.agentId,
|
|
5259
|
+
contentType: prepared.contentType,
|
|
5260
|
+
caption: options.caption
|
|
5261
|
+
});
|
|
5262
|
+
console.log(JSON.stringify(result));
|
|
5263
|
+
}
|
|
5264
|
+
)
|
|
5265
|
+
);
|
|
5266
|
+
|
|
5267
|
+
// src/commands/zero/phone/index.ts
|
|
5268
|
+
var zeroPhoneCommand = new Command().name("phone").description("Send AgentPhone messages, upload files, and download media").addCommand(messageCommand).addCommand(downloadFileCommand3).addCommand(uploadFileCommand3).addHelpText(
|
|
5269
|
+
"after",
|
|
5270
|
+
`
|
|
5271
|
+
Examples:
|
|
5272
|
+
Send a message: zero phone message --to +15551234567 -t "Hello!"
|
|
5273
|
+
Upload a file: zero phone upload-file -f /tmp/report.pdf --to +15551234567
|
|
5274
|
+
Download a file: zero phone download-file <file-id> -o /tmp/out.jpg`
|
|
5275
|
+
);
|
|
5276
|
+
|
|
5100
5277
|
// src/commands/zero/variable/index.ts
|
|
5101
5278
|
init_esm_shims();
|
|
5102
5279
|
|
|
@@ -5344,8 +5521,8 @@ init_esm_shims();
|
|
|
5344
5521
|
|
|
5345
5522
|
// src/lib/skill-directory.ts
|
|
5346
5523
|
init_esm_shims();
|
|
5347
|
-
import { readFileSync as
|
|
5348
|
-
import { join as
|
|
5524
|
+
import { readFileSync as readFileSync11, readdirSync } from "fs";
|
|
5525
|
+
import { join as join4 } from "path";
|
|
5349
5526
|
var IGNORED_NAMES = /* @__PURE__ */ new Set(["node_modules", ".git", ".DS_Store"]);
|
|
5350
5527
|
function readSkillDirectory(dirPath) {
|
|
5351
5528
|
const files = [];
|
|
@@ -5355,11 +5532,11 @@ function readSkillDirectory(dirPath) {
|
|
|
5355
5532
|
if (entry.name.startsWith(".") || IGNORED_NAMES.has(entry.name)) continue;
|
|
5356
5533
|
const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
5357
5534
|
if (entry.isDirectory()) {
|
|
5358
|
-
walk(
|
|
5535
|
+
walk(join4(dir, entry.name), relPath);
|
|
5359
5536
|
} else {
|
|
5360
5537
|
files.push({
|
|
5361
5538
|
path: relPath,
|
|
5362
|
-
content:
|
|
5539
|
+
content: readFileSync11(join4(dir, entry.name), "utf-8")
|
|
5363
5540
|
});
|
|
5364
5541
|
}
|
|
5365
5542
|
}
|
|
@@ -6125,12 +6302,12 @@ init_esm_shims();
|
|
|
6125
6302
|
import { execFile } from "child_process";
|
|
6126
6303
|
import { readFile, unlink } from "fs/promises";
|
|
6127
6304
|
import { randomUUID } from "crypto";
|
|
6128
|
-
import { join as
|
|
6129
|
-
import { tmpdir as
|
|
6305
|
+
import { join as join5 } from "path";
|
|
6306
|
+
import { tmpdir as tmpdir4 } from "os";
|
|
6130
6307
|
import { promisify } from "util";
|
|
6131
6308
|
var execFileAsync = promisify(execFile);
|
|
6132
6309
|
async function captureScreenshot() {
|
|
6133
|
-
const tmpPath =
|
|
6310
|
+
const tmpPath = join5(tmpdir4(), `vm0-screenshot-${randomUUID()}.jpg`);
|
|
6134
6311
|
try {
|
|
6135
6312
|
await execFileAsync("screencapture", ["-x", "-t", "jpg", tmpPath]);
|
|
6136
6313
|
const info = await getScreenInfo();
|
|
@@ -6159,7 +6336,7 @@ async function captureScreenshot() {
|
|
|
6159
6336
|
}
|
|
6160
6337
|
}
|
|
6161
6338
|
async function captureRegionScreenshot(region) {
|
|
6162
|
-
const tmpPath =
|
|
6339
|
+
const tmpPath = join5(tmpdir4(), `vm0-zoom-${randomUUID()}.jpg`);
|
|
6163
6340
|
try {
|
|
6164
6341
|
const regionArg = `${region.x},${region.y},${region.width},${region.height}`;
|
|
6165
6342
|
await execFileAsync("screencapture", [
|
|
@@ -6851,7 +7028,7 @@ var hostStopCommand = new Command().name("stop").description("Stop and unregiste
|
|
|
6851
7028
|
// src/commands/zero/computer-use/client.ts
|
|
6852
7029
|
init_esm_shims();
|
|
6853
7030
|
import { writeFile, mkdir } from "fs/promises";
|
|
6854
|
-
import { basename as
|
|
7031
|
+
import { basename as basename7, join as join6 } from "path";
|
|
6855
7032
|
|
|
6856
7033
|
// src/lib/computer-use/client.ts
|
|
6857
7034
|
init_esm_shims();
|
|
@@ -6896,7 +7073,7 @@ async function callHost(path, options) {
|
|
|
6896
7073
|
|
|
6897
7074
|
// src/commands/zero/computer-use/client.ts
|
|
6898
7075
|
function safeFormat(format) {
|
|
6899
|
-
return
|
|
7076
|
+
return basename7(format);
|
|
6900
7077
|
}
|
|
6901
7078
|
function mouseClickCommand(name, action, description) {
|
|
6902
7079
|
return new Command().name(name).description(description).argument("<x>", "X coordinate (points)").argument("<y>", "Y coordinate (points)").action(
|
|
@@ -6922,7 +7099,7 @@ var clientScreenshotCommand = new Command().name("screenshot").description("Capt
|
|
|
6922
7099
|
const dir = "/tmp/computer-use";
|
|
6923
7100
|
await mkdir(dir, { recursive: true });
|
|
6924
7101
|
const timestamp = Date.now();
|
|
6925
|
-
const filePath =
|
|
7102
|
+
const filePath = join6(
|
|
6926
7103
|
dir,
|
|
6927
7104
|
`screenshot-${timestamp}.${safeFormat(data.format)}`
|
|
6928
7105
|
);
|
|
@@ -6953,7 +7130,7 @@ var clientZoomCommand = new Command().name("zoom").description("Capture a region
|
|
|
6953
7130
|
const dir = "/tmp/computer-use";
|
|
6954
7131
|
await mkdir(dir, { recursive: true });
|
|
6955
7132
|
const timestamp = Date.now();
|
|
6956
|
-
const filePath =
|
|
7133
|
+
const filePath = join6(
|
|
6957
7134
|
dir,
|
|
6958
7135
|
`zoom-${timestamp}.${safeFormat(data.format)}`
|
|
6959
7136
|
);
|
|
@@ -7159,13 +7336,13 @@ init_esm_shims();
|
|
|
7159
7336
|
|
|
7160
7337
|
// src/commands/zero/shared/image-generate.ts
|
|
7161
7338
|
init_esm_shims();
|
|
7162
|
-
import { readFileSync as
|
|
7339
|
+
import { readFileSync as readFileSync12 } from "fs";
|
|
7163
7340
|
function readPrompt(options, usageCommand) {
|
|
7164
7341
|
if (options.prompt?.trim()) {
|
|
7165
7342
|
return options.prompt.trim();
|
|
7166
7343
|
}
|
|
7167
7344
|
if (process.stdin.isTTY === false) {
|
|
7168
|
-
const prompt =
|
|
7345
|
+
const prompt = readFileSync12("/dev/stdin", "utf8").trim();
|
|
7169
7346
|
if (prompt.length > 0) {
|
|
7170
7347
|
return prompt;
|
|
7171
7348
|
}
|
|
@@ -7239,13 +7416,13 @@ init_esm_shims();
|
|
|
7239
7416
|
|
|
7240
7417
|
// src/commands/zero/shared/voice-generate.ts
|
|
7241
7418
|
init_esm_shims();
|
|
7242
|
-
import { readFileSync as
|
|
7419
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
7243
7420
|
function readText(options, usageCommand) {
|
|
7244
7421
|
if (options.text?.trim()) {
|
|
7245
7422
|
return options.text.trim();
|
|
7246
7423
|
}
|
|
7247
7424
|
if (process.stdin.isTTY === false) {
|
|
7248
|
-
const text =
|
|
7425
|
+
const text = readFileSync13("/dev/stdin", "utf8").trim();
|
|
7249
7426
|
if (text.length > 0) {
|
|
7250
7427
|
return text;
|
|
7251
7428
|
}
|
|
@@ -7322,12 +7499,12 @@ init_esm_shims();
|
|
|
7322
7499
|
|
|
7323
7500
|
// src/commands/zero/web/download-file.ts
|
|
7324
7501
|
init_esm_shims();
|
|
7325
|
-
import { basename as
|
|
7326
|
-
import { tmpdir as
|
|
7327
|
-
function
|
|
7328
|
-
return
|
|
7502
|
+
import { basename as basename8, join as join7 } from "path";
|
|
7503
|
+
import { tmpdir as tmpdir5 } from "os";
|
|
7504
|
+
function defaultOutPath4(fileId) {
|
|
7505
|
+
return join7(tmpdir5(), `web-${basename8(fileId)}`);
|
|
7329
7506
|
}
|
|
7330
|
-
var
|
|
7507
|
+
var downloadFileCommand4 = new Command().name("download-file").description("Download a web-uploaded file by id").argument("<file-id>", "File id (UUID returned by the upload API)").option(
|
|
7331
7508
|
"-o, --out <path>",
|
|
7332
7509
|
"Output path for the downloaded file (default: /tmp/web-<file-id>)"
|
|
7333
7510
|
).addHelpText(
|
|
@@ -7353,7 +7530,7 @@ Notes:
|
|
|
7353
7530
|
- Streams the file bytes directly to disk`
|
|
7354
7531
|
).action(
|
|
7355
7532
|
withErrorHandler(async (fileId, options) => {
|
|
7356
|
-
const outPath = options.out ??
|
|
7533
|
+
const outPath = options.out ?? defaultOutPath4(fileId);
|
|
7357
7534
|
const result = await downloadWebFile(fileId, outPath);
|
|
7358
7535
|
console.log(JSON.stringify(result));
|
|
7359
7536
|
})
|
|
@@ -7361,7 +7538,7 @@ Notes:
|
|
|
7361
7538
|
|
|
7362
7539
|
// src/commands/zero/web/upload-file.ts
|
|
7363
7540
|
init_esm_shims();
|
|
7364
|
-
var
|
|
7541
|
+
var uploadFileCommand4 = new Command().name("upload-file").description("Upload a local file and print a permanent URL").requiredOption("-f, --file <path>", "Local file path to upload").option("--content-type <mime>", "Override inferred content type").addHelpText(
|
|
7365
7542
|
"after",
|
|
7366
7543
|
`
|
|
7367
7544
|
Examples:
|
|
@@ -7395,7 +7572,7 @@ Notes:
|
|
|
7395
7572
|
);
|
|
7396
7573
|
|
|
7397
7574
|
// src/commands/zero/web/index.ts
|
|
7398
|
-
var zeroWebCommand = new Command().name("web").description("Upload and download files via the web chat endpoint").addCommand(
|
|
7575
|
+
var zeroWebCommand = new Command().name("web").description("Upload and download files via the web chat endpoint").addCommand(downloadFileCommand4).addCommand(uploadFileCommand4).addHelpText(
|
|
7399
7576
|
"after",
|
|
7400
7577
|
`
|
|
7401
7578
|
Examples:
|
|
@@ -7416,6 +7593,7 @@ var COMMAND_CAPABILITY_MAP = {
|
|
|
7416
7593
|
chat: "chat-message:write",
|
|
7417
7594
|
slack: "slack:write",
|
|
7418
7595
|
telegram: ["telegram:read", "telegram:write"],
|
|
7596
|
+
phone: ["phone:read", "phone:write"],
|
|
7419
7597
|
whoami: null,
|
|
7420
7598
|
"developer-support": null,
|
|
7421
7599
|
"computer-use": "computer-use:write",
|
|
@@ -7435,6 +7613,7 @@ var DEFAULT_COMMANDS = [
|
|
|
7435
7613
|
zeroChatCommand,
|
|
7436
7614
|
zeroSlackCommand,
|
|
7437
7615
|
zeroTelegramCommand,
|
|
7616
|
+
zeroPhoneCommand,
|
|
7438
7617
|
zeroVariableCommand,
|
|
7439
7618
|
zeroLogsCommand,
|
|
7440
7619
|
zeroSearchCommand,
|
|
@@ -7469,7 +7648,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
7469
7648
|
var program = new Command();
|
|
7470
7649
|
program.name("zero").description(
|
|
7471
7650
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
7472
|
-
).version("9.
|
|
7651
|
+
).version("9.148.0").addHelpText(
|
|
7473
7652
|
"after",
|
|
7474
7653
|
`
|
|
7475
7654
|
Examples:
|
|
@@ -7479,6 +7658,9 @@ Examples:
|
|
|
7479
7658
|
Send Telegram? zero telegram message send --help
|
|
7480
7659
|
Upload Telegram? zero telegram upload-file --help
|
|
7481
7660
|
Download Telegram? zero telegram download-file --help
|
|
7661
|
+
Send AgentPhone? zero phone message --help
|
|
7662
|
+
Upload AgentPhone? zero phone upload-file --help
|
|
7663
|
+
Download AgentPhone? zero phone download-file --help
|
|
7482
7664
|
Set up a schedule? zero schedule setup --help
|
|
7483
7665
|
Update yourself? zero agent --help
|
|
7484
7666
|
Manage custom skills? zero skill --help
|