@vibetasks/cli 0.6.6 → 0.6.8

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.
@@ -497,9 +497,12 @@ var SessionManager = class {
497
497
  if (store.currentSession) {
498
498
  await this.endSession();
499
499
  }
500
+ const maxShortId = store.sessions.reduce((max, s) => Math.max(max, s.shortId || 0), 0);
501
+ const nextShortId = maxShortId + 1;
500
502
  const session = {
501
503
  id: this.generateSessionId(),
502
504
  fullId: randomUUID(),
505
+ shortId: nextShortId,
503
506
  startedAt: (/* @__PURE__ */ new Date()).toISOString(),
504
507
  project,
505
508
  actions: []
@@ -640,7 +643,7 @@ var addCommand = new Command2("add").description("Add a new task").argument("<ti
640
643
  } else {
641
644
  try {
642
645
  const detected = await detectProject(process.cwd());
643
- projectTag = detected.name;
646
+ projectTag = detected.fullName || detected.name;
644
647
  if (process.env.TASKFLOW_VERBOSE) {
645
648
  console.log(chalk3.gray(`Detected project: ${projectTag} (${detected.source})`));
646
649
  }
@@ -673,10 +676,16 @@ var addCommand = new Command2("add").description("Add a new task").argument("<ti
673
676
  done: false
674
677
  })) || [];
675
678
  let sessionId;
679
+ let sessionHistory = [];
676
680
  if (createdBy === "ai") {
677
681
  const sessionManager2 = getSessionManager();
678
682
  const session = await sessionManager2.getOrCreateSession(projectTag);
679
683
  sessionId = session.id;
684
+ sessionHistory = [{
685
+ session_id: session.id,
686
+ action: "created",
687
+ at: (/* @__PURE__ */ new Date()).toISOString()
688
+ }];
680
689
  }
681
690
  const task = await taskOps.createTask({
682
691
  title,
@@ -692,8 +701,10 @@ var addCommand = new Command2("add").description("Add a new task").argument("<ti
692
701
  // AI tasks start vibing
693
702
  energy_required: options.energy,
694
703
  subtasks_json: subtasksJson,
695
- session_id: sessionId
696
- // Link to AI session for ownership tracking
704
+ session_id: sessionId,
705
+ // Current AI session
706
+ session_history: sessionHistory
707
+ // Full history of sessions
697
708
  });
698
709
  if (options.tags && options.tags.length > 0) {
699
710
  const tagIds = [];
@@ -786,13 +797,14 @@ var ShortIdManager = class {
786
797
  this.storePath = join2(homedir2(), ".vibetasks", "short-ids.json");
787
798
  }
788
799
  /**
789
- * Save mappings from a list of task IDs
790
- * Short IDs are assigned 1, 2, 3... based on array order
800
+ * Save mappings from a list of tasks with their short_ids
801
+ * Uses the stable short_id from the database
791
802
  */
792
- async saveMappings(taskIds) {
793
- const mappings = taskIds.slice(0, this.maxIds).map((fullId, index) => ({
794
- shortId: index + 1,
795
- fullId,
803
+ async saveMappings(tasks) {
804
+ const mappings = tasks.filter((t) => t.short_id).slice(0, this.maxIds).map((task, index) => ({
805
+ shortId: task.short_id,
806
+ // Use actual short_id from database
807
+ fullId: task.id,
796
808
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
797
809
  }));
798
810
  const store = {
@@ -921,7 +933,10 @@ ${filterMessages[filter] || "No tasks found"}.
921
933
  const displayTasks = tasks.slice(0, limit);
922
934
  const shortIdManager = new ShortIdManager();
923
935
  if (options.shortIds) {
924
- await shortIdManager.saveMappings(displayTasks.map((t) => t.id));
936
+ await shortIdManager.saveMappings(displayTasks.map((t) => ({
937
+ id: t.id,
938
+ short_id: t.short_id
939
+ })));
925
940
  }
926
941
  const table = new Table({
927
942
  head: options.shortIds ? [
@@ -962,7 +977,7 @@ ${filterMessages[filter] || "No tasks found"}.
962
977
  };
963
978
  const priorityColor = priorityColors[task.priority || "none"];
964
979
  const statusColor = statusColors[task.status || "todo"];
965
- const shortId = chalk4.yellow.bold(`${index + 1}`);
980
+ const shortId = chalk4.yellow.bold(`${task.short_id || index + 1}`);
966
981
  const id = task.id.substring(0, 8);
967
982
  const status = statusColor(`${statusEmojis[task.status || "todo"]} ${task.status || "todo"}`);
968
983
  const title = task.status === "done" ? chalk4.strikethrough(task.title) : task.title;
@@ -1036,12 +1051,29 @@ No task found with ID starting with: ${id}
1036
1051
  }
1037
1052
  taskId = matchingTask.id;
1038
1053
  }
1054
+ const sessionManager2 = getSessionManager();
1055
+ const currentSession = await sessionManager2.getOrCreateSession();
1056
+ const existingTask = await taskOps.getTask(taskId);
1057
+ const existingHistory = existingTask?.session_history || [];
1058
+ const updatedHistory = [
1059
+ ...existingHistory,
1060
+ {
1061
+ session_id: currentSession.id,
1062
+ action: "completed",
1063
+ at: (/* @__PURE__ */ new Date()).toISOString(),
1064
+ notes: options.notes || options.context
1065
+ }
1066
+ ];
1039
1067
  const contextNotes = options.notes || options.context;
1068
+ const updatePayload = {
1069
+ session_id: currentSession.id,
1070
+ session_history: updatedHistory
1071
+ };
1040
1072
  if (contextNotes) {
1041
- await taskOps.updateTask(taskId, { context_notes: contextNotes });
1073
+ updatePayload.context_notes = contextNotes;
1042
1074
  }
1075
+ await taskOps.updateTask(taskId, updatePayload);
1043
1076
  const task = await taskOps.completeTask(taskId);
1044
- const sessionManager2 = getSessionManager();
1045
1077
  await sessionManager2.logAction({
1046
1078
  type: "task_completed",
1047
1079
  description: `Completed: "${task.title}"`,
@@ -1111,15 +1143,38 @@ var vibingCommand = new Command5("vibing").alias("start").alias("v").description
1111
1143
  taskId = selectedTask;
1112
1144
  }
1113
1145
  spinner.start("Starting task...");
1146
+ const task = allTasks.find((t) => t.id === taskId);
1147
+ const sessionManager2 = getSessionManager();
1148
+ const currentSession = await sessionManager2.getOrCreateSession();
1149
+ const existingSessionHistory = task?.session_history || [];
1150
+ const lastSession = existingSessionHistory[existingSessionHistory.length - 1];
1151
+ let updatedHistory = existingSessionHistory;
1152
+ if (!lastSession || lastSession.session_id !== currentSession.id) {
1153
+ updatedHistory = [
1154
+ ...existingSessionHistory,
1155
+ {
1156
+ session_id: currentSession.id,
1157
+ action: "continued",
1158
+ at: (/* @__PURE__ */ new Date()).toISOString()
1159
+ }
1160
+ ];
1161
+ }
1114
1162
  await taskOps.updateTask(taskId, {
1115
1163
  status: "vibing",
1116
- completed: false
1164
+ completed: false,
1165
+ session_id: currentSession.id,
1166
+ // Update to current session
1167
+ session_history: updatedHistory
1117
1168
  });
1118
- const task = allTasks.find((t) => t.id === taskId);
1119
1169
  spinner.succeed(chalk6.green("Now vibing on:"));
1120
1170
  console.log(chalk6.white(`
1121
1171
  ${task?.title || taskId}
1122
1172
  `));
1173
+ if (lastSession && lastSession.session_id !== currentSession.id) {
1174
+ console.log(chalk6.cyan(` \u{1F4CB} Continuing from session: ${lastSession.session_id}`));
1175
+ console.log(chalk6.gray(` This task has been worked on by ${existingSessionHistory.length} session(s)
1176
+ `));
1177
+ }
1123
1178
  console.log(chalk6.gray(" Tips:"));
1124
1179
  console.log(chalk6.gray(" \u2022 Update context notes as you work"));
1125
1180
  console.log(chalk6.gray(" \u2022 Run `vibetasks done " + taskId.slice(0, 8) + "` when finished"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibetasks/cli",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "VibeTasks CLI - Lightning-fast task management from your terminal. Works with Claude Code, Cursor, and all AI coding tools.",
5
5
  "author": "Vyas",
6
6
  "license": "MIT",