import { type Checkpoint } from "../checkpointStore.js"; import type { GuardJSON } from "../../guard.js"; import { type StopAt } from "./addresses.js"; import { type CheckpointEdit, type Refusal } from "./edits.js"; /** One write an edit lowers to: the path, the whole new value at it, * and the line the UI prints for it. */ export type Write = { jsonPath: string[]; value: unknown; applied: string; }; /** One copy of a guard in the checkpoint: the owning copy on the stack * that pushed it, or a clone on a branch stack below. */ export type GuardCopy = { jsonPath: string[]; json: Partial; owner: boolean; }; export type GuardChange = { limit?: number; disarmed?: boolean; }; /** The writes a guard change means, over every copy. `disarmed` is * written as given to each. A new cost limit goes to the owner only, * since cost clones are rebuilt from it on resume. A new time limit * goes to the owner, and each clone moves by the same difference: a * clone's limit is the time the parent had left when the branch * started, so its remaining time changes by what the budget did. */ export declare function guardWrites(copies: GuardCopy[], change: GuardChange): Write[]; /** The writes `edit` means on `checkpoint`, stopped at `at`, or why it * is refused. Each case picks a locator and a value; the layout of the * JSON is the reader's business. */ export declare function resolve(edit: CheckpointEdit, checkpoint: Checkpoint, at: StopAt): Write[] | Refusal;