MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / toSerializableContentBlocks

Function toSerializableContentBlocks

src/stores/aiChatContentBlocks.ts:3–12  ·  view source on GitHub ↗
(blocks: ContentBlock[] | undefined)

Source from the content-addressed store, hash-verified

1import type { ContentBlock } from './aiChat'
2
3export 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}

Callers 3

saveAIChatMessagesFunction · 0.90
editCurrentRoundOnlyFunction · 0.90

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected