import type { Database } from "../../../shared/sqlite";
export type KeyFileStaleReason = "missing" | "content_drift";
export interface ProjectKeyFileRow {
    projectPath: string;
    path: string;
    content: string;
    contentHash: string;
    localTokenEstimate: number;
    generatedAt: number;
    generatedByModel: string | null;
    generationConfigHash: string;
    staleReason: KeyFileStaleReason | null;
}
export interface ReplacementKeyFile {
    path: string;
    content: string;
    localTokenEstimate: number;
    generatedByModel?: string | null;
    generationConfigHash: string;
}
export interface CommitKeyFile {
    path: string;
    content: string;
    localTokenEstimate: number;
}
export interface ResolvedCommitKeyFile extends CommitKeyFile {
    contentHash: string;
    staleReason: KeyFileStaleReason | null;
}
declare const MISSING_CONTENT_HASH = "<missing>";
export declare function sha256(input: string | Buffer): string;
export declare function resolveProjectPath(directory: string | undefined): string | null;
export declare function readCurrentKeyFiles(db: Database, projectPath: string): ProjectKeyFileRow[];
export declare function getKeyFilesVersion(db: Database, projectPath: string): number;
export declare function bumpKeyFilesVersion(db: Database, projectPath: string): number;
export declare function resolveCommitFiles(projectPath: string, files: CommitKeyFile[]): ResolvedCommitKeyFile[];
export declare function replaceProjectKeyFiles(db: Database, projectPath: string, files: ReplacementKeyFile[], generatedAt?: number): number;
export declare function insertResolvedKeyFiles(db: Database, projectPath: string, files: ResolvedCommitKeyFile[], generatedAt: number, generatedByModel: string | null, generationConfigHash: string): void;
export declare function deleteOrphanProjectKeyFiles(db: Database, now?: number): number;
export declare function isRelativeProjectFile(projectPath: string, relativePath: string): boolean;
export { MISSING_CONTENT_HASH };
//# sourceMappingURL=project-key-files.d.ts.map