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

Function compactBlockLogs

apps/sim/lib/execution/payloads/serializer.ts:255–281  ·  view source on GitHub ↗
(
  logs: BlockLog[] | undefined,
  options: CompactExecutionPayloadOptions = {}
)

Source from the content-addressed store, hash-verified

253}
254
255export async function compactBlockLogs(
256 logs: BlockLog[] | undefined,
257 options: CompactExecutionPayloadOptions = {}
258): Promise<BlockLog[] | undefined> {
259 if (!logs) {
260 return logs
261 }
262
263 return Promise.all(
264 logs.map(async (log) => {
265 const compactedLog = { ...log }
266 if ('input' in compactedLog) {
267 compactedLog.input = await compactExecutionPayload(compactedLog.input, options)
268 }
269 if ('output' in compactedLog) {
270 compactedLog.output = await compactExecutionPayload(compactedLog.output, options)
271 }
272 if ('childTraceSpans' in compactedLog) {
273 compactedLog.childTraceSpans = await compactExecutionPayload(
274 compactedLog.childTraceSpans,
275 options
276 )
277 }
278 return compactedLog
279 })
280 )
281}

Callers 4

runResumeExecutionMethod · 0.90
startFunction · 0.90
compactEntriesFunction · 0.85

Calls 1

compactExecutionPayloadFunction · 0.85

Tested by

no test coverage detected