declare const VERSION: string; type RunStatus = "running" | "succeeded" | "failed" | "crashed"; interface RunState { status: RunStatus; pid: number; startedAt: number; endedAt?: number; toolVersion: string; argv: string[]; lastPeakRssMb: number | null; lastStage: string | null; reason?: string; } declare function resolveStateDir(): string; declare function stateFilePath(): string; declare function loadRunState(): RunState | null; declare function writeRunState(patch: Partial): void; declare function shouldSkipStaleWarning(prev: RunState): boolean; declare function probablyOomRssMb(override?: number): number; declare function shouldShowOomHint(prev: RunState): boolean; interface DotnsCommitmentRecord { savedAt: number; environmentId: string; tld: string; protocol: string; label: string; owner: string; reserved: boolean; secret: string; maxPrice?: string; pricingVersion?: string; commitment: string; recordId?: string; } declare function commitmentStateFilePath(environmentId: string, tld: string, owner: string, label: string): string; declare function commitmentLockFilePath(environmentId: string, tld: string, owner: string, label: string): string; declare function commitmentRecordKey(record: DotnsCommitmentRecord | null): string | null; declare const FALLBACK_MAX_COMMITMENT_AGE_SECONDS = 86400; declare function loadCommitmentRecord(environmentId: string, tld: string, owner: string, label: string): DotnsCommitmentRecord | null; declare function writeCommitmentRecord(record: DotnsCommitmentRecord): boolean; declare function replaceCommitmentRecord(record: DotnsCommitmentRecord, expectedKey: string | null): boolean; declare function clearCommitmentRecord(environmentId: string, tld: string, owner: string, label: string, expectedKey: string | null): void; interface CommitmentLockHolder { pid: number; host: string; token: string; createdAt: number; } type CommitmentLockResult = { token: string | null; heldBy?: undefined; release: () => void; } | { token?: undefined; heldBy: CommitmentLockHolder; release?: undefined; }; declare function tryAcquireCommitmentLock(environmentId: string, tld: string, owner: string, label: string, nowMs?: number): CommitmentLockResult; export { type CommitmentLockHolder, type CommitmentLockResult, type DotnsCommitmentRecord, FALLBACK_MAX_COMMITMENT_AGE_SECONDS, type RunState, type RunStatus, VERSION, clearCommitmentRecord, commitmentLockFilePath, commitmentRecordKey, commitmentStateFilePath, loadCommitmentRecord, loadRunState, probablyOomRssMb, replaceCommitmentRecord, resolveStateDir, shouldShowOomHint, shouldSkipStaleWarning, stateFilePath, tryAcquireCommitmentLock, writeCommitmentRecord, writeRunState };