feat: decode activity SSE events and expose tracker total
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user