@vm0/cli 9.35.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 +147 -55
- 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;
|
|
@@ -858,7 +858,9 @@ var agentNameSchema = z4.string().min(3, "Agent name must be at least 3 characte
|
|
|
858
858
|
);
|
|
859
859
|
var volumeConfigSchema = z4.object({
|
|
860
860
|
name: z4.string().min(1, "Volume name is required"),
|
|
861
|
-
version: z4.string().min(1, "Volume version is required")
|
|
861
|
+
version: z4.string().min(1, "Volume version is required"),
|
|
862
|
+
/** When true, skip mounting without error if volume doesn't exist */
|
|
863
|
+
optional: z4.boolean().optional()
|
|
862
864
|
});
|
|
863
865
|
var SUPPORTED_APPS = ["github"];
|
|
864
866
|
var SUPPORTED_APP_TAGS = ["latest", "dev"];
|
|
@@ -3783,11 +3785,20 @@ var connectorSessionByIdContract = c19.router({
|
|
|
3783
3785
|
import { z as z24 } from "zod";
|
|
3784
3786
|
var c20 = initContract();
|
|
3785
3787
|
var userPreferencesResponseSchema = z24.object({
|
|
3786
|
-
timezone: z24.string().nullable()
|
|
3788
|
+
timezone: z24.string().nullable(),
|
|
3789
|
+
notifyEmail: z24.boolean(),
|
|
3790
|
+
notifySlack: z24.boolean()
|
|
3787
3791
|
});
|
|
3788
3792
|
var updateUserPreferencesRequestSchema = z24.object({
|
|
3789
|
-
timezone: z24.string().min(1,
|
|
3790
|
-
|
|
3793
|
+
timezone: z24.string().min(1).optional(),
|
|
3794
|
+
notifyEmail: z24.boolean().optional(),
|
|
3795
|
+
notifySlack: z24.boolean().optional()
|
|
3796
|
+
}).refine(
|
|
3797
|
+
(data) => data.timezone !== void 0 || data.notifyEmail !== void 0 || data.notifySlack !== void 0,
|
|
3798
|
+
{
|
|
3799
|
+
message: "At least one preference must be provided"
|
|
3800
|
+
}
|
|
3801
|
+
);
|
|
3791
3802
|
var userPreferencesContract = c20.router({
|
|
3792
3803
|
/**
|
|
3793
3804
|
* GET /api/user/preferences
|
|
@@ -6334,7 +6345,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
6334
6345
|
options.autoUpdate = false;
|
|
6335
6346
|
}
|
|
6336
6347
|
if (options.autoUpdate !== false) {
|
|
6337
|
-
await startSilentUpgrade("9.
|
|
6348
|
+
await startSilentUpgrade("9.37.0");
|
|
6338
6349
|
}
|
|
6339
6350
|
try {
|
|
6340
6351
|
let result;
|
|
@@ -8531,7 +8542,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
8531
8542
|
async (identifier, prompt, options) => {
|
|
8532
8543
|
try {
|
|
8533
8544
|
if (options.autoUpdate !== false) {
|
|
8534
|
-
await startSilentUpgrade("9.
|
|
8545
|
+
await startSilentUpgrade("9.37.0");
|
|
8535
8546
|
}
|
|
8536
8547
|
const { scope, name, version } = parseIdentifier(identifier);
|
|
8537
8548
|
if (scope && !options.experimentalSharedAgent) {
|
|
@@ -10107,7 +10118,7 @@ var cookAction = new Command27().name("cook").description("Quick start: prepare,
|
|
|
10107
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(
|
|
10108
10119
|
async (prompt, options) => {
|
|
10109
10120
|
if (options.autoUpdate !== false) {
|
|
10110
|
-
const shouldExit = await checkAndUpgrade("9.
|
|
10121
|
+
const shouldExit = await checkAndUpgrade("9.37.0", prompt);
|
|
10111
10122
|
if (shouldExit) {
|
|
10112
10123
|
process.exit(0);
|
|
10113
10124
|
}
|
|
@@ -14678,7 +14689,7 @@ function displayResult(job) {
|
|
|
14678
14689
|
// src/commands/dev-tool/index.ts
|
|
14679
14690
|
var devToolCommand = new Command76().name("dev-tool").description("Developer tools for testing and debugging").addCommand(composeCommand2);
|
|
14680
14691
|
|
|
14681
|
-
// src/commands/
|
|
14692
|
+
// src/commands/preference/index.ts
|
|
14682
14693
|
import { Command as Command77 } from "commander";
|
|
14683
14694
|
import chalk78 from "chalk";
|
|
14684
14695
|
function detectTimezone2() {
|
|
@@ -14692,60 +14703,141 @@ function isValidTimezone(timezone) {
|
|
|
14692
14703
|
return false;
|
|
14693
14704
|
}
|
|
14694
14705
|
}
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14706
|
+
function parseOnOff(flag, value) {
|
|
14707
|
+
const lower = value.toLowerCase();
|
|
14708
|
+
if (lower === "on" || lower === "true" || lower === "1") return true;
|
|
14709
|
+
if (lower === "off" || lower === "false" || lower === "0") return false;
|
|
14710
|
+
throw new Error(
|
|
14711
|
+
`Invalid value for --${flag}: "${value}". Use "on" or "off".`
|
|
14712
|
+
);
|
|
14713
|
+
}
|
|
14714
|
+
function displayPreferences(prefs) {
|
|
14715
|
+
console.log(chalk78.bold("Current preferences:"));
|
|
14716
|
+
console.log(
|
|
14717
|
+
` Timezone: ${prefs.timezone ? chalk78.cyan(prefs.timezone) : chalk78.dim("not set")}`
|
|
14718
|
+
);
|
|
14719
|
+
console.log(
|
|
14720
|
+
` Email notify: ${prefs.notifyEmail ? chalk78.green("on") : chalk78.dim("off")}`
|
|
14721
|
+
);
|
|
14722
|
+
console.log(
|
|
14723
|
+
` Slack notify: ${prefs.notifySlack ? chalk78.green("on") : chalk78.dim("off")}`
|
|
14724
|
+
);
|
|
14725
|
+
}
|
|
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(`
|
|
14789
|
+
System timezone detected: ${detectedTz}`));
|
|
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()}`));
|
|
14705
14797
|
process.exit(1);
|
|
14706
14798
|
}
|
|
14707
|
-
|
|
14708
|
-
console.log(chalk78.green(
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14799
|
+
await updateUserPreferences({ timezone: tz.trim() });
|
|
14800
|
+
console.log(chalk78.green(`Timezone set to ${chalk78.cyan(tz.trim())}`));
|
|
14801
|
+
}
|
|
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);
|
|
14712
14820
|
return;
|
|
14713
14821
|
}
|
|
14714
14822
|
const prefs = await getUserPreferences();
|
|
14715
|
-
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
console.log(
|
|
14720
|
-
console.log(
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
if (setNow && setNow.trim()) {
|
|
14727
|
-
const tz = setNow.trim();
|
|
14728
|
-
if (!isValidTimezone(tz)) {
|
|
14729
|
-
console.error(chalk78.red(`\u2717 Invalid timezone: ${tz}`));
|
|
14730
|
-
process.exit(1);
|
|
14731
|
-
}
|
|
14732
|
-
await updateUserPreferences({ timezone: tz });
|
|
14733
|
-
console.log(chalk78.green(`\u2713 Timezone set to ${chalk78.cyan(tz)}`));
|
|
14734
|
-
}
|
|
14735
|
-
} else {
|
|
14736
|
-
console.log();
|
|
14737
|
-
console.log(
|
|
14738
|
-
`To set your timezone: ${chalk78.cyan("vm0 timezone <timezone>")}`
|
|
14739
|
-
);
|
|
14740
|
-
console.log(chalk78.dim("Example: vm0 timezone America/New_York"));
|
|
14741
|
-
}
|
|
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
|
+
);
|
|
14742
14834
|
}
|
|
14743
14835
|
})
|
|
14744
14836
|
);
|
|
14745
14837
|
|
|
14746
14838
|
// src/index.ts
|
|
14747
14839
|
var program = new Command78();
|
|
14748
|
-
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");
|
|
14749
14841
|
program.addCommand(authCommand);
|
|
14750
14842
|
program.addCommand(infoCommand);
|
|
14751
14843
|
program.addCommand(composeCommand);
|
|
@@ -14766,7 +14858,7 @@ program.addCommand(connectorCommand);
|
|
|
14766
14858
|
program.addCommand(onboardCommand);
|
|
14767
14859
|
program.addCommand(setupClaudeCommand);
|
|
14768
14860
|
program.addCommand(dashboardCommand);
|
|
14769
|
-
program.addCommand(
|
|
14861
|
+
program.addCommand(preferenceCommand);
|
|
14770
14862
|
program.addCommand(devToolCommand, { hidden: true });
|
|
14771
14863
|
if (process.argv[1]?.endsWith("index.js") || process.argv[1]?.endsWith("index.ts") || process.argv[1]?.endsWith("vm0")) {
|
|
14772
14864
|
program.parse();
|