/** * Flow goal state persistence. * * Stores state in `.pi/flow.json` with atomic rename writes. */ import type { GoalEntry, GoalState, GoalStatus } from "./types.js"; export declare function readState(cwd: string): GoalState; export declare function writeState(cwd: string, state: GoalState): void; /** Flush all pending writes. For tests or graceful shutdown. */ export declare function flushAllStoreCaches(): Promise; /** * Synchronous flush of all cached store entries. * * This is the **shutdown-path fallback** only. The normal async flush * (`flushAllStoreCaches`) is preferred during normal operation because it * yields to the event loop. `process.on('exit')` handlers cannot await, * so this sync variant guarantees data is persisted before the process * terminates. */ export declare function flushAllStoreCachesSync(): void; /** Clear the in-memory cache. For tests. */ export declare function _clearStoreCache(): void; export declare function getGoal(cwd: string): GoalEntry | undefined; export declare function getGoalForSession(cwd: string, sessionId: string | undefined): GoalEntry | undefined; export declare function setGoal(cwd: string, objective: string, opts?: { acceptance?: string; maxTokens?: number; maxFlows?: number; sessionId?: string; }): GoalEntry; export declare function clearGoal(cwd: string): void; export declare function updateGoalStatus(cwd: string, status: GoalStatus, sessionId?: string): GoalEntry | undefined; export declare function updateGoalObjective(cwd: string, objective: string, acceptance?: string): GoalEntry | undefined; export declare function recordFlowCompletion(cwd: string, flow: { type: string; intent: string; aim: string; }): GoalEntry | undefined; export declare function addTokens(cwd: string, tokens: number): GoalEntry | undefined; //# sourceMappingURL=store.d.ts.map