export interface Task { id: string; message: string; previousResponseId: string | null; workingDirectory: string | null; status: "pending" | "running" | "completed" | "failed" | "cancelled"; result: any | null; error: string | null; createdAt: Date; updatedAt: Date; abortController: AbortController | null; } /** * Task Service for handling async agent operations * Updated to work with SDK's AbortController instead of child processes */ export declare class TaskService { private activeTasks; private completedTasks; private cleanupInterval; private parentCheckInterval; private server; constructor(); /** * Set the MCP server instance for sending notifications */ setServer(server: any): void; /** * Create a new task */ createTask(message: string, previousResponseId?: string | null, workingDirectory?: string | null): string; /** * Get task by ID */ getTask(taskId: string): Task | undefined; /** * Get task by ID with validation */ getTaskOrThrow(taskId: string): Task; /** * Update task with new properties */ updateTask(taskId: string, updates: Partial): void; /** * Cancel a running task using AbortController */ cancelTask(taskId: string): boolean; /** * Get task statistics */ getStats(): { active: number; completed: number; total: number; }; /** * Clean up old completed tasks */ private cleanup; /** * Send task started notification */ sendTaskStartedNotification(taskId: string, message: string, workingDirectory: string | null): void; /** * Send system notification for task start */ private sendSystemNotificationForStart; /** * Send MCP notification to client */ private sendMcpNotification; /** * Send system notification when task completes */ private sendNotification; /** * Check if parent process is still alive */ private checkParentProcess; /** * Shutdown due to parent process exit - notify about each task */ private shutdownDueToParentExit; /** * Destroy service and cancel all tasks */ destroy(): void; } //# sourceMappingURL=TaskService.d.ts.map