@particle-academy/fancy-flow 0.74.1 → 0.76.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.
Files changed (41) hide show
  1. package/dist/{chunk-2GU3V2ZD.js → chunk-4KYW5BT4.js} +4 -4
  2. package/dist/{chunk-2GU3V2ZD.js.map → chunk-4KYW5BT4.js.map} +1 -1
  3. package/dist/{chunk-VAF2SWTC.js → chunk-CYVVUKHH.js} +3 -3
  4. package/dist/{chunk-VAF2SWTC.js.map → chunk-CYVVUKHH.js.map} +1 -1
  5. package/dist/{chunk-K7KO3UJ3.js → chunk-G4GKDJG5.js} +3 -3
  6. package/dist/{chunk-K7KO3UJ3.js.map → chunk-G4GKDJG5.js.map} +1 -1
  7. package/dist/{chunk-3RXQGYGH.js → chunk-M34S7XUM.js} +3 -3
  8. package/dist/{chunk-3RXQGYGH.js.map → chunk-M34S7XUM.js.map} +1 -1
  9. package/dist/{chunk-7DJ56PUA.js → chunk-PXVISCSC.js} +4 -4
  10. package/dist/{chunk-7DJ56PUA.js.map → chunk-PXVISCSC.js.map} +1 -1
  11. package/dist/{chunk-EX34GCKK.js → chunk-V2657EQG.js} +22 -9
  12. package/dist/chunk-V2657EQG.js.map +1 -0
  13. package/dist/{chunk-GQ5LEA7Q.js → chunk-ZKAPSUTL.js} +3 -3
  14. package/dist/{chunk-GQ5LEA7Q.js.map → chunk-ZKAPSUTL.js.map} +1 -1
  15. package/dist/durable.cjs +20 -7
  16. package/dist/durable.cjs.map +1 -1
  17. package/dist/durable.js +1 -1
  18. package/dist/engine.cjs +20 -7
  19. package/dist/engine.cjs.map +1 -1
  20. package/dist/engine.js +4 -4
  21. package/dist/index.cjs +20 -7
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.js +12 -12
  24. package/dist/registry.cjs +20 -7
  25. package/dist/registry.cjs.map +1 -1
  26. package/dist/registry.js +2 -2
  27. package/dist/runtime.cjs +20 -7
  28. package/dist/runtime.cjs.map +1 -1
  29. package/dist/runtime.js +3 -3
  30. package/dist/schema.cjs +20 -7
  31. package/dist/schema.cjs.map +1 -1
  32. package/dist/schema.js +3 -3
  33. package/dist/screens.cjs +20 -7
  34. package/dist/screens.cjs.map +1 -1
  35. package/dist/screens.js +4 -4
  36. package/dist/ux.cjs +21 -8
  37. package/dist/ux.cjs.map +1 -1
  38. package/dist/ux.js +2 -2
  39. package/dist/ux.js.map +1 -1
  40. package/package.json +2 -2
  41. package/dist/chunk-EX34GCKK.js.map +0 -1
package/dist/durable.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { pauseForHuman, decodePause } from './chunk-UEOE6B52.js';
2
- import { getNodeKind, runFlow, resolveKindId, kindIds, truthy, RunIdentity, undeliveredEdgeWarnings } from './chunk-EX34GCKK.js';
2
+ import { getNodeKind, runFlow, resolveKindId, kindIds, truthy, RunIdentity, undeliveredEdgeWarnings } from './chunk-V2657EQG.js';
3
3
  import './chunk-2QXKDLGT.js';
4
4
 
5
5
  // src/durable/state.ts
package/dist/engine.cjs CHANGED
@@ -2390,8 +2390,9 @@ function possiblePortIds(node) {
2390
2390
  if (!kind) return ["out"];
2391
2391
  const config = nodeConfig(node);
2392
2392
  const representative = typeof kind.outputs === "function" && !configDeclaresPorts(kind.name, config);
2393
- const ids = (resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config) ?? []).map((p) => p.id);
2394
- return ids.length > 0 ? ids : ["out"];
2393
+ const resolved = resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config);
2394
+ if (resolved === void 0) return ["out"];
2395
+ return resolved.map((p) => p.id);
2395
2396
  }
2396
2397
  function configDeclaresPorts(kindName2, config) {
2397
2398
  const bare = kindName2.startsWith("@") ? kindName2.slice(kindName2.lastIndexOf("/") + 1) : kindName2;
@@ -2531,8 +2532,9 @@ async function runFlow(graph, executors, onEvent = () => {
2531
2532
  outputs[node.id] = stored;
2532
2533
  const activated = activatedPorts(node, stored);
2533
2534
  for (const portId of activated.ports) {
2534
- portValues.set(`${node.id}:${portId}`, activated.value);
2535
- onEvent({ type: "node-output", nodeId: node.id, portId, value: activated.value });
2535
+ const value = portValueOf(activated, portId);
2536
+ portValues.set(`${node.id}:${portId}`, value);
2537
+ onEvent({ type: "node-output", nodeId: node.id, portId, value });
2536
2538
  }
2537
2539
  completed.add(node.id);
2538
2540
  onEvent({ type: "node-status", nodeId: node.id, status: "done", text: "resumed" });
@@ -2595,8 +2597,9 @@ async function runFlow(graph, executors, onEvent = () => {
2595
2597
  outputs[node.id] = result;
2596
2598
  const activated = activatedPorts(node, result);
2597
2599
  for (const portId of activated.ports) {
2598
- portValues.set(`${node.id}:${portId}`, activated.value);
2599
- onEvent({ type: "node-output", nodeId: node.id, portId, value: activated.value });
2600
+ const value = portValueOf(activated, portId);
2601
+ portValues.set(`${node.id}:${portId}`, value);
2602
+ onEvent({ type: "node-output", nodeId: node.id, portId, value });
2600
2603
  }
2601
2604
  completed.add(node.id);
2602
2605
  onEvent({ type: "node-status", nodeId: node.id, status: "done" });
@@ -2702,13 +2705,23 @@ function activatedPorts(node, result) {
2702
2705
  if (typeof r.__port === "string") {
2703
2706
  return { ports: [r.__port], value: r.value };
2704
2707
  }
2708
+ if (Array.isArray(r.__ports)) {
2709
+ return { ports: r.__ports.filter((p) => typeof p === "string"), value: r.value };
2710
+ }
2711
+ if (r.__ports && typeof r.__ports === "object") {
2712
+ const values = r.__ports;
2713
+ return { ports: Object.keys(values), value: r.value, values };
2714
+ }
2705
2715
  if (typeof r.branch === "string") {
2706
2716
  return { ports: [r.branch], value: Object.prototype.hasOwnProperty.call(r, "value") ? r.value : r };
2707
2717
  }
2708
2718
  }
2709
2719
  const kind = getNodeKind(node.data?.kind ?? node.type ?? "") ?? void 0;
2710
2720
  const declared = resolveNodePorts(node, kind).outputs?.map((p) => p.id);
2711
- return { ports: declared?.length ? declared : ["out"], value: result };
2721
+ return { ports: declared ?? ["out"], value: result };
2722
+ }
2723
+ function portValueOf(activated, portId) {
2724
+ return activated.values && Object.prototype.hasOwnProperty.call(activated.values, portId) ? activated.values[portId] : activated.value;
2712
2725
  }
2713
2726
  function announce(onEvent, node, phase) {
2714
2727
  const data = node.data;