/** * Task cancellation operations. * Ported from lib/tasks/cancel-ops.sh * * @epic T4454 * @task T4529 */ import type { Task } from '@cleocode/contracts'; /** Result of a cancel operation. */ export interface CancelResult { success: boolean; taskId: string; reason?: string; cancelledAt?: string; /** * True when the task was already cancelled before this call. The cancel * is treated as a no-op success — see T9838 idempotency contract. * * @defaultValue undefined */ alreadyCancelled?: boolean; error?: { code: string; message: string; }; } /** * Check if a task can be cancelled. */ export declare function canCancel(task: Task): { allowed: boolean; reason?: string; }; /** * Cancel a task in the tasks array (returns updated array). * Does NOT handle children - use deletion-strategy for that. */ export declare function cancelTask(taskId: string, tasks: Task[], reason?: string, projectRoot?: string): { tasks: Task[]; result: CancelResult; }; /** * Batch cancel multiple tasks. */ export declare function cancelMultiple(taskIds: string[], tasks: Task[], reason?: string, projectRoot?: string): { tasks: Task[]; results: CancelResult[]; }; //# sourceMappingURL=cancel-ops.d.ts.map