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
+8 -3
View File
@@ -18,6 +18,8 @@ export type Zombie = Schemas["Zombie"];
export type ProtocolErrors = Schemas["ProtocolErrors"];
export type Snapshot = Schemas["Snapshot"];
export type Participant = Schemas["Participant"];
export type Focus = Schemas["Focus"];
export type TaskTab = Schemas["TaskTab"];
type Method = "get" | "post" | "put" | "delete";
@@ -107,7 +109,7 @@ const retryAfterMs = 2_000;
export function subscribe(
after: number,
taskId: string | undefined,
filter: { task_id?: string; lead?: boolean },
onEvent: (ev: ByreEvent) => void,
onState: (connected: boolean) => void,
): () => void {
@@ -121,8 +123,11 @@ export function subscribe(
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;