@helm-ai/cli 0.19.0 → 0.20.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/dist/cli.js +15 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2890,6 +2890,17 @@ function parseDayOfWeek(input) {
|
|
|
2890
2890
|
if (n >= 0 && n <= 6) return n;
|
|
2891
2891
|
throw new Error(`Bad --day "${input}". Use mon|tue|... or 0-6.`);
|
|
2892
2892
|
}
|
|
2893
|
+
var OUTPUT_CHANNELS = ["notification", "slack", "slack_dm", "task_comment", "email"];
|
|
2894
|
+
function parseChannelList(input) {
|
|
2895
|
+
if (!input) return void 0;
|
|
2896
|
+
const parts = input.split(",").map((p) => p.trim()).filter(Boolean);
|
|
2897
|
+
for (const p of parts) {
|
|
2898
|
+
if (!OUTPUT_CHANNELS.includes(p)) {
|
|
2899
|
+
throw new Error(`Bad --output-channels entry "${p}". Use ${OUTPUT_CHANNELS.join("|")}.`);
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
return parts.length > 0 ? parts : void 0;
|
|
2903
|
+
}
|
|
2893
2904
|
function registerAgentCommands(parent) {
|
|
2894
2905
|
const cmd = parent.command("agent").alias("agents").description("Manage AI agents");
|
|
2895
2906
|
const sched = cmd.command("schedule").description("Manage agent schedules");
|
|
@@ -2901,7 +2912,7 @@ function registerAgentCommands(parent) {
|
|
|
2901
2912
|
{ header: "Name", get: (r) => r.name, truncate: 35 },
|
|
2902
2913
|
{ header: "Frequency", get: (r) => r.frequency },
|
|
2903
2914
|
{ header: "Time", get: (r) => r.time_of_day },
|
|
2904
|
-
{ header: "Output", get: (r) => r.output_channel },
|
|
2915
|
+
{ header: "Output", get: (r) => (r.output_channels?.length ? r.output_channels : [r.output_channel]).join(", ") },
|
|
2905
2916
|
{ header: "Enabled", get: (r) => r.enabled ? "yes" : "no" },
|
|
2906
2917
|
{ header: "ID", get: (r) => r.id, truncate: 8 }
|
|
2907
2918
|
], opts.output ?? defaultFormat()));
|
|
@@ -2911,7 +2922,7 @@ function registerAgentCommands(parent) {
|
|
|
2911
2922
|
return;
|
|
2912
2923
|
}
|
|
2913
2924
|
});
|
|
2914
|
-
sched.command("create").description("Create a recurring agent schedule").requiredOption("-a, --agent <id>", "agent ID").requiredOption("-n, --name <name>").requiredOption("--prompt <text>", "prompt the agent runs each time").requiredOption("-f, --frequency <freq>", "daily|weekly|monthly").option("--day <day>", "day-of-week (mon|tue|... or 0-6) for weekly").option("--day-of-month <n>", "day-of-month (1-28) for monthly", (v) => parseInt(v, 10)).option("--time <hhmm>", "HH:MM (default 09:00)", "09:00").option("--timezone <tz>", "", "America/New_York").option("--output-channel <ch>", "notification|slack|slack_dm|task_comment|email", "notification").option("-p, --profile <name>").action(async (opts) => {
|
|
2925
|
+
sched.command("create").description("Create a recurring agent schedule").requiredOption("-a, --agent <id>", "agent ID").requiredOption("-n, --name <name>").requiredOption("--prompt <text>", "prompt the agent runs each time").requiredOption("-f, --frequency <freq>", "daily|weekly|monthly").option("--day <day>", "day-of-week (mon|tue|... or 0-6) for weekly").option("--day-of-month <n>", "day-of-month (1-28) for monthly", (v) => parseInt(v, 10)).option("--time <hhmm>", "HH:MM (default 09:00)", "09:00").option("--timezone <tz>", "", "America/New_York").option("--output-channel <ch>", "notification|slack|slack_dm|task_comment|email", "notification").option("--output-channels <list>", "Deliver to several places at once, comma-separated (e.g. slack,email). Overrides --output-channel.").option("-p, --profile <name>").action(async (opts) => {
|
|
2915
2926
|
try {
|
|
2916
2927
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2917
2928
|
const schedule = await client.agentSchedules.create({
|
|
@@ -2923,7 +2934,8 @@ function registerAgentCommands(parent) {
|
|
|
2923
2934
|
day_of_month: opts.dayOfMonth,
|
|
2924
2935
|
time_of_day: opts.time,
|
|
2925
2936
|
timezone: opts.timezone,
|
|
2926
|
-
output_channel: opts.outputChannel
|
|
2937
|
+
output_channel: opts.outputChannel,
|
|
2938
|
+
output_channels: parseChannelList(opts.outputChannels)
|
|
2927
2939
|
});
|
|
2928
2940
|
console.log(JSON.stringify(schedule, null, 2));
|
|
2929
2941
|
} catch (err) {
|