feat: decode activity SSE events and expose tracker total

This commit is contained in:
c4ch3c4d3
2026-08-14 12:53:40 -06:00
parent ce372568e4
commit e961ed35aa
4 changed files with 30 additions and 0 deletions
+5
View File
@@ -15,6 +15,7 @@ export interface ModelState {
export type FeedEvent =
| { type: "inflight"; operation: "snapshot" | "add"; requests: InflightRequest[] }
| { type: "inflight"; operation: "remove"; id: string }
| { type: "activity"; id: number }
| { type: "modelStatus"; models: ModelState[] };
export type ModelRuntimeState = "stopped" | "loading" | "ready";
@@ -44,6 +45,10 @@ export class InflightTracker {
return n;
}
total(): number {
return this.requests.size;
}
state(modelId: string): ModelRuntimeState | undefined {
return this.states.get(modelId);
}