@d34dman/flowdrop 0.0.22 → 0.0.23
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/dist/components/App.svelte +26 -25
- package/dist/components/ConfigForm.svelte +140 -519
- package/dist/components/ConfigForm.svelte.d.ts +5 -3
- package/dist/components/form/FormArray.svelte +1049 -0
- package/dist/components/form/FormArray.svelte.d.ts +22 -0
- package/dist/components/form/FormCheckboxGroup.svelte +152 -0
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +15 -0
- package/dist/components/form/FormField.svelte +279 -0
- package/dist/components/form/FormField.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldWrapper.svelte +133 -0
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +18 -0
- package/dist/components/form/FormNumberField.svelte +109 -0
- package/dist/components/form/FormNumberField.svelte.d.ts +23 -0
- package/dist/components/form/FormSelect.svelte +126 -0
- package/dist/components/form/FormSelect.svelte.d.ts +18 -0
- package/dist/components/form/FormTextField.svelte +88 -0
- package/dist/components/form/FormTextField.svelte.d.ts +17 -0
- package/dist/components/form/FormTextarea.svelte +94 -0
- package/dist/components/form/FormTextarea.svelte.d.ts +19 -0
- package/dist/components/form/FormToggle.svelte +123 -0
- package/dist/components/form/FormToggle.svelte.d.ts +17 -0
- package/dist/components/form/index.d.ts +41 -0
- package/dist/components/form/index.js +45 -0
- package/dist/components/form/types.d.ts +208 -0
- package/dist/components/form/types.js +29 -0
- package/dist/components/nodes/GatewayNode.svelte +84 -12
- package/dist/components/nodes/SimpleNode.svelte +41 -5
- package/dist/components/nodes/SimpleNode.svelte.d.ts +2 -1
- package/dist/components/nodes/SquareNode.svelte +41 -5
- package/dist/components/nodes/SquareNode.svelte.d.ts +2 -1
- package/dist/components/nodes/WorkflowNode.svelte +88 -5
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -3
- package/dist/stores/workflowStore.d.ts +15 -0
- package/dist/stores/workflowStore.js +28 -0
- package/dist/types/index.d.ts +77 -0
- package/dist/types/index.js +16 -0
- package/package.json +3 -3
- package/dist/config/demo.d.ts +0 -58
- package/dist/config/demo.js +0 -142
- package/dist/data/samples.d.ts +0 -51
- package/dist/data/samples.js +0 -3245
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
Renders individual nodes in the workflow editor with full functionality
|
|
4
4
|
Uses SvelteFlow's Handle for connection ports
|
|
5
5
|
Styled with BEM syntax
|
|
6
|
+
|
|
7
|
+
UI Extensions Support:
|
|
8
|
+
- hideUnconnectedHandles: Hides ports that are not connected to reduce visual clutter
|
|
6
9
|
-->
|
|
7
10
|
|
|
8
11
|
<script lang="ts">
|
|
9
12
|
import { Position, Handle } from '@xyflow/svelte';
|
|
10
|
-
import type { WorkflowNode } from '../../types/index.js';
|
|
13
|
+
import type { WorkflowNode, NodePort, DynamicPort } from '../../types/index.js';
|
|
14
|
+
import { dynamicPortToNodePort } from '../../types/index.js';
|
|
11
15
|
import Icon from '@iconify/svelte';
|
|
12
16
|
import { getNodeIcon } from '../../utils/icons.js';
|
|
13
17
|
import { getDataTypeColorToken, getCategoryColorToken } from '../../utils/colors.js';
|
|
18
|
+
import { connectedHandles } from '../../stores/workflowStore.js';
|
|
14
19
|
|
|
15
20
|
interface Props {
|
|
16
21
|
data: WorkflowNode['data'] & {
|
|
@@ -23,6 +28,84 @@
|
|
|
23
28
|
let props: Props = $props();
|
|
24
29
|
let isHandleInteraction = $state(false);
|
|
25
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Get the hideUnconnectedHandles setting from extensions
|
|
33
|
+
* Merges node type defaults with instance overrides
|
|
34
|
+
*/
|
|
35
|
+
const hideUnconnectedHandles = $derived(() => {
|
|
36
|
+
const typeDefault = props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ?? false;
|
|
37
|
+
const instanceOverride = props.data.extensions?.ui?.hideUnconnectedHandles;
|
|
38
|
+
return instanceOverride ?? typeDefault;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Dynamic inputs from config - user-defined input ports
|
|
43
|
+
* Similar to how branches work in GatewayNode
|
|
44
|
+
*/
|
|
45
|
+
const dynamicInputs = $derived(
|
|
46
|
+
((props.data.config?.dynamicInputs as DynamicPort[]) || []).map((port) =>
|
|
47
|
+
dynamicPortToNodePort(port, 'input')
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Dynamic outputs from config - user-defined output ports
|
|
53
|
+
* Similar to how branches work in GatewayNode
|
|
54
|
+
*/
|
|
55
|
+
const dynamicOutputs = $derived(
|
|
56
|
+
((props.data.config?.dynamicOutputs as DynamicPort[]) || []).map((port) =>
|
|
57
|
+
dynamicPortToNodePort(port, 'output')
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Combined input ports: static metadata inputs + dynamic config inputs
|
|
63
|
+
*/
|
|
64
|
+
const allInputPorts = $derived([...props.data.metadata.inputs, ...dynamicInputs]);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Combined output ports: static metadata outputs + dynamic config outputs
|
|
68
|
+
*/
|
|
69
|
+
const allOutputPorts = $derived([...props.data.metadata.outputs, ...dynamicOutputs]);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Check if a port should be visible based on connection state and settings
|
|
73
|
+
* @param port - The port to check
|
|
74
|
+
* @param type - Whether this is an 'input' or 'output' port
|
|
75
|
+
* @returns true if the port should be visible
|
|
76
|
+
*/
|
|
77
|
+
function isPortVisible(port: NodePort, type: 'input' | 'output'): boolean {
|
|
78
|
+
// Always show if hideUnconnectedHandles is disabled
|
|
79
|
+
if (!hideUnconnectedHandles()) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Always show required ports
|
|
84
|
+
if (port.required) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Check if port is connected
|
|
89
|
+
const handleId = `${props.data.nodeId}-${type}-${port.id}`;
|
|
90
|
+
return $connectedHandles.has(handleId);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Derived list of visible input ports based on hideUnconnectedHandles setting
|
|
95
|
+
* Now includes both static and dynamic inputs
|
|
96
|
+
*/
|
|
97
|
+
const visibleInputPorts = $derived(
|
|
98
|
+
allInputPorts.filter((port) => isPortVisible(port, 'input'))
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Derived list of visible output ports based on hideUnconnectedHandles setting
|
|
103
|
+
* Now includes both static and dynamic outputs
|
|
104
|
+
*/
|
|
105
|
+
const visibleOutputPorts = $derived(
|
|
106
|
+
allOutputPorts.filter((port) => isPortVisible(port, 'output'))
|
|
107
|
+
);
|
|
108
|
+
|
|
26
109
|
/**
|
|
27
110
|
* Handle configuration value changes - now handled by global ConfigSidebar
|
|
28
111
|
*/
|
|
@@ -110,13 +193,13 @@
|
|
|
110
193
|
</div>
|
|
111
194
|
|
|
112
195
|
<!-- Input Ports Container -->
|
|
113
|
-
{#if
|
|
196
|
+
{#if visibleInputPorts.length > 0}
|
|
114
197
|
<div class="flowdrop-workflow-node__ports">
|
|
115
198
|
<div class="flowdrop-workflow-node__ports-header">
|
|
116
199
|
<h5 class="flowdrop-workflow-node__ports-title">Inputs</h5>
|
|
117
200
|
</div>
|
|
118
201
|
<div class="flowdrop-workflow-node__ports-list">
|
|
119
|
-
{#each
|
|
202
|
+
{#each visibleInputPorts as port (port.id)}
|
|
120
203
|
<div class="flowdrop-workflow-node__port">
|
|
121
204
|
<!-- Input Handle -->
|
|
122
205
|
<Handle
|
|
@@ -161,13 +244,13 @@
|
|
|
161
244
|
{/if}
|
|
162
245
|
|
|
163
246
|
<!-- Output Ports Container -->
|
|
164
|
-
{#if
|
|
247
|
+
{#if visibleOutputPorts.length > 0}
|
|
165
248
|
<div class="flowdrop-workflow-node__ports">
|
|
166
249
|
<div class="flowdrop-workflow-node__ports-header">
|
|
167
250
|
<h5 class="flowdrop-workflow-node__ports-title">Outputs</h5>
|
|
168
251
|
</div>
|
|
169
252
|
<div class="flowdrop-workflow-node__ports-list">
|
|
170
|
-
{#each
|
|
253
|
+
{#each visibleOutputPorts as port (port.id)}
|
|
171
254
|
<div class="flowdrop-workflow-node__port">
|
|
172
255
|
<!-- Port Info -->
|
|
173
256
|
<div class="flowdrop-flex--1 flowdrop-min-w--0 flowdrop-text--right">
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import './styles/base.css';
|
|
6
6
|
import './registry/builtinNodes.js';
|
|
7
|
-
export type { NodeCategory, NodeDataType, NodePort, NodeMetadata, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType } from './types/index.js';
|
|
7
|
+
export type { NodeCategory, NodeDataType, NodePort, NodeMetadata, NodeExtensions, NodeUIExtensions, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType } from './types/index.js';
|
|
8
8
|
export type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, ExecutionConfig, StorageConfig } from './types/config.js';
|
|
9
9
|
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from './types/auth.js';
|
|
10
10
|
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider } from './types/auth.js';
|
|
@@ -36,7 +36,6 @@ export { default as LogsSidebar } from './components/LogsSidebar.svelte';
|
|
|
36
36
|
export { default as PipelineStatus } from './components/PipelineStatus.svelte';
|
|
37
37
|
export { default as Navbar } from './components/Navbar.svelte';
|
|
38
38
|
export { default as Logo } from './components/Logo.svelte';
|
|
39
|
-
export { sampleNodes, sampleWorkflow } from './data/samples.js';
|
|
40
39
|
export * from './utils/icons.js';
|
|
41
40
|
export * from './utils/colors.js';
|
|
42
41
|
export * from './utils/connections.js';
|
|
@@ -56,7 +55,7 @@ export { globalSaveWorkflow, globalExportWorkflow, initializeGlobalSave } from '
|
|
|
56
55
|
export { fetchPortConfig, validatePortConfig } from './services/portConfigApi.js';
|
|
57
56
|
export { getDraftStorageKey, saveDraft, loadDraft, deleteDraft, hasDraft, getDraftMetadata, DraftAutoSaveManager } from './services/draftStorage.js';
|
|
58
57
|
export { EdgeStylingHelper, NodeOperationsHelper, WorkflowOperationsHelper, ConfigurationHelper } from './helpers/workflowEditorHelper.js';
|
|
59
|
-
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged, isDirtyStore, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange } from './stores/workflowStore.js';
|
|
58
|
+
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged, connectedHandles, isDirtyStore, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange } from './stores/workflowStore.js';
|
|
60
59
|
export * from './config/endpoints.js';
|
|
61
60
|
export { DEFAULT_PORT_CONFIG } from './config/defaultPortConfig.js';
|
|
62
61
|
export * from './config/runtimeConfig.js';
|
package/dist/index.js
CHANGED
|
@@ -37,8 +37,6 @@ export { default as LogsSidebar } from './components/LogsSidebar.svelte';
|
|
|
37
37
|
export { default as PipelineStatus } from './components/PipelineStatus.svelte';
|
|
38
38
|
export { default as Navbar } from './components/Navbar.svelte';
|
|
39
39
|
export { default as Logo } from './components/Logo.svelte';
|
|
40
|
-
// Export sample data for development
|
|
41
|
-
export { sampleNodes, sampleWorkflow } from './data/samples.js';
|
|
42
40
|
// Export utilities
|
|
43
41
|
export * from './utils/icons.js';
|
|
44
42
|
export * from './utils/colors.js';
|
|
@@ -67,7 +65,7 @@ export { getDraftStorageKey, saveDraft, loadDraft, deleteDraft, hasDraft, getDra
|
|
|
67
65
|
// Export helpers
|
|
68
66
|
export { EdgeStylingHelper, NodeOperationsHelper, WorkflowOperationsHelper, ConfigurationHelper } from './helpers/workflowEditorHelper.js';
|
|
69
67
|
// Export stores
|
|
70
|
-
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged,
|
|
68
|
+
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged, connectedHandles,
|
|
71
69
|
// Dirty state tracking
|
|
72
70
|
isDirtyStore, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange } from './stores/workflowStore.js';
|
|
73
71
|
// Export endpoint configuration
|
|
@@ -154,3 +154,18 @@ export declare const workflowMetadataChanged: import("svelte/store").Readable<{
|
|
|
154
154
|
updatedAt: string;
|
|
155
155
|
version: string;
|
|
156
156
|
}>;
|
|
157
|
+
/**
|
|
158
|
+
* Derived store for connected handles
|
|
159
|
+
*
|
|
160
|
+
* Provides a Set of all handle IDs that are currently connected to edges.
|
|
161
|
+
* Used by node components to implement hideUnconnectedHandles functionality.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* import { connectedHandles } from './workflowStore.js';
|
|
166
|
+
*
|
|
167
|
+
* // Check if a specific handle is connected
|
|
168
|
+
* const isConnected = $connectedHandles.has('node-1-input-data');
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
export declare const connectedHandles: import("svelte/store").Readable<Set<string>>;
|
|
@@ -470,3 +470,31 @@ export const workflowMetadataChanged = derived(workflowMetadata, (metadata) => (
|
|
|
470
470
|
updatedAt: metadata.updatedAt,
|
|
471
471
|
version: metadata.version ?? '1.0.0'
|
|
472
472
|
}));
|
|
473
|
+
/**
|
|
474
|
+
* Derived store for connected handles
|
|
475
|
+
*
|
|
476
|
+
* Provides a Set of all handle IDs that are currently connected to edges.
|
|
477
|
+
* Used by node components to implement hideUnconnectedHandles functionality.
|
|
478
|
+
*
|
|
479
|
+
* @example
|
|
480
|
+
* ```typescript
|
|
481
|
+
* import { connectedHandles } from './workflowStore.js';
|
|
482
|
+
*
|
|
483
|
+
* // Check if a specific handle is connected
|
|
484
|
+
* const isConnected = $connectedHandles.has('node-1-input-data');
|
|
485
|
+
* ```
|
|
486
|
+
*/
|
|
487
|
+
export const connectedHandles = derived(workflowEdges, (edges) => {
|
|
488
|
+
const handles = new Set();
|
|
489
|
+
edges.forEach((edge) => {
|
|
490
|
+
// Add source handle (output port)
|
|
491
|
+
if (edge.sourceHandle) {
|
|
492
|
+
handles.add(edge.sourceHandle);
|
|
493
|
+
}
|
|
494
|
+
// Add target handle (input port)
|
|
495
|
+
if (edge.targetHandle) {
|
|
496
|
+
handles.add(edge.targetHandle);
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
return handles;
|
|
500
|
+
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -70,6 +70,30 @@ export interface NodePort {
|
|
|
70
70
|
description?: string;
|
|
71
71
|
defaultValue?: unknown;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Dynamic port configuration for user-defined inputs/outputs
|
|
75
|
+
* These are defined in the node's config and allow users to create
|
|
76
|
+
* custom input/output handles at runtime similar to gateway branches
|
|
77
|
+
*/
|
|
78
|
+
export interface DynamicPort {
|
|
79
|
+
/** Unique identifier for the port (used for handle IDs and connections) */
|
|
80
|
+
name: string;
|
|
81
|
+
/** Display label shown in the UI */
|
|
82
|
+
label: string;
|
|
83
|
+
/** Description of what this port accepts/provides */
|
|
84
|
+
description?: string;
|
|
85
|
+
/** Data type for the port (affects color and connection validation) */
|
|
86
|
+
dataType: NodeDataType;
|
|
87
|
+
/** Whether this port is required for execution */
|
|
88
|
+
required?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Convert a DynamicPort to a NodePort
|
|
92
|
+
* @param port - The dynamic port configuration
|
|
93
|
+
* @param portType - Whether this is an input or output port
|
|
94
|
+
* @returns A NodePort compatible with the rendering system
|
|
95
|
+
*/
|
|
96
|
+
export declare function dynamicPortToNodePort(port: DynamicPort, portType: 'input' | 'output'): NodePort;
|
|
73
97
|
/**
|
|
74
98
|
* Built-in node types for explicit component rendering.
|
|
75
99
|
* These are the node types that ship with FlowDrop.
|
|
@@ -92,6 +116,48 @@ export type BuiltinNodeType = 'note' | 'simple' | 'square' | 'tool' | 'gateway'
|
|
|
92
116
|
* ```
|
|
93
117
|
*/
|
|
94
118
|
export type NodeType = BuiltinNodeType | (string & Record<never, never>);
|
|
119
|
+
/**
|
|
120
|
+
* UI-related extension settings for nodes
|
|
121
|
+
* Used to control visual behavior in the workflow editor
|
|
122
|
+
*/
|
|
123
|
+
export interface NodeUIExtensions {
|
|
124
|
+
/** Show/hide unconnected handles (ports) to reduce visual noise */
|
|
125
|
+
hideUnconnectedHandles?: boolean;
|
|
126
|
+
/** Custom styles or theme overrides */
|
|
127
|
+
style?: Record<string, unknown>;
|
|
128
|
+
/** Any other UI-specific settings */
|
|
129
|
+
[key: string]: unknown;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Custom extension properties for 3rd party integrations
|
|
133
|
+
* Allows storing additional configuration and UI state data
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const extensions: NodeExtensions = {
|
|
138
|
+
* ui: {
|
|
139
|
+
* hideUnconnectedHandles: true,
|
|
140
|
+
* style: { opacity: 0.8 }
|
|
141
|
+
* },
|
|
142
|
+
* "myapp:analytics": {
|
|
143
|
+
* trackUsage: true,
|
|
144
|
+
* customField: "value"
|
|
145
|
+
* }
|
|
146
|
+
* };
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export interface NodeExtensions {
|
|
150
|
+
/**
|
|
151
|
+
* UI-related settings for the node
|
|
152
|
+
* Used to control visual behavior in the workflow editor
|
|
153
|
+
*/
|
|
154
|
+
ui?: NodeUIExtensions;
|
|
155
|
+
/**
|
|
156
|
+
* Namespaced extension data from 3rd party integrations
|
|
157
|
+
* Use your package/organization name as the key (e.g., "myapp", "acme:analyzer")
|
|
158
|
+
*/
|
|
159
|
+
[namespace: string]: unknown;
|
|
160
|
+
}
|
|
95
161
|
/**
|
|
96
162
|
* Node configuration metadata
|
|
97
163
|
*/
|
|
@@ -115,6 +181,11 @@ export interface NodeMetadata {
|
|
|
115
181
|
outputs: NodePort[];
|
|
116
182
|
configSchema?: ConfigSchema;
|
|
117
183
|
tags?: string[];
|
|
184
|
+
/**
|
|
185
|
+
* Custom extension properties for 3rd party integrations
|
|
186
|
+
* Allows storing additional configuration and UI state data at the node type level
|
|
187
|
+
*/
|
|
188
|
+
extensions?: NodeExtensions;
|
|
118
189
|
}
|
|
119
190
|
/**
|
|
120
191
|
* Common base interface for all schema properties
|
|
@@ -265,6 +336,12 @@ export interface WorkflowNode extends Node {
|
|
|
265
336
|
nodeId?: string;
|
|
266
337
|
/** Node execution tracking information */
|
|
267
338
|
executionInfo?: NodeExecutionInfo;
|
|
339
|
+
/**
|
|
340
|
+
* Per-instance extension properties for 3rd party integrations
|
|
341
|
+
* Overrides or extends the node type extensions defined in metadata.extensions
|
|
342
|
+
* Use for instance-specific UI states or custom data
|
|
343
|
+
*/
|
|
344
|
+
extensions?: NodeExtensions;
|
|
268
345
|
};
|
|
269
346
|
}
|
|
270
347
|
/**
|
package/dist/types/index.js
CHANGED
|
@@ -2,3 +2,19 @@
|
|
|
2
2
|
* Core types for the Workflow Library
|
|
3
3
|
*/
|
|
4
4
|
import { ConnectionLineType } from '@xyflow/svelte';
|
|
5
|
+
/**
|
|
6
|
+
* Convert a DynamicPort to a NodePort
|
|
7
|
+
* @param port - The dynamic port configuration
|
|
8
|
+
* @param portType - Whether this is an input or output port
|
|
9
|
+
* @returns A NodePort compatible with the rendering system
|
|
10
|
+
*/
|
|
11
|
+
export function dynamicPortToNodePort(port, portType) {
|
|
12
|
+
return {
|
|
13
|
+
id: port.name,
|
|
14
|
+
name: port.label,
|
|
15
|
+
type: portType,
|
|
16
|
+
dataType: port.dataType,
|
|
17
|
+
required: port.required ?? false,
|
|
18
|
+
description: port.description
|
|
19
|
+
};
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@d34dman/flowdrop",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.23",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite dev",
|
|
8
8
|
"build": "vite build && npm run prepack",
|
|
@@ -125,7 +125,8 @@
|
|
|
125
125
|
"vite": "^6.2.6",
|
|
126
126
|
"vite-plugin-devtools-json": "^0.2.1",
|
|
127
127
|
"vitest": "^3.2.3",
|
|
128
|
-
"vitest-browser-svelte": "^0.1.0"
|
|
128
|
+
"vitest-browser-svelte": "^0.1.0",
|
|
129
|
+
"@types/uuid": "^10.0.0"
|
|
129
130
|
},
|
|
130
131
|
"overrides": {
|
|
131
132
|
"@sveltejs/kit": {
|
|
@@ -136,7 +137,6 @@
|
|
|
136
137
|
"svelte"
|
|
137
138
|
],
|
|
138
139
|
"dependencies": {
|
|
139
|
-
"@types/uuid": "^10.0.0",
|
|
140
140
|
"@xyflow/svelte": "~1.2",
|
|
141
141
|
"marked": "^16.1.1",
|
|
142
142
|
"svelte-5-french-toast": "^2.0.6",
|
package/dist/config/demo.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Demo configuration for FlowDrop UI
|
|
3
|
-
* Controls which nodes and workflows are shown in demo mode
|
|
4
|
-
*/
|
|
5
|
-
import type { DemoConfig } from '../data/samples.js';
|
|
6
|
-
/**
|
|
7
|
-
* Default demo configuration
|
|
8
|
-
* Change this to enable/disable demo mode and control what's shown
|
|
9
|
-
*/
|
|
10
|
-
export declare const defaultDemoConfig: DemoConfig;
|
|
11
|
-
/**
|
|
12
|
-
* Demo mode presets for different scenarios
|
|
13
|
-
*/
|
|
14
|
-
export declare const demoPresets: Record<string, DemoConfig>;
|
|
15
|
-
/**
|
|
16
|
-
* Get the current demo configuration
|
|
17
|
-
* You can modify this function to read from localStorage, URL params, etc.
|
|
18
|
-
*/
|
|
19
|
-
export declare function getCurrentDemoConfig(): DemoConfig;
|
|
20
|
-
/**
|
|
21
|
-
* Set demo configuration (for future use with UI controls)
|
|
22
|
-
*/
|
|
23
|
-
export declare function setDemoConfig(config: DemoConfig): void;
|
|
24
|
-
/**
|
|
25
|
-
* Load demo configuration from localStorage
|
|
26
|
-
*/
|
|
27
|
-
export declare function loadDemoConfig(): DemoConfig;
|
|
28
|
-
/**
|
|
29
|
-
* Demo workflow configuration
|
|
30
|
-
*/
|
|
31
|
-
export declare const demoWorkflowConfig: {
|
|
32
|
-
defaultWorkflow: string;
|
|
33
|
-
autoLoadDemo: boolean;
|
|
34
|
-
sampleWorkflowName: string;
|
|
35
|
-
sampleWorkflowDescription: string;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Demo instructions for non-technical users
|
|
39
|
-
*/
|
|
40
|
-
export declare const demoInstructions: {
|
|
41
|
-
title: string;
|
|
42
|
-
description: string;
|
|
43
|
-
steps: ({
|
|
44
|
-
step: number;
|
|
45
|
-
title: string;
|
|
46
|
-
description: string;
|
|
47
|
-
example: string;
|
|
48
|
-
note?: undefined;
|
|
49
|
-
} | {
|
|
50
|
-
step: number;
|
|
51
|
-
title: string;
|
|
52
|
-
description: string;
|
|
53
|
-
note: string;
|
|
54
|
-
example?: undefined;
|
|
55
|
-
})[];
|
|
56
|
-
benefits: string[];
|
|
57
|
-
useCases: string[];
|
|
58
|
-
};
|
package/dist/config/demo.js
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Demo configuration for FlowDrop UI
|
|
3
|
-
* Controls which nodes and workflows are shown in demo mode
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Default demo configuration
|
|
7
|
-
* Change this to enable/disable demo mode and control what's shown
|
|
8
|
-
*/
|
|
9
|
-
export const defaultDemoConfig = {
|
|
10
|
-
enabled: true, // Set to true to enable demo mode
|
|
11
|
-
mode: 'content-management' // Show only whitelisted content management nodes
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Demo mode presets for different scenarios
|
|
15
|
-
*/
|
|
16
|
-
export const demoPresets = {
|
|
17
|
-
// Content management demo mode - show only whitelisted nodes
|
|
18
|
-
'content-management': {
|
|
19
|
-
enabled: true,
|
|
20
|
-
mode: 'content-management'
|
|
21
|
-
},
|
|
22
|
-
// Show all nodes (disable demo filtering)
|
|
23
|
-
'all-nodes': {
|
|
24
|
-
enabled: false,
|
|
25
|
-
mode: 'all'
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Get the current demo configuration
|
|
30
|
-
* You can modify this function to read from localStorage, URL params, etc.
|
|
31
|
-
*/
|
|
32
|
-
export function getCurrentDemoConfig() {
|
|
33
|
-
// For now, return the default config
|
|
34
|
-
// In the future, this could check localStorage or URL parameters
|
|
35
|
-
return defaultDemoConfig;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Set demo configuration (for future use with UI controls)
|
|
39
|
-
*/
|
|
40
|
-
export function setDemoConfig(config) {
|
|
41
|
-
// Store in localStorage for persistence
|
|
42
|
-
if (typeof localStorage !== 'undefined') {
|
|
43
|
-
localStorage.setItem('flowdrop-demo-config', JSON.stringify(config));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Load demo configuration from localStorage
|
|
48
|
-
*/
|
|
49
|
-
export function loadDemoConfig() {
|
|
50
|
-
if (typeof localStorage !== 'undefined') {
|
|
51
|
-
const stored = localStorage.getItem('flowdrop-demo-config');
|
|
52
|
-
if (stored) {
|
|
53
|
-
try {
|
|
54
|
-
return JSON.parse(stored);
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
// Fall back to default if parsing fails
|
|
58
|
-
return defaultDemoConfig;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return defaultDemoConfig;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Demo workflow configuration
|
|
66
|
-
*/
|
|
67
|
-
export const demoWorkflowConfig = {
|
|
68
|
-
// Which workflow to show by default in demo mode
|
|
69
|
-
defaultWorkflow: 'sample', // Use sample workflow for now
|
|
70
|
-
// Whether to auto-load a workflow on startup
|
|
71
|
-
autoLoadDemo: false,
|
|
72
|
-
// Sample workflow is used in demo mode
|
|
73
|
-
sampleWorkflowName: 'Simple Chat Workflow',
|
|
74
|
-
sampleWorkflowDescription: 'A basic workflow demonstrating direct text input to AI model response'
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Demo instructions for non-technical users
|
|
78
|
-
*/
|
|
79
|
-
export const demoInstructions = {
|
|
80
|
-
title: 'Multi-Agent Workflow Demo',
|
|
81
|
-
description: 'This demo shows how FlowDrop uses multiple AI agents working together to process and manage data workflows.',
|
|
82
|
-
steps: [
|
|
83
|
-
{
|
|
84
|
-
step: 1,
|
|
85
|
-
title: 'User Input',
|
|
86
|
-
description: 'Start by providing input data or instructions to the main agent.',
|
|
87
|
-
example: 'Analyze and process the provided dataset'
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
step: 2,
|
|
91
|
-
title: 'Main Agent Orchestration',
|
|
92
|
-
description: 'The main conversational agent understands your request and coordinates with specialized sub-agents.',
|
|
93
|
-
note: 'Acts as the intelligent orchestrator of the entire workflow'
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
step: 3,
|
|
97
|
-
title: 'Data Analysis Agent',
|
|
98
|
-
description: 'Specialized agent analyzes data using search and processing tools to find and examine relevant information.',
|
|
99
|
-
note: 'Uses connected data sources and search tools for intelligent data discovery'
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
step: 4,
|
|
103
|
-
title: 'Data Processing Agent',
|
|
104
|
-
description: 'Specialized agent processes and transforms data using available tools and formatters.',
|
|
105
|
-
note: 'Has access to multiple tools and makes tracked transformations'
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
step: 5,
|
|
109
|
-
title: 'Tool Integration',
|
|
110
|
-
description: 'Sub-agents use specialized tools for data processing, formatting, and transformation.',
|
|
111
|
-
note: "Tools are connected via special 'tool' interface ports"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
step: 6,
|
|
115
|
-
title: 'Agent Collaboration',
|
|
116
|
-
description: 'Sub-agents report back to the main agent with their findings and completed work.',
|
|
117
|
-
note: 'Multi-agent coordination ensures comprehensive task completion'
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
step: 7,
|
|
121
|
-
title: 'Orchestrated Response',
|
|
122
|
-
description: 'Main agent compiles results from all sub-agents and provides a comprehensive response.',
|
|
123
|
-
note: 'Includes summaries, results, and next steps for review'
|
|
124
|
-
}
|
|
125
|
-
],
|
|
126
|
-
benefits: [
|
|
127
|
-
'Multi-agent collaboration for complex tasks',
|
|
128
|
-
'Specialized agents for specific data processing functions',
|
|
129
|
-
'Intelligent task orchestration and coordination',
|
|
130
|
-
'Tool-based architecture for extensibility',
|
|
131
|
-
'Human oversight through review process',
|
|
132
|
-
'Scalable agent-to-agent communication patterns'
|
|
133
|
-
],
|
|
134
|
-
useCases: [
|
|
135
|
-
'Multi-agent data analysis and processing',
|
|
136
|
-
'Coordinated data transformation workflows',
|
|
137
|
-
'Agent-orchestrated data quality checks',
|
|
138
|
-
'Collaborative data processing pipelines',
|
|
139
|
-
'Tool-assisted bulk data operations',
|
|
140
|
-
'Intelligent workflow automation'
|
|
141
|
-
]
|
|
142
|
-
};
|
package/dist/data/samples.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sample data for FlowDrop development and testing
|
|
3
|
-
* Includes sample nodes and workflows for demonstration and testing purposes
|
|
4
|
-
*/
|
|
5
|
-
import type { NodeMetadata, Workflow } from '../types/index.js';
|
|
6
|
-
import { CATEGORY_ICONS } from '../utils/icons.js';
|
|
7
|
-
/**
|
|
8
|
-
* Sample node data for development and testing
|
|
9
|
-
* These represent the available node types in the workflow editor
|
|
10
|
-
*/
|
|
11
|
-
export declare const sampleNodes: NodeMetadata[];
|
|
12
|
-
export { CATEGORY_ICONS as categoryIcons };
|
|
13
|
-
/**
|
|
14
|
-
* Demo mode configuration
|
|
15
|
-
*/
|
|
16
|
-
export interface DemoConfig {
|
|
17
|
-
enabled: boolean;
|
|
18
|
-
mode: 'content-management' | 'all';
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Filter nodes based on demo configuration
|
|
22
|
-
* @param nodes - All available nodes
|
|
23
|
-
* @param config - Demo configuration
|
|
24
|
-
* @returns Filtered array of nodes
|
|
25
|
-
*/
|
|
26
|
-
export declare function filterNodesForDemo(nodes: NodeMetadata[], config: DemoConfig): NodeMetadata[];
|
|
27
|
-
/**
|
|
28
|
-
* Get the list of allowed demo node IDs
|
|
29
|
-
*/
|
|
30
|
-
export declare function getDemoAllowedNodeIds(): string[];
|
|
31
|
-
/**
|
|
32
|
-
* Check if a node is allowed in demo mode
|
|
33
|
-
*/
|
|
34
|
-
export declare function isNodeAllowedInDemo(nodeId: string): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Get demo-specific nodes only
|
|
37
|
-
*/
|
|
38
|
-
export declare function getDemoNodes(): NodeMetadata[];
|
|
39
|
-
/**
|
|
40
|
-
* Get nodes by category with demo filtering
|
|
41
|
-
*/
|
|
42
|
-
export declare function getNodesByCategory(category: string, demoConfig?: DemoConfig): NodeMetadata[];
|
|
43
|
-
/**
|
|
44
|
-
* Search nodes with demo filtering
|
|
45
|
-
*/
|
|
46
|
-
export declare function searchNodes(query: string, demoConfig?: DemoConfig): NodeMetadata[];
|
|
47
|
-
/**
|
|
48
|
-
* Sample workflow for development
|
|
49
|
-
* Updated to use the new node types
|
|
50
|
-
*/
|
|
51
|
-
export declare const sampleWorkflow: Workflow;
|