@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,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock for $app/environment
|
|
3
|
+
* Provides minimal implementations for SvelteKit environment in library context
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Mock browser check
|
|
7
|
+
export const browser = typeof window !== 'undefined';
|
|
8
|
+
|
|
9
|
+
// Mock dev check
|
|
10
|
+
export const dev = false;
|
|
11
|
+
|
|
12
|
+
// Mock building check
|
|
13
|
+
export const building = false;
|
|
14
|
+
|
|
15
|
+
// Mock version
|
|
16
|
+
export const version = '1.0.0';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* Mock for $app/forms
|
|
4
|
+
* Provides minimal implementations for SvelteKit forms in library context
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Mock enhance function
|
|
8
|
+
export const enhance = (form, options = {}) => {
|
|
9
|
+
return (event) => {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
// Basic form handling for library context
|
|
12
|
+
if (options.onResult) {
|
|
13
|
+
options.onResult({ type: 'success' });
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// Mock applyAction function
|
|
19
|
+
export const applyAction = (action) => {
|
|
20
|
+
// No-op for library context
|
|
21
|
+
return action;
|
|
22
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock for $app/navigation
|
|
3
|
+
* Provides minimal implementations for SvelteKit navigation in library context
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { logger } from '../utils/logger.js';
|
|
7
|
+
|
|
8
|
+
// Mock goto function
|
|
9
|
+
export const goto = async () => {
|
|
10
|
+
// No-op for library context
|
|
11
|
+
logger.warn('Navigation not available in library context');
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// Mock invalidate function
|
|
15
|
+
export const invalidate = async () => {
|
|
16
|
+
// No-op for library context
|
|
17
|
+
return Promise.resolve();
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Mock invalidateAll function
|
|
21
|
+
export const invalidateAll = async () => {
|
|
22
|
+
// No-op for library context
|
|
23
|
+
return Promise.resolve();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Mock preloadData function
|
|
27
|
+
export const preloadData = async () => {
|
|
28
|
+
// No-op for library context
|
|
29
|
+
return Promise.resolve({});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// Mock preloadCode function
|
|
33
|
+
export const preloadCode = async () => {
|
|
34
|
+
// No-op for library context
|
|
35
|
+
return Promise.resolve();
|
|
36
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const page: import("svelte/store").Writable<{
|
|
2
|
+
url: URL;
|
|
3
|
+
params: {};
|
|
4
|
+
route: {
|
|
5
|
+
id: null;
|
|
6
|
+
};
|
|
7
|
+
status: number;
|
|
8
|
+
error: null;
|
|
9
|
+
data: {};
|
|
10
|
+
form: null;
|
|
11
|
+
}>;
|
|
12
|
+
export const navigating: import("svelte/store").Writable<null>;
|
|
13
|
+
export const updated: import("svelte/store").Writable<boolean>;
|
|
14
|
+
export function preloadData(): Promise<{}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock for $app/stores
|
|
3
|
+
* Provides minimal implementations for SvelteKit stores in library context
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { writable } from 'svelte/store';
|
|
7
|
+
|
|
8
|
+
// Mock page store
|
|
9
|
+
export const page = writable({
|
|
10
|
+
url: new URL('http://localhost:3000'),
|
|
11
|
+
params: {},
|
|
12
|
+
route: { id: null },
|
|
13
|
+
status: 200,
|
|
14
|
+
error: null,
|
|
15
|
+
data: {},
|
|
16
|
+
form: null
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// Mock navigating store
|
|
20
|
+
export const navigating = writable(null);
|
|
21
|
+
|
|
22
|
+
// Mock updated store
|
|
23
|
+
export const updated = writable(false);
|
|
24
|
+
|
|
25
|
+
// Mock preloadData function
|
|
26
|
+
export const preloadData = async () => ({});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlowDrop Playground Module
|
|
3
|
+
*
|
|
4
|
+
* Provides the Playground feature for interactive workflow testing with
|
|
5
|
+
* chat interface, session management, and real-time execution logs.
|
|
6
|
+
*
|
|
7
|
+
* @module playground
|
|
8
|
+
*
|
|
9
|
+
* @example Using mountPlayground for vanilla JS / Drupal / IIFE:
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { mountPlayground, createEndpointConfig } from "@flowdrop/flowdrop/playground";
|
|
12
|
+
*
|
|
13
|
+
* const app = await mountPlayground(
|
|
14
|
+
* document.getElementById("playground-container"),
|
|
15
|
+
* {
|
|
16
|
+
* workflowId: "wf-123",
|
|
17
|
+
* endpointConfig: createEndpointConfig("/api/flowdrop"),
|
|
18
|
+
* mode: "standalone"
|
|
19
|
+
* }
|
|
20
|
+
* );
|
|
21
|
+
*
|
|
22
|
+
* // Later, to cleanup:
|
|
23
|
+
* app.destroy();
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Drupal Behaviors integration:
|
|
27
|
+
* ```javascript
|
|
28
|
+
* (function (Drupal, FlowDrop) {
|
|
29
|
+
* Drupal.behaviors.flowdropPlayground = {
|
|
30
|
+
* attach: function (context, settings) {
|
|
31
|
+
* var container = document.getElementById("playground-container");
|
|
32
|
+
* if (!container || container.dataset.initialized) return;
|
|
33
|
+
* container.dataset.initialized = "true";
|
|
34
|
+
*
|
|
35
|
+
* FlowDrop.mountPlayground(container, {
|
|
36
|
+
* workflowId: settings.flowdrop.workflowId,
|
|
37
|
+
* endpointConfig: FlowDrop.createEndpointConfig(settings.flowdrop.apiBaseUrl),
|
|
38
|
+
* mode: "standalone"
|
|
39
|
+
* }).then(function (app) {
|
|
40
|
+
* container._flowdropApp = app;
|
|
41
|
+
* });
|
|
42
|
+
* },
|
|
43
|
+
* detach: function (context, settings, trigger) {
|
|
44
|
+
* if (trigger === "unload") {
|
|
45
|
+
* var container = document.getElementById("playground-container");
|
|
46
|
+
* if (container && container._flowdropApp) {
|
|
47
|
+
* container._flowdropApp.destroy();
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
* }
|
|
51
|
+
* };
|
|
52
|
+
* })(Drupal, window.FlowDrop);
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example In Svelte (Standalone mode):
|
|
56
|
+
* ```svelte
|
|
57
|
+
* <script>
|
|
58
|
+
* import { Playground } from "@flowdrop/flowdrop/playground";
|
|
59
|
+
* </script>
|
|
60
|
+
*
|
|
61
|
+
* <Playground workflowId="wf-123" mode="standalone" />
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example In Svelte (Embedded mode):
|
|
65
|
+
* ```svelte
|
|
66
|
+
* <script>
|
|
67
|
+
* import { Playground } from "@flowdrop/flowdrop/playground";
|
|
68
|
+
* let showPlayground = false;
|
|
69
|
+
* </script>
|
|
70
|
+
*
|
|
71
|
+
* {#if showPlayground}
|
|
72
|
+
* <Playground
|
|
73
|
+
* workflowId="wf-123"
|
|
74
|
+
* workflow={myWorkflow}
|
|
75
|
+
* mode="embedded"
|
|
76
|
+
* onClose={() => showPlayground = false}
|
|
77
|
+
* />
|
|
78
|
+
* {/if}
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @example In Svelte (Modal mode):
|
|
82
|
+
* ```svelte
|
|
83
|
+
* <script>
|
|
84
|
+
* import { PlaygroundModal } from "@flowdrop/flowdrop/playground";
|
|
85
|
+
* let showPlayground = false;
|
|
86
|
+
* </script>
|
|
87
|
+
*
|
|
88
|
+
* <PlaygroundModal
|
|
89
|
+
* isOpen={showPlayground}
|
|
90
|
+
* workflowId="wf-123"
|
|
91
|
+
* workflow={myWorkflow}
|
|
92
|
+
* onClose={() => showPlayground = false}
|
|
93
|
+
* />
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @example Using mountPlayground with modal mode:
|
|
97
|
+
* ```typescript
|
|
98
|
+
* import { mountPlayground, createEndpointConfig } from "@flowdrop/flowdrop/playground";
|
|
99
|
+
*
|
|
100
|
+
* const app = await mountPlayground(
|
|
101
|
+
* document.getElementById("playground-container"),
|
|
102
|
+
* {
|
|
103
|
+
* workflowId: "wf-123",
|
|
104
|
+
* endpointConfig: createEndpointConfig("/api/flowdrop"),
|
|
105
|
+
* mode: "modal",
|
|
106
|
+
* onClose: () => {
|
|
107
|
+
* app.destroy();
|
|
108
|
+
* }
|
|
109
|
+
* }
|
|
110
|
+
* );
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export { default as Playground } from '../components/playground/Playground.svelte';
|
|
114
|
+
export { default as PlaygroundModal } from '../components/playground/PlaygroundModal.svelte';
|
|
115
|
+
export { default as ChatPanel } from '../components/playground/ChatPanel.svelte';
|
|
116
|
+
export { default as SessionManager } from '../components/playground/SessionManager.svelte';
|
|
117
|
+
export { default as InputCollector } from '../components/playground/InputCollector.svelte';
|
|
118
|
+
export { default as ExecutionLogs } from '../components/playground/ExecutionLogs.svelte';
|
|
119
|
+
export { default as MessageBubble } from '../components/playground/MessageBubble.svelte';
|
|
120
|
+
export { InterruptBubble, ConfirmationPrompt, ChoicePrompt, TextInputPrompt, FormPrompt } from '../components/interrupt/index.js';
|
|
121
|
+
export { PlaygroundService, playgroundService } from '../services/playgroundService.js';
|
|
122
|
+
export { InterruptService, interruptService } from '../services/interruptService.js';
|
|
123
|
+
export { getCurrentSession, getSessions, getMessages, getIsExecuting, getIsLoading, getError as getPlaygroundError, getCurrentWorkflow, getLastPollTimestamp, getSessionStatus, getMessageCount, getChatMessages, getLogMessages, getLatestMessage, getInputFields, getHasChatInput, getSessionCount, playgroundActions, createPollingCallback, subscribeToSessionStatus, getCurrentSessionId, isSessionSelected, getMessagesSnapshot, getLatestMessageTimestamp } from '../stores/playgroundStore.svelte.js';
|
|
124
|
+
export type { PlaygroundSession, PlaygroundMessage, PlaygroundInputField, PlaygroundMessageRequest, PlaygroundMessagesResult, PlaygroundConfig, PlaygroundMode, PlaygroundSessionStatus, PlaygroundMessageRole, PlaygroundMessageLevel, PlaygroundMessageMetadata, PlaygroundApiResponse, PlaygroundSessionsResponse, PlaygroundSessionResponse, PlaygroundMessageResponse, PlaygroundMessagesApiResponse } from '../types/playground.js';
|
|
125
|
+
export { isChatInputNode, CHAT_INPUT_PATTERNS, defaultShouldStopPolling, defaultIsTerminalStatus, DEFAULT_STOP_POLLING_STATUSES, DEFAULT_TERMINAL_STATUSES } from '../types/playground.js';
|
|
126
|
+
export type { InterruptType, InterruptStatus, Interrupt, InterruptChoice, InterruptConfig, ConfirmationConfig, ChoiceConfig, TextConfig, FormConfig, ReviewConfig, ReviewChange, ReviewFieldDecision, ReviewResolution, InterruptResolution, InterruptApiResponse, InterruptListResponse, InterruptResponse, InterruptMessageMetadata, InterruptPollingConfig } from '../types/interrupt.js';
|
|
127
|
+
export { isInterruptMetadata, extractInterruptMetadata, metadataToInterrupt, defaultInterruptPollingConfig } from '../types/interrupt.js';
|
|
128
|
+
export { getInterruptsMap, getPendingInterruptIds, getPendingInterrupts, getPendingInterruptCount, getResolvedInterrupts, getIsAnySubmitting, interruptActions, getInterrupt, isInterruptPending, isInterruptSubmitting, getInterruptError, getInterruptByMessageId, interruptHasError } from '../stores/interruptStore.svelte.js';
|
|
129
|
+
export type { InterruptWithState } from '../stores/interruptStore.svelte.js';
|
|
130
|
+
export { mountPlayground, unmountPlayground, type PlaygroundMountOptions, type MountedPlayground } from './mount.js';
|
|
131
|
+
export { createEndpointConfig, defaultEndpointConfig, buildEndpointUrl, type EndpointConfig } from '../config/endpoints.js';
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlowDrop Playground Module
|
|
3
|
+
*
|
|
4
|
+
* Provides the Playground feature for interactive workflow testing with
|
|
5
|
+
* chat interface, session management, and real-time execution logs.
|
|
6
|
+
*
|
|
7
|
+
* @module playground
|
|
8
|
+
*
|
|
9
|
+
* @example Using mountPlayground for vanilla JS / Drupal / IIFE:
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { mountPlayground, createEndpointConfig } from "@flowdrop/flowdrop/playground";
|
|
12
|
+
*
|
|
13
|
+
* const app = await mountPlayground(
|
|
14
|
+
* document.getElementById("playground-container"),
|
|
15
|
+
* {
|
|
16
|
+
* workflowId: "wf-123",
|
|
17
|
+
* endpointConfig: createEndpointConfig("/api/flowdrop"),
|
|
18
|
+
* mode: "standalone"
|
|
19
|
+
* }
|
|
20
|
+
* );
|
|
21
|
+
*
|
|
22
|
+
* // Later, to cleanup:
|
|
23
|
+
* app.destroy();
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Drupal Behaviors integration:
|
|
27
|
+
* ```javascript
|
|
28
|
+
* (function (Drupal, FlowDrop) {
|
|
29
|
+
* Drupal.behaviors.flowdropPlayground = {
|
|
30
|
+
* attach: function (context, settings) {
|
|
31
|
+
* var container = document.getElementById("playground-container");
|
|
32
|
+
* if (!container || container.dataset.initialized) return;
|
|
33
|
+
* container.dataset.initialized = "true";
|
|
34
|
+
*
|
|
35
|
+
* FlowDrop.mountPlayground(container, {
|
|
36
|
+
* workflowId: settings.flowdrop.workflowId,
|
|
37
|
+
* endpointConfig: FlowDrop.createEndpointConfig(settings.flowdrop.apiBaseUrl),
|
|
38
|
+
* mode: "standalone"
|
|
39
|
+
* }).then(function (app) {
|
|
40
|
+
* container._flowdropApp = app;
|
|
41
|
+
* });
|
|
42
|
+
* },
|
|
43
|
+
* detach: function (context, settings, trigger) {
|
|
44
|
+
* if (trigger === "unload") {
|
|
45
|
+
* var container = document.getElementById("playground-container");
|
|
46
|
+
* if (container && container._flowdropApp) {
|
|
47
|
+
* container._flowdropApp.destroy();
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
* }
|
|
51
|
+
* };
|
|
52
|
+
* })(Drupal, window.FlowDrop);
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example In Svelte (Standalone mode):
|
|
56
|
+
* ```svelte
|
|
57
|
+
* <script>
|
|
58
|
+
* import { Playground } from "@flowdrop/flowdrop/playground";
|
|
59
|
+
* </script>
|
|
60
|
+
*
|
|
61
|
+
* <Playground workflowId="wf-123" mode="standalone" />
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example In Svelte (Embedded mode):
|
|
65
|
+
* ```svelte
|
|
66
|
+
* <script>
|
|
67
|
+
* import { Playground } from "@flowdrop/flowdrop/playground";
|
|
68
|
+
* let showPlayground = false;
|
|
69
|
+
* </script>
|
|
70
|
+
*
|
|
71
|
+
* {#if showPlayground}
|
|
72
|
+
* <Playground
|
|
73
|
+
* workflowId="wf-123"
|
|
74
|
+
* workflow={myWorkflow}
|
|
75
|
+
* mode="embedded"
|
|
76
|
+
* onClose={() => showPlayground = false}
|
|
77
|
+
* />
|
|
78
|
+
* {/if}
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @example In Svelte (Modal mode):
|
|
82
|
+
* ```svelte
|
|
83
|
+
* <script>
|
|
84
|
+
* import { PlaygroundModal } from "@flowdrop/flowdrop/playground";
|
|
85
|
+
* let showPlayground = false;
|
|
86
|
+
* </script>
|
|
87
|
+
*
|
|
88
|
+
* <PlaygroundModal
|
|
89
|
+
* isOpen={showPlayground}
|
|
90
|
+
* workflowId="wf-123"
|
|
91
|
+
* workflow={myWorkflow}
|
|
92
|
+
* onClose={() => showPlayground = false}
|
|
93
|
+
* />
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @example Using mountPlayground with modal mode:
|
|
97
|
+
* ```typescript
|
|
98
|
+
* import { mountPlayground, createEndpointConfig } from "@flowdrop/flowdrop/playground";
|
|
99
|
+
*
|
|
100
|
+
* const app = await mountPlayground(
|
|
101
|
+
* document.getElementById("playground-container"),
|
|
102
|
+
* {
|
|
103
|
+
* workflowId: "wf-123",
|
|
104
|
+
* endpointConfig: createEndpointConfig("/api/flowdrop"),
|
|
105
|
+
* mode: "modal",
|
|
106
|
+
* onClose: () => {
|
|
107
|
+
* app.destroy();
|
|
108
|
+
* }
|
|
109
|
+
* }
|
|
110
|
+
* );
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
// ============================================================================
|
|
114
|
+
// Playground Components
|
|
115
|
+
// ============================================================================
|
|
116
|
+
export { default as Playground } from '../components/playground/Playground.svelte';
|
|
117
|
+
export { default as PlaygroundModal } from '../components/playground/PlaygroundModal.svelte';
|
|
118
|
+
export { default as ChatPanel } from '../components/playground/ChatPanel.svelte';
|
|
119
|
+
export { default as SessionManager } from '../components/playground/SessionManager.svelte';
|
|
120
|
+
export { default as InputCollector } from '../components/playground/InputCollector.svelte';
|
|
121
|
+
export { default as ExecutionLogs } from '../components/playground/ExecutionLogs.svelte';
|
|
122
|
+
export { default as MessageBubble } from '../components/playground/MessageBubble.svelte';
|
|
123
|
+
// ============================================================================
|
|
124
|
+
// Interrupt Components (Human-in-the-Loop)
|
|
125
|
+
// ============================================================================
|
|
126
|
+
export { InterruptBubble, ConfirmationPrompt, ChoicePrompt, TextInputPrompt, FormPrompt } from '../components/interrupt/index.js';
|
|
127
|
+
// ============================================================================
|
|
128
|
+
// Playground Service
|
|
129
|
+
// ============================================================================
|
|
130
|
+
export { PlaygroundService, playgroundService } from '../services/playgroundService.js';
|
|
131
|
+
// ============================================================================
|
|
132
|
+
// Interrupt Service (Human-in-the-Loop)
|
|
133
|
+
// ============================================================================
|
|
134
|
+
export { InterruptService, interruptService } from '../services/interruptService.js';
|
|
135
|
+
// ============================================================================
|
|
136
|
+
// Playground Store
|
|
137
|
+
// ============================================================================
|
|
138
|
+
export {
|
|
139
|
+
// Core state getters
|
|
140
|
+
getCurrentSession, getSessions, getMessages, getIsExecuting, getIsLoading, getError as getPlaygroundError, getCurrentWorkflow, getLastPollTimestamp,
|
|
141
|
+
// Derived getters
|
|
142
|
+
getSessionStatus, getMessageCount, getChatMessages, getLogMessages, getLatestMessage, getInputFields, getHasChatInput, getSessionCount,
|
|
143
|
+
// Actions
|
|
144
|
+
playgroundActions,
|
|
145
|
+
// Polling callback factory
|
|
146
|
+
createPollingCallback,
|
|
147
|
+
// Subscription utility
|
|
148
|
+
subscribeToSessionStatus,
|
|
149
|
+
// Utilities
|
|
150
|
+
getCurrentSessionId, isSessionSelected, getMessagesSnapshot, getLatestMessageTimestamp } from '../stores/playgroundStore.svelte.js';
|
|
151
|
+
export { isChatInputNode, CHAT_INPUT_PATTERNS, defaultShouldStopPolling, defaultIsTerminalStatus, DEFAULT_STOP_POLLING_STATUSES, DEFAULT_TERMINAL_STATUSES } from '../types/playground.js';
|
|
152
|
+
export { isInterruptMetadata, extractInterruptMetadata, metadataToInterrupt, defaultInterruptPollingConfig } from '../types/interrupt.js';
|
|
153
|
+
// ============================================================================
|
|
154
|
+
// Interrupt Store (Human-in-the-Loop)
|
|
155
|
+
// ============================================================================
|
|
156
|
+
export {
|
|
157
|
+
// Core state accessor
|
|
158
|
+
getInterruptsMap,
|
|
159
|
+
// Getter functions (replace derived stores)
|
|
160
|
+
getPendingInterruptIds, getPendingInterrupts, getPendingInterruptCount, getResolvedInterrupts, getIsAnySubmitting,
|
|
161
|
+
// Actions
|
|
162
|
+
interruptActions,
|
|
163
|
+
// Utilities
|
|
164
|
+
getInterrupt, isInterruptPending, isInterruptSubmitting, getInterruptError, getInterruptByMessageId, interruptHasError } from '../stores/interruptStore.svelte.js';
|
|
165
|
+
// ============================================================================
|
|
166
|
+
// Playground Mount Functions (for vanilla JS / Drupal / IIFE integration)
|
|
167
|
+
// ============================================================================
|
|
168
|
+
export { mountPlayground, unmountPlayground } from './mount.js';
|
|
169
|
+
// ============================================================================
|
|
170
|
+
// Endpoint Configuration (re-exported for convenience)
|
|
171
|
+
// ============================================================================
|
|
172
|
+
export { createEndpointConfig, defaultEndpointConfig, buildEndpointUrl } from '../config/endpoints.js';
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playground Mount Functions
|
|
3
|
+
*
|
|
4
|
+
* Provides mount/unmount functions for integrating the Playground component
|
|
5
|
+
* into any web application. Particularly useful for integration with
|
|
6
|
+
* vanilla JS, Drupal, WordPress, or other frameworks.
|
|
7
|
+
*
|
|
8
|
+
* @module playground/mount
|
|
9
|
+
*
|
|
10
|
+
* @example Basic usage in vanilla JavaScript:
|
|
11
|
+
* ```javascript
|
|
12
|
+
* const app = await FlowDrop.mountPlayground(
|
|
13
|
+
* document.getElementById("playground-container"),
|
|
14
|
+
* {
|
|
15
|
+
* workflowId: "wf-123",
|
|
16
|
+
* endpointConfig: FlowDrop.createEndpointConfig("/api/flowdrop"),
|
|
17
|
+
* mode: "standalone"
|
|
18
|
+
* }
|
|
19
|
+
* );
|
|
20
|
+
*
|
|
21
|
+
* // Later, to cleanup:
|
|
22
|
+
* app.destroy();
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example Drupal integration:
|
|
26
|
+
* ```javascript
|
|
27
|
+
* (function (Drupal, FlowDrop) {
|
|
28
|
+
* Drupal.behaviors.flowdropPlayground = {
|
|
29
|
+
* attach: function (context, settings) {
|
|
30
|
+
* const container = document.getElementById("playground-container");
|
|
31
|
+
* if (!container || container.dataset.initialized) return;
|
|
32
|
+
* container.dataset.initialized = "true";
|
|
33
|
+
*
|
|
34
|
+
* FlowDrop.mountPlayground(container, {
|
|
35
|
+
* workflowId: settings.flowdrop.workflowId,
|
|
36
|
+
* endpointConfig: FlowDrop.createEndpointConfig(settings.flowdrop.apiBaseUrl),
|
|
37
|
+
* mode: "standalone"
|
|
38
|
+
* }).then(function (app) {
|
|
39
|
+
* container._flowdropApp = app;
|
|
40
|
+
* });
|
|
41
|
+
* }
|
|
42
|
+
* };
|
|
43
|
+
* })(Drupal, window.FlowDrop);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
import type { Workflow } from '../types/index.js';
|
|
47
|
+
import type { EndpointConfig } from '../config/endpoints.js';
|
|
48
|
+
import type { PlaygroundMode, PlaygroundConfig, PlaygroundSession, PlaygroundMessagesApiResponse, PlaygroundSessionStatus } from '../types/playground.js';
|
|
49
|
+
/**
|
|
50
|
+
* Mount options for Playground component
|
|
51
|
+
*/
|
|
52
|
+
export interface PlaygroundMountOptions {
|
|
53
|
+
/**
|
|
54
|
+
* Target workflow ID (required)
|
|
55
|
+
* The workflow that the playground will interact with
|
|
56
|
+
*/
|
|
57
|
+
workflowId: string;
|
|
58
|
+
/**
|
|
59
|
+
* Pre-loaded workflow data (optional)
|
|
60
|
+
* If not provided, the component will fetch it from the API
|
|
61
|
+
*/
|
|
62
|
+
workflow?: Workflow;
|
|
63
|
+
/**
|
|
64
|
+
* Display mode
|
|
65
|
+
* - "standalone": Full-page playground experience
|
|
66
|
+
* - "embedded": Panel mode for embedding alongside other content
|
|
67
|
+
* - "modal": Modal dialog mode with backdrop
|
|
68
|
+
* @default "standalone"
|
|
69
|
+
*/
|
|
70
|
+
mode?: PlaygroundMode;
|
|
71
|
+
/**
|
|
72
|
+
* Resume a specific session by ID
|
|
73
|
+
* If provided, the playground will load this session on mount
|
|
74
|
+
*/
|
|
75
|
+
initialSessionId?: string;
|
|
76
|
+
/**
|
|
77
|
+
* API endpoint configuration
|
|
78
|
+
* Use createEndpointConfig() to create this
|
|
79
|
+
*/
|
|
80
|
+
endpointConfig?: EndpointConfig;
|
|
81
|
+
/**
|
|
82
|
+
* Playground-specific configuration options
|
|
83
|
+
*/
|
|
84
|
+
config?: PlaygroundConfig;
|
|
85
|
+
/**
|
|
86
|
+
* Container height (CSS value)
|
|
87
|
+
* @default "100%"
|
|
88
|
+
*/
|
|
89
|
+
height?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Container width (CSS value)
|
|
92
|
+
* @default "100%"
|
|
93
|
+
*/
|
|
94
|
+
width?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Callback when playground is closed (required for embedded and modal modes)
|
|
97
|
+
*/
|
|
98
|
+
onClose?: () => void;
|
|
99
|
+
/**
|
|
100
|
+
* Called when session status changes (from polling or actions)
|
|
101
|
+
*
|
|
102
|
+
* @param status - The new session status
|
|
103
|
+
* @param previousStatus - The previous session status
|
|
104
|
+
*/
|
|
105
|
+
onSessionStatusChange?: (status: PlaygroundSessionStatus, previousStatus: PlaygroundSessionStatus) => void;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Return type for mounted Playground instance
|
|
109
|
+
*/
|
|
110
|
+
export interface MountedPlayground {
|
|
111
|
+
/**
|
|
112
|
+
* Destroy the playground and clean up resources
|
|
113
|
+
* Should be called when removing the playground from the DOM
|
|
114
|
+
*/
|
|
115
|
+
destroy: () => void;
|
|
116
|
+
/**
|
|
117
|
+
* Get the current session
|
|
118
|
+
* @returns The current session or null if none selected
|
|
119
|
+
*/
|
|
120
|
+
getCurrentSession: () => PlaygroundSession | null;
|
|
121
|
+
/**
|
|
122
|
+
* Get all sessions for the workflow
|
|
123
|
+
* @returns Array of playground sessions
|
|
124
|
+
*/
|
|
125
|
+
getSessions: () => PlaygroundSession[];
|
|
126
|
+
/**
|
|
127
|
+
* Get the message count in the current session
|
|
128
|
+
* @returns Number of messages
|
|
129
|
+
*/
|
|
130
|
+
getMessageCount: () => number;
|
|
131
|
+
/**
|
|
132
|
+
* Check if the playground is currently executing
|
|
133
|
+
* @returns True if a workflow execution is in progress
|
|
134
|
+
*/
|
|
135
|
+
isExecuting: () => boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Stop any active polling
|
|
138
|
+
*/
|
|
139
|
+
stopPolling: () => void;
|
|
140
|
+
/**
|
|
141
|
+
* Restart polling for the current session
|
|
142
|
+
* Useful after polling stops (e.g., on awaiting_input) and you want to resume
|
|
143
|
+
*/
|
|
144
|
+
startPolling: () => void;
|
|
145
|
+
/**
|
|
146
|
+
* Push a poll response into the store pipeline.
|
|
147
|
+
* Use with custom transports (WebSocket/SSE) instead of built-in polling.
|
|
148
|
+
*
|
|
149
|
+
* @param response - A PlaygroundMessagesApiResponse to process
|
|
150
|
+
*/
|
|
151
|
+
pushMessages: (response: PlaygroundMessagesApiResponse) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Reset the playground state
|
|
154
|
+
* Clears the current session and messages
|
|
155
|
+
*/
|
|
156
|
+
reset: () => void;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Mount the Playground component in a container
|
|
160
|
+
*
|
|
161
|
+
* This function mounts the Playground Svelte component into a DOM container,
|
|
162
|
+
* enabling interactive workflow testing with a chat interface.
|
|
163
|
+
*
|
|
164
|
+
* @param container - DOM element to mount the playground into
|
|
165
|
+
* @param options - Configuration options for the playground
|
|
166
|
+
* @returns Promise resolving to a MountedPlayground instance
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```typescript
|
|
170
|
+
* import { mountPlayground, createEndpointConfig } from "@flowdrop/flowdrop/playground";
|
|
171
|
+
*
|
|
172
|
+
* const app = await mountPlayground(
|
|
173
|
+
* document.getElementById("playground"),
|
|
174
|
+
* {
|
|
175
|
+
* workflowId: "wf-123",
|
|
176
|
+
* endpointConfig: createEndpointConfig("/api/flowdrop"),
|
|
177
|
+
* mode: "standalone",
|
|
178
|
+
* config: {
|
|
179
|
+
* showTimestamps: true,
|
|
180
|
+
* autoScroll: true,
|
|
181
|
+
* pollingInterval: 1500
|
|
182
|
+
* }
|
|
183
|
+
* }
|
|
184
|
+
* );
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
export declare function mountPlayground(container: HTMLElement, options: PlaygroundMountOptions): Promise<MountedPlayground>;
|
|
188
|
+
/**
|
|
189
|
+
* Unmount a Playground instance
|
|
190
|
+
*
|
|
191
|
+
* Convenience function for destroying a mounted playground.
|
|
192
|
+
* Equivalent to calling `app.destroy()`.
|
|
193
|
+
*
|
|
194
|
+
* @param app - The mounted playground to unmount
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* const app = await mountPlayground(container, options);
|
|
199
|
+
* // ... later
|
|
200
|
+
* unmountPlayground(app);
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
export declare function unmountPlayground(app: MountedPlayground): void;
|