@vm0/cli 9.38.0 → 9.38.1

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.
Files changed (2) hide show
  1. package/index.js +50 -22
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -45,7 +45,7 @@ if (DSN) {
45
45
  Sentry.init({
46
46
  dsn: DSN,
47
47
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
48
- release: "9.38.0",
48
+ release: "9.38.1",
49
49
  sendDefaultPii: false,
50
50
  tracesSampleRate: 0,
51
51
  shutdownTimeout: 500,
@@ -64,7 +64,7 @@ if (DSN) {
64
64
  }
65
65
  });
66
66
  Sentry.setContext("cli", {
67
- version: "9.38.0",
67
+ version: "9.38.1",
68
68
  command: process.argv.slice(2).join(" ")
69
69
  });
70
70
  Sentry.setContext("runtime", {
@@ -607,7 +607,7 @@ function getConfigPath() {
607
607
  return join2(homedir2(), ".vm0", "config.json");
608
608
  }
609
609
  var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
610
- console.log(chalk7.bold(`VM0 CLI v${"9.38.0"}`));
610
+ console.log(chalk7.bold(`VM0 CLI v${"9.38.1"}`));
611
611
  console.log();
612
612
  const config = await loadConfig();
613
613
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -6474,7 +6474,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
6474
6474
  options.autoUpdate = false;
6475
6475
  }
6476
6476
  if (options.autoUpdate !== false) {
6477
- await startSilentUpgrade("9.38.0");
6477
+ await startSilentUpgrade("9.38.1");
6478
6478
  }
6479
6479
  try {
6480
6480
  let result;
@@ -8688,7 +8688,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
8688
8688
  async (identifier, prompt, options) => {
8689
8689
  try {
8690
8690
  if (options.autoUpdate !== false) {
8691
- await startSilentUpgrade("9.38.0");
8691
+ await startSilentUpgrade("9.38.1");
8692
8692
  }
8693
8693
  const { scope, name, version } = parseIdentifier(identifier);
8694
8694
  if (scope && !options.experimentalSharedAgent) {
@@ -10264,7 +10264,7 @@ var cookAction = new Command27().name("cook").description("Quick start: prepare,
10264
10264
  ).option("-y, --yes", "Skip confirmation prompts").option("-v, --verbose", "Show full tool inputs and outputs").addOption(new Option5("--debug-no-mock-claude").hideHelp()).addOption(new Option5("--no-auto-update").hideHelp()).action(
10265
10265
  async (prompt, options) => {
10266
10266
  if (options.autoUpdate !== false) {
10267
- const shouldExit = await checkAndUpgrade("9.38.0", prompt);
10267
+ const shouldExit = await checkAndUpgrade("9.38.1", prompt);
10268
10268
  if (shouldExit) {
10269
10269
  process.exit(0);
10270
10270
  }
@@ -13773,6 +13773,7 @@ import { initClient as initClient13 } from "@ts-rest/core";
13773
13773
 
13774
13774
  // src/commands/connector/lib/computer/start-services.ts
13775
13775
  import { spawn as spawn3 } from "child_process";
13776
+ import { access as access2, constants } from "fs/promises";
13776
13777
  import { createServer } from "net";
13777
13778
  import { homedir as homedir4 } from "os";
13778
13779
  import { join as join11 } from "path";
@@ -13797,6 +13798,18 @@ async function stopNgrokTunnels() {
13797
13798
  }
13798
13799
 
13799
13800
  // src/commands/connector/lib/computer/start-services.ts
13801
+ var CHROME_CANDIDATES = [
13802
+ // macOS absolute paths
13803
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
13804
+ "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
13805
+ "/Applications/Chromium.app/Contents/MacOS/Chromium",
13806
+ // Linux / PATH-based
13807
+ "google-chrome",
13808
+ "google-chrome-stable",
13809
+ "chromium-browser",
13810
+ "chromium",
13811
+ "chrome"
13812
+ ];
13800
13813
  async function getRandomPort() {
13801
13814
  return new Promise((resolve, reject) => {
13802
13815
  const server = createServer();
@@ -13807,31 +13820,45 @@ async function getRandomPort() {
13807
13820
  server.on("error", reject);
13808
13821
  });
13809
13822
  }
13810
- async function findCommand(...candidates) {
13811
- for (const binary of candidates) {
13812
- const found = await new Promise((resolve) => {
13813
- const child = spawn3("which", [binary]);
13814
- child.on("close", (code) => resolve(code === 0));
13815
- });
13816
- if (found) return binary;
13823
+ async function findBinary(...candidates) {
13824
+ for (const candidate of candidates) {
13825
+ if (candidate.startsWith("/")) {
13826
+ try {
13827
+ await access2(candidate, constants.X_OK);
13828
+ return candidate;
13829
+ } catch {
13830
+ }
13831
+ } else {
13832
+ const found = await new Promise((resolve) => {
13833
+ const child = spawn3("which", [candidate]);
13834
+ child.on("close", (code) => resolve(code === 0));
13835
+ });
13836
+ if (found) return candidate;
13837
+ }
13817
13838
  }
13818
13839
  return null;
13819
13840
  }
13841
+ async function checkComputerDependencies() {
13842
+ const wsgidavBinary = await findBinary("wsgidav");
13843
+ if (!wsgidavBinary) {
13844
+ throw new Error(
13845
+ "wsgidav not found\n\nInstall with: pip install wsgidav[cheroot]"
13846
+ );
13847
+ }
13848
+ const chromeBinary = await findBinary(...CHROME_CANDIDATES);
13849
+ if (!chromeBinary) {
13850
+ throw new Error("Chrome not found\n\nInstall Google Chrome or Chromium");
13851
+ }
13852
+ }
13820
13853
  async function startComputerServices(credentials) {
13821
13854
  console.log(chalk67.cyan("Starting computer connector services..."));
13822
- const wsgidavBinary = await findCommand("wsgidav");
13855
+ const wsgidavBinary = await findBinary("wsgidav");
13823
13856
  if (!wsgidavBinary) {
13824
13857
  throw new Error(
13825
13858
  "wsgidav not found\n\nInstall with: pip install wsgidav[cheroot]"
13826
13859
  );
13827
13860
  }
13828
- const chromeBinary = await findCommand(
13829
- "google-chrome",
13830
- "google-chrome-stable",
13831
- "chromium",
13832
- "chromium-browser",
13833
- "chrome"
13834
- );
13861
+ const chromeBinary = await findBinary(...CHROME_CANDIDATES);
13835
13862
  if (!chromeBinary) {
13836
13863
  throw new Error("Chrome not found\n\nInstall Google Chrome or Chromium");
13837
13864
  }
@@ -13947,6 +13974,7 @@ var connectCommand = new Command67().name("connect").description("Connect a thir
13947
13974
  const apiUrl = await getApiUrl();
13948
13975
  const headers = await getHeaders2();
13949
13976
  if (connectorType === "computer") {
13977
+ await checkComputerDependencies();
13950
13978
  console.log(chalk68.cyan("Setting up computer connector..."));
13951
13979
  const computerClient = initClient13(computerConnectorContract, {
13952
13980
  baseUrl: apiUrl,
@@ -15164,7 +15192,7 @@ var preferenceCommand = new Command77().name("preference").description("View or
15164
15192
 
15165
15193
  // src/index.ts
15166
15194
  var program = new Command78();
15167
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.38.0");
15195
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.38.1");
15168
15196
  program.addCommand(authCommand);
15169
15197
  program.addCommand(infoCommand);
15170
15198
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.38.0",
3
+ "version": "9.38.1",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",