@particle-academy/fancy-flow 0.76.0 → 0.77.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-ZKAPSUTL.js → chunk-2VI24UPB.js} +3 -3
- package/dist/{chunk-ZKAPSUTL.js.map → chunk-2VI24UPB.js.map} +1 -1
- package/dist/{chunk-PXVISCSC.js → chunk-ARSOSEJV.js} +4 -4
- package/dist/{chunk-PXVISCSC.js.map → chunk-ARSOSEJV.js.map} +1 -1
- package/dist/{chunk-G4GKDJG5.js → chunk-CQAMEPPI.js} +3 -3
- package/dist/{chunk-G4GKDJG5.js.map → chunk-CQAMEPPI.js.map} +1 -1
- package/dist/{chunk-V2657EQG.js → chunk-EEIWAIXW.js} +45 -5
- package/dist/chunk-EEIWAIXW.js.map +1 -0
- package/dist/{chunk-4KYW5BT4.js → chunk-EGXA4SYJ.js} +4 -4
- package/dist/{chunk-4KYW5BT4.js.map → chunk-EGXA4SYJ.js.map} +1 -1
- package/dist/{chunk-CYVVUKHH.js → chunk-G5RAGPVD.js} +3 -3
- package/dist/{chunk-CYVVUKHH.js.map → chunk-G5RAGPVD.js.map} +1 -1
- package/dist/{chunk-M34S7XUM.js → chunk-T6WIIGSK.js} +3 -3
- package/dist/{chunk-M34S7XUM.js.map → chunk-T6WIIGSK.js.map} +1 -1
- package/dist/durable.cjs +39 -35
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +1 -2
- package/dist/durable.js.map +1 -1
- package/dist/engine.cjs +42 -38
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.js +4 -6
- package/dist/engine.js.map +1 -1
- package/dist/index.cjs +42 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -13
- package/dist/index.js.map +1 -1
- package/dist/registry.cjs +42 -38
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -3
- package/dist/runtime.cjs +32 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema.cjs +32 -2
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +3 -3
- package/dist/screens.cjs +32 -2
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.js +4 -5
- package/dist/screens.js.map +1 -1
- package/dist/ux.cjs +32 -2
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-UEOE6B52.js +0 -39
- package/dist/chunk-UEOE6B52.js.map +0 -1
- package/dist/chunk-V2657EQG.js.map +0 -1
package/dist/registry.cjs
CHANGED
|
@@ -925,6 +925,42 @@ function announce(onEvent, node, phase) {
|
|
|
925
925
|
onEvent({ type: "node-message", nodeId: node.id, phase, message });
|
|
926
926
|
}
|
|
927
927
|
|
|
928
|
+
// src/registry/pause.ts
|
|
929
|
+
var PAUSE_PREFIX = "fancy-flow:pause:";
|
|
930
|
+
var LEGACY_PAUSE_PREFIXES = [
|
|
931
|
+
["awaiting-approval:", "approval"],
|
|
932
|
+
["awaiting-input:", "input"]
|
|
933
|
+
];
|
|
934
|
+
function encodePause(signal) {
|
|
935
|
+
const { nodeId, awaiting, detail } = signal;
|
|
936
|
+
return PAUSE_PREFIX + JSON.stringify(detail === void 0 ? { nodeId, awaiting } : { nodeId, awaiting, detail });
|
|
937
|
+
}
|
|
938
|
+
function decodePause(reason) {
|
|
939
|
+
if (typeof reason !== "string") return null;
|
|
940
|
+
if (reason.startsWith(PAUSE_PREFIX)) {
|
|
941
|
+
const body = reason.slice(PAUSE_PREFIX.length);
|
|
942
|
+
try {
|
|
943
|
+
const parsed = JSON.parse(body);
|
|
944
|
+
if (typeof parsed?.nodeId !== "string" || typeof parsed?.awaiting !== "string") return null;
|
|
945
|
+
return "detail" in parsed ? { nodeId: parsed.nodeId, awaiting: parsed.awaiting, detail: parsed.detail } : { nodeId: parsed.nodeId, awaiting: parsed.awaiting };
|
|
946
|
+
} catch {
|
|
947
|
+
return null;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
for (const [prefix, awaiting] of LEGACY_PAUSE_PREFIXES) {
|
|
951
|
+
if (reason.startsWith(prefix)) {
|
|
952
|
+
return { nodeId: reason.slice(prefix.length), awaiting };
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
return null;
|
|
956
|
+
}
|
|
957
|
+
function isPause(reason) {
|
|
958
|
+
return decodePause(reason) !== null;
|
|
959
|
+
}
|
|
960
|
+
function pauseForHuman(ctx, awaiting, detail) {
|
|
961
|
+
return ctx.abort(encodePause({ nodeId: ctx.node.id, awaiting, detail }));
|
|
962
|
+
}
|
|
963
|
+
|
|
928
964
|
// src/registry/subflow.ts
|
|
929
965
|
var DEFAULT_MAX_DEPTH = 8;
|
|
930
966
|
function subflowMode(config) {
|
|
@@ -1006,7 +1042,11 @@ var subflowExecutor = async (ctx) => {
|
|
|
1006
1042
|
}
|
|
1007
1043
|
);
|
|
1008
1044
|
if (!result.ok) {
|
|
1009
|
-
|
|
1045
|
+
const reason = result.error ?? "unknown error";
|
|
1046
|
+
if (decodePause(reason)) {
|
|
1047
|
+
ctx.abort(reason);
|
|
1048
|
+
}
|
|
1049
|
+
ctx.abort(`subflow "${ref}" failed: ${reason}`);
|
|
1010
1050
|
}
|
|
1011
1051
|
if (mode === "stream") {
|
|
1012
1052
|
return { __port: "stream", value: result.outputs };
|
|
@@ -1814,7 +1854,7 @@ var KINDS = [
|
|
|
1814
1854
|
executor: forEachExecutor,
|
|
1815
1855
|
category: "logic",
|
|
1816
1856
|
label: "For Each",
|
|
1817
|
-
description: "
|
|
1857
|
+
description: "Publishes the resolved list and its size on BOTH `item` and `done`. Fan-out as DATA, not as jobs -- nothing runs per item.",
|
|
1818
1858
|
icon: "\u21BB",
|
|
1819
1859
|
inputs: [{ id: "in" }],
|
|
1820
1860
|
outputs: [{ id: "item", label: "item" }, { id: "done", label: "done" }],
|
|
@@ -2851,42 +2891,6 @@ function createConnectionValidator(getNodes, options = {}) {
|
|
|
2851
2891
|
return compatible(outPort, inPort);
|
|
2852
2892
|
};
|
|
2853
2893
|
}
|
|
2854
|
-
|
|
2855
|
-
// src/registry/pause.ts
|
|
2856
|
-
var PAUSE_PREFIX = "fancy-flow:pause:";
|
|
2857
|
-
var LEGACY_PAUSE_PREFIXES = [
|
|
2858
|
-
["awaiting-approval:", "approval"],
|
|
2859
|
-
["awaiting-input:", "input"]
|
|
2860
|
-
];
|
|
2861
|
-
function encodePause(signal) {
|
|
2862
|
-
const { nodeId, awaiting, detail } = signal;
|
|
2863
|
-
return PAUSE_PREFIX + JSON.stringify(detail === void 0 ? { nodeId, awaiting } : { nodeId, awaiting, detail });
|
|
2864
|
-
}
|
|
2865
|
-
function decodePause(reason) {
|
|
2866
|
-
if (typeof reason !== "string") return null;
|
|
2867
|
-
if (reason.startsWith(PAUSE_PREFIX)) {
|
|
2868
|
-
const body = reason.slice(PAUSE_PREFIX.length);
|
|
2869
|
-
try {
|
|
2870
|
-
const parsed = JSON.parse(body);
|
|
2871
|
-
if (typeof parsed?.nodeId !== "string" || typeof parsed?.awaiting !== "string") return null;
|
|
2872
|
-
return "detail" in parsed ? { nodeId: parsed.nodeId, awaiting: parsed.awaiting, detail: parsed.detail } : { nodeId: parsed.nodeId, awaiting: parsed.awaiting };
|
|
2873
|
-
} catch {
|
|
2874
|
-
return null;
|
|
2875
|
-
}
|
|
2876
|
-
}
|
|
2877
|
-
for (const [prefix, awaiting] of LEGACY_PAUSE_PREFIXES) {
|
|
2878
|
-
if (reason.startsWith(prefix)) {
|
|
2879
|
-
return { nodeId: reason.slice(prefix.length), awaiting };
|
|
2880
|
-
}
|
|
2881
|
-
}
|
|
2882
|
-
return null;
|
|
2883
|
-
}
|
|
2884
|
-
function isPause(reason) {
|
|
2885
|
-
return decodePause(reason) !== null;
|
|
2886
|
-
}
|
|
2887
|
-
function pauseForHuman(ctx, awaiting, detail) {
|
|
2888
|
-
return ctx.abort(encodePause({ nodeId: ctx.node.id, awaiting, detail }));
|
|
2889
|
-
}
|
|
2890
2894
|
var adapter = null;
|
|
2891
2895
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
2892
2896
|
function registerRichInputAdapter(next) {
|