MCPcopy
hub / github.com/simstudioai/sim / extractOutputValue

Function extractOutputValue

apps/sim/lib/workflows/streaming/streaming.ts:111–136  ·  view source on GitHub ↗
(
  output: unknown,
  path: string,
  context: OutputExtractionContext
)

Source from the content-addressed store, hash-verified

109> & { base64MaxBytes?: number }
110
111async function extractOutputValue(
112 output: unknown,
113 path: string,
114 context: OutputExtractionContext
115): Promise<unknown> {
116 const parsedOutput = parseOutputContentSafely(output)
117 const outputValue = path
118 ? await navigatePathAsync(parsedOutput, path.split('.'), {
119 executionContext: {
120 workflowId: context.workflowId ?? '',
121 workspaceId: context.workspaceId,
122 executionId: context.executionId,
123 largeValueExecutionIds: context.largeValueExecutionIds,
124 largeValueKeys: context.largeValueKeys,
125 fileKeys: context.fileKeys,
126 allowLargeValueWorkflowScope: context.allowLargeValueWorkflowScope,
127 userId: context.userId,
128 metadata: { requestId: context.requestId },
129 base64MaxBytes: context.base64MaxBytes,
130 },
131 allowLargeValueRefs: true,
132 })
133 : parsedOutput
134
135 return outputValue
136}
137
138function isDangerousKey(key: string): boolean {
139 return DANGEROUS_KEYS.includes(key)

Callers 2

buildMinimalResultFunction · 0.85
onBlockCompleteCallbackFunction · 0.85

Calls 2

parseOutputContentSafelyFunction · 0.90
navigatePathAsyncFunction · 0.90

Tested by

no test coverage detected