@flowdrop/flowdrop 2.1.0 → 2.1.1
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
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.1.1] - 2026-08-18
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Interface bindings resolved against the wrong side of a node.** A `PortBinding` carries no direction, and resolution re-derived one by searching a node's inputs first. Because a `portId` is only unique within one side of a node, any node declaring an input and an output under the same id resolved to the wrong port — `chat_output` ships exactly that shape (input `message`, output `message`), so every output entry bound to it reported a spurious direction mismatch against a port the binding picker never offered. Resolution now prefers the owning entry's own direction and falls back to the other side, so a genuinely misdirected binding is still reported. This also corrects the `hidden` exposure check, the `type-mismatch` check, and the bound-port ring, all of which were reading the opposite port for such nodes.
|
|
15
|
+
- **Saving or exporting a workflow stripped its declared interface.** `globalSaveWorkflow` and `globalExportWorkflow` rebuild the workflow from an explicit key list and neither named `interface`; since an absent `interface` means "declares no contract," a save dropped the contract and an export/re-import round trip lost it.
|
|
16
|
+
|
|
10
17
|
## [2.1.0] - 2026-08-18
|
|
11
18
|
|
|
12
19
|
**The workflow interface release.** A workflow can now declare its public call signature — named inputs and outputs bound to internal node ports — and author it in a dedicated settings panel. Entirely additive: workflows without an `interface` behave exactly as before.
|
|
@@ -120,7 +120,11 @@ export async function globalSaveWorkflow(options = {}) {
|
|
|
120
120
|
format: currentWorkflow.metadata?.format || DEFAULT_WORKFLOW_FORMAT,
|
|
121
121
|
createdAt: currentWorkflow.metadata?.createdAt || new Date().toISOString(),
|
|
122
122
|
updatedAt: new Date().toISOString()
|
|
123
|
-
}
|
|
123
|
+
},
|
|
124
|
+
// Explicit key list, so every contract field must be named here:
|
|
125
|
+
// omitting `interface` silently strips the declared contract on save
|
|
126
|
+
// (absent means "declares no interface" to the server).
|
|
127
|
+
...(currentWorkflow.interface !== undefined && { interface: currentWorkflow.interface })
|
|
124
128
|
};
|
|
125
129
|
// Step 4 — Persist via this instance's API client.
|
|
126
130
|
// id-presence (computed above) decides update vs create — never UUID-regex.
|
|
@@ -216,7 +220,10 @@ export async function globalExportWorkflow(options = {}) {
|
|
|
216
220
|
format: currentWorkflow.metadata?.format || DEFAULT_WORKFLOW_FORMAT,
|
|
217
221
|
createdAt: currentWorkflow.metadata?.createdAt || new Date().toISOString(),
|
|
218
222
|
updatedAt: new Date().toISOString()
|
|
219
|
-
}
|
|
223
|
+
},
|
|
224
|
+
// Same rule as the save path: the export must carry the declared
|
|
225
|
+
// contract, or a re-import round-trip loses `interface`.
|
|
226
|
+
...(currentWorkflow.interface !== undefined && { interface: currentWorkflow.interface })
|
|
220
227
|
};
|
|
221
228
|
// Trigger browser download
|
|
222
229
|
const dataStr = JSON.stringify(finalWorkflow, null, 2);
|
|
@@ -70,8 +70,17 @@ export interface InterfaceIssue {
|
|
|
70
70
|
* metadata ports (inputs and outputs) for the bound port. Returns `null` if
|
|
71
71
|
* the node no longer exists, or the port isn't among that node's metadata
|
|
72
72
|
* ports — the two ways a binding goes dangling.
|
|
73
|
+
*
|
|
74
|
+
* `PortBinding` carries no direction of its own, and a `portId` is only unique
|
|
75
|
+
* within one side of a node: plenty of node types name an input and an output
|
|
76
|
+
* the same thing (`chat_output` has both an input `message` and an output
|
|
77
|
+
* `message`). `prefer` — the owning entry's direction — decides which side is
|
|
78
|
+
* searched first, so such a binding resolves to the port the author actually
|
|
79
|
+
* picked. The other side is still searched as a fallback, so a genuinely
|
|
80
|
+
* misdirected binding (a port that exists only on the opposite side) still
|
|
81
|
+
* resolves and gets reported by `validateWorkflowInterface`.
|
|
73
82
|
*/
|
|
74
|
-
export declare function resolveBinding(workflow: Workflow, binding: PortBinding): ResolvedBinding | null;
|
|
83
|
+
export declare function resolveBinding(workflow: Workflow, binding: PortBinding, prefer?: 'input' | 'output'): ResolvedBinding | null;
|
|
75
84
|
/**
|
|
76
85
|
* Resolve every entry of `workflow.interface` (inputs then outputs) against
|
|
77
86
|
* the live node graph, with a health status per entry.
|
|
@@ -33,19 +33,28 @@ const STATUS_PRECEDENCE = [
|
|
|
33
33
|
* metadata ports (inputs and outputs) for the bound port. Returns `null` if
|
|
34
34
|
* the node no longer exists, or the port isn't among that node's metadata
|
|
35
35
|
* ports — the two ways a binding goes dangling.
|
|
36
|
+
*
|
|
37
|
+
* `PortBinding` carries no direction of its own, and a `portId` is only unique
|
|
38
|
+
* within one side of a node: plenty of node types name an input and an output
|
|
39
|
+
* the same thing (`chat_output` has both an input `message` and an output
|
|
40
|
+
* `message`). `prefer` — the owning entry's direction — decides which side is
|
|
41
|
+
* searched first, so such a binding resolves to the port the author actually
|
|
42
|
+
* picked. The other side is still searched as a fallback, so a genuinely
|
|
43
|
+
* misdirected binding (a port that exists only on the opposite side) still
|
|
44
|
+
* resolves and gets reported by `validateWorkflowInterface`.
|
|
36
45
|
*/
|
|
37
|
-
export function resolveBinding(workflow, binding) {
|
|
46
|
+
export function resolveBinding(workflow, binding, prefer = 'input') {
|
|
38
47
|
const node = workflow.nodes.find((candidate) => candidate.id === binding.nodeId);
|
|
39
48
|
if (!node)
|
|
40
49
|
return null;
|
|
41
50
|
const metadata = node.data?.metadata;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return
|
|
51
|
+
const find = (direction) => {
|
|
52
|
+
const ports = direction === 'input' ? metadata?.inputs : metadata?.outputs;
|
|
53
|
+
const port = ports?.find((candidate) => candidate.id === binding.portId);
|
|
54
|
+
return port ? { node, port, direction } : null;
|
|
55
|
+
};
|
|
56
|
+
const other = prefer === 'input' ? 'output' : 'input';
|
|
57
|
+
return find(prefer) ?? find(other);
|
|
49
58
|
}
|
|
50
59
|
/** The instance's `config.ports` entries for a resolved binding's own direction. */
|
|
51
60
|
function portConfigEntriesFor(target) {
|
|
@@ -60,7 +69,7 @@ function resolveEntry(workflow, entry, direction) {
|
|
|
60
69
|
if (entry.bindings.length === 0) {
|
|
61
70
|
return { entry, direction, targets: [], status: 'unbound' };
|
|
62
71
|
}
|
|
63
|
-
const resolved = entry.bindings.map((binding) => resolveBinding(workflow, binding));
|
|
72
|
+
const resolved = entry.bindings.map((binding) => resolveBinding(workflow, binding, direction));
|
|
64
73
|
const targets = resolved.filter((target) => target !== null);
|
|
65
74
|
const isDangling = targets.length !== resolved.length;
|
|
66
75
|
let status;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "A drop-in visual workflow editor for any web application. You own the backend. You own the data. You own the orchestration.",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "2.1.
|
|
6
|
+
"version": "2.1.1",
|
|
7
7
|
"author": "Shibin Das (D34dMan)",
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://github.com/flowdrop-io/flowdrop/issues"
|