/** Loop-safety defaults (overridable via AgentSettings). */
export declare const DEFAULT_MAX_CALLBACK_CHAIN_DEPTH = 10;
export declare const DEFAULT_MAX_PENDING_CALLBACKS = 25;
export interface PendingCallback {
    /** Stable id for this callback registration. */
    id: string;
    /** The spawned child session whose completion we are waiting on. */
    childChatId: string;
    /** The chat to re-invoke (notify) when the child completes. */
    parentChatId: string;
    /**
     * If the parent was an agent session, its alias — used to spawn a fresh agent
     * chat if the original parent chat has since been deleted.
     */
    parentAgentAlias?: string;
    /** Callback-chain depth of this registration (parent depth + 1). */
    depth: number;
    /** Unix ms timestamp of registration. */
    createdAt: number;
    /**
     * "waiting"  — child session is still running.
     * "ready"    — child has completed; awaiting delivery (parent may be busy).
     */
    status: "waiting" | "ready";
}
export interface AddCallbackInput {
    childChatId: string;
    parentChatId: string;
    parentAgentAlias?: string;
    depth: number;
}
export declare function addCallback(input: AddCallbackInput): PendingCallback;
/** Count of registrations not yet delivered (waiting + ready). */
export declare function countPending(): number;
/** Mark every callback waiting on `childChatId` as ready for delivery. Returns affected callbacks. */
export declare function markChildComplete(childChatId: string): PendingCallback[];
/** All "ready" callbacks targeting the given parent chat. */
export declare function getReadyForParent(parentChatId: string): PendingCallback[];
/** Remove callbacks by id. */
export declare function removeCallbacks(ids: string[]): void;
/** Distinct parent chat ids that currently have at least one "ready" callback. */
export declare function parentsWithReadyCallbacks(): string[];
/** Depth at which a chat was (re-)invoked via a callback. Defaults to 0 (root). */
export declare function getChatDepth(chatId: string): number;
export declare function setChatDepth(chatId: string, depth: number): void;
export declare function clearChatDepth(chatId: string): void;
//# sourceMappingURL=session-callbacks.d.ts.map