import type { Task, TaskWithRelations, TaskDependency, TaskHistoryEntry, TaskActivity, TaskSummary, TaskStats, CreateTaskInput, UpdateTaskInput, TaskFilter, DependencyType, AddDependencyResult } from './types.js';
export interface TaskServiceConfig {
    dbPath?: string;
    jsonlPath?: string;
    agentId?: string;
}
export declare class TaskService {
    private db;
    private jsonlPath;
    private agentId?;
    constructor(config?: TaskServiceConfig);
    private generateId;
    create(input: CreateTaskInput): Task;
    get(id: string): Task | null;
    getWithRelations(id: string): TaskWithRelations | null;
    update(id: string, input: UpdateTaskInput): Task | null;
    close(id: string, reason?: string): Task | null;
    /**
     * Check for tasks that were blocked by the completed task and are now ready.
     * Transitions them from 'blocked' to 'open' and emits events.
     */
    private notifyUnblockedDependents;
    delete(id: string): boolean;
    private _hasDueDateColumn;
    private hasDueDateColumn;
    list(filter?: TaskFilter): Task[];
    ready(): TaskWithRelations[];
    blocked(): TaskWithRelations[];
    /**
     * Batch version of getWithRelations that prefetches all dependencies in 2 queries
     * instead of N+1 individual queries. Used by ready(), blocked(), and stats().
     */
    batchGetWithRelations(tasks: Task[]): TaskWithRelations[];
    getChildren(parentId: string): Task[];
    addDependency(fromTask: string, toTask: string, depType?: DependencyType): AddDependencyResult;
    removeDependency(fromTask: string, toTask: string): boolean;
    getDependencies(taskId: string): TaskDependency[];
    getBlockers(taskId: string): Task[];
    private wouldCreateCycle;
    private recordHistory;
    private recordActivity;
    getHistory(taskId: string): TaskHistoryEntry[];
    getActivity(taskId: string): TaskActivity[];
    getStats(): TaskStats;
    exportToJSONL(): string;
    saveToJSONL(): void;
    importFromJSONL(): number;
    compact(olderThanDays?: number): TaskSummary | null;
    getSummaries(): TaskSummary[];
}
//# sourceMappingURL=service.d.ts.map