@vm0/cli 9.116.2 → 9.116.3

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/index.js CHANGED
@@ -72,7 +72,7 @@ import {
72
72
  source_default,
73
73
  volumeConfigSchema,
74
74
  withErrorHandler
75
- } from "./chunk-DV6NKREP.js";
75
+ } from "./chunk-PK7CJPFD.js";
76
76
 
77
77
  // src/index.ts
78
78
  init_esm_shims();
@@ -465,7 +465,7 @@ function getConfigPath() {
465
465
  return join(homedir(), ".vm0", "config.json");
466
466
  }
467
467
  var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
468
- console.log(source_default.bold(`VM0 CLI v${"9.116.2"}`));
468
+ console.log(source_default.bold(`VM0 CLI v${"9.116.3"}`));
469
469
  console.log();
470
470
  const config = await loadConfig();
471
471
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -4494,7 +4494,7 @@ var composeCommand = new Command().name("compose").description("Create or update
4494
4494
  options.autoUpdate = false;
4495
4495
  }
4496
4496
  if (options.autoUpdate !== false) {
4497
- await startSilentUpgrade("9.116.2");
4497
+ await startSilentUpgrade("9.116.3");
4498
4498
  }
4499
4499
  try {
4500
4500
  let result;
@@ -4579,7 +4579,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
4579
4579
  withErrorHandler(
4580
4580
  async (identifier, prompt, options) => {
4581
4581
  if (options.autoUpdate !== false) {
4582
- await startSilentUpgrade("9.116.2");
4582
+ await startSilentUpgrade("9.116.3");
4583
4583
  }
4584
4584
  const { name, version } = parseIdentifier(identifier);
4585
4585
  let composeId;
@@ -6353,7 +6353,7 @@ var cookAction = new Command().name("cook").description("Quick start: prepare, c
6353
6353
  withErrorHandler(
6354
6354
  async (prompt, options) => {
6355
6355
  if (options.autoUpdate !== false) {
6356
- const shouldExit = await checkAndUpgrade("9.116.2", prompt);
6356
+ const shouldExit = await checkAndUpgrade("9.116.3", prompt);
6357
6357
  if (shouldExit) {
6358
6358
  process.exit(0);
6359
6359
  }
@@ -7120,13 +7120,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
7120
7120
  if (latestVersion === null) {
7121
7121
  throw new Error("Could not check for updates. Please try again later.");
7122
7122
  }
7123
- if (latestVersion === "9.116.2") {
7124
- console.log(source_default.green(`\u2713 Already up to date (${"9.116.2"})`));
7123
+ if (latestVersion === "9.116.3") {
7124
+ console.log(source_default.green(`\u2713 Already up to date (${"9.116.3"})`));
7125
7125
  return;
7126
7126
  }
7127
7127
  console.log(
7128
7128
  source_default.yellow(
7129
- `Current version: ${"9.116.2"} -> Latest version: ${latestVersion}`
7129
+ `Current version: ${"9.116.3"} -> Latest version: ${latestVersion}`
7130
7130
  )
7131
7131
  );
7132
7132
  console.log();
@@ -7153,7 +7153,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
7153
7153
  const success = await performUpgrade(packageManager);
7154
7154
  if (success) {
7155
7155
  console.log(
7156
- source_default.green(`\u2713 Upgraded from ${"9.116.2"} to ${latestVersion}`)
7156
+ source_default.green(`\u2713 Upgraded from ${"9.116.3"} to ${latestVersion}`)
7157
7157
  );
7158
7158
  return;
7159
7159
  }
@@ -7220,7 +7220,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
7220
7220
 
7221
7221
  // src/index.ts
7222
7222
  var program = new Command();
7223
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.116.2");
7223
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.116.3");
7224
7224
  program.addCommand(authCommand);
7225
7225
  program.addCommand(infoCommand);
7226
7226
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.116.2",
3
+ "version": "9.116.3",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -37,6 +37,7 @@ import {
37
37
  deleteZeroVariable,
38
38
  deployZeroSchedule,
39
39
  disableZeroSchedule,
40
+ downloadSlackFile,
40
41
  enableZeroSchedule,
41
42
  extractSecretNamesFromApis,
42
43
  findMatchingPermissions,
@@ -130,7 +131,7 @@ import {
130
131
  upsertZeroOrgModelProvider,
131
132
  withErrorHandler,
132
133
  zeroAgentCustomSkillNameSchema
133
- } from "./chunk-DV6NKREP.js";
134
+ } from "./chunk-PK7CJPFD.js";
134
135
 
135
136
  // src/zero.ts
136
137
  init_esm_shims();
@@ -4133,14 +4134,49 @@ Notes:
4133
4134
  )
4134
4135
  );
4135
4136
 
4137
+ // src/commands/zero/slack/download-file.ts
4138
+ init_esm_shims();
4139
+ import { join as join2 } from "path";
4140
+ import { tmpdir } from "os";
4141
+ function defaultOutPath(fileId) {
4142
+ return join2(tmpdir(), `slack-${fileId}`);
4143
+ }
4144
+ var downloadFileCommand = new Command().name("download-file").description("Download a Slack file by id using the bot token").argument("<file-id>", "Slack file id (e.g. F01234ABCD)").option(
4145
+ "-o, --out <path>",
4146
+ "Output path for the downloaded file (default: /tmp/slack-<file-id>)"
4147
+ ).addHelpText(
4148
+ "after",
4149
+ `
4150
+ Examples:
4151
+ Download to default temp path: zero slack download-file F01234ABCD
4152
+ Download to explicit path: zero slack download-file F01234ABCD -o /tmp/image.png
4153
+
4154
+ Output:
4155
+ Prints a JSON object to stdout on success:
4156
+ {"path":"/tmp/slack-F01234ABCD","mimetype":"image/png","size":12345}
4157
+
4158
+ Notes:
4159
+ - Uses the bot token on the server side; no user Slack token is needed
4160
+ - Streams the file bytes directly to disk`
4161
+ ).action(
4162
+ withErrorHandler(async (fileId, options) => {
4163
+ const outPath = options.out ?? defaultOutPath(fileId);
4164
+ const result = await downloadSlackFile(fileId, outPath);
4165
+ console.log(JSON.stringify(result));
4166
+ })
4167
+ );
4168
+
4136
4169
  // src/commands/zero/slack/index.ts
4137
- var zeroSlackCommand = new Command().name("slack").description("Send messages and upload files to Slack channels as the bot").addCommand(zeroSlackMessageCommand).addCommand(uploadFileCommand).addHelpText(
4170
+ var zeroSlackCommand = new Command().name("slack").description(
4171
+ "Send messages, upload files, and download files from Slack as the bot"
4172
+ ).addCommand(zeroSlackMessageCommand).addCommand(uploadFileCommand).addCommand(downloadFileCommand).addHelpText(
4138
4173
  "after",
4139
4174
  `
4140
4175
  Examples:
4141
4176
  Send a message: zero slack message send -c <channel-id> -t "Hello!"
4142
4177
  Reply in a thread: zero slack message send -c <channel-id> --thread <ts> -t "reply"
4143
- Upload a file: zero slack upload-file -f /tmp/report.pdf -c <channel-id>`
4178
+ Upload a file: zero slack upload-file -f /tmp/report.pdf -c <channel-id>
4179
+ Download a file: zero slack download-file <file-id> -o /tmp/out.png`
4144
4180
  );
4145
4181
 
4146
4182
  // src/commands/zero/variable/index.ts
@@ -4391,7 +4427,7 @@ init_esm_shims();
4391
4427
  // src/lib/skill-directory.ts
4392
4428
  init_esm_shims();
4393
4429
  import { readFileSync as readFileSync5, readdirSync } from "fs";
4394
- import { join as join2 } from "path";
4430
+ import { join as join3 } from "path";
4395
4431
  var IGNORED_NAMES = /* @__PURE__ */ new Set(["node_modules", ".git", ".DS_Store"]);
4396
4432
  function readSkillDirectory(dirPath) {
4397
4433
  const files = [];
@@ -4401,11 +4437,11 @@ function readSkillDirectory(dirPath) {
4401
4437
  if (entry.name.startsWith(".") || IGNORED_NAMES.has(entry.name)) continue;
4402
4438
  const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;
4403
4439
  if (entry.isDirectory()) {
4404
- walk(join2(dir, entry.name), relPath);
4440
+ walk(join3(dir, entry.name), relPath);
4405
4441
  } else {
4406
4442
  files.push({
4407
4443
  path: relPath,
4408
- content: readFileSync5(join2(dir, entry.name), "utf-8")
4444
+ content: readFileSync5(join3(dir, entry.name), "utf-8")
4409
4445
  });
4410
4446
  }
4411
4447
  }
@@ -4997,12 +5033,12 @@ init_esm_shims();
4997
5033
  import { execFile } from "child_process";
4998
5034
  import { readFile, unlink } from "fs/promises";
4999
5035
  import { randomUUID } from "crypto";
5000
- import { join as join3 } from "path";
5001
- import { tmpdir } from "os";
5036
+ import { join as join4 } from "path";
5037
+ import { tmpdir as tmpdir2 } from "os";
5002
5038
  import { promisify } from "util";
5003
5039
  var execFileAsync = promisify(execFile);
5004
5040
  async function captureScreenshot() {
5005
- const tmpPath = join3(tmpdir(), `vm0-screenshot-${randomUUID()}.jpg`);
5041
+ const tmpPath = join4(tmpdir2(), `vm0-screenshot-${randomUUID()}.jpg`);
5006
5042
  try {
5007
5043
  await execFileAsync("screencapture", ["-x", "-t", "jpg", tmpPath]);
5008
5044
  const info = await getScreenInfo();
@@ -5031,7 +5067,7 @@ async function captureScreenshot() {
5031
5067
  }
5032
5068
  }
5033
5069
  async function captureRegionScreenshot(region) {
5034
- const tmpPath = join3(tmpdir(), `vm0-zoom-${randomUUID()}.jpg`);
5070
+ const tmpPath = join4(tmpdir2(), `vm0-zoom-${randomUUID()}.jpg`);
5035
5071
  try {
5036
5072
  const regionArg = `${region.x},${region.y},${region.width},${region.height}`;
5037
5073
  await execFileAsync("screencapture", [
@@ -5723,7 +5759,7 @@ var hostStopCommand = new Command().name("stop").description("Stop and unregiste
5723
5759
  // src/commands/zero/computer-use/client.ts
5724
5760
  init_esm_shims();
5725
5761
  import { writeFile, mkdir } from "fs/promises";
5726
- import { join as join4 } from "path";
5762
+ import { join as join5 } from "path";
5727
5763
 
5728
5764
  // src/lib/computer-use/client.ts
5729
5765
  init_esm_shims();
@@ -5791,7 +5827,7 @@ var clientScreenshotCommand = new Command().name("screenshot").description("Capt
5791
5827
  const dir = "/tmp/computer-use";
5792
5828
  await mkdir(dir, { recursive: true });
5793
5829
  const timestamp = Date.now();
5794
- const filePath = join4(dir, `screenshot-${timestamp}.${data.format}`);
5830
+ const filePath = join5(dir, `screenshot-${timestamp}.${data.format}`);
5795
5831
  const buffer = Buffer.from(data.image, "base64");
5796
5832
  await writeFile(filePath, buffer);
5797
5833
  process.stdout.write(`${filePath}
@@ -5819,7 +5855,7 @@ var clientZoomCommand = new Command().name("zoom").description("Capture a region
5819
5855
  const dir = "/tmp/computer-use";
5820
5856
  await mkdir(dir, { recursive: true });
5821
5857
  const timestamp = Date.now();
5822
- const filePath = join4(dir, `zoom-${timestamp}.${data.format}`);
5858
+ const filePath = join5(dir, `zoom-${timestamp}.${data.format}`);
5823
5859
  const buffer = Buffer.from(data.image, "base64");
5824
5860
  await writeFile(filePath, buffer);
5825
5861
  process.stdout.write(`${filePath}
@@ -6340,7 +6376,7 @@ function registerZeroCommands(prog, commands) {
6340
6376
  var program = new Command();
6341
6377
  program.name("zero").description(
6342
6378
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
6343
- ).version("9.116.2").addHelpText(
6379
+ ).version("9.116.3").addHelpText(
6344
6380
  "after",
6345
6381
  `
6346
6382
  Examples: