import type { AgentStatusEntry } from './agent-status-types' import type { BrowserCertificateFailure, BrowserLoadError } from './browser-workspace-types' import type { RuntimeBrowserPlacement } from './runtime-browser-placement' import type { TerminalColorOverrides } from './terminal-color-overrides' import type { TerminalLayoutSnapshot } from './terminal-tab-types' import type { TuiAgent } from './tui-agent' export type RuntimeMobileSessionTerminalTab = { type: 'terminal' id: string title: string quickCommandLabel?: string | null parentTabId: string leafId: string ptyId?: string | null terminalTheme?: RuntimeMobileTerminalTheme agentStatus?: AgentStatusEntry | null /** Event-only lead-turn end time for paired clients; never persisted in AgentStatusEntry. */ turnCompletedAt?: number launchAgent?: TuiAgent startupCwd?: string parentLayout?: TerminalLayoutSnapshot color?: string | null isPinned?: boolean viewMode?: 'terminal' | 'chat' launchDraft?: string launchDraftCreatedAt?: number isActive: boolean } export type RuntimeMobileTerminalTheme = { mode: 'dark' | 'light' theme: TerminalColorOverrides } export type RuntimeMobileSessionMarkdownTab = { type: 'markdown' id: string title: string filePath: string relativePath: string language: 'markdown' mode: 'edit' | 'markdown-preview' isDirty: boolean isActive: boolean sourceFileId: string sourceFilePath: string sourceRelativePath: string documentVersion: string color?: string | null isPinned?: boolean } export type RuntimeMobileSessionFileTab = { type: 'file' id: string title: string filePath: string relativePath: string language: string mode?: 'edit' | 'diff' diffSource?: 'staged' | 'unstaged' isDirty: boolean color?: string | null isPinned?: boolean isActive: boolean } export type RuntimeMobileSessionBrowserTab = { type: 'browser' id: string title: string browserWorkspaceId: string browserPageId: string | null browserProfileId?: string executionHostKey?: string placement?: RuntimeBrowserPlacement url: string loading: boolean canGoBack: boolean canGoForward: boolean loadError?: BrowserLoadError | null certificateFailure?: BrowserCertificateFailure | null color?: string | null isPinned?: boolean isActive: boolean } export type RuntimeMobileSessionAgentTab = { type: 'agent-session' id: string title: string sessionId: string agent: 'codex' color?: string | null isPinned?: boolean isActive: boolean } export type RuntimeMobileSessionSnapshotTab = | RuntimeMobileSessionTerminalTab | RuntimeMobileSessionMarkdownTab | RuntimeMobileSessionFileTab | RuntimeMobileSessionBrowserTab | RuntimeMobileSessionAgentTab export type RuntimeMobileSessionTerminalClientTab = | (RuntimeMobileSessionTerminalTab & { status: 'pending-handle'; terminal: null }) | (RuntimeMobileSessionTerminalTab & { status: 'ready'; terminal: string }) export type RuntimeMobileSessionClientTab = | RuntimeMobileSessionTerminalClientTab | RuntimeMobileSessionMarkdownTab | RuntimeMobileSessionFileTab | RuntimeMobileSessionBrowserTab | RuntimeMobileSessionAgentTab