@flowdrop/flowdrop 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/README.md +94 -51
  2. package/dist/adapters/WorkflowAdapter.d.ts +1 -1
  3. package/dist/adapters/WorkflowAdapter.js +27 -47
  4. package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +2 -2
  5. package/dist/adapters/agentspec/AgentSpecAdapter.js +122 -133
  6. package/dist/adapters/agentspec/agentAdapter.d.ts +2 -2
  7. package/dist/adapters/agentspec/agentAdapter.js +10 -10
  8. package/dist/adapters/agentspec/autoLayout.d.ts +52 -6
  9. package/dist/adapters/agentspec/autoLayout.js +118 -23
  10. package/dist/adapters/agentspec/componentTypeDefaults.d.ts +1 -1
  11. package/dist/adapters/agentspec/componentTypeDefaults.js +120 -120
  12. package/dist/adapters/agentspec/defaultNodeTypes.d.ts +2 -2
  13. package/dist/adapters/agentspec/defaultNodeTypes.js +307 -307
  14. package/dist/adapters/agentspec/index.d.ts +10 -10
  15. package/dist/adapters/agentspec/index.js +6 -6
  16. package/dist/adapters/agentspec/validator.d.ts +2 -2
  17. package/dist/adapters/agentspec/validator.js +20 -22
  18. package/dist/api/enhanced-client.d.ts +3 -3
  19. package/dist/api/enhanced-client.js +72 -73
  20. package/dist/chat/commandClassifier.d.ts +19 -0
  21. package/dist/chat/commandClassifier.js +30 -0
  22. package/dist/chat/index.d.ts +27 -0
  23. package/dist/chat/index.js +32 -0
  24. package/dist/chat/responseParser.d.ts +21 -0
  25. package/dist/chat/responseParser.js +91 -0
  26. package/dist/commands/batch.d.ts +18 -0
  27. package/dist/commands/batch.js +54 -0
  28. package/dist/commands/executor.d.ts +37 -0
  29. package/dist/commands/executor.js +1133 -0
  30. package/dist/commands/index.d.ts +14 -0
  31. package/dist/commands/index.js +17 -0
  32. package/dist/commands/parser.d.ts +16 -0
  33. package/dist/commands/parser.js +295 -0
  34. package/dist/commands/positioner.d.ts +19 -0
  35. package/dist/commands/positioner.js +33 -0
  36. package/dist/commands/storeIntegration.svelte.d.ts +16 -0
  37. package/dist/commands/storeIntegration.svelte.js +67 -0
  38. package/dist/commands/types.d.ts +343 -0
  39. package/dist/commands/types.js +45 -0
  40. package/dist/components/App.svelte +522 -237
  41. package/dist/components/App.svelte.d.ts +11 -8
  42. package/dist/components/CanvasBanner.stories.svelte +10 -16
  43. package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
  44. package/dist/components/CanvasBanner.svelte +2 -2
  45. package/dist/components/CanvasBanner.svelte.d.ts +1 -1
  46. package/dist/components/CanvasController.svelte +37 -0
  47. package/dist/components/CanvasController.svelte.d.ts +32 -0
  48. package/dist/components/ConfigForm.svelte +118 -256
  49. package/dist/components/ConfigForm.svelte.d.ts +2 -2
  50. package/dist/components/ConfigMappingRow.svelte +128 -0
  51. package/dist/components/ConfigMappingRow.svelte.d.ts +8 -0
  52. package/dist/components/ConfigModal.svelte +3 -3
  53. package/dist/components/ConfigModal.svelte.d.ts +1 -1
  54. package/dist/components/ConfigPanel.stories.svelte +19 -19
  55. package/dist/components/ConfigPanel.stories.svelte.d.ts +1 -1
  56. package/dist/components/ConfigPanel.svelte +57 -19
  57. package/dist/components/ConfigPanel.svelte.d.ts +3 -1
  58. package/dist/components/ConnectionLine.svelte +4 -4
  59. package/dist/components/EdgeRefresher.svelte +1 -1
  60. package/dist/components/FlowDropEdge.stories.svelte +110 -110
  61. package/dist/components/FlowDropEdge.svelte +11 -19
  62. package/dist/components/FlowDropEdge.svelte.d.ts +1 -1
  63. package/dist/components/FlowDropZone.svelte +6 -9
  64. package/dist/components/FlowDropZone.svelte.d.ts +1 -1
  65. package/dist/components/LoadingSpinner.stories.svelte +13 -13
  66. package/dist/components/LoadingSpinner.stories.svelte.d.ts +1 -1
  67. package/dist/components/LoadingSpinner.svelte +3 -3
  68. package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
  69. package/dist/components/Logo.stories.svelte +4 -4
  70. package/dist/components/Logo.stories.svelte.d.ts +1 -1
  71. package/dist/components/Logo.svelte +3 -9
  72. package/dist/components/LogsSidebar.svelte +46 -53
  73. package/dist/components/LogsSidebar.svelte.d.ts +1 -1
  74. package/dist/components/MarkdownDisplay.stories.svelte +10 -14
  75. package/dist/components/MarkdownDisplay.stories.svelte.d.ts +1 -1
  76. package/dist/components/MarkdownDisplay.svelte +4 -6
  77. package/dist/components/Navbar.stories.svelte +19 -19
  78. package/dist/components/Navbar.stories.svelte.d.ts +1 -1
  79. package/dist/components/Navbar.svelte +28 -49
  80. package/dist/components/Navbar.svelte.d.ts +2 -2
  81. package/dist/components/NodeSidebar.svelte +55 -135
  82. package/dist/components/NodeSidebar.svelte.d.ts +1 -1
  83. package/dist/components/NodeStatusOverlay.stories.svelte +19 -31
  84. package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
  85. package/dist/components/NodeStatusOverlay.svelte +40 -55
  86. package/dist/components/NodeStatusOverlay.svelte.d.ts +3 -3
  87. package/dist/components/NodeSwapPicker.svelte +493 -0
  88. package/dist/components/NodeSwapPicker.svelte.d.ts +16 -0
  89. package/dist/components/PipelineStatus.svelte +63 -89
  90. package/dist/components/PipelineStatus.svelte.d.ts +4 -4
  91. package/dist/components/PortCoordinateTracker.svelte +5 -7
  92. package/dist/components/PortCoordinateTracker.svelte.d.ts +1 -1
  93. package/dist/components/PortMappingRow.svelte +205 -0
  94. package/dist/components/PortMappingRow.svelte.d.ts +12 -0
  95. package/dist/components/ReadOnlyDetails.svelte +1 -1
  96. package/dist/components/SchemaForm.stories.svelte +53 -53
  97. package/dist/components/SchemaForm.stories.svelte.d.ts +1 -1
  98. package/dist/components/SchemaForm.svelte +24 -51
  99. package/dist/components/SchemaForm.svelte.d.ts +2 -2
  100. package/dist/components/SettingsModal.svelte +6 -9
  101. package/dist/components/SettingsModal.svelte.d.ts +1 -1
  102. package/dist/components/SettingsPanel.svelte +138 -158
  103. package/dist/components/SettingsPanel.svelte.d.ts +1 -1
  104. package/dist/components/StatusIcon.stories.svelte +16 -29
  105. package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
  106. package/dist/components/StatusIcon.svelte +19 -19
  107. package/dist/components/StatusIcon.svelte.d.ts +2 -2
  108. package/dist/components/StatusLabel.stories.svelte +8 -8
  109. package/dist/components/StatusLabel.stories.svelte.d.ts +1 -1
  110. package/dist/components/SwapMappingEditor.svelte +529 -0
  111. package/dist/components/SwapMappingEditor.svelte.d.ts +12 -0
  112. package/dist/components/ThemeToggle.stories.svelte +10 -10
  113. package/dist/components/ThemeToggle.stories.svelte.d.ts +1 -1
  114. package/dist/components/ThemeToggle.svelte +22 -33
  115. package/dist/components/ThemeToggle.svelte.d.ts +1 -1
  116. package/dist/components/UniversalNode.svelte +29 -41
  117. package/dist/components/UniversalNode.svelte.d.ts +3 -3
  118. package/dist/components/WorkflowEditor.svelte +210 -170
  119. package/dist/components/WorkflowEditor.svelte.d.ts +12 -4
  120. package/dist/components/chat/AIChatPanel.svelte +797 -0
  121. package/dist/components/chat/AIChatPanel.svelte.d.ts +13 -0
  122. package/dist/components/chat/CommandPreview.svelte +234 -0
  123. package/dist/components/chat/CommandPreview.svelte.d.ts +9 -0
  124. package/dist/components/console/CommandConsole.stories.svelte +111 -0
  125. package/dist/components/console/CommandConsole.stories.svelte.d.ts +27 -0
  126. package/dist/components/console/CommandConsole.svelte +263 -0
  127. package/dist/components/console/CommandConsole.svelte.d.ts +11 -0
  128. package/dist/components/console/ConsoleAutocomplete.svelte +142 -0
  129. package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +21 -0
  130. package/dist/components/console/ConsoleInput.svelte +771 -0
  131. package/dist/components/console/ConsoleInput.svelte.d.ts +16 -0
  132. package/dist/components/console/ConsoleOutput.svelte +116 -0
  133. package/dist/components/console/ConsoleOutput.svelte.d.ts +11 -0
  134. package/dist/components/console/formatters.d.ts +26 -0
  135. package/dist/components/console/formatters.js +116 -0
  136. package/dist/components/form/FormArray.svelte +75 -132
  137. package/dist/components/form/FormArray.svelte.d.ts +1 -1
  138. package/dist/components/form/FormAutocomplete.svelte +65 -108
  139. package/dist/components/form/FormAutocomplete.svelte.d.ts +1 -1
  140. package/dist/components/form/FormCheckboxGroup.stories.svelte +13 -16
  141. package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +1 -1
  142. package/dist/components/form/FormCheckboxGroup.svelte +2 -2
  143. package/dist/components/form/FormCodeEditor.svelte +42 -56
  144. package/dist/components/form/FormField.svelte +79 -90
  145. package/dist/components/form/FormField.svelte.d.ts +2 -2
  146. package/dist/components/form/FormFieldLight.svelte +72 -88
  147. package/dist/components/form/FormFieldLight.svelte.d.ts +1 -1
  148. package/dist/components/form/FormFieldWrapper.stories.svelte +14 -14
  149. package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +1 -1
  150. package/dist/components/form/FormFieldWrapper.svelte +2 -9
  151. package/dist/components/form/FormFieldWrapper.svelte.d.ts +1 -1
  152. package/dist/components/form/FormFieldset.svelte +3 -3
  153. package/dist/components/form/FormFieldset.svelte.d.ts +2 -2
  154. package/dist/components/form/FormMarkdownEditor.svelte +123 -156
  155. package/dist/components/form/FormNumberField.stories.svelte +18 -18
  156. package/dist/components/form/FormNumberField.stories.svelte.d.ts +1 -1
  157. package/dist/components/form/FormNumberField.svelte +6 -6
  158. package/dist/components/form/FormRangeField.stories.svelte +13 -13
  159. package/dist/components/form/FormRangeField.stories.svelte.d.ts +1 -1
  160. package/dist/components/form/FormRangeField.svelte +4 -12
  161. package/dist/components/form/FormSelect.stories.svelte +21 -21
  162. package/dist/components/form/FormSelect.stories.svelte.d.ts +1 -1
  163. package/dist/components/form/FormSelect.svelte +5 -5
  164. package/dist/components/form/FormSelect.svelte.d.ts +1 -1
  165. package/dist/components/form/FormTemplateEditor.svelte +126 -175
  166. package/dist/components/form/FormTemplateEditor.svelte.d.ts +1 -1
  167. package/dist/components/form/FormTextField.stories.svelte +17 -23
  168. package/dist/components/form/FormTextField.stories.svelte.d.ts +1 -1
  169. package/dist/components/form/FormTextField.svelte +4 -4
  170. package/dist/components/form/FormTextarea.stories.svelte +18 -21
  171. package/dist/components/form/FormTextarea.stories.svelte.d.ts +1 -1
  172. package/dist/components/form/FormTextarea.svelte +4 -4
  173. package/dist/components/form/FormToggle.stories.svelte +13 -16
  174. package/dist/components/form/FormToggle.stories.svelte.d.ts +1 -1
  175. package/dist/components/form/FormToggle.svelte +3 -3
  176. package/dist/components/form/FormUISchemaRenderer.svelte +12 -19
  177. package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +3 -3
  178. package/dist/components/form/index.d.ts +19 -19
  179. package/dist/components/form/index.js +18 -18
  180. package/dist/components/form/templateAutocomplete.d.ts +2 -2
  181. package/dist/components/form/templateAutocomplete.js +55 -64
  182. package/dist/components/form/types.d.ts +6 -6
  183. package/dist/components/form/types.js +4 -9
  184. package/dist/components/icons/AlertCircleIcon.svelte +1 -6
  185. package/dist/components/icons/CogIcon.svelte +1 -6
  186. package/dist/components/interrupt/ChoicePrompt.stories.svelte +27 -27
  187. package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +1 -1
  188. package/dist/components/interrupt/ChoicePrompt.svelte +17 -41
  189. package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +1 -1
  190. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +17 -17
  191. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +1 -1
  192. package/dist/components/interrupt/ConfirmationPrompt.svelte +10 -16
  193. package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +1 -1
  194. package/dist/components/interrupt/FormPrompt.svelte +10 -15
  195. package/dist/components/interrupt/FormPrompt.svelte.d.ts +1 -1
  196. package/dist/components/interrupt/InterruptBubble.svelte +87 -121
  197. package/dist/components/interrupt/InterruptBubble.svelte.d.ts +2 -2
  198. package/dist/components/interrupt/ReviewPrompt.stories.svelte +37 -37
  199. package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +1 -1
  200. package/dist/components/interrupt/ReviewPrompt.svelte +55 -75
  201. package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +1 -1
  202. package/dist/components/interrupt/TextInputPrompt.stories.svelte +16 -17
  203. package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
  204. package/dist/components/interrupt/TextInputPrompt.svelte +13 -18
  205. package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +1 -1
  206. package/dist/components/interrupt/index.d.ts +6 -5
  207. package/dist/components/interrupt/index.js +6 -5
  208. package/dist/components/layouts/MainLayout.svelte +46 -84
  209. package/dist/components/layouts/MainLayout.svelte.d.ts +6 -6
  210. package/dist/components/nodes/GatewayNode.stories.svelte +64 -65
  211. package/dist/components/nodes/GatewayNode.svelte +37 -70
  212. package/dist/components/nodes/GatewayNode.svelte.d.ts +3 -3
  213. package/dist/components/nodes/IdeaNode.stories.svelte +25 -26
  214. package/dist/components/nodes/IdeaNode.svelte +22 -36
  215. package/dist/components/nodes/IdeaNode.svelte.d.ts +1 -1
  216. package/dist/components/nodes/NotesNode.stories.svelte +37 -38
  217. package/dist/components/nodes/NotesNode.svelte +28 -39
  218. package/dist/components/nodes/NotesNode.svelte.d.ts +1 -1
  219. package/dist/components/nodes/SimpleNode.stories.svelte +137 -138
  220. package/dist/components/nodes/SimpleNode.svelte +44 -74
  221. package/dist/components/nodes/SimpleNode.svelte.d.ts +1 -1
  222. package/dist/components/nodes/SquareNode.stories.svelte +75 -75
  223. package/dist/components/nodes/SquareNode.svelte +42 -68
  224. package/dist/components/nodes/SquareNode.svelte.d.ts +1 -1
  225. package/dist/components/nodes/TerminalNode.stories.svelte +10 -10
  226. package/dist/components/nodes/TerminalNode.svelte +74 -112
  227. package/dist/components/nodes/TerminalNode.svelte.d.ts +1 -1
  228. package/dist/components/nodes/ToolNode.stories.svelte +115 -116
  229. package/dist/components/nodes/ToolNode.svelte +31 -64
  230. package/dist/components/nodes/ToolNode.svelte.d.ts +1 -1
  231. package/dist/components/nodes/WorkflowNode.stories.svelte +84 -89
  232. package/dist/components/nodes/WorkflowNode.svelte +50 -103
  233. package/dist/components/nodes/WorkflowNode.svelte.d.ts +3 -3
  234. package/dist/components/playground/ChatPanel.svelte +47 -103
  235. package/dist/components/playground/ExecutionLogs.svelte +45 -68
  236. package/dist/components/playground/InputCollector.svelte +32 -51
  237. package/dist/components/playground/MessageBubble.stories.svelte +25 -25
  238. package/dist/components/playground/MessageBubble.stories.svelte.d.ts +1 -1
  239. package/dist/components/playground/MessageBubble.svelte +54 -70
  240. package/dist/components/playground/MessageBubble.svelte.d.ts +1 -1
  241. package/dist/components/playground/Playground.svelte +60 -91
  242. package/dist/components/playground/Playground.svelte.d.ts +3 -3
  243. package/dist/components/playground/PlaygroundModal.svelte +8 -12
  244. package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -3
  245. package/dist/components/playground/SessionManager.svelte +34 -40
  246. package/dist/components/playground/SessionManager.svelte.d.ts +1 -1
  247. package/dist/config/agentSpecEndpoints.d.ts +1 -1
  248. package/dist/config/agentSpecEndpoints.js +20 -20
  249. package/dist/config/constants.js +2 -2
  250. package/dist/config/defaultCategories.d.ts +1 -1
  251. package/dist/config/defaultCategories.js +86 -86
  252. package/dist/config/defaultPortConfig.d.ts +1 -1
  253. package/dist/config/defaultPortConfig.js +144 -144
  254. package/dist/config/endpoints.d.ts +12 -4
  255. package/dist/config/endpoints.js +70 -65
  256. package/dist/config/runtimeConfig.d.ts +2 -2
  257. package/dist/config/runtimeConfig.js +8 -8
  258. package/dist/core/index.d.ts +68 -63
  259. package/dist/core/index.js +44 -35
  260. package/dist/display/index.d.ts +2 -2
  261. package/dist/display/index.js +2 -2
  262. package/dist/editor/index.d.ts +64 -62
  263. package/dist/editor/index.js +57 -55
  264. package/dist/form/code.d.ts +5 -5
  265. package/dist/form/code.js +14 -14
  266. package/dist/form/fieldRegistry.d.ts +3 -3
  267. package/dist/form/fieldRegistry.js +9 -11
  268. package/dist/form/full.d.ts +8 -8
  269. package/dist/form/full.js +9 -9
  270. package/dist/form/index.d.ts +18 -18
  271. package/dist/form/index.js +16 -16
  272. package/dist/form/markdown.d.ts +4 -4
  273. package/dist/form/markdown.js +8 -8
  274. package/dist/helpers/proximityConnect.d.ts +3 -3
  275. package/dist/helpers/proximityConnect.js +40 -35
  276. package/dist/helpers/workflowEditorHelper.d.ts +8 -58
  277. package/dist/helpers/workflowEditorHelper.js +73 -292
  278. package/dist/index.d.ts +6 -6
  279. package/dist/index.js +6 -6
  280. package/dist/mocks/app-environment.js +2 -2
  281. package/dist/mocks/app-forms.js +1 -1
  282. package/dist/mocks/app-navigation.js +2 -2
  283. package/dist/mocks/app-stores.js +3 -3
  284. package/dist/playground/index.d.ts +19 -19
  285. package/dist/playground/index.js +16 -16
  286. package/dist/playground/mount.d.ts +3 -3
  287. package/dist/playground/mount.js +24 -24
  288. package/dist/registry/builtinFormats.js +13 -13
  289. package/dist/registry/builtinNodes.d.ts +2 -2
  290. package/dist/registry/builtinNodes.js +77 -77
  291. package/dist/registry/index.d.ts +4 -4
  292. package/dist/registry/index.js +4 -4
  293. package/dist/registry/nodeComponentRegistry.d.ts +8 -8
  294. package/dist/registry/nodeComponentRegistry.js +9 -11
  295. package/dist/registry/plugin.d.ts +2 -2
  296. package/dist/registry/plugin.js +11 -11
  297. package/dist/registry/workflowFormatRegistry.d.ts +3 -3
  298. package/dist/registry/workflowFormatRegistry.js +2 -2
  299. package/dist/schema/index.d.ts +1 -1
  300. package/dist/schema/index.js +2 -2
  301. package/dist/schemas/v1/workflow.schema.json +107 -22
  302. package/dist/services/agentSpecExecutionService.d.ts +3 -3
  303. package/dist/services/agentSpecExecutionService.js +55 -56
  304. package/dist/services/api.d.ts +2 -2
  305. package/dist/services/api.js +37 -37
  306. package/dist/services/apiVariableService.d.ts +1 -1
  307. package/dist/services/apiVariableService.js +34 -41
  308. package/dist/services/autoSaveService.js +8 -8
  309. package/dist/services/categoriesApi.d.ts +2 -2
  310. package/dist/services/categoriesApi.js +8 -8
  311. package/dist/services/chatService.d.ts +65 -0
  312. package/dist/services/chatService.js +131 -0
  313. package/dist/services/draftStorage.d.ts +1 -1
  314. package/dist/services/draftStorage.js +11 -11
  315. package/dist/services/dynamicSchemaService.d.ts +1 -1
  316. package/dist/services/dynamicSchemaService.js +39 -41
  317. package/dist/services/globalSave.d.ts +2 -2
  318. package/dist/services/globalSave.js +38 -41
  319. package/dist/services/historyService.d.ts +7 -5
  320. package/dist/services/historyService.js +29 -14
  321. package/dist/services/interruptService.d.ts +1 -1
  322. package/dist/services/interruptService.js +29 -35
  323. package/dist/services/nodeExecutionService.d.ts +1 -1
  324. package/dist/services/nodeExecutionService.js +44 -45
  325. package/dist/services/playgroundService.d.ts +1 -1
  326. package/dist/services/playgroundService.js +29 -29
  327. package/dist/services/portConfigApi.d.ts +2 -2
  328. package/dist/services/portConfigApi.js +8 -8
  329. package/dist/services/settingsService.d.ts +2 -2
  330. package/dist/services/settingsService.js +19 -25
  331. package/dist/services/toastService.d.ts +4 -4
  332. package/dist/services/toastService.js +33 -33
  333. package/dist/services/variableService.d.ts +1 -1
  334. package/dist/services/variableService.js +36 -36
  335. package/dist/services/workflowStorage.d.ts +2 -2
  336. package/dist/services/workflowStorage.js +13 -13
  337. package/dist/settings/index.d.ts +7 -7
  338. package/dist/settings/index.js +6 -6
  339. package/dist/skins/default.d.ts +1 -1
  340. package/dist/skins/default.js +1 -1
  341. package/dist/skins/index.d.ts +3 -3
  342. package/dist/skins/index.js +7 -7
  343. package/dist/skins/slate.d.ts +1 -1
  344. package/dist/skins/slate.js +69 -69
  345. package/dist/stores/categoriesStore.svelte.d.ts +1 -1
  346. package/dist/stores/categoriesStore.svelte.js +5 -5
  347. package/dist/stores/editorStateMachine.svelte.d.ts +2 -2
  348. package/dist/stores/editorStateMachine.svelte.js +34 -34
  349. package/dist/stores/historyStore.svelte.d.ts +4 -4
  350. package/dist/stores/historyStore.svelte.js +4 -4
  351. package/dist/stores/interruptStore.svelte.d.ts +3 -3
  352. package/dist/stores/interruptStore.svelte.js +27 -22
  353. package/dist/stores/playgroundStore.svelte.d.ts +3 -3
  354. package/dist/stores/playgroundStore.svelte.js +29 -23
  355. package/dist/stores/portCoordinateStore.svelte.d.ts +6 -2
  356. package/dist/stores/portCoordinateStore.svelte.js +30 -39
  357. package/dist/stores/settingsStore.svelte.d.ts +2 -2
  358. package/dist/stores/settingsStore.svelte.js +57 -62
  359. package/dist/stores/workflowStore.svelte.d.ts +34 -5
  360. package/dist/stores/workflowStore.svelte.js +127 -108
  361. package/dist/stories/CanvasDecorator.svelte +7 -10
  362. package/dist/stories/CanvasDecorator.svelte.d.ts +2 -2
  363. package/dist/stories/EdgeDecorator.svelte +28 -31
  364. package/dist/stories/EdgeDecorator.svelte.d.ts +1 -1
  365. package/dist/stories/NodeDecorator.svelte +14 -20
  366. package/dist/stories/NodeDecorator.svelte.d.ts +1 -1
  367. package/dist/stories/utils.d.ts +2 -2
  368. package/dist/stories/utils.js +89 -93
  369. package/dist/styles/base.css +16 -50
  370. package/dist/styles/tokens.css +10 -28
  371. package/dist/svelte-app.d.ts +10 -10
  372. package/dist/svelte-app.js +39 -39
  373. package/dist/themes/default.d.ts +1 -1
  374. package/dist/themes/default.js +4 -4
  375. package/dist/themes/index.d.ts +3 -3
  376. package/dist/themes/index.js +11 -11
  377. package/dist/themes/minimal.d.ts +1 -1
  378. package/dist/themes/minimal.js +5 -5
  379. package/dist/types/agentspec.d.ts +18 -18
  380. package/dist/types/agentspec.js +2 -2
  381. package/dist/types/auth.d.ts +1 -1
  382. package/dist/types/auth.js +6 -6
  383. package/dist/types/chat.d.ts +63 -0
  384. package/dist/types/chat.js +9 -0
  385. package/dist/types/config.d.ts +6 -6
  386. package/dist/types/events.d.ts +28 -2
  387. package/dist/types/events.js +2 -1
  388. package/dist/types/index.d.ts +40 -32
  389. package/dist/types/index.js +6 -6
  390. package/dist/types/interrupt.d.ts +6 -6
  391. package/dist/types/interrupt.js +21 -21
  392. package/dist/types/interruptState.d.ts +12 -12
  393. package/dist/types/interruptState.js +66 -66
  394. package/dist/types/playground.d.ts +7 -7
  395. package/dist/types/playground.js +14 -14
  396. package/dist/types/settings.d.ts +12 -4
  397. package/dist/types/settings.js +21 -23
  398. package/dist/types/skin.d.ts +1 -1
  399. package/dist/types/theme.d.ts +2 -2
  400. package/dist/types/uischema.d.ts +4 -4
  401. package/dist/types/uischema.js +3 -3
  402. package/dist/utils/colors.d.ts +1 -1
  403. package/dist/utils/colors.js +95 -97
  404. package/dist/utils/config.d.ts +2 -2
  405. package/dist/utils/config.js +48 -48
  406. package/dist/utils/connections.d.ts +2 -2
  407. package/dist/utils/connections.js +15 -15
  408. package/dist/utils/edgeStyling.d.ts +42 -0
  409. package/dist/utils/edgeStyling.js +173 -0
  410. package/dist/utils/errors.js +3 -3
  411. package/dist/utils/fetchWithAuth.d.ts +1 -1
  412. package/dist/utils/fetchWithAuth.js +2 -2
  413. package/dist/utils/handleIds.d.ts +2 -2
  414. package/dist/utils/handleIds.js +8 -8
  415. package/dist/utils/handlePositioning.d.ts +1 -1
  416. package/dist/utils/handlePositioning.js +2 -2
  417. package/dist/utils/icons.d.ts +1 -1
  418. package/dist/utils/icons.js +74 -74
  419. package/dist/utils/logger.d.ts +1 -1
  420. package/dist/utils/logger.js +7 -7
  421. package/dist/utils/nodeIds.d.ts +31 -0
  422. package/dist/utils/nodeIds.js +42 -0
  423. package/dist/utils/nodeStatus.d.ts +1 -1
  424. package/dist/utils/nodeStatus.js +48 -48
  425. package/dist/utils/nodeSwap.d.ts +221 -0
  426. package/dist/utils/nodeSwap.js +680 -0
  427. package/dist/utils/nodeTypes.d.ts +1 -1
  428. package/dist/utils/nodeTypes.js +20 -21
  429. package/dist/utils/nodeWrapper.d.ts +7 -7
  430. package/dist/utils/nodeWrapper.js +19 -21
  431. package/dist/utils/performanceUtils.d.ts +1 -1
  432. package/dist/utils/performanceUtils.js +1 -2
  433. package/dist/utils/portUtils.d.ts +2 -2
  434. package/dist/utils/portUtils.js +1 -1
  435. package/dist/utils/sanitize.js +1 -1
  436. package/dist/utils/uischema.d.ts +2 -2
  437. package/dist/utils/uischema.js +8 -8
  438. package/dist/utils/validation.js +8 -8
  439. package/package.json +12 -11
  440. package/dist/helpers/nodeLayoutHelper.d.ts +0 -14
  441. package/dist/helpers/nodeLayoutHelper.js +0 -19
@@ -2,10 +2,10 @@
2
2
  * Node Execution Service
3
3
  * Handles fetching and managing node execution information from the backend
4
4
  */
5
- import { getEndpointConfig } from "./api.js";
6
- import { buildEndpointUrl } from "../config/endpoints.js";
7
- import { NODE_EXECUTION_CACHE_TIMEOUT_MS, PIPELINE_API_UNAVAILABLE_DURATION_MS, } from "../config/constants.js";
8
- import { logger } from "../utils/logger.js";
5
+ import { getEndpointConfig } from './api.js';
6
+ import { buildEndpointUrl } from '../config/endpoints.js';
7
+ import { NODE_EXECUTION_CACHE_TIMEOUT_MS, PIPELINE_API_UNAVAILABLE_DURATION_MS } from '../config/constants.js';
8
+ import { logger } from '../utils/logger.js';
9
9
  /**
10
10
  * Service for managing node execution information
11
11
  */
@@ -33,9 +33,9 @@ export class NodeExecutionService {
33
33
  try {
34
34
  const endpointConfig = getEndpointConfig();
35
35
  if (!endpointConfig)
36
- throw new Error("Endpoint config not available");
36
+ throw new Error('Endpoint config not available');
37
37
  const url = buildEndpointUrl(endpointConfig, endpointConfig.endpoints.pipelines.get, {
38
- id: pipelineId,
38
+ id: pipelineId
39
39
  });
40
40
  const response = await fetch(url);
41
41
  if (!response.ok) {
@@ -49,24 +49,24 @@ export class NodeExecutionService {
49
49
  const nodeStatus = nodeStatuses[nodeId];
50
50
  if (!nodeJob && !nodeStatus) {
51
51
  return {
52
- status: "idle",
52
+ status: 'idle',
53
53
  executionCount: 0,
54
- isExecuting: false,
54
+ isExecuting: false
55
55
  };
56
56
  }
57
57
  const executionInfo = {
58
- status: this.mapJobStatusToExecutionStatus(nodeStatus?.status || nodeJob?.status || "idle"),
58
+ status: this.mapJobStatusToExecutionStatus(nodeStatus?.status || nodeJob?.status || 'idle'),
59
59
  executionCount: nodeJob?.execution_count || 0,
60
- isExecuting: nodeStatus?.status === "running" || nodeJob?.status === "running",
60
+ isExecuting: nodeStatus?.status === 'running' || nodeJob?.status === 'running',
61
61
  lastExecuted: nodeJob?.last_executed || nodeStatus?.last_executed,
62
62
  lastExecutionDuration: nodeJob?.execution_time || nodeStatus?.execution_time,
63
- lastError: nodeJob?.error || nodeStatus?.error,
63
+ lastError: nodeJob?.error || nodeStatus?.error
64
64
  };
65
65
  this.cache.set(nodeId, executionInfo);
66
66
  return executionInfo;
67
67
  }
68
68
  catch (error) {
69
- logger.error("Failed to fetch node execution info:", error);
69
+ logger.error('Failed to fetch node execution info:', error);
70
70
  return null;
71
71
  }
72
72
  }
@@ -82,9 +82,9 @@ export class NodeExecutionService {
82
82
  const defaultExecutionInfo = {};
83
83
  nodeIds.forEach((nodeId) => {
84
84
  defaultExecutionInfo[nodeId] = {
85
- status: "idle",
85
+ status: 'idle',
86
86
  executionCount: 0,
87
- isExecuting: false,
87
+ isExecuting: false
88
88
  };
89
89
  });
90
90
  return defaultExecutionInfo;
@@ -92,9 +92,9 @@ export class NodeExecutionService {
92
92
  try {
93
93
  const endpointConfig = getEndpointConfig();
94
94
  if (!endpointConfig)
95
- throw new Error("Endpoint config not available");
95
+ throw new Error('Endpoint config not available');
96
96
  const url = buildEndpointUrl(endpointConfig, endpointConfig.endpoints.pipelines.get, {
97
- id: pipelineId,
97
+ id: pipelineId
98
98
  });
99
99
  const response = await fetch(url);
100
100
  if (!response.ok) {
@@ -103,14 +103,13 @@ export class NodeExecutionService {
103
103
  if (response.status === 404) {
104
104
  logger.warn(`Pipeline API endpoint not available for pipeline ${pipelineId}`);
105
105
  this.apiUnavailable = true;
106
- this.apiUnavailableUntil =
107
- Date.now() + PIPELINE_API_UNAVAILABLE_DURATION_MS;
106
+ this.apiUnavailableUntil = Date.now() + PIPELINE_API_UNAVAILABLE_DURATION_MS;
108
107
  const defaultExecutionInfo = {};
109
108
  nodeIds.forEach((nodeId) => {
110
109
  defaultExecutionInfo[nodeId] = {
111
- status: "idle",
110
+ status: 'idle',
112
111
  executionCount: 0,
113
- isExecuting: false,
112
+ isExecuting: false
114
113
  };
115
114
  });
116
115
  return defaultExecutionInfo;
@@ -123,9 +122,9 @@ export class NodeExecutionService {
123
122
  // Initialize all nodes with default values
124
123
  nodeIds.forEach((nodeId) => {
125
124
  executionInfoMap[nodeId] = {
126
- status: "idle",
125
+ status: 'idle',
127
126
  executionCount: 0,
128
- isExecuting: false,
127
+ isExecuting: false
129
128
  };
130
129
  });
131
130
  // Update with actual job data
@@ -135,10 +134,10 @@ export class NodeExecutionService {
135
134
  executionInfoMap[nodeId] = {
136
135
  status: this.mapJobStatusToExecutionStatus(job.status),
137
136
  executionCount: job.execution_count || 0,
138
- isExecuting: job.status === "running",
137
+ isExecuting: job.status === 'running',
139
138
  lastExecuted: job.completed || job.started,
140
139
  lastExecutionDuration: job.execution_time,
141
- lastError: job.error_message,
140
+ lastError: job.error_message
142
141
  };
143
142
  // Update cache
144
143
  this.cache.set(nodeId, executionInfoMap[nodeId]);
@@ -147,14 +146,14 @@ export class NodeExecutionService {
147
146
  return executionInfoMap;
148
147
  }
149
148
  catch (error) {
150
- logger.error("Failed to fetch multiple node execution info:", error);
149
+ logger.error('Failed to fetch multiple node execution info:', error);
151
150
  // Return default values instead of empty object to prevent repeated calls
152
151
  const defaultExecutionInfo = {};
153
152
  nodeIds.forEach((nodeId) => {
154
153
  defaultExecutionInfo[nodeId] = {
155
- status: "idle",
154
+ status: 'idle',
156
155
  executionCount: 0,
157
- isExecuting: false,
156
+ isExecuting: false
158
157
  };
159
158
  });
160
159
  return defaultExecutionInfo;
@@ -167,8 +166,8 @@ export class NodeExecutionService {
167
166
  try {
168
167
  const endpointConfig = getEndpointConfig();
169
168
  if (!endpointConfig)
170
- throw new Error("Endpoint config not available");
171
- const url = buildEndpointUrl(endpointConfig, "/node-execution-counts");
169
+ throw new Error('Endpoint config not available');
170
+ const url = buildEndpointUrl(endpointConfig, '/node-execution-counts');
172
171
  const response = await fetch(url);
173
172
  if (!response.ok) {
174
173
  throw new Error(`HTTP error! status: ${response.status}`);
@@ -180,7 +179,7 @@ export class NodeExecutionService {
180
179
  return {};
181
180
  }
182
181
  catch (error) {
183
- logger.error("Failed to fetch all node execution counts:", error);
182
+ logger.error('Failed to fetch all node execution counts:', error);
184
183
  return {};
185
184
  }
186
185
  }
@@ -219,10 +218,10 @@ export class NodeExecutionService {
219
218
  }
220
219
  else {
221
220
  this.cache.set(nodeId, {
222
- status: "idle",
221
+ status: 'idle',
223
222
  executionCount: 0,
224
223
  isExecuting: false,
225
- ...executionInfo,
224
+ ...executionInfo
226
225
  });
227
226
  }
228
227
  }
@@ -231,20 +230,20 @@ export class NodeExecutionService {
231
230
  */
232
231
  mapJobStatusToExecutionStatus(jobStatus) {
233
232
  switch (jobStatus) {
234
- case "pending":
235
- return "pending";
236
- case "running":
237
- return "running";
238
- case "completed":
239
- return "completed";
240
- case "failed":
241
- return "failed";
242
- case "cancelled":
243
- return "cancelled";
244
- case "skipped":
245
- return "skipped";
233
+ case 'pending':
234
+ return 'pending';
235
+ case 'running':
236
+ return 'running';
237
+ case 'completed':
238
+ return 'completed';
239
+ case 'failed':
240
+ return 'failed';
241
+ case 'cancelled':
242
+ return 'cancelled';
243
+ case 'skipped':
244
+ return 'skipped';
246
245
  default:
247
- return "idle";
246
+ return 'idle';
248
247
  }
249
248
  }
250
249
  /**
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @module services/playgroundService
8
8
  */
9
- import type { PlaygroundSession, PlaygroundMessage, PlaygroundMessagesApiResponse, PlaygroundSessionStatus } from "../types/playground.js";
9
+ import type { PlaygroundSession, PlaygroundMessage, PlaygroundMessagesApiResponse, PlaygroundSessionStatus } from '../types/playground.js';
10
10
  /**
11
11
  * Playground Service class
12
12
  *
@@ -6,10 +6,10 @@
6
6
  *
7
7
  * @module services/playgroundService
8
8
  */
9
- import { defaultShouldStopPolling } from "../types/playground.js";
10
- import { buildEndpointUrl, getEndpointHeaders } from "../config/endpoints.js";
11
- import { getEndpointConfig } from "./api.js";
12
- import { logger } from "../utils/logger.js";
9
+ import { defaultShouldStopPolling } from '../types/playground.js';
10
+ import { buildEndpointUrl, getEndpointHeaders } from '../config/endpoints.js';
11
+ import { getEndpointConfig } from './api.js';
12
+ import { logger } from '../utils/logger.js';
13
13
  /**
14
14
  * Default polling interval in milliseconds
15
15
  */
@@ -51,7 +51,7 @@ export class PlaygroundService {
51
51
  getConfig() {
52
52
  const config = getEndpointConfig();
53
53
  if (!config) {
54
- throw new Error("Endpoint configuration not set. Call setEndpointConfig() first.");
54
+ throw new Error('Endpoint configuration not set. Call setEndpointConfig() first.');
55
55
  }
56
56
  return config;
57
57
  }
@@ -64,13 +64,13 @@ export class PlaygroundService {
64
64
  */
65
65
  async request(url, options = {}) {
66
66
  const config = this.getConfig();
67
- const headers = getEndpointHeaders(config, "playground");
67
+ const headers = getEndpointHeaders(config, 'playground');
68
68
  const response = await fetch(url, {
69
69
  ...options,
70
70
  headers: {
71
71
  ...headers,
72
- ...options.headers,
73
- },
72
+ ...options.headers
73
+ }
74
74
  });
75
75
  if (!response.ok) {
76
76
  const errorData = await response.json().catch(() => ({}));
@@ -94,15 +94,15 @@ export class PlaygroundService {
94
94
  async listSessions(workflowId, options) {
95
95
  const config = this.getConfig();
96
96
  let url = buildEndpointUrl(config, config.endpoints.playground.listSessions, {
97
- id: workflowId,
97
+ id: workflowId
98
98
  });
99
99
  // Add query parameters
100
100
  const params = new URLSearchParams();
101
101
  if (options?.limit !== undefined) {
102
- params.append("limit", options.limit.toString());
102
+ params.append('limit', options.limit.toString());
103
103
  }
104
104
  if (options?.offset !== undefined) {
105
- params.append("offset", options.offset.toString());
105
+ params.append('offset', options.offset.toString());
106
106
  }
107
107
  const queryString = params.toString();
108
108
  if (queryString) {
@@ -122,14 +122,14 @@ export class PlaygroundService {
122
122
  async createSession(workflowId, name, metadata) {
123
123
  const config = this.getConfig();
124
124
  const url = buildEndpointUrl(config, config.endpoints.playground.createSession, {
125
- id: workflowId,
125
+ id: workflowId
126
126
  });
127
127
  const response = await this.request(url, {
128
- method: "POST",
129
- body: JSON.stringify({ name, metadata }),
128
+ method: 'POST',
129
+ body: JSON.stringify({ name, metadata })
130
130
  });
131
131
  if (!response.data) {
132
- throw new Error("Failed to create session: No data returned");
132
+ throw new Error('Failed to create session: No data returned');
133
133
  }
134
134
  return response.data;
135
135
  }
@@ -142,11 +142,11 @@ export class PlaygroundService {
142
142
  async getSession(sessionId) {
143
143
  const config = this.getConfig();
144
144
  const url = buildEndpointUrl(config, config.endpoints.playground.getSession, {
145
- sessionId,
145
+ sessionId
146
146
  });
147
147
  const response = await this.request(url);
148
148
  if (!response.data) {
149
- throw new Error("Session not found");
149
+ throw new Error('Session not found');
150
150
  }
151
151
  return response.data;
152
152
  }
@@ -158,10 +158,10 @@ export class PlaygroundService {
158
158
  async deleteSession(sessionId) {
159
159
  const config = this.getConfig();
160
160
  const url = buildEndpointUrl(config, config.endpoints.playground.deleteSession, {
161
- sessionId,
161
+ sessionId
162
162
  });
163
163
  await this.request(url, {
164
- method: "DELETE",
164
+ method: 'DELETE'
165
165
  });
166
166
  }
167
167
  // =========================================================================
@@ -178,15 +178,15 @@ export class PlaygroundService {
178
178
  async getMessages(sessionId, since, limit) {
179
179
  const config = this.getConfig();
180
180
  let url = buildEndpointUrl(config, config.endpoints.playground.getMessages, {
181
- sessionId,
181
+ sessionId
182
182
  });
183
183
  // Add query parameters
184
184
  const params = new URLSearchParams();
185
185
  if (since) {
186
- params.append("since", since);
186
+ params.append('since', since);
187
187
  }
188
188
  if (limit !== undefined) {
189
- params.append("limit", limit.toString());
189
+ params.append('limit', limit.toString());
190
190
  }
191
191
  const queryString = params.toString();
192
192
  if (queryString) {
@@ -205,18 +205,18 @@ export class PlaygroundService {
205
205
  async sendMessage(sessionId, content, inputs) {
206
206
  const config = this.getConfig();
207
207
  const url = buildEndpointUrl(config, config.endpoints.playground.sendMessage, {
208
- sessionId,
208
+ sessionId
209
209
  });
210
210
  const requestBody = { content };
211
211
  if (inputs) {
212
212
  requestBody.inputs = inputs;
213
213
  }
214
214
  const response = await this.request(url, {
215
- method: "POST",
216
- body: JSON.stringify(requestBody),
215
+ method: 'POST',
216
+ body: JSON.stringify(requestBody)
217
217
  });
218
218
  if (!response.data) {
219
- throw new Error("Failed to send message: No data returned");
219
+ throw new Error('Failed to send message: No data returned');
220
220
  }
221
221
  return response.data;
222
222
  }
@@ -228,10 +228,10 @@ export class PlaygroundService {
228
228
  async stopExecution(sessionId) {
229
229
  const config = this.getConfig();
230
230
  const url = buildEndpointUrl(config, config.endpoints.playground.stopExecution, {
231
- sessionId,
231
+ sessionId
232
232
  });
233
233
  await this.request(url, {
234
- method: "POST",
234
+ method: 'POST'
235
235
  });
236
236
  }
237
237
  // =========================================================================
@@ -274,7 +274,7 @@ export class PlaygroundService {
274
274
  }
275
275
  }
276
276
  catch (error) {
277
- logger.error("Polling error:", error);
277
+ logger.error('Polling error:', error);
278
278
  // Exponential backoff on error
279
279
  this.currentBackoff = Math.min(this.currentBackoff * 2, MAX_POLLING_BACKOFF);
280
280
  }
@@ -2,8 +2,8 @@
2
2
  * Port Configuration API Service
3
3
  * Handles fetching port configuration from the backend
4
4
  */
5
- import type { PortConfig } from "../types/index.js";
6
- import type { EndpointConfig } from "../config/endpoints.js";
5
+ import type { PortConfig } from '../types/index.js';
6
+ import type { EndpointConfig } from '../config/endpoints.js';
7
7
  /**
8
8
  * Fetch port configuration from API
9
9
  */
@@ -2,9 +2,9 @@
2
2
  * Port Configuration API Service
3
3
  * Handles fetching port configuration from the backend
4
4
  */
5
- import { buildEndpointUrl } from "../config/endpoints.js";
6
- import { DEFAULT_PORT_CONFIG } from "../config/defaultPortConfig.js";
7
- import { logger } from "../utils/logger.js";
5
+ import { buildEndpointUrl } from '../config/endpoints.js';
6
+ import { DEFAULT_PORT_CONFIG } from '../config/defaultPortConfig.js';
7
+ import { logger } from '../utils/logger.js';
8
8
  /**
9
9
  * Fetch port configuration from API
10
10
  */
@@ -12,7 +12,7 @@ export async function fetchPortConfig(endpointConfig) {
12
12
  try {
13
13
  const url = buildEndpointUrl(endpointConfig, endpointConfig.endpoints.portConfig);
14
14
  const response = await fetch(url, {
15
- headers: { "Content-Type": "application/json" },
15
+ headers: { 'Content-Type': 'application/json' }
16
16
  });
17
17
  if (!response.ok) {
18
18
  throw new Error(`HTTP ${response.status}: ${response.statusText}`);
@@ -21,13 +21,13 @@ export async function fetchPortConfig(endpointConfig) {
21
21
  const portConfig = data.data ?? data;
22
22
  // Validate the configuration has required fields
23
23
  if (!portConfig.dataTypes || !Array.isArray(portConfig.dataTypes)) {
24
- logger.warn("Invalid port config received from API, using default");
24
+ logger.warn('Invalid port config received from API, using default');
25
25
  return DEFAULT_PORT_CONFIG;
26
26
  }
27
27
  return portConfig;
28
28
  }
29
29
  catch (error) {
30
- logger.error("Error fetching port configuration:", error);
30
+ logger.error('Error fetching port configuration:', error);
31
31
  return DEFAULT_PORT_CONFIG;
32
32
  }
33
33
  }
@@ -35,13 +35,13 @@ export async function fetchPortConfig(endpointConfig) {
35
35
  * Validate port configuration structure
36
36
  */
37
37
  export function validatePortConfig(config) {
38
- if (!config || typeof config !== "object") {
38
+ if (!config || typeof config !== 'object') {
39
39
  return false;
40
40
  }
41
41
  if (!config.dataTypes || !Array.isArray(config.dataTypes)) {
42
42
  return false;
43
43
  }
44
- if (!config.defaultDataType || typeof config.defaultDataType !== "string") {
44
+ if (!config.defaultDataType || typeof config.defaultDataType !== 'string') {
45
45
  return false;
46
46
  }
47
47
  // Check that all data types have required fields
@@ -7,8 +7,8 @@
7
7
  *
8
8
  * @module services/settingsService
9
9
  */
10
- import type { FlowDropSettings, PartialSettings } from "../types/settings.js";
11
- import type { EndpointConfig } from "../config/endpoints.js";
10
+ import type { FlowDropSettings, PartialSettings } from '../types/settings.js';
11
+ import type { EndpointConfig } from '../config/endpoints.js';
12
12
  /**
13
13
  * Set the endpoint configuration for settings API calls
14
14
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @module services/settingsService
9
9
  */
10
- import { buildEndpointUrl, getEndpointHeaders } from "../config/endpoints.js";
10
+ import { buildEndpointUrl, getEndpointHeaders } from '../config/endpoints.js';
11
11
  // =========================================================================
12
12
  // Configuration
13
13
  // =========================================================================
@@ -44,17 +44,17 @@ export function getSettingsEndpointConfig() {
44
44
  */
45
45
  async function settingsRequest(endpointKey, endpointPath, options = {}) {
46
46
  if (!endpointConfig) {
47
- throw new Error("Endpoint configuration not set. Call setSettingsEndpointConfig() first.");
47
+ throw new Error('Endpoint configuration not set. Call setSettingsEndpointConfig() first.');
48
48
  }
49
49
  const url = buildEndpointUrl(endpointConfig, endpointPath);
50
50
  const headers = getEndpointHeaders(endpointConfig, endpointKey);
51
51
  const response = await fetch(url, {
52
52
  headers,
53
- ...options,
53
+ ...options
54
54
  });
55
55
  // Check if response is JSON
56
- const contentType = response.headers.get("content-type");
57
- const isJson = contentType?.includes("application/json");
56
+ const contentType = response.headers.get('content-type');
57
+ const isJson = contentType?.includes('application/json');
58
58
  if (!response.ok) {
59
59
  let errorMessage = `HTTP ${response.status}: ${response.statusText}`;
60
60
  if (isJson) {
@@ -86,13 +86,11 @@ export const settingsApi = {
86
86
  */
87
87
  async getPreferences() {
88
88
  if (!endpointConfig) {
89
- throw new Error("Endpoint configuration not set");
89
+ throw new Error('Endpoint configuration not set');
90
90
  }
91
- const response = await settingsRequest("users.preferences", endpointConfig.endpoints.users.preferences, { method: "GET" });
91
+ const response = await settingsRequest('users.preferences', endpointConfig.endpoints.users.preferences, { method: 'GET' });
92
92
  if (!response.success || !response.data) {
93
- throw new Error(typeof response.error === "string"
94
- ? response.error
95
- : "Failed to fetch user preferences");
93
+ throw new Error(typeof response.error === 'string' ? response.error : 'Failed to fetch user preferences');
96
94
  }
97
95
  return response.data;
98
96
  },
@@ -103,16 +101,14 @@ export const settingsApi = {
103
101
  */
104
102
  async savePreferences(settings) {
105
103
  if (!endpointConfig) {
106
- throw new Error("Endpoint configuration not set");
104
+ throw new Error('Endpoint configuration not set');
107
105
  }
108
- const response = await settingsRequest("users.preferences", endpointConfig.endpoints.users.preferences, {
109
- method: "PUT",
110
- body: JSON.stringify(settings),
106
+ const response = await settingsRequest('users.preferences', endpointConfig.endpoints.users.preferences, {
107
+ method: 'PUT',
108
+ body: JSON.stringify(settings)
111
109
  });
112
110
  if (!response.success) {
113
- throw new Error(typeof response.error === "string"
114
- ? response.error
115
- : "Failed to save user preferences");
111
+ throw new Error(typeof response.error === 'string' ? response.error : 'Failed to save user preferences');
116
112
  }
117
113
  },
118
114
  /**
@@ -122,19 +118,17 @@ export const settingsApi = {
122
118
  */
123
119
  async patchPreferences(partial) {
124
120
  if (!endpointConfig) {
125
- throw new Error("Endpoint configuration not set");
121
+ throw new Error('Endpoint configuration not set');
126
122
  }
127
- const response = await settingsRequest("users.preferences", endpointConfig.endpoints.users.preferences, {
128
- method: "PATCH",
129
- body: JSON.stringify(partial),
123
+ const response = await settingsRequest('users.preferences', endpointConfig.endpoints.users.preferences, {
124
+ method: 'PATCH',
125
+ body: JSON.stringify(partial)
130
126
  });
131
127
  if (!response.success || !response.data) {
132
- throw new Error(typeof response.error === "string"
133
- ? response.error
134
- : "Failed to update user preferences");
128
+ throw new Error(typeof response.error === 'string' ? response.error : 'Failed to update user preferences');
135
129
  }
136
130
  return response.data;
137
- },
131
+ }
138
132
  };
139
133
  // =========================================================================
140
134
  // Settings Service Class (for settingsStore integration)
@@ -3,7 +3,7 @@
3
3
  * Centralized toast notification service using svelte-french-toast
4
4
  * Provides consistent toast notifications across the FlowDrop application
5
5
  */
6
- import { type DefaultToastOptions } from "svelte-5-french-toast";
6
+ import { type DefaultToastOptions } from 'svelte-5-french-toast';
7
7
  /**
8
8
  * Default toast options themed with FlowDrop design tokens.
9
9
  * Use with <Toaster toastOptions={flowdropToastOptions} containerClassName="flowdrop-toaster" />
@@ -15,13 +15,13 @@ export declare const FLOWDROP_TOASTER_CLASS = "flowdrop-toaster";
15
15
  /**
16
16
  * Toast notification types
17
17
  */
18
- export type ToastType = "success" | "error" | "warning" | "info" | "loading";
18
+ export type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading';
19
19
  /**
20
20
  * Toast configuration options
21
21
  */
22
22
  export interface ToastOptions {
23
23
  duration?: number;
24
- position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
24
+ position?: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
25
25
  }
26
26
  /**
27
27
  * Show a success toast notification
@@ -54,7 +54,7 @@ export declare function dismissAllToasts(): void;
54
54
  /**
55
55
  * Show a promise-based toast (loading -> success/error)
56
56
  */
57
- export declare function showPromise<T>(promise: Promise<T>, { loading, success, error, options, }: {
57
+ export declare function showPromise<T>(promise: Promise<T>, { loading, success, error, options }: {
58
58
  loading: string;
59
59
  success: string | ((data: T) => string);
60
60
  error: string | ((error: unknown) => string);