@masslessai/push-todo 3.6.8 → 3.7.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/lib/daemon.js +36 -5
- package/lib/utils/format.js +4 -0
- package/package.json +1 -1
package/lib/daemon.js
CHANGED
|
@@ -338,6 +338,24 @@ async function updateTaskStatus(displayNumber, status, extra = {}) {
|
|
|
338
338
|
payload.machineName = machineName;
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
+
// Auto-generate execution event for timeline
|
|
342
|
+
if (!payload.event) {
|
|
343
|
+
const eventType = status === 'running' ? 'started'
|
|
344
|
+
: status === 'session_finished' ? 'session_finished'
|
|
345
|
+
: status === 'failed' ? 'failed'
|
|
346
|
+
: null;
|
|
347
|
+
if (eventType) {
|
|
348
|
+
payload.event = {
|
|
349
|
+
type: eventType,
|
|
350
|
+
timestamp: new Date().toISOString(),
|
|
351
|
+
machineName: machineName || undefined,
|
|
352
|
+
};
|
|
353
|
+
if (extra.summary) payload.event.summary = extra.summary;
|
|
354
|
+
if (extra.error) payload.event.summary = extra.error;
|
|
355
|
+
if (extra.sessionId) payload.event.sessionId = extra.sessionId;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
341
359
|
const response = await apiRequest('update-task-execution', {
|
|
342
360
|
method: 'PATCH',
|
|
343
361
|
body: JSON.stringify(payload)
|
|
@@ -785,8 +803,15 @@ IMPORTANT:
|
|
|
785
803
|
2. ALWAYS commit your changes before finishing. Use a descriptive commit message summarizing what you did. This is critical — uncommitted changes will be lost when the worktree is cleaned up.
|
|
786
804
|
3. When you're done, the SessionEnd hook will automatically report completion to Supabase.`;
|
|
787
805
|
|
|
788
|
-
// Update status to running
|
|
789
|
-
updateTaskStatus(displayNumber, 'running'
|
|
806
|
+
// Update status to running (auto-generates 'started' event)
|
|
807
|
+
updateTaskStatus(displayNumber, 'running', {
|
|
808
|
+
event: {
|
|
809
|
+
type: 'started',
|
|
810
|
+
timestamp: new Date().toISOString(),
|
|
811
|
+
machineName: getMachineName() || undefined,
|
|
812
|
+
summary: summary.slice(0, 100),
|
|
813
|
+
}
|
|
814
|
+
});
|
|
790
815
|
|
|
791
816
|
// Build Claude command
|
|
792
817
|
const allowedTools = [
|
|
@@ -915,7 +940,7 @@ function handleTaskCompletion(displayNumber, exitCode) {
|
|
|
915
940
|
executionSummary += ` PR: ${prUrl}`;
|
|
916
941
|
}
|
|
917
942
|
|
|
918
|
-
updateTaskStatus(displayNumber, '
|
|
943
|
+
updateTaskStatus(displayNumber, 'session_finished', {
|
|
919
944
|
duration,
|
|
920
945
|
sessionId,
|
|
921
946
|
summary: executionSummary
|
|
@@ -935,7 +960,7 @@ function handleTaskCompletion(displayNumber, exitCode) {
|
|
|
935
960
|
summary,
|
|
936
961
|
completedAt: new Date().toISOString(),
|
|
937
962
|
duration,
|
|
938
|
-
status: '
|
|
963
|
+
status: 'session_finished',
|
|
939
964
|
prUrl,
|
|
940
965
|
sessionId
|
|
941
966
|
});
|
|
@@ -1224,7 +1249,13 @@ function cleanup() {
|
|
|
1224
1249
|
// Mark as failed so the task doesn't stay as 'running' forever
|
|
1225
1250
|
const duration = Math.floor((Date.now() - taskInfo.startTime) / 1000);
|
|
1226
1251
|
updateTaskStatus(displayNumber, 'failed', {
|
|
1227
|
-
error: `Daemon shutdown after ${duration}s
|
|
1252
|
+
error: `Daemon shutdown after ${duration}s`,
|
|
1253
|
+
event: {
|
|
1254
|
+
type: 'daemon_shutdown',
|
|
1255
|
+
timestamp: new Date().toISOString(),
|
|
1256
|
+
machineName: getMachineName() || undefined,
|
|
1257
|
+
summary: `Daemon restarted after ${duration}s`,
|
|
1258
|
+
}
|
|
1228
1259
|
});
|
|
1229
1260
|
const projectPath = taskProjectPaths.get(displayNumber);
|
|
1230
1261
|
cleanupWorktree(displayNumber, projectPath);
|
package/lib/utils/format.js
CHANGED
|
@@ -58,6 +58,8 @@ export function formatTaskForDisplay(task) {
|
|
|
58
58
|
statusPrefix = '🔄 '; // Running on Mac
|
|
59
59
|
} else if (execStatus === 'queued') {
|
|
60
60
|
statusPrefix = '⚡ '; // Queued for Mac
|
|
61
|
+
} else if (execStatus === 'session_finished') {
|
|
62
|
+
statusPrefix = '🏁 '; // Session finished on Mac
|
|
61
63
|
} else if (execStatus === 'failed') {
|
|
62
64
|
statusPrefix = '❌ '; // Failed
|
|
63
65
|
} else if (execStatus === 'needs_clarification') {
|
|
@@ -223,6 +225,8 @@ export function formatTaskTable(tasks) {
|
|
|
223
225
|
status = '🔄 Running';
|
|
224
226
|
} else if (taskExecStatus === 'queued') {
|
|
225
227
|
status = '⚡ Queued';
|
|
228
|
+
} else if (taskExecStatus === 'session_finished') {
|
|
229
|
+
status = '🏁 Finished';
|
|
226
230
|
} else if (taskExecStatus === 'failed') {
|
|
227
231
|
status = '❌ Failed';
|
|
228
232
|
} else if (task.isBacklog || task.is_backlog) {
|