/**
 * Type declarations for unit-runtime.js
 */

export interface RecoveryDiagnostics {
	unitType: string;
	unitId: string;
	status: string;
	retryCount: number;
	maxRetries: number;
	lastRecoveryReason: string | null;
	progressCount: number;
	lastProgressKind: string;
	recoveryAttempts: number;
	lineageSummary: {
		status: string;
		workerCount: number;
		eventCount: number;
	} | null;
	updatedAt: number | null;
	startedAt: number | null;
}

export function getRecoveryDiagnostics(
	basePath: string,
	unitType: string,
	unitId: string,
): RecoveryDiagnostics | null;

export function readUnitRuntimeRecord(
	basePath: string,
	unitType: string,
	unitId: string,
): Record<string, unknown> | null;

export function listUnitRuntimeRecords(
	basePath: string,
): Array<Record<string, unknown> & { updatedAt?: number; unitId: string }>;
