@particle-academy/fancy-flow 0.71.0 → 0.72.0
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/{chunk-3L47KJ6Q.js → chunk-57QTX3S3.js} +3 -3
- package/dist/{chunk-3L47KJ6Q.js.map → chunk-57QTX3S3.js.map} +1 -1
- package/dist/{chunk-KQCX6KN7.js → chunk-6TC44VCY.js} +3 -3
- package/dist/{chunk-KQCX6KN7.js.map → chunk-6TC44VCY.js.map} +1 -1
- package/dist/{chunk-EVGSL2EM.js → chunk-C5K2DSZB.js} +157 -148
- package/dist/chunk-C5K2DSZB.js.map +1 -0
- package/dist/{chunk-D2OBU3CE.js → chunk-E3U3MBKI.js} +3 -3
- package/dist/{chunk-D2OBU3CE.js.map → chunk-E3U3MBKI.js.map} +1 -1
- package/dist/{chunk-FPWJYSXX.js → chunk-R3GQ72WA.js} +4 -4
- package/dist/{chunk-FPWJYSXX.js.map → chunk-R3GQ72WA.js.map} +1 -1
- package/dist/{chunk-PNTDTSMR.js → chunk-RQP666FB.js} +4 -4
- package/dist/{chunk-PNTDTSMR.js.map → chunk-RQP666FB.js.map} +1 -1
- package/dist/{chunk-XI4AZD2S.js → chunk-ZEDBF2V6.js} +3 -3
- package/dist/{chunk-XI4AZD2S.js.map → chunk-ZEDBF2V6.js.map} +1 -1
- package/dist/durable/index.d.cts +45 -4
- package/dist/durable/index.d.ts +45 -4
- package/dist/durable.cjs +137 -72
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +61 -5
- package/dist/durable.js.map +1 -1
- package/dist/engine.cjs +77 -68
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.js +4 -4
- package/dist/index.cjs +123 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/registry.cjs +77 -68
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -2
- package/dist/runtime.cjs +77 -68
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema.cjs +77 -68
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +3 -3
- package/dist/screens.cjs +77 -68
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.js +4 -4
- package/dist/ux.cjs +77 -68
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-EVGSL2EM.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-
|
|
2
|
-
export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-
|
|
3
|
-
import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-
|
|
4
|
-
export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-
|
|
5
|
-
export { runCohort } from './chunk-
|
|
6
|
-
import { buildNodeTypes, FlowEditorProvider, registerBuiltinKinds } from './chunk-
|
|
7
|
-
export { ANY_PORT_TYPE, BUILTIN_KINDS, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional } from './chunk-
|
|
1
|
+
import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-R3GQ72WA.js';
|
|
2
|
+
export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-R3GQ72WA.js';
|
|
3
|
+
import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-ZEDBF2V6.js';
|
|
4
|
+
export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-ZEDBF2V6.js';
|
|
5
|
+
export { runCohort } from './chunk-E3U3MBKI.js';
|
|
6
|
+
import { buildNodeTypes, FlowEditorProvider, registerBuiltinKinds } from './chunk-57QTX3S3.js';
|
|
7
|
+
export { ANY_PORT_TYPE, BUILTIN_KINDS, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional } from './chunk-57QTX3S3.js';
|
|
8
8
|
import { getRichInputAdapter } from './chunk-F5RPRB7A.js';
|
|
9
9
|
export { RichInputPreview, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerRichInputAdapter } from './chunk-F5RPRB7A.js';
|
|
10
10
|
import { ReactFlowProvider, useReactFlow, addEdge, applyEdgeChanges, applyNodeChanges, Position, Handle } from './chunk-OWENS2H5.js';
|
|
11
11
|
export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-UEOE6B52.js';
|
|
12
|
-
import { workflowToBlob, importWorkflow, exportWorkflow } from './chunk-
|
|
13
|
-
export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
import { humanInputFields, onNodeKindsChanged, listNodeKinds, getNodeKind, defaultConfigFor, ensureBuiltinKinds, validateConfig, categoryAccent, availableVariables, baseVariables, describeExpressionGrammar } from './chunk-
|
|
16
|
-
export { UnresolvedPathError, applyKindSchemaOverlay, availableVariables, baseVariables, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, defaultConfigFor, describeExpressionGrammar, ensureBuiltinKinds, evaluateConfig, evaluateExpression, getNodeKind, listNodeKinds, onNodeKindsChanged, outputFieldsFor, overrideNodeKind, registerNodeKind, resolveNodePorts, resolvePath, resolvePortSpec, runFlow, text, truthy, tryResolvePath, unregisterNodeKind, validateConfig } from './chunk-
|
|
12
|
+
import { workflowToBlob, importWorkflow, exportWorkflow } from './chunk-RQP666FB.js';
|
|
13
|
+
export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-RQP666FB.js';
|
|
14
|
+
import './chunk-6TC44VCY.js';
|
|
15
|
+
import { humanInputFields, onNodeKindsChanged, listNodeKinds, getNodeKind, defaultConfigFor, ensureBuiltinKinds, validateConfig, categoryAccent, availableVariables, baseVariables, describeExpressionGrammar } from './chunk-C5K2DSZB.js';
|
|
16
|
+
export { UnresolvedPathError, applyKindSchemaOverlay, availableVariables, baseVariables, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, defaultConfigFor, describeExpressionGrammar, ensureBuiltinKinds, evaluateConfig, evaluateExpression, getNodeKind, listNodeKinds, onNodeKindsChanged, outputFieldsFor, overrideNodeKind, registerNodeKind, resolveNodePorts, resolvePath, resolvePortSpec, runFlow, text, truthy, tryResolvePath, unregisterNodeKind, validateConfig } from './chunk-C5K2DSZB.js';
|
|
17
17
|
import './chunk-2QXKDLGT.js';
|
|
18
18
|
import { forwardRef, useState, useMemo, useEffect, useCallback, useRef, useImperativeHandle, useId, memo } from 'react';
|
|
19
19
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
package/dist/registry.cjs
CHANGED
|
@@ -187,24 +187,6 @@ var llmRouterExecutor = async (ctx) => {
|
|
|
187
187
|
return { __port: port, value: { route: port, reason, input: ctx.inputs } };
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
// src/expressions/variables.ts
|
|
191
|
-
function outputFieldsFor(node) {
|
|
192
|
-
const kindName = node.data?.kind ?? node.type;
|
|
193
|
-
if (!kindName) return [];
|
|
194
|
-
const kind = getNodeKind(kindName);
|
|
195
|
-
const shape = kind?.outputShape;
|
|
196
|
-
if (!shape) return [];
|
|
197
|
-
if (typeof shape === "function") {
|
|
198
|
-
try {
|
|
199
|
-
const config = node.data?.config ?? {};
|
|
200
|
-
return shape(config) ?? [];
|
|
201
|
-
} catch {
|
|
202
|
-
return [];
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return shape;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
190
|
// src/runtime/run-identity.ts
|
|
209
191
|
function escapeSegment(value) {
|
|
210
192
|
return value.replace(/%/g, "%25").replace(/\//g, "%2F").replace(/#/g, "%23");
|
|
@@ -558,6 +540,81 @@ function specForLane(lane) {
|
|
|
558
540
|
};
|
|
559
541
|
}
|
|
560
542
|
|
|
543
|
+
// src/expressions/variables.ts
|
|
544
|
+
function outputFieldsFor(node) {
|
|
545
|
+
const kindName = node.data?.kind ?? node.type;
|
|
546
|
+
if (!kindName) return [];
|
|
547
|
+
const kind = getNodeKind(kindName);
|
|
548
|
+
const shape = kind?.outputShape;
|
|
549
|
+
if (!shape) return [];
|
|
550
|
+
if (typeof shape === "function") {
|
|
551
|
+
try {
|
|
552
|
+
const config = node.data?.config ?? {};
|
|
553
|
+
return shape(config) ?? [];
|
|
554
|
+
} catch {
|
|
555
|
+
return [];
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
return shape;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// src/runtime/undelivered-edges.ts
|
|
562
|
+
function undeliveredEdgeWarnings(target, incoming, portValues, completed, nodesById) {
|
|
563
|
+
const events = [];
|
|
564
|
+
for (const e of incoming) {
|
|
565
|
+
const handle = e.sourceHandle ?? "out";
|
|
566
|
+
if (portValues.has(`${e.source}:${handle}`) || !completed.has(e.source)) continue;
|
|
567
|
+
if (possiblePortIds(nodesById.get(e.source)).includes(handle)) continue;
|
|
568
|
+
events.push({
|
|
569
|
+
type: "log",
|
|
570
|
+
nodeId: target.id,
|
|
571
|
+
level: "warn",
|
|
572
|
+
message: undeliveredEdgeMessage(e, target, portValues, nodesById),
|
|
573
|
+
detail: { edge: e.id, source: e.source, sourceHandle: handle }
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
return events;
|
|
577
|
+
}
|
|
578
|
+
function possiblePortIds(node) {
|
|
579
|
+
if (!node) return ["out"];
|
|
580
|
+
const own = node.data?.outputs;
|
|
581
|
+
if (Array.isArray(own)) return own.map((p) => p.id);
|
|
582
|
+
const kind = getNodeKind(node.data?.kind ?? node.type ?? "");
|
|
583
|
+
if (!kind) return ["out"];
|
|
584
|
+
const config = nodeConfig(node);
|
|
585
|
+
const representative = typeof kind.outputs === "function" && !configDeclaresPorts(kind.name, config);
|
|
586
|
+
const ids = (resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config) ?? []).map((p) => p.id);
|
|
587
|
+
return ids.length > 0 ? ids : ["out"];
|
|
588
|
+
}
|
|
589
|
+
function configDeclaresPorts(kindName, config) {
|
|
590
|
+
const bare = kindName.startsWith("@") ? kindName.slice(kindName.lastIndexOf("/") + 1) : kindName;
|
|
591
|
+
if (bare === "switch_case") {
|
|
592
|
+
const cases = config.cases;
|
|
593
|
+
return !!cases && typeof cases === "object" && Object.values(cases).some((port) => typeof port === "string" && port !== "");
|
|
594
|
+
}
|
|
595
|
+
if (bare === "llm_router") {
|
|
596
|
+
const routes = config.routes;
|
|
597
|
+
return Array.isArray(routes) && routes.some((route) => route?.port != null && route.port !== "");
|
|
598
|
+
}
|
|
599
|
+
return true;
|
|
600
|
+
}
|
|
601
|
+
function undeliveredEdgeMessage(edge, target, portValues, nodesById) {
|
|
602
|
+
const handle = edge.sourceHandle ?? "out";
|
|
603
|
+
const prefix = `${edge.source}:`;
|
|
604
|
+
const available = [];
|
|
605
|
+
for (const key of portValues.keys()) {
|
|
606
|
+
if (key.startsWith(prefix)) available.push(key.slice(prefix.length));
|
|
607
|
+
}
|
|
608
|
+
let message = `Edge ${edge.id} reads port "${handle}" from node ${edge.source}, which never publishes it \u2014 nothing would reach ${target.id} at run time.`;
|
|
609
|
+
if (available.length > 0) message += ` Available: ${available.join(", ")}.`;
|
|
610
|
+
const source = nodesById.get(edge.source);
|
|
611
|
+
if (source && outputFieldsFor(source).some((field) => field?.path === handle)) {
|
|
612
|
+
message += ` Note: "${handle}" is a FIELD this node emits, not a port \u2014 read it downstream as {{ in.${handle} }} rather than naming it as a source handle.`;
|
|
613
|
+
}
|
|
614
|
+
if (edge.sourceHandle != null) message += " Leave sourceHandle off to read the node's output.";
|
|
615
|
+
return message;
|
|
616
|
+
}
|
|
617
|
+
|
|
561
618
|
// src/runtime/workflow-props.ts
|
|
562
619
|
function typeOf(value) {
|
|
563
620
|
if (value === null) return "null";
|
|
@@ -679,17 +736,8 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
679
736
|
onEvent({ type: "node-status", nodeId: node.id, status: "idle", text: "skipped" });
|
|
680
737
|
continue;
|
|
681
738
|
}
|
|
682
|
-
for (const
|
|
683
|
-
|
|
684
|
-
if (portValues.has(`${e.source}:${handle}`) || !completed.has(e.source)) continue;
|
|
685
|
-
if (possiblePortIds(nodesById.get(e.source)).includes(handle)) continue;
|
|
686
|
-
onEvent({
|
|
687
|
-
type: "log",
|
|
688
|
-
nodeId: node.id,
|
|
689
|
-
level: "warn",
|
|
690
|
-
message: undeliveredEdgeMessage(e, node, portValues, nodesById),
|
|
691
|
-
detail: { edge: e.id, source: e.source, sourceHandle: handle }
|
|
692
|
-
});
|
|
739
|
+
for (const warning of undeliveredEdgeWarnings(node, incoming, portValues, completed, nodesById)) {
|
|
740
|
+
onEvent(warning);
|
|
693
741
|
}
|
|
694
742
|
if (incoming.length > 0) {
|
|
695
743
|
const anyActive = incoming.some((e) => portValues.has(`${e.source}:${e.sourceHandle ?? "out"}`));
|
|
@@ -853,45 +901,6 @@ function activatedPorts(node, result) {
|
|
|
853
901
|
const declared = resolveNodePorts(node, kind).outputs?.map((p) => p.id);
|
|
854
902
|
return { ports: declared?.length ? declared : ["out"], value: result };
|
|
855
903
|
}
|
|
856
|
-
function possiblePortIds(node) {
|
|
857
|
-
if (!node) return ["out"];
|
|
858
|
-
const own = node.data?.outputs;
|
|
859
|
-
if (Array.isArray(own)) return own.map((p) => p.id);
|
|
860
|
-
const kind = getNodeKind(node.data?.kind ?? node.type ?? "");
|
|
861
|
-
if (!kind) return ["out"];
|
|
862
|
-
const config = nodeConfig(node);
|
|
863
|
-
const representative = typeof kind.outputs === "function" && !configDeclaresPorts(kind.name, config);
|
|
864
|
-
const ids = (resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config) ?? []).map((p) => p.id);
|
|
865
|
-
return ids.length > 0 ? ids : ["out"];
|
|
866
|
-
}
|
|
867
|
-
function configDeclaresPorts(kindName, config) {
|
|
868
|
-
const bare = kindName.startsWith("@") ? kindName.slice(kindName.lastIndexOf("/") + 1) : kindName;
|
|
869
|
-
if (bare === "switch_case") {
|
|
870
|
-
const cases = config.cases;
|
|
871
|
-
return !!cases && typeof cases === "object" && Object.values(cases).some((port) => typeof port === "string" && port !== "");
|
|
872
|
-
}
|
|
873
|
-
if (bare === "llm_router") {
|
|
874
|
-
const routes = config.routes;
|
|
875
|
-
return Array.isArray(routes) && routes.some((route) => route?.port != null && route.port !== "");
|
|
876
|
-
}
|
|
877
|
-
return true;
|
|
878
|
-
}
|
|
879
|
-
function undeliveredEdgeMessage(edge, target, portValues, nodesById) {
|
|
880
|
-
const handle = edge.sourceHandle ?? "out";
|
|
881
|
-
const prefix = `${edge.source}:`;
|
|
882
|
-
const available = [];
|
|
883
|
-
for (const key of portValues.keys()) {
|
|
884
|
-
if (key.startsWith(prefix)) available.push(key.slice(prefix.length));
|
|
885
|
-
}
|
|
886
|
-
let message = `Edge ${edge.id} reads port "${handle}" from node ${edge.source}, which never publishes it \u2014 nothing would reach ${target.id} at run time.`;
|
|
887
|
-
if (available.length > 0) message += ` Available: ${available.join(", ")}.`;
|
|
888
|
-
const source = nodesById.get(edge.source);
|
|
889
|
-
if (source && outputFieldsFor(source).some((field) => field?.path === handle)) {
|
|
890
|
-
message += ` Note: "${handle}" is a FIELD this node emits, not a port \u2014 read it downstream as {{ in.${handle} }} rather than naming it as a source handle.`;
|
|
891
|
-
}
|
|
892
|
-
if (edge.sourceHandle != null) message += " Leave sourceHandle off to read the node's output.";
|
|
893
|
-
return message;
|
|
894
|
-
}
|
|
895
904
|
function announce(onEvent, node, phase) {
|
|
896
905
|
const data = node.data;
|
|
897
906
|
const raw = phase === "start" ? data?.startingMsg : data?.stoppingMsg;
|