/** * Task persistence: meta.json (single record) + events.jsonl (append-only log). * * Concurrency contract: applyEvent does a read-modify-write on meta.json. It * is safe to call from a single writer per task — by convention, that writer * is the _task-runner subprocess. CLI commands that need to influence a * running task (e.g. `franklin task cancel`) MUST signal the runner pid * (SIGTERM) rather than calling applyEvent directly, otherwise the two * writers race and one update is silently lost. Lost-task reconciliation * is an exception — it runs only when the runner is provably dead, so * there is no second writer to race with. * * Atomicity: writeTaskMeta uses tmp + rename; readers see either old or new * meta, never partial. appendTaskEvent relies on POSIX O_APPEND + PIPE_BUF * atomicity (~4096 bytes); summaries should stay short. readTaskEvents is * tolerant of a torn last line. */ import type { TaskRecord, TaskEventRecord } from './types.js'; export declare function writeTaskMeta(record: TaskRecord): void; export declare function readTaskMeta(runId: string): TaskRecord | null; export declare function appendTaskEvent(runId: string, event: TaskEventRecord): void; export declare function readTaskEvents(runId: string): TaskEventRecord[]; export declare function applyEvent(runId: string, event: TaskEventRecord): TaskRecord; export declare function listTasks(): TaskRecord[];