@vm0/cli 9.36.0 → 9.37.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.
Files changed (2) hide show
  1. package/index.js +124 -96
  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.36.0",
48
+ release: "9.37.0",
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.36.0",
67
+ version: "9.37.0",
68
68
  command: process.argv.slice(2).join(" ")
69
69
  });
70
70
  Sentry.setContext("runtime", {
@@ -605,7 +605,7 @@ async function waitForSilentUpgrade(timeout = TIMEOUT_MS) {
605
605
  // src/commands/info/index.ts
606
606
  var CONFIG_PATH = join2(homedir2(), ".vm0", "config.json");
607
607
  var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
608
- console.log(chalk7.bold(`VM0 CLI v${"9.36.0"}`));
608
+ console.log(chalk7.bold(`VM0 CLI v${"9.37.0"}`));
609
609
  console.log();
610
610
  const config = await loadConfig();
611
611
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -3786,13 +3786,15 @@ import { z as z24 } from "zod";
3786
3786
  var c20 = initContract();
3787
3787
  var userPreferencesResponseSchema = z24.object({
3788
3788
  timezone: z24.string().nullable(),
3789
- notifyEmail: z24.boolean()
3789
+ notifyEmail: z24.boolean(),
3790
+ notifySlack: z24.boolean()
3790
3791
  });
3791
3792
  var updateUserPreferencesRequestSchema = z24.object({
3792
3793
  timezone: z24.string().min(1).optional(),
3793
- notifyEmail: z24.boolean().optional()
3794
+ notifyEmail: z24.boolean().optional(),
3795
+ notifySlack: z24.boolean().optional()
3794
3796
  }).refine(
3795
- (data) => data.timezone !== void 0 || data.notifyEmail !== void 0,
3797
+ (data) => data.timezone !== void 0 || data.notifyEmail !== void 0 || data.notifySlack !== void 0,
3796
3798
  {
3797
3799
  message: "At least one preference must be provided"
3798
3800
  }
@@ -6343,7 +6345,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
6343
6345
  options.autoUpdate = false;
6344
6346
  }
6345
6347
  if (options.autoUpdate !== false) {
6346
- await startSilentUpgrade("9.36.0");
6348
+ await startSilentUpgrade("9.37.0");
6347
6349
  }
6348
6350
  try {
6349
6351
  let result;
@@ -8540,7 +8542,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
8540
8542
  async (identifier, prompt, options) => {
8541
8543
  try {
8542
8544
  if (options.autoUpdate !== false) {
8543
- await startSilentUpgrade("9.36.0");
8545
+ await startSilentUpgrade("9.37.0");
8544
8546
  }
8545
8547
  const { scope, name, version } = parseIdentifier(identifier);
8546
8548
  if (scope && !options.experimentalSharedAgent) {
@@ -10116,7 +10118,7 @@ var cookAction = new Command27().name("cook").description("Quick start: prepare,
10116
10118
  ).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(
10117
10119
  async (prompt, options) => {
10118
10120
  if (options.autoUpdate !== false) {
10119
- const shouldExit = await checkAndUpgrade("9.36.0", prompt);
10121
+ const shouldExit = await checkAndUpgrade("9.37.0", prompt);
10120
10122
  if (shouldExit) {
10121
10123
  process.exit(0);
10122
10124
  }
@@ -14701,12 +14703,12 @@ function isValidTimezone(timezone) {
14701
14703
  return false;
14702
14704
  }
14703
14705
  }
14704
- function parseNotifyEmail(value) {
14706
+ function parseOnOff(flag, value) {
14705
14707
  const lower = value.toLowerCase();
14706
14708
  if (lower === "on" || lower === "true" || lower === "1") return true;
14707
14709
  if (lower === "off" || lower === "false" || lower === "0") return false;
14708
14710
  throw new Error(
14709
- `Invalid value for --notify-email: "${value}". Use "on" or "off".`
14711
+ `Invalid value for --${flag}: "${value}". Use "on" or "off".`
14710
14712
  );
14711
14713
  }
14712
14714
  function displayPreferences(prefs) {
@@ -14717,99 +14719,125 @@ function displayPreferences(prefs) {
14717
14719
  console.log(
14718
14720
  ` Email notify: ${prefs.notifyEmail ? chalk78.green("on") : chalk78.dim("off")}`
14719
14721
  );
14722
+ console.log(
14723
+ ` Slack notify: ${prefs.notifySlack ? chalk78.green("on") : chalk78.dim("off")}`
14724
+ );
14720
14725
  }
14721
- var preferenceCommand = new Command77().name("preference").description("View or update your preferences").option("--timezone <timezone>", "IANA timezone (e.g., America/New_York)").option("--notify-email <on|off>", "Enable or disable email notifications").action(
14722
- withErrorHandler(
14723
- async (opts) => {
14724
- const hasTimezone = opts.timezone !== void 0;
14725
- const hasNotifyEmail = opts.notifyEmail !== void 0;
14726
- if (hasTimezone || hasNotifyEmail) {
14727
- const updates = {};
14728
- if (hasTimezone) {
14729
- if (!isValidTimezone(opts.timezone)) {
14730
- console.error(chalk78.red(`Invalid timezone: ${opts.timezone}`));
14731
- console.error(
14732
- chalk78.dim(
14733
- " Use an IANA timezone identifier (e.g., America/New_York, Asia/Shanghai)"
14734
- )
14735
- );
14736
- process.exit(1);
14737
- }
14738
- updates.timezone = opts.timezone;
14739
- }
14740
- if (hasNotifyEmail) {
14741
- try {
14742
- updates.notifyEmail = parseNotifyEmail(opts.notifyEmail);
14743
- } catch (err) {
14744
- console.error(chalk78.red(err.message));
14745
- process.exit(1);
14746
- }
14747
- }
14748
- const result = await updateUserPreferences(updates);
14749
- if (updates.timezone !== void 0) {
14750
- console.log(
14751
- chalk78.green(
14752
- `Timezone set to ${chalk78.cyan(result.timezone ?? updates.timezone)}`
14753
- )
14754
- );
14755
- }
14756
- if (updates.notifyEmail !== void 0) {
14757
- console.log(
14758
- chalk78.green(
14759
- `Email notifications ${result.notifyEmail ? "enabled" : "disabled"}`
14760
- )
14761
- );
14762
- }
14763
- return;
14764
- }
14765
- const prefs = await getUserPreferences();
14766
- displayPreferences(prefs);
14767
- if (isInteractive()) {
14768
- if (!prefs.timezone) {
14769
- const detectedTz = detectTimezone2();
14770
- console.log(chalk78.dim(`
14726
+ function buildUpdates(opts) {
14727
+ const hasTimezone = opts.timezone !== void 0;
14728
+ const hasNotifyEmail = opts.notifyEmail !== void 0;
14729
+ const hasNotifySlack = opts.notifySlack !== void 0;
14730
+ if (!hasTimezone && !hasNotifyEmail && !hasNotifySlack) return null;
14731
+ const updates = {};
14732
+ if (hasTimezone) {
14733
+ if (!isValidTimezone(opts.timezone)) {
14734
+ console.error(chalk78.red(`Invalid timezone: ${opts.timezone}`));
14735
+ console.error(
14736
+ chalk78.dim(
14737
+ " Use an IANA timezone identifier (e.g., America/New_York, Asia/Shanghai)"
14738
+ )
14739
+ );
14740
+ process.exit(1);
14741
+ }
14742
+ updates.timezone = opts.timezone;
14743
+ }
14744
+ if (hasNotifyEmail) {
14745
+ try {
14746
+ updates.notifyEmail = parseOnOff("notify-email", opts.notifyEmail);
14747
+ } catch (err) {
14748
+ console.error(chalk78.red(err.message));
14749
+ process.exit(1);
14750
+ }
14751
+ }
14752
+ if (hasNotifySlack) {
14753
+ try {
14754
+ updates.notifySlack = parseOnOff("notify-slack", opts.notifySlack);
14755
+ } catch (err) {
14756
+ console.error(chalk78.red(err.message));
14757
+ process.exit(1);
14758
+ }
14759
+ }
14760
+ return updates;
14761
+ }
14762
+ function printUpdateResult(updates, result) {
14763
+ if (updates.timezone !== void 0) {
14764
+ console.log(
14765
+ chalk78.green(
14766
+ `Timezone set to ${chalk78.cyan(result.timezone ?? updates.timezone)}`
14767
+ )
14768
+ );
14769
+ }
14770
+ if (updates.notifyEmail !== void 0) {
14771
+ console.log(
14772
+ chalk78.green(
14773
+ `Email notifications ${result.notifyEmail ? "enabled" : "disabled"}`
14774
+ )
14775
+ );
14776
+ }
14777
+ if (updates.notifySlack !== void 0) {
14778
+ console.log(
14779
+ chalk78.green(
14780
+ `Slack notifications ${result.notifySlack ? "enabled" : "disabled"}`
14781
+ )
14782
+ );
14783
+ }
14784
+ }
14785
+ async function interactiveSetup(prefs) {
14786
+ if (!prefs.timezone) {
14787
+ const detectedTz = detectTimezone2();
14788
+ console.log(chalk78.dim(`
14771
14789
  System timezone detected: ${detectedTz}`));
14772
- const tz = await promptText(
14773
- "Set timezone? (enter timezone or leave empty to skip)",
14774
- detectedTz
14775
- );
14776
- if (tz?.trim()) {
14777
- if (!isValidTimezone(tz.trim())) {
14778
- console.error(chalk78.red(`Invalid timezone: ${tz.trim()}`));
14779
- process.exit(1);
14780
- }
14781
- await updateUserPreferences({ timezone: tz.trim() });
14782
- console.log(
14783
- chalk78.green(`Timezone set to ${chalk78.cyan(tz.trim())}`)
14784
- );
14785
- }
14786
- }
14787
- if (!prefs.notifyEmail) {
14788
- const enable = await promptConfirm(
14789
- "\nEnable email notifications for scheduled runs?",
14790
- false
14791
- );
14792
- if (enable) {
14793
- await updateUserPreferences({ notifyEmail: true });
14794
- console.log(chalk78.green("Email notifications enabled"));
14795
- }
14796
- }
14797
- } else if (!prefs.timezone) {
14798
- console.log();
14799
- console.log(
14800
- `To set timezone: ${chalk78.cyan("vm0 preference --timezone <timezone>")}`
14801
- );
14802
- console.log(
14803
- chalk78.dim("Example: vm0 preference --timezone America/New_York")
14804
- );
14790
+ const tz = await promptText(
14791
+ "Set timezone? (enter timezone or leave empty to skip)",
14792
+ detectedTz
14793
+ );
14794
+ if (tz?.trim()) {
14795
+ if (!isValidTimezone(tz.trim())) {
14796
+ console.error(chalk78.red(`Invalid timezone: ${tz.trim()}`));
14797
+ process.exit(1);
14805
14798
  }
14799
+ await updateUserPreferences({ timezone: tz.trim() });
14800
+ console.log(chalk78.green(`Timezone set to ${chalk78.cyan(tz.trim())}`));
14806
14801
  }
14807
- )
14802
+ }
14803
+ if (!prefs.notifyEmail) {
14804
+ const enable = await promptConfirm(
14805
+ "\nEnable email notifications for scheduled runs?",
14806
+ false
14807
+ );
14808
+ if (enable) {
14809
+ await updateUserPreferences({ notifyEmail: true });
14810
+ console.log(chalk78.green("Email notifications enabled"));
14811
+ }
14812
+ }
14813
+ }
14814
+ var preferenceCommand = new Command77().name("preference").description("View or update your preferences").option("--timezone <timezone>", "IANA timezone (e.g., America/New_York)").option("--notify-email <on|off>", "Enable or disable email notifications").option("--notify-slack <on|off>", "Enable or disable Slack notifications").action(
14815
+ withErrorHandler(async (opts) => {
14816
+ const updates = buildUpdates(opts);
14817
+ if (updates) {
14818
+ const result = await updateUserPreferences(updates);
14819
+ printUpdateResult(updates, result);
14820
+ return;
14821
+ }
14822
+ const prefs = await getUserPreferences();
14823
+ displayPreferences(prefs);
14824
+ if (isInteractive()) {
14825
+ await interactiveSetup(prefs);
14826
+ } else if (!prefs.timezone) {
14827
+ console.log();
14828
+ console.log(
14829
+ `To set timezone: ${chalk78.cyan("vm0 preference --timezone <timezone>")}`
14830
+ );
14831
+ console.log(
14832
+ chalk78.dim("Example: vm0 preference --timezone America/New_York")
14833
+ );
14834
+ }
14835
+ })
14808
14836
  );
14809
14837
 
14810
14838
  // src/index.ts
14811
14839
  var program = new Command78();
14812
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.36.0");
14840
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.37.0");
14813
14841
  program.addCommand(authCommand);
14814
14842
  program.addCommand(infoCommand);
14815
14843
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.36.0",
3
+ "version": "9.37.0",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",