@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
@@ -0,0 +1,198 @@
1
+ /**
2
+ * Drafter — a fresh, modern "drafting workspace" skin for the whole editor
3
+ * environment (see ref-image.png): a fresh white shell around a mint/aqua
4
+ * canvas with soft cyan/teal technical grid lines, crisp engineering geometry
5
+ * and clean teal-ink text — not a neutral admin UI and not an all-cyan shell.
6
+ *
7
+ * Unlike a canvas-only skin, Drafter themes the entire shell so it reads as one
8
+ * designed environment:
9
+ * - App chrome (navbar, sidebars, inspector, status bars, form fields) stays
10
+ * white/near-white for a clean fresh product feel.
11
+ * - The mint/aqua personality lives in the canvas, node glass, focus rings,
12
+ * selected states and small technical accents.
13
+ * - Disabled/read-only surfaces use quiet light grey so state remains obvious.
14
+ * - Borders are mostly neutral hairlines; strong/focus borders + node outlines
15
+ * are teal/cyan ink (--fd-ring / --fd-border-strong / --fd-node-border).
16
+ * - Focus rings are cyan (--fd-ring), not the default blue.
17
+ * - Nodes are frosted glass with a faint inner highlight; the minimap + zoom
18
+ * controls share the same vocabulary.
19
+ * - Note/instruction cards read as cool annotations (translucent tint + slate
20
+ * ink border), never as a filled "success" card.
21
+ * - Emerald/green is reserved for primary actions, selection and live edges
22
+ * (--fd-primary) — it is not used for every outline.
23
+ *
24
+ * Data-type port colors and category icon colors are left untouched so they keep
25
+ * their full color against the draft surface. The square grid is rendered by
26
+ * WorkflowEditor via config.canvas.grid = 'lines'; --fd-grid-pattern-color
27
+ * colors it. Ships light + dark variants.
28
+ */
29
+ export const drafterSkin = {
30
+ tokens: {
31
+ /* ----- Shell surfaces: fresh white shell + pale mint chrome ----- */
32
+ /* Neutral greys read as cold admin chrome and fight the mint canvas, so the
33
+ quiet surfaces carry a faint aqua-mint tint instead. muted-foreground is
34
+ a darker teal-slate (≈6.5:1 on white) so secondary/helper text clears
35
+ WCAG AA comfortably — grey body text was the accessibility problem. */
36
+ background: '#ffffff',
37
+ foreground: '#10201c',
38
+ muted: '#eaf5f0',
39
+ 'muted-foreground': '#46635b',
40
+ subtle: '#e1f0ea',
41
+ card: '#ffffff',
42
+ 'card-foreground': '#10201c',
43
+ header: '#ffffff',
44
+ 'header-foreground': '#10201c',
45
+ 'header-gradient': 'linear-gradient(180deg, #ffffff 0%, #fbfefd 100%)',
46
+ 'surface-tint': 'rgba(20, 184, 166, 0.015)',
47
+ /* White sidebars/inspector with only a whisper of technical glass */
48
+ 'panel-bg': 'rgba(255, 255, 255, 0.94)',
49
+ 'panel-backdrop-filter': 'blur(10px) saturate(1.04)',
50
+ backdrop: 'rgba(255, 255, 255, 0.92)',
51
+ /* ----- Borders: soft mint hairlines; strong/focus = teal-cyan accent ----- */
52
+ border: '#d3e6df',
53
+ 'border-muted': '#e4f0eb',
54
+ 'border-strong': 'rgba(15, 118, 110, 0.42)',
55
+ ring: '#06b6d4',
56
+ /* ----- Canvas: fresh aqua-mint, soft cyan/teal square grid ----- */
57
+ 'canvas-bg': '#fbfefd',
58
+ 'grid-pattern-color': 'rgba(20, 184, 166, 0.08)',
59
+ /* ----- Nodes: frosted glass, faint inner highlight ----- */
60
+ 'node-bg': 'rgba(247, 252, 250, 0.7)',
61
+ 'node-header-bg': 'rgba(214, 245, 236, 0.6)',
62
+ 'node-backdrop-filter': 'blur(10px) saturate(1.15)',
63
+ 'node-radius': '2px',
64
+ 'node-shadow': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.6)',
65
+ 'node-shadow-hover': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.85)',
66
+ 'node-border': '#0f766e',
67
+ 'node-border-hover': '#0c5f59',
68
+ 'node-border-width': '1.25px',
69
+ /* Header divider matches the node outline ink (tracks light/dark node-border) */
70
+ 'node-header-divider-color': 'var(--fd-node-border)',
71
+ 'handle-border': '#ffffff',
72
+ /* Notes read as cool annotations, not filled success cards */
73
+ 'note-border': '#5b7891',
74
+ 'note-border-hover': '#48617a',
75
+ /* Status hues tuned to the cool palette: danger = rose (teal's warm
76
+ complement, not a generic red), warning = golden amber. Success/info stay
77
+ on the emerald/cyan family so they read as part of the theme. */
78
+ success: '#0d9488',
79
+ 'success-hover': '#0f766e',
80
+ info: '#0891b2',
81
+ 'info-hover': '#0e7490',
82
+ warning: '#d97706',
83
+ 'warning-hover': '#b45309',
84
+ error: '#e11d48',
85
+ 'error-hover': '#be123c',
86
+ /* Status/accent tints are FLAT + OPAQUE (not alpha) so the action buttons
87
+ that use them as fills (form add/move/delete, canvas toggles, secondary)
88
+ read as solid chips, never see-through to the grid. Values are the opaque
89
+ equivalent of the former translucent tints over the white shell. */
90
+ 'info-muted': '#e6f4f7',
91
+ 'success-muted': '#e7f4f3',
92
+ 'warning-muted': '#faefe1',
93
+ 'error-muted': '#fce8ed',
94
+ /* ----- Crisp drafting geometry + flat chrome (2–6px radius, no soft shadow) ----- */
95
+ 'radius-sm': '2px',
96
+ 'radius-md': '3px',
97
+ 'radius-lg': '4px',
98
+ 'radius-xl': '6px',
99
+ /* Form controls + their group containers (fields, array item boxes,
100
+ fieldsets) get the sharpest 2px corner so the config panel reads as
101
+ crisp drafting geometry, not rounded admin chrome. */
102
+ 'control-radius': '2px',
103
+ 'scrollbar-radius': '0',
104
+ 'shadow-sm': 'none',
105
+ 'shadow-md': 'none',
106
+ /* ----- Canvas overlays: light, instrument-like ----- */
107
+ 'minimap-bg': 'rgba(255, 255, 255, 0.72)',
108
+ 'minimap-mask-bg': 'rgba(15, 118, 110, 0.08)',
109
+ 'minimap-mask-stroke': 'rgba(15, 118, 110, 0.35)',
110
+ 'minimap-node-bg': 'rgba(15, 118, 110, 0.3)',
111
+ 'minimap-node-stroke': 'rgba(15, 118, 110, 0.45)',
112
+ 'controls-button-bg': '#ffffff',
113
+ 'controls-button-bg-hover': '#ccfbf1',
114
+ 'controls-button-color': '#0f766e',
115
+ 'controls-button-color-hover': '#0c5f59',
116
+ 'controls-button-border': 'rgba(15, 118, 110, 0.25)',
117
+ /* ----- Secondary = mint, accent = cyan, primary = the one allowed green ----- */
118
+ secondary: '#e4f1ed',
119
+ 'secondary-hover': '#cfe6e0',
120
+ 'secondary-foreground': '#0f3d36',
121
+ accent: '#06b6d4',
122
+ 'accent-hover': '#0891b2',
123
+ 'accent-foreground': '#ffffff',
124
+ 'accent-muted': '#e1f6fa',
125
+ primary: '#10b981',
126
+ 'primary-hover': '#059669',
127
+ 'primary-foreground': '#ffffff',
128
+ 'primary-muted': '#def5ed'
129
+ },
130
+ darkTokens: {
131
+ /* ----- Shell surfaces: deep teal-slate glass ----- */
132
+ background: '#0e2421',
133
+ foreground: '#d8f0ea',
134
+ muted: 'rgba(20, 60, 54, 0.6)',
135
+ 'muted-foreground': '#8fb3aa',
136
+ subtle: 'rgba(13, 47, 44, 0.7)',
137
+ card: 'rgba(18, 42, 38, 0.96)',
138
+ 'card-foreground': '#d8f0ea',
139
+ header: 'rgba(13, 40, 37, 0.7)',
140
+ 'header-foreground': '#d8f0ea',
141
+ 'header-gradient': 'linear-gradient(180deg, rgba(17, 42, 38, 0.9) 0%, rgba(12, 33, 30, 0.9) 100%)',
142
+ 'surface-tint': 'rgba(45, 212, 191, 0.04)',
143
+ 'panel-bg': 'rgba(14, 36, 33, 0.8)',
144
+ 'panel-backdrop-filter': 'blur(14px) saturate(1.2)',
145
+ backdrop: 'rgba(11, 31, 28, 0.8)',
146
+ border: 'rgba(45, 212, 191, 0.22)',
147
+ 'border-muted': 'rgba(45, 212, 191, 0.12)',
148
+ 'border-strong': 'rgba(45, 212, 191, 0.4)',
149
+ ring: '#22d3ee',
150
+ 'canvas-bg': '#0b1f1c',
151
+ 'grid-pattern-color': 'rgba(45, 212, 191, 0.16)',
152
+ 'node-bg': 'rgba(17, 38, 35, 0.62)',
153
+ 'node-header-bg': 'rgba(13, 47, 44, 0.6)',
154
+ 'node-backdrop-filter': 'blur(10px) saturate(1.2)',
155
+ 'node-shadow': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.08)',
156
+ 'node-shadow-hover': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.14)',
157
+ 'node-border': '#0d9488',
158
+ 'node-border-hover': '#2dd4bf',
159
+ 'handle-border': '#0b1f1c',
160
+ 'note-border': '#7d96b0',
161
+ 'note-border-hover': '#9fb4cb',
162
+ success: '#2dd4bf',
163
+ 'success-hover': '#5eead4',
164
+ info: '#22d3ee',
165
+ 'info-hover': '#67e8f9',
166
+ warning: '#fbbf24',
167
+ 'warning-hover': '#fcd34d',
168
+ error: '#fb7185',
169
+ 'error-hover': '#fda4af',
170
+ /* Flat + opaque tints (opaque equivalent of the former alpha tints over the
171
+ deep teal-slate shell) so button fills never go see-through. */
172
+ 'info-muted': '#10393a',
173
+ 'success-muted': '#123934',
174
+ 'warning-muted': '#2f3a21',
175
+ 'error-muted': '#2a2d2d',
176
+ 'minimap-bg': 'rgba(11, 31, 28, 0.7)',
177
+ 'minimap-mask-bg': 'rgba(45, 212, 191, 0.06)',
178
+ 'minimap-mask-stroke': 'rgba(45, 212, 191, 0.3)',
179
+ 'minimap-node-bg': 'rgba(45, 212, 191, 0.28)',
180
+ 'minimap-node-stroke': 'rgba(45, 212, 191, 0.45)',
181
+ 'controls-button-bg': '#102522',
182
+ 'controls-button-bg-hover': '#0d2d2a',
183
+ 'controls-button-color': '#2dd4bf',
184
+ 'controls-button-color-hover': '#5eead4',
185
+ 'controls-button-border': 'rgba(45, 212, 191, 0.3)',
186
+ secondary: '#0d2d2a',
187
+ 'secondary-hover': '#133a34',
188
+ 'secondary-foreground': '#d8f0ea',
189
+ accent: '#22d3ee',
190
+ 'accent-hover': '#67e8f9',
191
+ 'accent-foreground': '#03291c',
192
+ 'accent-muted': '#113d3e',
193
+ primary: '#34d399',
194
+ 'primary-hover': '#6ee7b7',
195
+ 'primary-foreground': '#03291c',
196
+ 'primary-muted': '#144034'
197
+ }
198
+ };
@@ -1,6 +1,7 @@
1
1
  import type { FlowDropSkin, FlowDropSkinName } from '../types/skin';
2
2
  import { defaultSkin } from './default';
3
3
  import { slateSkin } from './slate';
4
+ import { drafterSkin } from './drafter';
4
5
  /**
5
6
  * Resolve a skin prop to a complete FlowDropSkin object.
6
7
  *
@@ -10,4 +11,4 @@ import { slateSkin } from './slate';
10
11
  * → minimal skin tokens + { primary: '#e11d48' }
11
12
  */
12
13
  export declare function resolveSkin(skin: FlowDropSkin | FlowDropSkinName | undefined): FlowDropSkin;
13
- export { defaultSkin, slateSkin };
14
+ export { defaultSkin, slateSkin, drafterSkin };
@@ -1,8 +1,10 @@
1
1
  import { defaultSkin } from './default';
2
2
  import { slateSkin } from './slate';
3
+ import { drafterSkin } from './drafter';
3
4
  const builtinSkins = {
4
5
  default: defaultSkin,
5
- slate: slateSkin
6
+ slate: slateSkin,
7
+ drafter: drafterSkin
6
8
  };
7
9
  /**
8
10
  * Resolve a skin prop to a complete FlowDropSkin object.
@@ -27,4 +29,4 @@ export function resolveSkin(skin) {
27
29
  }
28
30
  return skin;
29
31
  }
30
- export { defaultSkin, slateSkin };
32
+ export { defaultSkin, slateSkin, drafterSkin };
@@ -40,6 +40,17 @@ export declare class ApiContext {
40
40
  * Discards any previously built client so the next access rebuilds it.
41
41
  */
42
42
  configure(config: EndpointConfig, authProvider?: AuthProvider): void;
43
+ /**
44
+ * Swap the auth provider at runtime — e.g. on login or logout — without
45
+ * reconfiguring endpoints or remounting. Propagates to the live client so
46
+ * in-flight components keep working against the same instance.
47
+ *
48
+ * Per-instance services read `fd.api.authProvider` per request, so they pick
49
+ * up the new provider on their next call automatically.
50
+ *
51
+ * @param authProvider - The new authentication provider
52
+ */
53
+ setAuthProvider(authProvider: AuthProvider): void;
43
54
  /** Whether {@link configure} has been called with a usable config. */
44
55
  isConfigured(): boolean;
45
56
  }
@@ -58,6 +58,21 @@ export class ApiContext {
58
58
  // Drop the cached client so it picks up the new config/auth on next access.
59
59
  this.#client = null;
60
60
  }
61
+ /**
62
+ * Swap the auth provider at runtime — e.g. on login or logout — without
63
+ * reconfiguring endpoints or remounting. Propagates to the live client so
64
+ * in-flight components keep working against the same instance.
65
+ *
66
+ * Per-instance services read `fd.api.authProvider` per request, so they pick
67
+ * up the new provider on their next call automatically.
68
+ *
69
+ * @param authProvider - The new authentication provider
70
+ */
71
+ setAuthProvider(authProvider) {
72
+ this.#authProvider = authProvider;
73
+ // Keep the cached client (and its in-flight consumers) in sync.
74
+ this.#client?.setAuthProvider(authProvider);
75
+ }
61
76
  /** Whether {@link configure} has been called with a usable config. */
62
77
  isConfigured() {
63
78
  return Boolean(this.#config);
@@ -28,7 +28,6 @@ export class CategoriesStore {
28
28
  #categories = $state([...DEFAULT_CATEGORIES]);
29
29
  /** Derived lookup map: category name → CategoryDefinition. */
30
30
  #categoryMap = $derived((() => {
31
- // eslint-disable-next-line svelte/prefer-svelte-reactivity -- rebuilt whole inside $derived, never mutated afterwards
32
31
  const map = new Map();
33
32
  for (const cat of this.#categories) {
34
33
  map.set(cat.name, cat);
@@ -24,7 +24,7 @@ export interface HistoryStoreActions {
24
24
  undo: () => boolean;
25
25
  redo: () => boolean;
26
26
  startTransaction: (workflow: Workflow, description?: string) => void;
27
- commitTransaction: () => void;
27
+ commitTransaction: (finalWorkflow: Workflow) => void;
28
28
  cancelTransaction: () => void;
29
29
  clear: (currentWorkflow?: Workflow) => void;
30
30
  canUndo: () => boolean;
@@ -71,6 +71,16 @@ export declare class HistoryStore {
71
71
  * Use this to update the workflow store or other state management.
72
72
  */
73
73
  setOnRestoreCallback(callback: ((workflow: Workflow) => void) | null): void;
74
+ /**
75
+ * Set the callback run just before every undo/redo.
76
+ *
77
+ * Use this to finalize an in-progress edit session (e.g. the workflow store's
78
+ * `finalizeNodeConfig`) so it is committed as one history step *before* being
79
+ * undone. The history service intentionally does not commit dangling
80
+ * transactions itself — it has no access to the live state — so this hook is
81
+ * how the owner of that state flushes it first.
82
+ */
83
+ setBeforeNavigateCallback(callback: (() => void) | null): void;
74
84
  /**
75
85
  * Release the history service subscription.
76
86
  * Called by the owning instance's destroy(); safe to call repeatedly.
@@ -106,8 +116,12 @@ export declare class HistoryStore {
106
116
  * All changes during a transaction are combined into a single undo entry.
107
117
  */
108
118
  startTransaction(workflow: Workflow, description?: string): void;
109
- /** Commit the current transaction. */
110
- commitTransaction(): void;
119
+ /**
120
+ * Commit the current transaction with its final (post-change) state.
121
+ *
122
+ * @param finalWorkflow - The workflow state after the grouped change.
123
+ */
124
+ commitTransaction(finalWorkflow: Workflow): void;
111
125
  /** Cancel the current transaction without committing. */
112
126
  cancelTransaction(): void;
113
127
  /**
@@ -34,6 +34,11 @@ export class HistoryStore {
34
34
  * Invoked when undo/redo operations return a workflow.
35
35
  */
36
36
  #onRestore = null;
37
+ /**
38
+ * Callback run immediately before an undo/redo, to flush any pending edit
39
+ * session into a committed history step (see {@link setBeforeNavigateCallback}).
40
+ */
41
+ #onBeforeNavigate = null;
37
42
  /** Unsubscribe handle for the service subscription. */
38
43
  #unsubscribe;
39
44
  /** The underlying (non-reactive) history service. */
@@ -102,6 +107,18 @@ export class HistoryStore {
102
107
  setOnRestoreCallback(callback) {
103
108
  this.#onRestore = callback;
104
109
  }
110
+ /**
111
+ * Set the callback run just before every undo/redo.
112
+ *
113
+ * Use this to finalize an in-progress edit session (e.g. the workflow store's
114
+ * `finalizeNodeConfig`) so it is committed as one history step *before* being
115
+ * undone. The history service intentionally does not commit dangling
116
+ * transactions itself — it has no access to the live state — so this hook is
117
+ * how the owner of that state flushes it first.
118
+ */
119
+ setBeforeNavigateCallback(callback) {
120
+ this.#onBeforeNavigate = callback;
121
+ }
105
122
  /**
106
123
  * Release the history service subscription.
107
124
  * Called by the owning instance's destroy(); safe to call repeatedly.
@@ -132,6 +149,9 @@ export class HistoryStore {
132
149
  * @returns true if undo was successful, false if at beginning of history
133
150
  */
134
151
  undo() {
152
+ // Flush any pending edit session into a committed step first, so undo reverts
153
+ // exactly that step rather than skipping over an uncommitted edit.
154
+ this.#onBeforeNavigate?.();
135
155
  const previousState = this.#service.undo();
136
156
  if (previousState && this.#onRestore) {
137
157
  this.#onRestore(previousState);
@@ -147,6 +167,9 @@ export class HistoryStore {
147
167
  * @returns true if redo was successful, false if at end of history
148
168
  */
149
169
  redo() {
170
+ // A pending edit session invalidates the redo stack (it is a new change), so
171
+ // finalize it first; redo then correctly reports nothing to redo.
172
+ this.#onBeforeNavigate?.();
150
173
  const nextState = this.#service.redo();
151
174
  if (nextState && this.#onRestore) {
152
175
  this.#onRestore(nextState);
@@ -162,9 +185,13 @@ export class HistoryStore {
162
185
  startTransaction(workflow, description) {
163
186
  this.#service.startTransaction(workflow, description);
164
187
  }
165
- /** Commit the current transaction. */
166
- commitTransaction() {
167
- this.#service.commitTransaction();
188
+ /**
189
+ * Commit the current transaction with its final (post-change) state.
190
+ *
191
+ * @param finalWorkflow - The workflow state after the grouped change.
192
+ */
193
+ commitTransaction(finalWorkflow) {
194
+ this.#service.commitTransaction(finalWorkflow);
168
195
  }
169
196
  /** Cancel the current transaction without committing. */
170
197
  cancelTransaction() {
@@ -55,10 +55,15 @@ export function createFlowDropInstance(options = {}) {
55
55
  // Default wiring: undo/redo restores into this instance's workflow store.
56
56
  // WorkflowEditor overrides this with a richer callback while mounted.
57
57
  historyBindings.setOnRestoreCallback((restored) => workflow.restoreFromHistory(restored));
58
+ // Before any undo/redo, flush a pending config-edit session into a committed
59
+ // step so it can be undone atomically (the history service won't commit a
60
+ // dangling transaction itself — it has no access to the live state).
61
+ historyBindings.setBeforeNavigateCallback(() => workflow.finalizeNodeConfig());
58
62
  const playground = new PlaygroundStore();
59
63
  const cleanups = [
60
64
  () => historyBindings.cleanup(),
61
65
  () => historyBindings.setOnRestoreCallback(null),
66
+ () => historyBindings.setBeforeNavigateCallback(null),
62
67
  () => workflow.setOnDirtyStateChange(null),
63
68
  () => workflow.setOnWorkflowChange(null),
64
69
  () => playground.dispose()
@@ -109,7 +109,6 @@ export class PlaygroundStore {
109
109
  // acknowledged optimistic write, overwritten by the next server response.
110
110
  #isExecuting = $derived(this.#currentSession?.status === 'running');
111
111
  /** Cleanups for active subscribeToSessionStatus effect roots. */
112
- // eslint-disable-next-line svelte/prefer-svelte-reactivity -- non-reactive bookkeeping registry; nothing renders from it
113
112
  #statusSubscriptions = new Set();
114
113
  /** Bound mutation facade — see {@link PlaygroundStoreActions}. */
115
114
  actions;
@@ -213,7 +212,7 @@ export class PlaygroundStore {
213
212
  // Find input nodes in the workflow
214
213
  workflow.nodes.forEach((node) => {
215
214
  const category = node.data.metadata?.category;
216
- const nodeTypeId = node.data.metadata?.id ?? node.type;
215
+ const nodeTypeId = node.data.metadata?.node_type_id ?? node.type;
217
216
  // Check if this is an input-type node
218
217
  // The category can be "inputs" (standard) or variations like "input"
219
218
  const categoryStr = String(category || '');
@@ -354,7 +353,6 @@ export class PlaygroundStore {
354
353
  if (!this.#currentSession)
355
354
  return;
356
355
  const executions = [...(this.#currentSession.executions ?? [])];
357
- // eslint-disable-next-line svelte/prefer-svelte-reactivity -- transient local for dedup within this call
358
356
  const seenIds = new Set(executions.map((e) => e.id));
359
357
  let added = false;
360
358
  let gainedMainRun = false;
@@ -64,6 +64,19 @@ export declare function getSystemThemeState(): ResolvedTheme;
64
64
  * @returns Cleanup function that removes the listener
65
65
  */
66
66
  export declare function initThemeListener(): () => void;
67
+ /**
68
+ * Seed UI settings from host-provided defaults (e.g. mount props) without
69
+ * overriding a returning user's persisted choices.
70
+ *
71
+ * For each provided key, the value is applied only when that key is **absent**
72
+ * from the persisted snapshot — so a mount prop sets the initial behavior but a
73
+ * value the user has actually changed always wins. Seeded values are not
74
+ * written to storage (storage stays user-driven), matching the precedence used
75
+ * by {@link initializeSettings}: library default < host default < user snapshot.
76
+ *
77
+ * @param partial - UI defaults to seed
78
+ */
79
+ export declare function seedUiDefaults(partial: Partial<UISettings>): void;
67
80
  /**
68
81
  * Update settings with partial values
69
82
  *
@@ -268,6 +268,38 @@ function notifyChange(category, key, previousValue, newValue) {
268
268
  function getCategoryAsRecord(settings, category) {
269
269
  return Object.fromEntries(Object.entries(settings[category]));
270
270
  }
271
+ /**
272
+ * Seed UI settings from host-provided defaults (e.g. mount props) without
273
+ * overriding a returning user's persisted choices.
274
+ *
275
+ * For each provided key, the value is applied only when that key is **absent**
276
+ * from the persisted snapshot — so a mount prop sets the initial behavior but a
277
+ * value the user has actually changed always wins. Seeded values are not
278
+ * written to storage (storage stays user-driven), matching the precedence used
279
+ * by {@link initializeSettings}: library default < host default < user snapshot.
280
+ *
281
+ * @param partial - UI defaults to seed
282
+ */
283
+ export function seedUiDefaults(partial) {
284
+ const persistedUi = loadRawFromStorage()?.ui ?? {};
285
+ const seeded = {};
286
+ for (const key of Object.keys(partial)) {
287
+ if (partial[key] === undefined)
288
+ continue;
289
+ if (key in persistedUi)
290
+ continue;
291
+ seeded[key] = partial[key];
292
+ }
293
+ if (Object.keys(seeded).length === 0)
294
+ return;
295
+ storeState = {
296
+ ...storeState,
297
+ settings: {
298
+ ...storeState.settings,
299
+ ui: { ...storeState.settings.ui, ...seeded }
300
+ }
301
+ };
302
+ }
271
303
  /**
272
304
  * Update settings with partial values
273
305
  *
@@ -55,6 +55,10 @@ export interface WorkflowStoreActions {
55
55
  addEdge: (edge: WorkflowEdge) => void;
56
56
  removeEdge: (edgeId: string) => void;
57
57
  updateNode: (nodeId: string, updates: Partial<WorkflowNode>) => void;
58
+ updateNodeConfig: (nodeId: string, updates: Partial<WorkflowNode>, opts?: {
59
+ fieldKey?: string;
60
+ }) => void;
61
+ finalizeNodeConfig: (changeType?: WorkflowChangeType) => void;
58
62
  clear: () => void;
59
63
  updateMetadata: (metadata: Partial<Workflow['metadata']>) => void;
60
64
  batchUpdate: (updates: {
@@ -129,7 +133,7 @@ export declare class WorkflowStore {
129
133
  /**
130
134
  * Set of all handle IDs currently connected to edges.
131
135
  *
132
- * Used by node components to implement hideUnconnectedHandles.
136
+ * Handle IDs are formatted `{nodeId}-{direction}-{portId}`.
133
137
  */
134
138
  get connectedHandles(): Set<string>;
135
139
  /**
@@ -208,6 +212,38 @@ export declare class WorkflowStore {
208
212
  * Used for config changes. Pushes to history for undo support.
209
213
  */
210
214
  updateNode(nodeId: string, updates: Partial<WorkflowNode>): void;
215
+ /**
216
+ * Apply a live config edit to a node.
217
+ *
218
+ * Unlike {@link updateNode}, this is cheap enough to call on every keystroke:
219
+ * it does NOT snapshot the workflow to history and does NOT fire the external
220
+ * change event per call. Instead it opens (lazily) a single history
221
+ * transaction for the field-editing session and defers the change event to
222
+ * {@link finalizeNodeConfig}. Editing a different node or field first
223
+ * finalizes the previous session, so undo granularity is one step per field.
224
+ *
225
+ * The store always reflects the latest value immediately (the mutation and
226
+ * version bump happen here), so a save mid-session persists the current
227
+ * value even if the session hasn't been finalized yet.
228
+ *
229
+ * @param nodeId - Node whose config is being edited
230
+ * @param updates - Partial node updates (typically `{ data }`)
231
+ * @param opts.fieldKey - The config field being edited; drives per-field
232
+ * session boundaries. Omit to treat the whole node as one session.
233
+ */
234
+ updateNodeConfig(nodeId: string, updates: Partial<WorkflowNode>, opts?: {
235
+ fieldKey?: string;
236
+ }): void;
237
+ /**
238
+ * Finalize the in-progress config-edit session, if any.
239
+ *
240
+ * Commits the session's history transaction (one undo step for the whole
241
+ * session) and fires the external change event once. Idempotent: a no-op
242
+ * when no session is open. Call on blur, panel close, node switch, and before
243
+ * save. Undo/redo call this first (via the history facade / command dispatch)
244
+ * so a session becomes a committed step before it is undone.
245
+ */
246
+ finalizeNodeConfig(changeType?: WorkflowChangeType): void;
211
247
  /**
212
248
  * Clear the workflow.
213
249
  *
@@ -242,12 +278,13 @@ export declare class WorkflowStore {
242
278
  description?: string;
243
279
  }): void;
244
280
  /**
245
- * Push current state to history manually.
281
+ * Push the current (post-change) state to history manually.
246
282
  *
247
- * Use this before operations that modify the workflow through other means
248
- * (e.g., drag operations handled by SvelteFlow directly).
283
+ * Use this AFTER operations that modify the workflow through other means
284
+ * (e.g., drag operations handled by SvelteFlow directly), passing the
285
+ * resulting state so undo returns to the state before the operation.
249
286
  *
250
- * @param description - Description of the upcoming change
287
+ * @param description - Description of the change that was just made
251
288
  * @param workflow - Optional workflow to push (uses store state if not provided)
252
289
  */
253
290
  pushHistory(description?: string, workflow?: Workflow): void;