MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / serialize

Function serialize

ts/workflow-core/src/function/serialization.ts:22–26  ·  view source on GitHub ↗
(fn: FunctionDeclaration)

Source from the content-addressed store, hash-verified

20/** Domain declaration → wire pieces: flatten the signature and lift each output's
21 * expression into the `outputAssignments` map keyed by output uid. */
22export function serialize(fn: FunctionDeclaration): SerializedFunction {
23 const outputAssignments: Record<string, Expression> = {};
24 for (const o of fn.outputs) outputAssignments[o.uid] = o.expression;
25 return { functionInfo: toFunctionInfo(fn), outputAssignments };
26}
27
28/** Wire pieces → domain declaration: bundle each `return` with its assignment. A
29 * return with no stored assignment gets an empty expression of the right dataType. */

Callers

nothing calls this directly

Calls 1

toFunctionInfoFunction · 0.90

Tested by

no test coverage detected