import type { IssueInfo, PRInfo } from '../../shared/github/pull-request-types' import type { WorkspaceSessionPatch, WorkspaceSessionState } from '../../shared/workspace-session-state-types' import type { ExecutionHostId } from '../../shared/execution-host' import type { TerminalSurfaceCloseTarget } from '../../shared/terminal-surface-close-target' export type WorkspaceSessionApi = { session: { // Omitted hostId selects the local persistence partition. get: (hostId?: ExecutionHostId) => Promise /** Read persisted partitions at boot; the host catalog may omit some. */ listHostIds: () => Promise set: (args: WorkspaceSessionState, hostId?: ExecutionHostId) => Promise patch: (args: WorkspaceSessionPatch, hostId?: ExecutionHostId) => Promise /** Commits a terminal tab or split-pane close into main's membership. */ closeTerminalSurface: (args: { worktreeId: string target: TerminalSurfaceCloseTarget reason?: 'user' | 'cleanup' }) => Promise flush: () => Promise readTerminalScrollback: (args: { ref: string }) => string | null /** Stat-only: whether this machine's snapshot store holds `ref`. */ hasTerminalScrollback: (args: { ref: string }) => boolean } cache: { getGitHub: () => Promise<{ pr: Record issue: Record }> setGitHub: (args: { cache: { pr: Record issue: Record } }) => Promise } }