@flowdrop/flowdrop 2.0.0-beta.4 → 2.0.0-beta.6
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 +35 -0
- package/dist/adapters/WorkflowAdapter.js +4 -5
- package/dist/adapters/agentspec/AgentSpecAdapter.js +3 -3
- package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
- package/dist/commands/executor.js +5 -6
- package/dist/commands/types.js +5 -5
- package/dist/components/App.svelte +5 -14
- package/dist/components/ConfigForm.svelte +6 -505
- package/dist/components/ConfigForm.svelte.d.ts +4 -6
- package/dist/components/ConfigModal.svelte +0 -1
- package/dist/components/NodeSidebar.svelte +4 -4
- package/dist/components/NodeSwapPicker.svelte +2 -2
- package/dist/components/UniversalNode.svelte +5 -4
- package/dist/components/UniversalNode.svelte.d.ts +1 -1
- package/dist/components/console/ConsoleInput.svelte +3 -3
- package/dist/components/form/FormField.svelte +15 -0
- package/dist/components/form/FormFieldLight.svelte +14 -0
- package/dist/components/form/FormPorts.svelte +262 -0
- package/dist/components/form/FormPorts.svelte.d.ts +13 -0
- package/dist/components/nodes/AtomNode.svelte +16 -42
- package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
- package/dist/components/nodes/GatewayNode.svelte +26 -65
- package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
- package/dist/components/nodes/IdeaNode.svelte +10 -8
- package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
- package/dist/components/nodes/NotesNode.svelte +6 -4
- package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
- package/dist/components/nodes/SimpleNode.svelte +31 -55
- package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
- package/dist/components/nodes/SquareNode.svelte +31 -55
- package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
- package/dist/components/nodes/TerminalNode.svelte +34 -38
- package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
- package/dist/components/nodes/ToolNode.svelte +10 -8
- package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
- package/dist/components/nodes/WorkflowNode.svelte +43 -93
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
- package/dist/components/playground/PipelineKanbanView.svelte +2 -2
- package/dist/components/playground/PipelineTableView.svelte +2 -2
- package/dist/core/index.d.ts +1 -1
- package/dist/helpers/workflowEditorHelper.js +4 -5
- package/dist/openapi/v1/openapi.yaml +33 -21
- package/dist/registry/nodeComponentRegistry.d.ts +2 -1
- package/dist/schemas/v1/workflow.schema.json +16 -14
- package/dist/services/dynamicSchemaService.d.ts +2 -2
- package/dist/services/dynamicSchemaService.js +8 -8
- package/dist/stores/playgroundStore.svelte.js +1 -1
- package/dist/stores/workflowStore.svelte.d.ts +1 -1
- package/dist/stores/workflowStore.svelte.js +1 -19
- package/dist/types/index.d.ts +51 -27
- package/dist/utils/colors.d.ts +27 -0
- package/dist/utils/colors.js +23 -0
- package/dist/utils/connections.js +6 -6
- package/dist/utils/nodeIds.d.ts +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeSwap.js +3 -6
- package/dist/utils/portUtils.d.ts +47 -11
- package/dist/utils/portUtils.js +67 -14
- package/package.json +1 -1
|
@@ -4,31 +4,32 @@
|
|
|
4
4
|
Uses SvelteFlow's Handle for connection ports
|
|
5
5
|
Styled with BEM syntax
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
-
|
|
7
|
+
Port rendering:
|
|
8
|
+
- Exposure (data.config.ports, falling back to each port's exposedByDefault)
|
|
9
|
+
decides which ports render — a not-exposed port is hidden.
|
|
10
|
+
- Order: data.config.ports order overrides the metadata default (displayOrder);
|
|
11
|
+
cosmetic only, no effect on execution.
|
|
11
12
|
-->
|
|
12
13
|
|
|
13
14
|
<script lang="ts">
|
|
14
15
|
import { Position, Handle } from '@xyflow/svelte';
|
|
15
|
-
import type { WorkflowNode,
|
|
16
|
+
import type { WorkflowNode, DynamicPort, PortsConfig } from '../../types/index.js';
|
|
16
17
|
import { dynamicPortToNodePort } from '../../types/index.js';
|
|
17
18
|
import Icon from '@iconify/svelte';
|
|
18
19
|
import { getNodeIcon } from '../../utils/icons.js';
|
|
19
20
|
import NodeConfigButton from './NodeConfigButton.svelte';
|
|
20
21
|
import {
|
|
21
|
-
getDataTypeColorToken,
|
|
22
22
|
getCategoryColorToken,
|
|
23
|
-
|
|
23
|
+
getPortColorToken,
|
|
24
|
+
getPortBackgroundColorForPort
|
|
24
25
|
} from '../../utils/colors.js';
|
|
25
26
|
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
26
|
-
import {
|
|
27
|
+
import { orderPortsFor, isPortVisible } from '../../utils/portUtils.js';
|
|
27
28
|
import { m } from '../../messages/index.js';
|
|
28
29
|
|
|
29
30
|
interface Props {
|
|
31
|
+
id: string;
|
|
30
32
|
data: WorkflowNode['data'] & {
|
|
31
|
-
nodeId?: string;
|
|
32
33
|
onConfigOpen?: (node: { id: string; type: string; data: WorkflowNode['data'] }) => void;
|
|
33
34
|
};
|
|
34
35
|
selected?: boolean;
|
|
@@ -61,30 +62,11 @@
|
|
|
61
62
|
);
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
65
|
+
* Per-instance port order + exposure, in config. Order overrides the metadata
|
|
66
|
+
* default; exposure is semantic (a not-exposed port is hidden, not wireable,
|
|
67
|
+
* not runtime-overridable).
|
|
66
68
|
*/
|
|
67
|
-
const
|
|
68
|
-
props.data.extensions?.ui?.hideUnconnectedHandles ??
|
|
69
|
-
props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ??
|
|
70
|
-
false
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Get the portOrder setting from extensions (visual-only, no effect on execution)
|
|
75
|
-
* Merges node type defaults with instance overrides
|
|
76
|
-
*/
|
|
77
|
-
const portOrder = $derived(
|
|
78
|
-
props.data.extensions?.ui?.portOrder ?? props.data.metadata?.extensions?.ui?.portOrder ?? {}
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Get the hiddenPorts setting from extensions (visual-only, no effect on execution)
|
|
83
|
-
* Merges node type defaults with instance overrides
|
|
84
|
-
*/
|
|
85
|
-
const hiddenPorts = $derived(
|
|
86
|
-
props.data.extensions?.ui?.hiddenPorts ?? props.data.metadata?.extensions?.ui?.hiddenPorts ?? {}
|
|
87
|
-
);
|
|
69
|
+
const portsConfig = $derived((props.data.config?.ports as PortsConfig | undefined) ?? {});
|
|
88
70
|
|
|
89
71
|
/**
|
|
90
72
|
* Dynamic inputs from config - user-defined input ports
|
|
@@ -108,61 +90,32 @@
|
|
|
108
90
|
|
|
109
91
|
/**
|
|
110
92
|
* Combined input ports: static metadata inputs + dynamic config inputs,
|
|
111
|
-
*
|
|
93
|
+
* in effective order (metadata default, then config override; cosmetic).
|
|
112
94
|
*/
|
|
113
95
|
const allInputPorts = $derived(
|
|
114
|
-
|
|
96
|
+
orderPortsFor([...props.data.metadata.inputs, ...dynamicInputs], portsConfig.inputs)
|
|
115
97
|
);
|
|
116
98
|
|
|
117
99
|
/**
|
|
118
100
|
* Combined output ports: static metadata outputs + dynamic config outputs,
|
|
119
|
-
*
|
|
101
|
+
* in effective order (metadata default, then config override; cosmetic).
|
|
120
102
|
*/
|
|
121
103
|
const allOutputPorts = $derived(
|
|
122
|
-
|
|
104
|
+
orderPortsFor([...props.data.metadata.outputs, ...dynamicOutputs], portsConfig.outputs)
|
|
123
105
|
);
|
|
124
106
|
|
|
125
107
|
/**
|
|
126
|
-
*
|
|
127
|
-
* @param port - The port to check
|
|
128
|
-
* @param type - Whether this is an 'input' or 'output' port
|
|
129
|
-
* @returns true if the port should be visible
|
|
108
|
+
* Derived list of exposed input ports (static + dynamic).
|
|
130
109
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
type === 'input'
|
|
135
|
-
? hiddenPorts.inputs?.includes(port.id)
|
|
136
|
-
: hiddenPorts.outputs?.includes(port.id);
|
|
137
|
-
if (manuallyHidden) return false;
|
|
138
|
-
|
|
139
|
-
// Always show if hideUnconnectedHandles is disabled
|
|
140
|
-
if (!hideUnconnectedHandles) {
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Always show required ports
|
|
145
|
-
if (port.required) {
|
|
146
|
-
return true;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Check if port is connected
|
|
150
|
-
const handleId = `${props.data.nodeId}-${type}-${port.id}`;
|
|
151
|
-
return fd.workflow.connectedHandles.has(handleId);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Derived list of visible input ports based on hideUnconnectedHandles setting
|
|
156
|
-
* Now includes both static and dynamic inputs
|
|
157
|
-
*/
|
|
158
|
-
const visibleInputPorts = $derived(allInputPorts.filter((port) => isPortVisible(port, 'input')));
|
|
110
|
+
const visibleInputPorts = $derived(
|
|
111
|
+
allInputPorts.filter((port) => isPortVisible(port, 'input', portsConfig))
|
|
112
|
+
);
|
|
159
113
|
|
|
160
114
|
/**
|
|
161
|
-
* Derived list of
|
|
162
|
-
* Now includes both static and dynamic outputs
|
|
115
|
+
* Derived list of exposed output ports (static + dynamic).
|
|
163
116
|
*/
|
|
164
117
|
const visibleOutputPorts = $derived(
|
|
165
|
-
allOutputPorts.filter((port) => isPortVisible(port, 'output'))
|
|
118
|
+
allOutputPorts.filter((port) => isPortVisible(port, 'output', portsConfig))
|
|
166
119
|
);
|
|
167
120
|
|
|
168
121
|
/**
|
|
@@ -179,7 +132,7 @@
|
|
|
179
132
|
if (props.data.onConfigOpen) {
|
|
180
133
|
// Create a WorkflowNodeType-like object for the global ConfigSidebar
|
|
181
134
|
const nodeForConfig = {
|
|
182
|
-
id: props.
|
|
135
|
+
id: props.id,
|
|
183
136
|
type: 'workflowNode',
|
|
184
137
|
data: props.data
|
|
185
138
|
};
|
|
@@ -201,7 +154,7 @@
|
|
|
201
154
|
}}
|
|
202
155
|
data-handle-interaction={isHandleInteraction}
|
|
203
156
|
aria-label={graph.workflowNode({ name: props.data.metadata.name })}
|
|
204
|
-
aria-describedby="node-description-{props.
|
|
157
|
+
aria-describedby="node-description-{props.id}"
|
|
205
158
|
>
|
|
206
159
|
<!-- Default Node Header: expands in multiples of 10 (title row 40px + gap 10px + description 20px per line) -->
|
|
207
160
|
<div class="flowdrop-workflow-node__header">
|
|
@@ -231,10 +184,7 @@
|
|
|
231
184
|
<div class="flowdrop-flex flowdrop-gap--2 flowdrop-items--center"></div>
|
|
232
185
|
</div>
|
|
233
186
|
<!-- Node Description - line-height 20px so header grows in steps of 10 -->
|
|
234
|
-
<p
|
|
235
|
-
class="flowdrop-workflow-node__header-desc"
|
|
236
|
-
id="node-description-{props.data.nodeId || 'unknown'}"
|
|
237
|
-
>
|
|
187
|
+
<p class="flowdrop-workflow-node__header-desc" id="node-description-{props.id}">
|
|
238
188
|
{displayDescription}
|
|
239
189
|
</p>
|
|
240
190
|
</div>
|
|
@@ -249,11 +199,11 @@
|
|
|
249
199
|
<Handle
|
|
250
200
|
type="target"
|
|
251
201
|
position={Position.Left}
|
|
252
|
-
id={`${props.
|
|
202
|
+
id={`${props.id}-input-${port.id}`}
|
|
253
203
|
class="flowdrop-workflow-node__handle"
|
|
254
|
-
style="top: var(--fd-node-port-row-height); transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {
|
|
204
|
+
style="top: var(--fd-node-port-row-height); transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
255
205
|
checker,
|
|
256
|
-
port
|
|
206
|
+
port
|
|
257
207
|
)}); --fd-handle-border-color: var(--fd-handle-border);"
|
|
258
208
|
tabindex={-1}
|
|
259
209
|
/>
|
|
@@ -264,14 +214,14 @@
|
|
|
264
214
|
<span class="flowdrop-text--xs flowdrop-font--medium">{port.name}</span>
|
|
265
215
|
<span
|
|
266
216
|
class="flowdrop-badge flowdrop-badge--sm"
|
|
267
|
-
style="background-color: {
|
|
217
|
+
style="background-color: {getPortBackgroundColorForPort(
|
|
268
218
|
checker,
|
|
269
|
-
port
|
|
219
|
+
port,
|
|
270
220
|
15
|
|
271
|
-
)}; color: {
|
|
221
|
+
)}; color: {getPortColorToken(
|
|
272
222
|
checker,
|
|
273
|
-
port
|
|
274
|
-
)}; border: 1px solid {
|
|
223
|
+
port
|
|
224
|
+
)}; border: 1px solid {getPortBackgroundColorForPort(checker, port, 30)};"
|
|
275
225
|
>
|
|
276
226
|
{port.dataType}
|
|
277
227
|
</span>
|
|
@@ -307,14 +257,14 @@
|
|
|
307
257
|
<span class="flowdrop-text--xs flowdrop-font--medium">{port.name}</span>
|
|
308
258
|
<span
|
|
309
259
|
class="flowdrop-badge flowdrop-badge--sm"
|
|
310
|
-
style="background-color: {
|
|
260
|
+
style="background-color: {getPortBackgroundColorForPort(
|
|
311
261
|
checker,
|
|
312
|
-
port
|
|
262
|
+
port,
|
|
313
263
|
15
|
|
314
|
-
)}; color: {
|
|
264
|
+
)}; color: {getPortColorToken(
|
|
315
265
|
checker,
|
|
316
|
-
port
|
|
317
|
-
)}; border: 1px solid {
|
|
266
|
+
port
|
|
267
|
+
)}; border: 1px solid {getPortBackgroundColorForPort(checker, port, 30)};"
|
|
318
268
|
>
|
|
319
269
|
{port.dataType}
|
|
320
270
|
</span>
|
|
@@ -330,11 +280,11 @@
|
|
|
330
280
|
<Handle
|
|
331
281
|
type="source"
|
|
332
282
|
position={Position.Right}
|
|
333
|
-
id={`${props.
|
|
283
|
+
id={`${props.id}-output-${port.id}`}
|
|
334
284
|
class="flowdrop-workflow-node__handle"
|
|
335
|
-
style="top: var(--fd-node-port-row-height); transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {
|
|
285
|
+
style="top: var(--fd-node-port-row-height); transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
336
286
|
checker,
|
|
337
|
-
port
|
|
287
|
+
port
|
|
338
288
|
)}); --fd-handle-border-color: var(--fd-handle-border);"
|
|
339
289
|
tabindex={-1}
|
|
340
290
|
/>
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
nodesByColumn.get(colKey)?.push({
|
|
109
109
|
key: job.id,
|
|
110
110
|
label: job.label || node.data.label,
|
|
111
|
-
typeId: node.data.metadata.
|
|
111
|
+
typeId: node.data.metadata.node_type_id,
|
|
112
112
|
status,
|
|
113
113
|
durationUs: job.executionTimeUs
|
|
114
114
|
});
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
nodesByColumn.get(colKey)?.push({
|
|
123
123
|
key: node.id,
|
|
124
124
|
label: node.data.label,
|
|
125
|
-
typeId: node.data.metadata.
|
|
125
|
+
typeId: node.data.metadata.node_type_id,
|
|
126
126
|
status
|
|
127
127
|
});
|
|
128
128
|
}
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
jobRows.push({
|
|
112
112
|
key: job.id,
|
|
113
113
|
label: job.label || node.data.label,
|
|
114
|
-
typeId: node.data.metadata.
|
|
114
|
+
typeId: node.data.metadata.node_type_id,
|
|
115
115
|
nodeId: job.nodeId,
|
|
116
116
|
status: resolveStatus({ status: job.status }),
|
|
117
117
|
started: job.started,
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
return {
|
|
138
138
|
key: node.id,
|
|
139
139
|
label: node.data.label,
|
|
140
|
-
typeId: node.data.metadata.
|
|
140
|
+
typeId: node.data.metadata.node_type_id,
|
|
141
141
|
nodeId: node.id,
|
|
142
142
|
status: resolveStatus(statusData),
|
|
143
143
|
started: statusData?.last_executed,
|
package/dist/core/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export type { WorkflowFormat, BuiltinWorkflowFormat } from '../types/index.js';
|
|
18
18
|
export { DEFAULT_WORKFLOW_FORMAT } from '../types/index.js';
|
|
19
|
-
export type { NodeCategory, BuiltinNodeCategory, CategoryDefinition, NodeDataType, NodePort, DynamicPort, Branch, NodeMetadata, NodeExtensions, NodeUIExtensions, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType, PortConfig, PortCompatibilityRule, ConfigSchema, ConfigProperty, HttpMethod, DynamicSchemaEndpoint, ExternalEditLink, ConfigEditOptions, EdgeCategory, UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement } from '../types/index.js';
|
|
19
|
+
export type { NodeCategory, BuiltinNodeCategory, CategoryDefinition, NodeDataType, NodePort, DynamicPort, Branch, NodeMetadata, NodeExtensions, NodeUIExtensions, PortsConfig, PortConfigEntry, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType, PortConfig, PortCompatibilityRule, ConfigSchema, ConfigProperty, HttpMethod, DynamicSchemaEndpoint, ExternalEditLink, ConfigEditOptions, EdgeCategory, UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement } from '../types/index.js';
|
|
20
20
|
export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup } from '../types/index.js';
|
|
21
21
|
export type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, ExecutionConfig, StorageConfig } from '../types/config.js';
|
|
22
22
|
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from '../types/auth.js';
|
|
@@ -63,7 +63,7 @@ export class NodeOperationsHelper {
|
|
|
63
63
|
// Use fallback sample nodes
|
|
64
64
|
return [
|
|
65
65
|
{
|
|
66
|
-
|
|
66
|
+
node_type_id: 'text-input',
|
|
67
67
|
name: 'Text Input',
|
|
68
68
|
category: 'inputs',
|
|
69
69
|
description: 'Simple text input field',
|
|
@@ -73,7 +73,7 @@ export class NodeOperationsHelper {
|
|
|
73
73
|
outputs: [{ id: 'text', name: 'text', type: 'output', dataType: 'string' }]
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
|
-
|
|
76
|
+
node_type_id: 'text-output',
|
|
77
77
|
name: 'Text Output',
|
|
78
78
|
category: 'outputs',
|
|
79
79
|
description: 'Display text output',
|
|
@@ -128,7 +128,7 @@ export class NodeOperationsHelper {
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
// Generate node ID based on node type and existing nodes
|
|
131
|
-
const newNodeId = generateNodeId(nodeType.
|
|
131
|
+
const newNodeId = generateNodeId(nodeType.node_type_id, existingNodes);
|
|
132
132
|
// All nodes use "universalNode" type
|
|
133
133
|
// UniversalNode component handles internal switching based on metadata and config
|
|
134
134
|
const newNode = {
|
|
@@ -137,8 +137,7 @@ export class NodeOperationsHelper {
|
|
|
137
137
|
position, // Use the position calculated from the drop event
|
|
138
138
|
deletable: true,
|
|
139
139
|
data: {
|
|
140
|
-
...nodeData
|
|
141
|
-
nodeId: newNodeId // Use the same ID
|
|
140
|
+
...nodeData
|
|
142
141
|
}
|
|
143
142
|
};
|
|
144
143
|
return newNode;
|
|
@@ -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
|
|
@@ -16,9 +16,10 @@ import { BaseRegistry } from './BaseRegistry.svelte.js';
|
|
|
16
16
|
* Any component registered in the registry must be compatible with these props.
|
|
17
17
|
*/
|
|
18
18
|
export interface NodeComponentProps {
|
|
19
|
+
/** The SvelteFlow node id */
|
|
20
|
+
id: string;
|
|
19
21
|
/** Node data containing label, config, metadata, executionInfo */
|
|
20
22
|
data: WorkflowNode['data'] & {
|
|
21
|
-
nodeId?: string;
|
|
22
23
|
onConfigOpen?: (node: {
|
|
23
24
|
id: string;
|
|
24
25
|
type: string;
|
|
@@ -560,9 +560,9 @@
|
|
|
560
560
|
},
|
|
561
561
|
"NodeMetadata": {
|
|
562
562
|
"type": "object",
|
|
563
|
-
"description": "Complete metadata for a node type including ports, configuration schema, and extensions.\n\n## Dynamic Port Support\n\nNodes can support user-defined dynamic ports through their configSchema:\n- Add `dynamicInputs` array property to allow custom input handles\n- Add `dynamicOutputs` array property to allow custom output handles\n- Add `branches` array property for gateway nodes with conditional paths\n\n## Extensions Support\n\nThe `extensions` property allows storing UI settings and 3rd party data:\n- Use `extensions.ui.
|
|
563
|
+
"description": "Complete metadata for a node type including ports, configuration schema, and extensions.\n\n## Dynamic Port Support\n\nNodes can support user-defined dynamic ports through their configSchema:\n- Add `dynamicInputs` array property to allow custom input handles\n- Add `dynamicOutputs` array property to allow custom output handles\n- Add `branches` array property for gateway nodes with conditional paths\n\n## Extensions Support\n\nThe `extensions` property allows storing UI settings and 3rd party data:\n- Use `extensions.ui.style` for custom per-node styling\n- Use namespaced keys for custom integrations (e.g., \"myapp:settings\")\n(Port order + exposure live in `config.ports`, not here.)\n",
|
|
564
564
|
"properties": {
|
|
565
|
-
"
|
|
565
|
+
"node_type_id": {
|
|
566
566
|
"type": "string",
|
|
567
567
|
"description": "Node type unique identifier"
|
|
568
568
|
},
|
|
@@ -650,7 +650,7 @@
|
|
|
650
650
|
}
|
|
651
651
|
},
|
|
652
652
|
"required": [
|
|
653
|
-
"
|
|
653
|
+
"node_type_id",
|
|
654
654
|
"name",
|
|
655
655
|
"description",
|
|
656
656
|
"category",
|
|
@@ -695,6 +695,16 @@
|
|
|
695
695
|
"defaultValue": {
|
|
696
696
|
"description": "Default value used when no connection provides data"
|
|
697
697
|
},
|
|
698
|
+
"exposedByDefault": {
|
|
699
|
+
"type": "boolean",
|
|
700
|
+
"default": true,
|
|
701
|
+
"description": "Whether the port is exposed when the instance sets no explicit exposure\nfor it (in `data.config.ports`). Defaults to true — a missing override\nreads as exposed. Reserved ports that ship hidden until an author opts in\n(e.g. the `error` output) carry false. In v2 exposure is semantic: a\nnot-exposed port is hidden on the canvas, not wireable, and not\nruntime-overridable.\n"
|
|
702
|
+
},
|
|
703
|
+
"displayOrder": {
|
|
704
|
+
"type": "integer",
|
|
705
|
+
"default": 0,
|
|
706
|
+
"description": "Default sort weight for the port's render position, ascending; ties\nbreak on declaration order. Author-declared ports default to 0. Reserved\nports (the `error` output and `trigger`/`tool` control ports) need no\nvalue — the renderer sinks them to the bottom automatically; set this\nonly to override that. Cosmetic only. The instance's `config.ports`\norder overrides this when present.\n"
|
|
707
|
+
},
|
|
698
708
|
"schema": {
|
|
699
709
|
"allOf": [
|
|
700
710
|
{
|
|
@@ -726,16 +736,12 @@
|
|
|
726
736
|
"idea",
|
|
727
737
|
"default"
|
|
728
738
|
],
|
|
729
|
-
"description": "Visual rendering type for the node.\n\nBuilt-in types:\n- `note` - Sticky note with markdown support\n- `simple` - Compact layout with header and description\n- `square` - Minimal square node with centered icon\n- `atom` - Minimal label-only pill/rectangle for value/transform nodes (uses extensions.ui.atom)\n- `tool` - Specialized node for agent tools\n- `gateway` - Branching control flow with dynamic branches (uses config.branches)\n- `terminal` - Circular node for workflow start/end/exit points\n- `idea` - Conceptual idea node for BPMN-like flow diagrams\n- `default` - Full-featured workflow node with dynamic port support\n\n## Dynamic Port Support\n\nThe `default` and `gateway` node types support dynamic ports:\n\n- **default**: Supports `config.dynamicInputs` and `config.dynamicOutputs`\n for user-defined input/output handles\n- **gateway**: Supports `config.branches` for conditional branching paths\n\n##
|
|
739
|
+
"description": "Visual rendering type for the node.\n\nBuilt-in types:\n- `note` - Sticky note with markdown support\n- `simple` - Compact layout with header and description\n- `square` - Minimal square node with centered icon\n- `atom` - Minimal label-only pill/rectangle for value/transform nodes (uses extensions.ui.atom)\n- `tool` - Specialized node for agent tools\n- `gateway` - Branching control flow with dynamic branches (uses config.branches)\n- `terminal` - Circular node for workflow start/end/exit points\n- `idea` - Conceptual idea node for BPMN-like flow diagrams\n- `default` - Full-featured workflow node with dynamic port support\n\n## Dynamic Port Support\n\nThe `default` and `gateway` node types support dynamic ports:\n\n- **default**: Supports `config.dynamicInputs` and `config.dynamicOutputs`\n for user-defined input/output handles\n- **gateway**: Supports `config.branches` for conditional branching paths\n\n## Port order + exposure\n\nRender order and exposure are controlled per instance via `config.ports`\n(a per-direction ordered list of `{id, exposed?}`), over each port's metadata\n`displayOrder` / `exposedByDefault` defaults. Order is cosmetic; a not-exposed\nport is hidden, not wireable, and not runtime-overridable.\n"
|
|
730
740
|
},
|
|
731
741
|
"NodeUIExtensions": {
|
|
732
742
|
"type": "object",
|
|
733
743
|
"description": "UI-related extension settings for nodes.\nUsed to control visual behavior in the workflow editor.\n\nThese settings can be defined at two levels:\n1. **Node Type Level** (`metadata.extensions.ui`): Default settings for all instances\n2. **Instance Level** (`data.extensions.ui`): Override for specific node instances\n\nInstance-level settings take precedence over type-level defaults.\n",
|
|
734
744
|
"properties": {
|
|
735
|
-
"hideUnconnectedHandles": {
|
|
736
|
-
"type": "boolean",
|
|
737
|
-
"description": "Show/hide unconnected handles (ports) to reduce visual noise.\nWhen true, only ports with active connections are displayed.\nUseful for nodes with many optional ports.\n"
|
|
738
|
-
},
|
|
739
745
|
"atom": {
|
|
740
746
|
"$ref": "#/$defs/AtomUIConfig"
|
|
741
747
|
},
|
|
@@ -1109,7 +1115,7 @@
|
|
|
1109
1115
|
},
|
|
1110
1116
|
"type": {
|
|
1111
1117
|
"type": "string",
|
|
1112
|
-
"description": "Node type ID (references NodeMetadata.
|
|
1118
|
+
"description": "Node type ID (references NodeMetadata.node_type_id)"
|
|
1113
1119
|
},
|
|
1114
1120
|
"position": {
|
|
1115
1121
|
"$ref": "#/$defs/Position"
|
|
@@ -1139,10 +1145,6 @@
|
|
|
1139
1145
|
"type": "string",
|
|
1140
1146
|
"description": "Error message if node execution failed"
|
|
1141
1147
|
},
|
|
1142
|
-
"nodeId": {
|
|
1143
|
-
"type": "string",
|
|
1144
|
-
"description": "Alternative node ID"
|
|
1145
|
-
},
|
|
1146
1148
|
"executionInfo": {
|
|
1147
1149
|
"$ref": "#/$defs/NodeExecutionInfo"
|
|
1148
1150
|
},
|
|
@@ -1152,7 +1154,7 @@
|
|
|
1152
1154
|
"$ref": "#/$defs/NodeExtensions"
|
|
1153
1155
|
},
|
|
1154
1156
|
{
|
|
1155
|
-
"description": "Per-instance extension properties for 3rd party integrations.\nOverrides or extends the node type extensions defined in metadata.extensions.\nUse for instance-specific UI states or custom data.\n\nCommon use cases:\n- `extensions.ui.
|
|
1157
|
+
"description": "Per-instance extension properties for 3rd party integrations.\nOverrides or extends the node type extensions defined in metadata.extensions.\nUse for instance-specific UI states or custom data.\n\nCommon use cases:\n- `extensions.ui.style`: Custom styling for this node instance\n(Port order + exposure live in `config.ports`, not here.)\n"
|
|
1156
1158
|
}
|
|
1157
1159
|
]
|
|
1158
1160
|
}
|
|
@@ -33,7 +33,7 @@ export interface DynamicSchemaResult {
|
|
|
33
33
|
* const endpoint: DynamicSchemaEndpoint = {
|
|
34
34
|
* url: "/api/nodes/{nodeTypeId}/schema",
|
|
35
35
|
* method: "GET",
|
|
36
|
-
* parameterMapping: { nodeTypeId: "metadata.
|
|
36
|
+
* parameterMapping: { nodeTypeId: "metadata.node_type_id" }
|
|
37
37
|
* };
|
|
38
38
|
*
|
|
39
39
|
* const result = await fetchDynamicSchema(endpoint, node);
|
|
@@ -56,7 +56,7 @@ export declare function fetchDynamicSchema(endpointConfig: EndpointConfig | null
|
|
|
56
56
|
* ```typescript
|
|
57
57
|
* const link: ExternalEditLink = {
|
|
58
58
|
* url: "https://admin.example.com/nodes/{nodeTypeId}/edit/{instanceId}",
|
|
59
|
-
* parameterMapping: { nodeTypeId: "metadata.
|
|
59
|
+
* parameterMapping: { nodeTypeId: "metadata.node_type_id", instanceId: "id" }
|
|
60
60
|
* };
|
|
61
61
|
*
|
|
62
62
|
* const url = resolveExternalEditUrl(link, node, workflowId);
|
|
@@ -15,16 +15,16 @@ const schemaCache = new Map();
|
|
|
15
15
|
const DEFAULT_CACHE_TTL = DEFAULT_CACHE_TTL_MS;
|
|
16
16
|
/**
|
|
17
17
|
* Resolves a template variable path from the node context.
|
|
18
|
-
* Supports dot-notation paths like "metadata.
|
|
18
|
+
* Supports dot-notation paths like "metadata.node_type_id", "config.apiKey", "id"
|
|
19
19
|
*
|
|
20
20
|
* @param context - The node context containing all available data
|
|
21
|
-
* @param path - Dot-notation path to resolve (e.g., "metadata.
|
|
21
|
+
* @param path - Dot-notation path to resolve (e.g., "metadata.node_type_id")
|
|
22
22
|
* @returns The resolved value as a string, or undefined if not found
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```typescript
|
|
26
|
-
* const context = { id: "node-1", metadata: {
|
|
27
|
-
* resolveVariablePath(context, "metadata.
|
|
26
|
+
* const context = { id: "node-1", metadata: { node_type_id: "llm-node" } };
|
|
27
|
+
* resolveVariablePath(context, "metadata.node_type_id"); // Returns "llm-node"
|
|
28
28
|
* resolveVariablePath(context, "id"); // Returns "node-1"
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
@@ -60,8 +60,8 @@ function resolveVariablePath(context, path) {
|
|
|
60
60
|
* @example
|
|
61
61
|
* ```typescript
|
|
62
62
|
* const url = "/api/nodes/{nodeTypeId}/schema?instance={instanceId}";
|
|
63
|
-
* const mapping = { nodeTypeId: "metadata.
|
|
64
|
-
* const context = { id: "node-1", metadata: {
|
|
63
|
+
* const mapping = { nodeTypeId: "metadata.node_type_id", instanceId: "id" };
|
|
64
|
+
* const context = { id: "node-1", metadata: { node_type_id: "llm-node" } };
|
|
65
65
|
* resolveTemplate(url, mapping, context);
|
|
66
66
|
* // Returns "/api/nodes/llm-node/schema?instance=node-1"
|
|
67
67
|
* ```
|
|
@@ -127,7 +127,7 @@ function isCacheValid(entry, ttl = DEFAULT_CACHE_TTL) {
|
|
|
127
127
|
* const endpoint: DynamicSchemaEndpoint = {
|
|
128
128
|
* url: "/api/nodes/{nodeTypeId}/schema",
|
|
129
129
|
* method: "GET",
|
|
130
|
-
* parameterMapping: { nodeTypeId: "metadata.
|
|
130
|
+
* parameterMapping: { nodeTypeId: "metadata.node_type_id" }
|
|
131
131
|
* };
|
|
132
132
|
*
|
|
133
133
|
* const result = await fetchDynamicSchema(endpoint, node);
|
|
@@ -279,7 +279,7 @@ export async function fetchDynamicSchema(endpointConfig, endpoint, node, workflo
|
|
|
279
279
|
* ```typescript
|
|
280
280
|
* const link: ExternalEditLink = {
|
|
281
281
|
* url: "https://admin.example.com/nodes/{nodeTypeId}/edit/{instanceId}",
|
|
282
|
-
* parameterMapping: { nodeTypeId: "metadata.
|
|
282
|
+
* parameterMapping: { nodeTypeId: "metadata.node_type_id", instanceId: "id" }
|
|
283
283
|
* };
|
|
284
284
|
*
|
|
285
285
|
* const url = resolveExternalEditUrl(link, node, workflowId);
|