@flowdrop/flowdrop 2.11.0 → 2.13.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 +233 -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 +976 -226
- package/dist/components/App.svelte.d.ts +34 -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 +82 -0
- package/dist/components/playground/DockedPlayground.svelte.d.ts +30 -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 +4 -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 +47 -5
- package/dist/svelte-app.js +15 -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 +75 -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,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node fingerprints: "did this node change since a run started?"
|
|
3
|
+
*
|
|
4
|
+
* A fingerprint is a string per node that changes when something that can
|
|
5
|
+
* change a run's result changes, and stays the same for edits that cannot:
|
|
6
|
+
*
|
|
7
|
+
* Counted:
|
|
8
|
+
* - the node's type and the node type it was made from (`metadata.node_type_id`),
|
|
9
|
+
* - its configuration (`data.config`), including dynamic ports and branches,
|
|
10
|
+
* - its extension data, except the `ui` namespace,
|
|
11
|
+
* - which ports feed it: the incoming edges (source node and both handles).
|
|
12
|
+
*
|
|
13
|
+
* Ignored (the server's WorkflowStamp ignores them as well):
|
|
14
|
+
* - position and size, selection, and other canvas state,
|
|
15
|
+
* - the display label (`data.label`) and the per-instance display overrides
|
|
16
|
+
* `config.instanceTitle`, `config.instanceDescription` and `config.instanceBadge`,
|
|
17
|
+
* - `extensions.ui` (visual settings),
|
|
18
|
+
* - run bookkeeping on the node data (`executionInfo`, `isProcessing`, `error`).
|
|
19
|
+
*
|
|
20
|
+
* Comparing two fingerprints of one node is all this is for; they are not a
|
|
21
|
+
* stable format and are never stored or sent.
|
|
22
|
+
*
|
|
23
|
+
* @module utils/nodeFingerprint
|
|
24
|
+
*/
|
|
25
|
+
/** Per-instance display overrides inside `config` that do not change a run. */
|
|
26
|
+
const DISPLAY_CONFIG_KEYS = new Set(['instanceTitle', 'instanceDescription', 'instanceBadge']);
|
|
27
|
+
/** JSON with object keys sorted, so key order never makes two equal values differ. */
|
|
28
|
+
function stableStringify(value) {
|
|
29
|
+
return JSON.stringify(value, (_key, v) => {
|
|
30
|
+
if (v && typeof v === 'object' && !Array.isArray(v)) {
|
|
31
|
+
const sorted = {};
|
|
32
|
+
for (const k of Object.keys(v).sort())
|
|
33
|
+
sorted[k] = v[k];
|
|
34
|
+
return sorted;
|
|
35
|
+
}
|
|
36
|
+
return v;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/** One fingerprint per node of the workflow, keyed by node id. */
|
|
40
|
+
export function fingerprintNodes(workflow) {
|
|
41
|
+
const prints = {};
|
|
42
|
+
if (!workflow)
|
|
43
|
+
return prints;
|
|
44
|
+
const incoming = new Map();
|
|
45
|
+
for (const edge of workflow.edges ?? []) {
|
|
46
|
+
const list = incoming.get(edge.target) ?? [];
|
|
47
|
+
list.push(`${edge.source}|${edge.sourceHandle ?? ''}|${edge.targetHandle ?? ''}`);
|
|
48
|
+
incoming.set(edge.target, list);
|
|
49
|
+
}
|
|
50
|
+
for (const node of workflow.nodes ?? []) {
|
|
51
|
+
const config = {};
|
|
52
|
+
for (const [key, value] of Object.entries(node.data?.config ?? {})) {
|
|
53
|
+
if (!DISPLAY_CONFIG_KEYS.has(key))
|
|
54
|
+
config[key] = value;
|
|
55
|
+
}
|
|
56
|
+
const { ui: _ui, ...extensions } = node.data?.extensions ?? {};
|
|
57
|
+
prints[node.id] = stableStringify({
|
|
58
|
+
type: node.type,
|
|
59
|
+
metadata: node.data?.metadata?.node_type_id ?? null,
|
|
60
|
+
config,
|
|
61
|
+
extensions,
|
|
62
|
+
incoming: (incoming.get(node.id) ?? []).sort()
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return prints;
|
|
66
|
+
}
|
|
@@ -23,6 +23,16 @@ import type { UISchemaElement } from '../types/uischema.js';
|
|
|
23
23
|
* ordered port list with optional exposure overrides).
|
|
24
24
|
*/
|
|
25
25
|
export declare const PORTS_CONFIG_KEY = "ports";
|
|
26
|
+
/**
|
|
27
|
+
* Whether the node has anything for the ports widget to show: a static
|
|
28
|
+
* metadata port, or a config field through which the author adds dynamic ones.
|
|
29
|
+
*
|
|
30
|
+
* Deliberately reads only `metadata` and the schema — never `data.config`.
|
|
31
|
+
* `ConfigForm` drops its in-flight `edits` buffer whenever the effective schema
|
|
32
|
+
* changes identity, so a decision that moved with config values would discard a
|
|
33
|
+
* user's half-typed edit the moment it flipped.
|
|
34
|
+
*/
|
|
35
|
+
export declare function hasConfigurablePorts(node: WorkflowNode, schema: ConfigSchema | undefined): boolean;
|
|
26
36
|
/**
|
|
27
37
|
* Append the reserved `ports` property to a node's effective config schema.
|
|
28
38
|
*
|
|
@@ -14,7 +14,7 @@ const DYNAMIC_PORT_KEYS = ['dynamicInputs', 'dynamicOutputs'];
|
|
|
14
14
|
* changes identity, so a decision that moved with config values would discard a
|
|
15
15
|
* user's half-typed edit the moment it flipped.
|
|
16
16
|
*/
|
|
17
|
-
function hasConfigurablePorts(node, schema) {
|
|
17
|
+
export function hasConfigurablePorts(node, schema) {
|
|
18
18
|
const meta = node.data.metadata;
|
|
19
19
|
if ((meta?.inputs?.length ?? 0) > 0 || (meta?.outputs?.length ?? 0) > 0)
|
|
20
20
|
return true;
|
|
@@ -51,7 +51,7 @@ export function withPortsField(base, node) {
|
|
|
51
51
|
// The signal FormField/FormFieldLight match to render <FormPorts>.
|
|
52
52
|
format: 'ports',
|
|
53
53
|
title: 'Ports',
|
|
54
|
-
description: '
|
|
54
|
+
description: 'Hidden ports are off the canvas and cannot be wired. Drag to reorder.'
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
};
|
|
@@ -0,0 +1,168 @@
|
|
|
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 declare const NODE_GRID = 20;
|
|
37
|
+
/** Header height. Fixed: a long title wraps to two lines and clamps, it never grows the header. */
|
|
38
|
+
export declare const NODE_HEADER_HEIGHT = 60;
|
|
39
|
+
/** The description band, reserved on every node while descriptions are shown. */
|
|
40
|
+
export declare 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 declare const NODE_EXEC_PIN_Y = 40;
|
|
43
|
+
/** Comfortable row pitch. */
|
|
44
|
+
export declare const NODE_ROW_PITCH = 40;
|
|
45
|
+
/** Default width. */
|
|
46
|
+
export declare const NODE_WIDTH = 280;
|
|
47
|
+
/** Width when a row's input and output pills would collide: one 40px step wider. */
|
|
48
|
+
export declare 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 declare const NODE_PILL_MAX_WIDTH = 128;
|
|
51
|
+
/** The id and data type of the completion port, which is drawn as a header pin. */
|
|
52
|
+
export declare const EXEC_PORT_ID = "trigger";
|
|
53
|
+
/** What the geometry needs to know about a port. */
|
|
54
|
+
export interface GeometryPort {
|
|
55
|
+
id: string;
|
|
56
|
+
name?: string;
|
|
57
|
+
dataType: string;
|
|
58
|
+
required?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface NodeGeometryInput<P extends GeometryPort = GeometryPort> {
|
|
61
|
+
/** Exposed input ports, in render order (the completion trigger included). */
|
|
62
|
+
inputs: readonly P[];
|
|
63
|
+
/** Exposed output ports, in render order (a gateway passes its branches here). */
|
|
64
|
+
outputs: readonly P[];
|
|
65
|
+
/** The *Show descriptions* setting. */
|
|
66
|
+
showDescriptions: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* `'completion'` (default): the port with id and data type `trigger` becomes a
|
|
69
|
+
* pin in the header, in and out. `'input'`: only the input one does (a gateway,
|
|
70
|
+
* whose outputs are branches). `'none'`: it stays an ordinary row.
|
|
71
|
+
*/
|
|
72
|
+
execPins?: 'completion' | 'input' | 'none';
|
|
73
|
+
/** Rows are at least this many (default 1, so an empty node keeps a body). */
|
|
74
|
+
minRows?: number;
|
|
75
|
+
/** A shape with a fixed width opts out of the pill rule. */
|
|
76
|
+
width?: number;
|
|
77
|
+
}
|
|
78
|
+
export type HandleDirection = 'input' | 'output';
|
|
79
|
+
export interface HandleGeometry<P extends GeometryPort = GeometryPort> {
|
|
80
|
+
portId: string;
|
|
81
|
+
/** The port the handle belongs to. */
|
|
82
|
+
port: P;
|
|
83
|
+
direction: HandleDirection;
|
|
84
|
+
/** `pin` in the header, `row` in the body. */
|
|
85
|
+
kind: 'pin' | 'row';
|
|
86
|
+
/** Centre, from the node's top-left corner. */
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
89
|
+
/** Row index for `row` handles. */
|
|
90
|
+
row?: number;
|
|
91
|
+
}
|
|
92
|
+
export interface RowGeometry<P extends GeometryPort = GeometryPort> {
|
|
93
|
+
index: number;
|
|
94
|
+
/** Row centre. */
|
|
95
|
+
y: number;
|
|
96
|
+
input: P | null;
|
|
97
|
+
output: P | null;
|
|
98
|
+
}
|
|
99
|
+
export interface NodeGeometry<P extends GeometryPort = GeometryPort> {
|
|
100
|
+
width: number;
|
|
101
|
+
height: number;
|
|
102
|
+
headerHeight: number;
|
|
103
|
+
/** 0, or 60 while descriptions are shown. */
|
|
104
|
+
descriptionBand: number;
|
|
105
|
+
/** Top of the port rows (header + band). */
|
|
106
|
+
bodyTop: number;
|
|
107
|
+
rowPitch: number;
|
|
108
|
+
rowCount: number;
|
|
109
|
+
rows: RowGeometry<P>[];
|
|
110
|
+
/** The header pins, when the completion ports exist. */
|
|
111
|
+
execInput: HandleGeometry<P> | null;
|
|
112
|
+
execOutput: HandleGeometry<P> | null;
|
|
113
|
+
/** Every handle, pins first. */
|
|
114
|
+
handles: HandleGeometry<P>[];
|
|
115
|
+
/** True when a row's pills would have collided at 280. */
|
|
116
|
+
wide: boolean;
|
|
117
|
+
}
|
|
118
|
+
/** True for the completion port: id and data type `trigger`. */
|
|
119
|
+
export declare function isCompletionPort(port: {
|
|
120
|
+
id: string;
|
|
121
|
+
dataType: string;
|
|
122
|
+
}): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* The width a pill is given (px): its label plus padding, capped at 128.
|
|
125
|
+
* An estimate on purpose, so the same name always lays out the same wherever it
|
|
126
|
+
* is measured (no font, no DOM).
|
|
127
|
+
*/
|
|
128
|
+
export declare function estimatePillWidth(port: GeometryPort, showRequiredMark?: boolean): number;
|
|
129
|
+
/**
|
|
130
|
+
* Compute a node card's geometry.
|
|
131
|
+
*
|
|
132
|
+
* @param input - Exposed ports, in order, and the descriptions setting
|
|
133
|
+
*/
|
|
134
|
+
export declare function computeNodeGeometry<P extends GeometryPort>(input: NodeGeometryInput<P>): NodeGeometry<P>;
|
|
135
|
+
/** Where a port's handle centre is, from the node's top-left, or undefined for an unknown port. */
|
|
136
|
+
export declare function handleCenter(geometry: Pick<NodeGeometry, 'handles'>, direction: HandleDirection, portId: string): {
|
|
137
|
+
x: number;
|
|
138
|
+
y: number;
|
|
139
|
+
} | undefined;
|
|
140
|
+
/** Compact shapes: the smallest box, and the step every box grows by. */
|
|
141
|
+
export declare const SHAPE_MIN_SIZE = 80;
|
|
142
|
+
/** Pitch of a compact shape's ports. */
|
|
143
|
+
export declare const SHAPE_PORT_PITCH = 40;
|
|
144
|
+
export interface ShapeGeometryInput<P extends GeometryPort = GeometryPort> {
|
|
145
|
+
inputs: readonly P[];
|
|
146
|
+
outputs: readonly P[];
|
|
147
|
+
/** The box width (a multiple of 20): 280 for Simple, 80 for Square. Terminal ignores it. */
|
|
148
|
+
width?: number;
|
|
149
|
+
}
|
|
150
|
+
export interface ShapeGeometry<P extends GeometryPort = GeometryPort> {
|
|
151
|
+
width: number;
|
|
152
|
+
/** Always a multiple of 40, at least 80. */
|
|
153
|
+
height: number;
|
|
154
|
+
/** Handle centres, from the node's top-left (x on the box edge). */
|
|
155
|
+
handles: HandleGeometry<P>[];
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The y of a compact shape's port, from the node top: a lone port sits at 40,
|
|
159
|
+
* several start at 20 and step by 40. Always a multiple of 20.
|
|
160
|
+
*/
|
|
161
|
+
export declare function shapePortY(index: number, count: number): number;
|
|
162
|
+
/**
|
|
163
|
+
* Geometry of the compact shapes (Simple, Square, Terminal). They have no
|
|
164
|
+
* header and keep their silhouette, but meet the same invariant as the card:
|
|
165
|
+
* every handle centre is a multiple of 20 from the node top and the box is a
|
|
166
|
+
* multiple of 20 (of 40 in height, so the ports sit symmetrically).
|
|
167
|
+
*/
|
|
168
|
+
export declare function computeShapeGeometry<P extends GeometryPort>(input: ShapeGeometryInput<P>): ShapeGeometry<P>;
|
|
@@ -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[];
|