/** * Bounded rolling-TAIL accumulator for streaming exec output (sema D2) — FIRST-PARTY, vendor-independent. * * A model-driven `yes` / `cat big.bin` over a 120s/600s shell can emit gigabytes; accumulating it unbounded OOMs * a durable worker. We keep only the LAST `maxBytes` — the tail (errors + the exit code are at the end, which is * what the model needs) — dropping the head as it overflows, plus a count of dropped bytes for a visible marker. * * This lives in `src/core/` — NOT `src/vendor/` — on purpose: it is OUR robustness invariant, shared by the * (currently-vendored) NodeExecutionEnv AND a downstream exec adapter (service host/ssh/adb/docker/k8s, [267]). * One implementation + ONE model-facing marker text = zero drift, and the public export points at a STABLE path * that survives the planned de-vendoring (when NodeExecutionEnv is naturalized out of `src/vendor/`, nothing rebinds). */ export declare const MAX_EXEC_OUTPUT_BYTES: number; /** * Push-based bounded tail: feed it raw output chunks (Buffers); it retains only the last `maxBytes`, dropping the * head incrementally so memory is O(maxBytes) regardless of total output. Byte-precise (the OOM bound is bytes). */ export declare class RollingTailBuffer { private readonly maxBytes; private readonly chunks; private size; private dropped; constructor(maxBytes?: number); /** Append a chunk; evict head bytes (whole or partial chunks) until within `maxBytes`. */ push(chunk: Buffer): void; /** The retained tail decoded as UTF-8, plus how many bytes were dropped off the head. */ result(): { text: string; droppedBytes: number; }; } /** * Prepend a model-visible marker when `droppedBytes > 0` (only the TAIL was kept). The SINGLE source of the * marker wording so the engine and any downstream adapter show the model the SAME thing. */ export declare function markTruncated(text: string, droppedBytes: number): string; //# sourceMappingURL=exec-output-tail.d.ts.map