import { PauseSignal } from "./errors.js"; import type { StatelogClient } from "../statelogClient.js"; import type { Checkpoint, SourceLocationOpts } from "./state/checkpointStore.js"; import type { RuntimeContext } from "./state/context.js"; import type { StateStack } from "./state/stateStack.js"; import type { RunNodeCoreResult } from "./types.js"; /** What a run returns in `data` when a pause request stopped it. The host * stores the whole value and hands it back to `resumeFromCheckpoint`. */ export type PausedCheckpoint = { type: "paused"; checkpoint: Checkpoint; runId: string; }; export declare function pausedResult(checkpoint: Checkpoint, runId: string): PausedCheckpoint; export declare function isPaused(data: unknown): data is PausedCheckpoint; /** Settle a caught pause into the object the caller gets back. The run is * not over, so the trace writer is paused rather than closed, and the * entry that catches the signal emits no agentEnd. */ export declare function pausedReturnObject(execCtx: RuntimeContext, signal: PauseSignal): Promise>; type PauseAtStepArgs = { ctx: RuntimeContext; /** The logger of the run that is pausing. */ log: StatelogClient; stack: StateStack; location: SourceLocationOpts; }; /** Honour an external pause at a step boundary: settle pending async calls, * stamp a checkpoint here, record it, clear the request, and unwind with * PauseSignal. The step counter has not advanced, so a resume re-enters * this same statement. * * An async call keeps its result in a pending-promise resolver, not in the * frame, so the checkpoint is stamped only after `awaitAll` has written * those results into the frame locals. */ export declare function pauseAtStep({ ctx, log, stack, location }: PauseAtStepArgs): Promise; export {};