import type { Database } from "bun:sqlite";
import type { FocusSession, FocusSessionStatus, Task, TaskStatus, TaskTimeLog, TaskWatcher } from "../types/index.js";
export interface BulkCreateTaskInput {
    temp_id?: string;
    title: string;
    description?: string;
    priority?: "low" | "medium" | "high" | "critical";
    status?: "pending" | "in_progress" | "completed" | "failed" | "cancelled";
    project_id?: string;
    parent_id?: string;
    plan_id?: string;
    task_list_id?: string;
    agent_id?: string;
    assigned_to?: string;
    tags?: string[];
    metadata?: Record<string, unknown>;
    estimated_minutes?: number;
    depends_on_temp_ids?: string[];
}
export declare function bulkCreateTasks(inputs: BulkCreateTaskInput[], db?: Database): {
    created: {
        temp_id: string | null;
        id: string;
        short_id: string | null;
        title: string;
    }[];
};
export declare function bulkUpdateTasks(taskIds: string[], updates: {
    status?: Task["status"];
    priority?: Task["priority"];
    assigned_to?: string;
    tags?: string[];
}, db?: Database): {
    updated: number;
    failed: {
        id: string;
        error: string;
    }[];
};
export declare function bulkDeleteTasks(taskIds: string[], force?: boolean, db?: Database): {
    deleted: number;
    skipped: number;
    failed: {
        id: string;
        error: string;
    }[];
};
/**
 * Archive tasks matching the criteria. Archives completed/failed/cancelled tasks
 * older than `olderThanDays` days. Returns count of archived tasks.
 */
export declare function archiveTasks(options: {
    project_id?: string;
    task_list_id?: string;
    older_than_days?: number;
    status?: TaskStatus[];
}, db?: Database): {
    archived: number;
};
export declare function archiveCompletedTasks(days?: number, projectId?: string, db?: Database): number;
export declare function getArchivedTasks(opts?: {
    project_id?: string;
    limit?: number;
}, db?: Database): Task[];
/**
 * Unarchive (restore) a specific task.
 */
export declare function unarchiveTask(id: string, db?: Database): Task | null;
export declare function getOverdueTasks(projectId?: string, db?: Database, at?: Date): Task[];
export interface EscalatedTask {
    task: Task;
    reasons: Array<"overdue" | "sla_breached">;
    breached_at: string;
}
export declare function getEscalatedTasks(opts?: {
    project_id?: string;
    agent_id?: string;
}, db?: Database, at?: Date): EscalatedTask[];
export declare function notifyUpcomingDeadlines(opts?: {
    hours?: number;
    project_id?: string;
    agent_id?: string;
}, db?: Database): Task[];
export declare function getBlockedTasks(projectId?: string, db?: Database): Array<Task & {
    blocked_by: string[];
}>;
export declare function getBlockingTasks(projectId?: string, db?: Database): Array<Task & {
    blocking_count: number;
}>;
export interface LogTimeInput {
    task_id: string;
    run_id?: string;
    focus_session_id?: string;
    agent_id?: string;
    minutes: number;
    started_at?: string;
    ended_at?: string;
    notes?: string;
}
export interface StartFocusSessionInput {
    task_id?: string;
    plan_id?: string;
    run_id?: string;
    agent_id?: string;
    title?: string;
    started_at?: string;
    idle_after_minutes?: number;
    notes?: string;
    metadata?: Record<string, unknown>;
}
export interface StopFocusSessionInput {
    id: string;
    ended_at?: string;
    notes?: string;
    status?: "completed" | "cancelled";
}
export interface FocusSessionQuery {
    task_id?: string;
    plan_id?: string;
    run_id?: string;
    agent_id?: string;
    status?: FocusSessionStatus;
    include_completed?: boolean;
    limit?: number;
}
export interface IdleFocusSessionPrompt {
    session: FocusSession;
    idle_minutes: number;
    message: string;
}
export interface TimeReportEntry {
    task_id: string;
    title: string;
    project_id: string | null;
    plan_id: string | null;
    estimated_minutes: number | null;
    actual_minutes: number | null;
    logged_minutes: number;
    focus_minutes: number;
    time_logs: TaskTimeLog[];
    focus_sessions: FocusSession[];
}
export declare function logTime(input: LogTimeInput, db?: Database): TaskTimeLog;
export declare function getTimeLogs(taskId: string, db?: Database): TaskTimeLog[];
export declare function startFocusSession(input: StartFocusSessionInput, db?: Database): FocusSession;
export declare function getFocusSession(id: string, db?: Database): FocusSession | null;
export declare function listFocusSessions(query?: FocusSessionQuery, db?: Database): FocusSession[];
export declare function pauseFocusSession(id: string, pausedAt?: string, db?: Database): FocusSession;
export declare function resumeFocusSession(id: string, resumedAt?: string, db?: Database): FocusSession;
export declare function stopFocusSession(input: StopFocusSessionInput, db?: Database): FocusSession;
export declare function getIdleFocusSessionPrompts(opts?: {
    agent_id?: string;
    now?: string | Date;
}, db?: Database): IdleFocusSessionPrompt[];
export declare function getTimeReport(opts?: {
    project_id?: string;
    plan_id?: string;
    agent_id?: string;
    since?: string;
    include_open?: boolean;
}, db?: Database): TimeReportEntry[];
export declare function watchTask(taskId: string, agentId: string, db?: Database): TaskWatcher;
export declare function unwatchTask(taskId: string, agentId: string, db?: Database): boolean;
export declare function getTaskWatchers(taskId: string, db?: Database): TaskWatcher[];
export declare function notifyWatchers(taskId: string, event: string, data: Record<string, unknown>, db?: Database): void;
/**
 * Log cost (tokens + USD) to a task. Accumulates — does not replace.
 */
export declare function logCost(taskId: string, tokens: number, usd: number, db?: Database): void;
//# sourceMappingURL=task-relations.d.ts.map