import type { RuntimeContext } from "./context.js"; import type { GlobalStoreJSON } from "./globalStore.js"; import type { SourceLocation } from "./sourceLocation.js"; import type { StateStackJSON } from "./stateStack.js"; import type { StateStack } from "./stateStack.js"; /** Label used for pinned checkpoints created at function entry for Result error handling. */ export declare const RESULT_ENTRY_LABEL = "result-entry"; export type SourceLocationOpts = Omit; /** Reset the global checkpoint ID counter. For use in tests only. */ export declare function resetGlobalCheckpointCounter(): void; export type ThreadMessages = { threadId: string; threadIndex: number; threadCount: number; messages: { role: string; content: string; }[]; }; export type CheckpointArgs = { id?: number; stack: StateStackJSON; globals: GlobalStoreJSON; nodeId: string; moduleId?: string; scopeName?: string; stepPath?: string; label?: string | null; pinned?: boolean; }; export declare class Checkpoint implements SourceLocation { id: number; stack: StateStackJSON; globals: GlobalStoreJSON; nodeId: string; moduleId: string; scopeName: string; stepPath: string; label: string | null; pinned: boolean; constructor(args: CheckpointArgs); getScopeKey(): string; get location(): SourceLocation; getCurrentFrame(): import("./stateStack.js").StateJSON | undefined; getThreadMessages(displayIndex?: number): ThreadMessages | null; private getContentFromMessage; getGlobalsForModule(): Record | null; getFilename(): string; pathEquals(other: Checkpoint): boolean; equals(other: Checkpoint): boolean; toJSON(): { id: number; stack: StateStackJSON; globals: GlobalStoreJSON; nodeId: string; moduleId: string; scopeName: string; stepPath: string; label: string | null; pinned: boolean; }; clone(opts?: Partial): Checkpoint; getLocation(): string; static fromStateStack(stateStack: StateStack, ctx: RuntimeContext, opts: SourceLocationOpts & { label?: string | null; pinned?: boolean; }): Checkpoint; static fromContext(ctx: RuntimeContext, opts: SourceLocationOpts & { label?: string | null; pinned?: boolean; }): Checkpoint; static fromJSON(json: any): Checkpoint | null; } export type CheckpointStoreJSON = { checkpoints: Record; counter: number; }; export declare class CheckpointStore { private checkpoints; private restoreCounts; private locationRestoreCounts; private maxRestores; private maxSize; constructor(maxRestores?: number, maxSize?: number); create(stateStack: StateStack, ctx: RuntimeContext, opts: SourceLocationOpts & { label?: string | null; pinned?: boolean; removeDuplicate?: boolean; }): number; add(checkpoint: Checkpoint): void; cloneCheckpoint(_checkpoint: Checkpoint, opts?: Partial): number; findCheckpoint(location: SourceLocationOpts): Checkpoint | null; findBefore(checkpoint: Checkpoint): Checkpoint | null; createRolling(ctx: RuntimeContext, opts: SourceLocationOpts): number; removeDebugFlagsFor(id: number): void; private removeDuplicate; createPinned(stateStack: StateStack, ctx: RuntimeContext, opts: SourceLocationOpts & { label: string | null; }): number; pin(id: number, label?: string): void; get(id: number): Checkpoint | undefined; delete(id: number): void; getCheckpoints(): Checkpoint[]; deleteAfterCheckpoint(id: number, deletePinned?: boolean): void; getLocationRestoreCount(location: string): number; trackLocationRestore(location: string): void; trackRestore(id: number): void; getSorted(): Checkpoint[]; prettyPrint(): string; toJSON(): CheckpointStoreJSON; static fromJSON(json: CheckpointStoreJSON, maxRestores?: number): CheckpointStore; private evictIfNeeded; }