import { CostEstimate, TokenUsage } from "smoltalk";
import { RuntimeContext, ThreadStore } from "./index.js";
import { ThreadStoreJSON } from "./state/threadStore.js";
export type GraphState = {
    messages?: ThreadStore;
    data: any;
    ctx: RuntimeContext<GraphState>;
    isResume?: boolean;
};
export type NodeReturnValue<T> = {
    data: T;
    messages: ThreadStore;
};
export type RunNodeResult<T> = {
    messages: ThreadStoreJSON;
    data: T;
    tokens?: TokenStats;
};
export type TokenStats = {
    usage: TokenUsage;
    cost: CostEstimate;
};
export type Rejected = {
    type: "reject";
    value?: any;
};
export type Approved = {
    type: "approve";
    value?: any;
};
export type Propagated = {
    type: "propagate";
};
export type HandlerFn = (interrupt: {
    kind: string;
    message: string;
    data: any;
    origin: string;
}) => Promise<Approved | Rejected | Propagated | undefined>;
