@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.
- package/index.js +124 -96
- 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14730
|
-
|
|
14731
|
-
|
|
14732
|
-
|
|
14733
|
-
|
|
14734
|
-
|
|
14735
|
-
|
|
14736
|
-
|
|
14737
|
-
|
|
14738
|
-
|
|
14739
|
-
|
|
14740
|
-
|
|
14741
|
-
|
|
14742
|
-
|
|
14743
|
-
|
|
14744
|
-
|
|
14745
|
-
|
|
14746
|
-
|
|
14747
|
-
|
|
14748
|
-
|
|
14749
|
-
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
|
|
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
|
-
|
|
14773
|
-
|
|
14774
|
-
|
|
14775
|
-
|
|
14776
|
-
|
|
14777
|
-
|
|
14778
|
-
|
|
14779
|
-
|
|
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.
|
|
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);
|