@flowdrop/flowdrop 1.14.0 → 2.0.0-beta.1

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 (218) hide show
  1. package/CHANGELOG.md +475 -0
  2. package/MIGRATION-2.0.md +472 -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/chat/batchFeedback.d.ts +39 -0
  8. package/dist/chat/batchFeedback.js +51 -0
  9. package/dist/commands/executor.js +15 -1
  10. package/dist/commands/storeIntegration.svelte.d.ts +4 -1
  11. package/dist/commands/storeIntegration.svelte.js +26 -21
  12. package/dist/commands/types.d.ts +2 -0
  13. package/dist/components/App.svelte +162 -192
  14. package/dist/components/App.svelte.d.ts +47 -8
  15. package/dist/components/ConfigForm.svelte +110 -66
  16. package/dist/components/ConfigModal.svelte +7 -2
  17. package/dist/components/ConnectionLine.svelte +4 -2
  18. package/dist/components/Navbar.svelte +61 -1
  19. package/dist/components/NodeSidebar.svelte +27 -45
  20. package/dist/components/NodeStatusOverlay.svelte +94 -6
  21. package/dist/components/NodeSwapPicker.svelte +10 -8
  22. package/dist/components/PipelineStatus.svelte +16 -67
  23. package/dist/components/PortCoordinateTracker.svelte +5 -6
  24. package/dist/components/SchemaForm.stories.svelte +1 -3
  25. package/dist/components/SchemaForm.svelte +45 -40
  26. package/dist/components/SchemaForm.svelte.d.ts +0 -8
  27. package/dist/components/SettingsModal.svelte +8 -3
  28. package/dist/components/SettingsPanel.svelte +20 -4
  29. package/dist/components/SwapMappingEditor.svelte +67 -49
  30. package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
  31. package/dist/components/UniversalNode.svelte +9 -7
  32. package/dist/components/WorkflowEditor.svelte +118 -111
  33. package/dist/components/WorkflowEditor.svelte.d.ts +18 -10
  34. package/dist/components/chat/AIChatPanel.svelte +93 -89
  35. package/dist/components/chat/AIChatPanel.svelte.d.ts +0 -4
  36. package/dist/components/chat/CommandPreview.svelte +2 -1
  37. package/dist/components/console/CommandConsole.svelte +7 -5
  38. package/dist/components/console/ConsoleAutocomplete.svelte +10 -11
  39. package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
  40. package/dist/components/console/ConsoleInput.svelte +15 -6
  41. package/dist/components/console/ConsoleOutput.svelte +2 -1
  42. package/dist/components/form/FormArray.svelte +5 -9
  43. package/dist/components/form/FormArray.svelte.d.ts +2 -1
  44. package/dist/components/form/FormAutocomplete.svelte +29 -13
  45. package/dist/components/form/FormField.svelte +4 -2
  46. package/dist/components/form/FormFieldLight.svelte +4 -2
  47. package/dist/components/form/FormMarkdownEditor.svelte +9 -4
  48. package/dist/components/form/FormRangeField.svelte +1 -0
  49. package/dist/components/form/FormTemplateEditor.svelte +11 -3
  50. package/dist/components/form/FormToggle.svelte +5 -12
  51. package/dist/components/form/FormToggle.svelte.d.ts +4 -2
  52. package/dist/components/form/templateAutocomplete.js +1 -5
  53. package/dist/components/form/types.d.ts +1 -14
  54. package/dist/components/interrupt/FormPrompt.svelte +3 -2
  55. package/dist/components/interrupt/InterruptBubble.svelte +16 -17
  56. package/dist/components/interrupt/ReviewPrompt.svelte +10 -3
  57. package/dist/components/interrupt/TextInputPrompt.svelte +2 -1
  58. package/dist/components/layouts/MainLayout.svelte +20 -13
  59. package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
  60. package/dist/components/nodes/AtomNode.svelte +292 -0
  61. package/dist/components/nodes/AtomNode.svelte.d.ts +26 -0
  62. package/dist/components/nodes/GatewayNode.svelte +19 -10
  63. package/dist/components/nodes/IdeaNode.svelte +7 -0
  64. package/dist/components/nodes/SimpleNode.svelte +11 -6
  65. package/dist/components/nodes/SquareNode.svelte +15 -8
  66. package/dist/components/nodes/TerminalNode.svelte +9 -4
  67. package/dist/components/nodes/ToolNode.svelte +7 -1
  68. package/dist/components/nodes/WorkflowNode.svelte +16 -7
  69. package/dist/components/playground/ChatInput.svelte +11 -14
  70. package/dist/components/playground/ChatPanel.svelte +6 -49
  71. package/dist/components/playground/ChatPanel.svelte.d.ts +0 -14
  72. package/dist/components/playground/ControlPanel.svelte +134 -123
  73. package/dist/components/playground/ControlPanel.svelte.d.ts +3 -0
  74. package/dist/components/playground/ExecutionLogs.svelte +11 -9
  75. package/dist/components/playground/InputCollector.svelte +11 -9
  76. package/dist/components/playground/MessageStream.svelte +17 -23
  77. package/dist/components/playground/PipelineKanbanView.svelte +65 -6
  78. package/dist/components/playground/PipelinePanel.svelte +11 -5
  79. package/dist/components/playground/PipelineTableView.svelte +186 -44
  80. package/dist/components/playground/Playground.svelte +95 -92
  81. package/dist/components/playground/Playground.svelte.d.ts +2 -0
  82. package/dist/components/playground/PlaygroundApp.svelte +6 -1
  83. package/dist/components/playground/PlaygroundApp.svelte.d.ts +3 -0
  84. package/dist/components/playground/PlaygroundModal.svelte +13 -3
  85. package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -0
  86. package/dist/components/playground/PlaygroundStudio.svelte +34 -32
  87. package/dist/components/playground/PlaygroundStudio.svelte.d.ts +3 -0
  88. package/dist/components/playground/SessionManager.svelte +9 -12
  89. package/dist/components/playground/pipelineViewUtils.svelte.d.ts +28 -0
  90. package/dist/components/playground/pipelineViewUtils.svelte.js +38 -1
  91. package/dist/config/endpoints.d.ts +0 -7
  92. package/dist/config/endpoints.js +2 -10
  93. package/dist/core/index.d.ts +4 -4
  94. package/dist/core/index.js +6 -6
  95. package/dist/display/index.d.ts +0 -2
  96. package/dist/display/index.js +0 -6
  97. package/dist/editor/index.d.ts +19 -20
  98. package/dist/editor/index.js +25 -35
  99. package/dist/form/code.d.ts +25 -15
  100. package/dist/form/code.js +44 -41
  101. package/dist/form/fieldRegistry.d.ts +17 -13
  102. package/dist/form/fieldRegistry.js +32 -12
  103. package/dist/form/full.d.ts +17 -13
  104. package/dist/form/full.js +22 -27
  105. package/dist/form/index.d.ts +3 -3
  106. package/dist/form/index.js +3 -3
  107. package/dist/form/markdown.d.ts +13 -8
  108. package/dist/form/markdown.js +22 -23
  109. package/dist/helpers/proximityConnect.d.ts +7 -3
  110. package/dist/helpers/proximityConnect.js +19 -6
  111. package/dist/helpers/workflowEditorHelper.d.ts +12 -5
  112. package/dist/helpers/workflowEditorHelper.js +27 -25
  113. package/dist/index.d.ts +28 -24
  114. package/dist/index.js +27 -50
  115. package/dist/messages/defaults.d.ts +2 -5
  116. package/dist/messages/defaults.js +3 -6
  117. package/dist/messages/index.d.ts +0 -1
  118. package/dist/messages/index.js +0 -1
  119. package/dist/mocks/app-forms.d.ts +6 -2
  120. package/dist/mocks/app-forms.js +11 -4
  121. package/dist/openapi/v1/openapi.yaml +227 -164
  122. package/dist/playground/index.d.ts +2 -3
  123. package/dist/playground/index.js +2 -30
  124. package/dist/playground/mount.d.ts +15 -0
  125. package/dist/playground/mount.js +46 -20
  126. package/dist/registry/{BaseRegistry.d.ts → BaseRegistry.svelte.d.ts} +22 -1
  127. package/dist/registry/{BaseRegistry.js → BaseRegistry.svelte.js} +37 -1
  128. package/dist/registry/builtinFormats.d.ts +9 -18
  129. package/dist/registry/builtinFormats.js +9 -39
  130. package/dist/registry/builtinNodes.d.ts +1 -26
  131. package/dist/registry/builtinNodes.js +14 -50
  132. package/dist/registry/index.d.ts +3 -4
  133. package/dist/registry/index.js +4 -6
  134. package/dist/registry/nodeComponentRegistry.d.ts +182 -15
  135. package/dist/registry/nodeComponentRegistry.js +235 -17
  136. package/dist/registry/workflowFormatRegistry.d.ts +14 -9
  137. package/dist/registry/workflowFormatRegistry.js +24 -8
  138. package/dist/{schema → schemas}/index.d.ts +2 -2
  139. package/dist/{schema → schemas}/index.js +2 -2
  140. package/dist/schemas/v1/workflow.schema.json +53 -6
  141. package/dist/services/agentSpecExecutionService.js +0 -1
  142. package/dist/services/apiVariableService.d.ts +2 -1
  143. package/dist/services/apiVariableService.js +5 -22
  144. package/dist/services/autoSaveService.d.ts +7 -0
  145. package/dist/services/autoSaveService.js +6 -4
  146. package/dist/services/chatService.d.ts +8 -4
  147. package/dist/services/chatService.js +15 -15
  148. package/dist/services/draftStorage.d.ts +129 -13
  149. package/dist/services/draftStorage.js +185 -37
  150. package/dist/services/dynamicSchemaService.d.ts +2 -1
  151. package/dist/services/dynamicSchemaService.js +5 -22
  152. package/dist/services/globalSave.d.ts +13 -12
  153. package/dist/services/globalSave.js +29 -51
  154. package/dist/services/historyService.d.ts +9 -3
  155. package/dist/services/historyService.js +9 -3
  156. package/dist/services/interruptService.d.ts +14 -9
  157. package/dist/services/interruptService.js +27 -27
  158. package/dist/services/nodeExecutionService.d.ts +18 -3
  159. package/dist/services/nodeExecutionService.js +71 -45
  160. package/dist/services/playgroundService.d.ts +14 -9
  161. package/dist/services/playgroundService.js +31 -30
  162. package/dist/services/variableService.d.ts +2 -1
  163. package/dist/services/variableService.js +2 -2
  164. package/dist/services/workflowStorage.js +6 -6
  165. package/dist/stores/apiContext.d.ts +45 -0
  166. package/dist/stores/apiContext.js +65 -0
  167. package/dist/stores/categoriesStore.svelte.d.ts +28 -23
  168. package/dist/stores/categoriesStore.svelte.js +70 -64
  169. package/dist/stores/getInstance.svelte.d.ts +39 -0
  170. package/dist/stores/getInstance.svelte.js +65 -0
  171. package/dist/stores/historyStore.svelte.d.ts +77 -93
  172. package/dist/stores/historyStore.svelte.js +134 -160
  173. package/dist/stores/instanceContainer.svelte.d.ts +111 -0
  174. package/dist/stores/instanceContainer.svelte.js +114 -0
  175. package/dist/stores/interruptStore.svelte.d.ts +112 -82
  176. package/dist/stores/interruptStore.svelte.js +253 -226
  177. package/dist/stores/pipelinePanelStore.svelte.d.ts +27 -3
  178. package/dist/stores/pipelinePanelStore.svelte.js +61 -14
  179. package/dist/stores/playgroundStore.svelte.d.ts +169 -216
  180. package/dist/stores/playgroundStore.svelte.js +515 -572
  181. package/dist/stores/portCoordinateStore.svelte.d.ts +57 -51
  182. package/dist/stores/portCoordinateStore.svelte.js +109 -98
  183. package/dist/stores/settingsStore.svelte.d.ts +4 -1
  184. package/dist/stores/settingsStore.svelte.js +47 -12
  185. package/dist/stores/workflowStore.svelte.d.ts +178 -213
  186. package/dist/stores/workflowStore.svelte.js +449 -501
  187. package/dist/stories/EdgeDecorator.svelte +5 -2
  188. package/dist/stories/NodeDecorator.svelte +5 -3
  189. package/dist/svelte-app.d.ts +60 -10
  190. package/dist/svelte-app.js +157 -53
  191. package/dist/types/events.d.ts +6 -3
  192. package/dist/types/index.d.ts +71 -6
  193. package/dist/types/navbar.d.ts +7 -0
  194. package/dist/types/playground.d.ts +18 -3
  195. package/dist/types/settings.d.ts +13 -0
  196. package/dist/types/settings.js +1 -0
  197. package/dist/utils/colors.d.ts +47 -21
  198. package/dist/utils/colors.js +69 -68
  199. package/dist/utils/connections.d.ts +9 -15
  200. package/dist/utils/connections.js +13 -32
  201. package/dist/utils/duration.d.ts +13 -0
  202. package/dist/utils/duration.js +45 -0
  203. package/dist/utils/formMerge.d.ts +36 -0
  204. package/dist/utils/formMerge.js +70 -0
  205. package/dist/utils/icons.d.ts +5 -2
  206. package/dist/utils/icons.js +6 -5
  207. package/dist/utils/nodeSwap.d.ts +6 -2
  208. package/dist/utils/nodeSwap.js +62 -126
  209. package/dist/utils/nodeTypes.d.ts +17 -8
  210. package/dist/utils/nodeTypes.js +27 -19
  211. package/dist/utils/performanceUtils.js +7 -0
  212. package/package.json +6 -5
  213. package/dist/messages/deprecation.d.ts +0 -20
  214. package/dist/messages/deprecation.js +0 -33
  215. package/dist/registry/plugin.d.ts +0 -215
  216. package/dist/registry/plugin.js +0 -249
  217. package/dist/services/api.d.ts +0 -129
  218. package/dist/services/api.js +0 -217
@@ -15,7 +15,7 @@
15
15
  import { getDataTypeColor, getCategoryColorToken } from '../../utils/colors.js';
16
16
  import { getNodeIcon } from '../../utils/icons.js';
17
17
  import { getCircleHandlePosition } from '../../utils/handlePositioning.js';
18
- import { getConnectedHandles } from '../../stores/workflowStore.svelte.js';
18
+ import { getInstance } from '../../stores/getInstance.svelte.js';
19
19
 
20
20
  /**
21
21
  * Terminal node variant types
@@ -83,6 +83,9 @@
83
83
  isError?: boolean;
84
84
  }>();
85
85
 
86
+ const fd = getInstance();
87
+ const checker = fd.portCompatibility;
88
+
86
89
  /**
87
90
  * Determine terminal variant from config or metadata
88
91
  * Priority: config.variant > metadata tag detection > default to "start"
@@ -156,7 +159,7 @@
156
159
  return true;
157
160
  }
158
161
  const handleId = `${props.data.nodeId}-${type}-${port.id}`;
159
- return getConnectedHandles().has(handleId);
162
+ return fd.workflow.connectedHandles.has(handleId);
160
163
  }
161
164
 
162
165
  /**
@@ -165,7 +168,7 @@
165
168
  */
166
169
  let terminalIcon = $derived(
167
170
  props.data.metadata?.icon
168
- ? getNodeIcon(props.data.metadata.icon, props.data.metadata?.category)
171
+ ? getNodeIcon(fd.categories, props.data.metadata.icon, props.data.metadata?.category)
169
172
  : variantConfig.icon
170
173
  );
171
174
 
@@ -175,7 +178,7 @@
175
178
  */
176
179
  let terminalColor = $derived(
177
180
  props.data.metadata?.category
178
- ? getCategoryColorToken(props.data.metadata.category)
181
+ ? getCategoryColorToken(fd.categories, props.data.metadata.category)
179
182
  : variantConfig.color
180
183
  );
181
184
 
@@ -363,6 +366,7 @@
363
366
  type="target"
364
367
  position={Position.Left}
365
368
  style="--fd-handle-fill: {getDataTypeColor(
369
+ checker,
366
370
  port.dataType
367
371
  )}; --fd-handle-border-color: var(--fd-handle-border); left: {pos.left}px; top: {pos.top}px; transform: translate(-50%, -50%); z-index: 30;"
368
372
  id={`${props.data.nodeId}-input-${port.id}`}
@@ -386,6 +390,7 @@
386
390
  position={Position.Right}
387
391
  id={`${props.data.nodeId}-output-${port.id}`}
388
392
  style="--fd-handle-fill: {getDataTypeColor(
393
+ checker,
389
394
  port.dataType
390
395
  )}; --fd-handle-border-color: var(--fd-handle-border); left: {pos.left}px; top: {pos.top}px; transform: translate(-50%, -50%); z-index: 30;"
391
396
  />
@@ -8,6 +8,7 @@
8
8
  import { Position, Handle } from '@xyflow/svelte';
9
9
  import Icon from '@iconify/svelte';
10
10
  import { getDataTypeColor, getCategoryColorToken } from '../../utils/colors';
11
+ import { getInstance } from '../../stores/getInstance.svelte.js';
11
12
  import type { NodeMetadata, NodePort } from '../../types/index.js';
12
13
  import CogIcon from '../icons/CogIcon.svelte';
13
14
  import AlertCircleIcon from '../icons/AlertCircleIcon.svelte';
@@ -46,6 +47,9 @@
46
47
  isError?: boolean;
47
48
  }>();
48
49
 
50
+ const fd = getInstance();
51
+ const checker = fd.portCompatibility;
52
+
49
53
  // Prioritize metadata over config for tool nodes (metadata is the node definition)
50
54
  let toolIcon = $derived(
51
55
  (props.data.metadata?.icon as string) || (props.data.config?.icon as string) || 'mdi:tools'
@@ -171,6 +175,7 @@
171
175
  position={Position.Left}
172
176
  id={`${props.data.nodeId}-input-${toolInputPort.id}`}
173
177
  style="top: 40px; transform: translateY(-50%); z-index: 30; --fd-handle-fill: var(--fd-port-skin-color, {getDataTypeColor(
178
+ checker,
174
179
  portDataType
175
180
  )}); --fd-handle-border-color: var(--fd-handle-border);"
176
181
  />
@@ -199,7 +204,7 @@
199
204
  <!-- Circle dot — visibility controlled by --fd-node-circle-display -->
200
205
  <span
201
206
  class="flowdrop-tool-node__color-dot"
202
- style="background: {getCategoryColorToken(props.data.metadata?.category)}"
207
+ style="background: {getCategoryColorToken(fd.categories, props.data.metadata?.category)}"
203
208
  ></span>
204
209
 
205
210
  <!-- Tool Info -->
@@ -249,6 +254,7 @@
249
254
  position={Position.Right}
250
255
  id={`${props.data.nodeId}-output-${toolOutputPort.id}`}
251
256
  style="top: 40px; transform: translateY(-50%); z-index: 30; --fd-handle-fill: var(--fd-port-skin-color, {getDataTypeColor(
257
+ checker,
252
258
  portDataType
253
259
  )}); --fd-handle-border-color: var(--fd-handle-border);"
254
260
  />
@@ -22,7 +22,7 @@
22
22
  getCategoryColorToken,
23
23
  getPortBackgroundColor
24
24
  } from '../../utils/colors.js';
25
- import { getConnectedHandles } from '../../stores/workflowStore.svelte.js';
25
+ import { getInstance } from '../../stores/getInstance.svelte.js';
26
26
  import { applyPortOrder } from '../../utils/portUtils.js';
27
27
  import { m } from '../../messages/index.js';
28
28
 
@@ -37,6 +37,9 @@
37
37
  let props: Props = $props();
38
38
  let isHandleInteraction = $state(false);
39
39
 
40
+ const fd = getInstance();
41
+ const checker = fd.portCompatibility;
42
+
40
43
  // Hoist the graph branch — three reads in the template, two of them inside
41
44
  // {#each port} loops where N×M reads add up. One getter walk per render.
42
45
  const graph = $derived(m().nodes.graph);
@@ -145,7 +148,7 @@
145
148
 
146
149
  // Check if port is connected
147
150
  const handleId = `${props.data.nodeId}-${type}-${port.id}`;
148
- return getConnectedHandles().has(handleId);
151
+ return fd.workflow.connectedHandles.has(handleId);
149
152
  }
150
153
 
151
154
  /**
@@ -219,17 +222,17 @@
219
222
  <!-- Squircle icon — visibility controlled by --fd-node-icon-display -->
220
223
  <div
221
224
  class="flowdrop-workflow-node__icon-wrapper"
222
- style="--_icon-color: {getCategoryColorToken(props.data.metadata.category)}"
225
+ style="--_icon-color: {getCategoryColorToken(fd.categories, props.data.metadata.category)}"
223
226
  >
224
227
  <Icon
225
- icon={getNodeIcon(props.data.metadata.icon, props.data.metadata.category)}
228
+ icon={getNodeIcon(fd.categories, props.data.metadata.icon, props.data.metadata.category)}
226
229
  class="flowdrop-workflow-node__icon"
227
230
  />
228
231
  </div>
229
232
  <!-- Circle dot — visibility controlled by --fd-node-circle-display -->
230
233
  <span
231
234
  class="flowdrop-workflow-node__color-dot"
232
- style="background: {getCategoryColorToken(props.data.metadata.category)}"
235
+ style="background: {getCategoryColorToken(fd.categories, props.data.metadata.category)}"
233
236
  ></span>
234
237
 
235
238
  <!-- Node Title - Icon and Title on same line -->
@@ -262,6 +265,7 @@
262
265
  id={`${props.data.nodeId}-input-${port.id}`}
263
266
  class="flowdrop-workflow-node__handle"
264
267
  style="top: 50%; transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {getDataTypeColorToken(
268
+ checker,
265
269
  port.dataType
266
270
  )}); --fd-handle-border-color: var(--fd-handle-border);"
267
271
  tabindex={-1}
@@ -274,11 +278,13 @@
274
278
  <span
275
279
  class="flowdrop-badge flowdrop-badge--sm"
276
280
  style="background-color: {getPortBackgroundColor(
281
+ checker,
277
282
  port.dataType,
278
283
  15
279
284
  )}; color: {getDataTypeColorToken(
285
+ checker,
280
286
  port.dataType
281
- )}; border: 1px solid {getPortBackgroundColor(port.dataType, 30)};"
287
+ )}; border: 1px solid {getPortBackgroundColor(checker, port.dataType, 30)};"
282
288
  >
283
289
  {port.dataType}
284
290
  </span>
@@ -315,11 +321,13 @@
315
321
  <span
316
322
  class="flowdrop-badge flowdrop-badge--sm"
317
323
  style="background-color: {getPortBackgroundColor(
324
+ checker,
318
325
  port.dataType,
319
326
  15
320
327
  )}; color: {getDataTypeColorToken(
328
+ checker,
321
329
  port.dataType
322
- )}; border: 1px solid {getPortBackgroundColor(port.dataType, 30)};"
330
+ )}; border: 1px solid {getPortBackgroundColor(checker, port.dataType, 30)};"
323
331
  >
324
332
  {port.dataType}
325
333
  </span>
@@ -338,6 +346,7 @@
338
346
  id={`${props.data.nodeId}-output-${port.id}`}
339
347
  class="flowdrop-workflow-node__handle"
340
348
  style="top: 50%; transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {getDataTypeColorToken(
349
+ checker,
341
350
  port.dataType
342
351
  )}); --fd-handle-border-color: var(--fd-handle-border);"
343
352
  tabindex={-1}
@@ -12,14 +12,11 @@
12
12
  import Icon from '@iconify/svelte';
13
13
  import { tick, untrack } from 'svelte';
14
14
  import { hasEnableRunFlag } from '../../types/playground.js';
15
- import {
16
- getMessages,
17
- getIsExecuting,
18
- getCanSendMessage,
19
- getCurrentSession
20
- } from '../../stores/playgroundStore.svelte.js';
15
+ import { getInstance } from '../../stores/getInstance.svelte.js';
21
16
  import { m } from '../../messages/index.js';
22
17
 
18
+ const fd = getInstance();
19
+
23
20
  interface Props {
24
21
  placeholder?: string;
25
22
  /** Show the textarea (default: true). When false, only the Run button is shown. */
@@ -65,7 +62,7 @@
65
62
  let seenEnableRunCount = 0;
66
63
 
67
64
  $effect(() => {
68
- const count = getMessages().filter((m) => hasEnableRunFlag(m.metadata)).length;
65
+ const count = fd.playground.messages.filter((m) => hasEnableRunFlag(m.metadata)).length;
69
66
  if (count > seenEnableRunCount) {
70
67
  untrack(() => {
71
68
  seenEnableRunCount = count;
@@ -75,7 +72,7 @@
75
72
  });
76
73
 
77
74
  $effect(() => {
78
- if (getCurrentSession()?.id) {
75
+ if (fd.playground.currentSession?.id) {
79
76
  untrack(() => {
80
77
  seenEnableRunCount = 0;
81
78
  });
@@ -87,7 +84,7 @@
87
84
 
88
85
  /** Auto-focus input when execution completes */
89
86
  $effect(() => {
90
- const nowExecuting = getIsExecuting();
87
+ const nowExecuting = fd.playground.isExecuting;
91
88
  if (wasExecuting && !nowExecuting && inputField) {
92
89
  tick().then(() => inputField?.focus({ preventScroll: true }));
93
90
  }
@@ -98,7 +95,7 @@
98
95
 
99
96
  function handleSend(): void {
100
97
  const trimmedValue = inputValue.trim();
101
- if (!trimmedValue || !getCanSendMessage()) return;
98
+ if (!trimmedValue || !fd.playground.canSendMessage) return;
102
99
 
103
100
  onSendMessage?.(trimmedValue);
104
101
  inputValue = '';
@@ -124,7 +121,7 @@
124
121
  }
125
122
 
126
123
  function handleRun(): void {
127
- if (getIsExecuting() || !runEnabled) return;
124
+ if (fd.playground.isExecuting || !runEnabled) return;
128
125
  runEnabled = false;
129
126
  onSendMessage?.(resolvedPredefinedMessage);
130
127
  }
@@ -153,14 +150,14 @@
153
150
  class="chat-input__textarea"
154
151
  placeholder={resolvedPlaceholder}
155
152
  rows="1"
156
- disabled={getIsExecuting() || !getCurrentSession()}
153
+ disabled={fd.playground.isExecuting || !fd.playground.currentSession}
157
154
  onkeydown={handleKeydown}
158
155
  oninput={handleInput}
159
156
  ></textarea>
160
157
  </div>
161
158
  {/if}
162
159
 
163
- {#if getIsExecuting()}
160
+ {#if fd.playground.isExecuting}
164
161
  <button
165
162
  type="button"
166
163
  class="chat-input__stop-btn"
@@ -176,7 +173,7 @@
176
173
  type="button"
177
174
  class="chat-input__send-btn"
178
175
  onclick={handleSend}
179
- disabled={!inputValue.trim() || !getCanSendMessage()}
176
+ disabled={!inputValue.trim() || !fd.playground.canSendMessage}
180
177
  title={actions.sendTitle}
181
178
  aria-label={actions.sendTitle}
182
179
  >
@@ -5,16 +5,14 @@
5
5
  MessageStream (message + interrupt feed) and ChatInput (textarea +
6
6
  send/run/stop). Use this for chat-style agent interactions.
7
7
 
8
- For view-only execution surfaces, prefer the MessageStream primitive
9
- directly ChatPanel's showChatInput/showRunButton flags are kept for
10
- backwards compatibility but are deprecated.
8
+ For view-only execution surfaces, use the MessageStream primitive directly.
9
+ Log visibility is managed by the playground store (fd.playground.setShowLogs).
11
10
  -->
12
11
 
13
12
  <script lang="ts">
14
13
  import Icon from '@iconify/svelte';
15
14
  import MessageStream from './MessageStream.svelte';
16
15
  import ChatInput from './ChatInput.svelte';
17
- import { playgroundActions } from '../../stores/playgroundStore.svelte.js';
18
16
  import { m } from '../../messages/index.js';
19
17
 
20
18
  interface Props {
@@ -28,22 +26,8 @@
28
26
  onInterruptResolved?: () => void;
29
27
  /** Render a "New session" CTA in the welcome state */
30
28
  onCreateSession?: () => void;
31
- /**
32
- * @deprecated Use `<MessageStream />` directly for view-only feeds.
33
- * Kept for backwards compatibility with PlaygroundConfig URL params.
34
- */
35
- showChatInput?: boolean;
36
- /**
37
- * @deprecated Use `<MessageStream />` directly for view-only feeds.
38
- */
39
- showRunButton?: boolean;
40
29
  predefinedMessage?: string;
41
30
  compactSystemMessages?: boolean;
42
- /**
43
- * @deprecated `showLogs` is now managed by playgroundStore.
44
- * Setting it here syncs to the store on mount for backwards compatibility.
45
- */
46
- showLogs?: boolean;
47
31
  }
48
32
 
49
33
  let {
@@ -56,23 +40,11 @@
56
40
  enableMarkdown = true,
57
41
  onInterruptResolved,
58
42
  onCreateSession,
59
- showChatInput = true,
60
- showRunButton = true,
61
43
  predefinedMessage,
62
- compactSystemMessages = true,
63
- showLogs
44
+ compactSystemMessages = true
64
45
  }: Props = $props();
65
46
 
66
47
  const states = $derived(m().playground.states);
67
-
68
- const noInputsAvailable = $derived(!showChatInput && !showRunButton);
69
-
70
- // Back-compat: sync legacy showLogs prop into the store whenever it changes.
71
- $effect(() => {
72
- if (showLogs !== undefined) {
73
- playgroundActions.setShowLogs(showLogs);
74
- }
75
- });
76
48
  </script>
77
49
 
78
50
  <div class="chat-panel">
@@ -87,14 +59,7 @@
87
59
  emptySession={emptyChatState}
88
60
  />
89
61
 
90
- <ChatInput
91
- {placeholder}
92
- {predefinedMessage}
93
- {onSendMessage}
94
- {onStopExecution}
95
- showTextarea={showChatInput}
96
- {showRunButton}
97
- />
62
+ <ChatInput {placeholder} {predefinedMessage} {onSendMessage} {onStopExecution} />
98
63
  </div>
99
64
 
100
65
  {#snippet welcomeIcon()}
@@ -115,16 +80,8 @@
115
80
  {/snippet}
116
81
 
117
82
  {#snippet welcomeCopy()}
118
- {#if noInputsAvailable}
119
- <h2 class="chat-panel__welcome-title">{states.viewOnlyTitle}</h2>
120
- <p class="chat-panel__welcome-text">{states.viewOnlyText}</p>
121
- {:else if showChatInput}
122
- <h2 class="chat-panel__welcome-title">{states.newSessionTitle}</h2>
123
- <p class="chat-panel__welcome-text">{states.newSessionText}</p>
124
- {:else}
125
- <h2 class="chat-panel__welcome-title">{states.readyTitle}</h2>
126
- <p class="chat-panel__welcome-text">{states.readyText}</p>
127
- {/if}
83
+ <h2 class="chat-panel__welcome-title">{states.newSessionTitle}</h2>
84
+ <p class="chat-panel__welcome-text">{states.newSessionText}</p>
128
85
  {/snippet}
129
86
 
130
87
  {#snippet welcomeState()}
@@ -9,22 +9,8 @@ interface Props {
9
9
  onInterruptResolved?: () => void;
10
10
  /** Render a "New session" CTA in the welcome state */
11
11
  onCreateSession?: () => void;
12
- /**
13
- * @deprecated Use `<MessageStream />` directly for view-only feeds.
14
- * Kept for backwards compatibility with PlaygroundConfig URL params.
15
- */
16
- showChatInput?: boolean;
17
- /**
18
- * @deprecated Use `<MessageStream />` directly for view-only feeds.
19
- */
20
- showRunButton?: boolean;
21
12
  predefinedMessage?: string;
22
13
  compactSystemMessages?: boolean;
23
- /**
24
- * @deprecated `showLogs` is now managed by playgroundStore.
25
- * Setting it here syncs to the store on mount for backwards compatibility.
26
- */
27
- showLogs?: boolean;
28
14
  }
29
15
  declare const ChatPanel: import("svelte").Component<Props, {}, "">;
30
16
  type ChatPanel = ReturnType<typeof ChatPanel>;