import { isProcessAlive, loadRuntimeState } from './config.js'; import { type ExternalUpgradeOptions, type ExternalUpgradeResult } from './external-upgrade.js'; import { stageRuntimeBundle } from './version-stager.js'; import { fetchRuntimeManifest, prepareRuntimeBundle } from './runtime-release.js'; import { loadLatestExternalUpgradeJob, transitionExternalUpgradeJob, type ExternalUpgradeJob } from './upgrade-job.js'; import { hasUpgradeLock } from './upgrade-lock.js'; import { isVersionStoreAdopted, loadCurrentVersion, loadLastKnownGood } from './version-store.js'; export interface UserRollbackResult { status: 'already-current' | 'completed'; currentVersion: string; targetVersion: string; runningVersion: string; job?: ExternalUpgradeJob; } export declare class UserRollbackError extends Error { readonly recovery: string; constructor(message: string, recovery: string); } export interface UserRollbackDeps { isAdopted: typeof isVersionStoreAdopted; loadCurrent: typeof loadCurrentVersion; loadLastKnownGood: typeof loadLastKnownGood; loadRuntime: typeof loadRuntimeState; processAlive: typeof isProcessAlive; hasActiveLock: typeof hasUpgradeLock; loadLatestJob: typeof loadLatestExternalUpgradeJob; fetchManifest: typeof fetchRuntimeManifest; prepareBundle: typeof prepareRuntimeBundle; stageBundle: typeof stageRuntimeBundle; transitionJob: typeof transitionExternalUpgradeJob; startExternalUpgrade: (options: ExternalUpgradeOptions) => Promise; onPlan: (currentVersion: string, targetVersion: string) => void; } export declare function rollbackToVersion(targetVersion: string, overrides?: Partial): Promise;