| 40 | return result; |
| 41 | } |
| 42 | export function sanitizeFilename(text: string): string { |
| 43 | // Replace special characters with hyphens |
| 44 | return text.toLowerCase().replace(/[^a-z0-9\s-]/g, '') // Remove special chars |
| 45 | .replace(/\s+/g, '-') // Replace spaces with hyphens |
| 46 | .replace(/-+/g, '-') // Replace multiple hyphens with single |
| 47 | .replace(/^-|-$/g, ''); // Remove leading/trailing hyphens |
| 48 | } |
| 49 | async function exportWithReactRenderer(context: ToolUseContext): Promise<string> { |
| 50 | const tools = context.options.tools || []; |
| 51 | return renderMessagesToPlainText(context.messages, tools); |