taskchef 7.22.1 → 7.22.2
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/package.json
CHANGED
package/src/dashboard/actions.js
CHANGED
|
@@ -20,7 +20,7 @@ export async function archiveTaskFromControl(event, task, {
|
|
|
20
20
|
confirmAction = globalThis.confirm,
|
|
21
21
|
fetchAction = globalThis.fetch,
|
|
22
22
|
onArchived = () => {},
|
|
23
|
-
|
|
23
|
+
showUpdate,
|
|
24
24
|
} = {}) {
|
|
25
25
|
event.stopPropagation();
|
|
26
26
|
const accepted = confirmAction(
|
|
@@ -39,15 +39,15 @@ export async function archiveTaskFromControl(event, task, {
|
|
|
39
39
|
);
|
|
40
40
|
const result = await response.json();
|
|
41
41
|
if (!response.ok) {
|
|
42
|
-
|
|
42
|
+
showUpdate(result.message ?? "Codex could not archive this chat.", { failed: true });
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
onArchived(task.threadId);
|
|
46
46
|
archived = true;
|
|
47
|
-
|
|
47
|
+
showUpdate(result.message ?? "Archived the Codex chat. TaskChef history remains available.");
|
|
48
48
|
return true;
|
|
49
49
|
} catch {
|
|
50
|
-
|
|
50
|
+
showUpdate("Codex chat archiving is temporarily unavailable. Try again.", { failed: true });
|
|
51
51
|
return false;
|
|
52
52
|
} finally {
|
|
53
53
|
if (!archived) control.disabled = false;
|
package/src/dashboard/app.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
MAX_NOTIFICATIONS,
|
|
2
3
|
canArchiveTask,
|
|
3
4
|
canManuallyTransitionTask,
|
|
4
5
|
clearNotifications,
|
|
@@ -55,6 +56,7 @@ let dateRefreshTimer = null;
|
|
|
55
56
|
let detailRequestGeneration = 0;
|
|
56
57
|
let copyTaskIdGeneration = 0;
|
|
57
58
|
let copyTaskIdTimer = null;
|
|
59
|
+
let archiveUpdateSerial = 0;
|
|
58
60
|
const relativeTimes = new RelativeTimeController();
|
|
59
61
|
|
|
60
62
|
const elements = {
|
|
@@ -362,6 +364,22 @@ function renderNotifications(additions = []) {
|
|
|
362
364
|
}
|
|
363
365
|
}
|
|
364
366
|
|
|
367
|
+
export function showArchiveUpdate(task, message, { failed = false } = {}) {
|
|
368
|
+
const notification = Object.freeze({
|
|
369
|
+
id: `archive:${task.id}:${Date.now()}:${archiveUpdateSerial += 1}`,
|
|
370
|
+
taskId: task.id,
|
|
371
|
+
title: task.title,
|
|
372
|
+
status: task.status,
|
|
373
|
+
event: failed ? "archive_failed" : "archive_succeeded",
|
|
374
|
+
turnRef: null,
|
|
375
|
+
turnId: null,
|
|
376
|
+
timestamp: new Date().toISOString(),
|
|
377
|
+
summary: message,
|
|
378
|
+
});
|
|
379
|
+
state.notifications = [notification, ...state.notifications].slice(0, MAX_NOTIFICATIONS);
|
|
380
|
+
renderNotifications([notification]);
|
|
381
|
+
}
|
|
382
|
+
|
|
365
383
|
function detailRow(term, value) {
|
|
366
384
|
const dt = document.createElement("dt");
|
|
367
385
|
dt.textContent = term;
|
|
@@ -597,7 +615,6 @@ async function submitManualTransition(targetStatus, event) {
|
|
|
597
615
|
if (current === result.task) replaceCurrentTask(result.task);
|
|
598
616
|
renderDialog(current);
|
|
599
617
|
render();
|
|
600
|
-
showMessage(result.task.summary);
|
|
601
618
|
elements.dialogTitle.focus?.();
|
|
602
619
|
return;
|
|
603
620
|
}
|
|
@@ -959,7 +976,7 @@ elements.archiveTask.addEventListener("click", async (event) => {
|
|
|
959
976
|
try {
|
|
960
977
|
await archiveTaskFromControl(event, task, {
|
|
961
978
|
onArchived: (threadId) => state.archivedThreadIds.add(threadId),
|
|
962
|
-
|
|
979
|
+
showUpdate: (message, options) => showArchiveUpdate(task, message, options),
|
|
963
980
|
});
|
|
964
981
|
} finally {
|
|
965
982
|
state.archivePendingThreadIds.delete(task.threadId);
|
package/src/dashboard/state.js
CHANGED
|
@@ -30,6 +30,8 @@ const NOTIFICATION_TITLES = new Map([
|
|
|
30
30
|
["failed", "Task failed"],
|
|
31
31
|
["manual_completed", "Task manually completed"],
|
|
32
32
|
["manual_failed", "Task manually failed"],
|
|
33
|
+
["archive_succeeded", "Chat archived"],
|
|
34
|
+
["archive_failed", "Chat archive failed"],
|
|
33
35
|
["unresolved", "Task updated"],
|
|
34
36
|
]);
|
|
35
37
|
|