push architecture slice 3: ServerEventsProvider + chat view attaches to server-initiated turns via the events channel (handoff/jobs-wake/other-tab discovery — the poll lattice retires)

This commit is contained in:
amosblomqvist
2026-10-02 17:15:17 +03:00
parent ef6d15ed93
commit 1345599ff7
6 changed files with 359 additions and 118 deletions
+11
View File
@@ -42,6 +42,17 @@ export interface ServerEvents {
export type ServerEventType = keyof ServerEvents;
/** The vocabulary's runtime names — the client wires one listener per
* name (types are erased; this list is the single source of truth for
* what the SSE channel can carry). */
export const SERVER_EVENT_TYPES = [
"turn-started",
"turn-settled",
"jobs-changed",
"activity-changed",
"chats-changed",
] as const satisfies readonly ServerEventType[];
/** One notification: the type discriminates the payload. */
export type ServerEvent<K extends ServerEventType = ServerEventType> = {
type: K;
+4
View File
@@ -20,6 +20,10 @@ export * from "./ports.ts";
export * from "./render-settings.ts";
export * from "./question-core.ts";
// The event bus (push architecture, 2026-10-02): vocabulary + emit/subscribe
// for every layer; the browser shell consumes the types + the runtime names
// through this barrel (shell law: pure core via @/src/core only).
export * from "./events.ts";
// clusters.ts (Louvain) is deliberately NOT re-exported: nothing in the
// shell runs community detection — the snapshot carries the partition
// from the server. Keeping it out keeps the heavy clustering deps out of the