@helm-ai/cli 0.19.0 → 0.21.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 +16 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2545,6 +2545,7 @@ function registerFormCommands(parent) {
|
|
|
2545
2545
|
{ header: "Status", get: (r) => r.status },
|
|
2546
2546
|
{ header: "Fields", get: (r) => r.field_count },
|
|
2547
2547
|
{ header: "Subs", get: (r) => r.submission_count },
|
|
2548
|
+
{ header: "Page", get: (r) => r.is_hosted && r.public_slug ? String(r.public_slug) : "-", truncate: 24 },
|
|
2548
2549
|
{ header: "ID", get: (r) => r.id, truncate: 8 }
|
|
2549
2550
|
], opts.output ?? defaultFormat()));
|
|
2550
2551
|
} catch (err) {
|
|
@@ -2890,6 +2891,17 @@ function parseDayOfWeek(input) {
|
|
|
2890
2891
|
if (n >= 0 && n <= 6) return n;
|
|
2891
2892
|
throw new Error(`Bad --day "${input}". Use mon|tue|... or 0-6.`);
|
|
2892
2893
|
}
|
|
2894
|
+
var OUTPUT_CHANNELS = ["notification", "slack", "slack_dm", "task_comment", "email"];
|
|
2895
|
+
function parseChannelList(input) {
|
|
2896
|
+
if (!input) return void 0;
|
|
2897
|
+
const parts = input.split(",").map((p) => p.trim()).filter(Boolean);
|
|
2898
|
+
for (const p of parts) {
|
|
2899
|
+
if (!OUTPUT_CHANNELS.includes(p)) {
|
|
2900
|
+
throw new Error(`Bad --output-channels entry "${p}". Use ${OUTPUT_CHANNELS.join("|")}.`);
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
return parts.length > 0 ? parts : void 0;
|
|
2904
|
+
}
|
|
2893
2905
|
function registerAgentCommands(parent) {
|
|
2894
2906
|
const cmd = parent.command("agent").alias("agents").description("Manage AI agents");
|
|
2895
2907
|
const sched = cmd.command("schedule").description("Manage agent schedules");
|
|
@@ -2901,7 +2913,7 @@ function registerAgentCommands(parent) {
|
|
|
2901
2913
|
{ header: "Name", get: (r) => r.name, truncate: 35 },
|
|
2902
2914
|
{ header: "Frequency", get: (r) => r.frequency },
|
|
2903
2915
|
{ header: "Time", get: (r) => r.time_of_day },
|
|
2904
|
-
{ header: "Output", get: (r) => r.output_channel },
|
|
2916
|
+
{ header: "Output", get: (r) => (r.output_channels?.length ? r.output_channels : [r.output_channel]).join(", ") },
|
|
2905
2917
|
{ header: "Enabled", get: (r) => r.enabled ? "yes" : "no" },
|
|
2906
2918
|
{ header: "ID", get: (r) => r.id, truncate: 8 }
|
|
2907
2919
|
], opts.output ?? defaultFormat()));
|
|
@@ -2911,7 +2923,7 @@ function registerAgentCommands(parent) {
|
|
|
2911
2923
|
return;
|
|
2912
2924
|
}
|
|
2913
2925
|
});
|
|
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) => {
|
|
2926
|
+
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
2927
|
try {
|
|
2916
2928
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2917
2929
|
const schedule = await client.agentSchedules.create({
|
|
@@ -2923,7 +2935,8 @@ function registerAgentCommands(parent) {
|
|
|
2923
2935
|
day_of_month: opts.dayOfMonth,
|
|
2924
2936
|
time_of_day: opts.time,
|
|
2925
2937
|
timezone: opts.timezone,
|
|
2926
|
-
output_channel: opts.outputChannel
|
|
2938
|
+
output_channel: opts.outputChannel,
|
|
2939
|
+
output_channels: parseChannelList(opts.outputChannels)
|
|
2927
2940
|
});
|
|
2928
2941
|
console.log(JSON.stringify(schedule, null, 2));
|
|
2929
2942
|
} catch (err) {
|