agentacta 1.4.0 → 2026.3.5
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/index.js +8 -5
- package/package.json +1 -1
- package/public/app.js +550 -49
- package/public/index.html +14 -6
- package/public/style.css +383 -7
package/index.js
CHANGED
|
@@ -453,18 +453,21 @@ const server = http.createServer((req, res) => {
|
|
|
453
453
|
res.write(': connected\n\n');
|
|
454
454
|
|
|
455
455
|
let lastTs = query.after || new Date().toISOString();
|
|
456
|
+
let lastId = query.afterId || '';
|
|
456
457
|
|
|
457
458
|
const onUpdate = () => {
|
|
458
459
|
try {
|
|
459
460
|
const rows = db.prepare(
|
|
460
461
|
`SELECT e.*, s.summary as session_summary FROM events e
|
|
461
462
|
JOIN sessions s ON s.id = e.session_id
|
|
462
|
-
WHERE e.timestamp > ?
|
|
463
|
-
ORDER BY e.timestamp ASC`
|
|
464
|
-
).all(lastTs);
|
|
463
|
+
WHERE (e.timestamp > ?) OR (e.timestamp = ? AND e.id > ?)
|
|
464
|
+
ORDER BY e.timestamp ASC, e.id ASC`
|
|
465
|
+
).all(lastTs, lastTs, lastId);
|
|
465
466
|
if (rows.length) {
|
|
466
|
-
|
|
467
|
-
|
|
467
|
+
const tail = rows[rows.length - 1];
|
|
468
|
+
lastTs = tail.timestamp || lastTs;
|
|
469
|
+
lastId = tail.id || lastId;
|
|
470
|
+
res.write(`id: ${lastTs}:${lastId}\ndata: ${JSON.stringify(rows)}\n\n`);
|
|
468
471
|
}
|
|
469
472
|
} catch (err) {
|
|
470
473
|
console.error('Timeline SSE error:', err.message);
|