@flowdrop/flowdrop 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/dist/components/App.svelte +112 -29
  3. package/dist/components/CanvasController.svelte +1 -1
  4. package/dist/components/ConfigForm.svelte +5 -5
  5. package/dist/components/ConfigModal.svelte +2 -2
  6. package/dist/components/ConfigModal.svelte.d.ts +1 -1
  7. package/dist/components/ConnectionLine.svelte +1 -1
  8. package/dist/components/EdgeRefresher.svelte +1 -1
  9. package/dist/components/FlowDropZone.svelte +11 -7
  10. package/dist/components/FlowDropZone.svelte.d.ts +12 -0
  11. package/dist/components/LogsSidebar.svelte +15 -12
  12. package/dist/components/MarkdownDisplay.svelte +1 -1
  13. package/dist/components/PipelineStatus.svelte +5 -18
  14. package/dist/components/PortCoordinateTracker.svelte +1 -1
  15. package/dist/components/SchemaForm.svelte +1 -1
  16. package/dist/components/SettingsModal.svelte +1 -1
  17. package/dist/components/SettingsPanel.svelte +1 -1
  18. package/dist/components/WorkflowEditor.svelte +200 -174
  19. package/dist/components/WorkflowInterfaceEditor.svelte +43 -8
  20. package/dist/components/WorkflowInterfaceEditor.svelte.d.ts +12 -1
  21. package/dist/components/WorkflowInterfaceEntryCard.svelte +117 -44
  22. package/dist/components/WorkflowInterfaceEntryCard.svelte.d.ts +14 -1
  23. package/dist/components/WorkflowPlaygroundSettings.svelte +551 -0
  24. package/dist/components/WorkflowPlaygroundSettings.svelte.d.ts +20 -0
  25. package/dist/components/chat/AIChatPanel.svelte +1 -1
  26. package/dist/components/form/index.d.ts +2 -2
  27. package/dist/components/form/index.js +2 -2
  28. package/dist/components/nodes/ToolNode.svelte +1 -1
  29. package/dist/components/playground/ControlPanel.svelte +30 -0
  30. package/dist/components/playground/ControlPanel.svelte.d.ts +5 -0
  31. package/dist/components/playground/Playground.svelte +94 -42
  32. package/dist/components/playground/PlaygroundApp.svelte +1 -1
  33. package/dist/components/playground/PlaygroundModal.svelte +1 -1
  34. package/dist/components/playground/PlaygroundStudio.svelte +1 -1
  35. package/dist/core/index.d.ts +1 -1
  36. package/dist/helpers/workflowEditorHelper.d.ts +12 -0
  37. package/dist/helpers/workflowEditorHelper.js +31 -0
  38. package/dist/messages/defaults.d.ts +53 -0
  39. package/dist/messages/defaults.js +48 -2
  40. package/dist/openapi/v1/openapi.yaml +113 -5
  41. package/dist/playground/index.d.ts +3 -1
  42. package/dist/playground/index.js +2 -1
  43. package/dist/playground/mount.d.ts +6 -10
  44. package/dist/playground/mount.js +43 -24
  45. package/dist/schemas/index.js +1 -1
  46. package/dist/schemas/v1/workflow.schema.json +140 -2
  47. package/dist/services/globalSave.js +11 -1
  48. package/dist/services/playgroundService.d.ts +6 -1
  49. package/dist/services/playgroundService.js +5 -0
  50. package/dist/skins/default.d.ts +1 -1
  51. package/dist/skins/drafter.d.ts +1 -1
  52. package/dist/skins/index.d.ts +4 -4
  53. package/dist/skins/index.js +3 -3
  54. package/dist/skins/slate.d.ts +1 -1
  55. package/dist/stores/instanceContainer.svelte.d.ts +15 -0
  56. package/dist/stores/instanceContainer.svelte.js +11 -1
  57. package/dist/stores/playgroundStore.svelte.d.ts +8 -0
  58. package/dist/stores/playgroundStore.svelte.js +18 -4
  59. package/dist/stores/workflowStore.svelte.d.ts +4 -1
  60. package/dist/stores/workflowStore.svelte.js +8 -1
  61. package/dist/styles/base.css +14 -3
  62. package/dist/styles/tokenAliases.d.ts +13 -0
  63. package/dist/styles/tokenAliases.js +89 -0
  64. package/dist/themes/scopedSkinCss.d.ts +30 -0
  65. package/dist/themes/scopedSkinCss.js +95 -0
  66. package/dist/types/index.d.ts +86 -4
  67. package/dist/types/index.js +15 -3
  68. package/dist/types/skin.d.ts +2 -2
  69. package/dist/utils/playgroundChat.d.ts +121 -0
  70. package/dist/utils/playgroundChat.js +275 -0
  71. package/dist/utils/portal.d.ts +8 -0
  72. package/dist/utils/portal.js +15 -0
  73. package/dist/utils/workflowInterface.d.ts +88 -20
  74. package/dist/utils/workflowInterface.js +179 -18
  75. package/dist/webmcp/WebMCPConfirm.svelte +68 -18
  76. package/dist/webmcp/gate.d.ts +6 -0
  77. package/dist/webmcp/gate.js +4 -0
  78. package/dist/webmcp/runtime.js +2 -1
  79. package/package.json +8 -7
  80. package/dist/components/Button.stories.svelte +0 -65
  81. package/dist/components/Button.stories.svelte.d.ts +0 -19
  82. package/dist/components/CanvasBanner.stories.svelte +0 -30
  83. package/dist/components/CanvasBanner.stories.svelte.d.ts +0 -27
  84. package/dist/components/CanvasContextMenu.stories.svelte +0 -63
  85. package/dist/components/CanvasContextMenu.stories.svelte.d.ts +0 -19
  86. package/dist/components/ConfigPanel.stories.svelte +0 -47
  87. package/dist/components/ConfigPanel.stories.svelte.d.ts +0 -27
  88. package/dist/components/EditorStatusBar.stories.svelte +0 -44
  89. package/dist/components/EditorStatusBar.stories.svelte.d.ts +0 -27
  90. package/dist/components/FlowDropEdge.stories.svelte +0 -197
  91. package/dist/components/FlowDropEdge.stories.svelte.d.ts +0 -26
  92. package/dist/components/LoadingSpinner.stories.svelte +0 -30
  93. package/dist/components/LoadingSpinner.stories.svelte.d.ts +0 -27
  94. package/dist/components/Logo.stories.svelte +0 -22
  95. package/dist/components/Logo.stories.svelte.d.ts +0 -27
  96. package/dist/components/MarkdownDisplay.stories.svelte +0 -38
  97. package/dist/components/MarkdownDisplay.stories.svelte.d.ts +0 -27
  98. package/dist/components/Navbar.stories.svelte +0 -58
  99. package/dist/components/Navbar.stories.svelte.d.ts +0 -27
  100. package/dist/components/NodeStatusOverlay.stories.svelte +0 -85
  101. package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +0 -27
  102. package/dist/components/SchemaForm.stories.svelte +0 -122
  103. package/dist/components/SchemaForm.stories.svelte.d.ts +0 -27
  104. package/dist/components/StatusIcon.stories.svelte +0 -60
  105. package/dist/components/StatusIcon.stories.svelte.d.ts +0 -27
  106. package/dist/components/StatusLabel.stories.svelte +0 -17
  107. package/dist/components/StatusLabel.stories.svelte.d.ts +0 -27
  108. package/dist/components/ThemeToggle.stories.svelte +0 -25
  109. package/dist/components/ThemeToggle.stories.svelte.d.ts +0 -27
  110. package/dist/components/console/CommandConsole.stories.svelte +0 -111
  111. package/dist/components/console/CommandConsole.stories.svelte.d.ts +0 -27
  112. package/dist/components/form/FormCheckboxGroup.stories.svelte +0 -28
  113. package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +0 -27
  114. package/dist/components/form/FormFieldWrapper.stories.svelte +0 -53
  115. package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +0 -27
  116. package/dist/components/form/FormNumberField.stories.svelte +0 -36
  117. package/dist/components/form/FormNumberField.stories.svelte.d.ts +0 -27
  118. package/dist/components/form/FormRangeField.stories.svelte +0 -31
  119. package/dist/components/form/FormRangeField.stories.svelte.d.ts +0 -27
  120. package/dist/components/form/FormSelect.stories.svelte +0 -50
  121. package/dist/components/form/FormSelect.stories.svelte.d.ts +0 -27
  122. package/dist/components/form/FormTextField.stories.svelte +0 -30
  123. package/dist/components/form/FormTextField.stories.svelte.d.ts +0 -27
  124. package/dist/components/form/FormTextarea.stories.svelte +0 -34
  125. package/dist/components/form/FormTextarea.stories.svelte.d.ts +0 -27
  126. package/dist/components/form/FormToggle.stories.svelte +0 -30
  127. package/dist/components/form/FormToggle.stories.svelte.d.ts +0 -27
  128. package/dist/components/interrupt/ChoicePrompt.stories.svelte +0 -68
  129. package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +0 -27
  130. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +0 -71
  131. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +0 -27
  132. package/dist/components/interrupt/ReviewPrompt.stories.svelte +0 -77
  133. package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +0 -27
  134. package/dist/components/interrupt/TextInputPrompt.stories.svelte +0 -51
  135. package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +0 -27
  136. package/dist/components/nodes/CaptionNode.stories.svelte +0 -65
  137. package/dist/components/nodes/CaptionNode.stories.svelte.d.ts +0 -18
  138. package/dist/components/nodes/GatewayNode.stories.svelte +0 -108
  139. package/dist/components/nodes/GatewayNode.stories.svelte.d.ts +0 -26
  140. package/dist/components/nodes/IdeaNode.stories.svelte +0 -52
  141. package/dist/components/nodes/IdeaNode.stories.svelte.d.ts +0 -26
  142. package/dist/components/nodes/NotesNode.stories.svelte +0 -76
  143. package/dist/components/nodes/NotesNode.stories.svelte.d.ts +0 -26
  144. package/dist/components/nodes/SimpleNode.stories.svelte +0 -223
  145. package/dist/components/nodes/SimpleNode.stories.svelte.d.ts +0 -26
  146. package/dist/components/nodes/SquareNode.stories.svelte +0 -127
  147. package/dist/components/nodes/SquareNode.stories.svelte.d.ts +0 -26
  148. package/dist/components/nodes/TerminalNode.stories.svelte +0 -25
  149. package/dist/components/nodes/TerminalNode.stories.svelte.d.ts +0 -26
  150. package/dist/components/nodes/ToolNode.stories.svelte +0 -189
  151. package/dist/components/nodes/ToolNode.stories.svelte.d.ts +0 -26
  152. package/dist/components/nodes/WorkflowNode.stories.svelte +0 -188
  153. package/dist/components/nodes/WorkflowNode.stories.svelte.d.ts +0 -26
  154. package/dist/components/playground/MessageBubble.stories.svelte +0 -151
  155. package/dist/components/playground/MessageBubble.stories.svelte.d.ts +0 -27
  156. package/dist/mocks/app-environment.d.ts +0 -8
  157. package/dist/mocks/app-environment.js +0 -16
  158. package/dist/mocks/app-forms.d.ts +0 -6
  159. package/dist/mocks/app-forms.js +0 -29
  160. package/dist/mocks/app-navigation.d.ts +0 -5
  161. package/dist/mocks/app-navigation.js +0 -36
  162. package/dist/mocks/app-stores.d.ts +0 -14
  163. package/dist/mocks/app-stores.js +0 -26
  164. package/dist/stories/CanvasDecorator.svelte +0 -49
  165. package/dist/stories/CanvasDecorator.svelte.d.ts +0 -8
  166. package/dist/stories/EdgeDecorator.svelte +0 -125
  167. package/dist/stories/EdgeDecorator.svelte.d.ts +0 -17
  168. package/dist/stories/NodeDecorator.svelte +0 -75
  169. package/dist/stories/NodeDecorator.svelte.d.ts +0 -8
  170. package/dist/stories/WebMCPFakeAgent.svelte +0 -229
  171. package/dist/stories/WebMCPFakeAgent.svelte.d.ts +0 -10
  172. package/dist/stories/utils.d.ts +0 -93
  173. package/dist/stories/utils.js +0 -156
  174. package/dist/webmcp/WebMCP.stories.svelte +0 -101
  175. package/dist/webmcp/WebMCP.stories.svelte.d.ts +0 -18
@@ -64,8 +64,21 @@
64
64
  alreadyConnected?: boolean;
65
65
  /** Label of the node feeding that competing edge, when there is one. */
66
66
  conflictingSource?: string;
67
- /** Input side only: the id of another input that already has this entry's turn. */
67
+ /** Input side only: the id of another input that already has this entry's (deprecated) turn. */
68
68
  turnTakenBy?: string;
69
+ /**
70
+ * Opens the workflow's Playground settings, where the chat is set up now.
71
+ * Linked from the deprecated `turn` notice; omit when the host has no
72
+ * Playground settings (the notice then says where without a link).
73
+ */
74
+ onOpenPlaygroundSettings?: () => void;
75
+ /**
76
+ * Offer the deprecated Chat turn selector (and the history limit).
77
+ * Only for a workflow without Playground settings (a server before
78
+ * FlowDrop 2.7.0), where `turn` is still the only way to set the chat
79
+ * up. With settings, a stored `turn` shows as a deprecated chip instead.
80
+ */
81
+ turnSelector?: boolean;
69
82
  isFirst: boolean;
70
83
  isLast: boolean;
71
84
  onPatch: (patch: Partial<WorkflowInterfaceEntry>) => void;
@@ -84,6 +97,8 @@
84
97
  alreadyConnected = false,
85
98
  conflictingSource,
86
99
  turnTakenBy,
100
+ onOpenPlaygroundSettings,
101
+ turnSelector = false,
87
102
  isFirst,
88
103
  isLast,
89
104
  onPatch,
@@ -118,10 +133,20 @@
118
133
  return options;
119
134
  }
120
135
 
136
+ /** The entry's deprecated `turn`, as a label. */
137
+ const turnLabel = $derived(
138
+ entry.turn === undefined
139
+ ? undefined
140
+ : isKnownTurn(entry.turn)
141
+ ? m().workflowInterface.turns[entry.turn]
142
+ : entry.turn
143
+ );
144
+
121
145
  /**
122
- * Chat turn options for this direction. A stored value outside them — one
123
- * from a newer server, or a value of the other direction — is listed too,
124
- * so the select shows what is stored and never silently rewrites it.
146
+ * Chat turn options for this direction (the selector, `turnSelector` only).
147
+ * A stored value outside them — one from a newer server, or a value of the
148
+ * other direction — is listed too, so the select shows what is stored and
149
+ * never silently rewrites it.
125
150
  */
126
151
  const turnOptions = $derived.by(() => {
127
152
  const options: Array<{ value: string; label: string }> = turnsFor(
@@ -262,7 +287,12 @@
262
287
  size="sm"
263
288
  type="text"
264
289
  value={entry.id}
265
- onchange={(e) => onPatch({ id: e.currentTarget.value })}
290
+ onchange={(e) => {
291
+ // An input needs an id: an emptied field goes back to the old one
292
+ // (else the chat binding would lose the input for good).
293
+ if (e.currentTarget.value.trim() === '') e.currentTarget.value = entry.id;
294
+ else onPatch({ id: e.currentTarget.value });
295
+ }}
266
296
  />
267
297
  </label>
268
298
  <div class="wf-interface__field wf-interface__field--binding">
@@ -358,52 +388,78 @@
358
388
  <summary>
359
389
  <Icon icon="heroicons:chevron-right" />
360
390
  {m().workflowInterface.moreOptions}
361
- {#if entry.turn !== undefined}
362
- <span class="wf-interface__turn-chip">
363
- {isKnownTurn(entry.turn) ? m().workflowInterface.turns[entry.turn] : entry.turn}
391
+ {#if turnLabel !== undefined}
392
+ <span
393
+ class="wf-interface__turn-chip"
394
+ class:wf-interface__turn-chip--deprecated={!turnSelector}
395
+ >
396
+ {turnLabel}
364
397
  </span>
365
398
  {/if}
366
399
  </summary>
367
400
  <div class="wf-interface__more-body">
368
- <div class="wf-interface__row">
369
- <label class="wf-interface__field">
370
- <span class="wf-interface__label">{m().workflowInterface.turnLabel}</span>
371
- <Select
372
- size="sm"
373
- invalid={turnTakenBy !== undefined}
374
- value={entry.turn ?? ''}
375
- onchange={(e) => setTurn(e.currentTarget.value)}
376
- >
377
- <option value="">{m().workflowInterface.turnNone}</option>
378
- {#each turnOptions as option (option.value)}
379
- <option value={option.value}>{option.label}</option>
380
- {/each}
381
- </Select>
382
- {#if turnTakenBy !== undefined}
383
- <span class="wf-interface__inline wf-interface__inline--warning">
384
- {m().workflowInterface.turnTakenInline({ id: turnTakenBy })}
385
- </span>
386
- {:else if turnDescription}
387
- <span class="wf-interface__hint">{turnDescription}</span>
388
- {/if}
389
- </label>
390
- {#if entry.turn === 'history'}
401
+ {#if turnSelector}
402
+ <div class="wf-interface__row">
391
403
  <label class="wf-interface__field">
392
- <span class="wf-interface__label">{m().workflowInterface.historyLimitLabel}</span>
393
- <Input
404
+ <span class="wf-interface__label">{m().workflowInterface.turnLabel}</span>
405
+ <Select
394
406
  size="sm"
395
- type="number"
396
- min="1"
397
- step="1"
398
- value={historyLimitOf(entry) ?? ''}
399
- placeholder={m().workflowInterface.historyLimitPlaceholder({
400
- limit: DEFAULT_HISTORY_TURN_LIMIT
401
- })}
402
- onchange={(e) => onPatch(historyLimitPatch(entry, e.currentTarget.value))}
403
- />
407
+ invalid={turnTakenBy !== undefined}
408
+ value={entry.turn ?? ''}
409
+ onchange={(e) => setTurn(e.currentTarget.value)}
410
+ >
411
+ <option value="">{m().workflowInterface.turnNone}</option>
412
+ {#each turnOptions as option (option.value)}
413
+ <option value={option.value}>{option.label}</option>
414
+ {/each}
415
+ </Select>
416
+ {#if turnTakenBy !== undefined}
417
+ <span class="wf-interface__inline wf-interface__inline--warning">
418
+ {m().workflowInterface.turnTakenInline({ id: turnTakenBy })}
419
+ </span>
420
+ {:else if turnDescription}
421
+ <span class="wf-interface__hint">{turnDescription}</span>
422
+ {/if}
404
423
  </label>
405
- {/if}
406
- </div>
424
+ {#if entry.turn === 'history'}
425
+ <label class="wf-interface__field">
426
+ <span class="wf-interface__label">{m().workflowInterface.historyLimitLabel}</span>
427
+ <Input
428
+ size="sm"
429
+ type="number"
430
+ min="1"
431
+ step="1"
432
+ value={historyLimitOf(entry) ?? ''}
433
+ placeholder={m().workflowInterface.historyLimitPlaceholder({
434
+ limit: DEFAULT_HISTORY_TURN_LIMIT
435
+ })}
436
+ onchange={(e) => onPatch(historyLimitPatch(entry, e.currentTarget.value))}
437
+ />
438
+ </label>
439
+ {/if}
440
+ </div>
441
+ {:else if turnLabel !== undefined}
442
+ <div class="wf-interface__turn-deprecated" role="note">
443
+ <span>
444
+ {m().workflowInterface.turnDeprecated({
445
+ turn: turnLabel,
446
+ limit: entry.turn === 'history' ? historyLimitOf(entry) : undefined
447
+ })}
448
+ {#if turnTakenBy !== undefined}
449
+ {m().workflowInterface.turnTakenInline({ id: turnTakenBy })}
450
+ {/if}
451
+ </span>
452
+ {#if onOpenPlaygroundSettings}
453
+ <button
454
+ type="button"
455
+ class="wf-interface__quickfix"
456
+ onclick={onOpenPlaygroundSettings}
457
+ >
458
+ {m().workflowInterface.turnOpenPlayground}
459
+ </button>
460
+ {/if}
461
+ </div>
462
+ {/if}
407
463
 
408
464
  {#if boundTarget}
409
465
  <div class="wf-interface__pull-row">
@@ -847,6 +903,23 @@
847
903
  line-height: 1.5;
848
904
  }
849
905
 
906
+ /* A deprecated `turn` reads as a warning, not as a choice. */
907
+ .wf-interface__turn-chip--deprecated {
908
+ border-color: color-mix(in srgb, var(--fd-warning) 45%, var(--fd-border));
909
+ color: var(--fd-warning);
910
+ text-decoration: line-through;
911
+ }
912
+
913
+ .wf-interface__turn-deprecated {
914
+ display: flex;
915
+ flex-wrap: wrap;
916
+ align-items: baseline;
917
+ gap: var(--fd-space-xs);
918
+ font-size: var(--fd-text-xs);
919
+ line-height: 1.4;
920
+ color: var(--fd-warning);
921
+ }
922
+
850
923
  .wf-interface__inline--warning {
851
924
  color: var(--fd-warning);
852
925
  }
@@ -17,8 +17,21 @@ interface Props {
17
17
  alreadyConnected?: boolean;
18
18
  /** Label of the node feeding that competing edge, when there is one. */
19
19
  conflictingSource?: string;
20
- /** Input side only: the id of another input that already has this entry's turn. */
20
+ /** Input side only: the id of another input that already has this entry's (deprecated) turn. */
21
21
  turnTakenBy?: string;
22
+ /**
23
+ * Opens the workflow's Playground settings, where the chat is set up now.
24
+ * Linked from the deprecated `turn` notice; omit when the host has no
25
+ * Playground settings (the notice then says where without a link).
26
+ */
27
+ onOpenPlaygroundSettings?: () => void;
28
+ /**
29
+ * Offer the deprecated Chat turn selector (and the history limit).
30
+ * Only for a workflow without Playground settings (a server before
31
+ * FlowDrop 2.7.0), where `turn` is still the only way to set the chat
32
+ * up. With settings, a stored `turn` shows as a deprecated chip instead.
33
+ */
34
+ turnSelector?: boolean;
22
35
  isFirst: boolean;
23
36
  isLast: boolean;
24
37
  onPatch: (patch: Partial<WorkflowInterfaceEntry>) => void;