import type { PhasePlan } from "./journal-phase-detector.js";
import type { WikiManifest, JournalPageEntry } from "./wiki-manifest.js";
export declare function assertSafeSlug(slug: string): void;
export interface CheckpointState {
    startedAt: string;
    completed: string[];
    costUsd: number;
}
export declare class BlockChangedError extends Error {
    readonly blockKind: string;
    constructor(kind: string);
}
export declare class BudgetExceededError extends Error {
    readonly file: string;
    readonly sizeBytes: number;
    readonly limit: number;
    constructor(file: string, sizeBytes: number, limit: number);
}
export declare const BUDGETS: Readonly<Record<string, number>>;
export declare function assertBlockUnchanged(fileContent: string, blockKind: string, preHash: string): void;
export declare function acquireLock(lockPath: string): Promise<void>;
export declare function releaseLock(lockPath: string): Promise<void>;
export declare function readCheckpoint(path: string): Promise<CheckpointState | null>;
export declare function writeCheckpoint(path: string, state: CheckpointState): Promise<void>;
export declare function enforceBudgets(files: Record<string, string>): void;
export declare function anyFileHasTodo(dir: string, files: string[]): Promise<boolean>;
export declare function readPhaseBlockHash(filePath: string, kind: string): Promise<string | undefined>;
export declare function filterPhasesBySince(phases: PhasePlan[], since: string, cwd?: string): PhasePlan[];
export type PhaseScope = {
    entry?: string;
    phase?: string;
};
export declare function filterPhasesByScope(phases: PhasePlan[], scope: PhaseScope): PhasePlan[];
/** True when !force AND manifest has a journal-* page w/ matching slug whose
 *  journal_content_hashes["phase-summary"] equals currentHash. */
export declare function shouldSkipPhaseByHash(slug: string, currentHash: string, opts?: {
    force?: boolean;
    manifest?: WikiManifest | null;
}): boolean;
export interface JournalPhaseWrite {
    slug: string;
    title: string;
    file: string;
    hash: string;
}
export declare function buildJournalManifestEntries(phaseWrites: JournalPhaseWrite[], overviewPresent: boolean): JournalPageEntry[];
export declare function mergeJournalIntoManifest(existing: WikiManifest | null, journalEntries: JournalPageEntry[]): WikiManifest;
export declare function renderJournalSectionMd(entries: JournalPageEntry[]): string;
export declare function insertJournalSectionIntoIndex(indexMd: string, sectionMd: string): string;
export declare function readManifestIfExists(path: string): Promise<WikiManifest | null>;
/** Atomic write with TOCTOU guard: re-read + hash-check before tmp→rename. */
export declare function writePhaseAtomic(filePath: string, content: string, preHash: string | undefined, force: boolean): Promise<void>;
export declare function extractPhaseTitle(filePath: string, fallback: string): Promise<string>;
export declare function rewriteOverviewPhasesList(existing: string, phaseWrites: JournalPhaseWrite[]): string;
//# sourceMappingURL=journal-generator-helpers.d.ts.map