export interface InterruptValue { /** Value the node is surfacing to the human */ value: unknown; /** Which node triggered the interrupt */ node: string; /** Unique resume key for this interrupt point */ resumeId: string; timestamp: number; } export interface ResumeValue { resumeId: string; value: unknown; } export declare class NodeInterruptSignal { readonly value: unknown; readonly resumeId: string; readonly isNodeInterrupt = true; constructor(value: unknown, resumeId: string); } interface InterruptContext { nodeName: string; /** Queue of resume values — one per interrupt() call in this execution. */ resumeValues: unknown[]; } export declare function _installInterruptContext(ctx: InterruptContext, fn: () => T): T; export declare function _clearInterruptContext(): void; export declare function _getInterruptContext(): InterruptContext | null; /** * Pause execution and surface `value` to the human. * Returns the human's response when execution resumes. * * @example * addNode("review", async (state) => { * const decision = await interrupt({ * message: "Approve this action?", * data: state.pendingAction, * }); * if (decision === "approve") { * return { approved: true }; * } * return { approved: false, reason: decision }; * }); */ export declare function interrupt(value: unknown): Promise; export interface GetUserInputOptions { /** Prompt shown to the user */ prompt: string; /** Optional field name for structured input */ field?: string; /** Validation — if it returns false, the input is rejected */ validate?: (input: unknown) => boolean | string; /** Expected input type hint */ inputType?: "text" | "boolean" | "number" | "select" | "json"; /** For "select" inputType — valid choices */ choices?: string[]; } /** * Pause execution and collect structured input from the human. * A semantic alias for interrupt() with richer metadata. * * @example * addNode("get_approval", async (state) => { * const approved = await getUserInput({ * prompt: `Approve deployment of ${state.version}?`, * inputType: "boolean", * }); * return { approved: approved as boolean }; * }); */ export declare function getUserInput(opts: GetUserInputOptions): Promise; /** * Ask the human for a yes/no decision. * * @example * const ok = await getUserApproval("Deploy to production?"); * if (!ok) return { aborted: true }; */ export declare function getUserApproval(prompt: string): Promise; export declare function getUserSelection(prompt: string, choices: string[]): Promise; export {}; //# sourceMappingURL=interrupt.d.ts.map