import type { EnterpriseRepositoryScope } from './enterpriseRepository';
export type PersistedAnalysisRunStatus = 'pending' | 'running' | 'awaiting_user' | 'completed' | 'failed' | 'cancelled' | 'quota_exceeded';
export interface AnalysisRunPersistenceScope extends EnterpriseRepositoryScope {
    sessionId: string;
    runId: string;
    traceId: string;
    query?: string;
    mode?: string;
}
export interface AnalysisRunLifecycle {
    id: string;
    status: PersistedAnalysisRunStatus | string;
    startedAt: number;
    completedAt: number | null;
    heartbeatAt: number | null;
    updatedAt: number | null;
    errorJson: string | null;
}
export interface InterruptedAnalysisRunRecovery {
    id: string;
    tenantId: string;
    workspaceId: string;
    sessionId: string;
    previousStatus: PersistedAnalysisRunStatus | string;
}
export declare function resetAnalysisRunStoreForTests(): void;
export declare function persistAnalysisRunState(scope: AnalysisRunPersistenceScope, status: PersistedAnalysisRunStatus, options?: {
    now?: number;
    error?: string;
}): void;
export declare function heartbeatAnalysisRun(scope: AnalysisRunPersistenceScope, now?: number): void;
export declare function getAnalysisRunLifecycle(scope: EnterpriseRepositoryScope, runId: string): AnalysisRunLifecycle | null;
export declare function isAnalysisRunHeartbeatFresh(scope: EnterpriseRepositoryScope, runId: string, now: number, maxStaleMs: number): boolean;
export declare function failInterruptedAnalysisRunsOnStartup(options?: {
    now?: number;
    error?: string;
}): InterruptedAnalysisRunRecovery[];
//# sourceMappingURL=analysisRunStore.d.ts.map