import type { RestartIntent } from '../services/restart-intent-store.js'; export type RestartFailureNotificationStatus = 'pending' | 'sent' | 'failed' | 'skipped'; export interface RestartFailureRecord { schemaVersion: 1; failureId: string; code: 'bootstrap_shutdown_protocol_required'; at: string; operation: 'restart'; detail: string; unsafeDaemonNames: string[]; restartIntent?: RestartIntent; notification: { status: RestartFailureNotificationStatus; attempts: number; updatedAt: string; larkAppId?: string; ownerOpenId?: string; messageId?: string; error?: string; }; } export interface RestartFailureNotifierBot { larkAppId: string; larkAppSecret: string; apiOnly?: boolean; ownerOpenId?: string; allowedUsers?: string[]; brand?: 'feishu' | 'lark'; } export interface RestartFailureNotificationTarget { larkAppId: string; ownerOpenId: string; } export interface RestartFailureNotificationWiring { dataDir: string; bots: RestartFailureNotifierBot[]; unsafeDaemonNames: string[]; detail: string; restartIntent?: RestartIntent | null; now?: number | (() => number); resolveOwner: (bot: RestartFailureNotifierBot) => Promise; sendText: (target: RestartFailureNotificationTarget, text: string) => Promise; } export declare function restartFailurePathIn(dir: string): string; export declare function writeRestartFailureTo(dir: string, record: RestartFailureRecord): void; export declare function readRestartFailureFrom(dir: string): RestartFailureRecord | null; export declare function buildRestartBootstrapRequiredText(record: RestartFailureRecord, dataDir: string): string; /** * Persist the first-upgrade failure before attempting any external delivery. * The selected owner is resolved independently inside each configured app; * an app-scoped open_id is never copied from one bot to another. */ export declare function recordAndNotifyRestartBootstrapFailure(input: RestartFailureNotificationWiring): Promise; //# sourceMappingURL=restart-failure-notification.d.ts.map