@vm0/cli 9.86.10 → 9.87.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.
- package/{chunk-BB3ODMCC.js → chunk-QAFCEPXB.js} +974 -806
- package/chunk-QAFCEPXB.js.map +1 -0
- package/index.js +27 -10
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +32 -17
- package/zero.js.map +1 -1
- package/chunk-BB3ODMCC.js.map +0 -1
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
updateZeroUserPreferences,
|
|
92
92
|
upsertZeroOrgModelProvider,
|
|
93
93
|
withErrorHandler
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-QAFCEPXB.js";
|
|
95
95
|
|
|
96
96
|
// src/zero.ts
|
|
97
97
|
import { Command as Command61 } from "commander";
|
|
@@ -2452,28 +2452,41 @@ async function gatherPromptText(optionPrompt, existingPrompt) {
|
|
|
2452
2452
|
existingPrompt || "let's start working."
|
|
2453
2453
|
);
|
|
2454
2454
|
}
|
|
2455
|
-
async function gatherNotificationPreferences(optionNotifyEmail, optionNotifySlack, existingSchedule) {
|
|
2455
|
+
async function gatherNotificationPreferences(optionNotifyEmail, optionNotifySlack, optionNotifySlackChannelId, existingSchedule) {
|
|
2456
2456
|
if (optionNotifyEmail !== void 0 && optionNotifySlack !== void 0) {
|
|
2457
2457
|
return {
|
|
2458
2458
|
notifyEmail: optionNotifyEmail,
|
|
2459
|
-
notifySlack: optionNotifySlack
|
|
2459
|
+
notifySlack: optionNotifySlack,
|
|
2460
|
+
notifySlackChannelId: optionNotifySlackChannelId
|
|
2460
2461
|
};
|
|
2461
2462
|
}
|
|
2462
2463
|
if (!isInteractive()) {
|
|
2463
2464
|
return {
|
|
2464
2465
|
notifyEmail: optionNotifyEmail,
|
|
2465
|
-
notifySlack: optionNotifySlack
|
|
2466
|
+
notifySlack: optionNotifySlack,
|
|
2467
|
+
notifySlackChannelId: optionNotifySlackChannelId
|
|
2466
2468
|
};
|
|
2467
2469
|
}
|
|
2468
2470
|
const notifyEmail = optionNotifyEmail ?? await promptConfirm(
|
|
2469
2471
|
"Enable email notifications?",
|
|
2470
|
-
existingSchedule?.notifyEmail ??
|
|
2472
|
+
existingSchedule?.notifyEmail ?? false
|
|
2471
2473
|
);
|
|
2472
2474
|
const notifySlack = optionNotifySlack ?? await promptConfirm(
|
|
2473
2475
|
"Enable Slack notifications?",
|
|
2474
|
-
existingSchedule?.notifySlack ??
|
|
2476
|
+
existingSchedule?.notifySlack ?? false
|
|
2475
2477
|
);
|
|
2476
|
-
|
|
2478
|
+
let notifySlackChannelId = optionNotifySlackChannelId;
|
|
2479
|
+
if (notifySlackChannelId === void 0 && notifySlack) {
|
|
2480
|
+
const defaultChannel = existingSchedule?.notifySlackChannelId ?? "";
|
|
2481
|
+
const channelInput = await promptText(
|
|
2482
|
+
"Slack channel ID (leave empty for DM)",
|
|
2483
|
+
defaultChannel
|
|
2484
|
+
);
|
|
2485
|
+
if (channelInput) {
|
|
2486
|
+
notifySlackChannelId = channelInput;
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
return { notifyEmail, notifySlack, notifySlackChannelId };
|
|
2477
2490
|
}
|
|
2478
2491
|
async function gatherInterval(optionInterval, existingInterval) {
|
|
2479
2492
|
if (optionInterval) {
|
|
@@ -2568,12 +2581,14 @@ Deploying schedule for agent ${chalk33.cyan(params.agentName)}...`
|
|
|
2568
2581
|
intervalSeconds: params.intervalSeconds,
|
|
2569
2582
|
timezone: params.timezone,
|
|
2570
2583
|
prompt: params.prompt,
|
|
2571
|
-
artifactName: params.artifactName,
|
|
2572
2584
|
...params.notifyEmail !== void 0 && {
|
|
2573
2585
|
notifyEmail: params.notifyEmail
|
|
2574
2586
|
},
|
|
2575
2587
|
...params.notifySlack !== void 0 && {
|
|
2576
2588
|
notifySlack: params.notifySlack
|
|
2589
|
+
},
|
|
2590
|
+
...params.notifySlackChannelId !== void 0 && {
|
|
2591
|
+
notifySlackChannelId: params.notifySlackChannelId
|
|
2577
2592
|
}
|
|
2578
2593
|
});
|
|
2579
2594
|
return deployResult;
|
|
@@ -2653,7 +2668,10 @@ async function handleScheduleEnabling(params) {
|
|
|
2653
2668
|
showEnableHint(agentName);
|
|
2654
2669
|
}
|
|
2655
2670
|
}
|
|
2656
|
-
var setupCommand2 = new Command40().name("setup").description("Create or edit a schedule for a zero agent").argument("<agent-id>", "Agent ID").option("-n, --name <schedule-name>", 'Schedule name (default: "default")').option("-f, --frequency <type>", "Frequency: daily|weekly|monthly|once|loop").option("-t, --time <HH:MM>", "Time to run (24-hour format)").option("-d, --day <day>", "Day of week (mon-sun) or day of month (1-31)").option("-i, --interval <seconds>", "Interval in seconds for loop mode").option("-z, --timezone <tz>", "IANA timezone").option("-p, --prompt <text>", "Prompt to run").option("
|
|
2671
|
+
var setupCommand2 = new Command40().name("setup").description("Create or edit a schedule for a zero agent").argument("<agent-id>", "Agent ID").option("-n, --name <schedule-name>", 'Schedule name (default: "default")').option("-f, --frequency <type>", "Frequency: daily|weekly|monthly|once|loop").option("-t, --time <HH:MM>", "Time to run (24-hour format)").option("-d, --day <day>", "Day of week (mon-sun) or day of month (1-31)").option("-i, --interval <seconds>", "Interval in seconds for loop mode").option("-z, --timezone <tz>", "IANA timezone").option("-p, --prompt <text>", "Prompt to run").option("-e, --enable", "Enable schedule immediately after creation").option("--notify-email", "Enable email notifications (default: false)").option("--no-notify-email", "Disable email notifications").option("--notify-slack", "Enable Slack notifications (default: false)").option("--no-notify-slack", "Disable Slack notifications").option(
|
|
2672
|
+
"--notify-slack-channel-id <channel-id>",
|
|
2673
|
+
"Slack channel ID for notifications (default: DM)"
|
|
2674
|
+
).addHelpText(
|
|
2657
2675
|
"after",
|
|
2658
2676
|
`
|
|
2659
2677
|
Examples:
|
|
@@ -2717,9 +2735,10 @@ Notes:
|
|
|
2717
2735
|
console.log(chalk33.dim("Cancelled"));
|
|
2718
2736
|
return;
|
|
2719
2737
|
}
|
|
2720
|
-
const { notifyEmail, notifySlack } = await gatherNotificationPreferences(
|
|
2738
|
+
const { notifyEmail, notifySlack, notifySlackChannelId } = await gatherNotificationPreferences(
|
|
2721
2739
|
options.notifyEmail,
|
|
2722
2740
|
options.notifySlack,
|
|
2741
|
+
options.notifySlackChannelId,
|
|
2723
2742
|
existingSchedule
|
|
2724
2743
|
);
|
|
2725
2744
|
const deployResult = await buildAndDeploy({
|
|
@@ -2733,9 +2752,9 @@ Notes:
|
|
|
2733
2752
|
intervalSeconds,
|
|
2734
2753
|
timezone,
|
|
2735
2754
|
prompt: promptText_,
|
|
2736
|
-
artifactName: options.artifactName,
|
|
2737
2755
|
notifyEmail,
|
|
2738
|
-
notifySlack
|
|
2756
|
+
notifySlack,
|
|
2757
|
+
notifySlackChannelId
|
|
2739
2758
|
});
|
|
2740
2759
|
displayDeployResult(scheduleName, deployResult);
|
|
2741
2760
|
const shouldPromptEnable = deployResult.created || existingSchedule !== void 0 && !existingSchedule.enabled;
|
|
@@ -2841,10 +2860,6 @@ function printRunConfiguration(schedule) {
|
|
|
2841
2860
|
if (schedule.secretNames && schedule.secretNames.length > 0) {
|
|
2842
2861
|
console.log(`${"Secrets:".padEnd(16)}${schedule.secretNames.join(", ")}`);
|
|
2843
2862
|
}
|
|
2844
|
-
if (schedule.artifactName) {
|
|
2845
|
-
const artifactInfo = schedule.artifactVersion ? `${schedule.artifactName}:${schedule.artifactVersion}` : schedule.artifactName;
|
|
2846
|
-
console.log(`${"Artifact:".padEnd(16)}${artifactInfo}`);
|
|
2847
|
-
}
|
|
2848
2863
|
if (schedule.volumeVersions && Object.keys(schedule.volumeVersions).length > 0) {
|
|
2849
2864
|
console.log(
|
|
2850
2865
|
`${"Volumes:".padEnd(16)}${Object.keys(schedule.volumeVersions).join(", ")}`
|
|
@@ -3508,7 +3523,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
3508
3523
|
var program = new Command61();
|
|
3509
3524
|
program.name("zero").description(
|
|
3510
3525
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
3511
|
-
).version("9.
|
|
3526
|
+
).version("9.87.1").addHelpText(
|
|
3512
3527
|
"after",
|
|
3513
3528
|
`
|
|
3514
3529
|
Examples:
|