@flowdrop/flowdrop 1.4.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 +94 -51
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +27 -47
- 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 +52 -6
- package/dist/adapters/agentspec/autoLayout.js +118 -23
- 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.d.ts +19 -0
- package/dist/chat/commandClassifier.js +30 -0
- package/dist/chat/index.d.ts +27 -0
- package/dist/chat/index.js +32 -0
- package/dist/chat/responseParser.d.ts +21 -0
- package/dist/chat/responseParser.js +91 -0
- package/dist/commands/batch.d.ts +18 -0
- package/dist/commands/batch.js +54 -0
- package/dist/commands/executor.d.ts +37 -0
- package/dist/commands/executor.js +1133 -0
- package/dist/commands/index.d.ts +14 -0
- package/dist/commands/index.js +17 -0
- package/dist/commands/parser.d.ts +16 -0
- package/dist/commands/parser.js +295 -0
- package/dist/commands/positioner.d.ts +19 -0
- package/dist/commands/positioner.js +33 -0
- package/dist/commands/storeIntegration.svelte.d.ts +16 -0
- package/dist/commands/storeIntegration.svelte.js +67 -0
- package/dist/commands/types.d.ts +343 -0
- package/dist/commands/types.js +45 -0
- package/dist/components/App.svelte +522 -237
- package/dist/components/App.svelte.d.ts +11 -8
- 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 +37 -0
- package/dist/components/CanvasController.svelte.d.ts +32 -0
- package/dist/components/ConfigForm.svelte +118 -256
- package/dist/components/ConfigForm.svelte.d.ts +2 -2
- package/dist/components/ConfigMappingRow.svelte +128 -0
- package/dist/components/ConfigMappingRow.svelte.d.ts +8 -0
- 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 +57 -19
- package/dist/components/ConfigPanel.svelte.d.ts +3 -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 +11 -19
- 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 +46 -53
- 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 +55 -135
- 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 +493 -0
- package/dist/components/NodeSwapPicker.svelte.d.ts +16 -0
- 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 +205 -0
- package/dist/components/PortMappingRow.svelte.d.ts +12 -0
- 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 +529 -0
- package/dist/components/SwapMappingEditor.svelte.d.ts +12 -0
- 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 +210 -170
- package/dist/components/WorkflowEditor.svelte.d.ts +12 -4
- package/dist/components/chat/AIChatPanel.svelte +797 -0
- package/dist/components/chat/AIChatPanel.svelte.d.ts +13 -0
- package/dist/components/chat/CommandPreview.svelte +234 -0
- package/dist/components/chat/CommandPreview.svelte.d.ts +9 -0
- package/dist/components/console/CommandConsole.stories.svelte +111 -0
- package/dist/components/console/CommandConsole.stories.svelte.d.ts +27 -0
- package/dist/components/console/CommandConsole.svelte +263 -0
- package/dist/components/console/CommandConsole.svelte.d.ts +11 -0
- package/dist/components/console/ConsoleAutocomplete.svelte +142 -0
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +21 -0
- package/dist/components/console/ConsoleInput.svelte +771 -0
- package/dist/components/console/ConsoleInput.svelte.d.ts +16 -0
- package/dist/components/console/ConsoleOutput.svelte +116 -0
- package/dist/components/console/ConsoleOutput.svelte.d.ts +11 -0
- package/dist/components/console/formatters.d.ts +26 -0
- package/dist/components/console/formatters.js +116 -0
- 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 -5
- package/dist/components/interrupt/index.js +6 -5
- 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 +12 -4
- package/dist/config/endpoints.js +70 -65
- package/dist/config/runtimeConfig.d.ts +2 -2
- package/dist/config/runtimeConfig.js +8 -8
- package/dist/core/index.d.ts +68 -63
- package/dist/core/index.js +44 -35
- package/dist/display/index.d.ts +2 -2
- package/dist/display/index.js +2 -2
- package/dist/editor/index.d.ts +64 -62
- package/dist/editor/index.js +57 -55
- 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 +40 -35
- package/dist/helpers/workflowEditorHelper.d.ts +8 -58
- package/dist/helpers/workflowEditorHelper.js +73 -292
- 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 +107 -22
- 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 +65 -0
- package/dist/services/chatService.js +131 -0
- 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 +7 -5
- package/dist/services/historyService.js +29 -14
- 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 +27 -22
- package/dist/stores/playgroundStore.svelte.d.ts +3 -3
- package/dist/stores/playgroundStore.svelte.js +29 -23
- package/dist/stores/portCoordinateStore.svelte.d.ts +6 -2
- package/dist/stores/portCoordinateStore.svelte.js +30 -39
- package/dist/stores/settingsStore.svelte.d.ts +2 -2
- package/dist/stores/settingsStore.svelte.js +57 -62
- package/dist/stores/workflowStore.svelte.d.ts +34 -5
- package/dist/stores/workflowStore.svelte.js +127 -108
- 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 +63 -0
- package/dist/types/chat.js +9 -0
- package/dist/types/config.d.ts +6 -6
- package/dist/types/events.d.ts +28 -2
- package/dist/types/events.js +2 -1
- package/dist/types/index.d.ts +40 -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 +12 -4
- package/dist/types/settings.js +21 -23
- 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 +42 -0
- package/dist/utils/edgeStyling.js +173 -0
- 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 +31 -0
- package/dist/utils/nodeIds.js +42 -0
- package/dist/utils/nodeStatus.d.ts +1 -1
- package/dist/utils/nodeStatus.js +48 -48
- package/dist/utils/nodeSwap.d.ts +221 -0
- package/dist/utils/nodeSwap.js +680 -0
- 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 +12 -11
- package/dist/helpers/nodeLayoutHelper.d.ts +0 -14
- package/dist/helpers/nodeLayoutHelper.js +0 -19
package/README.md
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
<img src="https://raw.githubusercontent.com/flowdrop-io/flowdrop/main/libs/flowdrop/static/logo.svg" alt="FlowDrop" width="120" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<h1 align="center">FlowDrop
|
|
5
|
+
<h1 align="center">FlowDrop™</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<img src="https://img.shields.io/github/actions/workflow/status/flowdrop-io/flowdrop/docker-publish.yml?style=flat-square&label=Build" alt="GitHub
|
|
8
|
+
<img src="https://img.shields.io/github/actions/workflow/status/flowdrop-io/flowdrop/docker-publish.yml?style=flat-square&label=Build" alt="GitHub build status" />
|
|
9
9
|
<a href="https://www.npmjs.com/package/@flowdrop/flowdrop"><img src="https://img.shields.io/npm/v/@flowdrop/flowdrop?style=flat-square" alt="npm" /></a>
|
|
10
10
|
<img src="https://img.shields.io/npm/unpacked-size/%40flowdrop%2Fflowdrop?style=flat-square" alt="NPM Unpacked Size" />
|
|
11
11
|
<img src="https://img.shields.io/npm/types/@flowdrop/flowdrop?style=flat-square" alt="npm type definitions" />
|
|
12
|
-
<a href="http://npmjs.com/package/@flowdrop/flowdrop"><img src="https://img.shields.io/npm/
|
|
12
|
+
<a href="http://npmjs.com/package/@flowdrop/flowdrop"><img alt="NPM Downloads" src="https://img.shields.io/npm/d18m/%40flowdrop%2Fflowdrop"></a>
|
|
13
|
+
|
|
13
14
|
</p>
|
|
14
15
|
|
|
15
16
|
<p align="center">
|
|
@@ -22,10 +23,10 @@
|
|
|
22
23
|
</p>
|
|
23
24
|
|
|
24
25
|
<p align="center">
|
|
25
|
-
<a href="
|
|
26
|
+
<a href="https://docs.flowdrop.io/getting-started/installation">Quickstart</a> •
|
|
26
27
|
<a href="#features">Features</a> •
|
|
27
28
|
<a href="#integration">Integration</a> •
|
|
28
|
-
<a href="
|
|
29
|
+
<a href="https://docs.flowdrop.io">Docs</a>
|
|
29
30
|
</p>
|
|
30
31
|
|
|
31
32
|
<p align="center">
|
|
@@ -57,8 +58,8 @@ You get a production-ready workflow UI. You keep full control of everything else
|
|
|
57
58
|
|
|
58
59
|
```svelte
|
|
59
60
|
<script lang="ts">
|
|
60
|
-
import { WorkflowEditor } from
|
|
61
|
-
import
|
|
61
|
+
import { WorkflowEditor } from '@flowdrop/flowdrop';
|
|
62
|
+
import '@flowdrop/flowdrop/styles/base.css';
|
|
62
63
|
</script>
|
|
63
64
|
|
|
64
65
|
<WorkflowEditor />
|
|
@@ -68,14 +69,14 @@ You get a production-ready workflow UI. You keep full control of everything else
|
|
|
68
69
|
|
|
69
70
|
## Features
|
|
70
71
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
72
|
+
| | |
|
|
73
|
+
| ------------------------- | ------------------------------------------------------------------------- |
|
|
74
|
+
| **Visual Editor Only** | Pure UI component. No hidden backend, no external dependencies |
|
|
75
|
+
| **You Own Everything** | Your data, your servers, your orchestration logic, your security policies |
|
|
76
|
+
| **Backend Agnostic** | Connect to any API: Drupal, Laravel, Express, FastAPI, or your own |
|
|
77
|
+
| **8 Built-in Node Types** | From simple icons to complex gateway logic |
|
|
78
|
+
| **Framework Flexible** | Use as Svelte component or mount into React, Vue, Angular, or vanilla JS |
|
|
79
|
+
| **Deploy Anywhere** | Runtime config means build once, deploy everywhere |
|
|
79
80
|
|
|
80
81
|
## Architecture Notes
|
|
81
82
|
|
|
@@ -85,7 +86,7 @@ You get a production-ready workflow UI. You keep full control of everything else
|
|
|
85
86
|
|
|
86
87
|
## Node Types
|
|
87
88
|
|
|
88
|
-
FlowDrop ships with
|
|
89
|
+
FlowDrop ships with 8 beautifully designed node types:
|
|
89
90
|
|
|
90
91
|
| Type | Purpose |
|
|
91
92
|
| ---------- | --------------------------------------- |
|
|
@@ -96,6 +97,7 @@ FlowDrop ships with 7 beautifully designed node types:
|
|
|
96
97
|
| `gateway` | Conditional branching logic |
|
|
97
98
|
| `terminal` | Start/end workflow points |
|
|
98
99
|
| `note` | Markdown documentation blocks |
|
|
100
|
+
| `idea` | Conceptual BPMN-like flow nodes |
|
|
99
101
|
|
|
100
102
|
<p align="center">
|
|
101
103
|
<img src="https://raw.githubusercontent.com/flowdrop-io/flowdrop/main/libs/flowdrop/static/Node-Types.jpg" alt="FlowDrop Node Types" width="800" />
|
|
@@ -104,13 +106,56 @@ FlowDrop ships with 7 beautifully designed node types:
|
|
|
104
106
|
<em>From simple triggers to complex branching logic, each node type is designed for specific workflow patterns.</em>
|
|
105
107
|
</p>
|
|
106
108
|
|
|
109
|
+
## Themes
|
|
110
|
+
|
|
111
|
+
FlowDrop includes a theme system with built-in light/dark support:
|
|
112
|
+
|
|
113
|
+
```svelte
|
|
114
|
+
<script lang="ts">
|
|
115
|
+
import { WorkflowEditor } from '@flowdrop/flowdrop';
|
|
116
|
+
import '@flowdrop/flowdrop/styles';
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<!-- Built-in themes: 'default' or 'minimal' -->
|
|
120
|
+
<WorkflowEditor theme="minimal" />
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Themes bundle a visual skin (CSS token palette) with behavioral UI defaults. You can also pass a custom theme object with your own skin tokens for full control over the light and dark palettes.
|
|
124
|
+
|
|
125
|
+
```javascript
|
|
126
|
+
// Via the mount API
|
|
127
|
+
const app = await mountFlowDropApp(container, {
|
|
128
|
+
theme: 'minimal'
|
|
129
|
+
// or a custom theme object:
|
|
130
|
+
// theme: { name: 'minimal', skin: { tokens: { primary: '#e11d48' } } }
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Sub-Module Exports
|
|
135
|
+
|
|
136
|
+
FlowDrop provides tree-shakeable sub-module exports so you can import only what you need:
|
|
137
|
+
|
|
138
|
+
| Export Path | Contents |
|
|
139
|
+
| ---------------------------------- | -------------------------------------------------- |
|
|
140
|
+
| `@flowdrop/flowdrop` | Full library (components, stores, services, types) |
|
|
141
|
+
| `@flowdrop/flowdrop/core` | Types and utilities only (no heavy dependencies) |
|
|
142
|
+
| `@flowdrop/flowdrop/editor` | WorkflowEditor, stores, services |
|
|
143
|
+
| `@flowdrop/flowdrop/form` | SchemaForm, form fields, registry |
|
|
144
|
+
| `@flowdrop/flowdrop/form/code` | Code editor field (CodeMirror) |
|
|
145
|
+
| `@flowdrop/flowdrop/form/markdown` | Markdown editor field |
|
|
146
|
+
| `@flowdrop/flowdrop/display` | MarkdownDisplay component |
|
|
147
|
+
| `@flowdrop/flowdrop/playground` | Playground components and services |
|
|
148
|
+
| `@flowdrop/flowdrop/settings` | SettingsPanel, stores, services |
|
|
149
|
+
| `@flowdrop/flowdrop/styles` | Base CSS stylesheet |
|
|
150
|
+
| `@flowdrop/flowdrop/schema` | Workflow JSON schema |
|
|
151
|
+
|
|
107
152
|
## Integration
|
|
108
153
|
|
|
109
154
|
### Svelte (Native)
|
|
110
155
|
|
|
111
156
|
```svelte
|
|
112
157
|
<script>
|
|
113
|
-
import { WorkflowEditor, NodeSidebar } from
|
|
158
|
+
import { WorkflowEditor, NodeSidebar } from '@flowdrop/flowdrop';
|
|
114
159
|
</script>
|
|
115
160
|
|
|
116
161
|
<div class="flex h-screen">
|
|
@@ -122,15 +167,15 @@ FlowDrop ships with 7 beautifully designed node types:
|
|
|
122
167
|
### Vanilla JS / React / Vue / Angular
|
|
123
168
|
|
|
124
169
|
```javascript
|
|
125
|
-
import { mountFlowDropApp, createEndpointConfig } from
|
|
170
|
+
import { mountFlowDropApp, createEndpointConfig } from '@flowdrop/flowdrop';
|
|
126
171
|
|
|
127
|
-
const app = await mountFlowDropApp(document.getElementById(
|
|
172
|
+
const app = await mountFlowDropApp(document.getElementById('editor'), {
|
|
128
173
|
workflow: myWorkflow,
|
|
129
|
-
endpointConfig: createEndpointConfig(
|
|
174
|
+
endpointConfig: createEndpointConfig('/api/flowdrop'),
|
|
130
175
|
eventHandlers: {
|
|
131
|
-
onDirtyStateChange: (isDirty) => console.log(
|
|
132
|
-
onAfterSave: (workflow) => console.log(
|
|
133
|
-
}
|
|
176
|
+
onDirtyStateChange: (isDirty) => console.log('Unsaved changes:', isDirty),
|
|
177
|
+
onAfterSave: (workflow) => console.log('Saved!', workflow)
|
|
178
|
+
}
|
|
134
179
|
});
|
|
135
180
|
|
|
136
181
|
// Full control over the editor
|
|
@@ -142,27 +187,27 @@ app.destroy();
|
|
|
142
187
|
### Enterprise Integration
|
|
143
188
|
|
|
144
189
|
```javascript
|
|
145
|
-
import { mountFlowDropApp, CallbackAuthProvider } from
|
|
190
|
+
import { mountFlowDropApp, CallbackAuthProvider } from '@flowdrop/flowdrop';
|
|
146
191
|
|
|
147
192
|
const app = await mountFlowDropApp(container, {
|
|
148
193
|
// Dynamic token refresh
|
|
149
194
|
authProvider: new CallbackAuthProvider({
|
|
150
195
|
getToken: () => authService.getAccessToken(),
|
|
151
|
-
onUnauthorized: () => authService.refreshToken()
|
|
196
|
+
onUnauthorized: () => authService.refreshToken()
|
|
152
197
|
}),
|
|
153
198
|
|
|
154
199
|
// Lifecycle hooks
|
|
155
200
|
eventHandlers: {
|
|
156
201
|
onBeforeUnmount: (workflow, isDirty) => {
|
|
157
202
|
if (isDirty) saveDraft(workflow);
|
|
158
|
-
}
|
|
203
|
+
}
|
|
159
204
|
},
|
|
160
205
|
|
|
161
206
|
// Auto-save, toasts, and more
|
|
162
207
|
features: {
|
|
163
208
|
autoSaveDraft: true,
|
|
164
|
-
autoSaveDraftInterval: 30000
|
|
165
|
-
}
|
|
209
|
+
autoSaveDraftInterval: 30000
|
|
210
|
+
}
|
|
166
211
|
});
|
|
167
212
|
```
|
|
168
213
|
|
|
@@ -171,34 +216,32 @@ const app = await mountFlowDropApp(container, {
|
|
|
171
216
|
Connect to any backend in seconds:
|
|
172
217
|
|
|
173
218
|
```typescript
|
|
174
|
-
import { createEndpointConfig } from
|
|
219
|
+
import { createEndpointConfig } from '@flowdrop/flowdrop';
|
|
175
220
|
|
|
176
|
-
const config = createEndpointConfig({
|
|
177
|
-
baseUrl: "https://api.example.com",
|
|
221
|
+
const config = createEndpointConfig('https://api.example.com', {
|
|
178
222
|
endpoints: {
|
|
179
|
-
nodes: { list:
|
|
223
|
+
nodes: { list: '/nodes', get: '/nodes/{id}' },
|
|
180
224
|
workflows: {
|
|
181
|
-
list:
|
|
182
|
-
get:
|
|
183
|
-
create:
|
|
184
|
-
update:
|
|
185
|
-
execute:
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
auth: { type: "bearer", token: "your-token" },
|
|
225
|
+
list: '/workflows',
|
|
226
|
+
get: '/workflows/{id}',
|
|
227
|
+
create: '/workflows',
|
|
228
|
+
update: '/workflows/{id}',
|
|
229
|
+
execute: '/workflows/{id}/execute'
|
|
230
|
+
}
|
|
231
|
+
}
|
|
189
232
|
});
|
|
190
233
|
```
|
|
191
234
|
|
|
192
235
|
## Customization
|
|
193
236
|
|
|
194
|
-
|
|
237
|
+
The recommended way to customize FlowDrop's appearance is through the [theme system](#themes). For fine-grained control, you can also override individual CSS custom properties:
|
|
195
238
|
|
|
196
239
|
```css
|
|
197
240
|
:root {
|
|
198
|
-
--
|
|
199
|
-
--
|
|
200
|
-
--
|
|
201
|
-
--
|
|
241
|
+
--fd-background: #0a0a0a;
|
|
242
|
+
--fd-primary: #6366f1;
|
|
243
|
+
--fd-border: #27272a;
|
|
244
|
+
--fd-foreground: #fafafa;
|
|
202
245
|
}
|
|
203
246
|
```
|
|
204
247
|
|
|
@@ -223,12 +266,11 @@ Runtime configuration means you build once and deploy to staging, production, or
|
|
|
223
266
|
|
|
224
267
|
## Documentation
|
|
225
268
|
|
|
226
|
-
| Resource
|
|
227
|
-
|
|
|
228
|
-
| [
|
|
229
|
-
| [
|
|
230
|
-
| [
|
|
231
|
-
| [CHANGELOG.md](./CHANGELOG.md) | Version history |
|
|
269
|
+
| Resource | Description |
|
|
270
|
+
| -------------------------------------------------------------------------------------------- | ------------------------ |
|
|
271
|
+
| [QUICK_START.md](https://docs.flowdrop.io/getting-started/installation/) | Get running in 5 minutes |
|
|
272
|
+
| [API Documentation](https://api.flowdrop.io/v1/) | REST API specification |
|
|
273
|
+
| [CHANGELOG.md](https://github.com/flowdrop-io/flowdrop/blob/main/libs/flowdrop/CHANGELOG.md) | Version history |
|
|
232
274
|
|
|
233
275
|
## Development
|
|
234
276
|
|
|
@@ -237,6 +279,7 @@ pnpm install # Install dependencies
|
|
|
237
279
|
pnpm dev # Start dev server
|
|
238
280
|
pnpm build # Build library
|
|
239
281
|
pnpm test # Run all tests
|
|
282
|
+
pnpm storybook # Launch Storybook
|
|
240
283
|
```
|
|
241
284
|
|
|
242
285
|
## Contributing
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* - External applications that want to integrate with FlowDrop
|
|
14
14
|
* - Systems that need to generate or modify workflows programmatically
|
|
15
15
|
*/
|
|
16
|
-
import type { Workflow, NodeMetadata, WorkflowFormat } from
|
|
16
|
+
import type { Workflow, NodeMetadata, WorkflowFormat } from '../types/index.js';
|
|
17
17
|
/**
|
|
18
18
|
* Standard workflow node interface (SvelteFlow-agnostic)
|
|
19
19
|
*/
|
|
@@ -13,28 +13,8 @@
|
|
|
13
13
|
* - External applications that want to integrate with FlowDrop
|
|
14
14
|
* - Systems that need to generate or modify workflows programmatically
|
|
15
15
|
*/
|
|
16
|
-
import { v4 as uuidv4 } from
|
|
17
|
-
|
|
18
|
-
* Generate a unique node ID based on node type and existing nodes
|
|
19
|
-
* Format: <node_type>.<number>
|
|
20
|
-
* Example: boolean_gateway.1, calculator.2
|
|
21
|
-
*/
|
|
22
|
-
function generateStandardNodeId(nodeTypeId, existingNodes) {
|
|
23
|
-
// Count how many nodes of this type already exist
|
|
24
|
-
const existingNodeIds = existingNodes
|
|
25
|
-
.filter((node) => node.data?.metadata?.id === nodeTypeId)
|
|
26
|
-
.map((node) => node.id);
|
|
27
|
-
// Extract the numbers from existing IDs with the same prefix
|
|
28
|
-
const existingNumbers = existingNodeIds
|
|
29
|
-
.map((id) => {
|
|
30
|
-
const match = id.match(new RegExp(`^${nodeTypeId}\\.(\\d+)$`));
|
|
31
|
-
return match ? parseInt(match[1], 10) : 0;
|
|
32
|
-
})
|
|
33
|
-
.filter((num) => num > 0);
|
|
34
|
-
// Find the next available number (highest + 1)
|
|
35
|
-
const nextNumber = existingNumbers.length > 0 ? Math.max(...existingNumbers) + 1 : 1;
|
|
36
|
-
return `${nodeTypeId}.${nextNumber}`;
|
|
37
|
-
}
|
|
16
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
17
|
+
import { generateNodeId } from '../utils/nodeIds.js';
|
|
38
18
|
/**
|
|
39
19
|
* Workflow Adapter Class
|
|
40
20
|
* Provides a clean API for workflow operations without exposing SvelteFlow internals
|
|
@@ -55,10 +35,10 @@ export class WorkflowAdapter {
|
|
|
55
35
|
nodes: [],
|
|
56
36
|
edges: [],
|
|
57
37
|
metadata: {
|
|
58
|
-
version:
|
|
38
|
+
version: '1.0.0',
|
|
59
39
|
createdAt: new Date().toISOString(),
|
|
60
|
-
updatedAt: new Date().toISOString()
|
|
61
|
-
}
|
|
40
|
+
updatedAt: new Date().toISOString()
|
|
41
|
+
}
|
|
62
42
|
};
|
|
63
43
|
}
|
|
64
44
|
/**
|
|
@@ -70,7 +50,7 @@ export class WorkflowAdapter {
|
|
|
70
50
|
throw new Error(`Node type '${nodeType}' not found`);
|
|
71
51
|
}
|
|
72
52
|
// Generate node ID based on node type and existing nodes
|
|
73
|
-
const nodeId =
|
|
53
|
+
const nodeId = generateNodeId(nodeType, workflow.nodes);
|
|
74
54
|
const node = {
|
|
75
55
|
id: nodeId,
|
|
76
56
|
type: nodeType,
|
|
@@ -78,8 +58,8 @@ export class WorkflowAdapter {
|
|
|
78
58
|
data: {
|
|
79
59
|
label: metadata.name,
|
|
80
60
|
config: config || {},
|
|
81
|
-
metadata
|
|
82
|
-
}
|
|
61
|
+
metadata
|
|
62
|
+
}
|
|
83
63
|
};
|
|
84
64
|
workflow.nodes.push(node);
|
|
85
65
|
workflow.metadata.updatedAt = new Date().toISOString();
|
|
@@ -129,7 +109,7 @@ export class WorkflowAdapter {
|
|
|
129
109
|
source: sourceNodeId,
|
|
130
110
|
target: targetNodeId,
|
|
131
111
|
sourceHandle,
|
|
132
|
-
targetHandle
|
|
112
|
+
targetHandle
|
|
133
113
|
};
|
|
134
114
|
workflow.edges.push(edge);
|
|
135
115
|
workflow.metadata.updatedAt = new Date().toISOString();
|
|
@@ -181,7 +161,7 @@ export class WorkflowAdapter {
|
|
|
181
161
|
const warnings = [];
|
|
182
162
|
// Check for empty workflow
|
|
183
163
|
if (workflow.nodes.length === 0) {
|
|
184
|
-
warnings.push(
|
|
164
|
+
warnings.push('Workflow has no nodes');
|
|
185
165
|
}
|
|
186
166
|
// Check for orphaned edges
|
|
187
167
|
const nodeIds = new Set(workflow.nodes.map((n) => n.id));
|
|
@@ -222,7 +202,7 @@ export class WorkflowAdapter {
|
|
|
222
202
|
return {
|
|
223
203
|
valid: errors.length === 0,
|
|
224
204
|
errors,
|
|
225
|
-
warnings
|
|
205
|
+
warnings
|
|
226
206
|
};
|
|
227
207
|
}
|
|
228
208
|
/**
|
|
@@ -240,20 +220,20 @@ export class WorkflowAdapter {
|
|
|
240
220
|
// Validate the imported workflow
|
|
241
221
|
const validation = this.validateWorkflow(workflow);
|
|
242
222
|
if (!validation.valid) {
|
|
243
|
-
throw new Error(`Invalid workflow: ${validation.errors.join(
|
|
223
|
+
throw new Error(`Invalid workflow: ${validation.errors.join(', ')}`);
|
|
244
224
|
}
|
|
245
225
|
// Update metadata
|
|
246
226
|
workflow.metadata = {
|
|
247
|
-
version: workflow.metadata?.version ||
|
|
227
|
+
version: workflow.metadata?.version || '1.0.0',
|
|
248
228
|
createdAt: workflow.metadata?.createdAt || new Date().toISOString(),
|
|
249
229
|
updatedAt: new Date().toISOString(),
|
|
250
230
|
author: workflow.metadata?.author,
|
|
251
|
-
tags: workflow.metadata?.tags
|
|
231
|
+
tags: workflow.metadata?.tags
|
|
252
232
|
};
|
|
253
233
|
return workflow;
|
|
254
234
|
}
|
|
255
235
|
catch (error) {
|
|
256
|
-
throw new Error(`Failed to import workflow: ${error instanceof Error ? error.message :
|
|
236
|
+
throw new Error(`Failed to import workflow: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
257
237
|
}
|
|
258
238
|
}
|
|
259
239
|
/**
|
|
@@ -271,17 +251,17 @@ export class WorkflowAdapter {
|
|
|
271
251
|
data: {
|
|
272
252
|
label: node.data.label,
|
|
273
253
|
config: node.data.config,
|
|
274
|
-
metadata: node.data.metadata
|
|
275
|
-
}
|
|
254
|
+
metadata: node.data.metadata
|
|
255
|
+
}
|
|
276
256
|
})),
|
|
277
257
|
edges: svelteFlowWorkflow.edges.map((edge) => ({
|
|
278
258
|
id: edge.id,
|
|
279
259
|
source: edge.source,
|
|
280
260
|
target: edge.target,
|
|
281
261
|
sourceHandle: edge.sourceHandle,
|
|
282
|
-
targetHandle: edge.targetHandle
|
|
262
|
+
targetHandle: edge.targetHandle
|
|
283
263
|
})),
|
|
284
|
-
metadata: svelteFlowWorkflow.metadata
|
|
264
|
+
metadata: svelteFlowWorkflow.metadata
|
|
285
265
|
};
|
|
286
266
|
}
|
|
287
267
|
/**
|
|
@@ -294,24 +274,24 @@ export class WorkflowAdapter {
|
|
|
294
274
|
description: workflow.description,
|
|
295
275
|
nodes: workflow.nodes.map((node) => ({
|
|
296
276
|
id: node.id,
|
|
297
|
-
type:
|
|
277
|
+
type: 'workflowNode',
|
|
298
278
|
position: node.position,
|
|
299
279
|
deletable: true,
|
|
300
280
|
data: {
|
|
301
281
|
label: node.data.label,
|
|
302
282
|
config: node.data.config,
|
|
303
283
|
metadata: node.data.metadata,
|
|
304
|
-
nodeId: node.id
|
|
305
|
-
}
|
|
284
|
+
nodeId: node.id
|
|
285
|
+
}
|
|
306
286
|
})),
|
|
307
287
|
edges: workflow.edges.map((edge) => ({
|
|
308
288
|
id: edge.id,
|
|
309
289
|
source: edge.source,
|
|
310
290
|
target: edge.target,
|
|
311
291
|
sourceHandle: edge.sourceHandle,
|
|
312
|
-
targetHandle: edge.targetHandle
|
|
292
|
+
targetHandle: edge.targetHandle
|
|
313
293
|
})),
|
|
314
|
-
metadata: workflow.metadata
|
|
294
|
+
metadata: workflow.metadata
|
|
315
295
|
};
|
|
316
296
|
}
|
|
317
297
|
/**
|
|
@@ -326,7 +306,7 @@ export class WorkflowAdapter {
|
|
|
326
306
|
totalNodes: workflow.nodes.length,
|
|
327
307
|
totalEdges: workflow.edges.length,
|
|
328
308
|
nodeTypeCounts: Object.fromEntries(nodeTypeCounts),
|
|
329
|
-
lastModified: workflow.metadata?.updatedAt
|
|
309
|
+
lastModified: workflow.metadata?.updatedAt
|
|
330
310
|
};
|
|
331
311
|
}
|
|
332
312
|
/**
|
|
@@ -357,11 +337,11 @@ export class WorkflowAdapter {
|
|
|
357
337
|
cloned.id = uuidv4();
|
|
358
338
|
cloned.name = newName || `${workflow.name} (Copy)`;
|
|
359
339
|
cloned.metadata = {
|
|
360
|
-
version: cloned.metadata?.version ||
|
|
340
|
+
version: cloned.metadata?.version || '1.0.0',
|
|
361
341
|
createdAt: new Date().toISOString(),
|
|
362
342
|
updatedAt: new Date().toISOString(),
|
|
363
343
|
author: cloned.metadata?.author,
|
|
364
|
-
tags: cloned.metadata?.tags
|
|
344
|
+
tags: cloned.metadata?.tags
|
|
365
345
|
};
|
|
366
346
|
return cloned;
|
|
367
347
|
}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @see https://github.com/oracle/agent-spec
|
|
11
11
|
*/
|
|
12
|
-
import type { AgentSpecFlow } from
|
|
13
|
-
import type { StandardWorkflow } from
|
|
12
|
+
import type { AgentSpecFlow } from '../../types/agentspec.js';
|
|
13
|
+
import type { StandardWorkflow } from '../WorkflowAdapter.js';
|
|
14
14
|
export declare class AgentSpecAdapter {
|
|
15
15
|
/**
|
|
16
16
|
* Convert a FlowDrop StandardWorkflow to an Agent Spec Flow.
|