import type { Interrupt } from "./interrupts.js"; import type { LoopStopKind, SourceLocation } from "./state/sourceLocation.js"; import type { StateStack } from "./state/stateStack.js"; import type { Run } from "./asyncContext.js"; import { type BusyKind, type StopLocation } from "./waits.js"; export type { BusyEntry, BusyKind, OpenWait, StopLocation } from "./waits.js"; /** Where a debug stop happened, carried in the debug interrupt's `data`. * The interrupt's checkpoint cannot say: once a stop inside a tool call * joins its batch, that checkpoint is the shared one stamped from the * `runPrompt` frame, whose location is the loop's. The driver reads the * source line from this record, finds the stopped frame in the * checkpoint by `branchPath` (`Checkpoint.frameAt`), and sets its * stepping depth from `depth` when it shows the stop. */ export type DebugStopData = StopLocation & { label: string | null; /** Set when the stop is one of the tool loop's own, before a model * request or a tool call, rather than at a statement. */ loopStop?: LoopStopKind; }; /** Run `body`, a model request or a tool call, as a wait the debugger * is shown while it is open. The wait goes on the module's debug slot * with or without a debugger, and is reported when it opens and when * it closes, however the body leaves: a return, a throw, or a bail-out. * A handler's or a callback's body runs plain, as `maybeDebugHook` and * `PromptRunner.debugStop` skip them: neither has a step a stop could * show. Reporting never claims the debugger (`DebuggerState.showsRun` * is read-only); a run takes it at its first stop and nowhere else. */ export declare function whileBusy(run: Run, stack: StateStack, wait: { kind: BusyKind; label: string; location: StopLocation; round?: number; }, body: () => Promise): Promise; export declare function isDebugStop(data: unknown): data is DebugStopData; export declare function debugStep(run: Run, info: Omit & { label: string | null; nodeContext: boolean; isUserAdded: boolean; /** Set for one of the tool loop's own stops. */ loopStop?: LoopStopKind; }, stack: StateStack): Promise;