MCPcopy Index your code
hub / github.com/simstudioai/sim / toDisplayBlock

Function toDisplayBlock

apps/sim/lib/copilot/chat/display-message.ts:51–64  ·  view source on GitHub ↗
(block: PersistedContentBlock)

Source from the content-addressed store, hash-verified

49}
50
51function toDisplayBlock(block: PersistedContentBlock): ContentBlock | undefined {
52 const displayed = toDisplayBlockBody(block)
53 if (!displayed) return undefined
54 if (block.parentToolCallId && displayed.parentToolCallId === undefined) {
55 displayed.parentToolCallId = block.parentToolCallId
56 }
57 if (block.spanId && displayed.spanId === undefined) {
58 displayed.spanId = block.spanId
59 }
60 if (block.parentSpanId && displayed.parentSpanId === undefined) {
61 displayed.parentSpanId = block.parentSpanId
62 }
63 return withBlockTiming(displayed, block)
64}
65
66function toDisplayBlockBody(block: PersistedContentBlock): ContentBlock | undefined {
67 switch (block.type) {

Callers

nothing calls this directly

Calls 2

withBlockTimingFunction · 0.90
toDisplayBlockBodyFunction · 0.85

Tested by

no test coverage detected