import type { AgentStatusState, AgentType, AgentWorkingMode } from './agent-status-types' import type { BaseRefSearchResult, Repo } from './repo-types' import type { CreateWorktreeResult, RemoveWorktreeResult } from './worktree/create-types' import type { WorkspaceLineage, WorktreeLineage, WorktreeLineageWarning } from './worktree/lineage-types' import type { RuntimeListingHostScope } from './runtime-listing-host-scope' import type { GitWorktreeInfo, Worktree } from './worktree/types' export type RuntimeWorktreeAgentRow = { paneKey: string parentPaneKey: string | null state: AgentStatusState workingMode?: AgentWorkingMode agentType: AgentType | null prompt: string taskTitle: string | null displayName: string | null lastAssistantMessage: string | null toolName: string | null toolInput: string | null interrupted: boolean stateStartedAt: number updatedAt: number restoredUnconfirmed?: boolean /** The structured session host still runs this row's provider child, so it is fresh regardless * of age. Optional on the wire: old hosts never send it. */ structuredHostOwned?: true } export type RuntimeWorktreePsSummary = { workspaceKind?: 'git' | 'folder-workspace' worktreeId: string repoId: string hostId?: Worktree['hostId'] terminalPlatform?: NodeJS.Platform repo: string path: string branch: string isArchived: boolean isMainWorktree: boolean hasHostSidebarActivity: boolean worktreeInstanceId?: string lineageWorktreeInstanceId?: string parentWorktreeInstanceId?: string parentWorktreeId: string | null childWorktreeIds: string[] displayName: string workspaceStatus: string sortOrder: number manualOrder?: number lastActivityAt?: number createdAt?: number creatorProvenance?: Worktree['creatorProvenance'] linkedIssue: number | null linkedPR: { number: number; state: string } | null linkedLinearIssue: string | null linkedGitLabMR: number | null linkedGitLabIssue: number | null comment: string isPinned: boolean isActive: boolean unread: boolean liveTerminalCount: number hasAttachedPty: boolean lastOutputAt: number | null preview: string status: RuntimeWorktreeStatus /** Optional discriminator for a working workspace; older clients fall back to ordinary working. */ workingMode?: AgentWorkingMode agents: RuntimeWorktreeAgentRow[] } export type RuntimeGitLocalBranches = { current: string | null branches: string[] } export type RuntimeSpeechModelSummary = { id: string label: string provider: 'local' | 'openai' sizeBytes: number | null recommended: boolean status: 'ready' | 'not-downloaded' | 'downloading' | 'extracting' | 'error' progress: number | null } export type RuntimeSpeechSetupState = { enabled: boolean selectedModelId: string dictationMode: 'toggle' | 'hold' models: RuntimeSpeechModelSummary[] } export type RuntimeGitCheckoutResult = { ok: true branch: string } export type RuntimeWorktreeStatus = 'active' | 'working' | 'permission' | 'done' | 'inactive' export type RuntimeWorktreeRecord = Worktree & { parentWorktreeId: string | null childWorktreeIds: string[] lineage: WorktreeLineage | null workspaceLineage?: WorkspaceLineage | null git: GitWorktreeInfo } export type RuntimeWorktreeCreateResult = { worktree: RuntimeWorktreeRecord lineage: WorktreeLineage | null workspaceLineage?: WorkspaceLineage | null warnings: WorktreeLineageWarning[] warning?: string startupTerminal?: CreateWorktreeResult['startupTerminal'] agentTerminalHandle?: string } export type RuntimeWorktreeRemoveResult = RemoveWorktreeResult & { removed: boolean warning?: string } export type RuntimeWorktreePsResult = { worktrees: RuntimeWorktreePsSummary[] totalCount: number truncated: boolean /** Absent from hosts that predate the field; treat that scope as unverifiable. */ hostScope?: RuntimeListingHostScope } export type RuntimeWorktreePsSnapshotResult = RuntimeWorktreePsResult & { snapshotId: string } export type RuntimeWorktreePsUnchangedResult = { unchanged: true snapshotId: string } export type RuntimeWorktreePsConditionalResult = | RuntimeWorktreePsSnapshotResult | RuntimeWorktreePsUnchangedResult export type RuntimeRepoList = { repos: Repo[] } export type RuntimeRepoSearchRefs = { refs: string[] refDetails?: BaseRefSearchResult[] truncated: boolean } export type RuntimeWorktreeListResult = { worktrees: RuntimeWorktreeRecord[] totalCount: number truncated: boolean /** Absent from hosts that predate the field; treat that scope as unverifiable. */ hostScope?: RuntimeListingHostScope }