import * as smoltalk from "smoltalk";
import { Checkpoint } from "./state/checkpointStore.js";
import { RuntimeContext } from "./state/context.js";
import { GlobalStoreJSON } from "./state/globalStore.js";
import { StateStack, StateStackJSON } from "./state/stateStack.js";
import { Approved, GraphState, Rejected } from "./types.js";
export type InterruptApprove = {
    type: "approve";
};
export type InterruptReject = {
    type: "reject";
};
export type InterruptResponse = InterruptApprove | InterruptReject;
export declare function approve(value?: any): InterruptResponse;
export declare function reject(value?: any): InterruptResponse;
export type InterruptData = {
    messages?: smoltalk.MessageJSON[];
    toolCall?: smoltalk.ToolCallJSON;
};
export type InterruptState = {
    stack: StateStackJSON;
    globals: GlobalStoreJSON;
};
export type Interrupt<T = any> = {
    type: "interrupt";
    kind: string;
    message: string;
    origin: string;
    interruptId: string;
    data: T;
    debugger?: boolean;
    interruptData?: InterruptData;
    checkpointId?: number;
    checkpoint?: Checkpoint;
    state?: InterruptState;
    runId: string;
};
export declare function interrupt<T = any>(opts: {
    kind: string;
    message: string;
    data: T;
    origin: string;
    runId: string;
    interruptId?: string;
}): Interrupt<T>;
export declare function createDebugInterrupt<T = any>(data: T, checkpointId: number, checkpoint: Checkpoint, runId: string): Interrupt<T>;
export declare function isInterrupt(obj: any): obj is Interrupt;
export declare function hasInterrupts(data: any): data is Interrupt[];
export declare function isDebugger(obj: any): obj is Interrupt;
export declare function isRejected(obj: any): obj is Rejected;
export declare function isApproved(obj: any): obj is Approved;
export declare function interruptWithHandlers<T = any>(kind: string, message: string, data: T, origin: string, ctx: RuntimeContext<any>, stack?: StateStack): Promise<Interrupt<T>[] | Approved | Rejected>;
export declare function respondToInterrupts(args: {
    ctx: RuntimeContext<GraphState>;
    interrupts: Interrupt[];
    responses: InterruptResponse[];
    overrides?: Record<string, unknown>;
    metadata?: Record<string, any>;
    registerTopLevelCallbacks?: (ctx: RuntimeContext<GraphState>) => void | Promise<void>;
    moduleDir?: string;
}): Promise<any>;
