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

Function withBlockSpan

apps/sim/lib/copilot/chat/persisted-message.ts:152–157  ·  view source on GitHub ↗

* Carry deterministic span identity (spanId / parentSpanId) across a block * mapping so the nesting tree survives the persist → normalize → display round * trip. Shared by both the write and read paths.

(target: T, src: { spanId?: string; parentSpanId?: string })

Source from the content-addressed store, hash-verified

150 * trip. Shared by both the write and read paths.
151 */
152function withBlockSpan<T>(target: T, src: { spanId?: string; parentSpanId?: string }): T {
153 const writable = target as { spanId?: string; parentSpanId?: string }
154 if (src.spanId) writable.spanId = src.spanId
155 if (src.parentSpanId) writable.parentSpanId = src.parentSpanId
156 return target
157}
158
159function mapContentBlock(block: ContentBlock): PersistedContentBlock {
160 const persisted = mapContentBlockBody(block)

Callers 1

mapContentBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected