@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/schema.js CHANGED
@@ -1,6 +1,6 @@
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';
1
+ export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-PXVISCSC.js';
2
+ import './chunk-CYVVUKHH.js';
3
+ import './chunk-V2657EQG.js';
4
4
  import './chunk-2QXKDLGT.js';
5
5
  //# sourceMappingURL=schema.js.map
6
6
  //# sourceMappingURL=schema.js.map
package/dist/screens.cjs CHANGED
@@ -9720,8 +9720,9 @@ function possiblePortIds(node) {
9720
9720
  if (!kind) return ["out"];
9721
9721
  const config = nodeConfig(node);
9722
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"];
9723
+ const resolved = resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config);
9724
+ if (resolved === void 0) return ["out"];
9725
+ return resolved.map((p) => p.id);
9725
9726
  }
9726
9727
  function configDeclaresPorts(kindName, config) {
9727
9728
  const bare = kindName.startsWith("@") ? kindName.slice(kindName.lastIndexOf("/") + 1) : kindName;
@@ -9861,8 +9862,9 @@ async function runFlow(graph, executors, onEvent = () => {
9861
9862
  outputs[node.id] = stored;
9862
9863
  const activated = activatedPorts(node, stored);
9863
9864
  for (const portId of activated.ports) {
9864
- portValues.set(`${node.id}:${portId}`, activated.value);
9865
- onEvent({ type: "node-output", nodeId: node.id, portId, value: activated.value });
9865
+ const value = portValueOf(activated, portId);
9866
+ portValues.set(`${node.id}:${portId}`, value);
9867
+ onEvent({ type: "node-output", nodeId: node.id, portId, value });
9866
9868
  }
9867
9869
  completed.add(node.id);
9868
9870
  onEvent({ type: "node-status", nodeId: node.id, status: "done", text: "resumed" });
@@ -9925,8 +9927,9 @@ async function runFlow(graph, executors, onEvent = () => {
9925
9927
  outputs[node.id] = result;
9926
9928
  const activated = activatedPorts(node, result);
9927
9929
  for (const portId of activated.ports) {
9928
- portValues.set(`${node.id}:${portId}`, activated.value);
9929
- onEvent({ type: "node-output", nodeId: node.id, portId, value: activated.value });
9930
+ const value = portValueOf(activated, portId);
9931
+ portValues.set(`${node.id}:${portId}`, value);
9932
+ onEvent({ type: "node-output", nodeId: node.id, portId, value });
9930
9933
  }
9931
9934
  completed.add(node.id);
9932
9935
  onEvent({ type: "node-status", nodeId: node.id, status: "done" });
@@ -10032,13 +10035,23 @@ function activatedPorts(node, result) {
10032
10035
  if (typeof r.__port === "string") {
10033
10036
  return { ports: [r.__port], value: r.value };
10034
10037
  }
10038
+ if (Array.isArray(r.__ports)) {
10039
+ return { ports: r.__ports.filter((p) => typeof p === "string"), value: r.value };
10040
+ }
10041
+ if (r.__ports && typeof r.__ports === "object") {
10042
+ const values = r.__ports;
10043
+ return { ports: Object.keys(values), value: r.value, values };
10044
+ }
10035
10045
  if (typeof r.branch === "string") {
10036
10046
  return { ports: [r.branch], value: Object.prototype.hasOwnProperty.call(r, "value") ? r.value : r };
10037
10047
  }
10038
10048
  }
10039
10049
  const kind = getNodeKind(node.data?.kind ?? node.type ?? "") ?? void 0;
10040
10050
  const declared = resolveNodePorts(node, kind).outputs?.map((p) => p.id);
10041
- return { ports: declared?.length ? declared : ["out"], value: result };
10051
+ return { ports: declared ?? ["out"], value: result };
10052
+ }
10053
+ function portValueOf(activated, portId) {
10054
+ return activated.values && Object.prototype.hasOwnProperty.call(activated.values, portId) ? activated.values[portId] : activated.value;
10042
10055
  }
10043
10056
  function announce(onEvent, node, phase) {
10044
10057
  const data = node.data;