/** * Central live healing for leaked reasoning markup in the visible text channel. * * Some providers emit their canonical reasoning idioms (` ```thinking `, * ``, Gemma/Harmony channels, …) into the *visible* text stream instead * of a structured thinking part. {@link wrapLeakedThinkingStream} re-projects any * provider stream into a fresh {@link AssistantMessageEventStream}, splitting the * leaked fences out into proper `thinking` blocks *live* as deltas arrive — so * every provider gets the same healing, not just the three with provider-local * {@link StreamMarkupHealing} loops. * * The healing is idempotent: a second pass over already-clean text finds no * fences, so wrapping a provider that already heals (or wrapping twice) is a * harmless pass-through. Signatures are load-bearing for Google/Gemini/Vertex * thought round-tripping, so text sub-blocks carry the source `textSignature`, * forwarded thinking blocks their `thinkingSignature`, and forwarded tool calls * their `thoughtSignature`. * * Modeled on {@link wrapInbandToolStream} / `InbandStreamProjector` in * `../dialect/owned-stream.ts`, minus all in-band tool-call grammar: tool-call * events are forwarded verbatim. */ import { AssistantMessageEventStream } from "./event-stream"; /** * Wrap a provider stream so leaked reasoning fences are healed into thinking * blocks live, for every provider. Returns a new stream that re-projects the * inner one; the inner stream is fully consumed. */ export declare function wrapLeakedThinkingStream(inner: AssistantMessageEventStream): AssistantMessageEventStream;