MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / resumeSession

Function resumeSession

ui/src/components/workspace/api.ts:372–393  ·  view source on GitHub ↗
(
  wsId: string,
  sessionId: string,
  terminalTheme?: TerminalThemeVariant,
)

Source from the content-addressed store, hash-verified

370 * fresh PTY w/ scrollback restore in S5).
371 */
372export async function resumeSession(
373 wsId: string,
374 sessionId: string,
375 terminalTheme?: TerminalThemeVariant,
376): Promise<SpawnedSession | null> {
377 const body: Record<string, unknown> = {};
378 if (terminalTheme !== undefined) body['terminalTheme'] = terminalTheme;
379 const res = await fetch(
380 `/api/workspaces/${encodeURIComponent(wsId)}/sessions/${encodeURIComponent(sessionId)}/resume`,
381 {
382 method: 'POST',
383 ...(Object.keys(body).length > 0
384 ? {
385 headers: { 'content-type': 'application/json' },
386 body: JSON.stringify(body),
387 }
388 : {}),
389 },
390 );
391 if (!res.ok) return null;
392 return (await res.json()) as SpawnedSession;
393}
394
395/** Permanently remove a session record (kills PTY first if running). */
396export async function deleteSession(wsId: string, sessionId: string): Promise<boolean> {

Callers

nothing calls this directly

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected