@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,1234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for the Workflow Library
|
|
3
|
+
*/
|
|
4
|
+
import type { Node, Edge, XYPosition } from '@xyflow/svelte';
|
|
5
|
+
import { ConnectionLineType } from '@xyflow/svelte';
|
|
6
|
+
import type { EndpointConfig } from '../config/endpoints.js';
|
|
7
|
+
/**
|
|
8
|
+
* Built-in node categories that ship with FlowDrop.
|
|
9
|
+
* These categories have predefined icons, colors, and display names.
|
|
10
|
+
*/
|
|
11
|
+
export type BuiltinNodeCategory = 'triggers' | 'inputs' | 'outputs' | 'prompts' | 'models' | 'processing' | 'logic' | 'data' | 'tools' | 'helpers' | 'vector stores' | 'embeddings' | 'memories' | 'agents' | 'ai' | 'interrupts' | 'bundles';
|
|
12
|
+
/**
|
|
13
|
+
* Node category for organizing nodes in the sidebar.
|
|
14
|
+
* Includes all built-in categories plus any custom string.
|
|
15
|
+
* Custom categories can be defined via the `/categories` API endpoint.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // Built-in category
|
|
20
|
+
* const cat: NodeCategory = 'triggers';
|
|
21
|
+
*
|
|
22
|
+
* // Custom category
|
|
23
|
+
* const custom: NodeCategory = 'my-custom-category';
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export type NodeCategory = BuiltinNodeCategory | (string & Record<never, never>);
|
|
27
|
+
/**
|
|
28
|
+
* Built-in workflow format identifiers that ship with FlowDrop.
|
|
29
|
+
*/
|
|
30
|
+
export type BuiltinWorkflowFormat = 'flowdrop' | 'agentspec';
|
|
31
|
+
/**
|
|
32
|
+
* Workflow format identifier.
|
|
33
|
+
* Determines sidebar node filtering and export behavior.
|
|
34
|
+
* Includes built-in formats plus any custom string for third-party adapters.
|
|
35
|
+
*/
|
|
36
|
+
export type WorkflowFormat = BuiltinWorkflowFormat | (string & Record<never, never>);
|
|
37
|
+
/**
|
|
38
|
+
* Default workflow format used when none is specified.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DEFAULT_WORKFLOW_FORMAT: WorkflowFormat;
|
|
41
|
+
/**
|
|
42
|
+
* Category definition with metadata for display and organization.
|
|
43
|
+
* Fetched from the `/categories` API endpoint or provided as defaults.
|
|
44
|
+
*/
|
|
45
|
+
export interface CategoryDefinition {
|
|
46
|
+
/** Machine name / unique identifier */
|
|
47
|
+
name: string;
|
|
48
|
+
/** Display label shown in UI */
|
|
49
|
+
label: string;
|
|
50
|
+
/** Icon identifier (e.g. 'mdi:brain') */
|
|
51
|
+
icon?: string;
|
|
52
|
+
/** Color token or CSS value (e.g. 'var(--fd-node-purple)') */
|
|
53
|
+
color?: string;
|
|
54
|
+
/** Category description */
|
|
55
|
+
description?: string;
|
|
56
|
+
/** Sort weight for ordering (lower = earlier) */
|
|
57
|
+
weight?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Port data type configuration
|
|
61
|
+
*/
|
|
62
|
+
export interface PortDataTypeConfig {
|
|
63
|
+
/** Unique identifier for the data type */
|
|
64
|
+
id: string;
|
|
65
|
+
/** Display name for the data type */
|
|
66
|
+
name: string;
|
|
67
|
+
/** Description of the data type */
|
|
68
|
+
description?: string;
|
|
69
|
+
/** Color for the data type (CSS color value) */
|
|
70
|
+
color: string;
|
|
71
|
+
/** Category grouping for the data type */
|
|
72
|
+
category?: string;
|
|
73
|
+
/** Alternative names/aliases for this data type */
|
|
74
|
+
aliases?: string[];
|
|
75
|
+
/** Whether this data type is enabled */
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Port compatibility rule configuration
|
|
80
|
+
* Simple rule: sourceType can connect TO targetType
|
|
81
|
+
*/
|
|
82
|
+
export interface PortCompatibilityRule {
|
|
83
|
+
/** Source data type ID (what you're connecting FROM) */
|
|
84
|
+
from: string;
|
|
85
|
+
/** Target data type ID (what you're connecting TO) */
|
|
86
|
+
to: string;
|
|
87
|
+
/** Optional description of why this connection is allowed */
|
|
88
|
+
description?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Complete port configuration system
|
|
92
|
+
*/
|
|
93
|
+
export interface PortConfig {
|
|
94
|
+
/** Available data types */
|
|
95
|
+
dataTypes: PortDataTypeConfig[];
|
|
96
|
+
/** Compatibility rules between data types */
|
|
97
|
+
compatibilityRules: PortCompatibilityRule[];
|
|
98
|
+
/** Default data type to use when none specified */
|
|
99
|
+
defaultDataType: string;
|
|
100
|
+
/** Version of the port configuration */
|
|
101
|
+
version?: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Node data type - now dynamic based on configuration
|
|
105
|
+
* Will be string literals of available data type IDs
|
|
106
|
+
*/
|
|
107
|
+
export type NodeDataType = string;
|
|
108
|
+
/**
|
|
109
|
+
* Node port configuration
|
|
110
|
+
*/
|
|
111
|
+
export interface NodePort {
|
|
112
|
+
id: string;
|
|
113
|
+
name: string;
|
|
114
|
+
type: 'input' | 'output' | 'metadata';
|
|
115
|
+
dataType: NodeDataType;
|
|
116
|
+
required?: boolean;
|
|
117
|
+
description?: string;
|
|
118
|
+
defaultValue?: unknown;
|
|
119
|
+
/**
|
|
120
|
+
* Optional JSON Schema describing the structure of data on this port.
|
|
121
|
+
* Used for template variable autocomplete to drill into nested properties.
|
|
122
|
+
*/
|
|
123
|
+
schema?: OutputSchema | InputSchema;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Absolute position of a port handle in canvas space.
|
|
127
|
+
* Used by proximity connect and other features that need port positions.
|
|
128
|
+
*/
|
|
129
|
+
export interface PortCoordinate {
|
|
130
|
+
/** Absolute X position in canvas space */
|
|
131
|
+
x: number;
|
|
132
|
+
/** Absolute Y position in canvas space */
|
|
133
|
+
y: number;
|
|
134
|
+
/** Handle ID in format: ${nodeId}-${direction}-${portId} */
|
|
135
|
+
handleId: string;
|
|
136
|
+
/** The node this port belongs to */
|
|
137
|
+
nodeId: string;
|
|
138
|
+
/** Port direction */
|
|
139
|
+
direction: 'input' | 'output';
|
|
140
|
+
/** Port data type for compatibility checks */
|
|
141
|
+
dataType: string;
|
|
142
|
+
}
|
|
143
|
+
/** Map of handle IDs to their absolute canvas coordinates */
|
|
144
|
+
export type PortCoordinateMap = Map<string, PortCoordinate>;
|
|
145
|
+
/**
|
|
146
|
+
* Dynamic port configuration for user-defined inputs/outputs
|
|
147
|
+
* These are defined in the node's config and allow users to create
|
|
148
|
+
* custom input/output handles at runtime similar to gateway branches
|
|
149
|
+
*/
|
|
150
|
+
export interface DynamicPort {
|
|
151
|
+
/** Unique identifier for the port (used for handle IDs and connections) */
|
|
152
|
+
name: string;
|
|
153
|
+
/** Display label shown in the UI */
|
|
154
|
+
label: string;
|
|
155
|
+
/** Description of what this port accepts/provides */
|
|
156
|
+
description?: string;
|
|
157
|
+
/** Data type for the port (affects color and connection validation) */
|
|
158
|
+
dataType: NodeDataType;
|
|
159
|
+
/** Whether this port is required for execution */
|
|
160
|
+
required?: boolean;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Branch configuration for gateway nodes
|
|
164
|
+
*
|
|
165
|
+
* Branches define conditional output paths in gateway/switch nodes.
|
|
166
|
+
* Each branch creates an output handle that can be connected to downstream nodes.
|
|
167
|
+
* Branches are stored in `config.branches` array and support dynamic addition/removal
|
|
168
|
+
* through the node configuration panel.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* const branches: Branch[] = [
|
|
173
|
+
* { name: "high", label: "High Priority", condition: "priority > 8" },
|
|
174
|
+
* { name: "medium", label: "Medium Priority", condition: "priority >= 4" },
|
|
175
|
+
* { name: "default", label: "Default", isDefault: true }
|
|
176
|
+
* ];
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
export interface Branch {
|
|
180
|
+
/** Unique identifier for the branch (used as handle ID and for connections) */
|
|
181
|
+
name: string;
|
|
182
|
+
/** Display label shown in the UI (optional, defaults to name) */
|
|
183
|
+
label?: string;
|
|
184
|
+
/** Description of when this branch is activated */
|
|
185
|
+
description?: string;
|
|
186
|
+
/** Optional value associated with the branch (e.g., for Switch matching) */
|
|
187
|
+
value?: string;
|
|
188
|
+
/** Optional condition expression for this branch */
|
|
189
|
+
condition?: string;
|
|
190
|
+
/** Whether this is the default/fallback branch */
|
|
191
|
+
isDefault?: boolean;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Convert a DynamicPort to a NodePort
|
|
195
|
+
* @param port - The dynamic port configuration
|
|
196
|
+
* @param portType - Whether this is an input or output port
|
|
197
|
+
* @returns A NodePort compatible with the rendering system
|
|
198
|
+
*/
|
|
199
|
+
export declare function dynamicPortToNodePort(port: DynamicPort, portType: 'input' | 'output'): NodePort;
|
|
200
|
+
/**
|
|
201
|
+
* Built-in node types for explicit component rendering.
|
|
202
|
+
* These are the node types that ship with FlowDrop.
|
|
203
|
+
*/
|
|
204
|
+
export type BuiltinNodeType = 'note' | 'simple' | 'square' | 'tool' | 'gateway' | 'terminal' | 'default';
|
|
205
|
+
/**
|
|
206
|
+
* Node type for component rendering.
|
|
207
|
+
* Includes built-in types and allows custom registered types.
|
|
208
|
+
*
|
|
209
|
+
* Built-in types: note, simple, square, tool, gateway, terminal, default
|
|
210
|
+
* Custom types: Any string registered via nodeComponentRegistry
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* // Built-in type
|
|
215
|
+
* const type: NodeType = "simple";
|
|
216
|
+
*
|
|
217
|
+
* // Custom registered type
|
|
218
|
+
* const customType: NodeType = "mylib:fancy";
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
export type NodeType = BuiltinNodeType | (string & Record<never, never>);
|
|
222
|
+
/**
|
|
223
|
+
* HTTP method types for dynamic schema endpoints
|
|
224
|
+
*/
|
|
225
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH';
|
|
226
|
+
/**
|
|
227
|
+
* Autocomplete configuration for form fields
|
|
228
|
+
*
|
|
229
|
+
* Defines how autocomplete suggestions are fetched from a callback URL.
|
|
230
|
+
* Supports both "on-type" (debounced search) and "on-focus" (load all options) modes.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* const autocompleteConfig: AutocompleteConfig = {
|
|
235
|
+
* url: "/api/users/search",
|
|
236
|
+
* queryParam: "q",
|
|
237
|
+
* minChars: 2,
|
|
238
|
+
* debounceMs: 300,
|
|
239
|
+
* fetchOnFocus: true,
|
|
240
|
+
* labelField: "name",
|
|
241
|
+
* valueField: "id",
|
|
242
|
+
* allowFreeText: false
|
|
243
|
+
* };
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
export interface AutocompleteConfig {
|
|
247
|
+
/**
|
|
248
|
+
* The callback URL to fetch autocomplete suggestions from.
|
|
249
|
+
* Can be relative (resolved against API base URL) or absolute.
|
|
250
|
+
*/
|
|
251
|
+
url: string;
|
|
252
|
+
/**
|
|
253
|
+
* Query parameter name to pass the search term.
|
|
254
|
+
* @default "q"
|
|
255
|
+
*/
|
|
256
|
+
queryParam?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Minimum number of characters before fetching suggestions.
|
|
259
|
+
* Set to 0 to fetch immediately on focus (when fetchOnFocus is true).
|
|
260
|
+
* @default 0
|
|
261
|
+
*/
|
|
262
|
+
minChars?: number;
|
|
263
|
+
/**
|
|
264
|
+
* Debounce delay in milliseconds before fetching suggestions.
|
|
265
|
+
* Prevents excessive API calls while typing.
|
|
266
|
+
* @default 300
|
|
267
|
+
*/
|
|
268
|
+
debounceMs?: number;
|
|
269
|
+
/**
|
|
270
|
+
* Whether to fetch all options when the field is focused.
|
|
271
|
+
* When true, an empty query is sent on focus to load initial options.
|
|
272
|
+
* @default false
|
|
273
|
+
*/
|
|
274
|
+
fetchOnFocus?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* The field name in the response objects to use as the display label.
|
|
277
|
+
* @default "label"
|
|
278
|
+
*/
|
|
279
|
+
labelField?: string;
|
|
280
|
+
/**
|
|
281
|
+
* The field name in the response objects to use as the stored value.
|
|
282
|
+
* @default "value"
|
|
283
|
+
*/
|
|
284
|
+
valueField?: string;
|
|
285
|
+
/**
|
|
286
|
+
* Whether to allow values that are not in the suggestions list.
|
|
287
|
+
* When true, users can enter and submit any text.
|
|
288
|
+
* When false, only values from suggestions are accepted.
|
|
289
|
+
* @default false
|
|
290
|
+
*/
|
|
291
|
+
allowFreeText?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Whether to allow multiple selections.
|
|
294
|
+
* When true, users can select multiple values displayed as tags.
|
|
295
|
+
* When false, only a single value can be selected.
|
|
296
|
+
* @default false
|
|
297
|
+
*/
|
|
298
|
+
multiple?: boolean;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Dynamic schema endpoint configuration
|
|
302
|
+
* Used when the config schema needs to be fetched at runtime from a REST endpoint
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```typescript
|
|
306
|
+
* const schemaEndpoint: DynamicSchemaEndpoint = {
|
|
307
|
+
* url: "/api/nodes/{nodeTypeId}/schema",
|
|
308
|
+
* method: "GET",
|
|
309
|
+
* headers: { "X-Custom-Header": "value" },
|
|
310
|
+
* parameterMapping: {
|
|
311
|
+
* nodeTypeId: "metadata.id",
|
|
312
|
+
* instanceId: "id"
|
|
313
|
+
* }
|
|
314
|
+
* };
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
export interface DynamicSchemaEndpoint {
|
|
318
|
+
/**
|
|
319
|
+
* The URL to fetch the schema from.
|
|
320
|
+
* Supports template variables in curly braces (e.g., "/api/nodes/{nodeTypeId}/schema")
|
|
321
|
+
* Variables are resolved from node metadata, config, or instance data.
|
|
322
|
+
*/
|
|
323
|
+
url: string;
|
|
324
|
+
/**
|
|
325
|
+
* HTTP method to use for fetching the schema.
|
|
326
|
+
* @default "GET"
|
|
327
|
+
*/
|
|
328
|
+
method?: HttpMethod;
|
|
329
|
+
/**
|
|
330
|
+
* Custom headers to include in the request
|
|
331
|
+
*/
|
|
332
|
+
headers?: Record<string, string>;
|
|
333
|
+
/**
|
|
334
|
+
* Maps template variables to their source paths.
|
|
335
|
+
* Keys are variable names used in the URL, values are dot-notation paths
|
|
336
|
+
* to resolve from the node context (e.g., "metadata.id", "config.apiKey", "id")
|
|
337
|
+
*/
|
|
338
|
+
parameterMapping?: Record<string, string>;
|
|
339
|
+
/**
|
|
340
|
+
* Request body for POST/PUT/PATCH methods.
|
|
341
|
+
* Can include template variables like the URL.
|
|
342
|
+
*/
|
|
343
|
+
body?: Record<string, unknown>;
|
|
344
|
+
/**
|
|
345
|
+
* Timeout in milliseconds for the schema fetch request
|
|
346
|
+
* @default 10000
|
|
347
|
+
*/
|
|
348
|
+
timeout?: number;
|
|
349
|
+
/**
|
|
350
|
+
* Whether to cache the fetched schema per node instance
|
|
351
|
+
* @default true
|
|
352
|
+
*/
|
|
353
|
+
cacheSchema?: boolean;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* External edit link configuration
|
|
357
|
+
* Used when the node configuration should be handled by an external 3rd party form
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* ```typescript
|
|
361
|
+
* const editLink: ExternalEditLink = {
|
|
362
|
+
* url: "https://admin.example.com/nodes/{nodeTypeId}/edit/{instanceId}",
|
|
363
|
+
* label: "Configure in Admin Panel",
|
|
364
|
+
* parameterMapping: {
|
|
365
|
+
* nodeTypeId: "metadata.id",
|
|
366
|
+
* instanceId: "id"
|
|
367
|
+
* },
|
|
368
|
+
* openInNewTab: true
|
|
369
|
+
* };
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
export interface ExternalEditLink {
|
|
373
|
+
/**
|
|
374
|
+
* The URL to the external edit form.
|
|
375
|
+
* Supports template variables in curly braces (e.g., "/admin/nodes/{nodeTypeId}/edit")
|
|
376
|
+
* Variables are resolved from node metadata, config, or instance data.
|
|
377
|
+
*/
|
|
378
|
+
url: string;
|
|
379
|
+
/**
|
|
380
|
+
* Display label for the edit link button
|
|
381
|
+
* @default "Configure Externally"
|
|
382
|
+
*/
|
|
383
|
+
label?: string;
|
|
384
|
+
/**
|
|
385
|
+
* Icon to display alongside the label (Iconify icon name)
|
|
386
|
+
* @default "heroicons:arrow-top-right-on-square"
|
|
387
|
+
*/
|
|
388
|
+
icon?: string;
|
|
389
|
+
/**
|
|
390
|
+
* Maps template variables to their source paths.
|
|
391
|
+
* Keys are variable names used in the URL, values are dot-notation paths
|
|
392
|
+
* to resolve from the node context (e.g., "metadata.id", "config.apiKey", "id")
|
|
393
|
+
*/
|
|
394
|
+
parameterMapping?: Record<string, string>;
|
|
395
|
+
/**
|
|
396
|
+
* Whether to open the link in a new tab
|
|
397
|
+
* @default true
|
|
398
|
+
*/
|
|
399
|
+
openInNewTab?: boolean;
|
|
400
|
+
/**
|
|
401
|
+
* Optional tooltip/description for the link
|
|
402
|
+
*/
|
|
403
|
+
description?: string;
|
|
404
|
+
/**
|
|
405
|
+
* Callback URL parameter name for FlowDrop to receive updates
|
|
406
|
+
* If set, the external form should redirect back with config updates
|
|
407
|
+
*/
|
|
408
|
+
callbackUrlParam?: string;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Admin/Edit configuration for nodes with dynamic or external configuration
|
|
412
|
+
* Used when the config schema cannot be determined at workflow load time
|
|
413
|
+
* or when configuration is handled by a 3rd party system.
|
|
414
|
+
*
|
|
415
|
+
* @example
|
|
416
|
+
* ```typescript
|
|
417
|
+
* // Option 1: External edit link only (opens external form in new tab)
|
|
418
|
+
* const configEdit: ConfigEditOptions = {
|
|
419
|
+
* externalEditLink: {
|
|
420
|
+
* url: "https://admin.example.com/configure/{nodeId}",
|
|
421
|
+
* label: "Open Configuration Portal"
|
|
422
|
+
* }
|
|
423
|
+
* };
|
|
424
|
+
*
|
|
425
|
+
* // Option 2: Dynamic schema (fetches schema from REST endpoint)
|
|
426
|
+
* const configEdit: ConfigEditOptions = {
|
|
427
|
+
* dynamicSchema: {
|
|
428
|
+
* url: "/api/nodes/{nodeTypeId}/schema",
|
|
429
|
+
* method: "GET"
|
|
430
|
+
* }
|
|
431
|
+
* };
|
|
432
|
+
*
|
|
433
|
+
* // Option 3: Both (user can choose)
|
|
434
|
+
* const configEdit: ConfigEditOptions = {
|
|
435
|
+
* externalEditLink: {
|
|
436
|
+
* url: "https://admin.example.com/configure/{nodeId}",
|
|
437
|
+
* label: "Advanced Configuration"
|
|
438
|
+
* },
|
|
439
|
+
* dynamicSchema: {
|
|
440
|
+
* url: "/api/nodes/{nodeTypeId}/schema"
|
|
441
|
+
* },
|
|
442
|
+
* preferDynamicSchema: true
|
|
443
|
+
* };
|
|
444
|
+
* ```
|
|
445
|
+
*/
|
|
446
|
+
export interface ConfigEditOptions {
|
|
447
|
+
/**
|
|
448
|
+
* External link configuration for 3rd party form
|
|
449
|
+
* When configured, shows a link/button to open external configuration
|
|
450
|
+
*/
|
|
451
|
+
externalEditLink?: ExternalEditLink;
|
|
452
|
+
/**
|
|
453
|
+
* Dynamic schema endpoint configuration
|
|
454
|
+
* When configured, fetches the config schema from the specified endpoint
|
|
455
|
+
*/
|
|
456
|
+
dynamicSchema?: DynamicSchemaEndpoint;
|
|
457
|
+
/**
|
|
458
|
+
* When both externalEditLink and dynamicSchema are configured,
|
|
459
|
+
* determines which to use by default
|
|
460
|
+
* @default false (prefer external link)
|
|
461
|
+
*/
|
|
462
|
+
preferDynamicSchema?: boolean;
|
|
463
|
+
/**
|
|
464
|
+
* Show a "Refresh Schema" button when using dynamic schema
|
|
465
|
+
* Allows users to manually refresh the schema
|
|
466
|
+
* @default true
|
|
467
|
+
*/
|
|
468
|
+
showRefreshButton?: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* Message to display when schema is being loaded
|
|
471
|
+
* @default "Loading configuration options..."
|
|
472
|
+
*/
|
|
473
|
+
loadingMessage?: string;
|
|
474
|
+
/**
|
|
475
|
+
* Message to display when schema fetch fails
|
|
476
|
+
* @default "Failed to load configuration. Use external editor instead."
|
|
477
|
+
*/
|
|
478
|
+
errorMessage?: string;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* UI-related extension settings for nodes
|
|
482
|
+
* Used to control visual behavior in the workflow editor
|
|
483
|
+
*/
|
|
484
|
+
export interface NodeUIExtensions {
|
|
485
|
+
/** Show/hide unconnected handles (ports) to reduce visual noise */
|
|
486
|
+
hideUnconnectedHandles?: boolean;
|
|
487
|
+
/** Custom styles or theme overrides */
|
|
488
|
+
style?: Record<string, unknown>;
|
|
489
|
+
/** Any other UI-specific settings */
|
|
490
|
+
[key: string]: unknown;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Custom extension properties for 3rd party integrations
|
|
494
|
+
* Allows storing additional configuration and UI state data
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* ```typescript
|
|
498
|
+
* const extensions: NodeExtensions = {
|
|
499
|
+
* ui: {
|
|
500
|
+
* hideUnconnectedHandles: true,
|
|
501
|
+
* style: { opacity: 0.8 }
|
|
502
|
+
* },
|
|
503
|
+
* "myapp:analytics": {
|
|
504
|
+
* trackUsage: true,
|
|
505
|
+
* customField: "value"
|
|
506
|
+
* }
|
|
507
|
+
* };
|
|
508
|
+
* ```
|
|
509
|
+
*/
|
|
510
|
+
export interface NodeExtensions {
|
|
511
|
+
/**
|
|
512
|
+
* UI-related settings for the node
|
|
513
|
+
* Used to control visual behavior in the workflow editor
|
|
514
|
+
*/
|
|
515
|
+
ui?: NodeUIExtensions;
|
|
516
|
+
/**
|
|
517
|
+
* Per-instance admin/edit configuration override
|
|
518
|
+
* Allows overriding the node type's configEdit settings for specific instances
|
|
519
|
+
*/
|
|
520
|
+
configEdit?: ConfigEditOptions;
|
|
521
|
+
/**
|
|
522
|
+
* Namespaced extension data from 3rd party integrations
|
|
523
|
+
* Use your package/organization name as the key (e.g., "myapp", "acme:analyzer")
|
|
524
|
+
*/
|
|
525
|
+
[namespace: string]: unknown;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Node configuration metadata
|
|
529
|
+
*/
|
|
530
|
+
export interface NodeMetadata {
|
|
531
|
+
id: string;
|
|
532
|
+
name: string;
|
|
533
|
+
type?: NodeType;
|
|
534
|
+
/**
|
|
535
|
+
* Array of supported node types that this node can be rendered as.
|
|
536
|
+
* If not specified, defaults to the single 'type' field or 'default'.
|
|
537
|
+
* This allows nodes to support multiple rendering modes (e.g., both 'simple' and 'default').
|
|
538
|
+
* Can include both built-in types and custom registered types.
|
|
539
|
+
*/
|
|
540
|
+
supportedTypes?: NodeType[];
|
|
541
|
+
description: string;
|
|
542
|
+
category: NodeCategory;
|
|
543
|
+
version: string;
|
|
544
|
+
icon?: string;
|
|
545
|
+
color?: string;
|
|
546
|
+
/** Badge label displayed in the node header (e.g., "TOOL", "API", "LLM"). Overridable per-instance via config.instanceBadge. */
|
|
547
|
+
badge?: string;
|
|
548
|
+
/** Port dataType to expose on tool nodes. Defaults to 'tool'. Set to another type (e.g., 'trigger') to show that port instead. */
|
|
549
|
+
portDataType?: string;
|
|
550
|
+
inputs: NodePort[];
|
|
551
|
+
outputs: NodePort[];
|
|
552
|
+
configSchema?: ConfigSchema;
|
|
553
|
+
/**
|
|
554
|
+
* Optional UI Schema that controls how configSchema fields are
|
|
555
|
+
* arranged, grouped, and displayed in the configuration form.
|
|
556
|
+
*
|
|
557
|
+
* When not provided, fields render in flat order (backward compatible).
|
|
558
|
+
* Uses JSON Forms-inspired format with VerticalLayout, Group, and Control elements.
|
|
559
|
+
*
|
|
560
|
+
* @see UISchemaElement for the element type definitions
|
|
561
|
+
* @see https://jsonforms.io/docs/uischema
|
|
562
|
+
*/
|
|
563
|
+
uiSchema?: import('./uischema.js').UISchemaElement;
|
|
564
|
+
/** Default configuration values for this node type */
|
|
565
|
+
config?: Record<string, unknown>;
|
|
566
|
+
tags?: string[];
|
|
567
|
+
/** Workflow formats this node is compatible with. Omit = universal (all formats). */
|
|
568
|
+
formats?: WorkflowFormat[];
|
|
569
|
+
/**
|
|
570
|
+
* Admin/Edit configuration for nodes with dynamic or external configuration.
|
|
571
|
+
* Used when the config schema cannot be determined at workflow load time
|
|
572
|
+
* or when configuration is handled by a 3rd party system.
|
|
573
|
+
*
|
|
574
|
+
* Supports two options:
|
|
575
|
+
* 1. External edit link - Opens a 3rd party form in a new tab
|
|
576
|
+
* 2. Dynamic schema - Fetches the config schema from a REST endpoint
|
|
577
|
+
*
|
|
578
|
+
* @example
|
|
579
|
+
* ```typescript
|
|
580
|
+
* configEdit: {
|
|
581
|
+
* externalEditLink: {
|
|
582
|
+
* url: "https://admin.example.com/nodes/{nodeTypeId}/configure",
|
|
583
|
+
* label: "Configure in Admin Portal"
|
|
584
|
+
* },
|
|
585
|
+
* dynamicSchema: {
|
|
586
|
+
* url: "/api/nodes/{nodeTypeId}/schema",
|
|
587
|
+
* method: "GET"
|
|
588
|
+
* }
|
|
589
|
+
* }
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
592
|
+
configEdit?: ConfigEditOptions;
|
|
593
|
+
/**
|
|
594
|
+
* Custom extension properties for 3rd party integrations
|
|
595
|
+
* Allows storing additional configuration and UI state data at the node type level
|
|
596
|
+
*/
|
|
597
|
+
extensions?: NodeExtensions;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Common base interface for all schema properties
|
|
601
|
+
*/
|
|
602
|
+
export interface BaseProperty {
|
|
603
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer' | 'mixed' | 'float';
|
|
604
|
+
description?: string;
|
|
605
|
+
title?: string;
|
|
606
|
+
default?: unknown;
|
|
607
|
+
enum?: unknown[];
|
|
608
|
+
minimum?: number;
|
|
609
|
+
maximum?: number;
|
|
610
|
+
minLength?: number;
|
|
611
|
+
maxLength?: number;
|
|
612
|
+
pattern?: string;
|
|
613
|
+
format?: string;
|
|
614
|
+
items?: BaseProperty;
|
|
615
|
+
properties?: Record<string, BaseProperty>;
|
|
616
|
+
[key: string]: unknown;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Common base interface for all schemas
|
|
620
|
+
*/
|
|
621
|
+
export interface BaseSchema {
|
|
622
|
+
type: 'object';
|
|
623
|
+
properties: Record<string, BaseProperty>;
|
|
624
|
+
required?: string[];
|
|
625
|
+
additionalProperties?: boolean;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Configuration schema property with specific attributes
|
|
629
|
+
*/
|
|
630
|
+
export interface ConfigProperty extends BaseProperty {
|
|
631
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer';
|
|
632
|
+
title?: string;
|
|
633
|
+
description?: string;
|
|
634
|
+
default?: unknown;
|
|
635
|
+
enum?: unknown[];
|
|
636
|
+
multiple?: boolean;
|
|
637
|
+
minimum?: number;
|
|
638
|
+
maximum?: number;
|
|
639
|
+
minLength?: number;
|
|
640
|
+
maxLength?: number;
|
|
641
|
+
pattern?: string;
|
|
642
|
+
format?: 'multiline' | 'hidden' | string;
|
|
643
|
+
items?: ConfigProperty;
|
|
644
|
+
properties?: Record<string, ConfigProperty>;
|
|
645
|
+
[key: string]: unknown;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Configuration schema interface
|
|
649
|
+
*/
|
|
650
|
+
export interface ConfigSchema extends BaseSchema {
|
|
651
|
+
properties: Record<string, ConfigProperty>;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Input schema property with specific attributes
|
|
655
|
+
*/
|
|
656
|
+
export interface InputProperty extends BaseProperty {
|
|
657
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer' | 'mixed';
|
|
658
|
+
title?: string;
|
|
659
|
+
description?: string;
|
|
660
|
+
required?: boolean;
|
|
661
|
+
default?: unknown;
|
|
662
|
+
enum?: unknown[];
|
|
663
|
+
minimum?: number;
|
|
664
|
+
maximum?: number;
|
|
665
|
+
minLength?: number;
|
|
666
|
+
maxLength?: number;
|
|
667
|
+
pattern?: string;
|
|
668
|
+
format?: 'multiline' | string;
|
|
669
|
+
items?: InputProperty;
|
|
670
|
+
properties?: Record<string, InputProperty>;
|
|
671
|
+
[key: string]: unknown;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Input schema interface
|
|
675
|
+
*/
|
|
676
|
+
export interface InputSchema extends BaseSchema {
|
|
677
|
+
properties: Record<string, InputProperty>;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Output schema property with specific attributes
|
|
681
|
+
*/
|
|
682
|
+
export interface OutputProperty extends BaseProperty {
|
|
683
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer' | 'mixed' | 'float';
|
|
684
|
+
description: string;
|
|
685
|
+
title?: string;
|
|
686
|
+
default?: unknown;
|
|
687
|
+
enum?: unknown[];
|
|
688
|
+
minimum?: number;
|
|
689
|
+
maximum?: number;
|
|
690
|
+
minLength?: number;
|
|
691
|
+
maxLength?: number;
|
|
692
|
+
pattern?: string;
|
|
693
|
+
format?: string;
|
|
694
|
+
items?: OutputProperty;
|
|
695
|
+
properties?: Record<string, OutputProperty>;
|
|
696
|
+
[key: string]: unknown;
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Output schema interface
|
|
700
|
+
*/
|
|
701
|
+
export interface OutputSchema extends BaseSchema {
|
|
702
|
+
properties: Record<string, OutputProperty>;
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Primitive types for template variables
|
|
706
|
+
*/
|
|
707
|
+
export type TemplateVariableType = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'integer' | 'mixed' | 'float';
|
|
708
|
+
/**
|
|
709
|
+
* Represents a variable available for template interpolation.
|
|
710
|
+
* Used by the template editor for autocomplete suggestions.
|
|
711
|
+
*
|
|
712
|
+
* Supports hierarchical drilling:
|
|
713
|
+
* - Objects have `properties` for dot notation (e.g., `user.name`)
|
|
714
|
+
* - Arrays have `items` for index access (e.g., `items[0].name`)
|
|
715
|
+
*
|
|
716
|
+
* @example
|
|
717
|
+
* ```typescript
|
|
718
|
+
* const userVariable: TemplateVariable = {
|
|
719
|
+
* name: "user",
|
|
720
|
+
* label: "User Data",
|
|
721
|
+
* type: "object",
|
|
722
|
+
* properties: {
|
|
723
|
+
* name: { name: "name", type: "string", label: "User Name" },
|
|
724
|
+
* email: { name: "email", type: "string", label: "Email Address" },
|
|
725
|
+
* address: {
|
|
726
|
+
* name: "address",
|
|
727
|
+
* type: "object",
|
|
728
|
+
* label: "Address",
|
|
729
|
+
* properties: {
|
|
730
|
+
* city: { name: "city", type: "string", label: "City" },
|
|
731
|
+
* country: { name: "country", type: "string", label: "Country" }
|
|
732
|
+
* }
|
|
733
|
+
* }
|
|
734
|
+
* }
|
|
735
|
+
* };
|
|
736
|
+
* ```
|
|
737
|
+
*/
|
|
738
|
+
export interface TemplateVariable {
|
|
739
|
+
/** Variable name (used in template as {{ name }}) */
|
|
740
|
+
name: string;
|
|
741
|
+
/** Display label for the variable in autocomplete dropdown */
|
|
742
|
+
label?: string;
|
|
743
|
+
/** Description shown in autocomplete tooltip */
|
|
744
|
+
description?: string;
|
|
745
|
+
/** Data type of the variable */
|
|
746
|
+
type: TemplateVariableType;
|
|
747
|
+
/** For objects: child properties accessible via dot notation */
|
|
748
|
+
properties?: Record<string, TemplateVariable>;
|
|
749
|
+
/** For arrays: schema of array items accessible via index notation */
|
|
750
|
+
items?: TemplateVariable;
|
|
751
|
+
/** Source port ID this variable comes from */
|
|
752
|
+
sourcePort?: string;
|
|
753
|
+
/** Source node ID */
|
|
754
|
+
sourceNode?: string;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Schema passed to template editor for autocomplete functionality.
|
|
758
|
+
* Contains all available variables derived from connected upstream nodes.
|
|
759
|
+
*
|
|
760
|
+
* @example
|
|
761
|
+
* ```typescript
|
|
762
|
+
* const variableSchema: VariableSchema = {
|
|
763
|
+
* variables: {
|
|
764
|
+
* user: { name: "user", type: "object", properties: { ... } },
|
|
765
|
+
* items: { name: "items", type: "array", items: { ... } },
|
|
766
|
+
* config: { name: "config", type: "object", properties: { ... } }
|
|
767
|
+
* }
|
|
768
|
+
* };
|
|
769
|
+
* ```
|
|
770
|
+
*/
|
|
771
|
+
export interface VariableSchema {
|
|
772
|
+
/** Map of available variables keyed by variable name */
|
|
773
|
+
variables: Record<string, TemplateVariable>;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Configuration for template variable autocomplete.
|
|
777
|
+
* Used in template fields to control which variables are available
|
|
778
|
+
* and how they are derived.
|
|
779
|
+
*
|
|
780
|
+
* Supports three modes:
|
|
781
|
+
* 1. **Schema-only** (existing): Variables from static schema and/or upstream ports
|
|
782
|
+
* 2. **API-only** (new): Variables fetched from backend endpoint
|
|
783
|
+
* 3. **Hybrid** (new): Merge API variables with static schema/ports
|
|
784
|
+
*
|
|
785
|
+
* @example
|
|
786
|
+
* ```json
|
|
787
|
+
* {
|
|
788
|
+
* "type": "string",
|
|
789
|
+
* "format": "template",
|
|
790
|
+
* "variables": {
|
|
791
|
+
* "ports": ["data", "context"],
|
|
792
|
+
* "includePortName": true
|
|
793
|
+
* }
|
|
794
|
+
* }
|
|
795
|
+
* ```
|
|
796
|
+
*
|
|
797
|
+
* @example API Mode
|
|
798
|
+
* ```json
|
|
799
|
+
* {
|
|
800
|
+
* "type": "string",
|
|
801
|
+
* "format": "template",
|
|
802
|
+
* "variables": {
|
|
803
|
+
* "api": {
|
|
804
|
+
* "endpoint": {
|
|
805
|
+
* "url": "/api/variables/{workflowId}/{nodeId}"
|
|
806
|
+
* }
|
|
807
|
+
* }
|
|
808
|
+
* }
|
|
809
|
+
* }
|
|
810
|
+
* ```
|
|
811
|
+
*/
|
|
812
|
+
export interface TemplateVariablesConfig {
|
|
813
|
+
/**
|
|
814
|
+
* Specifies which input port IDs should provide variables for autocomplete.
|
|
815
|
+
* Only connections to these ports will provide variables.
|
|
816
|
+
*
|
|
817
|
+
* - If not specified, all input ports with connections are used.
|
|
818
|
+
* - If specified as an empty array, no variables will be derived from ports.
|
|
819
|
+
*/
|
|
820
|
+
ports?: string[];
|
|
821
|
+
/**
|
|
822
|
+
* Pre-defined variable schema to use instead of (or in addition to) deriving from ports.
|
|
823
|
+
* Useful for providing static variables or overriding derived ones.
|
|
824
|
+
*/
|
|
825
|
+
schema?: VariableSchema;
|
|
826
|
+
/**
|
|
827
|
+
* Whether to include the port name as a prefix for variables.
|
|
828
|
+
* When true, variables are named like `data.user` instead of just `user`.
|
|
829
|
+
* Useful when multiple ports might have overlapping variable names.
|
|
830
|
+
* @default false
|
|
831
|
+
*/
|
|
832
|
+
includePortName?: boolean;
|
|
833
|
+
/**
|
|
834
|
+
* Whether to show available variables as clickable hints below the editor.
|
|
835
|
+
* @default true
|
|
836
|
+
*/
|
|
837
|
+
showHints?: boolean;
|
|
838
|
+
/**
|
|
839
|
+
* API mode configuration for fetching variables from backend endpoint.
|
|
840
|
+
* When configured, variables will be fetched from the specified endpoint
|
|
841
|
+
* and can be merged with static schema and/or port-derived variables.
|
|
842
|
+
*/
|
|
843
|
+
api?: ApiVariablesConfig;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Configuration for API-based variable fetching.
|
|
847
|
+
* Enables dynamic variable suggestions from backend endpoints.
|
|
848
|
+
*
|
|
849
|
+
* @example
|
|
850
|
+
* ```typescript
|
|
851
|
+
* const apiConfig: ApiVariablesConfig = {
|
|
852
|
+
* endpoint: {
|
|
853
|
+
* url: "/api/variables/{workflowId}/{nodeId}",
|
|
854
|
+
* method: "GET"
|
|
855
|
+
* },
|
|
856
|
+
* cacheTtl: 300000,
|
|
857
|
+
* mergeWithSchema: true,
|
|
858
|
+
* fallbackOnError: true
|
|
859
|
+
* };
|
|
860
|
+
* ```
|
|
861
|
+
*/
|
|
862
|
+
export interface ApiVariablesConfig {
|
|
863
|
+
/**
|
|
864
|
+
* Endpoint configuration for fetching variable schema
|
|
865
|
+
*/
|
|
866
|
+
endpoint: ApiVariablesEndpoint;
|
|
867
|
+
/**
|
|
868
|
+
* Cache TTL in milliseconds.
|
|
869
|
+
* Variables are cached to prevent excessive API calls during editing.
|
|
870
|
+
* @default 300000 (5 minutes)
|
|
871
|
+
*/
|
|
872
|
+
cacheTtl?: number;
|
|
873
|
+
/**
|
|
874
|
+
* Whether to merge API variables with static schema.
|
|
875
|
+
* When true, variables from both API and schema are combined.
|
|
876
|
+
* @default true
|
|
877
|
+
*/
|
|
878
|
+
mergeWithSchema?: boolean;
|
|
879
|
+
/**
|
|
880
|
+
* Whether to merge API variables with port-derived variables.
|
|
881
|
+
* When true, variables from both API and ports are combined.
|
|
882
|
+
* @default false
|
|
883
|
+
*/
|
|
884
|
+
mergeWithPorts?: boolean;
|
|
885
|
+
/**
|
|
886
|
+
* Whether to fallback to schema/ports on API error.
|
|
887
|
+
* When true, gracefully degrades to static variables if API fails.
|
|
888
|
+
* When false, shows error message to user.
|
|
889
|
+
* @default true
|
|
890
|
+
*/
|
|
891
|
+
fallbackOnError?: boolean;
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Endpoint configuration for fetching variable schemas from backend API.
|
|
895
|
+
* Supports template variables in URL (e.g., {workflowId}, {nodeId})
|
|
896
|
+
* which are resolved at runtime from node context.
|
|
897
|
+
*
|
|
898
|
+
* @example GET Request
|
|
899
|
+
* ```typescript
|
|
900
|
+
* const endpoint: ApiVariablesEndpoint = {
|
|
901
|
+
* url: "/api/variables/{workflowId}/{nodeId}",
|
|
902
|
+
* method: "GET"
|
|
903
|
+
* };
|
|
904
|
+
* ```
|
|
905
|
+
*
|
|
906
|
+
* @example POST Request with Body
|
|
907
|
+
* ```typescript
|
|
908
|
+
* const endpoint: ApiVariablesEndpoint = {
|
|
909
|
+
* url: "/api/variables",
|
|
910
|
+
* method: "POST",
|
|
911
|
+
* body: {
|
|
912
|
+
* workflowId: "{workflowId}",
|
|
913
|
+
* nodeId: "{nodeId}"
|
|
914
|
+
* }
|
|
915
|
+
* };
|
|
916
|
+
* ```
|
|
917
|
+
*/
|
|
918
|
+
export interface ApiVariablesEndpoint {
|
|
919
|
+
/**
|
|
920
|
+
* URL to fetch variables from.
|
|
921
|
+
* Supports template placeholders:
|
|
922
|
+
* - `{workflowId}` - Resolved from workflow ID
|
|
923
|
+
* - `{nodeId}` - Resolved from node instance ID
|
|
924
|
+
*
|
|
925
|
+
* @example "/api/variables/{workflowId}/{nodeId}"
|
|
926
|
+
* @example "https://api.example.com/variables?workflow={workflowId}&node={nodeId}"
|
|
927
|
+
*/
|
|
928
|
+
url: string;
|
|
929
|
+
/**
|
|
930
|
+
* HTTP method for the request.
|
|
931
|
+
* @default "GET"
|
|
932
|
+
*/
|
|
933
|
+
method?: HttpMethod;
|
|
934
|
+
/**
|
|
935
|
+
* Custom headers to include in the request.
|
|
936
|
+
* Note: Authentication headers are automatically added via AuthProvider.
|
|
937
|
+
*/
|
|
938
|
+
headers?: Record<string, string>;
|
|
939
|
+
/**
|
|
940
|
+
* Request body for POST/PUT/PATCH methods.
|
|
941
|
+
* Supports template variables like the URL.
|
|
942
|
+
*/
|
|
943
|
+
body?: Record<string, unknown>;
|
|
944
|
+
/**
|
|
945
|
+
* Request timeout in milliseconds.
|
|
946
|
+
* @default 30000 (30 seconds)
|
|
947
|
+
*/
|
|
948
|
+
timeout?: number;
|
|
949
|
+
/**
|
|
950
|
+
* Whether to cache the fetched schema.
|
|
951
|
+
* When false, schema is fetched on every editor load.
|
|
952
|
+
* @default true
|
|
953
|
+
*/
|
|
954
|
+
cacheEnabled?: boolean;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Union type for all schema types
|
|
958
|
+
*/
|
|
959
|
+
export type Schema = ConfigSchema | InputSchema | OutputSchema;
|
|
960
|
+
/**
|
|
961
|
+
* Union type for all property types
|
|
962
|
+
*/
|
|
963
|
+
export type Property = ConfigProperty | InputProperty | OutputProperty;
|
|
964
|
+
/**
|
|
965
|
+
* Schema type discriminator
|
|
966
|
+
*/
|
|
967
|
+
export type SchemaType = 'config' | 'input' | 'output';
|
|
968
|
+
/**
|
|
969
|
+
* Utility type to get the appropriate property type based on schema type
|
|
970
|
+
*/
|
|
971
|
+
export type SchemaProperty<T extends SchemaType> = T extends 'config' ? ConfigProperty : T extends 'input' ? InputProperty : T extends 'output' ? OutputProperty : never;
|
|
972
|
+
/**
|
|
973
|
+
* Utility type to get the appropriate schema type based on schema type
|
|
974
|
+
*/
|
|
975
|
+
export type SchemaTypeMap<T extends SchemaType> = T extends 'config' ? ConfigSchema : T extends 'input' ? InputSchema : T extends 'output' ? OutputSchema : never;
|
|
976
|
+
/**
|
|
977
|
+
* Node configuration values
|
|
978
|
+
*
|
|
979
|
+
* Key-value pairs of user-entered configuration values based on the node's configSchema.
|
|
980
|
+
* This is where all node-specific settings are stored, including:
|
|
981
|
+
*
|
|
982
|
+
* **Standard Properties:**
|
|
983
|
+
* - Any property defined in the node's `configSchema` (e.g., model, temperature, apiKey)
|
|
984
|
+
*
|
|
985
|
+
* **Special Properties (Dynamic Ports):**
|
|
986
|
+
* - `dynamicInputs`: Array of DynamicPort for user-defined input handles
|
|
987
|
+
* - `dynamicOutputs`: Array of DynamicPort for user-defined output handles
|
|
988
|
+
* - `branches`: Array of Branch for gateway node conditional output paths
|
|
989
|
+
*
|
|
990
|
+
* The backend uses this object to:
|
|
991
|
+
* - Store and retrieve node configuration
|
|
992
|
+
* - Pass configuration values to node processors during execution
|
|
993
|
+
* - Persist node state across sessions
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
996
|
+
* ```typescript
|
|
997
|
+
* const config: ConfigValues = {
|
|
998
|
+
* // Standard configuration from configSchema
|
|
999
|
+
* model: "gpt-4o-mini",
|
|
1000
|
+
* temperature: 0.7,
|
|
1001
|
+
* maxTokens: 1000,
|
|
1002
|
+
*
|
|
1003
|
+
* // Dynamic input ports
|
|
1004
|
+
* dynamicInputs: [
|
|
1005
|
+
* { name: "extra_data", label: "Extra Data", dataType: "json" }
|
|
1006
|
+
* ],
|
|
1007
|
+
*
|
|
1008
|
+
* // Gateway branches
|
|
1009
|
+
* branches: [
|
|
1010
|
+
* { name: "success", label: "Success", condition: "status === 200" },
|
|
1011
|
+
* { name: "error", label: "Error", isDefault: true }
|
|
1012
|
+
* ]
|
|
1013
|
+
* };
|
|
1014
|
+
* ```
|
|
1015
|
+
*/
|
|
1016
|
+
export interface ConfigValues {
|
|
1017
|
+
/** Dynamic input ports for user-defined input handles */
|
|
1018
|
+
dynamicInputs?: DynamicPort[];
|
|
1019
|
+
/** Dynamic output ports for user-defined output handles */
|
|
1020
|
+
dynamicOutputs?: DynamicPort[];
|
|
1021
|
+
/** Branches for gateway node conditional output paths */
|
|
1022
|
+
branches?: Branch[];
|
|
1023
|
+
/** Any other configuration properties defined in configSchema */
|
|
1024
|
+
[key: string]: unknown;
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Extended node type for workflows
|
|
1028
|
+
*
|
|
1029
|
+
* Represents a node instance in a workflow, containing position, display data,
|
|
1030
|
+
* configuration values, and metadata from the node type definition.
|
|
1031
|
+
*/
|
|
1032
|
+
export interface WorkflowNode extends Node {
|
|
1033
|
+
id: string;
|
|
1034
|
+
type: string;
|
|
1035
|
+
position: XYPosition;
|
|
1036
|
+
deletable?: boolean;
|
|
1037
|
+
data: {
|
|
1038
|
+
/** Display label for the node instance */
|
|
1039
|
+
label: string;
|
|
1040
|
+
/**
|
|
1041
|
+
* Node configuration values
|
|
1042
|
+
*
|
|
1043
|
+
* Contains all user-configured settings for this node instance based on the
|
|
1044
|
+
* node type's configSchema. This includes standard properties defined in the
|
|
1045
|
+
* schema as well as special dynamic port configurations.
|
|
1046
|
+
*
|
|
1047
|
+
* The backend uses this object to:
|
|
1048
|
+
* - Store and retrieve node configuration
|
|
1049
|
+
* - Pass configuration values to node processors during execution
|
|
1050
|
+
* - Persist node state across sessions
|
|
1051
|
+
*
|
|
1052
|
+
* @see ConfigValues for detailed documentation of available properties
|
|
1053
|
+
*/
|
|
1054
|
+
config: ConfigValues;
|
|
1055
|
+
/** Node type metadata (inputs, outputs, configSchema, etc.) */
|
|
1056
|
+
metadata: NodeMetadata;
|
|
1057
|
+
/** Whether the node is currently processing/executing */
|
|
1058
|
+
isProcessing?: boolean;
|
|
1059
|
+
/** Error message if the node execution failed */
|
|
1060
|
+
error?: string;
|
|
1061
|
+
/** Alternative node identifier */
|
|
1062
|
+
nodeId?: string;
|
|
1063
|
+
/** Node execution tracking information */
|
|
1064
|
+
executionInfo?: NodeExecutionInfo;
|
|
1065
|
+
/**
|
|
1066
|
+
* Per-instance extension properties for 3rd party integrations
|
|
1067
|
+
* Overrides or extends the node type extensions defined in metadata.extensions
|
|
1068
|
+
* Use for instance-specific UI states or custom data
|
|
1069
|
+
*/
|
|
1070
|
+
extensions?: NodeExtensions;
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* Edge category types based on source port data type or target handle
|
|
1075
|
+
* Used for visual styling of edges on the canvas
|
|
1076
|
+
* - trigger: For control flow connections (dataType: "trigger")
|
|
1077
|
+
* - tool: Dashed amber line for tool connections (dataType: "tool")
|
|
1078
|
+
* - loopback: Dashed gray line for loop iteration (targets loop_back port)
|
|
1079
|
+
* - data: Normal gray line for all other data connections
|
|
1080
|
+
*/
|
|
1081
|
+
export type EdgeCategory = 'trigger' | 'tool' | 'loopback' | 'data';
|
|
1082
|
+
/**
|
|
1083
|
+
* Extended edge type for workflows
|
|
1084
|
+
*/
|
|
1085
|
+
export interface WorkflowEdge extends Edge {
|
|
1086
|
+
id: string;
|
|
1087
|
+
source: string;
|
|
1088
|
+
target: string;
|
|
1089
|
+
sourceHandle?: string;
|
|
1090
|
+
targetHandle?: string;
|
|
1091
|
+
type?: ConnectionLineType;
|
|
1092
|
+
selectable?: boolean;
|
|
1093
|
+
deletable?: boolean;
|
|
1094
|
+
data?: {
|
|
1095
|
+
label?: string;
|
|
1096
|
+
condition?: string;
|
|
1097
|
+
/** Edge metadata for API and persistence */
|
|
1098
|
+
metadata?: {
|
|
1099
|
+
/** Edge type for styling ("tool" or "data") */
|
|
1100
|
+
edgeType?: EdgeCategory;
|
|
1101
|
+
/** Data type of the source output port (e.g., "tool", "string", "number") */
|
|
1102
|
+
sourcePortDataType?: string;
|
|
1103
|
+
};
|
|
1104
|
+
targetNodeType?: string;
|
|
1105
|
+
targetCategory?: string;
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Complete workflow definition
|
|
1110
|
+
*/
|
|
1111
|
+
export interface Workflow {
|
|
1112
|
+
id: string;
|
|
1113
|
+
name: string;
|
|
1114
|
+
description?: string;
|
|
1115
|
+
nodes: WorkflowNode[];
|
|
1116
|
+
edges: WorkflowEdge[];
|
|
1117
|
+
metadata?: {
|
|
1118
|
+
version: string;
|
|
1119
|
+
createdAt: string;
|
|
1120
|
+
updatedAt: string;
|
|
1121
|
+
author?: string;
|
|
1122
|
+
tags?: string[];
|
|
1123
|
+
versionId?: string;
|
|
1124
|
+
updateNumber?: number;
|
|
1125
|
+
/** Workflow format. Determines sidebar filtering and export behavior. */
|
|
1126
|
+
format?: WorkflowFormat;
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* API response types
|
|
1131
|
+
*/
|
|
1132
|
+
export interface ApiResponse<T> {
|
|
1133
|
+
success: boolean;
|
|
1134
|
+
data?: T;
|
|
1135
|
+
error?: string;
|
|
1136
|
+
message?: string;
|
|
1137
|
+
}
|
|
1138
|
+
export type NodesResponse = ApiResponse<NodeMetadata[]>;
|
|
1139
|
+
export type WorkflowResponse = ApiResponse<Workflow>;
|
|
1140
|
+
export type WorkflowsResponse = ApiResponse<Workflow[]>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Node execution status enum
|
|
1143
|
+
*/
|
|
1144
|
+
export type NodeExecutionStatus = 'idle' | 'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'skipped';
|
|
1145
|
+
/**
|
|
1146
|
+
* Node execution tracking information
|
|
1147
|
+
*/
|
|
1148
|
+
export interface NodeExecutionInfo {
|
|
1149
|
+
/** Current execution status */
|
|
1150
|
+
status: NodeExecutionStatus;
|
|
1151
|
+
/** Total number of times this node has been executed */
|
|
1152
|
+
executionCount: number;
|
|
1153
|
+
/** Last execution timestamp */
|
|
1154
|
+
lastExecuted?: string;
|
|
1155
|
+
/** Last execution duration in milliseconds */
|
|
1156
|
+
lastExecutionDuration?: number;
|
|
1157
|
+
/** Last error message if execution failed */
|
|
1158
|
+
lastError?: string;
|
|
1159
|
+
/** Whether the node is currently being executed */
|
|
1160
|
+
isExecuting: boolean;
|
|
1161
|
+
/** Execution output data (e.g., active branches for gateway nodes) */
|
|
1162
|
+
output?: Record<string, unknown>;
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Workflow execution status
|
|
1166
|
+
*/
|
|
1167
|
+
export type ExecutionStatus = 'idle' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
1168
|
+
/**
|
|
1169
|
+
* Workflow execution result
|
|
1170
|
+
*/
|
|
1171
|
+
export interface ExecutionResult {
|
|
1172
|
+
id: string;
|
|
1173
|
+
workflowId: string;
|
|
1174
|
+
status: ExecutionStatus;
|
|
1175
|
+
startTime: string;
|
|
1176
|
+
endTime?: string;
|
|
1177
|
+
results?: Record<string, unknown>;
|
|
1178
|
+
error?: string;
|
|
1179
|
+
logs?: string[];
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Library configuration
|
|
1183
|
+
*/
|
|
1184
|
+
export interface FlowDropConfig {
|
|
1185
|
+
endpointConfig?: EndpointConfig;
|
|
1186
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
1187
|
+
enableDebug?: boolean;
|
|
1188
|
+
autoSave?: boolean;
|
|
1189
|
+
autoSaveInterval?: number;
|
|
1190
|
+
maxUndoSteps?: number;
|
|
1191
|
+
nodeSpacing?: number;
|
|
1192
|
+
gridSize?: number;
|
|
1193
|
+
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Event types for the workflow editor
|
|
1196
|
+
*/
|
|
1197
|
+
export interface WorkflowEvents {
|
|
1198
|
+
nodeAdded: {
|
|
1199
|
+
node: WorkflowNode;
|
|
1200
|
+
};
|
|
1201
|
+
nodeRemoved: {
|
|
1202
|
+
nodeId: string;
|
|
1203
|
+
};
|
|
1204
|
+
nodeUpdated: {
|
|
1205
|
+
node: WorkflowNode;
|
|
1206
|
+
};
|
|
1207
|
+
edgeAdded: {
|
|
1208
|
+
edge: WorkflowEdge;
|
|
1209
|
+
};
|
|
1210
|
+
edgeRemoved: {
|
|
1211
|
+
edgeId: string;
|
|
1212
|
+
};
|
|
1213
|
+
workflowSaved: {
|
|
1214
|
+
workflow: Workflow;
|
|
1215
|
+
};
|
|
1216
|
+
workflowLoaded: {
|
|
1217
|
+
workflow: Workflow;
|
|
1218
|
+
};
|
|
1219
|
+
executionStarted: {
|
|
1220
|
+
workflowId: string;
|
|
1221
|
+
};
|
|
1222
|
+
executionCompleted: {
|
|
1223
|
+
result: ExecutionResult;
|
|
1224
|
+
};
|
|
1225
|
+
executionFailed: {
|
|
1226
|
+
error: string;
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from './auth.js';
|
|
1230
|
+
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider } from './auth.js';
|
|
1231
|
+
export type { FlowDropSettings, ThemeSettings, EditorSettings, UISettings, BehaviorSettings, ApiSettings, ThemePreference, ResolvedTheme, SettingsCategory, PartialSettings, SyncStatus, SettingsStoreState, SettingsChangeEvent, SettingsChangeCallback } from './settings.js';
|
|
1232
|
+
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';
|
|
1233
|
+
export type { UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement } from './uischema.js';
|
|
1234
|
+
export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup } from './uischema.js';
|