@flowdrop/flowdrop 2.0.0-beta.1 → 2.0.0-beta.11

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 (270) hide show
  1. package/CHANGELOG.md +210 -0
  2. package/MIGRATION-2.0.md +173 -3
  3. package/README.md +5 -5
  4. package/dist/adapters/WorkflowAdapter.js +4 -5
  5. package/dist/adapters/agentspec/AgentSpecAdapter.js +3 -3
  6. package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
  7. package/dist/api/enhanced-client.js +6 -11
  8. package/dist/chat/batchFeedback.js +1 -1
  9. package/dist/chat/commandClassifier.d.ts +11 -0
  10. package/dist/chat/commandClassifier.js +20 -0
  11. package/dist/chat/historyBuilder.d.ts +39 -0
  12. package/dist/chat/historyBuilder.js +82 -0
  13. package/dist/chat/index.d.ts +2 -1
  14. package/dist/chat/index.js +2 -1
  15. package/dist/chat/responseParser.js +16 -12
  16. package/dist/commands/executor.js +51 -26
  17. package/dist/commands/parser.d.ts +12 -0
  18. package/dist/commands/parser.js +33 -6
  19. package/dist/commands/storeIntegration.svelte.js +11 -1
  20. package/dist/commands/types.js +5 -5
  21. package/dist/components/App.svelte +547 -386
  22. package/dist/components/App.svelte.d.ts +16 -8
  23. package/dist/components/Button.stories.svelte +65 -0
  24. package/dist/components/Button.stories.svelte.d.ts +19 -0
  25. package/dist/components/Button.svelte +62 -0
  26. package/dist/components/Button.svelte.d.ts +24 -0
  27. package/dist/components/CanvasIconButton.svelte +76 -0
  28. package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
  29. package/dist/components/ConfigForm.svelte +194 -565
  30. package/dist/components/ConfigForm.svelte.d.ts +24 -7
  31. package/dist/components/ConfigModal.svelte +9 -1
  32. package/dist/components/ConfigPanel.svelte +234 -15
  33. package/dist/components/ConfigPanel.svelte.d.ts +6 -0
  34. package/dist/components/EditorStatusBar.stories.svelte +44 -0
  35. package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
  36. package/dist/components/EditorStatusBar.svelte +99 -0
  37. package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
  38. package/dist/components/IconButton.svelte +80 -0
  39. package/dist/components/IconButton.svelte.d.ts +30 -0
  40. package/dist/components/Input.svelte +74 -0
  41. package/dist/components/Input.svelte.d.ts +17 -0
  42. package/dist/components/LogoWordmark.svelte +113 -0
  43. package/dist/components/LogoWordmark.svelte.d.ts +26 -0
  44. package/dist/components/Navbar.svelte +17 -63
  45. package/dist/components/Navbar.svelte.d.ts +3 -0
  46. package/dist/components/NodeSidebar.svelte +21 -126
  47. package/dist/components/NodeSwapPicker.svelte +12 -30
  48. package/dist/components/PipelineStatus.svelte +6 -1
  49. package/dist/components/PipelineStatus.svelte.d.ts +3 -0
  50. package/dist/components/PortMappingRow.svelte +0 -2
  51. package/dist/components/SchemaForm.svelte +4 -14
  52. package/dist/components/Select.svelte +53 -0
  53. package/dist/components/Select.svelte.d.ts +15 -0
  54. package/dist/components/SettingsModal.svelte +0 -5
  55. package/dist/components/SettingsPanel.svelte +33 -6
  56. package/dist/components/Textarea.svelte +39 -0
  57. package/dist/components/Textarea.svelte.d.ts +12 -0
  58. package/dist/components/ThemeToggle.svelte +15 -94
  59. package/dist/components/UniversalNode.svelte +36 -4
  60. package/dist/components/UniversalNode.svelte.d.ts +1 -1
  61. package/dist/components/WorkflowEditor.svelte +71 -54
  62. package/dist/components/WorkflowEditor.svelte.d.ts +21 -0
  63. package/dist/components/chat/AIChatPanel.svelte +49 -8
  64. package/dist/components/chat/CommandPreview.svelte +10 -1
  65. package/dist/components/console/ConsoleAutocomplete.svelte +1 -1
  66. package/dist/components/console/ConsoleInput.svelte +3 -3
  67. package/dist/components/console/ConsoleOutput.svelte +2 -2
  68. package/dist/components/form/FormArray.svelte +37 -173
  69. package/dist/components/form/FormAutocomplete.svelte +18 -15
  70. package/dist/components/form/FormCheckboxGroup.svelte +1 -5
  71. package/dist/components/form/FormCodeEditor.svelte +9 -7
  72. package/dist/components/form/FormField.svelte +18 -42
  73. package/dist/components/form/FormFieldLight.svelte +52 -48
  74. package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
  75. package/dist/components/form/FormFieldset.svelte +45 -11
  76. package/dist/components/form/FormMarkdownEditor.svelte +8 -5
  77. package/dist/components/form/FormNumberField.svelte +4 -36
  78. package/dist/components/form/FormPorts.svelte +280 -0
  79. package/dist/components/form/FormPorts.svelte.d.ts +13 -0
  80. package/dist/components/form/FormRangeField.svelte +63 -30
  81. package/dist/components/form/FormSelect.svelte +13 -75
  82. package/dist/components/form/FormTemplateEditor.svelte +6 -4
  83. package/dist/components/form/FormTextField.svelte +3 -35
  84. package/dist/components/form/FormTextarea.svelte +4 -39
  85. package/dist/components/form/FormToggle.svelte +27 -6
  86. package/dist/components/form/FormToggle.svelte.d.ts +5 -0
  87. package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
  88. package/dist/components/form/resolveFieldType.d.ts +24 -0
  89. package/dist/components/form/resolveFieldType.js +55 -0
  90. package/dist/components/icons/CloseIcon.svelte +6 -0
  91. package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
  92. package/dist/components/icons/CommandLineIcon.svelte +15 -0
  93. package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
  94. package/dist/components/icons/MenuIcon.svelte +4 -0
  95. package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
  96. package/dist/components/icons/MenuOpenIcon.svelte +6 -0
  97. package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
  98. package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
  99. package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
  100. package/dist/components/interrupt/InterruptBubble.svelte +11 -12
  101. package/dist/components/interrupt/ReviewPrompt.svelte +0 -20
  102. package/dist/components/interrupt/TextInputPrompt.svelte +0 -6
  103. package/dist/components/layouts/MainLayout.svelte +4 -5
  104. package/dist/components/nodes/AtomNode.svelte +62 -76
  105. package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
  106. package/dist/components/nodes/GatewayNode.svelte +117 -164
  107. package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
  108. package/dist/components/nodes/IdeaNode.svelte +72 -98
  109. package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
  110. package/dist/components/nodes/NodeConfigButton.svelte +86 -0
  111. package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
  112. package/dist/components/nodes/NotesNode.svelte +76 -85
  113. package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
  114. package/dist/components/nodes/SimpleNode.svelte +59 -133
  115. package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
  116. package/dist/components/nodes/SquareNode.svelte +110 -164
  117. package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
  118. package/dist/components/nodes/TerminalNode.svelte +62 -124
  119. package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
  120. package/dist/components/nodes/ToolNode.svelte +92 -103
  121. package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
  122. package/dist/components/nodes/WorkflowNode.svelte +132 -191
  123. package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
  124. package/dist/components/playground/ChatInput.svelte +316 -27
  125. package/dist/components/playground/ChatInput.svelte.d.ts +31 -1
  126. package/dist/components/playground/ControlPanel.svelte +22 -0
  127. package/dist/components/playground/ControlPanel.svelte.d.ts +13 -0
  128. package/dist/components/playground/InputCollector.svelte +11 -48
  129. package/dist/components/playground/PipelineKanbanView.svelte +6 -4
  130. package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
  131. package/dist/components/playground/PipelinePanel.svelte +20 -3
  132. package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
  133. package/dist/components/playground/PipelineTableView.svelte +6 -4
  134. package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
  135. package/dist/components/playground/Playground.svelte +292 -28
  136. package/dist/components/playground/Playground.svelte.d.ts +3 -0
  137. package/dist/components/playground/PlaygroundApp.svelte +6 -1
  138. package/dist/components/playground/PlaygroundApp.svelte.d.ts +3 -0
  139. package/dist/components/playground/PlaygroundModal.svelte +5 -0
  140. package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -0
  141. package/dist/components/playground/PlaygroundStudio.svelte +7 -6
  142. package/dist/components/playground/PlaygroundStudio.svelte.d.ts +3 -0
  143. package/dist/components/playground/pipelineViewUtils.svelte.d.ts +2 -1
  144. package/dist/components/playground/pipelineViewUtils.svelte.js +2 -2
  145. package/dist/components/surfaces/SurfaceOverlay.svelte +153 -0
  146. package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
  147. package/dist/components/surfaces/TabbedSurface.svelte +133 -0
  148. package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
  149. package/dist/config/endpoints.d.ts +71 -1
  150. package/dist/config/endpoints.js +46 -5
  151. package/dist/core/index.d.ts +2 -3
  152. package/dist/core/index.js +2 -6
  153. package/dist/display/index.d.ts +6 -1
  154. package/dist/display/index.js +9 -1
  155. package/dist/editor/index.d.ts +1 -1
  156. package/dist/editor/index.js +1 -1
  157. package/dist/form/full.d.ts +2 -1
  158. package/dist/form/full.js +4 -1
  159. package/dist/form/index.d.ts +0 -1
  160. package/dist/form/index.js +3 -2
  161. package/dist/helpers/workflowEditorHelper.d.ts +4 -2
  162. package/dist/helpers/workflowEditorHelper.js +8 -8
  163. package/dist/messages/defaults.d.ts +98 -0
  164. package/dist/messages/defaults.js +58 -1
  165. package/dist/messages/index.d.ts +1 -1
  166. package/dist/messages/index.js +1 -1
  167. package/dist/openapi/v1/openapi.yaml +35 -23
  168. package/dist/playground/commands/args.d.ts +32 -0
  169. package/dist/playground/commands/args.js +50 -0
  170. package/dist/playground/commands/dispatch.d.ts +143 -0
  171. package/dist/playground/commands/dispatch.js +162 -0
  172. package/dist/playground/commands/index.d.ts +14 -0
  173. package/dist/playground/commands/index.js +10 -0
  174. package/dist/playground/commands/parser.d.ts +38 -0
  175. package/dist/playground/commands/parser.js +163 -0
  176. package/dist/playground/commands/registry.d.ts +42 -0
  177. package/dist/playground/commands/registry.js +122 -0
  178. package/dist/playground/commands/suggest.d.ts +37 -0
  179. package/dist/playground/commands/suggest.js +46 -0
  180. package/dist/playground/commands/types.d.ts +111 -0
  181. package/dist/playground/commands/types.js +15 -0
  182. package/dist/playground/index.d.ts +21 -2
  183. package/dist/playground/index.js +27 -2
  184. package/dist/playground/mount.d.ts +19 -5
  185. package/dist/playground/mount.js +16 -8
  186. package/dist/playground/runAction.d.ts +48 -0
  187. package/dist/playground/runAction.js +31 -0
  188. package/dist/registry/builtinNodeTypes.d.ts +53 -0
  189. package/dist/registry/builtinNodeTypes.js +67 -0
  190. package/dist/registry/builtinNodes.d.ts +2 -39
  191. package/dist/registry/builtinNodes.js +6 -53
  192. package/dist/registry/nodeComponentRegistry.d.ts +2 -1
  193. package/dist/schemas/v1/workflow.schema.json +16 -14
  194. package/dist/services/agentSpecExecutionService.d.ts +0 -2
  195. package/dist/services/agentSpecExecutionService.js +0 -2
  196. package/dist/services/apiVariableService.js +12 -26
  197. package/dist/services/categoriesApi.js +3 -6
  198. package/dist/services/chatService.d.ts +4 -3
  199. package/dist/services/chatService.js +13 -18
  200. package/dist/services/dynamicSchemaService.d.ts +31 -4
  201. package/dist/services/dynamicSchemaService.js +62 -33
  202. package/dist/services/historyService.d.ts +30 -8
  203. package/dist/services/historyService.js +51 -15
  204. package/dist/services/interruptService.d.ts +7 -6
  205. package/dist/services/interruptService.js +19 -21
  206. package/dist/services/pipelineSignalService.d.ts +97 -0
  207. package/dist/services/pipelineSignalService.js +94 -0
  208. package/dist/services/playgroundService.d.ts +21 -8
  209. package/dist/services/playgroundService.js +45 -25
  210. package/dist/services/portConfigApi.js +3 -6
  211. package/dist/services/settingsService.d.ts +9 -4
  212. package/dist/services/settingsService.js +23 -12
  213. package/dist/services/workflowLaunchService.d.ts +74 -0
  214. package/dist/services/workflowLaunchService.js +74 -0
  215. package/dist/skins/drafter.d.ts +30 -0
  216. package/dist/skins/drafter.js +198 -0
  217. package/dist/skins/index.d.ts +2 -1
  218. package/dist/skins/index.js +4 -2
  219. package/dist/stores/apiContext.d.ts +11 -0
  220. package/dist/stores/apiContext.js +15 -0
  221. package/dist/stores/categoriesStore.svelte.js +0 -1
  222. package/dist/stores/historyStore.svelte.d.ts +17 -3
  223. package/dist/stores/historyStore.svelte.js +30 -3
  224. package/dist/stores/instanceContainer.svelte.js +5 -0
  225. package/dist/stores/playgroundStore.svelte.js +1 -3
  226. package/dist/stores/settingsStore.svelte.d.ts +13 -0
  227. package/dist/stores/settingsStore.svelte.js +32 -0
  228. package/dist/stores/workflowStore.svelte.d.ts +42 -5
  229. package/dist/stores/workflowStore.svelte.js +109 -32
  230. package/dist/styles/base.css +285 -14
  231. package/dist/styles/tokens.css +60 -2
  232. package/dist/svelte-app.d.ts +18 -1
  233. package/dist/svelte-app.js +75 -110
  234. package/dist/themes/drafter.d.ts +2 -0
  235. package/dist/themes/drafter.js +15 -0
  236. package/dist/themes/index.d.ts +2 -1
  237. package/dist/themes/index.js +8 -2
  238. package/dist/types/auth.d.ts +9 -51
  239. package/dist/types/auth.js +4 -54
  240. package/dist/types/chat.d.ts +5 -1
  241. package/dist/types/events.d.ts +18 -0
  242. package/dist/types/events.js +2 -1
  243. package/dist/types/index.d.ts +84 -29
  244. package/dist/types/index.js +0 -1
  245. package/dist/types/settings.d.ts +28 -1
  246. package/dist/types/settings.js +6 -3
  247. package/dist/types/skin.d.ts +1 -1
  248. package/dist/types/theme.d.ts +16 -2
  249. package/dist/types/uischema.d.ts +5 -0
  250. package/dist/utils/canvasSelection.d.ts +25 -0
  251. package/dist/utils/canvasSelection.js +37 -0
  252. package/dist/utils/colors.d.ts +27 -0
  253. package/dist/utils/colors.js +23 -0
  254. package/dist/utils/connections.js +20 -56
  255. package/dist/utils/edgeStyling.js +9 -5
  256. package/dist/utils/fetchWithAuth.d.ts +36 -15
  257. package/dist/utils/fetchWithAuth.js +53 -23
  258. package/dist/utils/nodeFormSchema.d.ts +51 -0
  259. package/dist/utils/nodeFormSchema.js +87 -0
  260. package/dist/utils/nodeIds.d.ts +1 -1
  261. package/dist/utils/nodeIds.js +1 -1
  262. package/dist/utils/nodeSwap.js +3 -6
  263. package/dist/utils/nodeTypes.js +1 -1
  264. package/dist/utils/portUtils.d.ts +47 -11
  265. package/dist/utils/portUtils.js +67 -14
  266. package/dist/utils/portal.d.ts +18 -0
  267. package/dist/utils/portal.js +34 -0
  268. package/dist/utils/schemaMerge.d.ts +25 -0
  269. package/dist/utils/schemaMerge.js +61 -0
  270. package/package.json +2 -1
@@ -127,6 +127,13 @@
127
127
  --fd-card: #ffffff; /* @public */
128
128
  --fd-card-foreground: var(--_gray-9); /* @public */
129
129
 
130
+ /* ----- CHROME PANELS (sidebar + config/inspector panel) -----
131
+ Large editor-shell panels read from these so a theme can make them
132
+ glassy/translucent without touching every other surface. Default to the
133
+ opaque app background + no blur, so existing themes are unchanged. */
134
+ --fd-panel-bg: var(--fd-background); /* @public sidebar + config panel surface */
135
+ --fd-panel-backdrop-filter: none; /* @public glass/frost behind translucent panels; e.g. blur(14px) */
136
+
130
137
  /* ----- HEADER (Distinct header styling) ----- */
131
138
  --fd-header: #f5f7fa; /* @public */
132
139
  --fd-header-foreground: var(--_gray-8); /* @public */
@@ -140,10 +147,45 @@
140
147
  --fd-border-muted: var(--_gray-3); /* @public */
141
148
  --fd-border-strong: var(--_gray-5); /* @public */
142
149
  --fd-ring: var(--_blue-2); /* @public */
150
+ /* Focus-ring geometry. The whole library draws ONE focus ring from these
151
+ (see base.css). Color is theme-aware (--fd-ring); width/offset are not, so
152
+ they live only here. */
153
+ --fd-ring-width: 2px; /* @public */
154
+ --fd-ring-offset: 2px; /* @public */
155
+
156
+ /* ----- EDITOR CANVAS & NODE SURFACES -----
157
+ Scoped surfaces for the graph editor, kept separate from the general app
158
+ "chrome" (navbar, sidebars, panels) so a theme can restyle the canvas/nodes
159
+ without tinting the rest of the UI. Each defaults to its chrome equivalent,
160
+ so overriding the base token (e.g. --fd-card) still cascades here. */
161
+ --fd-canvas-bg: var(--fd-background); /* @public editor canvas (grid) background */
162
+ --fd-node-bg: var(--fd-card); /* @public node body surface */
163
+ --fd-node-header-bg: var(--fd-header); /* @public node header surface */
164
+ --fd-node-radius: var(
165
+ --fd-radius-xl
166
+ ); /* @public node card corner radius; lower for sharper corners */
167
+ --fd-node-shadow: var(
168
+ --fd-shadow-md
169
+ ); /* @public node resting elevation; 'none' for a flat look */
170
+ --fd-node-shadow-hover: var(
171
+ --fd-shadow-lg
172
+ ); /* @public node hover/selected elevation; 'none' for a flat look */
173
+ --fd-node-backdrop-filter: none; /* @public glass/frost effect behind translucent node bodies; e.g. blur(10px) */
143
174
 
144
175
  /* ----- NODE BORDERS (Higher contrast for visibility when zoomed out) ----- */
145
176
  --fd-node-border: var(--_gray-5); /* @public */
146
177
  --fd-node-border-hover: var(--_gray-6); /* @public */
178
+ --fd-node-border-width: 1.5px; /* @public node outline thickness; lower for a thinner look */
179
+ /* Note nodes can carry their own outline so themes can read them as
180
+ informational/annotation rather than a process node. Defaults to the
181
+ shared node border so existing themes are unchanged. */
182
+ --fd-note-border: var(--fd-node-border); /* @public notes-node outline */
183
+ --fd-note-border-hover: var(--fd-node-border-hover); /* @public notes-node outline (hover) */
184
+
185
+ /* ----- CANVAS GRID (pattern color for the editor background grid; any theme
186
+ can recolor whichever grid variant it picks via config.canvas.grid).
187
+ Default matches xyflow's dot-grid color so the default theme is unchanged. */
188
+ --fd-grid-pattern-color: #91919a; /* @public */
147
189
 
148
190
  /* ----- PRIMARY (Interactive/Brand) ----- */
149
191
  --fd-primary: var(--_blue-2); /* @public */
@@ -211,6 +253,12 @@
211
253
  --fd-radius-2xl: 1rem; /* @public 16px */
212
254
  --fd-radius-full: 9999px; /* @public */
213
255
 
256
+ /* Corner radius shared by form controls (input/select/textarea) and their
257
+ group containers (array item boxes, fieldsets, checkbox groups, config
258
+ sections). Defaults to --fd-radius-lg; themes can tighten it independently
259
+ of cards/panels — e.g. Drafter sets 2px for crisp drafting corners. */
260
+ --fd-control-radius: var(--fd-radius-lg); /* @public */
261
+
214
262
  /* ----- SHADOWS (Refined layered shadows for modern depth) ----- */
215
263
  --fd-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04), 0 1px 3px rgb(0 0 0 / 0.06); /* @public */
216
264
  --fd-shadow-md: 0 4px 8px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.04); /* @public */
@@ -307,6 +355,7 @@
307
355
  --fd-scrollbar-thumb: var(--_gray-4); /* @internal */
308
356
  --fd-scrollbar-thumb-hover: var(--_gray-5); /* @internal */
309
357
  --fd-scrollbar-track: var(--_gray-2); /* @internal */
358
+ --fd-scrollbar-radius: 4px; /* @public scrollbar thumb/track corner radius; 0 for square */
310
359
 
311
360
  /* ----- BACKDROP/OVERLAY ----- */
312
361
  --fd-backdrop: rgba(255, 255, 255, 0.8); /* @internal */
@@ -324,11 +373,17 @@
324
373
 
325
374
  /* ----- NODE LAYOUT (Dimensions and port alignment; multiples of 10 for grid) ----- */
326
375
  --fd-node-grid-step: 10; /* @internal — layout algorithm detail */
327
- --fd-node-default-width: 290px; /* @public */
376
+ --fd-node-default-width: 280px; /* @public */
328
377
  --fd-node-header-height: 60px; /* @public */
329
- --fd-node-header-title-height: 40px; /* @internal */
378
+ --fd-node-header-title-height: 40px; /* @internal — fits icon + up to 2 text lines */
330
379
  --fd-node-header-desc-line: 20px; /* @internal */
331
380
  --fd-node-header-gap: 10px; /* @internal */
381
+ /* Divider absorbed into header bottom padding so header height stays on the
382
+ 20px grid regardless of border thickness. */
383
+ --fd-node-header-divider-width: 1px; /* @public */
384
+ --fd-node-header-divider-color: var(
385
+ --fd-border-muted
386
+ ); /* @public — header bottom divider color */
332
387
  --fd-node-port-row-height: 20px; /* @internal */
333
388
  --fd-node-terminal-size: 80px; /* @public */
334
389
  --fd-node-square-size: 80px; /* @public */
@@ -395,6 +450,9 @@
395
450
  --fd-node-border: #4a4a52;
396
451
  --fd-node-border-hover: #5a5a62;
397
452
 
453
+ /* ----- CANVAS GRID (matches xyflow's dark dot-grid color) ----- */
454
+ --fd-grid-pattern-color: #777;
455
+
398
456
  /* ----- NODE COLORS (port type labels/badges - lighter for readability on dark surfaces) ----- */
399
457
  --fd-node-emerald: #34d399;
400
458
  --fd-node-blue: #60a5fa;
@@ -14,7 +14,7 @@ import type { FlowDropTheme, FlowDropThemeName } from './types/theme.js';
14
14
  import type { WorkflowFormatAdapter } from './registry/workflowFormatRegistry.js';
15
15
  import { type FlowDropInstance } from './stores/instanceContainer.svelte.js';
16
16
  import { type DraftStorageOption } from './services/draftStorage.js';
17
- import type { PartialSettings, SettingsCategory } from './types/settings.js';
17
+ import type { PartialSettings, SettingsCategory, SurfacePlacement } from './types/settings.js';
18
18
  import type { NavbarAction } from './types/navbar.js';
19
19
  export type { NavbarAction };
20
20
  /**
@@ -39,6 +39,17 @@ export interface FlowDropMountOptions {
39
39
  showNavbar?: boolean;
40
40
  /** Disable the node sidebar */
41
41
  disableSidebar?: boolean;
42
+ /**
43
+ * Default host for the config panel: `sidebar` (default), `modal`, or
44
+ * `below`. Seeds the user setting on first load; a later user change wins.
45
+ */
46
+ configPlacement?: SurfacePlacement;
47
+ /**
48
+ * Default host for the console / AI Assistant group: `below` (default),
49
+ * `sidebar`, or `modal`. Seeds the user setting on first load; a later user
50
+ * change wins.
51
+ */
52
+ consolePlacement?: SurfacePlacement;
42
53
  /**
43
54
  * Editor interaction mode. Replaces the former `readOnly` + `lockWorkflow`
44
55
  * mount options (2.0). `'edit'` (default) allows editing; `'readonly'` and
@@ -204,6 +215,12 @@ export declare function mountWorkflowEditor(container: HTMLElement, options?: {
204
215
  authProvider?: AuthProvider;
205
216
  /** Instance identifier — see {@link FlowDropMountOptions.instanceId}. */
206
217
  instanceId?: string;
218
+ /**
219
+ * Register the built-in markdown/code/template editors. Batteries-included
220
+ * by default (chunks load lazily). See {@link FlowDropFeatures.builtinEditors}.
221
+ * @default true
222
+ */
223
+ builtinEditors?: boolean;
207
224
  }): Promise<MountedFlowDropApp>;
208
225
  /**
209
226
  * Unmount a FlowDrop app
@@ -55,6 +55,58 @@ function releaseInstance(fd, isDefault) {
55
55
  fd.destroy();
56
56
  }
57
57
  }
58
+ /**
59
+ * Resolve endpoint config, port config and categories from mount options and
60
+ * apply them to the given instance (API context, port-compatibility checker,
61
+ * categories). Shared by `mountFlowDropApp` and `mountWorkflowEditor`.
62
+ *
63
+ * @returns the resolved {@link EndpointConfig} (merged with defaults), which the
64
+ * callers forward to their mounted component.
65
+ */
66
+ async function configureInstance(fd, options) {
67
+ const { endpointConfig, portConfig, categories, authProvider } = options;
68
+ // Create endpoint configuration, merging with defaults so all required
69
+ // endpoints are present.
70
+ const { defaultEndpointConfig } = await import('./config/endpoints.js');
71
+ const config = endpointConfig
72
+ ? {
73
+ ...defaultEndpointConfig,
74
+ ...endpointConfig,
75
+ endpoints: {
76
+ ...defaultEndpointConfig.endpoints,
77
+ ...endpointConfig.endpoints
78
+ }
79
+ }
80
+ : defaultEndpointConfig;
81
+ // Initialize port configuration (fetch from API when not supplied).
82
+ let finalPortConfig = portConfig;
83
+ if (!finalPortConfig) {
84
+ try {
85
+ finalPortConfig = await fetchPortConfig(config, authProvider);
86
+ }
87
+ catch (error) {
88
+ logger.warn('Failed to fetch port config from API, using default:', error);
89
+ finalPortConfig = DEFAULT_PORT_CONFIG;
90
+ }
91
+ }
92
+ // Configure this instance's API context and port compatibility checker.
93
+ fd.api.configure(config, authProvider);
94
+ fd.portCompatibility.reinitialize(finalPortConfig);
95
+ // Initialize this instance's categories (fetch from API when not supplied).
96
+ if (categories) {
97
+ fd.categories.initialize(categories);
98
+ }
99
+ else {
100
+ try {
101
+ const fetchedCategories = await fetchCategories(config, authProvider);
102
+ fd.categories.initialize(fetchedCategories);
103
+ }
104
+ catch (error) {
105
+ logger.warn('Failed to fetch categories from API, using defaults:', error);
106
+ }
107
+ }
108
+ return config;
109
+ }
58
110
  /**
59
111
  * Mount the full FlowDrop App with navbar, sidebars, and workflow editor
60
112
  *
@@ -80,7 +132,7 @@ function releaseInstance(fd, isDefault) {
80
132
  * ```
81
133
  */
82
134
  export async function mountFlowDropApp(container, options = {}) {
83
- const { workflow, nodes, endpointConfig, portConfig, categories, height = '100vh', width = '100%', showNavbar = false, disableSidebar, mode, pipelineId, navbarTitle, navbarActions, showSettings, showStatus, authProvider, eventHandlers, features: userFeatures, settings: initialSettings, draftStorageKey: customDraftKey, draftStorage, formatAdapters, theme, settingsCategories, showSettingsSyncButton, showSettingsResetButton, instanceId } = options;
135
+ const { workflow, nodes, endpointConfig, portConfig, categories, height = '100vh', width = '100%', showNavbar = false, disableSidebar, configPlacement, consolePlacement, mode, pipelineId, navbarTitle, navbarActions, showSettings, showStatus, authProvider, eventHandlers, features: userFeatures, settings: initialSettings, draftStorageKey: customDraftKey, draftStorage, formatAdapters, theme, settingsCategories, showSettingsSyncButton, showSettingsResetButton, instanceId } = options;
84
136
  // Per-instance state container — this is what allows multiple FlowDrop
85
137
  // editors to coexist on one page without sharing workflow/history state.
86
138
  const { fd, isDefault } = acquireInstance(instanceId);
@@ -103,61 +155,14 @@ export async function mountFlowDropApp(container, options = {}) {
103
155
  await initializeSettings({
104
156
  defaults: initialSettings
105
157
  });
106
- // Create endpoint configuration
107
- let config;
108
- if (endpointConfig) {
109
- // Merge with default configuration to ensure all required endpoints are present
110
- const { defaultEndpointConfig } = await import('./config/endpoints.js');
111
- config = {
112
- ...defaultEndpointConfig,
113
- ...endpointConfig,
114
- endpoints: {
115
- ...defaultEndpointConfig.endpoints,
116
- ...endpointConfig.endpoints
117
- }
118
- };
119
- }
120
- else {
121
- // Use default configuration if none provided
122
- const { defaultEndpointConfig } = await import('./config/endpoints.js');
123
- config = defaultEndpointConfig;
124
- }
125
- // Initialize port configuration
126
- let finalPortConfig = portConfig;
127
- if (!finalPortConfig && config) {
128
- // Try to fetch port configuration from API
129
- try {
130
- finalPortConfig = await fetchPortConfig(config, authProvider);
131
- }
132
- catch (error) {
133
- logger.warn('Failed to fetch port config from API, using default:', error);
134
- finalPortConfig = DEFAULT_PORT_CONFIG;
135
- }
136
- }
137
- else if (!finalPortConfig) {
138
- finalPortConfig = DEFAULT_PORT_CONFIG;
139
- }
140
- // Configure this instance's API context (endpoints + auth provider) so
141
- // <App> and services resolve it via getInstance().api.
142
- if (config) {
143
- fd.api.configure(config, authProvider);
144
- }
145
- // Re-initialize this instance's port compatibility checker with the resolved
146
- // config (it was seeded with DEFAULT_PORT_CONFIG at construction).
147
- fd.portCompatibility.reinitialize(finalPortConfig);
148
- // Initialize this instance's categories
149
- if (categories) {
150
- fd.categories.initialize(categories);
151
- }
152
- else if (config) {
153
- try {
154
- const fetchedCategories = await fetchCategories(config, authProvider);
155
- fd.categories.initialize(fetchedCategories);
156
- }
157
- catch (error) {
158
- logger.warn('Failed to fetch categories from API, using defaults:', error);
159
- }
160
- }
158
+ // Resolve and apply endpoint config, port config and categories to this
159
+ // instance (see configureInstance).
160
+ const config = await configureInstance(fd, {
161
+ endpointConfig,
162
+ portConfig,
163
+ categories,
164
+ authProvider
165
+ });
161
166
  // Set up event handler callbacks in this instance's store
162
167
  if (eventHandlers?.onDirtyStateChange) {
163
168
  fd.workflow.setOnDirtyStateChange(eventHandlers.onDirtyStateChange);
@@ -176,6 +181,8 @@ export async function mountFlowDropApp(container, options = {}) {
176
181
  width,
177
182
  showNavbar,
178
183
  disableSidebar,
184
+ configPlacement,
185
+ consolePlacement,
179
186
  mode,
180
187
  pipelineId,
181
188
  navbarTitle,
@@ -335,61 +342,17 @@ export async function mountFlowDropApp(container, options = {}) {
335
342
  * @returns Promise resolving to a MountedFlowDropApp instance
336
343
  */
337
344
  export async function mountWorkflowEditor(container, options = {}) {
338
- const { workflow, endpointConfig, portConfig, categories, authProvider, instanceId } = options;
345
+ const { workflow, endpointConfig, portConfig, categories, authProvider, instanceId, builtinEditors } = options;
339
346
  // Per-instance state container (see mountFlowDropApp)
340
347
  const { fd, isDefault } = acquireInstance(instanceId);
341
- // Create endpoint configuration
342
- let config;
343
- if (endpointConfig) {
344
- // Merge with default configuration to ensure all required endpoints are present
345
- const { defaultEndpointConfig } = await import('./config/endpoints.js');
346
- config = {
347
- ...defaultEndpointConfig,
348
- ...endpointConfig,
349
- endpoints: {
350
- ...defaultEndpointConfig.endpoints,
351
- ...endpointConfig.endpoints
352
- }
353
- };
354
- }
355
- else {
356
- // Use default configuration if none provided
357
- const { defaultEndpointConfig } = await import('./config/endpoints.js');
358
- config = defaultEndpointConfig;
359
- }
360
- // Initialize port configuration
361
- let finalPortConfig = portConfig;
362
- if (!finalPortConfig && config) {
363
- // Try to fetch port configuration from API
364
- try {
365
- finalPortConfig = await fetchPortConfig(config, authProvider);
366
- }
367
- catch (error) {
368
- logger.warn('Failed to fetch port config from API, using default:', error);
369
- finalPortConfig = DEFAULT_PORT_CONFIG;
370
- }
371
- }
372
- else if (!finalPortConfig) {
373
- finalPortConfig = DEFAULT_PORT_CONFIG;
374
- }
375
- // Configure this instance's API context and port compatibility checker.
376
- if (config) {
377
- fd.api.configure(config, authProvider);
378
- }
379
- fd.portCompatibility.reinitialize(finalPortConfig);
380
- // Initialize this instance's categories
381
- if (categories) {
382
- fd.categories.initialize(categories);
383
- }
384
- else if (config) {
385
- try {
386
- const fetchedCategories = await fetchCategories(config, authProvider);
387
- fd.categories.initialize(fetchedCategories);
388
- }
389
- catch (error) {
390
- logger.warn('Failed to fetch categories from API, using defaults:', error);
391
- }
392
- }
348
+ // Resolve and apply endpoint config, port config and categories to this
349
+ // instance (see configureInstance).
350
+ const config = await configureInstance(fd, {
351
+ endpointConfig,
352
+ portConfig,
353
+ categories,
354
+ authProvider
355
+ });
393
356
  // Seed the instance's workflow before mounting so the editor renders it
394
357
  // immediately. (1.x accepted this option but silently ignored it.)
395
358
  if (workflow) {
@@ -400,7 +363,9 @@ export async function mountWorkflowEditor(container, options = {}) {
400
363
  target: container,
401
364
  props: {
402
365
  instance: fd,
403
- endpointConfig: config
366
+ endpointConfig: config,
367
+ authProvider,
368
+ builtinEditors
404
369
  }
405
370
  });
406
371
  // Create the mounted app interface (simpler version)
@@ -0,0 +1,2 @@
1
+ import type { FlowDropTheme } from '../types/theme.js';
2
+ export declare const drafterTheme: FlowDropTheme;
@@ -0,0 +1,15 @@
1
+ import { drafterSkin } from '../skins/drafter.js';
2
+ export const drafterTheme = {
3
+ name: 'drafter',
4
+ skin: drafterSkin,
5
+ config: {
6
+ sidebar: {
7
+ defaultOpen: true,
8
+ categoriesDefaultOpen: false
9
+ },
10
+ // Blueprint square line grid (any theme can opt into a grid variant here)
11
+ canvas: {
12
+ grid: 'lines'
13
+ }
14
+ }
15
+ };
@@ -1,6 +1,7 @@
1
1
  import type { FlowDropTheme, FlowDropThemeName } from '../types/theme.js';
2
2
  import { defaultTheme } from './default.js';
3
3
  import { minimalTheme } from './minimal.js';
4
+ import { drafterTheme } from './drafter.js';
4
5
  /**
5
6
  * Resolve a theme prop to a complete FlowDropTheme object.
6
7
  *
@@ -10,4 +11,4 @@ import { minimalTheme } from './minimal.js';
10
11
  * → minimal theme + { skin.tokens.primary: '#e11d48' }
11
12
  */
12
13
  export declare function resolveTheme(theme: FlowDropTheme | FlowDropThemeName | undefined): FlowDropTheme;
13
- export { defaultTheme, minimalTheme };
14
+ export { defaultTheme, minimalTheme, drafterTheme };
@@ -1,8 +1,10 @@
1
1
  import { defaultTheme } from './default.js';
2
2
  import { minimalTheme } from './minimal.js';
3
+ import { drafterTheme } from './drafter.js';
3
4
  const builtinThemes = {
4
5
  default: defaultTheme,
5
- minimal: minimalTheme
6
+ minimal: minimalTheme,
7
+ drafter: drafterTheme
6
8
  };
7
9
  /**
8
10
  * Resolve a theme prop to a complete FlowDropTheme object.
@@ -35,10 +37,14 @@ export function resolveTheme(theme) {
35
37
  sidebar: {
36
38
  ...base.config?.sidebar,
37
39
  ...theme.config?.sidebar
40
+ },
41
+ canvas: {
42
+ ...base.config?.canvas,
43
+ ...theme.config?.canvas
38
44
  }
39
45
  }
40
46
  };
41
47
  }
42
48
  return theme;
43
49
  }
44
- export { defaultTheme, minimalTheme };
50
+ export { defaultTheme, minimalTheme, drafterTheme };
@@ -2,7 +2,9 @@
2
2
  * Authentication Provider Types for FlowDrop
3
3
  *
4
4
  * Provides interfaces and implementations for authentication in FlowDrop.
5
- * AuthProvider is passed at mount time and cannot be changed without remounting.
5
+ * An AuthProvider is supplied at mount time (or via `fd.api.configure`) and can
6
+ * be swapped at runtime with `fd.api.setAuthProvider(...)` — e.g. on login or
7
+ * logout — without remounting.
6
8
  *
7
9
  * @module types/auth
8
10
  */
@@ -15,8 +17,7 @@
15
17
  * @example
16
18
  * ```typescript
17
19
  * const authProvider: AuthProvider = {
18
- * getAuthHeaders: async () => ({ Authorization: "Bearer token123" }),
19
- * isAuthenticated: () => true
20
+ * getAuthHeaders: async () => ({ Authorization: "Bearer token123" })
20
21
  * };
21
22
  * ```
22
23
  */
@@ -30,15 +31,6 @@ export interface AuthProvider {
30
31
  * @returns Promise resolving to a record of header name-value pairs
31
32
  */
32
33
  getAuthHeaders(): Promise<Record<string, string>>;
33
- /**
34
- * Check if currently authenticated
35
- *
36
- * Used to determine if API requests should be attempted.
37
- * Should return synchronously for performance.
38
- *
39
- * @returns true if authenticated, false otherwise
40
- */
41
- isAuthenticated(): boolean;
42
34
  /**
43
35
  * Called when API returns 401 Unauthorized
44
36
  *
@@ -68,6 +60,11 @@ export interface StaticAuthConfig {
68
60
  token?: string;
69
61
  /** API key (used when type is "api_key") */
70
62
  apiKey?: string;
63
+ /**
64
+ * Header name to carry the API key (used when type is "api_key").
65
+ * Defaults to `"X-API-Key"`.
66
+ */
67
+ apiKeyHeader?: string;
71
68
  /** Custom headers (used when type is "custom") */
72
69
  headers?: Record<string, string>;
73
70
  }
@@ -119,28 +116,6 @@ export declare class StaticAuthProvider implements AuthProvider {
119
116
  * @returns Promise resolving to authentication headers
120
117
  */
121
118
  getAuthHeaders(): Promise<Record<string, string>>;
122
- /**
123
- * Check if authenticated
124
- *
125
- * Returns true if any auth headers are configured.
126
- *
127
- * @returns true if headers are configured
128
- */
129
- isAuthenticated(): boolean;
130
- /**
131
- * Handle unauthorized response
132
- *
133
- * Static provider cannot refresh tokens, so always returns false.
134
- *
135
- * @returns Promise resolving to false (cannot refresh)
136
- */
137
- onUnauthorized(): Promise<boolean>;
138
- /**
139
- * Handle forbidden response
140
- *
141
- * Static provider has no special handling for 403.
142
- */
143
- onForbidden(): Promise<void>;
144
119
  }
145
120
  /**
146
121
  * Configuration for callback-based authentication
@@ -213,15 +188,6 @@ export declare class CallbackAuthProvider implements AuthProvider {
213
188
  * @returns Promise resolving to authentication headers
214
189
  */
215
190
  getAuthHeaders(): Promise<Record<string, string>>;
216
- /**
217
- * Check if authenticated
218
- *
219
- * For callback-based auth, we assume authenticated if getToken exists.
220
- * The actual token validity is checked when making requests.
221
- *
222
- * @returns true (assumes authenticated, actual check happens on request)
223
- */
224
- isAuthenticated(): boolean;
225
191
  /**
226
192
  * Handle unauthorized response
227
193
  *
@@ -252,12 +218,4 @@ export declare class NoAuthProvider implements AuthProvider {
252
218
  * @returns Promise resolving to empty object
253
219
  */
254
220
  getAuthHeaders(): Promise<Record<string, string>>;
255
- /**
256
- * Check if authenticated
257
- *
258
- * Always returns false (no auth configured).
259
- *
260
- * @returns false
261
- */
262
- isAuthenticated(): boolean;
263
221
  }
@@ -2,7 +2,9 @@
2
2
  * Authentication Provider Types for FlowDrop
3
3
  *
4
4
  * Provides interfaces and implementations for authentication in FlowDrop.
5
- * AuthProvider is passed at mount time and cannot be changed without remounting.
5
+ * An AuthProvider is supplied at mount time (or via `fd.api.configure`) and can
6
+ * be swapped at runtime with `fd.api.setAuthProvider(...)` — e.g. on login or
7
+ * logout — without remounting.
6
8
  *
7
9
  * @module types/auth
8
10
  */
@@ -55,7 +57,7 @@ export class StaticAuthProvider {
55
57
  break;
56
58
  case 'api_key':
57
59
  if (config.apiKey) {
58
- this.headers['X-API-Key'] = config.apiKey;
60
+ this.headers[config.apiKeyHeader ?? 'X-API-Key'] = config.apiKey;
59
61
  }
60
62
  break;
61
63
  case 'custom':
@@ -79,35 +81,6 @@ export class StaticAuthProvider {
79
81
  async getAuthHeaders() {
80
82
  return this.headers;
81
83
  }
82
- /**
83
- * Check if authenticated
84
- *
85
- * Returns true if any auth headers are configured.
86
- *
87
- * @returns true if headers are configured
88
- */
89
- isAuthenticated() {
90
- return Object.keys(this.headers).length > 0;
91
- }
92
- /**
93
- * Handle unauthorized response
94
- *
95
- * Static provider cannot refresh tokens, so always returns false.
96
- *
97
- * @returns Promise resolving to false (cannot refresh)
98
- */
99
- async onUnauthorized() {
100
- // Static provider cannot refresh tokens
101
- return false;
102
- }
103
- /**
104
- * Handle forbidden response
105
- *
106
- * Static provider has no special handling for 403.
107
- */
108
- async onForbidden() {
109
- // No special handling for static provider
110
- }
111
84
  }
112
85
  /**
113
86
  * Callback-based authentication provider
@@ -162,19 +135,6 @@ export class CallbackAuthProvider {
162
135
  }
163
136
  return {};
164
137
  }
165
- /**
166
- * Check if authenticated
167
- *
168
- * For callback-based auth, we assume authenticated if getToken exists.
169
- * The actual token validity is checked when making requests.
170
- *
171
- * @returns true (assumes authenticated, actual check happens on request)
172
- */
173
- isAuthenticated() {
174
- // For callback-based auth, we assume authenticated if getToken exists
175
- // The actual token validity is checked when making requests
176
- return true;
177
- }
178
138
  /**
179
139
  * Handle unauthorized response
180
140
  *
@@ -216,14 +176,4 @@ export class NoAuthProvider {
216
176
  async getAuthHeaders() {
217
177
  return {};
218
178
  }
219
- /**
220
- * Check if authenticated
221
- *
222
- * Always returns false (no auth configured).
223
- *
224
- * @returns false
225
- */
226
- isAuthenticated() {
227
- return false;
228
- }
229
179
  }
@@ -48,8 +48,12 @@ export interface ExtractedCommands {
48
48
  }
49
49
  /**
50
50
  * Status of a single command in the preview
51
+ *
52
+ * `skipped` means the command was intentionally not run (e.g. a layout command
53
+ * while `chatAllowLayoutChanges` is off) — it is not a failure and does not
54
+ * trigger retry feedback.
51
55
  */
52
- export type CommandExecutionStatus = 'pending' | 'executing' | 'success' | 'error';
56
+ export type CommandExecutionStatus = 'pending' | 'executing' | 'success' | 'error' | 'skipped';
53
57
  /**
54
58
  * A single command shown in the command preview UI
55
59
  */
@@ -203,6 +203,24 @@ export interface FlowDropFeatures {
203
203
  * @default true
204
204
  */
205
205
  enableNodeSwap?: boolean;
206
+ /**
207
+ * Register the built-in heavy form editors (markdown / code / template).
208
+ *
209
+ * The full editor is batteries-included: node config fields with
210
+ * `format: 'markdown'` / `'code'` / `'template'` render real CodeMirror
211
+ * editors out of the box. Their chunks are code-split and load lazily, so
212
+ * an editor that never opens such a field never downloads CodeMirror/marked.
213
+ *
214
+ * Set to `false` only if you want to strip those editors (e.g. to shave the
215
+ * lazy chunks) and either live with the textarea fallback or register your
216
+ * own field components via `instance.fields.register(...)`.
217
+ *
218
+ * This does not affect the standalone `@flowdrop/flowdrop/form` primitive,
219
+ * which stays opt-in regardless.
220
+ *
221
+ * @default true
222
+ */
223
+ builtinEditors?: boolean;
206
224
  }
207
225
  /**
208
226
  * Default feature values