@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
@@ -7,18 +7,41 @@
7
7
  <script lang="ts">
8
8
  import type { ContextMenuOptions } from '../editor/contextMenu.js';
9
9
  import { onMount, tick, untrack } from 'svelte';
10
+ import { MediaQuery } from 'svelte/reactivity';
11
+ import { on } from 'svelte/events';
10
12
  import MainLayout from './layouts/MainLayout.svelte';
11
13
  import WorkflowEditor from './WorkflowEditor.svelte';
12
14
  import NodeSidebar from './NodeSidebar.svelte';
15
+ import DockedPlayground from './playground/DockedPlayground.svelte';
13
16
  import CanvasIconButton from './CanvasIconButton.svelte';
17
+ import IconButton from './primitives/IconButton.svelte';
14
18
  import EditorStatusBar from './EditorStatusBar.svelte';
15
19
  import MenuIcon from './icons/MenuIcon.svelte';
16
20
  import MenuOpenIcon from './icons/MenuOpenIcon.svelte';
17
21
  import ConfigForm from './ConfigForm.svelte';
22
+ import NodeInspector from './NodeInspector.svelte';
23
+ import WorkflowSettingsPanel from './WorkflowSettingsPanel.svelte';
18
24
  import ConfigPanel from './ConfigPanel.svelte';
19
25
  import WorkflowInterfaceEditor from './WorkflowInterfaceEditor.svelte';
26
+ import WorkflowPlaygroundSettings from './WorkflowPlaygroundSettings.svelte';
27
+ import { withPlaygroundChat, withoutInterfaceTurns } from '../utils/playgroundChat.js';
20
28
  import ReadOnlyDetails from './ReadOnlyDetails.svelte';
21
29
  import CommandConsole from './console/CommandConsole.svelte';
30
+ import ConsoleStrip from './console/ConsoleStrip.svelte';
31
+ import {
32
+ resolveSidebarWidths,
33
+ SIDEBAR_MIN_WIDTH,
34
+ SIDEBAR_MAX_WIDTH,
35
+ SIDEBAR_MAX_RATIO,
36
+ clampSidebarWidth
37
+ } from '../utils/sidebarWidths.js';
38
+ import {
39
+ resolveWorkflowSheetWidth,
40
+ clampSheetWidth,
41
+ sheetMaxWidth,
42
+ SHEET_MIN_WIDTH,
43
+ SHEET_KEY_STEP
44
+ } from '../utils/sheetWidths.js';
22
45
  import AIChatPanel from './chat/AIChatPanel.svelte';
23
46
  import TabbedSurface from './surfaces/TabbedSurface.svelte';
24
47
  import type { Snippet } from 'svelte';
@@ -28,7 +51,8 @@
28
51
  import NodeSwapPicker from './NodeSwapPicker.svelte';
29
52
  import SwapMappingEditor from './SwapMappingEditor.svelte';
30
53
  import Navbar from './Navbar.svelte';
31
- import type { NavbarAction } from '../types/navbar.js';
54
+ import DoctorMenu from './DoctorMenu.svelte';
55
+ import type { NavbarAction, NavbarBranding } from '../types/navbar.js';
32
56
  import type { NodeMetadata, Workflow, WorkflowNode, ConfigSchema } from '../types/index.js';
33
57
  import type { InteractiveSwapState, SwapEventContext } from '../utils/nodeSwap.js';
34
58
  import {
@@ -45,7 +69,7 @@
45
69
  import type { FlowDropEventHandlers, FlowDropFeatures } from '../types/events.js';
46
70
  import { mergeFeatures } from '../types/events.js';
47
71
  import type { FlowDropTheme, FlowDropThemeName } from '../types/theme.js';
48
- import type { FlowDropSkinTokens } from '../types/skin.js';
72
+ import { buildScopedSkinCss, toScopeId } from '../themes/scopedSkinCss.js';
49
73
  import { resolveTheme } from '../themes/index.js';
50
74
  import { provideInstance } from '../stores/getInstance.svelte.js';
51
75
  import type { FlowDropInstance } from '../stores/instanceContainer.svelte.js';
@@ -59,9 +83,17 @@
59
83
  initializeTheme
60
84
  } from '../stores/settingsStore.svelte.js';
61
85
  import { logger } from '../utils/logger.js';
86
+ import { themeScope } from '../utils/themeScope.svelte.js';
87
+ import {
88
+ resolveInspectorSurface,
89
+ closeTarget,
90
+ openingNodeTab,
91
+ type NodeInspectorTab
92
+ } from '../utils/inspectorSurface.js';
62
93
  import { validateWorkflowData } from '../utils/validation.js';
63
94
  import type { SettingsCategory, SurfacePlacement } from '../types/settings.js';
64
- import { defaultMessages, mergeMessages, setMessages } from '../messages/index.js';
95
+ import type { EditorMode } from '../stores/editorModeStore.svelte.js';
96
+ import { defaultMessages, mergeMessages, setMessages, m } from '../messages/index.js';
65
97
  import type { MessagesOverride } from '../messages/index.js';
66
98
 
67
99
  /**
@@ -88,7 +120,7 @@
88
120
  */
89
121
  configPlacement?: SurfacePlacement;
90
122
  /**
91
- * Default host for the console / AI Assistant group. Seeds the user setting
123
+ * Default host for the Command Console (the AI Assistant is a tab beside Nodes in the left slot). Seeds the user setting
92
124
  * on first load — a value the user later changes wins.
93
125
  * @default 'below'
94
126
  */
@@ -116,6 +148,27 @@
116
148
  * @default 'edit'
117
149
  */
118
150
  mode?: 'edit' | 'readonly' | 'locked';
151
+ /**
152
+ * Start in, or switch to, Test mode: the Playground docked beside the
153
+ * canvas, which keeps the rest of the width (a node opens its inspector as a
154
+ * sheet over it). A second axis beside `mode`: it
155
+ * only takes effect on an editable canvas (`mode: 'edit'`) with a saved
156
+ * workflow and no `pipelineId`, and `features.testMode` not off.
157
+ *
158
+ * Seeds `instance.editorMode`, the per-instance store that is the source
159
+ * of truth afterwards (the canvas toolbar's Edit | Test switch writes it, and so
160
+ * can a host: `instance.editorMode.set('test')`). A later change of this
161
+ * prop sets the store again.
162
+ *
163
+ * @default 'edit'
164
+ */
165
+ editorMode?: EditorMode;
166
+ /**
167
+ * Called when the Edit | Test mode changes after mount (the canvas toolbar switch,
168
+ * the T shortcut, the run pill's "Open", `instance.editorMode.set`). Not called for the
169
+ * initial value. A host uses it to keep its URL in step.
170
+ */
171
+ onEditorModeChange?: (mode: EditorMode) => void;
119
172
  /** Pipeline ID for fetching node execution info */
120
173
  pipelineId?: string;
121
174
  /** Increments to force a refresh of pipeline node status from the server */
@@ -124,6 +177,8 @@
124
177
  navbarTitle?: string;
125
178
  /** Custom navbar actions */
126
179
  navbarActions?: NavbarAction[];
180
+ /** White-label logo for the navbar (replaces the FlowDrop wordmark) */
181
+ branding?: NavbarBranding;
127
182
  /** Show settings gear icon in navbar */
128
183
  showSettings?: boolean;
129
184
  /** Show the "Connected" status indicator in the navbar (default: true) */
@@ -203,10 +258,13 @@
203
258
  configPlacement: configPlacementProp,
204
259
  consolePlacement: consolePlacementProp,
205
260
  mode = 'edit',
261
+ editorMode: editorModeProp,
262
+ onEditorModeChange,
206
263
  pipelineId,
207
264
  refreshTrigger = 0,
208
265
  navbarTitle,
209
266
  navbarActions = [],
267
+ branding,
210
268
  showSettings = true,
211
269
  showStatus = true,
212
270
  apiBaseUrl,
@@ -242,11 +300,127 @@
242
300
  // svelte-ignore state_referenced_locally
243
301
  const features = mergeFeatures(propFeatures);
244
302
 
303
+ // Test mode: the `editorMode` prop seeds the instance's store (the source of
304
+ // truth from then on); a later change of the prop sets it again. Setting the
305
+ // value it already holds changes nothing, so the first run is harmless.
306
+ // svelte-ignore state_referenced_locally
307
+ if (editorModeProp) fd.editorMode.set(editorModeProp);
308
+ $effect.pre(() => {
309
+ const requested = editorModeProp;
310
+ if (requested) untrack(() => fd.editorMode.set(requested));
311
+ });
312
+
313
+ // Tell the host when the mode moves. The listener is added after the seed,
314
+ // so the value the editor started with is never reported; the callback is
315
+ // read when it fires, so a changed callback prop is the one used.
316
+ onMount(() => fd.editorMode.onChange((mode) => onEditorModeChange?.(mode)));
317
+
245
318
  // `mode` is the public API; internally the canvas only cares whether editing
246
319
  // is disabled. 'readonly' and 'locked' both disable the same interactions
247
320
  // (see the `mode` prop JSDoc for the full matrix).
248
321
  const canvasEditable = $derived(mode === 'edit');
249
322
 
323
+ /**
324
+ * Test mode can be entered: it is offered, the canvas is editable, this is
325
+ * not a pipeline view, and the workflow is saved (the Playground runs the
326
+ * saved workflow's id).
327
+ */
328
+ const testModeAvailable = $derived(
329
+ features.testMode && canvasEditable && !pipelineId && !!fd.workflow.current?.id
330
+ );
331
+ /** Test mode is in effect: requested, and available. */
332
+ const testMode = $derived(testModeAvailable && fd.editorMode.isTest);
333
+ const effectiveEditorMode = $derived<EditorMode>(testMode ? 'test' : 'edit');
334
+
335
+ /** Narrow screens: the Playground is a drawer over the canvas, not a column. */
336
+ const narrowQuery = new MediaQuery('(max-width: 1199px)');
337
+ const narrow = $derived(narrowQuery.current);
338
+ /** Entering Test mode opens the Playground drawer; the person can still close it. */
339
+ let drawerOpen = $derived(testMode);
340
+
341
+ /** The node library popover of Test mode (N). */
342
+ let libraryOpen = $state(false);
343
+ let libraryEl = $state<HTMLElement | null>(null);
344
+ $effect(() => {
345
+ if (!testMode) libraryOpen = false;
346
+ });
347
+ $effect(() => {
348
+ if (!libraryOpen) return;
349
+ const closeOnOutside = (event: PointerEvent) => {
350
+ if (libraryEl && !libraryEl.contains(event.target as Node)) libraryOpen = false;
351
+ };
352
+ return on(window, 'pointerdown', closeOnOutside, { capture: true });
353
+ });
354
+ function toggleLibrary(): void {
355
+ libraryOpen = !libraryOpen;
356
+ if (libraryOpen) {
357
+ void tick().then(() =>
358
+ libraryEl?.querySelector<HTMLInputElement>('.flowdrop-sidebar__search input')?.focus()
359
+ );
360
+ }
361
+ }
362
+
363
+ // Badges follow a run while it is watched, and this effect is the one owner
364
+ // of loading them (through the coalesced fd.runs.requestNodeStatuses): in
365
+ // Test mode always (the shown run, live or finished), in Edit mode while a
366
+ // run exists (live, or ended and still on the run bar, whose fade drops it).
367
+ // They are dropped when neither holds, so Edit mode at rest has none.
368
+ const followRun = $derived(
369
+ !pipelineId && (testMode || fd.runs.activeRun !== null || fd.runs.isLive)
370
+ );
371
+ const EDIT_STATUS_REFRESH_MS = 1500;
372
+ /**
373
+ * Changes whenever the shown run's node statuses may have moved; null when no
374
+ * run is followed. Built from the shown run, its status (a host run changes
375
+ * nothing else) and every batch of new messages.
376
+ */
377
+ const runStatusKey = $derived(
378
+ followRun
379
+ ? [
380
+ fd.playground.activeExecutionId,
381
+ fd.playground.sessionStatus,
382
+ fd.playground.pipelineRefreshTrigger,
383
+ fd.runs.activeRun?.runId,
384
+ fd.runs.activeRun?.status
385
+ ].join('|')
386
+ : null
387
+ );
388
+ $effect(() => {
389
+ if (runStatusKey === null) return;
390
+ untrack(() => fd.runs.requestNodeStatuses());
391
+ });
392
+ // Edit mode has no Playground poll to ride on (and a host run has none at
393
+ // all), so while a run is live the badges are also asked for on a timer.
394
+ $effect(() => {
395
+ if (!followRun || testMode || !fd.runs.isLive) return;
396
+ const timer = setInterval(() => fd.runs.requestNodeStatuses(), EDIT_STATUS_REFRESH_MS);
397
+ return () => clearInterval(timer);
398
+ });
399
+ $effect(() => {
400
+ if (!followRun) return;
401
+ return () => fd.runs.clearNodeStatuses();
402
+ });
403
+ // `edited` marks: shown in Test mode only. The baseline is taken when a run
404
+ // is first seen (live or opened), before any statuses load, so edits made
405
+ // while its statuses are still loading count.
406
+ $effect(() => {
407
+ fd.editedNodes.setVisible(testMode);
408
+ });
409
+ $effect(() => {
410
+ void fd.workflow.current?.id;
411
+ const runId = fd.runs.activeRun?.runId ?? fd.playground.activeExecutionId ?? null;
412
+ untrack(() => fd.editedNodes.track(pipelineId ? null : runId));
413
+ });
414
+ // Crossing between Edit and Test drops a run that has already ended, so the
415
+ // bar does not come back stale. A live run keeps its state.
416
+ $effect(() => {
417
+ void testMode;
418
+ untrack(() => {
419
+ const run = fd.runs.activeRun;
420
+ if (run && run.endedAt !== null) fd.runs.dismissRun();
421
+ });
422
+ });
423
+
250
424
  // Messages: merge consumer overrides over defaults; expose via context as a
251
425
  // getter so consumer-side reactivity (e.g. paraglide-js locale switches)
252
426
  // propagates into every child without a subscription. Accepts either a
@@ -269,7 +443,7 @@
269
443
  {
270
444
  label: mergedMessages.navigation.save,
271
445
  href: '#save',
272
- icon: 'heroicons:document-arrow-down',
446
+ icon: 'mdi:file-download-outline',
273
447
  variant: 'primary' as const,
274
448
  onclick: (e: Event) => {
275
449
  e.preventDefault();
@@ -279,7 +453,7 @@
279
453
  {
280
454
  label: mergedMessages.navigation.export,
281
455
  href: '#export',
282
- icon: 'heroicons:arrow-down-tray',
456
+ icon: 'mdi:download',
283
457
  variant: 'outline' as const,
284
458
  onclick: (e: Event) => {
285
459
  e.preventDefault();
@@ -289,22 +463,12 @@
289
463
  {
290
464
  label: mergedMessages.navigation.import,
291
465
  href: '#import',
292
- icon: 'heroicons:arrow-up-tray',
466
+ icon: 'mdi:upload',
293
467
  variant: 'outline' as const,
294
468
  onclick: (e: Event) => {
295
469
  e.preventDefault();
296
470
  fileInputRef?.click();
297
471
  }
298
- },
299
- {
300
- label: mergedMessages.navigation.workflowSettings,
301
- href: '#settings',
302
- icon: 'heroicons:cog-6-tooth',
303
- variant: 'outline' as const,
304
- onclick: (e: Event) => {
305
- e.preventDefault();
306
- toggleWorkflowSettings();
307
- }
308
472
  }
309
473
  ]);
310
474
 
@@ -313,29 +477,37 @@
313
477
  let resolvedTheme = $derived(resolveTheme(themeProp ?? getUiSettings().theme));
314
478
  let themeConfig = $derived(resolvedTheme.config);
315
479
 
316
- // Inject skin tokens as a style tag so light/dark palettes can coexist.
317
- // tokens → :root { ... } (light mode / base)
318
- // darkTokens → [data-theme='dark'] { ... } (dark mode override)
319
- // The tag is appended after tokens.css so it wins via source order.
480
+ // Skin tokens are scoped to this instance (data-fd-scope on .flowdrop-root,
481
+ // copied onto portalled overlays), so two editors with different skins do
482
+ // not overwrite each other and the host page gets no --fd-* variables.
483
+ // See themes/scopedSkinCss.ts. The colour scheme is `data-theme` on this scope element (use:themeScope),
484
+ // not on <html>.
485
+ // One cleaned value for the attribute, the skin rule and fd.skinScope.
486
+ const rawScopeId = $props.id();
487
+ const scopeId = toScopeId(rawScopeId);
488
+
489
+ // Publish the scope on the instance so overlays mounted outside this tree
490
+ // (the WebMCP approval dialog) can carry it. Cleared only if still ours.
320
491
  $effect(() => {
321
- const skin = resolvedTheme.skin;
322
- const tokens = skin?.tokens;
323
- const darkTokens = skin?.darkTokens;
324
- if ((!tokens && !darkTokens) || typeof document === 'undefined') return;
325
-
326
- const toRules = (dict: FlowDropSkinTokens) =>
327
- Object.entries(dict)
328
- .map(([k, v]) => ` --fd-${k}: ${v};`)
329
- .join('\n');
492
+ fd.skinScope = scopeId;
493
+ return () => {
494
+ if (fd.skinScope === scopeId) fd.skinScope = null;
495
+ };
496
+ });
330
497
 
331
- let css = '';
332
- if (tokens) css += `:root {\n${toRules(tokens)}\n}\n`;
333
- if (darkTokens) css += `[data-theme='dark'] {\n${toRules(darkTokens)}\n}\n`;
498
+ $effect(() => {
499
+ if (typeof document === 'undefined') return;
500
+ // The user's Compact Mode hides node descriptions in every theme.
501
+ const display = getUiSettings().compactMode
502
+ ? { ...themeConfig?.display, nodeDetails: 'compact' as const }
503
+ : themeConfig?.display;
504
+ const css = buildScopedSkinCss(scopeId, resolvedTheme.skin, display);
505
+ if (!css) return;
334
506
 
335
507
  const style = document.createElement('style');
336
- style.id = 'fd-skin-tokens';
337
- document.head.appendChild(style);
508
+ style.setAttribute('data-fd-skin', scopeId);
338
509
  style.textContent = css;
510
+ document.head.appendChild(style);
339
511
 
340
512
  return () => style.remove();
341
513
  });
@@ -377,7 +549,16 @@
377
549
  // Inner tab within the workflow-settings surface — see Phase 3 of
378
550
  // `.claude/plans/workflow-interface.md`. Settings and the interface editor
379
551
  // are two tabs of one surface, not a field inside the settings form.
380
- let workflowSettingsTab = $state<'settings' | 'interface'>('settings');
552
+ let workflowSettingsTab = $state<'settings' | 'interface' | 'playground'>('settings');
553
+ // The Playground tab exists only while the workflow carries Playground
554
+ // settings; a workflow loaded without them shows Settings. Derived rather
555
+ // than reset, so there is no frame with the Playground tab picked and
556
+ // nothing shown, and the pick comes back with a workflow that has them.
557
+ const activeWorkflowSettingsTab = $derived(
558
+ workflowSettingsTab === 'playground' && fd.workflow.current?.playground === undefined
559
+ ? 'settings'
560
+ : workflowSettingsTab
561
+ );
381
562
 
382
563
  // Which surface (`config` | `console` | `chat`) is focused in its host. A
383
564
  // single selector across hosts: each TabbedSurface highlights this id when it
@@ -385,6 +566,23 @@
385
566
  // focuses it wherever it lives (sidebar/modal/below).
386
567
  let activeSurface = $state<string>(getUiSettings().bottomPanelTab);
387
568
 
569
+ // Entering Test mode, or loading into it with `?mode=test`, starts with no
570
+ // inspector: the canvas has the room, and a node opens its sheet. Whatever
571
+ // surface was last focused (the persisted Console tab, say) is reset to the
572
+ // config, and Edit mode's workflow tabs do not carry over. Later picks of
573
+ // the Console stick.
574
+ $effect.pre(() => {
575
+ if (testMode)
576
+ untrack(() => {
577
+ activeSurface = 'config';
578
+ isWorkflowSettingsOpen = false;
579
+ });
580
+ });
581
+
582
+ // Edit mode's left slot: Nodes | Assistant. Both stay mounted, so the
583
+ // conversation survives tab switches and a trip through Test mode.
584
+ let leftTab = $state<'nodes' | 'assistant'>('nodes');
585
+
388
586
  // Node swap state
389
587
  let swapMode = $state<'idle' | 'picking' | 'mapping'>('idle');
390
588
  let swapInteractiveState = $state<InteractiveSwapState | null>(null);
@@ -392,7 +590,13 @@
392
590
  // Built-in workflow settings field names — consumer schemas must not reuse these.
393
591
  // 'interface' is reserved too: it names `Workflow.interface`'s own tab, not a
394
592
  // workflowSettingsSchema field, but a consumer schema could still collide.
395
- const WORKFLOW_SETTINGS_RESERVED = new Set(['name', 'description', 'format', 'interface']);
593
+ const WORKFLOW_SETTINGS_RESERVED = new Set([
594
+ 'name',
595
+ 'description',
596
+ 'format',
597
+ 'interface',
598
+ 'playground'
599
+ ]);
396
600
 
397
601
  // Registered formats this host offers — the mount-level `workflowFormats`
398
602
  // allowlist filters the registry (an unknown id filters to nothing rather
@@ -425,13 +629,11 @@
425
629
  name: {
426
630
  type: 'string',
427
631
  title: 'Workflow Name',
428
- description: 'The name of the workflow',
429
632
  default: ''
430
633
  },
431
634
  description: {
432
635
  type: 'string',
433
636
  title: 'Description',
434
- description: 'A description of the workflow',
435
637
  format: 'multiline',
436
638
  default: ''
437
639
  },
@@ -628,12 +830,29 @@
628
830
  }
629
831
  selectedNodeId = node.id;
630
832
  isConfigSidebarOpen = true;
833
+ isWorkflowSettingsOpen = false;
631
834
  activeSurface = 'config';
632
835
  // Reset swap state when switching nodes
633
836
  swapMode = 'idle';
634
837
  swapInteractiveState = null;
635
838
  }
636
839
 
840
+ /**
841
+ * Test mode: a node was clicked (or double-clicked). Its sheet opens on Last
842
+ * run, or, if another node's sheet is open, switches to this node. Unlike
843
+ * `openConfigSidebar` it never toggles, so the double-click that follows a
844
+ * click does not close what the click opened.
845
+ */
846
+ function showNodeSheet(node: Pick<WorkflowNode, 'id'>): void {
847
+ if (isConfigSidebarOpen && selectedNodeId === node.id) return;
848
+ selectedNodeId = node.id;
849
+ isConfigSidebarOpen = true;
850
+ isWorkflowSettingsOpen = false;
851
+ activeSurface = 'config';
852
+ swapMode = 'idle';
853
+ swapInteractiveState = null;
854
+ }
855
+
637
856
  function closeConfigSidebar(): void {
638
857
  isConfigSidebarOpen = false;
639
858
  selectedNodeId = null;
@@ -642,6 +861,71 @@
642
861
  swapInteractiveState = null;
643
862
  }
644
863
 
864
+ // Which tab the open node shows. Picked when the node opens (Last run in Test
865
+ // mode, else Config) and kept until another node opens, so a node that starts
866
+ // running under the cursor does not change the tab by itself: the only
867
+ // dependency is the selected node, the mode is read untracked. The person's pick is a plain assignment. Edit
868
+ // mode always resolves to Config (`NodeInspector`).
869
+ let nodeInspectorTab = $derived<NodeInspectorTab>(
870
+ selectedNodeId ? untrack(() => openingNodeTab(effectiveEditorMode)) : 'config'
871
+ );
872
+
873
+ // Messages and canvas nodes light each other up through fd.highlight; the
874
+ // open node is the "selected" one.
875
+ $effect(() => {
876
+ fd.highlight.setSelected(selectedNodeForConfig?.id ?? null);
877
+ return () => fd.highlight.setSelected(null);
878
+ });
879
+
880
+ /**
881
+ * A message's node link was clicked: select the node, open its Last run and
882
+ * bring it into view. Only on request (this is the one place the view moves
883
+ * for a run). False when this is not Test mode or the node is gone.
884
+ */
885
+ function revealNodeLastRun(nodeId: string): boolean {
886
+ const node = fd.workflow.current?.nodes.find((n) => n.id === nodeId);
887
+ if (!testMode || !node) return false;
888
+ // Select first: assigning the node afterwards would recompute the tab.
889
+ selectedNodeId = nodeId;
890
+ nodeInspectorTab = 'lastRun';
891
+ isConfigSidebarOpen = true;
892
+ isWorkflowSettingsOpen = false;
893
+ activeSurface = 'config';
894
+ swapMode = 'idle';
895
+ swapInteractiveState = null;
896
+ workflowEditorRef?.canvasFocusNode(nodeId);
897
+ return true;
898
+ }
899
+ $effect(() => fd.highlight.setRevealHandler(revealNodeLastRun));
900
+
901
+ /**
902
+ * A problem's node name was clicked: select the node (its inspector opens)
903
+ * and bring it into view. Unlike a toggle, repeating it keeps it open.
904
+ */
905
+ function focusProblemNode(nodeId: string): boolean {
906
+ const node = fd.workflow.current?.nodes.find((n) => n.id === nodeId);
907
+ if (!node) return false;
908
+ selectedNodeId = nodeId;
909
+ isConfigSidebarOpen = true;
910
+ isWorkflowSettingsOpen = false;
911
+ activeSurface = 'config';
912
+ swapMode = 'idle';
913
+ swapInteractiveState = null;
914
+ workflowEditorRef?.canvasFocusNode(nodeId);
915
+ return true;
916
+ }
917
+ $effect(() => fd.doctor.setFocusHandler(focusProblemNode));
918
+
919
+ // The Doctor diagnoses the draft a moment after each edit, and on load (and
920
+ // once the workflow has an id). Reading the version and the id is the trigger.
921
+ $effect(() => {
922
+ void fd.workflow.editVersion;
923
+ void fd.workflow.id;
924
+ // The endpoints are configured after mount; their arrival is a trigger too.
925
+ void endpointConfig;
926
+ untrack(() => fd.doctor.schedule());
927
+ });
928
+
645
929
  /**
646
930
  * Toggle workflow settings sidebar
647
931
  */
@@ -654,6 +938,19 @@
654
938
  }
655
939
  }
656
940
 
941
+ /**
942
+ * Show the workflow's Playground settings: the workflow tabs with the
943
+ * Playground tab selected, as the workflow-settings surface (in Test mode,
944
+ * the inspector sheet). The docked Playground links here.
945
+ */
946
+ function openPlaygroundSettings(): void {
947
+ if (fd.workflow.current?.playground === undefined) return;
948
+ workflowSettingsTab = 'playground';
949
+ closeConfigSidebar();
950
+ isWorkflowSettingsOpen = true;
951
+ activeSurface = 'config';
952
+ }
953
+
657
954
  /**
658
955
  * Start swap mode — transitions the right sidebar to the node picker
659
956
  */
@@ -662,6 +959,14 @@
662
959
  swapInteractiveState = null;
663
960
  }
664
961
 
962
+ /** Swap from the canvas context menu: open the node's panel in the picker. */
963
+ function swapFromCanvas(nodeId: string): void {
964
+ selectedNodeId = nodeId;
965
+ isConfigSidebarOpen = true;
966
+ activeSurface = 'config';
967
+ startSwap();
968
+ }
969
+
665
970
  /**
666
971
  * Handle selection of a target node type for swap
667
972
  */
@@ -814,11 +1119,11 @@
814
1119
  }
815
1120
  });
816
1121
 
817
- async function saveWorkflow(): Promise<void> {
1122
+ async function saveWorkflow(): Promise<boolean> {
818
1123
  // Commit any in-flight config edit so the save and its history are
819
1124
  // consistent (the value itself is already live in the store).
820
1125
  flushNodeConfigEdit();
821
- await globalSaveWorkflow({
1126
+ return globalSaveWorkflow({
822
1127
  eventHandlers: { onBeforeSave, onAfterSave, onSaveError, onApiError },
823
1128
  features,
824
1129
  instance: fd,
@@ -900,7 +1205,15 @@
900
1205
  function handleCanvasClick(event: MouseEvent): void {
901
1206
  // Check if the click is outside the right sidebar
902
1207
  const rightSidebar = document.querySelector('.flowdrop-main-layout__sidebar--right');
903
- if (rightSidebar && !rightSidebar.contains(event.target as Node)) {
1208
+ // Test mode's inspector sheet sits inside the canvas region: a click in it is not a pane click.
1209
+ if ((event.target as Element).closest?.('.inspector-sheet')) return;
1210
+ // In Test mode only a click on empty canvas closes the sheet (not a node, not a control).
1211
+ const target = event.target as Element;
1212
+ if (
1213
+ testMode
1214
+ ? !!target.closest?.('.svelte-flow__pane') && !target.closest('.svelte-flow__node')
1215
+ : rightSidebar && !rightSidebar.contains(event.target as Node)
1216
+ ) {
904
1217
  // Close sidebar when clicking outside of it
905
1218
  if (isConfigSidebarOpen) {
906
1219
  closeConfigSidebar();
@@ -997,26 +1310,109 @@
997
1310
  // Surface placement — where the config panel and console/chat are hosted.
998
1311
  // =========================================================================
999
1312
 
1000
- const configPlacement = $derived(getUiSettings().configPlacement);
1001
- const consolePlacement = $derived(getUiSettings().consolePlacement);
1313
+ // Test mode shows the inspector as a sheet over the canvas, whatever
1314
+ // placement the person chose for Edit mode: no column, so the canvas keeps
1315
+ // the width. Workflow settings are a sheet in both modes: the person's
1316
+ // placement is for node settings.
1317
+ const configPlacement = $derived<SurfacePlacement | 'sheet'>(
1318
+ testMode || (!selectedNodeForConfig && isWorkflowSettingsOpen)
1319
+ ? 'sheet'
1320
+ : getUiSettings().configPlacement
1321
+ );
1322
+
1323
+ /** The canvas region's width, for clamping the workflow sheet. */
1324
+ let regionWidth = $state(0);
1325
+ /** The canvas region, to measure how much of it a sheet covers. */
1326
+ let editorMainEl = $state<HTMLElement | null>(null);
1327
+ /** Width while the workflow sheet's left edge is being dragged; `null` otherwise. */
1328
+ let liveSheetWidth = $state<number | null>(null);
1329
+ const workflowSheetWidth = $derived(
1330
+ liveSheetWidth ?? resolveWorkflowSheetWidth(getUiSettings(), regionWidth)
1331
+ );
1332
+ const workflowSheetMax = $derived(sheetMaxWidth(regionWidth));
1333
+ let sheetDrag: { startX: number; startWidth: number } | null = null;
1334
+
1335
+ function saveWorkflowSheetWidth(width: number): void {
1336
+ updateSettings({ ui: { sheetWidths: { workflow: clampSheetWidth(width, regionWidth) } } });
1337
+ }
1338
+ function onSheetResizeDown(event: PointerEvent): void {
1339
+ if (event.button !== 0) return;
1340
+ sheetDrag = { startX: event.clientX, startWidth: workflowSheetWidth };
1341
+ (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);
1342
+ event.preventDefault();
1343
+ }
1344
+ function onSheetResizeMove(event: PointerEvent): void {
1345
+ if (!sheetDrag) return;
1346
+ // The handle is on the left edge: dragging left makes the sheet wider.
1347
+ liveSheetWidth = clampSheetWidth(
1348
+ sheetDrag.startWidth + (sheetDrag.startX - event.clientX),
1349
+ regionWidth
1350
+ );
1351
+ }
1352
+ function onSheetResizeUp(): void {
1353
+ if (!sheetDrag) return;
1354
+ sheetDrag = null;
1355
+ if (liveSheetWidth !== null) saveWorkflowSheetWidth(liveSheetWidth);
1356
+ liveSheetWidth = null;
1357
+ }
1358
+ function onSheetResizeKey(event: KeyboardEvent): void {
1359
+ const step = event.shiftKey ? SHEET_KEY_STEP * 3 : SHEET_KEY_STEP;
1360
+ let next: number | null = null;
1361
+ // Arrow left moves the left edge left, so the sheet grows.
1362
+ if (event.key === 'ArrowLeft') next = workflowSheetWidth + step;
1363
+ else if (event.key === 'ArrowRight') next = workflowSheetWidth - step;
1364
+ else if (event.key === 'Home') next = SHEET_MIN_WIDTH;
1365
+ else if (event.key === 'End') next = workflowSheetMax;
1366
+ if (next === null) return;
1367
+ event.preventDefault();
1368
+ event.stopPropagation();
1369
+ saveWorkflowSheetWidth(next);
1370
+ }
1371
+
1372
+ /** How much of the canvas's right side an open sheet covers, for fit view. */
1373
+ function fitInset(): number {
1374
+ const sheet = editorMainEl?.querySelector('.inspector-sheet');
1375
+ if (!editorMainEl || !sheet) return 0;
1376
+ return Math.max(
1377
+ 0,
1378
+ editorMainEl.getBoundingClientRect().right - sheet.getBoundingClientRect().left
1379
+ );
1380
+ }
1381
+ // Test mode has no right column, so a Console placed in the sidebar uses the
1382
+ // bottom panel there; Edit mode keeps the person's placement.
1383
+ const consolePlacement = $derived<SurfacePlacement>(
1384
+ testMode && getUiSettings().consolePlacement === 'sidebar'
1385
+ ? 'below'
1386
+ : getUiSettings().consolePlacement
1387
+ );
1002
1388
 
1003
1389
  /** Config surface has something to show (node config or workflow settings). */
1004
1390
  const configActive = $derived(isWorkflowSettingsOpen || !!selectedNodeForConfig);
1005
1391
  /** The Command Console tab is offered by this mount. */
1006
1392
  const consoleTabOffered = features.console;
1007
- /** The AI Assistant tab is offered: switched on, and a chat backend exists. */
1393
+ /** The AI Assistant is offered: switched on, and a chat backend exists. */
1008
1394
  const chatTabOffered = $derived(
1009
1395
  features.assistant && endpointConfig?.endpoints?.chat !== undefined
1010
1396
  );
1011
- /** At least one surface of the console/chat group is offered. */
1012
- const consoleGroupOffered = $derived(consoleTabOffered || chatTabOffered);
1013
- /** Console/chat group is available (offered, editable canvas, console toggled open). */
1397
+ /**
1398
+ * The Assistant lives in the left slot, as a tab beside Nodes (Edit mode).
1399
+ * A host that disabled the sidebar has no left slot, so the Assistant keeps
1400
+ * its old place in the console group for it (until 3.0). Test mode has no
1401
+ * Assistant at all: it is the Edit-mode helper.
1402
+ */
1403
+ const chatInConsoleGroup = $derived(chatTabOffered && disableSidebar && !testMode);
1404
+ /** The Assistant is a tab beside Nodes in the left slot. */
1405
+ const chatInLeftSlot = $derived(chatTabOffered && !chatInConsoleGroup);
1406
+ /** At least one surface of the console group is offered. */
1407
+ const consoleGroupOffered = $derived(consoleTabOffered || chatInConsoleGroup);
1408
+ /** Console group is available (offered, editable canvas, console toggled open). */
1014
1409
  const consoleActive = $derived(
1015
1410
  consoleGroupOffered && getUiSettings().consoleOpen && canvasEditable
1016
1411
  );
1017
1412
 
1018
1413
  /**
1019
- * The console-group tabs this mount offers, for whichever host renders them.
1414
+ * The console-group tabs this mount offers, for whichever host renders them:
1415
+ * the Console, plus the Assistant only where there is no left slot for it.
1020
1416
  * Snippets are passed in because they are declared in the template.
1021
1417
  */
1022
1418
  function consoleGroupTabs(consoleBody: Snippet, chatBody: Snippet): SurfaceTab[] {
@@ -1031,11 +1427,15 @@
1031
1427
  }
1032
1428
  ]
1033
1429
  : []),
1034
- ...(chatTabOffered
1430
+ ...(chatInConsoleGroup
1035
1431
  ? [{ id: 'chat', label: mergedMessages.navigation.bottomPanel.chat, content: chatBody }]
1036
1432
  : [])
1037
1433
  ];
1038
1434
  }
1435
+ /** The Console's toggle strip is drawn: a console group is offered and the canvas is editable. */
1436
+ const consoleStripShown = $derived(consoleGroupOffered && canvasEditable);
1437
+ /** Id of the Console panel, for the strip's `aria-controls`. */
1438
+ const consolePanelId = `${scopeId}-console-panel`;
1039
1439
  /** Node-swap sub-flow occupies the right sidebar regardless of placement. */
1040
1440
  const swapActive = $derived(swapMode !== 'idle');
1041
1441
 
@@ -1049,8 +1449,17 @@
1049
1449
  * Metadata for the active config surface, independent of its host. The form
1050
1450
  * itself is rendered by the host via the `configBody` snippet.
1051
1451
  */
1452
+ const inspectorSurface = $derived(
1453
+ resolveInspectorSurface({
1454
+ hasNode: !!selectedNodeForConfig,
1455
+ workflowOpen: isWorkflowSettingsOpen
1456
+ })
1457
+ );
1458
+ /** The inspector can be closed. */
1459
+ const configClosable = $derived(closeTarget(inspectorSurface) !== null);
1460
+
1052
1461
  const activeConfig = $derived.by(() => {
1053
- if (isWorkflowSettingsOpen) {
1462
+ if (inspectorSurface === 'workflow') {
1054
1463
  return {
1055
1464
  kind: 'workflow' as const,
1056
1465
  title: mergedMessages.navigation.workflowSettingsPanelTitle,
@@ -1063,18 +1472,21 @@
1063
1472
  configTitle: mergedMessages.navigation.workflowSettingsPanelSubtitle
1064
1473
  };
1065
1474
  }
1066
- const node = selectedNodeForConfig;
1475
+ const node = inspectorSurface === 'node' ? selectedNodeForConfig : null;
1067
1476
  if (node) {
1068
1477
  return {
1069
1478
  kind: 'node' as const,
1070
1479
  node,
1071
1480
  title: node.data.label,
1072
1481
  id: node.id,
1073
- description:
1074
- node.data.metadata?.description || mergedMessages.navigation.nodeConfigDescription,
1482
+ // No filler when the node type has no description: the meta line says enough.
1483
+ description: node.data.metadata?.description ?? '',
1075
1484
  details: [
1076
1485
  { label: 'Type', value: node.data.metadata?.type || node.type },
1077
- { label: 'Category', value: node.data.metadata?.category || 'general' }
1486
+ {
1487
+ label: 'Category',
1488
+ value: fd.categories.getLabel(node.data.metadata?.category || 'general')
1489
+ }
1078
1490
  ],
1079
1491
  configTitle: undefined as string | undefined
1080
1492
  };
@@ -1084,10 +1496,13 @@
1084
1496
 
1085
1497
  /** Close whichever config surface is currently open. */
1086
1498
  function closeActiveConfig(): void {
1087
- if (isWorkflowSettingsOpen) {
1088
- isWorkflowSettingsOpen = false;
1089
- } else {
1499
+ // A node closes first; the inspector then falls back to the workflow tabs
1500
+ // if they are open. Closing the workflow tabs closes the surface.
1501
+ const target = closeTarget(inspectorSurface);
1502
+ if (target === 'node') {
1090
1503
  closeConfigSidebar();
1504
+ } else if (target === 'workflow') {
1505
+ isWorkflowSettingsOpen = false;
1091
1506
  }
1092
1507
  }
1093
1508
 
@@ -1100,17 +1515,49 @@
1100
1515
  }
1101
1516
 
1102
1517
  const showRightPanel = $derived(
1103
- !disableSidebar && (swapActive || configHere('sidebar') || consoleHere('sidebar'))
1518
+ (!disableSidebar || testMode) && (swapActive || configHere('sidebar') || consoleHere('sidebar'))
1104
1519
  );
1105
1520
 
1521
+ /** Test mode's docked Playground column; resizable, and a drawer when narrow. */
1522
+ const TEST_DOCK_WIDTH = 360;
1523
+ const dockedInColumn = $derived(testMode && !narrow);
1524
+
1525
+ /** Edit mode's left column keeps a width per tab (Nodes | Assistant). */
1526
+ const sidebarWidths = $derived(resolveSidebarWidths(getUiSettings()));
1527
+
1106
1528
  /**
1107
1529
  * Calculate left sidebar width based on collapsed state
1108
- * When collapsed, use 0; otherwise use user-configured width
1530
+ * When collapsed, use 0; otherwise use user-configured width.
1531
+ * In Test mode the left slot holds the Playground: its own width, never collapsed.
1109
1532
  */
1110
1533
  const leftSidebarWidth = $derived(
1111
- getUiSettings().sidebarCollapsed ? 0 : getUiSettings().sidebarWidth
1534
+ testMode
1535
+ ? dockedInColumn
1536
+ ? TEST_DOCK_WIDTH
1537
+ : 0
1538
+ : getUiSettings().sidebarCollapsed
1539
+ ? 0
1540
+ : sidebarWidths[leftTab]
1541
+ );
1542
+
1543
+ /** The left column can be resized: the Test dock, or Edit mode's column while it is open. */
1544
+ const leftResizable = $derived(
1545
+ testMode ? dockedInColumn : !disableSidebar && !getUiSettings().sidebarCollapsed
1112
1546
  );
1113
1547
 
1548
+ /** A drag or arrow-key resize of the left column ended: remember it for the active tab. */
1549
+ function saveLeftWidth(width: number): void {
1550
+ if (testMode) return;
1551
+ updateSettings({
1552
+ ui: { sidebarWidths: { ...sidebarWidths, [leftTab]: clampSidebarWidth(width) } }
1553
+ });
1554
+ }
1555
+
1556
+ /** A resize of the bottom panel ended: remember its height. */
1557
+ function saveConsoleHeight(height: number): void {
1558
+ updateSettings({ ui: { consoleHeight: Math.round(height) } });
1559
+ }
1560
+
1114
1561
  /** Whether the sidebar is collapsed */
1115
1562
  const isSidebarCollapsed = $derived(getUiSettings().sidebarCollapsed);
1116
1563
 
@@ -1132,14 +1579,49 @@
1132
1579
  // Dead key on international keyboards — do not intercept
1133
1580
  if (event.key === 'Dead') return;
1134
1581
 
1135
- if (event.key !== '`') return;
1582
+ // N opens the node library in Test mode, where the sidebar is the Playground.
1583
+ const isLibraryKey = testMode && (event.key === 'n' || event.key === 'N');
1584
+ // T toggles Edit | Test where Test mode is offered.
1585
+ const isModeKey = testModeAvailable && (event.key === 't' || event.key === 'T');
1586
+ // / focuses the node library's search in Edit mode.
1587
+ const isSearchKey = !testMode && !disableSidebar && event.key === '/';
1588
+ if (event.key !== '`' && !isLibraryKey && !isModeKey && !isSearchKey) return;
1589
+ if (
1590
+ (isLibraryKey || isModeKey || isSearchKey) &&
1591
+ (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey || event.repeat)
1592
+ ) {
1593
+ return;
1594
+ }
1136
1595
 
1137
- // Don't intercept when user is typing in an input, textarea, or contenteditable
1596
+ // Don't intercept when user is typing in an input, textarea, contenteditable
1597
+ // or code editor (CodeMirror's content is contenteditable, the closest() is a backstop)
1138
1598
  const target = event.target as HTMLElement;
1139
1599
  const isInputElement =
1140
- target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable;
1600
+ target.tagName === 'INPUT' ||
1601
+ target.tagName === 'TEXTAREA' ||
1602
+ target.isContentEditable ||
1603
+ !!target.closest?.('.cm-editor');
1141
1604
 
1142
1605
  if (isInputElement) return;
1606
+ if (isSearchKey) {
1607
+ event.preventDefault();
1608
+ if (isSidebarCollapsed) toggleSidebar();
1609
+ leftTab = 'nodes';
1610
+ void tick().then(() =>
1611
+ document.querySelector<HTMLInputElement>('input[data-fd-library-search]')?.focus()
1612
+ );
1613
+ return;
1614
+ }
1615
+ if (isModeKey) {
1616
+ event.preventDefault();
1617
+ fd.editorMode.set(testMode ? 'edit' : 'test');
1618
+ return;
1619
+ }
1620
+ if (isLibraryKey) {
1621
+ event.preventDefault();
1622
+ toggleLibrary();
1623
+ return;
1624
+ }
1143
1625
  if (!consoleGroupOffered) return;
1144
1626
 
1145
1627
  event.preventDefault();
@@ -1169,6 +1651,30 @@
1169
1651
  }
1170
1652
  }
1171
1653
 
1654
+ /** Show the Assistant: its tab beside Nodes, or the console group where there is no left slot. */
1655
+ function openAssistant(): void {
1656
+ if (chatInConsoleGroup) {
1657
+ activeSurface = 'chat';
1658
+ updateSettings({ ui: { consoleOpen: true } });
1659
+ return;
1660
+ }
1661
+ leftTab = 'assistant';
1662
+ if (getUiSettings().sidebarCollapsed) updateSettings({ ui: { sidebarCollapsed: false } });
1663
+ }
1664
+
1665
+ /**
1666
+ * "Ask the Assistant about this run": the Assistant is an Edit-mode helper,
1667
+ * so the editor goes back to Edit mode, opens the Assistant beside Nodes and
1668
+ * attaches the run.
1669
+ */
1670
+ function askAssistantAboutRun(runId: string): void {
1671
+ if (!chatTabOffered || !fd.attachedRun.attach(runId, { status: 'failed' })) return;
1672
+ fd.editorMode.set('edit');
1673
+ openAssistant();
1674
+ }
1675
+ /** The ask-the-Assistant actions are offered when there is an Assistant to ask. */
1676
+ const askAssistant = $derived(chatTabOffered ? askAssistantAboutRun : undefined);
1677
+
1172
1678
  function toggleConsole(): void {
1173
1679
  const currentOpen = getUiSettings().consoleOpen;
1174
1680
  updateSettings({ ui: { consoleOpen: !currentOpen } });
@@ -1197,7 +1703,7 @@
1197
1703
  <svelte:window onkeydown={handleGlobalKeydown} />
1198
1704
 
1199
1705
  <svelte:head>
1200
- <title>FlowDrop - Visual Workflow Manager</title>
1706
+ <title>{branding?.name ?? m().navigation.appName} - {m().navigation.tagline}</title>
1201
1707
  <meta name="description" content="A modern drag-and-drop workflow editor for LLM applications" />
1202
1708
  </svelte:head>
1203
1709
 
@@ -1245,6 +1751,40 @@
1245
1751
  />
1246
1752
  {/snippet}
1247
1753
 
1754
+ <!-- Last run of a failed node: take the run to the Assistant -->
1755
+ {#snippet askAboutRunAction()}
1756
+ {@const runId = fd.playground.nodeStatusScope?.pipelineId}
1757
+ {#if runId}
1758
+ <button
1759
+ type="button"
1760
+ class="ask-about-run"
1761
+ data-testid="last-run-ask-assistant"
1762
+ onclick={() => askAssistant?.(runId)}
1763
+ >
1764
+ {mergedMessages.nodeInspector.askAssistant}
1765
+ </button>
1766
+ {/if}
1767
+ {/snippet}
1768
+
1769
+ {#snippet nodeInspectorEl(node: WorkflowNode)}
1770
+ <NodeInspector
1771
+ editorMode={effectiveEditorMode}
1772
+ tab={nodeInspectorTab}
1773
+ onTabChange={(tab) => (nodeInspectorTab = tab)}
1774
+ info={fd.playground.nodeStatusFor(node.id)}
1775
+ runShown={fd.playground.nodeStatusScope !== null}
1776
+ lastRunActions={askAssistant &&
1777
+ fd.playground.nodeStatusFor(node.id)?.status === 'failed' &&
1778
+ fd.playground.nodeStatusScope?.pipelineId
1779
+ ? askAboutRunAction
1780
+ : undefined}
1781
+ >
1782
+ {#snippet config()}
1783
+ {@render nodeConfigFormEl(node)}
1784
+ {/snippet}
1785
+ </NodeInspector>
1786
+ {/snippet}
1787
+
1248
1788
  {#snippet workflowConfigFormEl()}
1249
1789
  <ConfigForm
1250
1790
  {authProvider}
@@ -1303,53 +1843,54 @@
1303
1843
  workflow={fd.workflow.current}
1304
1844
  dataTypes={fd.portCompatibility.getEnabledDataTypes()}
1305
1845
  checker={fd.portCompatibility}
1306
- onChange={(next) => fd.workflow.batchUpdate({ interface: next })}
1846
+ onChange={(next, edit) => fd.workflow.editInterface(next, edit)}
1847
+ onOpenPlaygroundSettings={fd.workflow.current.playground !== undefined
1848
+ ? () => (workflowSettingsTab = 'playground')
1849
+ : undefined}
1307
1850
  />
1308
1851
  {/if}
1309
1852
  {/snippet}
1310
1853
 
1311
1854
  <!--
1312
- Two tabs of the workflow-settings surface: the schema-driven settings form,
1313
- and the interface editor. A tab, not a field in the settings form — see
1314
- Phase 3's rationale (`ConfigForm` cannot express a bindings list).
1855
+ The workflow's Playground settings (its chat binding). Only for a backend
1856
+ that sends them (`workflow.playground`, FlowDrop 2.7.0 on): an older one
1857
+ would drop the key on save. Edits go through the workflow store, so they
1858
+ mark the workflow dirty and are saved with it.
1315
1859
  -->
1316
- {#snippet workflowSettingsTabs()}
1317
- <div class="workflow-settings-tabs">
1318
- <div class="workflow-settings-tabs__bar" role="tablist">
1319
- <button
1320
- type="button"
1321
- role="tab"
1322
- aria-selected={workflowSettingsTab === 'settings'}
1323
- class="workflow-settings-tabs__tab"
1324
- class:workflow-settings-tabs__tab--active={workflowSettingsTab === 'settings'}
1325
- onclick={() => (workflowSettingsTab = 'settings')}
1326
- >
1327
- {mergedMessages.navigation.workflowSettingsPanelSubtitle}
1328
- </button>
1329
- <button
1330
- type="button"
1331
- role="tab"
1332
- aria-selected={workflowSettingsTab === 'interface'}
1333
- class="workflow-settings-tabs__tab"
1334
- class:workflow-settings-tabs__tab--active={workflowSettingsTab === 'interface'}
1335
- onclick={() => (workflowSettingsTab = 'interface')}
1336
- >
1337
- {mergedMessages.navigation.workflowSettingsInterfaceTab}
1338
- </button>
1339
- </div>
1340
- <div
1341
- class="workflow-settings-tabs__panel"
1342
- style:display={workflowSettingsTab === 'settings' ? 'block' : 'none'}
1343
- >
1344
- {@render workflowConfigFormEl()}
1345
- </div>
1346
- <div
1347
- class="workflow-settings-tabs__panel"
1348
- style:display={workflowSettingsTab === 'interface' ? 'block' : 'none'}
1349
- >
1350
- {@render workflowInterfaceEl()}
1351
- </div>
1352
- </div>
1860
+ {#snippet workflowPlaygroundEl()}
1861
+ {#if fd.workflow.current}
1862
+ <WorkflowPlaygroundSettings
1863
+ workflow={fd.workflow.current}
1864
+ onChange={(next) => fd.workflow.batchUpdate({ playground: next })}
1865
+ onMoveTurns={(chat) => {
1866
+ const current = fd.workflow.current;
1867
+ if (!current) return;
1868
+ fd.workflow.batchUpdate({
1869
+ playground: withPlaygroundChat(current.playground, chat),
1870
+ interface: withoutInterfaceTurns(current.interface)
1871
+ });
1872
+ }}
1873
+ />
1874
+ {/if}
1875
+ {/snippet}
1876
+
1877
+ <!--
1878
+ The workflow-settings surface: General | Interface | Playground as tabs in
1879
+ the panel header. A tab, not a field in the settings form — see Phase 3's
1880
+ rationale (`ConfigForm` cannot express a bindings list).
1881
+ -->
1882
+ {#snippet workflowSettingsTabs(onClose?: () => void)}
1883
+ <WorkflowSettingsPanel
1884
+ tab={activeWorkflowSettingsTab}
1885
+ onTabChange={(t) => (workflowSettingsTab = t)}
1886
+ workflowId={fd.workflow.current?.id}
1887
+ nodeCount={fd.workflow.current?.nodes?.length ?? 0}
1888
+ connectionCount={fd.workflow.current?.edges?.length ?? 0}
1889
+ {onClose}
1890
+ general={workflowConfigFormEl}
1891
+ interfaceBody={workflowInterfaceEl}
1892
+ playground={fd.workflow.current?.playground !== undefined ? workflowPlaygroundEl : undefined}
1893
+ />
1353
1894
  {/snippet}
1354
1895
 
1355
1896
  <!--
@@ -1360,19 +1901,21 @@
1360
1901
  {#snippet configBody(showHeader: boolean)}
1361
1902
  {#if activeConfig}
1362
1903
  <div class="config-surface">
1363
- {#if showHeader}
1904
+ {#if showHeader && activeConfig.kind === 'node'}
1364
1905
  <div class="config-surface__header">
1365
1906
  <h2 class="config-surface__title">{activeConfig.title}</h2>
1366
- <button
1367
- class="config-surface__close"
1368
- onclick={closeActiveConfig}
1369
- aria-label={mergedMessages.layout.closeConfigPanel}
1370
- >
1371
- ×
1372
- </button>
1907
+ {#if configClosable}
1908
+ <button
1909
+ class="config-surface__close"
1910
+ onclick={closeActiveConfig}
1911
+ aria-label={mergedMessages.layout.closeConfigPanel}
1912
+ >
1913
+ ×
1914
+ </button>
1915
+ {/if}
1373
1916
  </div>
1374
1917
  {/if}
1375
- {#if activeConfig.id}
1918
+ {#if activeConfig.id && activeConfig.kind === 'node'}
1376
1919
  <div class="config-surface__details">
1377
1920
  <ReadOnlyDetails
1378
1921
  id={activeConfig.id}
@@ -1381,16 +1924,21 @@
1381
1924
  />
1382
1925
  </div>
1383
1926
  {/if}
1384
- <div class="config-surface__content">
1927
+ <div
1928
+ class="config-surface__content"
1929
+ class:config-surface__content--bare={activeConfig.kind === 'workflow'}
1930
+ >
1385
1931
  {#if activeConfig.kind === 'node'}
1386
1932
  <div class="config-surface__section">
1387
- <h3 class="config-surface__section-title">
1388
- {activeConfig.configTitle ?? 'Configuration'}
1389
- </h3>
1390
- {@render nodeConfigFormEl(activeConfig.node)}
1933
+ {#if activeConfig.configTitle}
1934
+ <h3 class="config-surface__section-title">{activeConfig.configTitle}</h3>
1935
+ {/if}
1936
+ {@render nodeInspectorEl(activeConfig.node)}
1391
1937
  </div>
1392
1938
  {:else}
1393
- {@render workflowSettingsTabs()}
1939
+ {@render workflowSettingsTabs(
1940
+ showHeader && configClosable ? closeActiveConfig : undefined
1941
+ )}
1394
1942
  {/if}
1395
1943
  </div>
1396
1944
  </div>
@@ -1406,7 +1954,29 @@
1406
1954
  {/snippet}
1407
1955
 
1408
1956
  {#snippet consoleSurfaceBody()}
1409
- <CommandConsole nodeTypes={nodes} onUIAction={handleConsoleUIAction} />
1957
+ <CommandConsole nodeTypes={nodes} onUIAction={handleConsoleUIAction} id={consolePanelId} />
1958
+ {/snippet}
1959
+
1960
+ <!-- The Console's toggle: a slim strip on the canvas's bottom edge; the panel's header once open -->
1961
+ {#snippet consoleStrip()}
1962
+ <ConsoleStrip
1963
+ open={consoleActive}
1964
+ controls={consolePanelId}
1965
+ label={consoleTabOffered ? undefined : mergedMessages.navigation.bottomPanel.chat}
1966
+ onToggle={toggleConsole}
1967
+ />
1968
+ {/snippet}
1969
+
1970
+ {#snippet nodesTabContent()}
1971
+ {#if !testMode}
1972
+ <NodeSidebar
1973
+ {nodes}
1974
+ loading={nodeTypesLoading}
1975
+ activeFormat={fd.workflow.format}
1976
+ categoriesDefaultOpen={themeConfig?.sidebar?.categoriesDefaultOpen ?? false}
1977
+ listStyle={themeConfig?.display?.sidebarList}
1978
+ />
1979
+ {/if}
1410
1980
  {/snippet}
1411
1981
 
1412
1982
  {#snippet chatSurfaceBody()}
@@ -1432,70 +2002,134 @@
1432
2002
  so the default experience is unchanged.
1433
2003
  -->
1434
2004
  {#snippet configPanelSidebar()}
1435
- {#if activeConfig}
2005
+ {#if activeConfig?.kind === 'workflow'}
2006
+ {@render workflowSettingsTabs(configClosable ? closeActiveConfig : undefined)}
2007
+ {:else if activeConfig}
1436
2008
  <ConfigPanel
1437
2009
  title={activeConfig.title}
1438
2010
  id={activeConfig.id}
1439
2011
  description={activeConfig.description}
1440
2012
  details={activeConfig.details}
1441
- configTitle={activeConfig.configTitle ?? 'Configuration'}
1442
- onClose={closeActiveConfig}
1443
- onSwap={activeConfig.kind === 'node' && canvasEditable && features.enableNodeSwap
2013
+ configTitle={activeConfig.configTitle}
2014
+ onClose={configClosable ? closeActiveConfig : undefined}
2015
+ onSwap={activeConfig.kind === 'node' && canvasEditable && !testMode && features.enableNodeSwap
1444
2016
  ? startSwap
1445
2017
  : undefined}
1446
2018
  >
1447
- {#if activeConfig.kind === 'node'}
1448
- {@render nodeConfigFormEl(activeConfig.node)}
1449
- {:else}
1450
- {@render workflowSettingsTabs()}
1451
- {/if}
2019
+ {@render nodeInspectorEl(activeConfig.node)}
1452
2020
  </ConfigPanel>
1453
2021
  {/if}
1454
2022
  {/snippet}
1455
2023
 
2024
+ <!-- Test mode's Playground, in the left slot or, on a narrow screen, a drawer -->
2025
+ {#snippet dockedPlayground()}
2026
+ {#if fd.workflow.current}
2027
+ <DockedPlayground
2028
+ workflow={fd.workflow.current}
2029
+ onSave={saveWorkflow}
2030
+ onOpenSettings={fd.workflow.current.playground !== undefined
2031
+ ? openPlaygroundSettings
2032
+ : undefined}
2033
+ />
2034
+ {/if}
2035
+ {/snippet}
2036
+
1456
2037
  <!-- MainLayout wrapper for workflow editor -->
1457
- <div class="flowdrop-root">
2038
+ <div class="flowdrop-root" data-fd-scope={scopeId} use:themeScope={{ mirror: true }}>
1458
2039
  <MainLayout
1459
2040
  {height}
1460
2041
  {width}
1461
2042
  showHeader={showNavbar}
1462
- showLeftSidebar={!disableSidebar}
2043
+ showLeftSidebar={testMode ? dockedInColumn : !disableSidebar}
1463
2044
  showRightSidebar={showRightPanel}
1464
2045
  showBottomPanel={anyHere('below')}
1465
2046
  bottomPanelHeight={getUiSettings().consoleHeight}
1466
2047
  showFooter={false}
1467
- headerHeight={60}
2048
+ headerHeight={48}
1468
2049
  {leftSidebarWidth}
1469
2050
  rightSidebarWidth={400}
1470
- leftSidebarMinWidth={getUiSettings().sidebarCollapsed ? 0 : 280}
1471
- leftSidebarMaxWidth={getUiSettings().sidebarCollapsed ? 0 : 450}
2051
+ leftSidebarMinWidth={testMode ? 300 : getUiSettings().sidebarCollapsed ? 0 : SIDEBAR_MIN_WIDTH}
2052
+ leftSidebarMaxWidth={testMode ? 560 : getUiSettings().sidebarCollapsed ? 0 : SIDEBAR_MAX_WIDTH}
2053
+ leftSidebarMaxRatio={testMode ? undefined : SIDEBAR_MAX_RATIO}
2054
+ onLeftSidebarResize={saveLeftWidth}
2055
+ onBottomPanelResize={saveConsoleHeight}
2056
+ bottomStrip={consoleStripShown ? consoleStrip : undefined}
2057
+ bottomStripIsHeader={consoleHere('below')}
1472
2058
  rightSidebarMinWidth={320}
1473
2059
  rightSidebarMaxWidth={550}
1474
- enableLeftSplitPane={false}
2060
+ enableLeftSplitPane={leftResizable}
1475
2061
  enableRightSplitPane={true}
1476
2062
  class="flowdrop-app-layout"
1477
2063
  >
1478
2064
  <!-- Header: Navbar -->
1479
2065
  {#snippet header()}
2066
+ {#snippet doctorStatus()}
2067
+ <DoctorMenu canApply={canvasEditable} />
2068
+ {/snippet}
1480
2069
  <Navbar
1481
2070
  title={breadcrumbTitle}
1482
2071
  primaryActions={navbarActions.length > 0 ? navbarActions : defaultPrimaryActions}
1483
2072
  {showStatus}
1484
2073
  {showSettings}
2074
+ {branding}
2075
+ saveShortcut
2076
+ onWorkflowSettings={toggleWorkflowSettings}
2077
+ status={doctorStatus}
2078
+ workflowSettingsOpen={isWorkflowSettingsOpen}
1485
2079
  {settingsCategories}
1486
2080
  {showSettingsSyncButton}
1487
2081
  {showSettingsResetButton}
1488
2082
  />
1489
2083
  {/snippet}
1490
2084
 
1491
- <!-- Left Sidebar: Node Components -->
2085
+ <!-- Left Sidebar: Node Components; in Test mode, the Playground -->
1492
2086
  {#snippet leftSidebar()}
1493
- <NodeSidebar
1494
- {nodes}
1495
- loading={nodeTypesLoading}
1496
- activeFormat={fd.workflow.format}
1497
- categoriesDefaultOpen={themeConfig?.sidebar?.categoriesDefaultOpen ?? false}
1498
- />
2087
+ {#if testMode}
2088
+ {@render dockedPlayground()}
2089
+ {/if}
2090
+ {#if chatInLeftSlot || !testMode}
2091
+ <!-- Kept mounted (hidden) in Test mode, so the conversation survives the trip -->
2092
+ <div
2093
+ class="left-slot"
2094
+ data-testid="left-slot"
2095
+ style:display={testMode || isSidebarCollapsed ? 'none' : null}
2096
+ >
2097
+ <TabbedSurface
2098
+ tabs={[
2099
+ {
2100
+ id: 'nodes',
2101
+ label: mergedMessages.layout.nodesTab,
2102
+ content: nodesTabContent
2103
+ },
2104
+ ...(chatInLeftSlot
2105
+ ? [
2106
+ {
2107
+ id: 'assistant',
2108
+ label: mergedMessages.navigation.bottomPanel.chat,
2109
+ content: chatSurfaceBody
2110
+ }
2111
+ ]
2112
+ : [])
2113
+ ]}
2114
+ activeId={leftTab}
2115
+ onSelect={(id) => (leftTab = id === 'assistant' ? 'assistant' : 'nodes')}
2116
+ ariaLabel={mergedMessages.layout.componentsSidebar}
2117
+ >
2118
+ {#snippet headerActions()}
2119
+ {#if !disableSidebar}
2120
+ <IconButton
2121
+ size="md"
2122
+ ariaLabel={mergedMessages.layout.collapseSidebar}
2123
+ title={mergedMessages.layout.collapseSidebar}
2124
+ onclick={toggleSidebar}
2125
+ >
2126
+ <MenuOpenIcon />
2127
+ </IconButton>
2128
+ {/if}
2129
+ {/snippet}
2130
+ </TabbedSurface>
2131
+ </div>
2132
+ {/if}
1499
2133
  {/snippet}
1500
2134
 
1501
2135
  <!--
@@ -1584,25 +2218,59 @@
1584
2218
  <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
1585
2219
  <div
1586
2220
  class="flowdrop-editor-main"
2221
+ bind:this={editorMainEl}
2222
+ bind:clientWidth={regionWidth}
1587
2223
  class:pipeline-view={!!pipelineId}
1588
- style="--fd-canvas-left-offset: {!disableSidebar ? leftSidebarWidth + 'px' : '0px'}"
2224
+ style="--fd-canvas-left-offset: {testMode || !disableSidebar
2225
+ ? leftSidebarWidth + 'px'
2226
+ : '0px'}; --fd-canvas-toolbar-inset: {testMode && narrow && drawerOpen
2227
+ ? 'var(--fd-test-drawer-width)'
2228
+ : !testMode && !disableSidebar && isSidebarCollapsed
2229
+ ? 'calc(var(--fd-canvas-control) + var(--fd-space-xs))'
2230
+ : '0px'}"
1589
2231
  onclick={handleCanvasClick}
1590
- onkeydown={(e) => e.key === 'Escape' && closeConfigSidebar()}
2232
+ onkeydown={(e) => {
2233
+ if (e.key !== 'Escape') return;
2234
+ // The topmost transient surface first (the node library), then the selection.
2235
+ if (libraryOpen) libraryOpen = false;
2236
+ else if (configPlacement === 'sheet') {
2237
+ // The inspector sheet is inside this region: Esc in one of its fields is the field's.
2238
+ const target = e.target as HTMLElement;
2239
+ if (
2240
+ target.tagName === 'INPUT' ||
2241
+ target.tagName === 'TEXTAREA' ||
2242
+ target.isContentEditable
2243
+ )
2244
+ return;
2245
+ closeActiveConfig();
2246
+ } else closeConfigSidebar();
2247
+ }}
1591
2248
  role="region"
1592
2249
  aria-label={mergedMessages.layout.workflowCanvas}
1593
2250
  >
1594
- <!-- Floating sidebar toggle — always visible on the canvas top-left -->
1595
- {#if !disableSidebar}
2251
+ <!--
2252
+ Floating sidebar toggle — always visible on the canvas top-left. In
2253
+ Test mode the sidebar is the Playground: a column that needs no
2254
+ toggle, or on a narrow screen a drawer that this button opens.
2255
+ -->
2256
+ {#if testMode ? narrow : !disableSidebar && isSidebarCollapsed}
1596
2257
  <CanvasIconButton
1597
- class="flowdrop-sidebar-fab"
1598
- label={isSidebarCollapsed
1599
- ? mergedMessages.layout.expandSidebar
1600
- : mergedMessages.layout.collapseSidebar}
1601
- active={!isSidebarCollapsed}
1602
- onclick={toggleSidebar}
2258
+ class="flowdrop-sidebar-fab {testMode ? '' : 'flowdrop-sidebar-fab--edit'} {testMode &&
2259
+ drawerOpen
2260
+ ? 'flowdrop-sidebar-fab--beside-drawer'
2261
+ : ''}"
2262
+ label={testMode
2263
+ ? drawerOpen
2264
+ ? mergedMessages.layout.hidePlayground
2265
+ : mergedMessages.layout.showPlayground
2266
+ : isSidebarCollapsed
2267
+ ? mergedMessages.layout.expandSidebar
2268
+ : mergedMessages.layout.collapseSidebar}
2269
+ active={testMode ? drawerOpen : !isSidebarCollapsed}
2270
+ onclick={testMode ? () => (drawerOpen = !drawerOpen) : toggleSidebar}
1603
2271
  >
1604
2272
  {#snippet icon()}
1605
- {#if isSidebarCollapsed}
2273
+ {#if testMode ? !drawerOpen : isSidebarCollapsed}
1606
2274
  <MenuIcon />
1607
2275
  {:else}
1608
2276
  <MenuOpenIcon />
@@ -1611,22 +2279,96 @@
1611
2279
  </CanvasIconButton>
1612
2280
  {/if}
1613
2281
 
2282
+ <!-- Test mode, narrow screen: the Playground as a drawer over the canvas -->
2283
+ {#if testMode && narrow}
2284
+ <div class="test-drawer" data-testid="test-drawer" hidden={!drawerOpen}>
2285
+ {@render dockedPlayground()}
2286
+ </div>
2287
+ {/if}
2288
+
2289
+ <!--
2290
+ The open node (Test mode) or the workflow tabs (both modes) as a sheet over the
2291
+ canvas's right edge. The workflow sheet is wider and resizable from its left edge.
2292
+ -->
2293
+ {#if configPlacement === 'sheet' && activeConfig}
2294
+ <aside
2295
+ class="inspector-sheet"
2296
+ class:inspector-sheet--workflow={activeConfig.kind === 'workflow'}
2297
+ data-testid="inspector-sheet"
2298
+ data-kind={activeConfig.kind}
2299
+ aria-label={activeConfig.title}
2300
+ style={activeConfig.kind === 'workflow'
2301
+ ? `width: min(${workflowSheetWidth}px, 100%)`
2302
+ : undefined}
2303
+ >
2304
+ {#if activeConfig.kind === 'workflow'}
2305
+ <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
2306
+ <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
2307
+ <div
2308
+ class="inspector-sheet__resizer"
2309
+ class:inspector-sheet__resizer--active={liveSheetWidth !== null}
2310
+ data-testid="inspector-sheet-resizer"
2311
+ role="separator"
2312
+ aria-orientation="vertical"
2313
+ aria-label={mergedMessages.layout.resizeWorkflowSheet}
2314
+ aria-valuenow={workflowSheetWidth}
2315
+ aria-valuemin={SHEET_MIN_WIDTH}
2316
+ aria-valuemax={workflowSheetMax}
2317
+ tabindex="0"
2318
+ onpointerdown={onSheetResizeDown}
2319
+ onpointermove={onSheetResizeMove}
2320
+ onpointerup={onSheetResizeUp}
2321
+ onpointercancel={onSheetResizeUp}
2322
+ onkeydown={onSheetResizeKey}
2323
+ ></div>
2324
+ {/if}
2325
+ {@render configPanelSidebar()}
2326
+ </aside>
2327
+ {/if}
2328
+
2329
+ <!-- Test mode: the node library as a popover (N) -->
2330
+ {#if testMode && libraryOpen}
2331
+ <div
2332
+ class="node-library-popover"
2333
+ class:node-library-popover--beside-drawer={narrow && drawerOpen}
2334
+ data-testid="node-library-popover"
2335
+ role="dialog"
2336
+ aria-label={mergedMessages.layout.nodeLibrary}
2337
+ bind:this={libraryEl}
2338
+ >
2339
+ <NodeSidebar
2340
+ popover={true}
2341
+ {nodes}
2342
+ loading={nodeTypesLoading}
2343
+ activeFormat={fd.workflow.format}
2344
+ categoriesDefaultOpen={themeConfig?.sidebar?.categoriesDefaultOpen ?? false}
2345
+ listStyle={themeConfig?.display?.sidebarList}
2346
+ />
2347
+ </div>
2348
+ {/if}
2349
+
1614
2350
  <WorkflowEditor
1615
2351
  bind:this={workflowEditorRef}
1616
2352
  endpointConfig={endpointConfig ?? undefined}
1617
2353
  {authProvider}
1618
- {openConfigSidebar}
2354
+ openConfigSidebar={testMode ? showNodeSheet : openConfigSidebar}
2355
+ onSwapNode={canvasEditable && !testMode && features.enableNodeSwap
2356
+ ? swapFromCanvas
2357
+ : undefined}
2358
+ onNodeClick={testMode ? showNodeSheet : undefined}
1619
2359
  {mode}
1620
2360
  {pipelineId}
1621
2361
  {refreshTrigger}
1622
2362
  builtinEditors={features.builtinEditors}
1623
2363
  {contextMenu}
1624
2364
  gridVariant={themeConfig?.canvas?.grid ?? 'dots'}
1625
- consoleOpen={consoleActive}
1626
- onToggleConsole={consoleGroupOffered ? toggleConsole : undefined}
1627
- consoleToggleLabel={consoleTabOffered
1628
- ? undefined
1629
- : mergedMessages.navigation.bottomPanel.chat}
2365
+ editorMode={effectiveEditorMode}
2366
+ onEditorModeChange={testModeAvailable ? (next) => fd.editorMode.set(next) : undefined}
2367
+ onOpenTest={testModeAvailable ? () => fd.editorMode.set('test') : undefined}
2368
+ onAskAssistant={askAssistant}
2369
+ showRuns={testMode && features.runsList}
2370
+ adminLinks={features.adminLinks}
2371
+ {fitInset}
1630
2372
  />
1631
2373
  </div>
1632
2374
  </MainLayout>
@@ -1662,7 +2404,7 @@
1662
2404
  </SurfaceOverlay>
1663
2405
  {:else if consoleHere('modal')}
1664
2406
  <SurfaceOverlay
1665
- title={activeSurface === 'chat' || !consoleTabOffered
2407
+ title={(activeSurface === 'chat' && chatInConsoleGroup) || !consoleTabOffered
1666
2408
  ? mergedMessages.navigation.bottomPanel.chat
1667
2409
  : mergedMessages.navigation.bottomPanel.console}
1668
2410
  closeLabel={mergedMessages.layout.closeConfigPanel}
@@ -1677,15 +2419,134 @@
1677
2419
  display: contents;
1678
2420
  }
1679
2421
 
2422
+ /* Edit mode's left slot: the Nodes | Assistant tab strip fills it. */
2423
+ .left-slot {
2424
+ display: flex;
2425
+ flex-direction: column;
2426
+ flex: 1;
2427
+ min-height: 0;
2428
+ height: 100%;
2429
+ min-width: 0;
2430
+ }
2431
+
2432
+ .left-slot :global(.tabbed-surface__panel) {
2433
+ min-width: 0;
2434
+ }
2435
+
2436
+ .ask-about-run {
2437
+ align-self: flex-start;
2438
+ padding: var(--fd-space-xs) var(--fd-space-md);
2439
+ border: 1px solid var(--fd-border);
2440
+ border-radius: var(--fd-radius-md, 0.5rem);
2441
+ background: var(--fd-background);
2442
+ color: var(--fd-primary);
2443
+ font: inherit;
2444
+ font-weight: 500;
2445
+ cursor: pointer;
2446
+ }
2447
+
2448
+ .ask-about-run:hover {
2449
+ background: var(--fd-muted);
2450
+ }
2451
+
1680
2452
  /* Floating sidebar toggle button — placement only; visuals live in CanvasIconButton */
1681
2453
  :global(.flowdrop-sidebar-fab) {
1682
- top: 12px;
1683
- left: 12px;
2454
+ /* Below the canvas toolbar, which holds the top-left corner (Test mode, narrow). */
2455
+ top: calc(2 * var(--fd-canvas-inset) + var(--fd-canvas-control));
2456
+ left: var(--fd-canvas-inset);
1684
2457
  z-index: 50;
1685
2458
  }
1686
2459
 
2460
+ /* Test mode on a narrow screen: the Playground over the canvas's left edge. */
2461
+ .test-drawer {
2462
+ position: absolute;
2463
+ top: 0;
2464
+ bottom: 0;
2465
+ left: 0;
2466
+ z-index: 55;
2467
+ width: var(--fd-test-drawer-width);
2468
+ background: var(--fd-background);
2469
+ border-right: 1px solid var(--fd-border);
2470
+ box-shadow: var(--fd-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.18));
2471
+ }
2472
+
2473
+ /* Edit mode, sidebar collapsed: the expand control takes the toolbar row's start;
2474
+ the toolbar is inset by control + gap (App sets --fd-canvas-toolbar-inset). */
2475
+ :global(.flowdrop-sidebar-fab--edit) {
2476
+ top: var(--fd-canvas-inset);
2477
+ }
2478
+
2479
+ :global(.flowdrop-sidebar-fab--beside-drawer) {
2480
+ left: calc(var(--fd-test-drawer-width) + var(--fd-canvas-inset)) !important;
2481
+ }
2482
+
2483
+ /* Test mode's inspector: a sheet over the canvas's right edge; the canvas does not reflow. */
2484
+ .inspector-sheet {
2485
+ position: absolute;
2486
+ top: var(--fd-sheet-inset);
2487
+ right: var(--fd-sheet-inset);
2488
+ bottom: var(--fd-sheet-inset);
2489
+ z-index: 56;
2490
+ width: min(360px, 100%);
2491
+ overflow: hidden;
2492
+ background: var(--fd-panel-bg, var(--fd-background));
2493
+ border-style: solid;
2494
+ border-width: var(--fd-sheet-border-width);
2495
+ border-color: var(--fd-sheet-border);
2496
+ border-radius: var(--fd-sheet-radius);
2497
+ box-shadow: var(--fd-shadow-lg);
2498
+ }
2499
+
2500
+ /* The workflow sheet's left edge: an 8px hit area inside the sheet, a ring line on hover/focus/drag. */
2501
+ .inspector-sheet__resizer {
2502
+ position: absolute;
2503
+ inset: 0 auto 0 0;
2504
+ z-index: 1;
2505
+ width: var(--fd-space-sm);
2506
+ cursor: col-resize;
2507
+ touch-action: none;
2508
+ outline: none;
2509
+ }
2510
+ .inspector-sheet__resizer::after {
2511
+ content: '';
2512
+ position: absolute;
2513
+ inset: 0 auto 0 0;
2514
+ width: 2px;
2515
+ background: var(--fd-ring);
2516
+ opacity: 0;
2517
+ transition: opacity var(--fd-transition-fast);
2518
+ }
2519
+ .inspector-sheet__resizer:hover::after,
2520
+ .inspector-sheet__resizer:focus-visible::after,
2521
+ .inspector-sheet__resizer--active::after {
2522
+ opacity: 1;
2523
+ }
2524
+
2525
+ /* Test mode's node library, over the canvas's top-left corner, below the canvas toolbar. */
2526
+ .node-library-popover {
2527
+ position: absolute;
2528
+ top: 56px;
2529
+ left: 12px;
2530
+ z-index: 60;
2531
+ width: 280px;
2532
+ max-height: calc(100% - 68px);
2533
+ display: flex;
2534
+ flex-direction: column;
2535
+ overflow: hidden;
2536
+ background: var(--fd-panel-bg, var(--fd-background));
2537
+ border: 1px solid var(--fd-border);
2538
+ border-radius: var(--fd-radius-lg, 8px);
2539
+ box-shadow: var(--fd-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.18));
2540
+ }
2541
+
2542
+ .node-library-popover--beside-drawer {
2543
+ left: calc(var(--fd-test-drawer-width) + 60px);
2544
+ }
2545
+
1687
2546
  /* Main editor area */
1688
2547
  .flowdrop-editor-main {
2548
+ /* Test mode's drawer width. */
2549
+ --fd-test-drawer-width: min(380px, 92%);
1689
2550
  flex: 1;
1690
2551
  position: relative;
1691
2552
  min-width: 0;
@@ -1744,9 +2605,7 @@
1744
2605
  }
1745
2606
 
1746
2607
  .config-surface__details {
1747
- padding: 0.75rem 1rem;
1748
- border-bottom: 1px solid var(--fd-border-muted);
1749
- background-color: var(--fd-card);
2608
+ padding: 0.75rem 1rem 0;
1750
2609
  flex-shrink: 0;
1751
2610
  }
1752
2611
 
@@ -1768,47 +2627,11 @@
1768
2627
  font-size: var(--fd-text-xs);
1769
2628
  font-weight: 600;
1770
2629
  color: var(--fd-muted-foreground);
1771
- text-transform: uppercase;
1772
- letter-spacing: 0.05em;
1773
2630
  }
1774
2631
 
1775
- /*
1776
- Inner tab strip for the workflow-settings surface — Settings vs. Interface
1777
- (Phase 3 of `.claude/plans/workflow-interface.md`). Deliberately not the
1778
- `TabbedSurface` component: that one governs which *host* a surface lives in
1779
- (sidebar/modal/below); this is a surface's own internal navigation, sitting
1780
- inside whichever host already scrolls it.
1781
- */
1782
- .workflow-settings-tabs {
1783
- display: flex;
1784
- flex-direction: column;
1785
- gap: var(--fd-space-xs, 0.5rem);
1786
- }
1787
-
1788
- .workflow-settings-tabs__bar {
1789
- display: flex;
1790
- gap: 0;
1791
- border-bottom: 1px solid var(--fd-border);
1792
- }
1793
-
1794
- .workflow-settings-tabs__tab {
1795
- padding: 0.375rem 0.75rem;
1796
- font-size: var(--fd-text-xs);
1797
- font-weight: 500;
1798
- cursor: pointer;
1799
- border: none;
1800
- border-bottom: 2px solid transparent;
1801
- background: transparent;
1802
- color: var(--fd-muted-foreground);
1803
- transition: all var(--fd-transition-fast);
1804
- }
1805
-
1806
- .workflow-settings-tabs__tab:hover {
1807
- color: var(--fd-foreground);
1808
- }
1809
-
1810
- .workflow-settings-tabs__tab--active {
1811
- color: var(--fd-foreground);
1812
- border-bottom-color: var(--fd-primary);
2632
+ /* The workflow settings panel owns its own scroll and padding. */
2633
+ .config-surface__content--bare {
2634
+ padding: 0;
2635
+ overflow: hidden;
1813
2636
  }
1814
2637
  </style>