export type TaskState = | "available" | "scheduled" | "executing" | "completed" | "failed" | "cancelled"; export interface TaskAttributes { state?: TaskState; result?: R; } export interface TaskData { attributes?: TaskAttributes; } export type GetTaskResponse = | { data: TaskData } | { error: string }; export interface PollOptions { maxAttempts?: number; delayMs?: number; } export type PollSettledResult = | { ok: true; state: TaskState; task: TaskData; result: R | undefined; } | { ok: false; error: string; state?: TaskState; task?: TaskData; result?: R; }; export interface TaskDetails { attributes: { state: string; completed_at: string; result: { exc_type?: string; exc_message?: string[]; exc_module?: string; }; task_args: { scan_id: string; provider_id: string; checks_to_execute: string[]; }; }; }