MCPcopy Create free account
hub / github.com/ShipSecAI/studio / resolveInputValue

Function resolveInputValue

worker/src/temporal/input-resolver.ts:145–173  ·  view source on GitHub ↗
(sourceOutput: unknown, sourceHandle: string)

Source from the content-addressed store, hash-verified

143}
144
145export function resolveInputValue(sourceOutput: unknown, sourceHandle: string): unknown {
146 if (sourceOutput === null || sourceOutput === undefined) {
147 return undefined;
148 }
149
150 if (sourceHandle === '__self__') {
151 return sourceOutput;
152 }
153
154 if (typeof sourceOutput === 'object') {
155 const record = sourceOutput as Record<string, unknown>;
156
157 // If it's a spilled marker, we return the marker itself along with the sourceHandle
158 // The activity will then be responsible for fetching the full data
159 // and extracting the specific handle.
160 if (isSpilledDataMarker(sourceOutput)) {
161 return {
162 ...sourceOutput,
163 __spilled_handle__: sourceHandle,
164 };
165 }
166
167 if (Object.prototype.hasOwnProperty.call(record, sourceHandle)) {
168 return record[sourceHandle];
169 }
170 }
171
172 return undefined;
173}
174
175interface ComponentInputMetadata {
176 id: string;

Callers 1

buildActionPayloadFunction · 0.85

Calls 1

isSpilledDataMarkerFunction · 0.90

Tested by

no test coverage detected