chatroom-cli 1.8.0 → 1.9.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.
- package/dist/index.js +186 -157
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12652,6 +12652,7 @@ __export(exports_backlog, {
|
|
|
12652
12652
|
patchBacklog: () => patchBacklog,
|
|
12653
12653
|
markForReviewBacklog: () => markForReviewBacklog,
|
|
12654
12654
|
listBacklog: () => listBacklog,
|
|
12655
|
+
historyBacklog: () => historyBacklog,
|
|
12655
12656
|
completeBacklog: () => completeBacklog,
|
|
12656
12657
|
addBacklog: () => addBacklog
|
|
12657
12658
|
});
|
|
@@ -12687,116 +12688,55 @@ async function listBacklog(chatroomId, options, deps) {
|
|
|
12687
12688
|
const d = deps ?? await createDefaultDeps10();
|
|
12688
12689
|
const sessionId = requireAuth2(d);
|
|
12689
12690
|
validateChatroomId(chatroomId);
|
|
12690
|
-
const
|
|
12691
|
-
"pending",
|
|
12692
|
-
"acknowledged",
|
|
12693
|
-
"in_progress",
|
|
12694
|
-
"backlog",
|
|
12695
|
-
"backlog_acknowledged",
|
|
12696
|
-
"completed",
|
|
12697
|
-
"closed",
|
|
12698
|
-
"active",
|
|
12699
|
-
"pending_review",
|
|
12700
|
-
"archived",
|
|
12701
|
-
"all"
|
|
12702
|
-
];
|
|
12703
|
-
const statusFilter = options.status;
|
|
12704
|
-
if (!statusFilter || !validStatuses.includes(statusFilter)) {
|
|
12705
|
-
console.error(`❌ Invalid or missing status: ${statusFilter || "(none)"}. Must be one of: ${validStatuses.join(", ")}`);
|
|
12706
|
-
process.exit(1);
|
|
12707
|
-
return;
|
|
12708
|
-
}
|
|
12691
|
+
const limit = options.limit ?? 100;
|
|
12709
12692
|
try {
|
|
12710
|
-
const
|
|
12693
|
+
const backlogItems = await d.backend.query(api.backlog.listBacklogItems, {
|
|
12711
12694
|
sessionId,
|
|
12712
|
-
chatroomId
|
|
12695
|
+
chatroomId,
|
|
12696
|
+
statusFilter: "active",
|
|
12697
|
+
limit
|
|
12713
12698
|
});
|
|
12714
|
-
let tasks;
|
|
12715
|
-
if (statusFilter === "active") {
|
|
12716
|
-
tasks = await d.backend.query(api.tasks.listActiveTasks, {
|
|
12717
|
-
sessionId,
|
|
12718
|
-
chatroomId,
|
|
12719
|
-
limit: options.limit || 100
|
|
12720
|
-
});
|
|
12721
|
-
} else if (statusFilter === "archived") {
|
|
12722
|
-
tasks = await d.backend.query(api.tasks.listArchivedTasks, {
|
|
12723
|
-
sessionId,
|
|
12724
|
-
chatroomId,
|
|
12725
|
-
limit: options.limit || 100
|
|
12726
|
-
});
|
|
12727
|
-
} else {
|
|
12728
|
-
tasks = await d.backend.query(api.tasks.listTasks, {
|
|
12729
|
-
sessionId,
|
|
12730
|
-
chatroomId,
|
|
12731
|
-
statusFilter: statusFilter === "all" ? undefined : statusFilter,
|
|
12732
|
-
limit: options.limit || 100
|
|
12733
|
-
});
|
|
12734
|
-
}
|
|
12735
12699
|
console.log("");
|
|
12736
12700
|
console.log("══════════════════════════════════════════════════");
|
|
12737
|
-
console.log("\uD83D\uDCCB
|
|
12701
|
+
console.log("\uD83D\uDCCB ACTIVE BACKLOG");
|
|
12738
12702
|
console.log("══════════════════════════════════════════════════");
|
|
12739
12703
|
console.log(`Chatroom: ${chatroomId}`);
|
|
12740
|
-
console.log(`Filter: ${statusFilter}`);
|
|
12741
12704
|
console.log("");
|
|
12742
|
-
|
|
12743
|
-
|
|
12744
|
-
console.log("──────────────────────────────────────────────────");
|
|
12745
|
-
if (counts.pending > 0)
|
|
12746
|
-
console.log(` \uD83D\uDFE2 Pending: ${counts.pending}`);
|
|
12747
|
-
if (counts.in_progress > 0)
|
|
12748
|
-
console.log(` \uD83D\uDD35 In Progress: ${counts.in_progress}`);
|
|
12749
|
-
if (counts.queued > 0)
|
|
12750
|
-
console.log(` \uD83D\uDFE1 Queued: ${counts.queued}`);
|
|
12751
|
-
if (counts.backlog > 0)
|
|
12752
|
-
console.log(` ⚪ Backlog: ${counts.backlog}`);
|
|
12753
|
-
const activeTotal = counts.pending + counts.in_progress + counts.queued + counts.backlog;
|
|
12754
|
-
console.log(` \uD83D\uDCDD Active Total: ${activeTotal}/100`);
|
|
12755
|
-
console.log("");
|
|
12756
|
-
if (tasks.length === 0) {
|
|
12757
|
-
console.log("No tasks found.");
|
|
12705
|
+
if (backlogItems.length === 0) {
|
|
12706
|
+
console.log("No active backlog items.");
|
|
12758
12707
|
} else {
|
|
12759
12708
|
console.log("──────────────────────────────────────────────────");
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
const
|
|
12764
|
-
const statusEmoji = getStatusEmoji(task.status);
|
|
12765
|
-
const date = new Date(task.createdAt).toLocaleString("en-US", {
|
|
12709
|
+
for (let i2 = 0;i2 < backlogItems.length; i2++) {
|
|
12710
|
+
const item = backlogItems[i2];
|
|
12711
|
+
const statusEmoji = getStatusEmoji(item.status);
|
|
12712
|
+
const date = new Date(item.createdAt).toLocaleString("en-US", {
|
|
12766
12713
|
month: "short",
|
|
12767
12714
|
day: "numeric",
|
|
12768
12715
|
hour: "2-digit",
|
|
12769
12716
|
minute: "2-digit",
|
|
12770
12717
|
hour12: false
|
|
12771
12718
|
});
|
|
12772
|
-
|
|
12773
|
-
console.log(
|
|
12774
|
-
console.log(`
|
|
12775
|
-
|
|
12719
|
+
console.log(`#${i2 + 1} [${statusEmoji} ${item.status.toUpperCase()}] ${item.content}`);
|
|
12720
|
+
console.log(` ID: ${item._id}`);
|
|
12721
|
+
console.log(` Created: ${date}${item.assignedTo ? ` | Assigned: ${item.assignedTo}` : ""}`);
|
|
12722
|
+
if (item.complexity !== undefined || item.value !== undefined || item.priority !== undefined) {
|
|
12723
|
+
const parts = [];
|
|
12724
|
+
if (item.complexity)
|
|
12725
|
+
parts.push(`complexity=${item.complexity}`);
|
|
12726
|
+
if (item.value)
|
|
12727
|
+
parts.push(`value=${item.value}`);
|
|
12728
|
+
if (item.priority !== undefined)
|
|
12729
|
+
parts.push(`priority=${item.priority}`);
|
|
12730
|
+
console.log(` Score: ${parts.join(" | ")}`);
|
|
12731
|
+
}
|
|
12776
12732
|
console.log("");
|
|
12777
12733
|
}
|
|
12778
12734
|
}
|
|
12779
12735
|
console.log("──────────────────────────────────────────────────");
|
|
12780
|
-
|
|
12781
|
-
if (statusFilter === "all") {
|
|
12782
|
-
totalForFilter = counts.pending + counts.in_progress + counts.queued + counts.backlog + counts.pending_user_review + counts.completed + counts.closed;
|
|
12783
|
-
} else if (statusFilter === "active") {
|
|
12784
|
-
totalForFilter = counts.pending + counts.in_progress + counts.queued + counts.backlog;
|
|
12785
|
-
} else if (statusFilter === "archived") {
|
|
12786
|
-
totalForFilter = counts.completed + counts.closed;
|
|
12787
|
-
} else if (statusFilter === "pending_review") {
|
|
12788
|
-
totalForFilter = tasks.length;
|
|
12789
|
-
} else {
|
|
12790
|
-
totalForFilter = counts[statusFilter] ?? tasks.length;
|
|
12791
|
-
}
|
|
12792
|
-
if (tasks.length < totalForFilter) {
|
|
12793
|
-
console.log(`Showing ${tasks.length} of ${totalForFilter} task(s) (use --limit=N to see more)`);
|
|
12794
|
-
} else {
|
|
12795
|
-
console.log(`Showing ${tasks.length} task(s)`);
|
|
12796
|
-
}
|
|
12736
|
+
console.log(`Showing ${backlogItems.length} backlog item(s)`);
|
|
12797
12737
|
console.log("");
|
|
12798
12738
|
} catch (error) {
|
|
12799
|
-
console.error(`❌ Failed to list
|
|
12739
|
+
console.error(`❌ Failed to list backlog items: ${error.message}`);
|
|
12800
12740
|
process.exit(1);
|
|
12801
12741
|
return;
|
|
12802
12742
|
}
|
|
@@ -12806,26 +12746,24 @@ async function addBacklog(chatroomId, options, deps) {
|
|
|
12806
12746
|
const sessionId = requireAuth2(d);
|
|
12807
12747
|
validateChatroomId(chatroomId);
|
|
12808
12748
|
if (!options.content || options.content.trim().length === 0) {
|
|
12809
|
-
console.error(`❌
|
|
12749
|
+
console.error(`❌ Backlog item content cannot be empty`);
|
|
12810
12750
|
process.exit(1);
|
|
12811
12751
|
return;
|
|
12812
12752
|
}
|
|
12813
12753
|
try {
|
|
12814
|
-
const
|
|
12754
|
+
const itemId = await d.backend.mutation(api.backlog.createBacklogItem, {
|
|
12815
12755
|
sessionId,
|
|
12816
12756
|
chatroomId,
|
|
12817
12757
|
content: options.content.trim(),
|
|
12818
|
-
createdBy: options.role
|
|
12819
|
-
isBacklog: true
|
|
12758
|
+
createdBy: options.role
|
|
12820
12759
|
});
|
|
12821
12760
|
console.log("");
|
|
12822
|
-
console.log("✅
|
|
12823
|
-
console.log(` ID: ${
|
|
12824
|
-
console.log(` Status:
|
|
12825
|
-
console.log(` Position: ${result.queuePosition}`);
|
|
12761
|
+
console.log("✅ Backlog item added");
|
|
12762
|
+
console.log(` ID: ${itemId}`);
|
|
12763
|
+
console.log(` Status: backlog`);
|
|
12826
12764
|
console.log("");
|
|
12827
12765
|
} catch (error) {
|
|
12828
|
-
console.error(`❌ Failed to add
|
|
12766
|
+
console.error(`❌ Failed to add backlog item: ${error.message}`);
|
|
12829
12767
|
process.exit(1);
|
|
12830
12768
|
return;
|
|
12831
12769
|
}
|
|
@@ -12834,24 +12772,24 @@ async function completeBacklog(chatroomId, options, deps) {
|
|
|
12834
12772
|
const d = deps ?? await createDefaultDeps10();
|
|
12835
12773
|
const sessionId = requireAuth2(d);
|
|
12836
12774
|
validateChatroomId(chatroomId);
|
|
12837
|
-
if (!options.
|
|
12838
|
-
console.error(`❌
|
|
12775
|
+
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
12776
|
+
console.error(`❌ Backlog item ID is required`);
|
|
12839
12777
|
process.exit(1);
|
|
12840
12778
|
return;
|
|
12841
12779
|
}
|
|
12842
12780
|
try {
|
|
12843
12781
|
const result = await d.backend.mutation(api.tasks.completeTaskById, {
|
|
12844
12782
|
sessionId,
|
|
12845
|
-
taskId: options.
|
|
12783
|
+
taskId: options.backlogItemId,
|
|
12846
12784
|
force: options.force
|
|
12847
12785
|
});
|
|
12848
12786
|
console.log("");
|
|
12849
12787
|
if (result.wasForced) {
|
|
12850
|
-
console.log("⚠️
|
|
12788
|
+
console.log("⚠️ Backlog item force-completed (was in_progress or pending)");
|
|
12851
12789
|
} else {
|
|
12852
|
-
console.log("✅
|
|
12790
|
+
console.log("✅ Backlog item completed");
|
|
12853
12791
|
}
|
|
12854
|
-
console.log(` ID: ${options.
|
|
12792
|
+
console.log(` ID: ${options.backlogItemId}`);
|
|
12855
12793
|
if (result.promoted) {
|
|
12856
12794
|
console.log(` \uD83D\uDCE4 Next task promoted: ${result.promoted}`);
|
|
12857
12795
|
console.log("");
|
|
@@ -12859,7 +12797,7 @@ async function completeBacklog(chatroomId, options, deps) {
|
|
|
12859
12797
|
}
|
|
12860
12798
|
console.log("");
|
|
12861
12799
|
} catch (error) {
|
|
12862
|
-
console.error(`❌ Failed to complete
|
|
12800
|
+
console.error(`❌ Failed to complete backlog item: ${error.message}`);
|
|
12863
12801
|
process.exit(1);
|
|
12864
12802
|
return;
|
|
12865
12803
|
}
|
|
@@ -12868,25 +12806,25 @@ async function reopenBacklog(chatroomId, options, deps) {
|
|
|
12868
12806
|
const d = deps ?? await createDefaultDeps10();
|
|
12869
12807
|
const sessionId = requireAuth2(d);
|
|
12870
12808
|
validateChatroomId(chatroomId);
|
|
12871
|
-
if (!options.
|
|
12872
|
-
console.error(`❌
|
|
12809
|
+
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
12810
|
+
console.error(`❌ Backlog item ID is required`);
|
|
12873
12811
|
process.exit(1);
|
|
12874
12812
|
return;
|
|
12875
12813
|
}
|
|
12876
12814
|
try {
|
|
12877
|
-
await d.backend.mutation(api.
|
|
12815
|
+
await d.backend.mutation(api.backlog.reopenBacklogItem, {
|
|
12878
12816
|
sessionId,
|
|
12879
|
-
|
|
12817
|
+
itemId: options.backlogItemId
|
|
12880
12818
|
});
|
|
12881
12819
|
console.log("");
|
|
12882
|
-
console.log("✅
|
|
12883
|
-
console.log(` ID: ${options.
|
|
12884
|
-
console.log(` Status:
|
|
12820
|
+
console.log("✅ Backlog item reopened");
|
|
12821
|
+
console.log(` ID: ${options.backlogItemId}`);
|
|
12822
|
+
console.log(` Status: backlog`);
|
|
12885
12823
|
console.log("");
|
|
12886
|
-
console.log("\uD83D\uDCA1 The
|
|
12824
|
+
console.log("\uD83D\uDCA1 The backlog item is now ready for user review again.");
|
|
12887
12825
|
console.log("");
|
|
12888
12826
|
} catch (error) {
|
|
12889
|
-
console.error(`❌ Failed to reopen
|
|
12827
|
+
console.error(`❌ Failed to reopen backlog item: ${error.message}`);
|
|
12890
12828
|
process.exit(1);
|
|
12891
12829
|
return;
|
|
12892
12830
|
}
|
|
@@ -12895,8 +12833,8 @@ async function patchBacklog(chatroomId, options, deps) {
|
|
|
12895
12833
|
const d = deps ?? await createDefaultDeps10();
|
|
12896
12834
|
const sessionId = requireAuth2(d);
|
|
12897
12835
|
validateChatroomId(chatroomId);
|
|
12898
|
-
if (!options.
|
|
12899
|
-
console.error(`❌
|
|
12836
|
+
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
12837
|
+
console.error(`❌ Backlog item ID is required`);
|
|
12900
12838
|
process.exit(1);
|
|
12901
12839
|
return;
|
|
12902
12840
|
}
|
|
@@ -12927,16 +12865,16 @@ async function patchBacklog(chatroomId, options, deps) {
|
|
|
12927
12865
|
}
|
|
12928
12866
|
}
|
|
12929
12867
|
try {
|
|
12930
|
-
await d.backend.mutation(api.
|
|
12868
|
+
await d.backend.mutation(api.backlog.patchBacklogItem, {
|
|
12931
12869
|
sessionId,
|
|
12932
|
-
|
|
12870
|
+
itemId: options.backlogItemId,
|
|
12933
12871
|
complexity: options.complexity,
|
|
12934
12872
|
value: options.value,
|
|
12935
12873
|
priority: priorityNum
|
|
12936
12874
|
});
|
|
12937
12875
|
console.log("");
|
|
12938
|
-
console.log("✅
|
|
12939
|
-
console.log(` ID: ${options.
|
|
12876
|
+
console.log("✅ Backlog item updated");
|
|
12877
|
+
console.log(` ID: ${options.backlogItemId}`);
|
|
12940
12878
|
if (options.complexity !== undefined) {
|
|
12941
12879
|
console.log(` Complexity: ${options.complexity}`);
|
|
12942
12880
|
}
|
|
@@ -12948,7 +12886,7 @@ async function patchBacklog(chatroomId, options, deps) {
|
|
|
12948
12886
|
}
|
|
12949
12887
|
console.log("");
|
|
12950
12888
|
} catch (error) {
|
|
12951
|
-
console.error(`❌ Failed to patch
|
|
12889
|
+
console.error(`❌ Failed to patch backlog item: ${error.message}`);
|
|
12952
12890
|
process.exit(1);
|
|
12953
12891
|
return;
|
|
12954
12892
|
}
|
|
@@ -12957,14 +12895,14 @@ async function scoreBacklog(chatroomId, options, deps) {
|
|
|
12957
12895
|
const d = deps ?? await createDefaultDeps10();
|
|
12958
12896
|
const sessionId = requireAuth2(d);
|
|
12959
12897
|
validateChatroomId(chatroomId);
|
|
12960
|
-
if (!options.
|
|
12961
|
-
console.error(`❌
|
|
12898
|
+
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
12899
|
+
console.error(`❌ Backlog item ID is required`);
|
|
12962
12900
|
process.exit(1);
|
|
12963
12901
|
return;
|
|
12964
12902
|
}
|
|
12965
12903
|
if (options.complexity === undefined && options.value === undefined && options.priority === undefined) {
|
|
12966
12904
|
console.error(`❌ At least one of --complexity, --value, or --priority is required`);
|
|
12967
|
-
console.error(` Example: chatroom backlog score --
|
|
12905
|
+
console.error(` Example: chatroom backlog score --backlog-item-id=... --complexity=medium --value=high`);
|
|
12968
12906
|
process.exit(1);
|
|
12969
12907
|
return;
|
|
12970
12908
|
}
|
|
@@ -12990,16 +12928,16 @@ async function scoreBacklog(chatroomId, options, deps) {
|
|
|
12990
12928
|
}
|
|
12991
12929
|
}
|
|
12992
12930
|
try {
|
|
12993
|
-
await d.backend.mutation(api.
|
|
12931
|
+
await d.backend.mutation(api.backlog.patchBacklogItem, {
|
|
12994
12932
|
sessionId,
|
|
12995
|
-
|
|
12933
|
+
itemId: options.backlogItemId,
|
|
12996
12934
|
complexity: options.complexity,
|
|
12997
12935
|
value: options.value,
|
|
12998
12936
|
priority: priorityNum
|
|
12999
12937
|
});
|
|
13000
12938
|
console.log("");
|
|
13001
|
-
console.log("✅
|
|
13002
|
-
console.log(` ID: ${options.
|
|
12939
|
+
console.log("✅ Backlog item scored");
|
|
12940
|
+
console.log(` ID: ${options.backlogItemId}`);
|
|
13003
12941
|
if (options.complexity !== undefined) {
|
|
13004
12942
|
console.log(` Complexity: ${options.complexity}`);
|
|
13005
12943
|
}
|
|
@@ -13011,7 +12949,7 @@ async function scoreBacklog(chatroomId, options, deps) {
|
|
|
13011
12949
|
}
|
|
13012
12950
|
console.log("");
|
|
13013
12951
|
} catch (error) {
|
|
13014
|
-
console.error(`❌ Failed to score
|
|
12952
|
+
console.error(`❌ Failed to score backlog item: ${error.message}`);
|
|
13015
12953
|
process.exit(1);
|
|
13016
12954
|
return;
|
|
13017
12955
|
}
|
|
@@ -13020,25 +12958,120 @@ async function markForReviewBacklog(chatroomId, options, deps) {
|
|
|
13020
12958
|
const d = deps ?? await createDefaultDeps10();
|
|
13021
12959
|
const sessionId = requireAuth2(d);
|
|
13022
12960
|
validateChatroomId(chatroomId);
|
|
13023
|
-
if (!options.
|
|
13024
|
-
console.error(`❌
|
|
12961
|
+
if (!options.backlogItemId || options.backlogItemId.trim().length === 0) {
|
|
12962
|
+
console.error(`❌ Backlog item ID is required`);
|
|
13025
12963
|
process.exit(1);
|
|
13026
12964
|
return;
|
|
13027
12965
|
}
|
|
13028
12966
|
try {
|
|
13029
|
-
await d.backend.mutation(api.
|
|
12967
|
+
await d.backend.mutation(api.backlog.markBacklogItemForReview, {
|
|
13030
12968
|
sessionId,
|
|
13031
|
-
|
|
12969
|
+
itemId: options.backlogItemId
|
|
13032
12970
|
});
|
|
13033
12971
|
console.log("");
|
|
13034
|
-
console.log("✅
|
|
13035
|
-
console.log(` ID: ${options.
|
|
12972
|
+
console.log("✅ Backlog item marked for review");
|
|
12973
|
+
console.log(` ID: ${options.backlogItemId}`);
|
|
13036
12974
|
console.log(` Status: pending_user_review`);
|
|
13037
12975
|
console.log("");
|
|
13038
|
-
console.log('\uD83D\uDCA1 The
|
|
12976
|
+
console.log('\uD83D\uDCA1 The backlog item is now visible in the "Pending Review" section for user confirmation.');
|
|
13039
12977
|
console.log("");
|
|
13040
12978
|
} catch (error) {
|
|
13041
|
-
console.error(`❌ Failed to mark
|
|
12979
|
+
console.error(`❌ Failed to mark backlog item for review: ${error.message}`);
|
|
12980
|
+
process.exit(1);
|
|
12981
|
+
return;
|
|
12982
|
+
}
|
|
12983
|
+
}
|
|
12984
|
+
async function historyBacklog(chatroomId, options, deps) {
|
|
12985
|
+
const d = deps ?? await createDefaultDeps10();
|
|
12986
|
+
const sessionId = requireAuth2(d);
|
|
12987
|
+
validateChatroomId(chatroomId);
|
|
12988
|
+
const now = Date.now();
|
|
12989
|
+
const defaultFrom = now - 30 * 24 * 60 * 60 * 1000;
|
|
12990
|
+
let fromMs;
|
|
12991
|
+
let toMs;
|
|
12992
|
+
if (options.from) {
|
|
12993
|
+
const parsed = Date.parse(options.from);
|
|
12994
|
+
if (isNaN(parsed)) {
|
|
12995
|
+
console.error(`❌ Invalid --from date: "${options.from}". Use YYYY-MM-DD format.`);
|
|
12996
|
+
process.exit(1);
|
|
12997
|
+
return;
|
|
12998
|
+
}
|
|
12999
|
+
fromMs = parsed;
|
|
13000
|
+
}
|
|
13001
|
+
if (options.to) {
|
|
13002
|
+
const parsed = Date.parse(options.to);
|
|
13003
|
+
if (isNaN(parsed)) {
|
|
13004
|
+
console.error(`❌ Invalid --to date: "${options.to}". Use YYYY-MM-DD format.`);
|
|
13005
|
+
process.exit(1);
|
|
13006
|
+
return;
|
|
13007
|
+
}
|
|
13008
|
+
toMs = parsed + 86399999;
|
|
13009
|
+
}
|
|
13010
|
+
try {
|
|
13011
|
+
const tasks = await d.backend.query(api.tasks.listHistoricalTasks, {
|
|
13012
|
+
sessionId,
|
|
13013
|
+
chatroomId,
|
|
13014
|
+
from: fromMs,
|
|
13015
|
+
to: toMs,
|
|
13016
|
+
limit: options.limit
|
|
13017
|
+
});
|
|
13018
|
+
const fromDate = new Date(fromMs ?? defaultFrom).toLocaleDateString("en-US", {
|
|
13019
|
+
month: "short",
|
|
13020
|
+
day: "numeric",
|
|
13021
|
+
year: "numeric"
|
|
13022
|
+
});
|
|
13023
|
+
const toDate = new Date(toMs ?? now).toLocaleDateString("en-US", {
|
|
13024
|
+
month: "short",
|
|
13025
|
+
day: "numeric",
|
|
13026
|
+
year: "numeric"
|
|
13027
|
+
});
|
|
13028
|
+
console.log("");
|
|
13029
|
+
console.log("══════════════════════════════════════════════════");
|
|
13030
|
+
console.log("\uD83D\uDCDC TASK HISTORY");
|
|
13031
|
+
console.log("══════════════════════════════════════════════════");
|
|
13032
|
+
console.log(`Chatroom: ${chatroomId}`);
|
|
13033
|
+
console.log(`Date range: ${fromDate} → ${toDate}`);
|
|
13034
|
+
console.log(`Filter: completed + closed`);
|
|
13035
|
+
console.log("");
|
|
13036
|
+
if (tasks.length === 0) {
|
|
13037
|
+
console.log("No history found for date range.");
|
|
13038
|
+
} else {
|
|
13039
|
+
console.log("──────────────────────────────────────────────────");
|
|
13040
|
+
console.log("\uD83D\uDCDD COMPLETED / CLOSED TASKS");
|
|
13041
|
+
console.log("──────────────────────────────────────────────────");
|
|
13042
|
+
for (let i2 = 0;i2 < tasks.length; i2++) {
|
|
13043
|
+
const task = tasks[i2];
|
|
13044
|
+
const statusEmoji = getStatusEmoji(task.status);
|
|
13045
|
+
const completedTs = task.completedAt ?? task.updatedAt;
|
|
13046
|
+
const date = new Date(completedTs).toLocaleString("en-US", {
|
|
13047
|
+
month: "short",
|
|
13048
|
+
day: "numeric",
|
|
13049
|
+
year: "numeric",
|
|
13050
|
+
hour: "2-digit",
|
|
13051
|
+
minute: "2-digit",
|
|
13052
|
+
hour12: false
|
|
13053
|
+
});
|
|
13054
|
+
console.log(`#${i2 + 1} [${statusEmoji} ${task.status.toUpperCase()}] ${task.content}`);
|
|
13055
|
+
console.log(` ID: ${task._id}`);
|
|
13056
|
+
console.log(` Completed: ${date}${task.assignedTo ? ` | Assigned: ${task.assignedTo}` : ""}`);
|
|
13057
|
+
if (task.complexity !== undefined || task.value !== undefined || task.priority !== undefined) {
|
|
13058
|
+
const parts = [];
|
|
13059
|
+
if (task.complexity)
|
|
13060
|
+
parts.push(`complexity=${task.complexity}`);
|
|
13061
|
+
if (task.value)
|
|
13062
|
+
parts.push(`value=${task.value}`);
|
|
13063
|
+
if (task.priority !== undefined)
|
|
13064
|
+
parts.push(`priority=${task.priority}`);
|
|
13065
|
+
console.log(` Score: ${parts.join(" | ")}`);
|
|
13066
|
+
}
|
|
13067
|
+
console.log("");
|
|
13068
|
+
}
|
|
13069
|
+
}
|
|
13070
|
+
console.log("──────────────────────────────────────────────────");
|
|
13071
|
+
console.log(`Showing ${tasks.length} task(s)`);
|
|
13072
|
+
console.log("");
|
|
13073
|
+
} catch (error) {
|
|
13074
|
+
console.error(`❌ Failed to load history: ${error.message}`);
|
|
13042
13075
|
process.exit(1);
|
|
13043
13076
|
return;
|
|
13044
13077
|
}
|
|
@@ -13053,8 +13086,6 @@ function getStatusEmoji(status) {
|
|
|
13053
13086
|
return "\uD83D\uDD35";
|
|
13054
13087
|
case "backlog":
|
|
13055
13088
|
return "⚪";
|
|
13056
|
-
case "backlog_acknowledged":
|
|
13057
|
-
return "\uD83D\uDCCB";
|
|
13058
13089
|
case "completed":
|
|
13059
13090
|
return "✅";
|
|
13060
13091
|
case "pending_user_review":
|
|
@@ -16294,22 +16325,15 @@ program2.command("report-progress").description("Report progress on current task
|
|
|
16294
16325
|
});
|
|
16295
16326
|
});
|
|
16296
16327
|
var backlogCommand = program2.command("backlog").description("Manage task queue and backlog");
|
|
16297
|
-
backlogCommand.command("list").description("List
|
|
16298
|
-
if (options.status === "all" && !options.limit) {
|
|
16299
|
-
console.error("❌ When using --status=all, you must specify --limit=<n>");
|
|
16300
|
-
console.error(" Example: chatroom backlog list --chatroom-id=<id> --role=builder --status=all --limit=50");
|
|
16301
|
-
process.exit(1);
|
|
16302
|
-
}
|
|
16328
|
+
backlogCommand.command("list").description("List active backlog items").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").option("--limit <n>", "Maximum number of items to show").action(async (options) => {
|
|
16303
16329
|
await maybeRequireAuth();
|
|
16304
16330
|
const { listBacklog: listBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
|
|
16305
16331
|
await listBacklog2(options.chatroomId, {
|
|
16306
16332
|
role: options.role,
|
|
16307
|
-
|
|
16308
|
-
limit: options.limit ? parseInt(options.limit, 10) : 20,
|
|
16309
|
-
full: options.full
|
|
16333
|
+
limit: options.limit ? parseInt(options.limit, 10) : undefined
|
|
16310
16334
|
});
|
|
16311
16335
|
});
|
|
16312
|
-
backlogCommand.command("add").description("Add a
|
|
16336
|
+
backlogCommand.command("add").description("Add a backlog item").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role (creator)").requiredOption("--content-file <path>", "Path to file containing task content").action(async (options) => {
|
|
16313
16337
|
await maybeRequireAuth();
|
|
16314
16338
|
const { readFileContent: readFileContent2 } = await Promise.resolve().then(() => (init_file_content(), exports_file_content));
|
|
16315
16339
|
let content;
|
|
@@ -16326,31 +16350,36 @@ backlogCommand.command("add").description("Add a task to the backlog").requiredO
|
|
|
16326
16350
|
const { addBacklog: addBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
|
|
16327
16351
|
await addBacklog2(options.chatroomId, { role: options.role, content });
|
|
16328
16352
|
});
|
|
16329
|
-
backlogCommand.command("complete").description("Mark a
|
|
16353
|
+
backlogCommand.command("complete").description("Mark a backlog item as complete. Use --force for stuck in_progress/pending tasks.").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--backlog-item-id <id>", "Backlog item ID to complete").option("-f, --force", "Force complete a stuck in_progress or pending task").action(async (options) => {
|
|
16330
16354
|
await maybeRequireAuth();
|
|
16331
16355
|
const { completeBacklog: completeBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
|
|
16332
16356
|
await completeBacklog2(options.chatroomId, options);
|
|
16333
16357
|
});
|
|
16334
|
-
backlogCommand.command("reopen").description("Reopen a
|
|
16358
|
+
backlogCommand.command("reopen").description("Reopen a closed backlog item, returning it to backlog status.").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--backlog-item-id <id>", "Backlog item ID to reopen").action(async (options) => {
|
|
16335
16359
|
await maybeRequireAuth();
|
|
16336
16360
|
const { reopenBacklog: reopenBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
|
|
16337
16361
|
await reopenBacklog2(options.chatroomId, options);
|
|
16338
16362
|
});
|
|
16339
|
-
backlogCommand.command("
|
|
16340
|
-
await maybeRequireAuth();
|
|
16341
|
-
const { patchBacklog: patchBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
|
|
16342
|
-
await patchBacklog2(options.chatroomId, options);
|
|
16343
|
-
});
|
|
16344
|
-
backlogCommand.command("score").description("Score a backlog task by complexity, value, and priority").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--task-id <taskId>", "Task ID to score").option("--complexity <level>", "Complexity level: low, medium, high").option("--value <level>", "Value level: low, medium, high").option("--priority <n>", "Priority number (higher = more important)").action(async (options) => {
|
|
16363
|
+
backlogCommand.command("score").description("Score a backlog item by complexity, value, and priority").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--backlog-item-id <id>", "Backlog item ID to score").option("--complexity <level>", "Complexity level: low, medium, high").option("--value <level>", "Value level: low, medium, high").option("--priority <n>", "Priority number (higher = more important)").action(async (options) => {
|
|
16345
16364
|
await maybeRequireAuth();
|
|
16346
16365
|
const { scoreBacklog: scoreBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
|
|
16347
16366
|
await scoreBacklog2(options.chatroomId, options);
|
|
16348
16367
|
});
|
|
16349
|
-
backlogCommand.command("mark-for-review").description("Mark a backlog
|
|
16368
|
+
backlogCommand.command("mark-for-review").description("Mark a backlog item as ready for user review (backlog → pending_user_review)").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--backlog-item-id <id>", "Backlog item ID to mark for review").action(async (options) => {
|
|
16350
16369
|
await maybeRequireAuth();
|
|
16351
16370
|
const { markForReviewBacklog: markForReviewBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
|
|
16352
16371
|
await markForReviewBacklog2(options.chatroomId, options);
|
|
16353
16372
|
});
|
|
16373
|
+
backlogCommand.command("history").description("View completed and closed backlog items by date range (all statuses)").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").option("--from <date>", "Start date (YYYY-MM-DD), defaults to 30 days ago").option("--to <date>", "End date (YYYY-MM-DD), defaults to today").option("--limit <n>", "Maximum number of items to show").action(async (options) => {
|
|
16374
|
+
await maybeRequireAuth();
|
|
16375
|
+
const { historyBacklog: historyBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
|
|
16376
|
+
await historyBacklog2(options.chatroomId, {
|
|
16377
|
+
role: options.role,
|
|
16378
|
+
from: options.from,
|
|
16379
|
+
to: options.to,
|
|
16380
|
+
limit: options.limit ? parseInt(options.limit, 10) : undefined
|
|
16381
|
+
});
|
|
16382
|
+
});
|
|
16354
16383
|
var skillCommand = program2.command("skill").description("Manage and activate chatroom skills");
|
|
16355
16384
|
skillCommand.command("list").description("List available skills for a chatroom").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").action(async (options) => {
|
|
16356
16385
|
await maybeRequireAuth();
|