@flowdrop/flowdrop 1.15.0 → 2.0.0-beta.10
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.
- package/CHANGELOG.md +648 -0
- package/MIGRATION-2.0.md +642 -0
- package/README.md +28 -28
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +18 -13
- package/dist/adapters/agentspec/AgentSpecAdapter.js +10 -10
- package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
- package/dist/api/enhanced-client.js +6 -11
- package/dist/chat/batchFeedback.d.ts +39 -0
- package/dist/chat/batchFeedback.js +51 -0
- package/dist/commands/executor.js +66 -27
- package/dist/commands/storeIntegration.svelte.d.ts +4 -1
- package/dist/commands/storeIntegration.svelte.js +36 -21
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands/types.js +5 -5
- package/dist/components/App.svelte +696 -565
- package/dist/components/App.svelte.d.ts +63 -16
- package/dist/components/Button.stories.svelte +65 -0
- package/dist/components/Button.stories.svelte.d.ts +19 -0
- package/dist/components/Button.svelte +62 -0
- package/dist/components/Button.svelte.d.ts +24 -0
- package/dist/components/CanvasIconButton.svelte +76 -0
- package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
- package/dist/components/ConfigForm.svelte +181 -552
- package/dist/components/ConfigForm.svelte.d.ts +24 -7
- package/dist/components/ConfigModal.svelte +16 -3
- package/dist/components/ConfigPanel.svelte +234 -15
- package/dist/components/ConfigPanel.svelte.d.ts +6 -0
- package/dist/components/ConnectionLine.svelte +4 -2
- package/dist/components/EditorStatusBar.stories.svelte +44 -0
- package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
- package/dist/components/EditorStatusBar.svelte +99 -0
- package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
- package/dist/components/IconButton.svelte +80 -0
- package/dist/components/IconButton.svelte.d.ts +30 -0
- package/dist/components/Input.svelte +74 -0
- package/dist/components/Input.svelte.d.ts +17 -0
- package/dist/components/LogoWordmark.svelte +113 -0
- package/dist/components/LogoWordmark.svelte.d.ts +26 -0
- package/dist/components/Navbar.svelte +78 -64
- package/dist/components/Navbar.svelte.d.ts +3 -0
- package/dist/components/NodeSidebar.svelte +48 -171
- package/dist/components/NodeStatusOverlay.svelte +94 -6
- package/dist/components/NodeSwapPicker.svelte +22 -38
- package/dist/components/PipelineStatus.svelte +22 -68
- package/dist/components/PipelineStatus.svelte.d.ts +3 -0
- package/dist/components/PortCoordinateTracker.svelte +5 -6
- package/dist/components/PortMappingRow.svelte +0 -2
- package/dist/components/SchemaForm.stories.svelte +1 -3
- package/dist/components/SchemaForm.svelte +22 -39
- package/dist/components/SchemaForm.svelte.d.ts +0 -8
- package/dist/components/Select.svelte +53 -0
- package/dist/components/Select.svelte.d.ts +15 -0
- package/dist/components/SettingsModal.svelte +8 -8
- package/dist/components/SettingsPanel.svelte +44 -10
- package/dist/components/SwapMappingEditor.svelte +67 -49
- package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
- package/dist/components/Textarea.svelte +39 -0
- package/dist/components/Textarea.svelte.d.ts +12 -0
- package/dist/components/ThemeToggle.svelte +15 -94
- package/dist/components/UniversalNode.svelte +45 -11
- package/dist/components/UniversalNode.svelte.d.ts +1 -1
- package/dist/components/WorkflowEditor.svelte +183 -162
- package/dist/components/WorkflowEditor.svelte.d.ts +39 -10
- package/dist/components/chat/AIChatPanel.svelte +99 -90
- package/dist/components/chat/AIChatPanel.svelte.d.ts +0 -4
- package/dist/components/chat/CommandPreview.svelte +2 -1
- package/dist/components/console/CommandConsole.svelte +7 -5
- package/dist/components/console/ConsoleAutocomplete.svelte +11 -12
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
- package/dist/components/console/ConsoleInput.svelte +18 -9
- package/dist/components/console/ConsoleOutput.svelte +4 -3
- package/dist/components/form/FormArray.svelte +42 -182
- package/dist/components/form/FormArray.svelte.d.ts +2 -1
- package/dist/components/form/FormAutocomplete.svelte +26 -21
- package/dist/components/form/FormCheckboxGroup.svelte +1 -5
- package/dist/components/form/FormCodeEditor.svelte +9 -7
- package/dist/components/form/FormField.svelte +22 -44
- package/dist/components/form/FormFieldLight.svelte +56 -50
- package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
- package/dist/components/form/FormFieldset.svelte +45 -11
- package/dist/components/form/FormMarkdownEditor.svelte +17 -9
- package/dist/components/form/FormNumberField.svelte +4 -36
- package/dist/components/form/FormPorts.svelte +262 -0
- package/dist/components/form/FormPorts.svelte.d.ts +13 -0
- package/dist/components/form/FormRangeField.svelte +62 -30
- package/dist/components/form/FormSelect.svelte +13 -75
- package/dist/components/form/FormTemplateEditor.svelte +17 -7
- package/dist/components/form/FormTextField.svelte +3 -35
- package/dist/components/form/FormTextarea.svelte +4 -39
- package/dist/components/form/FormToggle.svelte +5 -16
- package/dist/components/form/FormToggle.svelte.d.ts +4 -2
- package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
- package/dist/components/form/resolveFieldType.d.ts +24 -0
- package/dist/components/form/resolveFieldType.js +55 -0
- package/dist/components/form/templateAutocomplete.js +1 -5
- package/dist/components/form/types.d.ts +1 -14
- package/dist/components/icons/CloseIcon.svelte +6 -0
- package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
- package/dist/components/icons/CommandLineIcon.svelte +15 -0
- package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuIcon.svelte +4 -0
- package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuOpenIcon.svelte +6 -0
- package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
- package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
- package/dist/components/interrupt/FormPrompt.svelte +3 -2
- package/dist/components/interrupt/InterruptBubble.svelte +25 -27
- package/dist/components/interrupt/ReviewPrompt.svelte +10 -23
- package/dist/components/interrupt/TextInputPrompt.svelte +2 -7
- package/dist/components/layouts/MainLayout.svelte +24 -18
- package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
- package/dist/components/nodes/AtomNode.svelte +70 -72
- package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
- package/dist/components/nodes/GatewayNode.svelte +134 -172
- package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
- package/dist/components/nodes/IdeaNode.svelte +79 -98
- package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
- package/dist/components/nodes/NodeConfigButton.svelte +86 -0
- package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
- package/dist/components/nodes/NotesNode.svelte +76 -85
- package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
- package/dist/components/nodes/SimpleNode.svelte +68 -137
- package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
- package/dist/components/nodes/SquareNode.svelte +122 -169
- package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
- package/dist/components/nodes/TerminalNode.svelte +70 -127
- package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
- package/dist/components/nodes/ToolNode.svelte +99 -104
- package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
- package/dist/components/nodes/WorkflowNode.svelte +145 -195
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
- package/dist/components/playground/ChatInput.svelte +11 -15
- package/dist/components/playground/ChatPanel.svelte +6 -49
- package/dist/components/playground/ChatPanel.svelte.d.ts +0 -14
- package/dist/components/playground/ControlPanel.svelte +134 -123
- package/dist/components/playground/ControlPanel.svelte.d.ts +3 -0
- package/dist/components/playground/ExecutionLogs.svelte +11 -9
- package/dist/components/playground/InputCollector.svelte +22 -57
- package/dist/components/playground/MessageStream.svelte +17 -23
- package/dist/components/playground/PipelineKanbanView.svelte +69 -8
- package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
- package/dist/components/playground/PipelinePanel.svelte +31 -8
- package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
- package/dist/components/playground/PipelineTableView.svelte +188 -44
- package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
- package/dist/components/playground/Playground.svelte +154 -105
- package/dist/components/playground/Playground.svelte.d.ts +5 -0
- package/dist/components/playground/PlaygroundApp.svelte +12 -2
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +6 -0
- package/dist/components/playground/PlaygroundModal.svelte +18 -3
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +6 -0
- package/dist/components/playground/PlaygroundStudio.svelte +40 -37
- package/dist/components/playground/PlaygroundStudio.svelte.d.ts +6 -0
- package/dist/components/playground/SessionManager.svelte +9 -12
- package/dist/components/playground/pipelineViewUtils.svelte.d.ts +30 -1
- package/dist/components/playground/pipelineViewUtils.svelte.js +40 -3
- package/dist/components/surfaces/SurfaceOverlay.svelte +153 -0
- package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
- package/dist/components/surfaces/TabbedSurface.svelte +133 -0
- package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
- package/dist/config/endpoints.d.ts +23 -7
- package/dist/config/endpoints.js +30 -10
- package/dist/core/index.d.ts +6 -7
- package/dist/core/index.js +8 -12
- package/dist/display/index.d.ts +6 -3
- package/dist/display/index.js +7 -5
- package/dist/editor/index.d.ts +20 -21
- package/dist/editor/index.js +26 -36
- package/dist/form/code.d.ts +25 -15
- package/dist/form/code.js +44 -41
- package/dist/form/fieldRegistry.d.ts +17 -13
- package/dist/form/fieldRegistry.js +32 -12
- package/dist/form/full.d.ts +19 -14
- package/dist/form/full.js +26 -28
- package/dist/form/index.d.ts +3 -4
- package/dist/form/index.js +6 -5
- package/dist/form/markdown.d.ts +13 -8
- package/dist/form/markdown.js +22 -23
- package/dist/helpers/proximityConnect.d.ts +3 -2
- package/dist/helpers/proximityConnect.js +2 -5
- package/dist/helpers/workflowEditorHelper.d.ts +14 -5
- package/dist/helpers/workflowEditorHelper.js +32 -30
- package/dist/index.d.ts +28 -24
- package/dist/index.js +27 -50
- package/dist/messages/defaults.d.ts +2 -5
- package/dist/messages/defaults.js +3 -6
- package/dist/messages/index.d.ts +1 -2
- package/dist/messages/index.js +1 -2
- package/dist/mocks/app-forms.d.ts +6 -2
- package/dist/mocks/app-forms.js +11 -4
- package/dist/openapi/v1/openapi.yaml +38 -26
- package/dist/playground/index.d.ts +4 -5
- package/dist/playground/index.js +4 -32
- package/dist/playground/mount.d.ts +34 -5
- package/dist/playground/mount.js +58 -24
- package/dist/registry/{BaseRegistry.d.ts → BaseRegistry.svelte.d.ts} +22 -1
- package/dist/registry/{BaseRegistry.js → BaseRegistry.svelte.js} +37 -1
- package/dist/registry/builtinFormats.d.ts +9 -18
- package/dist/registry/builtinFormats.js +9 -39
- package/dist/registry/builtinNodeTypes.d.ts +53 -0
- package/dist/registry/builtinNodeTypes.js +67 -0
- package/dist/registry/builtinNodes.d.ts +2 -64
- package/dist/registry/builtinNodes.js +7 -103
- package/dist/registry/index.d.ts +3 -4
- package/dist/registry/index.js +4 -6
- package/dist/registry/nodeComponentRegistry.d.ts +184 -16
- package/dist/registry/nodeComponentRegistry.js +235 -17
- package/dist/registry/workflowFormatRegistry.d.ts +14 -9
- package/dist/registry/workflowFormatRegistry.js +24 -8
- package/dist/{schema → schemas}/index.d.ts +2 -2
- package/dist/{schema → schemas}/index.js +2 -2
- package/dist/schemas/v1/workflow.schema.json +19 -17
- package/dist/services/agentSpecExecutionService.d.ts +0 -2
- package/dist/services/agentSpecExecutionService.js +0 -3
- package/dist/services/apiVariableService.d.ts +2 -1
- package/dist/services/apiVariableService.js +16 -47
- package/dist/services/autoSaveService.d.ts +7 -0
- package/dist/services/autoSaveService.js +6 -4
- package/dist/services/categoriesApi.js +3 -6
- package/dist/services/chatService.d.ts +9 -4
- package/dist/services/chatService.js +23 -28
- package/dist/services/draftStorage.d.ts +129 -13
- package/dist/services/draftStorage.js +185 -37
- package/dist/services/dynamicSchemaService.d.ts +33 -5
- package/dist/services/dynamicSchemaService.js +67 -55
- package/dist/services/globalSave.d.ts +13 -12
- package/dist/services/globalSave.js +29 -51
- package/dist/services/historyService.d.ts +39 -11
- package/dist/services/historyService.js +60 -18
- package/dist/services/interruptService.d.ts +15 -9
- package/dist/services/interruptService.js +35 -37
- package/dist/services/nodeExecutionService.d.ts +18 -3
- package/dist/services/nodeExecutionService.js +71 -45
- package/dist/services/playgroundService.d.ts +16 -10
- package/dist/services/playgroundService.js +42 -43
- package/dist/services/portConfigApi.js +3 -6
- package/dist/services/settingsService.d.ts +9 -4
- package/dist/services/settingsService.js +23 -12
- package/dist/services/variableService.d.ts +2 -1
- package/dist/services/variableService.js +2 -2
- package/dist/services/workflowStorage.js +6 -6
- package/dist/skins/drafter.d.ts +30 -0
- package/dist/skins/drafter.js +198 -0
- package/dist/skins/index.d.ts +2 -1
- package/dist/skins/index.js +4 -2
- package/dist/stores/apiContext.d.ts +56 -0
- package/dist/stores/apiContext.js +80 -0
- package/dist/stores/categoriesStore.svelte.d.ts +28 -23
- package/dist/stores/categoriesStore.svelte.js +69 -64
- package/dist/stores/getInstance.svelte.d.ts +39 -0
- package/dist/stores/getInstance.svelte.js +65 -0
- package/dist/stores/historyStore.svelte.d.ts +89 -91
- package/dist/stores/historyStore.svelte.js +159 -158
- package/dist/stores/instanceContainer.svelte.d.ts +111 -0
- package/dist/stores/instanceContainer.svelte.js +119 -0
- package/dist/stores/interruptStore.svelte.d.ts +112 -82
- package/dist/stores/interruptStore.svelte.js +253 -226
- package/dist/stores/pipelinePanelStore.svelte.d.ts +27 -3
- package/dist/stores/pipelinePanelStore.svelte.js +61 -14
- package/dist/stores/playgroundStore.svelte.d.ts +169 -222
- package/dist/stores/playgroundStore.svelte.js +513 -580
- package/dist/stores/portCoordinateStore.svelte.d.ts +57 -51
- package/dist/stores/portCoordinateStore.svelte.js +109 -98
- package/dist/stores/settingsStore.svelte.d.ts +17 -1
- package/dist/stores/settingsStore.svelte.js +79 -12
- package/dist/stores/workflowStore.svelte.d.ts +212 -210
- package/dist/stores/workflowStore.svelte.js +527 -502
- package/dist/stories/EdgeDecorator.svelte +5 -2
- package/dist/stories/NodeDecorator.svelte +5 -3
- package/dist/styles/base.css +285 -14
- package/dist/styles/tokens.css +60 -2
- package/dist/svelte-app.d.ts +78 -11
- package/dist/svelte-app.js +210 -141
- package/dist/themes/drafter.d.ts +2 -0
- package/dist/themes/drafter.js +15 -0
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.js +8 -2
- package/dist/types/auth.d.ts +9 -51
- package/dist/types/auth.js +4 -54
- package/dist/types/events.d.ts +24 -3
- package/dist/types/events.js +2 -1
- package/dist/types/index.d.ts +117 -32
- package/dist/types/index.js +0 -1
- package/dist/types/navbar.d.ts +7 -0
- package/dist/types/playground.d.ts +18 -3
- package/dist/types/settings.d.ts +30 -1
- package/dist/types/settings.js +5 -2
- package/dist/types/skin.d.ts +1 -1
- package/dist/types/theme.d.ts +16 -2
- package/dist/types/uischema.d.ts +5 -0
- package/dist/utils/colors.d.ts +74 -21
- package/dist/utils/colors.js +92 -68
- package/dist/utils/connections.d.ts +9 -15
- package/dist/utils/connections.js +33 -88
- package/dist/utils/duration.d.ts +13 -0
- package/dist/utils/duration.js +45 -0
- package/dist/utils/edgeStyling.js +9 -5
- package/dist/utils/fetchWithAuth.d.ts +36 -15
- package/dist/utils/fetchWithAuth.js +53 -23
- package/dist/utils/icons.d.ts +5 -2
- package/dist/utils/icons.js +6 -5
- package/dist/utils/nodeIds.d.ts +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeSwap.d.ts +6 -2
- package/dist/utils/nodeSwap.js +62 -129
- package/dist/utils/nodeTypes.d.ts +17 -8
- package/dist/utils/nodeTypes.js +27 -20
- package/dist/utils/performanceUtils.js +7 -0
- package/dist/utils/portUtils.d.ts +47 -11
- package/dist/utils/portUtils.js +67 -14
- package/dist/utils/portal.d.ts +18 -0
- package/dist/utils/portal.js +34 -0
- package/dist/utils/schemaMerge.d.ts +25 -0
- package/dist/utils/schemaMerge.js +61 -0
- package/package.json +7 -5
- package/dist/messages/deprecation.d.ts +0 -20
- package/dist/messages/deprecation.js +0 -33
- package/dist/registry/plugin.d.ts +0 -215
- package/dist/registry/plugin.js +0 -249
- package/dist/services/api.d.ts +0 -129
- package/dist/services/api.js +0 -217
|
@@ -258,12 +258,8 @@ export const defaultMessages = {
|
|
|
258
258
|
predefinedRun: 'Run workflow'
|
|
259
259
|
},
|
|
260
260
|
states: {
|
|
261
|
-
viewOnlyTitle: 'View only',
|
|
262
|
-
viewOnlyText: 'This playground is in view-only mode. No inputs are available.',
|
|
263
261
|
newSessionTitle: 'New session',
|
|
264
262
|
newSessionText: 'Test your flow with a prompt',
|
|
265
|
-
readyTitle: 'Ready to run',
|
|
266
|
-
readyText: 'Click Run to execute your workflow',
|
|
267
263
|
processing: 'Processing...',
|
|
268
264
|
viewOnlyHelp: 'View-only mode. Workflow execution is controlled externally.'
|
|
269
265
|
},
|
|
@@ -316,7 +312,7 @@ export const defaultMessages = {
|
|
|
316
312
|
newSession: 'New session'
|
|
317
313
|
},
|
|
318
314
|
controlPanel: {
|
|
319
|
-
sessionsLabel: '
|
|
315
|
+
sessionsLabel: 'Session',
|
|
320
316
|
noSession: 'No session',
|
|
321
317
|
switchSession: 'Switch session',
|
|
322
318
|
newSession: 'New session',
|
|
@@ -380,7 +376,8 @@ export const defaultMessages = {
|
|
|
380
376
|
executionsLabel: 'Executions:',
|
|
381
377
|
lastRunLabel: 'Last Run:',
|
|
382
378
|
durationLabel: 'Duration:',
|
|
383
|
-
errorLabel: 'Error:'
|
|
379
|
+
errorLabel: 'Error:',
|
|
380
|
+
historyLabel: 'Runs:'
|
|
384
381
|
}
|
|
385
382
|
}
|
|
386
383
|
};
|
package/dist/messages/index.d.ts
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* Messages module — typed, overridable, translation-ready user-facing strings.
|
|
3
3
|
*
|
|
4
4
|
* See `./defaults.ts` for the canonical shape, `./context.ts` for the runtime
|
|
5
|
-
* plumbing, and the i18n guide in
|
|
5
|
+
* plumbing, and the i18n guide in the docs site (`.docs/`) for consumer recipes.
|
|
6
6
|
*/
|
|
7
7
|
export { defaultMessages } from './defaults.js';
|
|
8
8
|
export { mergeMessages } from './merge.js';
|
|
9
9
|
export { setMessages, getMessages, m } from './context.js';
|
|
10
|
-
export { warnDeprecatedProp, __resetDeprecationWarningsForTests } from './deprecation.js';
|
|
11
10
|
export type { Messages, MessagesOverride, DeepPartial } from './types.js';
|
package/dist/messages/index.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* Messages module — typed, overridable, translation-ready user-facing strings.
|
|
3
3
|
*
|
|
4
4
|
* See `./defaults.ts` for the canonical shape, `./context.ts` for the runtime
|
|
5
|
-
* plumbing, and the i18n guide in
|
|
5
|
+
* plumbing, and the i18n guide in the docs site (`.docs/`) for consumer recipes.
|
|
6
6
|
*/
|
|
7
7
|
export { defaultMessages } from './defaults.js';
|
|
8
8
|
export { mergeMessages } from './merge.js';
|
|
9
9
|
export { setMessages, getMessages, m } from './context.js';
|
|
10
|
-
export { warnDeprecatedProp, __resetDeprecationWarningsForTests } from './deprecation.js';
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export function enhance(
|
|
2
|
-
|
|
1
|
+
export function enhance(_form: HTMLFormElement, options?: {
|
|
2
|
+
onResult?: (result: {
|
|
3
|
+
type: string;
|
|
4
|
+
}) => void;
|
|
5
|
+
}): (event: SubmitEvent) => void;
|
|
6
|
+
export function applyAction(action: unknown): unknown;
|
package/dist/mocks/app-forms.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
2
|
* Mock for $app/forms
|
|
4
3
|
* Provides minimal implementations for SvelteKit forms in library context
|
|
5
4
|
*/
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Mock enhance function
|
|
8
|
+
* @param {HTMLFormElement} _form
|
|
9
|
+
* @param {{ onResult?: (result: { type: string }) => void }} [options]
|
|
10
|
+
*/
|
|
11
|
+
export const enhance = (_form, options = {}) => {
|
|
12
|
+
/** @param {SubmitEvent} event */
|
|
9
13
|
return (event) => {
|
|
10
14
|
event.preventDefault();
|
|
11
15
|
// Basic form handling for library context
|
|
@@ -15,7 +19,10 @@ export const enhance = (form, options = {}) => {
|
|
|
15
19
|
};
|
|
16
20
|
};
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Mock applyAction function
|
|
24
|
+
* @param {unknown} action
|
|
25
|
+
*/
|
|
19
26
|
export const applyAction = (action) => {
|
|
20
27
|
// No-op for library context
|
|
21
28
|
return action;
|
|
@@ -37,8 +37,8 @@ info:
|
|
|
37
37
|
email: shibinkidd@gmail.com
|
|
38
38
|
url: https://www.drupal.org/project/issues/flowdrop?categories=All
|
|
39
39
|
servers:
|
|
40
|
-
- url: http://localhost:
|
|
41
|
-
description: Local development server
|
|
40
|
+
- url: http://localhost:7104/api/flowdrop
|
|
41
|
+
description: Local development server
|
|
42
42
|
- url: https://flowdrop.ddev.site/api/flowdrop
|
|
43
43
|
description: Local Drupal server
|
|
44
44
|
security:
|
|
@@ -250,7 +250,7 @@ paths:
|
|
|
250
250
|
value:
|
|
251
251
|
success: true
|
|
252
252
|
data:
|
|
253
|
-
-
|
|
253
|
+
- node_type_id: openai_chat_executor
|
|
254
254
|
name: OpenAI Chat
|
|
255
255
|
description: Chat completion using OpenAI's GPT models
|
|
256
256
|
category: ai
|
|
@@ -563,7 +563,7 @@ paths:
|
|
|
563
563
|
config:
|
|
564
564
|
placeholder: Enter your question
|
|
565
565
|
metadata:
|
|
566
|
-
|
|
566
|
+
node_type_id: text_input
|
|
567
567
|
name: Text Input
|
|
568
568
|
description: Text input field for user data
|
|
569
569
|
category: inputs
|
|
@@ -2550,10 +2550,12 @@ components:
|
|
|
2550
2550
|
for user-defined input/output handles
|
|
2551
2551
|
- **gateway**: Supports `config.branches` for conditional branching paths
|
|
2552
2552
|
|
|
2553
|
-
##
|
|
2553
|
+
## Port order + exposure
|
|
2554
2554
|
|
|
2555
|
-
|
|
2556
|
-
|
|
2555
|
+
Render order and exposure are controlled per instance via `config.ports`
|
|
2556
|
+
(a per-direction ordered list of `{id, exposed?}`), over each port's metadata
|
|
2557
|
+
`displayOrder` / `exposedByDefault` defaults. Order is cosmetic; a not-exposed
|
|
2558
|
+
port is hidden, not wireable, and not runtime-overridable.
|
|
2557
2559
|
NodeExecutionStatus:
|
|
2558
2560
|
type: string
|
|
2559
2561
|
enum:
|
|
@@ -3213,6 +3215,26 @@ components:
|
|
|
3213
3215
|
example: Parsed JSON response from the HTTP request
|
|
3214
3216
|
defaultValue:
|
|
3215
3217
|
description: Default value used when no connection provides data
|
|
3218
|
+
exposedByDefault:
|
|
3219
|
+
type: boolean
|
|
3220
|
+
default: true
|
|
3221
|
+
description: |
|
|
3222
|
+
Whether the port is exposed when the instance sets no explicit exposure
|
|
3223
|
+
for it (in `data.config.ports`). Defaults to true — a missing override
|
|
3224
|
+
reads as exposed. Reserved ports that ship hidden until an author opts in
|
|
3225
|
+
(e.g. the `error` output) carry false. In v2 exposure is semantic: a
|
|
3226
|
+
not-exposed port is hidden on the canvas, not wireable, and not
|
|
3227
|
+
runtime-overridable.
|
|
3228
|
+
displayOrder:
|
|
3229
|
+
type: integer
|
|
3230
|
+
default: 0
|
|
3231
|
+
description: |
|
|
3232
|
+
Default sort weight for the port's render position, ascending; ties
|
|
3233
|
+
break on declaration order. Author-declared ports default to 0. Reserved
|
|
3234
|
+
ports (the `error` output and `trigger`/`tool` control ports) need no
|
|
3235
|
+
value — the renderer sinks them to the bottom automatically; set this
|
|
3236
|
+
only to override that. Cosmetic only. The instance's `config.ports`
|
|
3237
|
+
order overrides this when present.
|
|
3216
3238
|
schema:
|
|
3217
3239
|
$ref: '#/components/schemas/PortDataSchema'
|
|
3218
3240
|
description: |
|
|
@@ -3449,13 +3471,6 @@ components:
|
|
|
3449
3471
|
|
|
3450
3472
|
Instance-level settings take precedence over type-level defaults.
|
|
3451
3473
|
properties:
|
|
3452
|
-
hideUnconnectedHandles:
|
|
3453
|
-
type: boolean
|
|
3454
|
-
description: |
|
|
3455
|
-
Show/hide unconnected handles (ports) to reduce visual noise.
|
|
3456
|
-
When true, only ports with active connections are displayed.
|
|
3457
|
-
Useful for nodes with many optional ports.
|
|
3458
|
-
example: true
|
|
3459
3474
|
atom:
|
|
3460
3475
|
$ref: '#/components/schemas/AtomUIConfig'
|
|
3461
3476
|
style:
|
|
@@ -3492,7 +3507,6 @@ components:
|
|
|
3492
3507
|
additionalProperties: true
|
|
3493
3508
|
example:
|
|
3494
3509
|
ui:
|
|
3495
|
-
hideUnconnectedHandles: true
|
|
3496
3510
|
style:
|
|
3497
3511
|
opacity: 0.8
|
|
3498
3512
|
agentspec:component_type: llm_node
|
|
@@ -3514,10 +3528,11 @@ components:
|
|
|
3514
3528
|
## Extensions Support
|
|
3515
3529
|
|
|
3516
3530
|
The `extensions` property allows storing UI settings and 3rd party data:
|
|
3517
|
-
- Use `extensions.ui.
|
|
3531
|
+
- Use `extensions.ui.style` for custom per-node styling
|
|
3518
3532
|
- Use namespaced keys for custom integrations (e.g., "myapp:settings")
|
|
3533
|
+
(Port order + exposure live in `config.ports`, not here.)
|
|
3519
3534
|
properties:
|
|
3520
|
-
|
|
3535
|
+
node_type_id:
|
|
3521
3536
|
type: string
|
|
3522
3537
|
description: Node type unique identifier
|
|
3523
3538
|
example: calculator
|
|
@@ -3607,7 +3622,7 @@ components:
|
|
|
3607
3622
|
Default extension properties for all instances of this node type.
|
|
3608
3623
|
Can be overridden at the instance level via WorkflowNode.data.extensions.
|
|
3609
3624
|
required:
|
|
3610
|
-
-
|
|
3625
|
+
- node_type_id
|
|
3611
3626
|
- name
|
|
3612
3627
|
- description
|
|
3613
3628
|
- category
|
|
@@ -3801,7 +3816,7 @@ components:
|
|
|
3801
3816
|
description: Node instance UUID
|
|
3802
3817
|
type:
|
|
3803
3818
|
type: string
|
|
3804
|
-
description: Node type ID (references NodeMetadata.
|
|
3819
|
+
description: Node type ID (references NodeMetadata.node_type_id)
|
|
3805
3820
|
example: calculator
|
|
3806
3821
|
position:
|
|
3807
3822
|
$ref: '#/components/schemas/Position'
|
|
@@ -3825,9 +3840,6 @@ components:
|
|
|
3825
3840
|
error:
|
|
3826
3841
|
type: string
|
|
3827
3842
|
description: Error message if node execution failed
|
|
3828
|
-
nodeId:
|
|
3829
|
-
type: string
|
|
3830
|
-
description: Alternative node ID
|
|
3831
3843
|
executionInfo:
|
|
3832
3844
|
$ref: '#/components/schemas/NodeExecutionInfo'
|
|
3833
3845
|
extensions:
|
|
@@ -3838,8 +3850,8 @@ components:
|
|
|
3838
3850
|
Use for instance-specific UI states or custom data.
|
|
3839
3851
|
|
|
3840
3852
|
Common use cases:
|
|
3841
|
-
- `extensions.ui.hideUnconnectedHandles`: Hide ports without connections
|
|
3842
3853
|
- `extensions.ui.style`: Custom styling for this node instance
|
|
3854
|
+
(Port order + exposure live in `config.ports`, not here.)
|
|
3843
3855
|
required:
|
|
3844
3856
|
- label
|
|
3845
3857
|
- config
|
|
@@ -3923,9 +3935,9 @@ components:
|
|
|
3923
3935
|
WorkflowMetadata:
|
|
3924
3936
|
type: object
|
|
3925
3937
|
properties:
|
|
3926
|
-
|
|
3938
|
+
schemaVersion:
|
|
3927
3939
|
type: string
|
|
3928
|
-
description: Workflow version
|
|
3940
|
+
description: Workflow schema format version — identifies the document format, not the workflow's own revision.
|
|
3929
3941
|
example: 1.0.0
|
|
3930
3942
|
createdAt:
|
|
3931
3943
|
type: string
|
|
@@ -3963,7 +3975,7 @@ components:
|
|
|
3963
3975
|
example: flowdrop
|
|
3964
3976
|
default: flowdrop
|
|
3965
3977
|
required:
|
|
3966
|
-
-
|
|
3978
|
+
- schemaVersion
|
|
3967
3979
|
- createdAt
|
|
3968
3980
|
- updatedAt
|
|
3969
3981
|
Workflow:
|
|
@@ -126,15 +126,14 @@ export { default as InputCollector } from '../components/playground/InputCollect
|
|
|
126
126
|
export { default as ExecutionLogs } from '../components/playground/ExecutionLogs.svelte';
|
|
127
127
|
export { default as MessageBubble } from '../components/playground/MessageBubble.svelte';
|
|
128
128
|
export { InterruptBubble, ConfirmationPrompt, ChoicePrompt, TextInputPrompt, FormPrompt, ReviewPrompt } from '../components/interrupt/index.js';
|
|
129
|
-
export { PlaygroundService
|
|
130
|
-
export { InterruptService
|
|
131
|
-
export {
|
|
132
|
-
export { getPipelinePanelOpen, pipelinePanelActions } from '../stores/pipelinePanelStore.svelte.js';
|
|
129
|
+
export { PlaygroundService } from '../services/playgroundService.js';
|
|
130
|
+
export { InterruptService } from '../services/interruptService.js';
|
|
131
|
+
export { PlaygroundStore } from '../stores/playgroundStore.svelte.js';
|
|
133
132
|
export type { PlaygroundSession, PlaygroundMessage, PlaygroundInputField, PlaygroundMessageRequest, PlaygroundMessagesResult, PlaygroundConfig, PlaygroundMode, PlaygroundSessionStatus, PlaygroundMessageRole, PlaygroundMessageLevel, PlaygroundMessageMetadata, PlaygroundApiResponse, PlaygroundSessionsResponse, PlaygroundSessionResponse, PlaygroundMessageResponse, PlaygroundMessagesApiResponse, PlaygroundExecution } from '../types/playground.js';
|
|
134
133
|
export { isChatInputNode, CHAT_INPUT_PATTERNS, defaultShouldStopPolling, defaultIsTerminalStatus, DEFAULT_STOP_POLLING_STATUSES, DEFAULT_TERMINAL_STATUSES } from '../types/playground.js';
|
|
135
134
|
export type { InterruptType, InterruptStatus, Interrupt, InterruptChoice, InterruptConfig, ConfirmationConfig, ChoiceConfig, TextConfig, FormConfig, ReviewConfig, ReviewChange, ReviewFieldDecision, ReviewResolution, InterruptResolution, InterruptApiResponse, InterruptListResponse, InterruptResponse, InterruptMessageMetadata, InterruptPollingConfig } from '../types/interrupt.js';
|
|
136
135
|
export { isInterruptMetadata, extractInterruptMetadata, metadataToInterrupt, defaultInterruptPollingConfig } from '../types/interrupt.js';
|
|
137
|
-
export {
|
|
136
|
+
export { InterruptStore } from '../stores/interruptStore.svelte.js';
|
|
138
137
|
export type { InterruptWithState } from '../stores/interruptStore.svelte.js';
|
|
139
138
|
export { mountPlayground, unmountPlayground, mountPlaygroundStudio, mountPlaygroundApp, type PlaygroundMountOptions, type PlaygroundStudioMountOptions, type PlaygroundAppMountOptions, type MountedPlayground } from './mount.js';
|
|
140
139
|
export type { PipelineViewDef, PipelineViewProps } from '../types/index.js';
|
package/dist/playground/index.js
CHANGED
|
@@ -135,49 +135,21 @@ export { InterruptBubble, ConfirmationPrompt, ChoicePrompt, TextInputPrompt, For
|
|
|
135
135
|
// ============================================================================
|
|
136
136
|
// Playground Service
|
|
137
137
|
// ============================================================================
|
|
138
|
-
export { PlaygroundService
|
|
138
|
+
export { PlaygroundService } from '../services/playgroundService.js';
|
|
139
139
|
// ============================================================================
|
|
140
140
|
// Interrupt Service (Human-in-the-Loop)
|
|
141
141
|
// ============================================================================
|
|
142
|
-
export { InterruptService
|
|
142
|
+
export { InterruptService } from '../services/interruptService.js';
|
|
143
143
|
// ============================================================================
|
|
144
144
|
// Playground Store
|
|
145
145
|
// ============================================================================
|
|
146
|
-
export {
|
|
147
|
-
// Core state getters
|
|
148
|
-
getCurrentSession, getSessions, getMessages, getIsExecuting, getCanSendMessage, getIsLoading, getError as getPlaygroundError, getCurrentWorkflow, getLastPollSequenceNumber,
|
|
149
|
-
// Derived getters
|
|
150
|
-
getSessionStatus, getMessageCount, getChatMessages, getLogMessages, getLatestMessage, getInputFields, getHasChatInput, getSessionCount,
|
|
151
|
-
// Execution getters (used with PipelinePanel / PlaygroundSplit)
|
|
152
|
-
getActiveExecutionId, getPinnedExecutionId, getLatestExecutionId,
|
|
153
|
-
// UI state
|
|
154
|
-
getShowLogs,
|
|
155
|
-
// Actions
|
|
156
|
-
playgroundActions,
|
|
157
|
-
// Server response application (single update path)
|
|
158
|
-
applyServerResponse,
|
|
159
|
-
// Subscription utility
|
|
160
|
-
subscribeToSessionStatus,
|
|
161
|
-
// Utilities
|
|
162
|
-
getCurrentSessionId, isSessionSelected, getMessagesSnapshot, getLatestSequenceNumber } from '../stores/playgroundStore.svelte.js';
|
|
163
|
-
// ============================================================================
|
|
164
|
-
// Pipeline Panel Store (open/close state, persisted to localStorage)
|
|
165
|
-
// ============================================================================
|
|
166
|
-
export { getPipelinePanelOpen, pipelinePanelActions } from '../stores/pipelinePanelStore.svelte.js';
|
|
146
|
+
export { PlaygroundStore } from '../stores/playgroundStore.svelte.js';
|
|
167
147
|
export { isChatInputNode, CHAT_INPUT_PATTERNS, defaultShouldStopPolling, defaultIsTerminalStatus, DEFAULT_STOP_POLLING_STATUSES, DEFAULT_TERMINAL_STATUSES } from '../types/playground.js';
|
|
168
148
|
export { isInterruptMetadata, extractInterruptMetadata, metadataToInterrupt, defaultInterruptPollingConfig } from '../types/interrupt.js';
|
|
169
149
|
// ============================================================================
|
|
170
150
|
// Interrupt Store (Human-in-the-Loop)
|
|
171
151
|
// ============================================================================
|
|
172
|
-
export {
|
|
173
|
-
// Core state accessor
|
|
174
|
-
getInterruptsMap,
|
|
175
|
-
// Getter functions (replace derived stores)
|
|
176
|
-
getPendingInterruptIds, getPendingInterrupts, getPendingInterruptCount, getResolvedInterrupts, getIsAnySubmitting,
|
|
177
|
-
// Actions
|
|
178
|
-
interruptActions,
|
|
179
|
-
// Utilities
|
|
180
|
-
getInterrupt, isInterruptPending, isInterruptSubmitting, getInterruptError, getInterruptByMessageId, interruptHasError } from '../stores/interruptStore.svelte.js';
|
|
152
|
+
export { InterruptStore } from '../stores/interruptStore.svelte.js';
|
|
181
153
|
// ============================================================================
|
|
182
154
|
// Playground Mount Functions (for vanilla JS / Drupal / IIFE integration)
|
|
183
155
|
// ============================================================================
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
*/
|
|
46
46
|
import type { Workflow } from '../types/index.js';
|
|
47
47
|
import type { EndpointConfig } from '../config/endpoints.js';
|
|
48
|
+
import type { AuthProvider } from '../types/auth.js';
|
|
48
49
|
import type { PlaygroundMode, PlaygroundConfig, PlaygroundSession, PlaygroundMessagesApiResponse, PlaygroundSessionStatus } from '../types/playground.js';
|
|
49
50
|
import type { PartialSettings, SettingsCategory } from '../types/settings.js';
|
|
50
51
|
import type { NavbarAction } from '../types/navbar.js';
|
|
@@ -81,6 +82,15 @@ export interface PlaygroundMountOptions {
|
|
|
81
82
|
* Use createEndpointConfig() to create this
|
|
82
83
|
*/
|
|
83
84
|
endpointConfig?: EndpointConfig;
|
|
85
|
+
/**
|
|
86
|
+
* Authentication provider for API requests.
|
|
87
|
+
*
|
|
88
|
+
* Applied to this instance via `fd.api.configure()` so every request the
|
|
89
|
+
* playground makes (sessions, messages, polling, interrupts) carries the
|
|
90
|
+
* provider's headers — e.g. an `Authorization` bearer token or an
|
|
91
|
+
* `X-CSRF-Token`. Omit for unauthenticated backends.
|
|
92
|
+
*/
|
|
93
|
+
authProvider?: AuthProvider;
|
|
84
94
|
/**
|
|
85
95
|
* Playground-specific configuration options
|
|
86
96
|
*/
|
|
@@ -114,6 +124,21 @@ export interface PlaygroundMountOptions {
|
|
|
114
124
|
* `settings` option.
|
|
115
125
|
*/
|
|
116
126
|
settings?: PartialSettings;
|
|
127
|
+
/**
|
|
128
|
+
* Identifier for this playground's FlowDrop instance.
|
|
129
|
+
*
|
|
130
|
+
* When omitted, the playground uses the page-default instance — matching
|
|
131
|
+
* the legacy behavior where all playground mounts (and the editor's
|
|
132
|
+
* built-in playground) shared one session/message store. Pass an explicit
|
|
133
|
+
* id to isolate this playground's session/message *state* from other
|
|
134
|
+
* FlowDrop instances on the page.
|
|
135
|
+
*
|
|
136
|
+
* Note: live polling is NOT isolated — `playgroundService` keeps one
|
|
137
|
+
* page-global polling timer, so only one playground can actively poll at
|
|
138
|
+
* a time regardless of instance. Use `pushMessages()` with your own
|
|
139
|
+
* transport if two playgrounds need concurrent live updates.
|
|
140
|
+
*/
|
|
141
|
+
instanceId?: string;
|
|
117
142
|
}
|
|
118
143
|
/**
|
|
119
144
|
* Return type for mounted Playground instance
|
|
@@ -227,7 +252,7 @@ export interface PlaygroundAppMountOptions extends Omit<PlaygroundStudioMountOpt
|
|
|
227
252
|
* @default "standalone"
|
|
228
253
|
*/
|
|
229
254
|
mode?: 'standalone' | 'embedded';
|
|
230
|
-
/** Render the FlowDrop Navbar above the playground (default:
|
|
255
|
+
/** Render the FlowDrop Navbar above the playground (default: false). */
|
|
231
256
|
showNavbar?: boolean;
|
|
232
257
|
/** Title shown in the navbar. Falls back to the workflow name, then "Playground". */
|
|
233
258
|
navbarTitle?: string;
|
|
@@ -243,17 +268,21 @@ export interface PlaygroundAppMountOptions extends Omit<PlaygroundStudioMountOpt
|
|
|
243
268
|
showSettingsResetButton?: boolean;
|
|
244
269
|
}
|
|
245
270
|
/**
|
|
246
|
-
* Mount the full-page PlaygroundApp (
|
|
271
|
+
* Mount the full-page PlaygroundApp (PlaygroundStudio, optionally wrapped in the
|
|
272
|
+
* FlowDrop Navbar) into a container.
|
|
247
273
|
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
274
|
+
* The navbar is opt-in (`showNavbar: true`) — matching the editor mount, so
|
|
275
|
+
* embedding into a page that already has its own header never double-stacks a
|
|
276
|
+
* header. Pass `showNavbar: true` when FlowDrop owns the whole page and you want
|
|
277
|
+
* its chrome (logo, branding, settings modal). For a leaner embeddable
|
|
278
|
+
* split-pane, mountPlaygroundStudio() omits the navbar wrapper entirely.
|
|
251
279
|
*
|
|
252
280
|
* @example
|
|
253
281
|
* ```typescript
|
|
254
282
|
* const app = await mountPlaygroundApp(container, {
|
|
255
283
|
* workflowId: 'wf-123',
|
|
256
284
|
* endpointConfig: createEndpointConfig('/api/flowdrop'),
|
|
285
|
+
* showNavbar: true,
|
|
257
286
|
* navbarTitle: 'My Workflow',
|
|
258
287
|
* primaryActions: [
|
|
259
288
|
* { label: 'Edit', href: '/workflows/wf-123/edit', icon: 'mdi:pencil-outline', variant: 'secondary' },
|
package/dist/playground/mount.js
CHANGED
|
@@ -49,9 +49,8 @@ import PlaygroundModal from '../components/playground/PlaygroundModal.svelte';
|
|
|
49
49
|
import PlaygroundStudio from '../components/playground/PlaygroundStudio.svelte';
|
|
50
50
|
import PlaygroundApp from '../components/playground/PlaygroundApp.svelte';
|
|
51
51
|
import { initializeSettings } from '../stores/settingsStore.svelte.js';
|
|
52
|
-
import { setEndpointConfig } from '../services/api.js';
|
|
53
52
|
import { playgroundService } from '../services/playgroundService.js';
|
|
54
|
-
import {
|
|
53
|
+
import { createFlowDropInstance, getDefaultInstance } from '../stores/instanceContainer.svelte.js';
|
|
55
54
|
async function resolveEndpointConfig(endpointConfig) {
|
|
56
55
|
if (!endpointConfig)
|
|
57
56
|
return undefined;
|
|
@@ -61,7 +60,8 @@ async function resolveEndpointConfig(endpointConfig) {
|
|
|
61
60
|
...endpointConfig,
|
|
62
61
|
endpoints: { ...defaultEndpointConfig.endpoints, ...endpointConfig.endpoints }
|
|
63
62
|
};
|
|
64
|
-
|
|
63
|
+
// The resolved config is passed to the Playground component, which configures
|
|
64
|
+
// its instance's ApiContext (fd.api) — no module-level state to set here.
|
|
65
65
|
return resolved;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -86,33 +86,52 @@ function sizeContainer(container, height, width) {
|
|
|
86
86
|
if (width !== undefined)
|
|
87
87
|
container.style.width = width;
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Resolve the FlowDrop instance for a playground mount. No `instanceId` →
|
|
91
|
+
* the page-default instance (legacy shared-store behavior); an explicit id →
|
|
92
|
+
* a fresh isolated instance owned (and destroyed) by this mount.
|
|
93
|
+
*/
|
|
94
|
+
function acquirePlaygroundInstance(instanceId) {
|
|
95
|
+
if (instanceId) {
|
|
96
|
+
return { fd: createFlowDropInstance({ id: instanceId }), ownsInstance: true };
|
|
97
|
+
}
|
|
98
|
+
return { fd: getDefaultInstance(), ownsInstance: false };
|
|
99
|
+
}
|
|
100
|
+
function buildMountedPlayground(svelteApp, workflowId, config, fd, ownsInstance, onSessionStatusChange) {
|
|
90
101
|
const pollingInterval = config.pollingInterval ?? 1500;
|
|
91
102
|
const unsubscribeStatus = onSessionStatusChange
|
|
92
|
-
? subscribeToSessionStatus(onSessionStatusChange)
|
|
103
|
+
? fd.playground.subscribeToSessionStatus(onSessionStatusChange)
|
|
93
104
|
: undefined;
|
|
94
105
|
return {
|
|
95
106
|
destroy: () => {
|
|
96
107
|
unsubscribeStatus?.();
|
|
108
|
+
// Caution (shared default instance): stopPolling is page-global and
|
|
109
|
+
// reset() clears state other default-mounted playgrounds rely on —
|
|
110
|
+
// pass `instanceId` to isolate. Preserved legacy behavior.
|
|
97
111
|
playgroundService.stopPolling();
|
|
98
|
-
|
|
112
|
+
fd.playground.reset();
|
|
113
|
+
// Fully dispose instances created for this mount; the shared default
|
|
114
|
+
// instance only gets the reset above (legacy behavior).
|
|
115
|
+
if (ownsInstance) {
|
|
116
|
+
fd.destroy();
|
|
117
|
+
}
|
|
99
118
|
unmount(svelteApp);
|
|
100
119
|
},
|
|
101
|
-
getCurrentSession: () =>
|
|
102
|
-
getSessions: () =>
|
|
103
|
-
getMessageCount: () =>
|
|
104
|
-
isExecuting: () =>
|
|
120
|
+
getCurrentSession: () => fd.playground.currentSession,
|
|
121
|
+
getSessions: () => fd.playground.sessions,
|
|
122
|
+
getMessageCount: () => fd.playground.messageCount,
|
|
123
|
+
isExecuting: () => fd.playground.isExecuting,
|
|
105
124
|
stopPolling: () => playgroundService.stopPolling(),
|
|
106
125
|
startPolling: () => {
|
|
107
|
-
const session =
|
|
126
|
+
const session = fd.playground.currentSession;
|
|
108
127
|
if (session) {
|
|
109
|
-
playgroundService.startPolling(session.id, (response) => applyServerResponse(response, session.id), pollingInterval, config.shouldStopPolling, playgroundService.getLastSequenceNumber());
|
|
128
|
+
playgroundService.startPolling(fd.api.config, session.id, (response) => fd.playground.applyServerResponse(response, session.id), pollingInterval, config.shouldStopPolling, playgroundService.getLastSequenceNumber(), fd.api.authProvider);
|
|
110
129
|
}
|
|
111
130
|
},
|
|
112
|
-
pushMessages: (response) => applyServerResponse(response, null),
|
|
131
|
+
pushMessages: (response) => fd.playground.applyServerResponse(response, null),
|
|
113
132
|
reset: () => {
|
|
114
133
|
playgroundService.stopPolling();
|
|
115
|
-
|
|
134
|
+
fd.playground.reset();
|
|
116
135
|
}
|
|
117
136
|
};
|
|
118
137
|
}
|
|
@@ -146,7 +165,7 @@ function buildMountedPlayground(svelteApp, workflowId, config, onSessionStatusCh
|
|
|
146
165
|
* ```
|
|
147
166
|
*/
|
|
148
167
|
export async function mountPlayground(container, options) {
|
|
149
|
-
const { workflowId, workflow, mode = 'standalone', initialSessionId, endpointConfig, config = {}, height, width, settings: initialSettings, onClose, onSessionStatusChange } = options;
|
|
168
|
+
const { workflowId, workflow, mode = 'standalone', initialSessionId, endpointConfig, authProvider, config = {}, height, width, settings: initialSettings, onClose, onSessionStatusChange, instanceId } = options;
|
|
150
169
|
// Validate required parameters
|
|
151
170
|
if (!workflowId) {
|
|
152
171
|
throw new Error('workflowId is required for mountPlayground()');
|
|
@@ -162,6 +181,7 @@ export async function mountPlayground(container, options) {
|
|
|
162
181
|
endpointConfig,
|
|
163
182
|
settings: initialSettings
|
|
164
183
|
});
|
|
184
|
+
const { fd, ownsInstance } = acquirePlaygroundInstance(instanceId);
|
|
165
185
|
let targetContainer = container;
|
|
166
186
|
if (mode === 'modal') {
|
|
167
187
|
targetContainer = document.body;
|
|
@@ -175,10 +195,12 @@ export async function mountPlayground(container, options) {
|
|
|
175
195
|
target: targetContainer,
|
|
176
196
|
props: {
|
|
177
197
|
isOpen: true,
|
|
198
|
+
instance: fd,
|
|
178
199
|
workflowId,
|
|
179
200
|
workflow,
|
|
180
201
|
initialSessionId,
|
|
181
202
|
endpointConfig: finalEndpointConfig,
|
|
203
|
+
authProvider,
|
|
182
204
|
config,
|
|
183
205
|
onClose: () => {
|
|
184
206
|
if (onClose) {
|
|
@@ -192,17 +214,19 @@ export async function mountPlayground(container, options) {
|
|
|
192
214
|
svelteApp = mount(Playground, {
|
|
193
215
|
target: targetContainer,
|
|
194
216
|
props: {
|
|
217
|
+
instance: fd,
|
|
195
218
|
workflowId,
|
|
196
219
|
workflow,
|
|
197
220
|
mode,
|
|
198
221
|
initialSessionId,
|
|
199
222
|
endpointConfig: finalEndpointConfig,
|
|
223
|
+
authProvider,
|
|
200
224
|
config,
|
|
201
225
|
onClose
|
|
202
226
|
}
|
|
203
227
|
});
|
|
204
228
|
}
|
|
205
|
-
return buildMountedPlayground(svelteApp, workflowId, config, onSessionStatusChange);
|
|
229
|
+
return buildMountedPlayground(svelteApp, workflowId, config, fd, ownsInstance, onSessionStatusChange);
|
|
206
230
|
}
|
|
207
231
|
/**
|
|
208
232
|
* Unmount a Playground instance
|
|
@@ -225,7 +249,7 @@ export function unmountPlayground(app) {
|
|
|
225
249
|
}
|
|
226
250
|
}
|
|
227
251
|
export async function mountPlaygroundStudio(container, options) {
|
|
228
|
-
const { workflowId, workflow, mode = 'standalone', initialSessionId, endpointConfig, config = {}, height, width, initialPipelineOpen, minChatWidth, initialPipelineWidth, settings: initialSettings, onClose, onSessionNavigate, onSessionStatusChange, pipelineViews } = options;
|
|
252
|
+
const { workflowId, workflow, mode = 'standalone', initialSessionId, endpointConfig, authProvider, config = {}, height, width, initialPipelineOpen, minChatWidth, initialPipelineWidth, settings: initialSettings, onClose, onSessionNavigate, onSessionStatusChange, pipelineViews, instanceId } = options;
|
|
229
253
|
if (!workflowId) {
|
|
230
254
|
throw new Error('workflowId is required for mountPlaygroundStudio()');
|
|
231
255
|
}
|
|
@@ -239,15 +263,18 @@ export async function mountPlaygroundStudio(container, options) {
|
|
|
239
263
|
endpointConfig,
|
|
240
264
|
settings: initialSettings
|
|
241
265
|
});
|
|
266
|
+
const { fd, ownsInstance } = acquirePlaygroundInstance(instanceId);
|
|
242
267
|
sizeContainer(container, height, width);
|
|
243
268
|
const svelteApp = mount(PlaygroundStudio, {
|
|
244
269
|
target: container,
|
|
245
270
|
props: {
|
|
271
|
+
instance: fd,
|
|
246
272
|
workflowId,
|
|
247
273
|
workflow,
|
|
248
274
|
mode,
|
|
249
275
|
initialSessionId,
|
|
250
276
|
endpointConfig: finalEndpointConfig,
|
|
277
|
+
authProvider,
|
|
251
278
|
config,
|
|
252
279
|
onClose,
|
|
253
280
|
onSessionNavigate,
|
|
@@ -257,20 +284,24 @@ export async function mountPlaygroundStudio(container, options) {
|
|
|
257
284
|
extraPipelineViews: pipelineViews
|
|
258
285
|
}
|
|
259
286
|
});
|
|
260
|
-
return buildMountedPlayground(svelteApp, workflowId, config, onSessionStatusChange);
|
|
287
|
+
return buildMountedPlayground(svelteApp, workflowId, config, fd, ownsInstance, onSessionStatusChange);
|
|
261
288
|
}
|
|
262
289
|
/**
|
|
263
|
-
* Mount the full-page PlaygroundApp (
|
|
290
|
+
* Mount the full-page PlaygroundApp (PlaygroundStudio, optionally wrapped in the
|
|
291
|
+
* FlowDrop Navbar) into a container.
|
|
264
292
|
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
293
|
+
* The navbar is opt-in (`showNavbar: true`) — matching the editor mount, so
|
|
294
|
+
* embedding into a page that already has its own header never double-stacks a
|
|
295
|
+
* header. Pass `showNavbar: true` when FlowDrop owns the whole page and you want
|
|
296
|
+
* its chrome (logo, branding, settings modal). For a leaner embeddable
|
|
297
|
+
* split-pane, mountPlaygroundStudio() omits the navbar wrapper entirely.
|
|
268
298
|
*
|
|
269
299
|
* @example
|
|
270
300
|
* ```typescript
|
|
271
301
|
* const app = await mountPlaygroundApp(container, {
|
|
272
302
|
* workflowId: 'wf-123',
|
|
273
303
|
* endpointConfig: createEndpointConfig('/api/flowdrop'),
|
|
304
|
+
* showNavbar: true,
|
|
274
305
|
* navbarTitle: 'My Workflow',
|
|
275
306
|
* primaryActions: [
|
|
276
307
|
* { label: 'Edit', href: '/workflows/wf-123/edit', icon: 'mdi:pencil-outline', variant: 'secondary' },
|
|
@@ -280,7 +311,7 @@ export async function mountPlaygroundStudio(container, options) {
|
|
|
280
311
|
* ```
|
|
281
312
|
*/
|
|
282
313
|
export async function mountPlaygroundApp(container, options) {
|
|
283
|
-
const { workflowId, workflow, mode = 'standalone', initialSessionId, endpointConfig, config = {}, height, width, showNavbar =
|
|
314
|
+
const { workflowId, workflow, mode = 'standalone', initialSessionId, endpointConfig, authProvider, config = {}, height, width, showNavbar = false, navbarTitle, primaryActions, showSettings = true, settingsCategories, showSettingsSyncButton, showSettingsResetButton, initialPipelineOpen, minChatWidth, initialPipelineWidth, settings: initialSettings, onClose, onSessionNavigate, onSessionStatusChange, instanceId } = options;
|
|
284
315
|
if (!workflowId) {
|
|
285
316
|
throw new Error('workflowId is required for mountPlaygroundApp()');
|
|
286
317
|
}
|
|
@@ -297,15 +328,18 @@ export async function mountPlaygroundApp(container, options) {
|
|
|
297
328
|
endpointConfig,
|
|
298
329
|
settings: initialSettings
|
|
299
330
|
});
|
|
331
|
+
const { fd, ownsInstance } = acquirePlaygroundInstance(instanceId);
|
|
300
332
|
sizeContainer(container, height, width);
|
|
301
333
|
const svelteApp = mount(PlaygroundApp, {
|
|
302
334
|
target: container,
|
|
303
335
|
props: {
|
|
336
|
+
instance: fd,
|
|
304
337
|
workflowId,
|
|
305
338
|
workflow,
|
|
306
339
|
mode,
|
|
307
340
|
initialSessionId,
|
|
308
341
|
endpointConfig: finalEndpointConfig,
|
|
342
|
+
authProvider,
|
|
309
343
|
config,
|
|
310
344
|
showNavbar,
|
|
311
345
|
navbarTitle,
|
|
@@ -321,5 +355,5 @@ export async function mountPlaygroundApp(container, options) {
|
|
|
321
355
|
onSessionNavigate
|
|
322
356
|
}
|
|
323
357
|
});
|
|
324
|
-
return buildMountedPlayground(svelteApp, workflowId, config, onSessionStatusChange);
|
|
358
|
+
return buildMountedPlayground(svelteApp, workflowId, config, fd, ownsInstance, onSessionStatusChange);
|
|
325
359
|
}
|