@pxlabz/tasq-cli 0.1.15 → 0.1.17

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/.tasq-skill.md CHANGED
@@ -51,9 +51,9 @@ tasq task update <ref> [--title <title>] [--description <markdown>]
51
51
  [--parent <ref> | --no-parent]
52
52
 
53
53
  tasq comment add <ref> <body> [--reply-to <commentRef>] [--thread <threadId>]
54
- [--mention <agentName>]…
54
+ [--mention <name>]…
55
55
  tasq comment add --project <id|name> <body> [--reply-to <commentRef>]
56
- [--thread <threadId>] [--mention <agentName>]…
56
+ [--thread <threadId>] [--mention <name>]…
57
57
 
58
58
  tasq thread view <threadId>
59
59
  tasq thread context <threadId> [--markdown]
@@ -83,7 +83,7 @@ tasq auth whoami
83
83
 
84
84
  `--parent <ref>` makes the task a subtask of another task on the same team (one level only: a subtask cannot take subtasks, and an archived task cannot be a parent). A subtask's project and phase follow its parent, so `task create` refuses `--parent` together with `--project`; move the parent instead. `--no-parent` on `task update` detaches it and leaves its placement alone. `task view` prints `Parent: <key>` on a subtask and `Subtasks: <done>/<total> done` on a parent.
85
85
 
86
- `--mention` is repeatable and matches an agent name exactly, ignoring case.
86
+ `--mention` is repeatable and matches a person or agent name exactly, ignoring case; a person also matches by email. A name that matches more than one member (two people, or a person and an agent) is a usage error that lists the candidates. Agents are woken; people get a `mentioned` notification, and the output prints `mentioned <name>` for each.
87
87
 
88
88
  `task view` and `thread view` print every message with its id on the header line, as ` <createdAt> <author> #<id>` with the body indented beneath it. That `#<id>` is what `--reply-to` and `--thread` take; the `ENG-42#<id>` form is also accepted. The parent must be a message on the same task or project.
89
89
 
@@ -171,7 +171,7 @@ You draft; a person sends. `tasq update draft` always writes a draft, and nothin
171
171
  | --- | --- |
172
172
  | 0 | Success |
173
173
  | 1 | Error; details on stderr |
174
- | 2 | Usage error — a bad flag, or a `--mention` name matching no agent or more than one |
174
+ | 2 | Usage error — a bad flag, or a `--mention` name matching no one or more than one member |
175
175
  | 3 | Rate limited; the message says when to retry. `events listen` never exits here — it waits and continues |
176
176
  | 4 | Your policy denied the action, or it is one only a person may run (`update send`). Do not retry it; say what was refused |
177
177
 
package/README.md CHANGED
@@ -27,21 +27,24 @@ TASQ_API_KEY=tq_ag_… TASQ_WORKSPACE=acme tasq task list
27
27
  ```
28
28
  tasq workspace list | use <slug>
29
29
  tasq task list | view <ref> | create | update <ref>
30
- tasq comment add <ref> <body> [--reply-to <commentRef>] [--mention <agentName>]…
30
+ tasq comment add <ref> <body> [--reply-to <commentRef>] [--mention <name>]…
31
31
  tasq events listen [--wait <seconds>] [--once]
32
32
  tasq events ack <id>…
33
33
  tasq project list | star <project> | unstar <project>
34
+ tasq project share <project> <guest> [--access view|comment] | access <project> <guest> <view|comment> | unshare <project> <guest>
34
35
  tasq initiative list | create <name> | rename <initiative> <name> | archive <initiative>
35
36
  tasq initiative link <initiative> <project> | unlink <initiative> <project>
36
37
  tasq cycle current
37
38
  tasq auth login | logout
38
39
  ```
39
40
 
41
+ `project share` gives a guest (invited from the web app) a project, with comment access unless `--access view`; `project access` changes it and `project unshare` removes it. Admins and the project lead only; an agent key is refused.
42
+
40
43
  Every command takes `--json` for raw output and `-w, --workspace <slug>` to override the default. Task refs accept either the human key (`ENG-42`) or the UUID.
41
44
 
42
45
  ### Mentions and replies
43
46
 
44
- `--mention <agentName>` is repeatable and matches an agent's name exactly, ignoring case. Two agents answering to one name is a usage error (exit 2) rather than a guess. After the comment is written, one line per mention says `delivered to <name>`, or `<name>: suppressed: agents are isolated` when one agent mentioned another — agents do not deliver mentions to each other in this release.
47
+ `--mention <name>` is repeatable and matches a person's or an agent's name exactly, ignoring case; a person also matches by email. A name that matches more than one member — two people, two agents, or a person and an agent — is a usage error (exit 2) that lists the candidates rather than a guess. Each mentioned person gets a `mentioned` notification and a `mentioned <name>` line. After the comment is written, one line per mention says `delivered to <name>`, or `<name>: suppressed: agents are isolated` when one agent mentioned another — agents do not deliver mentions to each other in this release.
45
48
 
46
49
  `--reply-to` takes a comment id, or the `ENG-42#<id>` form `task view` prints. The parent must be a comment on the same task.
47
50
 
@@ -89,7 +92,7 @@ Both are examples. Tasq stores and delivers the event; it never runs your agent.
89
92
  | --- | --- |
90
93
  | 0 | Success |
91
94
  | 1 | Error (details on stderr) |
92
- | 2 | Usage error — including an `--mention` name that matches no agent or more than one |
95
+ | 2 | Usage error — including an `--mention` name that matches no one or more than one member |
93
96
  | 3 | Rate limited; the message includes when to retry. `events listen` does not exit here: it sleeps for `Retry-After` and carries on |
94
97
  | 4 | The agent's policy denied the action |
95
98
 
package/dist/tasq.js CHANGED
@@ -6651,7 +6651,14 @@ var TasqClient = class _TasqClient {
6651
6651
  * key is refused by policy whatever its preset.
6652
6652
  */
6653
6653
  star: (slug, input) => this.dispatch("project.star", slug, input),
6654
- unstar: (slug, input) => this.dispatch("project.unstar", slug, input)
6654
+ unstar: (slug, input) => this.dispatch("project.unstar", slug, input),
6655
+ /**
6656
+ * Share a project with a guest already in the workspace (6.2). Admins
6657
+ * and the project lead only; an agent key is always refused.
6658
+ */
6659
+ grantGuest: (slug, input) => this.dispatch("project.grantGuest", slug, input),
6660
+ setGuestAccess: (slug, input) => this.dispatch("project.setGuestAccess", slug, input),
6661
+ revokeGuest: (slug, input) => this.dispatch("project.revokeGuest", slug, input)
6655
6662
  };
6656
6663
  /**
6657
6664
  * Initiatives group projects across teams. Any member reads them; every
@@ -6946,7 +6953,7 @@ function reportError(error, io2) {
6946
6953
  // package.json
6947
6954
  var package_default = {
6948
6955
  name: "@pxlabz/tasq-cli",
6949
- version: "0.1.15",
6956
+ version: "0.1.17",
6950
6957
  description: "Command-line client for Tasq, for humans and agents alike",
6951
6958
  keywords: [
6952
6959
  "tasq",
@@ -7400,27 +7407,35 @@ function replyRef(options) {
7400
7407
  }
7401
7408
  return replyTo;
7402
7409
  }
7410
+ function mentionCandidate(member) {
7411
+ const name = member.name ?? "(no name)";
7412
+ return member.type === "agent" ? `${name} (agent)` : `${name} <${member.email ?? "no email"}> (person)`;
7413
+ }
7403
7414
  function resolveMentions(members, names) {
7404
- const agents = members.filter(
7405
- (member) => member.type === "agent" && member.agentId !== null
7406
- );
7407
- return names.map((name) => {
7415
+ const resolved = { agentIds: [], memberIds: [] };
7416
+ for (const name of names) {
7408
7417
  const wanted = name.trim().toLowerCase();
7409
- const matched = agents.filter(
7410
- (agent) => (agent.name ?? "").toLowerCase() === wanted
7418
+ const matched = members.filter(
7419
+ (member) => member.type === "agent" ? member.agentId !== null && (member.name ?? "").toLowerCase() === wanted : (member.name ?? "").toLowerCase() === wanted || (member.email ?? "").toLowerCase() === wanted
7411
7420
  );
7412
- if (matched.length === 0) {
7421
+ const [only] = matched;
7422
+ if (only === void 0) {
7413
7423
  throw new UsageError(
7414
- `No agent named "${name}" in this workspace. Run "tasq workspace members" to see the names.`
7424
+ `No person or agent named "${name}" in this workspace. Run "tasq workspace members" to see the names.`
7415
7425
  );
7416
7426
  }
7417
7427
  if (matched.length > 1) {
7418
7428
  throw new UsageError(
7419
- `"${name}" matches ${matched.length} agents. Rename one, or pass the agent id.`
7429
+ `"${name}" is ambiguous: it matches ${matched.map(mentionCandidate).join(", ")}. Mention a person by email, or rename one.`
7420
7430
  );
7421
7431
  }
7422
- return matched[0]?.agentId ?? "";
7423
- });
7432
+ if (only.type === "agent" && only.agentId !== null) {
7433
+ resolved.agentIds.push(only.agentId);
7434
+ } else {
7435
+ resolved.memberIds.push(only.id);
7436
+ }
7437
+ }
7438
+ return resolved;
7424
7439
  }
7425
7440
  function reasonPhrase(reason) {
7426
7441
  switch (reason) {
@@ -7430,6 +7445,8 @@ function reasonPhrase(reason) {
7430
7445
  return `loop stopped after ${MAX_CONSECUTIVE_AGENT_MESSAGES} agent messages in a row; waiting for a person`;
7431
7446
  case "fanout_cap":
7432
7447
  return `fan-out cap of ${MAX_AGENT_WAKES_PER_MESSAGE} reached`;
7448
+ case "guest_actor":
7449
+ return "a guest wrote it; guests never wake agents";
7433
7450
  default:
7434
7451
  return null;
7435
7452
  }
@@ -7529,7 +7546,8 @@ async function commentAdd(ctx, taskRef, body, options = {}) {
7529
7546
  if (parent !== void 0) {
7530
7547
  input.parentId = resolveParentId(target.comments, target.label, parent);
7531
7548
  }
7532
- if (mentions.length > 0) input.mentions = mentions;
7549
+ if (mentions.agentIds.length > 0) input.mentions = mentions.agentIds;
7550
+ if (mentions.memberIds.length > 0) input.memberMentions = mentions.memberIds;
7533
7551
  const added = await ctx.client.dispatch("comment.add", slug, input);
7534
7552
  if (ctx.config.json) {
7535
7553
  ctx.io.out(jsonOutput(added.result));
@@ -7542,6 +7560,12 @@ async function commentAdd(ctx, taskRef, body, options = {}) {
7542
7560
  for (const mention of added.result.mentions ?? []) {
7543
7561
  ctx.io.out(mentionLine(mention, nameById.get(mention.agentId)));
7544
7562
  }
7563
+ const nameByMemberId = new Map(
7564
+ members.map((member) => [member.id, member.name])
7565
+ );
7566
+ for (const memberId of added.result.memberMentions ?? []) {
7567
+ ctx.io.out(`mentioned ${nameByMemberId.get(memberId) ?? "a person"}`);
7568
+ }
7545
7569
  const threadMessages = added.result.threadMessages ?? [];
7546
7570
  if (threadMessages.length > 0) ctx.io.out(threadLine(threadMessages));
7547
7571
  }
@@ -7771,6 +7795,82 @@ async function projectUnstar(ctx, ref) {
7771
7795
  ctx.config.json ? jsonOutput(result) : `Unstarred ${project.name}.`
7772
7796
  );
7773
7797
  }
7798
+ var UUID_PATTERN4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
7799
+ function parseAccess(value) {
7800
+ const access = value.trim().toLowerCase();
7801
+ if (access !== "view" && access !== "comment") {
7802
+ throw new UsageError(
7803
+ `Access must be view or comment, not "${value}".`
7804
+ );
7805
+ }
7806
+ return access;
7807
+ }
7808
+ async function resolveGuest(client, slug, ref) {
7809
+ const trimmed = ref.trim();
7810
+ const guests = (await client.members.list(slug)).filter(
7811
+ (member) => member.role === "guest"
7812
+ );
7813
+ if (UUID_PATTERN4.test(trimmed)) {
7814
+ const found = guests.find((guest) => guest.id === trimmed);
7815
+ return { id: trimmed, name: found?.name ?? found?.email ?? trimmed };
7816
+ }
7817
+ const wanted = trimmed.toLowerCase();
7818
+ const matched = guests.filter(
7819
+ (guest) => (guest.name ?? "").toLowerCase() === wanted || (guest.email ?? "").toLowerCase() === wanted
7820
+ );
7821
+ const [only] = matched;
7822
+ if (only === void 0) {
7823
+ throw new UsageError(
7824
+ `No guest named "${ref}" in this workspace. Invite them from the web app first; run "tasq workspace members" to see the names.`
7825
+ );
7826
+ }
7827
+ if (matched.length > 1) {
7828
+ throw new UsageError(
7829
+ `"${ref}" matches ${matched.length} guests. Pass their email or member id instead.`
7830
+ );
7831
+ }
7832
+ return { id: only.id, name: only.name ?? only.email ?? only.id };
7833
+ }
7834
+ async function projectShare(ctx, projectRef, guestRef, options) {
7835
+ const slug = requireWorkspace(ctx.config);
7836
+ const access = parseAccess(options.access ?? "comment");
7837
+ const project = await resolveProject(ctx.client, slug, projectRef);
7838
+ const guest = await resolveGuest(ctx.client, slug, guestRef);
7839
+ const { result } = await ctx.client.projects.grantGuest(slug, {
7840
+ projectId: project.id,
7841
+ memberId: guest.id,
7842
+ access
7843
+ });
7844
+ ctx.io.out(
7845
+ ctx.config.json ? jsonOutput(result) : `Shared ${project.name} with ${guest.name} (can ${access}).`
7846
+ );
7847
+ }
7848
+ async function projectAccess(ctx, projectRef, guestRef, accessValue) {
7849
+ const slug = requireWorkspace(ctx.config);
7850
+ const access = parseAccess(accessValue);
7851
+ const project = await resolveProject(ctx.client, slug, projectRef);
7852
+ const guest = await resolveGuest(ctx.client, slug, guestRef);
7853
+ const { result } = await ctx.client.projects.setGuestAccess(slug, {
7854
+ projectId: project.id,
7855
+ memberId: guest.id,
7856
+ access
7857
+ });
7858
+ ctx.io.out(
7859
+ ctx.config.json ? jsonOutput(result) : `${guest.name} can now ${access} ${project.name}.`
7860
+ );
7861
+ }
7862
+ async function projectUnshare(ctx, projectRef, guestRef) {
7863
+ const slug = requireWorkspace(ctx.config);
7864
+ const project = await resolveProject(ctx.client, slug, projectRef);
7865
+ const guest = await resolveGuest(ctx.client, slug, guestRef);
7866
+ const { result } = await ctx.client.projects.revokeGuest(slug, {
7867
+ projectId: project.id,
7868
+ memberId: guest.id
7869
+ });
7870
+ ctx.io.out(
7871
+ ctx.config.json ? jsonOutput(result) : `Stopped sharing ${project.name} with ${guest.name}.`
7872
+ );
7873
+ }
7774
7874
 
7775
7875
  // src/commands/release.ts
7776
7876
  import { writeFileSync as writeFileSync2 } from "fs";
@@ -8313,7 +8413,7 @@ function approvalLine(approval) {
8313
8413
  }
8314
8414
  return `${state} ${preposition} ${approval.approver.name ?? approval.approver.memberId}`;
8315
8415
  }
8316
- var UUID_PATTERN4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
8416
+ var UUID_PATTERN5 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
8317
8417
  function resolveApprover(members, ref) {
8318
8418
  const wanted = ref.trim().toLowerCase();
8319
8419
  const matched = members.filter(
@@ -8338,7 +8438,7 @@ async function taskRequestApproval(ctx, taskRef, options) {
8338
8438
  throw new UsageError("--approver is required: a person's name, email or member id.");
8339
8439
  }
8340
8440
  const ref = options.approver.trim();
8341
- const approver = UUID_PATTERN4.test(ref) ? { id: ref, name: null } : resolveApprover(await ctx.client.members.list(slug), ref);
8441
+ const approver = UUID_PATTERN5.test(ref) ? { id: ref, name: null } : resolveApprover(await ctx.client.members.list(slug), ref);
8342
8442
  const taskId = await resolveTaskId(ctx.client, slug, taskRef);
8343
8443
  const response = await ctx.client.dispatch("task.requestApproval", slug, {
8344
8444
  taskId,
@@ -8555,8 +8655,8 @@ function buildProgram(io2) {
8555
8655
  }
8556
8656
  const comment = program2.command("comment").description("Task and project comments");
8557
8657
  comment.command("add").argument("<taskRefOrBody>", "task identifier or id, or the body with --project").argument("[body]", "comment body, when a task was given").description("Add a comment to a task or a project").usage("[options] <taskRef> <body>\n tasq comment add [options] --project <projectRef> <body>").option("--project <projectRef>", "project id or name, instead of a task").option("--reply-to <commentRef>", "comment id, or ENG-42#<id>, to reply to").option("--thread <threadId>", "thread root id, an alias for --reply-to").option(
8558
- "--mention <agentName>",
8559
- "agent to mention, repeatable",
8658
+ "--mention <name>",
8659
+ "person or agent to mention, by name (or a person's email), repeatable",
8560
8660
  (value, previous) => [
8561
8661
  ...previous ?? [],
8562
8662
  value
@@ -8604,6 +8704,17 @@ function buildProgram(io2) {
8604
8704
  project.command("unstar").argument("<project>", "project id or name").description("Remove your star from a project").action(async (ref) => {
8605
8705
  await projectUnstar(contextFor(program2, io2), ref);
8606
8706
  });
8707
+ project.command("share").argument("<project>", "project id or name").argument("<guest>", "the guest's name, email or member id").option("--access <access>", "view or comment", "comment").description("Share a project with a guest (admins and the project lead)").action(
8708
+ async (ref, guestRef, options) => {
8709
+ await projectShare(contextFor(program2, io2), ref, guestRef, options);
8710
+ }
8711
+ );
8712
+ project.command("access").argument("<project>", "project id or name").argument("<guest>", "the guest's name, email or member id").argument("<access>", "view or comment").description("Change what a guest can do on a project").action(async (ref, guestRef, access) => {
8713
+ await projectAccess(contextFor(program2, io2), ref, guestRef, access);
8714
+ });
8715
+ project.command("unshare").argument("<project>", "project id or name").argument("<guest>", "the guest's name, email or member id").description("Stop sharing a project with a guest").action(async (ref, guestRef) => {
8716
+ await projectUnshare(contextFor(program2, io2), ref, guestRef);
8717
+ });
8607
8718
  const initiative = program2.command("initiative").description("Initiatives: groups of projects across teams");
8608
8719
  initiative.command("list").description("List initiatives, archived ones included").action(run((ctx) => initiativeList(ctx)));
8609
8720
  initiative.command("create").argument("<name>", "initiative name").description("Create an initiative (admins)").action(async (name) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxlabz/tasq-cli",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Command-line client for Tasq, for humans and agents alike",
5
5
  "keywords": [
6
6
  "tasq",
@@ -49,7 +49,7 @@
49
49
  "commander": "^14.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@pxlabz/tasq-sdk": "0.1.13",
52
+ "@pxlabz/tasq-sdk": "0.1.15",
53
53
  "@types/bun": "^1.3.12",
54
54
  "tsup": "^8.5.0",
55
55
  "typescript": "^5.7.2"