/**
 * Local task scheduling — due dates, delayed starts, recurrence helpers,
 * stale detection, and agent-safe queue ordering.
 */
import type { Database } from "bun:sqlite";
import { type Task } from "../db/tasks.js";
export declare const TASK_SCHEDULING_SCHEMA = "todos.task_scheduling.v1";
export interface ScheduleTaskInput {
    due_at?: string | null;
    scheduled_start_at?: string | null;
    recurrence_rule?: string | null;
}
export interface StaleTaskReport {
    schema_version: typeof TASK_SCHEDULING_SCHEMA;
    stale_minutes: number;
    count: number;
    tasks: Array<{
        id: string;
        short_id: string | null;
        title: string;
        assigned_to: string | null;
        locked_by: string | null;
        stale_minutes: number;
        updated_at: string;
    }>;
}
export interface SchedulingQueueItem {
    id: string;
    short_id: string | null;
    title: string;
    priority: string;
    due_at: string | null;
    scheduled_start_at: string | null;
    score: number;
    blocked: boolean;
}
export interface SchedulingSummary {
    schema_version: typeof TASK_SCHEDULING_SCHEMA;
    due_today: number;
    overdue: number;
    stale: number;
    waiting_delayed_start: number;
    recurring: number;
    next_claimable: Task | null;
}
export declare function scheduleTask(taskId: string, input: ScheduleTaskInput, db?: Database): Task;
export declare function listDelayedStartTasks(db?: Database): Task[];
export declare function listReadyScheduledTasks(filters?: {
    project_id?: string;
}, db?: Database): Task[];
export declare function getAgentSafeQueue(_agentId?: string, filters?: {
    project_id?: string;
    limit?: number;
}, db?: Database): SchedulingQueueItem[];
export declare function getStaleTaskReport(staleMinutes?: number, filters?: {
    project_id?: string;
}, db?: Database): StaleTaskReport;
export declare function getSchedulingSummary(agentId?: string, filters?: {
    project_id?: string;
}, db?: Database): SchedulingSummary;
export declare function previewNextRecurrence(taskId: string, db?: Database): {
    due_at: string;
    rule: string;
} | null;
export declare function agentClaimNextSafe(agentId: string, filters?: {
    project_id?: string;
}, db?: Database): Task | null;
export declare function getAgentLoopDocs(): string;
//# sourceMappingURL=task-scheduling.d.ts.map