/**
* Conservative stripping for a message-opening `…` block.
*
* Only translated OpenAI text is routed through this module. Native Anthropic thinking blocks
* and byte-exact OpenAI Chat passthrough never reach it. The filter strips at most one complete,
* unnested block; every uncertain shape is released byte-for-byte as ordinary text.
*/
export declare const MAX_THINK_LEAD_BYTES = 512;
export declare const MAX_THINK_HELD_BYTES: number;
/**
* Four-state text filter shared by buffered and streaming translation.
*
* `inside-think` retains the candidate block until its close is proven. That bounded rollback
* buffer is what makes an unclosed or nested block lossless instead of silently deleting text.
*/
export declare class ThinkTagStripFilter {
private state;
private held;
private bodyStart;
private scanFrom;
push(text: string): string;
/**
* Release every undecided byte when the message/text block ends.
*
* A table, not an `if`/`else`: this filter's whole purpose is losslessness, so a future state
* that HOLDS bytes must be a compile error here rather than falling into the empty return and
* silently deleting them. `done` and `pass-through` return empty because both have already
* released and cleared their held text.
*/
flush(): string;
private decideLead;
private inspectThink;
private releaseLosslessly;
}
/** Strip one complete opening block, or return the original text on any doubt. */
export declare function stripOpeningThinkTag(text: string): string;
/**
* Rewrite translated Anthropic SSE text deltas through the strip filter. All non-text frames pass
* through; held doubtful text is emitted before its content block closes, preserving SSE order.
*/
export declare function stripThinkTagsInStream(upstream: ReadableStream): ReadableStream;