export type Surface = 'cli' | 'repl' | 'daemon' | 'telegram' | 'subagent' | 'web' | 'unknown'; export type PhaseRole = 'read-only' | 'read-write'; export type SubagentStatusLiteValue = 'idle' | 'running' | 'succeeded' | 'failed' | 'cancelled'; export type BgJobStatus = 'running' | 'completed' | 'failed' | 'cancelled'; export interface RuntimeSelf { sessionId: string | null; surface: Surface; parentSessionId: string | null; depth: number | null; maxDepth: number | null; phaseRole: PhaseRole | null; cwd: string; model: { provider: string; name: string; }; permissionMode: 'elevated' | 'default'; } export interface McpServerSummary { name: string; toolCount: number; } export interface McpFailedServer { name: string; reason: string; } export interface RuntimeTools { enabled: string[]; mcpServers: McpServerSummary[]; failedServers: McpFailedServer[]; } export interface SubagentStatusLite { id: string; status: SubagentStatusLiteValue; } export interface BgJobLite { jobId: string; status: BgJobStatus; startedAt: string; label: string | null; } export interface RuntimeSubagents { active: SubagentStatusLite[]; backgroundJobs: BgJobLite[]; } export interface RuntimeWorkspace { branch: string | null; headSha: string | null; dirty: boolean | null; dirtyCount: number | null; remoteUrl: string | null; } export interface RuntimeSnapshot { self: RuntimeSelf; tools: RuntimeTools; subagents: RuntimeSubagents; workspace: RuntimeWorkspace; } export type RuntimeView = 'self' | 'tools' | 'subagents' | 'workspace' | 'all'; export interface RuntimeStateSource { getSelf(): RuntimeSelf; getTools(): RuntimeTools; getSubagents(): RuntimeSubagents; getWorkspace(): RuntimeWorkspace; }