export interface PendingInjectRecord {
    /** tmux session name the inject targets (also the record's key). */
    tmuxSession: string;
    /** The message queued for injection (may be a bootstrap-file pointer). */
    initialMessage: string;
    /** Telegram topic the message belongs to, when known. */
    telegramTopicId?: number;
    /** ISO timestamp the record was written (spawn time). */
    createdAt: string;
}
export declare class PendingInjectStore {
    private dir;
    constructor(stateDir: string);
    /** Key → filename. tmux session names are already shell-safe, but clamp anyway. */
    private fileFor;
    /** Write (or overwrite) the pending record for a session. Never throws —
     *  a failed durability write must not block the spawn itself. */
    record(entry: Omit<PendingInjectRecord, 'createdAt'> & {
        createdAt?: string;
    }): void;
    /** Remove the record after a verified inject. Never throws. */
    clear(tmuxSession: string): void;
    /** All surviving records (corrupt files are skipped, reported via return). */
    list(): {
        records: PendingInjectRecord[];
        corrupt: string[];
    };
}
export interface PendingInjectSweepDeps {
    sessionAlive(tmuxSession: string): boolean;
    /** Re-deliver through the normal readiness path; resolves once injected (or throws). */
    redeliver(record: PendingInjectRecord): Promise<void>;
    /** Loud reporting for the cases recovery cannot fix on its own. */
    reportLoss(record: PendingInjectRecord, reason: string): void;
    now?: () => number;
    /** Records older than this are expired (reported, not re-injected). Default 6h. */
    maxAgeMs?: number;
}
export interface PendingInjectSweepResult {
    redelivered: string[];
    expired: string[];
    deadSession: string[];
    failed: string[];
}
/**
 * Boot-time recovery over surviving records. Decision per record:
 *  - older than maxAge       → expire + reportLoss (stale enough that re-injecting
 *                              mid-conversation would confuse more than help)
 *  - tmux session still alive → redeliver via the readiness path, clear on success
 *  - tmux session gone        → reportLoss + clear (the bridge respawns on the
 *                              user's next message; the loss is now VISIBLE)
 */
export declare function sweepPendingInjects(store: PendingInjectStore, deps: PendingInjectSweepDeps): Promise<PendingInjectSweepResult>;
//# sourceMappingURL=PendingInjectStore.d.ts.map