@skrr-ai/cli 0.1.91 → 0.1.93
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/base-command.d.ts +44 -0
- package/dist/base-command.js +96 -0
- package/dist/commands/agents/badge.d.ts +41 -0
- package/dist/commands/agents/badge.js +158 -0
- package/dist/commands/agents/create.d.ts +24 -0
- package/dist/commands/agents/create.js +212 -0
- package/dist/commands/agents/embed.d.ts +20 -0
- package/dist/commands/agents/embed.js +61 -0
- package/dist/commands/agents/share.d.ts +27 -0
- package/dist/commands/agents/share.js +100 -0
- package/dist/commands/agents/vanity.d.ts +21 -0
- package/dist/commands/agents/vanity.js +77 -0
- package/dist/commands/agents/visibility.d.ts +21 -1
- package/dist/commands/agents/visibility.js +112 -0
- package/dist/commands/commands.d.ts +1 -0
- package/dist/commands/commands.js +22 -9
- package/dist/commands/earnings/attributions.d.ts +17 -0
- package/dist/commands/earnings/attributions.js +82 -0
- package/dist/commands/earnings/index.js +2 -1
- package/dist/commands/generate-recovery-code.js +4 -3
- package/dist/commands/github/allow-tools.d.ts +1 -0
- package/dist/commands/github/app/install.d.ts +1 -0
- package/dist/commands/github/app/status.d.ts +1 -0
- package/dist/commands/github/connect.d.ts +1 -0
- package/dist/commands/github/connections.d.ts +1 -0
- package/dist/commands/github/disconnect.d.ts +1 -0
- package/dist/commands/github/finalize.d.ts +1 -0
- package/dist/commands/github/reconnect.d.ts +1 -0
- package/dist/commands/github/run.d.ts +1 -0
- package/dist/commands/github/tools.d.ts +1 -0
- package/dist/commands/integrations/connections/connect.d.ts +1 -0
- package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
- package/dist/commands/integrations/connections/finalize.d.ts +1 -0
- package/dist/commands/integrations/connections/list.d.ts +1 -0
- package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
- package/dist/commands/integrations/execute.d.ts +1 -0
- package/dist/commands/integrations/search.d.ts +1 -0
- package/dist/commands/integrations/toolkits.d.ts +1 -0
- package/dist/commands/integrations/tools/allow.d.ts +1 -0
- package/dist/commands/integrations/tools/list.d.ts +1 -0
- package/dist/commands/login.js +12 -0
- package/dist/commands/machines/dedicated/logs.d.ts +19 -0
- package/dist/commands/machines/dedicated/logs.js +103 -0
- package/dist/commands/machines/dedicated/power/index.js +3 -2
- package/dist/commands/machines/dedicated/power/set.js +1 -1
- package/dist/commands/machines/dedicated/power/waiting.d.ts +13 -0
- package/dist/commands/machines/dedicated/power/waiting.js +36 -0
- package/dist/commands/open.d.ts +24 -0
- package/dist/commands/open.js +74 -0
- package/dist/commands/projects/archive.d.ts +1 -0
- package/dist/commands/projects/archive.js +23 -0
- package/dist/commands/projects/delete.d.ts +1 -0
- package/dist/commands/projects/delete.js +23 -0
- package/dist/commands/projects/list.d.ts +3 -0
- package/dist/commands/projects/list.js +12 -2
- package/dist/commands/spaces/actions/add.js +4 -3
- package/dist/commands/spaces/actions/available.js +3 -2
- package/dist/commands/spaces/actions/list.js +5 -4
- package/dist/commands/spaces/actions/replace.js +6 -5
- package/dist/commands/spaces/archive.js +3 -2
- package/dist/commands/spaces/auto-executor/preview.js +4 -3
- package/dist/commands/spaces/auto-executor/run.js +4 -3
- package/dist/commands/spaces/auto-executor/runs.js +3 -2
- package/dist/commands/spaces/auto-executor/update.js +4 -3
- package/dist/commands/spaces/bootstrap.js +3 -2
- package/dist/commands/spaces/briefs/delete.js +3 -2
- package/dist/commands/spaces/briefs/get.js +3 -2
- package/dist/commands/spaces/briefs/list.js +3 -2
- package/dist/commands/spaces/briefs/set.js +5 -4
- package/dist/commands/spaces/capacity.js +5 -4
- package/dist/commands/spaces/conversations.js +3 -2
- package/dist/commands/spaces/cycles/create.js +3 -2
- package/dist/commands/spaces/cycles/graph.js +2 -1
- package/dist/commands/spaces/cycles/list.js +3 -2
- package/dist/commands/spaces/cycles/settings.js +4 -3
- package/dist/commands/spaces/cycles/show.js +3 -2
- package/dist/commands/spaces/cycles/update.js +3 -2
- package/dist/commands/spaces/delete.js +4 -3
- package/dist/commands/spaces/expertise-suggestions.js +4 -3
- package/dist/commands/spaces/files/delete.js +3 -2
- package/dist/commands/spaces/files/folders/create.js +3 -2
- package/dist/commands/spaces/files/folders/delete.js +3 -2
- package/dist/commands/spaces/files/folders/list.js +3 -2
- package/dist/commands/spaces/files/folders/update.js +3 -2
- package/dist/commands/spaces/files/list.js +3 -2
- package/dist/commands/spaces/files/move.js +3 -2
- package/dist/commands/spaces/files/rename.js +3 -2
- package/dist/commands/spaces/files/upload.js +6 -5
- package/dist/commands/spaces/github-automations/set.js +3 -2
- package/dist/commands/spaces/github-automations/show.js +3 -2
- package/dist/commands/spaces/goals.js +2 -1
- package/dist/commands/spaces/heartbeats/create.js +4 -3
- package/dist/commands/spaces/heartbeats/delete.js +4 -3
- package/dist/commands/spaces/heartbeats/list.js +4 -3
- package/dist/commands/spaces/heartbeats/status.js +3 -2
- package/dist/commands/spaces/heartbeats/update.js +4 -3
- package/dist/commands/spaces/insights.js +5 -4
- package/dist/commands/spaces/labels/add.js +4 -3
- package/dist/commands/spaces/labels/list.js +2 -1
- package/dist/commands/spaces/labels/remove.js +4 -3
- package/dist/commands/spaces/list.d.ts +3 -0
- package/dist/commands/spaces/list.js +11 -2
- package/dist/commands/spaces/live/cards/create.js +3 -2
- package/dist/commands/spaces/live/cards/list.js +3 -2
- package/dist/commands/spaces/live/cards/reorder.js +7 -2
- package/dist/commands/spaces/live/scene.js +4 -3
- package/dist/commands/spaces/members/add.js +7 -6
- package/dist/commands/spaces/members/list.js +4 -3
- package/dist/commands/spaces/members/remove.js +7 -6
- package/dist/commands/spaces/move.js +3 -2
- package/dist/commands/spaces/pin.js +5 -4
- package/dist/commands/spaces/preferences/show.js +4 -3
- package/dist/commands/spaces/preferences/tabs.js +4 -3
- package/dist/commands/spaces/revisions.js +3 -2
- package/dist/commands/spaces/room/ensure.js +5 -4
- package/dist/commands/spaces/room/messages.js +3 -2
- package/dist/commands/spaces/room/show.js +5 -4
- package/dist/commands/spaces/skills/add.js +4 -3
- package/dist/commands/spaces/skills/list.js +3 -2
- package/dist/commands/spaces/skills/pin.js +4 -3
- package/dist/commands/spaces/skills/remove.js +4 -3
- package/dist/commands/spaces/snapshot.js +3 -2
- package/dist/commands/spaces/states/archive.js +3 -2
- package/dist/commands/spaces/states/create.js +3 -2
- package/dist/commands/spaces/states/list.js +3 -2
- package/dist/commands/spaces/states/reorder.js +2 -1
- package/dist/commands/spaces/states/update.js +3 -2
- package/dist/commands/spaces/summary.js +4 -3
- package/dist/commands/spaces/tasks.d.ts +3 -0
- package/dist/commands/spaces/tasks.js +14 -3
- package/dist/commands/spaces/triggers/delete.js +5 -4
- package/dist/commands/spaces/triggers/set.js +4 -3
- package/dist/commands/spaces/triggers/show.js +4 -3
- package/dist/commands/spaces/unarchive.js +3 -2
- package/dist/commands/spaces/update.js +5 -4
- package/dist/commands/spaces/views/create.js +3 -2
- package/dist/commands/spaces/views/list.js +3 -2
- package/dist/commands/spaces/views/reorder.js +6 -3
- package/dist/commands/spaces/views/subscribe.js +2 -1
- package/dist/commands/spaces/views/subscriptions.js +1 -0
- package/dist/commands/spaces/views/unsubscribe.js +2 -1
- package/dist/commands/spaces/widgets/add.js +4 -3
- package/dist/commands/spaces/widgets/list.js +3 -2
- package/dist/commands/spaces/widgets/remove.js +5 -4
- package/dist/commands/spaces/work-graph.js +2 -1
- package/dist/commands/store/install.d.ts +1 -1
- package/dist/commands/store/install.js +24 -8
- package/dist/commands/store/show.d.ts +25 -0
- package/dist/commands/store/show.js +203 -0
- package/dist/commands/store/stats.d.ts +33 -0
- package/dist/commands/store/stats.js +258 -0
- package/dist/commands/tasks/actions/attach.js +1 -1
- package/dist/commands/tasks/actions/detach.js +4 -3
- package/dist/commands/tasks/activity.js +3 -2
- package/dist/commands/tasks/ancestors.js +2 -1
- package/dist/commands/tasks/approvals/create.js +2 -1
- package/dist/commands/tasks/approvals/delete.js +3 -2
- package/dist/commands/tasks/approvals/list.js +5 -4
- package/dist/commands/tasks/approvals/resolve.js +2 -1
- package/dist/commands/tasks/archive.js +3 -2
- package/dist/commands/tasks/assign.js +4 -3
- package/dist/commands/tasks/attachments/delete.js +3 -2
- package/dist/commands/tasks/attachments/download.d.ts +1 -0
- package/dist/commands/tasks/attachments/download.js +20 -1
- package/dist/commands/tasks/attachments/list.js +2 -1
- package/dist/commands/tasks/attachments/set-role.js +2 -1
- package/dist/commands/tasks/attachments/upload.js +2 -1
- package/dist/commands/tasks/bulk-update.d.ts +1 -0
- package/dist/commands/tasks/bulk-update.js +106 -15
- package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
- package/dist/commands/tasks/cancel-cascade.js +13 -3
- package/dist/commands/tasks/cascade-status.js +2 -1
- package/dist/commands/tasks/chat/send.d.ts +44 -0
- package/dist/commands/tasks/chat/send.js +112 -0
- package/dist/commands/tasks/checkout.js +3 -2
- package/dist/commands/tasks/children.js +2 -1
- package/dist/commands/tasks/comments/add.js +7 -6
- package/dist/commands/tasks/comments/anchor.js +8 -7
- package/dist/commands/tasks/comments/delete.js +3 -2
- package/dist/commands/tasks/comments/list.js +2 -1
- package/dist/commands/tasks/comments/reopen.js +3 -2
- package/dist/commands/tasks/comments/resolve.js +3 -2
- package/dist/commands/tasks/create-tree.d.ts +63 -0
- package/dist/commands/tasks/create-tree.js +197 -4
- package/dist/commands/tasks/delete.js +5 -4
- package/dist/commands/tasks/descendants.js +2 -1
- package/dist/commands/tasks/dri-plan.js +3 -2
- package/dist/commands/tasks/dri-run.js +3 -2
- package/dist/commands/tasks/dri-status.js +2 -1
- package/dist/commands/tasks/duplicate-pipeline.js +2 -1
- package/dist/commands/tasks/execution-summary.js +2 -1
- package/dist/commands/tasks/execution-timeline.js +2 -1
- package/dist/commands/tasks/fork.js +1 -0
- package/dist/commands/tasks/forward.js +4 -3
- package/dist/commands/tasks/handover.js +1 -0
- package/dist/commands/tasks/interrupt.js +3 -2
- package/dist/commands/tasks/labels/attach.js +4 -3
- package/dist/commands/tasks/labels/detach.js +4 -3
- package/dist/commands/tasks/labels/suggest.js +5 -4
- package/dist/commands/tasks/list.d.ts +27 -1
- package/dist/commands/tasks/list.js +101 -3
- package/dist/commands/tasks/move.js +4 -3
- package/dist/commands/tasks/output.js +6 -5
- package/dist/commands/tasks/pause-schedule.js +3 -2
- package/dist/commands/tasks/promote.js +1 -0
- package/dist/commands/tasks/prompt-log.js +2 -1
- package/dist/commands/tasks/release.js +5 -4
- package/dist/commands/tasks/remind.js +2 -1
- package/dist/commands/tasks/replay.js +3 -2
- package/dist/commands/tasks/report.js +1 -0
- package/dist/commands/tasks/resume-schedule.js +3 -2
- package/dist/commands/tasks/retry-schedule.js +3 -2
- package/dist/commands/tasks/retry.js +10 -9
- package/dist/commands/tasks/revisions.js +2 -1
- package/dist/commands/tasks/runs.js +6 -5
- package/dist/commands/tasks/schedule.js +3 -2
- package/dist/commands/tasks/self-schedule.js +6 -5
- package/dist/commands/tasks/skills/pin.js +3 -2
- package/dist/commands/tasks/skills/unpin.js +3 -2
- package/dist/commands/tasks/snooze.js +6 -5
- package/dist/commands/tasks/start-all.js +5 -4
- package/dist/commands/tasks/subscribe.js +1 -0
- package/dist/commands/tasks/tags/add.js +4 -3
- package/dist/commands/tasks/tags/remove.js +4 -3
- package/dist/commands/tasks/timeline.js +3 -2
- package/dist/commands/tasks/today.d.ts +4 -1
- package/dist/commands/tasks/today.js +12 -2
- package/dist/commands/tasks/transcript.js +6 -5
- package/dist/commands/tasks/unschedule.js +3 -2
- package/dist/commands/tasks/unsnooze.js +3 -2
- package/dist/commands/tasks/unsubscribe.js +2 -1
- package/dist/commands/tasks/update.js +5 -4
- package/dist/commands/tasks/wait.js +5 -4
- package/dist/lib/agent-distribution.d.ts +37 -0
- package/dist/lib/agent-distribution.js +63 -0
- package/dist/lib/agent-ref.d.ts +69 -0
- package/dist/lib/agent-ref.js +168 -0
- package/dist/lib/api-fetch.d.ts +2 -0
- package/dist/lib/api-fetch.js +14 -3
- package/dist/lib/command-hygiene.d.ts +13 -0
- package/dist/lib/command-hygiene.js +62 -2
- package/dist/lib/dedicated-power.d.ts +16 -1
- package/dist/lib/dedicated-power.js +153 -2
- package/dist/lib/dry-run-plans.d.ts +50 -0
- package/dist/lib/dry-run-plans.js +85 -0
- package/dist/lib/json-output.d.ts +31 -0
- package/dist/lib/json-output.js +78 -0
- package/dist/lib/list-output.d.ts +75 -0
- package/dist/lib/list-output.js +266 -0
- package/dist/lib/machine-daemon-log.d.ts +36 -0
- package/dist/lib/machine-daemon-log.js +78 -0
- package/dist/lib/node-adapter.js +10 -1
- package/dist/lib/open-target.d.ts +12 -0
- package/dist/lib/open-target.js +108 -0
- package/dist/lib/rate-limit-retry.d.ts +45 -0
- package/dist/lib/rate-limit-retry.js +88 -0
- package/dist/lib/store-listing.d.ts +45 -0
- package/dist/lib/store-listing.js +186 -0
- package/dist/lib/task-batch.d.ts +67 -0
- package/dist/lib/task-batch.js +227 -0
- package/dist/lib/terminal-qr.d.ts +55 -0
- package/dist/lib/terminal-qr.js +119 -0
- package/dist/lib/web-url.d.ts +11 -0
- package/dist/lib/web-url.js +24 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6615 -6112
- package/oclif.manifest.json +41499 -32585
- package/package.json +2 -1
|
@@ -5,12 +5,15 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
5
5
|
const base_command_1 = require("../../base-command");
|
|
6
6
|
const web_url_1 = require("../../lib/web-url");
|
|
7
7
|
const prompt_1 = require("../../lib/prompt");
|
|
8
|
+
const dry_run_plans_1 = require("../../lib/dry-run-plans");
|
|
9
|
+
const task_batch_1 = require("../../lib/task-batch");
|
|
8
10
|
const tasks_1 = require("../../lib/tasks");
|
|
9
11
|
class TasksBulkUpdate extends base_command_1.BaseCommand {
|
|
10
12
|
static description = 'Apply partial updates to many tasks from JSON';
|
|
11
13
|
static examples = [
|
|
12
14
|
'<%= config.bin %> tasks bulk-update --from-json updates.json --json',
|
|
13
15
|
'<%= config.bin %> tasks bulk-update --from-json updates.json --continue-on-error',
|
|
16
|
+
'<%= config.bin %> tasks bulk-update --from-json updates.json --dry-run --json',
|
|
14
17
|
];
|
|
15
18
|
static flags = {
|
|
16
19
|
json: core_1.Flags.boolean({ description: 'Output bulk result as JSON' }),
|
|
@@ -18,6 +21,9 @@ class TasksBulkUpdate extends base_command_1.BaseCommand {
|
|
|
18
21
|
description: 'Path to a JSON file (or "-" for stdin) containing updates',
|
|
19
22
|
required: true,
|
|
20
23
|
}),
|
|
24
|
+
'dry-run': core_1.Flags.boolean({
|
|
25
|
+
description: 'Read each task, validate every patch client-side and print the field-by-field diff without writing anything',
|
|
26
|
+
}),
|
|
21
27
|
'continue-on-error': core_1.Flags.boolean({
|
|
22
28
|
description: 'Continue applying later updates after one task fails',
|
|
23
29
|
}),
|
|
@@ -39,42 +45,127 @@ class TasksBulkUpdate extends base_command_1.BaseCommand {
|
|
|
39
45
|
catch (err) {
|
|
40
46
|
this.error(err.message, { exit: 1 });
|
|
41
47
|
}
|
|
48
|
+
if (flags['dry-run']) {
|
|
49
|
+
const currentById = {};
|
|
50
|
+
const failedReads = {};
|
|
51
|
+
for (const update of updates) {
|
|
52
|
+
try {
|
|
53
|
+
currentById[update.id] = (await data_provider_1.dataService.getTask(update.id, {
|
|
54
|
+
enrich: false,
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
const status = err.status;
|
|
59
|
+
if (status === 404)
|
|
60
|
+
currentById[update.id] = null;
|
|
61
|
+
else
|
|
62
|
+
failedReads[update.id] = err instanceof Error ? err.message : String(err);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const preview = (0, dry_run_plans_1.planBulkUpdate)(updates, currentById, failedReads);
|
|
66
|
+
if (flags.json)
|
|
67
|
+
this.log(JSON.stringify(preview, null, 2));
|
|
68
|
+
else {
|
|
69
|
+
this.log(`Dry run: ${preview.wouldChange} of ${preview.requested} task(s) would change, ${preview.invalid} invalid. Nothing was written.`);
|
|
70
|
+
for (const row of preview.results) {
|
|
71
|
+
if (!row.ok)
|
|
72
|
+
this.log(`- ${row.id}: ${row.errors.join('; ')}`);
|
|
73
|
+
else if (row.noop)
|
|
74
|
+
this.log(`- ${row.id}: no change`);
|
|
75
|
+
else
|
|
76
|
+
this.log(`- ${row.id}: ${Object.keys(row.changes).join(', ')}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (!preview.ok)
|
|
80
|
+
this.exit(1);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
42
83
|
const results = [];
|
|
43
84
|
const errors = [];
|
|
44
|
-
|
|
85
|
+
const rows = updates.map((update) => {
|
|
86
|
+
const { status, ...restPatch } = update.patch;
|
|
87
|
+
return { id: update.id, status, patch: (0, tasks_1.removeUndefinedFields)(restPatch) };
|
|
88
|
+
});
|
|
89
|
+
// The field patches go to PATCH /api/tasks/batch in chunks; `status` is a
|
|
90
|
+
// workflow move with its own route and stays one call per row. A server
|
|
91
|
+
// without the batch route (404/405) gets the serial path below.
|
|
92
|
+
const patchable = rows
|
|
93
|
+
.map((row, index) => ({ row, index }))
|
|
94
|
+
.filter(({ row }) => Object.keys(row.patch).length > 0);
|
|
95
|
+
const batchByRow = new Map();
|
|
96
|
+
if (patchable.length > 0) {
|
|
97
|
+
const outcome = await (0, task_batch_1.patchTasksViaBatch)(patchable.map(({ row }) => ({
|
|
98
|
+
id: row.id,
|
|
99
|
+
patch: row.patch,
|
|
100
|
+
})));
|
|
101
|
+
if (outcome.supported) {
|
|
102
|
+
for (const [i, result] of outcome.results.entries()) {
|
|
103
|
+
batchByRow.set(patchable[i].index, result);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const usedBatch = batchByRow.size > 0;
|
|
108
|
+
let stopped = false;
|
|
109
|
+
for (const [index, row] of rows.entries()) {
|
|
45
110
|
try {
|
|
46
|
-
const { status, ...restPatch } = update.patch;
|
|
47
|
-
const patch = (0, tasks_1.removeUndefinedFields)(restPatch);
|
|
48
111
|
let task = null;
|
|
49
|
-
if (Object.keys(patch).length > 0) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
112
|
+
if (Object.keys(row.patch).length > 0) {
|
|
113
|
+
const batched = batchByRow.get(index);
|
|
114
|
+
if (usedBatch && batched) {
|
|
115
|
+
if (!batched.ok) {
|
|
116
|
+
throw Object.assign(new Error(batched.error?.message ?? 'Update failed'), {
|
|
117
|
+
code: batched.error?.code,
|
|
118
|
+
status: batched.error?.status,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
// The batch route reports id/identifier/version, not the document:
|
|
122
|
+
// the fields this row set are echoed so the row is self-describing.
|
|
123
|
+
task = {
|
|
124
|
+
...row.patch,
|
|
125
|
+
id: batched.id ?? row.id,
|
|
126
|
+
...(batched.identifier ? { identifier: batched.identifier } : {}),
|
|
127
|
+
...(batched.version !== undefined ? { version: batched.version } : {}),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
task = await data_provider_1.dataService.updateTask({
|
|
132
|
+
taskId: row.id,
|
|
133
|
+
data: row.patch,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
54
136
|
}
|
|
55
|
-
if (status !== undefined) {
|
|
56
|
-
if (
|
|
137
|
+
if (row.status !== undefined) {
|
|
138
|
+
if (stopped) {
|
|
139
|
+
throw new Error('status move not applied: stopped after an earlier failure');
|
|
140
|
+
}
|
|
141
|
+
if (!data_provider_1.TASK_STATUSES.includes(row.status)) {
|
|
57
142
|
throw new Error(`status must be one of: ${data_provider_1.TASK_STATUSES.join(', ')}`);
|
|
58
143
|
}
|
|
59
144
|
task = await data_provider_1.dataService.moveTask({
|
|
60
|
-
taskId:
|
|
61
|
-
status: status,
|
|
145
|
+
taskId: row.id,
|
|
146
|
+
status: row.status,
|
|
62
147
|
});
|
|
63
148
|
}
|
|
64
149
|
if (!task) {
|
|
65
|
-
task = await data_provider_1.dataService.getTask(
|
|
150
|
+
task = await data_provider_1.dataService.getTask(row.id, { enrich: false });
|
|
66
151
|
}
|
|
67
|
-
results.push({ id:
|
|
152
|
+
results.push({ id: row.id, ok: true, task });
|
|
68
153
|
}
|
|
69
154
|
catch (err) {
|
|
155
|
+
const code = err.code;
|
|
70
156
|
const error = {
|
|
71
|
-
id:
|
|
157
|
+
id: row.id,
|
|
72
158
|
ok: false,
|
|
73
159
|
error: err instanceof Error ? err.message : String(err),
|
|
160
|
+
...(code ? { code } : {}),
|
|
74
161
|
};
|
|
75
162
|
errors.push(error);
|
|
76
163
|
results.push(error);
|
|
77
164
|
if (!flags['continue-on-error'])
|
|
165
|
+
stopped = true;
|
|
166
|
+
// Serial path: later rows are never touched. Batch path: they were
|
|
167
|
+
// already applied by the chunk, so they are reported rather than dropped.
|
|
168
|
+
if (!flags['continue-on-error'] && !usedBatch)
|
|
78
169
|
break;
|
|
79
170
|
}
|
|
80
171
|
}
|
|
@@ -15,29 +15,39 @@ class TasksCancelCascade extends base_command_1.BaseCommand {
|
|
|
15
15
|
};
|
|
16
16
|
static flags = {
|
|
17
17
|
yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation prompt' }),
|
|
18
|
+
json: core_1.Flags.boolean({ description: 'Output the result as JSON' }),
|
|
18
19
|
};
|
|
19
20
|
async run() {
|
|
20
21
|
this.requireAuth();
|
|
21
22
|
const { args, flags } = await this.parse(TasksCancelCascade);
|
|
23
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
22
24
|
let confirmed;
|
|
23
25
|
try {
|
|
24
|
-
confirmed = await (0, prompt_1.confirmDestructive)(`Cancel cascade for task ${
|
|
26
|
+
confirmed = await (0, prompt_1.confirmDestructive)(`Cancel cascade for task ${taskRef}? This cannot be undone.`, flags.yes);
|
|
25
27
|
}
|
|
26
28
|
catch (err) {
|
|
27
29
|
const e = err;
|
|
28
30
|
this.error(e.message, { exit: e.exit ?? 1 });
|
|
29
31
|
}
|
|
30
32
|
if (!confirmed) {
|
|
33
|
+
if (flags.json) {
|
|
34
|
+
this.log(JSON.stringify({ object: 'task_cascade_cancel', cancelled: false, id: taskRef }));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
31
37
|
this.log('Cancelled.');
|
|
32
38
|
return;
|
|
33
39
|
}
|
|
34
40
|
try {
|
|
35
|
-
await data_provider_1.dataService.cancelCascade(
|
|
41
|
+
await data_provider_1.dataService.cancelCascade(taskRef);
|
|
36
42
|
}
|
|
37
43
|
catch (err) {
|
|
38
44
|
this.handleApiError(err);
|
|
39
45
|
}
|
|
40
|
-
|
|
46
|
+
if (flags.json) {
|
|
47
|
+
this.log(JSON.stringify({ object: 'task_cascade_cancel', cancelled: true, id: taskRef }));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.log(`Cancelled cascade for task ${taskRef}`);
|
|
41
51
|
}
|
|
42
52
|
}
|
|
43
53
|
exports.default = TasksCancelCascade;
|
|
@@ -18,9 +18,10 @@ class TasksCascadeStatus extends base_command_1.BaseCommand {
|
|
|
18
18
|
async run() {
|
|
19
19
|
this.requireAuth();
|
|
20
20
|
const { args, flags } = await this.parse(TasksCascadeStatus);
|
|
21
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
21
22
|
let result;
|
|
22
23
|
try {
|
|
23
|
-
result = await data_provider_1.dataService.getCascadeStatus(
|
|
24
|
+
result = await data_provider_1.dataService.getCascadeStatus(taskRef);
|
|
24
25
|
}
|
|
25
26
|
catch (err) {
|
|
26
27
|
this.handleApiError(err);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
export interface TaskChatSendInput {
|
|
3
|
+
text: string;
|
|
4
|
+
commandId?: string;
|
|
5
|
+
now?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Build the `POST /api/tasks/:id/exchanges/messages` body.
|
|
9
|
+
*
|
|
10
|
+
* Every mutation on the task-chat surface requires an actor-scoped `commandId`;
|
|
11
|
+
* the server refuses to mint one (a server-minted id cannot make the caller's
|
|
12
|
+
* own retry idempotent). Without `--command-id` each invocation gets a FRESH id,
|
|
13
|
+
* because two sends of identical text are two intents (the unfenced-write rule
|
|
14
|
+
* in `idempotency.ts`). Pass the same `--command-id` to retry safely.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildTaskChatSendBody(input: TaskChatSendInput): {
|
|
17
|
+
immediate?: boolean | undefined;
|
|
18
|
+
commandId: string;
|
|
19
|
+
text: string;
|
|
20
|
+
};
|
|
21
|
+
/** One human line for a send result; never claims dispatch the server did not report. */
|
|
22
|
+
export declare function describeSendResult(result: Record<string, unknown>): string;
|
|
23
|
+
/**
|
|
24
|
+
* `skrr tasks chat send <task-id> --text "..."` — post a message into a Task's
|
|
25
|
+
* chat (the Task Multi-Turn Conversation surface).
|
|
26
|
+
*
|
|
27
|
+
* By default the message joins the current batch and the agent answers when the
|
|
28
|
+
* batch closes (several messages, one response). `--now` closes the batch and
|
|
29
|
+
* dispatches in the same request.
|
|
30
|
+
*/
|
|
31
|
+
export default class TasksChatSend extends BaseCommand {
|
|
32
|
+
static description: string;
|
|
33
|
+
static examples: string[];
|
|
34
|
+
static args: {
|
|
35
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
36
|
+
};
|
|
37
|
+
static flags: {
|
|
38
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
39
|
+
text: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
40
|
+
now: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
41
|
+
'command-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
42
|
+
};
|
|
43
|
+
run(): Promise<void>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildTaskChatSendBody = buildTaskChatSendBody;
|
|
4
|
+
exports.describeSendResult = describeSendResult;
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const base_command_1 = require("../../../base-command");
|
|
8
|
+
const task_extras_1 = require("../../../lib/task-extras");
|
|
9
|
+
/** The server's `appendSchema` bounds on `commandId`. */
|
|
10
|
+
const COMMAND_ID_MIN = 8;
|
|
11
|
+
const COMMAND_ID_MAX = 128;
|
|
12
|
+
/**
|
|
13
|
+
* Build the `POST /api/tasks/:id/exchanges/messages` body.
|
|
14
|
+
*
|
|
15
|
+
* Every mutation on the task-chat surface requires an actor-scoped `commandId`;
|
|
16
|
+
* the server refuses to mint one (a server-minted id cannot make the caller's
|
|
17
|
+
* own retry idempotent). Without `--command-id` each invocation gets a FRESH id,
|
|
18
|
+
* because two sends of identical text are two intents (the unfenced-write rule
|
|
19
|
+
* in `idempotency.ts`). Pass the same `--command-id` to retry safely.
|
|
20
|
+
*/
|
|
21
|
+
function buildTaskChatSendBody(input) {
|
|
22
|
+
const text = input.text?.trim() ? input.text : '';
|
|
23
|
+
if (!text)
|
|
24
|
+
throw new Error('A message needs non-empty text (--text).');
|
|
25
|
+
const commandId = input.commandId ?? `cli-${(0, node_crypto_1.randomUUID)()}`;
|
|
26
|
+
if (commandId.length < COMMAND_ID_MIN) {
|
|
27
|
+
throw new Error(`--command-id must be at least ${COMMAND_ID_MIN} characters.`);
|
|
28
|
+
}
|
|
29
|
+
if (commandId.length > COMMAND_ID_MAX) {
|
|
30
|
+
throw new Error(`--command-id must be at most ${COMMAND_ID_MAX} characters.`);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
commandId,
|
|
34
|
+
text,
|
|
35
|
+
...(input.now ? { immediate: true } : {}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** One human line for a send result; never claims dispatch the server did not report. */
|
|
39
|
+
function describeSendResult(result) {
|
|
40
|
+
const exchangeId = String(result.exchangeId ?? '?');
|
|
41
|
+
const replay = result.replay === true ? ' (replay of an earlier send)' : '';
|
|
42
|
+
if (result.alreadyClosed === true) {
|
|
43
|
+
return `Exchange ${exchangeId} was already closed${replay}.`;
|
|
44
|
+
}
|
|
45
|
+
if (result.materialized === false) {
|
|
46
|
+
return `Message recorded in exchange ${exchangeId}${replay}, but no run was started: ${String(result.reason ?? 'unknown reason')}.`;
|
|
47
|
+
}
|
|
48
|
+
if (result.materialized === true) {
|
|
49
|
+
const run = result.taskExecutionRunId ? ` as run ${String(result.taskExecutionRunId)}` : '';
|
|
50
|
+
return `Message sent in exchange ${exchangeId}${replay}; dispatched${run}.`;
|
|
51
|
+
}
|
|
52
|
+
const close = result.softCloseAt ? ` Batch closes at ${String(result.softCloseAt)}.` : '';
|
|
53
|
+
return `Message recorded in exchange ${exchangeId}${replay}; the batch is still collecting, not yet dispatched.${close} Use --now to dispatch immediately.`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* `skrr tasks chat send <task-id> --text "..."` — post a message into a Task's
|
|
57
|
+
* chat (the Task Multi-Turn Conversation surface).
|
|
58
|
+
*
|
|
59
|
+
* By default the message joins the current batch and the agent answers when the
|
|
60
|
+
* batch closes (several messages, one response). `--now` closes the batch and
|
|
61
|
+
* dispatches in the same request.
|
|
62
|
+
*/
|
|
63
|
+
class TasksChatSend extends base_command_1.BaseCommand {
|
|
64
|
+
static description = "Send a message into a task's chat";
|
|
65
|
+
static examples = [
|
|
66
|
+
'<%= config.bin %> tasks chat send task_abc123 --text "Also cover the retry path"',
|
|
67
|
+
'<%= config.bin %> tasks chat send OSK-42 --text "Go ahead" --now',
|
|
68
|
+
'<%= config.bin %> tasks chat send OSK-42 --text "Go ahead" --now --command-id my-retry-key-1',
|
|
69
|
+
];
|
|
70
|
+
static args = {
|
|
71
|
+
id: core_1.Args.string({ ignoreStdin: true, description: 'Task ID or identifier', required: true }),
|
|
72
|
+
};
|
|
73
|
+
static flags = {
|
|
74
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
75
|
+
text: core_1.Flags.string({ description: 'Message text', required: true }),
|
|
76
|
+
now: core_1.Flags.boolean({
|
|
77
|
+
description: 'Close the batch and dispatch immediately instead of waiting for it to close',
|
|
78
|
+
}),
|
|
79
|
+
'command-id': core_1.Flags.string({
|
|
80
|
+
description: `Actor-scoped command id (${COMMAND_ID_MIN}-${COMMAND_ID_MAX} chars). Reuse it to retry safely; generated fresh when omitted`,
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
83
|
+
async run() {
|
|
84
|
+
this.requireAuth();
|
|
85
|
+
const { args, flags } = await this.parse(TasksChatSend);
|
|
86
|
+
let body;
|
|
87
|
+
try {
|
|
88
|
+
body = buildTaskChatSendBody({
|
|
89
|
+
text: flags.text,
|
|
90
|
+
commandId: flags['command-id'],
|
|
91
|
+
now: flags.now,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
this.error(err.message, { exit: 2 });
|
|
96
|
+
}
|
|
97
|
+
const taskId = await this.resolveTaskReference(args.id);
|
|
98
|
+
let result;
|
|
99
|
+
try {
|
|
100
|
+
result = await task_extras_1.taskChatApi.sendExchangeMessage(taskId, body);
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
this.handleApiError(err);
|
|
104
|
+
}
|
|
105
|
+
if (flags.json) {
|
|
106
|
+
this.log(JSON.stringify({ commandId: body.commandId, ...result }, null, 2));
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.log(describeSendResult(result));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.default = TasksChatSend;
|
|
@@ -54,10 +54,11 @@ class TasksCheckout extends base_command_1.BaseCommand {
|
|
|
54
54
|
async run() {
|
|
55
55
|
this.requireAuth();
|
|
56
56
|
const { args, flags } = await this.parse(TasksCheckout);
|
|
57
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
57
58
|
const runId = flags.run ?? crypto.randomUUID();
|
|
58
59
|
let result;
|
|
59
60
|
try {
|
|
60
|
-
result = await data_provider_1.dataService.checkoutTask({ taskId:
|
|
61
|
+
result = await data_provider_1.dataService.checkoutTask({ taskId: taskRef, runId });
|
|
61
62
|
}
|
|
62
63
|
catch (err) {
|
|
63
64
|
const e = err;
|
|
@@ -73,7 +74,7 @@ class TasksCheckout extends base_command_1.BaseCommand {
|
|
|
73
74
|
this.log(JSON.stringify(result, null, 2));
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
this.log(`Checked out task ${
|
|
77
|
+
this.log(`Checked out task ${taskRef} with run ${runId}`);
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
exports.default = TasksCheckout;
|
|
@@ -20,9 +20,10 @@ class TasksChildren extends base_command_1.BaseCommand {
|
|
|
20
20
|
async run() {
|
|
21
21
|
this.requireAuth();
|
|
22
22
|
const { args, flags } = await this.parse(TasksChildren);
|
|
23
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
23
24
|
let response;
|
|
24
25
|
try {
|
|
25
|
-
response = await data_provider_1.dataService.listTaskChildren(
|
|
26
|
+
response = await data_provider_1.dataService.listTaskChildren(taskRef);
|
|
26
27
|
}
|
|
27
28
|
catch (err) {
|
|
28
29
|
this.handleApiError(err);
|
|
@@ -128,6 +128,7 @@ class TasksCommentsAdd extends base_command_1.BaseCommand {
|
|
|
128
128
|
details: { suggestion: failure.suggestion, context: failure.details },
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
+
const taskRef = await this.resolveEntityRef('task', task.id);
|
|
131
132
|
const commentBody = (0, task_resolver_1.stripTaskIdentityFields)(jsonBody);
|
|
132
133
|
if ('authorAgentId' in commentBody || 'author-agent' in commentBody) {
|
|
133
134
|
this.failWithCliError({
|
|
@@ -154,7 +155,7 @@ class TasksCommentsAdd extends base_command_1.BaseCommand {
|
|
|
154
155
|
for (const filePath of flags.attach) {
|
|
155
156
|
try {
|
|
156
157
|
const asset = await uploadTaskAssetFile({
|
|
157
|
-
taskId:
|
|
158
|
+
taskId: taskRef,
|
|
158
159
|
filePath,
|
|
159
160
|
role: 'evidence',
|
|
160
161
|
});
|
|
@@ -200,7 +201,7 @@ class TasksCommentsAdd extends base_command_1.BaseCommand {
|
|
|
200
201
|
// ONE key for the original attempt and any later replay — see the comment
|
|
201
202
|
// in `spaces create`. A key sent only on the replay would post a second
|
|
202
203
|
// comment whenever the original landed and its response was lost.
|
|
203
|
-
const idempotencyKey = (0, outbox_1.idempotencyKeyFor)('task-comment',
|
|
204
|
+
const idempotencyKey = (0, outbox_1.idempotencyKeyFor)('task-comment', taskRef, JSON.stringify(data));
|
|
204
205
|
let result;
|
|
205
206
|
try {
|
|
206
207
|
// apiFetch rather than `dataService.addTaskComment`: the shared transport
|
|
@@ -233,7 +234,7 @@ class TasksCommentsAdd extends base_command_1.BaseCommand {
|
|
|
233
234
|
},
|
|
234
235
|
headers: { 'X-Idempotency-Key': idempotencyKey },
|
|
235
236
|
})
|
|
236
|
-
: await (0, api_fetch_1.apiFetch)(`/api/tasks/${encodeURIComponent(
|
|
237
|
+
: await (0, api_fetch_1.apiFetch)(`/api/tasks/${encodeURIComponent(taskRef)}/comments`, {
|
|
237
238
|
method: 'POST',
|
|
238
239
|
body: data,
|
|
239
240
|
headers: { 'X-Idempotency-Key': idempotencyKey },
|
|
@@ -247,9 +248,9 @@ class TasksCommentsAdd extends base_command_1.BaseCommand {
|
|
|
247
248
|
// different comment on the same task hashes differently and still posts.
|
|
248
249
|
this.queueWriteOrFail(err, {
|
|
249
250
|
command: 'tasks comments add',
|
|
250
|
-
summary: `comment on task ${
|
|
251
|
+
summary: `comment on task ${taskRef}`,
|
|
251
252
|
method: 'post',
|
|
252
|
-
url: `/api/tasks/${encodeURIComponent(
|
|
253
|
+
url: `/api/tasks/${encodeURIComponent(taskRef)}/comments`,
|
|
253
254
|
body: data,
|
|
254
255
|
idempotencyKey,
|
|
255
256
|
});
|
|
@@ -264,7 +265,7 @@ class TasksCommentsAdd extends base_command_1.BaseCommand {
|
|
|
264
265
|
: c.anchor?.commentMarkId
|
|
265
266
|
? 'inline comment'
|
|
266
267
|
: 'comment';
|
|
267
|
-
this.log(`Added ${kind} ${c.id ?? c._id ?? '?'} on task ${
|
|
268
|
+
this.log(`Added ${kind} ${c.id ?? c._id ?? '?'} on task ${taskRef}`);
|
|
268
269
|
if (c.anchor?.commentMarkId) {
|
|
269
270
|
this.log(` anchor markId: ${c.anchor.commentMarkId}`);
|
|
270
271
|
if (c.anchor.quote) {
|
|
@@ -228,6 +228,7 @@ class TasksCommentsAnchor extends base_command_1.BaseCommand {
|
|
|
228
228
|
async run() {
|
|
229
229
|
this.requireAuth();
|
|
230
230
|
const { args, flags } = await this.parse(TasksCommentsAnchor);
|
|
231
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
231
232
|
if (flags.occurrence < 1) {
|
|
232
233
|
this.error('--occurrence must be ≥ 1', { exit: 1 });
|
|
233
234
|
}
|
|
@@ -244,7 +245,7 @@ class TasksCommentsAnchor extends base_command_1.BaseCommand {
|
|
|
244
245
|
// 1. Fetch current task.
|
|
245
246
|
let task;
|
|
246
247
|
try {
|
|
247
|
-
task = await data_provider_1.dataService.getTask(
|
|
248
|
+
task = await data_provider_1.dataService.getTask(taskRef, { enrich: false });
|
|
248
249
|
}
|
|
249
250
|
catch (err) {
|
|
250
251
|
this.handleApiError(err);
|
|
@@ -275,9 +276,9 @@ class TasksCommentsAnchor extends base_command_1.BaseCommand {
|
|
|
275
276
|
'',
|
|
276
277
|
'Workarounds:',
|
|
277
278
|
` • Edit the description first so the target text lives in one span:`,
|
|
278
|
-
` skrr tasks update ${
|
|
279
|
+
` skrr tasks update ${taskRef} --description "…"`,
|
|
279
280
|
` • Or post the anchor without modifying the description:`,
|
|
280
|
-
` skrr tasks comments add ${
|
|
281
|
+
` skrr tasks comments add ${taskRef} --body "…" --anchor-quote "…"`,
|
|
281
282
|
' (the editor will treat the comment as a sticky thread even without',
|
|
282
283
|
' a visible span.)',
|
|
283
284
|
].join('\n'), { exit: 1 });
|
|
@@ -304,7 +305,7 @@ class TasksCommentsAnchor extends base_command_1.BaseCommand {
|
|
|
304
305
|
: { description: wrap.html };
|
|
305
306
|
let patched;
|
|
306
307
|
try {
|
|
307
|
-
patched = await data_provider_1.dataService.updateTask({ taskId:
|
|
308
|
+
patched = await data_provider_1.dataService.updateTask({ taskId: taskRef, data: patchData });
|
|
308
309
|
}
|
|
309
310
|
catch (err) {
|
|
310
311
|
const e = err;
|
|
@@ -331,7 +332,7 @@ class TasksCommentsAnchor extends base_command_1.BaseCommand {
|
|
|
331
332
|
let comment;
|
|
332
333
|
try {
|
|
333
334
|
comment = await data_provider_1.dataService.addTaskComment({
|
|
334
|
-
taskId:
|
|
335
|
+
taskId: taskRef,
|
|
335
336
|
data: commentData,
|
|
336
337
|
});
|
|
337
338
|
}
|
|
@@ -343,7 +344,7 @@ class TasksCommentsAnchor extends base_command_1.BaseCommand {
|
|
|
343
344
|
// our PATCH and rollback, we accept that they win and warn the user.
|
|
344
345
|
try {
|
|
345
346
|
await data_provider_1.dataService.updateTask({
|
|
346
|
-
taskId:
|
|
347
|
+
taskId: taskRef,
|
|
347
348
|
data: { description: originalDescription },
|
|
348
349
|
});
|
|
349
350
|
this.warn('Comment POST failed — rolled back description to its pre-anchor state.');
|
|
@@ -361,7 +362,7 @@ class TasksCommentsAnchor extends base_command_1.BaseCommand {
|
|
|
361
362
|
return;
|
|
362
363
|
}
|
|
363
364
|
const c = comment;
|
|
364
|
-
this.log(`Anchored comment ${c.id ?? c._id ?? '?'} on task ${
|
|
365
|
+
this.log(`Anchored comment ${c.id ?? c._id ?? '?'} on task ${taskRef}`);
|
|
365
366
|
this.log(` mark id: ${markId}`);
|
|
366
367
|
this.log(` match: occurrence ${wrap.occurrence} of ${wrap.totalMatches}`);
|
|
367
368
|
this.log(` quote: "${quote.length > 80 ? quote.slice(0, 77) + '…' : quote}"`);
|
|
@@ -20,9 +20,10 @@ class TasksCommentsDelete extends base_command_1.BaseCommand {
|
|
|
20
20
|
async run() {
|
|
21
21
|
this.requireAuth();
|
|
22
22
|
const { args, flags } = await this.parse(TasksCommentsDelete);
|
|
23
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
23
24
|
let confirmed;
|
|
24
25
|
try {
|
|
25
|
-
confirmed = await (0, prompt_1.confirmDestructive)(`Delete comment ${args.commentId} from task ${
|
|
26
|
+
confirmed = await (0, prompt_1.confirmDestructive)(`Delete comment ${args.commentId} from task ${taskRef}? This cannot be undone.`, flags.yes);
|
|
26
27
|
}
|
|
27
28
|
catch (err) {
|
|
28
29
|
const e = err;
|
|
@@ -33,7 +34,7 @@ class TasksCommentsDelete extends base_command_1.BaseCommand {
|
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
36
|
try {
|
|
36
|
-
await data_provider_1.dataService.deleteTaskComment({ taskId:
|
|
37
|
+
await data_provider_1.dataService.deleteTaskComment({ taskId: taskRef, commentId: args.commentId });
|
|
37
38
|
}
|
|
38
39
|
catch (err) {
|
|
39
40
|
this.handleApiError(err);
|
|
@@ -83,9 +83,10 @@ class TasksCommentsList extends base_command_1.BaseCommand {
|
|
|
83
83
|
details: { suggestion: failure.suggestion, context: failure.details },
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
+
const taskRef = await this.resolveEntityRef('task', task.id);
|
|
86
87
|
let response;
|
|
87
88
|
try {
|
|
88
|
-
response = await data_provider_1.dataService.listTaskComments(
|
|
89
|
+
response = await data_provider_1.dataService.listTaskComments(taskRef, {
|
|
89
90
|
limit: flags.limit,
|
|
90
91
|
cursor: flags.cursor,
|
|
91
92
|
});
|
|
@@ -19,10 +19,11 @@ class TasksCommentsReopen extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(TasksCommentsReopen);
|
|
22
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
22
23
|
let result;
|
|
23
24
|
try {
|
|
24
25
|
result = await data_provider_1.dataService.reopenTaskComment({
|
|
25
|
-
taskId:
|
|
26
|
+
taskId: taskRef,
|
|
26
27
|
commentId: args.commentId,
|
|
27
28
|
});
|
|
28
29
|
}
|
|
@@ -34,7 +35,7 @@ class TasksCommentsReopen extends base_command_1.BaseCommand {
|
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
const c = result;
|
|
37
|
-
this.log(`Reopened comment ${c.id ?? c._id ?? args.commentId} on task ${
|
|
38
|
+
this.log(`Reopened comment ${c.id ?? c._id ?? args.commentId} on task ${taskRef}`);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
exports.default = TasksCommentsReopen;
|
|
@@ -19,10 +19,11 @@ class TasksCommentsResolve extends base_command_1.BaseCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
this.requireAuth();
|
|
21
21
|
const { args, flags } = await this.parse(TasksCommentsResolve);
|
|
22
|
+
const taskRef = await this.resolveEntityRef('task', args.id);
|
|
22
23
|
let result;
|
|
23
24
|
try {
|
|
24
25
|
result = await data_provider_1.dataService.resolveTaskComment({
|
|
25
|
-
taskId:
|
|
26
|
+
taskId: taskRef,
|
|
26
27
|
commentId: args.commentId,
|
|
27
28
|
});
|
|
28
29
|
}
|
|
@@ -34,7 +35,7 @@ class TasksCommentsResolve extends base_command_1.BaseCommand {
|
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
const c = result;
|
|
37
|
-
this.log(`Resolved comment ${c.id ?? c._id ?? args.commentId} on task ${
|
|
38
|
+
this.log(`Resolved comment ${c.id ?? c._id ?? args.commentId} on task ${taskRef}`);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
exports.default = TasksCommentsResolve;
|