import type { Host } from "../host/host.js"; import type { StateStack } from "./state/stateStack.js"; /** Install a root cost/time budget. Applies the disable rule: cost < 0 installs * nothing; time <= 0 installs nothing (cost 0 IS a real limit — no paid spend, * local-models-only). Called once at the root, next to installRunPolicyHandler, * before the node body runs, so the budget is outermost and cannot be bypassed. * No-op in IPC subprocesses — a child's budget is owned by the parent's guard, * which meters the subprocess through the branch clone. * * pushGuard() installs immediately, so a time budget's clock starts at run * start — the intended whole-run semantics. Interrupt halts and input() waits * still pause it like any other time guard. */ export declare function installRootBudget(stack: StateStack, host: Host, contextBudget?: { maxCost?: number; maxTimeMs?: number; }): void; /** Re-assert the root budget on a RESUMED exec context. The root guard is * serialized with the checkpoint, so on a stateless served resume its limit * arrives from a client-controllable payload — a crafted resume could raise the * ceiling. Clamp the restored root guard's LIMIT to the host value while * KEEPING the guard (and its accumulated spend/elapsed): * * - the limit becomes host-authoritative and un-raisable from the client; * - accumulated spend is preserved, so the trusted in-process CLI resume path * stays cumulative across legs — no regression — and a served client that * lowers its own reported spend only hurts itself (same residual gap a * stateless resume always has); * - arming is untouched (restored guards are un-armed by restoreState), so this * can't reintroduce a timer pop-race. * * A dimension the host no longer caps has its restored root guard dropped * (through `uninstall`); a dimension the host caps but the checkpoint had no * root guard for gets a fresh guard. No-op in IPC. */ export declare function reinstallRootBudget(stack: StateStack, host: Host, contextBudget?: { maxCost?: number; maxTimeMs?: number; }): void;