import { type AuditLogger } from './audit-log.js'; import { applyConfigGuardWithFallback, type ApplyConfigGuardResult, type ConfigGuardServerFields } from './config-guard.js'; import { diagnoseEnvironment, type EnvironmentDoctorReport } from './environment-doctor.js'; import { probeOpenCodeHealth, type OpenCodeProbeResult } from './opencode-probe.js'; import { acquireRescueLock, checkOpenCodeSingleInstance, type ProcessGuardResult } from './process-guard.js'; export type RescueStep = 'lock' | 'doctor' | 'config' | 'start' | 'verify' | 'release'; export type RescueStepResult = 'success' | 'failed'; export interface RescueStepTrace { step: RescueStep; result: RescueStepResult; durationMs: number; reason?: string; } export interface RescueExecutorOptions { lockTargetPath: string; pidFilePath: string; host: string; port: number; configPath: string; serverFields: ConfigGuardServerFields; healthPath?: string; startOpenCode?: () => Promise; audit?: AuditLogger; deps?: Partial; } export interface RescueExecutionSuccess { ok: true; trace: RescueStepTrace[]; lockPath: string; singleInstance: ProcessGuardResult; doctor: EnvironmentDoctorReport; config: ApplyConfigGuardResult; health: OpenCodeProbeResult; } export interface RescueExecutionFailure { ok: false; failedStep: RescueStep; reason: string; trace: RescueStepTrace[]; } export type RescueExecutionResult = RescueExecutionSuccess | RescueExecutionFailure; export interface RescueExecutorDependencies { acquireRescueLock: typeof acquireRescueLock; checkOpenCodeSingleInstance: typeof checkOpenCodeSingleInstance; diagnoseEnvironment: typeof diagnoseEnvironment; applyConfigGuardWithFallback: typeof applyConfigGuardWithFallback; probeOpenCodeHealth: typeof probeOpenCodeHealth; startOpenCode: () => Promise; now: () => number; } export declare function executeRescuePipeline(options: RescueExecutorOptions): Promise; //# sourceMappingURL=rescue-executor.d.ts.map