@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.
Files changed (59) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/adapters/WorkflowAdapter.js +4 -5
  3. package/dist/adapters/agentspec/AgentSpecAdapter.js +3 -3
  4. package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
  5. package/dist/commands/executor.js +5 -6
  6. package/dist/commands/types.js +5 -5
  7. package/dist/components/App.svelte +5 -14
  8. package/dist/components/ConfigForm.svelte +6 -505
  9. package/dist/components/ConfigForm.svelte.d.ts +4 -6
  10. package/dist/components/ConfigModal.svelte +0 -1
  11. package/dist/components/NodeSidebar.svelte +4 -4
  12. package/dist/components/NodeSwapPicker.svelte +2 -2
  13. package/dist/components/UniversalNode.svelte +5 -4
  14. package/dist/components/UniversalNode.svelte.d.ts +1 -1
  15. package/dist/components/console/ConsoleInput.svelte +3 -3
  16. package/dist/components/form/FormField.svelte +15 -0
  17. package/dist/components/form/FormFieldLight.svelte +14 -0
  18. package/dist/components/form/FormPorts.svelte +262 -0
  19. package/dist/components/form/FormPorts.svelte.d.ts +13 -0
  20. package/dist/components/nodes/AtomNode.svelte +16 -42
  21. package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
  22. package/dist/components/nodes/GatewayNode.svelte +26 -65
  23. package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
  24. package/dist/components/nodes/IdeaNode.svelte +10 -8
  25. package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
  26. package/dist/components/nodes/NotesNode.svelte +6 -4
  27. package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
  28. package/dist/components/nodes/SimpleNode.svelte +31 -55
  29. package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
  30. package/dist/components/nodes/SquareNode.svelte +31 -55
  31. package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
  32. package/dist/components/nodes/TerminalNode.svelte +34 -38
  33. package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
  34. package/dist/components/nodes/ToolNode.svelte +10 -8
  35. package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
  36. package/dist/components/nodes/WorkflowNode.svelte +43 -93
  37. package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
  38. package/dist/components/playground/PipelineKanbanView.svelte +2 -2
  39. package/dist/components/playground/PipelineTableView.svelte +2 -2
  40. package/dist/core/index.d.ts +1 -1
  41. package/dist/helpers/workflowEditorHelper.js +4 -5
  42. package/dist/openapi/v1/openapi.yaml +33 -21
  43. package/dist/registry/nodeComponentRegistry.d.ts +2 -1
  44. package/dist/schemas/v1/workflow.schema.json +16 -14
  45. package/dist/services/dynamicSchemaService.d.ts +2 -2
  46. package/dist/services/dynamicSchemaService.js +8 -8
  47. package/dist/stores/playgroundStore.svelte.js +1 -1
  48. package/dist/stores/workflowStore.svelte.d.ts +1 -1
  49. package/dist/stores/workflowStore.svelte.js +1 -19
  50. package/dist/types/index.d.ts +51 -27
  51. package/dist/utils/colors.d.ts +27 -0
  52. package/dist/utils/colors.js +23 -0
  53. package/dist/utils/connections.js +6 -6
  54. package/dist/utils/nodeIds.d.ts +1 -1
  55. package/dist/utils/nodeIds.js +1 -1
  56. package/dist/utils/nodeSwap.js +3 -6
  57. package/dist/utils/portUtils.d.ts +47 -11
  58. package/dist/utils/portUtils.js +67 -14
  59. 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
- UI Extensions Support:
8
- - hideUnconnectedHandles: Hides ports that are not connected to reduce visual clutter
9
- - portOrder: Visual-only reordering of input/output ports (no effect on execution)
10
- - hiddenPorts: Manually hidden ports per direction (required ports cannot be hidden)
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, NodePort, DynamicPort } from '../../types/index.js';
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
- getPortBackgroundColor
23
+ getPortColorToken,
24
+ getPortBackgroundColorForPort
24
25
  } from '../../utils/colors.js';
25
26
  import { getInstance } from '../../stores/getInstance.svelte.js';
26
- import { applyPortOrder } from '../../utils/portUtils.js';
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
- * Get the hideUnconnectedHandles setting from extensions
65
- * Merges node type defaults with instance overrides
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 hideUnconnectedHandles = $derived(
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
- * sorted by portOrder if set (visual-only)
93
+ * in effective order (metadata default, then config override; cosmetic).
112
94
  */
113
95
  const allInputPorts = $derived(
114
- applyPortOrder([...props.data.metadata.inputs, ...dynamicInputs], portOrder.inputs)
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
- * sorted by portOrder if set (visual-only)
101
+ * in effective order (metadata default, then config override; cosmetic).
120
102
  */
121
103
  const allOutputPorts = $derived(
122
- applyPortOrder([...props.data.metadata.outputs, ...dynamicOutputs], portOrder.outputs)
104
+ orderPortsFor([...props.data.metadata.outputs, ...dynamicOutputs], portsConfig.outputs)
123
105
  );
124
106
 
125
107
  /**
126
- * Check if a port should be visible based on connection state and settings
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
- function isPortVisible(port: NodePort, type: 'input' | 'output'): boolean {
132
- // Manual hide takes precedence (required ports are prevented from being hidden in ConfigForm)
133
- const manuallyHidden =
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 visible output ports based on hideUnconnectedHandles setting
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.data.nodeId || 'unknown',
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.data.nodeId || 'unknown'}"
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.data.nodeId}-input-${port.id}`}
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, {getDataTypeColorToken(
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.dataType
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: {getPortBackgroundColor(
217
+ style="background-color: {getPortBackgroundColorForPort(
268
218
  checker,
269
- port.dataType,
219
+ port,
270
220
  15
271
- )}; color: {getDataTypeColorToken(
221
+ )}; color: {getPortColorToken(
272
222
  checker,
273
- port.dataType
274
- )}; border: 1px solid {getPortBackgroundColor(checker, port.dataType, 30)};"
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: {getPortBackgroundColor(
260
+ style="background-color: {getPortBackgroundColorForPort(
311
261
  checker,
312
- port.dataType,
262
+ port,
313
263
  15
314
- )}; color: {getDataTypeColorToken(
264
+ )}; color: {getPortColorToken(
315
265
  checker,
316
- port.dataType
317
- )}; border: 1px solid {getPortBackgroundColor(checker, port.dataType, 30)};"
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.data.nodeId}-output-${port.id}`}
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, {getDataTypeColorToken(
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.dataType
287
+ port
338
288
  )}); --fd-handle-border-color: var(--fd-handle-border);"
339
289
  tabindex={-1}
340
290
  />
@@ -1,7 +1,7 @@
1
1
  import type { WorkflowNode } from '../../types/index.js';
2
2
  interface Props {
3
+ id: string;
3
4
  data: WorkflowNode['data'] & {
4
- nodeId?: string;
5
5
  onConfigOpen?: (node: {
6
6
  id: string;
7
7
  type: string;
@@ -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.id,
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.id,
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.id,
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.id,
140
+ typeId: node.data.metadata.node_type_id,
141
141
  nodeId: node.id,
142
142
  status: resolveStatus(statusData),
143
143
  started: statusData?.last_executed,
@@ -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
- id: 'text-input',
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
- id: 'text-output',
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.id, existingNodes);
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
- - id: openai_chat_executor
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
- id: text_input
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
- ## UI Extensions
2553
+ ## Port order + exposure
2554
2554
 
2555
- All node types support `extensions.ui.hideUnconnectedHandles` to control
2556
- visibility of unconnected ports.
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.hideUnconnectedHandles` to hide unconnected ports by default
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
- id:
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
- - id
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.id)
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.hideUnconnectedHandles` to hide unconnected ports by default\n- Use namespaced keys for custom integrations (e.g., \"myapp:settings\")\n",
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
- "id": {
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
- "id",
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## UI Extensions\n\nAll node types support `extensions.ui.hideUnconnectedHandles` to control\nvisibility of unconnected ports.\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.id)"
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.hideUnconnectedHandles`: Hide ports without connections\n- `extensions.ui.style`: Custom styling for this node instance\n"
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.id" }
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.id", instanceId: "id" }
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.id", "config.apiKey", "id"
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.id")
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: { id: "llm-node" } };
27
- * resolveVariablePath(context, "metadata.id"); // Returns "llm-node"
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.id", instanceId: "id" };
64
- * const context = { id: "node-1", metadata: { id: "llm-node" } };
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.id" }
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.id", instanceId: "id" }
282
+ * parameterMapping: { nodeTypeId: "metadata.node_type_id", instanceId: "id" }
283
283
  * };
284
284
  *
285
285
  * const url = resolveExternalEditUrl(link, node, workflowId);