@helm-ai/cli 0.29.1 → 0.30.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.
Files changed (3) hide show
  1. package/README.md +6 -0
  2. package/dist/cli.js +36 -13
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -108,6 +108,12 @@ helm-ai task create --title "Fix the webhook retry" --project <project-id>
108
108
  helm-ai task complete TASK-42
109
109
  helm-ai task comment TASK-42 "Shipped in 1.4.2"
110
110
 
111
+ # Let an agent front the work you do yourself: it owns the task without
112
+ # running it, and your updates post under its name (admins only)
113
+ helm-ai task owner TASK-42 Devin
114
+ helm-ai task comment TASK-42 "Shipped in 1.4.2" --as Devin
115
+ helm-ai task complete TASK-42 --as Devin
116
+
111
117
  # Log the time against it
112
118
  helm-ai time log --task TASK-42 --duration 90m --description "Webhook retry fix"
113
119
 
package/dist/cli.js CHANGED
@@ -25,7 +25,7 @@ function renderSplash(ctx) {
25
25
  }
26
26
 
27
27
  // src/version.ts
28
- var version = "0.29.1";
28
+ var version = "0.30.0";
29
29
 
30
30
  // src/commands/auth.ts
31
31
  import prompts from "prompts";
@@ -218,8 +218,9 @@ var HelmClient = class _HelmClient {
218
218
  const { task_id, task_display_id, message: _msg, ...rest } = data;
219
219
  return { id: task_id, visible_id: task_display_id, ...rest };
220
220
  },
221
- update: async (taskId, input) => {
222
- const data = await this.request("update_task", "POST", { task_id: taskId, ...input });
221
+ /** `asAgent` posts the change under that agent's name (workspace admins only). */
222
+ update: async (taskId, input, asAgent) => {
223
+ const data = await this.request("update_task", "POST", { task_id: taskId, ...input, as_agent: asAgent });
223
224
  return data.task;
224
225
  },
225
226
  comments: async (taskId, opts = {}) => {
@@ -230,9 +231,18 @@ var HelmClient = class _HelmClient {
230
231
  });
231
232
  return data;
232
233
  },
233
- addComment: async (taskId, content, attachments) => {
234
- const data = await this.request("add_task_comment", "POST", { task_id: taskId, content, attachments });
234
+ /** `asAgent` posts the comment under that agent's name (workspace admins only). */
235
+ addComment: async (taskId, content, attachments, asAgent) => {
236
+ const data = await this.request("add_task_comment", "POST", { task_id: taskId, content, attachments, as_agent: asAgent });
235
237
  return data.comment;
238
+ },
239
+ /**
240
+ * Name an agent as the task's owner (assigned and visible, never runs it),
241
+ * or pass null to clear the owner.
242
+ */
243
+ setOwner: async (taskId, agent) => {
244
+ const data = await this.request("set_task_owner", "POST", { task_id: taskId, agent });
245
+ return data;
236
246
  }
237
247
  };
238
248
  attachments = {
@@ -2036,7 +2046,7 @@ function registerTaskCommands(parent) {
2036
2046
  return;
2037
2047
  }
2038
2048
  });
2039
- cmd.command("update <id>").description("Update a task").option("-t, --title <title>").option("-d, --description <text>").option("-s, --status <status>").option("--priority <level>").option("--due <date>", "ISO 8601 date").option("--parent <id>", 'parent task ID or visible_id (use "none" to detach)').option("-a, --assignee <id...>").option("-p, --profile <name>").action(async (id, opts) => {
2049
+ cmd.command("update <id>").description("Update a task").option("-t, --title <title>").option("-d, --description <text>").option("-s, --status <status>").option("--priority <level>").option("--due <date>", "ISO 8601 date").option("--parent <id>", 'parent task ID or visible_id (use "none" to detach)').option("-a, --assignee <id...>").option("--as <agent>", "make the change as one of your agents (name, slug, or id; admins only)").option("-p, --profile <name>").action(async (id, opts) => {
2040
2050
  try {
2041
2051
  const client = HelmClient.fromProfile(resolveProfile(opts.profile));
2042
2052
  const task = await client.tasks.update(id, {
@@ -2046,7 +2056,7 @@ function registerTaskCommands(parent) {
2046
2056
  priority: opts.priority,
2047
2057
  assignee_ids: opts.assignee,
2048
2058
  parent_task_id: opts.parent === "none" ? null : opts.parent
2049
- });
2059
+ }, opts.as);
2050
2060
  console.log(JSON.stringify(task, null, 2));
2051
2061
  } catch (err) {
2052
2062
  console.error(formatErrorForCli(err));
@@ -2054,11 +2064,11 @@ function registerTaskCommands(parent) {
2054
2064
  return;
2055
2065
  }
2056
2066
  });
2057
- cmd.command("complete <id>").description("Mark a task as completed").option("-p, --profile <name>").action(async (id, opts) => {
2067
+ cmd.command("complete <id>").description("Mark a task as completed").option("--as <agent>", "complete it as one of your agents (name, slug, or id; admins only)").option("-p, --profile <name>").action(async (id, opts) => {
2058
2068
  try {
2059
2069
  const client = HelmClient.fromProfile(resolveProfile(opts.profile));
2060
- await client.tasks.update(id, { status: "completed" });
2061
- console.log(`\u2713 Completed ${id}`);
2070
+ await client.tasks.update(id, { status: "completed" }, opts.as);
2071
+ console.log(opts.as ? `\u2713 Completed ${id} as ${opts.as}` : `\u2713 Completed ${id}`);
2062
2072
  } catch (err) {
2063
2073
  console.error(formatErrorForCli(err));
2064
2074
  process.exitCode = 1;
@@ -2095,12 +2105,25 @@ Showing ${result.returned} of ${result.total}. Use --offset to page.`);
2095
2105
  return;
2096
2106
  }
2097
2107
  });
2098
- 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) => {
2108
+ 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("--as <agent>", "post it as one of your agents (name, slug, or id; admins only)").option("-p, --profile <name>").action(async (id, content, opts) => {
2099
2109
  try {
2100
2110
  const client = HelmClient.fromProfile(resolveProfile(opts.profile));
2101
2111
  const attachments = opts.attach ? await uploadAttachments(client, opts.attach) : void 0;
2102
- await client.tasks.addComment(id, content, attachments);
2103
- console.log(`\u2713 Comment added to ${id}`);
2112
+ await client.tasks.addComment(id, content, attachments, opts.as);
2113
+ console.log(opts.as ? `\u2713 Comment added to ${id} as ${opts.as}` : `\u2713 Comment added to ${id}`);
2114
+ } catch (err) {
2115
+ console.error(formatErrorForCli(err));
2116
+ process.exitCode = 1;
2117
+ return;
2118
+ }
2119
+ });
2120
+ cmd.command("owner <id> [agent]").description("Name an agent as the task's owner: assigned and visible on the task, but it never runs the task").option("--clear", "remove the agent owner").option("-p, --profile <name>").action(async (id, agent, opts) => {
2121
+ try {
2122
+ if (opts.clear && agent) throw new Error("Pass an agent or --clear, not both");
2123
+ if (!opts.clear && !agent) throw new Error("Pass an agent (name, slug, or id), or --clear");
2124
+ const client = HelmClient.fromProfile(resolveProfile(opts.profile));
2125
+ const result = await client.tasks.setOwner(id, opts.clear ? null : agent);
2126
+ console.log(result.owner ? `\u2713 ${result.owner.name} owns ${result.task_id}` : result.removed_owner_count > 0 ? `\u2713 Cleared the owner of ${result.task_id}` : `${result.task_id} had no agent owner`);
2104
2127
  } catch (err) {
2105
2128
  console.error(formatErrorForCli(err));
2106
2129
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helm-ai/cli",
3
- "version": "0.29.1",
3
+ "version": "0.30.0",
4
4
  "description": "Command line interface for Helm",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",