From 6249aa703e71f2fa3aa1b5f77266ab36231985b4 Mon Sep 17 00:00:00 2001 From: Jacobcdsmith <88069592+Jacobcdsmith@users.noreply.github.com> Date: Thu, 3 Sep 2026 15:16:01 +0000 Subject: [PATCH] feat: add Data Transform and Array Loop Iterator nodes with runtime execution and codegen support --- frontend/src/flow/AgentNode.tsx | 2 + frontend/src/flow/Inspector.tsx | 15 ++ frontend/src/flow/Palette.tsx | 2 + frontend/src/flow/codegen.ts | 82 ++++++- frontend/src/flow/runFlow.ts | 162 ++++++++++++- frontend/src/flow/types.ts | 27 +++ frontend/src/flow/validate.ts | 18 ++ frontend/src/test/transformAndLoop.test.ts | 263 +++++++++++++++++++++ 8 files changed, 569 insertions(+), 2 deletions(-) create mode 100644 frontend/src/test/transformAndLoop.test.ts diff --git a/frontend/src/flow/AgentNode.tsx b/frontend/src/flow/AgentNode.tsx index b14d380..7df6b9e 100644 --- a/frontend/src/flow/AgentNode.tsx +++ b/frontend/src/flow/AgentNode.tsx @@ -13,6 +13,8 @@ const KIND_COLOR: Record = { sink: "hsl(var(--node-sink))", http: "hsl(var(--node-http))", script: "hsl(var(--node-script))", + transform: "hsl(280 75% 55%)", + loop: "hsl(190 85% 45%)", note: "hsl(45 90% 48%)", }; diff --git a/frontend/src/flow/Inspector.tsx b/frontend/src/flow/Inspector.tsx index 02335cb..31a874a 100644 --- a/frontend/src/flow/Inspector.tsx +++ b/frontend/src/flow/Inspector.tsx @@ -64,6 +64,21 @@ export function Inspector({ /> + {node.data.kind === "transform" && ( +
+ + Operation Preset Guide + +

+ {node.data.config?.operation === "pick_fields" && "Pick Fields: extracts listed properties (e.g. 'id, title, status') from input object."} + {node.data.config?.operation === "template_string" && "Template String: interpolates '{{state.val}}', '{{global.KEY}}', and '{{secret.KEY}}'."} + {node.data.config?.operation === "set_keys" && "Set Keys: assigns JSON key-value pairs directly onto execution state."} + {node.data.config?.operation === "flatten_object" && "Flatten Object: flattens nested JSON objects into top-level dot-notation keys."} + {(!node.data.config?.operation || node.data.config?.operation === "json_map") && "JSON Map: renames input object keys based on JSON mapping params."} +

+
+ )} + {meta.configFields.map((f) => (