@flowdrop/flowdrop 1.15.0 → 2.0.0-beta.2

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 (235) hide show
  1. package/CHANGELOG.md +508 -0
  2. package/MIGRATION-2.0.md +629 -0
  3. package/README.md +23 -23
  4. package/dist/adapters/WorkflowAdapter.d.ts +1 -1
  5. package/dist/adapters/WorkflowAdapter.js +14 -8
  6. package/dist/adapters/agentspec/AgentSpecAdapter.js +7 -7
  7. package/dist/api/enhanced-client.js +6 -11
  8. package/dist/chat/batchFeedback.d.ts +39 -0
  9. package/dist/chat/batchFeedback.js +51 -0
  10. package/dist/commands/executor.js +15 -1
  11. package/dist/commands/storeIntegration.svelte.d.ts +4 -1
  12. package/dist/commands/storeIntegration.svelte.js +26 -21
  13. package/dist/commands/types.d.ts +2 -0
  14. package/dist/components/App.svelte +163 -192
  15. package/dist/components/App.svelte.d.ts +47 -8
  16. package/dist/components/ConfigForm.svelte +77 -49
  17. package/dist/components/ConfigModal.svelte +7 -2
  18. package/dist/components/ConnectionLine.svelte +4 -2
  19. package/dist/components/Navbar.svelte +61 -1
  20. package/dist/components/NodeSidebar.svelte +27 -45
  21. package/dist/components/NodeStatusOverlay.svelte +94 -6
  22. package/dist/components/NodeSwapPicker.svelte +10 -8
  23. package/dist/components/PipelineStatus.svelte +22 -68
  24. package/dist/components/PipelineStatus.svelte.d.ts +3 -0
  25. package/dist/components/PortCoordinateTracker.svelte +5 -6
  26. package/dist/components/SchemaForm.stories.svelte +1 -3
  27. package/dist/components/SchemaForm.svelte +22 -27
  28. package/dist/components/SchemaForm.svelte.d.ts +0 -8
  29. package/dist/components/SettingsModal.svelte +8 -3
  30. package/dist/components/SettingsPanel.svelte +20 -4
  31. package/dist/components/SwapMappingEditor.svelte +67 -49
  32. package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
  33. package/dist/components/UniversalNode.svelte +9 -7
  34. package/dist/components/WorkflowEditor.svelte +121 -111
  35. package/dist/components/WorkflowEditor.svelte.d.ts +21 -10
  36. package/dist/components/chat/AIChatPanel.svelte +98 -89
  37. package/dist/components/chat/AIChatPanel.svelte.d.ts +0 -4
  38. package/dist/components/chat/CommandPreview.svelte +2 -1
  39. package/dist/components/console/CommandConsole.svelte +7 -5
  40. package/dist/components/console/ConsoleAutocomplete.svelte +10 -11
  41. package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
  42. package/dist/components/console/ConsoleInput.svelte +15 -6
  43. package/dist/components/console/ConsoleOutput.svelte +2 -1
  44. package/dist/components/form/FormArray.svelte +5 -9
  45. package/dist/components/form/FormArray.svelte.d.ts +2 -1
  46. package/dist/components/form/FormAutocomplete.svelte +16 -15
  47. package/dist/components/form/FormField.svelte +4 -2
  48. package/dist/components/form/FormFieldLight.svelte +34 -3
  49. package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
  50. package/dist/components/form/FormMarkdownEditor.svelte +9 -4
  51. package/dist/components/form/FormRangeField.svelte +1 -0
  52. package/dist/components/form/FormTemplateEditor.svelte +11 -3
  53. package/dist/components/form/FormToggle.svelte +5 -12
  54. package/dist/components/form/FormToggle.svelte.d.ts +4 -2
  55. package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
  56. package/dist/components/form/templateAutocomplete.js +1 -5
  57. package/dist/components/form/types.d.ts +1 -14
  58. package/dist/components/interrupt/FormPrompt.svelte +3 -2
  59. package/dist/components/interrupt/InterruptBubble.svelte +25 -17
  60. package/dist/components/interrupt/ReviewPrompt.svelte +10 -3
  61. package/dist/components/interrupt/TextInputPrompt.svelte +2 -1
  62. package/dist/components/layouts/MainLayout.svelte +20 -13
  63. package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
  64. package/dist/components/nodes/AtomNode.svelte +17 -5
  65. package/dist/components/nodes/GatewayNode.svelte +19 -10
  66. package/dist/components/nodes/IdeaNode.svelte +7 -0
  67. package/dist/components/nodes/SimpleNode.svelte +11 -6
  68. package/dist/components/nodes/SquareNode.svelte +15 -8
  69. package/dist/components/nodes/TerminalNode.svelte +9 -4
  70. package/dist/components/nodes/ToolNode.svelte +7 -1
  71. package/dist/components/nodes/WorkflowNode.svelte +16 -7
  72. package/dist/components/playground/ChatInput.svelte +11 -14
  73. package/dist/components/playground/ChatPanel.svelte +6 -49
  74. package/dist/components/playground/ChatPanel.svelte.d.ts +0 -14
  75. package/dist/components/playground/ControlPanel.svelte +134 -123
  76. package/dist/components/playground/ControlPanel.svelte.d.ts +3 -0
  77. package/dist/components/playground/ExecutionLogs.svelte +11 -9
  78. package/dist/components/playground/InputCollector.svelte +11 -9
  79. package/dist/components/playground/MessageStream.svelte +17 -23
  80. package/dist/components/playground/PipelineKanbanView.svelte +69 -8
  81. package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
  82. package/dist/components/playground/PipelinePanel.svelte +31 -8
  83. package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
  84. package/dist/components/playground/PipelineTableView.svelte +188 -44
  85. package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
  86. package/dist/components/playground/Playground.svelte +154 -105
  87. package/dist/components/playground/Playground.svelte.d.ts +5 -0
  88. package/dist/components/playground/PlaygroundApp.svelte +11 -1
  89. package/dist/components/playground/PlaygroundApp.svelte.d.ts +6 -0
  90. package/dist/components/playground/PlaygroundModal.svelte +18 -3
  91. package/dist/components/playground/PlaygroundModal.svelte.d.ts +6 -0
  92. package/dist/components/playground/PlaygroundStudio.svelte +40 -32
  93. package/dist/components/playground/PlaygroundStudio.svelte.d.ts +6 -0
  94. package/dist/components/playground/SessionManager.svelte +9 -12
  95. package/dist/components/playground/pipelineViewUtils.svelte.d.ts +30 -1
  96. package/dist/components/playground/pipelineViewUtils.svelte.js +40 -3
  97. package/dist/config/endpoints.d.ts +23 -7
  98. package/dist/config/endpoints.js +30 -10
  99. package/dist/core/index.d.ts +5 -6
  100. package/dist/core/index.js +8 -12
  101. package/dist/display/index.d.ts +6 -3
  102. package/dist/display/index.js +7 -5
  103. package/dist/editor/index.d.ts +20 -21
  104. package/dist/editor/index.js +26 -36
  105. package/dist/form/code.d.ts +25 -15
  106. package/dist/form/code.js +44 -41
  107. package/dist/form/fieldRegistry.d.ts +17 -13
  108. package/dist/form/fieldRegistry.js +32 -12
  109. package/dist/form/full.d.ts +19 -14
  110. package/dist/form/full.js +26 -28
  111. package/dist/form/index.d.ts +3 -4
  112. package/dist/form/index.js +6 -5
  113. package/dist/form/markdown.d.ts +13 -8
  114. package/dist/form/markdown.js +22 -23
  115. package/dist/helpers/proximityConnect.d.ts +3 -2
  116. package/dist/helpers/proximityConnect.js +2 -5
  117. package/dist/helpers/workflowEditorHelper.d.ts +14 -5
  118. package/dist/helpers/workflowEditorHelper.js +28 -25
  119. package/dist/index.d.ts +28 -24
  120. package/dist/index.js +27 -50
  121. package/dist/messages/defaults.d.ts +2 -5
  122. package/dist/messages/defaults.js +3 -6
  123. package/dist/messages/index.d.ts +0 -1
  124. package/dist/messages/index.js +0 -1
  125. package/dist/mocks/app-forms.d.ts +6 -2
  126. package/dist/mocks/app-forms.js +11 -4
  127. package/dist/openapi/v1/openapi.yaml +3 -3
  128. package/dist/playground/index.d.ts +4 -5
  129. package/dist/playground/index.js +4 -32
  130. package/dist/playground/mount.d.ts +25 -0
  131. package/dist/playground/mount.js +50 -20
  132. package/dist/registry/{BaseRegistry.d.ts → BaseRegistry.svelte.d.ts} +22 -1
  133. package/dist/registry/{BaseRegistry.js → BaseRegistry.svelte.js} +37 -1
  134. package/dist/registry/builtinFormats.d.ts +9 -18
  135. package/dist/registry/builtinFormats.js +9 -39
  136. package/dist/registry/builtinNodeTypes.d.ts +53 -0
  137. package/dist/registry/builtinNodeTypes.js +67 -0
  138. package/dist/registry/builtinNodes.d.ts +2 -64
  139. package/dist/registry/builtinNodes.js +7 -103
  140. package/dist/registry/index.d.ts +3 -4
  141. package/dist/registry/index.js +4 -6
  142. package/dist/registry/nodeComponentRegistry.d.ts +182 -15
  143. package/dist/registry/nodeComponentRegistry.js +235 -17
  144. package/dist/registry/workflowFormatRegistry.d.ts +14 -9
  145. package/dist/registry/workflowFormatRegistry.js +24 -8
  146. package/dist/{schema → schemas}/index.d.ts +2 -2
  147. package/dist/{schema → schemas}/index.js +2 -2
  148. package/dist/schemas/v1/workflow.schema.json +3 -3
  149. package/dist/services/agentSpecExecutionService.d.ts +0 -2
  150. package/dist/services/agentSpecExecutionService.js +0 -3
  151. package/dist/services/apiVariableService.d.ts +2 -1
  152. package/dist/services/apiVariableService.js +16 -47
  153. package/dist/services/autoSaveService.d.ts +7 -0
  154. package/dist/services/autoSaveService.js +6 -4
  155. package/dist/services/categoriesApi.js +3 -6
  156. package/dist/services/chatService.d.ts +9 -4
  157. package/dist/services/chatService.js +23 -28
  158. package/dist/services/draftStorage.d.ts +129 -13
  159. package/dist/services/draftStorage.js +185 -37
  160. package/dist/services/dynamicSchemaService.d.ts +2 -1
  161. package/dist/services/dynamicSchemaService.js +5 -22
  162. package/dist/services/globalSave.d.ts +13 -12
  163. package/dist/services/globalSave.js +29 -51
  164. package/dist/services/historyService.d.ts +9 -3
  165. package/dist/services/historyService.js +9 -3
  166. package/dist/services/interruptService.d.ts +15 -9
  167. package/dist/services/interruptService.js +35 -37
  168. package/dist/services/nodeExecutionService.d.ts +18 -3
  169. package/dist/services/nodeExecutionService.js +71 -45
  170. package/dist/services/playgroundService.d.ts +16 -10
  171. package/dist/services/playgroundService.js +42 -43
  172. package/dist/services/portConfigApi.js +3 -6
  173. package/dist/services/settingsService.d.ts +9 -4
  174. package/dist/services/settingsService.js +23 -12
  175. package/dist/services/variableService.d.ts +2 -1
  176. package/dist/services/variableService.js +2 -2
  177. package/dist/services/workflowStorage.js +6 -6
  178. package/dist/stores/apiContext.d.ts +56 -0
  179. package/dist/stores/apiContext.js +80 -0
  180. package/dist/stores/categoriesStore.svelte.d.ts +28 -23
  181. package/dist/stores/categoriesStore.svelte.js +69 -64
  182. package/dist/stores/getInstance.svelte.d.ts +39 -0
  183. package/dist/stores/getInstance.svelte.js +65 -0
  184. package/dist/stores/historyStore.svelte.d.ts +77 -93
  185. package/dist/stores/historyStore.svelte.js +134 -160
  186. package/dist/stores/instanceContainer.svelte.d.ts +111 -0
  187. package/dist/stores/instanceContainer.svelte.js +114 -0
  188. package/dist/stores/interruptStore.svelte.d.ts +112 -82
  189. package/dist/stores/interruptStore.svelte.js +253 -226
  190. package/dist/stores/pipelinePanelStore.svelte.d.ts +27 -3
  191. package/dist/stores/pipelinePanelStore.svelte.js +61 -14
  192. package/dist/stores/playgroundStore.svelte.d.ts +169 -222
  193. package/dist/stores/playgroundStore.svelte.js +513 -580
  194. package/dist/stores/portCoordinateStore.svelte.d.ts +57 -51
  195. package/dist/stores/portCoordinateStore.svelte.js +109 -98
  196. package/dist/stores/settingsStore.svelte.d.ts +4 -1
  197. package/dist/stores/settingsStore.svelte.js +47 -12
  198. package/dist/stores/workflowStore.svelte.d.ts +178 -213
  199. package/dist/stores/workflowStore.svelte.js +449 -501
  200. package/dist/stories/EdgeDecorator.svelte +5 -2
  201. package/dist/stories/NodeDecorator.svelte +5 -3
  202. package/dist/svelte-app.d.ts +60 -10
  203. package/dist/svelte-app.js +159 -54
  204. package/dist/types/auth.d.ts +9 -51
  205. package/dist/types/auth.js +4 -54
  206. package/dist/types/events.d.ts +6 -3
  207. package/dist/types/index.d.ts +37 -5
  208. package/dist/types/index.js +0 -1
  209. package/dist/types/navbar.d.ts +7 -0
  210. package/dist/types/playground.d.ts +18 -3
  211. package/dist/types/settings.d.ts +13 -0
  212. package/dist/types/settings.js +1 -0
  213. package/dist/utils/colors.d.ts +47 -21
  214. package/dist/utils/colors.js +69 -68
  215. package/dist/utils/connections.d.ts +9 -15
  216. package/dist/utils/connections.js +13 -32
  217. package/dist/utils/duration.d.ts +13 -0
  218. package/dist/utils/duration.js +45 -0
  219. package/dist/utils/edgeStyling.js +9 -5
  220. package/dist/utils/fetchWithAuth.d.ts +36 -15
  221. package/dist/utils/fetchWithAuth.js +53 -23
  222. package/dist/utils/icons.d.ts +5 -2
  223. package/dist/utils/icons.js +6 -5
  224. package/dist/utils/nodeSwap.d.ts +6 -2
  225. package/dist/utils/nodeSwap.js +62 -126
  226. package/dist/utils/nodeTypes.d.ts +17 -8
  227. package/dist/utils/nodeTypes.js +27 -20
  228. package/dist/utils/performanceUtils.js +7 -0
  229. package/package.json +7 -5
  230. package/dist/messages/deprecation.d.ts +0 -20
  231. package/dist/messages/deprecation.js +0 -33
  232. package/dist/registry/plugin.d.ts +0 -215
  233. package/dist/registry/plugin.js +0 -249
  234. package/dist/services/api.d.ts +0 -129
  235. package/dist/services/api.js +0 -217
@@ -2,7 +2,9 @@
2
2
  * Authentication Provider Types for FlowDrop
3
3
  *
4
4
  * Provides interfaces and implementations for authentication in FlowDrop.
5
- * AuthProvider is passed at mount time and cannot be changed without remounting.
5
+ * An AuthProvider is supplied at mount time (or via `fd.api.configure`) and can
6
+ * be swapped at runtime with `fd.api.setAuthProvider(...)` — e.g. on login or
7
+ * logout — without remounting.
6
8
  *
7
9
  * @module types/auth
8
10
  */
@@ -55,7 +57,7 @@ export class StaticAuthProvider {
55
57
  break;
56
58
  case 'api_key':
57
59
  if (config.apiKey) {
58
- this.headers['X-API-Key'] = config.apiKey;
60
+ this.headers[config.apiKeyHeader ?? 'X-API-Key'] = config.apiKey;
59
61
  }
60
62
  break;
61
63
  case 'custom':
@@ -79,35 +81,6 @@ export class StaticAuthProvider {
79
81
  async getAuthHeaders() {
80
82
  return this.headers;
81
83
  }
82
- /**
83
- * Check if authenticated
84
- *
85
- * Returns true if any auth headers are configured.
86
- *
87
- * @returns true if headers are configured
88
- */
89
- isAuthenticated() {
90
- return Object.keys(this.headers).length > 0;
91
- }
92
- /**
93
- * Handle unauthorized response
94
- *
95
- * Static provider cannot refresh tokens, so always returns false.
96
- *
97
- * @returns Promise resolving to false (cannot refresh)
98
- */
99
- async onUnauthorized() {
100
- // Static provider cannot refresh tokens
101
- return false;
102
- }
103
- /**
104
- * Handle forbidden response
105
- *
106
- * Static provider has no special handling for 403.
107
- */
108
- async onForbidden() {
109
- // No special handling for static provider
110
- }
111
84
  }
112
85
  /**
113
86
  * Callback-based authentication provider
@@ -162,19 +135,6 @@ export class CallbackAuthProvider {
162
135
  }
163
136
  return {};
164
137
  }
165
- /**
166
- * Check if authenticated
167
- *
168
- * For callback-based auth, we assume authenticated if getToken exists.
169
- * The actual token validity is checked when making requests.
170
- *
171
- * @returns true (assumes authenticated, actual check happens on request)
172
- */
173
- isAuthenticated() {
174
- // For callback-based auth, we assume authenticated if getToken exists
175
- // The actual token validity is checked when making requests
176
- return true;
177
- }
178
138
  /**
179
139
  * Handle unauthorized response
180
140
  *
@@ -216,14 +176,4 @@ export class NoAuthProvider {
216
176
  async getAuthHeaders() {
217
177
  return {};
218
178
  }
219
- /**
220
- * Check if authenticated
221
- *
222
- * Always returns false (no auth configured).
223
- *
224
- * @returns false
225
- */
226
- isAuthenticated() {
227
- return false;
228
- }
229
179
  }
@@ -166,10 +166,13 @@ export interface FlowDropEventHandlers {
166
166
  */
167
167
  export interface FlowDropFeatures {
168
168
  /**
169
- * Save drafts to localStorage automatically
169
+ * Save drafts to browser storage automatically
170
170
  *
171
171
  * When enabled, FlowDrop will periodically save the current workflow
172
- * to localStorage as a draft. This helps prevent data loss.
172
+ * to draft storage (localStorage by default, configurable via the
173
+ * `draftStorage` mount option). This helps prevent data loss. End users
174
+ * can additionally opt out at runtime via the "Store Drafts in Browser"
175
+ * behavior setting.
173
176
  *
174
177
  * @default true
175
178
  */
@@ -177,7 +180,7 @@ export interface FlowDropFeatures {
177
180
  /**
178
181
  * Auto-save interval in milliseconds
179
182
  *
180
- * How often to save drafts to localStorage when autoSaveDraft is enabled.
183
+ * How often to save drafts to storage when autoSaveDraft is enabled.
181
184
  *
182
185
  * @default 30000 (30 seconds)
183
186
  */
@@ -2,9 +2,9 @@
2
2
  * Core types for the Workflow Library
3
3
  */
4
4
  import type { Component } from 'svelte';
5
- import type { Node, Edge, XYPosition } from '@xyflow/svelte';
6
- import { ConnectionLineType } from '@xyflow/svelte';
5
+ import type { Node, Edge, XYPosition, ConnectionLineType } from '@xyflow/svelte';
7
6
  import type { EndpointConfig } from '../config/endpoints.js';
7
+ import type { AuthProvider } from './auth.js';
8
8
  /**
9
9
  * Built-in node categories that ship with FlowDrop.
10
10
  * These categories have predefined icons, colors, and display names.
@@ -208,7 +208,7 @@ export type BuiltinNodeType = 'note' | 'simple' | 'square' | 'atom' | 'tool' | '
208
208
  * Includes built-in types and allows custom registered types.
209
209
  *
210
210
  * Built-in types: note, simple, square, tool, gateway, terminal, default
211
- * Custom types: Any string registered via nodeComponentRegistry
211
+ * Custom types: Any string registered via fd.nodes
212
212
  *
213
213
  * @example
214
214
  * ```typescript
@@ -1188,8 +1188,9 @@ export interface Workflow {
1188
1188
  description?: string;
1189
1189
  nodes: WorkflowNode[];
1190
1190
  edges: WorkflowEdge[];
1191
- metadata?: {
1192
- version: string;
1191
+ metadata: {
1192
+ /** Workflow schema format version — identifies the document format, not the workflow's own revision. */
1193
+ schemaVersion: string;
1193
1194
  createdAt: string;
1194
1195
  updatedAt: string;
1195
1196
  author?: string;
@@ -1230,6 +1231,8 @@ export interface PipelineViewProps {
1230
1231
  pipelineId: string | null;
1231
1232
  workflow: Workflow;
1232
1233
  endpointConfig: EndpointConfig;
1234
+ /** Auth provider for building authenticated API clients in custom views. */
1235
+ authProvider?: AuthProvider;
1233
1236
  refreshTrigger?: number;
1234
1237
  }
1235
1238
  /** A custom view injected into the PipelinePanel view switcher. */
@@ -1243,6 +1246,31 @@ export interface PipelineViewDef {
1243
1246
  /** Svelte component that receives PipelineViewProps */
1244
1247
  component: Component<PipelineViewProps>;
1245
1248
  }
1249
+ /**
1250
+ * One job execution of a node within a pipeline run.
1251
+ *
1252
+ * Loop-orchestrated workflows create one job per iteration for the same
1253
+ * node (labels carry an iteration suffix, e.g. "Invoke tool #2"), so a node
1254
+ * can have several of these per run.
1255
+ */
1256
+ export interface NodeJobExecution {
1257
+ /** Job entity ID */
1258
+ id?: string;
1259
+ /** Job label, carries the iteration suffix (e.g. "Invoke tool #2") */
1260
+ label?: string;
1261
+ /** Job status */
1262
+ status: NodeExecutionStatus;
1263
+ /** ISO timestamp the job started, if it ran */
1264
+ started?: string;
1265
+ /** ISO timestamp the job completed, if it finished */
1266
+ completed?: string;
1267
+ /** Execution duration in milliseconds, if the job ran to completion */
1268
+ executionTime?: number;
1269
+ /** Precise execution duration in microseconds, when the backend provides it */
1270
+ executionTimeUs?: number;
1271
+ /** Error message if the job failed */
1272
+ error?: string;
1273
+ }
1246
1274
  /**
1247
1275
  * Node execution tracking information
1248
1276
  */
@@ -1255,12 +1283,16 @@ export interface NodeExecutionInfo {
1255
1283
  lastExecuted?: string;
1256
1284
  /** Last execution duration in milliseconds */
1257
1285
  lastExecutionDuration?: number;
1286
+ /** Precise last execution duration in microseconds, when the backend provides it */
1287
+ lastExecutionDurationUs?: number;
1258
1288
  /** Last error message if execution failed */
1259
1289
  lastError?: string;
1260
1290
  /** Whether the node is currently being executed */
1261
1291
  isExecuting: boolean;
1262
1292
  /** Execution output data (e.g., active branches for gateway nodes) */
1263
1293
  output?: Record<string, unknown>;
1294
+ /** Per-job execution history (loop iterations), in pipeline order */
1295
+ jobs?: NodeJobExecution[];
1264
1296
  }
1265
1297
  /**
1266
1298
  * Workflow execution status
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Core types for the Workflow Library
3
3
  */
4
- import { ConnectionLineType } from '@xyflow/svelte';
5
4
  /**
6
5
  * Default workflow format used when none is specified.
7
6
  */
@@ -11,4 +11,11 @@ export interface NavbarAction {
11
11
  onclick?: (event: Event) => void;
12
12
  /** If true, opens link in new tab with `rel="noopener noreferrer"`. */
13
13
  external?: boolean;
14
+ /**
15
+ * Optional group label. Items sharing the same `group` cluster together
16
+ * under a header inside the flyout dropdown. Ungrouped items render first.
17
+ * Group order follows first occurrence in the array. Ignored when the
18
+ * navbar is in split mode (the inline row of buttons).
19
+ */
20
+ group?: string;
14
21
  }
@@ -376,11 +376,26 @@ export interface PlaygroundConfig {
376
376
  */
377
377
  showSidebar?: boolean;
378
378
  /**
379
- * Whether to show the session header bar (default: true)
380
- * When false, the header with session name and close button is hidden.
381
- * Typically used together with showSidebar: false for minimal UI.
379
+ * Whether to show the ControlPanel header bar (default: true)
380
+ * When false, hides the entire header row: session label, session chip
381
+ * (with its New Session / session list popover) and the toolbar actions
382
+ * (Pipeline / Refresh / Logs). Use for a minimal, locked-down playground.
382
383
  */
383
384
  showSessionHeader?: boolean;
385
+ /**
386
+ * Whether to show the "New Session" entry in the session chip popover
387
+ * (default: true). When false, users cannot create additional sessions
388
+ * from the UI — useful for single-session playground embeds.
389
+ * No effect when showSessionHeader is false.
390
+ */
391
+ showNewSessionButton?: boolean;
392
+ /**
393
+ * Whether to show the session chip selector and its session list (default:
394
+ * true). When false, the chip dropdown is hidden entirely — users cannot
395
+ * switch sessions or see other sessions. Useful for locking a playground
396
+ * embed to a single session. No effect when showSessionHeader is false.
397
+ */
398
+ showSessionList?: boolean;
384
399
  /**
385
400
  * Determines if polling should stop for a given session status.
386
401
  * Override to customize which statuses pause polling.
@@ -72,6 +72,19 @@ export interface BehaviorSettings {
72
72
  autoSave: boolean;
73
73
  /** Auto-save interval in milliseconds */
74
74
  autoSaveInterval: number;
75
+ /**
76
+ * Persist workflow drafts in browser storage.
77
+ *
78
+ * When enabled (default), unsaved changes are written to browser storage
79
+ * so they survive page reloads. On the default `localStorage` backend,
80
+ * drafts remain stored on the device even after the tab or browser is
81
+ * closed, until they are saved or cleared. Turning this off stops draft
82
+ * writes and removes the current draft.
83
+ *
84
+ * Caveat: the toggle applies per tab. Other tabs that are already open
85
+ * read settings at load time and keep writing drafts until reloaded.
86
+ */
87
+ storeDraftsInBrowser: boolean;
75
88
  /** Maximum number of undo history entries */
76
89
  undoHistoryLimit: number;
77
90
  /** Show confirmation dialog before deleting nodes */
@@ -70,6 +70,7 @@ export const DEFAULT_UI_SETTINGS = {
70
70
  export const DEFAULT_BEHAVIOR_SETTINGS = {
71
71
  autoSave: false,
72
72
  autoSaveInterval: 30000,
73
+ storeDraftsInBrowser: true,
73
74
  undoHistoryLimit: 50,
74
75
  confirmDelete: false,
75
76
  chatAutoRetry: true
@@ -4,6 +4,8 @@
4
4
  * Uses BEM syntax for CSS classes
5
5
  */
6
6
  import type { NodeCategory, PortDataTypeConfig } from '../types/index.js';
7
+ import type { PortCompatibilityChecker } from './connections.js';
8
+ import type { CategoriesStore } from '../stores/categoriesStore.svelte.js';
7
9
  /**
8
10
  * Category color mapping to design tokens (CSS variables)
9
11
  * Uses --fd-node-* tokens from tokens.css
@@ -14,20 +16,27 @@ export declare const CATEGORY_COLOR_TOKENS: Record<string, string>;
14
16
  * Get the design token for a category color.
15
17
  * Checks the categories store first (which includes API overrides),
16
18
  * then falls back to the static CATEGORY_COLOR_TOKENS map, then to slate.
19
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
20
+ * @param category - The node category
17
21
  */
18
- export declare function getCategoryColorToken(category: NodeCategory): string;
22
+ export declare function getCategoryColorToken(categories: CategoriesStore, category: NodeCategory): string;
19
23
  /**
20
24
  * Get the reference color token for a data type (configurable version)
25
+ * @param checker - The instance's port compatibility checker (provides data-type config)
26
+ * @param dataType - The data type
21
27
  */
22
- export declare function getDataTypeColorToken(dataType: string): string;
28
+ export declare function getDataTypeColorToken(checker: PortCompatibilityChecker, dataType: string): string;
23
29
  /**
24
30
  * Get data type configuration from port config
31
+ * @param checker - The instance's port compatibility checker
32
+ * @param dataType - The data type
25
33
  */
26
- export declare function getDataTypeConfig(dataType: string): PortDataTypeConfig | undefined;
34
+ export declare function getDataTypeConfig(checker: PortCompatibilityChecker, dataType: string): PortDataTypeConfig | undefined;
27
35
  /**
28
36
  * Get all available data types from port configuration
37
+ * @param checker - The instance's port compatibility checker
29
38
  */
30
- export declare function getAvailableDataTypes(): PortDataTypeConfig[];
39
+ export declare function getAvailableDataTypes(checker: PortCompatibilityChecker): PortDataTypeConfig[];
31
40
  /**
32
41
  * Default colors for fallback cases
33
42
  */
@@ -39,43 +48,49 @@ export declare const DEFAULT_COLORS: {
39
48
  };
40
49
  /**
41
50
  * Get category colors
51
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
42
52
  * @param category - The node category
43
53
  * @returns The color configuration for the category
44
54
  */
45
- export declare function getCategoryColors(category: NodeCategory): string;
55
+ export declare function getCategoryColors(categories: CategoriesStore, category: NodeCategory): string;
46
56
  /**
47
57
  * Get category background color
58
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
48
59
  * @param category - The node category
49
60
  * @returns The background color class
50
61
  */
51
- export declare function getCategoryBackground(category: NodeCategory): string;
62
+ export declare function getCategoryBackground(categories: CategoriesStore, category: NodeCategory): string;
52
63
  /**
53
64
  * Get category accent color
65
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
54
66
  * @param category - The node category
55
67
  * @returns The accent color class
56
68
  */
57
- export declare function getCategoryAccent(category: NodeCategory): string;
69
+ export declare function getCategoryAccent(categories: CategoriesStore, category: NodeCategory): string;
58
70
  /**
59
71
  * Get category text color
72
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
60
73
  * @param category - The node category
61
74
  * @returns The text color class
62
75
  */
63
- export declare function getCategoryText(category: NodeCategory): string;
76
+ export declare function getCategoryText(categories: CategoriesStore, category: NodeCategory): string;
64
77
  /**
65
78
  * Get category border color
79
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
66
80
  * @param category - The node category
67
81
  * @returns The border color class
68
82
  */
69
- export declare function getCategoryBorder(category: NodeCategory): string;
83
+ export declare function getCategoryBorder(categories: CategoriesStore, category: NodeCategory): string;
70
84
  /**
71
85
  * Get node colors based on category and state
86
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
72
87
  * @param category - The node category
73
88
  * @param isError - Whether the node is in error state
74
89
  * @param isProcessing - Whether the node is processing
75
90
  * @param isSelected - Whether the node is selected
76
91
  * @returns The color configuration object
77
92
  */
78
- export declare function getNodeColors(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): {
93
+ export declare function getNodeColors(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): {
79
94
  background: string;
80
95
  accent: string;
81
96
  text: string;
@@ -83,52 +98,58 @@ export declare function getNodeColors(category: NodeCategory, isError?: boolean,
83
98
  };
84
99
  /**
85
100
  * Get node background color
101
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
86
102
  * @param category - The node category
87
103
  * @param isError - Whether the node is in error state
88
104
  * @param isProcessing - Whether the node is processing
89
105
  * @param isSelected - Whether the node is selected
90
106
  * @returns The background color
91
107
  */
92
- export declare function getNodeBackground(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
108
+ export declare function getNodeBackground(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
93
109
  /**
94
110
  * Get node accent color
111
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
95
112
  * @param category - The node category
96
113
  * @param isError - Whether the node is in error state
97
114
  * @param isProcessing - Whether the node is processing
98
115
  * @param isSelected - Whether the node is selected
99
116
  * @returns The accent color
100
117
  */
101
- export declare function getNodeAccent(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
118
+ export declare function getNodeAccent(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
102
119
  /**
103
120
  * Get node text color
121
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
104
122
  * @param category - The node category
105
123
  * @param isError - Whether the node is in error state
106
124
  * @param isProcessing - Whether the node is processing
107
125
  * @param isSelected - Whether the node is selected
108
126
  * @returns The text color
109
127
  */
110
- export declare function getNodeText(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
128
+ export declare function getNodeText(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
111
129
  /**
112
130
  * Get node border color
131
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
113
132
  * @param category - The node category
114
133
  * @param isError - Whether the node is in error state
115
134
  * @param isProcessing - Whether the node is processing
116
135
  * @param isSelected - Whether the node is selected
117
136
  * @returns The border color
118
137
  */
119
- export declare function getNodeBorder(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
138
+ export declare function getNodeBorder(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
120
139
  /**
121
140
  * Get data type color
141
+ * @param checker - The instance's port compatibility checker
122
142
  * @param dataType - The data type
123
143
  * @returns The color for the data type
124
144
  */
125
- export declare function getDataTypeColor(dataType: string): string;
145
+ export declare function getDataTypeColor(checker: PortCompatibilityChecker, dataType: string): string;
126
146
  /**
127
147
  * Parse typed array notation and get display information
148
+ * @param checker - The instance's port compatibility checker
128
149
  * @param dataType - The data type (e.g., "string[]", "number", "object[]")
129
150
  * @returns Object with display information
130
151
  */
131
- export declare function parseDataTypeDisplay(dataType: string): {
152
+ export declare function parseDataTypeDisplay(checker: PortCompatibilityChecker, dataType: string): {
132
153
  baseType: string;
133
154
  isArray: boolean;
134
155
  displayName: string;
@@ -136,10 +157,11 @@ export declare function parseDataTypeDisplay(dataType: string): {
136
157
  };
137
158
  /**
138
159
  * Get formatted display text for a data type
160
+ * @param checker - The instance's port compatibility checker
139
161
  * @param dataType - The data type
140
162
  * @returns Formatted display text
141
163
  */
142
- export declare function getDataTypeDisplayText(dataType: string): string;
164
+ export declare function getDataTypeDisplayText(checker: PortCompatibilityChecker, dataType: string): string;
143
165
  /**
144
166
  * Check if a data type represents an array
145
167
  * @param dataType - The data type
@@ -191,30 +213,34 @@ export declare function getContrastTextColor(backgroundColor: string): string;
191
213
  export declare function resolveColorToken(token: string): string;
192
214
  /**
193
215
  * Get the appropriate contrast text color for a data type badge
216
+ * @param checker - The instance's port compatibility checker
194
217
  * @param dataType - The data type (e.g., "array", "string", "number")
195
218
  * @returns CSS color value for text that provides good contrast on the data type's background
196
219
  */
197
- export declare function getContrastTextColorForDataType(dataType: string): string;
220
+ export declare function getContrastTextColorForDataType(checker: PortCompatibilityChecker, dataType: string): string;
198
221
  /**
199
222
  * Get the appropriate contrast text color for a category badge
223
+ * @param categories - The instance's categories store (e.g. `fd.categories`)
200
224
  * @param category - The node category
201
225
  * @returns CSS color value for text that provides good contrast on the category's background
202
226
  */
203
- export declare function getContrastTextColorForCategory(category: NodeCategory): string;
227
+ export declare function getContrastTextColorForCategory(categories: CategoriesStore, category: NodeCategory): string;
204
228
  /**
205
229
  * Get a semi-transparent tinted background color for ports
206
230
  * Creates a cohesive look with the icon wrapper styling
231
+ * @param checker - The instance's port compatibility checker
207
232
  * @param dataType - The data type
208
233
  * @param opacity - Opacity percentage (default 25%)
209
234
  * @returns CSS color-mix expression for the tinted background
210
235
  */
211
- export declare function getPortBackgroundColor(dataType: string, opacity?: number): string;
236
+ export declare function getPortBackgroundColor(checker: PortCompatibilityChecker, dataType: string, opacity?: number): string;
212
237
  /**
213
238
  * Get the border color for ports (solid data type color)
239
+ * @param checker - The instance's port compatibility checker
214
240
  * @param dataType - The data type
215
241
  * @returns CSS color value for the port border
216
242
  */
217
- export declare function getPortBorderColor(dataType: string): string;
243
+ export declare function getPortBorderColor(checker: PortCompatibilityChecker, dataType: string): string;
218
244
  /**
219
245
  * Convert RGB components to hex color string
220
246
  * @param r - Red component (0-255)