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

Function getOutputBinding

ts/workflow-core/src/node/methods.ts:23–43  ·  view source on GitHub ↗
(node: NodeData, outputId: string)

Source from the content-addressed store, hash-verified

21 * entries should walk the declaration list directly via `arguments[out.id]`.
22 */
23export function getOutputBinding(node: NodeData, outputId: string): OutputBinding | undefined {
24 const args = node.arguments as Record<string, unknown>;
25
26 if (node.type === "FunctionCall") {
27 return getStaticBinding(args, outputId);
28 }
29
30 const def = NodeRegistry.getByType(node.type);
31 if (!def?.outputs) return undefined;
32
33 for (const out of def.outputs) {
34 if (out.type === "static") {
35 if (out.id === outputId) return getStaticBinding(args, out.id);
36 } else {
37 const entries = args[out.id] as OutputDeclaration[] | undefined;
38 const entry = entries?.find((e) => e.mode === "emit" && e.uid === outputId);
39 if (entry && entry.mode === "emit") return { active: true, mode: "emit", name: entry.name };
40 }
41 }
42 return undefined;
43}
44
45// ---------------------------------------------------------------------------
46// External input requirements for debug mode

Callers 2

renderStaticRowFunction · 0.90
computeNodeDiagnosticsFunction · 0.90

Calls 2

getStaticBindingFunction · 0.85
getByTypeMethod · 0.45

Tested by

no test coverage detected