@flowdrop/flowdrop 1.5.0 → 1.7.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/README.md +46 -47
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +26 -26
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +2 -2
- package/dist/adapters/agentspec/AgentSpecAdapter.js +122 -133
- package/dist/adapters/agentspec/agentAdapter.d.ts +2 -2
- package/dist/adapters/agentspec/agentAdapter.js +10 -10
- package/dist/adapters/agentspec/autoLayout.d.ts +1 -1
- package/dist/adapters/agentspec/autoLayout.js +7 -9
- package/dist/adapters/agentspec/componentTypeDefaults.d.ts +1 -1
- package/dist/adapters/agentspec/componentTypeDefaults.js +120 -120
- package/dist/adapters/agentspec/defaultNodeTypes.d.ts +2 -2
- package/dist/adapters/agentspec/defaultNodeTypes.js +307 -307
- package/dist/adapters/agentspec/index.d.ts +10 -10
- package/dist/adapters/agentspec/index.js +6 -6
- package/dist/adapters/agentspec/validator.d.ts +2 -2
- package/dist/adapters/agentspec/validator.js +20 -22
- package/dist/api/enhanced-client.d.ts +3 -3
- package/dist/api/enhanced-client.js +72 -73
- package/dist/chat/commandClassifier.js +6 -6
- package/dist/chat/index.d.ts +5 -5
- package/dist/chat/index.js +4 -4
- package/dist/chat/responseParser.d.ts +6 -6
- package/dist/chat/responseParser.js +28 -24
- package/dist/commands/batch.d.ts +1 -1
- package/dist/commands/batch.js +5 -7
- package/dist/commands/executor.d.ts +2 -2
- package/dist/commands/executor.js +320 -231
- package/dist/commands/index.d.ts +6 -6
- package/dist/commands/index.js +5 -5
- package/dist/commands/parser.d.ts +1 -1
- package/dist/commands/parser.js +91 -74
- package/dist/commands/positioner.d.ts +2 -2
- package/dist/commands/positioner.js +1 -1
- package/dist/commands/storeIntegration.svelte.d.ts +2 -2
- package/dist/commands/storeIntegration.svelte.js +5 -5
- package/dist/commands/types.d.ts +42 -42
- package/dist/commands/types.js +2 -2
- package/dist/components/App.svelte +280 -303
- package/dist/components/App.svelte.d.ts +11 -9
- package/dist/components/CanvasBanner.stories.svelte +10 -16
- package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
- package/dist/components/CanvasBanner.svelte +2 -2
- package/dist/components/CanvasBanner.svelte.d.ts +1 -1
- package/dist/components/CanvasController.svelte +3 -4
- package/dist/components/ConfigForm.svelte +118 -256
- package/dist/components/ConfigForm.svelte.d.ts +2 -2
- package/dist/components/ConfigMappingRow.svelte +7 -9
- package/dist/components/ConfigMappingRow.svelte.d.ts +1 -1
- package/dist/components/ConfigModal.svelte +3 -3
- package/dist/components/ConfigModal.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.stories.svelte +19 -19
- package/dist/components/ConfigPanel.stories.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.svelte +9 -20
- package/dist/components/ConfigPanel.svelte.d.ts +1 -1
- package/dist/components/ConnectionLine.svelte +4 -4
- package/dist/components/EdgeRefresher.svelte +1 -1
- package/dist/components/FlowDropEdge.stories.svelte +110 -110
- package/dist/components/FlowDropEdge.svelte +9 -9
- package/dist/components/FlowDropEdge.svelte.d.ts +1 -1
- package/dist/components/FlowDropZone.svelte +6 -9
- package/dist/components/FlowDropZone.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.stories.svelte +13 -13
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.svelte +3 -3
- package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
- package/dist/components/Logo.stories.svelte +4 -4
- package/dist/components/Logo.stories.svelte.d.ts +1 -1
- package/dist/components/Logo.svelte +3 -9
- package/dist/components/LogsSidebar.svelte +41 -48
- package/dist/components/LogsSidebar.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.stories.svelte +10 -14
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.svelte +4 -6
- package/dist/components/Navbar.stories.svelte +19 -19
- package/dist/components/Navbar.stories.svelte.d.ts +1 -1
- package/dist/components/Navbar.svelte +28 -49
- package/dist/components/Navbar.svelte.d.ts +2 -2
- package/dist/components/NodeSidebar.svelte +42 -88
- package/dist/components/NodeSidebar.svelte.d.ts +1 -1
- package/dist/components/NodeStatusOverlay.stories.svelte +19 -31
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
- package/dist/components/NodeStatusOverlay.svelte +40 -55
- package/dist/components/NodeStatusOverlay.svelte.d.ts +3 -3
- package/dist/components/NodeSwapPicker.svelte +20 -64
- package/dist/components/NodeSwapPicker.svelte.d.ts +1 -1
- package/dist/components/PipelineStatus.svelte +63 -89
- package/dist/components/PipelineStatus.svelte.d.ts +4 -4
- package/dist/components/PortCoordinateTracker.svelte +5 -7
- package/dist/components/PortCoordinateTracker.svelte.d.ts +1 -1
- package/dist/components/PortMappingRow.svelte +20 -24
- package/dist/components/PortMappingRow.svelte.d.ts +2 -2
- package/dist/components/ReadOnlyDetails.svelte +1 -1
- package/dist/components/SchemaForm.stories.svelte +53 -53
- package/dist/components/SchemaForm.stories.svelte.d.ts +1 -1
- package/dist/components/SchemaForm.svelte +24 -51
- package/dist/components/SchemaForm.svelte.d.ts +2 -2
- package/dist/components/SettingsModal.svelte +6 -9
- package/dist/components/SettingsModal.svelte.d.ts +1 -1
- package/dist/components/SettingsPanel.svelte +138 -158
- package/dist/components/SettingsPanel.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.stories.svelte +16 -29
- package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.svelte +19 -19
- package/dist/components/StatusIcon.svelte.d.ts +2 -2
- package/dist/components/StatusLabel.stories.svelte +8 -8
- package/dist/components/StatusLabel.stories.svelte.d.ts +1 -1
- package/dist/components/SwapMappingEditor.svelte +35 -56
- package/dist/components/SwapMappingEditor.svelte.d.ts +2 -2
- package/dist/components/ThemeToggle.stories.svelte +10 -10
- package/dist/components/ThemeToggle.stories.svelte.d.ts +1 -1
- package/dist/components/ThemeToggle.svelte +22 -33
- package/dist/components/ThemeToggle.svelte.d.ts +1 -1
- package/dist/components/UniversalNode.svelte +29 -41
- package/dist/components/UniversalNode.svelte.d.ts +3 -3
- package/dist/components/WorkflowEditor.svelte +113 -168
- package/dist/components/WorkflowEditor.svelte.d.ts +4 -4
- package/dist/components/chat/AIChatPanel.svelte +272 -133
- package/dist/components/chat/AIChatPanel.svelte.d.ts +3 -3
- package/dist/components/chat/CommandPreview.svelte +74 -24
- package/dist/components/chat/CommandPreview.svelte.d.ts +1 -1
- package/dist/components/console/CommandConsole.stories.svelte +71 -53
- package/dist/components/console/CommandConsole.stories.svelte.d.ts +1 -1
- package/dist/components/console/CommandConsole.svelte +39 -35
- package/dist/components/console/CommandConsole.svelte.d.ts +2 -2
- package/dist/components/console/ConsoleAutocomplete.svelte +6 -3
- package/dist/components/console/ConsoleInput.svelte +148 -89
- package/dist/components/console/ConsoleInput.svelte.d.ts +1 -1
- package/dist/components/console/ConsoleOutput.svelte +5 -10
- package/dist/components/console/ConsoleOutput.svelte.d.ts +1 -1
- package/dist/components/console/formatters.d.ts +1 -1
- package/dist/components/console/formatters.js +27 -29
- package/dist/components/form/FormArray.svelte +75 -132
- package/dist/components/form/FormArray.svelte.d.ts +1 -1
- package/dist/components/form/FormAutocomplete.svelte +65 -108
- package/dist/components/form/FormAutocomplete.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.stories.svelte +13 -16
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.svelte +2 -2
- package/dist/components/form/FormCodeEditor.svelte +46 -59
- package/dist/components/form/FormField.svelte +79 -90
- package/dist/components/form/FormField.svelte.d.ts +2 -2
- package/dist/components/form/FormFieldLight.svelte +72 -88
- package/dist/components/form/FormFieldLight.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.stories.svelte +14 -14
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.svelte +2 -9
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldset.svelte +3 -3
- package/dist/components/form/FormFieldset.svelte.d.ts +2 -2
- package/dist/components/form/FormMarkdownEditor.svelte +123 -156
- package/dist/components/form/FormNumberField.stories.svelte +18 -18
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormNumberField.svelte +6 -6
- package/dist/components/form/FormRangeField.stories.svelte +13 -13
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormRangeField.svelte +4 -12
- package/dist/components/form/FormSelect.stories.svelte +21 -21
- package/dist/components/form/FormSelect.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormSelect.svelte +5 -5
- package/dist/components/form/FormSelect.svelte.d.ts +1 -1
- package/dist/components/form/FormTemplateEditor.svelte +126 -175
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.stories.svelte +17 -23
- package/dist/components/form/FormTextField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.svelte +4 -4
- package/dist/components/form/FormTextarea.stories.svelte +18 -21
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextarea.svelte +4 -4
- package/dist/components/form/FormToggle.stories.svelte +13 -16
- package/dist/components/form/FormToggle.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormToggle.svelte +3 -3
- package/dist/components/form/FormUISchemaRenderer.svelte +12 -19
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +3 -3
- package/dist/components/form/index.d.ts +19 -19
- package/dist/components/form/index.js +18 -18
- package/dist/components/form/templateAutocomplete.d.ts +2 -2
- package/dist/components/form/templateAutocomplete.js +55 -64
- package/dist/components/form/types.d.ts +6 -6
- package/dist/components/form/types.js +4 -9
- package/dist/components/icons/AlertCircleIcon.svelte +1 -6
- package/dist/components/icons/CogIcon.svelte +1 -6
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +27 -27
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ChoicePrompt.svelte +17 -41
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +17 -17
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.svelte +10 -16
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/FormPrompt.svelte +10 -15
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/InterruptBubble.svelte +87 -121
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +2 -2
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +37 -37
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ReviewPrompt.svelte +55 -75
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +16 -17
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.svelte +13 -18
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/index.d.ts +6 -6
- package/dist/components/interrupt/index.js +6 -6
- package/dist/components/layouts/MainLayout.svelte +46 -84
- package/dist/components/layouts/MainLayout.svelte.d.ts +6 -6
- package/dist/components/nodes/GatewayNode.stories.svelte +64 -65
- package/dist/components/nodes/GatewayNode.svelte +37 -70
- package/dist/components/nodes/GatewayNode.svelte.d.ts +3 -3
- package/dist/components/nodes/IdeaNode.stories.svelte +25 -26
- package/dist/components/nodes/IdeaNode.svelte +22 -36
- package/dist/components/nodes/IdeaNode.svelte.d.ts +1 -1
- package/dist/components/nodes/NotesNode.stories.svelte +37 -38
- package/dist/components/nodes/NotesNode.svelte +28 -39
- package/dist/components/nodes/NotesNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SimpleNode.stories.svelte +137 -138
- package/dist/components/nodes/SimpleNode.svelte +51 -81
- package/dist/components/nodes/SimpleNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SquareNode.stories.svelte +75 -75
- package/dist/components/nodes/SquareNode.svelte +42 -68
- package/dist/components/nodes/SquareNode.svelte.d.ts +1 -1
- package/dist/components/nodes/TerminalNode.stories.svelte +10 -10
- package/dist/components/nodes/TerminalNode.svelte +74 -112
- package/dist/components/nodes/TerminalNode.svelte.d.ts +1 -1
- package/dist/components/nodes/ToolNode.stories.svelte +115 -116
- package/dist/components/nodes/ToolNode.svelte +31 -64
- package/dist/components/nodes/ToolNode.svelte.d.ts +1 -1
- package/dist/components/nodes/WorkflowNode.stories.svelte +84 -89
- package/dist/components/nodes/WorkflowNode.svelte +50 -103
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +3 -3
- package/dist/components/playground/ChatPanel.svelte +47 -103
- package/dist/components/playground/ExecutionLogs.svelte +45 -68
- package/dist/components/playground/InputCollector.svelte +32 -51
- package/dist/components/playground/MessageBubble.stories.svelte +25 -25
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +1 -1
- package/dist/components/playground/MessageBubble.svelte +54 -70
- package/dist/components/playground/MessageBubble.svelte.d.ts +1 -1
- package/dist/components/playground/Playground.svelte +60 -91
- package/dist/components/playground/Playground.svelte.d.ts +3 -3
- package/dist/components/playground/PlaygroundModal.svelte +8 -12
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -3
- package/dist/components/playground/SessionManager.svelte +34 -40
- package/dist/components/playground/SessionManager.svelte.d.ts +1 -1
- package/dist/config/agentSpecEndpoints.d.ts +1 -1
- package/dist/config/agentSpecEndpoints.js +20 -20
- package/dist/config/constants.js +2 -2
- package/dist/config/defaultCategories.d.ts +1 -1
- package/dist/config/defaultCategories.js +86 -86
- package/dist/config/defaultPortConfig.d.ts +1 -1
- package/dist/config/defaultPortConfig.js +144 -144
- package/dist/config/endpoints.d.ts +4 -4
- package/dist/config/endpoints.js +68 -68
- package/dist/config/runtimeConfig.d.ts +2 -2
- package/dist/config/runtimeConfig.js +8 -8
- package/dist/core/index.d.ts +68 -68
- package/dist/core/index.js +38 -38
- package/dist/display/index.d.ts +2 -2
- package/dist/display/index.js +2 -2
- package/dist/editor/index.d.ts +64 -64
- package/dist/editor/index.js +54 -54
- package/dist/form/code.d.ts +5 -5
- package/dist/form/code.js +14 -14
- package/dist/form/fieldRegistry.d.ts +3 -3
- package/dist/form/fieldRegistry.js +9 -11
- package/dist/form/full.d.ts +8 -8
- package/dist/form/full.js +9 -9
- package/dist/form/index.d.ts +18 -18
- package/dist/form/index.js +16 -16
- package/dist/form/markdown.d.ts +4 -4
- package/dist/form/markdown.js +8 -8
- package/dist/helpers/proximityConnect.d.ts +3 -3
- package/dist/helpers/proximityConnect.js +32 -34
- package/dist/helpers/workflowEditorHelper.d.ts +6 -6
- package/dist/helpers/workflowEditorHelper.js +64 -68
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/mocks/app-environment.js +2 -2
- package/dist/mocks/app-forms.js +1 -1
- package/dist/mocks/app-navigation.js +2 -2
- package/dist/mocks/app-stores.js +3 -3
- package/dist/playground/index.d.ts +19 -19
- package/dist/playground/index.js +16 -16
- package/dist/playground/mount.d.ts +3 -3
- package/dist/playground/mount.js +24 -24
- package/dist/registry/builtinFormats.js +13 -13
- package/dist/registry/builtinNodes.d.ts +2 -2
- package/dist/registry/builtinNodes.js +77 -77
- package/dist/registry/index.d.ts +4 -4
- package/dist/registry/index.js +4 -4
- package/dist/registry/nodeComponentRegistry.d.ts +8 -8
- package/dist/registry/nodeComponentRegistry.js +9 -11
- package/dist/registry/plugin.d.ts +2 -2
- package/dist/registry/plugin.js +11 -11
- package/dist/registry/workflowFormatRegistry.d.ts +3 -3
- package/dist/registry/workflowFormatRegistry.js +2 -2
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/schemas/v1/workflow.schema.json +5 -0
- package/dist/services/agentSpecExecutionService.d.ts +3 -3
- package/dist/services/agentSpecExecutionService.js +55 -56
- package/dist/services/api.d.ts +2 -2
- package/dist/services/api.js +37 -37
- package/dist/services/apiVariableService.d.ts +1 -1
- package/dist/services/apiVariableService.js +34 -41
- package/dist/services/autoSaveService.js +8 -8
- package/dist/services/categoriesApi.d.ts +2 -2
- package/dist/services/categoriesApi.js +8 -8
- package/dist/services/chatService.d.ts +1 -1
- package/dist/services/chatService.js +18 -18
- package/dist/services/draftStorage.d.ts +1 -1
- package/dist/services/draftStorage.js +11 -11
- package/dist/services/dynamicSchemaService.d.ts +1 -1
- package/dist/services/dynamicSchemaService.js +39 -41
- package/dist/services/globalSave.d.ts +2 -2
- package/dist/services/globalSave.js +38 -41
- package/dist/services/historyService.d.ts +1 -1
- package/dist/services/historyService.js +10 -10
- package/dist/services/interruptService.d.ts +1 -1
- package/dist/services/interruptService.js +29 -35
- package/dist/services/nodeExecutionService.d.ts +1 -1
- package/dist/services/nodeExecutionService.js +44 -45
- package/dist/services/playgroundService.d.ts +1 -1
- package/dist/services/playgroundService.js +29 -29
- package/dist/services/portConfigApi.d.ts +2 -2
- package/dist/services/portConfigApi.js +8 -8
- package/dist/services/settingsService.d.ts +2 -2
- package/dist/services/settingsService.js +19 -25
- package/dist/services/toastService.d.ts +4 -4
- package/dist/services/toastService.js +33 -33
- package/dist/services/variableService.d.ts +1 -1
- package/dist/services/variableService.js +36 -36
- package/dist/services/workflowStorage.d.ts +2 -2
- package/dist/services/workflowStorage.js +13 -13
- package/dist/settings/index.d.ts +7 -7
- package/dist/settings/index.js +6 -6
- package/dist/skins/default.d.ts +1 -1
- package/dist/skins/default.js +1 -1
- package/dist/skins/index.d.ts +3 -3
- package/dist/skins/index.js +7 -7
- package/dist/skins/slate.d.ts +1 -1
- package/dist/skins/slate.js +69 -69
- package/dist/stores/categoriesStore.svelte.d.ts +1 -1
- package/dist/stores/categoriesStore.svelte.js +5 -5
- package/dist/stores/editorStateMachine.svelte.d.ts +2 -2
- package/dist/stores/editorStateMachine.svelte.js +34 -34
- package/dist/stores/historyStore.svelte.d.ts +4 -4
- package/dist/stores/historyStore.svelte.js +4 -4
- package/dist/stores/interruptStore.svelte.d.ts +3 -3
- package/dist/stores/interruptStore.svelte.js +21 -21
- package/dist/stores/playgroundStore.svelte.d.ts +2 -2
- package/dist/stores/playgroundStore.svelte.js +18 -21
- package/dist/stores/portCoordinateStore.svelte.d.ts +2 -2
- package/dist/stores/portCoordinateStore.svelte.js +10 -13
- package/dist/stores/settingsStore.svelte.d.ts +2 -2
- package/dist/stores/settingsStore.svelte.js +57 -62
- package/dist/stores/workflowStore.svelte.d.ts +4 -3
- package/dist/stores/workflowStore.svelte.js +47 -47
- package/dist/stories/CanvasDecorator.svelte +7 -10
- package/dist/stories/CanvasDecorator.svelte.d.ts +2 -2
- package/dist/stories/EdgeDecorator.svelte +28 -31
- package/dist/stories/EdgeDecorator.svelte.d.ts +1 -1
- package/dist/stories/NodeDecorator.svelte +14 -20
- package/dist/stories/NodeDecorator.svelte.d.ts +1 -1
- package/dist/stories/utils.d.ts +2 -2
- package/dist/stories/utils.js +89 -93
- package/dist/styles/base.css +16 -50
- package/dist/styles/tokens.css +10 -28
- package/dist/svelte-app.d.ts +10 -10
- package/dist/svelte-app.js +39 -39
- package/dist/themes/default.d.ts +1 -1
- package/dist/themes/default.js +4 -4
- package/dist/themes/index.d.ts +3 -3
- package/dist/themes/index.js +11 -11
- package/dist/themes/minimal.d.ts +1 -1
- package/dist/themes/minimal.js +5 -5
- package/dist/types/agentspec.d.ts +18 -18
- package/dist/types/agentspec.js +2 -2
- package/dist/types/auth.d.ts +1 -1
- package/dist/types/auth.js +6 -6
- package/dist/types/chat.d.ts +2 -2
- package/dist/types/config.d.ts +6 -6
- package/dist/types/events.d.ts +3 -3
- package/dist/types/events.js +2 -2
- package/dist/types/index.d.ts +34 -32
- package/dist/types/index.js +6 -6
- package/dist/types/interrupt.d.ts +6 -6
- package/dist/types/interrupt.js +21 -21
- package/dist/types/interruptState.d.ts +12 -12
- package/dist/types/interruptState.js +66 -66
- package/dist/types/playground.d.ts +7 -7
- package/dist/types/playground.js +14 -14
- package/dist/types/settings.d.ts +7 -5
- package/dist/types/settings.js +19 -24
- package/dist/types/skin.d.ts +1 -1
- package/dist/types/theme.d.ts +2 -2
- package/dist/types/uischema.d.ts +4 -4
- package/dist/types/uischema.js +3 -3
- package/dist/utils/colors.d.ts +1 -1
- package/dist/utils/colors.js +95 -97
- package/dist/utils/config.d.ts +2 -2
- package/dist/utils/config.js +48 -48
- package/dist/utils/connections.d.ts +6 -2
- package/dist/utils/connections.js +21 -15
- package/dist/utils/edgeStyling.d.ts +2 -2
- package/dist/utils/edgeStyling.js +36 -39
- package/dist/utils/errors.js +3 -3
- package/dist/utils/fetchWithAuth.d.ts +1 -1
- package/dist/utils/fetchWithAuth.js +2 -2
- package/dist/utils/handleIds.d.ts +2 -2
- package/dist/utils/handleIds.js +8 -8
- package/dist/utils/handlePositioning.d.ts +1 -1
- package/dist/utils/handlePositioning.js +2 -2
- package/dist/utils/icons.d.ts +1 -1
- package/dist/utils/icons.js +74 -74
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/logger.js +7 -7
- package/dist/utils/nodeIds.d.ts +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeStatus.d.ts +1 -1
- package/dist/utils/nodeStatus.js +48 -48
- package/dist/utils/nodeSwap.d.ts +9 -9
- package/dist/utils/nodeSwap.js +52 -58
- package/dist/utils/nodeTypes.d.ts +1 -1
- package/dist/utils/nodeTypes.js +20 -21
- package/dist/utils/nodeWrapper.d.ts +7 -7
- package/dist/utils/nodeWrapper.js +19 -21
- package/dist/utils/performanceUtils.d.ts +1 -1
- package/dist/utils/performanceUtils.js +1 -2
- package/dist/utils/portUtils.d.ts +2 -2
- package/dist/utils/portUtils.js +1 -1
- package/dist/utils/sanitize.js +1 -1
- package/dist/utils/uischema.d.ts +2 -2
- package/dist/utils/uischema.js +8 -8
- package/dist/utils/validation.js +8 -8
- package/package.json +7 -11
package/dist/utils/nodeSwap.js
CHANGED
|
@@ -6,23 +6,19 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module utils/nodeSwap
|
|
8
8
|
*/
|
|
9
|
-
import { buildHandleId, extractPortId, extractDirection } from
|
|
10
|
-
import { generateNodeId } from
|
|
9
|
+
import { buildHandleId, extractPortId, extractDirection } from './handleIds.js';
|
|
10
|
+
import { generateNodeId } from './nodeIds.js';
|
|
11
11
|
/** Error class for swap validation failures. */
|
|
12
12
|
export class SwapValidationError extends Error {
|
|
13
13
|
constructor(message) {
|
|
14
14
|
super(message);
|
|
15
|
-
this.name =
|
|
15
|
+
this.name = 'SwapValidationError';
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
// =========================================================================
|
|
19
19
|
// Dynamic port keys that should never be carried over
|
|
20
20
|
// =========================================================================
|
|
21
|
-
const DYNAMIC_PORT_KEYS = new Set([
|
|
22
|
-
"dynamicInputs",
|
|
23
|
-
"dynamicOutputs",
|
|
24
|
-
"branches",
|
|
25
|
-
]);
|
|
21
|
+
const DYNAMIC_PORT_KEYS = new Set(['dynamicInputs', 'dynamicOutputs', 'branches']);
|
|
26
22
|
// =========================================================================
|
|
27
23
|
// Semver comparison
|
|
28
24
|
// =========================================================================
|
|
@@ -34,10 +30,10 @@ const DYNAMIC_PORT_KEYS = new Set([
|
|
|
34
30
|
*/
|
|
35
31
|
export function compareSemver(a, b) {
|
|
36
32
|
// Split off pre-release tag
|
|
37
|
-
const [aCore, aPre] = a.split(
|
|
38
|
-
const [bCore, bPre] = b.split(
|
|
39
|
-
const aParts = aCore.split(
|
|
40
|
-
const bParts = bCore.split(
|
|
33
|
+
const [aCore, aPre] = a.split('-', 2);
|
|
34
|
+
const [bCore, bPre] = b.split('-', 2);
|
|
35
|
+
const aParts = aCore.split('.').map(Number);
|
|
36
|
+
const bParts = bCore.split('.').map(Number);
|
|
41
37
|
const maxLen = Math.max(aParts.length, bParts.length);
|
|
42
38
|
for (let i = 0; i < maxLen; i++) {
|
|
43
39
|
const av = aParts[i] ?? 0;
|
|
@@ -107,7 +103,7 @@ function findMatchingPort(oldPort, newPorts, usedPortIds, checker) {
|
|
|
107
103
|
if (!checker)
|
|
108
104
|
return a.dataType === b.dataType;
|
|
109
105
|
// Check both directions since the port role (input vs output) matters
|
|
110
|
-
if (oldPort.type ===
|
|
106
|
+
if (oldPort.type === 'input') {
|
|
111
107
|
// Old port is input → old dataType was the target; check any source can feed into new port
|
|
112
108
|
return checker.areDataTypesCompatible(a.dataType, b.dataType);
|
|
113
109
|
}
|
|
@@ -135,9 +131,7 @@ function resolvePort(node, handleId, direction) {
|
|
|
135
131
|
const portId = extractPortId(handleId);
|
|
136
132
|
if (!portId)
|
|
137
133
|
return null;
|
|
138
|
-
const ports = direction ===
|
|
139
|
-
? node.data.metadata.inputs
|
|
140
|
-
: node.data.metadata.outputs;
|
|
134
|
+
const ports = direction === 'input' ? node.data.metadata.inputs : node.data.metadata.outputs;
|
|
141
135
|
return ports.find((p) => p.id === portId) ?? null;
|
|
142
136
|
}
|
|
143
137
|
// =========================================================================
|
|
@@ -161,7 +155,7 @@ export function computeSwapPreview(oldNode, newMetadata, edges, allNodes, checke
|
|
|
161
155
|
const droppedEdges = [];
|
|
162
156
|
for (const edge of connectedEdges) {
|
|
163
157
|
const isSource = edge.source === oldNodeId;
|
|
164
|
-
const direction = isSource ?
|
|
158
|
+
const direction = isSource ? 'output' : 'input';
|
|
165
159
|
const handleId = isSource ? edge.sourceHandle : edge.targetHandle;
|
|
166
160
|
const usedPorts = isSource ? usedOutputPortIds : usedInputPortIds;
|
|
167
161
|
// Resolve the old port
|
|
@@ -169,17 +163,17 @@ export function computeSwapPreview(oldNode, newMetadata, edges, allNodes, checke
|
|
|
169
163
|
if (!oldPort) {
|
|
170
164
|
droppedEdges.push({
|
|
171
165
|
edge,
|
|
172
|
-
reason: `Port not found on original node
|
|
166
|
+
reason: `Port not found on original node`
|
|
173
167
|
});
|
|
174
168
|
continue;
|
|
175
169
|
}
|
|
176
170
|
// Find matching port on new node
|
|
177
|
-
const newPorts = direction ===
|
|
171
|
+
const newPorts = direction === 'input' ? newMetadata.inputs : newMetadata.outputs;
|
|
178
172
|
const match = findMatchingPort(oldPort, newPorts, usedPorts, checker);
|
|
179
173
|
if (!match) {
|
|
180
174
|
droppedEdges.push({
|
|
181
175
|
edge,
|
|
182
|
-
reason: `No compatible ${direction} port found on "${newMetadata.name}"
|
|
176
|
+
reason: `No compatible ${direction} port found on "${newMetadata.name}"`
|
|
183
177
|
});
|
|
184
178
|
continue;
|
|
185
179
|
}
|
|
@@ -205,7 +199,7 @@ export function computeSwapPreview(oldNode, newMetadata, edges, allNodes, checke
|
|
|
205
199
|
hasDataLoss: droppedEdges.length > 0,
|
|
206
200
|
newNodeId,
|
|
207
201
|
configCarriedOver: carriedOver,
|
|
208
|
-
configReset: reset
|
|
202
|
+
configReset: reset
|
|
209
203
|
};
|
|
210
204
|
}
|
|
211
205
|
// =========================================================================
|
|
@@ -225,20 +219,20 @@ export function executeSwap(oldNode, newMetadata, preview, allNodes, allEdges) {
|
|
|
225
219
|
const extensions = {
|
|
226
220
|
...oldNode.data.extensions,
|
|
227
221
|
swap: {
|
|
228
|
-
previousNodeId: oldNodeId
|
|
229
|
-
}
|
|
222
|
+
previousNodeId: oldNodeId
|
|
223
|
+
}
|
|
230
224
|
};
|
|
231
225
|
const newNode = {
|
|
232
226
|
id: newNodeId,
|
|
233
|
-
type:
|
|
227
|
+
type: 'universalNode',
|
|
234
228
|
position: { ...oldNode.position },
|
|
235
229
|
deletable: oldNode.deletable,
|
|
236
230
|
data: {
|
|
237
231
|
label: newMetadata.name,
|
|
238
232
|
config: mappedConfig,
|
|
239
233
|
metadata: newMetadata,
|
|
240
|
-
extensions
|
|
241
|
-
}
|
|
234
|
+
extensions
|
|
235
|
+
}
|
|
242
236
|
};
|
|
243
237
|
// Build dropped edge IDs set for fast lookup
|
|
244
238
|
const droppedEdgeIds = new Set(preview.droppedEdges.map((d) => d.edge.id));
|
|
@@ -261,7 +255,7 @@ export function executeSwap(oldNode, newMetadata, preview, allNodes, allEdges) {
|
|
|
261
255
|
}
|
|
262
256
|
}
|
|
263
257
|
// Build updated nodes: replace old node with new node (preserving array order)
|
|
264
|
-
const updatedNodes = allNodes.map((node) => node.id === oldNodeId ? newNode : node);
|
|
258
|
+
const updatedNodes = allNodes.map((node) => (node.id === oldNodeId ? newNode : node));
|
|
265
259
|
return { updatedNodes, updatedEdges };
|
|
266
260
|
}
|
|
267
261
|
// =========================================================================
|
|
@@ -292,12 +286,12 @@ export function getVersionUpgrade(currentMetadata, allNodeTypes) {
|
|
|
292
286
|
*/
|
|
293
287
|
function classifyMatch(oldPort, matchedPort) {
|
|
294
288
|
if (!matchedPort)
|
|
295
|
-
return
|
|
289
|
+
return 'unmapped';
|
|
296
290
|
if (matchedPort.id === oldPort.id)
|
|
297
|
-
return
|
|
291
|
+
return 'id';
|
|
298
292
|
if (matchedPort.name.toLowerCase() === oldPort.name.toLowerCase())
|
|
299
|
-
return
|
|
300
|
-
return
|
|
293
|
+
return 'name';
|
|
294
|
+
return 'type';
|
|
301
295
|
}
|
|
302
296
|
/**
|
|
303
297
|
* Compute a swap preview with full options support (strategies, overrides).
|
|
@@ -323,7 +317,7 @@ export function computeSwapPreviewWithOptions(oldNode, newMetadata, edges, allNo
|
|
|
323
317
|
newMetadata,
|
|
324
318
|
edges,
|
|
325
319
|
allNodes,
|
|
326
|
-
checker
|
|
320
|
+
checker
|
|
327
321
|
};
|
|
328
322
|
for (const strategy of options.strategies) {
|
|
329
323
|
if (strategy.canHandle(ctx)) {
|
|
@@ -345,12 +339,12 @@ export function computeSwapPreviewWithOptions(oldNode, newMetadata, edges, allNo
|
|
|
345
339
|
const droppedEdges = [];
|
|
346
340
|
for (const edge of connectedEdges) {
|
|
347
341
|
const isSource = edge.source === oldNodeId;
|
|
348
|
-
const direction = isSource ?
|
|
342
|
+
const direction = isSource ? 'output' : 'input';
|
|
349
343
|
const handleId = isSource ? edge.sourceHandle : edge.targetHandle;
|
|
350
344
|
const usedPorts = isSource ? usedOutputPortIds : usedInputPortIds;
|
|
351
345
|
const oldPort = resolvePort(oldNode, handleId, direction);
|
|
352
346
|
if (!oldPort) {
|
|
353
|
-
droppedEdges.push({ edge, reason:
|
|
347
|
+
droppedEdges.push({ edge, reason: 'Port not found on original node' });
|
|
354
348
|
continue;
|
|
355
349
|
}
|
|
356
350
|
// Priority 1: Manual port override
|
|
@@ -358,10 +352,10 @@ export function computeSwapPreviewWithOptions(oldNode, newMetadata, edges, allNo
|
|
|
358
352
|
if (portOverrideLookup.has(overrideKey)) {
|
|
359
353
|
const overrideNewPortId = portOverrideLookup.get(overrideKey);
|
|
360
354
|
if (overrideNewPortId === null) {
|
|
361
|
-
droppedEdges.push({ edge, reason:
|
|
355
|
+
droppedEdges.push({ edge, reason: 'Manually dropped' });
|
|
362
356
|
continue;
|
|
363
357
|
}
|
|
364
|
-
const newPorts = direction ===
|
|
358
|
+
const newPorts = direction === 'input' ? newMetadata.inputs : newMetadata.outputs;
|
|
365
359
|
const overridePort = newPorts.find((p) => p.id === overrideNewPortId);
|
|
366
360
|
if (overridePort) {
|
|
367
361
|
usedPorts.add(overridePort.id);
|
|
@@ -383,10 +377,10 @@ export function computeSwapPreviewWithOptions(oldNode, newMetadata, edges, allNo
|
|
|
383
377
|
if (strategyPortMap && oldPort.id in strategyPortMap) {
|
|
384
378
|
const strategyNewPortId = strategyPortMap[oldPort.id];
|
|
385
379
|
if (strategyNewPortId === null) {
|
|
386
|
-
droppedEdges.push({ edge, reason:
|
|
380
|
+
droppedEdges.push({ edge, reason: 'Dropped by strategy' });
|
|
387
381
|
continue;
|
|
388
382
|
}
|
|
389
|
-
const newPorts = direction ===
|
|
383
|
+
const newPorts = direction === 'input' ? newMetadata.inputs : newMetadata.outputs;
|
|
390
384
|
const strategyPort = newPorts.find((p) => p.id === strategyNewPortId);
|
|
391
385
|
if (strategyPort && !usedPorts.has(strategyPort.id)) {
|
|
392
386
|
usedPorts.add(strategyPort.id);
|
|
@@ -405,12 +399,12 @@ export function computeSwapPreviewWithOptions(oldNode, newMetadata, edges, allNo
|
|
|
405
399
|
}
|
|
406
400
|
}
|
|
407
401
|
// Priority 3: Built-in 3-pass matching
|
|
408
|
-
const newPorts = direction ===
|
|
402
|
+
const newPorts = direction === 'input' ? newMetadata.inputs : newMetadata.outputs;
|
|
409
403
|
const match = findMatchingPort(oldPort, newPorts, usedPorts, checker);
|
|
410
404
|
if (!match) {
|
|
411
405
|
droppedEdges.push({
|
|
412
406
|
edge,
|
|
413
|
-
reason: `No compatible ${direction} port found on "${newMetadata.name}"
|
|
407
|
+
reason: `No compatible ${direction} port found on "${newMetadata.name}"`
|
|
414
408
|
});
|
|
415
409
|
continue;
|
|
416
410
|
}
|
|
@@ -432,14 +426,14 @@ export function computeSwapPreviewWithOptions(oldNode, newMetadata, edges, allNo
|
|
|
432
426
|
// Apply strategy config overrides
|
|
433
427
|
if (strategyConfigMap) {
|
|
434
428
|
for (const [key, mapping] of Object.entries(strategyConfigMap)) {
|
|
435
|
-
if (mapping.action ===
|
|
429
|
+
if (mapping.action === 'carry' && key in oldNode.data.config) {
|
|
436
430
|
if (!carriedOver.includes(key))
|
|
437
431
|
carriedOver.push(key);
|
|
438
432
|
const resetIdx = reset.indexOf(key);
|
|
439
433
|
if (resetIdx >= 0)
|
|
440
434
|
reset.splice(resetIdx, 1);
|
|
441
435
|
}
|
|
442
|
-
else if (mapping.action ===
|
|
436
|
+
else if (mapping.action === 'reset') {
|
|
443
437
|
if (!reset.includes(key))
|
|
444
438
|
reset.push(key);
|
|
445
439
|
const carryIdx = carriedOver.indexOf(key);
|
|
@@ -450,21 +444,21 @@ export function computeSwapPreviewWithOptions(oldNode, newMetadata, edges, allNo
|
|
|
450
444
|
}
|
|
451
445
|
// Apply manual config overrides (highest priority)
|
|
452
446
|
for (const override of options.configOverrides ?? []) {
|
|
453
|
-
if (override.action ===
|
|
447
|
+
if (override.action === 'carry' && override.key in oldNode.data.config) {
|
|
454
448
|
if (!carriedOver.includes(override.key))
|
|
455
449
|
carriedOver.push(override.key);
|
|
456
450
|
const resetIdx = reset.indexOf(override.key);
|
|
457
451
|
if (resetIdx >= 0)
|
|
458
452
|
reset.splice(resetIdx, 1);
|
|
459
453
|
}
|
|
460
|
-
else if (override.action ===
|
|
454
|
+
else if (override.action === 'reset') {
|
|
461
455
|
if (!reset.includes(override.key))
|
|
462
456
|
reset.push(override.key);
|
|
463
457
|
const carryIdx = carriedOver.indexOf(override.key);
|
|
464
458
|
if (carryIdx >= 0)
|
|
465
459
|
carriedOver.splice(carryIdx, 1);
|
|
466
460
|
}
|
|
467
|
-
else if (override.action ===
|
|
461
|
+
else if (override.action === 'set') {
|
|
468
462
|
if (!carriedOver.includes(override.key))
|
|
469
463
|
carriedOver.push(override.key);
|
|
470
464
|
const resetIdx = reset.indexOf(override.key);
|
|
@@ -478,7 +472,7 @@ export function computeSwapPreviewWithOptions(oldNode, newMetadata, edges, allNo
|
|
|
478
472
|
hasDataLoss: droppedEdges.length > 0,
|
|
479
473
|
newNodeId,
|
|
480
474
|
configCarriedOver: carriedOver,
|
|
481
|
-
configReset: reset
|
|
475
|
+
configReset: reset
|
|
482
476
|
};
|
|
483
477
|
}
|
|
484
478
|
/**
|
|
@@ -507,15 +501,15 @@ export function computeInteractiveState(oldNode, newMetadata, edges, allNodes, o
|
|
|
507
501
|
const portMappings = [];
|
|
508
502
|
for (const edge of connectedEdges) {
|
|
509
503
|
const isSource = edge.source === oldNodeId;
|
|
510
|
-
const direction = isSource ?
|
|
504
|
+
const direction = isSource ? 'output' : 'input';
|
|
511
505
|
const handleId = isSource ? edge.sourceHandle : edge.targetHandle;
|
|
512
506
|
const oldPort = resolvePort(oldNode, handleId, direction);
|
|
513
507
|
if (!oldPort)
|
|
514
508
|
continue;
|
|
515
509
|
const matchedPortId = keptEdgePortMap.get(edge.id) ?? null;
|
|
516
|
-
const newPorts = direction ===
|
|
510
|
+
const newPorts = direction === 'input' ? newMetadata.inputs : newMetadata.outputs;
|
|
517
511
|
const matchedPort = matchedPortId
|
|
518
|
-
? newPorts.find((p) => p.id === matchedPortId) ?? null
|
|
512
|
+
? (newPorts.find((p) => p.id === matchedPortId) ?? null)
|
|
519
513
|
: null;
|
|
520
514
|
const matchQuality = classifyMatch(oldPort, matchedPort);
|
|
521
515
|
portMappings.push({
|
|
@@ -525,7 +519,7 @@ export function computeInteractiveState(oldNode, newMetadata, edges, allNodes, o
|
|
|
525
519
|
selectedNewPortId: matchedPortId,
|
|
526
520
|
matchQuality,
|
|
527
521
|
autoSuggestedPortId: matchedPortId,
|
|
528
|
-
isOverridden: false
|
|
522
|
+
isOverridden: false
|
|
529
523
|
});
|
|
530
524
|
}
|
|
531
525
|
// Build config mappings
|
|
@@ -548,7 +542,7 @@ export function computeInteractiveState(oldNode, newMetadata, edges, allNodes, o
|
|
|
548
542
|
newDefault,
|
|
549
543
|
carryOver: hasOldValue && isFlat,
|
|
550
544
|
autoCarryOver: hasOldValue && isFlat,
|
|
551
|
-
isFlat
|
|
545
|
+
isFlat
|
|
552
546
|
});
|
|
553
547
|
}
|
|
554
548
|
}
|
|
@@ -559,7 +553,7 @@ export function computeInteractiveState(oldNode, newMetadata, edges, allNodes, o
|
|
|
559
553
|
portMappings,
|
|
560
554
|
configMappings,
|
|
561
555
|
availableNewInputs: [...newMetadata.inputs],
|
|
562
|
-
availableNewOutputs: [...newMetadata.outputs]
|
|
556
|
+
availableNewOutputs: [...newMetadata.outputs]
|
|
563
557
|
};
|
|
564
558
|
}
|
|
565
559
|
/** Check if a value is a primitive (string, number, boolean, null, undefined). */
|
|
@@ -567,7 +561,7 @@ function isPrimitive(value) {
|
|
|
567
561
|
if (value === null || value === undefined)
|
|
568
562
|
return true;
|
|
569
563
|
const t = typeof value;
|
|
570
|
-
return t ===
|
|
564
|
+
return t === 'string' || t === 'number' || t === 'boolean';
|
|
571
565
|
}
|
|
572
566
|
/**
|
|
573
567
|
* Convert user-edited InteractiveSwapState back into a SwapPreview
|
|
@@ -580,9 +574,9 @@ export function buildSwapPreviewFromState(state, allEdges) {
|
|
|
580
574
|
if (!mapping.selectedNewPortId) {
|
|
581
575
|
droppedEdges.push({
|
|
582
576
|
edge: mapping.edge,
|
|
583
|
-
reason: mapping.matchQuality ===
|
|
577
|
+
reason: mapping.matchQuality === 'unmapped'
|
|
584
578
|
? `No compatible ${mapping.direction} port found on "${state.newMetadata.name}"`
|
|
585
|
-
:
|
|
579
|
+
: 'Manually dropped'
|
|
586
580
|
});
|
|
587
581
|
continue;
|
|
588
582
|
}
|
|
@@ -616,7 +610,7 @@ export function buildSwapPreviewFromState(state, allEdges) {
|
|
|
616
610
|
hasDataLoss: droppedEdges.length > 0,
|
|
617
611
|
newNodeId: state.newNodeId,
|
|
618
612
|
configCarriedOver,
|
|
619
|
-
configReset
|
|
613
|
+
configReset
|
|
620
614
|
};
|
|
621
615
|
}
|
|
622
616
|
/**
|
|
@@ -672,13 +666,13 @@ export function validateSwapResult(result) {
|
|
|
672
666
|
if (!nodeIds.has(edge.source)) {
|
|
673
667
|
return {
|
|
674
668
|
valid: false,
|
|
675
|
-
error: `Dangling edge "${edge.id}": source node "${edge.source}" not found
|
|
669
|
+
error: `Dangling edge "${edge.id}": source node "${edge.source}" not found`
|
|
676
670
|
};
|
|
677
671
|
}
|
|
678
672
|
if (!nodeIds.has(edge.target)) {
|
|
679
673
|
return {
|
|
680
674
|
valid: false,
|
|
681
|
-
error: `Dangling edge "${edge.id}": target node "${edge.target}" not found
|
|
675
|
+
error: `Dangling edge "${edge.id}": target node "${edge.target}" not found`
|
|
682
676
|
};
|
|
683
677
|
}
|
|
684
678
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Works with both built-in types and custom registered types.
|
|
11
11
|
*/
|
|
12
|
-
import type { NodeType, NodeMetadata } from
|
|
12
|
+
import type { NodeType, NodeMetadata } from '../types/index.js';
|
|
13
13
|
/**
|
|
14
14
|
* Gets the SvelteFlow component name for a given NodeType.
|
|
15
15
|
* Uses the node component registry to resolve types.
|
package/dist/utils/nodeTypes.js
CHANGED
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Works with both built-in types and custom registered types.
|
|
11
11
|
*/
|
|
12
|
-
import { nodeComponentRegistry } from
|
|
13
|
-
import { resolveBuiltinAlias, isBuiltinType
|
|
12
|
+
import { nodeComponentRegistry } from '../registry/nodeComponentRegistry.js';
|
|
13
|
+
import { resolveBuiltinAlias, isBuiltinType } from '../registry/builtinNodes.js';
|
|
14
14
|
/**
|
|
15
15
|
* Display names for built-in node types.
|
|
16
16
|
*/
|
|
17
17
|
const TYPE_DISPLAY_NAMES = {
|
|
18
|
-
note:
|
|
19
|
-
simple:
|
|
20
|
-
square:
|
|
21
|
-
tool:
|
|
22
|
-
gateway:
|
|
23
|
-
terminal:
|
|
24
|
-
default:
|
|
18
|
+
note: 'Note (sticky note style)',
|
|
19
|
+
simple: 'Simple (compact layout)',
|
|
20
|
+
square: 'Square (geometric layout)',
|
|
21
|
+
tool: 'Tool (specialized for agent tools)',
|
|
22
|
+
gateway: 'Gateway (branching control flow)',
|
|
23
|
+
terminal: 'Terminal (start/end/exit)',
|
|
24
|
+
default: 'Default (standard workflow node)'
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* Gets the SvelteFlow component name for a given NodeType.
|
|
@@ -38,7 +38,7 @@ export function getComponentNameForNodeType(nodeType) {
|
|
|
38
38
|
return resolvedType;
|
|
39
39
|
}
|
|
40
40
|
// Unknown type - return workflowNode as default
|
|
41
|
-
return
|
|
41
|
+
return 'workflowNode';
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Gets the available node types for a given NodeMetadata.
|
|
@@ -54,7 +54,7 @@ export function getAvailableNodeTypes(metadata) {
|
|
|
54
54
|
if (metadata.type) {
|
|
55
55
|
return [metadata.type];
|
|
56
56
|
}
|
|
57
|
-
return [
|
|
57
|
+
return ['default'];
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Gets the primary (default) node type for a given NodeMetadata.
|
|
@@ -92,8 +92,7 @@ export function resolveNodeType(metadata, configNodeType) {
|
|
|
92
92
|
return configNodeType;
|
|
93
93
|
}
|
|
94
94
|
// Check if it's a registered custom type
|
|
95
|
-
if (nodeComponentRegistry.has(configNodeType) ||
|
|
96
|
-
nodeComponentRegistry.has(resolvedConfig)) {
|
|
95
|
+
if (nodeComponentRegistry.has(configNodeType) || nodeComponentRegistry.has(resolvedConfig)) {
|
|
97
96
|
return configNodeType;
|
|
98
97
|
}
|
|
99
98
|
}
|
|
@@ -172,7 +171,7 @@ export function getNodeTypeOneOfOptions(metadata, includeCustomTypes = false) {
|
|
|
172
171
|
// Optionally include all registered custom types
|
|
173
172
|
if (includeCustomTypes) {
|
|
174
173
|
const registrations = nodeComponentRegistry.filter({
|
|
175
|
-
predicate: (reg) => !isBuiltinType(reg.type) && !includedTypes.has(reg.type)
|
|
174
|
+
predicate: (reg) => !isBuiltinType(reg.type) && !includedTypes.has(reg.type)
|
|
176
175
|
});
|
|
177
176
|
for (const reg of registrations) {
|
|
178
177
|
options.push({ const: reg.type, title: reg.displayName });
|
|
@@ -195,11 +194,11 @@ export function createNodeTypeConfigProperty(metadata, defaultType) {
|
|
|
195
194
|
const oneOf = getNodeTypeOneOfOptions(metadata);
|
|
196
195
|
const primaryType = defaultType ?? getPrimaryNodeType(metadata);
|
|
197
196
|
return {
|
|
198
|
-
type:
|
|
199
|
-
title:
|
|
200
|
-
description:
|
|
197
|
+
type: 'string',
|
|
198
|
+
title: 'Node Type',
|
|
199
|
+
description: 'Choose the visual representation for this node',
|
|
201
200
|
default: primaryType,
|
|
202
|
-
oneOf
|
|
201
|
+
oneOf
|
|
203
202
|
};
|
|
204
203
|
}
|
|
205
204
|
/**
|
|
@@ -227,12 +226,12 @@ export function getAllNodeTypes() {
|
|
|
227
226
|
*/
|
|
228
227
|
function formatTypeName(type) {
|
|
229
228
|
// Handle namespaced types (e.g., "mylib:fancy" -> "Mylib: Fancy")
|
|
230
|
-
if (type.includes(
|
|
231
|
-
const [namespace, name] = type.split(
|
|
229
|
+
if (type.includes(':')) {
|
|
230
|
+
const [namespace, name] = type.split(':');
|
|
232
231
|
return `${capitalize(namespace)}: ${capitalize(name)}`;
|
|
233
232
|
}
|
|
234
233
|
// Capitalize and add spaces for camelCase
|
|
235
|
-
return capitalize(type.replace(/([A-Z])/g,
|
|
234
|
+
return capitalize(type.replace(/([A-Z])/g, ' $1').trim());
|
|
236
235
|
}
|
|
237
236
|
/**
|
|
238
237
|
* Capitalize the first letter of a string.
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Node Wrapper Utilities
|
|
3
3
|
* Provides utilities for wrapping nodes with status overlays
|
|
4
4
|
*/
|
|
5
|
-
import type { NodeExecutionInfo } from
|
|
5
|
+
import type { NodeExecutionInfo } from '../types/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* Configuration for node status overlay
|
|
8
8
|
*/
|
|
9
9
|
export interface NodeStatusConfig {
|
|
10
|
-
position?:
|
|
11
|
-
size?:
|
|
10
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
12
|
showDetails?: boolean;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
@@ -21,8 +21,8 @@ export declare const DEFAULT_NODE_STATUS_CONFIG: NodeStatusConfig;
|
|
|
21
21
|
export declare function createNodeWrapperConfig(nodeId: string, executionInfo?: NodeExecutionInfo, config?: NodeStatusConfig): {
|
|
22
22
|
nodeId: string;
|
|
23
23
|
executionInfo?: NodeExecutionInfo;
|
|
24
|
-
statusPosition: NodeStatusConfig[
|
|
25
|
-
statusSize: NodeStatusConfig[
|
|
24
|
+
statusPosition: NodeStatusConfig['position'];
|
|
25
|
+
statusSize: NodeStatusConfig['size'];
|
|
26
26
|
showStatusDetails: boolean;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -32,8 +32,8 @@ export declare function shouldShowNodeStatus(executionInfo?: NodeExecutionInfo):
|
|
|
32
32
|
/**
|
|
33
33
|
* Get optimal status position based on node type
|
|
34
34
|
*/
|
|
35
|
-
export declare function getOptimalStatusPosition(nodeType: string): NodeStatusConfig[
|
|
35
|
+
export declare function getOptimalStatusPosition(nodeType: string): NodeStatusConfig['position'];
|
|
36
36
|
/**
|
|
37
37
|
* Get optimal status size based on node type
|
|
38
38
|
*/
|
|
39
|
-
export declare function getOptimalStatusSize(nodeType: string): NodeStatusConfig[
|
|
39
|
+
export declare function getOptimalStatusSize(nodeType: string): NodeStatusConfig['size'];
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* Default configuration for node status overlays
|
|
7
7
|
*/
|
|
8
8
|
export const DEFAULT_NODE_STATUS_CONFIG = {
|
|
9
|
-
position:
|
|
10
|
-
size:
|
|
11
|
-
showDetails: true
|
|
9
|
+
position: 'top-right',
|
|
10
|
+
size: 'md',
|
|
11
|
+
showDetails: true
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Create a node wrapper configuration
|
|
@@ -19,7 +19,7 @@ export function createNodeWrapperConfig(nodeId, executionInfo, config = {}) {
|
|
|
19
19
|
executionInfo,
|
|
20
20
|
statusPosition: config.position || DEFAULT_NODE_STATUS_CONFIG.position,
|
|
21
21
|
statusSize: config.size || DEFAULT_NODE_STATUS_CONFIG.size,
|
|
22
|
-
showStatusDetails: config.showDetails ?? DEFAULT_NODE_STATUS_CONFIG.showDetails ?? true
|
|
22
|
+
showStatusDetails: config.showDetails ?? DEFAULT_NODE_STATUS_CONFIG.showDetails ?? true
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -28,23 +28,21 @@ export function createNodeWrapperConfig(nodeId, executionInfo, config = {}) {
|
|
|
28
28
|
export function shouldShowNodeStatus(executionInfo) {
|
|
29
29
|
if (!executionInfo)
|
|
30
30
|
return false;
|
|
31
|
-
return (executionInfo.status !==
|
|
32
|
-
executionInfo.executionCount > 0 ||
|
|
33
|
-
executionInfo.isExecuting);
|
|
31
|
+
return (executionInfo.status !== 'idle' || executionInfo.executionCount > 0 || executionInfo.isExecuting);
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* Get optimal status position based on node type
|
|
37
35
|
*/
|
|
38
36
|
export function getOptimalStatusPosition(nodeType) {
|
|
39
37
|
switch (nodeType) {
|
|
40
|
-
case
|
|
41
|
-
return
|
|
42
|
-
case
|
|
43
|
-
return
|
|
44
|
-
case
|
|
45
|
-
case
|
|
38
|
+
case 'tool':
|
|
39
|
+
return 'top-left';
|
|
40
|
+
case 'note':
|
|
41
|
+
return 'bottom-right';
|
|
42
|
+
case 'simple':
|
|
43
|
+
case 'square':
|
|
46
44
|
default:
|
|
47
|
-
return
|
|
45
|
+
return 'top-right';
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
/**
|
|
@@ -52,13 +50,13 @@ export function getOptimalStatusPosition(nodeType) {
|
|
|
52
50
|
*/
|
|
53
51
|
export function getOptimalStatusSize(nodeType) {
|
|
54
52
|
switch (nodeType) {
|
|
55
|
-
case
|
|
56
|
-
return
|
|
57
|
-
case
|
|
58
|
-
return
|
|
59
|
-
case
|
|
60
|
-
case
|
|
53
|
+
case 'tool':
|
|
54
|
+
return 'sm';
|
|
55
|
+
case 'note':
|
|
56
|
+
return 'sm';
|
|
57
|
+
case 'simple':
|
|
58
|
+
case 'square':
|
|
61
59
|
default:
|
|
62
|
-
return
|
|
60
|
+
return 'md';
|
|
63
61
|
}
|
|
64
62
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Performance Utilities
|
|
3
3
|
* Helper functions for optimizing performance in the FlowDrop app
|
|
4
4
|
*/
|
|
5
|
-
import type { WorkflowNode, WorkflowEdge } from
|
|
5
|
+
import type { WorkflowNode, WorkflowEdge } from '../types/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* Fast shallow comparison for workflow nodes
|
|
8
8
|
* Avoids expensive JSON.stringify operations
|
|
@@ -16,8 +16,7 @@ export function areNodeArraysEqual(nodes1, nodes2) {
|
|
|
16
16
|
if (node1?.id !== node2?.id)
|
|
17
17
|
return false;
|
|
18
18
|
// Check position (most common change during drag)
|
|
19
|
-
if (node1?.position?.x !== node2?.position?.x ||
|
|
20
|
-
node1?.position?.y !== node2?.position?.y) {
|
|
19
|
+
if (node1?.position?.x !== node2?.position?.x || node1?.position?.y !== node2?.position?.y) {
|
|
21
20
|
return false;
|
|
22
21
|
}
|
|
23
22
|
// Check selected state
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodePort } from
|
|
1
|
+
import type { NodePort } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Sort ports by an ordered array of port IDs.
|
|
4
4
|
* Ports not listed appear at the end in their original order.
|
|
@@ -18,7 +18,7 @@ export declare function getPortTop(index: number, count: number): number;
|
|
|
18
18
|
* 2. `hideUnconnectedHandles` — hide if not present in the connected handles set
|
|
19
19
|
* 3. Default — visible
|
|
20
20
|
*/
|
|
21
|
-
export declare function isPortVisible(port: NodePort, direction:
|
|
21
|
+
export declare function isPortVisible(port: NodePort, direction: 'input' | 'output', hiddenPorts: {
|
|
22
22
|
inputs?: string[];
|
|
23
23
|
outputs?: string[];
|
|
24
24
|
}, hideUnconnectedHandles: boolean, connectedHandles: Set<string>, nodeId: string | undefined): boolean;
|
package/dist/utils/portUtils.js
CHANGED
|
@@ -32,7 +32,7 @@ export function getPortTop(index, count) {
|
|
|
32
32
|
* 3. Default — visible
|
|
33
33
|
*/
|
|
34
34
|
export function isPortVisible(port, direction, hiddenPorts, hideUnconnectedHandles, connectedHandles, nodeId) {
|
|
35
|
-
const hiddenList = direction ===
|
|
35
|
+
const hiddenList = direction === 'input' ? hiddenPorts.inputs : hiddenPorts.outputs;
|
|
36
36
|
if (hiddenList?.includes(port.id))
|
|
37
37
|
return false;
|
|
38
38
|
if (hideUnconnectedHandles) {
|
package/dist/utils/sanitize.js
CHANGED
package/dist/utils/uischema.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Functions for resolving JSON Pointer scope strings to property keys,
|
|
5
5
|
* and for generating default UISchema from a ConfigSchema.
|
|
6
6
|
*/
|
|
7
|
-
import type { ConfigSchema } from
|
|
8
|
-
import type { UISchemaElement, UISchemaVerticalLayout } from
|
|
7
|
+
import type { ConfigSchema } from '../types/index.js';
|
|
8
|
+
import type { UISchemaElement, UISchemaVerticalLayout } from '../types/uischema.js';
|
|
9
9
|
/**
|
|
10
10
|
* Resolve a JSON Pointer scope string to a property key.
|
|
11
11
|
*
|