Bold questions
This commit is contained in:
+11
-2
@@ -1,6 +1,6 @@
|
||||
import { get, type AgentSession, type ByreEvent, type InboxItem, type Project, type Task, type User } from "./api.js";
|
||||
|
||||
export type Topic = "me" | "projects" | "tasks" | "sessions" | "inbox" | "selection" | "transcript" | "connection";
|
||||
export type Topic = "me" | "projects" | "tasks" | "sessions" | "inbox" | "selection" | "transcript" | "stream" | "connection";
|
||||
|
||||
export const state = {
|
||||
me: undefined as User | undefined,
|
||||
@@ -127,6 +127,13 @@ function appendTranscript(events: ByreEvent[]): void {
|
||||
}
|
||||
|
||||
export function handleEvent(ev: ByreEvent): void {
|
||||
if (ev.seq === 0) {
|
||||
if (ev.task_id && ev.task_id === state.selectedTaskId && !liveDuringLoad) {
|
||||
notify("stream", ev);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (ev.task_id && ev.task_id === state.selectedTaskId) {
|
||||
if (liveDuringLoad) {
|
||||
liveDuringLoad.push(ev);
|
||||
@@ -145,13 +152,15 @@ export function handleEvent(ev: ByreEvent): void {
|
||||
void loadProjects();
|
||||
break;
|
||||
case "task.created":
|
||||
case "task.completed":
|
||||
case "task.merged":
|
||||
case "task.discarded":
|
||||
if (ev.project_id) {
|
||||
void loadTasks(ev.project_id);
|
||||
}
|
||||
break;
|
||||
case "session.created":
|
||||
case "session.state":
|
||||
case "session.model":
|
||||
if (ev.task_id) {
|
||||
void loadSessions(ev.task_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user