import type { FlowDef, FlowState, WorkflowData } from './types';
export declare function flowsDir(folderPath: string): string;
export declare function workflowDataPath(folderPath: string): string;
export declare function flowStatePath(folderPath: string): string;
/** Reject filenames that contain path separators / parent-dir tokens / NUL.
 *  Returned name has `.json` appended if missing. */
export declare function sanitizeFlowFilename(name: string): string | null;
export declare function listFlowDefs(folderPath: string): string[];
export declare function loadFlowDef(folderPath: string, filename: string): FlowDef | null;
export declare function saveFlowDef(folderPath: string, filename: string, def: FlowDef): boolean;
export declare function deleteFlowDef(folderPath: string, filename: string): boolean;
export declare function loadFlowState(folderPath: string): FlowState | null;
export declare function saveFlowState(folderPath: string, state: FlowState): void;
export declare function clearFlowState(folderPath: string): void;
/** Read the unified data file, returning a fresh empty shape on miss/parse
 *  error. Callers should never see null — partial corruption recovers to the
 *  zero state rather than crashing the runner mid-flight. */
export declare function readWorkflowData(folderPath: string): WorkflowData;
export declare function writeWorkflowData(folderPath: string, data: WorkflowData): void;
/** Initialize workflow_data at flow start:
 *  - constants ← FlowDef.constants (overwrites; constants are immutable per run)
 *  - variables ← FlowDef.variables[].initialValue where present (others left
 *    undefined / missing); preserves any pre-existing variable keys not
 *    declared in this flow (defensive — shouldn't happen in practice but
 *    avoids data loss if a partial def reload races with persistence)
 *  - task_progress ← [] (reset for new run)
 */
export declare function initWorkflowData(folderPath: string, def: FlowDef): WorkflowData;
/** Append a task progress entry, return its index. Used by runner for LLM
 *  nodes — the LLM signals completion by flipping `task_progress[index].finish`
 *  to true via Edit/Write. */
export declare function appendTaskProgress(folderPath: string, entry: Omit<import('./types').TaskProgressEntry, 'startedAt'> & {
    startedAt?: number;
}): number;
export declare function globalFlowsDir(username: string): string | null;
export declare function listGlobalFlowDefs(username: string): string[];
export declare function loadGlobalFlowDef(username: string, filename: string): FlowDef | null;
export declare function saveGlobalFlowDef(username: string, filename: string, def: FlowDef): boolean;
export declare function deleteGlobalFlowDef(username: string, filename: string): boolean;
//# sourceMappingURL=store.d.ts.map