import { type IControllerToolExecution } from '../dist_ts_interfaces/index.js'; /** * A live tool snapshot as a harness adapter produces it, before the controller stamps its * delivery ordering on it. Both session harnesses that bound a live tool payload — OpenCode in * its event stream, Flex in the controller — hand exactly this shape to the bounder below. */ export type TLiveToolSnapshot = Omit; /** * What a bounded live tool snapshot must fit into. The headroom below * `controllerMaxToolEventBytes` covers the envelope the controller wraps the snapshot in — event * type, project and harness identity, timestamps, ordering — so the delivered event stays inside * the budget the browser admits. */ export declare const liveToolExecutionBudgetBytes: number; /** A text bounded to a byte budget, together with whether the bound actually cut it. */ export interface IBoundedToolText { /** A complete-UTF-8 prefix of the original, carrying no marker of its own. */ text: string; truncated: boolean; } /** * Bound a text to a byte budget and say what happened, so no caller has to read the result back * to find out. The prefix is deliberately marker-free: a live payload is covered by the durable * one only while it remains a prefix of it, and a marker written into the value would make that * impossible for good. See `IControllerToolExecution` for the contract. */ export declare const boundToolText: (valueArg: string, byteLimitArg: number) => IBoundedToolText; /** * Bound one live tool snapshot to the live event budget, giving up the least useful payload * first: a structured input, then the tail of an error text, then a structured output, and only * then the tail of the output stream the user is watching. Each step is followed by a fresh * measurement, so a snapshot only loses what it has to. * * Both bounding operations the contract allows are signalled out of band — an elided payload * becomes `controllerLiveToolPayloadNotice`, a truncated text becomes a marker-free prefix plus * its flag — because the receiver retires a live snapshot exactly when the durable tool call * covers it, and an in-band marker could never appear in the durable payload. * * `harnessNameArg` names the harness in the one error this can raise: a snapshot whose identity * alone exceeds the budget is a bug in the harness adapter, not something to send truncated. */ export declare const boundLiveToolExecution: (executionArg: TLiveToolSnapshot, harnessNameArg: string) => TLiveToolSnapshot;