@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
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
A simple square node with optional input and output ports
|
|
4
4
|
Styled with BEM syntax
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
-
|
|
6
|
+
Port rendering:
|
|
7
|
+
- Exposure (data.config.ports, falling back to each port's exposedByDefault)
|
|
8
|
+
decides which ports render — a not-exposed port is hidden.
|
|
9
|
+
- Order: data.config.ports order overrides the metadata default (displayOrder);
|
|
10
|
+
unlisted ports follow in default order.
|
|
10
11
|
-->
|
|
11
12
|
|
|
12
13
|
<script lang="ts">
|
|
@@ -16,23 +17,24 @@
|
|
|
16
17
|
NodeMetadata,
|
|
17
18
|
NodeExtensions,
|
|
18
19
|
NodePort,
|
|
19
|
-
DynamicPort
|
|
20
|
+
DynamicPort,
|
|
21
|
+
PortsConfig
|
|
20
22
|
} from '../../types/index.js';
|
|
21
23
|
import { dynamicPortToNodePort } from '../../types/index.js';
|
|
22
24
|
import Icon from '@iconify/svelte';
|
|
23
|
-
import {
|
|
25
|
+
import { getPortColorToken, getCategoryColorToken } from '../../utils/colors.js';
|
|
24
26
|
import { getNodeIcon } from '../../utils/icons.js';
|
|
25
27
|
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
26
|
-
import {
|
|
28
|
+
import { orderPortsFor, getPortTop, isPortVisible } from '../../utils/portUtils.js';
|
|
27
29
|
import NodeConfigButton from './NodeConfigButton.svelte';
|
|
28
30
|
import AlertCircleIcon from '../icons/AlertCircleIcon.svelte';
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
interface Props {
|
|
33
|
+
id: string;
|
|
31
34
|
data: {
|
|
32
35
|
label: string;
|
|
33
36
|
config: ConfigValues;
|
|
34
37
|
metadata: NodeMetadata;
|
|
35
|
-
nodeId?: string;
|
|
36
38
|
extensions?: NodeExtensions;
|
|
37
39
|
onConfigOpen?: (node: {
|
|
38
40
|
id: string;
|
|
@@ -43,27 +45,19 @@
|
|
|
43
45
|
selected?: boolean;
|
|
44
46
|
isProcessing?: boolean;
|
|
45
47
|
isError?: boolean;
|
|
46
|
-
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let props: Props = $props();
|
|
47
51
|
|
|
48
52
|
const fd = getInstance();
|
|
49
53
|
const checker = fd.portCompatibility;
|
|
50
54
|
|
|
51
55
|
/**
|
|
52
|
-
*
|
|
56
|
+
* Per-instance port order + exposure, in config. Order overrides the metadata
|
|
57
|
+
* default; exposure is semantic (a not-exposed port is hidden, not wireable,
|
|
58
|
+
* not runtime-overridable).
|
|
53
59
|
*/
|
|
54
|
-
const
|
|
55
|
-
props.data.extensions?.ui?.hideUnconnectedHandles ??
|
|
56
|
-
props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ??
|
|
57
|
-
false
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const hiddenPorts = $derived(
|
|
61
|
-
props.data.extensions?.ui?.hiddenPorts ?? props.data.metadata?.extensions?.ui?.hiddenPorts ?? {}
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
const portOrder = $derived(
|
|
65
|
-
props.data.extensions?.ui?.portOrder ?? props.data.metadata?.extensions?.ui?.portOrder ?? {}
|
|
66
|
-
);
|
|
60
|
+
const portsConfig = $derived((props.data.config?.ports as PortsConfig | undefined) ?? {});
|
|
67
61
|
|
|
68
62
|
/**
|
|
69
63
|
* Get icon using the same resolution as WorkflowNode
|
|
@@ -84,7 +78,7 @@
|
|
|
84
78
|
if (props.data.onConfigOpen) {
|
|
85
79
|
// Create a WorkflowNodeType-like object for the global ConfigSidebar
|
|
86
80
|
const nodeForConfig = {
|
|
87
|
-
id: props.
|
|
81
|
+
id: props.id,
|
|
88
82
|
type: 'square',
|
|
89
83
|
data: props.data
|
|
90
84
|
};
|
|
@@ -118,38 +112,20 @@
|
|
|
118
112
|
* All visible input ports in user-defined order.
|
|
119
113
|
*/
|
|
120
114
|
const visibleInputPorts = $derived(
|
|
121
|
-
|
|
115
|
+
orderPortsFor(
|
|
122
116
|
[...(props.data.metadata?.inputs ?? []), ...dynamicInputs],
|
|
123
|
-
|
|
124
|
-
).filter((p: NodePort) =>
|
|
125
|
-
isPortVisible(
|
|
126
|
-
p,
|
|
127
|
-
'input',
|
|
128
|
-
hiddenPorts,
|
|
129
|
-
hideUnconnectedHandles,
|
|
130
|
-
fd.workflow.connectedHandles,
|
|
131
|
-
props.data.nodeId
|
|
132
|
-
)
|
|
133
|
-
)
|
|
117
|
+
portsConfig.inputs
|
|
118
|
+
).filter((p: NodePort) => isPortVisible(p, 'input', portsConfig))
|
|
134
119
|
);
|
|
135
120
|
|
|
136
121
|
/**
|
|
137
122
|
* All visible output ports in user-defined order.
|
|
138
123
|
*/
|
|
139
124
|
const visibleOutputPorts = $derived(
|
|
140
|
-
|
|
125
|
+
orderPortsFor(
|
|
141
126
|
[...(props.data.metadata?.outputs ?? []), ...dynamicOutputs],
|
|
142
|
-
|
|
143
|
-
).filter((p: NodePort) =>
|
|
144
|
-
isPortVisible(
|
|
145
|
-
p,
|
|
146
|
-
'output',
|
|
147
|
-
hiddenPorts,
|
|
148
|
-
hideUnconnectedHandles,
|
|
149
|
-
fd.workflow.connectedHandles,
|
|
150
|
-
props.data.nodeId
|
|
151
|
-
)
|
|
152
|
-
)
|
|
127
|
+
portsConfig.outputs
|
|
128
|
+
).filter((p: NodePort) => isPortVisible(p, 'output', portsConfig))
|
|
153
129
|
);
|
|
154
130
|
|
|
155
131
|
/**
|
|
@@ -169,14 +145,14 @@
|
|
|
169
145
|
<Handle
|
|
170
146
|
type="target"
|
|
171
147
|
position={Position.Left}
|
|
172
|
-
style="--fd-handle-fill: var(--fd-port-skin-color, {
|
|
148
|
+
style="--fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
173
149
|
checker,
|
|
174
|
-
port
|
|
150
|
+
port
|
|
175
151
|
)}); --fd-handle-border-color: var(--fd-handle-border); top: {getPortTop(
|
|
176
152
|
index,
|
|
177
153
|
visibleInputPorts.length
|
|
178
154
|
)}px; transform: translateY(-50%); z-index: 30;"
|
|
179
|
-
id={`${props.
|
|
155
|
+
id={`${props.id}-input-${port.id}`}
|
|
180
156
|
/>
|
|
181
157
|
{/each}
|
|
182
158
|
|
|
@@ -235,14 +211,14 @@
|
|
|
235
211
|
<Handle
|
|
236
212
|
type="source"
|
|
237
213
|
position={Position.Right}
|
|
238
|
-
style="--fd-handle-fill: var(--fd-port-skin-color, {
|
|
214
|
+
style="--fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
239
215
|
checker,
|
|
240
|
-
port
|
|
216
|
+
port
|
|
241
217
|
)}); --fd-handle-border-color: var(--fd-handle-border); top: {getPortTop(
|
|
242
218
|
index,
|
|
243
219
|
visibleOutputPorts.length
|
|
244
220
|
)}px; transform: translateY(-50%); z-index: 30;"
|
|
245
|
-
id={`${props.
|
|
221
|
+
id={`${props.id}-output-${port.id}`}
|
|
246
222
|
/>
|
|
247
223
|
{/each}
|
|
248
224
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ConfigValues, NodeMetadata, NodeExtensions } from '../../types/index.js';
|
|
2
|
-
|
|
2
|
+
interface Props {
|
|
3
|
+
id: string;
|
|
3
4
|
data: {
|
|
4
5
|
label: string;
|
|
5
6
|
config: ConfigValues;
|
|
6
7
|
metadata: NodeMetadata;
|
|
7
|
-
nodeId?: string;
|
|
8
8
|
extensions?: NodeExtensions;
|
|
9
9
|
onConfigOpen?: (node: {
|
|
10
10
|
id: string;
|
|
@@ -19,7 +19,7 @@ type $$ComponentProps = {
|
|
|
19
19
|
selected?: boolean;
|
|
20
20
|
isProcessing?: boolean;
|
|
21
21
|
isError?: boolean;
|
|
22
|
-
}
|
|
23
|
-
declare const SquareNode: import("svelte").Component
|
|
22
|
+
}
|
|
23
|
+
declare const SquareNode: import("svelte").Component<Props, {}, "">;
|
|
24
24
|
type SquareNode = ReturnType<typeof SquareNode>;
|
|
25
25
|
export default SquareNode;
|
|
@@ -10,12 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
12
|
import { Position, Handle } from '@xyflow/svelte';
|
|
13
|
-
import type {
|
|
13
|
+
import type {
|
|
14
|
+
ConfigValues,
|
|
15
|
+
NodeMetadata,
|
|
16
|
+
NodeExtensions,
|
|
17
|
+
NodePort,
|
|
18
|
+
PortsConfig
|
|
19
|
+
} from '../../types/index.js';
|
|
14
20
|
import Icon from '@iconify/svelte';
|
|
15
21
|
import NodeConfigButton from './NodeConfigButton.svelte';
|
|
16
|
-
import {
|
|
22
|
+
import { getPortColorToken, getCategoryColorToken } from '../../utils/colors.js';
|
|
17
23
|
import { getNodeIcon } from '../../utils/icons.js';
|
|
18
24
|
import { getCircleHandlePosition } from '../../utils/handlePositioning.js';
|
|
25
|
+
import { orderPortsFor, isPortVisible } from '../../utils/portUtils.js';
|
|
19
26
|
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
20
27
|
|
|
21
28
|
/**
|
|
@@ -66,12 +73,12 @@
|
|
|
66
73
|
}
|
|
67
74
|
};
|
|
68
75
|
|
|
69
|
-
|
|
76
|
+
interface Props {
|
|
77
|
+
id: string;
|
|
70
78
|
data: {
|
|
71
79
|
label: string;
|
|
72
80
|
config: ConfigValues;
|
|
73
81
|
metadata: NodeMetadata;
|
|
74
|
-
nodeId?: string;
|
|
75
82
|
extensions?: NodeExtensions;
|
|
76
83
|
onConfigOpen?: (node: {
|
|
77
84
|
id: string;
|
|
@@ -82,7 +89,9 @@
|
|
|
82
89
|
selected?: boolean;
|
|
83
90
|
isProcessing?: boolean;
|
|
84
91
|
isError?: boolean;
|
|
85
|
-
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let props: Props = $props();
|
|
86
95
|
|
|
87
96
|
const fd = getInstance();
|
|
88
97
|
const checker = fd.portCompatibility;
|
|
@@ -111,7 +120,7 @@
|
|
|
111
120
|
}
|
|
112
121
|
|
|
113
122
|
// Check metadata id/name for hints
|
|
114
|
-
const idLower = (props.data.metadata?.
|
|
123
|
+
const idLower = (props.data.metadata?.node_type_id || '').toLowerCase();
|
|
115
124
|
const nameLower = (props.data.metadata?.name || '').toLowerCase();
|
|
116
125
|
if (idLower.includes('start') || nameLower.includes('start')) {
|
|
117
126
|
return 'start';
|
|
@@ -140,28 +149,11 @@
|
|
|
140
149
|
let variantConfig = $derived(VARIANT_CONFIGS[variant]);
|
|
141
150
|
|
|
142
151
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
152
|
+
* Per-instance port order + exposure, in config. Order overrides the metadata
|
|
153
|
+
* default; exposure is semantic (a not-exposed port is hidden, not wireable,
|
|
154
|
+
* not runtime-overridable).
|
|
145
155
|
*/
|
|
146
|
-
const
|
|
147
|
-
props.data.extensions?.ui?.hideUnconnectedHandles ??
|
|
148
|
-
props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ??
|
|
149
|
-
false
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Check if a port should be visible based on connection state and settings
|
|
154
|
-
*/
|
|
155
|
-
function isPortVisible(port: NodePort, type: 'input' | 'output'): boolean {
|
|
156
|
-
if (!hideUnconnectedHandles) {
|
|
157
|
-
return true;
|
|
158
|
-
}
|
|
159
|
-
if (port.required) {
|
|
160
|
-
return true;
|
|
161
|
-
}
|
|
162
|
-
const handleId = `${props.data.nodeId}-${type}-${port.id}`;
|
|
163
|
-
return fd.workflow.connectedHandles.has(handleId);
|
|
164
|
-
}
|
|
156
|
+
const portsConfig = $derived((props.data.config?.ports as PortsConfig | undefined) ?? {});
|
|
165
157
|
|
|
166
158
|
/**
|
|
167
159
|
* Get icon using the same resolution as WorkflowNode
|
|
@@ -269,17 +261,21 @@
|
|
|
269
261
|
);
|
|
270
262
|
|
|
271
263
|
/**
|
|
272
|
-
*
|
|
264
|
+
* Exposed input ports, in effective order.
|
|
273
265
|
*/
|
|
274
266
|
let visibleInputPorts = $derived(
|
|
275
|
-
inputPorts.filter((port: NodePort) =>
|
|
267
|
+
orderPortsFor(inputPorts, portsConfig.inputs).filter((port: NodePort) =>
|
|
268
|
+
isPortVisible(port, 'input', portsConfig)
|
|
269
|
+
)
|
|
276
270
|
);
|
|
277
271
|
|
|
278
272
|
/**
|
|
279
|
-
*
|
|
273
|
+
* Exposed output ports, in effective order.
|
|
280
274
|
*/
|
|
281
275
|
let visibleOutputPorts = $derived(
|
|
282
|
-
outputPorts.filter((port: NodePort) =>
|
|
276
|
+
orderPortsFor(outputPorts, portsConfig.outputs).filter((port: NodePort) =>
|
|
277
|
+
isPortVisible(port, 'output', portsConfig)
|
|
278
|
+
)
|
|
283
279
|
);
|
|
284
280
|
|
|
285
281
|
/**
|
|
@@ -298,7 +294,7 @@
|
|
|
298
294
|
function openConfigSidebar(): void {
|
|
299
295
|
if (props.data.onConfigOpen) {
|
|
300
296
|
const nodeForConfig = {
|
|
301
|
-
id: props.
|
|
297
|
+
id: props.id,
|
|
302
298
|
type: 'terminal',
|
|
303
299
|
data: props.data
|
|
304
300
|
};
|
|
@@ -342,11 +338,11 @@
|
|
|
342
338
|
<Handle
|
|
343
339
|
type="target"
|
|
344
340
|
position={Position.Left}
|
|
345
|
-
style="--fd-handle-fill: {
|
|
341
|
+
style="--fd-handle-fill: {getPortColorToken(
|
|
346
342
|
checker,
|
|
347
|
-
port
|
|
343
|
+
port
|
|
348
344
|
)}; --fd-handle-border-color: var(--fd-handle-border); left: {pos.left}px; top: {pos.top}px; transform: translate(-50%, -50%); z-index: 30;"
|
|
349
|
-
id={`${props.
|
|
345
|
+
id={`${props.id}-input-${port.id}`}
|
|
350
346
|
/>
|
|
351
347
|
{/each}
|
|
352
348
|
{/if}
|
|
@@ -365,10 +361,10 @@
|
|
|
365
361
|
<Handle
|
|
366
362
|
type="source"
|
|
367
363
|
position={Position.Right}
|
|
368
|
-
id={`${props.
|
|
369
|
-
style="--fd-handle-fill: {
|
|
364
|
+
id={`${props.id}-output-${port.id}`}
|
|
365
|
+
style="--fd-handle-fill: {getPortColorToken(
|
|
370
366
|
checker,
|
|
371
|
-
port
|
|
367
|
+
port
|
|
372
368
|
)}; --fd-handle-border-color: var(--fd-handle-border); left: {pos.left}px; top: {pos.top}px; transform: translate(-50%, -50%); z-index: 30;"
|
|
373
369
|
/>
|
|
374
370
|
{/each}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ConfigValues, NodeMetadata, NodeExtensions } from '../../types/index.js';
|
|
2
|
-
|
|
2
|
+
interface Props {
|
|
3
|
+
id: string;
|
|
3
4
|
data: {
|
|
4
5
|
label: string;
|
|
5
6
|
config: ConfigValues;
|
|
6
7
|
metadata: NodeMetadata;
|
|
7
|
-
nodeId?: string;
|
|
8
8
|
extensions?: NodeExtensions;
|
|
9
9
|
onConfigOpen?: (node: {
|
|
10
10
|
id: string;
|
|
@@ -19,7 +19,7 @@ type $$ComponentProps = {
|
|
|
19
19
|
selected?: boolean;
|
|
20
20
|
isProcessing?: boolean;
|
|
21
21
|
isError?: boolean;
|
|
22
|
-
}
|
|
23
|
-
declare const TerminalNode: import("svelte").Component
|
|
22
|
+
}
|
|
23
|
+
declare const TerminalNode: import("svelte").Component<Props, {}, "">;
|
|
24
24
|
type TerminalNode = ReturnType<typeof TerminalNode>;
|
|
25
25
|
export default TerminalNode;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import Icon from '@iconify/svelte';
|
|
10
10
|
import { getDataTypeColor, getCategoryColorToken } from '../../utils/colors';
|
|
11
11
|
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
12
|
-
import type { NodeMetadata, NodePort } from '../../types/index.js';
|
|
12
|
+
import type { ConfigValues, NodeMetadata, NodePort } from '../../types/index.js';
|
|
13
13
|
import NodeConfigButton from './NodeConfigButton.svelte';
|
|
14
14
|
import AlertCircleIcon from '../icons/AlertCircleIcon.svelte';
|
|
15
15
|
|
|
@@ -19,10 +19,11 @@
|
|
|
19
19
|
description?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
interface Props {
|
|
23
|
+
id: string;
|
|
23
24
|
data: {
|
|
24
25
|
label: string;
|
|
25
|
-
config: {
|
|
26
|
+
config: ConfigValues & {
|
|
26
27
|
icon?: string;
|
|
27
28
|
color?: string;
|
|
28
29
|
toolName?: string;
|
|
@@ -31,7 +32,6 @@
|
|
|
31
32
|
parameters?: ToolNodeParameter[];
|
|
32
33
|
};
|
|
33
34
|
metadata: NodeMetadata;
|
|
34
|
-
nodeId?: string;
|
|
35
35
|
onConfigOpen?: (node: {
|
|
36
36
|
id: string;
|
|
37
37
|
type: string;
|
|
@@ -45,7 +45,9 @@
|
|
|
45
45
|
selected?: boolean;
|
|
46
46
|
isProcessing?: boolean;
|
|
47
47
|
isError?: boolean;
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let props: Props = $props();
|
|
49
51
|
|
|
50
52
|
const fd = getInstance();
|
|
51
53
|
const checker = fd.portCompatibility;
|
|
@@ -142,7 +144,7 @@
|
|
|
142
144
|
if (props.data.onConfigOpen) {
|
|
143
145
|
// Create a WorkflowNodeType-like object for the global ConfigSidebar
|
|
144
146
|
const nodeForConfig = {
|
|
145
|
-
id: props.
|
|
147
|
+
id: props.id,
|
|
146
148
|
type: 'tool',
|
|
147
149
|
data: props.data
|
|
148
150
|
};
|
|
@@ -163,7 +165,7 @@
|
|
|
163
165
|
<Handle
|
|
164
166
|
type="target"
|
|
165
167
|
position={Position.Left}
|
|
166
|
-
id={`${props.
|
|
168
|
+
id={`${props.id}-input-${toolInputPort.id}`}
|
|
167
169
|
style="top: {firstPortTop}px; transform: translateY(-50%); z-index: 30; --fd-handle-fill: var(--fd-port-skin-color, {getDataTypeColor(
|
|
168
170
|
checker,
|
|
169
171
|
portDataType
|
|
@@ -239,7 +241,7 @@
|
|
|
239
241
|
<Handle
|
|
240
242
|
type="source"
|
|
241
243
|
position={Position.Right}
|
|
242
|
-
id={`${props.
|
|
244
|
+
id={`${props.id}-output-${toolOutputPort.id}`}
|
|
243
245
|
style="top: {firstPortTop}px; transform: translateY(-50%); z-index: 30; --fd-handle-fill: var(--fd-port-skin-color, {getDataTypeColor(
|
|
244
246
|
checker,
|
|
245
247
|
portDataType
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { NodeMetadata } from '../../types/index.js';
|
|
1
|
+
import type { ConfigValues, NodeMetadata } from '../../types/index.js';
|
|
2
2
|
interface ToolNodeParameter {
|
|
3
3
|
name: string;
|
|
4
4
|
type?: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
interface Props {
|
|
8
|
+
id: string;
|
|
8
9
|
data: {
|
|
9
10
|
label: string;
|
|
10
|
-
config: {
|
|
11
|
+
config: ConfigValues & {
|
|
11
12
|
icon?: string;
|
|
12
13
|
color?: string;
|
|
13
14
|
toolName?: string;
|
|
@@ -16,7 +17,6 @@ type $$ComponentProps = {
|
|
|
16
17
|
parameters?: ToolNodeParameter[];
|
|
17
18
|
};
|
|
18
19
|
metadata: NodeMetadata;
|
|
19
|
-
nodeId?: string;
|
|
20
20
|
onConfigOpen?: (node: {
|
|
21
21
|
id: string;
|
|
22
22
|
type: string;
|
|
@@ -30,7 +30,7 @@ type $$ComponentProps = {
|
|
|
30
30
|
selected?: boolean;
|
|
31
31
|
isProcessing?: boolean;
|
|
32
32
|
isError?: boolean;
|
|
33
|
-
}
|
|
34
|
-
declare const ToolNode: import("svelte").Component
|
|
33
|
+
}
|
|
34
|
+
declare const ToolNode: import("svelte").Component<Props, {}, "">;
|
|
35
35
|
type ToolNode = ReturnType<typeof ToolNode>;
|
|
36
36
|
export default ToolNode;
|