import type { IMatrixContext } from '../../engine/core/IMatrixContext';
import type { IExitSignal } from '../../engine/mailbox/IMailbox';
import type { ChildManager } from '../children/ChildManager';
export type SupervisionStrategy = 'OneForOne' | 'OneForAll' | 'RestForOne';
export interface ISupervisorPolicy {
    strategy: SupervisionStrategy;
    maxRestarts: number;
    windowMs: number;
}
export declare const DEFAULT_SUPERVISION_POLICY: ISupervisorPolicy;
/**
 * SupervisorBehavior - Encapsulates Child Lifecycle & Failure Recovery.
 *
 * Vision:
 * - Uses ChildManager for blueprints and child lifecycle.
 * - Maintains own restart-count tracking (IRestartEntry).
 * - Implements OTP-style restart strategies.
 * - Handles 'cheating-free' introspection via async messaging.
 */
export declare class SupervisorBehavior {
    /** Restart tracking (separate from ChildManager's child tracking) */
    private readonly restartTracking;
    private readonly context;
    private readonly childManager;
    private readonly policy;
    constructor(context: IMatrixContext, childManager: ChildManager, policy?: ISupervisorPolicy);
    /**
     * Register a new child for restart tracking (AFTER it has been spawned by Runtime).
     * ChildManager handles the actual child data; this is for restart counts.
     */
    registerChild(id: string, mount: string): void;
    /**
     * Unregister a child from restart tracking (e.g. after deliberate removal).
     */
    unregisterChild(id: string): void;
    /**
     * Get child mount path. Delegates to ChildManager for authoritative data.
     */
    getChildMount(id: string): string | undefined;
    /**
     * Get all children. Delegates to ChildManager for authoritative data.
     */
    getAllChildren(): {
        id: string;
        mount: string;
    }[];
    /**
     * Handle an EXIT signal from a child.
     * Creates a Plan of Action (which children to restart).
     */
    handleExit(signal: IExitSignal): Promise<void>;
    /**
     * Find restart tracking entry by mount path.
     */
    private findRestartEntryByMount;
    /**
     * Check if child has exceeded max restart attempts within the window.
     */
    private _tooManyRestarts;
    /**
     * Restart a single crashed child (OneForOne strategy).
     */
    private _restartChild;
    /**
     * Restart ALL children (OneForAll strategy).
     */
    private _restartAll;
    /**
     * Restart failed child and all children started after it (RestForOne strategy).
     */
    private _restartRest;
}
//# sourceMappingURL=SupervisorBehavior.d.ts.map