@foresthubai/workflow-builder 0.3.0
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.
- package/LICENSE +661 -0
- package/NOTICE +16 -0
- package/README.md +93 -0
- package/dist/BuilderLayout.d.ts +34 -0
- package/dist/BuilderLayout.d.ts.map +1 -0
- package/dist/BuilderLayout.js +172 -0
- package/dist/BuilderLayout.js.map +1 -0
- package/dist/Canvas.d.ts +23 -0
- package/dist/Canvas.d.ts.map +1 -0
- package/dist/Canvas.js +141 -0
- package/dist/Canvas.js.map +1 -0
- package/dist/CanvasEditor.d.ts +46 -0
- package/dist/CanvasEditor.d.ts.map +1 -0
- package/dist/CanvasEditor.js +57 -0
- package/dist/CanvasEditor.js.map +1 -0
- package/dist/CanvasTabsToolbar.d.ts +11 -0
- package/dist/CanvasTabsToolbar.d.ts.map +1 -0
- package/dist/CanvasTabsToolbar.js +101 -0
- package/dist/CanvasTabsToolbar.js.map +1 -0
- package/dist/RightConfigPanel.d.ts +27 -0
- package/dist/RightConfigPanel.d.ts.map +1 -0
- package/dist/RightConfigPanel.js +102 -0
- package/dist/RightConfigPanel.js.map +1 -0
- package/dist/WorkflowBuilder.d.ts +62 -0
- package/dist/WorkflowBuilder.d.ts.map +1 -0
- package/dist/WorkflowBuilder.js +275 -0
- package/dist/WorkflowBuilder.js.map +1 -0
- package/dist/cn.d.ts +3 -0
- package/dist/cn.d.ts.map +1 -0
- package/dist/cn.js +6 -0
- package/dist/cn.js.map +1 -0
- package/dist/components/ui/add-button.d.ts +16 -0
- package/dist/components/ui/add-button.d.ts.map +1 -0
- package/dist/components/ui/add-button.js +21 -0
- package/dist/components/ui/add-button.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +30 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +23 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +21 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +40 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +17 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +9 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +6 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/command.d.ts +82 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +29 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/delete-button.d.ts +11 -0
- package/dist/components/ui/delete-button.d.ts.map +1 -0
- package/dist/components/ui/delete-button.js +14 -0
- package/dist/components/ui/delete-button.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +22 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +27 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +36 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/input.d.ts +13 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +34 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +10 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/readonly-banner.d.ts +7 -0
- package/dist/components/ui/readonly-banner.d.ts.map +1 -0
- package/dist/components/ui/readonly-banner.js +12 -0
- package/dist/components/ui/readonly-banner.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +24 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +9 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +45 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +27 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +30 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +8 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +8 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +12 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +34 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toast.d.ts +16 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +34 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +10 -0
- package/dist/components/ui/toaster.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +21 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +26 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +14 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/dialogs/NodePickerDialog.d.ts +10 -0
- package/dist/dialogs/NodePickerDialog.d.ts.map +1 -0
- package/dist/dialogs/NodePickerDialog.js +39 -0
- package/dist/dialogs/NodePickerDialog.js.map +1 -0
- package/dist/dialogs/ValidationDialog.d.ts +17 -0
- package/dist/dialogs/ValidationDialog.d.ts.map +1 -0
- package/dist/dialogs/ValidationDialog.js +29 -0
- package/dist/dialogs/ValidationDialog.js.map +1 -0
- package/dist/graph/BaseNode.d.ts +9 -0
- package/dist/graph/BaseNode.d.ts.map +1 -0
- package/dist/graph/BaseNode.js +318 -0
- package/dist/graph/BaseNode.js.map +1 -0
- package/dist/graph/CustomEdge.d.ts +14 -0
- package/dist/graph/CustomEdge.d.ts.map +1 -0
- package/dist/graph/CustomEdge.js +107 -0
- package/dist/graph/CustomEdge.js.map +1 -0
- package/dist/graph/CustomNode.d.ts +3 -0
- package/dist/graph/CustomNode.d.ts.map +1 -0
- package/dist/graph/CustomNode.js +15 -0
- package/dist/graph/CustomNode.js.map +1 -0
- package/dist/graph/FunctionCallNode.d.ts +3 -0
- package/dist/graph/FunctionCallNode.d.ts.map +1 -0
- package/dist/graph/FunctionCallNode.js +25 -0
- package/dist/graph/FunctionCallNode.js.map +1 -0
- package/dist/graph/PortHandle.d.ts +21 -0
- package/dist/graph/PortHandle.d.ts.map +1 -0
- package/dist/graph/PortHandle.js +113 -0
- package/dist/graph/PortHandle.js.map +1 -0
- package/dist/graph/reactFlowRegistry.d.ts +65 -0
- package/dist/graph/reactFlowRegistry.d.ts.map +1 -0
- package/dist/graph/reactFlowRegistry.js +24 -0
- package/dist/graph/reactFlowRegistry.js.map +1 -0
- package/dist/hooks/use-toast.d.ts +47 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/use-toast.js +95 -0
- package/dist/hooks/use-toast.js.map +1 -0
- package/dist/hooks/useAvailableVariables.d.ts +12 -0
- package/dist/hooks/useAvailableVariables.d.ts.map +1 -0
- package/dist/hooks/useAvailableVariables.js +16 -0
- package/dist/hooks/useAvailableVariables.js.map +1 -0
- package/dist/hooks/useCanvasHistory.d.ts +14 -0
- package/dist/hooks/useCanvasHistory.d.ts.map +1 -0
- package/dist/hooks/useCanvasHistory.js +20 -0
- package/dist/hooks/useCanvasHistory.js.map +1 -0
- package/dist/hooks/useCanvasTabs.d.ts +23 -0
- package/dist/hooks/useCanvasTabs.d.ts.map +1 -0
- package/dist/hooks/useCanvasTabs.js +136 -0
- package/dist/hooks/useCanvasTabs.js.map +1 -0
- package/dist/hooks/useFunctionDiagnosticsSync.d.ts +14 -0
- package/dist/hooks/useFunctionDiagnosticsSync.d.ts.map +1 -0
- package/dist/hooks/useFunctionDiagnosticsSync.js +38 -0
- package/dist/hooks/useFunctionDiagnosticsSync.js.map +1 -0
- package/dist/hooks/useFunctionRegistry.d.ts +15 -0
- package/dist/hooks/useFunctionRegistry.d.ts.map +1 -0
- package/dist/hooks/useFunctionRegistry.js +22 -0
- package/dist/hooks/useFunctionRegistry.js.map +1 -0
- package/dist/hooks/useFunctions.d.ts +15 -0
- package/dist/hooks/useFunctions.d.ts.map +1 -0
- package/dist/hooks/useFunctions.js +34 -0
- package/dist/hooks/useFunctions.js.map +1 -0
- package/dist/hooks/useGraph.d.ts +40 -0
- package/dist/hooks/useGraph.d.ts.map +1 -0
- package/dist/hooks/useGraph.js +102 -0
- package/dist/hooks/useGraph.js.map +1 -0
- package/dist/hooks/useNodeDefinitions.d.ts +17 -0
- package/dist/hooks/useNodeDefinitions.d.ts.map +1 -0
- package/dist/hooks/useNodeDefinitions.js +65 -0
- package/dist/hooks/useNodeDefinitions.js.map +1 -0
- package/dist/hooks/useParamErrors.d.ts +12 -0
- package/dist/hooks/useParamErrors.d.ts.map +1 -0
- package/dist/hooks/useParamErrors.js +28 -0
- package/dist/hooks/useParamErrors.js.map +1 -0
- package/dist/hooks/useResolvedTheme.d.ts +10 -0
- package/dist/hooks/useResolvedTheme.d.ts.map +1 -0
- package/dist/hooks/useResolvedTheme.js +29 -0
- package/dist/hooks/useResolvedTheme.js.map +1 -0
- package/dist/hooks/useResourceDiagnosticsSync.d.ts +40 -0
- package/dist/hooks/useResourceDiagnosticsSync.d.ts.map +1 -0
- package/dist/hooks/useResourceDiagnosticsSync.js +39 -0
- package/dist/hooks/useResourceDiagnosticsSync.js.map +1 -0
- package/dist/hooks/useSuppressThemeTransition.d.ts +32 -0
- package/dist/hooks/useSuppressThemeTransition.d.ts.map +1 -0
- package/dist/hooks/useSuppressThemeTransition.js +75 -0
- package/dist/hooks/useSuppressThemeTransition.js.map +1 -0
- package/dist/hooks/useWorkflowSerialization.d.ts +24 -0
- package/dist/hooks/useWorkflowSerialization.d.ts.map +1 -0
- package/dist/hooks/useWorkflowSerialization.js +113 -0
- package/dist/hooks/useWorkflowSerialization.js.map +1 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +46 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/locales/de.json +501 -0
- package/dist/i18n/locales/en.json +557 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/inputs/ExpressionInput.d.ts +12 -0
- package/dist/inputs/ExpressionInput.d.ts.map +1 -0
- package/dist/inputs/ExpressionInput.js +203 -0
- package/dist/inputs/ExpressionInput.js.map +1 -0
- package/dist/inputs/ParameterEditor.d.ts +13 -0
- package/dist/inputs/ParameterEditor.d.ts.map +1 -0
- package/dist/inputs/ParameterEditor.js +204 -0
- package/dist/inputs/ParameterEditor.js.map +1 -0
- package/dist/inputs/PortSection.d.ts +31 -0
- package/dist/inputs/PortSection.d.ts.map +1 -0
- package/dist/inputs/PortSection.js +26 -0
- package/dist/inputs/PortSection.js.map +1 -0
- package/dist/panels/BuilderSidebar.d.ts +24 -0
- package/dist/panels/BuilderSidebar.d.ts.map +1 -0
- package/dist/panels/BuilderSidebar.js +202 -0
- package/dist/panels/BuilderSidebar.js.map +1 -0
- package/dist/panels/ChannelConfigPanel.d.ts +8 -0
- package/dist/panels/ChannelConfigPanel.d.ts.map +1 -0
- package/dist/panels/ChannelConfigPanel.js +26 -0
- package/dist/panels/ChannelConfigPanel.js.map +1 -0
- package/dist/panels/ChannelsPanel.d.ts +2 -0
- package/dist/panels/ChannelsPanel.d.ts.map +1 -0
- package/dist/panels/ChannelsPanel.js +16 -0
- package/dist/panels/ChannelsPanel.js.map +1 -0
- package/dist/panels/DebugConsolePanel.d.ts +2 -0
- package/dist/panels/DebugConsolePanel.d.ts.map +1 -0
- package/dist/panels/DebugConsolePanel.js +32 -0
- package/dist/panels/DebugConsolePanel.js.map +1 -0
- package/dist/panels/DebugContextPanel.d.ts +2 -0
- package/dist/panels/DebugContextPanel.d.ts.map +1 -0
- package/dist/panels/DebugContextPanel.js +32 -0
- package/dist/panels/DebugContextPanel.js.map +1 -0
- package/dist/panels/DebugExternalIOPanel.d.ts +9 -0
- package/dist/panels/DebugExternalIOPanel.d.ts.map +1 -0
- package/dist/panels/DebugExternalIOPanel.js +66 -0
- package/dist/panels/DebugExternalIOPanel.js.map +1 -0
- package/dist/panels/DiagnosticsPanel.d.ts +8 -0
- package/dist/panels/DiagnosticsPanel.d.ts.map +1 -0
- package/dist/panels/DiagnosticsPanel.js +86 -0
- package/dist/panels/DiagnosticsPanel.js.map +1 -0
- package/dist/panels/EdgeConfigPanel.d.ts +14 -0
- package/dist/panels/EdgeConfigPanel.d.ts.map +1 -0
- package/dist/panels/EdgeConfigPanel.js +34 -0
- package/dist/panels/EdgeConfigPanel.js.map +1 -0
- package/dist/panels/FunctionConfigPanel.d.ts +16 -0
- package/dist/panels/FunctionConfigPanel.d.ts.map +1 -0
- package/dist/panels/FunctionConfigPanel.js +62 -0
- package/dist/panels/FunctionConfigPanel.js.map +1 -0
- package/dist/panels/FunctionListPanel.d.ts +14 -0
- package/dist/panels/FunctionListPanel.d.ts.map +1 -0
- package/dist/panels/FunctionListPanel.js +25 -0
- package/dist/panels/FunctionListPanel.js.map +1 -0
- package/dist/panels/MemoryConfigPanel.d.ts +8 -0
- package/dist/panels/MemoryConfigPanel.d.ts.map +1 -0
- package/dist/panels/MemoryConfigPanel.js +22 -0
- package/dist/panels/MemoryConfigPanel.js.map +1 -0
- package/dist/panels/MemoryPanel.d.ts +2 -0
- package/dist/panels/MemoryPanel.d.ts.map +1 -0
- package/dist/panels/MemoryPanel.js +25 -0
- package/dist/panels/MemoryPanel.js.map +1 -0
- package/dist/panels/ModelConfigPanel.d.ts +8 -0
- package/dist/panels/ModelConfigPanel.d.ts.map +1 -0
- package/dist/panels/ModelConfigPanel.js +14 -0
- package/dist/panels/ModelConfigPanel.js.map +1 -0
- package/dist/panels/ModelsPanel.d.ts +8 -0
- package/dist/panels/ModelsPanel.d.ts.map +1 -0
- package/dist/panels/ModelsPanel.js +24 -0
- package/dist/panels/ModelsPanel.js.map +1 -0
- package/dist/panels/NodeConfigPanel.d.ts +16 -0
- package/dist/panels/NodeConfigPanel.d.ts.map +1 -0
- package/dist/panels/NodeConfigPanel.js +248 -0
- package/dist/panels/NodeConfigPanel.js.map +1 -0
- package/dist/panels/NodeLibrary.d.ts +16 -0
- package/dist/panels/NodeLibrary.d.ts.map +1 -0
- package/dist/panels/NodeLibrary.js +125 -0
- package/dist/panels/NodeLibrary.js.map +1 -0
- package/dist/panels/ResourceConfigPanel.d.ts +37 -0
- package/dist/panels/ResourceConfigPanel.d.ts.map +1 -0
- package/dist/panels/ResourceConfigPanel.js +35 -0
- package/dist/panels/ResourceConfigPanel.js.map +1 -0
- package/dist/panels/ResourceListPanel.d.ts +35 -0
- package/dist/panels/ResourceListPanel.d.ts.map +1 -0
- package/dist/panels/ResourceListPanel.js +35 -0
- package/dist/panels/ResourceListPanel.js.map +1 -0
- package/dist/panels/VariableConfigPanel.d.ts +9 -0
- package/dist/panels/VariableConfigPanel.d.ts.map +1 -0
- package/dist/panels/VariableConfigPanel.js +50 -0
- package/dist/panels/VariableConfigPanel.js.map +1 -0
- package/dist/panels/VariablesPanel.d.ts +7 -0
- package/dist/panels/VariablesPanel.d.ts.map +1 -0
- package/dist/panels/VariablesPanel.js +56 -0
- package/dist/panels/VariablesPanel.js.map +1 -0
- package/dist/stores/canvasStore.d.ts +41 -0
- package/dist/stores/canvasStore.d.ts.map +1 -0
- package/dist/stores/canvasStore.js +187 -0
- package/dist/stores/canvasStore.js.map +1 -0
- package/dist/stores/debugStore.d.ts +42 -0
- package/dist/stores/debugStore.d.ts.map +1 -0
- package/dist/stores/debugStore.js +22 -0
- package/dist/stores/debugStore.js.map +1 -0
- package/dist/stores/diagnosticsStore.d.ts +41 -0
- package/dist/stores/diagnosticsStore.d.ts.map +1 -0
- package/dist/stores/diagnosticsStore.js +67 -0
- package/dist/stores/diagnosticsStore.js.map +1 -0
- package/dist/stores/editorStore.d.ts +76 -0
- package/dist/stores/editorStore.d.ts.map +1 -0
- package/dist/stores/editorStore.js +116 -0
- package/dist/stores/editorStore.js.map +1 -0
- package/dist/utils/categoryConstants.d.ts +4 -0
- package/dist/utils/categoryConstants.d.ts.map +1 -0
- package/dist/utils/categoryConstants.js +24 -0
- package/dist/utils/categoryConstants.js.map +1 -0
- package/dist/utils/channelOperations.d.ts +21 -0
- package/dist/utils/channelOperations.d.ts.map +1 -0
- package/dist/utils/channelOperations.js +84 -0
- package/dist/utils/channelOperations.js.map +1 -0
- package/dist/utils/connectionRules.d.ts +15 -0
- package/dist/utils/connectionRules.d.ts.map +1 -0
- package/dist/utils/connectionRules.js +113 -0
- package/dist/utils/connectionRules.js.map +1 -0
- package/dist/utils/functionOperations.d.ts +27 -0
- package/dist/utils/functionOperations.d.ts.map +1 -0
- package/dist/utils/functionOperations.js +140 -0
- package/dist/utils/functionOperations.js.map +1 -0
- package/dist/utils/graphOperations.d.ts +54 -0
- package/dist/utils/graphOperations.d.ts.map +1 -0
- package/dist/utils/graphOperations.js +461 -0
- package/dist/utils/graphOperations.js.map +1 -0
- package/dist/utils/history.d.ts +76 -0
- package/dist/utils/history.d.ts.map +1 -0
- package/dist/utils/history.js +93 -0
- package/dist/utils/history.js.map +1 -0
- package/dist/utils/memoryOperations.d.ts +14 -0
- package/dist/utils/memoryOperations.d.ts.map +1 -0
- package/dist/utils/memoryOperations.js +55 -0
- package/dist/utils/memoryOperations.js.map +1 -0
- package/dist/utils/migrateFunctionNodes.d.ts +9 -0
- package/dist/utils/migrateFunctionNodes.d.ts.map +1 -0
- package/dist/utils/migrateFunctionNodes.js +89 -0
- package/dist/utils/migrateFunctionNodes.js.map +1 -0
- package/dist/utils/modelOperations.d.ts +13 -0
- package/dist/utils/modelOperations.d.ts.map +1 -0
- package/dist/utils/modelOperations.js +53 -0
- package/dist/utils/modelOperations.js.map +1 -0
- package/dist/utils/paramDisplay.d.ts +12 -0
- package/dist/utils/paramDisplay.d.ts.map +1 -0
- package/dist/utils/paramDisplay.js +56 -0
- package/dist/utils/paramDisplay.js.map +1 -0
- package/dist/utils/resourceHelpers.d.ts +17 -0
- package/dist/utils/resourceHelpers.d.ts.map +1 -0
- package/dist/utils/resourceHelpers.js +32 -0
- package/dist/utils/resourceHelpers.js.map +1 -0
- package/dist/utils/translation.d.ts +20 -0
- package/dist/utils/translation.d.ts.map +1 -0
- package/dist/utils/translation.js +23 -0
- package/dist/utils/translation.js.map +1 -0
- package/dist/utils/variableOperations.d.ts +15 -0
- package/dist/utils/variableOperations.d.ts.map +1 -0
- package/dist/utils/variableOperations.js +71 -0
- package/dist/utils/variableOperations.js.map +1 -0
- package/package.json +79 -0
- package/src/BuilderLayout.tsx +345 -0
- package/src/Canvas.tsx +261 -0
- package/src/CanvasEditor.tsx +142 -0
- package/src/CanvasTabsToolbar.tsx +176 -0
- package/src/RightConfigPanel.tsx +266 -0
- package/src/WorkflowBuilder.tsx +412 -0
- package/src/cn.ts +6 -0
- package/src/components/ui/add-button.tsx +39 -0
- package/src/components/ui/alert-dialog.tsx +141 -0
- package/src/components/ui/alert.tsx +59 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/button.tsx +85 -0
- package/src/components/ui/card.tsx +79 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/command.tsx +153 -0
- package/src/components/ui/delete-button.tsx +23 -0
- package/src/components/ui/dialog.tsx +125 -0
- package/src/components/ui/dropdown-menu.tsx +198 -0
- package/src/components/ui/input.tsx +55 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/readonly-banner.tsx +15 -0
- package/src/components/ui/resizable.tsx +43 -0
- package/src/components/ui/scroll-area.tsx +102 -0
- package/src/components/ui/select.tsx +160 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/textarea.tsx +51 -0
- package/src/components/ui/toast.tsx +127 -0
- package/src/components/ui/toaster.tsx +33 -0
- package/src/components/ui/toggle-group.tsx +59 -0
- package/src/components/ui/toggle.tsx +43 -0
- package/src/components/ui/tooltip.tsx +32 -0
- package/src/dialogs/NodePickerDialog.tsx +84 -0
- package/src/dialogs/ValidationDialog.tsx +184 -0
- package/src/graph/BaseNode.tsx +557 -0
- package/src/graph/CustomEdge.tsx +185 -0
- package/src/graph/CustomNode.tsx +16 -0
- package/src/graph/FunctionCallNode.tsx +30 -0
- package/src/graph/PortHandle.tsx +189 -0
- package/src/graph/reactFlowRegistry.ts +26 -0
- package/src/hooks/use-toast.ts +125 -0
- package/src/hooks/useAvailableVariables.ts +20 -0
- package/src/hooks/useCanvasHistory.ts +22 -0
- package/src/hooks/useCanvasTabs.ts +168 -0
- package/src/hooks/useFunctionDiagnosticsSync.ts +40 -0
- package/src/hooks/useFunctionRegistry.ts +26 -0
- package/src/hooks/useFunctions.ts +44 -0
- package/src/hooks/useGraph.ts +161 -0
- package/src/hooks/useNodeDefinitions.ts +82 -0
- package/src/hooks/useParamErrors.ts +26 -0
- package/src/hooks/useResolvedTheme.ts +30 -0
- package/src/hooks/useResourceDiagnosticsSync.ts +58 -0
- package/src/hooks/useSuppressThemeTransition.ts +79 -0
- package/src/hooks/useWorkflowSerialization.ts +127 -0
- package/src/i18n/index.ts +53 -0
- package/src/i18n/locales/de.json +501 -0
- package/src/i18n/locales/en.json +557 -0
- package/src/index.ts +27 -0
- package/src/inputs/ExpressionInput.tsx +297 -0
- package/src/inputs/ParameterEditor.tsx +515 -0
- package/src/inputs/PortSection.tsx +144 -0
- package/src/panels/BuilderSidebar.tsx +301 -0
- package/src/panels/ChannelConfigPanel.tsx +49 -0
- package/src/panels/ChannelsPanel.tsx +28 -0
- package/src/panels/DebugConsolePanel.tsx +73 -0
- package/src/panels/DebugContextPanel.tsx +77 -0
- package/src/panels/DebugExternalIOPanel.tsx +180 -0
- package/src/panels/DiagnosticsPanel.tsx +170 -0
- package/src/panels/EdgeConfigPanel.tsx +104 -0
- package/src/panels/FunctionConfigPanel.tsx +179 -0
- package/src/panels/FunctionListPanel.tsx +45 -0
- package/src/panels/MemoryConfigPanel.tsx +55 -0
- package/src/panels/MemoryPanel.tsx +40 -0
- package/src/panels/ModelConfigPanel.tsx +41 -0
- package/src/panels/ModelsPanel.tsx +36 -0
- package/src/panels/NodeConfigPanel.tsx +630 -0
- package/src/panels/NodeLibrary.tsx +288 -0
- package/src/panels/ResourceConfigPanel.tsx +132 -0
- package/src/panels/ResourceListPanel.tsx +113 -0
- package/src/panels/VariableConfigPanel.tsx +161 -0
- package/src/panels/VariablesPanel.tsx +145 -0
- package/src/stores/canvasStore.test.ts +44 -0
- package/src/stores/canvasStore.ts +245 -0
- package/src/stores/debugStore.ts +74 -0
- package/src/stores/diagnosticsStore.ts +130 -0
- package/src/stores/editorStore.ts +202 -0
- package/src/styles/index.css +526 -0
- package/src/utils/categoryConstants.ts +26 -0
- package/src/utils/channelOperations.ts +86 -0
- package/src/utils/connectionRules.ts +137 -0
- package/src/utils/functionOperations.ts +179 -0
- package/src/utils/graphOperations.ts +550 -0
- package/src/utils/history.ts +207 -0
- package/src/utils/memoryOperations.ts +57 -0
- package/src/utils/migrateFunctionNodes.ts +107 -0
- package/src/utils/modelOperations.ts +55 -0
- package/src/utils/paramDisplay.ts +71 -0
- package/src/utils/resourceHelpers.ts +32 -0
- package/src/utils/translation.ts +28 -0
- package/src/utils/variableOperations.ts +75 -0
- package/tailwind-preset.ts +166 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
import { Badge } from "../components/ui/badge";
|
|
2
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../components/ui/tooltip";
|
|
3
|
+
import {
|
|
4
|
+
NodeBase,
|
|
5
|
+
NodeCategory,
|
|
6
|
+
NodeDefinition,
|
|
7
|
+
NodeData,
|
|
8
|
+
getArguments,
|
|
9
|
+
getPorts,
|
|
10
|
+
} from "@foresthubai/workflow-core/node";
|
|
11
|
+
import { NodeProps, Position } from "@xyflow/react";
|
|
12
|
+
import { AlertCircle, AlertTriangle } from "lucide-react";
|
|
13
|
+
import { memo, useCallback, useEffect, useMemo } from "react";
|
|
14
|
+
import { useAvailableVariables } from "../hooks/useAvailableVariables";
|
|
15
|
+
import { getOrCreateCanvasStore } from "../stores/canvasStore";
|
|
16
|
+
import { useDebugStore } from "../stores/debugStore";
|
|
17
|
+
import { useDiagnosticsStore } from "../stores/diagnosticsStore";
|
|
18
|
+
import { useEditorStore } from "../stores/editorStore";
|
|
19
|
+
import { isReadOnly } from "../WorkflowBuilder";
|
|
20
|
+
import { categoryIcons } from "../utils/categoryConstants";
|
|
21
|
+
import { computeNodeDiagnostics } from "@foresthubai/workflow-core/diagnostics";
|
|
22
|
+
import {
|
|
23
|
+
parseExpression,
|
|
24
|
+
type ParseResult,
|
|
25
|
+
isExpression,
|
|
26
|
+
resolveExpression,
|
|
27
|
+
type ResolvedExpr,
|
|
28
|
+
} from "@foresthubai/workflow-core/expression";
|
|
29
|
+
import { isNodeUsedAsTool } from "@foresthubai/workflow-core/node";
|
|
30
|
+
import { canPortAcceptEdge } from "../utils/connectionRules";
|
|
31
|
+
import { PortHandle } from "./PortHandle";
|
|
32
|
+
import { isParameterActive } from "@foresthubai/workflow-core/parameter";
|
|
33
|
+
import { formatParamDisplay, displayValue } from "../utils/paramDisplay";
|
|
34
|
+
|
|
35
|
+
// Node shape variants
|
|
36
|
+
type NodeShape = "rectangle" | "tapered-right";
|
|
37
|
+
|
|
38
|
+
export interface BaseNodeProps extends NodeProps {
|
|
39
|
+
nodeDefinition: NodeDefinition | undefined;
|
|
40
|
+
isStale?: boolean;
|
|
41
|
+
isDeleted?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Base Node component - handles all rendering logic
|
|
45
|
+
export const BaseNode = memo(
|
|
46
|
+
({ id, data, selected, nodeDefinition, isStale = false, isDeleted = false }: BaseNodeProps) => {
|
|
47
|
+
const nodeData = data as NodeData;
|
|
48
|
+
const isHighlighted = selected ?? false;
|
|
49
|
+
// Skip diagnostics when in read-only mode OR when rendered inside VersionPreviewCanvas
|
|
50
|
+
const isPreview = useEditorStore((s) => isReadOnly(s.builderMode)) || !!(data as Record<string, unknown>)?._preview;
|
|
51
|
+
|
|
52
|
+
// Debug cursor: true when this node is the current debug step target
|
|
53
|
+
const isDebugCursor = useDebugStore(
|
|
54
|
+
useCallback(
|
|
55
|
+
(s) => {
|
|
56
|
+
const p = s.phase;
|
|
57
|
+
return (p.status === "paused" || p.status === "stepping") && p.cursorNodeId === id;
|
|
58
|
+
},
|
|
59
|
+
[id],
|
|
60
|
+
),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// Get active canvas ID with imperative access (no subscription), since it doesn't change for a node
|
|
64
|
+
const activeCanvasId = useEditorStore.getState().activeCanvasId;
|
|
65
|
+
|
|
66
|
+
// Get necessary canvas store data
|
|
67
|
+
const canvasStore = getOrCreateCanvasStore(activeCanvasId);
|
|
68
|
+
const edges = canvasStore((s) => s.edges);
|
|
69
|
+
const nodes = canvasStore((s) => s.nodes);
|
|
70
|
+
const channels = useEditorStore((s) => s.channels);
|
|
71
|
+
const memory = useEditorStore((s) => s.memory);
|
|
72
|
+
const models = useEditorStore((s) => s.models);
|
|
73
|
+
const availableModels = useEditorStore((s) => s.availableModels);
|
|
74
|
+
|
|
75
|
+
// Get available variables for resolving expressions
|
|
76
|
+
const { lookup: availableVariables } = useAvailableVariables(activeCanvasId);
|
|
77
|
+
|
|
78
|
+
// Build channel ID → label lookup for formatParamDisplay
|
|
79
|
+
const channelLabels = useMemo(() => {
|
|
80
|
+
const labels: Record<string, string> = {};
|
|
81
|
+
for (const v of Object.values(channels)) labels[v.id] = v.label;
|
|
82
|
+
return labels;
|
|
83
|
+
}, [channels]);
|
|
84
|
+
|
|
85
|
+
// Build memory ID → label lookup for formatParamDisplay (memorySelect params)
|
|
86
|
+
const memoryLabels = useMemo(() => {
|
|
87
|
+
const labels: Record<string, string> = {};
|
|
88
|
+
for (const m of Object.values(memory)) labels[m.id] = m.label;
|
|
89
|
+
return labels;
|
|
90
|
+
}, [memory]);
|
|
91
|
+
|
|
92
|
+
// Build model ID → label lookup (catalog ∪ declared customs) + the catalog id
|
|
93
|
+
// set — used for inline display and modelSelect reference validation.
|
|
94
|
+
const { modelLabels, availableModelIds } = useMemo(() => {
|
|
95
|
+
const labels: Record<string, string> = {};
|
|
96
|
+
const ids = new Set<string>();
|
|
97
|
+
for (const m of availableModels) {
|
|
98
|
+
labels[m.id] = m.label;
|
|
99
|
+
ids.add(m.id);
|
|
100
|
+
}
|
|
101
|
+
for (const m of Object.values(models)) labels[m.id] = m.label;
|
|
102
|
+
return { modelLabels: labels, availableModelIds: ids };
|
|
103
|
+
}, [availableModels, models]);
|
|
104
|
+
|
|
105
|
+
// Get port definitions using centralized dispatcher
|
|
106
|
+
const portDefinitions = getPorts(nodeData);
|
|
107
|
+
|
|
108
|
+
// Separate ports by type for positioning
|
|
109
|
+
const { executionInputs, toolInputs, executionOutputs, toolOutputs } = useMemo(() => {
|
|
110
|
+
return {
|
|
111
|
+
executionInputs: portDefinitions.input.filter((p) => p.type === "control"),
|
|
112
|
+
toolInputs: portDefinitions.input.filter((p) => p.type === "tool"),
|
|
113
|
+
executionOutputs: portDefinitions.output.filter((p) => p.type === "control"),
|
|
114
|
+
toolOutputs: portDefinitions.output.filter((p) => p.type === "tool"),
|
|
115
|
+
};
|
|
116
|
+
}, [portDefinitions]);
|
|
117
|
+
|
|
118
|
+
// Mutual exclusion: tool input vs control ports.
|
|
119
|
+
// Tool OUTPUT is always allowed (not part of exclusion).
|
|
120
|
+
const usedAsToolInput = useMemo(() => {
|
|
121
|
+
return isNodeUsedAsTool(id, nodeData, edges);
|
|
122
|
+
}, [id, nodeData, edges]);
|
|
123
|
+
|
|
124
|
+
const parameters = getArguments(nodeData);
|
|
125
|
+
|
|
126
|
+
// Set of parameter IDs that should be hidden given current context
|
|
127
|
+
const hiddenParamIds = useMemo(() => {
|
|
128
|
+
const ids = new Set<string>();
|
|
129
|
+
for (const p of nodeDefinition?.parameters ?? []) {
|
|
130
|
+
if (!isParameterActive(p, parameters, usedAsToolInput)) ids.add(p.id);
|
|
131
|
+
}
|
|
132
|
+
return ids.size > 0 ? ids : null;
|
|
133
|
+
}, [usedAsToolInput, nodeDefinition, parameters]);
|
|
134
|
+
|
|
135
|
+
const category = nodeDefinition?.category;
|
|
136
|
+
|
|
137
|
+
// Compute diagnostics via extracted pure function
|
|
138
|
+
const diagnostics = useMemo(
|
|
139
|
+
() =>
|
|
140
|
+
computeNodeDiagnostics({
|
|
141
|
+
canvasId: activeCanvasId,
|
|
142
|
+
nodeId: id,
|
|
143
|
+
nodeData,
|
|
144
|
+
nodeDefinition,
|
|
145
|
+
availableVariables,
|
|
146
|
+
channels,
|
|
147
|
+
memory,
|
|
148
|
+
models,
|
|
149
|
+
availableModelIds,
|
|
150
|
+
edges,
|
|
151
|
+
isStale,
|
|
152
|
+
isDeleted,
|
|
153
|
+
}),
|
|
154
|
+
[
|
|
155
|
+
activeCanvasId,
|
|
156
|
+
id,
|
|
157
|
+
nodeData,
|
|
158
|
+
nodeDefinition,
|
|
159
|
+
availableVariables,
|
|
160
|
+
channels,
|
|
161
|
+
memory,
|
|
162
|
+
models,
|
|
163
|
+
availableModelIds,
|
|
164
|
+
edges,
|
|
165
|
+
isStale,
|
|
166
|
+
isDeleted,
|
|
167
|
+
],
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
// Resolve expressions for display (separate from diagnostics)
|
|
171
|
+
const resolvedExpressions = useMemo(() => {
|
|
172
|
+
const resolved: Record<string, { expr: ResolvedExpr; parseRes: ParseResult }> = {};
|
|
173
|
+
const paramDefs = nodeDefinition?.parameters ?? [];
|
|
174
|
+
for (const param of paramDefs) {
|
|
175
|
+
if (hiddenParamIds?.has(param.id)) continue;
|
|
176
|
+
const value = parameters[param.id];
|
|
177
|
+
if (isExpression(value)) {
|
|
178
|
+
const expr = resolveExpression(value, availableVariables);
|
|
179
|
+
const parseRes = parseExpression(expr);
|
|
180
|
+
resolved[param.id] = { expr, parseRes };
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return resolved;
|
|
184
|
+
}, [parameters, availableVariables, hiddenParamIds, nodeDefinition]);
|
|
185
|
+
|
|
186
|
+
// Derived booleans from diagnostics
|
|
187
|
+
const hasErrors = diagnostics.some((d) => d.severity === "error");
|
|
188
|
+
const hasWarnings = diagnostics.some((d) => d.severity === "warning");
|
|
189
|
+
|
|
190
|
+
// Write diagnostics to store (cleanup on unmount; validateAllCanvases handles full-project)
|
|
191
|
+
const setNodeDiagnostics = useDiagnosticsStore((s) => s.setNodeDiagnostics);
|
|
192
|
+
const clearNodeDiagnostics = useDiagnosticsStore((s) => s.clearNodeDiagnostics);
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
if (isPreview) return;
|
|
195
|
+
setNodeDiagnostics(id, diagnostics);
|
|
196
|
+
return () => clearNodeDiagnostics(id);
|
|
197
|
+
}, [id, diagnostics, setNodeDiagnostics, clearNodeDiagnostics, isPreview]);
|
|
198
|
+
|
|
199
|
+
const usedInControlFlow = useMemo(() => {
|
|
200
|
+
return edges.some((e) => {
|
|
201
|
+
if (e.source === id) {
|
|
202
|
+
return executionOutputs.some((p) => p.id === e.sourceHandle);
|
|
203
|
+
}
|
|
204
|
+
if (e.target === id) {
|
|
205
|
+
return executionInputs.some((p) => p.id === e.targetHandle);
|
|
206
|
+
}
|
|
207
|
+
return false;
|
|
208
|
+
});
|
|
209
|
+
}, [edges, id, executionInputs, executionOutputs]);
|
|
210
|
+
|
|
211
|
+
const IconComponent = category ? categoryIcons[category] : null;
|
|
212
|
+
|
|
213
|
+
// Determine node shape based on category
|
|
214
|
+
const nodeShape: NodeShape = useMemo(() => {
|
|
215
|
+
if (category === "Trigger") return "tapered-right";
|
|
216
|
+
return "rectangle";
|
|
217
|
+
}, [category]);
|
|
218
|
+
|
|
219
|
+
// Get the color variable based on category
|
|
220
|
+
const nodeColor = useMemo(() => {
|
|
221
|
+
if (category === NodeCategory.Trigger) return "--node-trigger";
|
|
222
|
+
if (category === NodeCategory.Tool) return "--node-tool";
|
|
223
|
+
if (category === NodeCategory.AI) return "--node-agent";
|
|
224
|
+
if (category === NodeCategory.Input) return "--node-input";
|
|
225
|
+
if (category === NodeCategory.Output) return "--node-output";
|
|
226
|
+
if (category === NodeCategory.Logic) return "--node-logic";
|
|
227
|
+
if (category === NodeCategory.Data) return "--node-data";
|
|
228
|
+
if (category === NodeCategory.Function) return "--node-function";
|
|
229
|
+
return "--primary";
|
|
230
|
+
}, [category]);
|
|
231
|
+
|
|
232
|
+
// Determine if this node should have highlighted styling (Tool, Trigger, Agent)
|
|
233
|
+
const fancyBg = category === NodeCategory.Tool || category === NodeCategory.Trigger || category === NodeCategory.AI;
|
|
234
|
+
|
|
235
|
+
// Get parameters dynamically from node definition (must be before early return for hooks order)
|
|
236
|
+
// Filter out hidden params based on display conditions
|
|
237
|
+
const nodeParameters = useMemo(() => {
|
|
238
|
+
const params = nodeDefinition?.parameters ?? [];
|
|
239
|
+
if (!hiddenParamIds) return params;
|
|
240
|
+
return params.filter((p) => !hiddenParamIds.has(p.id));
|
|
241
|
+
}, [nodeDefinition, hiddenParamIds]);
|
|
242
|
+
|
|
243
|
+
// Count visible inline params for height calculation (show first 3 params always)
|
|
244
|
+
const visibleParamCount = useMemo(() => {
|
|
245
|
+
const shown = Math.min(nodeParameters.length, 3);
|
|
246
|
+
const hasOverflow = nodeParameters.length > 3 ? 1 : 0;
|
|
247
|
+
return shown + hasOverflow;
|
|
248
|
+
}, [nodeParameters]);
|
|
249
|
+
|
|
250
|
+
// Calculate dimensions
|
|
251
|
+
const maxExecutionPorts = Math.max(executionInputs.length, executionOutputs.length);
|
|
252
|
+
const nodeWidth = 200;
|
|
253
|
+
const taperWidth = 24;
|
|
254
|
+
const paramLineHeight = 16; // ~text-xs line + space-y-0.5 gap
|
|
255
|
+
const headerHeight = 50; // padding + emoji/badge row + margin
|
|
256
|
+
const minHeight = useMemo(() => {
|
|
257
|
+
const paramHeight = visibleParamCount * paramLineHeight;
|
|
258
|
+
const contentHeight = headerHeight + paramHeight;
|
|
259
|
+
if (nodeShape === "tapered-right") {
|
|
260
|
+
return Math.max(contentHeight, 60 + Math.max(maxExecutionPorts, 1) * 40);
|
|
261
|
+
}
|
|
262
|
+
return Math.max(contentHeight, 80 + maxExecutionPorts * 40);
|
|
263
|
+
}, [nodeShape, maxExecutionPorts, visibleParamCount]);
|
|
264
|
+
|
|
265
|
+
if (!nodeDefinition) {
|
|
266
|
+
return (
|
|
267
|
+
<div className="min-w-[200px] p-3 border border-destructive/50 bg-destructive/10 rounded-lg">
|
|
268
|
+
<div className="text-destructive text-sm">Unknown node: {nodeData.type}</div>
|
|
269
|
+
</div>
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Calculate vertical port positions for even distribution (left/right)
|
|
274
|
+
const getVerticalPortPosition = (index: number, total: number) => {
|
|
275
|
+
if (total === 1) return minHeight / 2;
|
|
276
|
+
const spacing = (minHeight - 40) / (total + 1);
|
|
277
|
+
return 20 + spacing * (index + 1);
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// Calculate horizontal port positions for even distribution (top/bottom)
|
|
281
|
+
const getHorizontalPortPosition = (index: number, total: number) => {
|
|
282
|
+
if (total === 1) return nodeWidth / 2;
|
|
283
|
+
const spacing = (nodeWidth - 40) / (total + 1);
|
|
284
|
+
return 20 + spacing * (index + 1);
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
// Render SVG background shape
|
|
288
|
+
const renderShape = () => {
|
|
289
|
+
const gradientId = `node-gradient-${nodeData.id}`;
|
|
290
|
+
const strokeW = 2;
|
|
291
|
+
|
|
292
|
+
// Dark nodes (Tool, Trigger) use dark gradient, others use white/light background
|
|
293
|
+
const gradientStartColor = `hsl(var(--canvas-background))`;
|
|
294
|
+
const gradientEndColor = `color-mix(in srgb, hsl(var(${nodeColor})), hsl(var(--canvas-background)) 80%)`;
|
|
295
|
+
const lightFill = "hsl(var(--card))";
|
|
296
|
+
|
|
297
|
+
// Glow effect for highlighted state (our custom selection, not ReactFlow's)
|
|
298
|
+
// Debug cursor gets an orange pulsing glow (takes priority over selection glow)
|
|
299
|
+
const glowStyle = isDebugCursor
|
|
300
|
+
? {
|
|
301
|
+
filter: `drop-shadow(0 0 14px hsl(var(--warning) / 0.7)) drop-shadow(0 0 24px hsl(var(--warning) / 0.5))`,
|
|
302
|
+
animation: "debug-cursor-pulse 1.5s ease-in-out infinite",
|
|
303
|
+
}
|
|
304
|
+
: isHighlighted
|
|
305
|
+
? {
|
|
306
|
+
filter: `drop-shadow(0 0 12px hsl(var(--selection-glow) / 0.6)) drop-shadow(0 0 20px hsl(var(--selection-glow) / 0.4))`,
|
|
307
|
+
}
|
|
308
|
+
: {};
|
|
309
|
+
|
|
310
|
+
if (nodeShape === "tapered-right") {
|
|
311
|
+
const inset = strokeW / 2;
|
|
312
|
+
return (
|
|
313
|
+
<svg
|
|
314
|
+
className="absolute inset-0 z-0 transition-all duration-300 will-change-[filter]"
|
|
315
|
+
width={nodeWidth}
|
|
316
|
+
height={minHeight}
|
|
317
|
+
viewBox={`0 0 ${nodeWidth} ${minHeight}`}
|
|
318
|
+
preserveAspectRatio="none"
|
|
319
|
+
style={glowStyle}
|
|
320
|
+
>
|
|
321
|
+
<defs>
|
|
322
|
+
<linearGradient id={gradientId} x1="0%" y1="70%" x2="100%" y2="0%">
|
|
323
|
+
<stop offset="0%" stopColor={gradientStartColor} />
|
|
324
|
+
<stop offset="100%" stopColor={gradientEndColor} />
|
|
325
|
+
</linearGradient>
|
|
326
|
+
</defs>
|
|
327
|
+
{/* Tapered right edge shape - rightmost edge at nodeWidth */}
|
|
328
|
+
<path
|
|
329
|
+
d={`
|
|
330
|
+
M ${12 + inset} ${0 + inset}
|
|
331
|
+
L ${nodeWidth - taperWidth - inset} ${0 + inset}
|
|
332
|
+
L ${nodeWidth - inset} ${minHeight / 2}
|
|
333
|
+
L ${nodeWidth - taperWidth - inset} ${minHeight - inset}
|
|
334
|
+
L ${12 + inset} ${minHeight - inset}
|
|
335
|
+
Q ${0 + inset} ${minHeight - inset} ${0 + inset} ${minHeight - 12 - inset}
|
|
336
|
+
L ${0 + inset} ${12 + inset}
|
|
337
|
+
Q ${0 + inset} ${0 + inset} ${12 + inset} ${0 + inset}
|
|
338
|
+
Z
|
|
339
|
+
`}
|
|
340
|
+
fill={`url(#${gradientId})`}
|
|
341
|
+
stroke={
|
|
342
|
+
hasErrors
|
|
343
|
+
? "hsl(var(--destructive))"
|
|
344
|
+
: fancyBg
|
|
345
|
+
? `hsl(var(${nodeColor})/0.5)`
|
|
346
|
+
: "hsl(var(--edge-default))"
|
|
347
|
+
}
|
|
348
|
+
strokeWidth={strokeW}
|
|
349
|
+
/>
|
|
350
|
+
</svg>
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Rectangle shape (default) - use light or dark based on category
|
|
355
|
+
return (
|
|
356
|
+
<svg
|
|
357
|
+
className="absolute inset-0 z-0 transition-all duration-300 will-change-[filter]"
|
|
358
|
+
width={nodeWidth}
|
|
359
|
+
height={minHeight}
|
|
360
|
+
viewBox={`0 0 ${nodeWidth} ${minHeight}`}
|
|
361
|
+
preserveAspectRatio="none"
|
|
362
|
+
style={glowStyle}
|
|
363
|
+
>
|
|
364
|
+
{fancyBg && (
|
|
365
|
+
<defs>
|
|
366
|
+
<linearGradient id={gradientId} x1="0%" y1="70%" x2="100%" y2="0%">
|
|
367
|
+
<stop offset="0%" stopColor={gradientStartColor} />
|
|
368
|
+
<stop offset="120%" stopColor={gradientEndColor} />
|
|
369
|
+
</linearGradient>
|
|
370
|
+
</defs>
|
|
371
|
+
)}
|
|
372
|
+
<rect
|
|
373
|
+
x={strokeW / 2}
|
|
374
|
+
y={strokeW / 2}
|
|
375
|
+
width={nodeWidth - strokeW}
|
|
376
|
+
height={minHeight - strokeW}
|
|
377
|
+
rx="10"
|
|
378
|
+
ry="10"
|
|
379
|
+
fill={fancyBg ? `url(#${gradientId})` : lightFill}
|
|
380
|
+
stroke={
|
|
381
|
+
hasErrors
|
|
382
|
+
? "hsl(var(--destructive))"
|
|
383
|
+
: fancyBg
|
|
384
|
+
? `hsl(var(${nodeColor})/0.5)`
|
|
385
|
+
: "hsl(var(--edge-default))"
|
|
386
|
+
}
|
|
387
|
+
strokeWidth={strokeW}
|
|
388
|
+
/>
|
|
389
|
+
</svg>
|
|
390
|
+
);
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
return (
|
|
394
|
+
<div className="relative z-0" style={{ height: `${minHeight}px`, width: `${nodeWidth}px` }}>
|
|
395
|
+
{/* Tool input handles (top) — disabled when control ports are connected */}
|
|
396
|
+
{toolInputs.map((port, index) => (
|
|
397
|
+
<PortHandle
|
|
398
|
+
key={port.id}
|
|
399
|
+
id={port.id}
|
|
400
|
+
type="target"
|
|
401
|
+
position={Position.Top}
|
|
402
|
+
portType={port.type}
|
|
403
|
+
label={port.label}
|
|
404
|
+
disabled={usedInControlFlow}
|
|
405
|
+
style={{
|
|
406
|
+
left: `${getHorizontalPortPosition(index, toolInputs.length)}px`,
|
|
407
|
+
}}
|
|
408
|
+
/>
|
|
409
|
+
))}
|
|
410
|
+
|
|
411
|
+
{/* Execution input handles (left) — disabled when tool input is connected */}
|
|
412
|
+
{executionInputs.map((port, index) => (
|
|
413
|
+
<PortHandle
|
|
414
|
+
key={port.id}
|
|
415
|
+
id={port.id}
|
|
416
|
+
type="target"
|
|
417
|
+
position={Position.Left}
|
|
418
|
+
portType={port.type}
|
|
419
|
+
label={port.label}
|
|
420
|
+
disabled={usedAsToolInput}
|
|
421
|
+
style={{
|
|
422
|
+
top:
|
|
423
|
+
nodeShape === "tapered-right"
|
|
424
|
+
? `${minHeight / 2}px`
|
|
425
|
+
: `${getVerticalPortPosition(index, executionInputs.length)}px`,
|
|
426
|
+
}}
|
|
427
|
+
/>
|
|
428
|
+
))}
|
|
429
|
+
|
|
430
|
+
{/* SVG Shape */}
|
|
431
|
+
{renderShape()}
|
|
432
|
+
|
|
433
|
+
{/* Error badge */}
|
|
434
|
+
{hasErrors && (
|
|
435
|
+
<Tooltip delayDuration={300}>
|
|
436
|
+
<TooltipTrigger asChild>
|
|
437
|
+
<div className="absolute -top-4 -left-4 z-30 cursor-help">
|
|
438
|
+
<AlertTriangle className="h-8 w-8 text-destructive fill-card" strokeWidth={2} />
|
|
439
|
+
</div>
|
|
440
|
+
</TooltipTrigger>
|
|
441
|
+
<TooltipContent side="top" className="bg-destructive text-destructive-foreground text-xs px-2 py-1">
|
|
442
|
+
{diagnostics.find((d) => d.severity === "error")?.message ?? "This node has errors"}
|
|
443
|
+
</TooltipContent>
|
|
444
|
+
</Tooltip>
|
|
445
|
+
)}
|
|
446
|
+
|
|
447
|
+
{/* Warning badge (only when no errors) */}
|
|
448
|
+
{!hasErrors && hasWarnings && (
|
|
449
|
+
<Tooltip delayDuration={300}>
|
|
450
|
+
<TooltipTrigger asChild>
|
|
451
|
+
<div className="absolute -top-4 -left-4 z-30 cursor-help">
|
|
452
|
+
<AlertCircle className="h-8 w-8 text-warning fill-card" strokeWidth={2} />
|
|
453
|
+
</div>
|
|
454
|
+
</TooltipTrigger>
|
|
455
|
+
<TooltipContent side="top" className="bg-warning text-warning-foreground text-xs px-2 py-1">
|
|
456
|
+
{diagnostics.find((d) => d.severity === "warning")?.message ?? "This node has warnings"}
|
|
457
|
+
</TooltipContent>
|
|
458
|
+
</Tooltip>
|
|
459
|
+
)}
|
|
460
|
+
|
|
461
|
+
{/* Content overlay */}
|
|
462
|
+
{/* Content overlay — top-aligned */}
|
|
463
|
+
<div className={`relative z-10 p-3 ${nodeShape === "tapered-right" ? "pr-8" : ""}`}>
|
|
464
|
+
{/* Header row: emoji + label badge */}
|
|
465
|
+
<div className="flex items-center gap-1.5 min-w-0 mb-1.5">
|
|
466
|
+
{IconComponent && (
|
|
467
|
+
<IconComponent className="w-4 h-4 shrink-0" style={{ color: `hsl(var(${nodeColor}))` }} />
|
|
468
|
+
)}
|
|
469
|
+
<Badge
|
|
470
|
+
variant="secondary"
|
|
471
|
+
className="text-sm truncate max-w-full text-foreground"
|
|
472
|
+
style={{
|
|
473
|
+
backgroundColor: `hsl(var(${nodeColor}) / 0.3)`,
|
|
474
|
+
borderColor: `hsl(var(${nodeColor}) / 0.4)`,
|
|
475
|
+
}}
|
|
476
|
+
>
|
|
477
|
+
{(nodeData as NodeBase).label || nodeDefinition.label}
|
|
478
|
+
</Badge>
|
|
479
|
+
</div>
|
|
480
|
+
|
|
481
|
+
{/* Parameters list */}
|
|
482
|
+
{nodeParameters.length > 0 && (
|
|
483
|
+
<div className="space-y-0.5">
|
|
484
|
+
{nodeParameters.slice(0, 3).map((param) => {
|
|
485
|
+
const value = parameters[param.id];
|
|
486
|
+
const resolved = resolvedExpressions[param.id];
|
|
487
|
+
|
|
488
|
+
const paramDisplay = resolved
|
|
489
|
+
? null
|
|
490
|
+
: formatParamDisplay(param, value, availableVariables, channelLabels, memoryLabels, modelLabels);
|
|
491
|
+
const isInvalid = resolved ? !resolved.parseRes.isValid : !!paramDisplay?.isInvalid;
|
|
492
|
+
|
|
493
|
+
return (
|
|
494
|
+
<div key={param.id} className="text-xs leading-4 flex items-baseline gap-1 truncate">
|
|
495
|
+
<span className="shrink-0 text-muted-foreground">{param.label}:</span>
|
|
496
|
+
<span className={`font-mono truncate ${isInvalid ? "text-destructive" : "text-foreground"}`}>
|
|
497
|
+
{resolved ? displayValue(resolved.expr) : paramDisplay!.text}
|
|
498
|
+
</span>
|
|
499
|
+
</div>
|
|
500
|
+
);
|
|
501
|
+
})}
|
|
502
|
+
{nodeParameters.length > 3 && (
|
|
503
|
+
<div className="text-xs text-muted-foreground">+{nodeParameters.length - 3} more...</div>
|
|
504
|
+
)}
|
|
505
|
+
</div>
|
|
506
|
+
)}
|
|
507
|
+
</div>
|
|
508
|
+
|
|
509
|
+
{/* Execution output handles (right) — disabled when tool input is connected */}
|
|
510
|
+
{executionOutputs.map((port, index) => {
|
|
511
|
+
const canAccept = !isPreview && !usedAsToolInput && canPortAcceptEdge(id, port.id, nodes, edges);
|
|
512
|
+
return (
|
|
513
|
+
<PortHandle
|
|
514
|
+
key={port.id}
|
|
515
|
+
id={port.id}
|
|
516
|
+
type="source"
|
|
517
|
+
position={Position.Right}
|
|
518
|
+
portType={port.type}
|
|
519
|
+
label={port.label}
|
|
520
|
+
disabled={usedAsToolInput}
|
|
521
|
+
showPlus={canAccept}
|
|
522
|
+
nodeId={id}
|
|
523
|
+
style={{
|
|
524
|
+
top:
|
|
525
|
+
nodeShape === "tapered-right"
|
|
526
|
+
? `${minHeight / 2}px`
|
|
527
|
+
: `${getVerticalPortPosition(index, executionOutputs.length)}px`,
|
|
528
|
+
right: "0",
|
|
529
|
+
}}
|
|
530
|
+
/>
|
|
531
|
+
);
|
|
532
|
+
})}
|
|
533
|
+
|
|
534
|
+
{/* Tool output handles (bottom) */}
|
|
535
|
+
{toolOutputs.map((port, index) => {
|
|
536
|
+
const canAccept = !isPreview && canPortAcceptEdge(id, port.id, nodes, edges);
|
|
537
|
+
return (
|
|
538
|
+
<PortHandle
|
|
539
|
+
key={port.id}
|
|
540
|
+
id={port.id}
|
|
541
|
+
type="source"
|
|
542
|
+
position={Position.Bottom}
|
|
543
|
+
portType={port.type}
|
|
544
|
+
label={port.label}
|
|
545
|
+
showPlus={canAccept}
|
|
546
|
+
nodeId={id}
|
|
547
|
+
style={{
|
|
548
|
+
left: `${getHorizontalPortPosition(index, toolOutputs.length)}px`,
|
|
549
|
+
bottom: 0,
|
|
550
|
+
}}
|
|
551
|
+
/>
|
|
552
|
+
);
|
|
553
|
+
})}
|
|
554
|
+
</div>
|
|
555
|
+
);
|
|
556
|
+
},
|
|
557
|
+
);
|