@pxlabz/tasq-cli 0.1.30 → 0.1.31
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 +2 -1
- package/README.md +1 -0
- package/dist/tasq.js +35 -11
- package/package.json +1 -1
package/.tasq-skill.md
CHANGED
|
@@ -57,6 +57,7 @@ tasq comment add <ref> <body> [--reply-to <commentRef>] [--thread <threadId>]
|
|
|
57
57
|
[--mention <name>]…
|
|
58
58
|
tasq comment add --project <id|name> <body> [--reply-to <commentRef>]
|
|
59
59
|
[--thread <threadId>] [--mention <name>]…
|
|
60
|
+
tasq comment add --doc <docId> <body> [--thread <threadId>] [--propose <text>]
|
|
60
61
|
|
|
61
62
|
tasq time log <ref> <duration> [--day <YYYY-MM-DD>] [--note <text>] [--billable <yes|no>]
|
|
62
63
|
tasq time list <ref>
|
|
@@ -118,7 +119,7 @@ The loop is:
|
|
|
118
119
|
1. **Listen.** `tasq events listen --wait 20`. Each poll holds the connection open for up to 25 seconds and costs one read, so a listener is about three reads a minute.
|
|
119
120
|
2. **Read the task.** `tasq task view <taskKey> --json`. This is where the body of the mention, the rest of the thread, and the task's state come from.
|
|
120
121
|
3. **Gather context.** `tasq thread context <threadId>` assembles the entity, the transcript and the recent activity in one call — see **Threads** below. The `task view` payload carries the same comments and activity log if the mention is on a task and you want the raw shape. Read before you write.
|
|
121
|
-
4. **Reply in the thread.** `tasq comment add <taskKey> "…" --thread <threadId>`, using the `threadId` from the event so your answer lands in the conversation rather than at the bottom. On a project mention, `tasq comment add --project <id|name> "…" --thread <threadId>`.
|
|
122
|
+
4. **Reply in the thread.** `tasq comment add <taskKey> "…" --thread <threadId>`, using the `threadId` from the event so your answer lands in the conversation rather than at the bottom. On a project mention, `tasq comment add --project <id|name> "…" --thread <threadId>`. On a doc mention the event carries `documentId`: `tasq comment add --doc <documentId> "…" --thread <threadId>`. When you are asked to rewrite the thread's passage (`thread context` shows it as **Passage**), add `--propose "<new text>"` (empty deletes it): a member sees it struck and rewritten and accepts or rejects it. Propose the passage only, not the whole doc.
|
|
122
123
|
5. **Acknowledge.** `tasq events ack <eventId>`, and only after the work is done.
|
|
123
124
|
|
|
124
125
|
Ack last, deliberately. An unacknowledged event is offered again ten minutes after delivery, so a crash between step 2 and step 4 costs nothing; an event acked up front is gone. On a 429 the listener sleeps for `Retry-After` and carries on rather than exiting, so do not wrap it in a restart loop that would spend the same budget twice.
|
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ tasq task list | view <ref> | create | update <ref>
|
|
|
30
30
|
tasq task create|update … [--field <key=value>]…
|
|
31
31
|
tasq field list [--all]
|
|
32
32
|
tasq comment add <ref> <body> [--reply-to <commentRef>] [--mention <name>]…
|
|
33
|
+
tasq comment add --doc <docId> <body> [--thread <threadId>] [--propose <text>]
|
|
33
34
|
tasq time log <ref> <duration> [--day YYYY-MM-DD] [--note <text>] [--billable yes|no]
|
|
34
35
|
tasq time list <ref> | edit <entryId> [--duration] [--day] [--note | --no-note] [--billable] | delete <entryId>
|
|
35
36
|
tasq clients hours <client> [--month YYYY-MM] [--billable]
|
package/dist/tasq.js
CHANGED
|
@@ -7078,7 +7078,7 @@ function reportError(error, io2) {
|
|
|
7078
7078
|
// package.json
|
|
7079
7079
|
var package_default = {
|
|
7080
7080
|
name: "@pxlabz/tasq-cli",
|
|
7081
|
-
version: "0.1.
|
|
7081
|
+
version: "0.1.31",
|
|
7082
7082
|
description: "Command-line client for Tasq, for humans and agents alike",
|
|
7083
7083
|
keywords: [
|
|
7084
7084
|
"tasq",
|
|
@@ -7652,21 +7652,24 @@ async function resolveProjectId(ctx, slug, ref) {
|
|
|
7652
7652
|
}
|
|
7653
7653
|
return matched[0]?.id ?? "";
|
|
7654
7654
|
}
|
|
7655
|
-
function commentPositionals(first, second, project) {
|
|
7655
|
+
function commentPositionals(first, second, project, doc) {
|
|
7656
7656
|
if (second !== void 0) return { taskRef: first, body: second };
|
|
7657
|
-
if (project === void 0) {
|
|
7657
|
+
if (project === void 0 && doc === void 0) {
|
|
7658
7658
|
throw new UsageError(
|
|
7659
|
-
"Nothing to comment on. Pass a task key such as ENG-42,
|
|
7659
|
+
"Nothing to comment on. Pass a task key such as ENG-42, --project <id|name> or --doc <id>."
|
|
7660
7660
|
);
|
|
7661
7661
|
}
|
|
7662
7662
|
return { taskRef: void 0, body: first };
|
|
7663
7663
|
}
|
|
7664
|
-
async function resolveTarget(ctx, slug, taskRef, project) {
|
|
7665
|
-
if (taskRef
|
|
7664
|
+
async function resolveTarget(ctx, slug, taskRef, project, doc) {
|
|
7665
|
+
if ([taskRef, project, doc].filter((value) => value !== void 0).length > 1) {
|
|
7666
7666
|
throw new UsageError(
|
|
7667
|
-
"Pass
|
|
7667
|
+
"Pass one of a task, --project <id|name> or --doc <id>."
|
|
7668
7668
|
);
|
|
7669
7669
|
}
|
|
7670
|
+
if (doc !== void 0) {
|
|
7671
|
+
return { input: { documentId: doc }, label: "the doc", comments: null };
|
|
7672
|
+
}
|
|
7670
7673
|
if (project !== void 0) {
|
|
7671
7674
|
const projectId = await resolveProjectId(ctx, slug, project);
|
|
7672
7675
|
const detail = await ctx.client.projects.get(slug, projectId);
|
|
@@ -7691,14 +7694,26 @@ async function resolveTarget(ctx, slug, taskRef, project) {
|
|
|
7691
7694
|
}
|
|
7692
7695
|
async function commentAdd(ctx, taskRef, body, options = {}) {
|
|
7693
7696
|
const slug = requireWorkspace(ctx.config);
|
|
7694
|
-
const target = await resolveTarget(
|
|
7697
|
+
const target = await resolveTarget(
|
|
7698
|
+
ctx,
|
|
7699
|
+
slug,
|
|
7700
|
+
taskRef,
|
|
7701
|
+
options.project,
|
|
7702
|
+
options.doc
|
|
7703
|
+
);
|
|
7695
7704
|
const names = options.mention ?? [];
|
|
7696
7705
|
const members = names.length === 0 ? [] : await ctx.client.members.list(slug);
|
|
7697
7706
|
const mentions = resolveMentions(members, names);
|
|
7698
7707
|
const input = { ...target.input, body };
|
|
7699
7708
|
const parent = replyRef(options);
|
|
7700
7709
|
if (parent !== void 0) {
|
|
7701
|
-
input.parentId = resolveParentId(target.comments, target.label, parent);
|
|
7710
|
+
input.parentId = target.comments === null ? commentIdOf(parent) : resolveParentId(target.comments, target.label, parent);
|
|
7711
|
+
}
|
|
7712
|
+
if (options.propose !== void 0) {
|
|
7713
|
+
if (options.doc === void 0) {
|
|
7714
|
+
throw new UsageError("Only a doc comment can propose an edit (--doc <id>).");
|
|
7715
|
+
}
|
|
7716
|
+
input.proposal = { replacement: options.propose };
|
|
7702
7717
|
}
|
|
7703
7718
|
if (mentions.agentIds.length > 0) input.mentions = mentions.agentIds;
|
|
7704
7719
|
if (mentions.memberIds.length > 0) input.memberMentions = mentions.memberIds;
|
|
@@ -8178,6 +8193,11 @@ function entityFacts(entity) {
|
|
|
8178
8193
|
facts.push(`- Project: ${entity.project?.name ?? "\u2014"}`);
|
|
8179
8194
|
return facts;
|
|
8180
8195
|
}
|
|
8196
|
+
if (entity.type === "document") {
|
|
8197
|
+
facts.push(`- Version: ${entity.version}`);
|
|
8198
|
+
if (entity.passage !== null) facts.push(`- Passage: \u201C${entity.passage}\u201D`);
|
|
8199
|
+
return facts;
|
|
8200
|
+
}
|
|
8181
8201
|
const teams = entity.teams.map((team) => `${team.name} (${team.identifier})`).join(", ");
|
|
8182
8202
|
facts.push(`- Teams: ${teams === "" ? "\u2014" : teams}`);
|
|
8183
8203
|
return facts;
|
|
@@ -9422,7 +9442,10 @@ function buildProgram(io2) {
|
|
|
9422
9442
|
await timeDelete(contextFor(program2, io2), entryId2);
|
|
9423
9443
|
});
|
|
9424
9444
|
const comment = program2.command("comment").description("Task and project comments");
|
|
9425
|
-
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
|
|
9445
|
+
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, a project or a doc").usage("[options] <taskRef> <body>\n tasq comment add [options] --project <projectRef> <body>\n tasq comment add [options] --doc <docId> <body>").option("--project <projectRef>", "project id or name, instead of a task").option("--doc <docId>", "doc id, instead of a task").option(
|
|
9446
|
+
"--propose <text>",
|
|
9447
|
+
"in a doc thread on a passage, a rewrite of that passage (empty deletes it)"
|
|
9448
|
+
).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(
|
|
9426
9449
|
"--mention <name>",
|
|
9427
9450
|
"person or agent to mention, by name (or a person's email), repeatable",
|
|
9428
9451
|
(value, previous) => [
|
|
@@ -9434,7 +9457,8 @@ function buildProgram(io2) {
|
|
|
9434
9457
|
const { taskRef, body } = commentPositionals(
|
|
9435
9458
|
taskRefOrBody,
|
|
9436
9459
|
maybeBody,
|
|
9437
|
-
options.project
|
|
9460
|
+
options.project,
|
|
9461
|
+
options.doc
|
|
9438
9462
|
);
|
|
9439
9463
|
await commentAdd(contextFor(program2, io2), taskRef, body, options);
|
|
9440
9464
|
}
|