/** * Removal of DeepSeek tool-call markup left in visible assistant text. * * DeepSeek models on OpenAI-compatible hosts sometimes emit their tool calls as * text in `content`: the V4 `<|DSML|…>` envelope or the V3 chat-template * tokens (`<|tool▁calls▁begin|>` …). A well-formed call is healed into a * structured call by `StreamMarkupHealing`, but a degraded model can drop * required tags (or the host runs no healer at all). That markup must not stay * in history: replaying it teaches the model to keep writing tool calls as text * (issue #10556). Callers strip it before the message is committed and tell the * model its call failed. */ import type { AssistantMessage, Model } from "../types.js"; /** * Whether DSML leak recovery applies to `model`: a DeepSeek-class model, or one * explicitly configured with the `dsml` stream healer (e.g. a `models.yml` entry * whose id the classifier cannot place). Other models never write DeepSeek tool * calls, so such markup from them is prose and is left alone. */ export declare function isDsmlLeakRecoveryTarget(model: Model): boolean; /** * Strip leaked DeepSeek tool-call markup (DSML or chat-template tokens) from * `text`, leaving quoted code intact. Returns `undefined` when `text` carries * no such markup. */ export declare function stripDsmlToolMarkup(text: string): string | undefined; /** * Remove leaked DSML tool-call markup from an assistant message before commit, * including reasoning blocks and turns with valid structured calls. Rewritten * thinking with an opaque signature is discarded; OpenAI-compatible reasoning * field names are replay markers, not signatures, and survive cleanup. */ export declare function removeDsmlToolMarkupLeak(message: AssistantMessage): boolean;