import type { EventBus } from '../kernel/events.js'; import type { TaskItem } from '../utils/task-format.js'; export interface TaskFile { version: 1; sessionId: string; updatedAt: string; tasks: TaskItem[]; } export declare function emptyTaskFile(sessionId: string): TaskFile; /** Read the task file. Returns null when the file doesn't exist. */ export declare function loadTasks(filePath: string, events?: EventBus, traceId?: string): Promise; /** * Write the task file atomically. Prefer `mutateTasks` for read-modify-write * cycles — this low-level function does NOT acquire a lock. */ /** * Persist the task file. Returns `true` on success, `false` if the write * failed (still emits `storage.error` + warns — does NOT throw). `mutateTasks` * inspects the result and throws so the task TOOL can report `ok:false` * instead of falsely claiming the tasks were saved. */ export declare function saveTasks(filePath: string, tasks: TaskFile, events?: EventBus, traceId?: string, warn?: (msg: string) => void): Promise; /** * Load, modify, and save the task file under a file-level lock. * `fn` receives the current TaskFile (or a fresh empty one) and must * return the mutated TaskFile (mutating in-place is fine — the returned * reference is what gets saved). * * This is the primary API for any code path that reads *and then writes* * the task file — it prevents races from parallel `batch_tool_use` calls. */ export declare function mutateTasks(filePath: string, sessionId: string, fn: (file: TaskFile) => TaskFile | Promise, events?: EventBus, traceId?: string): Promise; //# sourceMappingURL=task-store.d.ts.map