import { HttpClient } from "./http"; import type { CreateSessionRequest, LiveControlRequest, ResetSessionRequest, SourceMonitorReport, SessionState, StepSessionRequest, StepSessionResponse, } from "./types"; export class SessionClient { constructor(private readonly http: HttpClient) {} async health(): Promise<{ status: string }> { return this.http.get<{ status: string }>("/healthz"); } async createSession(request: CreateSessionRequest = {}): Promise { return this.http.post("/sessions", request); } async getSession(sessionId: string): Promise { return this.http.get(`/sessions/${sessionId}`); } async resetSession(sessionId: string, request: ResetSessionRequest = {}): Promise { return this.http.post(`/sessions/${sessionId}/reset`, request); } async refreshSources(sessionId: string): Promise { return this.http.post(`/sessions/${sessionId}/sources/refresh`, {}); } async getSourceMonitor(sessionId: string): Promise { return this.http.get(`/sessions/${sessionId}/sources/monitor`); } async setLiveMode(sessionId: string, request: LiveControlRequest): Promise { return this.http.post(`/sessions/${sessionId}/live`, request); } async stepSession(sessionId: string, request: StepSessionRequest): Promise { return this.http.post(`/sessions/${sessionId}/step`, request); } }