@flowdrop/flowdrop 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -51
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +27 -47
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +2 -2
- package/dist/adapters/agentspec/AgentSpecAdapter.js +122 -133
- package/dist/adapters/agentspec/agentAdapter.d.ts +2 -2
- package/dist/adapters/agentspec/agentAdapter.js +10 -10
- package/dist/adapters/agentspec/autoLayout.d.ts +52 -6
- package/dist/adapters/agentspec/autoLayout.js +118 -23
- package/dist/adapters/agentspec/componentTypeDefaults.d.ts +1 -1
- package/dist/adapters/agentspec/componentTypeDefaults.js +120 -120
- package/dist/adapters/agentspec/defaultNodeTypes.d.ts +2 -2
- package/dist/adapters/agentspec/defaultNodeTypes.js +307 -307
- package/dist/adapters/agentspec/index.d.ts +10 -10
- package/dist/adapters/agentspec/index.js +6 -6
- package/dist/adapters/agentspec/validator.d.ts +2 -2
- package/dist/adapters/agentspec/validator.js +20 -22
- package/dist/api/enhanced-client.d.ts +3 -3
- package/dist/api/enhanced-client.js +72 -73
- package/dist/chat/commandClassifier.d.ts +19 -0
- package/dist/chat/commandClassifier.js +30 -0
- package/dist/chat/index.d.ts +27 -0
- package/dist/chat/index.js +32 -0
- package/dist/chat/responseParser.d.ts +21 -0
- package/dist/chat/responseParser.js +91 -0
- package/dist/commands/batch.d.ts +18 -0
- package/dist/commands/batch.js +54 -0
- package/dist/commands/executor.d.ts +37 -0
- package/dist/commands/executor.js +1133 -0
- package/dist/commands/index.d.ts +14 -0
- package/dist/commands/index.js +17 -0
- package/dist/commands/parser.d.ts +16 -0
- package/dist/commands/parser.js +295 -0
- package/dist/commands/positioner.d.ts +19 -0
- package/dist/commands/positioner.js +33 -0
- package/dist/commands/storeIntegration.svelte.d.ts +16 -0
- package/dist/commands/storeIntegration.svelte.js +67 -0
- package/dist/commands/types.d.ts +343 -0
- package/dist/commands/types.js +45 -0
- package/dist/components/App.svelte +522 -237
- package/dist/components/App.svelte.d.ts +11 -8
- package/dist/components/CanvasBanner.stories.svelte +10 -16
- package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
- package/dist/components/CanvasBanner.svelte +2 -2
- package/dist/components/CanvasBanner.svelte.d.ts +1 -1
- package/dist/components/CanvasController.svelte +37 -0
- package/dist/components/CanvasController.svelte.d.ts +32 -0
- package/dist/components/ConfigForm.svelte +118 -256
- package/dist/components/ConfigForm.svelte.d.ts +2 -2
- package/dist/components/ConfigMappingRow.svelte +128 -0
- package/dist/components/ConfigMappingRow.svelte.d.ts +8 -0
- package/dist/components/ConfigModal.svelte +3 -3
- package/dist/components/ConfigModal.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.stories.svelte +19 -19
- package/dist/components/ConfigPanel.stories.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.svelte +57 -19
- package/dist/components/ConfigPanel.svelte.d.ts +3 -1
- package/dist/components/ConnectionLine.svelte +4 -4
- package/dist/components/EdgeRefresher.svelte +1 -1
- package/dist/components/FlowDropEdge.stories.svelte +110 -110
- package/dist/components/FlowDropEdge.svelte +11 -19
- package/dist/components/FlowDropEdge.svelte.d.ts +1 -1
- package/dist/components/FlowDropZone.svelte +6 -9
- package/dist/components/FlowDropZone.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.stories.svelte +13 -13
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.svelte +3 -3
- package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
- package/dist/components/Logo.stories.svelte +4 -4
- package/dist/components/Logo.stories.svelte.d.ts +1 -1
- package/dist/components/Logo.svelte +3 -9
- package/dist/components/LogsSidebar.svelte +46 -53
- package/dist/components/LogsSidebar.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.stories.svelte +10 -14
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.svelte +4 -6
- package/dist/components/Navbar.stories.svelte +19 -19
- package/dist/components/Navbar.stories.svelte.d.ts +1 -1
- package/dist/components/Navbar.svelte +28 -49
- package/dist/components/Navbar.svelte.d.ts +2 -2
- package/dist/components/NodeSidebar.svelte +55 -135
- package/dist/components/NodeSidebar.svelte.d.ts +1 -1
- package/dist/components/NodeStatusOverlay.stories.svelte +19 -31
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
- package/dist/components/NodeStatusOverlay.svelte +40 -55
- package/dist/components/NodeStatusOverlay.svelte.d.ts +3 -3
- package/dist/components/NodeSwapPicker.svelte +493 -0
- package/dist/components/NodeSwapPicker.svelte.d.ts +16 -0
- package/dist/components/PipelineStatus.svelte +63 -89
- package/dist/components/PipelineStatus.svelte.d.ts +4 -4
- package/dist/components/PortCoordinateTracker.svelte +5 -7
- package/dist/components/PortCoordinateTracker.svelte.d.ts +1 -1
- package/dist/components/PortMappingRow.svelte +205 -0
- package/dist/components/PortMappingRow.svelte.d.ts +12 -0
- package/dist/components/ReadOnlyDetails.svelte +1 -1
- package/dist/components/SchemaForm.stories.svelte +53 -53
- package/dist/components/SchemaForm.stories.svelte.d.ts +1 -1
- package/dist/components/SchemaForm.svelte +24 -51
- package/dist/components/SchemaForm.svelte.d.ts +2 -2
- package/dist/components/SettingsModal.svelte +6 -9
- package/dist/components/SettingsModal.svelte.d.ts +1 -1
- package/dist/components/SettingsPanel.svelte +138 -158
- package/dist/components/SettingsPanel.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.stories.svelte +16 -29
- package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.svelte +19 -19
- package/dist/components/StatusIcon.svelte.d.ts +2 -2
- package/dist/components/StatusLabel.stories.svelte +8 -8
- package/dist/components/StatusLabel.stories.svelte.d.ts +1 -1
- package/dist/components/SwapMappingEditor.svelte +529 -0
- package/dist/components/SwapMappingEditor.svelte.d.ts +12 -0
- package/dist/components/ThemeToggle.stories.svelte +10 -10
- package/dist/components/ThemeToggle.stories.svelte.d.ts +1 -1
- package/dist/components/ThemeToggle.svelte +22 -33
- package/dist/components/ThemeToggle.svelte.d.ts +1 -1
- package/dist/components/UniversalNode.svelte +29 -41
- package/dist/components/UniversalNode.svelte.d.ts +3 -3
- package/dist/components/WorkflowEditor.svelte +210 -170
- package/dist/components/WorkflowEditor.svelte.d.ts +12 -4
- package/dist/components/chat/AIChatPanel.svelte +797 -0
- package/dist/components/chat/AIChatPanel.svelte.d.ts +13 -0
- package/dist/components/chat/CommandPreview.svelte +234 -0
- package/dist/components/chat/CommandPreview.svelte.d.ts +9 -0
- package/dist/components/console/CommandConsole.stories.svelte +111 -0
- package/dist/components/console/CommandConsole.stories.svelte.d.ts +27 -0
- package/dist/components/console/CommandConsole.svelte +263 -0
- package/dist/components/console/CommandConsole.svelte.d.ts +11 -0
- package/dist/components/console/ConsoleAutocomplete.svelte +142 -0
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +21 -0
- package/dist/components/console/ConsoleInput.svelte +771 -0
- package/dist/components/console/ConsoleInput.svelte.d.ts +16 -0
- package/dist/components/console/ConsoleOutput.svelte +116 -0
- package/dist/components/console/ConsoleOutput.svelte.d.ts +11 -0
- package/dist/components/console/formatters.d.ts +26 -0
- package/dist/components/console/formatters.js +116 -0
- package/dist/components/form/FormArray.svelte +75 -132
- package/dist/components/form/FormArray.svelte.d.ts +1 -1
- package/dist/components/form/FormAutocomplete.svelte +65 -108
- package/dist/components/form/FormAutocomplete.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.stories.svelte +13 -16
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.svelte +2 -2
- package/dist/components/form/FormCodeEditor.svelte +42 -56
- package/dist/components/form/FormField.svelte +79 -90
- package/dist/components/form/FormField.svelte.d.ts +2 -2
- package/dist/components/form/FormFieldLight.svelte +72 -88
- package/dist/components/form/FormFieldLight.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.stories.svelte +14 -14
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.svelte +2 -9
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldset.svelte +3 -3
- package/dist/components/form/FormFieldset.svelte.d.ts +2 -2
- package/dist/components/form/FormMarkdownEditor.svelte +123 -156
- package/dist/components/form/FormNumberField.stories.svelte +18 -18
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormNumberField.svelte +6 -6
- package/dist/components/form/FormRangeField.stories.svelte +13 -13
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormRangeField.svelte +4 -12
- package/dist/components/form/FormSelect.stories.svelte +21 -21
- package/dist/components/form/FormSelect.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormSelect.svelte +5 -5
- package/dist/components/form/FormSelect.svelte.d.ts +1 -1
- package/dist/components/form/FormTemplateEditor.svelte +126 -175
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.stories.svelte +17 -23
- package/dist/components/form/FormTextField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.svelte +4 -4
- package/dist/components/form/FormTextarea.stories.svelte +18 -21
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextarea.svelte +4 -4
- package/dist/components/form/FormToggle.stories.svelte +13 -16
- package/dist/components/form/FormToggle.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormToggle.svelte +3 -3
- package/dist/components/form/FormUISchemaRenderer.svelte +12 -19
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +3 -3
- package/dist/components/form/index.d.ts +19 -19
- package/dist/components/form/index.js +18 -18
- package/dist/components/form/templateAutocomplete.d.ts +2 -2
- package/dist/components/form/templateAutocomplete.js +55 -64
- package/dist/components/form/types.d.ts +6 -6
- package/dist/components/form/types.js +4 -9
- package/dist/components/icons/AlertCircleIcon.svelte +1 -6
- package/dist/components/icons/CogIcon.svelte +1 -6
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +27 -27
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ChoicePrompt.svelte +17 -41
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +17 -17
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.svelte +10 -16
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/FormPrompt.svelte +10 -15
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/InterruptBubble.svelte +87 -121
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +2 -2
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +37 -37
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ReviewPrompt.svelte +55 -75
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +16 -17
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.svelte +13 -18
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/index.d.ts +6 -5
- package/dist/components/interrupt/index.js +6 -5
- package/dist/components/layouts/MainLayout.svelte +46 -84
- package/dist/components/layouts/MainLayout.svelte.d.ts +6 -6
- package/dist/components/nodes/GatewayNode.stories.svelte +64 -65
- package/dist/components/nodes/GatewayNode.svelte +37 -70
- package/dist/components/nodes/GatewayNode.svelte.d.ts +3 -3
- package/dist/components/nodes/IdeaNode.stories.svelte +25 -26
- package/dist/components/nodes/IdeaNode.svelte +22 -36
- package/dist/components/nodes/IdeaNode.svelte.d.ts +1 -1
- package/dist/components/nodes/NotesNode.stories.svelte +37 -38
- package/dist/components/nodes/NotesNode.svelte +28 -39
- package/dist/components/nodes/NotesNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SimpleNode.stories.svelte +137 -138
- package/dist/components/nodes/SimpleNode.svelte +44 -74
- package/dist/components/nodes/SimpleNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SquareNode.stories.svelte +75 -75
- package/dist/components/nodes/SquareNode.svelte +42 -68
- package/dist/components/nodes/SquareNode.svelte.d.ts +1 -1
- package/dist/components/nodes/TerminalNode.stories.svelte +10 -10
- package/dist/components/nodes/TerminalNode.svelte +74 -112
- package/dist/components/nodes/TerminalNode.svelte.d.ts +1 -1
- package/dist/components/nodes/ToolNode.stories.svelte +115 -116
- package/dist/components/nodes/ToolNode.svelte +31 -64
- package/dist/components/nodes/ToolNode.svelte.d.ts +1 -1
- package/dist/components/nodes/WorkflowNode.stories.svelte +84 -89
- package/dist/components/nodes/WorkflowNode.svelte +50 -103
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +3 -3
- package/dist/components/playground/ChatPanel.svelte +47 -103
- package/dist/components/playground/ExecutionLogs.svelte +45 -68
- package/dist/components/playground/InputCollector.svelte +32 -51
- package/dist/components/playground/MessageBubble.stories.svelte +25 -25
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +1 -1
- package/dist/components/playground/MessageBubble.svelte +54 -70
- package/dist/components/playground/MessageBubble.svelte.d.ts +1 -1
- package/dist/components/playground/Playground.svelte +60 -91
- package/dist/components/playground/Playground.svelte.d.ts +3 -3
- package/dist/components/playground/PlaygroundModal.svelte +8 -12
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -3
- package/dist/components/playground/SessionManager.svelte +34 -40
- package/dist/components/playground/SessionManager.svelte.d.ts +1 -1
- package/dist/config/agentSpecEndpoints.d.ts +1 -1
- package/dist/config/agentSpecEndpoints.js +20 -20
- package/dist/config/constants.js +2 -2
- package/dist/config/defaultCategories.d.ts +1 -1
- package/dist/config/defaultCategories.js +86 -86
- package/dist/config/defaultPortConfig.d.ts +1 -1
- package/dist/config/defaultPortConfig.js +144 -144
- package/dist/config/endpoints.d.ts +12 -4
- package/dist/config/endpoints.js +70 -65
- package/dist/config/runtimeConfig.d.ts +2 -2
- package/dist/config/runtimeConfig.js +8 -8
- package/dist/core/index.d.ts +68 -63
- package/dist/core/index.js +44 -35
- package/dist/display/index.d.ts +2 -2
- package/dist/display/index.js +2 -2
- package/dist/editor/index.d.ts +64 -62
- package/dist/editor/index.js +57 -55
- package/dist/form/code.d.ts +5 -5
- package/dist/form/code.js +14 -14
- package/dist/form/fieldRegistry.d.ts +3 -3
- package/dist/form/fieldRegistry.js +9 -11
- package/dist/form/full.d.ts +8 -8
- package/dist/form/full.js +9 -9
- package/dist/form/index.d.ts +18 -18
- package/dist/form/index.js +16 -16
- package/dist/form/markdown.d.ts +4 -4
- package/dist/form/markdown.js +8 -8
- package/dist/helpers/proximityConnect.d.ts +3 -3
- package/dist/helpers/proximityConnect.js +40 -35
- package/dist/helpers/workflowEditorHelper.d.ts +8 -58
- package/dist/helpers/workflowEditorHelper.js +73 -292
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/mocks/app-environment.js +2 -2
- package/dist/mocks/app-forms.js +1 -1
- package/dist/mocks/app-navigation.js +2 -2
- package/dist/mocks/app-stores.js +3 -3
- package/dist/playground/index.d.ts +19 -19
- package/dist/playground/index.js +16 -16
- package/dist/playground/mount.d.ts +3 -3
- package/dist/playground/mount.js +24 -24
- package/dist/registry/builtinFormats.js +13 -13
- package/dist/registry/builtinNodes.d.ts +2 -2
- package/dist/registry/builtinNodes.js +77 -77
- package/dist/registry/index.d.ts +4 -4
- package/dist/registry/index.js +4 -4
- package/dist/registry/nodeComponentRegistry.d.ts +8 -8
- package/dist/registry/nodeComponentRegistry.js +9 -11
- package/dist/registry/plugin.d.ts +2 -2
- package/dist/registry/plugin.js +11 -11
- package/dist/registry/workflowFormatRegistry.d.ts +3 -3
- package/dist/registry/workflowFormatRegistry.js +2 -2
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/schemas/v1/workflow.schema.json +107 -22
- package/dist/services/agentSpecExecutionService.d.ts +3 -3
- package/dist/services/agentSpecExecutionService.js +55 -56
- package/dist/services/api.d.ts +2 -2
- package/dist/services/api.js +37 -37
- package/dist/services/apiVariableService.d.ts +1 -1
- package/dist/services/apiVariableService.js +34 -41
- package/dist/services/autoSaveService.js +8 -8
- package/dist/services/categoriesApi.d.ts +2 -2
- package/dist/services/categoriesApi.js +8 -8
- package/dist/services/chatService.d.ts +65 -0
- package/dist/services/chatService.js +131 -0
- package/dist/services/draftStorage.d.ts +1 -1
- package/dist/services/draftStorage.js +11 -11
- package/dist/services/dynamicSchemaService.d.ts +1 -1
- package/dist/services/dynamicSchemaService.js +39 -41
- package/dist/services/globalSave.d.ts +2 -2
- package/dist/services/globalSave.js +38 -41
- package/dist/services/historyService.d.ts +7 -5
- package/dist/services/historyService.js +29 -14
- package/dist/services/interruptService.d.ts +1 -1
- package/dist/services/interruptService.js +29 -35
- package/dist/services/nodeExecutionService.d.ts +1 -1
- package/dist/services/nodeExecutionService.js +44 -45
- package/dist/services/playgroundService.d.ts +1 -1
- package/dist/services/playgroundService.js +29 -29
- package/dist/services/portConfigApi.d.ts +2 -2
- package/dist/services/portConfigApi.js +8 -8
- package/dist/services/settingsService.d.ts +2 -2
- package/dist/services/settingsService.js +19 -25
- package/dist/services/toastService.d.ts +4 -4
- package/dist/services/toastService.js +33 -33
- package/dist/services/variableService.d.ts +1 -1
- package/dist/services/variableService.js +36 -36
- package/dist/services/workflowStorage.d.ts +2 -2
- package/dist/services/workflowStorage.js +13 -13
- package/dist/settings/index.d.ts +7 -7
- package/dist/settings/index.js +6 -6
- package/dist/skins/default.d.ts +1 -1
- package/dist/skins/default.js +1 -1
- package/dist/skins/index.d.ts +3 -3
- package/dist/skins/index.js +7 -7
- package/dist/skins/slate.d.ts +1 -1
- package/dist/skins/slate.js +69 -69
- package/dist/stores/categoriesStore.svelte.d.ts +1 -1
- package/dist/stores/categoriesStore.svelte.js +5 -5
- package/dist/stores/editorStateMachine.svelte.d.ts +2 -2
- package/dist/stores/editorStateMachine.svelte.js +34 -34
- package/dist/stores/historyStore.svelte.d.ts +4 -4
- package/dist/stores/historyStore.svelte.js +4 -4
- package/dist/stores/interruptStore.svelte.d.ts +3 -3
- package/dist/stores/interruptStore.svelte.js +27 -22
- package/dist/stores/playgroundStore.svelte.d.ts +3 -3
- package/dist/stores/playgroundStore.svelte.js +29 -23
- package/dist/stores/portCoordinateStore.svelte.d.ts +6 -2
- package/dist/stores/portCoordinateStore.svelte.js +30 -39
- package/dist/stores/settingsStore.svelte.d.ts +2 -2
- package/dist/stores/settingsStore.svelte.js +57 -62
- package/dist/stores/workflowStore.svelte.d.ts +34 -5
- package/dist/stores/workflowStore.svelte.js +127 -108
- package/dist/stories/CanvasDecorator.svelte +7 -10
- package/dist/stories/CanvasDecorator.svelte.d.ts +2 -2
- package/dist/stories/EdgeDecorator.svelte +28 -31
- package/dist/stories/EdgeDecorator.svelte.d.ts +1 -1
- package/dist/stories/NodeDecorator.svelte +14 -20
- package/dist/stories/NodeDecorator.svelte.d.ts +1 -1
- package/dist/stories/utils.d.ts +2 -2
- package/dist/stories/utils.js +89 -93
- package/dist/styles/base.css +16 -50
- package/dist/styles/tokens.css +10 -28
- package/dist/svelte-app.d.ts +10 -10
- package/dist/svelte-app.js +39 -39
- package/dist/themes/default.d.ts +1 -1
- package/dist/themes/default.js +4 -4
- package/dist/themes/index.d.ts +3 -3
- package/dist/themes/index.js +11 -11
- package/dist/themes/minimal.d.ts +1 -1
- package/dist/themes/minimal.js +5 -5
- package/dist/types/agentspec.d.ts +18 -18
- package/dist/types/agentspec.js +2 -2
- package/dist/types/auth.d.ts +1 -1
- package/dist/types/auth.js +6 -6
- package/dist/types/chat.d.ts +63 -0
- package/dist/types/chat.js +9 -0
- package/dist/types/config.d.ts +6 -6
- package/dist/types/events.d.ts +28 -2
- package/dist/types/events.js +2 -1
- package/dist/types/index.d.ts +40 -32
- package/dist/types/index.js +6 -6
- package/dist/types/interrupt.d.ts +6 -6
- package/dist/types/interrupt.js +21 -21
- package/dist/types/interruptState.d.ts +12 -12
- package/dist/types/interruptState.js +66 -66
- package/dist/types/playground.d.ts +7 -7
- package/dist/types/playground.js +14 -14
- package/dist/types/settings.d.ts +12 -4
- package/dist/types/settings.js +21 -23
- package/dist/types/skin.d.ts +1 -1
- package/dist/types/theme.d.ts +2 -2
- package/dist/types/uischema.d.ts +4 -4
- package/dist/types/uischema.js +3 -3
- package/dist/utils/colors.d.ts +1 -1
- package/dist/utils/colors.js +95 -97
- package/dist/utils/config.d.ts +2 -2
- package/dist/utils/config.js +48 -48
- package/dist/utils/connections.d.ts +2 -2
- package/dist/utils/connections.js +15 -15
- package/dist/utils/edgeStyling.d.ts +42 -0
- package/dist/utils/edgeStyling.js +173 -0
- package/dist/utils/errors.js +3 -3
- package/dist/utils/fetchWithAuth.d.ts +1 -1
- package/dist/utils/fetchWithAuth.js +2 -2
- package/dist/utils/handleIds.d.ts +2 -2
- package/dist/utils/handleIds.js +8 -8
- package/dist/utils/handlePositioning.d.ts +1 -1
- package/dist/utils/handlePositioning.js +2 -2
- package/dist/utils/icons.d.ts +1 -1
- package/dist/utils/icons.js +74 -74
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/logger.js +7 -7
- package/dist/utils/nodeIds.d.ts +31 -0
- package/dist/utils/nodeIds.js +42 -0
- package/dist/utils/nodeStatus.d.ts +1 -1
- package/dist/utils/nodeStatus.js +48 -48
- package/dist/utils/nodeSwap.d.ts +221 -0
- package/dist/utils/nodeSwap.js +680 -0
- package/dist/utils/nodeTypes.d.ts +1 -1
- package/dist/utils/nodeTypes.js +20 -21
- package/dist/utils/nodeWrapper.d.ts +7 -7
- package/dist/utils/nodeWrapper.js +19 -21
- package/dist/utils/performanceUtils.d.ts +1 -1
- package/dist/utils/performanceUtils.js +1 -2
- package/dist/utils/portUtils.d.ts +2 -2
- package/dist/utils/portUtils.js +1 -1
- package/dist/utils/sanitize.js +1 -1
- package/dist/utils/uischema.d.ts +2 -2
- package/dist/utils/uischema.js +8 -8
- package/dist/utils/validation.js +8 -8
- package/package.json +12 -11
- package/dist/helpers/nodeLayoutHelper.d.ts +0 -14
- package/dist/helpers/nodeLayoutHelper.js +0 -19
package/dist/skins/slate.js
CHANGED
|
@@ -2,93 +2,93 @@ export const slateSkin = {
|
|
|
2
2
|
tokens: {
|
|
3
3
|
// --- Display / structural tokens (apply in both light and dark) ---
|
|
4
4
|
// Node icon: hide squircle, show circle dot
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
'node-icon-display': 'none',
|
|
6
|
+
'node-circle-display': 'flex',
|
|
7
7
|
// Sidebar: hide search + header, hide cards, show flat list
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
'sidebar-search-display': 'none',
|
|
9
|
+
'sidebar-header-display': 'none',
|
|
10
|
+
'sidebar-card-display': 'none',
|
|
11
|
+
'sidebar-flat-display': 'block',
|
|
12
12
|
// Navbar: split buttons instead of dropdown
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
'navbar-split-display': 'flex',
|
|
14
|
+
'navbar-dropdown-display': 'none',
|
|
15
15
|
// --- Light mode color palette (cool lavender-white) ---
|
|
16
|
-
background:
|
|
17
|
-
foreground:
|
|
18
|
-
muted:
|
|
19
|
-
|
|
20
|
-
card:
|
|
21
|
-
|
|
22
|
-
border:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
header:
|
|
26
|
-
|
|
16
|
+
background: '#f6f6ff',
|
|
17
|
+
foreground: '#13131a',
|
|
18
|
+
muted: '#eeeef8',
|
|
19
|
+
'muted-foreground': '#5a5a7a',
|
|
20
|
+
card: '#ffffff',
|
|
21
|
+
'card-foreground': '#13131a',
|
|
22
|
+
border: '#d0d0e8',
|
|
23
|
+
'border-muted': '#e4e4f4',
|
|
24
|
+
'border-strong': '#b0b0cc',
|
|
25
|
+
header: '#ededf8',
|
|
26
|
+
'layout-background': 'linear-gradient(135deg, #f4f4ff 0%, #ece8ff 50%, #e6e0ff 100%)',
|
|
27
27
|
// Primary brand colors (website accent purple)
|
|
28
|
-
primary:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
primary: '#6c63ff',
|
|
29
|
+
'primary-hover': '#5b52ef',
|
|
30
|
+
'primary-foreground': '#ffffff',
|
|
31
|
+
'primary-muted': 'rgba(108, 99, 255, 0.1)',
|
|
32
32
|
// Scrollbar
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
'scrollbar-thumb': '#d0d0e8',
|
|
34
|
+
'scrollbar-track': '#f0f0f8',
|
|
35
35
|
// Backdrop
|
|
36
|
-
backdrop:
|
|
36
|
+
backdrop: 'rgba(246, 246, 255, 0.9)',
|
|
37
37
|
// Node border and port ring
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
'node-border': '#9898b8',
|
|
39
|
+
'node-border-hover': '#7878a8',
|
|
40
|
+
'handle-border': '#ffffff',
|
|
41
41
|
// Category header: dim purple-grey
|
|
42
|
-
|
|
42
|
+
'sidebar-category-color': '#c0c0d8',
|
|
43
43
|
// Flat item text: dark for light bg readability
|
|
44
|
-
|
|
44
|
+
'sidebar-flat-item-color': '#4a4a6a',
|
|
45
45
|
// Logo: monochrome purple-grey to match skin
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
'logo-bg': '#eeeef8',
|
|
47
|
+
'logo-stroke': '#5a5a7a',
|
|
48
|
+
'logo-line-fill': '#5a5a7a',
|
|
49
|
+
'logo-drop': '#009cde',
|
|
50
|
+
'logo-circle': '#f46351',
|
|
51
|
+
'logo-left': '#ccbaf4',
|
|
52
|
+
'logo-right': '#ffc423'
|
|
53
53
|
},
|
|
54
54
|
darkTokens: {
|
|
55
55
|
// --- Dark mode color palette (deep navy / original slate) ---
|
|
56
|
-
background:
|
|
57
|
-
foreground:
|
|
58
|
-
muted:
|
|
59
|
-
|
|
60
|
-
card:
|
|
61
|
-
|
|
62
|
-
border:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
header:
|
|
66
|
-
|
|
56
|
+
background: '#13131a',
|
|
57
|
+
foreground: '#c0c0d8',
|
|
58
|
+
muted: '#1a1a28',
|
|
59
|
+
'muted-foreground': '#7a7a9a',
|
|
60
|
+
card: '#1a1a28',
|
|
61
|
+
'card-foreground': '#e8e8f0',
|
|
62
|
+
border: '#2a2a3a',
|
|
63
|
+
'border-muted': '#1e1e2a',
|
|
64
|
+
'border-strong': '#3a3a55',
|
|
65
|
+
header: '#1a1a25',
|
|
66
|
+
'layout-background': '#0a0a0f',
|
|
67
67
|
// Primary brand colors
|
|
68
|
-
primary:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
primary: '#6c63ff',
|
|
69
|
+
'primary-hover': '#7c74ff',
|
|
70
|
+
'primary-foreground': '#ffffff',
|
|
71
|
+
'primary-muted': 'rgba(108, 99, 255, 0.15)',
|
|
72
72
|
// Scrollbar
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
'scrollbar-thumb': '#2a2a3a',
|
|
74
|
+
'scrollbar-track': '#13131a',
|
|
75
75
|
// Backdrop
|
|
76
|
-
backdrop:
|
|
76
|
+
backdrop: 'rgba(19, 19, 26, 0.9)',
|
|
77
77
|
// Node border and port ring: purplish-grey matching dark palette
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
'node-border': '#9898b8',
|
|
79
|
+
'node-border-hover': '#aeaed0',
|
|
80
|
+
'handle-border': '#9898b8',
|
|
81
81
|
// Category header: extremely dim
|
|
82
|
-
|
|
82
|
+
'sidebar-category-color': '#3a3a55',
|
|
83
83
|
// Flat item text: muted, not full-brightness white
|
|
84
|
-
|
|
84
|
+
'sidebar-flat-item-color': '#8888aa',
|
|
85
85
|
// Logo: monochrome purple-grey to match dark skin
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
86
|
+
'logo-bg': 'none',
|
|
87
|
+
'logo-stroke': '#9898b8',
|
|
88
|
+
'logo-line-fill': 'none',
|
|
89
|
+
'logo-drop': 'none',
|
|
90
|
+
'logo-circle': 'none',
|
|
91
|
+
'logo-left': 'none',
|
|
92
|
+
'logo-right': 'none'
|
|
93
|
+
}
|
|
94
94
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Manages category definitions with merged defaults and API-provided overrides.
|
|
5
5
|
* Exposes lookup helpers for icon, color, and label resolution.
|
|
6
6
|
*/
|
|
7
|
-
import type { CategoryDefinition, NodeCategory } from
|
|
7
|
+
import type { CategoryDefinition, NodeCategory } from '../types/index.js';
|
|
8
8
|
/**
|
|
9
9
|
* Get all category definitions, sorted by weight.
|
|
10
10
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Manages category definitions with merged defaults and API-provided overrides.
|
|
5
5
|
* Exposes lookup helpers for icon, color, and label resolution.
|
|
6
6
|
*/
|
|
7
|
-
import { DEFAULT_CATEGORIES } from
|
|
7
|
+
import { DEFAULT_CATEGORIES } from '../config/defaultCategories.js';
|
|
8
8
|
/**
|
|
9
9
|
* Internal reactive state holding the category definitions.
|
|
10
10
|
* Initialized with defaults, updated when API data is fetched.
|
|
@@ -39,7 +39,7 @@ export function initializeCategories(apiCategories) {
|
|
|
39
39
|
for (const cat of apiCategories) {
|
|
40
40
|
defaultMap.set(cat.name, {
|
|
41
41
|
...defaultMap.get(cat.name),
|
|
42
|
-
...cat
|
|
42
|
+
...cat
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
categoriesState = Array.from(defaultMap.values());
|
|
@@ -55,19 +55,19 @@ export function getCategoryLabel(category) {
|
|
|
55
55
|
return category
|
|
56
56
|
.split(/[\s_-]+/)
|
|
57
57
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
58
|
-
.join(
|
|
58
|
+
.join(' ');
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Get the icon for a category.
|
|
62
62
|
*/
|
|
63
63
|
export function getCategoryIcon(category) {
|
|
64
|
-
return categoryMap.get(category)?.icon ??
|
|
64
|
+
return categoryMap.get(category)?.icon ?? 'mdi:folder';
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Get the color token for a category.
|
|
68
68
|
*/
|
|
69
69
|
export function getCategoryColor(category) {
|
|
70
|
-
return categoryMap.get(category)?.color ??
|
|
70
|
+
return categoryMap.get(category)?.color ?? 'var(--fd-node-slate)';
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Get the full category definition, or undefined if not found.
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module stores/editorStateMachine
|
|
9
9
|
*/
|
|
10
|
-
export type EditorState =
|
|
11
|
-
export type EditorEvent =
|
|
10
|
+
export type EditorState = 'uninitialized' | 'loading' | 'idle' | 'dragging' | 'connecting' | 'dropping' | 'restoring' | 'deleting' | 'updating_node';
|
|
11
|
+
export type EditorEvent = 'WORKFLOW_LOADED' | 'LOAD_COMPLETE' | 'START_DRAG' | 'STOP_DRAG' | 'START_CONNECT' | 'CONNECTION_MADE' | 'CONNECTION_CANCELLED' | 'START_DROP' | 'DROP_COMPLETE' | 'DROP_CANCELLED' | 'START_RESTORE' | 'RESTORE_COMPLETE' | 'EXTERNAL_STORE_CHANGE' | 'SYNC_COMPLETE' | 'START_DELETE' | 'DELETE_COMPLETE' | 'START_NODE_UPDATE' | 'UPDATE_COMPLETE' | 'WORKFLOW_SWITCHED' | 'WORKFLOW_CLEARED' | 'RESET';
|
|
12
12
|
/** What operations are permitted in the current state */
|
|
13
13
|
export interface StatePermissions {
|
|
14
14
|
/** Whether the editor can write to the global workflow store */
|
|
@@ -7,50 +7,50 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module stores/editorStateMachine
|
|
9
9
|
*/
|
|
10
|
-
import { logger } from
|
|
10
|
+
import { logger } from '../utils/logger.js';
|
|
11
11
|
const transitions = {
|
|
12
12
|
uninitialized: {
|
|
13
|
-
WORKFLOW_LOADED:
|
|
13
|
+
WORKFLOW_LOADED: 'loading'
|
|
14
14
|
},
|
|
15
15
|
loading: {
|
|
16
|
-
LOAD_COMPLETE:
|
|
16
|
+
LOAD_COMPLETE: 'idle'
|
|
17
17
|
},
|
|
18
18
|
idle: {
|
|
19
|
-
START_DRAG:
|
|
20
|
-
START_CONNECT:
|
|
21
|
-
START_DROP:
|
|
22
|
-
START_RESTORE:
|
|
23
|
-
EXTERNAL_STORE_CHANGE:
|
|
24
|
-
START_DELETE:
|
|
25
|
-
START_NODE_UPDATE:
|
|
26
|
-
WORKFLOW_SWITCHED:
|
|
27
|
-
WORKFLOW_CLEARED:
|
|
19
|
+
START_DRAG: 'dragging',
|
|
20
|
+
START_CONNECT: 'connecting',
|
|
21
|
+
START_DROP: 'dropping',
|
|
22
|
+
START_RESTORE: 'restoring',
|
|
23
|
+
EXTERNAL_STORE_CHANGE: 'loading',
|
|
24
|
+
START_DELETE: 'deleting',
|
|
25
|
+
START_NODE_UPDATE: 'updating_node',
|
|
26
|
+
WORKFLOW_SWITCHED: 'loading',
|
|
27
|
+
WORKFLOW_CLEARED: 'uninitialized'
|
|
28
28
|
},
|
|
29
29
|
dragging: {
|
|
30
|
-
STOP_DRAG:
|
|
30
|
+
STOP_DRAG: 'idle'
|
|
31
31
|
},
|
|
32
32
|
connecting: {
|
|
33
|
-
CONNECTION_MADE:
|
|
34
|
-
CONNECTION_CANCELLED:
|
|
33
|
+
CONNECTION_MADE: 'idle',
|
|
34
|
+
CONNECTION_CANCELLED: 'idle'
|
|
35
35
|
},
|
|
36
36
|
dropping: {
|
|
37
|
-
DROP_COMPLETE:
|
|
38
|
-
DROP_CANCELLED:
|
|
37
|
+
DROP_COMPLETE: 'idle',
|
|
38
|
+
DROP_CANCELLED: 'idle'
|
|
39
39
|
},
|
|
40
40
|
restoring: {
|
|
41
|
-
RESTORE_COMPLETE:
|
|
41
|
+
RESTORE_COMPLETE: 'idle'
|
|
42
42
|
},
|
|
43
43
|
deleting: {
|
|
44
|
-
DELETE_COMPLETE:
|
|
44
|
+
DELETE_COMPLETE: 'idle'
|
|
45
45
|
},
|
|
46
46
|
updating_node: {
|
|
47
|
-
UPDATE_COMPLETE:
|
|
48
|
-
}
|
|
47
|
+
UPDATE_COMPLETE: 'idle'
|
|
48
|
+
}
|
|
49
49
|
};
|
|
50
50
|
/** Global transitions valid from any state */
|
|
51
51
|
const globalTransitions = {
|
|
52
|
-
RESET:
|
|
53
|
-
WORKFLOW_CLEARED:
|
|
52
|
+
RESET: 'uninitialized',
|
|
53
|
+
WORKFLOW_CLEARED: 'uninitialized'
|
|
54
54
|
};
|
|
55
55
|
// ---------------------------------------------------------------------------
|
|
56
56
|
// Permissions table
|
|
@@ -59,44 +59,44 @@ const permissions = {
|
|
|
59
59
|
uninitialized: {
|
|
60
60
|
canWriteToStore: false,
|
|
61
61
|
canPushHistory: false,
|
|
62
|
-
suppressEffect: false
|
|
62
|
+
suppressEffect: false
|
|
63
63
|
},
|
|
64
64
|
loading: {
|
|
65
65
|
canWriteToStore: false,
|
|
66
66
|
canPushHistory: false,
|
|
67
|
-
suppressEffect: false
|
|
67
|
+
suppressEffect: false
|
|
68
68
|
},
|
|
69
69
|
idle: { canWriteToStore: true, canPushHistory: true, suppressEffect: false },
|
|
70
70
|
dragging: {
|
|
71
71
|
canWriteToStore: true,
|
|
72
72
|
canPushHistory: false,
|
|
73
|
-
suppressEffect: true
|
|
73
|
+
suppressEffect: true
|
|
74
74
|
},
|
|
75
75
|
connecting: {
|
|
76
76
|
canWriteToStore: true,
|
|
77
77
|
canPushHistory: false,
|
|
78
|
-
suppressEffect: true
|
|
78
|
+
suppressEffect: true
|
|
79
79
|
},
|
|
80
80
|
dropping: {
|
|
81
81
|
canWriteToStore: true,
|
|
82
82
|
canPushHistory: false,
|
|
83
|
-
suppressEffect: true
|
|
83
|
+
suppressEffect: true
|
|
84
84
|
},
|
|
85
85
|
restoring: {
|
|
86
86
|
canWriteToStore: true,
|
|
87
87
|
canPushHistory: false,
|
|
88
|
-
suppressEffect: true
|
|
88
|
+
suppressEffect: true
|
|
89
89
|
},
|
|
90
90
|
deleting: {
|
|
91
91
|
canWriteToStore: true,
|
|
92
92
|
canPushHistory: false,
|
|
93
|
-
suppressEffect: true
|
|
93
|
+
suppressEffect: true
|
|
94
94
|
},
|
|
95
95
|
updating_node: {
|
|
96
96
|
canWriteToStore: true,
|
|
97
97
|
canPushHistory: false,
|
|
98
|
-
suppressEffect: true
|
|
99
|
-
}
|
|
98
|
+
suppressEffect: true
|
|
99
|
+
}
|
|
100
100
|
};
|
|
101
101
|
// ---------------------------------------------------------------------------
|
|
102
102
|
// Factory
|
|
@@ -110,7 +110,7 @@ const permissions = {
|
|
|
110
110
|
*
|
|
111
111
|
* Each WorkflowEditor component instance should create its own machine.
|
|
112
112
|
*/
|
|
113
|
-
export function createEditorStateMachine(initialState =
|
|
113
|
+
export function createEditorStateMachine(initialState = 'uninitialized') {
|
|
114
114
|
let _current = $state(initialState);
|
|
115
115
|
let _permissions = $state(permissions[initialState]);
|
|
116
116
|
const _listeners = new Set();
|
|
@@ -159,6 +159,6 @@ export function createEditorStateMachine(initialState = "uninitialized") {
|
|
|
159
159
|
},
|
|
160
160
|
send,
|
|
161
161
|
canSend,
|
|
162
|
-
onTransition
|
|
162
|
+
onTransition
|
|
163
163
|
};
|
|
164
164
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module stores/historyStore
|
|
8
8
|
*/
|
|
9
|
-
import { type HistoryState, type PushOptions } from
|
|
10
|
-
import type { Workflow } from
|
|
9
|
+
import { type HistoryState, type PushOptions } from '../services/historyService.js';
|
|
10
|
+
import type { Workflow } from '../types/index.js';
|
|
11
11
|
/**
|
|
12
12
|
* Clean up the historyService subscription created at module initialisation.
|
|
13
13
|
* Call this when tearing down the history store (e.g., in tests or on app
|
|
@@ -132,5 +132,5 @@ export declare const historyActions: {
|
|
|
132
132
|
*/
|
|
133
133
|
getState: () => HistoryState;
|
|
134
134
|
};
|
|
135
|
-
export type { HistoryEntry, HistoryState, PushOptions
|
|
136
|
-
export { HistoryService, historyService } from
|
|
135
|
+
export type { HistoryEntry, HistoryState, PushOptions } from '../services/historyService.js';
|
|
136
|
+
export { HistoryService, historyService } from '../services/historyService.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module stores/historyStore
|
|
8
8
|
*/
|
|
9
|
-
import { historyService
|
|
9
|
+
import { historyService } from '../services/historyService.js';
|
|
10
10
|
// =========================================================================
|
|
11
11
|
// Reactive State (Runes)
|
|
12
12
|
// =========================================================================
|
|
@@ -18,7 +18,7 @@ let historyState = $state({
|
|
|
18
18
|
canRedo: false,
|
|
19
19
|
currentIndex: 0,
|
|
20
20
|
historyLength: 0,
|
|
21
|
-
isInTransaction: false
|
|
21
|
+
isInTransaction: false
|
|
22
22
|
});
|
|
23
23
|
// Subscribe to history service changes and update the rune state.
|
|
24
24
|
// The unsubscribe function is stored so it can be called via
|
|
@@ -202,6 +202,6 @@ export const historyActions = {
|
|
|
202
202
|
*/
|
|
203
203
|
getState: () => {
|
|
204
204
|
return historyState;
|
|
205
|
-
}
|
|
205
|
+
}
|
|
206
206
|
};
|
|
207
|
-
export { HistoryService, historyService } from
|
|
207
|
+
export { HistoryService, historyService } from '../services/historyService.js';
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module stores/interruptStore
|
|
8
8
|
*/
|
|
9
|
-
import { SvelteMap } from
|
|
10
|
-
import type { Interrupt } from
|
|
11
|
-
import { type InterruptState, type TransitionResult } from
|
|
9
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
10
|
+
import type { Interrupt } from '../types/interrupt.js';
|
|
11
|
+
import { type InterruptState, type TransitionResult } from '../types/interruptState.js';
|
|
12
12
|
/**
|
|
13
13
|
* Extended interrupt with state machine
|
|
14
14
|
*/
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module stores/interruptStore
|
|
8
8
|
*/
|
|
9
|
-
import { SvelteMap } from
|
|
10
|
-
import { initialState, transition, isTerminalState, isSubmitting as checkIsSubmitting, hasError as checkHasError, getErrorMessage, getResolvedValue, toLegacyStatus
|
|
11
|
-
import { logger } from
|
|
9
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
10
|
+
import { initialState, transition, isTerminalState, isSubmitting as checkIsSubmitting, hasError as checkHasError, getErrorMessage, getResolvedValue, toLegacyStatus } from '../types/interruptState.js';
|
|
11
|
+
import { logger } from '../utils/logger.js';
|
|
12
12
|
// =========================================================================
|
|
13
13
|
// Core Reactive State
|
|
14
14
|
// =========================================================================
|
|
@@ -56,7 +56,12 @@ export function getPendingInterrupts() {
|
|
|
56
56
|
* Get count of pending interrupts
|
|
57
57
|
*/
|
|
58
58
|
export function getPendingInterruptCount() {
|
|
59
|
-
|
|
59
|
+
let count = 0;
|
|
60
|
+
for (const interrupt of interrupts.values()) {
|
|
61
|
+
if (!isTerminalState(interrupt.machineState))
|
|
62
|
+
count++;
|
|
63
|
+
}
|
|
64
|
+
return count;
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
67
|
* Get resolved interrupts array
|
|
@@ -64,7 +69,7 @@ export function getPendingInterruptCount() {
|
|
|
64
69
|
export function getResolvedInterrupts() {
|
|
65
70
|
const resolved = [];
|
|
66
71
|
interrupts.forEach((interrupt) => {
|
|
67
|
-
if (interrupt.machineState.status ===
|
|
72
|
+
if (interrupt.machineState.status === 'resolved') {
|
|
68
73
|
resolved.push(interrupt);
|
|
69
74
|
}
|
|
70
75
|
});
|
|
@@ -97,7 +102,7 @@ function applyAction(interruptId, action) {
|
|
|
97
102
|
return {
|
|
98
103
|
state: initialState,
|
|
99
104
|
valid: false,
|
|
100
|
-
error: `Interrupt not found: ${interruptId}
|
|
105
|
+
error: `Interrupt not found: ${interruptId}`
|
|
101
106
|
};
|
|
102
107
|
}
|
|
103
108
|
const result = transition(interrupt.machineState, action);
|
|
@@ -110,11 +115,11 @@ function applyAction(interruptId, action) {
|
|
|
110
115
|
machineState: result.state,
|
|
111
116
|
status: toLegacyStatus(result.state),
|
|
112
117
|
responseValue: getResolvedValue(result.state) ?? current.responseValue,
|
|
113
|
-
resolvedAt: result.state.status ===
|
|
118
|
+
resolvedAt: result.state.status === 'resolved'
|
|
114
119
|
? result.state.resolvedAt
|
|
115
|
-
: result.state.status ===
|
|
120
|
+
: result.state.status === 'cancelled'
|
|
116
121
|
? result.state.cancelledAt
|
|
117
|
-
: current.resolvedAt
|
|
122
|
+
: current.resolvedAt
|
|
118
123
|
};
|
|
119
124
|
interrupts.set(interruptId, newInterrupt);
|
|
120
125
|
}
|
|
@@ -142,7 +147,7 @@ export const interruptActions = {
|
|
|
142
147
|
const machineState = existing?.machineState ?? initialState;
|
|
143
148
|
const interruptWithState = {
|
|
144
149
|
...interrupt,
|
|
145
|
-
machineState
|
|
150
|
+
machineState
|
|
146
151
|
};
|
|
147
152
|
interrupts.set(interrupt.id, interruptWithState);
|
|
148
153
|
},
|
|
@@ -159,7 +164,7 @@ export const interruptActions = {
|
|
|
159
164
|
const machineState = existing?.machineState ?? initialState;
|
|
160
165
|
const interruptWithState = {
|
|
161
166
|
...interrupt,
|
|
162
|
-
machineState
|
|
167
|
+
machineState
|
|
163
168
|
};
|
|
164
169
|
interrupts.set(interrupt.id, interruptWithState);
|
|
165
170
|
});
|
|
@@ -172,7 +177,7 @@ export const interruptActions = {
|
|
|
172
177
|
* @returns Transition result
|
|
173
178
|
*/
|
|
174
179
|
startSubmit: (interruptId, value) => {
|
|
175
|
-
return applyAction(interruptId, { type:
|
|
180
|
+
return applyAction(interruptId, { type: 'SUBMIT', value });
|
|
176
181
|
},
|
|
177
182
|
/**
|
|
178
183
|
* Start cancelling an interrupt (user clicked cancel)
|
|
@@ -181,7 +186,7 @@ export const interruptActions = {
|
|
|
181
186
|
* @returns Transition result
|
|
182
187
|
*/
|
|
183
188
|
startCancel: (interruptId) => {
|
|
184
|
-
return applyAction(interruptId, { type:
|
|
189
|
+
return applyAction(interruptId, { type: 'CANCEL' });
|
|
185
190
|
},
|
|
186
191
|
/**
|
|
187
192
|
* Mark submission as successful
|
|
@@ -190,7 +195,7 @@ export const interruptActions = {
|
|
|
190
195
|
* @returns Transition result
|
|
191
196
|
*/
|
|
192
197
|
submitSuccess: (interruptId) => {
|
|
193
|
-
return applyAction(interruptId, { type:
|
|
198
|
+
return applyAction(interruptId, { type: 'SUCCESS' });
|
|
194
199
|
},
|
|
195
200
|
/**
|
|
196
201
|
* Mark submission as failed
|
|
@@ -200,7 +205,7 @@ export const interruptActions = {
|
|
|
200
205
|
* @returns Transition result
|
|
201
206
|
*/
|
|
202
207
|
submitFailure: (interruptId, error) => {
|
|
203
|
-
return applyAction(interruptId, { type:
|
|
208
|
+
return applyAction(interruptId, { type: 'FAILURE', error });
|
|
204
209
|
},
|
|
205
210
|
/**
|
|
206
211
|
* Retry a failed submission
|
|
@@ -209,7 +214,7 @@ export const interruptActions = {
|
|
|
209
214
|
* @returns Transition result
|
|
210
215
|
*/
|
|
211
216
|
retry: (interruptId) => {
|
|
212
|
-
return applyAction(interruptId, { type:
|
|
217
|
+
return applyAction(interruptId, { type: 'RETRY' });
|
|
213
218
|
},
|
|
214
219
|
/**
|
|
215
220
|
* Reset an interrupt to idle state
|
|
@@ -218,7 +223,7 @@ export const interruptActions = {
|
|
|
218
223
|
* @returns Transition result
|
|
219
224
|
*/
|
|
220
225
|
resetInterrupt: (interruptId) => {
|
|
221
|
-
return applyAction(interruptId, { type:
|
|
226
|
+
return applyAction(interruptId, { type: 'RESET' });
|
|
222
227
|
},
|
|
223
228
|
/**
|
|
224
229
|
* Mark an interrupt as resolved with the user's response
|
|
@@ -227,9 +232,9 @@ export const interruptActions = {
|
|
|
227
232
|
* @param value - The resolved value
|
|
228
233
|
*/
|
|
229
234
|
resolveInterrupt: (interruptId, value) => {
|
|
230
|
-
const submitResult = applyAction(interruptId, { type:
|
|
235
|
+
const submitResult = applyAction(interruptId, { type: 'SUBMIT', value });
|
|
231
236
|
if (submitResult.valid) {
|
|
232
|
-
applyAction(interruptId, { type:
|
|
237
|
+
applyAction(interruptId, { type: 'SUCCESS' });
|
|
233
238
|
}
|
|
234
239
|
},
|
|
235
240
|
/**
|
|
@@ -238,9 +243,9 @@ export const interruptActions = {
|
|
|
238
243
|
* @param interruptId - The interrupt ID
|
|
239
244
|
*/
|
|
240
245
|
cancelInterrupt: (interruptId) => {
|
|
241
|
-
const cancelResult = applyAction(interruptId, { type:
|
|
246
|
+
const cancelResult = applyAction(interruptId, { type: 'CANCEL' });
|
|
242
247
|
if (cancelResult.valid) {
|
|
243
|
-
applyAction(interruptId, { type:
|
|
248
|
+
applyAction(interruptId, { type: 'SUCCESS' });
|
|
244
249
|
}
|
|
245
250
|
},
|
|
246
251
|
/**
|
|
@@ -276,7 +281,7 @@ export const interruptActions = {
|
|
|
276
281
|
*/
|
|
277
282
|
reset: () => {
|
|
278
283
|
interrupts.clear();
|
|
279
|
-
}
|
|
284
|
+
}
|
|
280
285
|
};
|
|
281
286
|
// =========================================================================
|
|
282
287
|
// Utilities
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module stores/playgroundStore
|
|
8
8
|
*/
|
|
9
|
-
import type { PlaygroundSession, PlaygroundMessage, PlaygroundInputField, PlaygroundSessionStatus, PlaygroundMessagesApiResponse } from
|
|
10
|
-
import type { Workflow } from
|
|
9
|
+
import type { PlaygroundSession, PlaygroundMessage, PlaygroundInputField, PlaygroundSessionStatus, PlaygroundMessagesApiResponse } from '../types/playground.js';
|
|
10
|
+
import type { Workflow } from '../types/index.js';
|
|
11
11
|
/**
|
|
12
12
|
* Get the current session
|
|
13
13
|
*/
|
|
@@ -124,7 +124,7 @@ export declare const playgroundActions: {
|
|
|
124
124
|
setMessages: (messageList: PlaygroundMessage[]) => void;
|
|
125
125
|
/**
|
|
126
126
|
* Add a message to the current session
|
|
127
|
-
*
|
|
127
|
+
* Uses binary search insertion for O(log n) instead of full sort.
|
|
128
128
|
*
|
|
129
129
|
* @param message - The message to add
|
|
130
130
|
*/
|