@flowdrop/flowdrop 1.15.0 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +508 -0
- package/MIGRATION-2.0.md +629 -0
- package/README.md +23 -23
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +14 -8
- package/dist/adapters/agentspec/AgentSpecAdapter.js +7 -7
- 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 +15 -1
- package/dist/commands/storeIntegration.svelte.d.ts +4 -1
- package/dist/commands/storeIntegration.svelte.js +26 -21
- package/dist/commands/types.d.ts +2 -0
- package/dist/components/App.svelte +163 -192
- package/dist/components/App.svelte.d.ts +47 -8
- package/dist/components/ConfigForm.svelte +77 -49
- package/dist/components/ConfigModal.svelte +7 -2
- package/dist/components/ConnectionLine.svelte +4 -2
- package/dist/components/Navbar.svelte +61 -1
- package/dist/components/NodeSidebar.svelte +27 -45
- package/dist/components/NodeStatusOverlay.svelte +94 -6
- package/dist/components/NodeSwapPicker.svelte +10 -8
- 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/SchemaForm.stories.svelte +1 -3
- package/dist/components/SchemaForm.svelte +22 -27
- package/dist/components/SchemaForm.svelte.d.ts +0 -8
- package/dist/components/SettingsModal.svelte +8 -3
- package/dist/components/SettingsPanel.svelte +20 -4
- package/dist/components/SwapMappingEditor.svelte +67 -49
- package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
- package/dist/components/UniversalNode.svelte +9 -7
- package/dist/components/WorkflowEditor.svelte +121 -111
- package/dist/components/WorkflowEditor.svelte.d.ts +21 -10
- package/dist/components/chat/AIChatPanel.svelte +98 -89
- 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 +10 -11
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
- package/dist/components/console/ConsoleInput.svelte +15 -6
- package/dist/components/console/ConsoleOutput.svelte +2 -1
- package/dist/components/form/FormArray.svelte +5 -9
- package/dist/components/form/FormArray.svelte.d.ts +2 -1
- package/dist/components/form/FormAutocomplete.svelte +16 -15
- package/dist/components/form/FormField.svelte +4 -2
- package/dist/components/form/FormFieldLight.svelte +34 -3
- package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
- package/dist/components/form/FormMarkdownEditor.svelte +9 -4
- package/dist/components/form/FormRangeField.svelte +1 -0
- package/dist/components/form/FormTemplateEditor.svelte +11 -3
- package/dist/components/form/FormToggle.svelte +5 -12
- package/dist/components/form/FormToggle.svelte.d.ts +4 -2
- package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
- package/dist/components/form/templateAutocomplete.js +1 -5
- package/dist/components/form/types.d.ts +1 -14
- package/dist/components/interrupt/FormPrompt.svelte +3 -2
- package/dist/components/interrupt/InterruptBubble.svelte +25 -17
- package/dist/components/interrupt/ReviewPrompt.svelte +10 -3
- package/dist/components/interrupt/TextInputPrompt.svelte +2 -1
- package/dist/components/layouts/MainLayout.svelte +20 -13
- package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
- package/dist/components/nodes/AtomNode.svelte +17 -5
- package/dist/components/nodes/GatewayNode.svelte +19 -10
- package/dist/components/nodes/IdeaNode.svelte +7 -0
- package/dist/components/nodes/SimpleNode.svelte +11 -6
- package/dist/components/nodes/SquareNode.svelte +15 -8
- package/dist/components/nodes/TerminalNode.svelte +9 -4
- package/dist/components/nodes/ToolNode.svelte +7 -1
- package/dist/components/nodes/WorkflowNode.svelte +16 -7
- package/dist/components/playground/ChatInput.svelte +11 -14
- 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 +11 -9
- 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 +11 -1
- 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 -32
- 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/config/endpoints.d.ts +23 -7
- package/dist/config/endpoints.js +30 -10
- package/dist/core/index.d.ts +5 -6
- 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 +28 -25
- 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 +0 -1
- package/dist/messages/index.js +0 -1
- package/dist/mocks/app-forms.d.ts +6 -2
- package/dist/mocks/app-forms.js +11 -4
- package/dist/openapi/v1/openapi.yaml +3 -3
- package/dist/playground/index.d.ts +4 -5
- package/dist/playground/index.js +4 -32
- package/dist/playground/mount.d.ts +25 -0
- package/dist/playground/mount.js +50 -20
- 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 +182 -15
- 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 +3 -3
- 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 +2 -1
- package/dist/services/dynamicSchemaService.js +5 -22
- package/dist/services/globalSave.d.ts +13 -12
- package/dist/services/globalSave.js +29 -51
- package/dist/services/historyService.d.ts +9 -3
- package/dist/services/historyService.js +9 -3
- 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/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 +77 -93
- package/dist/stores/historyStore.svelte.js +134 -160
- package/dist/stores/instanceContainer.svelte.d.ts +111 -0
- package/dist/stores/instanceContainer.svelte.js +114 -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 +4 -1
- package/dist/stores/settingsStore.svelte.js +47 -12
- package/dist/stores/workflowStore.svelte.d.ts +178 -213
- package/dist/stores/workflowStore.svelte.js +449 -501
- package/dist/stories/EdgeDecorator.svelte +5 -2
- package/dist/stories/NodeDecorator.svelte +5 -3
- package/dist/svelte-app.d.ts +60 -10
- package/dist/svelte-app.js +159 -54
- package/dist/types/auth.d.ts +9 -51
- package/dist/types/auth.js +4 -54
- package/dist/types/events.d.ts +6 -3
- package/dist/types/index.d.ts +37 -5
- 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 +13 -0
- package/dist/types/settings.js +1 -0
- package/dist/utils/colors.d.ts +47 -21
- package/dist/utils/colors.js +69 -68
- package/dist/utils/connections.d.ts +9 -15
- package/dist/utils/connections.js +13 -32
- 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/nodeSwap.d.ts +6 -2
- package/dist/utils/nodeSwap.js +62 -126
- package/dist/utils/nodeTypes.d.ts +17 -8
- package/dist/utils/nodeTypes.js +27 -20
- package/dist/utils/performanceUtils.js +7 -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
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* Contains business logic for workflow operations
|
|
4
4
|
*/
|
|
5
5
|
import { hasCycles, hasInvalidCycles } from '../utils/connections.js';
|
|
6
|
-
import { workflowApi, nodeApi, setEndpointConfig } from '../services/api.js';
|
|
7
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
|
-
import {
|
|
7
|
+
import { getDefaultInstance } from '../stores/instanceContainer.svelte.js';
|
|
9
8
|
import { nodeExecutionService } from '../services/nodeExecutionService.js';
|
|
10
9
|
import { WorkflowAdapter } from '../adapters/WorkflowAdapter.js';
|
|
11
10
|
import { AgentSpecAdapter } from '../adapters/agentspec/AgentSpecAdapter.js';
|
|
@@ -49,14 +48,14 @@ export class NodeOperationsHelper {
|
|
|
49
48
|
/**
|
|
50
49
|
* Load nodes from API
|
|
51
50
|
*/
|
|
52
|
-
static async loadNodesFromApi(providedNodes) {
|
|
51
|
+
static async loadNodesFromApi(api, providedNodes) {
|
|
53
52
|
// If nodes are provided via props, use them
|
|
54
53
|
if (providedNodes && providedNodes.length > 0) {
|
|
55
54
|
return providedNodes;
|
|
56
55
|
}
|
|
57
56
|
// Otherwise, load from API
|
|
58
57
|
try {
|
|
59
|
-
const fetchedNodes = await
|
|
58
|
+
const fetchedNodes = await api.client.getAvailableNodes();
|
|
60
59
|
return fetchedNodes;
|
|
61
60
|
}
|
|
62
61
|
catch (error) {
|
|
@@ -89,7 +88,7 @@ export class NodeOperationsHelper {
|
|
|
89
88
|
/**
|
|
90
89
|
* Load node execution information for all nodes in the workflow
|
|
91
90
|
*/
|
|
92
|
-
static async loadNodeExecutionInfo(workflow, pipelineId) {
|
|
91
|
+
static async loadNodeExecutionInfo(api, workflow, pipelineId) {
|
|
93
92
|
if (!workflow?.nodes)
|
|
94
93
|
return {};
|
|
95
94
|
// Only load execution info if we have a pipelineId (for pipeline status mode)
|
|
@@ -97,7 +96,7 @@ export class NodeOperationsHelper {
|
|
|
97
96
|
return {};
|
|
98
97
|
try {
|
|
99
98
|
const nodeIds = workflow.nodes.map((node) => node.id);
|
|
100
|
-
const executionInfo = await nodeExecutionService.getMultipleNodeExecutionInfo(nodeIds, pipelineId);
|
|
99
|
+
const executionInfo = await nodeExecutionService.getMultipleNodeExecutionInfo(api.config, nodeIds, pipelineId);
|
|
101
100
|
return executionInfo;
|
|
102
101
|
}
|
|
103
102
|
catch (error) {
|
|
@@ -160,7 +159,7 @@ export class WorkflowOperationsHelper {
|
|
|
160
159
|
static generateMetadata(existingMetadata) {
|
|
161
160
|
const now = new Date().toISOString();
|
|
162
161
|
return {
|
|
163
|
-
|
|
162
|
+
schemaVersion: '1.0.0',
|
|
164
163
|
createdAt: now,
|
|
165
164
|
...(existingMetadata ?? {}),
|
|
166
165
|
updatedAt: now,
|
|
@@ -217,38 +216,41 @@ export class WorkflowOperationsHelper {
|
|
|
217
216
|
}
|
|
218
217
|
/**
|
|
219
218
|
* Save workflow to backend
|
|
219
|
+
*
|
|
220
|
+
* @param api - The instance's API context (endpoints + client)
|
|
221
|
+
* @param workflow - The workflow to save
|
|
222
|
+
* @param instance - The FlowDrop instance whose store should be synced when
|
|
223
|
+
* the server assigns a new ID; defaults to the page-default instance
|
|
220
224
|
*/
|
|
221
|
-
static async saveWorkflow(workflow) {
|
|
225
|
+
static async saveWorkflow(api, workflow, instance) {
|
|
222
226
|
if (!workflow) {
|
|
223
227
|
logger.warn('No workflow data available to save');
|
|
224
228
|
return null;
|
|
225
229
|
}
|
|
226
230
|
try {
|
|
227
|
-
// Determine
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
// Generate a new UUID for a new workflow
|
|
235
|
-
workflowId = uuidv4();
|
|
236
|
-
}
|
|
231
|
+
// Determine new vs existing BEFORE the uuidv4() fallback: a present id (any
|
|
232
|
+
// format) means the workflow came from a backend and must be updated. Only
|
|
233
|
+
// a missing id means "truly new".
|
|
234
|
+
const isExistingWorkflow = !!workflow.id;
|
|
235
|
+
const workflowId = workflow.id || uuidv4();
|
|
237
236
|
const workflowToSave = {
|
|
238
237
|
id: workflowId,
|
|
239
238
|
name: workflow.name || 'Untitled Workflow',
|
|
240
239
|
nodes: workflow.nodes || [],
|
|
241
240
|
edges: workflow.edges || [],
|
|
242
241
|
metadata: {
|
|
243
|
-
|
|
242
|
+
schemaVersion: workflow.metadata?.schemaVersion || '1.0.0',
|
|
244
243
|
createdAt: workflow.metadata?.createdAt || new Date().toISOString(),
|
|
245
244
|
updatedAt: new Date().toISOString()
|
|
246
245
|
}
|
|
247
246
|
};
|
|
248
|
-
const savedWorkflow =
|
|
247
|
+
const savedWorkflow = isExistingWorkflow
|
|
248
|
+
? await api.client.updateWorkflow(workflowToSave.id, workflowToSave)
|
|
249
|
+
: await api.client.saveWorkflow(workflowToSave);
|
|
249
250
|
// Update the workflow ID if it changed (new workflow)
|
|
250
251
|
if (savedWorkflow.id && savedWorkflow.id !== workflowToSave.id) {
|
|
251
|
-
|
|
252
|
+
const fd = instance ?? getDefaultInstance();
|
|
253
|
+
fd.workflow.batchUpdate({
|
|
252
254
|
nodes: workflowToSave.nodes,
|
|
253
255
|
edges: workflowToSave.edges,
|
|
254
256
|
name: workflowToSave.name,
|
|
@@ -281,7 +283,7 @@ export class WorkflowOperationsHelper {
|
|
|
281
283
|
nodes: workflow.nodes || [],
|
|
282
284
|
edges: workflow.edges || [],
|
|
283
285
|
metadata: {
|
|
284
|
-
|
|
286
|
+
schemaVersion: workflow.metadata?.schemaVersion || '1.0.0',
|
|
285
287
|
createdAt: workflow.metadata?.createdAt || new Date().toISOString(),
|
|
286
288
|
updatedAt: new Date().toISOString()
|
|
287
289
|
}
|
|
@@ -380,9 +382,10 @@ export class WorkflowOperationsHelper {
|
|
|
380
382
|
*/
|
|
381
383
|
export class ConfigurationHelper {
|
|
382
384
|
/**
|
|
383
|
-
* Configure API endpoints
|
|
385
|
+
* Configure API endpoints (and optionally the auth provider) on the given
|
|
386
|
+
* instance's API context.
|
|
384
387
|
*/
|
|
385
|
-
static configureEndpoints(config) {
|
|
386
|
-
|
|
388
|
+
static configureEndpoints(api, config, authProvider) {
|
|
389
|
+
api.configure(config, authProvider);
|
|
387
390
|
}
|
|
388
391
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FlowDrop - Visual Workflow Editor Library
|
|
3
3
|
*
|
|
4
|
-
* A Svelte 5 component library built on @xyflow/svelte for creating node-based
|
|
4
|
+
* A Svelte 5 component library built on @xyflow/svelte for creating node-based
|
|
5
|
+
* workflow editors.
|
|
5
6
|
*
|
|
6
|
-
* ##
|
|
7
|
+
* ## The main entry is a minimal front door
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
+
* This entry point intentionally exposes only the small surface most apps need
|
|
10
|
+
* to get started: the `App` component, the `mountFlowDropApp` / `unmountFlowDropApp`
|
|
11
|
+
* mount helpers, instance plumbing (`createFlowDropInstance` / `getInstance` /
|
|
12
|
+
* `provideInstance`), endpoint + auth helpers, and the core public types. It does
|
|
13
|
+
* NOT re-export the entire library.
|
|
9
14
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
15
|
+
* Everything else lives in focused sub-modules — import from the one you need:
|
|
16
|
+
*
|
|
17
|
+
* - `@flowdrop/flowdrop/core` - Types, utilities, theme/skin, messages helpers (no heavy deps)
|
|
18
|
+
* - `@flowdrop/flowdrop/editor` - WorkflowEditor, registries, stores, services (adds @xyflow/svelte)
|
|
12
19
|
* - `@flowdrop/flowdrop/form` - SchemaForm with basic fields
|
|
13
|
-
* - `@flowdrop/flowdrop/form/code` - Code editor
|
|
14
|
-
* - `@flowdrop/flowdrop/form/markdown` - Markdown editor
|
|
20
|
+
* - `@flowdrop/flowdrop/form/code` - Code editor field (adds CodeMirror)
|
|
21
|
+
* - `@flowdrop/flowdrop/form/markdown` - Markdown editor field (CodeMirror 6)
|
|
15
22
|
* - `@flowdrop/flowdrop/display` - MarkdownDisplay (adds marked)
|
|
16
23
|
* - `@flowdrop/flowdrop/playground` - Playground for interactive workflow testing
|
|
24
|
+
* - `@flowdrop/flowdrop/settings` - Settings stores, services, components
|
|
17
25
|
* - `@flowdrop/flowdrop/styles` - CSS styles
|
|
18
26
|
*
|
|
19
|
-
* ## Legacy Import (Full Bundle)
|
|
20
|
-
*
|
|
21
|
-
* Importing from the main entry point includes everything:
|
|
22
|
-
*
|
|
23
|
-
* ```typescript
|
|
24
|
-
* import { WorkflowEditor, SchemaForm } from "@flowdrop/flowdrop";
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* **Note**: This will bundle ALL dependencies including @xyflow/svelte,
|
|
28
|
-
* CodeMirror and marked. For smaller bundles, use sub-modules.
|
|
29
|
-
*
|
|
30
27
|
* @module flowdrop
|
|
31
28
|
*/
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
29
|
+
export { default as App } from './components/App.svelte';
|
|
30
|
+
export { mountFlowDropApp, unmountFlowDropApp } from './svelte-app.js';
|
|
31
|
+
export { createFlowDropInstance } from './stores/instanceContainer.svelte.js';
|
|
32
|
+
export { getInstance, provideInstance } from './stores/getInstance.svelte.js';
|
|
33
|
+
export { createEndpointConfig, defaultEndpointConfig } from './config/endpoints.js';
|
|
34
|
+
export { NoAuthProvider, StaticAuthProvider, CallbackAuthProvider } from './types/auth.js';
|
|
35
|
+
export type { Workflow, WorkflowNode, WorkflowEdge, NodeMetadata, ConfigSchema } from './types/index.js';
|
|
36
|
+
export type { EndpointConfig } from './config/endpoints.js';
|
|
37
|
+
export type { AuthProvider } from './types/auth.js';
|
|
38
|
+
export type { FlowDropInstance } from './stores/instanceContainer.svelte.js';
|
|
39
|
+
export type { FlowDropMountOptions, MountedFlowDropApp } from './svelte-app.js';
|
|
40
|
+
export type { FlowDropEventHandlers } from './types/events.js';
|
|
41
|
+
export type { Messages, MessagesOverride } from './messages/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,64 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FlowDrop - Visual Workflow Editor Library
|
|
3
3
|
*
|
|
4
|
-
* A Svelte 5 component library built on @xyflow/svelte for creating node-based
|
|
4
|
+
* A Svelte 5 component library built on @xyflow/svelte for creating node-based
|
|
5
|
+
* workflow editors.
|
|
5
6
|
*
|
|
6
|
-
* ##
|
|
7
|
+
* ## The main entry is a minimal front door
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
+
* This entry point intentionally exposes only the small surface most apps need
|
|
10
|
+
* to get started: the `App` component, the `mountFlowDropApp` / `unmountFlowDropApp`
|
|
11
|
+
* mount helpers, instance plumbing (`createFlowDropInstance` / `getInstance` /
|
|
12
|
+
* `provideInstance`), endpoint + auth helpers, and the core public types. It does
|
|
13
|
+
* NOT re-export the entire library.
|
|
9
14
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
15
|
+
* Everything else lives in focused sub-modules — import from the one you need:
|
|
16
|
+
*
|
|
17
|
+
* - `@flowdrop/flowdrop/core` - Types, utilities, theme/skin, messages helpers (no heavy deps)
|
|
18
|
+
* - `@flowdrop/flowdrop/editor` - WorkflowEditor, registries, stores, services (adds @xyflow/svelte)
|
|
12
19
|
* - `@flowdrop/flowdrop/form` - SchemaForm with basic fields
|
|
13
|
-
* - `@flowdrop/flowdrop/form/code` - Code editor
|
|
14
|
-
* - `@flowdrop/flowdrop/form/markdown` - Markdown editor
|
|
20
|
+
* - `@flowdrop/flowdrop/form/code` - Code editor field (adds CodeMirror)
|
|
21
|
+
* - `@flowdrop/flowdrop/form/markdown` - Markdown editor field (CodeMirror 6)
|
|
15
22
|
* - `@flowdrop/flowdrop/display` - MarkdownDisplay (adds marked)
|
|
16
23
|
* - `@flowdrop/flowdrop/playground` - Playground for interactive workflow testing
|
|
24
|
+
* - `@flowdrop/flowdrop/settings` - Settings stores, services, components
|
|
17
25
|
* - `@flowdrop/flowdrop/styles` - CSS styles
|
|
18
26
|
*
|
|
19
|
-
* ## Legacy Import (Full Bundle)
|
|
20
|
-
*
|
|
21
|
-
* Importing from the main entry point includes everything:
|
|
22
|
-
*
|
|
23
|
-
* ```typescript
|
|
24
|
-
* import { WorkflowEditor, SchemaForm } from "@flowdrop/flowdrop";
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* **Note**: This will bundle ALL dependencies including @xyflow/svelte,
|
|
28
|
-
* CodeMirror and marked. For smaller bundles, use sub-modules.
|
|
29
|
-
*
|
|
30
27
|
* @module flowdrop
|
|
31
28
|
*/
|
|
32
29
|
// ============================================================================
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
export
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
// ============================================================================
|
|
46
|
-
export * from './form/index.js';
|
|
47
|
-
// Note: Heavy form fields (code, markdown) are NOT auto-registered.
|
|
48
|
-
// Users must import from form/code or form/markdown and register explicitly.
|
|
49
|
-
// ============================================================================
|
|
50
|
-
// Display Exports
|
|
51
|
-
// ============================================================================
|
|
52
|
-
export * from './display/index.js';
|
|
53
|
-
// ============================================================================
|
|
54
|
-
// Playground Exports
|
|
55
|
-
// ============================================================================
|
|
56
|
-
export * from './playground/index.js';
|
|
57
|
-
// ============================================================================
|
|
58
|
-
// Editor Exports (includes @xyflow/svelte and auto-registers builtin nodes)
|
|
59
|
-
// ============================================================================
|
|
60
|
-
export * from './editor/index.js';
|
|
61
|
-
// ============================================================================
|
|
62
|
-
// Settings Exports (stores, services, components, types)
|
|
63
|
-
// ============================================================================
|
|
64
|
-
export * from './settings/index.js';
|
|
30
|
+
// Values
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// App component + vanilla-JS mount lifecycle.
|
|
33
|
+
export { default as App } from './components/App.svelte';
|
|
34
|
+
export { mountFlowDropApp, unmountFlowDropApp } from './svelte-app.js';
|
|
35
|
+
// Instance plumbing — per-instance state container + Svelte context helpers.
|
|
36
|
+
export { createFlowDropInstance } from './stores/instanceContainer.svelte.js';
|
|
37
|
+
export { getInstance, provideInstance } from './stores/getInstance.svelte.js';
|
|
38
|
+
// Endpoint configuration helpers.
|
|
39
|
+
export { createEndpointConfig, defaultEndpointConfig } from './config/endpoints.js';
|
|
40
|
+
// Authentication providers.
|
|
41
|
+
export { NoAuthProvider, StaticAuthProvider, CallbackAuthProvider } from './types/auth.js';
|
|
@@ -279,12 +279,8 @@ export declare const defaultMessages: {
|
|
|
279
279
|
readonly predefinedRun: "Run workflow";
|
|
280
280
|
};
|
|
281
281
|
readonly states: {
|
|
282
|
-
readonly viewOnlyTitle: "View only";
|
|
283
|
-
readonly viewOnlyText: "This playground is in view-only mode. No inputs are available.";
|
|
284
282
|
readonly newSessionTitle: "New session";
|
|
285
283
|
readonly newSessionText: "Test your flow with a prompt";
|
|
286
|
-
readonly readyTitle: "Ready to run";
|
|
287
|
-
readonly readyText: "Click Run to execute your workflow";
|
|
288
284
|
readonly processing: "Processing...";
|
|
289
285
|
readonly viewOnlyHelp: "View-only mode. Workflow execution is controlled externally.";
|
|
290
286
|
};
|
|
@@ -342,7 +338,7 @@ export declare const defaultMessages: {
|
|
|
342
338
|
readonly newSession: "New session";
|
|
343
339
|
};
|
|
344
340
|
readonly controlPanel: {
|
|
345
|
-
readonly sessionsLabel: "
|
|
341
|
+
readonly sessionsLabel: "Session";
|
|
346
342
|
readonly noSession: "No session";
|
|
347
343
|
readonly switchSession: "Switch session";
|
|
348
344
|
readonly newSession: "New session";
|
|
@@ -420,6 +416,7 @@ export declare const defaultMessages: {
|
|
|
420
416
|
readonly lastRunLabel: "Last Run:";
|
|
421
417
|
readonly durationLabel: "Duration:";
|
|
422
418
|
readonly errorLabel: "Error:";
|
|
419
|
+
readonly historyLabel: "Runs:";
|
|
423
420
|
};
|
|
424
421
|
};
|
|
425
422
|
};
|
|
@@ -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
|
@@ -7,5 +7,4 @@
|
|
|
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
|
@@ -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;
|
|
@@ -3923,9 +3923,9 @@ components:
|
|
|
3923
3923
|
WorkflowMetadata:
|
|
3924
3924
|
type: object
|
|
3925
3925
|
properties:
|
|
3926
|
-
|
|
3926
|
+
schemaVersion:
|
|
3927
3927
|
type: string
|
|
3928
|
-
description: Workflow version
|
|
3928
|
+
description: Workflow schema format version — identifies the document format, not the workflow's own revision.
|
|
3929
3929
|
example: 1.0.0
|
|
3930
3930
|
createdAt:
|
|
3931
3931
|
type: string
|
|
@@ -3963,7 +3963,7 @@ components:
|
|
|
3963
3963
|
example: flowdrop
|
|
3964
3964
|
default: flowdrop
|
|
3965
3965
|
required:
|
|
3966
|
-
-
|
|
3966
|
+
- schemaVersion
|
|
3967
3967
|
- createdAt
|
|
3968
3968
|
- updatedAt
|
|
3969
3969
|
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
|