chatroom-cli 1.7.1 → 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.
Files changed (2) hide show
  1. package/dist/index.js +309 -180
  2. 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 validStatuses = [
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 counts = await d.backend.query(api.tasks.getTaskCounts, {
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 TASK QUEUE");
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
- console.log("──────────────────────────────────────────────────");
12743
- console.log("\uD83D\uDCCA SUMMARY");
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
- console.log("\uD83D\uDCDD TASKS");
12761
- console.log("──────────────────────────────────────────────────");
12762
- for (let i2 = 0;i2 < tasks.length; i2++) {
12763
- const task = tasks[i2];
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
- const displayContent = task.content;
12773
- console.log(`#${i2 + 1} [${statusEmoji} ${task.status.toUpperCase()}] ${displayContent}`);
12774
- console.log(` ID: ${task._id}`);
12775
- console.log(` Created: ${date}${task.assignedTo ? ` | Assigned: ${task.assignedTo}` : ""}`);
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
- let totalForFilter;
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 tasks: ${error.message}`);
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(`❌ Task content cannot be empty`);
12749
+ console.error(`❌ Backlog item content cannot be empty`);
12810
12750
  process.exit(1);
12811
12751
  return;
12812
12752
  }
12813
12753
  try {
12814
- const result = await d.backend.mutation(api.tasks.createTask, {
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("✅ Task added to backlog");
12823
- console.log(` ID: ${result.taskId}`);
12824
- console.log(` Status: ${result.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 task: ${error.message}`);
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.taskId || options.taskId.trim().length === 0) {
12838
- console.error(`❌ Task ID is required`);
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.taskId,
12783
+ taskId: options.backlogItemId,
12846
12784
  force: options.force
12847
12785
  });
12848
12786
  console.log("");
12849
12787
  if (result.wasForced) {
12850
- console.log("⚠️ Task force-completed (was in_progress or pending)");
12788
+ console.log("⚠️ Backlog item force-completed (was in_progress or pending)");
12851
12789
  } else {
12852
- console.log("✅ Task completed");
12790
+ console.log("✅ Backlog item completed");
12853
12791
  }
12854
- console.log(` ID: ${options.taskId}`);
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 task: ${error.message}`);
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.taskId || options.taskId.trim().length === 0) {
12872
- console.error(`❌ Task ID is required`);
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.tasks.reopenBacklogTask, {
12815
+ await d.backend.mutation(api.backlog.reopenBacklogItem, {
12878
12816
  sessionId,
12879
- taskId: options.taskId
12817
+ itemId: options.backlogItemId
12880
12818
  });
12881
12819
  console.log("");
12882
- console.log("✅ Task reopened");
12883
- console.log(` ID: ${options.taskId}`);
12884
- console.log(` Status: pending_user_review`);
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 task is now ready for user review again.");
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 task: ${error.message}`);
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.taskId || options.taskId.trim().length === 0) {
12899
- console.error(`❌ Task ID is required`);
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.tasks.patchTask, {
12868
+ await d.backend.mutation(api.backlog.patchBacklogItem, {
12931
12869
  sessionId,
12932
- taskId: options.taskId,
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("✅ Task updated");
12939
- console.log(` ID: ${options.taskId}`);
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 task: ${error.message}`);
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.taskId || options.taskId.trim().length === 0) {
12961
- console.error(`❌ Task ID is required`);
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 --task-id=... --complexity=medium --value=high`);
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.tasks.patchTask, {
12931
+ await d.backend.mutation(api.backlog.patchBacklogItem, {
12994
12932
  sessionId,
12995
- taskId: options.taskId,
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("✅ Task scored");
13002
- console.log(` ID: ${options.taskId}`);
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 task: ${error.message}`);
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.taskId || options.taskId.trim().length === 0) {
13024
- console.error(`❌ Task ID is required`);
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.tasks.markBacklogForReview, {
12967
+ await d.backend.mutation(api.backlog.markBacklogItemForReview, {
13030
12968
  sessionId,
13031
- taskId: options.taskId
12969
+ itemId: options.backlogItemId
13032
12970
  });
13033
12971
  console.log("");
13034
- console.log("✅ Task marked for review");
13035
- console.log(` ID: ${options.taskId}`);
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 task is now visible in the "Pending Review" section for user confirmation.');
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 task for review: ${error.message}`);
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":
@@ -13100,13 +13131,102 @@ function resolveContent(content, filePath, optionName) {
13100
13131
  }
13101
13132
  var init_file_content = () => {};
13102
13133
 
13134
+ // src/commands/skill/index.ts
13135
+ var exports_skill = {};
13136
+ __export(exports_skill, {
13137
+ listSkills: () => listSkills,
13138
+ activateSkill: () => activateSkill
13139
+ });
13140
+ async function createDefaultDeps11() {
13141
+ const client2 = await getConvexClient();
13142
+ return {
13143
+ backend: {
13144
+ mutation: (endpoint, args) => client2.mutation(endpoint, args),
13145
+ query: (endpoint, args) => client2.query(endpoint, args)
13146
+ },
13147
+ session: {
13148
+ getSessionId,
13149
+ getConvexUrl,
13150
+ getOtherSessionUrls
13151
+ }
13152
+ };
13153
+ }
13154
+ function requireAuth3(d) {
13155
+ const sessionId = d.session.getSessionId();
13156
+ if (!sessionId) {
13157
+ console.error(`❌ Not authenticated. Please run: chatroom auth login`);
13158
+ process.exit(1);
13159
+ }
13160
+ return sessionId;
13161
+ }
13162
+ async function listSkills(chatroomId, options, deps) {
13163
+ const d = deps ?? await createDefaultDeps11();
13164
+ const sessionId = requireAuth3(d);
13165
+ try {
13166
+ const skills = await d.backend.query(api.skills.list, {
13167
+ sessionId,
13168
+ chatroomId
13169
+ });
13170
+ if (!skills || skills.length === 0) {
13171
+ console.log("No skills available.");
13172
+ return;
13173
+ }
13174
+ const maxSkillIdLen = Math.max(...skills.map((s) => s.skillId.length));
13175
+ console.log("Available skills:");
13176
+ for (const skill of skills) {
13177
+ const padded = skill.skillId.padEnd(maxSkillIdLen);
13178
+ console.log(` ${padded} ${skill.description}`);
13179
+ }
13180
+ } catch (error) {
13181
+ if (error instanceof ConvexError) {
13182
+ const msg = typeof error.data === "string" ? error.data : error.data.message ?? String(error.data);
13183
+ console.error(`❌ ${msg}`);
13184
+ } else {
13185
+ console.error(`❌ Failed to list skills: ${error.message}`);
13186
+ }
13187
+ process.exit(1);
13188
+ }
13189
+ }
13190
+ async function activateSkill(chatroomId, skillId, options, deps) {
13191
+ const d = deps ?? await createDefaultDeps11();
13192
+ const sessionId = requireAuth3(d);
13193
+ try {
13194
+ const convexUrl = d.session.getConvexUrl();
13195
+ const result = await d.backend.mutation(api.skills.activate, {
13196
+ sessionId,
13197
+ chatroomId,
13198
+ skillId,
13199
+ role: options.role,
13200
+ convexUrl: convexUrl ?? undefined
13201
+ });
13202
+ console.log("");
13203
+ console.log(`✅ Skill "${result.skill.skillId}" activated.`);
13204
+ console.log(` The agent will now: ${result.skill.description}`);
13205
+ console.log("");
13206
+ } catch (error) {
13207
+ if (error instanceof ConvexError) {
13208
+ const msg = typeof error.data === "string" ? error.data : error.data.message ?? String(error.data);
13209
+ console.error(`❌ ${msg}`);
13210
+ } else {
13211
+ console.error(`❌ Failed to activate skill: ${error.message}`);
13212
+ }
13213
+ process.exit(1);
13214
+ }
13215
+ }
13216
+ var init_skill = __esm(() => {
13217
+ init_values();
13218
+ init_api3();
13219
+ init_storage();
13220
+ init_client2();
13221
+ });
13222
+
13103
13223
  // src/commands/messages/index.ts
13104
13224
  var exports_messages = {};
13105
13225
  __export(exports_messages, {
13106
13226
  listSinceMessage: () => listSinceMessage,
13107
13227
  listBySenderRole: () => listBySenderRole
13108
13228
  });
13109
- async function createDefaultDeps11() {
13229
+ async function createDefaultDeps12() {
13110
13230
  const client2 = await getConvexClient();
13111
13231
  return {
13112
13232
  backend: {
@@ -13121,7 +13241,7 @@ async function createDefaultDeps11() {
13121
13241
  };
13122
13242
  }
13123
13243
  async function listBySenderRole(chatroomId, options, deps) {
13124
- const d = deps ?? await createDefaultDeps11();
13244
+ const d = deps ?? await createDefaultDeps12();
13125
13245
  const sessionId = d.session.getSessionId();
13126
13246
  if (!sessionId) {
13127
13247
  console.error(`❌ Not authenticated. Please run: chatroom auth login`);
@@ -13186,7 +13306,7 @@ ${content.split(`
13186
13306
  }
13187
13307
  }
13188
13308
  async function listSinceMessage(chatroomId, options, deps) {
13189
- const d = deps ?? await createDefaultDeps11();
13309
+ const d = deps ?? await createDefaultDeps12();
13190
13310
  const sessionId = d.session.getSessionId();
13191
13311
  if (!sessionId) {
13192
13312
  console.error(`❌ Not authenticated. Please run: chatroom auth login`);
@@ -13262,7 +13382,7 @@ __export(exports_context, {
13262
13382
  listContexts: () => listContexts,
13263
13383
  inspectContext: () => inspectContext
13264
13384
  });
13265
- async function createDefaultDeps12() {
13385
+ async function createDefaultDeps13() {
13266
13386
  const client2 = await getConvexClient();
13267
13387
  return {
13268
13388
  backend: {
@@ -13277,7 +13397,7 @@ async function createDefaultDeps12() {
13277
13397
  };
13278
13398
  }
13279
13399
  async function readContext(chatroomId, options, deps) {
13280
- const d = deps ?? await createDefaultDeps12();
13400
+ const d = deps ?? await createDefaultDeps13();
13281
13401
  const sessionId = d.session.getSessionId();
13282
13402
  if (!sessionId) {
13283
13403
  console.error(`❌ Not authenticated. Please run: chatroom auth login`);
@@ -13392,7 +13512,7 @@ async function readContext(chatroomId, options, deps) {
13392
13512
  }
13393
13513
  }
13394
13514
  async function newContext(chatroomId, options, deps) {
13395
- const d = deps ?? await createDefaultDeps12();
13515
+ const d = deps ?? await createDefaultDeps13();
13396
13516
  const sessionId = d.session.getSessionId();
13397
13517
  if (!sessionId) {
13398
13518
  console.error(`❌ Not authenticated. Please run: chatroom auth login`);
@@ -13444,7 +13564,7 @@ async function newContext(chatroomId, options, deps) {
13444
13564
  }
13445
13565
  }
13446
13566
  async function listContexts(chatroomId, options, deps) {
13447
- const d = deps ?? await createDefaultDeps12();
13567
+ const d = deps ?? await createDefaultDeps13();
13448
13568
  const sessionId = d.session.getSessionId();
13449
13569
  if (!sessionId) {
13450
13570
  console.error(`❌ Not authenticated. Please run: chatroom auth login`);
@@ -13496,7 +13616,7 @@ async function listContexts(chatroomId, options, deps) {
13496
13616
  }
13497
13617
  }
13498
13618
  async function inspectContext(chatroomId, options, deps) {
13499
- const d = deps ?? await createDefaultDeps12();
13619
+ const d = deps ?? await createDefaultDeps13();
13500
13620
  const sessionId = d.session.getSessionId();
13501
13621
  if (!sessionId) {
13502
13622
  console.error(`❌ Not authenticated. Please run: chatroom auth login`);
@@ -13556,7 +13676,7 @@ __export(exports_guidelines, {
13556
13676
  viewGuidelines: () => viewGuidelines,
13557
13677
  listGuidelineTypes: () => listGuidelineTypes
13558
13678
  });
13559
- async function createDefaultDeps13() {
13679
+ async function createDefaultDeps14() {
13560
13680
  const client2 = await getConvexClient();
13561
13681
  return {
13562
13682
  backend: {
@@ -13571,7 +13691,7 @@ async function createDefaultDeps13() {
13571
13691
  };
13572
13692
  }
13573
13693
  async function viewGuidelines(options, deps) {
13574
- const d = deps ?? await createDefaultDeps13();
13694
+ const d = deps ?? await createDefaultDeps14();
13575
13695
  const { type } = options;
13576
13696
  if (!VALID_TYPES.includes(type)) {
13577
13697
  console.error(`❌ Invalid guideline type: "${type}"`);
@@ -13606,7 +13726,7 @@ ${"═".repeat(60)}
13606
13726
  }
13607
13727
  }
13608
13728
  async function listGuidelineTypes(deps) {
13609
- const d = deps ?? await createDefaultDeps13();
13729
+ const d = deps ?? await createDefaultDeps14();
13610
13730
  const sessionId = d.session.getSessionId();
13611
13731
  if (!sessionId) {
13612
13732
  console.error(`❌ Not authenticated. Please run: chatroom auth login`);
@@ -13648,7 +13768,7 @@ __export(exports_artifact, {
13648
13768
  viewArtifact: () => viewArtifact,
13649
13769
  createArtifact: () => createArtifact
13650
13770
  });
13651
- async function createDefaultDeps14() {
13771
+ async function createDefaultDeps15() {
13652
13772
  const client2 = await getConvexClient();
13653
13773
  return {
13654
13774
  backend: {
@@ -13663,7 +13783,7 @@ async function createDefaultDeps14() {
13663
13783
  };
13664
13784
  }
13665
13785
  async function createArtifact(chatroomId, options, deps) {
13666
- const d = deps ?? await createDefaultDeps14();
13786
+ const d = deps ?? await createDefaultDeps15();
13667
13787
  const sessionId = d.session.getSessionId();
13668
13788
  if (!sessionId) {
13669
13789
  formatAuthError(d.session.getConvexUrl(), d.session.getOtherSessionUrls());
@@ -13717,7 +13837,7 @@ async function createArtifact(chatroomId, options, deps) {
13717
13837
  }
13718
13838
  }
13719
13839
  async function viewArtifact(chatroomId, options, deps) {
13720
- const d = deps ?? await createDefaultDeps14();
13840
+ const d = deps ?? await createDefaultDeps15();
13721
13841
  const sessionId = d.session.getSessionId();
13722
13842
  if (!sessionId) {
13723
13843
  formatAuthError(d.session.getConvexUrl(), d.session.getOtherSessionUrls());
@@ -13761,7 +13881,7 @@ async function viewArtifact(chatroomId, options, deps) {
13761
13881
  }
13762
13882
  }
13763
13883
  async function viewManyArtifacts(chatroomId, options, deps) {
13764
- const d = deps ?? await createDefaultDeps14();
13884
+ const d = deps ?? await createDefaultDeps15();
13765
13885
  const sessionId = d.session.getSessionId();
13766
13886
  if (!sessionId) {
13767
13887
  formatAuthError(d.session.getConvexUrl(), d.session.getOtherSessionUrls());
@@ -13827,7 +13947,7 @@ var exports_get_system_prompt = {};
13827
13947
  __export(exports_get_system_prompt, {
13828
13948
  getSystemPrompt: () => getSystemPrompt
13829
13949
  });
13830
- async function createDefaultDeps15() {
13950
+ async function createDefaultDeps16() {
13831
13951
  const client2 = await getConvexClient();
13832
13952
  return {
13833
13953
  backend: {
@@ -13842,7 +13962,7 @@ async function createDefaultDeps15() {
13842
13962
  };
13843
13963
  }
13844
13964
  async function getSystemPrompt(chatroomId, options, deps) {
13845
- const d = deps ?? await createDefaultDeps15();
13965
+ const d = deps ?? await createDefaultDeps16();
13846
13966
  const { role } = options;
13847
13967
  const sessionId = d.session.getSessionId();
13848
13968
  if (!sessionId) {
@@ -14364,7 +14484,7 @@ async function discoverModels(agentServices) {
14364
14484
  }
14365
14485
  return results;
14366
14486
  }
14367
- function createDefaultDeps16() {
14487
+ function createDefaultDeps17() {
14368
14488
  return {
14369
14489
  backend: {
14370
14490
  mutation: async () => {
@@ -14502,7 +14622,7 @@ async function initDaemon() {
14502
14622
  const agentServices = new Map(getAllHarnesses().map((s) => [s.id, s]));
14503
14623
  const availableModels = await registerCapabilities(client2, typedSessionId, config3, agentServices);
14504
14624
  await connectDaemon(client2, typedSessionId, machineId, convexUrl);
14505
- const deps = createDefaultDeps16();
14625
+ const deps = createDefaultDeps17();
14506
14626
  deps.backend.mutation = (endpoint, args) => client2.mutation(endpoint, args);
14507
14627
  deps.backend.query = (endpoint, args) => client2.query(endpoint, args);
14508
14628
  const events = new DaemonEventBus;
@@ -15568,7 +15688,7 @@ async function isChatroomInstalledDefault() {
15568
15688
  return false;
15569
15689
  }
15570
15690
  }
15571
- async function createDefaultDeps17() {
15691
+ async function createDefaultDeps18() {
15572
15692
  const client2 = await getConvexClient();
15573
15693
  const fs = await import("fs/promises");
15574
15694
  return {
@@ -15596,7 +15716,7 @@ async function createDefaultDeps17() {
15596
15716
  };
15597
15717
  }
15598
15718
  async function installTool(options = {}, deps) {
15599
- const d = deps ?? await createDefaultDeps17();
15719
+ const d = deps ?? await createDefaultDeps18();
15600
15720
  const { checkExisting = true } = options;
15601
15721
  const os = await import("os");
15602
15722
  const path2 = await import("path");
@@ -16057,8 +16177,8 @@ async function maybeRequireAuth() {
16057
16177
  console.log("⚠️ Skipping authentication (--skip-auth flag)");
16058
16178
  return;
16059
16179
  }
16060
- const { requireAuth: requireAuth3 } = await Promise.resolve().then(() => (init_middleware(), exports_middleware));
16061
- await requireAuth3();
16180
+ const { requireAuth: requireAuth4 } = await Promise.resolve().then(() => (init_middleware(), exports_middleware));
16181
+ await requireAuth4();
16062
16182
  }
16063
16183
  var authCommand = program2.command("auth").description("Manage CLI authentication");
16064
16184
  authCommand.command("login").description("Authenticate the CLI via browser").option("-f, --force", "Re-authenticate even if already logged in").action(async (options) => {
@@ -16205,22 +16325,15 @@ program2.command("report-progress").description("Report progress on current task
16205
16325
  });
16206
16326
  });
16207
16327
  var backlogCommand = program2.command("backlog").description("Manage task queue and backlog");
16208
- backlogCommand.command("list").description("List tasks in a chatroom").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--status <status>", "Filter by status (pending|in_progress|backlog|completed|cancelled|active|pending_review|archived|all)").option("--limit <n>", "Maximum number of tasks to show (required for --status=all)").option("--full", "Show full task content without truncation").action(async (options) => {
16209
- if (options.status === "all" && !options.limit) {
16210
- console.error("❌ When using --status=all, you must specify --limit=<n>");
16211
- console.error(" Example: chatroom backlog list --chatroom-id=<id> --role=builder --status=all --limit=50");
16212
- process.exit(1);
16213
- }
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) => {
16214
16329
  await maybeRequireAuth();
16215
16330
  const { listBacklog: listBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
16216
16331
  await listBacklog2(options.chatroomId, {
16217
16332
  role: options.role,
16218
- status: options.status,
16219
- limit: options.limit ? parseInt(options.limit, 10) : 20,
16220
- full: options.full
16333
+ limit: options.limit ? parseInt(options.limit, 10) : undefined
16221
16334
  });
16222
16335
  });
16223
- backlogCommand.command("add").description("Add a task to the backlog").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) => {
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) => {
16224
16337
  await maybeRequireAuth();
16225
16338
  const { readFileContent: readFileContent2 } = await Promise.resolve().then(() => (init_file_content(), exports_file_content));
16226
16339
  let content;
@@ -16237,31 +16350,47 @@ backlogCommand.command("add").description("Add a task to the backlog").requiredO
16237
16350
  const { addBacklog: addBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
16238
16351
  await addBacklog2(options.chatroomId, { role: options.role, content });
16239
16352
  });
16240
- backlogCommand.command("complete").description("Mark a task as complete. Use --force for stuck in_progress/pending tasks.").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--task-id <taskId>", "Task ID to complete").option("-f, --force", "Force complete a stuck in_progress or pending task").action(async (options) => {
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) => {
16241
16354
  await maybeRequireAuth();
16242
16355
  const { completeBacklog: completeBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
16243
16356
  await completeBacklog2(options.chatroomId, options);
16244
16357
  });
16245
- backlogCommand.command("reopen").description("Reopen a completed backlog task, returning it to pending_user_review status.").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--task-id <taskId>", "Task ID to reopen").action(async (options) => {
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) => {
16246
16359
  await maybeRequireAuth();
16247
16360
  const { reopenBacklog: reopenBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
16248
16361
  await reopenBacklog2(options.chatroomId, options);
16249
16362
  });
16250
- backlogCommand.command("patch-task").description("Update task scoring fields (complexity, value, priority)").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--task-id <taskId>", "Task ID to patch").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) => {
16251
- await maybeRequireAuth();
16252
- const { patchBacklog: patchBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
16253
- await patchBacklog2(options.chatroomId, options);
16254
- });
16255
- 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) => {
16256
16364
  await maybeRequireAuth();
16257
16365
  const { scoreBacklog: scoreBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
16258
16366
  await scoreBacklog2(options.chatroomId, options);
16259
16367
  });
16260
- backlogCommand.command("mark-for-review").description("Mark a backlog task as ready for user review (backlog → pending_user_review)").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").requiredOption("--task-id <taskId>", "Task ID to mark for review").action(async (options) => {
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) => {
16261
16369
  await maybeRequireAuth();
16262
16370
  const { markForReviewBacklog: markForReviewBacklog2 } = await Promise.resolve().then(() => (init_backlog(), exports_backlog));
16263
16371
  await markForReviewBacklog2(options.chatroomId, options);
16264
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
+ });
16383
+ var skillCommand = program2.command("skill").description("Manage and activate chatroom skills");
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) => {
16385
+ await maybeRequireAuth();
16386
+ const { listSkills: listSkills2 } = await Promise.resolve().then(() => (init_skill(), exports_skill));
16387
+ await listSkills2(options.chatroomId, { role: options.role });
16388
+ });
16389
+ skillCommand.command("activate <skill-name>").description("Activate a named skill in the chatroom").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").action(async (skillName, options) => {
16390
+ await maybeRequireAuth();
16391
+ const { activateSkill: activateSkill2 } = await Promise.resolve().then(() => (init_skill(), exports_skill));
16392
+ await activateSkill2(options.chatroomId, skillName, { role: options.role });
16393
+ });
16265
16394
  var messagesCommand = program2.command("messages").description("List and filter chatroom messages");
16266
16395
  messagesCommand.command("list").description("List messages by sender role or since a specific message").requiredOption("--chatroom-id <id>", "Chatroom identifier").requiredOption("--role <role>", "Your role").option("--sender-role <senderRole>", "Filter by sender role (e.g., user, builder, reviewer)").option("--since-message-id <messageId>", "Get all messages since this message ID (inclusive)").option("--limit <n>", "Maximum number of messages to show").option("--full", "Show full message content without truncation").action(async (options) => {
16267
16396
  if (!options.senderRole && !options.sinceMessageId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatroom-cli",
3
- "version": "1.7.1",
3
+ "version": "1.9.0",
4
4
  "description": "CLI for multi-agent chatroom collaboration",
5
5
  "type": "module",
6
6
  "bin": {