@flowdrop/flowdrop 1.5.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 +46 -47
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +26 -26
- 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 +1 -1
- package/dist/adapters/agentspec/autoLayout.js +7 -9
- 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.js +6 -6
- package/dist/chat/index.d.ts +5 -5
- package/dist/chat/index.js +4 -4
- package/dist/chat/responseParser.d.ts +6 -6
- package/dist/chat/responseParser.js +28 -24
- package/dist/commands/batch.d.ts +1 -1
- package/dist/commands/batch.js +5 -7
- package/dist/commands/executor.d.ts +2 -2
- package/dist/commands/executor.js +320 -231
- package/dist/commands/index.d.ts +6 -6
- package/dist/commands/index.js +5 -5
- package/dist/commands/parser.d.ts +1 -1
- package/dist/commands/parser.js +91 -74
- package/dist/commands/positioner.d.ts +2 -2
- package/dist/commands/positioner.js +1 -1
- package/dist/commands/storeIntegration.svelte.d.ts +2 -2
- package/dist/commands/storeIntegration.svelte.js +5 -5
- package/dist/commands/types.d.ts +42 -42
- package/dist/commands/types.js +2 -2
- package/dist/components/App.svelte +240 -294
- package/dist/components/App.svelte.d.ts +9 -9
- 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 +3 -4
- package/dist/components/ConfigForm.svelte +118 -256
- package/dist/components/ConfigForm.svelte.d.ts +2 -2
- package/dist/components/ConfigMappingRow.svelte +7 -9
- package/dist/components/ConfigMappingRow.svelte.d.ts +1 -1
- 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 +9 -20
- package/dist/components/ConfigPanel.svelte.d.ts +1 -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 +9 -9
- 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 +41 -48
- 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 +42 -88
- 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 +20 -64
- package/dist/components/NodeSwapPicker.svelte.d.ts +1 -1
- 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 +20 -24
- package/dist/components/PortMappingRow.svelte.d.ts +2 -2
- 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 +35 -56
- package/dist/components/SwapMappingEditor.svelte.d.ts +2 -2
- 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 +113 -168
- package/dist/components/WorkflowEditor.svelte.d.ts +4 -4
- package/dist/components/chat/AIChatPanel.svelte +272 -133
- package/dist/components/chat/AIChatPanel.svelte.d.ts +3 -3
- package/dist/components/chat/CommandPreview.svelte +74 -24
- package/dist/components/chat/CommandPreview.svelte.d.ts +1 -1
- package/dist/components/console/CommandConsole.stories.svelte +71 -53
- package/dist/components/console/CommandConsole.stories.svelte.d.ts +1 -1
- package/dist/components/console/CommandConsole.svelte +39 -35
- package/dist/components/console/CommandConsole.svelte.d.ts +2 -2
- package/dist/components/console/ConsoleAutocomplete.svelte +6 -3
- package/dist/components/console/ConsoleInput.svelte +148 -89
- package/dist/components/console/ConsoleInput.svelte.d.ts +1 -1
- package/dist/components/console/ConsoleOutput.svelte +5 -10
- package/dist/components/console/ConsoleOutput.svelte.d.ts +1 -1
- package/dist/components/console/formatters.d.ts +1 -1
- package/dist/components/console/formatters.js +27 -29
- 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 -6
- package/dist/components/interrupt/index.js +6 -6
- 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 +4 -4
- package/dist/config/endpoints.js +68 -68
- package/dist/config/runtimeConfig.d.ts +2 -2
- package/dist/config/runtimeConfig.js +8 -8
- package/dist/core/index.d.ts +68 -68
- package/dist/core/index.js +38 -38
- package/dist/display/index.d.ts +2 -2
- package/dist/display/index.js +2 -2
- package/dist/editor/index.d.ts +64 -64
- package/dist/editor/index.js +54 -54
- 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 +32 -34
- package/dist/helpers/workflowEditorHelper.d.ts +6 -6
- package/dist/helpers/workflowEditorHelper.js +64 -68
- 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/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 +1 -1
- package/dist/services/chatService.js +18 -18
- 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 +1 -1
- package/dist/services/historyService.js +10 -10
- 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 +21 -21
- package/dist/stores/playgroundStore.svelte.d.ts +2 -2
- package/dist/stores/playgroundStore.svelte.js +18 -21
- package/dist/stores/portCoordinateStore.svelte.d.ts +2 -2
- package/dist/stores/portCoordinateStore.svelte.js +10 -13
- package/dist/stores/settingsStore.svelte.d.ts +2 -2
- package/dist/stores/settingsStore.svelte.js +57 -62
- package/dist/stores/workflowStore.svelte.d.ts +3 -3
- package/dist/stores/workflowStore.svelte.js +46 -47
- 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 +2 -2
- package/dist/types/config.d.ts +6 -6
- package/dist/types/events.d.ts +3 -3
- 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 +7 -5
- package/dist/types/settings.js +19 -24
- 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 +2 -2
- package/dist/utils/edgeStyling.js +36 -39
- 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 +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeStatus.d.ts +1 -1
- package/dist/utils/nodeStatus.js +48 -48
- package/dist/utils/nodeSwap.d.ts +9 -9
- package/dist/utils/nodeSwap.js +52 -58
- 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 +7 -11
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
-->
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
-
import type { NodeMetadata } from
|
|
10
|
-
import { getWorkflowStore } from
|
|
11
|
-
import { toShortId, resolveNode } from
|
|
12
|
-
import ConsoleAutocomplete, { type Suggestion } from
|
|
9
|
+
import type { NodeMetadata } from '../../types/index.js';
|
|
10
|
+
import { getWorkflowStore } from '../../stores/workflowStore.svelte.js';
|
|
11
|
+
import { toShortId, resolveNode } from '../../commands/index.js';
|
|
12
|
+
import ConsoleAutocomplete, { type Suggestion } from './ConsoleAutocomplete.svelte';
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
15
15
|
/** Whether the console is currently visible/open */
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
|
|
27
27
|
let { open, nodeTypes = [], onSubmit, onBatchSubmit, onClose }: Props = $props();
|
|
28
28
|
|
|
29
|
-
let inputValue = $state(
|
|
29
|
+
let inputValue = $state('');
|
|
30
30
|
let inputElement: HTMLInputElement | undefined = $state();
|
|
31
31
|
|
|
32
32
|
// Multiline value entry state
|
|
33
33
|
let multilineMode = $state(false);
|
|
34
|
-
let multilinePrefix = $state(
|
|
35
|
-
let textareaValue = $state(
|
|
34
|
+
let multilinePrefix = $state(''); // e.g. "set node1:prompt"
|
|
35
|
+
let textareaValue = $state('');
|
|
36
36
|
let textareaElement: HTMLTextAreaElement | undefined = $state();
|
|
37
37
|
|
|
38
38
|
// Command history state
|
|
39
39
|
const MAX_HISTORY = 100;
|
|
40
40
|
let history: string[] = $state([]);
|
|
41
41
|
let historyIndex = $state(-1);
|
|
42
|
-
let savedInput = $state(
|
|
42
|
+
let savedInput = $state('');
|
|
43
43
|
|
|
44
44
|
// Autocomplete state
|
|
45
45
|
let acVisible = $state(false);
|
|
@@ -47,15 +47,40 @@
|
|
|
47
47
|
let acSuggestions: Suggestion[] = $state([]);
|
|
48
48
|
|
|
49
49
|
const COMMAND_VERBS = [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
'add',
|
|
51
|
+
'delete',
|
|
52
|
+
'rename',
|
|
53
|
+
'set',
|
|
54
|
+
'get',
|
|
55
|
+
'info',
|
|
56
|
+
'config',
|
|
57
|
+
'select',
|
|
58
|
+
'connect',
|
|
59
|
+
'disconnect',
|
|
60
|
+
'list',
|
|
61
|
+
'undo',
|
|
62
|
+
'redo',
|
|
63
|
+
'help',
|
|
64
|
+
'clear',
|
|
65
|
+
'cls',
|
|
66
|
+
'swap',
|
|
67
|
+
'move',
|
|
68
|
+
'layout',
|
|
69
|
+
'canvas'
|
|
53
70
|
];
|
|
54
71
|
|
|
55
72
|
/** Verbs that take a nodeId as their first argument */
|
|
56
73
|
const NODE_ID_VERBS = [
|
|
57
|
-
|
|
58
|
-
|
|
74
|
+
'delete',
|
|
75
|
+
'rename',
|
|
76
|
+
'info',
|
|
77
|
+
'config',
|
|
78
|
+
'select',
|
|
79
|
+
'set',
|
|
80
|
+
'get',
|
|
81
|
+
'disconnect',
|
|
82
|
+
'swap',
|
|
83
|
+
'move'
|
|
59
84
|
];
|
|
60
85
|
|
|
61
86
|
$effect(() => {
|
|
@@ -79,7 +104,7 @@
|
|
|
79
104
|
return {
|
|
80
105
|
value: shortId,
|
|
81
106
|
label: shortId,
|
|
82
|
-
detail: node.data.label
|
|
107
|
+
detail: node.data.label
|
|
83
108
|
};
|
|
84
109
|
})
|
|
85
110
|
.filter((s) => s.value.toLowerCase().startsWith(lowerPrefix))
|
|
@@ -90,25 +115,28 @@
|
|
|
90
115
|
* Detect if cursor is at a position expecting a node ID.
|
|
91
116
|
* Returns the partial text typed so far, or null if not at a nodeId position.
|
|
92
117
|
*/
|
|
93
|
-
function getNodeIdContext(value: string): {
|
|
118
|
+
function getNodeIdContext(value: string): {
|
|
119
|
+
partial: string;
|
|
120
|
+
type: 'nodeId' | 'connectSource' | 'connectTarget';
|
|
121
|
+
} | null {
|
|
94
122
|
// "connect <source> to <partial>" — target node ID
|
|
95
123
|
const connectToMatch = value.match(/^connect\s+\S+\s+to\s+(.*)$/i);
|
|
96
|
-
if (connectToMatch) return { partial: connectToMatch[1], type:
|
|
124
|
+
if (connectToMatch) return { partial: connectToMatch[1], type: 'connectTarget' };
|
|
97
125
|
|
|
98
126
|
// "connect <partial>" — source node ID (only if no "to" keyword yet)
|
|
99
127
|
const connectMatch = value.match(/^connect\s+(?!.*\bto\b)(.*)$/i);
|
|
100
|
-
if (connectMatch) return { partial: connectMatch[1], type:
|
|
128
|
+
if (connectMatch) return { partial: connectMatch[1], type: 'connectSource' };
|
|
101
129
|
|
|
102
130
|
// Verbs that take nodeId as first arg: "verb <partial>"
|
|
103
131
|
for (const verb of NODE_ID_VERBS) {
|
|
104
|
-
const regex = new RegExp(`^${verb}\\s+(.*)$`,
|
|
132
|
+
const regex = new RegExp(`^${verb}\\s+(.*)$`, 'i');
|
|
105
133
|
const match = value.match(regex);
|
|
106
134
|
if (match) {
|
|
107
135
|
// Only suggest if the partial doesn't already contain a space
|
|
108
136
|
// (user has moved past the nodeId arg to further args)
|
|
109
137
|
const partial = match[1];
|
|
110
|
-
if (!partial.includes(
|
|
111
|
-
return { partial, type:
|
|
138
|
+
if (!partial.includes(' ') && !partial.includes(':')) {
|
|
139
|
+
return { partial, type: 'nodeId' };
|
|
112
140
|
}
|
|
113
141
|
return null;
|
|
114
142
|
}
|
|
@@ -121,35 +149,51 @@
|
|
|
121
149
|
* Detect if cursor is after a "<nodeId>:" pattern, indicating port or config key position.
|
|
122
150
|
* Returns the nodeId, partial text after colon, and context type.
|
|
123
151
|
*/
|
|
124
|
-
function getPortOrConfigContext(value: string): {
|
|
152
|
+
function getPortOrConfigContext(value: string): {
|
|
153
|
+
nodeId: string;
|
|
154
|
+
partial: string;
|
|
155
|
+
type: 'outputPort' | 'inputPort' | 'configKey' | 'port';
|
|
156
|
+
} | null {
|
|
125
157
|
// "connect <nodeId>:<partial>" — output ports (source position, no "to" yet)
|
|
126
158
|
const connectSourcePort = value.match(/^connect\s+(\S+?):(\S*)$/i);
|
|
127
159
|
if (connectSourcePort && !/\bto\b/i.test(value)) {
|
|
128
|
-
return {
|
|
160
|
+
return {
|
|
161
|
+
nodeId: connectSourcePort[1],
|
|
162
|
+
partial: connectSourcePort[2],
|
|
163
|
+
type: 'outputPort'
|
|
164
|
+
};
|
|
129
165
|
}
|
|
130
166
|
|
|
131
167
|
// "connect <source> to <nodeId>:<partial>" — input ports (target position)
|
|
132
168
|
const connectTargetPort = value.match(/^connect\s+\S+\s+to\s+(\S+?):(\S*)$/i);
|
|
133
169
|
if (connectTargetPort) {
|
|
134
|
-
return {
|
|
170
|
+
return {
|
|
171
|
+
nodeId: connectTargetPort[1],
|
|
172
|
+
partial: connectTargetPort[2],
|
|
173
|
+
type: 'inputPort'
|
|
174
|
+
};
|
|
135
175
|
}
|
|
136
176
|
|
|
137
177
|
// "set <nodeId>:<partial>" — config keys
|
|
138
178
|
const setMatch = value.match(/^set\s+(\S+?):(\S*)$/i);
|
|
139
179
|
if (setMatch) {
|
|
140
|
-
return { nodeId: setMatch[1], partial: setMatch[2], type:
|
|
180
|
+
return { nodeId: setMatch[1], partial: setMatch[2], type: 'configKey' };
|
|
141
181
|
}
|
|
142
182
|
|
|
143
183
|
// "get <nodeId>:<partial>" — config keys
|
|
144
184
|
const getMatch = value.match(/^get\s+(\S+?):(\S*)$/i);
|
|
145
185
|
if (getMatch) {
|
|
146
|
-
return { nodeId: getMatch[1], partial: getMatch[2], type:
|
|
186
|
+
return { nodeId: getMatch[1], partial: getMatch[2], type: 'configKey' };
|
|
147
187
|
}
|
|
148
188
|
|
|
149
189
|
// "disconnect <nodeId>:<partial>" — all ports
|
|
150
190
|
const disconnectMatch = value.match(/^disconnect\s+(\S+?):(\S*)$/i);
|
|
151
191
|
if (disconnectMatch) {
|
|
152
|
-
return {
|
|
192
|
+
return {
|
|
193
|
+
nodeId: disconnectMatch[1],
|
|
194
|
+
partial: disconnectMatch[2],
|
|
195
|
+
type: 'port'
|
|
196
|
+
};
|
|
153
197
|
}
|
|
154
198
|
|
|
155
199
|
return null;
|
|
@@ -158,7 +202,11 @@
|
|
|
158
202
|
/**
|
|
159
203
|
* Get port suggestions for a resolved node, filtered by direction and prefix.
|
|
160
204
|
*/
|
|
161
|
-
function getPortSuggestions(
|
|
205
|
+
function getPortSuggestions(
|
|
206
|
+
nodeId: string,
|
|
207
|
+
partial: string,
|
|
208
|
+
filter: 'input' | 'output' | 'all'
|
|
209
|
+
): Suggestion[] {
|
|
162
210
|
const workflow = getWorkflowStore();
|
|
163
211
|
if (!workflow) return [];
|
|
164
212
|
|
|
@@ -170,8 +218,8 @@
|
|
|
170
218
|
|
|
171
219
|
const lowerPartial = partial.toLowerCase();
|
|
172
220
|
const ports = [
|
|
173
|
-
...(filter ===
|
|
174
|
-
...(filter ===
|
|
221
|
+
...(filter === 'input' || filter === 'all' ? metadata.inputs : []),
|
|
222
|
+
...(filter === 'output' || filter === 'all' ? metadata.outputs : [])
|
|
175
223
|
];
|
|
176
224
|
|
|
177
225
|
const staticSuggestions = ports
|
|
@@ -179,20 +227,22 @@
|
|
|
179
227
|
.map((p) => ({
|
|
180
228
|
value: p.id,
|
|
181
229
|
label: p.id,
|
|
182
|
-
detail: `${p.name} (${p.dataType})
|
|
230
|
+
detail: `${p.name} (${p.dataType})`
|
|
183
231
|
}));
|
|
184
232
|
|
|
185
233
|
// Gateway nodes (e.g. if_else) have dynamic branch outputs stored in config, not metadata
|
|
186
234
|
const branchSuggestions: Suggestion[] = [];
|
|
187
|
-
if ((filter ===
|
|
188
|
-
const branches = node.data.config?.branches as
|
|
235
|
+
if ((filter === 'output' || filter === 'all') && metadata.type === 'gateway') {
|
|
236
|
+
const branches = node.data.config?.branches as
|
|
237
|
+
| Array<{ name: string; label?: string }>
|
|
238
|
+
| undefined;
|
|
189
239
|
if (branches) {
|
|
190
240
|
for (const branch of branches) {
|
|
191
241
|
if (branch.name.toLowerCase().startsWith(lowerPartial)) {
|
|
192
242
|
branchSuggestions.push({
|
|
193
243
|
value: branch.name,
|
|
194
244
|
label: branch.name,
|
|
195
|
-
detail: branch.label ? `branch: ${branch.label}` :
|
|
245
|
+
detail: branch.label ? `branch: ${branch.label}` : 'branch'
|
|
196
246
|
});
|
|
197
247
|
}
|
|
198
248
|
}
|
|
@@ -221,7 +271,7 @@
|
|
|
221
271
|
.map(([key, prop]) => ({
|
|
222
272
|
value: key,
|
|
223
273
|
label: key,
|
|
224
|
-
detail: typeof prop ===
|
|
274
|
+
detail: typeof prop === 'object' && 'type' in prop ? String(prop.type) : undefined
|
|
225
275
|
}))
|
|
226
276
|
.slice(0, 50);
|
|
227
277
|
}
|
|
@@ -229,22 +279,22 @@
|
|
|
229
279
|
/** Sub-commands for verbs that have them */
|
|
230
280
|
const SUBCOMMAND_MAP: Record<string, Array<{ value: string; detail?: string }>> = {
|
|
231
281
|
layout: [
|
|
232
|
-
{ value:
|
|
233
|
-
{ value:
|
|
282
|
+
{ value: 'auto', detail: 'Re-arrange all nodes from scratch' },
|
|
283
|
+
{ value: 'beautify', detail: 'Normalize spacing, preserve arrangement' }
|
|
234
284
|
],
|
|
235
285
|
list: [
|
|
236
|
-
{ value:
|
|
237
|
-
{ value:
|
|
238
|
-
{ value:
|
|
286
|
+
{ value: 'nodes', detail: 'List all workflow nodes' },
|
|
287
|
+
{ value: 'edges', detail: 'List all connections' },
|
|
288
|
+
{ value: 'types', detail: 'List available node types' }
|
|
239
289
|
],
|
|
240
290
|
canvas: [
|
|
241
|
-
{ value:
|
|
242
|
-
{ value:
|
|
243
|
-
{ value:
|
|
244
|
-
{ value:
|
|
245
|
-
{ value:
|
|
246
|
-
{ value:
|
|
247
|
-
]
|
|
291
|
+
{ value: 'fitview', detail: 'Fit all nodes into the viewport' },
|
|
292
|
+
{ value: 'zoom in', detail: 'Zoom in on the canvas' },
|
|
293
|
+
{ value: 'zoom out', detail: 'Zoom out on the canvas' },
|
|
294
|
+
{ value: 'zoom', detail: 'Set zoom level (e.g. canvas zoom 1.5)' },
|
|
295
|
+
{ value: 'pan', detail: 'Pan to position (e.g. canvas pan 100,200)' },
|
|
296
|
+
{ value: 'reset', detail: 'Reset viewport to default' }
|
|
297
|
+
]
|
|
248
298
|
};
|
|
249
299
|
|
|
250
300
|
function computeSuggestions(value: string): Suggestion[] {
|
|
@@ -253,12 +303,15 @@
|
|
|
253
303
|
// Check if we're after "<nodeId>:" — port names or config keys
|
|
254
304
|
const portConfigCtx = getPortOrConfigContext(value);
|
|
255
305
|
if (portConfigCtx !== null) {
|
|
256
|
-
if (portConfigCtx.type ===
|
|
306
|
+
if (portConfigCtx.type === 'configKey') {
|
|
257
307
|
return getConfigKeySuggestions(portConfigCtx.nodeId, portConfigCtx.partial);
|
|
258
308
|
}
|
|
259
|
-
const filter =
|
|
260
|
-
|
|
261
|
-
|
|
309
|
+
const filter =
|
|
310
|
+
portConfigCtx.type === 'outputPort'
|
|
311
|
+
? 'output'
|
|
312
|
+
: portConfigCtx.type === 'inputPort'
|
|
313
|
+
? 'input'
|
|
314
|
+
: 'all';
|
|
262
315
|
return getPortSuggestions(portConfigCtx.nodeId, portConfigCtx.partial, filter);
|
|
263
316
|
}
|
|
264
317
|
|
|
@@ -268,7 +321,11 @@
|
|
|
268
321
|
const prefix = subCmdContext.partial.toLowerCase();
|
|
269
322
|
return subCmdContext.options
|
|
270
323
|
.filter((opt) => opt.value.toLowerCase().startsWith(prefix))
|
|
271
|
-
.map((opt) => ({
|
|
324
|
+
.map((opt) => ({
|
|
325
|
+
value: opt.value,
|
|
326
|
+
label: opt.value,
|
|
327
|
+
detail: opt.detail
|
|
328
|
+
}));
|
|
272
329
|
}
|
|
273
330
|
|
|
274
331
|
// Check if we're in a position where node type IDs should be suggested
|
|
@@ -280,7 +337,7 @@
|
|
|
280
337
|
.map((nt) => ({
|
|
281
338
|
value: nt.id,
|
|
282
339
|
label: nt.id,
|
|
283
|
-
detail: `${nt.name} (${nt.category})
|
|
340
|
+
detail: `${nt.name} (${nt.category})`
|
|
284
341
|
}))
|
|
285
342
|
.slice(0, 50);
|
|
286
343
|
}
|
|
@@ -292,11 +349,12 @@
|
|
|
292
349
|
}
|
|
293
350
|
|
|
294
351
|
// Check if we're at verb position (no space in input yet)
|
|
295
|
-
if (!value.includes(
|
|
352
|
+
if (!value.includes(' ')) {
|
|
296
353
|
const prefix = value.toLowerCase();
|
|
297
|
-
return COMMAND_VERBS
|
|
298
|
-
|
|
299
|
-
|
|
354
|
+
return COMMAND_VERBS.filter((v) => v.startsWith(prefix)).map((v) => ({
|
|
355
|
+
value: v,
|
|
356
|
+
label: v
|
|
357
|
+
}));
|
|
300
358
|
}
|
|
301
359
|
|
|
302
360
|
return [];
|
|
@@ -306,7 +364,10 @@
|
|
|
306
364
|
* Detect if cursor is at a sub-command position (e.g. "layout <partial>").
|
|
307
365
|
* Returns the verb's sub-command options and the partial typed so far, or null.
|
|
308
366
|
*/
|
|
309
|
-
function getSubcommandContext(value: string): {
|
|
367
|
+
function getSubcommandContext(value: string): {
|
|
368
|
+
partial: string;
|
|
369
|
+
options: Array<{ value: string; detail?: string }>;
|
|
370
|
+
} | null {
|
|
310
371
|
const match = value.match(/^(\w+)\s+(.*)$/i);
|
|
311
372
|
if (!match) return null;
|
|
312
373
|
const verb = match[1].toLowerCase();
|
|
@@ -314,7 +375,7 @@
|
|
|
314
375
|
const options = SUBCOMMAND_MAP[verb];
|
|
315
376
|
if (!options) return null;
|
|
316
377
|
// Only suggest if the partial has no further spaces (still on sub-command)
|
|
317
|
-
if (partial.includes(
|
|
378
|
+
if (partial.includes(' ')) return null;
|
|
318
379
|
return { partial, options };
|
|
319
380
|
}
|
|
320
381
|
|
|
@@ -411,15 +472,15 @@
|
|
|
411
472
|
multilinePrefix = prefixText;
|
|
412
473
|
textareaValue = initialValue;
|
|
413
474
|
multilineMode = true;
|
|
414
|
-
inputValue =
|
|
475
|
+
inputValue = '';
|
|
415
476
|
dismissAutocomplete();
|
|
416
477
|
setTimeout(() => textareaElement?.focus(), 0);
|
|
417
478
|
}
|
|
418
479
|
|
|
419
480
|
function exitMultilineMode() {
|
|
420
481
|
multilineMode = false;
|
|
421
|
-
multilinePrefix =
|
|
422
|
-
textareaValue =
|
|
482
|
+
multilinePrefix = '';
|
|
483
|
+
textareaValue = '';
|
|
423
484
|
setTimeout(() => inputElement?.focus(), 0);
|
|
424
485
|
}
|
|
425
486
|
|
|
@@ -434,33 +495,33 @@
|
|
|
434
495
|
}
|
|
435
496
|
|
|
436
497
|
function handleTextareaKeydown(event: KeyboardEvent) {
|
|
437
|
-
if (event.key ===
|
|
498
|
+
if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
|
|
438
499
|
event.preventDefault();
|
|
439
500
|
submitMultilineValue();
|
|
440
|
-
} else if (event.key ===
|
|
501
|
+
} else if (event.key === 'Escape') {
|
|
441
502
|
event.preventDefault();
|
|
442
503
|
exitMultilineMode();
|
|
443
504
|
}
|
|
444
505
|
}
|
|
445
506
|
|
|
446
507
|
function handlePaste(event: ClipboardEvent) {
|
|
447
|
-
const text = event.clipboardData?.getData(
|
|
448
|
-
if (!text || !text.includes(
|
|
508
|
+
const text = event.clipboardData?.getData('text/plain');
|
|
509
|
+
if (!text || !text.includes('\n')) return;
|
|
449
510
|
|
|
450
511
|
// If already typing a set command, treat multiline paste as the value
|
|
451
512
|
const setMatch = inputValue.match(/^(set\s+\S+?:\S+)\s*(.*)$/i);
|
|
452
513
|
if (setMatch) {
|
|
453
514
|
event.preventDefault();
|
|
454
|
-
enterMultilineMode(setMatch[1], (setMatch[2] ? setMatch[2] +
|
|
515
|
+
enterMultilineMode(setMatch[1], (setMatch[2] ? setMatch[2] + '\n' : '') + text);
|
|
455
516
|
historyIndex = -1;
|
|
456
|
-
savedInput =
|
|
517
|
+
savedInput = '';
|
|
457
518
|
return;
|
|
458
519
|
}
|
|
459
520
|
|
|
460
521
|
// Multi-line paste: prevent default and batch-submit
|
|
461
522
|
event.preventDefault();
|
|
462
523
|
const lines = text
|
|
463
|
-
.split(
|
|
524
|
+
.split('\n')
|
|
464
525
|
.map((l) => l.trim())
|
|
465
526
|
.filter((l) => l.length > 0);
|
|
466
527
|
if (lines.length <= 1) return;
|
|
@@ -474,35 +535,31 @@
|
|
|
474
535
|
onBatchSubmit(lines);
|
|
475
536
|
}
|
|
476
537
|
|
|
477
|
-
inputValue =
|
|
538
|
+
inputValue = '';
|
|
478
539
|
historyIndex = -1;
|
|
479
|
-
savedInput =
|
|
540
|
+
savedInput = '';
|
|
480
541
|
dismissAutocomplete();
|
|
481
542
|
}
|
|
482
543
|
|
|
483
544
|
function handleKeydown(event: KeyboardEvent) {
|
|
484
545
|
// When autocomplete is visible, intercept navigation keys
|
|
485
546
|
if (acVisible && acSuggestions.length > 0) {
|
|
486
|
-
if (event.key ===
|
|
547
|
+
if (event.key === 'ArrowUp') {
|
|
487
548
|
event.preventDefault();
|
|
488
|
-
acSelectedIndex = acSelectedIndex > 0
|
|
489
|
-
? acSelectedIndex - 1
|
|
490
|
-
: acSuggestions.length - 1;
|
|
549
|
+
acSelectedIndex = acSelectedIndex > 0 ? acSelectedIndex - 1 : acSuggestions.length - 1;
|
|
491
550
|
return;
|
|
492
551
|
}
|
|
493
|
-
if (event.key ===
|
|
552
|
+
if (event.key === 'ArrowDown') {
|
|
494
553
|
event.preventDefault();
|
|
495
|
-
acSelectedIndex = acSelectedIndex < acSuggestions.length - 1
|
|
496
|
-
? acSelectedIndex + 1
|
|
497
|
-
: 0;
|
|
554
|
+
acSelectedIndex = acSelectedIndex < acSuggestions.length - 1 ? acSelectedIndex + 1 : 0;
|
|
498
555
|
return;
|
|
499
556
|
}
|
|
500
|
-
if (event.key ===
|
|
557
|
+
if (event.key === 'Tab') {
|
|
501
558
|
event.preventDefault();
|
|
502
559
|
acceptSuggestion(acSuggestions[acSelectedIndex]);
|
|
503
560
|
return;
|
|
504
561
|
}
|
|
505
|
-
if (event.key ===
|
|
562
|
+
if (event.key === 'Enter') {
|
|
506
563
|
const selected = acSuggestions[acSelectedIndex];
|
|
507
564
|
// If accepting the suggestion wouldn't change the input, execute directly
|
|
508
565
|
const before = inputValue;
|
|
@@ -513,14 +570,14 @@
|
|
|
513
570
|
}
|
|
514
571
|
// Input unchanged — fall through to submit handler below
|
|
515
572
|
}
|
|
516
|
-
if (event.key ===
|
|
573
|
+
if (event.key === 'Escape') {
|
|
517
574
|
event.preventDefault();
|
|
518
575
|
dismissAutocomplete();
|
|
519
576
|
return;
|
|
520
577
|
}
|
|
521
578
|
}
|
|
522
579
|
|
|
523
|
-
if (event.key ===
|
|
580
|
+
if (event.key === 'Enter' && event.shiftKey) {
|
|
524
581
|
// Shift+Enter on a set command → expand to multiline textarea
|
|
525
582
|
const setMatch = inputValue.match(/^(set\s+\S+?:\S+)\s*(.*)$/i);
|
|
526
583
|
if (setMatch) {
|
|
@@ -530,21 +587,21 @@
|
|
|
530
587
|
}
|
|
531
588
|
}
|
|
532
589
|
|
|
533
|
-
if (event.key ===
|
|
590
|
+
if (event.key === 'Enter' && !event.shiftKey) {
|
|
534
591
|
event.preventDefault();
|
|
535
592
|
const value = inputValue.trim();
|
|
536
593
|
if (value) {
|
|
537
594
|
addToHistory(value);
|
|
538
595
|
onSubmit(value);
|
|
539
|
-
inputValue =
|
|
596
|
+
inputValue = '';
|
|
540
597
|
historyIndex = -1;
|
|
541
|
-
savedInput =
|
|
598
|
+
savedInput = '';
|
|
542
599
|
dismissAutocomplete();
|
|
543
600
|
}
|
|
544
|
-
} else if (event.key ===
|
|
601
|
+
} else if (event.key === 'Escape') {
|
|
545
602
|
event.preventDefault();
|
|
546
603
|
onClose();
|
|
547
|
-
} else if (event.key ===
|
|
604
|
+
} else if (event.key === 'ArrowUp') {
|
|
548
605
|
event.preventDefault();
|
|
549
606
|
if (history.length === 0) return;
|
|
550
607
|
if (historyIndex === -1) {
|
|
@@ -556,7 +613,7 @@
|
|
|
556
613
|
}
|
|
557
614
|
inputValue = history[historyIndex];
|
|
558
615
|
dismissAutocomplete();
|
|
559
|
-
} else if (event.key ===
|
|
616
|
+
} else if (event.key === 'ArrowDown') {
|
|
560
617
|
event.preventDefault();
|
|
561
618
|
if (historyIndex === -1) return;
|
|
562
619
|
if (historyIndex < history.length - 1) {
|
|
@@ -612,7 +669,9 @@
|
|
|
612
669
|
role="combobox"
|
|
613
670
|
aria-expanded={acVisible}
|
|
614
671
|
aria-controls="console-autocomplete-listbox"
|
|
615
|
-
aria-activedescendant={acVisible && acSuggestions.length > 0
|
|
672
|
+
aria-activedescendant={acVisible && acSuggestions.length > 0
|
|
673
|
+
? `console-autocomplete-option-${acSelectedIndex}`
|
|
674
|
+
: undefined}
|
|
616
675
|
onkeydown={handleKeydown}
|
|
617
676
|
oninput={handleInput}
|
|
618
677
|
onpaste={handlePaste}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
-->
|
|
6
6
|
|
|
7
7
|
<script lang="ts">
|
|
8
|
-
import { tick } from
|
|
8
|
+
import { tick } from 'svelte';
|
|
9
9
|
|
|
10
10
|
export interface ConsoleEntry {
|
|
11
|
-
type:
|
|
11
|
+
type: 'input' | 'success' | 'error' | 'formatted';
|
|
12
12
|
text: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -32,18 +32,13 @@
|
|
|
32
32
|
});
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
|
-
<div
|
|
36
|
-
class="console-output"
|
|
37
|
-
bind:this={outputElement}
|
|
38
|
-
role="log"
|
|
39
|
-
aria-live="polite"
|
|
40
|
-
>
|
|
35
|
+
<div class="console-output" bind:this={outputElement} role="log" aria-live="polite">
|
|
41
36
|
{#each entries as entry}
|
|
42
37
|
<div class="console-output__entry console-output__entry--{entry.type}">
|
|
43
|
-
{#if entry.type ===
|
|
38
|
+
{#if entry.type === 'input'}
|
|
44
39
|
<span class="console-output__prefix">></span>
|
|
45
40
|
<span class="console-output__text">{entry.text}</span>
|
|
46
|
-
{:else if entry.type ===
|
|
41
|
+
{:else if entry.type === 'formatted'}
|
|
47
42
|
<pre class="console-output__pre">{entry.text}</pre>
|
|
48
43
|
{:else}
|
|
49
44
|
<span class="console-output__text">{entry.text}</span>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Pure formatting functions for rich command result display.
|
|
3
3
|
* Converts CommandResult data into aligned table strings for console output.
|
|
4
4
|
*/
|
|
5
|
-
import type { ListNodesResultData, ListEdgesResultData, ListTypesResultData, InfoResultData, HelpResultData } from
|
|
5
|
+
import type { ListNodesResultData, ListEdgesResultData, ListTypesResultData, InfoResultData, HelpResultData } from '../../commands/types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Formats list nodes result as an aligned table: ID, Label, Type.
|
|
8
8
|
*/
|