@foresthubai/workflow-builder 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/LICENSE +661 -661
  2. package/NOTICE +16 -16
  3. package/README.md +110 -110
  4. package/dist/BuilderLayout.d.ts.map +1 -1
  5. package/dist/BuilderLayout.js +52 -61
  6. package/dist/BuilderLayout.js.map +1 -1
  7. package/dist/Canvas.d.ts.map +1 -1
  8. package/dist/Canvas.js +10 -3
  9. package/dist/Canvas.js.map +1 -1
  10. package/dist/CanvasEditor.d.ts.map +1 -1
  11. package/dist/CanvasEditor.js.map +1 -1
  12. package/dist/CanvasTabsToolbar.d.ts.map +1 -1
  13. package/dist/CanvasTabsToolbar.js +3 -0
  14. package/dist/CanvasTabsToolbar.js.map +1 -1
  15. package/dist/RightConfigPanel.d.ts.map +1 -1
  16. package/dist/RightConfigPanel.js +3 -0
  17. package/dist/RightConfigPanel.js.map +1 -1
  18. package/dist/WorkflowBuilder.d.ts +7 -13
  19. package/dist/WorkflowBuilder.d.ts.map +1 -1
  20. package/dist/WorkflowBuilder.js +25 -13
  21. package/dist/WorkflowBuilder.js.map +1 -1
  22. package/dist/cn.d.ts.map +1 -1
  23. package/dist/cn.js +3 -0
  24. package/dist/cn.js.map +1 -1
  25. package/dist/components/ui/add-button.d.ts.map +1 -1
  26. package/dist/components/ui/add-button.js +3 -0
  27. package/dist/components/ui/add-button.js.map +1 -1
  28. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  29. package/dist/components/ui/alert-dialog.js +3 -0
  30. package/dist/components/ui/alert-dialog.js.map +1 -1
  31. package/dist/components/ui/alert.d.ts.map +1 -1
  32. package/dist/components/ui/alert.js +3 -0
  33. package/dist/components/ui/alert.js.map +1 -1
  34. package/dist/components/ui/badge.d.ts.map +1 -1
  35. package/dist/components/ui/badge.js.map +1 -1
  36. package/dist/components/ui/button.d.ts.map +1 -1
  37. package/dist/components/ui/button.js +3 -0
  38. package/dist/components/ui/button.js.map +1 -1
  39. package/dist/components/ui/card.d.ts.map +1 -1
  40. package/dist/components/ui/card.js +3 -0
  41. package/dist/components/ui/card.js.map +1 -1
  42. package/dist/components/ui/checkbox.d.ts.map +1 -1
  43. package/dist/components/ui/checkbox.js +3 -0
  44. package/dist/components/ui/checkbox.js.map +1 -1
  45. package/dist/components/ui/collapsible.d.ts.map +1 -1
  46. package/dist/components/ui/collapsible.js +3 -0
  47. package/dist/components/ui/collapsible.js.map +1 -1
  48. package/dist/components/ui/command.d.ts +2 -2
  49. package/dist/components/ui/command.d.ts.map +1 -1
  50. package/dist/components/ui/command.js +3 -0
  51. package/dist/components/ui/command.js.map +1 -1
  52. package/dist/components/ui/delete-button.d.ts.map +1 -1
  53. package/dist/components/ui/delete-button.js +3 -0
  54. package/dist/components/ui/delete-button.js.map +1 -1
  55. package/dist/components/ui/dialog.d.ts.map +1 -1
  56. package/dist/components/ui/dialog.js +3 -0
  57. package/dist/components/ui/dialog.js.map +1 -1
  58. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  59. package/dist/components/ui/dropdown-menu.js +3 -0
  60. package/dist/components/ui/dropdown-menu.js.map +1 -1
  61. package/dist/components/ui/input.d.ts +1 -1
  62. package/dist/components/ui/input.d.ts.map +1 -1
  63. package/dist/components/ui/input.js +3 -0
  64. package/dist/components/ui/input.js.map +1 -1
  65. package/dist/components/ui/label.d.ts.map +1 -1
  66. package/dist/components/ui/label.js +3 -0
  67. package/dist/components/ui/label.js.map +1 -1
  68. package/dist/components/ui/readonly-banner.d.ts.map +1 -1
  69. package/dist/components/ui/readonly-banner.js +3 -0
  70. package/dist/components/ui/readonly-banner.js.map +1 -1
  71. package/dist/components/ui/resizable.d.ts +1 -1
  72. package/dist/components/ui/resizable.d.ts.map +1 -1
  73. package/dist/components/ui/resizable.js +3 -0
  74. package/dist/components/ui/resizable.js.map +1 -1
  75. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  76. package/dist/components/ui/scroll-area.js +3 -0
  77. package/dist/components/ui/scroll-area.js.map +1 -1
  78. package/dist/components/ui/select.d.ts.map +1 -1
  79. package/dist/components/ui/select.js +3 -0
  80. package/dist/components/ui/select.js.map +1 -1
  81. package/dist/components/ui/separator.d.ts.map +1 -1
  82. package/dist/components/ui/separator.js +3 -0
  83. package/dist/components/ui/separator.js.map +1 -1
  84. package/dist/components/ui/switch.d.ts.map +1 -1
  85. package/dist/components/ui/switch.js +3 -0
  86. package/dist/components/ui/switch.js.map +1 -1
  87. package/dist/components/ui/textarea.d.ts +1 -1
  88. package/dist/components/ui/textarea.d.ts.map +1 -1
  89. package/dist/components/ui/textarea.js +3 -0
  90. package/dist/components/ui/textarea.js.map +1 -1
  91. package/dist/components/ui/toast.d.ts.map +1 -1
  92. package/dist/components/ui/toast.js +3 -0
  93. package/dist/components/ui/toast.js.map +1 -1
  94. package/dist/components/ui/toaster.d.ts.map +1 -1
  95. package/dist/components/ui/toaster.js +3 -0
  96. package/dist/components/ui/toaster.js.map +1 -1
  97. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  98. package/dist/components/ui/toggle-group.js +3 -0
  99. package/dist/components/ui/toggle-group.js.map +1 -1
  100. package/dist/components/ui/toggle.d.ts.map +1 -1
  101. package/dist/components/ui/toggle.js +3 -0
  102. package/dist/components/ui/toggle.js.map +1 -1
  103. package/dist/components/ui/tooltip.d.ts.map +1 -1
  104. package/dist/components/ui/tooltip.js +3 -0
  105. package/dist/components/ui/tooltip.js.map +1 -1
  106. package/dist/dialogs/NodePickerDialog.d.ts.map +1 -1
  107. package/dist/dialogs/NodePickerDialog.js +3 -0
  108. package/dist/dialogs/NodePickerDialog.js.map +1 -1
  109. package/dist/dialogs/ValidationDialog.d.ts.map +1 -1
  110. package/dist/dialogs/ValidationDialog.js +3 -0
  111. package/dist/dialogs/ValidationDialog.js.map +1 -1
  112. package/dist/graph/BaseNode.d.ts.map +1 -1
  113. package/dist/graph/BaseNode.js +21 -16
  114. package/dist/graph/BaseNode.js.map +1 -1
  115. package/dist/graph/CustomEdge.d.ts.map +1 -1
  116. package/dist/graph/CustomEdge.js +4 -1
  117. package/dist/graph/CustomEdge.js.map +1 -1
  118. package/dist/graph/CustomNode.d.ts.map +1 -1
  119. package/dist/graph/CustomNode.js +3 -0
  120. package/dist/graph/CustomNode.js.map +1 -1
  121. package/dist/graph/FunctionCallNode.d.ts.map +1 -1
  122. package/dist/graph/FunctionCallNode.js.map +1 -1
  123. package/dist/graph/PortHandle.d.ts.map +1 -1
  124. package/dist/graph/PortHandle.js.map +1 -1
  125. package/dist/graph/reactFlowRegistry.d.ts.map +1 -1
  126. package/dist/graph/reactFlowRegistry.js +3 -0
  127. package/dist/graph/reactFlowRegistry.js.map +1 -1
  128. package/dist/hooks/use-toast.d.ts.map +1 -1
  129. package/dist/hooks/use-toast.js +3 -0
  130. package/dist/hooks/use-toast.js.map +1 -1
  131. package/dist/hooks/useAvailableVariables.d.ts.map +1 -1
  132. package/dist/hooks/useAvailableVariables.js +3 -0
  133. package/dist/hooks/useAvailableVariables.js.map +1 -1
  134. package/dist/hooks/useCanvasHistory.d.ts.map +1 -1
  135. package/dist/hooks/useCanvasHistory.js +3 -0
  136. package/dist/hooks/useCanvasHistory.js.map +1 -1
  137. package/dist/hooks/useCanvasTabs.d.ts.map +1 -1
  138. package/dist/hooks/useCanvasTabs.js +3 -0
  139. package/dist/hooks/useCanvasTabs.js.map +1 -1
  140. package/dist/hooks/useFunctionDiagnosticsSync.d.ts.map +1 -1
  141. package/dist/hooks/useFunctionDiagnosticsSync.js +3 -0
  142. package/dist/hooks/useFunctionDiagnosticsSync.js.map +1 -1
  143. package/dist/hooks/useFunctionRegistry.d.ts.map +1 -1
  144. package/dist/hooks/useFunctionRegistry.js +3 -0
  145. package/dist/hooks/useFunctionRegistry.js.map +1 -1
  146. package/dist/hooks/useFunctions.d.ts.map +1 -1
  147. package/dist/hooks/useFunctions.js +3 -0
  148. package/dist/hooks/useFunctions.js.map +1 -1
  149. package/dist/hooks/useGraph.d.ts.map +1 -1
  150. package/dist/hooks/useGraph.js +3 -0
  151. package/dist/hooks/useGraph.js.map +1 -1
  152. package/dist/hooks/useNodeDefinitions.d.ts.map +1 -1
  153. package/dist/hooks/useNodeDefinitions.js +3 -0
  154. package/dist/hooks/useNodeDefinitions.js.map +1 -1
  155. package/dist/hooks/useParamErrors.d.ts.map +1 -1
  156. package/dist/hooks/useParamErrors.js +3 -0
  157. package/dist/hooks/useParamErrors.js.map +1 -1
  158. package/dist/hooks/useResolvedTheme.d.ts.map +1 -1
  159. package/dist/hooks/useResolvedTheme.js +3 -0
  160. package/dist/hooks/useResolvedTheme.js.map +1 -1
  161. package/dist/hooks/useResourceDiagnosticsSync.d.ts.map +1 -1
  162. package/dist/hooks/useResourceDiagnosticsSync.js +3 -0
  163. package/dist/hooks/useResourceDiagnosticsSync.js.map +1 -1
  164. package/dist/hooks/useSuppressThemeTransition.d.ts.map +1 -1
  165. package/dist/hooks/useSuppressThemeTransition.js +3 -0
  166. package/dist/hooks/useSuppressThemeTransition.js.map +1 -1
  167. package/dist/hooks/useWorkflowSerialization.d.ts.map +1 -1
  168. package/dist/hooks/useWorkflowSerialization.js +3 -0
  169. package/dist/hooks/useWorkflowSerialization.js.map +1 -1
  170. package/dist/i18n/index.d.ts.map +1 -1
  171. package/dist/i18n/index.js +3 -0
  172. package/dist/i18n/index.js.map +1 -1
  173. package/dist/index.d.ts +1 -1
  174. package/dist/index.d.ts.map +1 -1
  175. package/dist/index.js +3 -0
  176. package/dist/index.js.map +1 -1
  177. package/dist/inputs/ExpressionInput.d.ts.map +1 -1
  178. package/dist/inputs/ExpressionInput.js +3 -0
  179. package/dist/inputs/ExpressionInput.js.map +1 -1
  180. package/dist/inputs/ParameterEditor.d.ts.map +1 -1
  181. package/dist/inputs/ParameterEditor.js +3 -0
  182. package/dist/inputs/ParameterEditor.js.map +1 -1
  183. package/dist/inputs/PortSection.d.ts.map +1 -1
  184. package/dist/inputs/PortSection.js.map +1 -1
  185. package/dist/mode.d.ts +11 -0
  186. package/dist/mode.d.ts.map +1 -0
  187. package/dist/mode.js +8 -0
  188. package/dist/mode.js.map +1 -0
  189. package/dist/panels/BuilderSidebar.d.ts.map +1 -1
  190. package/dist/panels/BuilderSidebar.js +3 -0
  191. package/dist/panels/BuilderSidebar.js.map +1 -1
  192. package/dist/panels/ChannelConfigPanel.d.ts.map +1 -1
  193. package/dist/panels/ChannelConfigPanel.js +3 -0
  194. package/dist/panels/ChannelConfigPanel.js.map +1 -1
  195. package/dist/panels/ChannelsPanel.d.ts.map +1 -1
  196. package/dist/panels/ChannelsPanel.js +3 -0
  197. package/dist/panels/ChannelsPanel.js.map +1 -1
  198. package/dist/panels/DebugConsolePanel.d.ts.map +1 -1
  199. package/dist/panels/DebugConsolePanel.js +3 -0
  200. package/dist/panels/DebugConsolePanel.js.map +1 -1
  201. package/dist/panels/DebugContextPanel.d.ts.map +1 -1
  202. package/dist/panels/DebugContextPanel.js +3 -0
  203. package/dist/panels/DebugContextPanel.js.map +1 -1
  204. package/dist/panels/DebugExternalIOPanel.d.ts.map +1 -1
  205. package/dist/panels/DebugExternalIOPanel.js +3 -0
  206. package/dist/panels/DebugExternalIOPanel.js.map +1 -1
  207. package/dist/panels/DiagnosticsPanel.d.ts.map +1 -1
  208. package/dist/panels/DiagnosticsPanel.js +3 -0
  209. package/dist/panels/DiagnosticsPanel.js.map +1 -1
  210. package/dist/panels/EdgeConfigPanel.d.ts.map +1 -1
  211. package/dist/panels/EdgeConfigPanel.js +4 -1
  212. package/dist/panels/EdgeConfigPanel.js.map +1 -1
  213. package/dist/panels/FunctionConfigPanel.d.ts.map +1 -1
  214. package/dist/panels/FunctionConfigPanel.js +4 -1
  215. package/dist/panels/FunctionConfigPanel.js.map +1 -1
  216. package/dist/panels/FunctionListPanel.d.ts.map +1 -1
  217. package/dist/panels/FunctionListPanel.js +3 -0
  218. package/dist/panels/FunctionListPanel.js.map +1 -1
  219. package/dist/panels/MemoryConfigPanel.d.ts.map +1 -1
  220. package/dist/panels/MemoryConfigPanel.js +3 -0
  221. package/dist/panels/MemoryConfigPanel.js.map +1 -1
  222. package/dist/panels/MemoryPanel.d.ts.map +1 -1
  223. package/dist/panels/MemoryPanel.js +3 -0
  224. package/dist/panels/MemoryPanel.js.map +1 -1
  225. package/dist/panels/ModelConfigPanel.d.ts.map +1 -1
  226. package/dist/panels/ModelConfigPanel.js +3 -0
  227. package/dist/panels/ModelConfigPanel.js.map +1 -1
  228. package/dist/panels/ModelsPanel.d.ts.map +1 -1
  229. package/dist/panels/ModelsPanel.js +3 -0
  230. package/dist/panels/ModelsPanel.js.map +1 -1
  231. package/dist/panels/NodeConfigPanel.d.ts.map +1 -1
  232. package/dist/panels/NodeConfigPanel.js +4 -1
  233. package/dist/panels/NodeConfigPanel.js.map +1 -1
  234. package/dist/panels/NodeLibrary.d.ts.map +1 -1
  235. package/dist/panels/NodeLibrary.js +4 -1
  236. package/dist/panels/NodeLibrary.js.map +1 -1
  237. package/dist/panels/ResourceConfigPanel.d.ts.map +1 -1
  238. package/dist/panels/ResourceConfigPanel.js +4 -1
  239. package/dist/panels/ResourceConfigPanel.js.map +1 -1
  240. package/dist/panels/ResourceListPanel.d.ts.map +1 -1
  241. package/dist/panels/ResourceListPanel.js +4 -1
  242. package/dist/panels/ResourceListPanel.js.map +1 -1
  243. package/dist/panels/VariableConfigPanel.d.ts.map +1 -1
  244. package/dist/panels/VariableConfigPanel.js +4 -1
  245. package/dist/panels/VariableConfigPanel.js.map +1 -1
  246. package/dist/panels/VariablesPanel.d.ts.map +1 -1
  247. package/dist/panels/VariablesPanel.js +4 -1
  248. package/dist/panels/VariablesPanel.js.map +1 -1
  249. package/dist/stores/canvasStore.d.ts.map +1 -1
  250. package/dist/stores/canvasStore.js +3 -0
  251. package/dist/stores/canvasStore.js.map +1 -1
  252. package/dist/stores/debugStore.d.ts.map +1 -1
  253. package/dist/stores/debugStore.js +3 -0
  254. package/dist/stores/debugStore.js.map +1 -1
  255. package/dist/stores/diagnosticsStore.d.ts.map +1 -1
  256. package/dist/stores/diagnosticsStore.js +3 -0
  257. package/dist/stores/diagnosticsStore.js.map +1 -1
  258. package/dist/stores/editorStore.d.ts +1 -1
  259. package/dist/stores/editorStore.d.ts.map +1 -1
  260. package/dist/stores/editorStore.js +3 -0
  261. package/dist/stores/editorStore.js.map +1 -1
  262. package/dist/utils/categoryConstants.d.ts.map +1 -1
  263. package/dist/utils/categoryConstants.js +3 -0
  264. package/dist/utils/categoryConstants.js.map +1 -1
  265. package/dist/utils/channelOperations.d.ts.map +1 -1
  266. package/dist/utils/channelOperations.js +3 -0
  267. package/dist/utils/channelOperations.js.map +1 -1
  268. package/dist/utils/connectionRules.d.ts +3 -1
  269. package/dist/utils/connectionRules.d.ts.map +1 -1
  270. package/dist/utils/connectionRules.js +11 -16
  271. package/dist/utils/connectionRules.js.map +1 -1
  272. package/dist/utils/functionOperations.d.ts.map +1 -1
  273. package/dist/utils/functionOperations.js +3 -0
  274. package/dist/utils/functionOperations.js.map +1 -1
  275. package/dist/utils/graphOperations.d.ts.map +1 -1
  276. package/dist/utils/graphOperations.js +3 -0
  277. package/dist/utils/graphOperations.js.map +1 -1
  278. package/dist/utils/history.d.ts.map +1 -1
  279. package/dist/utils/history.js +4 -1
  280. package/dist/utils/history.js.map +1 -1
  281. package/dist/utils/memoryOperations.d.ts.map +1 -1
  282. package/dist/utils/memoryOperations.js +3 -0
  283. package/dist/utils/memoryOperations.js.map +1 -1
  284. package/dist/utils/migrateFunctionNodes.d.ts.map +1 -1
  285. package/dist/utils/migrateFunctionNodes.js +3 -0
  286. package/dist/utils/migrateFunctionNodes.js.map +1 -1
  287. package/dist/utils/modelOperations.d.ts.map +1 -1
  288. package/dist/utils/modelOperations.js +3 -0
  289. package/dist/utils/modelOperations.js.map +1 -1
  290. package/dist/utils/paramDisplay.d.ts.map +1 -1
  291. package/dist/utils/paramDisplay.js +3 -0
  292. package/dist/utils/paramDisplay.js.map +1 -1
  293. package/dist/utils/resourceHelpers.d.ts.map +1 -1
  294. package/dist/utils/resourceHelpers.js +3 -0
  295. package/dist/utils/resourceHelpers.js.map +1 -1
  296. package/dist/utils/translation.d.ts.map +1 -1
  297. package/dist/utils/translation.js +3 -0
  298. package/dist/utils/translation.js.map +1 -1
  299. package/dist/utils/variableOperations.d.ts.map +1 -1
  300. package/dist/utils/variableOperations.js +3 -0
  301. package/dist/utils/variableOperations.js.map +1 -1
  302. package/package.json +2 -2
  303. package/src/BuilderLayout.tsx +338 -345
  304. package/src/Canvas.tsx +270 -261
  305. package/src/CanvasEditor.tsx +146 -142
  306. package/src/CanvasTabsToolbar.tsx +180 -176
  307. package/src/RightConfigPanel.tsx +270 -266
  308. package/src/WorkflowBuilder.tsx +423 -408
  309. package/src/cn.ts +10 -6
  310. package/src/components/ui/add-button.tsx +43 -39
  311. package/src/components/ui/alert-dialog.tsx +145 -141
  312. package/src/components/ui/alert.tsx +63 -59
  313. package/src/components/ui/badge.tsx +40 -36
  314. package/src/components/ui/button.tsx +89 -85
  315. package/src/components/ui/card.tsx +83 -79
  316. package/src/components/ui/checkbox.tsx +32 -28
  317. package/src/components/ui/collapsible.tsx +13 -9
  318. package/src/components/ui/command.tsx +157 -153
  319. package/src/components/ui/delete-button.tsx +27 -23
  320. package/src/components/ui/dialog.tsx +129 -125
  321. package/src/components/ui/dropdown-menu.tsx +202 -198
  322. package/src/components/ui/input.tsx +59 -55
  323. package/src/components/ui/label.tsx +28 -24
  324. package/src/components/ui/readonly-banner.tsx +19 -15
  325. package/src/components/ui/resizable.tsx +47 -43
  326. package/src/components/ui/scroll-area.tsx +106 -102
  327. package/src/components/ui/select.tsx +164 -160
  328. package/src/components/ui/separator.tsx +33 -29
  329. package/src/components/ui/switch.tsx +31 -27
  330. package/src/components/ui/textarea.tsx +55 -51
  331. package/src/components/ui/toast.tsx +131 -127
  332. package/src/components/ui/toaster.tsx +37 -33
  333. package/src/components/ui/toggle-group.tsx +63 -59
  334. package/src/components/ui/toggle.tsx +47 -43
  335. package/src/components/ui/tooltip.tsx +36 -32
  336. package/src/dialogs/NodePickerDialog.tsx +88 -84
  337. package/src/dialogs/ValidationDialog.tsx +188 -184
  338. package/src/graph/BaseNode.tsx +563 -557
  339. package/src/graph/CustomEdge.tsx +189 -185
  340. package/src/graph/CustomNode.tsx +20 -16
  341. package/src/graph/FunctionCallNode.tsx +34 -30
  342. package/src/graph/PortHandle.tsx +193 -189
  343. package/src/graph/reactFlowRegistry.ts +30 -26
  344. package/src/hooks/use-toast.ts +129 -125
  345. package/src/hooks/useAvailableVariables.ts +24 -20
  346. package/src/hooks/useCanvasHistory.ts +26 -22
  347. package/src/hooks/useCanvasTabs.ts +172 -168
  348. package/src/hooks/useFunctionDiagnosticsSync.ts +44 -40
  349. package/src/hooks/useFunctionRegistry.ts +30 -26
  350. package/src/hooks/useFunctions.ts +48 -44
  351. package/src/hooks/useGraph.ts +165 -161
  352. package/src/hooks/useNodeDefinitions.ts +86 -82
  353. package/src/hooks/useParamErrors.ts +30 -26
  354. package/src/hooks/useResolvedTheme.ts +34 -30
  355. package/src/hooks/useResourceDiagnosticsSync.ts +62 -58
  356. package/src/hooks/useSuppressThemeTransition.ts +83 -79
  357. package/src/hooks/useWorkflowSerialization.ts +145 -141
  358. package/src/i18n/index.ts +57 -53
  359. package/src/i18n/locales/de.json +501 -501
  360. package/src/i18n/locales/en.json +557 -557
  361. package/src/index.ts +31 -27
  362. package/src/inputs/ExpressionInput.tsx +301 -297
  363. package/src/inputs/ParameterEditor.tsx +519 -515
  364. package/src/inputs/PortSection.tsx +148 -144
  365. package/src/mode.ts +15 -0
  366. package/src/panels/BuilderSidebar.tsx +305 -301
  367. package/src/panels/ChannelConfigPanel.tsx +53 -49
  368. package/src/panels/ChannelsPanel.tsx +32 -28
  369. package/src/panels/DebugConsolePanel.tsx +77 -73
  370. package/src/panels/DebugContextPanel.tsx +81 -77
  371. package/src/panels/DebugExternalIOPanel.tsx +184 -180
  372. package/src/panels/DiagnosticsPanel.tsx +174 -170
  373. package/src/panels/EdgeConfigPanel.tsx +108 -104
  374. package/src/panels/FunctionConfigPanel.tsx +183 -179
  375. package/src/panels/FunctionListPanel.tsx +49 -45
  376. package/src/panels/MemoryConfigPanel.tsx +59 -55
  377. package/src/panels/MemoryPanel.tsx +44 -40
  378. package/src/panels/ModelConfigPanel.tsx +45 -41
  379. package/src/panels/ModelsPanel.tsx +40 -36
  380. package/src/panels/NodeConfigPanel.tsx +634 -630
  381. package/src/panels/NodeLibrary.tsx +292 -288
  382. package/src/panels/ResourceConfigPanel.tsx +136 -132
  383. package/src/panels/ResourceListPanel.tsx +117 -113
  384. package/src/panels/VariableConfigPanel.tsx +165 -161
  385. package/src/panels/VariablesPanel.tsx +149 -145
  386. package/src/stores/canvasStore.test.ts +48 -44
  387. package/src/stores/canvasStore.ts +249 -245
  388. package/src/stores/debugStore.ts +78 -74
  389. package/src/stores/diagnosticsStore.ts +134 -130
  390. package/src/stores/editorStore.ts +194 -190
  391. package/src/styles/index.css +526 -526
  392. package/src/utils/categoryConstants.ts +30 -26
  393. package/src/utils/channelOperations.ts +90 -86
  394. package/src/utils/connectionRules.ts +140 -137
  395. package/src/utils/functionOperations.ts +183 -179
  396. package/src/utils/graphOperations.ts +554 -550
  397. package/src/utils/history.test.ts +92 -0
  398. package/src/utils/history.ts +211 -207
  399. package/src/utils/memoryOperations.ts +61 -57
  400. package/src/utils/migrateFunctionNodes.ts +111 -107
  401. package/src/utils/modelOperations.ts +59 -55
  402. package/src/utils/paramDisplay.ts +75 -71
  403. package/src/utils/resourceHelpers.ts +36 -32
  404. package/src/utils/translation.ts +32 -28
  405. package/src/utils/variableOperations.ts +79 -75
  406. package/tailwind-preset.ts +170 -166
  407. package/dist/lib/utils.d.ts +0 -3
  408. package/dist/lib/utils.d.ts.map +0 -1
  409. package/dist/lib/utils.js +0 -6
  410. package/dist/lib/utils.js.map +0 -1
  411. package/dist/toolbars/CanvasTabsToolbar.d.ts +0 -11
  412. package/dist/toolbars/CanvasTabsToolbar.d.ts.map +0 -1
  413. package/dist/toolbars/CanvasTabsToolbar.js +0 -101
  414. package/dist/toolbars/CanvasTabsToolbar.js.map +0 -1
@@ -1,132 +1,136 @@
1
- import { useEffect, useState, type ReactNode } from "react";
2
- import { Button } from "../components/ui/button";
3
- import { Separator } from "../components/ui/separator";
4
- import { ChevronRight } from "lucide-react";
5
- import type { Parameter } from "@foresthubai/workflow-core/parameter";
6
- import type { Diagnostic } from "@foresthubai/workflow-core/diagnostics";
7
- import ParameterEditor from "../inputs/ParameterEditor";
8
- import { MAIN_CANVAS_ID } from "../stores/canvasStore";
9
- import { useEditorStore } from "../stores/editorStore";
10
- import { isReadOnly } from "../WorkflowBuilder";
11
- import { useParamErrors } from "../hooks/useParamErrors";
12
- import { ReadOnlyBanner } from "../components/ui/readonly-banner";
13
- import { DeleteButton } from "../components/ui/delete-button";
14
-
15
- interface ResourceConfigPanelProps {
16
- /** Stable id of the open resource — resets the local label field when it changes. */
17
- resetKey: string;
18
- label: string;
19
- /** `title`/aria text for the label input. */
20
- labelTitle: string;
21
- onLabelChange: (label: string) => void;
22
- description: string;
23
- /** Optional validation messages rendered under the title (e.g. empty/duplicate label). */
24
- belowLabel?: ReactNode;
25
- parameters: Parameter[];
26
- /** Read the current value for a parameter (channels map `type` to a top-level field). */
27
- getValue: (param: Parameter) => unknown;
28
- allArguments: Record<string, unknown>;
29
- onParamChange: (paramId: string, value: unknown) => void;
30
- diagnostics: Diagnostic[] | undefined;
31
- translationPrefix: string;
32
- deleteLabel: string;
33
- onDelete: () => void;
34
- onClose: () => void;
35
- /** Canvas used for variable resolution in ParameterEditor. Project-scoped resources use MAIN. */
36
- canvasId?: string;
37
- }
38
-
39
- /**
40
- * Shared editor shell for the project-scoped "primitive" resources that all
41
- * render a `{type, arguments}` bag through `ParameterEditor` — channels, memory,
42
- * declared models. Owns the chrome (editable title, readOnly banner, parameter
43
- * list, delete/close buttons); each wrapper supplies the parameter source, the
44
- * value accessor, and the mutation callbacks. Nodes/edges are too divergent to
45
- * use this and keep their own bodies (sharing only {@link useParamErrors}).
46
- */
47
- export const ResourceConfigPanel = ({
48
- resetKey,
49
- label,
50
- labelTitle,
51
- onLabelChange,
52
- description,
53
- belowLabel,
54
- parameters,
55
- getValue,
56
- allArguments,
57
- onParamChange,
58
- diagnostics,
59
- translationPrefix,
60
- deleteLabel,
61
- onDelete,
62
- onClose,
63
- canvasId = MAIN_CANVAS_ID,
64
- }: ResourceConfigPanelProps) => {
65
- const readOnly = useEditorStore((s) => isReadOnly(s.builderMode));
66
- const paramErrors = useParamErrors(diagnostics);
67
-
68
- // Local label state preserves cursor position on edit; resets when a different
69
- // resource is opened.
70
- const [localLabel, setLocalLabel] = useState(label);
71
- useEffect(() => {
72
- setLocalLabel(label);
73
- }, [resetKey, label]);
74
-
75
- return (
76
- <div className="p-4">
77
- <div className="space-y-4">
78
- <div className="flex items-center justify-between gap-2">
79
- <div className="flex-1 min-w-0">
80
- <div className="group flex items-center gap-1.5 rounded-md border border-transparent px-1.5 -mx-1.5 hover:border-input focus-within:border-input transition-colors">
81
- <input
82
- type="text"
83
- title={labelTitle}
84
- className="font-semibold text-lg bg-transparent w-full outline-none cursor-text py-0.5"
85
- value={localLabel}
86
- readOnly={readOnly}
87
- onChange={(e) => {
88
- setLocalLabel(e.target.value);
89
- onLabelChange(e.target.value);
90
- }}
91
- />
92
- </div>
93
- <p className="text-sm text-muted-foreground">{description}</p>
94
- {belowLabel}
95
- </div>
96
- <Button variant="ghost" size="icon" className="shrink-0" onClick={onClose}>
97
- <ChevronRight className="h-4 w-4" />
98
- </Button>
99
- </div>
100
-
101
- {readOnly && <ReadOnlyBanner />}
102
-
103
- {parameters.length > 0 && (
104
- <>
105
- <Separator />
106
- <div className={`space-y-3 ${readOnly ? "pointer-events-none opacity-60" : ""}`}>
107
- {parameters.map((param) => (
108
- <ParameterEditor
109
- key={param.id}
110
- canvasId={canvasId}
111
- parameter={param}
112
- value={getValue(param)}
113
- allArguments={allArguments}
114
- onChange={(value) => onParamChange(param.id, value)}
115
- errors={paramErrors.get(param.id)}
116
- translationPrefix={translationPrefix}
117
- />
118
- ))}
119
- </div>
120
- </>
121
- )}
122
-
123
- {!readOnly && (
124
- <>
125
- <Separator />
126
- <DeleteButton onClick={onDelete}>{deleteLabel}</DeleteButton>
127
- </>
128
- )}
129
- </div>
130
- </div>
131
- );
132
- };
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (c) 2026 ForestHub. All rights reserved.
3
+ // For commercial licensing, contact root@foresthub.ai
4
+
5
+ import { useEffect, useState, type ReactNode } from "react";
6
+ import { Button } from "../components/ui/button";
7
+ import { Separator } from "../components/ui/separator";
8
+ import { ChevronRight } from "lucide-react";
9
+ import type { Parameter } from "@foresthubai/workflow-core/parameter";
10
+ import type { Diagnostic } from "@foresthubai/workflow-core/diagnostics";
11
+ import ParameterEditor from "../inputs/ParameterEditor";
12
+ import { MAIN_CANVAS_ID } from "../stores/canvasStore";
13
+ import { useEditorStore } from "../stores/editorStore";
14
+ import { isReadOnly } from "../mode";
15
+ import { useParamErrors } from "../hooks/useParamErrors";
16
+ import { ReadOnlyBanner } from "../components/ui/readonly-banner";
17
+ import { DeleteButton } from "../components/ui/delete-button";
18
+
19
+ interface ResourceConfigPanelProps {
20
+ /** Stable id of the open resource — resets the local label field when it changes. */
21
+ resetKey: string;
22
+ label: string;
23
+ /** `title`/aria text for the label input. */
24
+ labelTitle: string;
25
+ onLabelChange: (label: string) => void;
26
+ description: string;
27
+ /** Optional validation messages rendered under the title (e.g. empty/duplicate label). */
28
+ belowLabel?: ReactNode;
29
+ parameters: Parameter[];
30
+ /** Read the current value for a parameter (channels map `type` to a top-level field). */
31
+ getValue: (param: Parameter) => unknown;
32
+ allArguments: Record<string, unknown>;
33
+ onParamChange: (paramId: string, value: unknown) => void;
34
+ diagnostics: Diagnostic[] | undefined;
35
+ translationPrefix: string;
36
+ deleteLabel: string;
37
+ onDelete: () => void;
38
+ onClose: () => void;
39
+ /** Canvas used for variable resolution in ParameterEditor. Project-scoped resources use MAIN. */
40
+ canvasId?: string;
41
+ }
42
+
43
+ /**
44
+ * Shared editor shell for the project-scoped "primitive" resources that all
45
+ * render a `{type, arguments}` bag through `ParameterEditor` channels, memory,
46
+ * declared models. Owns the chrome (editable title, readOnly banner, parameter
47
+ * list, delete/close buttons); each wrapper supplies the parameter source, the
48
+ * value accessor, and the mutation callbacks. Nodes/edges are too divergent to
49
+ * use this and keep their own bodies (sharing only {@link useParamErrors}).
50
+ */
51
+ export const ResourceConfigPanel = ({
52
+ resetKey,
53
+ label,
54
+ labelTitle,
55
+ onLabelChange,
56
+ description,
57
+ belowLabel,
58
+ parameters,
59
+ getValue,
60
+ allArguments,
61
+ onParamChange,
62
+ diagnostics,
63
+ translationPrefix,
64
+ deleteLabel,
65
+ onDelete,
66
+ onClose,
67
+ canvasId = MAIN_CANVAS_ID,
68
+ }: ResourceConfigPanelProps) => {
69
+ const readOnly = useEditorStore((s) => isReadOnly(s.builderMode));
70
+ const paramErrors = useParamErrors(diagnostics);
71
+
72
+ // Local label state preserves cursor position on edit; resets when a different
73
+ // resource is opened.
74
+ const [localLabel, setLocalLabel] = useState(label);
75
+ useEffect(() => {
76
+ setLocalLabel(label);
77
+ }, [resetKey, label]);
78
+
79
+ return (
80
+ <div className="p-4">
81
+ <div className="space-y-4">
82
+ <div className="flex items-center justify-between gap-2">
83
+ <div className="flex-1 min-w-0">
84
+ <div className="group flex items-center gap-1.5 rounded-md border border-transparent px-1.5 -mx-1.5 hover:border-input focus-within:border-input transition-colors">
85
+ <input
86
+ type="text"
87
+ title={labelTitle}
88
+ className="font-semibold text-lg bg-transparent w-full outline-none cursor-text py-0.5"
89
+ value={localLabel}
90
+ readOnly={readOnly}
91
+ onChange={(e) => {
92
+ setLocalLabel(e.target.value);
93
+ onLabelChange(e.target.value);
94
+ }}
95
+ />
96
+ </div>
97
+ <p className="text-sm text-muted-foreground">{description}</p>
98
+ {belowLabel}
99
+ </div>
100
+ <Button variant="ghost" size="icon" className="shrink-0" onClick={onClose}>
101
+ <ChevronRight className="h-4 w-4" />
102
+ </Button>
103
+ </div>
104
+
105
+ {readOnly && <ReadOnlyBanner />}
106
+
107
+ {parameters.length > 0 && (
108
+ <>
109
+ <Separator />
110
+ <div className={`space-y-3 ${readOnly ? "pointer-events-none opacity-60" : ""}`}>
111
+ {parameters.map((param) => (
112
+ <ParameterEditor
113
+ key={param.id}
114
+ canvasId={canvasId}
115
+ parameter={param}
116
+ value={getValue(param)}
117
+ allArguments={allArguments}
118
+ onChange={(value) => onParamChange(param.id, value)}
119
+ errors={paramErrors.get(param.id)}
120
+ translationPrefix={translationPrefix}
121
+ />
122
+ ))}
123
+ </div>
124
+ </>
125
+ )}
126
+
127
+ {!readOnly && (
128
+ <>
129
+ <Separator />
130
+ <DeleteButton onClick={onDelete}>{deleteLabel}</DeleteButton>
131
+ </>
132
+ )}
133
+ </div>
134
+ </div>
135
+ );
136
+ };
@@ -1,113 +1,117 @@
1
- import { AlertTriangle, type LucideIcon } from "lucide-react";
2
- import { AddButton } from "../components/ui/add-button";
3
- import { cn } from "../cn";
4
- import { useEditorStore } from "../stores/editorStore";
5
- import { isReadOnly } from "../WorkflowBuilder";
6
- import type { Diagnostic } from "@foresthubai/workflow-core/diagnostics";
7
-
8
- interface ResourceListItem {
9
- id: string;
10
- label: string;
11
- }
12
-
13
- interface AddAction {
14
- label: string;
15
- icon: LucideIcon;
16
- onAdd: () => void;
17
- }
18
-
19
- interface ResourceListPanelProps<I extends ResourceListItem> {
20
- items: I[];
21
- selectedId: string | null;
22
- onSelect: (id: string) => void;
23
- /** The matching diagnostics slot (byChannelId / byMemoryId / byModelId). */
24
- diagnosticsSlot: Record<string, Diagnostic[]>;
25
- /** Short type-badge text shown on the right of each row. */
26
- badge: (item: I) => string;
27
- emptyIcon: LucideIcon;
28
- emptyText: string;
29
- emptyHint: string;
30
- /** One add button (channels/models) or several (memory: File + Vector). */
31
- addActions: AddAction[];
32
- }
33
-
34
- /**
35
- * Shared sidebar list for the project-scoped primitive resources (channels,
36
- * memory, declared models): a selectable row per item with an error ring +
37
- * warning icon driven by the diagnostics slot, a type badge, and add button(s).
38
- * Variables are not listed here — they're canvas-scoped, sectioned, and don't
39
- * use this error-badge model.
40
- */
41
- export function ResourceListPanel<I extends ResourceListItem>({
42
- items,
43
- selectedId,
44
- onSelect,
45
- diagnosticsSlot,
46
- badge,
47
- emptyIcon: EmptyIcon,
48
- emptyText,
49
- emptyHint,
50
- addActions,
51
- }: ResourceListPanelProps<I>) {
52
- const readOnly = useEditorStore((s) => isReadOnly(s.builderMode));
53
-
54
- const addButtons = (
55
- <div className="flex flex-col gap-1.5">
56
- {addActions.map(({ label, icon, onAdd }) => (
57
- <AddButton key={label} icon={icon} onClick={onAdd}>
58
- {label}
59
- </AddButton>
60
- ))}
61
- </div>
62
- );
63
-
64
- if (items.length === 0) {
65
- return (
66
- <div className="flex flex-col items-center justify-center py-8 text-center">
67
- <EmptyIcon className="w-10 h-10 text-muted-foreground/50 mb-3" />
68
- <p className="text-sm text-muted-foreground">{emptyText}</p>
69
- <p className="text-xs text-muted-foreground/70 mt-1">{emptyHint}</p>
70
- {!readOnly && <div className="mt-3 w-full px-2">{addButtons}</div>}
71
- </div>
72
- );
73
- }
74
-
75
- return (
76
- <div className="space-y-1.5">
77
- {items.map((item) => {
78
- const isSelected = selectedId === item.id;
79
- const hasError = (diagnosticsSlot[item.id] ?? []).some((d) => d.severity === "error");
80
- return (
81
- <div
82
- key={item.id}
83
- onClick={() => onSelect(item.id)}
84
- className={cn(
85
- // Background/shadow come from selection; border/ring come from error
86
- // status. Layered, not exclusive — so a selected row with an error
87
- // keeps its red outline against the green selection tint instead of
88
- // hiding the very signal the user is acting on.
89
- "p-3 rounded-lg transition-all cursor-pointer border ring-1",
90
- isSelected ? "bg-accent shadow-md" : "bg-card shadow-sm hover:shadow-md",
91
- hasError
92
- ? "border-destructive ring-destructive"
93
- : isSelected
94
- ? "border-primary/40 ring-primary/40"
95
- : "border-border ring-transparent",
96
- )}
97
- >
98
- <div className="flex items-center justify-between gap-2">
99
- <span className="font-mono text-sm text-foreground truncate flex items-center gap-1.5">
100
- {hasError && <AlertTriangle className="w-3.5 h-3.5 text-destructive shrink-0" />}
101
- {item.label}
102
- </span>
103
- <span className="text-[10px] font-medium px-1.5 py-0.5 rounded border border-border/50 text-muted-foreground shrink-0">
104
- {badge(item)}
105
- </span>
106
- </div>
107
- </div>
108
- );
109
- })}
110
- {!readOnly && <div className="pt-1">{addButtons}</div>}
111
- </div>
112
- );
113
- }
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (c) 2026 ForestHub. All rights reserved.
3
+ // For commercial licensing, contact root@foresthub.ai
4
+
5
+ import { AlertTriangle, type LucideIcon } from "lucide-react";
6
+ import { AddButton } from "../components/ui/add-button";
7
+ import { cn } from "../cn";
8
+ import { useEditorStore } from "../stores/editorStore";
9
+ import { isReadOnly } from "../mode";
10
+ import type { Diagnostic } from "@foresthubai/workflow-core/diagnostics";
11
+
12
+ interface ResourceListItem {
13
+ id: string;
14
+ label: string;
15
+ }
16
+
17
+ interface AddAction {
18
+ label: string;
19
+ icon: LucideIcon;
20
+ onAdd: () => void;
21
+ }
22
+
23
+ interface ResourceListPanelProps<I extends ResourceListItem> {
24
+ items: I[];
25
+ selectedId: string | null;
26
+ onSelect: (id: string) => void;
27
+ /** The matching diagnostics slot (byChannelId / byMemoryId / byModelId). */
28
+ diagnosticsSlot: Record<string, Diagnostic[]>;
29
+ /** Short type-badge text shown on the right of each row. */
30
+ badge: (item: I) => string;
31
+ emptyIcon: LucideIcon;
32
+ emptyText: string;
33
+ emptyHint: string;
34
+ /** One add button (channels/models) or several (memory: File + Vector). */
35
+ addActions: AddAction[];
36
+ }
37
+
38
+ /**
39
+ * Shared sidebar list for the project-scoped primitive resources (channels,
40
+ * memory, declared models): a selectable row per item with an error ring +
41
+ * warning icon driven by the diagnostics slot, a type badge, and add button(s).
42
+ * Variables are not listed here — they're canvas-scoped, sectioned, and don't
43
+ * use this error-badge model.
44
+ */
45
+ export function ResourceListPanel<I extends ResourceListItem>({
46
+ items,
47
+ selectedId,
48
+ onSelect,
49
+ diagnosticsSlot,
50
+ badge,
51
+ emptyIcon: EmptyIcon,
52
+ emptyText,
53
+ emptyHint,
54
+ addActions,
55
+ }: ResourceListPanelProps<I>) {
56
+ const readOnly = useEditorStore((s) => isReadOnly(s.builderMode));
57
+
58
+ const addButtons = (
59
+ <div className="flex flex-col gap-1.5">
60
+ {addActions.map(({ label, icon, onAdd }) => (
61
+ <AddButton key={label} icon={icon} onClick={onAdd}>
62
+ {label}
63
+ </AddButton>
64
+ ))}
65
+ </div>
66
+ );
67
+
68
+ if (items.length === 0) {
69
+ return (
70
+ <div className="flex flex-col items-center justify-center py-8 text-center">
71
+ <EmptyIcon className="w-10 h-10 text-muted-foreground/50 mb-3" />
72
+ <p className="text-sm text-muted-foreground">{emptyText}</p>
73
+ <p className="text-xs text-muted-foreground/70 mt-1">{emptyHint}</p>
74
+ {!readOnly && <div className="mt-3 w-full px-2">{addButtons}</div>}
75
+ </div>
76
+ );
77
+ }
78
+
79
+ return (
80
+ <div className="space-y-1.5">
81
+ {items.map((item) => {
82
+ const isSelected = selectedId === item.id;
83
+ const hasError = (diagnosticsSlot[item.id] ?? []).some((d) => d.severity === "error");
84
+ return (
85
+ <div
86
+ key={item.id}
87
+ onClick={() => onSelect(item.id)}
88
+ className={cn(
89
+ // Background/shadow come from selection; border/ring come from error
90
+ // status. Layered, not exclusive so a selected row with an error
91
+ // keeps its red outline against the green selection tint instead of
92
+ // hiding the very signal the user is acting on.
93
+ "p-3 rounded-lg transition-all cursor-pointer border ring-1",
94
+ isSelected ? "bg-accent shadow-md" : "bg-card shadow-sm hover:shadow-md",
95
+ hasError
96
+ ? "border-destructive ring-destructive"
97
+ : isSelected
98
+ ? "border-primary/40 ring-primary/40"
99
+ : "border-border ring-transparent",
100
+ )}
101
+ >
102
+ <div className="flex items-center justify-between gap-2">
103
+ <span className="font-mono text-sm text-foreground truncate flex items-center gap-1.5">
104
+ {hasError && <AlertTriangle className="w-3.5 h-3.5 text-destructive shrink-0" />}
105
+ {item.label}
106
+ </span>
107
+ <span className="text-[10px] font-medium px-1.5 py-0.5 rounded border border-border/50 text-muted-foreground shrink-0">
108
+ {badge(item)}
109
+ </span>
110
+ </div>
111
+ </div>
112
+ );
113
+ })}
114
+ {!readOnly && <div className="pt-1">{addButtons}</div>}
115
+ </div>
116
+ );
117
+ }