import type { SceneCandidatesArtifact } from './types.js'; export declare function sceneCandidatesPathFor(root: string, slug: string): string; export declare function readSceneCandidatesArtifact(root: string, slug: string): Promise; export declare function writeSceneCandidatesArtifact(root: string, slug: string, artifact: SceneCandidatesArtifact): Promise; export declare function updateSceneCandidatesArtifact(root: string, slug: string, updater: (artifact: SceneCandidatesArtifact) => Promise<{ artifact: SceneCandidatesArtifact; result: T; }> | { artifact: SceneCandidatesArtifact; result: T; }): Promise; /** * Run `fn` while holding the SINGLE per-project artifact lock that guards BOTH * `scene-candidates.json` AND `scene-selection.json`. Used to make the * concurrent `pool` render path's per-scene candidate/selection read-modify-write * atomic: concurrent scenes serialize on the fast on-disk write while their slow * provider submit/poll stays OUTSIDE the lock. * * The canonical concurrency-safe shape inside `fn` is "RE-READ current → apply * MY deltas to the fresh current → write", so a concurrent writer's update is * never lost (the re-read inside the lock sees it). * * DEADLOCK RULE — the file lock is NOT re-entrant. Code inside `fn` must use * ONLY the RAW read/write functions (`readSceneCandidatesArtifact` / * `writeSceneCandidatesArtifact` / `readSceneSelectionArtifact` / * `writeSceneSelectionArtifact`) and the pure transforms (`appendCandidate` / * `markPending` / `updateCandidate` / `selectCandidate`). It must NEVER call * `updateSceneCandidatesArtifact` or `withSceneArtifactsLock` again (acquiring * the same `open(wx)` lock a second time on the same path would block forever). */ export declare function withSceneArtifactsLock(root: string, slug: string, fn: () => Promise): Promise; //# sourceMappingURL=scene-candidate-store.d.ts.map