@foresthubai/workflow-builder 0.4.4 → 0.4.6
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/dist/BuilderLayout.d.ts.map +1 -1
- package/dist/BuilderLayout.js +52 -61
- package/dist/BuilderLayout.js.map +1 -1
- package/dist/Canvas.d.ts.map +1 -1
- package/dist/Canvas.js +10 -3
- package/dist/Canvas.js.map +1 -1
- package/dist/CanvasEditor.d.ts.map +1 -1
- package/dist/CanvasEditor.js.map +1 -1
- package/dist/CanvasTabsToolbar.d.ts.map +1 -1
- package/dist/CanvasTabsToolbar.js +3 -0
- package/dist/CanvasTabsToolbar.js.map +1 -1
- package/dist/RightConfigPanel.d.ts.map +1 -1
- package/dist/RightConfigPanel.js +3 -0
- package/dist/RightConfigPanel.js.map +1 -1
- package/dist/WorkflowBuilder.d.ts +7 -13
- package/dist/WorkflowBuilder.d.ts.map +1 -1
- package/dist/WorkflowBuilder.js +25 -13
- package/dist/WorkflowBuilder.js.map +1 -1
- package/dist/cn.d.ts.map +1 -1
- package/dist/cn.js +3 -0
- package/dist/cn.js.map +1 -1
- package/dist/components/ui/add-button.d.ts.map +1 -1
- package/dist/components/ui/add-button.js +3 -0
- package/dist/components/ui/add-button.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +3 -0
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +3 -0
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +3 -0
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +3 -0
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +3 -0
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +3 -0
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +3 -0
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/delete-button.d.ts.map +1 -1
- package/dist/components/ui/delete-button.js +3 -0
- package/dist/components/ui/delete-button.js.map +1 -1
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +3 -0
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +3 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +3 -0
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +3 -0
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/readonly-banner.d.ts.map +1 -1
- package/dist/components/ui/readonly-banner.js +3 -0
- package/dist/components/ui/readonly-banner.js.map +1 -1
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +3 -0
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +3 -0
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +3 -0
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +3 -0
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +3 -0
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +3 -0
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toast.d.ts.map +1 -1
- package/dist/components/ui/toast.js +3 -0
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/components/ui/toaster.d.ts.map +1 -1
- package/dist/components/ui/toaster.js +3 -0
- package/dist/components/ui/toaster.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +3 -0
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +3 -0
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +3 -0
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/dialogs/NodePickerDialog.d.ts.map +1 -1
- package/dist/dialogs/NodePickerDialog.js +3 -0
- package/dist/dialogs/NodePickerDialog.js.map +1 -1
- package/dist/dialogs/ValidationDialog.d.ts.map +1 -1
- package/dist/dialogs/ValidationDialog.js +3 -0
- package/dist/dialogs/ValidationDialog.js.map +1 -1
- package/dist/graph/BaseNode.d.ts.map +1 -1
- package/dist/graph/BaseNode.js +18 -12
- package/dist/graph/BaseNode.js.map +1 -1
- package/dist/graph/CustomEdge.d.ts.map +1 -1
- package/dist/graph/CustomEdge.js +6 -6
- package/dist/graph/CustomEdge.js.map +1 -1
- package/dist/graph/CustomNode.d.ts.map +1 -1
- package/dist/graph/CustomNode.js +3 -0
- package/dist/graph/CustomNode.js.map +1 -1
- package/dist/graph/FunctionCallNode.d.ts.map +1 -1
- package/dist/graph/FunctionCallNode.js.map +1 -1
- package/dist/graph/PortHandle.d.ts.map +1 -1
- package/dist/graph/PortHandle.js.map +1 -1
- package/dist/graph/reactFlowRegistry.d.ts.map +1 -1
- package/dist/graph/reactFlowRegistry.js +3 -1
- package/dist/graph/reactFlowRegistry.js.map +1 -1
- package/dist/hooks/use-toast.d.ts.map +1 -1
- package/dist/hooks/use-toast.js +3 -0
- package/dist/hooks/use-toast.js.map +1 -1
- package/dist/hooks/useAvailableVariables.d.ts.map +1 -1
- package/dist/hooks/useAvailableVariables.js +3 -0
- package/dist/hooks/useAvailableVariables.js.map +1 -1
- package/dist/hooks/useCanvasHistory.d.ts.map +1 -1
- package/dist/hooks/useCanvasHistory.js +3 -0
- package/dist/hooks/useCanvasHistory.js.map +1 -1
- package/dist/hooks/useCanvasTabs.d.ts.map +1 -1
- package/dist/hooks/useCanvasTabs.js +3 -0
- package/dist/hooks/useCanvasTabs.js.map +1 -1
- package/dist/hooks/useFunctionDiagnosticsSync.d.ts.map +1 -1
- package/dist/hooks/useFunctionDiagnosticsSync.js +3 -0
- package/dist/hooks/useFunctionDiagnosticsSync.js.map +1 -1
- package/dist/hooks/useFunctionRegistry.d.ts.map +1 -1
- package/dist/hooks/useFunctionRegistry.js +3 -0
- package/dist/hooks/useFunctionRegistry.js.map +1 -1
- package/dist/hooks/useFunctions.d.ts.map +1 -1
- package/dist/hooks/useFunctions.js +3 -0
- package/dist/hooks/useFunctions.js.map +1 -1
- package/dist/hooks/useGraph.d.ts.map +1 -1
- package/dist/hooks/useGraph.js +3 -0
- package/dist/hooks/useGraph.js.map +1 -1
- package/dist/hooks/useNodeDefinitions.d.ts.map +1 -1
- package/dist/hooks/useNodeDefinitions.js +3 -0
- package/dist/hooks/useNodeDefinitions.js.map +1 -1
- package/dist/hooks/useParamErrors.d.ts.map +1 -1
- package/dist/hooks/useParamErrors.js +3 -0
- package/dist/hooks/useParamErrors.js.map +1 -1
- package/dist/hooks/useResolvedTheme.d.ts.map +1 -1
- package/dist/hooks/useResolvedTheme.js +3 -0
- package/dist/hooks/useResolvedTheme.js.map +1 -1
- package/dist/hooks/useResourceDiagnosticsSync.d.ts.map +1 -1
- package/dist/hooks/useResourceDiagnosticsSync.js +3 -0
- package/dist/hooks/useResourceDiagnosticsSync.js.map +1 -1
- package/dist/hooks/useSuppressThemeTransition.d.ts.map +1 -1
- package/dist/hooks/useSuppressThemeTransition.js +3 -0
- package/dist/hooks/useSuppressThemeTransition.js.map +1 -1
- package/dist/hooks/useWorkflowSerialization.d.ts.map +1 -1
- package/dist/hooks/useWorkflowSerialization.js +3 -0
- package/dist/hooks/useWorkflowSerialization.js.map +1 -1
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/inputs/ExpressionInput.d.ts.map +1 -1
- package/dist/inputs/ExpressionInput.js +3 -0
- package/dist/inputs/ExpressionInput.js.map +1 -1
- package/dist/inputs/ParameterEditor.d.ts.map +1 -1
- package/dist/inputs/ParameterEditor.js +3 -0
- package/dist/inputs/ParameterEditor.js.map +1 -1
- package/dist/inputs/PortSection.d.ts.map +1 -1
- package/dist/inputs/PortSection.js.map +1 -1
- package/dist/mode.d.ts +11 -0
- package/dist/mode.d.ts.map +1 -0
- package/dist/mode.js +8 -0
- package/dist/mode.js.map +1 -0
- package/dist/panels/BuilderSidebar.d.ts.map +1 -1
- package/dist/panels/BuilderSidebar.js +3 -0
- package/dist/panels/BuilderSidebar.js.map +1 -1
- package/dist/panels/ChannelConfigPanel.d.ts.map +1 -1
- package/dist/panels/ChannelConfigPanel.js +3 -0
- package/dist/panels/ChannelConfigPanel.js.map +1 -1
- package/dist/panels/ChannelsPanel.d.ts.map +1 -1
- package/dist/panels/ChannelsPanel.js +3 -0
- package/dist/panels/ChannelsPanel.js.map +1 -1
- package/dist/panels/DebugConsolePanel.d.ts.map +1 -1
- package/dist/panels/DebugConsolePanel.js +3 -0
- package/dist/panels/DebugConsolePanel.js.map +1 -1
- package/dist/panels/DebugContextPanel.d.ts.map +1 -1
- package/dist/panels/DebugContextPanel.js +3 -0
- package/dist/panels/DebugContextPanel.js.map +1 -1
- package/dist/panels/DebugExternalIOPanel.d.ts.map +1 -1
- package/dist/panels/DebugExternalIOPanel.js +3 -0
- package/dist/panels/DebugExternalIOPanel.js.map +1 -1
- package/dist/panels/DiagnosticsPanel.d.ts.map +1 -1
- package/dist/panels/DiagnosticsPanel.js +3 -0
- package/dist/panels/DiagnosticsPanel.js.map +1 -1
- package/dist/panels/EdgeConfigPanel.d.ts.map +1 -1
- package/dist/panels/EdgeConfigPanel.js +4 -1
- package/dist/panels/EdgeConfigPanel.js.map +1 -1
- package/dist/panels/FunctionConfigPanel.d.ts.map +1 -1
- package/dist/panels/FunctionConfigPanel.js +4 -1
- package/dist/panels/FunctionConfigPanel.js.map +1 -1
- package/dist/panels/FunctionListPanel.d.ts.map +1 -1
- package/dist/panels/FunctionListPanel.js +3 -0
- package/dist/panels/FunctionListPanel.js.map +1 -1
- package/dist/panels/MemoryConfigPanel.d.ts.map +1 -1
- package/dist/panels/MemoryConfigPanel.js +3 -0
- package/dist/panels/MemoryConfigPanel.js.map +1 -1
- package/dist/panels/MemoryPanel.d.ts.map +1 -1
- package/dist/panels/MemoryPanel.js +3 -0
- package/dist/panels/MemoryPanel.js.map +1 -1
- package/dist/panels/ModelConfigPanel.d.ts.map +1 -1
- package/dist/panels/ModelConfigPanel.js +3 -0
- package/dist/panels/ModelConfigPanel.js.map +1 -1
- package/dist/panels/ModelsPanel.d.ts.map +1 -1
- package/dist/panels/ModelsPanel.js +3 -0
- package/dist/panels/ModelsPanel.js.map +1 -1
- package/dist/panels/NodeConfigPanel.d.ts.map +1 -1
- package/dist/panels/NodeConfigPanel.js +4 -1
- package/dist/panels/NodeConfigPanel.js.map +1 -1
- package/dist/panels/NodeLibrary.d.ts.map +1 -1
- package/dist/panels/NodeLibrary.js +4 -1
- package/dist/panels/NodeLibrary.js.map +1 -1
- package/dist/panels/ResourceConfigPanel.d.ts.map +1 -1
- package/dist/panels/ResourceConfigPanel.js +4 -1
- package/dist/panels/ResourceConfigPanel.js.map +1 -1
- package/dist/panels/ResourceListPanel.d.ts.map +1 -1
- package/dist/panels/ResourceListPanel.js +4 -1
- package/dist/panels/ResourceListPanel.js.map +1 -1
- package/dist/panels/VariableConfigPanel.d.ts.map +1 -1
- package/dist/panels/VariableConfigPanel.js +4 -1
- package/dist/panels/VariableConfigPanel.js.map +1 -1
- package/dist/panels/VariablesPanel.d.ts.map +1 -1
- package/dist/panels/VariablesPanel.js +4 -1
- package/dist/panels/VariablesPanel.js.map +1 -1
- package/dist/stores/canvasStore.d.ts.map +1 -1
- package/dist/stores/canvasStore.js +3 -0
- package/dist/stores/canvasStore.js.map +1 -1
- package/dist/stores/debugStore.d.ts.map +1 -1
- package/dist/stores/debugStore.js +3 -0
- package/dist/stores/debugStore.js.map +1 -1
- package/dist/stores/diagnosticsStore.d.ts.map +1 -1
- package/dist/stores/diagnosticsStore.js +3 -0
- package/dist/stores/diagnosticsStore.js.map +1 -1
- package/dist/stores/editorStore.d.ts +1 -1
- package/dist/stores/editorStore.d.ts.map +1 -1
- package/dist/stores/editorStore.js +3 -0
- package/dist/stores/editorStore.js.map +1 -1
- package/dist/utils/categoryConstants.d.ts.map +1 -1
- package/dist/utils/categoryConstants.js +3 -0
- package/dist/utils/categoryConstants.js.map +1 -1
- package/dist/utils/channelOperations.d.ts.map +1 -1
- package/dist/utils/channelOperations.js +3 -0
- package/dist/utils/channelOperations.js.map +1 -1
- package/dist/utils/connectionRules.d.ts +3 -1
- package/dist/utils/connectionRules.d.ts.map +1 -1
- package/dist/utils/connectionRules.js +11 -16
- package/dist/utils/connectionRules.js.map +1 -1
- package/dist/utils/functionOperations.d.ts.map +1 -1
- package/dist/utils/functionOperations.js +3 -0
- package/dist/utils/functionOperations.js.map +1 -1
- package/dist/utils/graphOperations.d.ts.map +1 -1
- package/dist/utils/graphOperations.js +3 -0
- package/dist/utils/graphOperations.js.map +1 -1
- package/dist/utils/history.d.ts.map +1 -1
- package/dist/utils/history.js +4 -1
- package/dist/utils/history.js.map +1 -1
- package/dist/utils/memoryOperations.d.ts.map +1 -1
- package/dist/utils/memoryOperations.js +3 -0
- package/dist/utils/memoryOperations.js.map +1 -1
- package/dist/utils/migrateFunctionNodes.d.ts.map +1 -1
- package/dist/utils/migrateFunctionNodes.js +3 -0
- package/dist/utils/migrateFunctionNodes.js.map +1 -1
- package/dist/utils/modelOperations.d.ts.map +1 -1
- package/dist/utils/modelOperations.js +3 -0
- package/dist/utils/modelOperations.js.map +1 -1
- package/dist/utils/paramDisplay.d.ts.map +1 -1
- package/dist/utils/paramDisplay.js +3 -0
- package/dist/utils/paramDisplay.js.map +1 -1
- package/dist/utils/resourceHelpers.d.ts.map +1 -1
- package/dist/utils/resourceHelpers.js +3 -0
- package/dist/utils/resourceHelpers.js.map +1 -1
- package/dist/utils/translation.d.ts.map +1 -1
- package/dist/utils/translation.js +3 -0
- package/dist/utils/translation.js.map +1 -1
- package/dist/utils/variableOperations.d.ts.map +1 -1
- package/dist/utils/variableOperations.js +3 -0
- package/dist/utils/variableOperations.js.map +1 -1
- package/package.json +2 -2
- package/src/BuilderLayout.tsx +54 -61
- package/src/Canvas.tsx +12 -3
- package/src/CanvasEditor.tsx +4 -0
- package/src/CanvasTabsToolbar.tsx +4 -0
- package/src/RightConfigPanel.tsx +4 -0
- package/src/WorkflowBuilder.tsx +33 -18
- package/src/cn.ts +4 -0
- package/src/components/ui/add-button.tsx +4 -0
- package/src/components/ui/alert-dialog.tsx +4 -0
- package/src/components/ui/alert.tsx +4 -0
- package/src/components/ui/badge.tsx +4 -0
- package/src/components/ui/button.tsx +4 -0
- package/src/components/ui/card.tsx +4 -0
- package/src/components/ui/checkbox.tsx +4 -0
- package/src/components/ui/collapsible.tsx +4 -0
- package/src/components/ui/command.tsx +4 -0
- package/src/components/ui/delete-button.tsx +4 -0
- package/src/components/ui/dialog.tsx +4 -0
- package/src/components/ui/dropdown-menu.tsx +4 -0
- package/src/components/ui/input.tsx +4 -0
- package/src/components/ui/label.tsx +4 -0
- package/src/components/ui/readonly-banner.tsx +4 -0
- package/src/components/ui/resizable.tsx +4 -0
- package/src/components/ui/scroll-area.tsx +4 -0
- package/src/components/ui/select.tsx +4 -0
- package/src/components/ui/separator.tsx +4 -0
- package/src/components/ui/switch.tsx +4 -0
- package/src/components/ui/textarea.tsx +4 -0
- package/src/components/ui/toast.tsx +4 -0
- package/src/components/ui/toaster.tsx +4 -0
- package/src/components/ui/toggle-group.tsx +4 -0
- package/src/components/ui/toggle.tsx +4 -0
- package/src/components/ui/tooltip.tsx +4 -0
- package/src/dialogs/NodePickerDialog.tsx +4 -0
- package/src/dialogs/ValidationDialog.tsx +4 -0
- package/src/graph/BaseNode.tsx +19 -11
- package/src/graph/CustomEdge.tsx +7 -5
- package/src/graph/CustomNode.tsx +4 -0
- package/src/graph/FunctionCallNode.tsx +4 -0
- package/src/graph/PortHandle.tsx +4 -0
- package/src/graph/reactFlowRegistry.ts +4 -1
- package/src/hooks/use-toast.ts +4 -0
- package/src/hooks/useAvailableVariables.ts +4 -0
- package/src/hooks/useCanvasHistory.ts +4 -0
- package/src/hooks/useCanvasTabs.ts +4 -0
- package/src/hooks/useFunctionDiagnosticsSync.ts +4 -0
- package/src/hooks/useFunctionRegistry.ts +4 -0
- package/src/hooks/useFunctions.ts +4 -0
- package/src/hooks/useGraph.ts +4 -0
- package/src/hooks/useNodeDefinitions.ts +4 -0
- package/src/hooks/useParamErrors.ts +4 -0
- package/src/hooks/useResolvedTheme.ts +4 -0
- package/src/hooks/useResourceDiagnosticsSync.ts +4 -0
- package/src/hooks/useSuppressThemeTransition.ts +4 -0
- package/src/hooks/useWorkflowSerialization.ts +4 -0
- package/src/i18n/index.ts +4 -0
- package/src/index.ts +5 -1
- package/src/inputs/ExpressionInput.tsx +4 -0
- package/src/inputs/ParameterEditor.tsx +4 -0
- package/src/inputs/PortSection.tsx +4 -0
- package/src/mode.ts +15 -0
- package/src/panels/BuilderSidebar.tsx +4 -0
- package/src/panels/ChannelConfigPanel.tsx +4 -0
- package/src/panels/ChannelsPanel.tsx +4 -0
- package/src/panels/DebugConsolePanel.tsx +4 -0
- package/src/panels/DebugContextPanel.tsx +4 -0
- package/src/panels/DebugExternalIOPanel.tsx +4 -0
- package/src/panels/DiagnosticsPanel.tsx +4 -0
- package/src/panels/EdgeConfigPanel.tsx +5 -1
- package/src/panels/FunctionConfigPanel.tsx +5 -1
- package/src/panels/FunctionListPanel.tsx +4 -0
- package/src/panels/MemoryConfigPanel.tsx +4 -0
- package/src/panels/MemoryPanel.tsx +4 -0
- package/src/panels/ModelConfigPanel.tsx +4 -0
- package/src/panels/ModelsPanel.tsx +4 -0
- package/src/panels/NodeConfigPanel.tsx +5 -1
- package/src/panels/NodeLibrary.tsx +5 -1
- package/src/panels/ResourceConfigPanel.tsx +5 -1
- package/src/panels/ResourceListPanel.tsx +5 -1
- package/src/panels/VariableConfigPanel.tsx +5 -1
- package/src/panels/VariablesPanel.tsx +5 -1
- package/src/stores/canvasStore.test.ts +4 -0
- package/src/stores/canvasStore.ts +4 -0
- package/src/stores/debugStore.ts +4 -0
- package/src/stores/diagnosticsStore.ts +4 -0
- package/src/stores/editorStore.ts +5 -1
- package/src/utils/categoryConstants.ts +4 -0
- package/src/utils/channelOperations.ts +4 -0
- package/src/utils/connectionRules.ts +12 -9
- package/src/utils/functionOperations.ts +4 -0
- package/src/utils/graphOperations.ts +4 -0
- package/src/utils/history.test.ts +92 -0
- package/src/utils/history.ts +5 -1
- package/src/utils/memoryOperations.ts +4 -0
- package/src/utils/migrateFunctionNodes.ts +4 -0
- package/src/utils/modelOperations.ts +4 -0
- package/src/utils/paramDisplay.ts +4 -0
- package/src/utils/resourceHelpers.ts +4 -0
- package/src/utils/translation.ts +4 -0
- package/src/utils/variableOperations.ts +4 -0
- package/tailwind-preset.ts +4 -0
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import { create, UseBoundStore, StoreApi } from "zustand";
|
|
2
6
|
import { Node, Edge, Viewport } from "@xyflow/react";
|
|
3
7
|
import { NodeCategory, type NodeData } from "@foresthubai/workflow-core/node";
|
package/src/stores/debugStore.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import { create } from "zustand";
|
|
2
6
|
|
|
3
7
|
// ---------------------------------------------------------------------------
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import { create } from "zustand";
|
|
2
6
|
import { getCanvasStore, getOrCreateCanvasStore, MAIN_CANVAS_ID } from "./canvasStore";
|
|
3
7
|
import type { Channel } from "@foresthubai/workflow-core/channel";
|
|
@@ -5,7 +9,7 @@ import type { Memory } from "@foresthubai/workflow-core/memory";
|
|
|
5
9
|
import type { Model, ModelInfo } from "@foresthubai/workflow-core/model";
|
|
6
10
|
import type { FunctionDeclaration } from "@foresthubai/workflow-core/function";
|
|
7
11
|
|
|
8
|
-
import type { BuilderMode } from "../
|
|
12
|
+
import type { BuilderMode } from "../mode";
|
|
9
13
|
// Type-only (erased) — the active left-sidebar tab lives here so non-sidebar code
|
|
10
14
|
// (e.g. validation navigation) can open a specific panel. No runtime cycle.
|
|
11
15
|
import type { SidebarTab } from "../panels/BuilderSidebar";
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
// Shared category icons and colors for node categories in the workflow builder.
|
|
2
6
|
|
|
3
7
|
import { NodeCategory } from "@foresthubai/workflow-core/node";
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import { CHANNEL_DEFINITION, type ChannelType, type Channel } from "@foresthubai/workflow-core/channel";
|
|
2
6
|
import { isParameterActive } from "@foresthubai/workflow-core/parameter";
|
|
3
7
|
import { useEditorStore } from "../stores/editorStore";
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
// Editor connection rules — which ports may connect, which node types are
|
|
2
6
|
// offered from a port, and whether a node can take another outgoing edge.
|
|
3
7
|
//
|
|
@@ -33,24 +37,23 @@ function hasControlFlowEdge(nodeId: string, nodeData: NodeData, edges: Edge[]):
|
|
|
33
37
|
/**
|
|
34
38
|
* Check whether an output port can accept at least one more outgoing edge.
|
|
35
39
|
* Used by the contextual "+" button on output ports.
|
|
40
|
+
* Takes the node's own data rather than the nodes array so per-node components
|
|
41
|
+
* (BaseNode) can call it without subscribing to all nodes.
|
|
36
42
|
*/
|
|
37
|
-
export function canPortAcceptEdge(
|
|
38
|
-
const
|
|
39
|
-
if (!node) return false;
|
|
40
|
-
|
|
41
|
-
const ports = getPorts(node.data);
|
|
43
|
+
export function canPortAcceptEdge(nodeData: NodeData, handleId: string, edges: Edge[]): boolean {
|
|
44
|
+
const ports = getPorts(nodeData);
|
|
42
45
|
const port = ports.output.find((p) => p.id === handleId);
|
|
43
46
|
if (!port) return false;
|
|
44
47
|
|
|
45
48
|
// Tool output ports always accept multiple edges (an agent wires up many tools).
|
|
46
49
|
// A control output port accepts a single edge unless the node can branch.
|
|
47
|
-
if (port.type === "control" && !NodeRegistry.getByType(
|
|
48
|
-
if (edges.some((e) => e.source ===
|
|
50
|
+
if (port.type === "control" && !NodeRegistry.getByType(nodeData.type)?.canBranch) {
|
|
51
|
+
if (edges.some((e) => e.source === nodeData.id && e.sourceHandle === handleId)) return false;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
// Mutual exclusion: control output blocked when node has tool-input edges
|
|
52
55
|
// (Tool output is exempt — never blocked)
|
|
53
|
-
if (port.type === "control" && hasToolInputEdge(
|
|
56
|
+
if (port.type === "control" && hasToolInputEdge(nodeData.id, nodeData, edges)) return false;
|
|
54
57
|
|
|
55
58
|
return true;
|
|
56
59
|
}
|
|
@@ -107,7 +110,7 @@ export const isValidConnection = (
|
|
|
107
110
|
if (!srcNode || !tgtNode) return false;
|
|
108
111
|
|
|
109
112
|
// Source-side checks via canPortAcceptEdge (multiple-outgoing + mutual exclusion)
|
|
110
|
-
if (!canPortAcceptEdge(
|
|
113
|
+
if (!canPortAcceptEdge(srcNode.data, sourceHandleId, edges)) return false;
|
|
111
114
|
|
|
112
115
|
// Get ports using centralized dispatcher
|
|
113
116
|
const sourcePorts = getPorts(srcNode.data);
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import type { Expression } from "@foresthubai/workflow-core";
|
|
2
6
|
import type { DataType } from "@foresthubai/workflow-core/parameter";
|
|
3
7
|
import type { FunctionDeclaration } from "@foresthubai/workflow-core/function";
|
|
@@ -0,0 +1,92 @@
|
|
|
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 { describe, it, expect, beforeEach } from "vitest";
|
|
6
|
+
import { create } from "zustand";
|
|
7
|
+
import { history } from "./history";
|
|
8
|
+
|
|
9
|
+
interface CounterState {
|
|
10
|
+
count: number;
|
|
11
|
+
label: string;
|
|
12
|
+
setCount: (n: number) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// A store on DEFAULT config — no custom equality/partialize — so the default
|
|
16
|
+
// equality path is what's under test.
|
|
17
|
+
function makeStore() {
|
|
18
|
+
return create(
|
|
19
|
+
history<CounterState>()((set) => ({
|
|
20
|
+
count: 0,
|
|
21
|
+
label: "a",
|
|
22
|
+
setCount: (n) => set((s) => ({ ...s, count: n })),
|
|
23
|
+
})),
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe("history middleware (default config)", () => {
|
|
28
|
+
let store: ReturnType<typeof makeStore>;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
store = makeStore();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("withCheckpoint records a checkpoint when the operation changes state", () => {
|
|
34
|
+
store.getState().withCheckpoint(() => store.getState().setCount(1));
|
|
35
|
+
expect(store.getState().count).toBe(1);
|
|
36
|
+
expect(store.getState().canUndo()).toBe(true);
|
|
37
|
+
|
|
38
|
+
store.getState().undo();
|
|
39
|
+
expect(store.getState().count).toBe(0);
|
|
40
|
+
expect(store.getState().canRedo()).toBe(true);
|
|
41
|
+
|
|
42
|
+
store.getState().redo();
|
|
43
|
+
expect(store.getState().count).toBe(1);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("withCheckpoint does NOT record a checkpoint for a no-op", () => {
|
|
47
|
+
store.getState().withCheckpoint(() => {});
|
|
48
|
+
expect(store.getState().canUndo()).toBe(false);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("a no-op withCheckpoint preserves the redo stack", () => {
|
|
52
|
+
store.getState().withCheckpoint(() => store.getState().setCount(1));
|
|
53
|
+
store.getState().undo();
|
|
54
|
+
expect(store.getState().canRedo()).toBe(true);
|
|
55
|
+
|
|
56
|
+
store.getState().withCheckpoint(() => {});
|
|
57
|
+
expect(store.getState().canRedo()).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("a real change clears the redo stack", () => {
|
|
61
|
+
store.getState().withCheckpoint(() => store.getState().setCount(1));
|
|
62
|
+
store.getState().undo();
|
|
63
|
+
store.getState().withCheckpoint(() => store.getState().setCount(7));
|
|
64
|
+
expect(store.getState().canRedo()).toBe(false);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("withCheckpoint returns the operation's result and propagates throws without a checkpoint", () => {
|
|
68
|
+
expect(store.getState().withCheckpoint(() => 42)).toBe(42);
|
|
69
|
+
expect(() =>
|
|
70
|
+
store.getState().withCheckpoint(() => {
|
|
71
|
+
throw new Error("boom");
|
|
72
|
+
}),
|
|
73
|
+
).toThrow("boom");
|
|
74
|
+
expect(store.getState().canUndo()).toBe(false);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("mutationCount ticks on checkpointed changes only", () => {
|
|
78
|
+
const before = store.getState().mutationCount;
|
|
79
|
+
store.getState().withCheckpoint(() => {});
|
|
80
|
+
expect(store.getState().mutationCount).toBe(before);
|
|
81
|
+
store.getState().withCheckpoint(() => store.getState().setCount(5));
|
|
82
|
+
expect(store.getState().mutationCount).toBe(before + 1);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("takeCheckpoint always records, and clearHistory empties both stacks", () => {
|
|
86
|
+
store.getState().takeCheckpoint();
|
|
87
|
+
expect(store.getState().canUndo()).toBe(true);
|
|
88
|
+
store.getState().clearHistory();
|
|
89
|
+
expect(store.getState().canUndo()).toBe(false);
|
|
90
|
+
expect(store.getState().canRedo()).toBe(false);
|
|
91
|
+
});
|
|
92
|
+
});
|
package/src/utils/history.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import { StateCreator, StoreMutatorIdentifier } from "zustand";
|
|
2
6
|
|
|
3
7
|
// Opaque type for exporting/importing history state
|
|
@@ -99,7 +103,7 @@ export const history =
|
|
|
99
103
|
const {
|
|
100
104
|
limit = 50,
|
|
101
105
|
partialize = (state) => state,
|
|
102
|
-
equality = (before, after) => JSON.stringify(before)
|
|
106
|
+
equality = (before, after) => JSON.stringify(before) === JSON.stringify(after),
|
|
103
107
|
} = config;
|
|
104
108
|
|
|
105
109
|
return (set, get, store) => {
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import { MemoryRegistry, type MemoryType, type Memory } from "@foresthubai/workflow-core/memory";
|
|
2
6
|
import { useEditorStore } from "../stores/editorStore";
|
|
3
7
|
import { generateId } from "@foresthubai/workflow-core/id";
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import type { OutputBinding, FunctionCallNode } from "@foresthubai/workflow-core/node";
|
|
2
6
|
import type { Expression } from "@foresthubai/workflow-core";
|
|
3
7
|
import { toast } from "../hooks/use-toast";
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import { ModelRegistry, type ModelType, type Model } from "@foresthubai/workflow-core/model";
|
|
2
6
|
import { useEditorStore } from "../stores/editorStore";
|
|
3
7
|
import { generateId } from "@foresthubai/workflow-core/id";
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
// Presentation-only formatters for inline node display. These render domain
|
|
2
6
|
// values to human-readable text; they live in the builder (not headless
|
|
3
7
|
// workflow-core) because formatting for display is an editor concern.
|
package/src/utils/translation.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import type { TFunction } from "i18next";
|
|
2
6
|
import type { NodeDefinition } from "@foresthubai/workflow-core/node";
|
|
3
7
|
import type { Parameter } from "@foresthubai/workflow-core/parameter";
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
1
5
|
import { declaredVarKey, type DeclaredVariable } from "@foresthubai/workflow-core/variable";
|
|
2
6
|
import type { DataType } from "@foresthubai/workflow-core";
|
|
3
7
|
import { getOrCreateCanvasStore } from "../stores/canvasStore";
|
package/tailwind-preset.ts
CHANGED