(blocks: ContentBlock[] | undefined)
| 1 | import type { ContentBlock } from './aiChat' |
| 2 | |
| 3 | export function toSerializableContentBlocks(blocks: ContentBlock[] | undefined) { |
| 4 | if (!blocks) return undefined |
| 5 | const cloned = JSON.parse(JSON.stringify(blocks)) |
| 6 | for (const block of cloned) { |
| 7 | if (block.type === 'tool') { |
| 8 | delete block.tool.displayResult |
| 9 | } |
| 10 | } |
| 11 | return cloned |
| 12 | } |
no test coverage detected