@particle-academy/fancy-flow 0.71.0 → 0.72.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/{chunk-3L47KJ6Q.js → chunk-3RXQGYGH.js} +3 -3
- package/dist/{chunk-3L47KJ6Q.js.map → chunk-3RXQGYGH.js.map} +1 -1
- package/dist/{chunk-PNTDTSMR.js → chunk-7DJ56PUA.js} +4 -4
- package/dist/{chunk-PNTDTSMR.js.map → chunk-7DJ56PUA.js.map} +1 -1
- package/dist/{chunk-EVGSL2EM.js → chunk-EX34GCKK.js} +162 -151
- package/dist/chunk-EX34GCKK.js.map +1 -0
- package/dist/{chunk-XI4AZD2S.js → chunk-GQ5LEA7Q.js} +3 -3
- package/dist/{chunk-XI4AZD2S.js.map → chunk-GQ5LEA7Q.js.map} +1 -1
- package/dist/{chunk-D2OBU3CE.js → chunk-K7KO3UJ3.js} +3 -3
- package/dist/{chunk-D2OBU3CE.js.map → chunk-K7KO3UJ3.js.map} +1 -1
- package/dist/{chunk-FPWJYSXX.js → chunk-LYYQO7EY.js} +4 -4
- package/dist/{chunk-FPWJYSXX.js.map → chunk-LYYQO7EY.js.map} +1 -1
- package/dist/{chunk-KQCX6KN7.js → chunk-VAF2SWTC.js} +3 -3
- package/dist/{chunk-KQCX6KN7.js.map → chunk-VAF2SWTC.js.map} +1 -1
- package/dist/durable/index.d.cts +90 -16
- package/dist/durable/index.d.ts +90 -16
- package/dist/durable.cjs +160 -83
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +79 -14
- package/dist/durable.js.map +1 -1
- package/dist/engine.cjs +82 -71
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.cts +2 -2
- package/dist/engine.d.ts +2 -2
- package/dist/engine.js +4 -4
- package/dist/index.cjs +128 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/registry.cjs +82 -71
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -2
- package/dist/{run-cohort-DL9JzzPU.d.cts → run-cohort-DNpPa0mq.d.cts} +1 -1
- package/dist/{run-cohort-CjUBWg6X.d.ts → run-cohort-rgT_FX3V.d.ts} +1 -1
- package/dist/{run-flow-B_8hgO5_.d.cts → run-flow-BLP9rXfO.d.ts} +22 -1
- package/dist/{run-flow-CxEGBOxd.d.ts → run-flow-pW0PllaZ.d.cts} +22 -1
- package/dist/runtime/index.d.cts +3 -3
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime.cjs +82 -71
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema.cjs +82 -71
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +3 -3
- package/dist/screens.cjs +82 -71
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.js +4 -4
- package/dist/ux.cjs +82 -71
- 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/schema.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-7DJ56PUA.js';
|
|
2
|
+
import './chunk-VAF2SWTC.js';
|
|
3
|
+
import './chunk-EX34GCKK.js';
|
|
4
4
|
import './chunk-2QXKDLGT.js';
|
|
5
5
|
//# sourceMappingURL=schema.js.map
|
|
6
6
|
//# sourceMappingURL=schema.js.map
|
package/dist/screens.cjs
CHANGED
|
@@ -9334,24 +9334,6 @@ function resolveNodePorts(node, kind) {
|
|
|
9334
9334
|
};
|
|
9335
9335
|
}
|
|
9336
9336
|
|
|
9337
|
-
// src/expressions/variables.ts
|
|
9338
|
-
function outputFieldsFor(node) {
|
|
9339
|
-
const kindName = node.data?.kind ?? node.type;
|
|
9340
|
-
if (!kindName) return [];
|
|
9341
|
-
const kind = getNodeKind(kindName);
|
|
9342
|
-
const shape = kind?.outputShape;
|
|
9343
|
-
if (!shape) return [];
|
|
9344
|
-
if (typeof shape === "function") {
|
|
9345
|
-
try {
|
|
9346
|
-
const config = node.data?.config ?? {};
|
|
9347
|
-
return shape(config) ?? [];
|
|
9348
|
-
} catch {
|
|
9349
|
-
return [];
|
|
9350
|
-
}
|
|
9351
|
-
}
|
|
9352
|
-
return shape;
|
|
9353
|
-
}
|
|
9354
|
-
|
|
9355
9337
|
// src/runtime/run-identity.ts
|
|
9356
9338
|
function escapeSegment(value) {
|
|
9357
9339
|
return value.replace(/%/g, "%25").replace(/\//g, "%2F").replace(/#/g, "%23");
|
|
@@ -9695,6 +9677,81 @@ function specForLane(lane) {
|
|
|
9695
9677
|
};
|
|
9696
9678
|
}
|
|
9697
9679
|
|
|
9680
|
+
// src/expressions/variables.ts
|
|
9681
|
+
function outputFieldsFor(node) {
|
|
9682
|
+
const kindName = node.data?.kind ?? node.type;
|
|
9683
|
+
if (!kindName) return [];
|
|
9684
|
+
const kind = getNodeKind(kindName);
|
|
9685
|
+
const shape = kind?.outputShape;
|
|
9686
|
+
if (!shape) return [];
|
|
9687
|
+
if (typeof shape === "function") {
|
|
9688
|
+
try {
|
|
9689
|
+
const config = node.data?.config ?? {};
|
|
9690
|
+
return shape(config) ?? [];
|
|
9691
|
+
} catch {
|
|
9692
|
+
return [];
|
|
9693
|
+
}
|
|
9694
|
+
}
|
|
9695
|
+
return shape;
|
|
9696
|
+
}
|
|
9697
|
+
|
|
9698
|
+
// src/runtime/undelivered-edges.ts
|
|
9699
|
+
function undeliveredEdgeWarnings(target, incoming, portValues, completed, nodesById) {
|
|
9700
|
+
const events = [];
|
|
9701
|
+
for (const e of incoming) {
|
|
9702
|
+
const handle = e.sourceHandle ?? "out";
|
|
9703
|
+
if (portValues.has(`${e.source}:${handle}`) || !completed.has(e.source)) continue;
|
|
9704
|
+
if (possiblePortIds(nodesById.get(e.source)).includes(handle)) continue;
|
|
9705
|
+
events.push({
|
|
9706
|
+
type: "log",
|
|
9707
|
+
nodeId: target.id,
|
|
9708
|
+
level: "warn",
|
|
9709
|
+
message: undeliveredEdgeMessage(e, target, portValues, nodesById),
|
|
9710
|
+
detail: { edge: e.id, source: e.source, sourceHandle: handle }
|
|
9711
|
+
});
|
|
9712
|
+
}
|
|
9713
|
+
return events;
|
|
9714
|
+
}
|
|
9715
|
+
function possiblePortIds(node) {
|
|
9716
|
+
if (!node) return ["out"];
|
|
9717
|
+
const own = node.data?.outputs;
|
|
9718
|
+
if (Array.isArray(own)) return own.map((p) => p.id);
|
|
9719
|
+
const kind = getNodeKind(node.data?.kind ?? node.type ?? "");
|
|
9720
|
+
if (!kind) return ["out"];
|
|
9721
|
+
const config = nodeConfig(node);
|
|
9722
|
+
const representative = typeof kind.outputs === "function" && !configDeclaresPorts(kind.name, config);
|
|
9723
|
+
const ids = (resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config) ?? []).map((p) => p.id);
|
|
9724
|
+
return ids.length > 0 ? ids : ["out"];
|
|
9725
|
+
}
|
|
9726
|
+
function configDeclaresPorts(kindName, config) {
|
|
9727
|
+
const bare = kindName.startsWith("@") ? kindName.slice(kindName.lastIndexOf("/") + 1) : kindName;
|
|
9728
|
+
if (bare === "switch_case") {
|
|
9729
|
+
const cases = config.cases;
|
|
9730
|
+
return !!cases && typeof cases === "object" && Object.values(cases).some((port) => typeof port === "string" && port !== "");
|
|
9731
|
+
}
|
|
9732
|
+
if (bare === "llm_router") {
|
|
9733
|
+
const routes = config.routes;
|
|
9734
|
+
return Array.isArray(routes) && routes.some((route) => route?.port != null && route.port !== "");
|
|
9735
|
+
}
|
|
9736
|
+
return true;
|
|
9737
|
+
}
|
|
9738
|
+
function undeliveredEdgeMessage(edge, target, portValues, nodesById) {
|
|
9739
|
+
const handle = edge.sourceHandle ?? "out";
|
|
9740
|
+
const prefix = `${edge.source}:`;
|
|
9741
|
+
const available = [];
|
|
9742
|
+
for (const key of portValues.keys()) {
|
|
9743
|
+
if (key.startsWith(prefix)) available.push(key.slice(prefix.length));
|
|
9744
|
+
}
|
|
9745
|
+
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.`;
|
|
9746
|
+
if (available.length > 0) message += ` Available: ${available.join(", ")}.`;
|
|
9747
|
+
const source = nodesById.get(edge.source);
|
|
9748
|
+
if (source && outputFieldsFor(source).some((field) => field?.path === handle)) {
|
|
9749
|
+
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.`;
|
|
9750
|
+
}
|
|
9751
|
+
if (edge.sourceHandle != null) message += " Leave sourceHandle off to read the node's output.";
|
|
9752
|
+
return message;
|
|
9753
|
+
}
|
|
9754
|
+
|
|
9698
9755
|
// src/runtime/workflow-props.ts
|
|
9699
9756
|
function typeOf(value) {
|
|
9700
9757
|
if (value === null) return "null";
|
|
@@ -9753,7 +9810,7 @@ function resolveWorkflowProps(declared, passed) {
|
|
|
9753
9810
|
// src/runtime/run-flow.ts
|
|
9754
9811
|
async function runFlow(graph, executors, onEvent = () => {
|
|
9755
9812
|
}, options = {}) {
|
|
9756
|
-
const { signal, initialInputs = {}, timeoutMs, depth = 0, resumeOutputs = {}, entryNodes } = options;
|
|
9813
|
+
const { signal, initialInputs = {}, timeoutMs, depth = 0, resumeOutputs = {}, entryNodes, nodeExecutors } = options;
|
|
9757
9814
|
const run = options.run === void 0 ? void 0 : RunIdentity.from(options.run);
|
|
9758
9815
|
const outputs = {};
|
|
9759
9816
|
const portValues = /* @__PURE__ */ new Map();
|
|
@@ -9816,17 +9873,8 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
9816
9873
|
onEvent({ type: "node-status", nodeId: node.id, status: "idle", text: "skipped" });
|
|
9817
9874
|
continue;
|
|
9818
9875
|
}
|
|
9819
|
-
for (const
|
|
9820
|
-
|
|
9821
|
-
if (portValues.has(`${e.source}:${handle}`) || !completed.has(e.source)) continue;
|
|
9822
|
-
if (possiblePortIds(nodesById.get(e.source)).includes(handle)) continue;
|
|
9823
|
-
onEvent({
|
|
9824
|
-
type: "log",
|
|
9825
|
-
nodeId: node.id,
|
|
9826
|
-
level: "warn",
|
|
9827
|
-
message: undeliveredEdgeMessage(e, node, portValues, nodesById),
|
|
9828
|
-
detail: { edge: e.id, source: e.source, sourceHandle: handle }
|
|
9829
|
-
});
|
|
9876
|
+
for (const warning of undeliveredEdgeWarnings(node, incoming, portValues, completed, nodesById)) {
|
|
9877
|
+
onEvent(warning);
|
|
9830
9878
|
}
|
|
9831
9879
|
if (incoming.length > 0) {
|
|
9832
9880
|
const anyActive = incoming.some((e) => portValues.has(`${e.source}:${e.sourceHandle ?? "out"}`));
|
|
@@ -9850,7 +9898,7 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
9850
9898
|
onEvent({ type: "node-status", nodeId: node.id, status: "running" });
|
|
9851
9899
|
announce(onEvent, node, "start");
|
|
9852
9900
|
const inputs = collectInputs(node, incoming, portValues, initialInputs, props, declaresProps);
|
|
9853
|
-
const exec = pickExecutor(executors, node);
|
|
9901
|
+
const exec = pickExecutor(executors, node, nodeExecutors);
|
|
9854
9902
|
if (!exec) {
|
|
9855
9903
|
const tried = executorLookupIds(node);
|
|
9856
9904
|
const msg = `No executor registered for kind=${node.type} \u2014 tried ${tried.map((id2) => `"${id2}"`).join(", ")}. Key your registry by one of those.`;
|
|
@@ -9970,7 +10018,9 @@ function executorLookupIds(node) {
|
|
|
9970
10018
|
ids.push("*");
|
|
9971
10019
|
return [...new Set(ids)];
|
|
9972
10020
|
}
|
|
9973
|
-
function pickExecutor(executors, node) {
|
|
10021
|
+
function pickExecutor(executors, node, nodeExecutors) {
|
|
10022
|
+
const pinned = nodeExecutors && Object.prototype.hasOwnProperty.call(nodeExecutors, node.id) ? nodeExecutors[node.id] : void 0;
|
|
10023
|
+
if (pinned) return pinned;
|
|
9974
10024
|
for (const id2 of executorLookupIds(node)) {
|
|
9975
10025
|
if (executors[id2]) return executors[id2];
|
|
9976
10026
|
}
|
|
@@ -9990,45 +10040,6 @@ function activatedPorts(node, result) {
|
|
|
9990
10040
|
const declared = resolveNodePorts(node, kind).outputs?.map((p) => p.id);
|
|
9991
10041
|
return { ports: declared?.length ? declared : ["out"], value: result };
|
|
9992
10042
|
}
|
|
9993
|
-
function possiblePortIds(node) {
|
|
9994
|
-
if (!node) return ["out"];
|
|
9995
|
-
const own = node.data?.outputs;
|
|
9996
|
-
if (Array.isArray(own)) return own.map((p) => p.id);
|
|
9997
|
-
const kind = getNodeKind(node.data?.kind ?? node.type ?? "");
|
|
9998
|
-
if (!kind) return ["out"];
|
|
9999
|
-
const config = nodeConfig(node);
|
|
10000
|
-
const representative = typeof kind.outputs === "function" && !configDeclaresPorts(kind.name, config);
|
|
10001
|
-
const ids = (resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config) ?? []).map((p) => p.id);
|
|
10002
|
-
return ids.length > 0 ? ids : ["out"];
|
|
10003
|
-
}
|
|
10004
|
-
function configDeclaresPorts(kindName, config) {
|
|
10005
|
-
const bare = kindName.startsWith("@") ? kindName.slice(kindName.lastIndexOf("/") + 1) : kindName;
|
|
10006
|
-
if (bare === "switch_case") {
|
|
10007
|
-
const cases = config.cases;
|
|
10008
|
-
return !!cases && typeof cases === "object" && Object.values(cases).some((port) => typeof port === "string" && port !== "");
|
|
10009
|
-
}
|
|
10010
|
-
if (bare === "llm_router") {
|
|
10011
|
-
const routes = config.routes;
|
|
10012
|
-
return Array.isArray(routes) && routes.some((route) => route?.port != null && route.port !== "");
|
|
10013
|
-
}
|
|
10014
|
-
return true;
|
|
10015
|
-
}
|
|
10016
|
-
function undeliveredEdgeMessage(edge, target, portValues, nodesById) {
|
|
10017
|
-
const handle = edge.sourceHandle ?? "out";
|
|
10018
|
-
const prefix = `${edge.source}:`;
|
|
10019
|
-
const available = [];
|
|
10020
|
-
for (const key of portValues.keys()) {
|
|
10021
|
-
if (key.startsWith(prefix)) available.push(key.slice(prefix.length));
|
|
10022
|
-
}
|
|
10023
|
-
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.`;
|
|
10024
|
-
if (available.length > 0) message += ` Available: ${available.join(", ")}.`;
|
|
10025
|
-
const source = nodesById.get(edge.source);
|
|
10026
|
-
if (source && outputFieldsFor(source).some((field) => field?.path === handle)) {
|
|
10027
|
-
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.`;
|
|
10028
|
-
}
|
|
10029
|
-
if (edge.sourceHandle != null) message += " Leave sourceHandle off to read the node's output.";
|
|
10030
|
-
return message;
|
|
10031
|
-
}
|
|
10032
10043
|
function announce(onEvent, node, phase) {
|
|
10033
10044
|
const data = node.data;
|
|
10034
10045
|
const raw = phase === "start" ? data?.startingMsg : data?.stoppingMsg;
|