@khangal.j/fireside-cli 0.0.3 → 0.0.4
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/README.md +2 -1
- package/dist/index.js +65 -18
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ fireside tasks list
|
|
|
22
22
|
fireside tasks list --project personal
|
|
23
23
|
fireside tasks get <task-id>
|
|
24
24
|
fireside tasks get <task-id> --context
|
|
25
|
+
fireside tasks get <task-id> --handoff
|
|
25
26
|
fireside tasks create --project personal --board main --column maybe --title "Ship CLI"
|
|
26
27
|
fireside tasks update <task-id> --title "Ship task CLI"
|
|
27
28
|
fireside tasks delete <task-id>
|
|
@@ -31,7 +32,7 @@ fireside tasks handoff create <task-id> --to @alice --summary "Ready for review"
|
|
|
31
32
|
## Task Commands
|
|
32
33
|
|
|
33
34
|
- `fireside tasks list [--project <project>] [--board <board>] [--column <column>] [--json]`
|
|
34
|
-
- `fireside tasks get <task-id> [--project <project>] [--context] [--json]`
|
|
35
|
+
- `fireside tasks get <task-id> [--project <project>] [--context] [--handoff] [--json]`
|
|
35
36
|
- `fireside tasks create --project <project> --column <column> --title <title> [--board <board>] [--description <text> | --description-file <path>] [--due-date YYYY-MM-DD] [--assignee <member>]... [--json]`
|
|
36
37
|
- `fireside tasks update <task-id> [--project <project>] [--title <title>] [--description <text> | --description-file <path> | --clear-description] [--due-date YYYY-MM-DD | --clear-due-date] [--assignee <member>]... [--clear-assignees] [--json]`
|
|
37
38
|
- `fireside tasks delete <task-id> [--project <project>] [--json]`
|
package/dist/index.js
CHANGED
|
@@ -197,6 +197,14 @@ async function createTaskHandoff(baseUrl, accessToken, projectId, boardId, taskI
|
|
|
197
197
|
}
|
|
198
198
|
);
|
|
199
199
|
}
|
|
200
|
+
async function listTaskHandoffs(baseUrl, accessToken, projectId, boardId, taskId) {
|
|
201
|
+
return requestJson(
|
|
202
|
+
`${baseUrl}/api/projects/${encodeURIComponent(projectId)}/boards/${encodeURIComponent(boardId)}/tasks/${encodeURIComponent(taskId)}/handoffs`,
|
|
203
|
+
{
|
|
204
|
+
headers: getAuthHeaders(accessToken)
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
}
|
|
200
208
|
async function listAssignedTasks(baseUrl, accessToken) {
|
|
201
209
|
return requestJson(`${baseUrl}/api/my-stuff`, {
|
|
202
210
|
headers: getAuthHeaders(accessToken)
|
|
@@ -634,7 +642,7 @@ function flattenTaskEntries(projectBoardsResults) {
|
|
|
634
642
|
)
|
|
635
643
|
).sort(compareTaskEntries);
|
|
636
644
|
}
|
|
637
|
-
function serializeTaskEntry(taskEntry, contextRevision) {
|
|
645
|
+
function serializeTaskEntry(taskEntry, contextRevision, taskHandoff) {
|
|
638
646
|
return {
|
|
639
647
|
board: {
|
|
640
648
|
id: taskEntry.board.id,
|
|
@@ -646,6 +654,7 @@ function serializeTaskEntry(taskEntry, contextRevision) {
|
|
|
646
654
|
title: taskEntry.column.title
|
|
647
655
|
},
|
|
648
656
|
...contextRevision !== void 0 ? { contextRevision } : {},
|
|
657
|
+
...taskHandoff !== void 0 ? { handoff: taskHandoff } : {},
|
|
649
658
|
project: {
|
|
650
659
|
color: taskEntry.project.color,
|
|
651
660
|
id: taskEntry.project.id,
|
|
@@ -690,7 +699,7 @@ function printTaskSummary(taskEntry) {
|
|
|
690
699
|
}
|
|
691
700
|
console.log("");
|
|
692
701
|
}
|
|
693
|
-
function printTaskDetails(taskEntry, contextRevision) {
|
|
702
|
+
function printTaskDetails(taskEntry, contextRevision, taskHandoff) {
|
|
694
703
|
console.log(formatHeading(taskEntry.task.title, taskEntry.task.id));
|
|
695
704
|
printKeyValue(" Project", import_picocolors.default.cyan(taskEntry.project.title));
|
|
696
705
|
printKeyValue(" Board", taskEntry.board.title);
|
|
@@ -700,10 +709,7 @@ function printTaskDetails(taskEntry, contextRevision) {
|
|
|
700
709
|
taskEntry.task.dueDate ? import_picocolors.default.yellow(formatDueDate(taskEntry.task.dueDate)) : import_picocolors.default.dim("None")
|
|
701
710
|
);
|
|
702
711
|
printKeyValue(" Assignees", formatMemberList(taskEntry.task.assignees));
|
|
703
|
-
printKeyValue(
|
|
704
|
-
" Description",
|
|
705
|
-
taskEntry.task.description || import_picocolors.default.dim("None")
|
|
706
|
-
);
|
|
712
|
+
printKeyValue(" Description", taskEntry.task.description || import_picocolors.default.dim("None"));
|
|
707
713
|
if (contextRevision !== void 0) {
|
|
708
714
|
printKeyValue(
|
|
709
715
|
" Task context",
|
|
@@ -714,6 +720,26 @@ function printTaskDetails(taskEntry, contextRevision) {
|
|
|
714
720
|
console.log(contextRevision.contentMarkdown);
|
|
715
721
|
}
|
|
716
722
|
}
|
|
723
|
+
if (taskHandoff !== void 0) {
|
|
724
|
+
printKeyValue(
|
|
725
|
+
" Active handoff",
|
|
726
|
+
taskHandoff ? import_picocolors.default.cyan(taskHandoff.id) : import_picocolors.default.dim("None")
|
|
727
|
+
);
|
|
728
|
+
if (taskHandoff) {
|
|
729
|
+
printKeyValue(" Handoff status", import_picocolors.default.cyan(taskHandoff.status));
|
|
730
|
+
printKeyValue(" Handoff from", formatMember(taskHandoff.fromUser));
|
|
731
|
+
printKeyValue(" Handoff to", formatMember(taskHandoff.toUser));
|
|
732
|
+
printKeyValue(
|
|
733
|
+
" Handoff next assignee",
|
|
734
|
+
formatMember(taskHandoff.nextAssigneeUser)
|
|
735
|
+
);
|
|
736
|
+
printKeyValue(" Handoff summary", taskHandoff.summary);
|
|
737
|
+
if (taskHandoff.contextMarkdown) {
|
|
738
|
+
console.log("");
|
|
739
|
+
console.log(taskHandoff.contextMarkdown);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
717
743
|
}
|
|
718
744
|
function printTaskHandoff(taskEntry, taskHandoff) {
|
|
719
745
|
console.log(formatHeading(taskEntry.task.title, taskEntry.task.id));
|
|
@@ -724,10 +750,7 @@ function printTaskHandoff(taskEntry, taskHandoff) {
|
|
|
724
750
|
printKeyValue(" Status", import_picocolors.default.cyan(taskHandoff.status));
|
|
725
751
|
printKeyValue(" From", formatMember(taskHandoff.fromUser));
|
|
726
752
|
printKeyValue(" To", formatMember(taskHandoff.toUser));
|
|
727
|
-
printKeyValue(
|
|
728
|
-
" Next assignee",
|
|
729
|
-
formatMember(taskHandoff.nextAssigneeUser)
|
|
730
|
-
);
|
|
753
|
+
printKeyValue(" Next assignee", formatMember(taskHandoff.nextAssigneeUser));
|
|
731
754
|
console.log(` ${taskHandoff.summary}`);
|
|
732
755
|
}
|
|
733
756
|
async function readTextFile(filePath, label) {
|
|
@@ -1029,7 +1052,7 @@ addBaseUrlOption(
|
|
|
1029
1052
|
)
|
|
1030
1053
|
);
|
|
1031
1054
|
addBaseUrlOption(
|
|
1032
|
-
tasksCommand.command("get <taskId>").description("Show a task by id").option("--json", "Print the task as JSON").option("-p, --project <project>", "Limit lookup to a project id or title").option("--context", "Load the latest saved task context").action(
|
|
1055
|
+
tasksCommand.command("get <taskId>").description("Show a task by id").option("--json", "Print the task as JSON").option("-p, --project <project>", "Limit lookup to a project id or title").option("--context", "Load the latest saved task context").option("--handoff", "Load the active handoff context").action(
|
|
1033
1056
|
async (taskId, options) => {
|
|
1034
1057
|
const { accessToken, baseUrl } = await loadCliContext(options.baseUrl);
|
|
1035
1058
|
const taskEntry = await resolveTaskEntry(
|
|
@@ -1045,17 +1068,24 @@ addBaseUrlOption(
|
|
|
1045
1068
|
taskEntry.board.id,
|
|
1046
1069
|
taskId
|
|
1047
1070
|
) : void 0;
|
|
1071
|
+
const taskHandoff = options.handoff ? (await listTaskHandoffs(
|
|
1072
|
+
baseUrl,
|
|
1073
|
+
accessToken,
|
|
1074
|
+
taskEntry.project.id,
|
|
1075
|
+
taskEntry.board.id,
|
|
1076
|
+
taskId
|
|
1077
|
+
)).find((handoff) => handoff.status === "active") || null : void 0;
|
|
1048
1078
|
if (options.json) {
|
|
1049
1079
|
console.log(
|
|
1050
1080
|
JSON.stringify(
|
|
1051
|
-
serializeTaskEntry(taskEntry, contextRevision),
|
|
1081
|
+
serializeTaskEntry(taskEntry, contextRevision, taskHandoff),
|
|
1052
1082
|
null,
|
|
1053
1083
|
2
|
|
1054
1084
|
)
|
|
1055
1085
|
);
|
|
1056
1086
|
return;
|
|
1057
1087
|
}
|
|
1058
|
-
printTaskDetails(taskEntry, contextRevision);
|
|
1088
|
+
printTaskDetails(taskEntry, contextRevision, taskHandoff);
|
|
1059
1089
|
}
|
|
1060
1090
|
)
|
|
1061
1091
|
);
|
|
@@ -1073,7 +1103,10 @@ addBaseUrlOption(
|
|
|
1073
1103
|
accessToken,
|
|
1074
1104
|
options.project
|
|
1075
1105
|
);
|
|
1076
|
-
const board = resolveBoard(
|
|
1106
|
+
const board = resolveBoard(
|
|
1107
|
+
projectBoardsResult.boardsData.boards,
|
|
1108
|
+
options.board
|
|
1109
|
+
);
|
|
1077
1110
|
const column = resolveColumn(board.columns, options.column);
|
|
1078
1111
|
const description = await resolveTextInput(
|
|
1079
1112
|
options.description,
|
|
@@ -1152,7 +1185,11 @@ addBaseUrlOption(
|
|
|
1152
1185
|
options.descriptionFile,
|
|
1153
1186
|
"description"
|
|
1154
1187
|
);
|
|
1155
|
-
const assigneeIds = options.clearAssignees ? [] : options.assignee.length ? resolveProjectMemberIds(
|
|
1188
|
+
const assigneeIds = options.clearAssignees ? [] : options.assignee.length ? resolveProjectMemberIds(
|
|
1189
|
+
taskEntry.members,
|
|
1190
|
+
options.assignee,
|
|
1191
|
+
user.id
|
|
1192
|
+
) : taskEntry.task.assignees.map((assignee) => assignee.id);
|
|
1156
1193
|
const updatedTask = await updateTask(
|
|
1157
1194
|
baseUrl,
|
|
1158
1195
|
accessToken,
|
|
@@ -1171,7 +1208,9 @@ addBaseUrlOption(
|
|
|
1171
1208
|
task: updatedTask
|
|
1172
1209
|
};
|
|
1173
1210
|
if (options.json) {
|
|
1174
|
-
console.log(
|
|
1211
|
+
console.log(
|
|
1212
|
+
JSON.stringify(serializeTaskEntry(updatedTaskEntry), null, 2)
|
|
1213
|
+
);
|
|
1175
1214
|
return;
|
|
1176
1215
|
}
|
|
1177
1216
|
printSuccess("Updated task.");
|
|
@@ -1247,7 +1286,11 @@ addBaseUrlOption(
|
|
|
1247
1286
|
"Handoff context is required. Pass `--context` or `--context-file`."
|
|
1248
1287
|
);
|
|
1249
1288
|
}
|
|
1250
|
-
const toUser = resolveProjectMember(
|
|
1289
|
+
const toUser = resolveProjectMember(
|
|
1290
|
+
taskEntry.members,
|
|
1291
|
+
options.to,
|
|
1292
|
+
user.id
|
|
1293
|
+
);
|
|
1251
1294
|
if (toUser.id === user.id) {
|
|
1252
1295
|
throw new Error("Choose another project member for `--to`.");
|
|
1253
1296
|
}
|
|
@@ -1271,7 +1314,11 @@ addBaseUrlOption(
|
|
|
1271
1314
|
);
|
|
1272
1315
|
if (options.json) {
|
|
1273
1316
|
console.log(
|
|
1274
|
-
JSON.stringify(
|
|
1317
|
+
JSON.stringify(
|
|
1318
|
+
serializeTaskHandoff(taskEntry, taskHandoff),
|
|
1319
|
+
null,
|
|
1320
|
+
2
|
|
1321
|
+
)
|
|
1275
1322
|
);
|
|
1276
1323
|
return;
|
|
1277
1324
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khangal.j/fireside-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Fireside CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"picocolors": "^1.1.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@types/node": "^25.6.0",
|
|
33
34
|
"tsup": "^8.5.0"
|
|
34
35
|
}
|
|
35
36
|
}
|