import type { Checkpoint } from "./state/checkpointStore.js";
import type { MessageJSON } from "smoltalk";
export type RestoreOptions = {
    messages?: MessageJSON[];
    args?: Record<string, any>;
    /** Override global variables on restore. Applied to the checkpoint's module.
     * Only affects globals defined in the same file as the checkpoint.
     * Globals in other imported files are restored from checkpoint state. */
    globals?: Record<string, any>;
    /** Maximum number of times this checkpoint's source location may be restored.
     * Once the limit is reached, the restore is skipped (returns instead of throwing).
     * The count is keyed by the checkpoint's source location (moduleId:scopeName#stepPath),
     * so it persists across checkpoint ID changes caused by restore cycles. */
    maxRestores?: number;
};
export declare class CheckpointError extends Error {
    constructor(message: string);
}
export declare class RestoreSignal extends Error {
    checkpoint: Checkpoint;
    options?: RestoreOptions;
    constructor(checkpoint: Checkpoint, options?: RestoreOptions);
}
export declare class ConcurrentInterruptError extends Error {
    constructor(message: string);
}
export declare class AgencyCancelledError extends Error {
    constructor(reason?: string);
}
/** Thrown by `runHandlerChain` (lib/runtime/interrupts.ts) when nested
 *  handler-chain dispatch depth exceeds `MAX_HANDLER_CHAIN_DEPTH`. Almost
 *  always indicates a handler raised an interrupt that re-enters the same
 *  handler (directly or via the chain dispatcher visiting every handler).
 *  Carries the interrupt kind that tripped the limit so the diagnostic
 *  points at the right place. */
export declare class HandlerRecursionError extends Error {
    readonly kind: string;
    readonly depth: number;
    constructor(kind: string, depth: number);
}
export declare function isAbortError(error: unknown): boolean;
