/** * Tool-output sanitizer. * * Motivation: every module reflects upstream data — IMAP error strings, * OAuth exception messages, CalDAV XML, Slack webhook payloads — back to * the MCP client as tool output. If an upstream library leaks a Bearer * token or IMAP password into a `result.error`, the assistant prints it * verbatim to the human. * * `logger.sanitizeSecrets` already strips 15+ secret shapes from log * strings. This wrapper applies the same scrub to a whole tool response * tree (content text, error messages, deeply nested strings) before the * response goes back on the wire. * * Usage: * return sanitizeToolOutput(jsonResponse(result, isError)); * * Performance: walks the object tree once. Strings are the only type * mutated; numbers / booleans / null pass through unchanged. */ export type ToolOutput = { content: Array<{ type: 'text'; text: string; }>; isError?: boolean; [k: string]: unknown; }; export declare function sanitizeToolOutput(output: T): T; //# sourceMappingURL=sanitize-output.d.ts.map