Add a per-user lead agent and make the right pane task-focused

This commit is contained in:
Ian Gulliver
2026-10-15 09:40:30 -07:00
parent d212590cdc
commit bdd1ae48f0
68 changed files with 3332 additions and 1364 deletions
+6 -3
View File
@@ -52,7 +52,7 @@ export const put = (path, opts) => request("put", path, opts);
export const del = (path, opts) => request("delete", path, opts);
const staleAfterMs = 40_000;
const retryAfterMs = 2_000;
export function subscribe(after, taskId, onEvent, onState) {
export function subscribe(after, filter, onEvent, onState) {
let last = after;
let heard = Date.now();
let source;
@@ -62,8 +62,11 @@ export function subscribe(after, taskId, onEvent, onState) {
source?.close();
heard = Date.now();
const query = new URLSearchParams({ after: String(last) });
if (taskId) {
query.set("task_id", taskId);
if (filter.task_id) {
query.set("task_id", filter.task_id);
}
if (filter.lead) {
query.set("lead", "true");
}
const s = new EventSource(`/api/events?${query}`);
source = s;