@particle-academy/fancy-flow 0.50.0 → 0.51.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/dist/{ConfigFieldRenderer-CrXFq6Eb.d.cts → ConfigFieldRenderer-Bc9Txnql.d.cts} +2 -2
- package/dist/{ConfigFieldRenderer-u3nYHovX.d.ts → ConfigFieldRenderer-Bt3RGT7Z.d.ts} +2 -2
- package/dist/{FlowViewer-DRgjeWJ7.d.ts → FlowViewer-BI_AyyvU.d.ts} +1 -1
- package/dist/{FlowViewer-CFSMlCqi.d.cts → FlowViewer-DABx-6A-.d.cts} +1 -1
- package/dist/{capabilities-VzgDApur.d.cts → capabilities-BYa5p5jw.d.cts} +1 -1
- package/dist/{capabilities-B00VXLUp.d.ts → capabilities-COOXRiNL.d.ts} +1 -1
- package/dist/{chunk-XJMWMU4J.js → chunk-4GO2CHAY.js} +90 -7
- package/dist/chunk-4GO2CHAY.js.map +1 -0
- package/dist/{chunk-OWDSPRAF.js → chunk-OECW2E5D.js} +4 -4
- package/dist/{chunk-OWDSPRAF.js.map → chunk-OECW2E5D.js.map} +1 -1
- package/dist/{chunk-BAHJVX3S.js → chunk-OK7KJLWA.js} +3 -3
- package/dist/{chunk-BAHJVX3S.js.map → chunk-OK7KJLWA.js.map} +1 -1
- package/dist/{chunk-I4F6GI3A.js → chunk-RSRXKZ52.js} +3 -3
- package/dist/{chunk-I4F6GI3A.js.map → chunk-RSRXKZ52.js.map} +1 -1
- package/dist/{chunk-3W26FA7Q.js → chunk-SPINP4EJ.js} +18 -4
- package/dist/chunk-SPINP4EJ.js.map +1 -0
- package/dist/{chunk-DQJIU55F.js → chunk-VUU3CDBT.js} +3 -3
- package/dist/{chunk-DQJIU55F.js.map → chunk-VUU3CDBT.js.map} +1 -1
- package/dist/connectors.d.cts +2 -2
- package/dist/connectors.d.ts +2 -2
- package/dist/durable/index.d.cts +2 -2
- package/dist/durable/index.d.ts +2 -2
- package/dist/durable.cjs +88 -5
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +1 -1
- package/dist/engine.cjs +88 -5
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.cts +7 -7
- package/dist/engine.d.ts +7 -7
- package/dist/engine.js +3 -3
- package/dist/fields/react-fancy.d.cts +3 -3
- package/dist/fields/react-fancy.d.ts +3 -3
- package/dist/index.cjs +103 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -11
- package/dist/layout/index.d.cts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/llm/prism.d.cts +2 -2
- package/dist/llm/prism.d.ts +2 -2
- package/dist/llm/vercel-ai.d.cts +2 -2
- package/dist/llm/vercel-ai.d.ts +2 -2
- package/dist/registry/index.d.cts +6 -6
- package/dist/registry/index.d.ts +6 -6
- package/dist/{registry-6cB5wCv6.d.ts → registry-3RkSYrMi.d.ts} +1 -1
- package/dist/{registry-DQh7ZmnM.d.cts → registry-C6TMfiD_.d.cts} +1 -1
- package/dist/registry.cjs +88 -5
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -2
- package/dist/{run-cohort-VX4JG21l.d.ts → run-cohort-BPIOpE8A.d.ts} +2 -2
- package/dist/{run-cohort-DYCL8Qv6.d.cts → run-cohort-r-L8dMED.d.cts} +2 -2
- package/dist/{run-flow-B24QUO1H.d.cts → run-flow-COdAOFg2.d.cts} +10 -1
- package/dist/{run-flow-DPUPAWk6.d.ts → run-flow-DJ7KYT6E.d.ts} +10 -1
- package/dist/runtime/index.d.cts +5 -5
- package/dist/runtime/index.d.ts +5 -5
- package/dist/runtime.cjs +88 -5
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema/index.d.cts +12 -1
- package/dist/schema/index.d.ts +12 -1
- package/dist/schema.cjs +103 -6
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/screens.cjs +88 -5
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.d.cts +2 -2
- package/dist/screens.d.ts +2 -2
- package/dist/screens.js +4 -4
- package/dist/{types-BtMOnb9I.d.cts → types-3sPauVRT.d.cts} +1 -1
- package/dist/{types-7cXcSQlx.d.cts → types-JFYjPJAG.d.cts} +37 -1
- package/dist/{types-7cXcSQlx.d.ts → types-JFYjPJAG.d.ts} +37 -1
- package/dist/{types-CDgIIj4c.d.ts → types-s643U1Hi.d.ts} +1 -1
- package/dist/ux.cjs +88 -5
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.d.cts +2 -2
- package/dist/ux.d.ts +2 -2
- package/dist/ux.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3W26FA7Q.js.map +0 -1
- package/dist/chunk-XJMWMU4J.js.map +0 -1
package/dist/engine.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { R as RunOptions, a as RunResult, r as runFlow } from './run-flow-
|
|
2
|
-
import { F as FlowGraph, R as RunEvent, N as NodeExecutor } from './types-
|
|
3
|
-
export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, E as ExecutorRegistry, d as FlowEdge, a as FlowNode, e as FlowNodeData, f as FlowNodeKind, g as NodeRunStatus, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, b as RunIdentity, c as RunIdentityJson, S as SubgraphNodeData, T as TriggerNodeData, i as escapeSegment } from './types-
|
|
4
|
-
export { C as CohortGuard, a as CohortOptions, b as CohortPolicy, c as CohortResult, r as runCohort } from './run-cohort-
|
|
5
|
-
export { d as defaultConfigFor, g as getNodeKind, k as kindIds, l as listNodeKinds, r as registerNodeKind, a as resolveKindId, v as validateConfig } from './registry-
|
|
6
|
-
export { b as CapabilityRequirement, C as ConfigField, M as ManifestProblem, c as ManifestValidation, d as NODE_MANIFEST_SCHEMA_VERSION, a as NodeCategory, N as NodeKindDefinition, e as NodePackageManifest, f as NodeRuntimeId, g as NodeRuntimeSpec, O as OutputField, h as OutputShape, P as PortSpec, S as SideEffects, i as checkCapabilities, j as checkRuntimeSupport, s as satisfiesRange, v as validateNodeManifest } from './types-
|
|
1
|
+
export { R as RunOptions, a as RunResult, r as runFlow } from './run-flow-COdAOFg2.cjs';
|
|
2
|
+
import { F as FlowGraph, R as RunEvent, N as NodeExecutor } from './types-JFYjPJAG.cjs';
|
|
3
|
+
export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, E as ExecutorRegistry, d as FlowEdge, a as FlowNode, e as FlowNodeData, f as FlowNodeKind, g as NodeRunStatus, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, b as RunIdentity, c as RunIdentityJson, S as SubgraphNodeData, T as TriggerNodeData, i as escapeSegment } from './types-JFYjPJAG.cjs';
|
|
4
|
+
export { C as CohortGuard, a as CohortOptions, b as CohortPolicy, c as CohortResult, r as runCohort } from './run-cohort-r-L8dMED.cjs';
|
|
5
|
+
export { d as defaultConfigFor, g as getNodeKind, k as kindIds, l as listNodeKinds, r as registerNodeKind, a as resolveKindId, v as validateConfig } from './registry-C6TMfiD_.cjs';
|
|
6
|
+
export { b as CapabilityRequirement, C as ConfigField, M as ManifestProblem, c as ManifestValidation, d as NODE_MANIFEST_SCHEMA_VERSION, a as NodeCategory, N as NodeKindDefinition, e as NodePackageManifest, f as NodeRuntimeId, g as NodeRuntimeSpec, O as OutputField, h as OutputShape, P as PortSpec, S as SideEffects, i as checkCapabilities, j as checkRuntimeSupport, s as satisfiesRange, v as validateNodeManifest } from './types-3sPauVRT.cjs';
|
|
7
7
|
import { P as PauseAwaiting } from './pause-9iT4tCEV.cjs';
|
|
8
8
|
export { L as LEGACY_PAUSE_PREFIXES, a as PAUSE_PREFIX, b as PauseSignal, d as decodePause, e as encodePause, i as isPause, p as pauseForHuman } from './pause-9iT4tCEV.cjs';
|
|
9
|
-
import { W as WorkflowResolver } from './capabilities-
|
|
9
|
+
import { W as WorkflowResolver } from './capabilities-BYa5p5jw.cjs';
|
|
10
10
|
import '@xyflow/react';
|
|
11
11
|
import 'react';
|
|
12
12
|
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { R as RunOptions, a as RunResult, r as runFlow } from './run-flow-
|
|
2
|
-
import { F as FlowGraph, R as RunEvent, N as NodeExecutor } from './types-
|
|
3
|
-
export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, E as ExecutorRegistry, d as FlowEdge, a as FlowNode, e as FlowNodeData, f as FlowNodeKind, g as NodeRunStatus, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, b as RunIdentity, c as RunIdentityJson, S as SubgraphNodeData, T as TriggerNodeData, i as escapeSegment } from './types-
|
|
4
|
-
export { C as CohortGuard, a as CohortOptions, b as CohortPolicy, c as CohortResult, r as runCohort } from './run-cohort-
|
|
5
|
-
export { d as defaultConfigFor, g as getNodeKind, k as kindIds, l as listNodeKinds, r as registerNodeKind, a as resolveKindId, v as validateConfig } from './registry-
|
|
6
|
-
export { b as CapabilityRequirement, C as ConfigField, M as ManifestProblem, c as ManifestValidation, d as NODE_MANIFEST_SCHEMA_VERSION, a as NodeCategory, N as NodeKindDefinition, e as NodePackageManifest, f as NodeRuntimeId, g as NodeRuntimeSpec, O as OutputField, h as OutputShape, P as PortSpec, S as SideEffects, i as checkCapabilities, j as checkRuntimeSupport, s as satisfiesRange, v as validateNodeManifest } from './types-
|
|
1
|
+
export { R as RunOptions, a as RunResult, r as runFlow } from './run-flow-DJ7KYT6E.js';
|
|
2
|
+
import { F as FlowGraph, R as RunEvent, N as NodeExecutor } from './types-JFYjPJAG.js';
|
|
3
|
+
export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, E as ExecutorRegistry, d as FlowEdge, a as FlowNode, e as FlowNodeData, f as FlowNodeKind, g as NodeRunStatus, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, b as RunIdentity, c as RunIdentityJson, S as SubgraphNodeData, T as TriggerNodeData, i as escapeSegment } from './types-JFYjPJAG.js';
|
|
4
|
+
export { C as CohortGuard, a as CohortOptions, b as CohortPolicy, c as CohortResult, r as runCohort } from './run-cohort-BPIOpE8A.js';
|
|
5
|
+
export { d as defaultConfigFor, g as getNodeKind, k as kindIds, l as listNodeKinds, r as registerNodeKind, a as resolveKindId, v as validateConfig } from './registry-3RkSYrMi.js';
|
|
6
|
+
export { b as CapabilityRequirement, C as ConfigField, M as ManifestProblem, c as ManifestValidation, d as NODE_MANIFEST_SCHEMA_VERSION, a as NodeCategory, N as NodeKindDefinition, e as NodePackageManifest, f as NodeRuntimeId, g as NodeRuntimeSpec, O as OutputField, h as OutputShape, P as PortSpec, S as SideEffects, i as checkCapabilities, j as checkRuntimeSupport, s as satisfiesRange, v as validateNodeManifest } from './types-s643U1Hi.js';
|
|
7
7
|
import { P as PauseAwaiting } from './pause-9iT4tCEV.js';
|
|
8
8
|
export { L as LEGACY_PAUSE_PREFIXES, a as PAUSE_PREFIX, b as PauseSignal, d as decodePause, e as encodePause, i as isPause, p as pauseForHuman } from './pause-9iT4tCEV.js';
|
|
9
|
-
import { W as WorkflowResolver } from './capabilities-
|
|
9
|
+
import { W as WorkflowResolver } from './capabilities-COOXRiNL.js';
|
|
10
10
|
import '@xyflow/react';
|
|
11
11
|
import 'react';
|
|
12
12
|
|
package/dist/engine.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { runCohort } from './chunk-
|
|
1
|
+
export { runCohort } from './chunk-VUU3CDBT.js';
|
|
2
2
|
import { decodePause } from './chunk-UEOE6B52.js';
|
|
3
3
|
export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-UEOE6B52.js';
|
|
4
|
-
import { runFlow, getNodeKind, resolveNodePorts } from './chunk-
|
|
5
|
-
export { RunIdentity, defaultConfigFor, escapeSegment, getNodeKind, kindIds, listNodeKinds, registerNodeKind, resolveKindId, runFlow, validateConfig } from './chunk-
|
|
4
|
+
import { runFlow, getNodeKind, resolveNodePorts } from './chunk-4GO2CHAY.js';
|
|
5
|
+
export { RunIdentity, defaultConfigFor, escapeSegment, getNodeKind, kindIds, listNodeKinds, registerNodeKind, resolveKindId, runFlow, validateConfig } from './chunk-4GO2CHAY.js';
|
|
6
6
|
import './chunk-F5RPRB7A.js';
|
|
7
7
|
import { isResolutionFailure, registerLlmClient, registerWorkflowResolver } from './chunk-USL4FMFU.js';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ConfigFieldRenderFn } from '../ConfigFieldRenderer-
|
|
1
|
+
import { C as ConfigFieldRenderFn } from '../ConfigFieldRenderer-Bc9Txnql.cjs';
|
|
2
2
|
import 'react';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-JFYjPJAG.cjs';
|
|
4
4
|
import '@xyflow/react';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-3sPauVRT.cjs';
|
|
6
6
|
import '../pause-9iT4tCEV.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ConfigFieldRenderFn } from '../ConfigFieldRenderer-
|
|
1
|
+
import { C as ConfigFieldRenderFn } from '../ConfigFieldRenderer-Bt3RGT7Z.js';
|
|
2
2
|
import 'react';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-JFYjPJAG.js';
|
|
4
4
|
import '@xyflow/react';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-s643U1Hi.js';
|
|
6
6
|
import '../pause-9iT4tCEV.js';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -11098,6 +11098,61 @@ var RunIdentity = class _RunIdentity {
|
|
|
11098
11098
|
}
|
|
11099
11099
|
};
|
|
11100
11100
|
|
|
11101
|
+
// src/runtime/workflow-props.ts
|
|
11102
|
+
function typeOf(value) {
|
|
11103
|
+
if (value === null) return "null";
|
|
11104
|
+
if (Array.isArray(value)) return "array";
|
|
11105
|
+
return typeof value;
|
|
11106
|
+
}
|
|
11107
|
+
function resolveWorkflowProps(declared, passed) {
|
|
11108
|
+
const inputs = declared ?? [];
|
|
11109
|
+
const given = passed ?? {};
|
|
11110
|
+
const byName = new Map(inputs.map((input) => [input.name, input]));
|
|
11111
|
+
for (const name of Object.keys(given)) {
|
|
11112
|
+
if (!byName.has(name)) {
|
|
11113
|
+
const known = inputs.map((input) => input.name);
|
|
11114
|
+
const suffix = known.length === 0 ? "this workflow declares no inputs" : `known inputs: ${known.join(", ")}`;
|
|
11115
|
+
return {
|
|
11116
|
+
ok: false,
|
|
11117
|
+
code: "unknown_input",
|
|
11118
|
+
error: `Unknown workflow input "${name}" \u2014 ${suffix}.`
|
|
11119
|
+
};
|
|
11120
|
+
}
|
|
11121
|
+
}
|
|
11122
|
+
const resolved = {};
|
|
11123
|
+
for (const input of inputs) {
|
|
11124
|
+
const supplied = Object.prototype.hasOwnProperty.call(given, input.name);
|
|
11125
|
+
const hasDefault = Object.prototype.hasOwnProperty.call(input, "default");
|
|
11126
|
+
if (!supplied) {
|
|
11127
|
+
if (hasDefault) {
|
|
11128
|
+
resolved[input.name] = input.default;
|
|
11129
|
+
continue;
|
|
11130
|
+
}
|
|
11131
|
+
if (input.required) {
|
|
11132
|
+
return {
|
|
11133
|
+
ok: false,
|
|
11134
|
+
code: "missing_required",
|
|
11135
|
+
error: `Missing required workflow input "${input.name}"${input.type ? ` (${input.type})` : ""}.`
|
|
11136
|
+
};
|
|
11137
|
+
}
|
|
11138
|
+
continue;
|
|
11139
|
+
}
|
|
11140
|
+
const value = given[input.name];
|
|
11141
|
+
if (input.type !== void 0) {
|
|
11142
|
+
const actual = typeOf(value);
|
|
11143
|
+
if (actual !== input.type) {
|
|
11144
|
+
return {
|
|
11145
|
+
ok: false,
|
|
11146
|
+
code: "type_mismatch",
|
|
11147
|
+
error: `Workflow input "${input.name}" expects ${input.type}, got ${actual}.`
|
|
11148
|
+
};
|
|
11149
|
+
}
|
|
11150
|
+
}
|
|
11151
|
+
resolved[input.name] = value;
|
|
11152
|
+
}
|
|
11153
|
+
return { ok: true, props: resolved };
|
|
11154
|
+
}
|
|
11155
|
+
|
|
11101
11156
|
// src/runtime/run-flow.ts
|
|
11102
11157
|
async function runFlow(graph, executors, onEvent = () => {
|
|
11103
11158
|
}, options = {}) {
|
|
@@ -11113,6 +11168,13 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
11113
11168
|
onEvent({ type: "run-error", error: msg });
|
|
11114
11169
|
return { ok: false, outputs, error: msg };
|
|
11115
11170
|
}
|
|
11171
|
+
const propsCheck = resolveWorkflowProps(graph.inputs, options.props);
|
|
11172
|
+
if (!propsCheck.ok) {
|
|
11173
|
+
onEvent({ type: "run-error", error: propsCheck.error });
|
|
11174
|
+
return { ok: false, outputs, error: propsCheck.error };
|
|
11175
|
+
}
|
|
11176
|
+
const props = propsCheck.props;
|
|
11177
|
+
const declaresProps = (graph.inputs?.length ?? 0) > 0;
|
|
11116
11178
|
const incomingByNode = indexIncoming(graph.edges);
|
|
11117
11179
|
const timer2 = timeoutMs ? setTimeout(() => errors.push(`Run timed out after ${timeoutMs}ms`), timeoutMs) : null;
|
|
11118
11180
|
onEvent({ type: "run-start" });
|
|
@@ -11154,10 +11216,11 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
11154
11216
|
}
|
|
11155
11217
|
onEvent({ type: "node-status", nodeId: node.id, status: "running" });
|
|
11156
11218
|
announce(onEvent, node, "start");
|
|
11157
|
-
const inputs = collectInputs(node, incoming, portValues, initialInputs);
|
|
11219
|
+
const inputs = collectInputs(node, incoming, portValues, initialInputs, props, declaresProps);
|
|
11158
11220
|
const exec = pickExecutor(executors, node);
|
|
11159
11221
|
if (!exec) {
|
|
11160
|
-
const
|
|
11222
|
+
const tried = executorLookupIds(node);
|
|
11223
|
+
const msg = `No executor registered for kind=${node.type} \u2014 tried ${tried.map((id2) => `"${id2}"`).join(", ")} and the wildcard "*". Key your registry by one of those.`;
|
|
11161
11224
|
errors.push(msg);
|
|
11162
11225
|
onEvent({ type: "node-status", nodeId: node.id, status: "error", text: msg });
|
|
11163
11226
|
onEvent({ type: "log", nodeId: node.id, level: "error", message: msg });
|
|
@@ -11231,8 +11294,13 @@ function topoSort(graph) {
|
|
|
11231
11294
|
const byId = new Map(graph.nodes.map((n) => [n.id, n]));
|
|
11232
11295
|
return ordered.map((id2) => byId.get(id2)).filter(Boolean);
|
|
11233
11296
|
}
|
|
11234
|
-
function collectInputs(node, incoming, portValues, initial) {
|
|
11297
|
+
function collectInputs(node, incoming, portValues, initial, props, declaresProps) {
|
|
11235
11298
|
const inputs = { ...initial[node.id] ?? {} };
|
|
11299
|
+
if (incoming.length === 0) {
|
|
11300
|
+
for (const [name, value] of Object.entries(props)) {
|
|
11301
|
+
if (!(name in inputs)) inputs[name] = value;
|
|
11302
|
+
}
|
|
11303
|
+
}
|
|
11236
11304
|
for (const e of incoming) {
|
|
11237
11305
|
const portId = e.targetHandle ?? "in";
|
|
11238
11306
|
const key = `${e.source}:${e.sourceHandle ?? "out"}`;
|
|
@@ -11242,16 +11310,31 @@ function collectInputs(node, incoming, portValues, initial) {
|
|
|
11242
11310
|
inputs[e.source] = portValues.get(key);
|
|
11243
11311
|
}
|
|
11244
11312
|
}
|
|
11313
|
+
if (declaresProps) inputs.$props = props;
|
|
11245
11314
|
return inputs;
|
|
11246
11315
|
}
|
|
11316
|
+
function executorLookupIds(node) {
|
|
11317
|
+
const ids = [node.id];
|
|
11318
|
+
if (node.type) ids.push(node.type);
|
|
11319
|
+
const declared = node.data?.kind;
|
|
11320
|
+
const kindName = typeof declared === "string" && declared !== "" ? declared : node.type;
|
|
11321
|
+
if (kindName && kindName !== node.type) ids.push(kindName);
|
|
11322
|
+
for (const name of [kindName, node.type]) {
|
|
11323
|
+
const kind = name ? getNodeKind(name) : null;
|
|
11324
|
+
if (!kind) continue;
|
|
11325
|
+
for (const id2 of kindIds(kind)) ids.push(id2);
|
|
11326
|
+
}
|
|
11327
|
+
return [...new Set(ids)];
|
|
11328
|
+
}
|
|
11247
11329
|
function pickExecutor(executors, node) {
|
|
11248
11330
|
if (executors[node.id]) return executors[node.id];
|
|
11249
11331
|
if (node.type && executors[node.type]) return executors[node.type];
|
|
11250
11332
|
const declared = node.data?.kind;
|
|
11251
11333
|
const kindName = typeof declared === "string" && declared !== "" ? declared : node.type;
|
|
11252
11334
|
if (kindName && kindName !== node.type && executors[kindName]) return executors[kindName];
|
|
11253
|
-
const
|
|
11254
|
-
|
|
11335
|
+
for (const name of [kindName, node.type]) {
|
|
11336
|
+
const kind = name ? getNodeKind(name) : null;
|
|
11337
|
+
if (!kind) continue;
|
|
11255
11338
|
for (const id2 of kindIds(kind)) {
|
|
11256
11339
|
if (executors[id2]) return executors[id2];
|
|
11257
11340
|
}
|
|
@@ -14116,6 +14199,9 @@ function exportWorkflow(graph, metadata, view) {
|
|
|
14116
14199
|
$schema: WORKFLOW_SCHEMA_URL,
|
|
14117
14200
|
version: WORKFLOW_SCHEMA_VERSION,
|
|
14118
14201
|
metadata: metadata ? { ...metadata, updatedAt: Date.now() } : void 0,
|
|
14202
|
+
// Round-trips, or a saved workflow silently forgets its own contract and
|
|
14203
|
+
// every caller's props become "unknown input" on the next load.
|
|
14204
|
+
...graph.inputs && graph.inputs.length > 0 ? { inputs: graph.inputs } : {},
|
|
14119
14205
|
graph: {
|
|
14120
14206
|
nodes: graph.nodes.map(toSchemaNode),
|
|
14121
14207
|
edges: graph.edges.map(toSchemaEdge)
|
|
@@ -14238,7 +14324,18 @@ function importWorkflow(schema, options = {}) {
|
|
|
14238
14324
|
};
|
|
14239
14325
|
}).filter((e) => e !== null);
|
|
14240
14326
|
const ok = issues.every((i) => i.level !== "error");
|
|
14241
|
-
|
|
14327
|
+
const declaredInputs = Array.isArray(s.inputs) ? s.inputs.filter(
|
|
14328
|
+
(input) => input !== null && typeof input === "object" && typeof input.name === "string"
|
|
14329
|
+
) : void 0;
|
|
14330
|
+
return {
|
|
14331
|
+
ok,
|
|
14332
|
+
graph: {
|
|
14333
|
+
nodes,
|
|
14334
|
+
edges,
|
|
14335
|
+
...declaredInputs && declaredInputs.length > 0 ? { inputs: declaredInputs } : {}
|
|
14336
|
+
},
|
|
14337
|
+
issues
|
|
14338
|
+
};
|
|
14242
14339
|
}
|
|
14243
14340
|
function workflowToBlob(schema) {
|
|
14244
14341
|
return new Blob([JSON.stringify(schema, null, 2)], { type: "application/json" });
|