@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
@@ -15,6 +15,7 @@
15
15
  import type { Workflow } from '../../types/index.js';
16
16
  import type { FlowDropInstance } from '../../stores/instanceContainer.svelte.js';
17
17
  import type { EndpointConfig } from '../../config/endpoints.js';
18
+ import type { AuthProvider } from '../../types/auth.js';
18
19
  import type { PlaygroundConfig } from '../../types/playground.js';
19
20
  import type { SettingsCategory } from '../../types/settings.js';
20
21
  import type { NavbarAction } from '../../types/navbar.js';
@@ -24,6 +25,8 @@
24
25
  workflow?: Workflow;
25
26
  mode?: 'standalone' | 'embedded';
26
27
  endpointConfig?: EndpointConfig;
28
+ /** Auth provider applied to this instance's API requests. */
29
+ authProvider?: AuthProvider;
27
30
  config?: PlaygroundConfig;
28
31
  showNavbar?: boolean;
29
32
  navbarTitle?: string;
@@ -47,8 +50,9 @@
47
50
  workflow,
48
51
  mode = 'standalone',
49
52
  endpointConfig,
53
+ authProvider,
50
54
  config = {},
51
- showNavbar = true,
55
+ showNavbar = false,
52
56
  navbarTitle,
53
57
  primaryActions = [],
54
58
  showSettings = true,
@@ -86,6 +90,7 @@
86
90
  {workflow}
87
91
  {mode}
88
92
  {endpointConfig}
93
+ {authProvider}
89
94
  {config}
90
95
  {initialSessionId}
91
96
  {initialPipelineOpen}
@@ -1,6 +1,7 @@
1
1
  import type { Workflow } from '../../types/index.js';
2
2
  import type { FlowDropInstance } from '../../stores/instanceContainer.svelte.js';
3
3
  import type { EndpointConfig } from '../../config/endpoints.js';
4
+ import type { AuthProvider } from '../../types/auth.js';
4
5
  import type { PlaygroundConfig } from '../../types/playground.js';
5
6
  import type { SettingsCategory } from '../../types/settings.js';
6
7
  import type { NavbarAction } from '../../types/navbar.js';
@@ -9,6 +10,8 @@ interface Props {
9
10
  workflow?: Workflow;
10
11
  mode?: 'standalone' | 'embedded';
11
12
  endpointConfig?: EndpointConfig;
13
+ /** Auth provider applied to this instance's API requests. */
14
+ authProvider?: AuthProvider;
12
15
  config?: PlaygroundConfig;
13
16
  showNavbar?: boolean;
14
17
  navbarTitle?: string;
@@ -12,6 +12,7 @@
12
12
  import type { Workflow } from '../../types/index.js';
13
13
  import type { FlowDropInstance } from '../../stores/instanceContainer.svelte.js';
14
14
  import type { EndpointConfig } from '../../config/endpoints.js';
15
+ import type { AuthProvider } from '../../types/auth.js';
15
16
  import type { PlaygroundConfig } from '../../types/playground.js';
16
17
  import { m } from '../../messages/index.js';
17
18
 
@@ -29,6 +30,8 @@
29
30
  initialSessionId?: string;
30
31
  /** API endpoint configuration */
31
32
  endpointConfig?: EndpointConfig;
33
+ /** Auth provider applied to this instance's API requests. */
34
+ authProvider?: AuthProvider;
32
35
  /** Playground configuration options */
33
36
  config?: PlaygroundConfig;
34
37
  /** Per-instance state container — forwarded to the inner Playground */
@@ -43,6 +46,7 @@
43
46
  workflow,
44
47
  initialSessionId,
45
48
  endpointConfig,
49
+ authProvider,
46
50
  config = {},
47
51
  instance,
48
52
  onClose
@@ -111,6 +115,7 @@
111
115
  mode="modal"
112
116
  {initialSessionId}
113
117
  {endpointConfig}
118
+ {authProvider}
114
119
  {config}
115
120
  {onClose}
116
121
  />
@@ -1,6 +1,7 @@
1
1
  import type { Workflow } from '../../types/index.js';
2
2
  import type { FlowDropInstance } from '../../stores/instanceContainer.svelte.js';
3
3
  import type { EndpointConfig } from '../../config/endpoints.js';
4
+ import type { AuthProvider } from '../../types/auth.js';
4
5
  import type { PlaygroundConfig } from '../../types/playground.js';
5
6
  /**
6
7
  * Component props
@@ -16,6 +17,8 @@ interface Props {
16
17
  initialSessionId?: string;
17
18
  /** API endpoint configuration */
18
19
  endpointConfig?: EndpointConfig;
20
+ /** Auth provider applied to this instance's API requests. */
21
+ authProvider?: AuthProvider;
19
22
  /** Playground configuration options */
20
23
  config?: PlaygroundConfig;
21
24
  /** Per-instance state container — forwarded to the inner Playground */
@@ -8,6 +8,7 @@
8
8
  import { logger } from '../../utils/logger.js';
9
9
  import type { Workflow, PipelineViewDef } from '../../types/index.js';
10
10
  import type { EndpointConfig } from '../../config/endpoints.js';
11
+ import type { AuthProvider } from '../../types/auth.js';
11
12
  import type { PlaygroundConfig, PlaygroundMode } from '../../types/playground.js';
12
13
 
13
14
  interface Props {
@@ -17,6 +18,8 @@
17
18
  workflow?: Workflow;
18
19
  /** API endpoint configuration */
19
20
  endpointConfig?: EndpointConfig;
21
+ /** Auth provider applied to this instance's API requests. */
22
+ authProvider?: AuthProvider;
20
23
  /** Display mode (default: standalone) */
21
24
  mode?: PlaygroundMode;
22
25
  /** Session ID to activate on mount. Changing this prop remounts the Playground. */
@@ -43,6 +46,7 @@
43
46
  workflowId,
44
47
  workflow: workflowProp,
45
48
  endpointConfig,
49
+ authProvider,
46
50
  mode = 'standalone',
47
51
  initialSessionId,
48
52
  config = {},
@@ -99,7 +103,7 @@
99
103
  fd.pipelinePanel.setOpen(initialPipelineOpen);
100
104
  }
101
105
  if (endpointConfig) {
102
- fd.api.configure(endpointConfig);
106
+ fd.api.configure(endpointConfig, authProvider);
103
107
  }
104
108
  if (!workflowProp) {
105
109
  void loadWorkflow();
@@ -182,6 +186,7 @@
182
186
  pipelineId={activeId}
183
187
  workflow={resolvedWorkflow}
184
188
  {endpointConfig}
189
+ {authProvider}
185
190
  isPinned={fd.playground.pinnedExecutionId !== null}
186
191
  {executions}
187
192
  latestExecutionId={fd.playground.latestExecutionId}
@@ -238,6 +243,7 @@
238
243
  {workflowId}
239
244
  workflow={resolvedWorkflow}
240
245
  {endpointConfig}
246
+ {authProvider}
241
247
  {mode}
242
248
  {initialSessionId}
243
249
  {config}
@@ -457,11 +463,6 @@
457
463
  .playground-studio__back-to-chat:hover {
458
464
  background-color: var(--fd-muted);
459
465
  }
460
-
461
- .playground-studio__back-to-chat:focus-visible {
462
- outline: 2px solid var(--fd-ring);
463
- outline-offset: 2px;
464
- }
465
466
  }
466
467
 
467
468
  @media (prefers-reduced-motion: reduce) {
@@ -1,6 +1,7 @@
1
1
  import type { FlowDropInstance } from '../../stores/instanceContainer.svelte.js';
2
2
  import type { Workflow, PipelineViewDef } from '../../types/index.js';
3
3
  import type { EndpointConfig } from '../../config/endpoints.js';
4
+ import type { AuthProvider } from '../../types/auth.js';
4
5
  import type { PlaygroundConfig, PlaygroundMode } from '../../types/playground.js';
5
6
  interface Props {
6
7
  /** Target workflow ID */
@@ -9,6 +10,8 @@ interface Props {
9
10
  workflow?: Workflow;
10
11
  /** API endpoint configuration */
11
12
  endpointConfig?: EndpointConfig;
13
+ /** Auth provider applied to this instance's API requests. */
14
+ authProvider?: AuthProvider;
12
15
  /** Display mode (default: standalone) */
13
16
  mode?: PlaygroundMode;
14
17
  /** Session ID to activate on mount. Changing this prop remounts the Playground. */
@@ -1,4 +1,5 @@
1
1
  import type { EndpointConfig } from '../../config/endpoints.js';
2
+ import type { AuthProvider } from '../../types/auth.js';
2
3
  import type { NodeExecutionStatus, KanbanColumnDef } from '../../types/index.js';
3
4
  export type NodeStatus = NodeExecutionStatus;
4
5
  export interface NodeStatusData {
@@ -40,7 +41,7 @@ export declare function resolveStatus(raw: NodeStatusData | undefined): NodeStat
40
41
  * `endpointConfig` is used once to construct the API client — it must be stable.
41
42
  * `getPipelineId` is called on every fetch so pipeline ID changes are picked up.
42
43
  */
43
- export declare function createPipelineDataFetcher(getPipelineId: () => string, endpointConfig: EndpointConfig): {
44
+ export declare function createPipelineDataFetcher(getPipelineId: () => string, endpointConfig: EndpointConfig, authProvider?: AuthProvider): {
44
45
  readonly nodeStatusMap: Record<string, NodeStatusData>;
45
46
  readonly jobs: PipelineJobItem[];
46
47
  readonly kanbanConfig: KanbanColumnDef[] | null;
@@ -55,8 +55,8 @@ export function resolveStatus(raw) {
55
55
  * `endpointConfig` is used once to construct the API client — it must be stable.
56
56
  * `getPipelineId` is called on every fetch so pipeline ID changes are picked up.
57
57
  */
58
- export function createPipelineDataFetcher(getPipelineId, endpointConfig) {
59
- const client = new EnhancedFlowDropApiClient(endpointConfig);
58
+ export function createPipelineDataFetcher(getPipelineId, endpointConfig, authProvider) {
59
+ const client = new EnhancedFlowDropApiClient(endpointConfig, authProvider);
60
60
  let nodeStatusMap = $state({});
61
61
  let jobs = $state([]);
62
62
  let kanbanConfig = $state(null);
@@ -0,0 +1,153 @@
1
+ <!--
2
+ SurfaceOverlay
3
+ A reusable centered modal shell used to host a surface (or a TabbedSurface of
4
+ several) in the `modal` placement. Portals to `document.body` so the fixed
5
+ backdrop escapes any ancestor that establishes a containing block (transform,
6
+ filter, backdrop-filter, …). Esc and backdrop-click close it.
7
+
8
+ Promotes the modal shell first built inline in ConfigPanel so config, console,
9
+ and chat can all float when their placement is `modal`.
10
+ -->
11
+
12
+ <script lang="ts">
13
+ import type { Snippet } from 'svelte';
14
+ import { portal } from '../../utils/portal.js';
15
+
16
+ interface Props {
17
+ /** Header title. */
18
+ title: string;
19
+ /** Accessible label for the close button. */
20
+ closeLabel?: string;
21
+ /** Called on Esc, backdrop click, or the close button. */
22
+ onClose: () => void;
23
+ /** Overlay body. */
24
+ children: Snippet;
25
+ }
26
+
27
+ const { title, closeLabel = 'Close', onClose, children }: Props = $props();
28
+
29
+ const uid = $props.id();
30
+ const titleId = `${uid}-surface-overlay-title`;
31
+
32
+ function handleKeydown(event: KeyboardEvent) {
33
+ if (event.key === 'Escape') {
34
+ event.stopPropagation();
35
+ onClose();
36
+ }
37
+ }
38
+
39
+ function handleBackdropClick(event: MouseEvent) {
40
+ if (event.target === event.currentTarget) {
41
+ onClose();
42
+ }
43
+ }
44
+ </script>
45
+
46
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
47
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
48
+ <div
49
+ class="surface-overlay__backdrop"
50
+ use:portal
51
+ onclick={handleBackdropClick}
52
+ onkeydown={handleKeydown}
53
+ >
54
+ <div
55
+ class="surface-overlay"
56
+ role="dialog"
57
+ aria-modal="true"
58
+ aria-labelledby={titleId}
59
+ tabindex="-1"
60
+ >
61
+ <div class="surface-overlay__header">
62
+ <h2 id={titleId} class="surface-overlay__title">{title}</h2>
63
+ <button class="surface-overlay__close" onclick={onClose} aria-label={closeLabel}> × </button>
64
+ </div>
65
+ <div class="surface-overlay__body">
66
+ {@render children()}
67
+ </div>
68
+ </div>
69
+ </div>
70
+
71
+ <style>
72
+ .surface-overlay__backdrop {
73
+ position: fixed;
74
+ inset: 0;
75
+ /*
76
+ Portalled to document.body, this shell sits outside the editor container
77
+ that carries the app font, so it would otherwise inherit the host page's
78
+ default (e.g. serif on a bare Drupal page). Re-establish the font here,
79
+ mirroring the mount container's declaration.
80
+ */
81
+ font-family: var(--fd-font-family, system-ui, -apple-system, sans-serif);
82
+ background-color: var(--fd-backdrop, rgba(0, 0, 0, 0.5));
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ z-index: 1000;
87
+ padding: 1rem;
88
+ }
89
+
90
+ .surface-overlay {
91
+ display: flex;
92
+ flex-direction: column;
93
+ width: 100%;
94
+ max-width: 48rem;
95
+ max-height: 90vh;
96
+ background-color: var(--fd-panel-bg, var(--fd-card));
97
+ border: 1px solid var(--fd-border);
98
+ border-radius: var(--fd-radius-lg, 0.75rem);
99
+ box-shadow: var(--fd-shadow-lg, 0 20px 25px -5px rgba(0, 0, 0, 0.25));
100
+ overflow: hidden;
101
+ }
102
+
103
+ .surface-overlay__header {
104
+ display: flex;
105
+ justify-content: space-between;
106
+ align-items: center;
107
+ padding: 0.875rem 1rem;
108
+ border-bottom: 1px solid var(--fd-border);
109
+ background-color: var(--fd-card);
110
+ flex-shrink: 0;
111
+ }
112
+
113
+ .surface-overlay__title {
114
+ margin: 0;
115
+ font-size: 1rem;
116
+ font-weight: 600;
117
+ color: var(--fd-foreground);
118
+ }
119
+
120
+ .surface-overlay__close {
121
+ background: none;
122
+ border: none;
123
+ font-size: 1.25rem;
124
+ line-height: 1;
125
+ cursor: pointer;
126
+ color: var(--fd-muted-foreground);
127
+ padding: 0.25rem;
128
+ border-radius: var(--fd-radius-sm);
129
+ transition:
130
+ color var(--fd-transition-fast),
131
+ background-color var(--fd-transition-fast);
132
+ }
133
+
134
+ .surface-overlay__close:hover {
135
+ color: var(--fd-foreground);
136
+ background-color: var(--fd-subtle);
137
+ }
138
+
139
+ .surface-overlay__body {
140
+ flex: 1;
141
+ min-height: 0;
142
+ overflow-y: auto;
143
+ display: flex;
144
+ flex-direction: column;
145
+ }
146
+
147
+ @media (max-width: 640px) {
148
+ .surface-overlay {
149
+ max-width: 100%;
150
+ max-height: 95vh;
151
+ }
152
+ }
153
+ </style>
@@ -0,0 +1,14 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ /** Header title. */
4
+ title: string;
5
+ /** Accessible label for the close button. */
6
+ closeLabel?: string;
7
+ /** Called on Esc, backdrop click, or the close button. */
8
+ onClose: () => void;
9
+ /** Overlay body. */
10
+ children: Snippet;
11
+ }
12
+ declare const SurfaceOverlay: import("svelte").Component<Props, {}, "">;
13
+ type SurfaceOverlay = ReturnType<typeof SurfaceOverlay>;
14
+ export default SurfaceOverlay;
@@ -0,0 +1,133 @@
1
+ <!--
2
+ TabbedSurface
3
+ A reusable tabbed container that hosts one or more "surfaces" (config panel,
4
+ console, AI Assistant). Promotes the bottom-panel tab strip so the same
5
+ container can host surfaces in the sidebar, bottom panel, or a modal overlay.
6
+
7
+ All tab bodies stay mounted (toggled via `display`) so surface state — console
8
+ scrollback, chat history, in-progress form edits — survives tab switches. The
9
+ tab bar hides itself when only a single surface is present, so a lone surface
10
+ reads as a plain panel with no redundant chrome.
11
+ -->
12
+
13
+ <script lang="ts">
14
+ import type { Snippet } from 'svelte';
15
+
16
+ /** A single hostable surface. */
17
+ export interface SurfaceTab {
18
+ /** Stable identifier, unique within the host. */
19
+ id: string;
20
+ /** Tab-strip label. */
21
+ label: string;
22
+ /** Body content. Rendered once — a surface has exactly one host. */
23
+ content: Snippet;
24
+ /**
25
+ * `display` value applied while active. Some surfaces (the console) expect
26
+ * to be a direct flex child of the content area and use `contents`; most
27
+ * use `flex`. Defaults to `flex`.
28
+ */
29
+ display?: 'flex' | 'contents';
30
+ }
31
+
32
+ interface Props {
33
+ /** Surfaces to host, in tab order. */
34
+ tabs: SurfaceTab[];
35
+ /** Currently active tab id. */
36
+ activeId: string;
37
+ /** Called when a tab is selected. */
38
+ onSelect: (id: string) => void;
39
+ }
40
+
41
+ const { tabs, activeId, onSelect }: Props = $props();
42
+
43
+ // Fall back to the first tab when `activeId` doesn't match any present tab
44
+ // (e.g. the active surface was just routed to a different host).
45
+ const resolvedActiveId = $derived(
46
+ tabs.some((t) => t.id === activeId) ? activeId : (tabs[0]?.id ?? '')
47
+ );
48
+ </script>
49
+
50
+ <div class="tabbed-surface">
51
+ {#if tabs.length > 1}
52
+ <div class="tabbed-surface__bar" role="tablist">
53
+ {#each tabs as tab (tab.id)}
54
+ <button
55
+ class="tabbed-surface__tab {tab.id === resolvedActiveId
56
+ ? 'tabbed-surface__tab--active'
57
+ : ''}"
58
+ role="tab"
59
+ aria-selected={tab.id === resolvedActiveId}
60
+ onclick={() => onSelect(tab.id)}
61
+ >
62
+ {tab.label}
63
+ </button>
64
+ {/each}
65
+ </div>
66
+ {/if}
67
+
68
+ <div class="tabbed-surface__content">
69
+ {#each tabs as tab (tab.id)}
70
+ <div
71
+ class="tabbed-surface__panel"
72
+ style:display={tab.id === resolvedActiveId ? (tab.display ?? 'flex') : 'none'}
73
+ >
74
+ {@render tab.content()}
75
+ </div>
76
+ {/each}
77
+ </div>
78
+ </div>
79
+
80
+ <style>
81
+ .tabbed-surface {
82
+ display: flex;
83
+ flex-direction: column;
84
+ height: 100%;
85
+ overflow: hidden;
86
+ }
87
+
88
+ .tabbed-surface__bar {
89
+ display: flex;
90
+ gap: 0;
91
+ background: var(--fd-muted);
92
+ border-bottom: 1px solid var(--fd-border);
93
+ flex-shrink: 0;
94
+ }
95
+
96
+ .tabbed-surface__tab {
97
+ padding: 0.375rem 0.75rem;
98
+ font-size: 0.75rem;
99
+ font-weight: 500;
100
+ cursor: pointer;
101
+ border: none;
102
+ border-bottom: 2px solid transparent;
103
+ background: transparent;
104
+ color: var(--fd-muted-foreground);
105
+ transition: all var(--fd-transition-fast);
106
+ }
107
+
108
+ .tabbed-surface__tab:hover {
109
+ color: var(--fd-foreground);
110
+ background: var(--fd-background);
111
+ }
112
+
113
+ .tabbed-surface__tab--active {
114
+ color: var(--fd-foreground);
115
+ border-bottom-color: var(--fd-primary);
116
+ background: var(--fd-background);
117
+ }
118
+
119
+ .tabbed-surface__content {
120
+ flex: 1;
121
+ min-height: 0;
122
+ overflow: hidden;
123
+ display: flex;
124
+ flex-direction: column;
125
+ }
126
+
127
+ .tabbed-surface__panel {
128
+ flex: 1;
129
+ min-height: 0;
130
+ overflow: hidden;
131
+ flex-direction: column;
132
+ }
133
+ </style>
@@ -0,0 +1,27 @@
1
+ import type { Snippet } from 'svelte';
2
+ /** A single hostable surface. */
3
+ export interface SurfaceTab {
4
+ /** Stable identifier, unique within the host. */
5
+ id: string;
6
+ /** Tab-strip label. */
7
+ label: string;
8
+ /** Body content. Rendered once — a surface has exactly one host. */
9
+ content: Snippet;
10
+ /**
11
+ * `display` value applied while active. Some surfaces (the console) expect
12
+ * to be a direct flex child of the content area and use `contents`; most
13
+ * use `flex`. Defaults to `flex`.
14
+ */
15
+ display?: 'flex' | 'contents';
16
+ }
17
+ interface Props {
18
+ /** Surfaces to host, in tab order. */
19
+ tabs: SurfaceTab[];
20
+ /** Currently active tab id. */
21
+ activeId: string;
22
+ /** Called when a tab is selected. */
23
+ onSelect: (id: string) => void;
24
+ }
25
+ declare const TabbedSurface: import("svelte").Component<Props, {}, "">;
26
+ type TabbedSurface = ReturnType<typeof TabbedSurface>;
27
+ export default TabbedSurface;
@@ -3,6 +3,7 @@
3
3
  * Provides configurable endpoints for all API actions
4
4
  */
5
5
  import type { AgentSpecEndpointConfig } from './agentSpecEndpoints.js';
6
+ import type { AuthProvider } from '../types/auth.js';
6
7
  export interface EndpointConfig {
7
8
  /** Base URL for all endpoints */
8
9
  baseUrl: string;
@@ -25,6 +26,17 @@ export interface EndpointConfig {
25
26
  validate: string;
26
27
  export: string;
27
28
  import: string;
29
+ /**
30
+ * Launch a run with schema-resolved named inputs, returning the new
31
+ * pipeline id.
32
+ *
33
+ * The semantically correct verb for "start this workflow" — as opposed to
34
+ * posting a chat message and relying on the side effect of a run starting.
35
+ *
36
+ * Optional: a backend without an explicit launch verb omits it, and the
37
+ * `/run` command is not offered.
38
+ */
39
+ run?: string;
28
40
  };
29
41
  executions: {
30
42
  execute: string;
@@ -59,6 +71,42 @@ export interface EndpointConfig {
59
71
  sendMessage: string;
60
72
  /** Stop execution in a session */
61
73
  stopExecution: string;
74
+ /**
75
+ * Reset a stuck session to idle.
76
+ *
77
+ * Optional: a backend that cannot reset a session simply omits this key,
78
+ * and the `/reset` command is not offered. Absence of an endpoint is
79
+ * absence of a capability — see the slash-command registry.
80
+ */
81
+ resetSession?: string;
82
+ };
83
+ /**
84
+ * Operator signals into a *running* pipeline — pause, resume, cancel.
85
+ *
86
+ * Distinct from `interrupts`, which are raised *by* a pipeline and awaited
87
+ * (human-in-the-loop). These travel the other way: an external party acting
88
+ * on a run that never asked.
89
+ *
90
+ * Optional as a whole: a backend with no signal plane omits the block, and
91
+ * the corresponding commands are not offered.
92
+ */
93
+ signals?: {
94
+ /**
95
+ * Root for signal routes, when the backend serves them from a different
96
+ * prefix than {@link EndpointConfig.baseUrl}.
97
+ *
98
+ * Needed because API roots are not always uniform — the reference backend
99
+ * serves signals from `/flowdrop/api` while everything else lives under
100
+ * `/api/flowdrop`, and a single base cannot express both. Omit to use the
101
+ * global `baseUrl`.
102
+ */
103
+ baseUrl?: string;
104
+ /** Pause a running pipeline */
105
+ pause: string;
106
+ /** Resume a paused pipeline */
107
+ resume: string;
108
+ /** Cancel a running pipeline */
109
+ cancel: string;
62
110
  };
63
111
  interrupts: {
64
112
  /** Get interrupt details by ID */
@@ -150,7 +198,7 @@ export declare function createEndpointConfig(baseUrl: string, overrides?: Partia
150
198
  /**
151
199
  * Build full URL for an endpoint
152
200
  */
153
- export declare function buildEndpointUrl(config: EndpointConfig, endpointPath: string, params?: Record<string, string>): string;
201
+ export declare function buildEndpointUrl(config: EndpointConfig, endpointPath: string, params?: Record<string, string>, baseUrlOverride?: string): string;
154
202
  /**
155
203
  * Get HTTP method for an endpoint
156
204
  */
@@ -159,3 +207,25 @@ export declare function getEndpointMethod(config: EndpointConfig, endpointKey: s
159
207
  * Get custom headers for an endpoint
160
208
  */
161
209
  export declare function getEndpointHeaders(config: EndpointConfig, endpointKey: string): Record<string, string>;
210
+ /**
211
+ * Build request headers for an endpoint, layering the auth provider's headers
212
+ * over the static endpoint headers.
213
+ *
214
+ * This is the single header-building path shared by the per-instance services
215
+ * (playground, chat, interrupt, settings, port config, categories). Routing all
216
+ * of them through this helper guarantees a configured {@link AuthProvider}
217
+ * authenticates every request consistently — matching the behaviour of
218
+ * {@link EnhancedFlowDropApiClient}, which owns the equivalent merge for the
219
+ * typed workflow/node API.
220
+ *
221
+ * `getAuthHeaders()` is awaited per call so providers can return freshly
222
+ * refreshed tokens. When no provider is supplied the result is identical to
223
+ * {@link getEndpointHeaders} (no auth) — keeping unauthenticated callers
224
+ * working unchanged.
225
+ *
226
+ * @param config - The endpoint configuration
227
+ * @param endpointKey - Key identifying the endpoint (for static header lookup)
228
+ * @param authProvider - Optional auth provider supplying `Authorization` etc.
229
+ * @returns Merged headers: static endpoint headers < auth headers
230
+ */
231
+ export declare function getRequestHeaders(config: EndpointConfig, endpointKey: string, authProvider?: AuthProvider): Promise<Record<string, string>>;