import type { RawOutcome } from "./servedInvocationLifecycle.js"; import { Checkpoint } from "./state/checkpointStore.js"; import type { RuntimeContext } from "./state/context.js"; import type { GraphState } from "./types.js"; /** The metadata key an attached debugger sets on the resumes and rewinds * it issues itself, so the public entry points return those as they are * instead of handing their stops back to the debugger that is already * handling them, and so the run keeps its key. A key on the call, not a * flag on the debugger: only the call knows whose resume it is. */ export declare const ATTACHED_RESUME = "attachedResume"; export declare function isAttachedResume(metadata: Record | undefined): boolean; /** Give an execution context a run key of its own: a fresh run, or a * resume the debugger did not issue, which remembers the key the * checkpoint carried. */ export declare function mintDebugRun(execCtx: RuntimeContext): void; /** The key of the run `execCtx` was resumed from by a caller, or * undefined for a fresh run. */ export declare function debugRunResumedFrom(execCtx: RuntimeContext): string | undefined; /** A copy of `checkpoint` that is the run `key`'s, whichever run recorded * it. The attached debugger rewinds the stopped run to the copy, of a * file saved in an earlier session for one: the key is the one thing * the debugger tells runs apart by, and the replay installs the handlers * and the policy as any resume does, so nothing else about the rewind * changes. The checkpoint itself is left as it was: one the program * pinned stays in the store, with the signature it was given, for a * later resume. The restore re-signs its own copy. */ export declare function stampDebugRun(checkpoint: Checkpoint, key: string): Checkpoint; /** The run `key` lets go of the debugger with no outcome to judge: its * leg failed before one existed, in the debugger's own rewind whose * restore threw, or in the debugger itself at a stop. */ export declare function letGoOfDebugRun(execCtx: RuntimeContext, key: string | undefined): void; /** The key of the run `execCtx` belongs to, or undefined for a context * built by hand with no root stack of its own. */ export declare function debugRunOf(execCtx: RuntimeContext): string | undefined; /** The key in a root stack, live or as a checkpoint holds it. */ export declare function debugRunOfStack(stack: { other?: Record; } | undefined): string | undefined; /** The leg is over. Unless it paused on nothing but debug stops, which * only the attached debugger sees and resumes itself, it goes back to * someone outside the debugger, and the run no longer owns it. Returns * whether the run owned the debugger, which is what `settleStops` needs * to report the end to the person: a run the debugger ignored ending * is not news. */ export declare function releaseDebugRunAfter(execCtx: RuntimeContext, outcome: RawOutcome): boolean;