@flowdrop/flowdrop 1.0.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/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/adapters/WorkflowAdapter.d.ts +167 -0
- package/dist/adapters/WorkflowAdapter.js +368 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +96 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.js +626 -0
- package/dist/adapters/agentspec/agentAdapter.d.ts +59 -0
- package/dist/adapters/agentspec/agentAdapter.js +91 -0
- package/dist/adapters/agentspec/autoLayout.d.ts +34 -0
- package/dist/adapters/agentspec/autoLayout.js +127 -0
- package/dist/adapters/agentspec/componentTypeDefaults.d.ts +73 -0
- package/dist/adapters/agentspec/componentTypeDefaults.js +238 -0
- package/dist/adapters/agentspec/defaultNodeTypes.d.ts +53 -0
- package/dist/adapters/agentspec/defaultNodeTypes.js +561 -0
- package/dist/adapters/agentspec/index.d.ts +37 -0
- package/dist/adapters/agentspec/index.js +39 -0
- package/dist/adapters/agentspec/validator.d.ts +34 -0
- package/dist/adapters/agentspec/validator.js +169 -0
- package/dist/api/enhanced-client.d.ts +183 -0
- package/dist/api/enhanced-client.js +430 -0
- package/dist/components/App.svelte +981 -0
- package/dist/components/App.svelte.d.ts +54 -0
- package/dist/components/CanvasBanner.stories.svelte +29 -0
- package/dist/components/CanvasBanner.stories.svelte.d.ts +27 -0
- package/dist/components/CanvasBanner.svelte +57 -0
- package/dist/components/CanvasBanner.svelte.d.ts +8 -0
- package/dist/components/ConfigForm.svelte +1138 -0
- package/dist/components/ConfigForm.svelte.d.ts +44 -0
- package/dist/components/ConfigModal.svelte +188 -0
- package/dist/components/ConfigModal.svelte.d.ts +13 -0
- package/dist/components/ConfigPanel.stories.svelte +47 -0
- package/dist/components/ConfigPanel.stories.svelte.d.ts +27 -0
- package/dist/components/ConfigPanel.svelte +182 -0
- package/dist/components/ConfigPanel.svelte.d.ts +32 -0
- package/dist/components/ConnectionLine.svelte +32 -0
- package/dist/components/ConnectionLine.svelte.d.ts +3 -0
- package/dist/components/EdgeRefresher.svelte +41 -0
- package/dist/components/EdgeRefresher.svelte.d.ts +9 -0
- package/dist/components/FlowDropZone.svelte +83 -0
- package/dist/components/FlowDropZone.svelte.d.ts +13 -0
- package/dist/components/LoadingSpinner.stories.svelte +30 -0
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +27 -0
- package/dist/components/LoadingSpinner.svelte +36 -0
- package/dist/components/LoadingSpinner.svelte.d.ts +8 -0
- package/dist/components/Logo.stories.svelte +22 -0
- package/dist/components/Logo.stories.svelte.d.ts +27 -0
- package/dist/components/Logo.svelte +102 -0
- package/dist/components/Logo.svelte.d.ts +26 -0
- package/dist/components/LogsSidebar.svelte +563 -0
- package/dist/components/LogsSidebar.svelte.d.ts +17 -0
- package/dist/components/MarkdownDisplay.stories.svelte +36 -0
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +27 -0
- package/dist/components/MarkdownDisplay.svelte +29 -0
- package/dist/components/MarkdownDisplay.svelte.d.ts +7 -0
- package/dist/components/Navbar.stories.svelte +53 -0
- package/dist/components/Navbar.stories.svelte.d.ts +27 -0
- package/dist/components/Navbar.svelte +726 -0
- package/dist/components/Navbar.svelte.d.ts +29 -0
- package/dist/components/NodeSidebar.svelte +762 -0
- package/dist/components/NodeSidebar.svelte.d.ts +9 -0
- package/dist/components/NodeStatusOverlay.stories.svelte +85 -0
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +27 -0
- package/dist/components/NodeStatusOverlay.svelte +327 -0
- package/dist/components/NodeStatusOverlay.svelte.d.ts +11 -0
- package/dist/components/PipelineStatus.svelte +314 -0
- package/dist/components/PipelineStatus.svelte.d.ts +20 -0
- package/dist/components/PortCoordinateTracker.svelte +58 -0
- package/dist/components/PortCoordinateTracker.svelte.d.ts +12 -0
- package/dist/components/ReadOnlyDetails.svelte +170 -0
- package/dist/components/ReadOnlyDetails.svelte.d.ts +25 -0
- package/dist/components/SchemaForm.stories.svelte +116 -0
- package/dist/components/SchemaForm.stories.svelte.d.ts +27 -0
- package/dist/components/SchemaForm.svelte +536 -0
- package/dist/components/SchemaForm.svelte.d.ts +83 -0
- package/dist/components/SettingsModal.svelte +279 -0
- package/dist/components/SettingsModal.svelte.d.ts +23 -0
- package/dist/components/SettingsPanel.svelte +638 -0
- package/dist/components/SettingsPanel.svelte.d.ts +21 -0
- package/dist/components/StatusIcon.stories.svelte +60 -0
- package/dist/components/StatusIcon.stories.svelte.d.ts +27 -0
- package/dist/components/StatusIcon.svelte +119 -0
- package/dist/components/StatusIcon.svelte.d.ts +10 -0
- package/dist/components/StatusLabel.stories.svelte +17 -0
- package/dist/components/StatusLabel.stories.svelte.d.ts +27 -0
- package/dist/components/StatusLabel.svelte +33 -0
- package/dist/components/StatusLabel.svelte.d.ts +7 -0
- package/dist/components/ThemeToggle.stories.svelte +25 -0
- package/dist/components/ThemeToggle.stories.svelte.d.ts +27 -0
- package/dist/components/ThemeToggle.svelte +185 -0
- package/dist/components/ThemeToggle.svelte.d.ts +14 -0
- package/dist/components/UniversalNode.svelte +155 -0
- package/dist/components/UniversalNode.svelte.d.ts +15 -0
- package/dist/components/WorkflowEditor.svelte +1035 -0
- package/dist/components/WorkflowEditor.svelte.d.ts +23 -0
- package/dist/components/form/FormArray.svelte +1049 -0
- package/dist/components/form/FormArray.svelte.d.ts +22 -0
- package/dist/components/form/FormAutocomplete.svelte +1009 -0
- package/dist/components/form/FormAutocomplete.svelte.d.ts +25 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte +28 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormCheckboxGroup.svelte +155 -0
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +17 -0
- package/dist/components/form/FormCodeEditor.svelte +458 -0
- package/dist/components/form/FormCodeEditor.svelte.d.ts +25 -0
- package/dist/components/form/FormField.svelte +417 -0
- package/dist/components/form/FormField.svelte.d.ts +29 -0
- package/dist/components/form/FormFieldLight.svelte +425 -0
- package/dist/components/form/FormFieldLight.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte +53 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormFieldWrapper.svelte +125 -0
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldset.svelte +142 -0
- package/dist/components/form/FormFieldset.svelte.d.ts +11 -0
- package/dist/components/form/FormMarkdownEditor.svelte +752 -0
- package/dist/components/form/FormMarkdownEditor.svelte.d.ts +33 -0
- package/dist/components/form/FormNumberField.stories.svelte +36 -0
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormNumberField.svelte +112 -0
- package/dist/components/form/FormNumberField.svelte.d.ts +25 -0
- package/dist/components/form/FormRangeField.stories.svelte +31 -0
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormRangeField.svelte +246 -0
- package/dist/components/form/FormRangeField.svelte.d.ts +23 -0
- package/dist/components/form/FormSelect.stories.svelte +50 -0
- package/dist/components/form/FormSelect.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormSelect.svelte +129 -0
- package/dist/components/form/FormSelect.svelte.d.ts +20 -0
- package/dist/components/form/FormTemplateEditor.svelte +825 -0
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +41 -0
- package/dist/components/form/FormTextField.stories.svelte +30 -0
- package/dist/components/form/FormTextField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextField.svelte +91 -0
- package/dist/components/form/FormTextField.svelte.d.ts +19 -0
- package/dist/components/form/FormTextarea.stories.svelte +34 -0
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextarea.svelte +97 -0
- package/dist/components/form/FormTextarea.svelte.d.ts +21 -0
- package/dist/components/form/FormToggle.stories.svelte +30 -0
- package/dist/components/form/FormToggle.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormToggle.svelte +126 -0
- package/dist/components/form/FormToggle.svelte.d.ts +19 -0
- package/dist/components/form/FormUISchemaRenderer.svelte +136 -0
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +32 -0
- package/dist/components/form/index.d.ts +50 -0
- package/dist/components/form/index.js +54 -0
- package/dist/components/form/templateAutocomplete.d.ts +29 -0
- package/dist/components/form/templateAutocomplete.js +254 -0
- package/dist/components/form/types.d.ts +485 -0
- package/dist/components/form/types.js +73 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +52 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +401 -0
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +71 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte +292 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +25 -0
- package/dist/components/interrupt/FormPrompt.svelte +236 -0
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/InterruptBubble.svelte +601 -0
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +16 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +67 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ReviewPrompt.svelte +861 -0
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +47 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/TextInputPrompt.svelte +346 -0
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/index.d.ts +13 -0
- package/dist/components/interrupt/index.js +15 -0
- package/dist/components/layouts/MainLayout.svelte +718 -0
- package/dist/components/layouts/MainLayout.svelte.d.ts +62 -0
- package/dist/components/nodes/GatewayNode.stories.svelte +108 -0
- package/dist/components/nodes/GatewayNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/GatewayNode.svelte +591 -0
- package/dist/components/nodes/GatewayNode.svelte.d.ts +15 -0
- package/dist/components/nodes/IdeaNode.stories.svelte +52 -0
- package/dist/components/nodes/IdeaNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/IdeaNode.svelte +455 -0
- package/dist/components/nodes/IdeaNode.svelte.d.ts +24 -0
- package/dist/components/nodes/NotesNode.stories.svelte +76 -0
- package/dist/components/nodes/NotesNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/NotesNode.svelte +378 -0
- package/dist/components/nodes/NotesNode.svelte.d.ts +24 -0
- package/dist/components/nodes/SimpleNode.stories.svelte +159 -0
- package/dist/components/nodes/SimpleNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SimpleNode.svelte +451 -0
- package/dist/components/nodes/SimpleNode.svelte.d.ts +25 -0
- package/dist/components/nodes/SquareNode.stories.svelte +82 -0
- package/dist/components/nodes/SquareNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SquareNode.svelte +407 -0
- package/dist/components/nodes/SquareNode.svelte.d.ts +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/TerminalNode.svelte +690 -0
- package/dist/components/nodes/TerminalNode.svelte.d.ts +25 -0
- package/dist/components/nodes/ToolNode.stories.svelte +189 -0
- package/dist/components/nodes/ToolNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/ToolNode.svelte +471 -0
- package/dist/components/nodes/ToolNode.svelte.d.ts +36 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte +55 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/WorkflowNode.svelte +571 -0
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +15 -0
- package/dist/components/playground/ChatPanel.svelte +905 -0
- package/dist/components/playground/ChatPanel.svelte.d.ts +46 -0
- package/dist/components/playground/ExecutionLogs.svelte +488 -0
- package/dist/components/playground/ExecutionLogs.svelte.d.ts +14 -0
- package/dist/components/playground/InputCollector.svelte +444 -0
- package/dist/components/playground/InputCollector.svelte.d.ts +16 -0
- package/dist/components/playground/MessageBubble.stories.svelte +62 -0
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +27 -0
- package/dist/components/playground/MessageBubble.svelte +633 -0
- package/dist/components/playground/MessageBubble.svelte.d.ts +24 -0
- package/dist/components/playground/Playground.svelte +1075 -0
- package/dist/components/playground/Playground.svelte.d.ts +25 -0
- package/dist/components/playground/PlaygroundModal.svelte +220 -0
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +25 -0
- package/dist/components/playground/SessionManager.svelte +538 -0
- package/dist/components/playground/SessionManager.svelte.d.ts +20 -0
- package/dist/config/agentSpecEndpoints.d.ts +70 -0
- package/dist/config/agentSpecEndpoints.js +65 -0
- package/dist/config/constants.d.ts +43 -0
- package/dist/config/constants.js +31 -0
- package/dist/config/defaultCategories.d.ts +7 -0
- package/dist/config/defaultCategories.js +126 -0
- package/dist/config/defaultPortConfig.d.ts +6 -0
- package/dist/config/defaultPortConfig.js +201 -0
- package/dist/config/endpoints.d.ts +160 -0
- package/dist/config/endpoints.js +146 -0
- package/dist/config/runtimeConfig.d.ts +47 -0
- package/dist/config/runtimeConfig.js +80 -0
- package/dist/core/index.d.ts +75 -0
- package/dist/core/index.js +92 -0
- package/dist/display/index.d.ts +29 -0
- package/dist/display/index.js +36 -0
- package/dist/editor/index.d.ts +95 -0
- package/dist/editor/index.js +138 -0
- package/dist/form/code.d.ts +101 -0
- package/dist/form/code.js +168 -0
- package/dist/form/fieldRegistry.d.ts +169 -0
- package/dist/form/fieldRegistry.js +152 -0
- package/dist/form/full.d.ts +56 -0
- package/dist/form/full.js +80 -0
- package/dist/form/index.d.ts +77 -0
- package/dist/form/index.js +91 -0
- package/dist/form/markdown.d.ts +69 -0
- package/dist/form/markdown.js +103 -0
- package/dist/helpers/nodeLayoutHelper.d.ts +14 -0
- package/dist/helpers/nodeLayoutHelper.js +19 -0
- package/dist/helpers/proximityConnect.d.ts +94 -0
- package/dist/helpers/proximityConnect.js +314 -0
- package/dist/helpers/workflowEditorHelper.d.ts +183 -0
- package/dist/helpers/workflowEditorHelper.js +595 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +64 -0
- package/dist/mocks/app-environment.d.ts +8 -0
- package/dist/mocks/app-environment.js +16 -0
- package/dist/mocks/app-forms.d.ts +2 -0
- package/dist/mocks/app-forms.js +22 -0
- package/dist/mocks/app-navigation.d.ts +5 -0
- package/dist/mocks/app-navigation.js +36 -0
- package/dist/mocks/app-stores.d.ts +14 -0
- package/dist/mocks/app-stores.js +26 -0
- package/dist/playground/index.d.ts +131 -0
- package/dist/playground/index.js +172 -0
- package/dist/playground/mount.d.ts +203 -0
- package/dist/playground/mount.js +235 -0
- package/dist/registry/BaseRegistry.d.ts +92 -0
- package/dist/registry/BaseRegistry.js +124 -0
- package/dist/registry/builtinFormats.d.ts +23 -0
- package/dist/registry/builtinFormats.js +70 -0
- package/dist/registry/builtinNodes.d.ts +77 -0
- package/dist/registry/builtinNodes.js +211 -0
- package/dist/registry/index.d.ts +8 -0
- package/dist/registry/index.js +12 -0
- package/dist/registry/nodeComponentRegistry.d.ts +276 -0
- package/dist/registry/nodeComponentRegistry.js +262 -0
- package/dist/registry/plugin.d.ts +215 -0
- package/dist/registry/plugin.js +249 -0
- package/dist/registry/workflowFormatRegistry.d.ts +122 -0
- package/dist/registry/workflowFormatRegistry.js +96 -0
- package/dist/schema/index.d.ts +23 -0
- package/dist/schema/index.js +23 -0
- package/dist/schemas/v1/workflow.schema.json +1078 -0
- package/dist/services/agentSpecExecutionService.d.ts +106 -0
- package/dist/services/agentSpecExecutionService.js +334 -0
- package/dist/services/api.d.ts +115 -0
- package/dist/services/api.js +214 -0
- package/dist/services/apiVariableService.d.ts +114 -0
- package/dist/services/apiVariableService.js +338 -0
- package/dist/services/autoSaveService.d.ts +112 -0
- package/dist/services/autoSaveService.js +227 -0
- package/dist/services/categoriesApi.d.ts +14 -0
- package/dist/services/categoriesApi.js +49 -0
- package/dist/services/draftStorage.d.ts +171 -0
- package/dist/services/draftStorage.js +299 -0
- package/dist/services/dynamicSchemaService.d.ts +108 -0
- package/dist/services/dynamicSchemaService.js +444 -0
- package/dist/services/globalSave.d.ts +69 -0
- package/dist/services/globalSave.js +248 -0
- package/dist/services/historyService.d.ts +208 -0
- package/dist/services/historyService.js +321 -0
- package/dist/services/interruptService.d.ts +133 -0
- package/dist/services/interruptService.js +280 -0
- package/dist/services/nodeExecutionService.d.ts +63 -0
- package/dist/services/nodeExecutionService.js +266 -0
- package/dist/services/playgroundService.d.ts +130 -0
- package/dist/services/playgroundService.js +321 -0
- package/dist/services/portConfigApi.d.ts +14 -0
- package/dist/services/portConfigApi.js +54 -0
- package/dist/services/settingsService.d.ts +92 -0
- package/dist/services/settingsService.js +196 -0
- package/dist/services/toastService.d.ts +156 -0
- package/dist/services/toastService.js +265 -0
- package/dist/services/variableService.d.ts +141 -0
- package/dist/services/variableService.js +463 -0
- package/dist/services/workflowStorage.d.ts +37 -0
- package/dist/services/workflowStorage.js +116 -0
- package/dist/settings/index.d.ts +25 -0
- package/dist/settings/index.js +33 -0
- package/dist/stores/categoriesStore.svelte.d.ts +32 -0
- package/dist/stores/categoriesStore.svelte.js +77 -0
- package/dist/stores/editorStateMachine.svelte.d.ts +42 -0
- package/dist/stores/editorStateMachine.svelte.js +132 -0
- package/dist/stores/historyStore.svelte.d.ts +136 -0
- package/dist/stores/historyStore.svelte.js +207 -0
- package/dist/stores/interruptStore.svelte.d.ts +179 -0
- package/dist/stores/interruptStore.svelte.js +346 -0
- package/dist/stores/playgroundStore.svelte.d.ts +230 -0
- package/dist/stores/playgroundStore.svelte.js +515 -0
- package/dist/stores/portCoordinateStore.svelte.d.ts +66 -0
- package/dist/stores/portCoordinateStore.svelte.js +186 -0
- package/dist/stores/settingsStore.svelte.d.ts +158 -0
- package/dist/stores/settingsStore.svelte.js +544 -0
- package/dist/stores/workflowStore.svelte.d.ts +260 -0
- package/dist/stores/workflowStore.svelte.js +649 -0
- package/dist/stories/CanvasDecorator.svelte +49 -0
- package/dist/stories/CanvasDecorator.svelte.d.ts +8 -0
- package/dist/stories/NodeDecorator.svelte +73 -0
- package/dist/stories/NodeDecorator.svelte.d.ts +8 -0
- package/dist/stories/utils.d.ts +93 -0
- package/dist/stories/utils.js +122 -0
- package/dist/styles/base.css +1300 -0
- package/dist/styles/toast.css +35 -0
- package/dist/styles/tokens.css +475 -0
- package/dist/svelte-app.d.ts +150 -0
- package/dist/svelte-app.js +295 -0
- package/dist/types/agentspec.d.ts +318 -0
- package/dist/types/agentspec.js +48 -0
- package/dist/types/auth.d.ts +263 -0
- package/dist/types/auth.js +229 -0
- package/dist/types/config.d.ts +151 -0
- package/dist/types/config.js +7 -0
- package/dist/types/events.d.ts +190 -0
- package/dist/types/events.js +30 -0
- package/dist/types/index.d.ts +1234 -0
- package/dist/types/index.js +27 -0
- package/dist/types/interrupt.d.ts +390 -0
- package/dist/types/interrupt.js +145 -0
- package/dist/types/interruptState.d.ts +211 -0
- package/dist/types/interruptState.js +308 -0
- package/dist/types/playground.d.ts +351 -0
- package/dist/types/playground.js +95 -0
- package/dist/types/settings.d.ts +189 -0
- package/dist/types/settings.js +97 -0
- package/dist/types/uischema.d.ts +144 -0
- package/dist/types/uischema.js +51 -0
- package/dist/utils/colors.d.ts +288 -0
- package/dist/utils/colors.js +548 -0
- package/dist/utils/config.d.ts +37 -0
- package/dist/utils/config.js +226 -0
- package/dist/utils/connections.d.ts +125 -0
- package/dist/utils/connections.js +414 -0
- package/dist/utils/errors.d.ts +28 -0
- package/dist/utils/errors.js +44 -0
- package/dist/utils/fetchWithAuth.d.ts +25 -0
- package/dist/utils/fetchWithAuth.js +34 -0
- package/dist/utils/handleIds.d.ts +35 -0
- package/dist/utils/handleIds.js +58 -0
- package/dist/utils/handlePositioning.d.ts +31 -0
- package/dist/utils/handlePositioning.js +35 -0
- package/dist/utils/icons.d.ts +106 -0
- package/dist/utils/icons.js +157 -0
- package/dist/utils/logger.d.ts +47 -0
- package/dist/utils/logger.js +72 -0
- package/dist/utils/nodeStatus.d.ts +53 -0
- package/dist/utils/nodeStatus.js +183 -0
- package/dist/utils/nodeTypes.d.ts +117 -0
- package/dist/utils/nodeTypes.js +244 -0
- package/dist/utils/nodeWrapper.d.ts +39 -0
- package/dist/utils/nodeWrapper.js +62 -0
- package/dist/utils/performanceUtils.d.ts +30 -0
- package/dist/utils/performanceUtils.js +108 -0
- package/dist/utils/sanitize.d.ts +19 -0
- package/dist/utils/sanitize.js +31 -0
- package/dist/utils/uischema.d.ts +52 -0
- package/dist/utils/uischema.js +88 -0
- package/dist/utils/validation.d.ts +29 -0
- package/dist/utils/validation.js +39 -0
- package/package.json +292 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* History Service for FlowDrop
|
|
3
|
+
*
|
|
4
|
+
* Provides undo/redo functionality for the workflow editor using snapshot-based history.
|
|
5
|
+
* Supports debounced drag operations and configurable history limits.
|
|
6
|
+
*
|
|
7
|
+
* @module services/historyService
|
|
8
|
+
*/
|
|
9
|
+
import { DEFAULT_BEHAVIOR_SETTINGS } from '../types/settings.js';
|
|
10
|
+
import { logger } from '../utils/logger.js';
|
|
11
|
+
// =========================================================================
|
|
12
|
+
// History Service Class
|
|
13
|
+
// =========================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Manages undo/redo history for workflow state
|
|
16
|
+
*
|
|
17
|
+
* Uses a snapshot-based approach where each history entry contains
|
|
18
|
+
* a complete copy of the workflow state. This trades memory for simplicity
|
|
19
|
+
* and reliability.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const historyService = new HistoryService();
|
|
24
|
+
*
|
|
25
|
+
* // Initialize with current workflow
|
|
26
|
+
* historyService.initialize(workflow);
|
|
27
|
+
*
|
|
28
|
+
* // Push state before making changes
|
|
29
|
+
* historyService.push(workflow, { description: "Add node" });
|
|
30
|
+
*
|
|
31
|
+
* // Undo/Redo
|
|
32
|
+
* const previousState = historyService.undo();
|
|
33
|
+
* const nextState = historyService.redo();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export class HistoryService {
|
|
37
|
+
/** Stack of history entries */
|
|
38
|
+
undoStack = [];
|
|
39
|
+
/** Stack of redo entries (cleared when new changes are made) */
|
|
40
|
+
redoStack = [];
|
|
41
|
+
/** Maximum number of entries to keep in history */
|
|
42
|
+
maxEntries;
|
|
43
|
+
/** Flag to track if we're in a transaction (batch operation) */
|
|
44
|
+
inTransaction = false;
|
|
45
|
+
/** Snapshot captured at transaction start */
|
|
46
|
+
transactionSnapshot = null;
|
|
47
|
+
/** Description for the transaction */
|
|
48
|
+
transactionDescription = null;
|
|
49
|
+
/** Callbacks to notify when history state changes */
|
|
50
|
+
changeCallbacks = new Set();
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new HistoryService instance
|
|
53
|
+
*
|
|
54
|
+
* @param maxEntries - Maximum number of history entries to keep (default: 50)
|
|
55
|
+
*/
|
|
56
|
+
constructor(maxEntries = DEFAULT_BEHAVIOR_SETTINGS.undoHistoryLimit) {
|
|
57
|
+
this.maxEntries = maxEntries;
|
|
58
|
+
}
|
|
59
|
+
// =========================================================================
|
|
60
|
+
// Public Methods
|
|
61
|
+
// =========================================================================
|
|
62
|
+
/**
|
|
63
|
+
* Initialize the history with the current workflow state
|
|
64
|
+
*
|
|
65
|
+
* This clears any existing history and sets the initial state.
|
|
66
|
+
* Should be called when a workflow is first loaded.
|
|
67
|
+
*
|
|
68
|
+
* @param workflow - The initial workflow state
|
|
69
|
+
*/
|
|
70
|
+
initialize(workflow) {
|
|
71
|
+
this.undoStack = [];
|
|
72
|
+
this.redoStack = [];
|
|
73
|
+
this.inTransaction = false;
|
|
74
|
+
this.transactionSnapshot = null;
|
|
75
|
+
this.transactionDescription = null;
|
|
76
|
+
// Push the initial state as the first entry
|
|
77
|
+
this.undoStack.push({
|
|
78
|
+
snapshot: this.cloneWorkflow(workflow),
|
|
79
|
+
timestamp: Date.now(),
|
|
80
|
+
description: 'Initial state'
|
|
81
|
+
});
|
|
82
|
+
this.notifyChange();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Push the current state to history before making changes
|
|
86
|
+
*
|
|
87
|
+
* Call this BEFORE modifying the workflow to capture the "before" state.
|
|
88
|
+
* The redo stack is cleared when new changes are pushed.
|
|
89
|
+
*
|
|
90
|
+
* @param workflow - The current workflow state (before changes)
|
|
91
|
+
* @param options - Options for this history entry
|
|
92
|
+
*/
|
|
93
|
+
push(workflow, options = {}) {
|
|
94
|
+
// Skip if we're in a transaction (we'll push at commit)
|
|
95
|
+
if (this.inTransaction) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// Skip if explicitly requested
|
|
99
|
+
if (options.skipHistory) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
this.pushInternal(workflow, options.description);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Undo the last change
|
|
106
|
+
*
|
|
107
|
+
* Returns the previous workflow state, or null if at the beginning of history.
|
|
108
|
+
*
|
|
109
|
+
* @returns The previous workflow state, or null if cannot undo
|
|
110
|
+
*/
|
|
111
|
+
undo() {
|
|
112
|
+
// Need at least 2 entries to undo (initial + 1 change)
|
|
113
|
+
if (this.undoStack.length <= 1) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
// Pop the current state and push to redo stack
|
|
117
|
+
const current = this.undoStack.pop();
|
|
118
|
+
if (current) {
|
|
119
|
+
this.redoStack.push(current);
|
|
120
|
+
}
|
|
121
|
+
// Return the new current state (the one before the change)
|
|
122
|
+
const previous = this.undoStack[this.undoStack.length - 1];
|
|
123
|
+
this.notifyChange();
|
|
124
|
+
return previous ? this.cloneWorkflow(previous.snapshot) : null;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Redo the last undone change
|
|
128
|
+
*
|
|
129
|
+
* Returns the next workflow state, or null if at the end of history.
|
|
130
|
+
*
|
|
131
|
+
* @returns The next workflow state, or null if cannot redo
|
|
132
|
+
*/
|
|
133
|
+
redo() {
|
|
134
|
+
if (this.redoStack.length === 0) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
// Pop from redo stack and push to undo stack
|
|
138
|
+
const next = this.redoStack.pop();
|
|
139
|
+
if (next) {
|
|
140
|
+
this.undoStack.push(next);
|
|
141
|
+
this.notifyChange();
|
|
142
|
+
return this.cloneWorkflow(next.snapshot);
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Start a transaction for grouping multiple changes
|
|
148
|
+
*
|
|
149
|
+
* All changes made during a transaction are combined into a single undo entry.
|
|
150
|
+
* Useful for operations like "delete node" which also removes connected edges.
|
|
151
|
+
*
|
|
152
|
+
* @param workflow - The current workflow state (before changes)
|
|
153
|
+
* @param description - Description for the combined change
|
|
154
|
+
*/
|
|
155
|
+
startTransaction(workflow, description) {
|
|
156
|
+
if (this.inTransaction) {
|
|
157
|
+
logger.warn('HistoryService: Transaction already in progress, ignoring startTransaction');
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this.inTransaction = true;
|
|
161
|
+
this.transactionSnapshot = this.cloneWorkflow(workflow);
|
|
162
|
+
this.transactionDescription = description ?? null;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Commit the current transaction
|
|
166
|
+
*
|
|
167
|
+
* Pushes the state captured at transaction start to the history stack.
|
|
168
|
+
*/
|
|
169
|
+
commitTransaction() {
|
|
170
|
+
if (!this.inTransaction || !this.transactionSnapshot) {
|
|
171
|
+
logger.warn('HistoryService: No transaction in progress, ignoring commitTransaction');
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
// Push the snapshot captured at transaction start
|
|
175
|
+
this.pushInternal(this.transactionSnapshot, this.transactionDescription ?? undefined);
|
|
176
|
+
// Clear transaction state
|
|
177
|
+
this.inTransaction = false;
|
|
178
|
+
this.transactionSnapshot = null;
|
|
179
|
+
this.transactionDescription = null;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Cancel the current transaction without committing
|
|
183
|
+
*
|
|
184
|
+
* Discards the transaction without adding to history.
|
|
185
|
+
*/
|
|
186
|
+
cancelTransaction() {
|
|
187
|
+
this.inTransaction = false;
|
|
188
|
+
this.transactionSnapshot = null;
|
|
189
|
+
this.transactionDescription = null;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Clear all history
|
|
193
|
+
*
|
|
194
|
+
* Resets the history stack. Optionally keeps the current state as initial.
|
|
195
|
+
*
|
|
196
|
+
* @param currentWorkflow - If provided, keeps this as the initial state
|
|
197
|
+
*/
|
|
198
|
+
clear(currentWorkflow) {
|
|
199
|
+
this.undoStack = [];
|
|
200
|
+
this.redoStack = [];
|
|
201
|
+
this.inTransaction = false;
|
|
202
|
+
this.transactionSnapshot = null;
|
|
203
|
+
this.transactionDescription = null;
|
|
204
|
+
if (currentWorkflow) {
|
|
205
|
+
this.undoStack.push({
|
|
206
|
+
snapshot: this.cloneWorkflow(currentWorkflow),
|
|
207
|
+
timestamp: Date.now(),
|
|
208
|
+
description: 'Initial state'
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
this.notifyChange();
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Get the current history state
|
|
215
|
+
*
|
|
216
|
+
* @returns The current state of the history service
|
|
217
|
+
*/
|
|
218
|
+
getState() {
|
|
219
|
+
return {
|
|
220
|
+
canUndo: this.undoStack.length > 1,
|
|
221
|
+
canRedo: this.redoStack.length > 0,
|
|
222
|
+
currentIndex: this.undoStack.length - 1,
|
|
223
|
+
historyLength: this.undoStack.length + this.redoStack.length,
|
|
224
|
+
isInTransaction: this.inTransaction
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Check if undo is available
|
|
229
|
+
*/
|
|
230
|
+
canUndo() {
|
|
231
|
+
return this.undoStack.length > 1;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Check if redo is available
|
|
235
|
+
*/
|
|
236
|
+
canRedo() {
|
|
237
|
+
return this.redoStack.length > 0;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Subscribe to history state changes
|
|
241
|
+
*
|
|
242
|
+
* @param callback - Function to call when history state changes
|
|
243
|
+
* @returns Unsubscribe function
|
|
244
|
+
*/
|
|
245
|
+
subscribe(callback) {
|
|
246
|
+
this.changeCallbacks.add(callback);
|
|
247
|
+
// Immediately notify with current state
|
|
248
|
+
callback(this.getState());
|
|
249
|
+
return () => {
|
|
250
|
+
this.changeCallbacks.delete(callback);
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Update the maximum number of history entries
|
|
255
|
+
*
|
|
256
|
+
* @param maxEntries - New maximum number of entries
|
|
257
|
+
*/
|
|
258
|
+
setMaxEntries(maxEntries) {
|
|
259
|
+
this.maxEntries = maxEntries;
|
|
260
|
+
this.trimHistory();
|
|
261
|
+
}
|
|
262
|
+
// =========================================================================
|
|
263
|
+
// Private Methods
|
|
264
|
+
// =========================================================================
|
|
265
|
+
/**
|
|
266
|
+
* Internal method to push a state to history
|
|
267
|
+
*/
|
|
268
|
+
pushInternal(workflow, description) {
|
|
269
|
+
// Clear redo stack when making new changes
|
|
270
|
+
this.redoStack = [];
|
|
271
|
+
// Add new entry
|
|
272
|
+
this.undoStack.push({
|
|
273
|
+
snapshot: this.cloneWorkflow(workflow),
|
|
274
|
+
timestamp: Date.now(),
|
|
275
|
+
description
|
|
276
|
+
});
|
|
277
|
+
// Trim history if over limit
|
|
278
|
+
this.trimHistory();
|
|
279
|
+
this.notifyChange();
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Trim history to stay within maxEntries limit.
|
|
283
|
+
* A maxEntries of 0 means unlimited (no trimming).
|
|
284
|
+
*/
|
|
285
|
+
trimHistory() {
|
|
286
|
+
if (this.maxEntries <= 0)
|
|
287
|
+
return;
|
|
288
|
+
while (this.undoStack.length > this.maxEntries) {
|
|
289
|
+
this.undoStack.shift();
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Create a deep clone of a workflow
|
|
294
|
+
*
|
|
295
|
+
* Uses JSON parse/stringify to properly strip non-serializable values
|
|
296
|
+
* like functions (e.g., onConfigOpen callbacks) that are added to nodes
|
|
297
|
+
* at runtime but shouldn't be persisted in history.
|
|
298
|
+
*/
|
|
299
|
+
cloneWorkflow(workflow) {
|
|
300
|
+
// Always use JSON parse/stringify to strip functions and other non-serializable values
|
|
301
|
+
// structuredClone would fail on workflows containing callback functions
|
|
302
|
+
return JSON.parse(JSON.stringify(workflow));
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Notify all subscribers of state changes
|
|
306
|
+
*/
|
|
307
|
+
notifyChange() {
|
|
308
|
+
const state = this.getState();
|
|
309
|
+
this.changeCallbacks.forEach((callback) => callback(state));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
// =========================================================================
|
|
313
|
+
// Singleton Instance
|
|
314
|
+
// =========================================================================
|
|
315
|
+
/**
|
|
316
|
+
* Singleton instance of the history service
|
|
317
|
+
*
|
|
318
|
+
* Use this for the main workflow editor. For isolated instances,
|
|
319
|
+
* create a new HistoryService directly.
|
|
320
|
+
*/
|
|
321
|
+
export const historyService = new HistoryService();
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interrupt Service
|
|
3
|
+
*
|
|
4
|
+
* Handles API interactions for Human-in-the-Loop (HITL) interrupts,
|
|
5
|
+
* including fetching interrupt details, resolving interrupts with user
|
|
6
|
+
* responses, and optional dedicated polling for interrupt status.
|
|
7
|
+
*
|
|
8
|
+
* @module services/interruptService
|
|
9
|
+
*/
|
|
10
|
+
import type { Interrupt, InterruptPollingConfig } from '../types/interrupt.js';
|
|
11
|
+
/**
|
|
12
|
+
* Interrupt Service class
|
|
13
|
+
*
|
|
14
|
+
* Provides methods to interact with interrupt API endpoints including
|
|
15
|
+
* fetching, resolving, cancelling, and listing interrupts.
|
|
16
|
+
* Supports optional dedicated polling for interrupt status.
|
|
17
|
+
*/
|
|
18
|
+
export declare class InterruptService {
|
|
19
|
+
private static instance;
|
|
20
|
+
private pollingInterval;
|
|
21
|
+
private pollingSessionId;
|
|
22
|
+
private currentBackoff;
|
|
23
|
+
private pollingConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Private constructor for singleton pattern
|
|
26
|
+
*/
|
|
27
|
+
private constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Get the singleton instance of InterruptService
|
|
30
|
+
*
|
|
31
|
+
* @returns The InterruptService singleton instance
|
|
32
|
+
*/
|
|
33
|
+
static getInstance(): InterruptService;
|
|
34
|
+
/**
|
|
35
|
+
* Configure interrupt polling settings
|
|
36
|
+
*
|
|
37
|
+
* @param config - Polling configuration options
|
|
38
|
+
*/
|
|
39
|
+
setPollingConfig(config: Partial<InterruptPollingConfig>): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get the current polling configuration
|
|
42
|
+
*
|
|
43
|
+
* @returns Current polling configuration
|
|
44
|
+
*/
|
|
45
|
+
getPollingConfig(): InterruptPollingConfig;
|
|
46
|
+
/**
|
|
47
|
+
* Check if interrupt endpoints are configured
|
|
48
|
+
*
|
|
49
|
+
* @returns True if interrupt endpoints are available
|
|
50
|
+
*/
|
|
51
|
+
isConfigured(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Get the endpoint configuration
|
|
54
|
+
*
|
|
55
|
+
* @throws Error if endpoint configuration is not set
|
|
56
|
+
* @returns The endpoint configuration
|
|
57
|
+
*/
|
|
58
|
+
private getConfig;
|
|
59
|
+
/**
|
|
60
|
+
* Generic API request helper
|
|
61
|
+
*
|
|
62
|
+
* @param url - The URL to fetch
|
|
63
|
+
* @param options - Fetch options
|
|
64
|
+
* @returns The parsed JSON response
|
|
65
|
+
*/
|
|
66
|
+
private request;
|
|
67
|
+
/**
|
|
68
|
+
* Get interrupt details by ID
|
|
69
|
+
*
|
|
70
|
+
* @param interruptId - The interrupt UUID
|
|
71
|
+
* @returns The interrupt details
|
|
72
|
+
*/
|
|
73
|
+
getInterrupt(interruptId: string): Promise<Interrupt>;
|
|
74
|
+
/**
|
|
75
|
+
* Resolve an interrupt with user response
|
|
76
|
+
*
|
|
77
|
+
* @param interruptId - The interrupt UUID
|
|
78
|
+
* @param value - The user's response value
|
|
79
|
+
* @returns The updated interrupt
|
|
80
|
+
*/
|
|
81
|
+
resolveInterrupt(interruptId: string, value: unknown): Promise<Interrupt>;
|
|
82
|
+
/**
|
|
83
|
+
* Cancel a pending interrupt
|
|
84
|
+
*
|
|
85
|
+
* @param interruptId - The interrupt UUID
|
|
86
|
+
* @returns The updated interrupt
|
|
87
|
+
*/
|
|
88
|
+
cancelInterrupt(interruptId: string): Promise<Interrupt>;
|
|
89
|
+
/**
|
|
90
|
+
* List interrupts for a playground session
|
|
91
|
+
*
|
|
92
|
+
* @param sessionId - The session UUID
|
|
93
|
+
* @returns Array of interrupts for the session
|
|
94
|
+
*/
|
|
95
|
+
listSessionInterrupts(sessionId: string): Promise<Interrupt[]>;
|
|
96
|
+
/**
|
|
97
|
+
* List interrupts for a pipeline
|
|
98
|
+
*
|
|
99
|
+
* @param pipelineId - The pipeline UUID
|
|
100
|
+
* @returns Array of interrupts for the pipeline
|
|
101
|
+
*/
|
|
102
|
+
listPipelineInterrupts(pipelineId: string): Promise<Interrupt[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Start polling for interrupts in a session
|
|
105
|
+
*
|
|
106
|
+
* This is optional - interrupts are typically detected via message metadata.
|
|
107
|
+
* Use this for scenarios where dedicated polling is preferred.
|
|
108
|
+
*
|
|
109
|
+
* @param sessionId - The session UUID to poll
|
|
110
|
+
* @param callback - Callback function to handle new interrupts
|
|
111
|
+
*/
|
|
112
|
+
startPolling(sessionId: string, callback: (interrupts: Interrupt[]) => void): void;
|
|
113
|
+
/**
|
|
114
|
+
* Stop polling for interrupts
|
|
115
|
+
*/
|
|
116
|
+
stopPolling(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Check if polling is active
|
|
119
|
+
*
|
|
120
|
+
* @returns True if polling is active
|
|
121
|
+
*/
|
|
122
|
+
isPolling(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Get the current polling session ID
|
|
125
|
+
*
|
|
126
|
+
* @returns The session ID being polled, or null
|
|
127
|
+
*/
|
|
128
|
+
getPollingSessionId(): string | null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Export singleton instance
|
|
132
|
+
*/
|
|
133
|
+
export declare const interruptService: InterruptService;
|