@flowdrop/flowdrop 2.11.0 → 2.12.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/CHANGELOG.md +223 -0
- package/dist/adapters/agentspec/autoLayout.d.ts +18 -36
- package/dist/adapters/agentspec/autoLayout.js +75 -93
- package/dist/chat/activity.d.ts +49 -0
- package/dist/chat/activity.js +65 -0
- package/dist/chat/commandClassifier.js +2 -1
- package/dist/commands/executor.js +186 -27
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/parser.js +43 -3
- package/dist/commands/session.d.ts +60 -0
- package/dist/commands/session.js +332 -0
- package/dist/commands/storeIntegration.svelte.js +18 -1
- package/dist/commands/types.d.ts +77 -4
- package/dist/components/App.svelte +966 -226
- package/dist/components/App.svelte.d.ts +26 -2
- package/dist/components/BindablePortListbox.svelte +68 -369
- package/dist/components/Button.svelte +17 -14
- package/dist/components/Button.svelte.d.ts +2 -2
- package/dist/components/CanvasContextMenu.svelte +31 -10
- package/dist/components/CanvasController.svelte +146 -3
- package/dist/components/CanvasController.svelte.d.ts +25 -33
- package/dist/components/CanvasIconButton.svelte +6 -6
- package/dist/components/CanvasToolbar.svelte +103 -0
- package/dist/components/CanvasToolbar.svelte.d.ts +23 -0
- package/dist/components/CanvasZoomControls.svelte +122 -0
- package/dist/components/CanvasZoomControls.svelte.d.ts +15 -0
- package/dist/components/ConfigForm.svelte +159 -121
- package/dist/components/ConfigModal.svelte +11 -54
- package/dist/components/ConfigPanel.svelte +98 -228
- package/dist/components/ConfigPanel.svelte.d.ts +2 -2
- package/dist/components/ConnectPortPicker.svelte +153 -0
- package/dist/components/ConnectPortPicker.svelte.d.ts +22 -0
- package/dist/components/DoctorMenu.svelte +422 -0
- package/dist/components/DoctorMenu.svelte.d.ts +7 -0
- package/dist/components/ExternalLinkRow.svelte +82 -0
- package/dist/components/ExternalLinkRow.svelte.d.ts +14 -0
- package/dist/components/FlowDropEdge.svelte +52 -2
- package/dist/components/FlowDropEdge.svelte.d.ts +5 -1
- package/dist/components/InterfaceNameInput.svelte +103 -0
- package/dist/components/InterfaceNameInput.svelte.d.ts +13 -0
- package/dist/components/InterfaceTag.svelte +215 -0
- package/dist/components/InterfaceTag.svelte.d.ts +20 -0
- package/dist/components/InterfaceTagAnchor.svelte +103 -0
- package/dist/components/InterfaceTagAnchor.svelte.d.ts +12 -0
- package/dist/components/InterfaceTagLayer.svelte +314 -0
- package/dist/components/InterfaceTagLayer.svelte.d.ts +28 -0
- package/dist/components/LogsSidebar.svelte +43 -43
- package/dist/components/LoopbackLanes.svelte +54 -0
- package/dist/components/LoopbackLanes.svelte.d.ts +8 -0
- package/dist/components/Navbar.svelte +539 -169
- package/dist/components/Navbar.svelte.d.ts +20 -1
- package/dist/components/NodeInspector.svelte +153 -0
- package/dist/components/NodeInspector.svelte.d.ts +19 -0
- package/dist/components/NodeLastRun.svelte +212 -0
- package/dist/components/NodeLastRun.svelte.d.ts +13 -0
- package/dist/components/NodeSidebar.svelte +279 -23
- package/dist/components/NodeSidebar.svelte.d.ts +11 -0
- package/dist/components/NodeStatusOverlay.svelte +144 -353
- package/dist/components/NodeStatusOverlay.svelte.d.ts +4 -1
- package/dist/components/PortMappingRow.svelte +28 -44
- package/dist/components/PortPickerListbox.svelte +475 -0
- package/dist/components/PortPickerListbox.svelte.d.ts +73 -0
- package/dist/components/ReadOnlyDetails.svelte +52 -89
- package/dist/components/RunBar.svelte +222 -0
- package/dist/components/RunBar.svelte.d.ts +20 -0
- package/dist/components/RunsMenu.svelte +649 -0
- package/dist/components/RunsMenu.svelte.d.ts +14 -0
- package/dist/components/SettingsModal.svelte +27 -59
- package/dist/components/SettingsPanel.svelte +515 -241
- package/dist/components/StraightGuides.svelte +46 -0
- package/dist/components/StraightGuides.svelte.d.ts +7 -0
- package/dist/components/ThemeToggle.svelte +14 -4
- package/dist/components/UniversalNode.svelte +152 -51
- package/dist/components/WebMCPBridgeMenu.svelte +336 -0
- package/dist/components/WebMCPBridgeMenu.svelte.d.ts +3 -0
- package/dist/components/WorkflowEditor.svelte +789 -136
- package/dist/components/WorkflowEditor.svelte.d.ts +43 -1
- package/dist/components/WorkflowInterfaceEditor.svelte +63 -92
- package/dist/components/WorkflowInterfaceEntryCard.svelte +478 -549
- package/dist/components/WorkflowInterfaceEntryComposer.svelte +23 -67
- package/dist/components/WorkflowPlaygroundSettings.svelte +48 -85
- package/dist/components/WorkflowSettingsPanel.svelte +311 -0
- package/dist/components/WorkflowSettingsPanel.svelte.d.ts +20 -0
- package/dist/components/ZoomTier.svelte +56 -0
- package/dist/components/ZoomTier.svelte.d.ts +4 -0
- package/dist/components/chat/AIChatPanel.svelte +463 -312
- package/dist/components/chat/ActivityList.svelte +130 -0
- package/dist/components/chat/ActivityList.svelte.d.ts +11 -0
- package/dist/components/chat/ActivityRow.svelte +179 -0
- package/dist/components/chat/ActivityRow.svelte.d.ts +16 -0
- package/dist/components/chat/CommandPreview.svelte +42 -64
- package/dist/components/console/CommandConsole.svelte +106 -41
- package/dist/components/console/CommandConsole.svelte.d.ts +2 -0
- package/dist/components/console/ConsoleAutocomplete.svelte +14 -13
- package/dist/components/console/ConsoleInput.svelte +60 -27
- package/dist/components/console/ConsoleOutput.svelte +86 -24
- package/dist/components/console/ConsoleStrip.svelte +80 -0
- package/dist/components/console/ConsoleStrip.svelte.d.ts +13 -0
- package/dist/components/form/FieldFactory.svelte +30 -4
- package/dist/components/form/FormArray.svelte +306 -339
- package/dist/components/form/FormArray.svelte.d.ts +10 -0
- package/dist/components/form/FormArrayRows.svelte +443 -0
- package/dist/components/form/FormArrayRows.svelte.d.ts +18 -0
- package/dist/components/form/FormAutocomplete.svelte +2 -2
- package/dist/components/form/FormCheckboxGroup.svelte +10 -85
- package/dist/components/form/FormCodeEditor.svelte +3 -3
- package/dist/components/form/FormFieldWrapper.svelte +98 -18
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +10 -0
- package/dist/components/form/FormFieldset.svelte +44 -28
- package/dist/components/form/FormMarkdownEditor.svelte +6 -6
- package/dist/components/form/FormPorts.svelte +437 -141
- package/dist/components/form/FormSelect.svelte +1 -1
- package/dist/components/form/FormTemplateEditor.svelte +22 -26
- package/dist/components/form/FormToggle.svelte +15 -106
- package/dist/components/form/FormToggle.svelte.d.ts +3 -2
- package/dist/components/form/FormUISchemaRenderer.svelte +38 -3
- package/dist/components/form/humanizeKey.d.ts +7 -0
- package/dist/components/form/humanizeKey.js +21 -0
- package/dist/components/form/types.d.ts +6 -0
- package/dist/components/icons/MenuOpenIcon.svelte +8 -1
- package/dist/components/interrupt/ChoicePrompt.svelte +51 -152
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +0 -2
- package/dist/components/interrupt/ConfirmationPrompt.svelte +18 -201
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +0 -4
- package/dist/components/interrupt/FormPrompt.svelte +22 -147
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +0 -4
- package/dist/components/interrupt/InterruptBubble.svelte +198 -355
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +0 -2
- package/dist/components/interrupt/ReviewPrompt.svelte +0 -10
- package/dist/components/interrupt/TextInputPrompt.svelte +23 -120
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +0 -2
- package/dist/components/layouts/MainLayout.svelte +110 -75
- package/dist/components/layouts/MainLayout.svelte.d.ts +17 -0
- package/dist/components/nodes/CaptionNode.svelte +7 -0
- package/dist/components/nodes/GatewayNode.svelte +66 -431
- package/dist/components/nodes/IdeaNode.svelte +6 -5
- package/dist/components/nodes/NodeCard.svelte +1051 -0
- package/dist/components/nodes/NodeCard.svelte.d.ts +30 -0
- package/dist/components/nodes/NodeConfigButton.svelte +28 -9
- package/dist/components/nodes/NodeProblemMark.svelte +113 -0
- package/dist/components/nodes/NodeProblemMark.svelte.d.ts +8 -0
- package/dist/components/nodes/NodeTip.svelte +104 -0
- package/dist/components/nodes/NodeTip.svelte.d.ts +15 -0
- package/dist/components/nodes/NotesNode.svelte +183 -150
- package/dist/components/nodes/SimpleNode.svelte +176 -44
- package/dist/components/nodes/SquareNode.svelte +127 -34
- package/dist/components/nodes/TerminalNode.svelte +232 -88
- package/dist/components/nodes/ToolNode.svelte +49 -381
- package/dist/components/nodes/WorkflowNode.svelte +40 -399
- package/dist/components/playground/ChatBubble.svelte +248 -62
- package/dist/components/playground/ChatInput.svelte +134 -297
- package/dist/components/playground/ChatInput.svelte.d.ts +17 -0
- package/dist/components/playground/ControlPanel.svelte +290 -190
- package/dist/components/playground/ControlPanel.svelte.d.ts +10 -2
- package/dist/components/playground/DockedPlayground.svelte +75 -0
- package/dist/components/playground/DockedPlayground.svelte.d.ts +24 -0
- package/dist/components/playground/ExecutionConsole.svelte +54 -36
- package/dist/components/playground/ExecutionConsole.svelte.d.ts +12 -0
- package/dist/components/playground/ExecutionLogs.svelte +4 -0
- package/dist/components/playground/HeaderMenu.svelte +170 -0
- package/dist/components/playground/HeaderMenu.svelte.d.ts +22 -0
- package/dist/components/playground/InputCollector.svelte +8 -32
- package/dist/components/playground/InputFields.svelte +246 -0
- package/dist/components/playground/InputFields.svelte.d.ts +16 -0
- package/dist/components/playground/InterfaceInputForm.svelte +285 -30
- package/dist/components/playground/InterfaceInputForm.svelte.d.ts +20 -0
- package/dist/components/playground/InterfaceJsonInput.svelte +92 -0
- package/dist/components/playground/InterfaceJsonInput.svelte.d.ts +10 -0
- package/dist/components/playground/LogRow.svelte +12 -12
- package/dist/components/playground/MessageMarkdown.svelte +11 -11
- package/dist/components/playground/MessageStream.svelte +154 -182
- package/dist/components/playground/Playground.svelte +17 -1139
- package/dist/components/playground/PlaygroundApp.svelte +12 -2
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +2 -1
- package/dist/components/playground/PlaygroundHeader.svelte +309 -0
- package/dist/components/playground/PlaygroundHeader.svelte.d.ts +22 -0
- package/dist/components/playground/PlaygroundModal.svelte +6 -0
- package/dist/components/playground/PlaygroundStudio.svelte +30 -32
- package/dist/components/playground/PlaygroundSurface.svelte +648 -0
- package/dist/components/playground/PlaygroundSurface.svelte.d.ts +79 -0
- package/dist/components/playground/StepsSummary.svelte +312 -0
- package/dist/components/playground/StepsSummary.svelte.d.ts +11 -0
- package/dist/components/playground/messageDisplay.d.ts +9 -0
- package/dist/components/playground/messageDisplay.js +24 -2
- package/dist/components/playground/stepSummary.d.ts +71 -0
- package/dist/components/playground/stepSummary.js +152 -0
- package/dist/components/ports/PortTypeBadge.svelte +13 -1
- package/dist/components/primitives/Button.svelte +226 -0
- package/dist/components/primitives/Button.svelte.d.ts +31 -0
- package/dist/components/primitives/Card.svelte +110 -0
- package/dist/components/primitives/Card.svelte.d.ts +20 -0
- package/dist/components/primitives/Checkbox.svelte +126 -0
- package/dist/components/primitives/Checkbox.svelte.d.ts +15 -0
- package/dist/components/primitives/Chip.svelte +143 -0
- package/dist/components/primitives/Chip.svelte.d.ts +22 -0
- package/dist/components/primitives/Combobox.svelte +444 -0
- package/dist/components/primitives/Combobox.svelte.d.ts +22 -0
- package/dist/components/primitives/Composer.svelte +293 -0
- package/dist/components/primitives/Composer.svelte.d.ts +47 -0
- package/dist/components/primitives/EmptyState.svelte +113 -0
- package/dist/components/primitives/EmptyState.svelte.d.ts +18 -0
- package/dist/components/primitives/Field.svelte +178 -0
- package/dist/components/primitives/Field.svelte.d.ts +30 -0
- package/dist/components/primitives/IconButton.svelte +156 -0
- package/dist/components/primitives/IconButton.svelte.d.ts +27 -0
- package/dist/components/primitives/Menu.svelte +435 -0
- package/dist/components/primitives/Menu.svelte.d.ts +61 -0
- package/dist/components/primitives/Notice.svelte +161 -0
- package/dist/components/primitives/Notice.svelte.d.ts +22 -0
- package/dist/components/primitives/PanelHeader.svelte +134 -0
- package/dist/components/primitives/PanelHeader.svelte.d.ts +23 -0
- package/dist/components/primitives/Segmented.svelte +198 -0
- package/dist/components/primitives/Segmented.svelte.d.ts +32 -0
- package/dist/components/primitives/Select.svelte +130 -0
- package/dist/components/primitives/Select.svelte.d.ts +26 -0
- package/dist/components/primitives/StatusPill.svelte +218 -0
- package/dist/components/primitives/StatusPill.svelte.d.ts +24 -0
- package/dist/components/primitives/Switch.svelte +113 -0
- package/dist/components/primitives/Switch.svelte.d.ts +14 -0
- package/dist/components/primitives/Tabs.svelte +209 -0
- package/dist/components/primitives/Tabs.svelte.d.ts +32 -0
- package/dist/components/primitives/Toolbar.svelte +94 -0
- package/dist/components/primitives/Toolbar.svelte.d.ts +14 -0
- package/dist/components/primitives/ToolbarSeparator.svelte +40 -0
- package/dist/components/primitives/ToolbarSeparator.svelte.d.ts +7 -0
- package/dist/components/surfaces/SurfaceOverlay.svelte +10 -40
- package/dist/components/surfaces/TabbedSurface.svelte +49 -39
- package/dist/components/surfaces/TabbedSurface.svelte.d.ts +8 -0
- package/dist/components/toast/DismissibleToast.svelte +94 -32
- package/dist/components/toast/DismissibleToast.svelte.d.ts +17 -7
- package/dist/config/endpoints.d.ts +43 -1
- package/dist/config/endpoints.js +21 -3
- package/dist/core/index.d.ts +8 -5
- package/dist/core/index.js +1 -1
- package/dist/editor/connectCandidates.d.ts +56 -0
- package/dist/editor/connectCandidates.js +131 -0
- package/dist/editor/contextMenu.d.ts +31 -2
- package/dist/editor/contextMenu.js +96 -9
- package/dist/editor/index.d.ts +3 -1
- package/dist/editor/index.js +1 -0
- package/dist/editor/interfaceMenu.d.ts +35 -0
- package/dist/editor/interfaceMenu.js +47 -0
- package/dist/editor/portMenu.d.ts +23 -0
- package/dist/editor/portMenu.js +34 -0
- package/dist/editor/tidy.d.ts +30 -0
- package/dist/editor/tidy.js +66 -0
- package/dist/helpers/workflowEditorHelper.d.ts +3 -0
- package/dist/helpers/workflowEditorHelper.js +8 -3
- package/dist/layout/fromWorkflow.d.ts +42 -0
- package/dist/layout/fromWorkflow.js +135 -0
- package/dist/layout/geometry.d.ts +102 -0
- package/dist/layout/geometry.js +317 -0
- package/dist/layout/index.d.ts +21 -0
- package/dist/layout/index.js +14 -0
- package/dist/layout/inspect.d.ts +18 -0
- package/dist/layout/inspect.js +81 -0
- package/dist/layout/lanePath.d.ts +23 -0
- package/dist/layout/lanePath.js +47 -0
- package/dist/layout/measure.d.ts +141 -0
- package/dist/layout/measure.js +477 -0
- package/dist/layout/primitives.d.ts +124 -0
- package/dist/layout/primitives.js +461 -0
- package/dist/layout/sweep.d.ts +59 -0
- package/dist/layout/sweep.js +257 -0
- package/dist/layout/toWorkflow.d.ts +43 -0
- package/dist/layout/toWorkflow.js +131 -0
- package/dist/layout/types.d.ts +93 -0
- package/dist/layout/types.js +35 -0
- package/dist/messages/defaults.d.ts +641 -26
- package/dist/messages/defaults.js +578 -25
- package/dist/messages/types.d.ts +21 -1
- package/dist/openapi/v1/openapi.yaml +109 -0
- package/dist/playground/index.d.ts +28 -1
- package/dist/playground/index.js +29 -0
- package/dist/playground/mount.d.ts +28 -2
- package/dist/playground/mount.js +41 -15
- package/dist/playground/runAction.d.ts +29 -0
- package/dist/playground/runAction.js +38 -0
- package/dist/services/doctorService.d.ts +52 -0
- package/dist/services/doctorService.js +113 -0
- package/dist/services/globalSave.js +12 -29
- package/dist/services/nodeExecutionService.d.ts +12 -1
- package/dist/services/nodeExecutionService.js +58 -58
- package/dist/services/playgroundService.d.ts +17 -2
- package/dist/services/playgroundService.js +48 -5
- package/dist/services/runsService.d.ts +42 -0
- package/dist/services/runsService.js +87 -0
- package/dist/services/toastQueue.d.ts +33 -0
- package/dist/services/toastQueue.js +38 -0
- package/dist/services/toastService.d.ts +30 -9
- package/dist/services/toastService.js +81 -46
- package/dist/settings/index.d.ts +1 -0
- package/dist/skins/graphite.d.ts +26 -0
- package/dist/skins/graphite.js +473 -0
- package/dist/skins/index.d.ts +2 -1
- package/dist/skins/index.js +4 -2
- package/dist/skins/slate.js +4 -4
- package/dist/stores/attachedRunStore.svelte.d.ts +35 -0
- package/dist/stores/attachedRunStore.svelte.js +47 -0
- package/dist/stores/connectDragStore.svelte.d.ts +39 -0
- package/dist/stores/connectDragStore.svelte.js +42 -0
- package/dist/stores/doctorStore.svelte.d.ts +79 -0
- package/dist/stores/doctorStore.svelte.js +244 -0
- package/dist/stores/editedNodesStore.svelte.d.ts +42 -0
- package/dist/stores/editedNodesStore.svelte.js +84 -0
- package/dist/stores/editorModeStore.svelte.d.ts +34 -0
- package/dist/stores/editorModeStore.svelte.js +55 -0
- package/dist/stores/instanceContainer.svelte.d.ts +53 -0
- package/dist/stores/instanceContainer.svelte.js +38 -1
- package/dist/stores/loopbackLanesStore.svelte.d.ts +18 -0
- package/dist/stores/loopbackLanesStore.svelte.js +25 -0
- package/dist/stores/nodeHighlightStore.svelte.d.ts +34 -0
- package/dist/stores/nodeHighlightStore.svelte.js +56 -0
- package/dist/stores/playgroundStore.svelte.d.ts +66 -2
- package/dist/stores/playgroundStore.svelte.js +164 -2
- package/dist/stores/runController.svelte.d.ts +382 -0
- package/dist/stores/runController.svelte.js +1217 -0
- package/dist/stores/settingsStore.svelte.d.ts +80 -18
- package/dist/stores/settingsStore.svelte.js +180 -62
- package/dist/stores/workflowStore.svelte.d.ts +14 -0
- package/dist/stores/workflowStore.svelte.js +22 -1
- package/dist/styles/base.css +286 -25
- package/dist/styles/fonts/Inter-LICENSE.txt +93 -0
- package/dist/styles/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/styles/fonts/inter.css +19 -0
- package/dist/styles/toast.css +100 -20
- package/dist/styles/tokenAliases.js +118 -1
- package/dist/styles/tokens.css +586 -14
- package/dist/svelte-app.d.ts +38 -5
- package/dist/svelte-app.js +14 -3
- package/dist/themes/graphite.d.ts +2 -0
- package/dist/themes/graphite.js +15 -0
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.js +22 -3
- package/dist/themes/minimal.js +10 -0
- package/dist/themes/scopedSkinCss.d.ts +22 -5
- package/dist/themes/scopedSkinCss.js +136 -11
- package/dist/types/chat.d.ts +6 -0
- package/dist/types/doctor.d.ts +82 -0
- package/dist/types/doctor.js +11 -0
- package/dist/types/events.d.ts +35 -0
- package/dist/types/events.js +4 -1
- package/dist/types/index.d.ts +17 -2
- package/dist/types/navbar.d.ts +36 -0
- package/dist/types/playground.d.ts +66 -0
- package/dist/types/settings.d.ts +120 -7
- package/dist/types/settings.js +35 -3
- package/dist/types/skin.d.ts +21 -8
- package/dist/types/theme.d.ts +40 -2
- package/dist/utils/appearance.d.ts +19 -0
- package/dist/utils/appearance.js +13 -0
- package/dist/utils/canvasFit.d.ts +41 -0
- package/dist/utils/canvasFit.js +44 -0
- package/dist/utils/chipTitles.d.ts +9 -0
- package/dist/utils/chipTitles.js +19 -0
- package/dist/utils/connections.js +8 -0
- package/dist/utils/consoleHighlight.d.ts +28 -0
- package/dist/utils/consoleHighlight.js +269 -0
- package/dist/utils/deprecation.d.ts +17 -0
- package/dist/utils/deprecation.js +29 -0
- package/dist/utils/doctorOperations.d.ts +40 -0
- package/dist/utils/doctorOperations.js +237 -0
- package/dist/utils/duration.d.ts +13 -0
- package/dist/utils/duration.js +40 -0
- package/dist/utils/inspectorContext.d.ts +19 -0
- package/dist/utils/inspectorContext.js +12 -0
- package/dist/utils/inspectorSections.d.ts +20 -0
- package/dist/utils/inspectorSections.js +44 -0
- package/dist/utils/inspectorSurface.d.ts +46 -0
- package/dist/utils/inspectorSurface.js +51 -0
- package/dist/utils/interfaceTags.d.ts +102 -0
- package/dist/utils/interfaceTags.js +211 -0
- package/dist/utils/itemRef.d.ts +86 -0
- package/dist/utils/itemRef.js +106 -0
- package/dist/utils/lastRun.d.ts +35 -0
- package/dist/utils/lastRun.js +73 -0
- package/dist/utils/messageNodeLink.d.ts +17 -0
- package/dist/utils/messageNodeLink.js +16 -0
- package/dist/utils/minimapVisibility.d.ts +28 -0
- package/dist/utils/minimapVisibility.js +34 -0
- package/dist/utils/nodeAriaLabel.d.ts +12 -0
- package/dist/utils/nodeAriaLabel.js +17 -0
- package/dist/utils/nodeFingerprint.d.ts +27 -0
- package/dist/utils/nodeFingerprint.js +66 -0
- package/dist/utils/nodeFormSchema.d.ts +10 -0
- package/dist/utils/nodeFormSchema.js +2 -2
- package/dist/utils/nodeGeometry.d.ts +168 -0
- package/dist/utils/nodeGeometry.js +204 -0
- package/dist/utils/nodeProblem.d.ts +19 -0
- package/dist/utils/nodeProblem.js +9 -0
- package/dist/utils/nodeStatus.d.ts +38 -3
- package/dist/utils/nodeStatus.js +67 -39
- package/dist/utils/nodeSwap.js +9 -1
- package/dist/utils/nodeWrapper.d.ts +1 -0
- package/dist/utils/playgroundHistory.d.ts +48 -0
- package/dist/utils/playgroundHistory.js +38 -0
- package/dist/utils/playgroundInputRuns.d.ts +26 -0
- package/dist/utils/playgroundInputRuns.js +50 -0
- package/dist/utils/portExposure.d.ts +49 -0
- package/dist/utils/portExposure.js +122 -0
- package/dist/utils/portUtils.d.ts +16 -0
- package/dist/utils/portUtils.js +37 -0
- package/dist/utils/portal.d.ts +0 -19
- package/dist/utils/portal.js +8 -1
- package/dist/utils/reservedPorts.d.ts +59 -0
- package/dist/utils/reservedPorts.js +60 -0
- package/dist/utils/runEdges.d.ts +24 -0
- package/dist/utils/runEdges.js +35 -0
- package/dist/utils/runsList.d.ts +69 -0
- package/dist/utils/runsList.js +134 -0
- package/dist/utils/selectOptions.d.ts +62 -0
- package/dist/utils/selectOptions.js +137 -0
- package/dist/utils/sessionRuns.d.ts +62 -0
- package/dist/utils/sessionRuns.js +123 -0
- package/dist/utils/sheetWidths.d.ts +29 -0
- package/dist/utils/sheetWidths.js +41 -0
- package/dist/utils/sidebarWidths.d.ts +34 -0
- package/dist/utils/sidebarWidths.js +47 -0
- package/dist/utils/straightWires.d.ts +73 -0
- package/dist/utils/straightWires.js +99 -0
- package/dist/utils/themeScope.svelte.d.ts +10 -0
- package/dist/utils/themeScope.svelte.js +80 -0
- package/dist/utils/wiredHandles.d.ts +10 -0
- package/dist/utils/wiredHandles.js +14 -0
- package/dist/utils/workflowDraft.d.ts +9 -0
- package/dist/utils/workflowDraft.js +39 -0
- package/dist/utils/workflowInterface.d.ts +40 -7
- package/dist/utils/workflowInterface.js +66 -16
- package/dist/utils/zoomTier.d.ts +43 -0
- package/dist/utils/zoomTier.js +107 -0
- package/dist/utils/zoomTierRows.d.ts +41 -0
- package/dist/utils/zoomTierRows.js +103 -0
- package/dist/webmcp/WebMCPConfirm.svelte +1 -1
- package/dist/webmcp/bridge.d.ts +5 -0
- package/dist/webmcp/bridge.js +8 -0
- package/dist/webmcp/bridgeController.svelte.d.ts +84 -0
- package/dist/webmcp/bridgeController.svelte.js +224 -0
- package/dist/webmcp/descriptors.d.ts +1 -1
- package/dist/webmcp/descriptors.js +66 -5
- package/dist/webmcp/fakeWidget.d.ts +34 -0
- package/dist/webmcp/fakeWidget.js +75 -0
- package/dist/webmcp/gate.js +4 -0
- package/dist/webmcp/index.d.ts +2 -0
- package/dist/webmcp/index.js +1 -0
- package/dist/webmcp/runtime.js +4 -1
- package/dist/webmcp/types.d.ts +2 -0
- package/dist/webmcp/validate.js +5 -1
- package/package.json +8 -2
- package/dist/components/Select.svelte +0 -53
- package/dist/components/Select.svelte.d.ts +0 -15
- package/dist/components/icons/CommandLineIcon.svelte +0 -15
- package/dist/components/icons/CommandLineIcon.svelte.d.ts +0 -26
- package/dist/components/toast/WarningIcon.svelte +0 -28
- package/dist/components/toast/WarningIcon.svelte.d.ts +0 -26
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node card geometry: the straight-wire contract as one pure function.
|
|
3
|
+
*
|
|
4
|
+
* Every node position is on the 20px grid, and every handle centre is a
|
|
5
|
+
* multiple of 20 from the node top, so any output can line up with any input in
|
|
6
|
+
* a straight wire. The rules (Graphite G8, "Geometry contract"):
|
|
7
|
+
*
|
|
8
|
+
* | Part | Value |
|
|
9
|
+
* |-------------------|-------------------------------------------------------------|
|
|
10
|
+
* | Width | 280, or 320 when a row's input and output pills would collide |
|
|
11
|
+
* | Header | always 60 |
|
|
12
|
+
* | Exec pins | y = 40, at x = 0 and x = width |
|
|
13
|
+
* | Description band | 60, reserved on EVERY node while the setting is on |
|
|
14
|
+
* | Port rows | first row centre at 80 (140 with the band), pitch 40 |
|
|
15
|
+
* | Border | drawn inside the box, so it never adds to the height |
|
|
16
|
+
*
|
|
17
|
+
* Nothing here measures the DOM. The node component renders what this function
|
|
18
|
+
* says (it positions every handle from `handleY`), and the edge, alignment and
|
|
19
|
+
* layout code can ask the same function where a handle will be before a node
|
|
20
|
+
* is rendered. Comfortable density only (decision D2): a Compact density would
|
|
21
|
+
* move different rows by different amounts and bend straight wires.
|
|
22
|
+
*
|
|
23
|
+
* Other node types plug in through the same input: a gateway passes its
|
|
24
|
+
* branches as `outputs` with `execPins: 'input'` (a branch named `trigger` stays
|
|
25
|
+
* a row), a node with no inputs passes `inputs: []`, and `execPins: 'none'`
|
|
26
|
+
* keeps the completion trigger as an ordinary row (a tool, whose only port is
|
|
27
|
+
* its tool port).
|
|
28
|
+
*
|
|
29
|
+
* The three compact shapes (Simple, Square, Terminal) have no header, so they
|
|
30
|
+
* use `computeShapeGeometry`: the same rule (every handle centre a multiple of
|
|
31
|
+
* 20 from the node top, every box a multiple of 20) on a plain 40px pitch.
|
|
32
|
+
*
|
|
33
|
+
* @module utils/nodeGeometry
|
|
34
|
+
*/
|
|
35
|
+
/** The canvas grid every offset below is a multiple of. */
|
|
36
|
+
export const NODE_GRID = 20;
|
|
37
|
+
/** Header height. Fixed: a long title wraps to two lines and clamps, it never grows the header. */
|
|
38
|
+
export const NODE_HEADER_HEIGHT = 60;
|
|
39
|
+
/** The description band, reserved on every node while descriptions are shown. */
|
|
40
|
+
export const NODE_DESCRIPTION_BAND_HEIGHT = 60;
|
|
41
|
+
/** Exec pins sit on the third grid line of the header, clear of the top corner and the gear. */
|
|
42
|
+
export const NODE_EXEC_PIN_Y = 40;
|
|
43
|
+
/** Comfortable row pitch. */
|
|
44
|
+
export const NODE_ROW_PITCH = 40;
|
|
45
|
+
/** Default width. */
|
|
46
|
+
export const NODE_WIDTH = 280;
|
|
47
|
+
/** Width when a row's input and output pills would collide: one 40px step wider. */
|
|
48
|
+
export const NODE_WIDTH_WIDE = 320;
|
|
49
|
+
/** A port pill never grows past this (px); the rest is an ellipsis, the full name is in the tooltip. */
|
|
50
|
+
export const NODE_PILL_MAX_WIDTH = 128;
|
|
51
|
+
/** Horizontal padding inside a pill, both sides together (12 + 14). */
|
|
52
|
+
const PILL_PADDING = 26;
|
|
53
|
+
/** Space the "*" of a required, open input takes. */
|
|
54
|
+
const PILL_REQUIRED_MARK = 8;
|
|
55
|
+
/** Average glyph advance of a 12px / 500 label, a deliberately slightly generous estimate. */
|
|
56
|
+
const PILL_CHAR_WIDTH = 6.5;
|
|
57
|
+
/** Air kept between an input pill and an output pill on one row. */
|
|
58
|
+
const PILL_MIN_GAP = 32;
|
|
59
|
+
/** The id and data type of the completion port, which is drawn as a header pin. */
|
|
60
|
+
export const EXEC_PORT_ID = 'trigger';
|
|
61
|
+
/** True for the completion port: id and data type `trigger`. */
|
|
62
|
+
export function isCompletionPort(port) {
|
|
63
|
+
return port.id === EXEC_PORT_ID && port.dataType === 'trigger';
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The width a pill is given (px): its label plus padding, capped at 128.
|
|
67
|
+
* An estimate on purpose, so the same name always lays out the same wherever it
|
|
68
|
+
* is measured (no font, no DOM).
|
|
69
|
+
*/
|
|
70
|
+
export function estimatePillWidth(port, showRequiredMark = false) {
|
|
71
|
+
const text = port.name ?? port.id;
|
|
72
|
+
const mark = showRequiredMark && port.required ? PILL_REQUIRED_MARK : 0;
|
|
73
|
+
return Math.min(NODE_PILL_MAX_WIDTH, Math.ceil(PILL_PADDING + mark + text.length * PILL_CHAR_WIDTH));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Compute a node card's geometry.
|
|
77
|
+
*
|
|
78
|
+
* @param input - Exposed ports, in order, and the descriptions setting
|
|
79
|
+
*/
|
|
80
|
+
export function computeNodeGeometry(input) {
|
|
81
|
+
const mode = input.execPins ?? 'completion';
|
|
82
|
+
const execIn = mode !== 'none' ? (input.inputs.find(isCompletionPort) ?? null) : null;
|
|
83
|
+
const execOut = mode === 'completion' ? (input.outputs.find(isCompletionPort) ?? null) : null;
|
|
84
|
+
const inputs = input.inputs.filter((port) => port !== execIn);
|
|
85
|
+
const outputs = input.outputs.filter((port) => port !== execOut);
|
|
86
|
+
const rowCount = Math.max(inputs.length, outputs.length, input.minRows ?? 1);
|
|
87
|
+
const descriptionBand = input.showDescriptions ? NODE_DESCRIPTION_BAND_HEIGHT : 0;
|
|
88
|
+
const bodyTop = NODE_HEADER_HEIGHT + descriptionBand;
|
|
89
|
+
// Widen to one 40px step when any row's two pills would meet.
|
|
90
|
+
let wide = false;
|
|
91
|
+
for (let i = 0; i < Math.min(inputs.length, outputs.length); i++) {
|
|
92
|
+
if (estimatePillWidth(inputs[i], true) + estimatePillWidth(outputs[i]) + PILL_MIN_GAP >
|
|
93
|
+
NODE_WIDTH) {
|
|
94
|
+
wide = true;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const width = input.width ?? (wide ? NODE_WIDTH_WIDE : NODE_WIDTH);
|
|
99
|
+
const rows = [];
|
|
100
|
+
const handles = [];
|
|
101
|
+
if (execIn) {
|
|
102
|
+
handles.push({
|
|
103
|
+
portId: execIn.id,
|
|
104
|
+
port: execIn,
|
|
105
|
+
direction: 'input',
|
|
106
|
+
kind: 'pin',
|
|
107
|
+
x: 0,
|
|
108
|
+
y: NODE_EXEC_PIN_Y
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (execOut) {
|
|
112
|
+
handles.push({
|
|
113
|
+
portId: execOut.id,
|
|
114
|
+
port: execOut,
|
|
115
|
+
direction: 'output',
|
|
116
|
+
kind: 'pin',
|
|
117
|
+
x: width,
|
|
118
|
+
y: NODE_EXEC_PIN_Y
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
for (let i = 0; i < rowCount; i++) {
|
|
122
|
+
const y = bodyTop + NODE_GRID + i * NODE_ROW_PITCH;
|
|
123
|
+
const rowInput = inputs[i] ?? null;
|
|
124
|
+
const rowOutput = outputs[i] ?? null;
|
|
125
|
+
rows.push({ index: i, y, input: rowInput, output: rowOutput });
|
|
126
|
+
if (rowInput) {
|
|
127
|
+
handles.push({
|
|
128
|
+
portId: rowInput.id,
|
|
129
|
+
port: rowInput,
|
|
130
|
+
direction: 'input',
|
|
131
|
+
kind: 'row',
|
|
132
|
+
x: 0,
|
|
133
|
+
y,
|
|
134
|
+
row: i
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (rowOutput) {
|
|
138
|
+
handles.push({
|
|
139
|
+
portId: rowOutput.id,
|
|
140
|
+
port: rowOutput,
|
|
141
|
+
direction: 'output',
|
|
142
|
+
kind: 'row',
|
|
143
|
+
x: width,
|
|
144
|
+
y,
|
|
145
|
+
row: i
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
width,
|
|
151
|
+
height: bodyTop + rowCount * NODE_ROW_PITCH,
|
|
152
|
+
headerHeight: NODE_HEADER_HEIGHT,
|
|
153
|
+
descriptionBand,
|
|
154
|
+
bodyTop,
|
|
155
|
+
rowPitch: NODE_ROW_PITCH,
|
|
156
|
+
rowCount,
|
|
157
|
+
rows,
|
|
158
|
+
execInput: handles.find((h) => h.kind === 'pin' && h.direction === 'input') ?? null,
|
|
159
|
+
execOutput: handles.find((h) => h.kind === 'pin' && h.direction === 'output') ?? null,
|
|
160
|
+
handles,
|
|
161
|
+
wide
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/** Where a port's handle centre is, from the node's top-left, or undefined for an unknown port. */
|
|
165
|
+
export function handleCenter(geometry, direction, portId) {
|
|
166
|
+
const handle = geometry.handles.find((h) => h.direction === direction && h.portId === portId);
|
|
167
|
+
return handle ? { x: handle.x, y: handle.y } : undefined;
|
|
168
|
+
}
|
|
169
|
+
/** Compact shapes: the smallest box, and the step every box grows by. */
|
|
170
|
+
export const SHAPE_MIN_SIZE = 80;
|
|
171
|
+
/** Pitch of a compact shape's ports. */
|
|
172
|
+
export const SHAPE_PORT_PITCH = 40;
|
|
173
|
+
/**
|
|
174
|
+
* The y of a compact shape's port, from the node top: a lone port sits at 40,
|
|
175
|
+
* several start at 20 and step by 40. Always a multiple of 20.
|
|
176
|
+
*/
|
|
177
|
+
export function shapePortY(index, count) {
|
|
178
|
+
return count === 1 ? SHAPE_MIN_SIZE / 2 : NODE_GRID + index * SHAPE_PORT_PITCH;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Geometry of the compact shapes (Simple, Square, Terminal). They have no
|
|
182
|
+
* header and keep their silhouette, but meet the same invariant as the card:
|
|
183
|
+
* every handle centre is a multiple of 20 from the node top and the box is a
|
|
184
|
+
* multiple of 20 (of 40 in height, so the ports sit symmetrically).
|
|
185
|
+
*/
|
|
186
|
+
export function computeShapeGeometry(input) {
|
|
187
|
+
const width = input.width ?? NODE_WIDTH;
|
|
188
|
+
const most = Math.max(input.inputs.length, input.outputs.length, 2);
|
|
189
|
+
const handles = [];
|
|
190
|
+
const side = (list, direction) => {
|
|
191
|
+
list.forEach((port, i) => handles.push({
|
|
192
|
+
portId: port.id,
|
|
193
|
+
port,
|
|
194
|
+
direction,
|
|
195
|
+
kind: 'row',
|
|
196
|
+
x: direction === 'input' ? 0 : width,
|
|
197
|
+
y: shapePortY(i, list.length),
|
|
198
|
+
row: i
|
|
199
|
+
}));
|
|
200
|
+
};
|
|
201
|
+
side(input.inputs, 'input');
|
|
202
|
+
side(input.outputs, 'output');
|
|
203
|
+
return { width, height: most * SHAPE_PORT_PITCH, handles };
|
|
204
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Doctor's findings on one node, shared by UniversalNode (which knows them)
|
|
3
|
+
* with the node component (which draws them in its header). `claimed` is set by
|
|
4
|
+
* a node that renders a NodeProblemMark itself; UniversalNode draws a fallback
|
|
5
|
+
* mark in the node's corner for the types that do not (Idea, Caption, ...).
|
|
6
|
+
*/
|
|
7
|
+
export interface NodeProblem {
|
|
8
|
+
/** Worst severity on the node, or null when it has no problems. */
|
|
9
|
+
readonly severity: 'error' | 'warning' | 'info' | null;
|
|
10
|
+
/** Accessible name, e.g. "Error: 2 problems". */
|
|
11
|
+
readonly label: string;
|
|
12
|
+
/** Tooltip: the label, then one line per problem. */
|
|
13
|
+
readonly tooltip: string;
|
|
14
|
+
/** Whether the node component draws the mark itself. */
|
|
15
|
+
claimed: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function provideNodeProblem(problem: NodeProblem): void;
|
|
18
|
+
/** The node's problems, or undefined outside a UniversalNode (stories, tests). */
|
|
19
|
+
export declare function getNodeProblem(): NodeProblem | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getContext, setContext } from 'svelte';
|
|
2
|
+
const KEY = Symbol('fd-node-problem');
|
|
3
|
+
export function provideNodeProblem(problem) {
|
|
4
|
+
setContext(KEY, problem);
|
|
5
|
+
}
|
|
6
|
+
/** The node's problems, or undefined outside a UniversalNode (stories, tests). */
|
|
7
|
+
export function getNodeProblem() {
|
|
8
|
+
return getContext(KEY);
|
|
9
|
+
}
|
|
@@ -4,7 +4,28 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { NodeExecutionStatus, NodeExecutionInfo } from '../types/index.js';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* The five statuses a run can show on the canvas (the `StatusPill` vocabulary).
|
|
8
|
+
* Same names as `--fd-status-*` tokens.
|
|
9
|
+
*/
|
|
10
|
+
export type PillStatus = 'running' | 'completed' | 'waiting' | 'failed' | 'skipped';
|
|
11
|
+
/**
|
|
12
|
+
* Map an execution status onto the pill vocabulary; `null` = draw nothing.
|
|
13
|
+
*
|
|
14
|
+
* idle -> null nothing happened (a node that never ran).
|
|
15
|
+
* pending -> null queued, not started: no result and no activity
|
|
16
|
+
* to report yet; the pill appears once it runs.
|
|
17
|
+
* running -> running
|
|
18
|
+
* completed -> completed
|
|
19
|
+
* failed -> failed
|
|
20
|
+
* paused -> waiting the run is held, usually for a person.
|
|
21
|
+
* interrupted -> waiting waiting for a human ("Waiting for you").
|
|
22
|
+
* skipped -> skipped
|
|
23
|
+
* cancelled -> skipped the node did not finish and has no result.
|
|
24
|
+
*/
|
|
25
|
+
export declare function toPillStatus(status: NodeExecutionStatus): PillStatus | null;
|
|
26
|
+
/**
|
|
27
|
+
* Get the display color for a node execution status, as a CSS value
|
|
28
|
+
* (`var(--fd-status-*)`), so themes and dark mode apply. Only valid in CSS.
|
|
8
29
|
*/
|
|
9
30
|
export declare function getStatusColor(status: NodeExecutionStatus): string;
|
|
10
31
|
/**
|
|
@@ -16,11 +37,13 @@ export declare function getStatusIcon(status: NodeExecutionStatus): string;
|
|
|
16
37
|
*/
|
|
17
38
|
export declare function getStatusLabel(status: NodeExecutionStatus): string;
|
|
18
39
|
/**
|
|
19
|
-
* Get the background color for a node execution status overlay
|
|
40
|
+
* Get the background color for a node execution status overlay, as a CSS value
|
|
41
|
+
* (`var(--fd-status-*-soft)`).
|
|
20
42
|
*/
|
|
21
43
|
export declare function getStatusBackgroundColor(status: NodeExecutionStatus): string;
|
|
22
44
|
/**
|
|
23
|
-
* Get the text color for a node execution status overlay
|
|
45
|
+
* Get the text color for a node execution status overlay, as a CSS value.
|
|
46
|
+
* Same as {@link getStatusColor}: the status tokens are text-safe on `-soft`.
|
|
24
47
|
*/
|
|
25
48
|
export declare function getStatusTextColor(status: NodeExecutionStatus): string;
|
|
26
49
|
/**
|
|
@@ -51,3 +74,15 @@ export declare function formatExecutionDuration(duration?: number): string;
|
|
|
51
74
|
* Format last executed timestamp for display
|
|
52
75
|
*/
|
|
53
76
|
export declare function formatLastExecuted(timestamp?: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Remove `data.executionInfo` from every node.
|
|
79
|
+
*
|
|
80
|
+
* Run status belongs to a run, not to the workflow: it lives in the
|
|
81
|
+
* instance's `PlaygroundStore` (`fd.playground.nodeStatuses`) and must never
|
|
82
|
+
* be written into a workflow that is synced to the store, saved or exported.
|
|
83
|
+
* Returns the same array when no node carries it, otherwise new node objects
|
|
84
|
+
* for those that did.
|
|
85
|
+
*/
|
|
86
|
+
export declare function stripExecutionInfo<T extends {
|
|
87
|
+
data: object;
|
|
88
|
+
}>(nodes: T[]): T[];
|
package/dist/utils/nodeStatus.js
CHANGED
|
@@ -3,21 +3,50 @@
|
|
|
3
3
|
* Provides utilities for managing and displaying node execution status
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Map an execution status onto the pill vocabulary; `null` = draw nothing.
|
|
7
|
+
*
|
|
8
|
+
* idle -> null nothing happened (a node that never ran).
|
|
9
|
+
* pending -> null queued, not started: no result and no activity
|
|
10
|
+
* to report yet; the pill appears once it runs.
|
|
11
|
+
* running -> running
|
|
12
|
+
* completed -> completed
|
|
13
|
+
* failed -> failed
|
|
14
|
+
* paused -> waiting the run is held, usually for a person.
|
|
15
|
+
* interrupted -> waiting waiting for a human ("Waiting for you").
|
|
16
|
+
* skipped -> skipped
|
|
17
|
+
* cancelled -> skipped the node did not finish and has no result.
|
|
18
|
+
*/
|
|
19
|
+
export function toPillStatus(status) {
|
|
20
|
+
switch (status) {
|
|
21
|
+
case 'running':
|
|
22
|
+
case 'completed':
|
|
23
|
+
case 'failed':
|
|
24
|
+
case 'skipped':
|
|
25
|
+
return status;
|
|
26
|
+
case 'paused':
|
|
27
|
+
case 'interrupted':
|
|
28
|
+
return 'waiting';
|
|
29
|
+
case 'cancelled':
|
|
30
|
+
return 'skipped';
|
|
31
|
+
default:
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** The `--fd-status-*` token name for an execution status (idle falls back to skipped's muted tone). */
|
|
36
|
+
function statusToken(status) {
|
|
37
|
+
switch (status) {
|
|
38
|
+
case 'pending':
|
|
39
|
+
return 'waiting';
|
|
40
|
+
default:
|
|
41
|
+
return toPillStatus(status) ?? 'skipped';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get the display color for a node execution status, as a CSS value
|
|
46
|
+
* (`var(--fd-status-*)`), so themes and dark mode apply. Only valid in CSS.
|
|
7
47
|
*/
|
|
8
48
|
export function getStatusColor(status) {
|
|
9
|
-
|
|
10
|
-
idle: '#6b7280', // gray
|
|
11
|
-
pending: '#f59e0b', // amber
|
|
12
|
-
running: '#3b82f6', // blue
|
|
13
|
-
completed: '#10b981', // emerald
|
|
14
|
-
failed: '#ef4444', // red
|
|
15
|
-
cancelled: '#6b7280', // gray
|
|
16
|
-
skipped: '#8b5cf6', // violet
|
|
17
|
-
paused: '#f97316', // orange
|
|
18
|
-
interrupted: '#06b6d4' // cyan
|
|
19
|
-
};
|
|
20
|
-
return statusColors[status] || statusColors.idle;
|
|
49
|
+
return `var(--fd-status-${statusToken(status)})`;
|
|
21
50
|
}
|
|
22
51
|
/**
|
|
23
52
|
* Get the display icon for a node execution status
|
|
@@ -54,38 +83,18 @@ export function getStatusLabel(status) {
|
|
|
54
83
|
return statusLabels[status] || statusLabels.idle;
|
|
55
84
|
}
|
|
56
85
|
/**
|
|
57
|
-
* Get the background color for a node execution status overlay
|
|
86
|
+
* Get the background color for a node execution status overlay, as a CSS value
|
|
87
|
+
* (`var(--fd-status-*-soft)`).
|
|
58
88
|
*/
|
|
59
89
|
export function getStatusBackgroundColor(status) {
|
|
60
|
-
|
|
61
|
-
idle: '#f9fafb', // light gray
|
|
62
|
-
pending: '#fef3c7', // light amber
|
|
63
|
-
running: '#dbeafe', // light blue
|
|
64
|
-
completed: '#d1fae5', // light emerald
|
|
65
|
-
failed: '#fee2e2', // light red
|
|
66
|
-
cancelled: '#f3f4f6', // light gray
|
|
67
|
-
skipped: '#ede9fe', // light violet
|
|
68
|
-
paused: '#ffedd5', // light orange
|
|
69
|
-
interrupted: '#cffafe' // light cyan
|
|
70
|
-
};
|
|
71
|
-
return statusBackgroundColors[status] || statusBackgroundColors.idle;
|
|
90
|
+
return `var(--fd-status-${statusToken(status)}-soft)`;
|
|
72
91
|
}
|
|
73
92
|
/**
|
|
74
|
-
* Get the text color for a node execution status overlay
|
|
93
|
+
* Get the text color for a node execution status overlay, as a CSS value.
|
|
94
|
+
* Same as {@link getStatusColor}: the status tokens are text-safe on `-soft`.
|
|
75
95
|
*/
|
|
76
96
|
export function getStatusTextColor(status) {
|
|
77
|
-
|
|
78
|
-
idle: '#6b7280', // gray
|
|
79
|
-
pending: '#d97706', // amber
|
|
80
|
-
running: '#1d4ed8', // blue
|
|
81
|
-
completed: '#059669', // emerald
|
|
82
|
-
failed: '#dc2626', // red
|
|
83
|
-
cancelled: '#6b7280', // gray
|
|
84
|
-
skipped: '#7c3aed', // violet
|
|
85
|
-
paused: '#ea580c', // orange
|
|
86
|
-
interrupted: '#0891b2' // cyan
|
|
87
|
-
};
|
|
88
|
-
return statusTextColors[status] || statusTextColors.idle;
|
|
97
|
+
return getStatusColor(status);
|
|
89
98
|
}
|
|
90
99
|
/**
|
|
91
100
|
* Create a default NodeExecutionInfo object
|
|
@@ -191,3 +200,22 @@ export function formatLastExecuted(timestamp) {
|
|
|
191
200
|
return date.toLocaleDateString();
|
|
192
201
|
}
|
|
193
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Remove `data.executionInfo` from every node.
|
|
205
|
+
*
|
|
206
|
+
* Run status belongs to a run, not to the workflow: it lives in the
|
|
207
|
+
* instance's `PlaygroundStore` (`fd.playground.nodeStatuses`) and must never
|
|
208
|
+
* be written into a workflow that is synced to the store, saved or exported.
|
|
209
|
+
* Returns the same array when no node carries it, otherwise new node objects
|
|
210
|
+
* for those that did.
|
|
211
|
+
*/
|
|
212
|
+
export function stripExecutionInfo(nodes) {
|
|
213
|
+
if (!nodes.some((node) => 'executionInfo' in node.data))
|
|
214
|
+
return nodes;
|
|
215
|
+
return nodes.map((node) => {
|
|
216
|
+
if (!('executionInfo' in node.data))
|
|
217
|
+
return node;
|
|
218
|
+
const { executionInfo: _dropped, ...data } = node.data;
|
|
219
|
+
return { ...node, data };
|
|
220
|
+
});
|
|
221
|
+
}
|
package/dist/utils/nodeSwap.js
CHANGED
|
@@ -218,7 +218,15 @@ export function getVersionUpgrade(currentMetadata, allNodeTypes) {
|
|
|
218
218
|
const available = allNodeTypes.find((n) => n.node_type_id === currentMetadata.node_type_id);
|
|
219
219
|
if (!available)
|
|
220
220
|
return null;
|
|
221
|
-
|
|
221
|
+
// Backends may omit the version (FlowDrop for Drupal sends none); without
|
|
222
|
+
// both there is nothing to compare, so no upgrade is offered.
|
|
223
|
+
const availableVersion = available.version;
|
|
224
|
+
const currentVersion = currentMetadata.version;
|
|
225
|
+
if (typeof availableVersion !== 'string' || typeof currentVersion !== 'string')
|
|
226
|
+
return null;
|
|
227
|
+
if (availableVersion === '' || currentVersion === '')
|
|
228
|
+
return null;
|
|
229
|
+
if (compareSemver(availableVersion, currentVersion) > 0) {
|
|
222
230
|
return available;
|
|
223
231
|
}
|
|
224
232
|
return null;
|
|
@@ -9,6 +9,7 @@ import type { NodeExecutionInfo } from '../types/index.js';
|
|
|
9
9
|
export interface NodeStatusConfig {
|
|
10
10
|
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
11
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
/** @deprecated No effect: the badge shows status only. Details are in the inspector's Last run tab. */
|
|
12
13
|
showDetails?: boolean;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the Playground's history chip lists: the conversations (sessions the
|
|
3
|
+
* Playground created) and the runs of the open conversation.
|
|
4
|
+
*
|
|
5
|
+
* Pure: no store, no fetch, never throws, never mutates its arguments.
|
|
6
|
+
*
|
|
7
|
+
* @module utils/playgroundHistory
|
|
8
|
+
*/
|
|
9
|
+
import type { PlaygroundSession, SessionRunsResult } from '../types/playground.js';
|
|
10
|
+
/** One conversation in the history chip. */
|
|
11
|
+
export interface HistoryConversation {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
/** The conversation that is open. */
|
|
15
|
+
current: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** One run in the history chip. */
|
|
18
|
+
export interface HistoryRun {
|
|
19
|
+
/** Pipeline id of the run. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** 1 for the first run of the conversation. */
|
|
22
|
+
number: number;
|
|
23
|
+
status: string;
|
|
24
|
+
/** What started it: the person's message, when the server reports one. */
|
|
25
|
+
message: string | null;
|
|
26
|
+
startedAt: string | null;
|
|
27
|
+
/** It ran on another version of the workflow than the current one. */
|
|
28
|
+
stale: boolean;
|
|
29
|
+
/** It is the run the view is on (pinned, or the latest). */
|
|
30
|
+
shown: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** The two groups of the history chip. */
|
|
33
|
+
export interface HistoryGroups {
|
|
34
|
+
conversations: HistoryConversation[];
|
|
35
|
+
/** Newest first. */
|
|
36
|
+
runs: HistoryRun[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Group the history: conversations as the store lists them, runs of the open
|
|
40
|
+
* conversation newest first with stale ones marked ({@link isRunStale}
|
|
41
|
+
* against the version the runs endpoint reports as current).
|
|
42
|
+
*
|
|
43
|
+
* @param sessions - The sessions to list (already the Playground's own)
|
|
44
|
+
* @param currentSessionId - The open conversation
|
|
45
|
+
* @param runs - `GET /sessions/{id}/runs` for the open conversation, or `null`
|
|
46
|
+
* @param shownRunId - The run the view is on
|
|
47
|
+
*/
|
|
48
|
+
export declare function historyGroups(sessions: readonly PlaygroundSession[], currentSessionId: string | null | undefined, runs: SessionRunsResult | null | undefined, shownRunId?: string | null): HistoryGroups;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the Playground's history chip lists: the conversations (sessions the
|
|
3
|
+
* Playground created) and the runs of the open conversation.
|
|
4
|
+
*
|
|
5
|
+
* Pure: no store, no fetch, never throws, never mutates its arguments.
|
|
6
|
+
*
|
|
7
|
+
* @module utils/playgroundHistory
|
|
8
|
+
*/
|
|
9
|
+
import { isRunStale } from './sessionRuns.js';
|
|
10
|
+
/**
|
|
11
|
+
* Group the history: conversations as the store lists them, runs of the open
|
|
12
|
+
* conversation newest first with stale ones marked ({@link isRunStale}
|
|
13
|
+
* against the version the runs endpoint reports as current).
|
|
14
|
+
*
|
|
15
|
+
* @param sessions - The sessions to list (already the Playground's own)
|
|
16
|
+
* @param currentSessionId - The open conversation
|
|
17
|
+
* @param runs - `GET /sessions/{id}/runs` for the open conversation, or `null`
|
|
18
|
+
* @param shownRunId - The run the view is on
|
|
19
|
+
*/
|
|
20
|
+
export function historyGroups(sessions, currentSessionId, runs, shownRunId) {
|
|
21
|
+
const conversations = sessions.map((session) => ({
|
|
22
|
+
id: session.id,
|
|
23
|
+
name: session.name,
|
|
24
|
+
current: session.id === currentSessionId
|
|
25
|
+
}));
|
|
26
|
+
const list = runs?.runs ?? [];
|
|
27
|
+
const current = runs?.workflowVersion ?? null;
|
|
28
|
+
const items = list.map((run, index) => ({
|
|
29
|
+
id: run.id,
|
|
30
|
+
number: index + 1,
|
|
31
|
+
status: run.status,
|
|
32
|
+
message: run.message,
|
|
33
|
+
startedAt: run.startedAt,
|
|
34
|
+
stale: isRunStale(run.workflowVersion, current),
|
|
35
|
+
shown: run.id === shownRunId
|
|
36
|
+
}));
|
|
37
|
+
return { conversations, runs: items.reverse() };
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The earlier runs of a session that carried named inputs, read back from the
|
|
3
|
+
* session's own messages: a turn started with inputs records them in its user
|
|
4
|
+
* message's `metadata.inputs` (the same data the "Ran with …" label names).
|
|
5
|
+
* Nothing is kept client-side, so the list survives a reload and follows a
|
|
6
|
+
* switch of session.
|
|
7
|
+
*/
|
|
8
|
+
import type { PlaygroundMessage } from '../types/playground.js';
|
|
9
|
+
import type { WorkflowInterfaceEntry } from '../types/index.js';
|
|
10
|
+
/** One earlier run: what it was started with, and when. */
|
|
11
|
+
export interface PlaygroundInputRun {
|
|
12
|
+
/** The user message that started the run. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** ISO 8601 time of that message. */
|
|
15
|
+
timestamp: string;
|
|
16
|
+
/** The inputs it carried, keyed by interface entry id. */
|
|
17
|
+
inputs: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The session's runs that carried inputs, newest first. Only keys the form
|
|
21
|
+
* still has an entry for are kept, so a refill never reintroduces an input the
|
|
22
|
+
* interface dropped since; a run left with none is not listed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function playgroundInputRuns(messages: readonly PlaygroundMessage[], entries: readonly WorkflowInterfaceEntry[], limit?: number): PlaygroundInputRun[];
|
|
25
|
+
/** "Topic: cats · Count: 3": what a run was started with, by input name. */
|
|
26
|
+
export declare function summarizeRunInputs(inputs: Record<string, unknown>, entries: readonly WorkflowInterfaceEntry[]): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The earlier runs of a session that carried named inputs, read back from the
|
|
3
|
+
* session's own messages: a turn started with inputs records them in its user
|
|
4
|
+
* message's `metadata.inputs` (the same data the "Ran with …" label names).
|
|
5
|
+
* Nothing is kept client-side, so the list survives a reload and follows a
|
|
6
|
+
* switch of session.
|
|
7
|
+
*/
|
|
8
|
+
/** The inputs of a message, or null when it carried none. */
|
|
9
|
+
function messageInputs(message) {
|
|
10
|
+
if (message.role !== 'user')
|
|
11
|
+
return null;
|
|
12
|
+
const inputs = message.metadata?.inputs;
|
|
13
|
+
if (inputs === null || typeof inputs !== 'object' || Array.isArray(inputs))
|
|
14
|
+
return null;
|
|
15
|
+
return Object.keys(inputs).length > 0 ? inputs : null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The session's runs that carried inputs, newest first. Only keys the form
|
|
19
|
+
* still has an entry for are kept, so a refill never reintroduces an input the
|
|
20
|
+
* interface dropped since; a run left with none is not listed.
|
|
21
|
+
*/
|
|
22
|
+
export function playgroundInputRuns(messages, entries, limit = 5) {
|
|
23
|
+
const ids = new Set(entries.map((entry) => entry.id));
|
|
24
|
+
const runs = [];
|
|
25
|
+
for (let i = messages.length - 1; i >= 0 && runs.length < limit; i--) {
|
|
26
|
+
const sent = messageInputs(messages[i]);
|
|
27
|
+
if (!sent)
|
|
28
|
+
continue;
|
|
29
|
+
const inputs = Object.fromEntries(Object.entries(sent).filter(([id]) => ids.has(id)));
|
|
30
|
+
if (Object.keys(inputs).length > 0) {
|
|
31
|
+
runs.push({ id: messages[i].id, timestamp: messages[i].timestamp, inputs });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return runs;
|
|
35
|
+
}
|
|
36
|
+
/** A value as a short single line, for the list of runs. */
|
|
37
|
+
function brief(value) {
|
|
38
|
+
const text = typeof value === 'string' ? value : JSON.stringify(value);
|
|
39
|
+
const line = (text ?? '').replace(/\s+/g, ' ').trim();
|
|
40
|
+
return line.length > 40 ? `${line.slice(0, 39)}…` : line;
|
|
41
|
+
}
|
|
42
|
+
/** "Topic: cats · Count: 3": what a run was started with, by input name. */
|
|
43
|
+
export function summarizeRunInputs(inputs, entries) {
|
|
44
|
+
return Object.entries(inputs)
|
|
45
|
+
.map(([id, value]) => {
|
|
46
|
+
const entry = entries.find((candidate) => candidate.id === id);
|
|
47
|
+
return `${entry?.name ?? id}: ${brief(value)}`;
|
|
48
|
+
})
|
|
49
|
+
.join(' · ');
|
|
50
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bulk port exposure for a node: which ports "Hide unconnected ports" and
|
|
3
|
+
* "Show hidden ports" would change, and the node's `config.ports` afterwards.
|
|
4
|
+
*
|
|
5
|
+
* Pure. Exposure is semantic in v2 (a hidden port is off the canvas, not
|
|
6
|
+
* wireable, not runtime-overridable), so these are real config edits, the same
|
|
7
|
+
* ones the Ports form makes with its eye toggle, only in bulk.
|
|
8
|
+
*
|
|
9
|
+
* @module utils/portExposure
|
|
10
|
+
*/
|
|
11
|
+
import type { NodePort, PortsConfig, Workflow, WorkflowNode } from '../types/index.js';
|
|
12
|
+
import type { PortsDirection } from './portUtils.js';
|
|
13
|
+
/** Whether a bulk edit hides ports or shows them. */
|
|
14
|
+
export type PortExposureMode = 'hide' | 'show';
|
|
15
|
+
/** A port a bulk edit would change. */
|
|
16
|
+
export interface PortExposureCandidate {
|
|
17
|
+
direction: PortsDirection;
|
|
18
|
+
port: NodePort;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The ports the Ports form lists for a direction: the node type's metadata
|
|
22
|
+
* ports, then the instance's dynamic ports. A gateway's branches are not part
|
|
23
|
+
* of it (they are always drawn).
|
|
24
|
+
*/
|
|
25
|
+
export declare function nodePortsFor(node: Pick<WorkflowNode, 'data'>, direction: PortsDirection): NodePort[];
|
|
26
|
+
/**
|
|
27
|
+
* Exposed data ports with no edge on them, the ones worth hiding. Left out:
|
|
28
|
+
* reserved ports (error output, trigger and tool types), control-flow ports
|
|
29
|
+
* (loop-back), a trigger's event input (always exposed), ports published on
|
|
30
|
+
* the workflow interface (hiding them would break the binding), and a required
|
|
31
|
+
* input with no config value (hiding it would only hide the missing value).
|
|
32
|
+
*/
|
|
33
|
+
export declare function hideCandidates(node: WorkflowNode, workflow: Workflow): PortExposureCandidate[];
|
|
34
|
+
/**
|
|
35
|
+
* Data ports currently hidden, in both directions. Reserved and control-flow
|
|
36
|
+
* ports (error, trigger, tool, loop-back) are left to the Ports form, as in
|
|
37
|
+
* {@link hideCandidates}: a backend often hides them by default, and showing
|
|
38
|
+
* them here would put ports on the card that "Hide unconnected ports" never
|
|
39
|
+
* takes back.
|
|
40
|
+
*/
|
|
41
|
+
export declare function showCandidates(node: WorkflowNode): PortExposureCandidate[];
|
|
42
|
+
/** The candidates of a mode. */
|
|
43
|
+
export declare function exposureCandidates(node: WorkflowNode, workflow: Workflow, mode: PortExposureMode): PortExposureCandidate[];
|
|
44
|
+
/**
|
|
45
|
+
* The node's `config.ports` after hiding or showing its candidates, keeping
|
|
46
|
+
* the stored order and every other override. `undefined` means the node ends
|
|
47
|
+
* up with no override at all (the key is to be dropped).
|
|
48
|
+
*/
|
|
49
|
+
export declare function applyPortExposure(node: WorkflowNode, workflow: Workflow, mode: PortExposureMode): PortsConfig | undefined;
|