@flowdrop/flowdrop 1.5.0 → 1.6.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 +240 -294
- package/dist/components/App.svelte.d.ts +9 -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 +42 -56
- 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 +44 -74
- 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/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 +3 -3
- package/dist/stores/workflowStore.svelte.js +46 -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 +32 -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 +2 -2
- package/dist/utils/connections.js +15 -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/nodeIds.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Used by both the visual editor and the workflow adapter to ensure
|
|
4
4
|
* consistent behavior across all code paths.
|
|
5
5
|
*/
|
|
6
|
-
import type { ConfigSchema } from
|
|
6
|
+
import type { ConfigSchema } from '../types/index.js';
|
|
7
7
|
/**
|
|
8
8
|
* Minimal node shape required for ID generation.
|
|
9
9
|
* Both WorkflowNode and StandardNode satisfy this interface.
|
package/dist/utils/nodeIds.js
CHANGED
|
@@ -34,7 +34,7 @@ export function extractConfigDefaults(configSchema) {
|
|
|
34
34
|
if (!configSchema?.properties)
|
|
35
35
|
return config;
|
|
36
36
|
for (const [key, prop] of Object.entries(configSchema.properties)) {
|
|
37
|
-
if (prop && typeof prop ===
|
|
37
|
+
if (prop && typeof prop === 'object' && 'default' in prop) {
|
|
38
38
|
config[key] = prop.default;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Node Status Utility Functions
|
|
3
3
|
* Provides utilities for managing and displaying node execution status
|
|
4
4
|
*/
|
|
5
|
-
import type { NodeExecutionStatus, NodeExecutionInfo } from
|
|
5
|
+
import type { NodeExecutionStatus, NodeExecutionInfo } from '../types/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* Get the display color for a node execution status
|
|
8
8
|
*/
|
package/dist/utils/nodeStatus.js
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export function getStatusColor(status) {
|
|
9
9
|
const statusColors = {
|
|
10
|
-
idle:
|
|
11
|
-
pending:
|
|
12
|
-
running:
|
|
13
|
-
completed:
|
|
14
|
-
failed:
|
|
15
|
-
cancelled:
|
|
16
|
-
skipped:
|
|
10
|
+
idle: '#6b7280', // gray
|
|
11
|
+
pending: '#f59e0b', // amber
|
|
12
|
+
running: '#3b82f6', // blue
|
|
13
|
+
completed: '#10b981', // emerald
|
|
14
|
+
failed: '#ef4444', // red
|
|
15
|
+
cancelled: '#6b7280', // gray
|
|
16
|
+
skipped: '#8b5cf6' // violet
|
|
17
17
|
};
|
|
18
18
|
return statusColors[status] || statusColors.idle;
|
|
19
19
|
}
|
|
@@ -22,13 +22,13 @@ export function getStatusColor(status) {
|
|
|
22
22
|
*/
|
|
23
23
|
export function getStatusIcon(status) {
|
|
24
24
|
const statusIcons = {
|
|
25
|
-
idle:
|
|
26
|
-
pending:
|
|
27
|
-
running:
|
|
28
|
-
completed:
|
|
29
|
-
failed:
|
|
30
|
-
cancelled:
|
|
31
|
-
skipped:
|
|
25
|
+
idle: 'mdi:circle-outline',
|
|
26
|
+
pending: 'mdi:clock-outline',
|
|
27
|
+
running: 'mdi:loading',
|
|
28
|
+
completed: 'mdi:check-circle',
|
|
29
|
+
failed: 'mdi:alert-circle',
|
|
30
|
+
cancelled: 'mdi:cancel',
|
|
31
|
+
skipped: 'mdi:skip-next'
|
|
32
32
|
};
|
|
33
33
|
return statusIcons[status] || statusIcons.idle;
|
|
34
34
|
}
|
|
@@ -37,13 +37,13 @@ export function getStatusIcon(status) {
|
|
|
37
37
|
*/
|
|
38
38
|
export function getStatusLabel(status) {
|
|
39
39
|
const statusLabels = {
|
|
40
|
-
idle:
|
|
41
|
-
pending:
|
|
42
|
-
running:
|
|
43
|
-
completed:
|
|
44
|
-
failed:
|
|
45
|
-
cancelled:
|
|
46
|
-
skipped:
|
|
40
|
+
idle: 'Idle',
|
|
41
|
+
pending: 'Pending',
|
|
42
|
+
running: 'Running',
|
|
43
|
+
completed: 'Completed',
|
|
44
|
+
failed: 'Failed',
|
|
45
|
+
cancelled: 'Cancelled',
|
|
46
|
+
skipped: 'Skipped'
|
|
47
47
|
};
|
|
48
48
|
return statusLabels[status] || statusLabels.idle;
|
|
49
49
|
}
|
|
@@ -52,13 +52,13 @@ export function getStatusLabel(status) {
|
|
|
52
52
|
*/
|
|
53
53
|
export function getStatusBackgroundColor(status) {
|
|
54
54
|
const statusBackgroundColors = {
|
|
55
|
-
idle:
|
|
56
|
-
pending:
|
|
57
|
-
running:
|
|
58
|
-
completed:
|
|
59
|
-
failed:
|
|
60
|
-
cancelled:
|
|
61
|
-
skipped:
|
|
55
|
+
idle: '#f9fafb', // light gray
|
|
56
|
+
pending: '#fef3c7', // light amber
|
|
57
|
+
running: '#dbeafe', // light blue
|
|
58
|
+
completed: '#d1fae5', // light emerald
|
|
59
|
+
failed: '#fee2e2', // light red
|
|
60
|
+
cancelled: '#f3f4f6', // light gray
|
|
61
|
+
skipped: '#ede9fe' // light violet
|
|
62
62
|
};
|
|
63
63
|
return statusBackgroundColors[status] || statusBackgroundColors.idle;
|
|
64
64
|
}
|
|
@@ -67,13 +67,13 @@ export function getStatusBackgroundColor(status) {
|
|
|
67
67
|
*/
|
|
68
68
|
export function getStatusTextColor(status) {
|
|
69
69
|
const statusTextColors = {
|
|
70
|
-
idle:
|
|
71
|
-
pending:
|
|
72
|
-
running:
|
|
73
|
-
completed:
|
|
74
|
-
failed:
|
|
75
|
-
cancelled:
|
|
76
|
-
skipped:
|
|
70
|
+
idle: '#6b7280', // gray
|
|
71
|
+
pending: '#d97706', // amber
|
|
72
|
+
running: '#1d4ed8', // blue
|
|
73
|
+
completed: '#059669', // emerald
|
|
74
|
+
failed: '#dc2626', // red
|
|
75
|
+
cancelled: '#6b7280', // gray
|
|
76
|
+
skipped: '#7c3aed' // violet
|
|
77
77
|
};
|
|
78
78
|
return statusTextColors[status] || statusTextColors.idle;
|
|
79
79
|
}
|
|
@@ -82,9 +82,9 @@ export function getStatusTextColor(status) {
|
|
|
82
82
|
*/
|
|
83
83
|
export function createDefaultExecutionInfo() {
|
|
84
84
|
return {
|
|
85
|
-
status:
|
|
85
|
+
status: 'idle',
|
|
86
86
|
executionCount: 0,
|
|
87
|
-
isExecuting: false
|
|
87
|
+
isExecuting: false
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
@@ -93,8 +93,8 @@ export function createDefaultExecutionInfo() {
|
|
|
93
93
|
export function updateExecutionStart(executionInfo) {
|
|
94
94
|
return {
|
|
95
95
|
...executionInfo,
|
|
96
|
-
status:
|
|
97
|
-
isExecuting: true
|
|
96
|
+
status: 'running',
|
|
97
|
+
isExecuting: true
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
@@ -103,12 +103,12 @@ export function updateExecutionStart(executionInfo) {
|
|
|
103
103
|
export function updateExecutionComplete(executionInfo, duration) {
|
|
104
104
|
return {
|
|
105
105
|
...executionInfo,
|
|
106
|
-
status:
|
|
106
|
+
status: 'completed',
|
|
107
107
|
executionCount: executionInfo.executionCount + 1,
|
|
108
108
|
lastExecuted: new Date().toISOString(),
|
|
109
109
|
lastExecutionDuration: duration,
|
|
110
110
|
isExecuting: false,
|
|
111
|
-
lastError: undefined
|
|
111
|
+
lastError: undefined // Clear any previous error
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
@@ -117,12 +117,12 @@ export function updateExecutionComplete(executionInfo, duration) {
|
|
|
117
117
|
export function updateExecutionFailed(executionInfo, error, duration) {
|
|
118
118
|
return {
|
|
119
119
|
...executionInfo,
|
|
120
|
-
status:
|
|
120
|
+
status: 'failed',
|
|
121
121
|
executionCount: executionInfo.executionCount + 1,
|
|
122
122
|
lastExecuted: new Date().toISOString(),
|
|
123
123
|
lastExecutionDuration: duration,
|
|
124
124
|
isExecuting: false,
|
|
125
|
-
lastError: error
|
|
125
|
+
lastError: error
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
@@ -131,9 +131,9 @@ export function updateExecutionFailed(executionInfo, error, duration) {
|
|
|
131
131
|
export function resetExecutionInfo(executionInfo) {
|
|
132
132
|
return {
|
|
133
133
|
...executionInfo,
|
|
134
|
-
status:
|
|
134
|
+
status: 'idle',
|
|
135
135
|
isExecuting: false,
|
|
136
|
-
lastError: undefined
|
|
136
|
+
lastError: undefined
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
@@ -141,7 +141,7 @@ export function resetExecutionInfo(executionInfo) {
|
|
|
141
141
|
*/
|
|
142
142
|
export function formatExecutionDuration(duration) {
|
|
143
143
|
if (!duration)
|
|
144
|
-
return
|
|
144
|
+
return 'N/A';
|
|
145
145
|
if (duration < 1000) {
|
|
146
146
|
return `${Math.round(duration)}ms`;
|
|
147
147
|
}
|
|
@@ -159,13 +159,13 @@ export function formatExecutionDuration(duration) {
|
|
|
159
159
|
*/
|
|
160
160
|
export function formatLastExecuted(timestamp) {
|
|
161
161
|
if (!timestamp)
|
|
162
|
-
return
|
|
162
|
+
return 'Never';
|
|
163
163
|
const date = new Date(timestamp);
|
|
164
164
|
const now = new Date();
|
|
165
165
|
const diffMs = now.getTime() - date.getTime();
|
|
166
166
|
if (diffMs < 60000) {
|
|
167
167
|
// Less than 1 minute
|
|
168
|
-
return
|
|
168
|
+
return 'Just now';
|
|
169
169
|
}
|
|
170
170
|
else if (diffMs < 3600000) {
|
|
171
171
|
// Less than 1 hour
|
package/dist/utils/nodeSwap.d.ts
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module utils/nodeSwap
|
|
8
8
|
*/
|
|
9
|
-
import type { WorkflowNode, WorkflowEdge, NodeMetadata, NodePort, ConfigSchema, ConfigValues } from
|
|
10
|
-
import type { WorkflowValidationResult } from
|
|
11
|
-
import type { PortCompatibilityChecker } from
|
|
9
|
+
import type { WorkflowNode, WorkflowEdge, NodeMetadata, NodePort, ConfigSchema, ConfigValues } from '../types/index.js';
|
|
10
|
+
import type { WorkflowValidationResult } from './validation.js';
|
|
11
|
+
import type { PortCompatibilityChecker } from './connections.js';
|
|
12
12
|
/**
|
|
13
13
|
* Describes how a single port was remapped during a swap.
|
|
14
14
|
*/
|
|
@@ -17,7 +17,7 @@ export interface PortMapping {
|
|
|
17
17
|
newHandleId: string;
|
|
18
18
|
oldPortId: string;
|
|
19
19
|
newPortId: string;
|
|
20
|
-
direction:
|
|
20
|
+
direction: 'input' | 'output';
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* An edge that could not be remapped and will be dropped.
|
|
@@ -54,17 +54,17 @@ export interface SwapResult {
|
|
|
54
54
|
updatedEdges: WorkflowEdge[];
|
|
55
55
|
}
|
|
56
56
|
/** Quality annotation for how a port was matched. */
|
|
57
|
-
export type MatchQuality =
|
|
57
|
+
export type MatchQuality = 'id' | 'name' | 'type' | 'manual' | 'unmapped';
|
|
58
58
|
/** Manual override for a single port mapping. */
|
|
59
59
|
export interface PortMappingOverride {
|
|
60
60
|
oldPortId: string;
|
|
61
61
|
newPortId: string | null;
|
|
62
|
-
direction:
|
|
62
|
+
direction: 'input' | 'output';
|
|
63
63
|
}
|
|
64
64
|
/** Manual override for a single config mapping. */
|
|
65
65
|
export interface ConfigMappingOverride {
|
|
66
66
|
key: string;
|
|
67
|
-
action:
|
|
67
|
+
action: 'carry' | 'reset' | 'set';
|
|
68
68
|
value?: unknown;
|
|
69
69
|
}
|
|
70
70
|
/** Options bag for advanced swap functions. */
|
|
@@ -81,7 +81,7 @@ export interface SwapStrategy {
|
|
|
81
81
|
canHandle(ctx: SwapStrategyContext): boolean;
|
|
82
82
|
mapPorts?(ctx: SwapStrategyContext): Record<string, string | null> | undefined;
|
|
83
83
|
mapConfig?(ctx: SwapStrategyContext): Record<string, {
|
|
84
|
-
action:
|
|
84
|
+
action: 'carry' | 'reset' | 'set';
|
|
85
85
|
value?: unknown;
|
|
86
86
|
}> | undefined;
|
|
87
87
|
}
|
|
@@ -109,7 +109,7 @@ export declare class SwapValidationError extends Error {
|
|
|
109
109
|
export interface EditablePortMapping {
|
|
110
110
|
oldPort: NodePort;
|
|
111
111
|
edge: WorkflowEdge;
|
|
112
|
-
direction:
|
|
112
|
+
direction: 'input' | 'output';
|
|
113
113
|
selectedNewPortId: string | null;
|
|
114
114
|
matchQuality: MatchQuality;
|
|
115
115
|
autoSuggestedPortId: string | null;
|
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.
|