@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/dist/types/events.d.ts
CHANGED
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module types/events
|
|
8
8
|
*/
|
|
9
|
-
import type { Workflow, NodeExecutionInfo } from
|
|
9
|
+
import type { Workflow, NodeExecutionInfo, WorkflowNode } from './index.js';
|
|
10
|
+
import type { SwapEventContext, SwapResult } from '../utils/nodeSwap.js';
|
|
10
11
|
/**
|
|
11
12
|
* Types of workflow changes
|
|
12
13
|
*
|
|
13
14
|
* Used to identify what kind of change triggered the onWorkflowChange event.
|
|
14
15
|
*/
|
|
15
|
-
export type WorkflowChangeType =
|
|
16
|
+
export type WorkflowChangeType = 'node_add' | 'node_remove' | 'node_move' | 'node_config' | 'node_swap' | 'edge_add' | 'edge_remove' | 'metadata' | 'name' | 'description';
|
|
16
17
|
/**
|
|
17
18
|
* High-level event handlers for enterprise integration
|
|
18
19
|
*
|
|
@@ -113,6 +114,22 @@ export interface FlowDropEventHandlers {
|
|
|
113
114
|
* @returns true to suppress default error handling, false/void to show default toast
|
|
114
115
|
*/
|
|
115
116
|
onApiError?: (error: Error, operation: string) => boolean | void;
|
|
117
|
+
/**
|
|
118
|
+
* Called before a node swap is executed.
|
|
119
|
+
* Return false to cancel the swap.
|
|
120
|
+
*
|
|
121
|
+
* @param context - Data-only swap context (oldNode, newMetadata, preview, overrides)
|
|
122
|
+
* @returns false to cancel, true/void to proceed
|
|
123
|
+
*/
|
|
124
|
+
onBeforeSwap?: (context: SwapEventContext) => boolean | void | Promise<boolean | void>;
|
|
125
|
+
/**
|
|
126
|
+
* Called after a node swap is successfully executed.
|
|
127
|
+
*
|
|
128
|
+
* @param result - The swap result with updated nodes/edges
|
|
129
|
+
* @param oldNode - The node that was replaced
|
|
130
|
+
* @param newNodeId - The ID of the newly created node
|
|
131
|
+
*/
|
|
132
|
+
onAfterSwap?: (result: SwapResult, oldNode: WorkflowNode, newNodeId: string) => void;
|
|
116
133
|
/**
|
|
117
134
|
* Called when an Agent Spec execution starts
|
|
118
135
|
*
|
|
@@ -174,6 +191,15 @@ export interface FlowDropFeatures {
|
|
|
174
191
|
* @default true
|
|
175
192
|
*/
|
|
176
193
|
showToasts?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Enable node swap functionality
|
|
196
|
+
*
|
|
197
|
+
* When enabled, users can swap a node for a different type
|
|
198
|
+
* while preserving compatible connections and configuration.
|
|
199
|
+
*
|
|
200
|
+
* @default true
|
|
201
|
+
*/
|
|
202
|
+
enableNodeSwap?: boolean;
|
|
177
203
|
}
|
|
178
204
|
/**
|
|
179
205
|
* Default feature values
|
package/dist/types/events.js
CHANGED
|
@@ -15,6 +15,7 @@ export const DEFAULT_FEATURES = {
|
|
|
15
15
|
autoSaveDraft: true,
|
|
16
16
|
autoSaveDraftInterval: 30000,
|
|
17
17
|
showToasts: true,
|
|
18
|
+
enableNodeSwap: true
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
21
|
* Merge user-provided features with defaults
|
|
@@ -25,6 +26,6 @@ export const DEFAULT_FEATURES = {
|
|
|
25
26
|
export function mergeFeatures(features) {
|
|
26
27
|
return {
|
|
27
28
|
...DEFAULT_FEATURES,
|
|
28
|
-
...features
|
|
29
|
+
...features
|
|
29
30
|
};
|
|
30
31
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core types for the Workflow Library
|
|
3
3
|
*/
|
|
4
|
-
import type { Node, Edge, XYPosition } from
|
|
5
|
-
import { ConnectionLineType } from
|
|
6
|
-
import type { EndpointConfig } from
|
|
4
|
+
import type { Node, Edge, XYPosition } from '@xyflow/svelte';
|
|
5
|
+
import { ConnectionLineType } from '@xyflow/svelte';
|
|
6
|
+
import type { EndpointConfig } from '../config/endpoints.js';
|
|
7
7
|
/**
|
|
8
8
|
* Built-in node categories that ship with FlowDrop.
|
|
9
9
|
* These categories have predefined icons, colors, and display names.
|
|
10
10
|
*/
|
|
11
|
-
export type BuiltinNodeCategory =
|
|
11
|
+
export type BuiltinNodeCategory = 'triggers' | 'inputs' | 'outputs' | 'prompts' | 'models' | 'processing' | 'logic' | 'data' | 'tools' | 'helpers' | 'vector stores' | 'embeddings' | 'memories' | 'agents' | 'ai' | 'interrupts' | 'bundles';
|
|
12
12
|
/**
|
|
13
13
|
* Node category for organizing nodes in the sidebar.
|
|
14
14
|
* Includes all built-in categories plus any custom string.
|
|
@@ -27,7 +27,7 @@ export type NodeCategory = BuiltinNodeCategory | (string & Record<never, never>)
|
|
|
27
27
|
/**
|
|
28
28
|
* Built-in workflow format identifiers that ship with FlowDrop.
|
|
29
29
|
*/
|
|
30
|
-
export type BuiltinWorkflowFormat =
|
|
30
|
+
export type BuiltinWorkflowFormat = 'flowdrop' | 'agentspec';
|
|
31
31
|
/**
|
|
32
32
|
* Workflow format identifier.
|
|
33
33
|
* Determines sidebar node filtering and export behavior.
|
|
@@ -111,7 +111,7 @@ export type NodeDataType = string;
|
|
|
111
111
|
export interface NodePort {
|
|
112
112
|
id: string;
|
|
113
113
|
name: string;
|
|
114
|
-
type:
|
|
114
|
+
type: 'input' | 'output' | 'metadata';
|
|
115
115
|
dataType: NodeDataType;
|
|
116
116
|
required?: boolean;
|
|
117
117
|
description?: string;
|
|
@@ -136,7 +136,7 @@ export interface PortCoordinate {
|
|
|
136
136
|
/** The node this port belongs to */
|
|
137
137
|
nodeId: string;
|
|
138
138
|
/** Port direction */
|
|
139
|
-
direction:
|
|
139
|
+
direction: 'input' | 'output';
|
|
140
140
|
/** Port data type for compatibility checks */
|
|
141
141
|
dataType: string;
|
|
142
142
|
}
|
|
@@ -196,12 +196,12 @@ export interface Branch {
|
|
|
196
196
|
* @param portType - Whether this is an input or output port
|
|
197
197
|
* @returns A NodePort compatible with the rendering system
|
|
198
198
|
*/
|
|
199
|
-
export declare function dynamicPortToNodePort(port: DynamicPort, portType:
|
|
199
|
+
export declare function dynamicPortToNodePort(port: DynamicPort, portType: 'input' | 'output'): NodePort;
|
|
200
200
|
/**
|
|
201
201
|
* Built-in node types for explicit component rendering.
|
|
202
202
|
* These are the node types that ship with FlowDrop.
|
|
203
203
|
*/
|
|
204
|
-
export type BuiltinNodeType =
|
|
204
|
+
export type BuiltinNodeType = 'note' | 'simple' | 'square' | 'tool' | 'gateway' | 'terminal' | 'default';
|
|
205
205
|
/**
|
|
206
206
|
* Node type for component rendering.
|
|
207
207
|
* Includes built-in types and allows custom registered types.
|
|
@@ -222,7 +222,7 @@ export type NodeType = BuiltinNodeType | (string & Record<never, never>);
|
|
|
222
222
|
/**
|
|
223
223
|
* HTTP method types for dynamic schema endpoints
|
|
224
224
|
*/
|
|
225
|
-
export type HttpMethod =
|
|
225
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH';
|
|
226
226
|
/**
|
|
227
227
|
* Autocomplete configuration for form fields
|
|
228
228
|
*
|
|
@@ -535,6 +535,14 @@ export interface NodeExtensions {
|
|
|
535
535
|
* Allows overriding the node type's configEdit settings for specific instances
|
|
536
536
|
*/
|
|
537
537
|
configEdit?: ConfigEditOptions;
|
|
538
|
+
/**
|
|
539
|
+
* Set when this node was created by swapping another node.
|
|
540
|
+
* Stores the immediate predecessor only — not a full chain.
|
|
541
|
+
* Sequential swaps (A→B→C) each store only their direct predecessor.
|
|
542
|
+
*/
|
|
543
|
+
swap?: {
|
|
544
|
+
previousNodeId: string;
|
|
545
|
+
};
|
|
538
546
|
/**
|
|
539
547
|
* Namespaced extension data from 3rd party integrations
|
|
540
548
|
* Use your package/organization name as the key (e.g., "myapp", "acme:analyzer")
|
|
@@ -577,7 +585,7 @@ export interface NodeMetadata {
|
|
|
577
585
|
* @see UISchemaElement for the element type definitions
|
|
578
586
|
* @see https://jsonforms.io/docs/uischema
|
|
579
587
|
*/
|
|
580
|
-
uiSchema?: import(
|
|
588
|
+
uiSchema?: import('./uischema.js').UISchemaElement;
|
|
581
589
|
/** Default configuration values for this node type */
|
|
582
590
|
config?: Record<string, unknown>;
|
|
583
591
|
tags?: string[];
|
|
@@ -617,7 +625,7 @@ export interface NodeMetadata {
|
|
|
617
625
|
* Common base interface for all schema properties
|
|
618
626
|
*/
|
|
619
627
|
export interface BaseProperty {
|
|
620
|
-
type:
|
|
628
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer' | 'mixed' | 'float';
|
|
621
629
|
description?: string;
|
|
622
630
|
title?: string;
|
|
623
631
|
default?: unknown;
|
|
@@ -636,7 +644,7 @@ export interface BaseProperty {
|
|
|
636
644
|
* Common base interface for all schemas
|
|
637
645
|
*/
|
|
638
646
|
export interface BaseSchema {
|
|
639
|
-
type:
|
|
647
|
+
type: 'object';
|
|
640
648
|
properties: Record<string, BaseProperty>;
|
|
641
649
|
required?: string[];
|
|
642
650
|
additionalProperties?: boolean;
|
|
@@ -645,7 +653,7 @@ export interface BaseSchema {
|
|
|
645
653
|
* Configuration schema property with specific attributes
|
|
646
654
|
*/
|
|
647
655
|
export interface ConfigProperty extends BaseProperty {
|
|
648
|
-
type:
|
|
656
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer';
|
|
649
657
|
title?: string;
|
|
650
658
|
description?: string;
|
|
651
659
|
default?: unknown;
|
|
@@ -656,7 +664,7 @@ export interface ConfigProperty extends BaseProperty {
|
|
|
656
664
|
minLength?: number;
|
|
657
665
|
maxLength?: number;
|
|
658
666
|
pattern?: string;
|
|
659
|
-
format?:
|
|
667
|
+
format?: 'multiline' | 'hidden' | string;
|
|
660
668
|
items?: ConfigProperty;
|
|
661
669
|
properties?: Record<string, ConfigProperty>;
|
|
662
670
|
[key: string]: unknown;
|
|
@@ -671,7 +679,7 @@ export interface ConfigSchema extends BaseSchema {
|
|
|
671
679
|
* Input schema property with specific attributes
|
|
672
680
|
*/
|
|
673
681
|
export interface InputProperty extends BaseProperty {
|
|
674
|
-
type:
|
|
682
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer' | 'mixed';
|
|
675
683
|
title?: string;
|
|
676
684
|
description?: string;
|
|
677
685
|
required?: boolean;
|
|
@@ -682,7 +690,7 @@ export interface InputProperty extends BaseProperty {
|
|
|
682
690
|
minLength?: number;
|
|
683
691
|
maxLength?: number;
|
|
684
692
|
pattern?: string;
|
|
685
|
-
format?:
|
|
693
|
+
format?: 'multiline' | string;
|
|
686
694
|
items?: InputProperty;
|
|
687
695
|
properties?: Record<string, InputProperty>;
|
|
688
696
|
[key: string]: unknown;
|
|
@@ -697,7 +705,7 @@ export interface InputSchema extends BaseSchema {
|
|
|
697
705
|
* Output schema property with specific attributes
|
|
698
706
|
*/
|
|
699
707
|
export interface OutputProperty extends BaseProperty {
|
|
700
|
-
type:
|
|
708
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer' | 'mixed' | 'float';
|
|
701
709
|
description: string;
|
|
702
710
|
title?: string;
|
|
703
711
|
default?: unknown;
|
|
@@ -721,7 +729,7 @@ export interface OutputSchema extends BaseSchema {
|
|
|
721
729
|
/**
|
|
722
730
|
* Primitive types for template variables
|
|
723
731
|
*/
|
|
724
|
-
export type TemplateVariableType =
|
|
732
|
+
export type TemplateVariableType = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer' | 'mixed' | 'float';
|
|
725
733
|
/**
|
|
726
734
|
* Represents a variable available for template interpolation.
|
|
727
735
|
* Used by the template editor for autocomplete suggestions.
|
|
@@ -981,15 +989,15 @@ export type Property = ConfigProperty | InputProperty | OutputProperty;
|
|
|
981
989
|
/**
|
|
982
990
|
* Schema type discriminator
|
|
983
991
|
*/
|
|
984
|
-
export type SchemaType =
|
|
992
|
+
export type SchemaType = 'config' | 'input' | 'output';
|
|
985
993
|
/**
|
|
986
994
|
* Utility type to get the appropriate property type based on schema type
|
|
987
995
|
*/
|
|
988
|
-
export type SchemaProperty<T extends SchemaType> = T extends
|
|
996
|
+
export type SchemaProperty<T extends SchemaType> = T extends 'config' ? ConfigProperty : T extends 'input' ? InputProperty : T extends 'output' ? OutputProperty : never;
|
|
989
997
|
/**
|
|
990
998
|
* Utility type to get the appropriate schema type based on schema type
|
|
991
999
|
*/
|
|
992
|
-
export type SchemaTypeMap<T extends SchemaType> = T extends
|
|
1000
|
+
export type SchemaTypeMap<T extends SchemaType> = T extends 'config' ? ConfigSchema : T extends 'input' ? InputSchema : T extends 'output' ? OutputSchema : never;
|
|
993
1001
|
/**
|
|
994
1002
|
* Node configuration values
|
|
995
1003
|
*
|
|
@@ -1095,7 +1103,7 @@ export interface WorkflowNode extends Node {
|
|
|
1095
1103
|
* - loopback: Dashed gray line for loop iteration (targets loop_back port)
|
|
1096
1104
|
* - data: Normal gray line for all other data connections
|
|
1097
1105
|
*/
|
|
1098
|
-
export type EdgeCategory =
|
|
1106
|
+
export type EdgeCategory = 'trigger' | 'tool' | 'loopback' | 'data';
|
|
1099
1107
|
/**
|
|
1100
1108
|
* Extended edge type for workflows
|
|
1101
1109
|
*/
|
|
@@ -1158,7 +1166,7 @@ export type WorkflowsResponse = ApiResponse<Workflow[]>;
|
|
|
1158
1166
|
/**
|
|
1159
1167
|
* Node execution status enum
|
|
1160
1168
|
*/
|
|
1161
|
-
export type NodeExecutionStatus =
|
|
1169
|
+
export type NodeExecutionStatus = 'idle' | 'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'skipped';
|
|
1162
1170
|
/**
|
|
1163
1171
|
* Node execution tracking information
|
|
1164
1172
|
*/
|
|
@@ -1181,7 +1189,7 @@ export interface NodeExecutionInfo {
|
|
|
1181
1189
|
/**
|
|
1182
1190
|
* Workflow execution status
|
|
1183
1191
|
*/
|
|
1184
|
-
export type ExecutionStatus =
|
|
1192
|
+
export type ExecutionStatus = 'idle' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
1185
1193
|
/**
|
|
1186
1194
|
* Workflow execution result
|
|
1187
1195
|
*/
|
|
@@ -1200,7 +1208,7 @@ export interface ExecutionResult {
|
|
|
1200
1208
|
*/
|
|
1201
1209
|
export interface FlowDropConfig {
|
|
1202
1210
|
endpointConfig?: EndpointConfig;
|
|
1203
|
-
theme?:
|
|
1211
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
1204
1212
|
enableDebug?: boolean;
|
|
1205
1213
|
autoSave?: boolean;
|
|
1206
1214
|
autoSaveInterval?: number;
|
|
@@ -1243,9 +1251,9 @@ export interface WorkflowEvents {
|
|
|
1243
1251
|
error: string;
|
|
1244
1252
|
};
|
|
1245
1253
|
}
|
|
1246
|
-
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig
|
|
1247
|
-
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider
|
|
1248
|
-
export type { FlowDropSettings, ThemeSettings, EditorSettings, UISettings, BehaviorSettings, ApiSettings, ThemePreference, ResolvedTheme, SettingsCategory, PartialSettings, SyncStatus, SettingsStoreState, SettingsChangeEvent, SettingsChangeCallback
|
|
1249
|
-
export { DEFAULT_SETTINGS, DEFAULT_THEME_SETTINGS, DEFAULT_EDITOR_SETTINGS, DEFAULT_UI_SETTINGS, DEFAULT_BEHAVIOR_SETTINGS, DEFAULT_API_SETTINGS, SETTINGS_CATEGORIES, SETTINGS_CATEGORY_LABELS, SETTINGS_CATEGORY_ICONS, SETTINGS_STORAGE_KEY
|
|
1250
|
-
export type { UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement
|
|
1251
|
-
export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup
|
|
1254
|
+
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from './auth.js';
|
|
1255
|
+
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider } from './auth.js';
|
|
1256
|
+
export type { FlowDropSettings, ThemeSettings, EditorSettings, UISettings, BehaviorSettings, ApiSettings, ThemePreference, ResolvedTheme, SettingsCategory, PartialSettings, SyncStatus, SettingsStoreState, SettingsChangeEvent, SettingsChangeCallback } from './settings.js';
|
|
1257
|
+
export { DEFAULT_SETTINGS, DEFAULT_THEME_SETTINGS, DEFAULT_EDITOR_SETTINGS, DEFAULT_UI_SETTINGS, DEFAULT_BEHAVIOR_SETTINGS, DEFAULT_API_SETTINGS, SETTINGS_CATEGORIES, SETTINGS_CATEGORY_LABELS, SETTINGS_CATEGORY_ICONS, SETTINGS_STORAGE_KEY } from './settings.js';
|
|
1258
|
+
export type { UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement } from './uischema.js';
|
|
1259
|
+
export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup } from './uischema.js';
|
package/dist/types/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Core types for the Workflow Library
|
|
3
3
|
*/
|
|
4
|
-
import { ConnectionLineType } from
|
|
4
|
+
import { ConnectionLineType } from '@xyflow/svelte';
|
|
5
5
|
/**
|
|
6
6
|
* Default workflow format used when none is specified.
|
|
7
7
|
*/
|
|
8
|
-
export const DEFAULT_WORKFLOW_FORMAT =
|
|
8
|
+
export const DEFAULT_WORKFLOW_FORMAT = 'flowdrop';
|
|
9
9
|
/**
|
|
10
10
|
* Convert a DynamicPort to a NodePort
|
|
11
11
|
* @param port - The dynamic port configuration
|
|
@@ -19,9 +19,9 @@ export function dynamicPortToNodePort(port, portType) {
|
|
|
19
19
|
type: portType,
|
|
20
20
|
dataType: port.dataType,
|
|
21
21
|
required: port.required ?? false,
|
|
22
|
-
description: port.description
|
|
22
|
+
description: port.description
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider
|
|
26
|
-
export { DEFAULT_SETTINGS, DEFAULT_THEME_SETTINGS, DEFAULT_EDITOR_SETTINGS, DEFAULT_UI_SETTINGS, DEFAULT_BEHAVIOR_SETTINGS, DEFAULT_API_SETTINGS, SETTINGS_CATEGORIES, SETTINGS_CATEGORY_LABELS, SETTINGS_CATEGORY_ICONS, SETTINGS_STORAGE_KEY
|
|
27
|
-
export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup
|
|
25
|
+
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider } from './auth.js';
|
|
26
|
+
export { DEFAULT_SETTINGS, DEFAULT_THEME_SETTINGS, DEFAULT_EDITOR_SETTINGS, DEFAULT_UI_SETTINGS, DEFAULT_BEHAVIOR_SETTINGS, DEFAULT_API_SETTINGS, SETTINGS_CATEGORIES, SETTINGS_CATEGORY_LABELS, SETTINGS_CATEGORY_ICONS, SETTINGS_STORAGE_KEY } from './settings.js';
|
|
27
|
+
export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup } from './uischema.js';
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module types/interrupt
|
|
8
8
|
*/
|
|
9
|
-
import type { ConfigSchema } from
|
|
10
|
-
export type { InterruptState, IdleState, SubmittingState, ResolvedState, CancelledState, ErrorState, InterruptAction, SubmitAction, CancelAction, SuccessAction, FailureAction, RetryAction, ResetAction, TransitionResult
|
|
11
|
-
export { initialState, transition, isTerminalState, isSubmitting, hasError, canSubmit, getErrorMessage, getResolvedValue, toLegacyStatus
|
|
9
|
+
import type { ConfigSchema } from './index.js';
|
|
10
|
+
export type { InterruptState, IdleState, SubmittingState, ResolvedState, CancelledState, ErrorState, InterruptAction, SubmitAction, CancelAction, SuccessAction, FailureAction, RetryAction, ResetAction, TransitionResult } from './interruptState.js';
|
|
11
|
+
export { initialState, transition, isTerminalState, isSubmitting, hasError, canSubmit, getErrorMessage, getResolvedValue, toLegacyStatus } from './interruptState.js';
|
|
12
12
|
/**
|
|
13
13
|
* Types of interrupts supported by the system
|
|
14
14
|
*
|
|
@@ -17,7 +17,7 @@ export { initialState, transition, isTerminalState, isSubmitting, hasError, canS
|
|
|
17
17
|
* - `text`: Free-form text input
|
|
18
18
|
* - `form`: JSON Schema-based form
|
|
19
19
|
*/
|
|
20
|
-
export type InterruptType =
|
|
20
|
+
export type InterruptType = 'confirmation' | 'choice' | 'text' | 'form' | 'review';
|
|
21
21
|
/**
|
|
22
22
|
* Status of an interrupt request
|
|
23
23
|
*
|
|
@@ -26,7 +26,7 @@ export type InterruptType = "confirmation" | "choice" | "text" | "form" | "revie
|
|
|
26
26
|
* - `cancelled`: User or system cancelled the interrupt
|
|
27
27
|
* - `expired`: Interrupt timed out without response
|
|
28
28
|
*/
|
|
29
|
-
export type InterruptStatus =
|
|
29
|
+
export type InterruptStatus = 'pending' | 'resolved' | 'cancelled' | 'expired';
|
|
30
30
|
/**
|
|
31
31
|
* Choice option for choice-type interrupts
|
|
32
32
|
*
|
|
@@ -306,7 +306,7 @@ export type InterruptResponse = InterruptApiResponse<Interrupt>;
|
|
|
306
306
|
*/
|
|
307
307
|
export interface InterruptMessageMetadata {
|
|
308
308
|
/** Indicates this is an interrupt request */
|
|
309
|
-
type:
|
|
309
|
+
type: 'interrupt_request';
|
|
310
310
|
/** The interrupt ID */
|
|
311
311
|
interrupt_id: string;
|
|
312
312
|
/** Type of interrupt */
|
package/dist/types/interrupt.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module types/interrupt
|
|
8
8
|
*/
|
|
9
|
-
export { initialState, transition, isTerminalState, isSubmitting, hasError, canSubmit, getErrorMessage, getResolvedValue, toLegacyStatus
|
|
9
|
+
export { initialState, transition, isTerminalState, isSubmitting, hasError, canSubmit, getErrorMessage, getResolvedValue, toLegacyStatus } from './interruptState.js';
|
|
10
10
|
/**
|
|
11
11
|
* Type guard to check if message metadata indicates an interrupt
|
|
12
12
|
*
|
|
@@ -15,8 +15,8 @@ export { initialState, transition, isTerminalState, isSubmitting, hasError, canS
|
|
|
15
15
|
*/
|
|
16
16
|
export function isInterruptMetadata(metadata) {
|
|
17
17
|
return (metadata !== undefined &&
|
|
18
|
-
metadata.type ===
|
|
19
|
-
typeof metadata.interrupt_id ===
|
|
18
|
+
metadata.type === 'interrupt_request' &&
|
|
19
|
+
typeof metadata.interrupt_id === 'string');
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Safely extract interrupt metadata from a generic record
|
|
@@ -30,7 +30,7 @@ export function extractInterruptMetadata(metadata) {
|
|
|
30
30
|
}
|
|
31
31
|
// Manually construct the typed object from the validated metadata
|
|
32
32
|
return {
|
|
33
|
-
type:
|
|
33
|
+
type: 'interrupt_request',
|
|
34
34
|
interrupt_id: metadata.interrupt_id,
|
|
35
35
|
interrupt_type: metadata.interrupt_type,
|
|
36
36
|
schema: metadata.schema,
|
|
@@ -54,7 +54,7 @@ export function extractInterruptMetadata(metadata) {
|
|
|
54
54
|
changes: metadata.changes,
|
|
55
55
|
accept_all_label: metadata.accept_all_label,
|
|
56
56
|
reject_all_label: metadata.reject_all_label,
|
|
57
|
-
submit_label: metadata.submit_label
|
|
57
|
+
submit_label: metadata.submit_label
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
@@ -69,7 +69,7 @@ export function metadataToInterrupt(metadata, messageId, content) {
|
|
|
69
69
|
const baseInterrupt = {
|
|
70
70
|
id: metadata.interrupt_id,
|
|
71
71
|
type: metadata.interrupt_type,
|
|
72
|
-
status:
|
|
72
|
+
status: 'pending',
|
|
73
73
|
message: content,
|
|
74
74
|
nodeId: metadata.node_id,
|
|
75
75
|
executionId: metadata.execution_id,
|
|
@@ -80,8 +80,8 @@ export function metadataToInterrupt(metadata, messageId, content) {
|
|
|
80
80
|
// Include metadata for resolved-by info (passed through from message metadata)
|
|
81
81
|
metadata: {
|
|
82
82
|
resolvedByUserName: metadata.resolvedByUserName,
|
|
83
|
-
resolvedByUserId: metadata.resolvedByUserId
|
|
84
|
-
}
|
|
83
|
+
resolvedByUserId: metadata.resolvedByUserId
|
|
84
|
+
}
|
|
85
85
|
};
|
|
86
86
|
return baseInterrupt;
|
|
87
87
|
}
|
|
@@ -94,42 +94,42 @@ export function metadataToInterrupt(metadata, messageId, content) {
|
|
|
94
94
|
*/
|
|
95
95
|
function buildInterruptConfig(metadata, message) {
|
|
96
96
|
switch (metadata.interrupt_type) {
|
|
97
|
-
case
|
|
97
|
+
case 'confirmation':
|
|
98
98
|
return {
|
|
99
99
|
message,
|
|
100
|
-
confirmLabel: metadata.confirm_label ??
|
|
101
|
-
cancelLabel: metadata.cancel_label ??
|
|
100
|
+
confirmLabel: metadata.confirm_label ?? 'Yes',
|
|
101
|
+
cancelLabel: metadata.cancel_label ?? 'No'
|
|
102
102
|
};
|
|
103
|
-
case
|
|
103
|
+
case 'choice':
|
|
104
104
|
return {
|
|
105
105
|
message,
|
|
106
106
|
options: metadata.options ?? [],
|
|
107
107
|
multiple: metadata.multiple ?? false,
|
|
108
108
|
minSelections: metadata.min_selections,
|
|
109
|
-
maxSelections: metadata.max_selections
|
|
109
|
+
maxSelections: metadata.max_selections
|
|
110
110
|
};
|
|
111
|
-
case
|
|
111
|
+
case 'text':
|
|
112
112
|
return {
|
|
113
113
|
message,
|
|
114
114
|
placeholder: metadata.placeholder,
|
|
115
115
|
multiline: metadata.multiline ?? false,
|
|
116
116
|
minLength: metadata.min_length,
|
|
117
117
|
maxLength: metadata.max_length,
|
|
118
|
-
defaultValue: metadata.default_value
|
|
118
|
+
defaultValue: metadata.default_value
|
|
119
119
|
};
|
|
120
|
-
case
|
|
120
|
+
case 'form':
|
|
121
121
|
return {
|
|
122
122
|
message,
|
|
123
|
-
schema: metadata.schema ?? { type:
|
|
124
|
-
defaultValues: metadata.default_value
|
|
123
|
+
schema: metadata.schema ?? { type: 'object', properties: {} },
|
|
124
|
+
defaultValues: metadata.default_value
|
|
125
125
|
};
|
|
126
|
-
case
|
|
126
|
+
case 'review':
|
|
127
127
|
return {
|
|
128
128
|
message,
|
|
129
129
|
changes: metadata.changes ?? [],
|
|
130
130
|
acceptAllLabel: metadata.accept_all_label,
|
|
131
131
|
rejectAllLabel: metadata.reject_all_label,
|
|
132
|
-
submitLabel: metadata.submit_label
|
|
132
|
+
submitLabel: metadata.submit_label
|
|
133
133
|
};
|
|
134
134
|
default:
|
|
135
135
|
return { message };
|
|
@@ -141,5 +141,5 @@ function buildInterruptConfig(metadata, message) {
|
|
|
141
141
|
export const defaultInterruptPollingConfig = {
|
|
142
142
|
enabled: false,
|
|
143
143
|
interval: 2000,
|
|
144
|
-
maxBackoff: 10000
|
|
144
|
+
maxBackoff: 10000
|
|
145
145
|
};
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
* Idle state - waiting for user action
|
|
37
37
|
*/
|
|
38
38
|
export interface IdleState {
|
|
39
|
-
readonly status:
|
|
39
|
+
readonly status: 'idle';
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Submitting state - API call in progress
|
|
43
43
|
*/
|
|
44
44
|
export interface SubmittingState {
|
|
45
|
-
readonly status:
|
|
45
|
+
readonly status: 'submitting';
|
|
46
46
|
/** The value being submitted */
|
|
47
47
|
readonly pendingValue: unknown;
|
|
48
48
|
/** Whether this is a cancel operation */
|
|
@@ -52,7 +52,7 @@ export interface SubmittingState {
|
|
|
52
52
|
* Resolved state - successfully completed
|
|
53
53
|
*/
|
|
54
54
|
export interface ResolvedState {
|
|
55
|
-
readonly status:
|
|
55
|
+
readonly status: 'resolved';
|
|
56
56
|
/** The submitted value */
|
|
57
57
|
readonly value: unknown;
|
|
58
58
|
/** Timestamp when resolved */
|
|
@@ -62,7 +62,7 @@ export interface ResolvedState {
|
|
|
62
62
|
* Cancelled state - user cancelled
|
|
63
63
|
*/
|
|
64
64
|
export interface CancelledState {
|
|
65
|
-
readonly status:
|
|
65
|
+
readonly status: 'cancelled';
|
|
66
66
|
/** Timestamp when cancelled */
|
|
67
67
|
readonly cancelledAt: string;
|
|
68
68
|
}
|
|
@@ -70,7 +70,7 @@ export interface CancelledState {
|
|
|
70
70
|
* Error state - submission failed, can retry
|
|
71
71
|
*/
|
|
72
72
|
export interface ErrorState {
|
|
73
|
-
readonly status:
|
|
73
|
+
readonly status: 'error';
|
|
74
74
|
/** The error message */
|
|
75
75
|
readonly error: string;
|
|
76
76
|
/** The value that failed to submit (for retry) */
|
|
@@ -86,39 +86,39 @@ export type InterruptState = IdleState | SubmittingState | ResolvedState | Cance
|
|
|
86
86
|
* Submit action - user submits a value
|
|
87
87
|
*/
|
|
88
88
|
export interface SubmitAction {
|
|
89
|
-
readonly type:
|
|
89
|
+
readonly type: 'SUBMIT';
|
|
90
90
|
readonly value: unknown;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Cancel action - user cancels the interrupt
|
|
94
94
|
*/
|
|
95
95
|
export interface CancelAction {
|
|
96
|
-
readonly type:
|
|
96
|
+
readonly type: 'CANCEL';
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* Success action - API call succeeded
|
|
100
100
|
*/
|
|
101
101
|
export interface SuccessAction {
|
|
102
|
-
readonly type:
|
|
102
|
+
readonly type: 'SUCCESS';
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Failure action - API call failed
|
|
106
106
|
*/
|
|
107
107
|
export interface FailureAction {
|
|
108
|
-
readonly type:
|
|
108
|
+
readonly type: 'FAILURE';
|
|
109
109
|
readonly error: string;
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* Retry action - retry after error
|
|
113
113
|
*/
|
|
114
114
|
export interface RetryAction {
|
|
115
|
-
readonly type:
|
|
115
|
+
readonly type: 'RETRY';
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
118
|
* Reset action - reset to idle state
|
|
119
119
|
*/
|
|
120
120
|
export interface ResetAction {
|
|
121
|
-
readonly type:
|
|
121
|
+
readonly type: 'RESET';
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Union of all possible actions
|
|
@@ -208,4 +208,4 @@ export declare function getResolvedValue(state: InterruptState): unknown;
|
|
|
208
208
|
* @param state - The interrupt state
|
|
209
209
|
* @returns Legacy status string
|
|
210
210
|
*/
|
|
211
|
-
export declare function toLegacyStatus(state: InterruptState):
|
|
211
|
+
export declare function toLegacyStatus(state: InterruptState): 'pending' | 'resolved' | 'cancelled' | 'expired';
|