/** * Strip tool-call markup an LLM emitted as prose. * * Models occasionally write their function-call envelope into the *text* * part of a turn instead of (or as well as) making a real tool call. For a * PTY runtime nobody sees it, but the in-process Crewly Agent forwards its * text straight to Slack and chat, so the user gets a wall of * `…` instead of an answer (2026-09-19, #crewly-support). * * This removes those envelopes — `function_calls` wrappers, `invoke` * blocks and stray `parameter` tags, with or without a namespace prefix — * while leaving fenced code blocks untouched, so an agent that is * deliberately *explaining* the syntax keeps its example. * * @module utils/tool-call-markup */ /** Result of {@link stripToolCallMarkup}. */ export interface StrippedText { /** The text with tool-call envelopes removed and whitespace tidied. */ text: string; /** True when something was removed. */ stripped: boolean; } /** * Whether a string contains something that looks like a tool-call envelope. * * @param raw - Candidate text * @returns True when an `invoke` / `function_calls` tag is present */ export declare function hasToolCallMarkup(raw: string): boolean; /** * Remove tool-call markup from an agent's text response. * * Fenced code blocks (``` … ```) are passed through untouched: markup * inside them is an example the agent meant to show. * * @param raw - The agent's text * @returns The cleaned text and whether anything was removed * * @example * stripToolCallMarkup('Working on it.\n…') * // → { text: 'Working on it.', stripped: true } */ export declare function stripToolCallMarkup(raw: string): StrippedText; //# sourceMappingURL=tool-call-markup.utils.d.ts.map