@flowdrop/flowdrop 2.10.1 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (571) hide show
  1. package/CHANGELOG.md +385 -0
  2. package/dist/adapters/agentspec/autoLayout.d.ts +18 -36
  3. package/dist/adapters/agentspec/autoLayout.js +75 -93
  4. package/dist/chat/activity.d.ts +49 -0
  5. package/dist/chat/activity.js +65 -0
  6. package/dist/chat/commandClassifier.js +2 -1
  7. package/dist/commands/executor.js +186 -27
  8. package/dist/commands/index.d.ts +2 -1
  9. package/dist/commands/index.js +2 -0
  10. package/dist/commands/parser.js +43 -3
  11. package/dist/commands/session.d.ts +60 -0
  12. package/dist/commands/session.js +332 -0
  13. package/dist/commands/storeIntegration.svelte.js +18 -1
  14. package/dist/commands/types.d.ts +77 -4
  15. package/dist/components/App.svelte +1030 -207
  16. package/dist/components/App.svelte.d.ts +26 -2
  17. package/dist/components/BindablePortListbox.svelte +68 -369
  18. package/dist/components/Button.svelte +17 -14
  19. package/dist/components/Button.svelte.d.ts +2 -2
  20. package/dist/components/CanvasContextMenu.svelte +31 -10
  21. package/dist/components/CanvasController.svelte +146 -3
  22. package/dist/components/CanvasController.svelte.d.ts +25 -33
  23. package/dist/components/CanvasIconButton.svelte +6 -6
  24. package/dist/components/CanvasToolbar.svelte +103 -0
  25. package/dist/components/CanvasToolbar.svelte.d.ts +23 -0
  26. package/dist/components/CanvasZoomControls.svelte +122 -0
  27. package/dist/components/CanvasZoomControls.svelte.d.ts +15 -0
  28. package/dist/components/ConfigForm.svelte +163 -125
  29. package/dist/components/ConfigModal.svelte +13 -56
  30. package/dist/components/ConfigModal.svelte.d.ts +1 -1
  31. package/dist/components/ConfigPanel.svelte +98 -228
  32. package/dist/components/ConfigPanel.svelte.d.ts +2 -2
  33. package/dist/components/ConnectPortPicker.svelte +153 -0
  34. package/dist/components/ConnectPortPicker.svelte.d.ts +22 -0
  35. package/dist/components/ConnectionLine.svelte +1 -1
  36. package/dist/components/DoctorMenu.svelte +422 -0
  37. package/dist/components/DoctorMenu.svelte.d.ts +7 -0
  38. package/dist/components/ExternalLinkRow.svelte +82 -0
  39. package/dist/components/ExternalLinkRow.svelte.d.ts +14 -0
  40. package/dist/components/FlowDropEdge.svelte +52 -2
  41. package/dist/components/FlowDropEdge.svelte.d.ts +5 -1
  42. package/dist/components/InterfaceNameInput.svelte +103 -0
  43. package/dist/components/InterfaceNameInput.svelte.d.ts +13 -0
  44. package/dist/components/InterfaceTag.svelte +215 -0
  45. package/dist/components/InterfaceTag.svelte.d.ts +20 -0
  46. package/dist/components/InterfaceTagAnchor.svelte +103 -0
  47. package/dist/components/InterfaceTagAnchor.svelte.d.ts +12 -0
  48. package/dist/components/InterfaceTagLayer.svelte +314 -0
  49. package/dist/components/InterfaceTagLayer.svelte.d.ts +28 -0
  50. package/dist/components/LogsSidebar.svelte +58 -55
  51. package/dist/components/LoopbackLanes.svelte +54 -0
  52. package/dist/components/LoopbackLanes.svelte.d.ts +8 -0
  53. package/dist/components/MarkdownDisplay.svelte +1 -1
  54. package/dist/components/Navbar.svelte +539 -169
  55. package/dist/components/Navbar.svelte.d.ts +20 -1
  56. package/dist/components/NodeInspector.svelte +153 -0
  57. package/dist/components/NodeInspector.svelte.d.ts +19 -0
  58. package/dist/components/NodeLastRun.svelte +212 -0
  59. package/dist/components/NodeLastRun.svelte.d.ts +13 -0
  60. package/dist/components/NodeSidebar.svelte +279 -23
  61. package/dist/components/NodeSidebar.svelte.d.ts +11 -0
  62. package/dist/components/NodeStatusOverlay.svelte +144 -353
  63. package/dist/components/NodeStatusOverlay.svelte.d.ts +4 -1
  64. package/dist/components/PipelineStatus.svelte +5 -18
  65. package/dist/components/PortMappingRow.svelte +28 -44
  66. package/dist/components/PortPickerListbox.svelte +475 -0
  67. package/dist/components/PortPickerListbox.svelte.d.ts +73 -0
  68. package/dist/components/ReadOnlyDetails.svelte +52 -89
  69. package/dist/components/RunBar.svelte +222 -0
  70. package/dist/components/RunBar.svelte.d.ts +20 -0
  71. package/dist/components/RunsMenu.svelte +649 -0
  72. package/dist/components/RunsMenu.svelte.d.ts +14 -0
  73. package/dist/components/SchemaForm.svelte +1 -1
  74. package/dist/components/SettingsModal.svelte +28 -60
  75. package/dist/components/SettingsPanel.svelte +516 -242
  76. package/dist/components/StraightGuides.svelte +46 -0
  77. package/dist/components/StraightGuides.svelte.d.ts +7 -0
  78. package/dist/components/ThemeToggle.svelte +14 -4
  79. package/dist/components/UniversalNode.svelte +152 -51
  80. package/dist/components/WebMCPBridgeMenu.svelte +336 -0
  81. package/dist/components/WebMCPBridgeMenu.svelte.d.ts +3 -0
  82. package/dist/components/WorkflowEditor.svelte +821 -142
  83. package/dist/components/WorkflowEditor.svelte.d.ts +43 -1
  84. package/dist/components/WorkflowInterfaceEditor.svelte +106 -100
  85. package/dist/components/WorkflowInterfaceEditor.svelte.d.ts +12 -1
  86. package/dist/components/WorkflowInterfaceEntryCard.svelte +496 -494
  87. package/dist/components/WorkflowInterfaceEntryCard.svelte.d.ts +14 -1
  88. package/dist/components/WorkflowInterfaceEntryComposer.svelte +23 -67
  89. package/dist/components/WorkflowPlaygroundSettings.svelte +514 -0
  90. package/dist/components/WorkflowPlaygroundSettings.svelte.d.ts +20 -0
  91. package/dist/components/WorkflowSettingsPanel.svelte +311 -0
  92. package/dist/components/WorkflowSettingsPanel.svelte.d.ts +20 -0
  93. package/dist/components/ZoomTier.svelte +56 -0
  94. package/dist/components/ZoomTier.svelte.d.ts +4 -0
  95. package/dist/components/chat/AIChatPanel.svelte +464 -313
  96. package/dist/components/chat/ActivityList.svelte +130 -0
  97. package/dist/components/chat/ActivityList.svelte.d.ts +11 -0
  98. package/dist/components/chat/ActivityRow.svelte +179 -0
  99. package/dist/components/chat/ActivityRow.svelte.d.ts +16 -0
  100. package/dist/components/chat/CommandPreview.svelte +42 -64
  101. package/dist/components/console/CommandConsole.svelte +106 -41
  102. package/dist/components/console/CommandConsole.svelte.d.ts +2 -0
  103. package/dist/components/console/ConsoleAutocomplete.svelte +14 -13
  104. package/dist/components/console/ConsoleInput.svelte +60 -27
  105. package/dist/components/console/ConsoleOutput.svelte +86 -24
  106. package/dist/components/console/ConsoleStrip.svelte +80 -0
  107. package/dist/components/console/ConsoleStrip.svelte.d.ts +13 -0
  108. package/dist/components/form/FieldFactory.svelte +30 -4
  109. package/dist/components/form/FormArray.svelte +306 -339
  110. package/dist/components/form/FormArray.svelte.d.ts +10 -0
  111. package/dist/components/form/FormArrayRows.svelte +443 -0
  112. package/dist/components/form/FormArrayRows.svelte.d.ts +18 -0
  113. package/dist/components/form/FormAutocomplete.svelte +2 -2
  114. package/dist/components/form/FormCheckboxGroup.svelte +10 -85
  115. package/dist/components/form/FormCodeEditor.svelte +3 -3
  116. package/dist/components/form/FormFieldWrapper.svelte +98 -18
  117. package/dist/components/form/FormFieldWrapper.svelte.d.ts +10 -0
  118. package/dist/components/form/FormFieldset.svelte +44 -28
  119. package/dist/components/form/FormMarkdownEditor.svelte +6 -6
  120. package/dist/components/form/FormPorts.svelte +437 -141
  121. package/dist/components/form/FormSelect.svelte +1 -1
  122. package/dist/components/form/FormTemplateEditor.svelte +22 -26
  123. package/dist/components/form/FormToggle.svelte +15 -106
  124. package/dist/components/form/FormToggle.svelte.d.ts +3 -2
  125. package/dist/components/form/FormUISchemaRenderer.svelte +38 -3
  126. package/dist/components/form/humanizeKey.d.ts +7 -0
  127. package/dist/components/form/humanizeKey.js +21 -0
  128. package/dist/components/form/index.d.ts +2 -2
  129. package/dist/components/form/index.js +2 -2
  130. package/dist/components/form/types.d.ts +6 -0
  131. package/dist/components/icons/MenuOpenIcon.svelte +8 -1
  132. package/dist/components/interrupt/ChoicePrompt.svelte +51 -152
  133. package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +0 -2
  134. package/dist/components/interrupt/ConfirmationPrompt.svelte +18 -201
  135. package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +0 -4
  136. package/dist/components/interrupt/FormPrompt.svelte +22 -147
  137. package/dist/components/interrupt/FormPrompt.svelte.d.ts +0 -4
  138. package/dist/components/interrupt/InterruptBubble.svelte +198 -355
  139. package/dist/components/interrupt/InterruptBubble.svelte.d.ts +0 -2
  140. package/dist/components/interrupt/ReviewPrompt.svelte +0 -10
  141. package/dist/components/interrupt/TextInputPrompt.svelte +23 -120
  142. package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +0 -2
  143. package/dist/components/layouts/MainLayout.svelte +110 -75
  144. package/dist/components/layouts/MainLayout.svelte.d.ts +17 -0
  145. package/dist/components/nodes/CaptionNode.svelte +7 -0
  146. package/dist/components/nodes/GatewayNode.svelte +66 -431
  147. package/dist/components/nodes/IdeaNode.svelte +6 -5
  148. package/dist/components/nodes/NodeCard.svelte +1051 -0
  149. package/dist/components/nodes/NodeCard.svelte.d.ts +30 -0
  150. package/dist/components/nodes/NodeConfigButton.svelte +28 -9
  151. package/dist/components/nodes/NodeProblemMark.svelte +113 -0
  152. package/dist/components/nodes/NodeProblemMark.svelte.d.ts +8 -0
  153. package/dist/components/nodes/NodeTip.svelte +104 -0
  154. package/dist/components/nodes/NodeTip.svelte.d.ts +15 -0
  155. package/dist/components/nodes/NotesNode.svelte +183 -150
  156. package/dist/components/nodes/SimpleNode.svelte +176 -44
  157. package/dist/components/nodes/SquareNode.svelte +127 -34
  158. package/dist/components/nodes/TerminalNode.svelte +232 -88
  159. package/dist/components/nodes/ToolNode.svelte +49 -381
  160. package/dist/components/nodes/WorkflowNode.svelte +40 -399
  161. package/dist/components/playground/ChatBubble.svelte +248 -62
  162. package/dist/components/playground/ChatInput.svelte +134 -297
  163. package/dist/components/playground/ChatInput.svelte.d.ts +17 -0
  164. package/dist/components/playground/ControlPanel.svelte +318 -188
  165. package/dist/components/playground/ControlPanel.svelte.d.ts +13 -0
  166. package/dist/components/playground/DockedPlayground.svelte +75 -0
  167. package/dist/components/playground/DockedPlayground.svelte.d.ts +24 -0
  168. package/dist/components/playground/ExecutionConsole.svelte +54 -36
  169. package/dist/components/playground/ExecutionConsole.svelte.d.ts +12 -0
  170. package/dist/components/playground/ExecutionLogs.svelte +4 -0
  171. package/dist/components/playground/HeaderMenu.svelte +170 -0
  172. package/dist/components/playground/HeaderMenu.svelte.d.ts +22 -0
  173. package/dist/components/playground/InputCollector.svelte +8 -32
  174. package/dist/components/playground/InputFields.svelte +246 -0
  175. package/dist/components/playground/InputFields.svelte.d.ts +16 -0
  176. package/dist/components/playground/InterfaceInputForm.svelte +285 -30
  177. package/dist/components/playground/InterfaceInputForm.svelte.d.ts +20 -0
  178. package/dist/components/playground/InterfaceJsonInput.svelte +92 -0
  179. package/dist/components/playground/InterfaceJsonInput.svelte.d.ts +10 -0
  180. package/dist/components/playground/LogRow.svelte +12 -12
  181. package/dist/components/playground/MessageMarkdown.svelte +11 -11
  182. package/dist/components/playground/MessageStream.svelte +154 -182
  183. package/dist/components/playground/Playground.svelte +17 -1087
  184. package/dist/components/playground/PlaygroundApp.svelte +12 -2
  185. package/dist/components/playground/PlaygroundApp.svelte.d.ts +2 -1
  186. package/dist/components/playground/PlaygroundHeader.svelte +309 -0
  187. package/dist/components/playground/PlaygroundHeader.svelte.d.ts +22 -0
  188. package/dist/components/playground/PlaygroundModal.svelte +7 -1
  189. package/dist/components/playground/PlaygroundStudio.svelte +31 -33
  190. package/dist/components/playground/PlaygroundSurface.svelte +648 -0
  191. package/dist/components/playground/PlaygroundSurface.svelte.d.ts +79 -0
  192. package/dist/components/playground/StepsSummary.svelte +312 -0
  193. package/dist/components/playground/StepsSummary.svelte.d.ts +11 -0
  194. package/dist/components/playground/messageDisplay.d.ts +9 -0
  195. package/dist/components/playground/messageDisplay.js +24 -2
  196. package/dist/components/playground/stepSummary.d.ts +71 -0
  197. package/dist/components/playground/stepSummary.js +152 -0
  198. package/dist/components/ports/PortTypeBadge.svelte +13 -1
  199. package/dist/components/primitives/Button.svelte +226 -0
  200. package/dist/components/primitives/Button.svelte.d.ts +31 -0
  201. package/dist/components/primitives/Card.svelte +110 -0
  202. package/dist/components/primitives/Card.svelte.d.ts +20 -0
  203. package/dist/components/primitives/Checkbox.svelte +126 -0
  204. package/dist/components/primitives/Checkbox.svelte.d.ts +15 -0
  205. package/dist/components/primitives/Chip.svelte +143 -0
  206. package/dist/components/primitives/Chip.svelte.d.ts +22 -0
  207. package/dist/components/primitives/Combobox.svelte +444 -0
  208. package/dist/components/primitives/Combobox.svelte.d.ts +22 -0
  209. package/dist/components/primitives/Composer.svelte +293 -0
  210. package/dist/components/primitives/Composer.svelte.d.ts +47 -0
  211. package/dist/components/primitives/EmptyState.svelte +113 -0
  212. package/dist/components/primitives/EmptyState.svelte.d.ts +18 -0
  213. package/dist/components/primitives/Field.svelte +178 -0
  214. package/dist/components/primitives/Field.svelte.d.ts +30 -0
  215. package/dist/components/primitives/IconButton.svelte +156 -0
  216. package/dist/components/primitives/IconButton.svelte.d.ts +27 -0
  217. package/dist/components/primitives/Menu.svelte +435 -0
  218. package/dist/components/primitives/Menu.svelte.d.ts +61 -0
  219. package/dist/components/primitives/Notice.svelte +161 -0
  220. package/dist/components/primitives/Notice.svelte.d.ts +22 -0
  221. package/dist/components/primitives/PanelHeader.svelte +134 -0
  222. package/dist/components/primitives/PanelHeader.svelte.d.ts +23 -0
  223. package/dist/components/primitives/Segmented.svelte +198 -0
  224. package/dist/components/primitives/Segmented.svelte.d.ts +32 -0
  225. package/dist/components/primitives/Select.svelte +130 -0
  226. package/dist/components/primitives/Select.svelte.d.ts +26 -0
  227. package/dist/components/primitives/StatusPill.svelte +218 -0
  228. package/dist/components/primitives/StatusPill.svelte.d.ts +24 -0
  229. package/dist/components/primitives/Switch.svelte +113 -0
  230. package/dist/components/primitives/Switch.svelte.d.ts +14 -0
  231. package/dist/components/primitives/Tabs.svelte +209 -0
  232. package/dist/components/primitives/Tabs.svelte.d.ts +32 -0
  233. package/dist/components/primitives/Toolbar.svelte +94 -0
  234. package/dist/components/primitives/Toolbar.svelte.d.ts +14 -0
  235. package/dist/components/primitives/ToolbarSeparator.svelte +40 -0
  236. package/dist/components/primitives/ToolbarSeparator.svelte.d.ts +7 -0
  237. package/dist/components/surfaces/SurfaceOverlay.svelte +10 -40
  238. package/dist/components/surfaces/TabbedSurface.svelte +49 -39
  239. package/dist/components/surfaces/TabbedSurface.svelte.d.ts +8 -0
  240. package/dist/components/toast/DismissibleToast.svelte +94 -32
  241. package/dist/components/toast/DismissibleToast.svelte.d.ts +17 -7
  242. package/dist/config/endpoints.d.ts +43 -1
  243. package/dist/config/endpoints.js +21 -3
  244. package/dist/core/index.d.ts +9 -6
  245. package/dist/core/index.js +1 -1
  246. package/dist/editor/connectCandidates.d.ts +56 -0
  247. package/dist/editor/connectCandidates.js +131 -0
  248. package/dist/editor/contextMenu.d.ts +31 -2
  249. package/dist/editor/contextMenu.js +96 -9
  250. package/dist/editor/index.d.ts +3 -1
  251. package/dist/editor/index.js +1 -0
  252. package/dist/editor/interfaceMenu.d.ts +35 -0
  253. package/dist/editor/interfaceMenu.js +47 -0
  254. package/dist/editor/portMenu.d.ts +23 -0
  255. package/dist/editor/portMenu.js +34 -0
  256. package/dist/editor/tidy.d.ts +30 -0
  257. package/dist/editor/tidy.js +66 -0
  258. package/dist/helpers/workflowEditorHelper.d.ts +15 -0
  259. package/dist/helpers/workflowEditorHelper.js +39 -3
  260. package/dist/layout/fromWorkflow.d.ts +42 -0
  261. package/dist/layout/fromWorkflow.js +135 -0
  262. package/dist/layout/geometry.d.ts +102 -0
  263. package/dist/layout/geometry.js +317 -0
  264. package/dist/layout/index.d.ts +21 -0
  265. package/dist/layout/index.js +14 -0
  266. package/dist/layout/inspect.d.ts +18 -0
  267. package/dist/layout/inspect.js +81 -0
  268. package/dist/layout/lanePath.d.ts +23 -0
  269. package/dist/layout/lanePath.js +47 -0
  270. package/dist/layout/measure.d.ts +141 -0
  271. package/dist/layout/measure.js +477 -0
  272. package/dist/layout/primitives.d.ts +124 -0
  273. package/dist/layout/primitives.js +461 -0
  274. package/dist/layout/sweep.d.ts +59 -0
  275. package/dist/layout/sweep.js +257 -0
  276. package/dist/layout/toWorkflow.d.ts +43 -0
  277. package/dist/layout/toWorkflow.js +131 -0
  278. package/dist/layout/types.d.ts +93 -0
  279. package/dist/layout/types.js +35 -0
  280. package/dist/messages/defaults.d.ts +694 -26
  281. package/dist/messages/defaults.js +626 -27
  282. package/dist/messages/types.d.ts +21 -1
  283. package/dist/openapi/v1/openapi.yaml +222 -5
  284. package/dist/playground/index.d.ts +31 -2
  285. package/dist/playground/index.js +31 -1
  286. package/dist/playground/mount.d.ts +34 -12
  287. package/dist/playground/mount.js +80 -35
  288. package/dist/playground/runAction.d.ts +29 -0
  289. package/dist/playground/runAction.js +38 -0
  290. package/dist/schemas/index.js +1 -1
  291. package/dist/schemas/v1/workflow.schema.json +140 -2
  292. package/dist/services/doctorService.d.ts +52 -0
  293. package/dist/services/doctorService.js +113 -0
  294. package/dist/services/globalSave.js +17 -24
  295. package/dist/services/nodeExecutionService.d.ts +12 -1
  296. package/dist/services/nodeExecutionService.js +58 -58
  297. package/dist/services/playgroundService.d.ts +23 -3
  298. package/dist/services/playgroundService.js +53 -5
  299. package/dist/services/runsService.d.ts +42 -0
  300. package/dist/services/runsService.js +87 -0
  301. package/dist/services/toastQueue.d.ts +33 -0
  302. package/dist/services/toastQueue.js +38 -0
  303. package/dist/services/toastService.d.ts +30 -9
  304. package/dist/services/toastService.js +81 -46
  305. package/dist/settings/index.d.ts +1 -0
  306. package/dist/skins/default.d.ts +1 -1
  307. package/dist/skins/drafter.d.ts +1 -1
  308. package/dist/skins/graphite.d.ts +26 -0
  309. package/dist/skins/graphite.js +473 -0
  310. package/dist/skins/index.d.ts +6 -5
  311. package/dist/skins/index.js +7 -5
  312. package/dist/skins/slate.d.ts +1 -1
  313. package/dist/skins/slate.js +4 -4
  314. package/dist/stores/attachedRunStore.svelte.d.ts +35 -0
  315. package/dist/stores/attachedRunStore.svelte.js +47 -0
  316. package/dist/stores/connectDragStore.svelte.d.ts +39 -0
  317. package/dist/stores/connectDragStore.svelte.js +42 -0
  318. package/dist/stores/doctorStore.svelte.d.ts +79 -0
  319. package/dist/stores/doctorStore.svelte.js +244 -0
  320. package/dist/stores/editedNodesStore.svelte.d.ts +42 -0
  321. package/dist/stores/editedNodesStore.svelte.js +84 -0
  322. package/dist/stores/editorModeStore.svelte.d.ts +34 -0
  323. package/dist/stores/editorModeStore.svelte.js +55 -0
  324. package/dist/stores/instanceContainer.svelte.d.ts +68 -0
  325. package/dist/stores/instanceContainer.svelte.js +49 -2
  326. package/dist/stores/loopbackLanesStore.svelte.d.ts +18 -0
  327. package/dist/stores/loopbackLanesStore.svelte.js +25 -0
  328. package/dist/stores/nodeHighlightStore.svelte.d.ts +34 -0
  329. package/dist/stores/nodeHighlightStore.svelte.js +56 -0
  330. package/dist/stores/playgroundStore.svelte.d.ts +74 -2
  331. package/dist/stores/playgroundStore.svelte.js +182 -6
  332. package/dist/stores/runController.svelte.d.ts +382 -0
  333. package/dist/stores/runController.svelte.js +1217 -0
  334. package/dist/stores/settingsStore.svelte.d.ts +80 -18
  335. package/dist/stores/settingsStore.svelte.js +180 -62
  336. package/dist/stores/workflowStore.svelte.d.ts +18 -1
  337. package/dist/stores/workflowStore.svelte.js +29 -1
  338. package/dist/styles/base.css +300 -28
  339. package/dist/styles/fonts/Inter-LICENSE.txt +93 -0
  340. package/dist/styles/fonts/inter-latin-wght-normal.woff2 +0 -0
  341. package/dist/styles/fonts/inter.css +19 -0
  342. package/dist/styles/toast.css +100 -20
  343. package/dist/styles/tokenAliases.d.ts +13 -0
  344. package/dist/styles/tokenAliases.js +206 -0
  345. package/dist/styles/tokens.css +586 -14
  346. package/dist/svelte-app.d.ts +38 -5
  347. package/dist/svelte-app.js +14 -3
  348. package/dist/themes/graphite.d.ts +2 -0
  349. package/dist/themes/graphite.js +15 -0
  350. package/dist/themes/index.d.ts +2 -1
  351. package/dist/themes/index.js +22 -3
  352. package/dist/themes/minimal.js +10 -0
  353. package/dist/themes/scopedSkinCss.d.ts +47 -0
  354. package/dist/themes/scopedSkinCss.js +220 -0
  355. package/dist/types/chat.d.ts +6 -0
  356. package/dist/types/doctor.d.ts +82 -0
  357. package/dist/types/doctor.js +11 -0
  358. package/dist/types/events.d.ts +35 -0
  359. package/dist/types/events.js +4 -1
  360. package/dist/types/index.d.ts +103 -6
  361. package/dist/types/index.js +15 -3
  362. package/dist/types/navbar.d.ts +36 -0
  363. package/dist/types/playground.d.ts +66 -0
  364. package/dist/types/settings.d.ts +120 -7
  365. package/dist/types/settings.js +35 -3
  366. package/dist/types/skin.d.ts +23 -10
  367. package/dist/types/theme.d.ts +40 -2
  368. package/dist/utils/appearance.d.ts +19 -0
  369. package/dist/utils/appearance.js +13 -0
  370. package/dist/utils/canvasFit.d.ts +41 -0
  371. package/dist/utils/canvasFit.js +44 -0
  372. package/dist/utils/chipTitles.d.ts +9 -0
  373. package/dist/utils/chipTitles.js +19 -0
  374. package/dist/utils/connections.js +8 -0
  375. package/dist/utils/consoleHighlight.d.ts +28 -0
  376. package/dist/utils/consoleHighlight.js +269 -0
  377. package/dist/utils/deprecation.d.ts +17 -0
  378. package/dist/utils/deprecation.js +29 -0
  379. package/dist/utils/doctorOperations.d.ts +40 -0
  380. package/dist/utils/doctorOperations.js +237 -0
  381. package/dist/utils/duration.d.ts +13 -0
  382. package/dist/utils/duration.js +40 -0
  383. package/dist/utils/inspectorContext.d.ts +19 -0
  384. package/dist/utils/inspectorContext.js +12 -0
  385. package/dist/utils/inspectorSections.d.ts +20 -0
  386. package/dist/utils/inspectorSections.js +44 -0
  387. package/dist/utils/inspectorSurface.d.ts +46 -0
  388. package/dist/utils/inspectorSurface.js +51 -0
  389. package/dist/utils/interfaceTags.d.ts +102 -0
  390. package/dist/utils/interfaceTags.js +211 -0
  391. package/dist/utils/itemRef.d.ts +86 -0
  392. package/dist/utils/itemRef.js +106 -0
  393. package/dist/utils/lastRun.d.ts +35 -0
  394. package/dist/utils/lastRun.js +73 -0
  395. package/dist/utils/messageNodeLink.d.ts +17 -0
  396. package/dist/utils/messageNodeLink.js +16 -0
  397. package/dist/utils/minimapVisibility.d.ts +28 -0
  398. package/dist/utils/minimapVisibility.js +34 -0
  399. package/dist/utils/nodeAriaLabel.d.ts +12 -0
  400. package/dist/utils/nodeAriaLabel.js +17 -0
  401. package/dist/utils/nodeFingerprint.d.ts +27 -0
  402. package/dist/utils/nodeFingerprint.js +66 -0
  403. package/dist/utils/nodeFormSchema.d.ts +10 -0
  404. package/dist/utils/nodeFormSchema.js +2 -2
  405. package/dist/utils/nodeGeometry.d.ts +168 -0
  406. package/dist/utils/nodeGeometry.js +204 -0
  407. package/dist/utils/nodeProblem.d.ts +19 -0
  408. package/dist/utils/nodeProblem.js +9 -0
  409. package/dist/utils/nodeStatus.d.ts +38 -3
  410. package/dist/utils/nodeStatus.js +67 -39
  411. package/dist/utils/nodeSwap.js +9 -1
  412. package/dist/utils/nodeWrapper.d.ts +1 -0
  413. package/dist/utils/playgroundChat.d.ts +121 -0
  414. package/dist/utils/playgroundChat.js +275 -0
  415. package/dist/utils/playgroundHistory.d.ts +48 -0
  416. package/dist/utils/playgroundHistory.js +38 -0
  417. package/dist/utils/playgroundInputRuns.d.ts +26 -0
  418. package/dist/utils/playgroundInputRuns.js +50 -0
  419. package/dist/utils/portExposure.d.ts +49 -0
  420. package/dist/utils/portExposure.js +122 -0
  421. package/dist/utils/portUtils.d.ts +16 -0
  422. package/dist/utils/portUtils.js +37 -0
  423. package/dist/utils/portal.d.ts +3 -14
  424. package/dist/utils/portal.js +22 -0
  425. package/dist/utils/reservedPorts.d.ts +59 -0
  426. package/dist/utils/reservedPorts.js +60 -0
  427. package/dist/utils/runEdges.d.ts +24 -0
  428. package/dist/utils/runEdges.js +35 -0
  429. package/dist/utils/runsList.d.ts +69 -0
  430. package/dist/utils/runsList.js +134 -0
  431. package/dist/utils/selectOptions.d.ts +62 -0
  432. package/dist/utils/selectOptions.js +137 -0
  433. package/dist/utils/sessionRuns.d.ts +62 -0
  434. package/dist/utils/sessionRuns.js +123 -0
  435. package/dist/utils/sheetWidths.d.ts +29 -0
  436. package/dist/utils/sheetWidths.js +41 -0
  437. package/dist/utils/sidebarWidths.d.ts +34 -0
  438. package/dist/utils/sidebarWidths.js +47 -0
  439. package/dist/utils/straightWires.d.ts +73 -0
  440. package/dist/utils/straightWires.js +99 -0
  441. package/dist/utils/themeScope.svelte.d.ts +10 -0
  442. package/dist/utils/themeScope.svelte.js +80 -0
  443. package/dist/utils/wiredHandles.d.ts +10 -0
  444. package/dist/utils/wiredHandles.js +14 -0
  445. package/dist/utils/workflowDraft.d.ts +9 -0
  446. package/dist/utils/workflowDraft.js +39 -0
  447. package/dist/utils/workflowInterface.d.ts +128 -27
  448. package/dist/utils/workflowInterface.js +244 -33
  449. package/dist/utils/zoomTier.d.ts +43 -0
  450. package/dist/utils/zoomTier.js +107 -0
  451. package/dist/utils/zoomTierRows.d.ts +41 -0
  452. package/dist/utils/zoomTierRows.js +103 -0
  453. package/dist/webmcp/WebMCPConfirm.svelte +68 -18
  454. package/dist/webmcp/bridge.d.ts +5 -0
  455. package/dist/webmcp/bridge.js +8 -0
  456. package/dist/webmcp/bridgeController.svelte.d.ts +84 -0
  457. package/dist/webmcp/bridgeController.svelte.js +224 -0
  458. package/dist/webmcp/descriptors.d.ts +1 -1
  459. package/dist/webmcp/descriptors.js +66 -5
  460. package/dist/webmcp/fakeWidget.d.ts +34 -0
  461. package/dist/webmcp/fakeWidget.js +75 -0
  462. package/dist/webmcp/gate.d.ts +6 -0
  463. package/dist/webmcp/gate.js +8 -0
  464. package/dist/webmcp/index.d.ts +2 -0
  465. package/dist/webmcp/index.js +1 -0
  466. package/dist/webmcp/runtime.js +6 -2
  467. package/dist/webmcp/types.d.ts +2 -0
  468. package/dist/webmcp/validate.js +5 -1
  469. package/package.json +14 -7
  470. package/dist/components/Button.stories.svelte +0 -65
  471. package/dist/components/Button.stories.svelte.d.ts +0 -19
  472. package/dist/components/CanvasBanner.stories.svelte +0 -30
  473. package/dist/components/CanvasBanner.stories.svelte.d.ts +0 -27
  474. package/dist/components/CanvasContextMenu.stories.svelte +0 -63
  475. package/dist/components/CanvasContextMenu.stories.svelte.d.ts +0 -19
  476. package/dist/components/ConfigPanel.stories.svelte +0 -47
  477. package/dist/components/ConfigPanel.stories.svelte.d.ts +0 -27
  478. package/dist/components/EditorStatusBar.stories.svelte +0 -44
  479. package/dist/components/EditorStatusBar.stories.svelte.d.ts +0 -27
  480. package/dist/components/FlowDropEdge.stories.svelte +0 -197
  481. package/dist/components/FlowDropEdge.stories.svelte.d.ts +0 -26
  482. package/dist/components/LoadingSpinner.stories.svelte +0 -30
  483. package/dist/components/LoadingSpinner.stories.svelte.d.ts +0 -27
  484. package/dist/components/Logo.stories.svelte +0 -22
  485. package/dist/components/Logo.stories.svelte.d.ts +0 -27
  486. package/dist/components/MarkdownDisplay.stories.svelte +0 -38
  487. package/dist/components/MarkdownDisplay.stories.svelte.d.ts +0 -27
  488. package/dist/components/Navbar.stories.svelte +0 -58
  489. package/dist/components/Navbar.stories.svelte.d.ts +0 -27
  490. package/dist/components/NodeStatusOverlay.stories.svelte +0 -85
  491. package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +0 -27
  492. package/dist/components/SchemaForm.stories.svelte +0 -122
  493. package/dist/components/SchemaForm.stories.svelte.d.ts +0 -27
  494. package/dist/components/Select.svelte +0 -53
  495. package/dist/components/Select.svelte.d.ts +0 -15
  496. package/dist/components/StatusIcon.stories.svelte +0 -60
  497. package/dist/components/StatusIcon.stories.svelte.d.ts +0 -27
  498. package/dist/components/StatusLabel.stories.svelte +0 -17
  499. package/dist/components/StatusLabel.stories.svelte.d.ts +0 -27
  500. package/dist/components/ThemeToggle.stories.svelte +0 -25
  501. package/dist/components/ThemeToggle.stories.svelte.d.ts +0 -27
  502. package/dist/components/console/CommandConsole.stories.svelte +0 -111
  503. package/dist/components/console/CommandConsole.stories.svelte.d.ts +0 -27
  504. package/dist/components/form/FormCheckboxGroup.stories.svelte +0 -28
  505. package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +0 -27
  506. package/dist/components/form/FormFieldWrapper.stories.svelte +0 -53
  507. package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +0 -27
  508. package/dist/components/form/FormNumberField.stories.svelte +0 -36
  509. package/dist/components/form/FormNumberField.stories.svelte.d.ts +0 -27
  510. package/dist/components/form/FormRangeField.stories.svelte +0 -31
  511. package/dist/components/form/FormRangeField.stories.svelte.d.ts +0 -27
  512. package/dist/components/form/FormSelect.stories.svelte +0 -50
  513. package/dist/components/form/FormSelect.stories.svelte.d.ts +0 -27
  514. package/dist/components/form/FormTextField.stories.svelte +0 -30
  515. package/dist/components/form/FormTextField.stories.svelte.d.ts +0 -27
  516. package/dist/components/form/FormTextarea.stories.svelte +0 -34
  517. package/dist/components/form/FormTextarea.stories.svelte.d.ts +0 -27
  518. package/dist/components/form/FormToggle.stories.svelte +0 -30
  519. package/dist/components/form/FormToggle.stories.svelte.d.ts +0 -27
  520. package/dist/components/icons/CommandLineIcon.svelte +0 -15
  521. package/dist/components/icons/CommandLineIcon.svelte.d.ts +0 -26
  522. package/dist/components/interrupt/ChoicePrompt.stories.svelte +0 -68
  523. package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +0 -27
  524. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +0 -71
  525. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +0 -27
  526. package/dist/components/interrupt/ReviewPrompt.stories.svelte +0 -77
  527. package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +0 -27
  528. package/dist/components/interrupt/TextInputPrompt.stories.svelte +0 -51
  529. package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +0 -27
  530. package/dist/components/nodes/CaptionNode.stories.svelte +0 -65
  531. package/dist/components/nodes/CaptionNode.stories.svelte.d.ts +0 -18
  532. package/dist/components/nodes/GatewayNode.stories.svelte +0 -108
  533. package/dist/components/nodes/GatewayNode.stories.svelte.d.ts +0 -26
  534. package/dist/components/nodes/IdeaNode.stories.svelte +0 -52
  535. package/dist/components/nodes/IdeaNode.stories.svelte.d.ts +0 -26
  536. package/dist/components/nodes/NotesNode.stories.svelte +0 -76
  537. package/dist/components/nodes/NotesNode.stories.svelte.d.ts +0 -26
  538. package/dist/components/nodes/SimpleNode.stories.svelte +0 -223
  539. package/dist/components/nodes/SimpleNode.stories.svelte.d.ts +0 -26
  540. package/dist/components/nodes/SquareNode.stories.svelte +0 -127
  541. package/dist/components/nodes/SquareNode.stories.svelte.d.ts +0 -26
  542. package/dist/components/nodes/TerminalNode.stories.svelte +0 -25
  543. package/dist/components/nodes/TerminalNode.stories.svelte.d.ts +0 -26
  544. package/dist/components/nodes/ToolNode.stories.svelte +0 -189
  545. package/dist/components/nodes/ToolNode.stories.svelte.d.ts +0 -26
  546. package/dist/components/nodes/WorkflowNode.stories.svelte +0 -188
  547. package/dist/components/nodes/WorkflowNode.stories.svelte.d.ts +0 -26
  548. package/dist/components/playground/MessageBubble.stories.svelte +0 -151
  549. package/dist/components/playground/MessageBubble.stories.svelte.d.ts +0 -27
  550. package/dist/components/toast/WarningIcon.svelte +0 -28
  551. package/dist/components/toast/WarningIcon.svelte.d.ts +0 -26
  552. package/dist/mocks/app-environment.d.ts +0 -8
  553. package/dist/mocks/app-environment.js +0 -16
  554. package/dist/mocks/app-forms.d.ts +0 -6
  555. package/dist/mocks/app-forms.js +0 -29
  556. package/dist/mocks/app-navigation.d.ts +0 -5
  557. package/dist/mocks/app-navigation.js +0 -36
  558. package/dist/mocks/app-stores.d.ts +0 -14
  559. package/dist/mocks/app-stores.js +0 -26
  560. package/dist/stories/CanvasDecorator.svelte +0 -49
  561. package/dist/stories/CanvasDecorator.svelte.d.ts +0 -8
  562. package/dist/stories/EdgeDecorator.svelte +0 -125
  563. package/dist/stories/EdgeDecorator.svelte.d.ts +0 -17
  564. package/dist/stories/NodeDecorator.svelte +0 -75
  565. package/dist/stories/NodeDecorator.svelte.d.ts +0 -8
  566. package/dist/stories/WebMCPFakeAgent.svelte +0 -229
  567. package/dist/stories/WebMCPFakeAgent.svelte.d.ts +0 -10
  568. package/dist/stories/utils.d.ts +0 -93
  569. package/dist/stories/utils.js +0 -156
  570. package/dist/webmcp/WebMCP.stories.svelte +0 -101
  571. package/dist/webmcp/WebMCP.stories.svelte.d.ts +0 -18
@@ -21,12 +21,22 @@ import { WorkflowStore } from './workflowStore.svelte.js';
21
21
  import { HistoryStore } from './historyStore.svelte.js';
22
22
  import { PlaygroundStore } from './playgroundStore.svelte.js';
23
23
  import { InterruptStore } from './interruptStore.svelte.js';
24
+ import { RunController } from './runController.svelte.js';
24
25
  import { CategoriesStore } from './categoriesStore.svelte.js';
25
26
  import { PortCoordinateStore } from './portCoordinateStore.svelte.js';
26
27
  import { PipelinePanelStore } from './pipelinePanelStore.svelte.js';
27
28
  import { InlineEditStore } from './inlineEditStore.svelte.js';
29
+ import { EditorModeStore } from './editorModeStore.svelte.js';
30
+ import { AttachedRunStore } from './attachedRunStore.svelte.js';
31
+ import { NodeHighlightStore } from './nodeHighlightStore.svelte.js';
32
+ import { ConnectDragStore } from './connectDragStore.svelte.js';
33
+ import { LoopbackLanesStore } from './loopbackLanesStore.svelte.js';
34
+ import { EditedNodesStore } from './editedNodesStore.svelte.js';
35
+ import { DoctorStore } from './doctorStore.svelte.js';
36
+ import { PlaygroundService } from '../services/playgroundService.js';
28
37
  import { ApiContext } from './apiContext.js';
29
38
  import { PortCompatibilityChecker } from '../utils/connections.js';
39
+ import type { MeasuredCard } from '../layout/fromWorkflow.js';
30
40
  import { NodeComponentRegistry } from '../registry/nodeComponentRegistry.js';
31
41
  import { FieldComponentRegistry } from '../form/fieldRegistry.js';
32
42
  import { WorkflowFormatRegistry } from '../registry/workflowFormatRegistry.js';
@@ -54,6 +64,20 @@ export interface FlowDropInstance {
54
64
  readonly historyBindings: HistoryStore;
55
65
  /** Playground sessions, messages, and execution state. */
56
66
  readonly playground: PlaygroundStore;
67
+ /**
68
+ * The playground API client and its polling loop. The default instance
69
+ * uses the exported `playgroundService` singleton, so legacy external
70
+ * `playgroundService.stopPolling()` calls still reach it; every other
71
+ * instance owns a separate service, so sessions poll independently.
72
+ */
73
+ readonly playgroundService: PlaygroundService;
74
+ /**
75
+ * The session and run executors of this instance: load, create and select
76
+ * sessions, take a turn, launch a run, signal, stop, poll. The Playground
77
+ * and the editor Console both drive them from here, so there is one code
78
+ * path; the controller Test mode builds on.
79
+ */
80
+ readonly runs: RunController;
57
81
  /** Pending interrupt/confirmation dialogs. */
58
82
  readonly interrupts: InterruptStore;
59
83
  /** Endpoint configuration, auth provider, and API client for this instance. */
@@ -85,6 +109,36 @@ export interface FlowDropInstance {
85
109
  * `editsInPlace` (the caption) watch it for their own id.
86
110
  */
87
111
  readonly inlineEdit: InlineEditStore;
112
+ /**
113
+ * The Edit | Test mode of this editor. `fd.editorMode.set('test')` is how a
114
+ * host (or a run bar) takes the editor into Test mode; the navbar switch
115
+ * writes the same store.
116
+ */
117
+ readonly editorMode: EditorModeStore;
118
+ /**
119
+ * The run attached to the Assistant (`fd.attachedRun.attach(id)`): the chat
120
+ * request carries it as `attachedRunId`, and the Assistant's run tools read it.
121
+ */
122
+ readonly attachedRun: AttachedRunStore;
123
+ /**
124
+ * Hover and selection shared by Playground messages and canvas nodes, and
125
+ * the "show this node's last run" request a message link makes.
126
+ */
127
+ readonly highlight: NodeHighlightStore;
128
+ /** The wire being dragged out of a port: cards light the ports that take its type. */
129
+ readonly connectDrag: ConnectDragStore;
130
+ /** The return lanes loopback edges are drawn along. */
131
+ readonly loopbackLanes: LoopbackLanesStore;
132
+ /**
133
+ * Which nodes changed since the shown run started (the `edited` mark in Test
134
+ * mode). `App` feeds it the shown run and the effective mode.
135
+ */
136
+ readonly editedNodes: EditedNodesStore;
137
+ /**
138
+ * The problems the backend's Doctor finds in the draft, and the remedies it
139
+ * offers (the Problems indicator and the node badges read it).
140
+ */
141
+ readonly doctor: DoctorStore;
88
142
  /**
89
143
  * The node types this editor currently knows: what `App` fetched (or was
90
144
  * given), merged with the format-provided nodes. Written by the editor as
@@ -109,6 +163,20 @@ export interface FlowDropInstance {
109
163
  * publisher clears it when it goes away. `null` until a surface exists.
110
164
  */
111
165
  approvalGate: ApprovalGate | null;
166
+ /**
167
+ * The skin scope (`data-fd-scope`) of the editor rendering this instance,
168
+ * set by `App` while it is mounted. Overlays mounted outside the editor tree
169
+ * (the WebMCP approval dialog) copy it so they keep the editor's skin.
170
+ * `null` when no editor is mounted.
171
+ */
172
+ skinScope: string | null;
173
+ /**
174
+ * How the mounted canvas measured a node (size and handle centres from its
175
+ * top-left), registered by the editor while its canvas is mounted. Node
176
+ * layout commands read it so they work from the geometry on screen; without
177
+ * a canvas they fall back to computed geometry.
178
+ */
179
+ measureNode: ((nodeId: string) => MeasuredCard | undefined) | null;
112
180
  /**
113
181
  * Run `fn` when this instance is destroyed. Returns an unsubscribe; calling
114
182
  * it before `destroy()` means `fn` never runs. Adapters that bind to an
@@ -18,10 +18,19 @@ import { WorkflowStore } from './workflowStore.svelte.js';
18
18
  import { HistoryStore } from './historyStore.svelte.js';
19
19
  import { PlaygroundStore } from './playgroundStore.svelte.js';
20
20
  import { InterruptStore } from './interruptStore.svelte.js';
21
+ import { RunController } from './runController.svelte.js';
21
22
  import { CategoriesStore } from './categoriesStore.svelte.js';
22
23
  import { PortCoordinateStore } from './portCoordinateStore.svelte.js';
23
24
  import { PipelinePanelStore } from './pipelinePanelStore.svelte.js';
24
25
  import { InlineEditStore } from './inlineEditStore.svelte.js';
26
+ import { EditorModeStore } from './editorModeStore.svelte.js';
27
+ import { AttachedRunStore } from './attachedRunStore.svelte.js';
28
+ import { NodeHighlightStore } from './nodeHighlightStore.svelte.js';
29
+ import { ConnectDragStore } from './connectDragStore.svelte.js';
30
+ import { LoopbackLanesStore } from './loopbackLanesStore.svelte.js';
31
+ import { EditedNodesStore } from './editedNodesStore.svelte.js';
32
+ import { DoctorStore } from './doctorStore.svelte.js';
33
+ import { PlaygroundService, playgroundService } from '../services/playgroundService.js';
25
34
  import { ApiContext } from './apiContext.js';
26
35
  import { PortCompatibilityChecker } from '../utils/connections.js';
27
36
  import { DEFAULT_PORT_CONFIG } from '../config/defaultPortConfig.js';
@@ -104,13 +113,35 @@ export function createFlowDropInstance(options = {}) {
104
113
  // dangling transaction itself — it has no access to the live state).
105
114
  historyBindings.setBeforeNavigateCallback(() => workflow.finalizeNodeConfig());
106
115
  const playground = new PlaygroundStore();
116
+ const instancePlaygroundService = isDefault ? playgroundService : new PlaygroundService();
117
+ const api = new ApiContext();
118
+ const doctor = new DoctorStore(workflow, api);
119
+ const runs = new RunController({
120
+ playground,
121
+ service: instancePlaygroundService,
122
+ api,
123
+ workflow
124
+ });
125
+ // Reactive, so the loopback lanes recompute once the canvas registers its measurement.
126
+ let measureNodeFn = $state.raw(null);
107
127
  const cleanups = [
108
128
  () => historyBindings.cleanup(),
109
129
  () => historyBindings.setOnRestoreCallback(null),
110
130
  () => historyBindings.setBeforeNavigateCallback(null),
131
+ () => doctor.dispose(),
111
132
  () => workflow.setOnDirtyStateChange(null),
112
133
  () => workflow.setOnWorkflowChange(null),
113
- () => playground.dispose()
134
+ () => playground.dispose(),
135
+ // Drop the surface's options (callbacks into a mounted component).
136
+ () => runs.configure({}),
137
+ // Its host-run poll and session-status subscription.
138
+ () => runs.dispose(),
139
+ // An owned service stops with its instance. The default one is the shared
140
+ // singleton and keeps the legacy behavior (outlives its mounts).
141
+ () => {
142
+ if (!isDefault)
143
+ instancePlaygroundService.stopPolling();
144
+ }
114
145
  ];
115
146
  return {
116
147
  id,
@@ -120,8 +151,10 @@ export function createFlowDropInstance(options = {}) {
120
151
  workflow,
121
152
  historyBindings,
122
153
  playground,
154
+ playgroundService: instancePlaygroundService,
155
+ runs,
123
156
  interrupts: new InterruptStore(),
124
- api: new ApiContext(),
157
+ api,
125
158
  nodes: new NodeComponentRegistry({
126
159
  registrations: BUILTIN_NODE_COMPONENTS,
127
160
  defaultType: 'workflowNode'
@@ -134,9 +167,23 @@ export function createFlowDropInstance(options = {}) {
134
167
  // The default instance keeps the legacy bare localStorage key.
135
168
  pipelinePanel: new PipelinePanelStore(id),
136
169
  inlineEdit: new InlineEditStore(),
170
+ editorMode: new EditorModeStore(),
171
+ attachedRun: new AttachedRunStore(),
172
+ highlight: new NodeHighlightStore(),
173
+ connectDrag: new ConnectDragStore(),
174
+ loopbackLanes: new LoopbackLanesStore(),
175
+ editedNodes: new EditedNodesStore(() => workflow.current),
176
+ doctor,
137
177
  nodeTypes: new NodeTypesStore(),
138
178
  host: new HostHooksStore(),
139
179
  approvalGate: null,
180
+ skinScope: null,
181
+ get measureNode() {
182
+ return measureNodeFn;
183
+ },
184
+ set measureNode(fn) {
185
+ measureNodeFn = fn;
186
+ },
140
187
  onDestroy(fn) {
141
188
  cleanups.push(fn);
142
189
  return () => {
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The return lanes of the loopbacks on the canvas, one store per editor.
3
+ *
4
+ * Track assignment needs the whole graph, so the LoopbackLanes component derives every
5
+ * lane once per change (nodes, edges, measured sizes) and the edges only look theirs
6
+ * up by id. Empty until the canvas is measured, and
7
+ * for a loopback whose cards are not measured yet: that edge stays a bezier.
8
+ *
9
+ * @module stores/loopbackLanesStore
10
+ */
11
+ import type { LoopbackLane } from '../layout/geometry.js';
12
+ export declare class LoopbackLanesStore {
13
+ #private;
14
+ /** The lane of an edge, or undefined when it is drawn as a bezier. */
15
+ get(edgeId: string): LoopbackLane | undefined;
16
+ /** Read the lanes through `source` (a derived in the component). Returns the disconnect. */
17
+ connect(source: () => ReadonlyMap<string, LoopbackLane>): () => void;
18
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The return lanes of the loopbacks on the canvas, one store per editor.
3
+ *
4
+ * Track assignment needs the whole graph, so the LoopbackLanes component derives every
5
+ * lane once per change (nodes, edges, measured sizes) and the edges only look theirs
6
+ * up by id. Empty until the canvas is measured, and
7
+ * for a loopback whose cards are not measured yet: that edge stays a bezier.
8
+ *
9
+ * @module stores/loopbackLanesStore
10
+ */
11
+ export class LoopbackLanesStore {
12
+ #source = $state.raw(null);
13
+ /** The lane of an edge, or undefined when it is drawn as a bezier. */
14
+ get(edgeId) {
15
+ return this.#source?.().get(edgeId);
16
+ }
17
+ /** Read the lanes through `source` (a derived in the component). Returns the disconnect. */
18
+ connect(source) {
19
+ this.#source = source;
20
+ return () => {
21
+ if (this.#source === source)
22
+ this.#source = null;
23
+ };
24
+ }
25
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The link between Playground messages and canvas nodes, one store per editor.
3
+ *
4
+ * Hovering a message's node link lights that node on the canvas; hovering or
5
+ * selecting a node lights the messages that came from it. The store holds only
6
+ * what is hovered or selected right now. It never moves the view: a click on a
7
+ * link asks `reveal`, and whoever registered the handler (`App`) decides what
8
+ * that means.
9
+ *
10
+ * @module stores/nodeHighlightStore
11
+ */
12
+ export type RevealHandler = (nodeId: string) => boolean;
13
+ export declare class NodeHighlightStore {
14
+ #private;
15
+ /** The node to light on the canvas: the one whose message link is hovered. */
16
+ get canvasNodeId(): string | null;
17
+ /** The node whose messages to light: the hovered node, else the selected one. */
18
+ get messageNodeId(): string | null;
19
+ /** Whether message links can do anything (an editor registered a handler). */
20
+ get canReveal(): boolean;
21
+ /** A message link is hovered (`null` when the pointer leaves it). */
22
+ hoverLink(nodeId: string | null): void;
23
+ /** A canvas node is hovered (`null` when the pointer leaves it). */
24
+ hoverNode(nodeId: string | null): void;
25
+ /** The node open in the inspector (`null` when none). */
26
+ setSelected(nodeId: string | null): void;
27
+ /**
28
+ * Show a node's last run: select it, open Last run, bring it into view.
29
+ * Returns whether the editor did so (false: no editor, or no such node).
30
+ */
31
+ reveal(nodeId: string): boolean;
32
+ /** Register the editor's reveal handler. Returns the unregister function. */
33
+ setRevealHandler(handler: RevealHandler): () => void;
34
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * The link between Playground messages and canvas nodes, one store per editor.
3
+ *
4
+ * Hovering a message's node link lights that node on the canvas; hovering or
5
+ * selecting a node lights the messages that came from it. The store holds only
6
+ * what is hovered or selected right now. It never moves the view: a click on a
7
+ * link asks `reveal`, and whoever registered the handler (`App`) decides what
8
+ * that means.
9
+ *
10
+ * @module stores/nodeHighlightStore
11
+ */
12
+ export class NodeHighlightStore {
13
+ #linkHover = $state(null);
14
+ #nodeHover = $state(null);
15
+ #selected = $state(null);
16
+ #reveal = null;
17
+ /** The node to light on the canvas: the one whose message link is hovered. */
18
+ get canvasNodeId() {
19
+ return this.#linkHover;
20
+ }
21
+ /** The node whose messages to light: the hovered node, else the selected one. */
22
+ get messageNodeId() {
23
+ return this.#nodeHover ?? this.#selected;
24
+ }
25
+ /** Whether message links can do anything (an editor registered a handler). */
26
+ get canReveal() {
27
+ return this.#reveal !== null;
28
+ }
29
+ /** A message link is hovered (`null` when the pointer leaves it). */
30
+ hoverLink(nodeId) {
31
+ this.#linkHover = nodeId;
32
+ }
33
+ /** A canvas node is hovered (`null` when the pointer leaves it). */
34
+ hoverNode(nodeId) {
35
+ this.#nodeHover = nodeId;
36
+ }
37
+ /** The node open in the inspector (`null` when none). */
38
+ setSelected(nodeId) {
39
+ this.#selected = nodeId;
40
+ }
41
+ /**
42
+ * Show a node's last run: select it, open Last run, bring it into view.
43
+ * Returns whether the editor did so (false: no editor, or no such node).
44
+ */
45
+ reveal(nodeId) {
46
+ return this.#reveal?.(nodeId) ?? false;
47
+ }
48
+ /** Register the editor's reveal handler. Returns the unregister function. */
49
+ setRevealHandler(handler) {
50
+ this.#reveal = handler;
51
+ return () => {
52
+ if (this.#reveal === handler)
53
+ this.#reveal = null;
54
+ };
55
+ }
56
+ }
@@ -10,9 +10,15 @@
10
10
  *
11
11
  * @module stores/playgroundStore
12
12
  */
13
- import type { PlaygroundSession, PlaygroundTurnResult, PlaygroundMessage, PlaygroundInputField, PlaygroundSessionStatus, PlaygroundMessagesApiResponse, PlaygroundExecution } from '../types/playground.js';
14
- import type { Workflow, WorkflowInterfaceEntry } from '../types/index.js';
13
+ import type { PlaygroundSession, PlaygroundTurnResult, PlaygroundMessage, PlaygroundInputField, PlaygroundSessionStatus, PlaygroundMessagesApiResponse, PlaygroundExecution, SessionRunsResult, VersionDivider } from '../types/playground.js';
14
+ import type { NodeExecutionInfo, Workflow, WorkflowInterfaceEntry } from '../types/index.js';
15
15
  import { type InterfaceInputsResult, type PlaygroundInputMode } from '../utils/workflowInterface.js';
16
+ import { type ResolvedPlaygroundChat } from '../utils/playgroundChat.js';
17
+ /** Which workflow and run a set of node statuses was loaded for. */
18
+ export interface NodeStatusScope {
19
+ workflowId: string;
20
+ pipelineId: string;
21
+ }
16
22
  /**
17
23
  * Playground mutation actions for a {@link PlaygroundStore}.
18
24
  *
@@ -30,14 +36,20 @@ export interface PlaygroundStoreActions {
30
36
  addMessage: (message: PlaygroundMessage) => void;
31
37
  addMessages: (newMessages: PlaygroundMessage[]) => void;
32
38
  clearMessages: () => void;
39
+ setSessionRuns: (sessionId: string, result: SessionRunsResult | null) => void;
40
+ setVersionDividers: (sessionId: string, items: VersionDivider[]) => void;
41
+ addVersionDivider: (sessionId: string, divider: VersionDivider) => void;
33
42
  setLoading: (loading: boolean) => void;
34
43
  setError: (errorMessage: string | null) => void;
44
+ setLaunchError: (errorMessage: string | null) => void;
35
45
  updateLastPollSequenceNumber: (seq: number) => void;
36
46
  reset: () => void;
37
47
  switchSession: (sessionId: string) => void;
38
48
  pinExecution: (executionId: string | null) => void;
39
49
  setShowLogs: (value: boolean) => void;
40
50
  toggleShowLogs: () => void;
51
+ setExpandSteps: (value: boolean) => void;
52
+ toggleExpandSteps: () => void;
41
53
  setTurnPending: (value: boolean) => void;
42
54
  lockRunUntilEnabled: () => void;
43
55
  releaseRunLock: () => void;
@@ -76,6 +88,8 @@ export declare class PlaygroundStore {
76
88
  get isLoading(): boolean;
77
89
  /** Error state. */
78
90
  get error(): string | null;
91
+ /** The refusal of the last Run click, for the message under Run. */
92
+ get launchError(): string | null;
79
93
  /** The current workflow. */
80
94
  get currentWorkflow(): Workflow | null;
81
95
  /** The last poll sequence number cursor. */
@@ -108,6 +122,13 @@ export declare class PlaygroundStore {
108
122
  * its interface declares no `turn`.
109
123
  */
110
124
  get inputMode(): PlaygroundInputMode;
125
+ /**
126
+ * The chat binding in effect for the current workflow and where it came
127
+ * from (`settings`, the deprecated interface `turn`, or `none`), or `null`
128
+ * when the server sends no Playground settings (before FlowDrop 2.7.0).
129
+ * `source: 'none'` is a workflow with no chat until somebody sets it up.
130
+ */
131
+ get chatBinding(): ResolvedPlaygroundChat | null;
111
132
  /**
112
133
  * The interface inputs a person fills in (inputs without a `turn`), in
113
134
  * interface order. Empty in `legacy` mode: there the node-based
@@ -149,10 +170,44 @@ export declare class PlaygroundStore {
149
170
  * Pass to PipelinePanel's refreshTrigger prop.
150
171
  */
151
172
  get pipelineRefreshTrigger(): number;
173
+ /**
174
+ * Per-node run status for the workflow on the canvas, keyed by node id.
175
+ *
176
+ * This is the single source the node status overlay draws from. It is kept
177
+ * here, off the node data, so an edit to the graph can neither wipe it nor
178
+ * carry it into the saved workflow.
179
+ */
180
+ get nodeStatuses(): Readonly<Record<string, NodeExecutionInfo>>;
181
+ /** The workflow and run the statuses belong to, or null when there are none. */
182
+ get nodeStatusScope(): NodeStatusScope | null;
183
+ /** One node's run status, or undefined when the shown run has none for it. */
184
+ nodeStatusFor(nodeId: string): NodeExecutionInfo | undefined;
185
+ /** Replace all node statuses with those of one run. */
186
+ setNodeStatuses(statuses: Record<string, NodeExecutionInfo>, scope: NodeStatusScope): void;
187
+ /** Forget the node statuses (a different workflow or run is shown, or none). */
188
+ clearNodeStatuses(): void;
152
189
  /** Whether log messages should be shown in the execution console. */
153
190
  get showLogs(): boolean;
191
+ /** Whether each turn's steps start expanded in the conversation. */
192
+ get expandSteps(): boolean;
154
193
  /** The current session ID, or null. */
155
194
  get currentSessionId(): string | null;
195
+ /**
196
+ * The current session's runs from the runs endpoint (oldest first, each
197
+ * stamped with the workflow version it ran), or `null` before the first load
198
+ * and on a server without the endpoint. The one place the list of a
199
+ * session's runs lives: the dividers are derived from it, and "attach a
200
+ * run" lists it.
201
+ */
202
+ get sessionRuns(): SessionRunsResult | null;
203
+ /** The "Saved, new version" dividers of the current session's feed. */
204
+ get versionDividers(): VersionDivider[];
205
+ /** Keep the runs of a session (`null` forgets them). */
206
+ setSessionRuns(sessionId: string, result: SessionRunsResult | null): void;
207
+ /** Replace a session's dividers. */
208
+ setVersionDividers(sessionId: string, items: VersionDivider[]): void;
209
+ /** Add a divider to a session's feed; one with the same id is not added twice. */
210
+ addVersionDivider(sessionId: string, divider: VersionDivider): void;
156
211
  /** Whether older messages exist before the oldest one currently loaded. */
157
212
  get hasOlder(): boolean;
158
213
  /**
@@ -197,6 +252,8 @@ export declare class PlaygroundStore {
197
252
  setLoading(loading: boolean): void;
198
253
  /** Set an error message (or null to clear). */
199
254
  setError(errorMessage: string | null): void;
255
+ /** Set the Run click's refusal (or null to clear). */
256
+ setLaunchError(errorMessage: string | null): void;
200
257
  /** Update the last poll cursor. */
201
258
  updateLastPollSequenceNumber(seq: number): void;
202
259
  /** Reset all playground state. */
@@ -209,6 +266,10 @@ export declare class PlaygroundStore {
209
266
  setShowLogs(value: boolean): void;
210
267
  /** Toggle log message visibility. */
211
268
  toggleShowLogs(): void;
269
+ /** Set whether turns' steps start expanded. */
270
+ setExpandSteps(value: boolean): void;
271
+ /** Toggle whether turns' steps start expanded. */
272
+ toggleExpandSteps(): void;
212
273
  /** Mark a turn request as in flight (or finished). */
213
274
  setTurnPending(value: boolean): void;
214
275
  /**
@@ -242,6 +303,17 @@ export declare class PlaygroundStore {
242
303
  * backward-pagination response.
243
304
  */
244
305
  setHasOlder(hasOlder: boolean): void;
306
+ /**
307
+ * Listen for session status changes, synchronously.
308
+ *
309
+ * Unlike {@link subscribeToSessionStatus}, which rides an effect and so
310
+ * batches (two changes inside one flush read as one, or as none), the
311
+ * listener runs inside the write that changed the status: once per real
312
+ * change, in order, at the moment it happened. Cleared by {@link dispose}.
313
+ *
314
+ * @returns Function that removes the listener
315
+ */
316
+ onSessionStatusChange(listener: (status: PlaygroundSessionStatus, previous: PlaygroundSessionStatus) => void): () => void;
245
317
  /**
246
318
  * Subscribe to session status changes using $effect.root.
247
319
  * This is designed for use in non-component contexts (e.g., mount.ts).