/** * Removal of DeepSeek DSML tool-call markup left in visible assistant text. * * DeepSeek models on OpenAI-compatible hosts sometimes emit their tool calls as * raw `<|DSML|…>` markup in `content`. A well-formed envelope is healed into a * structured call by `StreamMarkupHealing`, but a degraded model can drop the * opening `<|DSML|tool_calls>` / `<|DSML|invoke name="…">` 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 DSML tool * calls, so DSML text from them is prose and is left alone. */ export declare function isDsmlLeakRecoveryTarget(model: Model): boolean; /** * Strip leaked DSML tool-call markup 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 `message`'s text blocks in place, * dropping blocks left empty. Returns true when anything was removed. */ export declare function removeDsmlToolMarkupLeak(message: AssistantMessage): boolean;