/** * Fast path for in-band scanners that sit inside a body waiting for one fixed * terminator (a tool-call close tag) and emit nothing until it arrives. * * Appending each delta to the scanner's string buffer and calling `indexOf` on * it flattens the growing rope on every delta, so a long in-band tool call cost * O(n²) copying and scanning. While armed, deltas are set aside and only the new * text plus the terminator-length overlap with what came before is searched; * the buffer is rebuilt once, when the terminator shows up or the stream ends. */ export declare class TerminatorWait { #private; /** Start deferring; `buffered` is the scanner's pending body, known not to contain `terminator`. */ arm(terminator: string, buffered: string): void; /** Take `text` while the terminator is still absent; false means the caller must {@link release} and scan. */ absorb(text: string): boolean; /** Stop deferring and return `buffered` with every absorbed delta appended. */ release(buffered: string): string; }