@flowdrop/flowdrop 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/README.md +94 -51
  2. package/dist/adapters/WorkflowAdapter.d.ts +1 -1
  3. package/dist/adapters/WorkflowAdapter.js +27 -47
  4. package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +2 -2
  5. package/dist/adapters/agentspec/AgentSpecAdapter.js +122 -133
  6. package/dist/adapters/agentspec/agentAdapter.d.ts +2 -2
  7. package/dist/adapters/agentspec/agentAdapter.js +10 -10
  8. package/dist/adapters/agentspec/autoLayout.d.ts +52 -6
  9. package/dist/adapters/agentspec/autoLayout.js +118 -23
  10. package/dist/adapters/agentspec/componentTypeDefaults.d.ts +1 -1
  11. package/dist/adapters/agentspec/componentTypeDefaults.js +120 -120
  12. package/dist/adapters/agentspec/defaultNodeTypes.d.ts +2 -2
  13. package/dist/adapters/agentspec/defaultNodeTypes.js +307 -307
  14. package/dist/adapters/agentspec/index.d.ts +10 -10
  15. package/dist/adapters/agentspec/index.js +6 -6
  16. package/dist/adapters/agentspec/validator.d.ts +2 -2
  17. package/dist/adapters/agentspec/validator.js +20 -22
  18. package/dist/api/enhanced-client.d.ts +3 -3
  19. package/dist/api/enhanced-client.js +72 -73
  20. package/dist/chat/commandClassifier.d.ts +19 -0
  21. package/dist/chat/commandClassifier.js +30 -0
  22. package/dist/chat/index.d.ts +27 -0
  23. package/dist/chat/index.js +32 -0
  24. package/dist/chat/responseParser.d.ts +21 -0
  25. package/dist/chat/responseParser.js +91 -0
  26. package/dist/commands/batch.d.ts +18 -0
  27. package/dist/commands/batch.js +54 -0
  28. package/dist/commands/executor.d.ts +37 -0
  29. package/dist/commands/executor.js +1133 -0
  30. package/dist/commands/index.d.ts +14 -0
  31. package/dist/commands/index.js +17 -0
  32. package/dist/commands/parser.d.ts +16 -0
  33. package/dist/commands/parser.js +295 -0
  34. package/dist/commands/positioner.d.ts +19 -0
  35. package/dist/commands/positioner.js +33 -0
  36. package/dist/commands/storeIntegration.svelte.d.ts +16 -0
  37. package/dist/commands/storeIntegration.svelte.js +67 -0
  38. package/dist/commands/types.d.ts +343 -0
  39. package/dist/commands/types.js +45 -0
  40. package/dist/components/App.svelte +522 -237
  41. package/dist/components/App.svelte.d.ts +11 -8
  42. package/dist/components/CanvasBanner.stories.svelte +10 -16
  43. package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
  44. package/dist/components/CanvasBanner.svelte +2 -2
  45. package/dist/components/CanvasBanner.svelte.d.ts +1 -1
  46. package/dist/components/CanvasController.svelte +37 -0
  47. package/dist/components/CanvasController.svelte.d.ts +32 -0
  48. package/dist/components/ConfigForm.svelte +118 -256
  49. package/dist/components/ConfigForm.svelte.d.ts +2 -2
  50. package/dist/components/ConfigMappingRow.svelte +128 -0
  51. package/dist/components/ConfigMappingRow.svelte.d.ts +8 -0
  52. package/dist/components/ConfigModal.svelte +3 -3
  53. package/dist/components/ConfigModal.svelte.d.ts +1 -1
  54. package/dist/components/ConfigPanel.stories.svelte +19 -19
  55. package/dist/components/ConfigPanel.stories.svelte.d.ts +1 -1
  56. package/dist/components/ConfigPanel.svelte +57 -19
  57. package/dist/components/ConfigPanel.svelte.d.ts +3 -1
  58. package/dist/components/ConnectionLine.svelte +4 -4
  59. package/dist/components/EdgeRefresher.svelte +1 -1
  60. package/dist/components/FlowDropEdge.stories.svelte +110 -110
  61. package/dist/components/FlowDropEdge.svelte +11 -19
  62. package/dist/components/FlowDropEdge.svelte.d.ts +1 -1
  63. package/dist/components/FlowDropZone.svelte +6 -9
  64. package/dist/components/FlowDropZone.svelte.d.ts +1 -1
  65. package/dist/components/LoadingSpinner.stories.svelte +13 -13
  66. package/dist/components/LoadingSpinner.stories.svelte.d.ts +1 -1
  67. package/dist/components/LoadingSpinner.svelte +3 -3
  68. package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
  69. package/dist/components/Logo.stories.svelte +4 -4
  70. package/dist/components/Logo.stories.svelte.d.ts +1 -1
  71. package/dist/components/Logo.svelte +3 -9
  72. package/dist/components/LogsSidebar.svelte +46 -53
  73. package/dist/components/LogsSidebar.svelte.d.ts +1 -1
  74. package/dist/components/MarkdownDisplay.stories.svelte +10 -14
  75. package/dist/components/MarkdownDisplay.stories.svelte.d.ts +1 -1
  76. package/dist/components/MarkdownDisplay.svelte +4 -6
  77. package/dist/components/Navbar.stories.svelte +19 -19
  78. package/dist/components/Navbar.stories.svelte.d.ts +1 -1
  79. package/dist/components/Navbar.svelte +28 -49
  80. package/dist/components/Navbar.svelte.d.ts +2 -2
  81. package/dist/components/NodeSidebar.svelte +55 -135
  82. package/dist/components/NodeSidebar.svelte.d.ts +1 -1
  83. package/dist/components/NodeStatusOverlay.stories.svelte +19 -31
  84. package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
  85. package/dist/components/NodeStatusOverlay.svelte +40 -55
  86. package/dist/components/NodeStatusOverlay.svelte.d.ts +3 -3
  87. package/dist/components/NodeSwapPicker.svelte +493 -0
  88. package/dist/components/NodeSwapPicker.svelte.d.ts +16 -0
  89. package/dist/components/PipelineStatus.svelte +63 -89
  90. package/dist/components/PipelineStatus.svelte.d.ts +4 -4
  91. package/dist/components/PortCoordinateTracker.svelte +5 -7
  92. package/dist/components/PortCoordinateTracker.svelte.d.ts +1 -1
  93. package/dist/components/PortMappingRow.svelte +205 -0
  94. package/dist/components/PortMappingRow.svelte.d.ts +12 -0
  95. package/dist/components/ReadOnlyDetails.svelte +1 -1
  96. package/dist/components/SchemaForm.stories.svelte +53 -53
  97. package/dist/components/SchemaForm.stories.svelte.d.ts +1 -1
  98. package/dist/components/SchemaForm.svelte +24 -51
  99. package/dist/components/SchemaForm.svelte.d.ts +2 -2
  100. package/dist/components/SettingsModal.svelte +6 -9
  101. package/dist/components/SettingsModal.svelte.d.ts +1 -1
  102. package/dist/components/SettingsPanel.svelte +138 -158
  103. package/dist/components/SettingsPanel.svelte.d.ts +1 -1
  104. package/dist/components/StatusIcon.stories.svelte +16 -29
  105. package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
  106. package/dist/components/StatusIcon.svelte +19 -19
  107. package/dist/components/StatusIcon.svelte.d.ts +2 -2
  108. package/dist/components/StatusLabel.stories.svelte +8 -8
  109. package/dist/components/StatusLabel.stories.svelte.d.ts +1 -1
  110. package/dist/components/SwapMappingEditor.svelte +529 -0
  111. package/dist/components/SwapMappingEditor.svelte.d.ts +12 -0
  112. package/dist/components/ThemeToggle.stories.svelte +10 -10
  113. package/dist/components/ThemeToggle.stories.svelte.d.ts +1 -1
  114. package/dist/components/ThemeToggle.svelte +22 -33
  115. package/dist/components/ThemeToggle.svelte.d.ts +1 -1
  116. package/dist/components/UniversalNode.svelte +29 -41
  117. package/dist/components/UniversalNode.svelte.d.ts +3 -3
  118. package/dist/components/WorkflowEditor.svelte +210 -170
  119. package/dist/components/WorkflowEditor.svelte.d.ts +12 -4
  120. package/dist/components/chat/AIChatPanel.svelte +797 -0
  121. package/dist/components/chat/AIChatPanel.svelte.d.ts +13 -0
  122. package/dist/components/chat/CommandPreview.svelte +234 -0
  123. package/dist/components/chat/CommandPreview.svelte.d.ts +9 -0
  124. package/dist/components/console/CommandConsole.stories.svelte +111 -0
  125. package/dist/components/console/CommandConsole.stories.svelte.d.ts +27 -0
  126. package/dist/components/console/CommandConsole.svelte +263 -0
  127. package/dist/components/console/CommandConsole.svelte.d.ts +11 -0
  128. package/dist/components/console/ConsoleAutocomplete.svelte +142 -0
  129. package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +21 -0
  130. package/dist/components/console/ConsoleInput.svelte +771 -0
  131. package/dist/components/console/ConsoleInput.svelte.d.ts +16 -0
  132. package/dist/components/console/ConsoleOutput.svelte +116 -0
  133. package/dist/components/console/ConsoleOutput.svelte.d.ts +11 -0
  134. package/dist/components/console/formatters.d.ts +26 -0
  135. package/dist/components/console/formatters.js +116 -0
  136. package/dist/components/form/FormArray.svelte +75 -132
  137. package/dist/components/form/FormArray.svelte.d.ts +1 -1
  138. package/dist/components/form/FormAutocomplete.svelte +65 -108
  139. package/dist/components/form/FormAutocomplete.svelte.d.ts +1 -1
  140. package/dist/components/form/FormCheckboxGroup.stories.svelte +13 -16
  141. package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +1 -1
  142. package/dist/components/form/FormCheckboxGroup.svelte +2 -2
  143. package/dist/components/form/FormCodeEditor.svelte +42 -56
  144. package/dist/components/form/FormField.svelte +79 -90
  145. package/dist/components/form/FormField.svelte.d.ts +2 -2
  146. package/dist/components/form/FormFieldLight.svelte +72 -88
  147. package/dist/components/form/FormFieldLight.svelte.d.ts +1 -1
  148. package/dist/components/form/FormFieldWrapper.stories.svelte +14 -14
  149. package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +1 -1
  150. package/dist/components/form/FormFieldWrapper.svelte +2 -9
  151. package/dist/components/form/FormFieldWrapper.svelte.d.ts +1 -1
  152. package/dist/components/form/FormFieldset.svelte +3 -3
  153. package/dist/components/form/FormFieldset.svelte.d.ts +2 -2
  154. package/dist/components/form/FormMarkdownEditor.svelte +123 -156
  155. package/dist/components/form/FormNumberField.stories.svelte +18 -18
  156. package/dist/components/form/FormNumberField.stories.svelte.d.ts +1 -1
  157. package/dist/components/form/FormNumberField.svelte +6 -6
  158. package/dist/components/form/FormRangeField.stories.svelte +13 -13
  159. package/dist/components/form/FormRangeField.stories.svelte.d.ts +1 -1
  160. package/dist/components/form/FormRangeField.svelte +4 -12
  161. package/dist/components/form/FormSelect.stories.svelte +21 -21
  162. package/dist/components/form/FormSelect.stories.svelte.d.ts +1 -1
  163. package/dist/components/form/FormSelect.svelte +5 -5
  164. package/dist/components/form/FormSelect.svelte.d.ts +1 -1
  165. package/dist/components/form/FormTemplateEditor.svelte +126 -175
  166. package/dist/components/form/FormTemplateEditor.svelte.d.ts +1 -1
  167. package/dist/components/form/FormTextField.stories.svelte +17 -23
  168. package/dist/components/form/FormTextField.stories.svelte.d.ts +1 -1
  169. package/dist/components/form/FormTextField.svelte +4 -4
  170. package/dist/components/form/FormTextarea.stories.svelte +18 -21
  171. package/dist/components/form/FormTextarea.stories.svelte.d.ts +1 -1
  172. package/dist/components/form/FormTextarea.svelte +4 -4
  173. package/dist/components/form/FormToggle.stories.svelte +13 -16
  174. package/dist/components/form/FormToggle.stories.svelte.d.ts +1 -1
  175. package/dist/components/form/FormToggle.svelte +3 -3
  176. package/dist/components/form/FormUISchemaRenderer.svelte +12 -19
  177. package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +3 -3
  178. package/dist/components/form/index.d.ts +19 -19
  179. package/dist/components/form/index.js +18 -18
  180. package/dist/components/form/templateAutocomplete.d.ts +2 -2
  181. package/dist/components/form/templateAutocomplete.js +55 -64
  182. package/dist/components/form/types.d.ts +6 -6
  183. package/dist/components/form/types.js +4 -9
  184. package/dist/components/icons/AlertCircleIcon.svelte +1 -6
  185. package/dist/components/icons/CogIcon.svelte +1 -6
  186. package/dist/components/interrupt/ChoicePrompt.stories.svelte +27 -27
  187. package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +1 -1
  188. package/dist/components/interrupt/ChoicePrompt.svelte +17 -41
  189. package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +1 -1
  190. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +17 -17
  191. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +1 -1
  192. package/dist/components/interrupt/ConfirmationPrompt.svelte +10 -16
  193. package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +1 -1
  194. package/dist/components/interrupt/FormPrompt.svelte +10 -15
  195. package/dist/components/interrupt/FormPrompt.svelte.d.ts +1 -1
  196. package/dist/components/interrupt/InterruptBubble.svelte +87 -121
  197. package/dist/components/interrupt/InterruptBubble.svelte.d.ts +2 -2
  198. package/dist/components/interrupt/ReviewPrompt.stories.svelte +37 -37
  199. package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +1 -1
  200. package/dist/components/interrupt/ReviewPrompt.svelte +55 -75
  201. package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +1 -1
  202. package/dist/components/interrupt/TextInputPrompt.stories.svelte +16 -17
  203. package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
  204. package/dist/components/interrupt/TextInputPrompt.svelte +13 -18
  205. package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +1 -1
  206. package/dist/components/interrupt/index.d.ts +6 -5
  207. package/dist/components/interrupt/index.js +6 -5
  208. package/dist/components/layouts/MainLayout.svelte +46 -84
  209. package/dist/components/layouts/MainLayout.svelte.d.ts +6 -6
  210. package/dist/components/nodes/GatewayNode.stories.svelte +64 -65
  211. package/dist/components/nodes/GatewayNode.svelte +37 -70
  212. package/dist/components/nodes/GatewayNode.svelte.d.ts +3 -3
  213. package/dist/components/nodes/IdeaNode.stories.svelte +25 -26
  214. package/dist/components/nodes/IdeaNode.svelte +22 -36
  215. package/dist/components/nodes/IdeaNode.svelte.d.ts +1 -1
  216. package/dist/components/nodes/NotesNode.stories.svelte +37 -38
  217. package/dist/components/nodes/NotesNode.svelte +28 -39
  218. package/dist/components/nodes/NotesNode.svelte.d.ts +1 -1
  219. package/dist/components/nodes/SimpleNode.stories.svelte +137 -138
  220. package/dist/components/nodes/SimpleNode.svelte +44 -74
  221. package/dist/components/nodes/SimpleNode.svelte.d.ts +1 -1
  222. package/dist/components/nodes/SquareNode.stories.svelte +75 -75
  223. package/dist/components/nodes/SquareNode.svelte +42 -68
  224. package/dist/components/nodes/SquareNode.svelte.d.ts +1 -1
  225. package/dist/components/nodes/TerminalNode.stories.svelte +10 -10
  226. package/dist/components/nodes/TerminalNode.svelte +74 -112
  227. package/dist/components/nodes/TerminalNode.svelte.d.ts +1 -1
  228. package/dist/components/nodes/ToolNode.stories.svelte +115 -116
  229. package/dist/components/nodes/ToolNode.svelte +31 -64
  230. package/dist/components/nodes/ToolNode.svelte.d.ts +1 -1
  231. package/dist/components/nodes/WorkflowNode.stories.svelte +84 -89
  232. package/dist/components/nodes/WorkflowNode.svelte +50 -103
  233. package/dist/components/nodes/WorkflowNode.svelte.d.ts +3 -3
  234. package/dist/components/playground/ChatPanel.svelte +47 -103
  235. package/dist/components/playground/ExecutionLogs.svelte +45 -68
  236. package/dist/components/playground/InputCollector.svelte +32 -51
  237. package/dist/components/playground/MessageBubble.stories.svelte +25 -25
  238. package/dist/components/playground/MessageBubble.stories.svelte.d.ts +1 -1
  239. package/dist/components/playground/MessageBubble.svelte +54 -70
  240. package/dist/components/playground/MessageBubble.svelte.d.ts +1 -1
  241. package/dist/components/playground/Playground.svelte +60 -91
  242. package/dist/components/playground/Playground.svelte.d.ts +3 -3
  243. package/dist/components/playground/PlaygroundModal.svelte +8 -12
  244. package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -3
  245. package/dist/components/playground/SessionManager.svelte +34 -40
  246. package/dist/components/playground/SessionManager.svelte.d.ts +1 -1
  247. package/dist/config/agentSpecEndpoints.d.ts +1 -1
  248. package/dist/config/agentSpecEndpoints.js +20 -20
  249. package/dist/config/constants.js +2 -2
  250. package/dist/config/defaultCategories.d.ts +1 -1
  251. package/dist/config/defaultCategories.js +86 -86
  252. package/dist/config/defaultPortConfig.d.ts +1 -1
  253. package/dist/config/defaultPortConfig.js +144 -144
  254. package/dist/config/endpoints.d.ts +12 -4
  255. package/dist/config/endpoints.js +70 -65
  256. package/dist/config/runtimeConfig.d.ts +2 -2
  257. package/dist/config/runtimeConfig.js +8 -8
  258. package/dist/core/index.d.ts +68 -63
  259. package/dist/core/index.js +44 -35
  260. package/dist/display/index.d.ts +2 -2
  261. package/dist/display/index.js +2 -2
  262. package/dist/editor/index.d.ts +64 -62
  263. package/dist/editor/index.js +57 -55
  264. package/dist/form/code.d.ts +5 -5
  265. package/dist/form/code.js +14 -14
  266. package/dist/form/fieldRegistry.d.ts +3 -3
  267. package/dist/form/fieldRegistry.js +9 -11
  268. package/dist/form/full.d.ts +8 -8
  269. package/dist/form/full.js +9 -9
  270. package/dist/form/index.d.ts +18 -18
  271. package/dist/form/index.js +16 -16
  272. package/dist/form/markdown.d.ts +4 -4
  273. package/dist/form/markdown.js +8 -8
  274. package/dist/helpers/proximityConnect.d.ts +3 -3
  275. package/dist/helpers/proximityConnect.js +40 -35
  276. package/dist/helpers/workflowEditorHelper.d.ts +8 -58
  277. package/dist/helpers/workflowEditorHelper.js +73 -292
  278. package/dist/index.d.ts +6 -6
  279. package/dist/index.js +6 -6
  280. package/dist/mocks/app-environment.js +2 -2
  281. package/dist/mocks/app-forms.js +1 -1
  282. package/dist/mocks/app-navigation.js +2 -2
  283. package/dist/mocks/app-stores.js +3 -3
  284. package/dist/playground/index.d.ts +19 -19
  285. package/dist/playground/index.js +16 -16
  286. package/dist/playground/mount.d.ts +3 -3
  287. package/dist/playground/mount.js +24 -24
  288. package/dist/registry/builtinFormats.js +13 -13
  289. package/dist/registry/builtinNodes.d.ts +2 -2
  290. package/dist/registry/builtinNodes.js +77 -77
  291. package/dist/registry/index.d.ts +4 -4
  292. package/dist/registry/index.js +4 -4
  293. package/dist/registry/nodeComponentRegistry.d.ts +8 -8
  294. package/dist/registry/nodeComponentRegistry.js +9 -11
  295. package/dist/registry/plugin.d.ts +2 -2
  296. package/dist/registry/plugin.js +11 -11
  297. package/dist/registry/workflowFormatRegistry.d.ts +3 -3
  298. package/dist/registry/workflowFormatRegistry.js +2 -2
  299. package/dist/schema/index.d.ts +1 -1
  300. package/dist/schema/index.js +2 -2
  301. package/dist/schemas/v1/workflow.schema.json +107 -22
  302. package/dist/services/agentSpecExecutionService.d.ts +3 -3
  303. package/dist/services/agentSpecExecutionService.js +55 -56
  304. package/dist/services/api.d.ts +2 -2
  305. package/dist/services/api.js +37 -37
  306. package/dist/services/apiVariableService.d.ts +1 -1
  307. package/dist/services/apiVariableService.js +34 -41
  308. package/dist/services/autoSaveService.js +8 -8
  309. package/dist/services/categoriesApi.d.ts +2 -2
  310. package/dist/services/categoriesApi.js +8 -8
  311. package/dist/services/chatService.d.ts +65 -0
  312. package/dist/services/chatService.js +131 -0
  313. package/dist/services/draftStorage.d.ts +1 -1
  314. package/dist/services/draftStorage.js +11 -11
  315. package/dist/services/dynamicSchemaService.d.ts +1 -1
  316. package/dist/services/dynamicSchemaService.js +39 -41
  317. package/dist/services/globalSave.d.ts +2 -2
  318. package/dist/services/globalSave.js +38 -41
  319. package/dist/services/historyService.d.ts +7 -5
  320. package/dist/services/historyService.js +29 -14
  321. package/dist/services/interruptService.d.ts +1 -1
  322. package/dist/services/interruptService.js +29 -35
  323. package/dist/services/nodeExecutionService.d.ts +1 -1
  324. package/dist/services/nodeExecutionService.js +44 -45
  325. package/dist/services/playgroundService.d.ts +1 -1
  326. package/dist/services/playgroundService.js +29 -29
  327. package/dist/services/portConfigApi.d.ts +2 -2
  328. package/dist/services/portConfigApi.js +8 -8
  329. package/dist/services/settingsService.d.ts +2 -2
  330. package/dist/services/settingsService.js +19 -25
  331. package/dist/services/toastService.d.ts +4 -4
  332. package/dist/services/toastService.js +33 -33
  333. package/dist/services/variableService.d.ts +1 -1
  334. package/dist/services/variableService.js +36 -36
  335. package/dist/services/workflowStorage.d.ts +2 -2
  336. package/dist/services/workflowStorage.js +13 -13
  337. package/dist/settings/index.d.ts +7 -7
  338. package/dist/settings/index.js +6 -6
  339. package/dist/skins/default.d.ts +1 -1
  340. package/dist/skins/default.js +1 -1
  341. package/dist/skins/index.d.ts +3 -3
  342. package/dist/skins/index.js +7 -7
  343. package/dist/skins/slate.d.ts +1 -1
  344. package/dist/skins/slate.js +69 -69
  345. package/dist/stores/categoriesStore.svelte.d.ts +1 -1
  346. package/dist/stores/categoriesStore.svelte.js +5 -5
  347. package/dist/stores/editorStateMachine.svelte.d.ts +2 -2
  348. package/dist/stores/editorStateMachine.svelte.js +34 -34
  349. package/dist/stores/historyStore.svelte.d.ts +4 -4
  350. package/dist/stores/historyStore.svelte.js +4 -4
  351. package/dist/stores/interruptStore.svelte.d.ts +3 -3
  352. package/dist/stores/interruptStore.svelte.js +27 -22
  353. package/dist/stores/playgroundStore.svelte.d.ts +3 -3
  354. package/dist/stores/playgroundStore.svelte.js +29 -23
  355. package/dist/stores/portCoordinateStore.svelte.d.ts +6 -2
  356. package/dist/stores/portCoordinateStore.svelte.js +30 -39
  357. package/dist/stores/settingsStore.svelte.d.ts +2 -2
  358. package/dist/stores/settingsStore.svelte.js +57 -62
  359. package/dist/stores/workflowStore.svelte.d.ts +34 -5
  360. package/dist/stores/workflowStore.svelte.js +127 -108
  361. package/dist/stories/CanvasDecorator.svelte +7 -10
  362. package/dist/stories/CanvasDecorator.svelte.d.ts +2 -2
  363. package/dist/stories/EdgeDecorator.svelte +28 -31
  364. package/dist/stories/EdgeDecorator.svelte.d.ts +1 -1
  365. package/dist/stories/NodeDecorator.svelte +14 -20
  366. package/dist/stories/NodeDecorator.svelte.d.ts +1 -1
  367. package/dist/stories/utils.d.ts +2 -2
  368. package/dist/stories/utils.js +89 -93
  369. package/dist/styles/base.css +16 -50
  370. package/dist/styles/tokens.css +10 -28
  371. package/dist/svelte-app.d.ts +10 -10
  372. package/dist/svelte-app.js +39 -39
  373. package/dist/themes/default.d.ts +1 -1
  374. package/dist/themes/default.js +4 -4
  375. package/dist/themes/index.d.ts +3 -3
  376. package/dist/themes/index.js +11 -11
  377. package/dist/themes/minimal.d.ts +1 -1
  378. package/dist/themes/minimal.js +5 -5
  379. package/dist/types/agentspec.d.ts +18 -18
  380. package/dist/types/agentspec.js +2 -2
  381. package/dist/types/auth.d.ts +1 -1
  382. package/dist/types/auth.js +6 -6
  383. package/dist/types/chat.d.ts +63 -0
  384. package/dist/types/chat.js +9 -0
  385. package/dist/types/config.d.ts +6 -6
  386. package/dist/types/events.d.ts +28 -2
  387. package/dist/types/events.js +2 -1
  388. package/dist/types/index.d.ts +40 -32
  389. package/dist/types/index.js +6 -6
  390. package/dist/types/interrupt.d.ts +6 -6
  391. package/dist/types/interrupt.js +21 -21
  392. package/dist/types/interruptState.d.ts +12 -12
  393. package/dist/types/interruptState.js +66 -66
  394. package/dist/types/playground.d.ts +7 -7
  395. package/dist/types/playground.js +14 -14
  396. package/dist/types/settings.d.ts +12 -4
  397. package/dist/types/settings.js +21 -23
  398. package/dist/types/skin.d.ts +1 -1
  399. package/dist/types/theme.d.ts +2 -2
  400. package/dist/types/uischema.d.ts +4 -4
  401. package/dist/types/uischema.js +3 -3
  402. package/dist/utils/colors.d.ts +1 -1
  403. package/dist/utils/colors.js +95 -97
  404. package/dist/utils/config.d.ts +2 -2
  405. package/dist/utils/config.js +48 -48
  406. package/dist/utils/connections.d.ts +2 -2
  407. package/dist/utils/connections.js +15 -15
  408. package/dist/utils/edgeStyling.d.ts +42 -0
  409. package/dist/utils/edgeStyling.js +173 -0
  410. package/dist/utils/errors.js +3 -3
  411. package/dist/utils/fetchWithAuth.d.ts +1 -1
  412. package/dist/utils/fetchWithAuth.js +2 -2
  413. package/dist/utils/handleIds.d.ts +2 -2
  414. package/dist/utils/handleIds.js +8 -8
  415. package/dist/utils/handlePositioning.d.ts +1 -1
  416. package/dist/utils/handlePositioning.js +2 -2
  417. package/dist/utils/icons.d.ts +1 -1
  418. package/dist/utils/icons.js +74 -74
  419. package/dist/utils/logger.d.ts +1 -1
  420. package/dist/utils/logger.js +7 -7
  421. package/dist/utils/nodeIds.d.ts +31 -0
  422. package/dist/utils/nodeIds.js +42 -0
  423. package/dist/utils/nodeStatus.d.ts +1 -1
  424. package/dist/utils/nodeStatus.js +48 -48
  425. package/dist/utils/nodeSwap.d.ts +221 -0
  426. package/dist/utils/nodeSwap.js +680 -0
  427. package/dist/utils/nodeTypes.d.ts +1 -1
  428. package/dist/utils/nodeTypes.js +20 -21
  429. package/dist/utils/nodeWrapper.d.ts +7 -7
  430. package/dist/utils/nodeWrapper.js +19 -21
  431. package/dist/utils/performanceUtils.d.ts +1 -1
  432. package/dist/utils/performanceUtils.js +1 -2
  433. package/dist/utils/portUtils.d.ts +2 -2
  434. package/dist/utils/portUtils.js +1 -1
  435. package/dist/utils/sanitize.js +1 -1
  436. package/dist/utils/uischema.d.ts +2 -2
  437. package/dist/utils/uischema.js +8 -8
  438. package/dist/utils/validation.js +8 -8
  439. package/package.json +12 -11
  440. package/dist/helpers/nodeLayoutHelper.d.ts +0 -14
  441. package/dist/helpers/nodeLayoutHelper.js +0 -19
@@ -25,9 +25,9 @@ const LOG_PRIORITY = {
25
25
  info: 1,
26
26
  warn: 2,
27
27
  error: 3,
28
- none: 4,
28
+ none: 4
29
29
  };
30
- let currentLevel = "none";
30
+ let currentLevel = 'none';
31
31
  /**
32
32
  * Set the minimum log level for FlowDrop library output.
33
33
  * Messages below this level are silently discarded.
@@ -54,19 +54,19 @@ function shouldLog(level) {
54
54
  */
55
55
  export const logger = {
56
56
  debug(message, ...args) {
57
- if (shouldLog("debug"))
57
+ if (shouldLog('debug'))
58
58
  console.debug(`[FlowDrop] ${message}`, ...args);
59
59
  },
60
60
  info(message, ...args) {
61
- if (shouldLog("info"))
61
+ if (shouldLog('info'))
62
62
  console.info(`[FlowDrop] ${message}`, ...args);
63
63
  },
64
64
  warn(message, ...args) {
65
- if (shouldLog("warn"))
65
+ if (shouldLog('warn'))
66
66
  console.warn(`[FlowDrop] ${message}`, ...args);
67
67
  },
68
68
  error(message, ...args) {
69
- if (shouldLog("error"))
69
+ if (shouldLog('error'))
70
70
  console.error(`[FlowDrop] ${message}`, ...args);
71
- },
71
+ }
72
72
  };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shared node ID generation and config defaults utilities.
3
+ * Used by both the visual editor and the workflow adapter to ensure
4
+ * consistent behavior across all code paths.
5
+ */
6
+ import type { ConfigSchema } from '../types/index.js';
7
+ /**
8
+ * Minimal node shape required for ID generation.
9
+ * Both WorkflowNode and StandardNode satisfy this interface.
10
+ */
11
+ interface NodeWithMetadata {
12
+ id: string;
13
+ data?: {
14
+ metadata?: {
15
+ id?: string;
16
+ };
17
+ };
18
+ }
19
+ /**
20
+ * Generate a unique node ID based on node type and existing nodes.
21
+ * Format: <node_type>.<number>
22
+ * Example: boolean_gateway.1, calculator.2
23
+ */
24
+ export declare function generateNodeId(nodeTypeId: string, existingNodes: NodeWithMetadata[]): string;
25
+ /**
26
+ * Extract default config values from a node's configSchema.
27
+ * Iterates configSchema.properties and returns an object with each property's
28
+ * default value (if defined).
29
+ */
30
+ export declare function extractConfigDefaults(configSchema?: ConfigSchema): Record<string, unknown>;
31
+ export {};
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Shared node ID generation and config defaults utilities.
3
+ * Used by both the visual editor and the workflow adapter to ensure
4
+ * consistent behavior across all code paths.
5
+ */
6
+ /**
7
+ * Generate a unique node ID based on node type and existing nodes.
8
+ * Format: <node_type>.<number>
9
+ * Example: boolean_gateway.1, calculator.2
10
+ */
11
+ export function generateNodeId(nodeTypeId, existingNodes) {
12
+ // Count how many nodes of this type already exist
13
+ const existingNodeIds = existingNodes
14
+ .filter((node) => node.data?.metadata?.id === nodeTypeId)
15
+ .map((node) => node.id);
16
+ // Extract the numbers from existing IDs with the same prefix
17
+ const existingNumbers = existingNodeIds
18
+ .map((id) => {
19
+ const match = id.match(new RegExp(`^${nodeTypeId}\\.(\\d+)$`));
20
+ return match ? parseInt(match[1], 10) : 0;
21
+ })
22
+ .filter((num) => num > 0);
23
+ // Find the next available number (highest + 1)
24
+ const nextNumber = existingNumbers.length > 0 ? Math.max(...existingNumbers) + 1 : 1;
25
+ return `${nodeTypeId}.${nextNumber}`;
26
+ }
27
+ /**
28
+ * Extract default config values from a node's configSchema.
29
+ * Iterates configSchema.properties and returns an object with each property's
30
+ * default value (if defined).
31
+ */
32
+ export function extractConfigDefaults(configSchema) {
33
+ const config = {};
34
+ if (!configSchema?.properties)
35
+ return config;
36
+ for (const [key, prop] of Object.entries(configSchema.properties)) {
37
+ if (prop && typeof prop === 'object' && 'default' in prop) {
38
+ config[key] = prop.default;
39
+ }
40
+ }
41
+ return config;
42
+ }
@@ -2,7 +2,7 @@
2
2
  * Node Status Utility Functions
3
3
  * Provides utilities for managing and displaying node execution status
4
4
  */
5
- import type { NodeExecutionStatus, NodeExecutionInfo } from "../types/index.js";
5
+ import type { NodeExecutionStatus, NodeExecutionInfo } from '../types/index.js';
6
6
  /**
7
7
  * Get the display color for a node execution status
8
8
  */
@@ -7,13 +7,13 @@
7
7
  */
8
8
  export function getStatusColor(status) {
9
9
  const statusColors = {
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
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
17
  };
18
18
  return statusColors[status] || statusColors.idle;
19
19
  }
@@ -22,13 +22,13 @@ export function getStatusColor(status) {
22
22
  */
23
23
  export function getStatusIcon(status) {
24
24
  const statusIcons = {
25
- idle: "mdi:circle-outline",
26
- pending: "mdi:clock-outline",
27
- running: "mdi:loading",
28
- completed: "mdi:check-circle",
29
- failed: "mdi:alert-circle",
30
- cancelled: "mdi:cancel",
31
- skipped: "mdi:skip-next",
25
+ idle: 'mdi:circle-outline',
26
+ pending: 'mdi:clock-outline',
27
+ running: 'mdi:loading',
28
+ completed: 'mdi:check-circle',
29
+ failed: 'mdi:alert-circle',
30
+ cancelled: 'mdi:cancel',
31
+ skipped: 'mdi:skip-next'
32
32
  };
33
33
  return statusIcons[status] || statusIcons.idle;
34
34
  }
@@ -37,13 +37,13 @@ export function getStatusIcon(status) {
37
37
  */
38
38
  export function getStatusLabel(status) {
39
39
  const statusLabels = {
40
- idle: "Idle",
41
- pending: "Pending",
42
- running: "Running",
43
- completed: "Completed",
44
- failed: "Failed",
45
- cancelled: "Cancelled",
46
- skipped: "Skipped",
40
+ idle: 'Idle',
41
+ pending: 'Pending',
42
+ running: 'Running',
43
+ completed: 'Completed',
44
+ failed: 'Failed',
45
+ cancelled: 'Cancelled',
46
+ skipped: 'Skipped'
47
47
  };
48
48
  return statusLabels[status] || statusLabels.idle;
49
49
  }
@@ -52,13 +52,13 @@ export function getStatusLabel(status) {
52
52
  */
53
53
  export function getStatusBackgroundColor(status) {
54
54
  const statusBackgroundColors = {
55
- idle: "#f9fafb", // light gray
56
- pending: "#fef3c7", // light amber
57
- running: "#dbeafe", // light blue
58
- completed: "#d1fae5", // light emerald
59
- failed: "#fee2e2", // light red
60
- cancelled: "#f3f4f6", // light gray
61
- skipped: "#ede9fe", // light violet
55
+ idle: '#f9fafb', // light gray
56
+ pending: '#fef3c7', // light amber
57
+ running: '#dbeafe', // light blue
58
+ completed: '#d1fae5', // light emerald
59
+ failed: '#fee2e2', // light red
60
+ cancelled: '#f3f4f6', // light gray
61
+ skipped: '#ede9fe' // light violet
62
62
  };
63
63
  return statusBackgroundColors[status] || statusBackgroundColors.idle;
64
64
  }
@@ -67,13 +67,13 @@ export function getStatusBackgroundColor(status) {
67
67
  */
68
68
  export function getStatusTextColor(status) {
69
69
  const statusTextColors = {
70
- idle: "#6b7280", // gray
71
- pending: "#d97706", // amber
72
- running: "#1d4ed8", // blue
73
- completed: "#059669", // emerald
74
- failed: "#dc2626", // red
75
- cancelled: "#6b7280", // gray
76
- skipped: "#7c3aed", // violet
70
+ idle: '#6b7280', // gray
71
+ pending: '#d97706', // amber
72
+ running: '#1d4ed8', // blue
73
+ completed: '#059669', // emerald
74
+ failed: '#dc2626', // red
75
+ cancelled: '#6b7280', // gray
76
+ skipped: '#7c3aed' // violet
77
77
  };
78
78
  return statusTextColors[status] || statusTextColors.idle;
79
79
  }
@@ -82,9 +82,9 @@ export function getStatusTextColor(status) {
82
82
  */
83
83
  export function createDefaultExecutionInfo() {
84
84
  return {
85
- status: "idle",
85
+ status: 'idle',
86
86
  executionCount: 0,
87
- isExecuting: false,
87
+ isExecuting: false
88
88
  };
89
89
  }
90
90
  /**
@@ -93,8 +93,8 @@ export function createDefaultExecutionInfo() {
93
93
  export function updateExecutionStart(executionInfo) {
94
94
  return {
95
95
  ...executionInfo,
96
- status: "running",
97
- isExecuting: true,
96
+ status: 'running',
97
+ isExecuting: true
98
98
  };
99
99
  }
100
100
  /**
@@ -103,12 +103,12 @@ export function updateExecutionStart(executionInfo) {
103
103
  export function updateExecutionComplete(executionInfo, duration) {
104
104
  return {
105
105
  ...executionInfo,
106
- status: "completed",
106
+ status: 'completed',
107
107
  executionCount: executionInfo.executionCount + 1,
108
108
  lastExecuted: new Date().toISOString(),
109
109
  lastExecutionDuration: duration,
110
110
  isExecuting: false,
111
- lastError: undefined, // Clear any previous error
111
+ lastError: undefined // Clear any previous error
112
112
  };
113
113
  }
114
114
  /**
@@ -117,12 +117,12 @@ export function updateExecutionComplete(executionInfo, duration) {
117
117
  export function updateExecutionFailed(executionInfo, error, duration) {
118
118
  return {
119
119
  ...executionInfo,
120
- status: "failed",
120
+ status: 'failed',
121
121
  executionCount: executionInfo.executionCount + 1,
122
122
  lastExecuted: new Date().toISOString(),
123
123
  lastExecutionDuration: duration,
124
124
  isExecuting: false,
125
- lastError: error,
125
+ lastError: error
126
126
  };
127
127
  }
128
128
  /**
@@ -131,9 +131,9 @@ export function updateExecutionFailed(executionInfo, error, duration) {
131
131
  export function resetExecutionInfo(executionInfo) {
132
132
  return {
133
133
  ...executionInfo,
134
- status: "idle",
134
+ status: 'idle',
135
135
  isExecuting: false,
136
- lastError: undefined,
136
+ lastError: undefined
137
137
  };
138
138
  }
139
139
  /**
@@ -141,7 +141,7 @@ export function resetExecutionInfo(executionInfo) {
141
141
  */
142
142
  export function formatExecutionDuration(duration) {
143
143
  if (!duration)
144
- return "N/A";
144
+ return 'N/A';
145
145
  if (duration < 1000) {
146
146
  return `${Math.round(duration)}ms`;
147
147
  }
@@ -159,13 +159,13 @@ export function formatExecutionDuration(duration) {
159
159
  */
160
160
  export function formatLastExecuted(timestamp) {
161
161
  if (!timestamp)
162
- return "Never";
162
+ return 'Never';
163
163
  const date = new Date(timestamp);
164
164
  const now = new Date();
165
165
  const diffMs = now.getTime() - date.getTime();
166
166
  if (diffMs < 60000) {
167
167
  // Less than 1 minute
168
- return "Just now";
168
+ return 'Just now';
169
169
  }
170
170
  else if (diffMs < 3600000) {
171
171
  // Less than 1 hour
@@ -0,0 +1,221 @@
1
+ /**
2
+ * Node Swap utilities for FlowDrop
3
+ *
4
+ * Provides logic for swapping a workflow node with a different node type
5
+ * while intelligently remapping compatible port connections.
6
+ *
7
+ * @module utils/nodeSwap
8
+ */
9
+ import type { WorkflowNode, WorkflowEdge, NodeMetadata, NodePort, ConfigSchema, ConfigValues } from '../types/index.js';
10
+ import type { WorkflowValidationResult } from './validation.js';
11
+ import type { PortCompatibilityChecker } from './connections.js';
12
+ /**
13
+ * Describes how a single port was remapped during a swap.
14
+ */
15
+ export interface PortMapping {
16
+ oldHandleId: string;
17
+ newHandleId: string;
18
+ oldPortId: string;
19
+ newPortId: string;
20
+ direction: 'input' | 'output';
21
+ }
22
+ /**
23
+ * An edge that could not be remapped and will be dropped.
24
+ */
25
+ export interface DroppedEdge {
26
+ edge: WorkflowEdge;
27
+ reason: string;
28
+ }
29
+ /**
30
+ * Preview of what a node swap will do before it is executed.
31
+ */
32
+ export interface SwapPreview {
33
+ /** Edges that will be preserved with their rewritten versions */
34
+ keptEdges: Array<{
35
+ edge: WorkflowEdge;
36
+ newEdge: WorkflowEdge;
37
+ }>;
38
+ /** Edges that will be removed */
39
+ droppedEdges: DroppedEdge[];
40
+ /** True if any connected edges will be lost */
41
+ hasDataLoss: boolean;
42
+ /** The new node ID that will be generated */
43
+ newNodeId: string;
44
+ /** Config keys carried over from the old node */
45
+ configCarriedOver: string[];
46
+ /** Config keys reset to defaults on the new node */
47
+ configReset: string[];
48
+ }
49
+ /**
50
+ * Result of executing a node swap.
51
+ */
52
+ export interface SwapResult {
53
+ updatedNodes: WorkflowNode[];
54
+ updatedEdges: WorkflowEdge[];
55
+ }
56
+ /** Quality annotation for how a port was matched. */
57
+ export type MatchQuality = 'id' | 'name' | 'type' | 'manual' | 'unmapped';
58
+ /** Manual override for a single port mapping. */
59
+ export interface PortMappingOverride {
60
+ oldPortId: string;
61
+ newPortId: string | null;
62
+ direction: 'input' | 'output';
63
+ }
64
+ /** Manual override for a single config mapping. */
65
+ export interface ConfigMappingOverride {
66
+ key: string;
67
+ action: 'carry' | 'reset' | 'set';
68
+ value?: unknown;
69
+ }
70
+ /** Options bag for advanced swap functions. */
71
+ export interface SwapOptions {
72
+ checker?: PortCompatibilityChecker | null;
73
+ portOverrides?: PortMappingOverride[];
74
+ configOverrides?: ConfigMappingOverride[];
75
+ strategies?: SwapStrategy[];
76
+ }
77
+ /** Pluggable strategy passed per-call, not registered globally. */
78
+ export interface SwapStrategy {
79
+ readonly id: string;
80
+ readonly name: string;
81
+ canHandle(ctx: SwapStrategyContext): boolean;
82
+ mapPorts?(ctx: SwapStrategyContext): Record<string, string | null> | undefined;
83
+ mapConfig?(ctx: SwapStrategyContext): Record<string, {
84
+ action: 'carry' | 'reset' | 'set';
85
+ value?: unknown;
86
+ }> | undefined;
87
+ }
88
+ /** Context passed to swap strategies. */
89
+ export interface SwapStrategyContext {
90
+ oldNode: WorkflowNode;
91
+ newMetadata: NodeMetadata;
92
+ edges: WorkflowEdge[];
93
+ allNodes: WorkflowNode[];
94
+ checker: PortCompatibilityChecker | null;
95
+ }
96
+ /** Stable, data-only event context for swap hooks. */
97
+ export interface SwapEventContext {
98
+ oldNode: WorkflowNode;
99
+ newMetadata: NodeMetadata;
100
+ preview: SwapPreview;
101
+ portOverrides: PortMappingOverride[];
102
+ configOverrides: ConfigMappingOverride[];
103
+ }
104
+ /** Error class for swap validation failures. */
105
+ export declare class SwapValidationError extends Error {
106
+ constructor(message: string);
107
+ }
108
+ /** Editable port mapping for the interactive mapping editor. */
109
+ export interface EditablePortMapping {
110
+ oldPort: NodePort;
111
+ edge: WorkflowEdge;
112
+ direction: 'input' | 'output';
113
+ selectedNewPortId: string | null;
114
+ matchQuality: MatchQuality;
115
+ autoSuggestedPortId: string | null;
116
+ isOverridden: boolean;
117
+ }
118
+ /** Editable config mapping for the interactive mapping editor. */
119
+ export interface EditableConfigMapping {
120
+ key: string;
121
+ title: string;
122
+ oldValue: unknown;
123
+ newDefault: unknown;
124
+ carryOver: boolean;
125
+ autoCarryOver: boolean;
126
+ /** false for nested objects/arrays — shown as read-only, always reset */
127
+ isFlat: boolean;
128
+ }
129
+ /** Full interactive swap state for the mapping editor. */
130
+ export interface InteractiveSwapState {
131
+ oldNode: WorkflowNode;
132
+ newMetadata: NodeMetadata;
133
+ newNodeId: string;
134
+ portMappings: EditablePortMapping[];
135
+ configMappings: EditableConfigMapping[];
136
+ availableNewInputs: NodePort[];
137
+ availableNewOutputs: NodePort[];
138
+ }
139
+ /**
140
+ * Compare two semver-like version strings.
141
+ * Returns positive if a > b, negative if a < b, 0 if equal.
142
+ *
143
+ * Handles pre-release tags: "2.0.0-beta" < "2.0.0"
144
+ */
145
+ export declare function compareSemver(a: string, b: string): number;
146
+ /**
147
+ * Map config values from an old node to a new node's schema.
148
+ *
149
+ * - Keys present in both old config and new schema: carry over the old value
150
+ * - Keys only in the new schema: use the schema default or newDefaults
151
+ * - Keys only in the old config: discarded
152
+ * - Dynamic port keys (dynamicInputs, dynamicOutputs, branches): never carried over
153
+ */
154
+ export declare function mapConfig(oldConfig: ConfigValues, newConfigSchema: ConfigSchema | undefined, newDefaults?: Record<string, unknown>): {
155
+ config: ConfigValues;
156
+ carriedOver: string[];
157
+ reset: string[];
158
+ };
159
+ /**
160
+ * Compute a preview of what will happen when swapping oldNode with newMetadata.
161
+ *
162
+ * This does NOT mutate anything — it returns a preview that can be displayed
163
+ * to the user for confirmation before executing the swap.
164
+ */
165
+ export declare function computeSwapPreview(oldNode: WorkflowNode, newMetadata: NodeMetadata, edges: WorkflowEdge[], allNodes: WorkflowNode[], checker?: PortCompatibilityChecker | null): SwapPreview;
166
+ /**
167
+ * Execute a node swap using a previously computed preview.
168
+ *
169
+ * Returns new nodes and edges arrays ready for `workflowActions.batchUpdate()`.
170
+ */
171
+ export declare function executeSwap(oldNode: WorkflowNode, newMetadata: NodeMetadata, preview: SwapPreview, allNodes: WorkflowNode[], allEdges: WorkflowEdge[]): SwapResult;
172
+ /**
173
+ * Check if a newer version of the same node type is available.
174
+ *
175
+ * Compares the node's embedded metadata.version against the same-ID entry
176
+ * in the available nodes list (API returns only the latest version).
177
+ *
178
+ * @returns The newer NodeMetadata if an upgrade is available, null otherwise
179
+ */
180
+ export declare function getVersionUpgrade(currentMetadata: NodeMetadata, allNodeTypes: NodeMetadata[]): NodeMetadata | null;
181
+ /**
182
+ * Compute a swap preview with full options support (strategies, overrides).
183
+ *
184
+ * Resolution order:
185
+ * 1. Check strategies — first canHandle() match wins for mapPorts()/mapConfig()
186
+ * 2. Fall through to built-in 3-pass for ports not covered by strategy
187
+ * 3. Apply portOverrides on top (highest priority — user's manual overrides)
188
+ * 4. Same cascade for config
189
+ */
190
+ export declare function computeSwapPreviewWithOptions(oldNode: WorkflowNode, newMetadata: NodeMetadata, edges: WorkflowEdge[], allNodes: WorkflowNode[], options: SwapOptions): SwapPreview;
191
+ /**
192
+ * Compute interactive state for the mapping editor UI.
193
+ *
194
+ * Returns EditablePortMapping and EditableConfigMapping entries
195
+ * with match quality annotations and isFlat flags.
196
+ */
197
+ export declare function computeInteractiveState(oldNode: WorkflowNode, newMetadata: NodeMetadata, edges: WorkflowEdge[], allNodes: WorkflowNode[], options?: SwapOptions): InteractiveSwapState;
198
+ /**
199
+ * Convert user-edited InteractiveSwapState back into a SwapPreview
200
+ * for executeSwap(). Pure function, no side effects.
201
+ */
202
+ export declare function buildSwapPreviewFromState(state: InteractiveSwapState, allEdges: WorkflowEdge[]): SwapPreview;
203
+ /**
204
+ * Headless one-shot swap with full validation.
205
+ *
206
+ * Guardrails:
207
+ * - Validates oldNode.id exists in allNodes
208
+ * - Validates format compatibility if newMetadata.formats is set
209
+ * - Computes preview → executes → validates → returns result
210
+ * - Throws SwapValidationError on invalid input
211
+ */
212
+ export declare function performSwap(oldNode: WorkflowNode, newMetadata: NodeMetadata, allNodes: WorkflowNode[], allEdges: WorkflowEdge[], options?: SwapOptions): SwapResult;
213
+ /**
214
+ * Validate a swap result for structural integrity.
215
+ *
216
+ * Checks:
217
+ * - No dangling edge references (every edge source/target exists in nodes)
218
+ * - No duplicate node IDs
219
+ * - No duplicate edge IDs
220
+ */
221
+ export declare function validateSwapResult(result: SwapResult): WorkflowValidationResult;