/** * FileTaskStore — File-based persistence for TaskManager. * Used automatically when backend is "node-timeout". * * Storage layout: * {storePath} — tasks.json (all task definitions) * {logsPath}/{taskId}.jsonl — run log per task (append-only) * Continuation history is in-memory only (lost on restart). */ import { type Task, type TaskStatus, type TaskRunResult, type TaskStore, type TaskManagerConfig, type ConversationEntry } from "../../types/index.js"; export declare class FileTaskStore implements TaskStore { readonly type: "file"; private storePath; private logsPath; private maxRunLogs; private maxHistoryEntries; private tasks; /** In-memory only — lost on restart */ private history; private flushQueue; constructor(config: TaskManagerConfig); initialize(): Promise; shutdown(): Promise; save(task: Task): Promise; get(taskId: string): Promise; list(filter?: { status?: TaskStatus; }): Promise; update(taskId: string, updates: Partial): Promise; delete(taskId: string): Promise; appendRun(taskId: string, run: TaskRunResult): Promise; getRuns(taskId: string, options?: { limit?: number; status?: string; }): Promise; appendHistory(taskId: string, messages: ConversationEntry[]): Promise; getHistory(taskId: string): Promise; clearHistory(taskId: string): Promise; /** Write all tasks to disk atomically, serialized via promise queue */ private flush; /** Prune run log if it exceeds maxRunLogs entries */ private pruneRunLog; }