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

Function boundFinalOutput

apps/sim/lib/workspace-events/payload.ts:20–32  ·  view source on GitHub ↗

* Bounds the finalOutput field. Trace spans are never included; the payload * travels through the job queue, so large outputs are serialized and * truncated instead of being passed through whole.

(finalOutput: unknown)

Source from the content-addressed store, hash-verified

18 * truncated instead of being passed through whole.
19 */
20function boundFinalOutput(finalOutput: unknown): unknown {
21 if (finalOutput === undefined || finalOutput === null) return null
22
23 try {
24 const serialized = JSON.stringify(finalOutput)
25 if (serialized === undefined) return null
26 if (serialized.length <= SIM_FINAL_OUTPUT_MAX_BYTES) return finalOutput
27 const suffix = '... [truncated]'
28 return truncate(serialized, SIM_FINAL_OUTPUT_MAX_BYTES - suffix.length, suffix)
29 } catch {
30 return null
31 }
32}
33
34function basePayload(params: {
35 event: SimEventType

Callers 1

summarizeRunFunction · 0.85

Calls 1

truncateFunction · 0.90

Tested by

no test coverage detected