@flowdrop/flowdrop 1.0.1 → 1.2.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 +50 -50
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +25 -25
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +2 -2
- package/dist/adapters/agentspec/AgentSpecAdapter.js +133 -122
- package/dist/adapters/agentspec/agentAdapter.d.ts +2 -2
- package/dist/adapters/agentspec/agentAdapter.js +10 -10
- package/dist/adapters/agentspec/autoLayout.d.ts +1 -1
- package/dist/adapters/agentspec/autoLayout.js +2 -2
- 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 +22 -20
- package/dist/api/enhanced-client.d.ts +3 -3
- package/dist/api/enhanced-client.js +73 -72
- package/dist/components/App.svelte +1090 -961
- package/dist/components/App.svelte.d.ts +9 -6
- package/dist/components/CanvasBanner.stories.svelte +23 -20
- package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
- package/dist/components/CanvasBanner.svelte +52 -46
- package/dist/components/ConfigForm.svelte +1164 -1065
- package/dist/components/ConfigForm.svelte.d.ts +2 -2
- package/dist/components/ConfigModal.svelte +180 -180
- package/dist/components/ConfigModal.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.stories.svelte +35 -35
- package/dist/components/ConfigPanel.stories.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.svelte +178 -167
- package/dist/components/ConfigPanel.svelte.d.ts +1 -1
- package/dist/components/ConnectionLine.svelte +25 -25
- package/dist/components/EdgeRefresher.svelte +26 -26
- package/dist/components/FlowDropEdge.stories.svelte +179 -143
- package/dist/components/FlowDropEdge.svelte +147 -147
- package/dist/components/FlowDropEdge.svelte.d.ts +1 -1
- package/dist/components/FlowDropZone.svelte +63 -60
- package/dist/components/FlowDropZone.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.stories.svelte +19 -19
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.svelte +21 -21
- package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
- package/dist/components/Logo.stories.svelte +13 -13
- package/dist/components/Logo.stories.svelte.d.ts +1 -1
- package/dist/components/Logo.svelte +101 -95
- package/dist/components/LogsSidebar.svelte +553 -546
- package/dist/components/LogsSidebar.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.stories.svelte +29 -23
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.svelte +16 -14
- package/dist/components/Navbar.stories.svelte +43 -38
- package/dist/components/Navbar.stories.svelte.d.ts +1 -1
- package/dist/components/Navbar.svelte +760 -706
- package/dist/components/Navbar.svelte.d.ts +1 -1
- package/dist/components/NodeSidebar.svelte +905 -746
- package/dist/components/NodeSidebar.svelte.d.ts +5 -1
- package/dist/components/NodeStatusOverlay.stories.svelte +82 -70
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
- package/dist/components/NodeStatusOverlay.svelte +295 -280
- package/dist/components/NodeStatusOverlay.svelte.d.ts +3 -3
- package/dist/components/PipelineStatus.svelte +326 -300
- package/dist/components/PipelineStatus.svelte.d.ts +4 -4
- package/dist/components/PortCoordinateTracker.svelte +49 -47
- package/dist/components/PortCoordinateTracker.svelte.d.ts +1 -1
- package/dist/components/ReadOnlyDetails.svelte +156 -156
- package/dist/components/SchemaForm.stories.svelte +106 -98
- package/dist/components/SchemaForm.stories.svelte.d.ts +1 -1
- package/dist/components/SchemaForm.svelte +490 -463
- package/dist/components/SchemaForm.svelte.d.ts +2 -2
- package/dist/components/SettingsModal.svelte +226 -223
- package/dist/components/SettingsModal.svelte.d.ts +1 -1
- package/dist/components/SettingsPanel.svelte +637 -601
- package/dist/components/SettingsPanel.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.stories.svelte +62 -49
- package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.svelte +87 -87
- package/dist/components/StatusIcon.svelte.d.ts +2 -2
- package/dist/components/StatusLabel.stories.svelte +12 -12
- package/dist/components/StatusLabel.stories.svelte.d.ts +1 -1
- package/dist/components/StatusLabel.svelte +19 -19
- package/dist/components/ThemeToggle.stories.svelte +16 -16
- package/dist/components/ThemeToggle.stories.svelte.d.ts +1 -1
- package/dist/components/ThemeToggle.svelte +180 -169
- package/dist/components/ThemeToggle.svelte.d.ts +1 -1
- package/dist/components/UniversalNode.svelte +150 -138
- package/dist/components/UniversalNode.svelte.d.ts +3 -3
- package/dist/components/WorkflowEditor.svelte +1069 -1014
- package/dist/components/WorkflowEditor.svelte.d.ts +4 -4
- package/dist/components/form/FormArray.svelte +1034 -973
- package/dist/components/form/FormArray.svelte.d.ts +1 -1
- package/dist/components/form/FormAutocomplete.svelte +1021 -978
- package/dist/components/form/FormAutocomplete.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.stories.svelte +23 -20
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormCheckboxGroup.svelte +136 -136
- package/dist/components/form/FormCodeEditor.svelte +452 -434
- package/dist/components/form/FormField.svelte +366 -355
- package/dist/components/form/FormField.svelte.d.ts +2 -2
- package/dist/components/form/FormFieldLight.svelte +400 -384
- package/dist/components/form/FormFieldLight.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.stories.svelte +42 -42
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldWrapper.svelte +100 -93
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +1 -1
- package/dist/components/form/FormFieldset.svelte +108 -108
- package/dist/components/form/FormFieldset.svelte.d.ts +2 -2
- package/dist/components/form/FormMarkdownEditor.svelte +758 -725
- package/dist/components/form/FormNumberField.stories.svelte +25 -25
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormNumberField.svelte +88 -88
- package/dist/components/form/FormRangeField.stories.svelte +20 -20
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormRangeField.svelte +234 -226
- package/dist/components/form/FormSelect.stories.svelte +38 -38
- package/dist/components/form/FormSelect.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormSelect.svelte +101 -101
- package/dist/components/form/FormSelect.svelte.d.ts +1 -1
- package/dist/components/form/FormTemplateEditor.svelte +847 -798
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.stories.svelte +29 -23
- package/dist/components/form/FormTextField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.svelte +68 -68
- package/dist/components/form/FormTextarea.stories.svelte +28 -25
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextarea.svelte +74 -74
- package/dist/components/form/FormToggle.stories.svelte +23 -20
- package/dist/components/form/FormToggle.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormToggle.svelte +98 -98
- package/dist/components/form/FormUISchemaRenderer.svelte +120 -113
- 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 +64 -55
- package/dist/components/form/types.d.ts +6 -6
- package/dist/components/form/types.js +9 -4
- package/dist/components/icons/AlertCircleIcon.svelte +11 -0
- package/dist/components/icons/AlertCircleIcon.svelte.d.ts +26 -0
- package/dist/components/icons/CogIcon.svelte +11 -0
- package/dist/components/icons/CogIcon.svelte.d.ts +26 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +54 -38
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ChoicePrompt.svelte +407 -383
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +48 -48
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.svelte +280 -274
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/FormPrompt.svelte +223 -218
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/InterruptBubble.svelte +617 -583
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +2 -2
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +66 -56
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ReviewPrompt.svelte +861 -841
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +38 -33
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.svelte +333 -328
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +1 -1
- package/dist/components/interrupt/index.d.ts +5 -5
- package/dist/components/interrupt/index.js +5 -5
- package/dist/components/layouts/MainLayout.svelte +724 -691
- package/dist/components/layouts/MainLayout.svelte.d.ts +6 -6
- package/dist/components/nodes/GatewayNode.stories.svelte +100 -99
- package/dist/components/nodes/GatewayNode.svelte +605 -571
- package/dist/components/nodes/GatewayNode.svelte.d.ts +3 -3
- package/dist/components/nodes/IdeaNode.stories.svelte +44 -43
- package/dist/components/nodes/IdeaNode.svelte +451 -437
- package/dist/components/nodes/IdeaNode.svelte.d.ts +1 -1
- package/dist/components/nodes/NotesNode.stories.svelte +65 -64
- package/dist/components/nodes/NotesNode.svelte +380 -369
- package/dist/components/nodes/NotesNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SimpleNode.stories.svelte +145 -144
- package/dist/components/nodes/SimpleNode.svelte +486 -424
- package/dist/components/nodes/SimpleNode.svelte.d.ts +1 -1
- package/dist/components/nodes/SquareNode.stories.svelte +73 -73
- package/dist/components/nodes/SquareNode.svelte +439 -380
- package/dist/components/nodes/SquareNode.svelte.d.ts +1 -1
- package/dist/components/nodes/TerminalNode.stories.svelte +13 -13
- package/dist/components/nodes/TerminalNode.svelte +709 -670
- package/dist/components/nodes/TerminalNode.svelte.d.ts +1 -1
- package/dist/components/nodes/ToolNode.stories.svelte +181 -180
- package/dist/components/nodes/ToolNode.svelte +505 -447
- package/dist/components/nodes/ToolNode.svelte.d.ts +1 -1
- package/dist/components/nodes/WorkflowNode.stories.svelte +70 -46
- package/dist/components/nodes/WorkflowNode.svelte +621 -551
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +3 -3
- package/dist/components/playground/ChatPanel.svelte +945 -889
- package/dist/components/playground/ExecutionLogs.svelte +495 -472
- package/dist/components/playground/InputCollector.svelte +449 -428
- package/dist/components/playground/MessageBubble.stories.svelte +47 -47
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +1 -1
- package/dist/components/playground/MessageBubble.svelte +626 -610
- package/dist/components/playground/MessageBubble.svelte.d.ts +1 -1
- package/dist/components/playground/Playground.svelte +1088 -1057
- package/dist/components/playground/Playground.svelte.d.ts +3 -3
- package/dist/components/playground/PlaygroundModal.svelte +208 -204
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -3
- package/dist/components/playground/SessionManager.svelte +527 -521
- 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 +4 -4
- package/dist/config/endpoints.js +65 -65
- package/dist/config/runtimeConfig.d.ts +2 -2
- package/dist/config/runtimeConfig.js +8 -8
- package/dist/core/index.d.ts +63 -59
- package/dist/core/index.js +35 -33
- package/dist/display/index.d.ts +2 -2
- package/dist/display/index.js +2 -2
- package/dist/editor/index.d.ts +62 -62
- package/dist/editor/index.js +53 -53
- 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 +11 -9
- 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 +34 -32
- package/dist/helpers/workflowEditorHelper.d.ts +5 -5
- package/dist/helpers/workflowEditorHelper.js +108 -96
- 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 +9 -9
- package/dist/mocks/app-navigation.js +11 -11
- package/dist/mocks/app-stores.js +8 -8
- 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 +11 -9
- 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/services/agentSpecExecutionService.d.ts +3 -3
- package/dist/services/agentSpecExecutionService.js +59 -55
- 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 +41 -34
- 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/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 +41 -39
- package/dist/services/globalSave.d.ts +2 -2
- package/dist/services/globalSave.js +41 -38
- package/dist/services/historyService.d.ts +1 -1
- package/dist/services/historyService.js +8 -8
- package/dist/services/interruptService.d.ts +1 -1
- package/dist/services/interruptService.js +35 -29
- package/dist/services/nodeExecutionService.d.ts +1 -1
- package/dist/services/nodeExecutionService.js +45 -44
- 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 +25 -19
- 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 +2 -0
- package/dist/skins/default.js +1 -0
- package/dist/skins/index.d.ts +13 -0
- package/dist/skins/index.js +30 -0
- package/dist/skins/slate.d.ts +2 -0
- package/dist/skins/slate.js +78 -0
- 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 +65 -33
- 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 +21 -21
- package/dist/stores/playgroundStore.svelte.d.ts +2 -2
- package/dist/stores/playgroundStore.svelte.js +25 -18
- package/dist/stores/portCoordinateStore.svelte.d.ts +2 -2
- package/dist/stores/portCoordinateStore.svelte.js +15 -8
- package/dist/stores/settingsStore.svelte.d.ts +2 -2
- package/dist/stores/settingsStore.svelte.js +62 -57
- package/dist/stores/workflowStore.svelte.d.ts +3 -3
- package/dist/stores/workflowStore.svelte.js +50 -47
- package/dist/stories/CanvasDecorator.svelte +35 -32
- package/dist/stories/CanvasDecorator.svelte.d.ts +2 -2
- package/dist/stories/EdgeDecorator.svelte +102 -99
- package/dist/stories/EdgeDecorator.svelte.d.ts +1 -1
- package/dist/stories/NodeDecorator.svelte +59 -53
- package/dist/stories/NodeDecorator.svelte.d.ts +1 -1
- package/dist/stories/utils.d.ts +2 -2
- package/dist/stories/utils.js +105 -67
- package/dist/styles/base.css +599 -595
- package/dist/styles/toast.css +14 -14
- package/dist/styles/tokens.css +409 -378
- package/dist/svelte-app.d.ts +12 -9
- package/dist/svelte-app.js +40 -39
- package/dist/themes/default.d.ts +2 -0
- package/dist/themes/default.js +9 -0
- package/dist/themes/index.d.ts +13 -0
- package/dist/themes/index.js +44 -0
- package/dist/themes/minimal.d.ts +2 -0
- package/dist/themes/minimal.js +11 -0
- 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/config.d.ts +6 -6
- package/dist/types/events.d.ts +2 -2
- package/dist/types/events.js +2 -2
- package/dist/types/index.d.ts +32 -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 +5 -3
- package/dist/types/settings.js +25 -18
- package/dist/types/skin.d.ts +31 -0
- package/dist/types/skin.js +1 -0
- package/dist/types/theme.d.ts +35 -0
- package/dist/types/theme.js +1 -0
- 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 +97 -95
- 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/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/nodeStatus.d.ts +1 -1
- package/dist/utils/nodeStatus.js +48 -48
- package/dist/utils/nodeTypes.d.ts +1 -1
- package/dist/utils/nodeTypes.js +21 -20
- package/dist/utils/nodeWrapper.d.ts +7 -7
- package/dist/utils/nodeWrapper.js +21 -19
- package/dist/utils/performanceUtils.d.ts +1 -1
- package/dist/utils/performanceUtils.js +2 -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 +20 -8
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const defaultSkin = { name: "default" };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FlowDropSkin, FlowDropSkinName } from "../types/skin";
|
|
2
|
+
import { defaultSkin } from "./default";
|
|
3
|
+
import { slateSkin } from "./slate";
|
|
4
|
+
/**
|
|
5
|
+
* Resolve a skin prop to a complete FlowDropSkin object.
|
|
6
|
+
*
|
|
7
|
+
* When an object with inline tokens is provided alongside a named base skin,
|
|
8
|
+
* the inline tokens are merged on top of the named skin's tokens:
|
|
9
|
+
* resolveSkin({ name: 'minimal', tokens: { primary: '#e11d48' } })
|
|
10
|
+
* → minimal skin tokens + { primary: '#e11d48' }
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveSkin(skin: FlowDropSkin | FlowDropSkinName | undefined): FlowDropSkin;
|
|
13
|
+
export { defaultSkin, slateSkin };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defaultSkin } from "./default";
|
|
2
|
+
import { slateSkin } from "./slate";
|
|
3
|
+
const builtinSkins = {
|
|
4
|
+
default: defaultSkin,
|
|
5
|
+
slate: slateSkin,
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Resolve a skin prop to a complete FlowDropSkin object.
|
|
9
|
+
*
|
|
10
|
+
* When an object with inline tokens is provided alongside a named base skin,
|
|
11
|
+
* the inline tokens are merged on top of the named skin's tokens:
|
|
12
|
+
* resolveSkin({ name: 'minimal', tokens: { primary: '#e11d48' } })
|
|
13
|
+
* → minimal skin tokens + { primary: '#e11d48' }
|
|
14
|
+
*/
|
|
15
|
+
export function resolveSkin(skin) {
|
|
16
|
+
if (!skin || skin === "default")
|
|
17
|
+
return defaultSkin;
|
|
18
|
+
if (typeof skin === "string")
|
|
19
|
+
return builtinSkins[skin] ?? defaultSkin;
|
|
20
|
+
// Object form — check for a named base to merge on top of
|
|
21
|
+
const baseName = skin.name;
|
|
22
|
+
if (baseName && baseName !== "default" && builtinSkins[baseName]) {
|
|
23
|
+
const base = builtinSkins[baseName];
|
|
24
|
+
return {
|
|
25
|
+
tokens: { ...(base.tokens ?? {}), ...(skin.tokens ?? {}) },
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return skin;
|
|
29
|
+
}
|
|
30
|
+
export { defaultSkin, slateSkin };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const slateSkin = {
|
|
2
|
+
tokens: {
|
|
3
|
+
// --- Display / structural tokens (apply in both light and dark) ---
|
|
4
|
+
// Node icon: hide squircle, show circle dot
|
|
5
|
+
"node-icon-display": "none",
|
|
6
|
+
"node-circle-display": "flex",
|
|
7
|
+
// Sidebar: hide search + header, hide cards, show flat list
|
|
8
|
+
"sidebar-search-display": "none",
|
|
9
|
+
"sidebar-header-display": "none",
|
|
10
|
+
"sidebar-card-display": "none",
|
|
11
|
+
"sidebar-flat-display": "block",
|
|
12
|
+
// Navbar: split buttons instead of dropdown
|
|
13
|
+
"navbar-split-display": "flex",
|
|
14
|
+
"navbar-dropdown-display": "none",
|
|
15
|
+
// --- Light mode color palette (cool lavender-white) ---
|
|
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
|
+
// Primary brand colors (website accent purple)
|
|
28
|
+
primary: "#6c63ff",
|
|
29
|
+
"primary-hover": "#5b52ef",
|
|
30
|
+
"primary-foreground": "#ffffff",
|
|
31
|
+
"primary-muted": "rgba(108, 99, 255, 0.1)",
|
|
32
|
+
// Scrollbar
|
|
33
|
+
"scrollbar-thumb": "#d0d0e8",
|
|
34
|
+
"scrollbar-track": "#f0f0f8",
|
|
35
|
+
// Backdrop
|
|
36
|
+
backdrop: "rgba(246, 246, 255, 0.9)",
|
|
37
|
+
// Node border and port ring
|
|
38
|
+
"node-border": "#9898b8",
|
|
39
|
+
"node-border-hover": "#7878a8",
|
|
40
|
+
"handle-border": "#ffffff",
|
|
41
|
+
// Category header: dim purple-grey
|
|
42
|
+
"sidebar-category-color": "#c0c0d8",
|
|
43
|
+
// Flat item text: dark for light bg readability
|
|
44
|
+
"sidebar-flat-item-color": "#4a4a6a",
|
|
45
|
+
},
|
|
46
|
+
darkTokens: {
|
|
47
|
+
// --- Dark mode color palette (deep navy / original slate) ---
|
|
48
|
+
background: "#13131a",
|
|
49
|
+
foreground: "#c0c0d8",
|
|
50
|
+
muted: "#1a1a28",
|
|
51
|
+
"muted-foreground": "#7a7a9a",
|
|
52
|
+
card: "#1a1a28",
|
|
53
|
+
"card-foreground": "#e8e8f0",
|
|
54
|
+
border: "#2a2a3a",
|
|
55
|
+
"border-muted": "#1e1e2a",
|
|
56
|
+
"border-strong": "#3a3a55",
|
|
57
|
+
header: "#1a1a25",
|
|
58
|
+
"layout-background": "#0a0a0f",
|
|
59
|
+
// Primary brand colors
|
|
60
|
+
primary: "#6c63ff",
|
|
61
|
+
"primary-hover": "#7c74ff",
|
|
62
|
+
"primary-foreground": "#ffffff",
|
|
63
|
+
"primary-muted": "rgba(108, 99, 255, 0.15)",
|
|
64
|
+
// Scrollbar
|
|
65
|
+
"scrollbar-thumb": "#2a2a3a",
|
|
66
|
+
"scrollbar-track": "#13131a",
|
|
67
|
+
// Backdrop
|
|
68
|
+
backdrop: "rgba(19, 19, 26, 0.9)",
|
|
69
|
+
// Node border and port ring: purplish-grey matching dark palette
|
|
70
|
+
"node-border": "#9898b8",
|
|
71
|
+
"node-border-hover": "#aeaed0",
|
|
72
|
+
"handle-border": "#9898b8",
|
|
73
|
+
// Category header: extremely dim
|
|
74
|
+
"sidebar-category-color": "#3a3a55",
|
|
75
|
+
// Flat item text: muted, not full-brightness white
|
|
76
|
+
"sidebar-flat-item-color": "#8888aa",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -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,64 +7,96 @@
|
|
|
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
|
|
57
57
|
// ---------------------------------------------------------------------------
|
|
58
58
|
const permissions = {
|
|
59
|
-
uninitialized: {
|
|
60
|
-
|
|
59
|
+
uninitialized: {
|
|
60
|
+
canWriteToStore: false,
|
|
61
|
+
canPushHistory: false,
|
|
62
|
+
suppressEffect: false,
|
|
63
|
+
},
|
|
64
|
+
loading: {
|
|
65
|
+
canWriteToStore: false,
|
|
66
|
+
canPushHistory: false,
|
|
67
|
+
suppressEffect: false,
|
|
68
|
+
},
|
|
61
69
|
idle: { canWriteToStore: true, canPushHistory: true, suppressEffect: false },
|
|
62
|
-
dragging: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
dragging: {
|
|
71
|
+
canWriteToStore: true,
|
|
72
|
+
canPushHistory: false,
|
|
73
|
+
suppressEffect: true,
|
|
74
|
+
},
|
|
75
|
+
connecting: {
|
|
76
|
+
canWriteToStore: true,
|
|
77
|
+
canPushHistory: false,
|
|
78
|
+
suppressEffect: true,
|
|
79
|
+
},
|
|
80
|
+
dropping: {
|
|
81
|
+
canWriteToStore: true,
|
|
82
|
+
canPushHistory: false,
|
|
83
|
+
suppressEffect: true,
|
|
84
|
+
},
|
|
85
|
+
restoring: {
|
|
86
|
+
canWriteToStore: true,
|
|
87
|
+
canPushHistory: false,
|
|
88
|
+
suppressEffect: true,
|
|
89
|
+
},
|
|
90
|
+
deleting: {
|
|
91
|
+
canWriteToStore: true,
|
|
92
|
+
canPushHistory: false,
|
|
93
|
+
suppressEffect: true,
|
|
94
|
+
},
|
|
95
|
+
updating_node: {
|
|
96
|
+
canWriteToStore: true,
|
|
97
|
+
canPushHistory: false,
|
|
98
|
+
suppressEffect: true,
|
|
99
|
+
},
|
|
68
100
|
};
|
|
69
101
|
// ---------------------------------------------------------------------------
|
|
70
102
|
// Factory
|
|
@@ -78,7 +110,7 @@ const permissions = {
|
|
|
78
110
|
*
|
|
79
111
|
* Each WorkflowEditor component instance should create its own machine.
|
|
80
112
|
*/
|
|
81
|
-
export function createEditorStateMachine(initialState =
|
|
113
|
+
export function createEditorStateMachine(initialState = "uninitialized") {
|
|
82
114
|
let _current = $state(initialState);
|
|
83
115
|
let _permissions = $state(permissions[initialState]);
|
|
84
116
|
const _listeners = new Set();
|
|
@@ -127,6 +159,6 @@ export function createEditorStateMachine(initialState = 'uninitialized') {
|
|
|
127
159
|
},
|
|
128
160
|
send,
|
|
129
161
|
canSend,
|
|
130
|
-
onTransition
|
|
162
|
+
onTransition,
|
|
131
163
|
};
|
|
132
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 } from
|
|
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 } from
|
|
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 } from
|
|
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
|
// =========================================================================
|
|
@@ -64,7 +64,7 @@ export function getPendingInterruptCount() {
|
|
|
64
64
|
export function getResolvedInterrupts() {
|
|
65
65
|
const resolved = [];
|
|
66
66
|
interrupts.forEach((interrupt) => {
|
|
67
|
-
if (interrupt.machineState.status ===
|
|
67
|
+
if (interrupt.machineState.status === "resolved") {
|
|
68
68
|
resolved.push(interrupt);
|
|
69
69
|
}
|
|
70
70
|
});
|
|
@@ -97,7 +97,7 @@ function applyAction(interruptId, action) {
|
|
|
97
97
|
return {
|
|
98
98
|
state: initialState,
|
|
99
99
|
valid: false,
|
|
100
|
-
error: `Interrupt not found: ${interruptId}
|
|
100
|
+
error: `Interrupt not found: ${interruptId}`,
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
const result = transition(interrupt.machineState, action);
|
|
@@ -110,11 +110,11 @@ function applyAction(interruptId, action) {
|
|
|
110
110
|
machineState: result.state,
|
|
111
111
|
status: toLegacyStatus(result.state),
|
|
112
112
|
responseValue: getResolvedValue(result.state) ?? current.responseValue,
|
|
113
|
-
resolvedAt: result.state.status ===
|
|
113
|
+
resolvedAt: result.state.status === "resolved"
|
|
114
114
|
? result.state.resolvedAt
|
|
115
|
-
: result.state.status ===
|
|
115
|
+
: result.state.status === "cancelled"
|
|
116
116
|
? result.state.cancelledAt
|
|
117
|
-
: current.resolvedAt
|
|
117
|
+
: current.resolvedAt,
|
|
118
118
|
};
|
|
119
119
|
interrupts.set(interruptId, newInterrupt);
|
|
120
120
|
}
|
|
@@ -142,7 +142,7 @@ export const interruptActions = {
|
|
|
142
142
|
const machineState = existing?.machineState ?? initialState;
|
|
143
143
|
const interruptWithState = {
|
|
144
144
|
...interrupt,
|
|
145
|
-
machineState
|
|
145
|
+
machineState,
|
|
146
146
|
};
|
|
147
147
|
interrupts.set(interrupt.id, interruptWithState);
|
|
148
148
|
},
|
|
@@ -159,7 +159,7 @@ export const interruptActions = {
|
|
|
159
159
|
const machineState = existing?.machineState ?? initialState;
|
|
160
160
|
const interruptWithState = {
|
|
161
161
|
...interrupt,
|
|
162
|
-
machineState
|
|
162
|
+
machineState,
|
|
163
163
|
};
|
|
164
164
|
interrupts.set(interrupt.id, interruptWithState);
|
|
165
165
|
});
|
|
@@ -172,7 +172,7 @@ export const interruptActions = {
|
|
|
172
172
|
* @returns Transition result
|
|
173
173
|
*/
|
|
174
174
|
startSubmit: (interruptId, value) => {
|
|
175
|
-
return applyAction(interruptId, { type:
|
|
175
|
+
return applyAction(interruptId, { type: "SUBMIT", value });
|
|
176
176
|
},
|
|
177
177
|
/**
|
|
178
178
|
* Start cancelling an interrupt (user clicked cancel)
|
|
@@ -181,7 +181,7 @@ export const interruptActions = {
|
|
|
181
181
|
* @returns Transition result
|
|
182
182
|
*/
|
|
183
183
|
startCancel: (interruptId) => {
|
|
184
|
-
return applyAction(interruptId, { type:
|
|
184
|
+
return applyAction(interruptId, { type: "CANCEL" });
|
|
185
185
|
},
|
|
186
186
|
/**
|
|
187
187
|
* Mark submission as successful
|
|
@@ -190,7 +190,7 @@ export const interruptActions = {
|
|
|
190
190
|
* @returns Transition result
|
|
191
191
|
*/
|
|
192
192
|
submitSuccess: (interruptId) => {
|
|
193
|
-
return applyAction(interruptId, { type:
|
|
193
|
+
return applyAction(interruptId, { type: "SUCCESS" });
|
|
194
194
|
},
|
|
195
195
|
/**
|
|
196
196
|
* Mark submission as failed
|
|
@@ -200,7 +200,7 @@ export const interruptActions = {
|
|
|
200
200
|
* @returns Transition result
|
|
201
201
|
*/
|
|
202
202
|
submitFailure: (interruptId, error) => {
|
|
203
|
-
return applyAction(interruptId, { type:
|
|
203
|
+
return applyAction(interruptId, { type: "FAILURE", error });
|
|
204
204
|
},
|
|
205
205
|
/**
|
|
206
206
|
* Retry a failed submission
|
|
@@ -209,7 +209,7 @@ export const interruptActions = {
|
|
|
209
209
|
* @returns Transition result
|
|
210
210
|
*/
|
|
211
211
|
retry: (interruptId) => {
|
|
212
|
-
return applyAction(interruptId, { type:
|
|
212
|
+
return applyAction(interruptId, { type: "RETRY" });
|
|
213
213
|
},
|
|
214
214
|
/**
|
|
215
215
|
* Reset an interrupt to idle state
|
|
@@ -218,7 +218,7 @@ export const interruptActions = {
|
|
|
218
218
|
* @returns Transition result
|
|
219
219
|
*/
|
|
220
220
|
resetInterrupt: (interruptId) => {
|
|
221
|
-
return applyAction(interruptId, { type:
|
|
221
|
+
return applyAction(interruptId, { type: "RESET" });
|
|
222
222
|
},
|
|
223
223
|
/**
|
|
224
224
|
* Mark an interrupt as resolved with the user's response
|
|
@@ -227,9 +227,9 @@ export const interruptActions = {
|
|
|
227
227
|
* @param value - The resolved value
|
|
228
228
|
*/
|
|
229
229
|
resolveInterrupt: (interruptId, value) => {
|
|
230
|
-
const submitResult = applyAction(interruptId, { type:
|
|
230
|
+
const submitResult = applyAction(interruptId, { type: "SUBMIT", value });
|
|
231
231
|
if (submitResult.valid) {
|
|
232
|
-
applyAction(interruptId, { type:
|
|
232
|
+
applyAction(interruptId, { type: "SUCCESS" });
|
|
233
233
|
}
|
|
234
234
|
},
|
|
235
235
|
/**
|
|
@@ -238,9 +238,9 @@ export const interruptActions = {
|
|
|
238
238
|
* @param interruptId - The interrupt ID
|
|
239
239
|
*/
|
|
240
240
|
cancelInterrupt: (interruptId) => {
|
|
241
|
-
const cancelResult = applyAction(interruptId, { type:
|
|
241
|
+
const cancelResult = applyAction(interruptId, { type: "CANCEL" });
|
|
242
242
|
if (cancelResult.valid) {
|
|
243
|
-
applyAction(interruptId, { type:
|
|
243
|
+
applyAction(interruptId, { type: "SUCCESS" });
|
|
244
244
|
}
|
|
245
245
|
},
|
|
246
246
|
/**
|
|
@@ -276,7 +276,7 @@ export const interruptActions = {
|
|
|
276
276
|
*/
|
|
277
277
|
reset: () => {
|
|
278
278
|
interrupts.clear();
|
|
279
|
-
}
|
|
279
|
+
},
|
|
280
280
|
};
|
|
281
281
|
// =========================================================================
|
|
282
282
|
// 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
|
*/
|