import type { HostSettings } from "../../../host/host.js"; import { Checkpoint, type CheckpointJSON } from "../checkpointStore.js"; import { type StopAt } from "./addresses.js"; import { type CheckpointEdit } from "./edits.js"; export type { CheckpointEdit, Refusal } from "./edits.js"; export { checkpointEditSchema, checkpointEditsSchema } from "./edits.js"; export type { StopAt } from "./addresses.js"; export { stopOfCheckpoint } from "./addresses.js"; export type PatchResult = { checkpoint: Checkpoint; applied: string[]; } | { refused: string[]; }; /** The three shapes a resume took before edits: locals, args, and * globals, each a name-value map, written to the checkpoint's own * frame and module. */ export type ResumeOverrides = { locals?: Record; args?: Record; globals?: Record; }; /** A new checkpoint with `edits` applied to a copy of `source`, in * order, validated against the source's invariants, and re-signed * under `settings` when the source was signed; or every reason an * edit was refused, with no checkpoint, so a caller never resumes a * partly edited one. `at` is the stop the edits are made at; a * checkpoint on its own is its own stop. * * Each edit is lowered against the checkpoint as the edits before it * left it, so two edits on one place add up: a second `appendMessage` * on a thread lands after the first. The edits are checked against * their schema first, since a caller outside TypeScript can hand in * any shape. */ export declare function patchCheckpoint(checkpointOrJson: Checkpoint | CheckpointJSON, edits: CheckpointEdit[], settings: HostSettings, at?: StopAt): PatchResult; /** The old override shapes as edits on the frame at `at`, the * checkpoint's own stop when the caller has no stop record. */ export declare function fromOverrides(overrides: ResumeOverrides, checkpoint: Checkpoint | CheckpointJSON, at?: StopAt): CheckpointEdit[];