export interface RestartState { id: string; phase: string; oldPid?: number; candidatePid?: number; candidateRelease?: string; previousRelease?: string; startedAt: string; updatedAt: string; error?: string; /** 本次重启是否由自动升级触发(NIUBOT_AUTO_UPDATE=1 写入);供新引擎早晨汇报判定。 */ autoUpdate?: boolean; /** 自动升级成功通知已送达;跨 Engine 重启去重。 */ autoUpdateReportedAt?: string; } export declare function readRestartState(stateFile: string, expectedId?: string): RestartState | undefined; export declare class RestartStateWriter { readonly botDirectory: string; readonly id: string; readonly startedAt: string; readonly directory: string; readonly stateFile: string; /** 本次重启是否自动升级触发:构造时固定,write 自动带上(贯穿整个 worker 生命周期) */ private readonly autoUpdate; constructor(botDirectory: string, id: string, startedAt: string, autoUpdate?: boolean); write(phase: string, values?: Partial>): RestartState; read(): RestartState | undefined; } /** 持久标记自动升级结果已通知,避免进程重启后重复发送。 */ export declare function markAutoUpdateReported(stateFile: string, expectedId: string): boolean;