@helm-ai/cli 0.17.0 → 0.19.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 +39 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -222,6 +222,14 @@ var HelmClient = class _HelmClient {
|
|
|
222
222
|
const data = await this.request("update_task", "POST", { task_id: taskId, ...input });
|
|
223
223
|
return data.task;
|
|
224
224
|
},
|
|
225
|
+
comments: async (taskId, opts = {}) => {
|
|
226
|
+
const data = await this.request("get_task_comments", "GET", {
|
|
227
|
+
task_id: taskId,
|
|
228
|
+
limit: opts.limit,
|
|
229
|
+
offset: opts.offset
|
|
230
|
+
});
|
|
231
|
+
return data;
|
|
232
|
+
},
|
|
225
233
|
addComment: async (taskId, content, attachments) => {
|
|
226
234
|
const data = await this.request("add_task_comment", "POST", { task_id: taskId, content, attachments });
|
|
227
235
|
return data.comment;
|
|
@@ -1941,6 +1949,36 @@ function registerTaskCommands(parent) {
|
|
|
1941
1949
|
return;
|
|
1942
1950
|
}
|
|
1943
1951
|
});
|
|
1952
|
+
cmd.command("comments <id>").description("Read the comment thread on a task").option("-l, --limit <n>", "max comments", (v) => parseInt(v, 10), 100).option("--offset <n>", "comments to skip, counting from the oldest", (v) => parseInt(v, 10), 0).option("-o, --output <format>").option("-p, --profile <name>").action(async (id, opts) => {
|
|
1953
|
+
try {
|
|
1954
|
+
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
1955
|
+
const result = await client.tasks.comments(id, { limit: opts.limit, offset: opts.offset });
|
|
1956
|
+
const format = opts.output ?? defaultFormat();
|
|
1957
|
+
if (format === "json") {
|
|
1958
|
+
console.log(JSON.stringify(result, null, 2));
|
|
1959
|
+
return;
|
|
1960
|
+
}
|
|
1961
|
+
if (result.comments.length === 0) {
|
|
1962
|
+
console.log(`No comments on ${id}.`);
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
console.log(render(result.comments, [
|
|
1966
|
+
{ header: "When", get: (c) => new Date(c.created_at).toLocaleString() },
|
|
1967
|
+
{ header: "Author", get: (c) => c.author_type === "agent" ? `${c.author} (agent)` : c.author, truncate: 24 },
|
|
1968
|
+
{ header: "Internal", get: (c) => c.is_internal ? "yes" : "" },
|
|
1969
|
+
// Comments are markdown and often multi-line; a table cell is one line.
|
|
1970
|
+
{ header: "Comment", get: (c) => c.content.replace(/\s+/g, " "), truncate: 90 }
|
|
1971
|
+
], format));
|
|
1972
|
+
if (result.has_more) {
|
|
1973
|
+
console.log(`
|
|
1974
|
+
Showing ${result.returned} of ${result.total}. Use --offset to page.`);
|
|
1975
|
+
}
|
|
1976
|
+
} catch (err) {
|
|
1977
|
+
console.error(formatErrorForCli(err));
|
|
1978
|
+
process.exitCode = 1;
|
|
1979
|
+
return;
|
|
1980
|
+
}
|
|
1981
|
+
});
|
|
1944
1982
|
cmd.command("comment <id> <content>").description("Add a comment to a task").option("--attach <path...>", "file(s) to attach (repeatable, any type, max 25MB each)").option("-p, --profile <name>").action(async (id, content, opts) => {
|
|
1945
1983
|
try {
|
|
1946
1984
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
@@ -2873,7 +2911,7 @@ function registerAgentCommands(parent) {
|
|
|
2873
2911
|
return;
|
|
2874
2912
|
}
|
|
2875
2913
|
});
|
|
2876
|
-
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|task_comment", "notification").option("-p, --profile <name>").action(async (opts) => {
|
|
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) => {
|
|
2877
2915
|
try {
|
|
2878
2916
|
const client = HelmClient.fromProfile(resolveProfile(opts.profile));
|
|
2879
2917
|
const schedule = await client.agentSchedules.create({
|