import { Database } from "../db.js"; export type BackgroundStatus = "running" | "completed" | "failed" | "timeout" | "delivered"; export interface BackgroundTask { id: string; sessionId: string; parentSessionId: string; command: string; status: BackgroundStatus; progress: number; progressMessage?: string; result?: unknown; error?: string; createdAt: number; startedAt?: number; completedAt?: number; deliveredAt?: number; } export declare function initBackgroundTasks(): Promise; export declare function startBackgroundTask(parentSessionId: string, command: string, onProgress?: (task: BackgroundTask) => void): Promise; export declare function updateTaskProgress(taskId: string, progress: number, message?: string): Promise; export declare function completeTask(taskId: string, result: unknown): Promise; export declare function failTask(taskId: string, error: string): Promise; export declare function markTaskDelivered(taskId: string): Promise; export declare function getTask(taskId: string): Promise; export declare function getPendingResultsForSession(parentSessionId: string): Promise; export declare function listTasks(status?: BackgroundStatus): Promise; export declare function cancelTask(taskId: string): Promise; export declare function cleanupOldTasks(maxAgeMs?: number): Promise;