/** * Capture Agent — Program Patcher * * Applies healer patches to compiled programs. * Patches are applied in-memory during the run, and propagated to * the server ONLY after a fully successful run. */ import type { ExecutionProgram, HealerPatch } from './execution-types.js'; /** * Applies a healer patch to a program in-place. * The original opcode at the given index is replaced by the healer's output. * If the healer produced multiple opcodes, subsequent steps are shifted. * * Returns the modified program (same reference, mutated). */ export declare function applyPatch(program: ExecutionProgram, patch: HealerPatch): ExecutionProgram; /** * Applies all patches from a successful run to a program. * Patches are applied in reverse index order to avoid shifting issues. */ export declare function applyAllPatches(program: ExecutionProgram, patches: HealerPatch[]): ExecutionProgram; /** * Creates a deep clone of a program for safe patching. */ export declare function cloneProgram(program: ExecutionProgram): ExecutionProgram;