@particle-academy/fancy-flow 0.59.0 → 0.64.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 (66) hide show
  1. package/dist/{HumanPrompt-Bw09OyS3.d.ts → HumanPrompt-BKThiyjB.d.ts} +1 -1
  2. package/dist/{HumanPrompt-DV5-xnDa.d.cts → HumanPrompt-Bpp3JiVH.d.cts} +1 -1
  3. package/dist/{chunk-M7M6GLFV.js → chunk-5H54OTKT.js} +3 -3
  4. package/dist/{chunk-M7M6GLFV.js.map → chunk-5H54OTKT.js.map} +1 -1
  5. package/dist/chunk-77V4QC6Y.js +54 -0
  6. package/dist/chunk-77V4QC6Y.js.map +1 -0
  7. package/dist/{chunk-MX4SJDNI.js → chunk-EO6444T2.js} +4 -4
  8. package/dist/{chunk-MX4SJDNI.js.map → chunk-EO6444T2.js.map} +1 -1
  9. package/dist/{chunk-HBE4LVPX.js → chunk-JF6WCRBU.js} +9 -7
  10. package/dist/chunk-JF6WCRBU.js.map +1 -0
  11. package/dist/{chunk-LGLOBK6Q.js → chunk-MBVX4ZRB.js} +3 -3
  12. package/dist/{chunk-LGLOBK6Q.js.map → chunk-MBVX4ZRB.js.map} +1 -1
  13. package/dist/{chunk-A3TLZS5B.js → chunk-RIAFHQT5.js} +3 -3
  14. package/dist/{chunk-A3TLZS5B.js.map → chunk-RIAFHQT5.js.map} +1 -1
  15. package/dist/{chunk-BHM5HGXH.js → chunk-UM4C46AF.js} +38 -14
  16. package/dist/chunk-UM4C46AF.js.map +1 -0
  17. package/dist/{chunk-FGYG5JVW.js → chunk-W5DPKJY4.js} +5 -3
  18. package/dist/chunk-W5DPKJY4.js.map +1 -0
  19. package/dist/connectors.d.cts +1 -1
  20. package/dist/connectors.d.ts +1 -1
  21. package/dist/durable.cjs +7 -5
  22. package/dist/durable.cjs.map +1 -1
  23. package/dist/durable.js +2 -2
  24. package/dist/engine.cjs +189 -29
  25. package/dist/engine.cjs.map +1 -1
  26. package/dist/engine.d.cts +67 -5
  27. package/dist/engine.d.ts +67 -5
  28. package/dist/engine.js +7 -5
  29. package/dist/engine.js.map +1 -1
  30. package/dist/expr-BfXDrs4H.d.cts +149 -0
  31. package/dist/expr-BfXDrs4H.d.ts +149 -0
  32. package/dist/fields/react-fancy.d.cts +2 -2
  33. package/dist/fields/react-fancy.d.ts +2 -2
  34. package/dist/index.cjs +94 -16
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +7 -84
  37. package/dist/index.d.ts +7 -84
  38. package/dist/index.js +13 -12
  39. package/dist/index.js.map +1 -1
  40. package/dist/registry/index.d.cts +3 -3
  41. package/dist/registry/index.d.ts +3 -3
  42. package/dist/{registry-1qhmRtvC.d.cts → registry-CntAdUcY.d.cts} +1 -1
  43. package/dist/{registry-D2qocEsY.d.ts → registry-DYoV-MQi.d.ts} +1 -1
  44. package/dist/registry.cjs +7 -5
  45. package/dist/registry.cjs.map +1 -1
  46. package/dist/registry.js +2 -2
  47. package/dist/runtime.cjs +7 -5
  48. package/dist/runtime.cjs.map +1 -1
  49. package/dist/runtime.js +3 -3
  50. package/dist/schema.cjs +57 -5
  51. package/dist/schema.cjs.map +1 -1
  52. package/dist/schema.js +3 -2
  53. package/dist/screens.cjs +7 -5
  54. package/dist/screens.cjs.map +1 -1
  55. package/dist/screens.js +4 -4
  56. package/dist/{types-CLSUZW8c.d.ts → types-Ckhz-YwC.d.ts} +7 -2
  57. package/dist/{types-BLVpNNLN.d.cts → types-D71SKA5A.d.cts} +7 -2
  58. package/dist/ux.cjs +7 -5
  59. package/dist/ux.cjs.map +1 -1
  60. package/dist/ux.d.cts +1 -1
  61. package/dist/ux.d.ts +1 -1
  62. package/dist/ux.js +1 -1
  63. package/package.json +2 -2
  64. package/dist/chunk-BHM5HGXH.js.map +0 -1
  65. package/dist/chunk-FGYG5JVW.js.map +0 -1
  66. package/dist/chunk-HBE4LVPX.js.map +0 -1
package/dist/runtime.js CHANGED
@@ -1,6 +1,6 @@
1
- export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-LGLOBK6Q.js';
2
- export { runCohort } from './chunk-A3TLZS5B.js';
3
- export { RunIdentity, escapeSegment, runFlow } from './chunk-HBE4LVPX.js';
1
+ export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-MBVX4ZRB.js';
2
+ export { runCohort } from './chunk-RIAFHQT5.js';
3
+ export { RunIdentity, escapeSegment, runFlow } from './chunk-JF6WCRBU.js';
4
4
  import './chunk-F5RPRB7A.js';
5
5
  import './chunk-USL4FMFU.js';
6
6
  //# sourceMappingURL=runtime.js.map
package/dist/schema.cjs CHANGED
@@ -9531,7 +9531,7 @@ function activatedPorts(node, result) {
9531
9531
  return { ports: [r.__port], value: r.value };
9532
9532
  }
9533
9533
  if (typeof r.branch === "string") {
9534
- return { ports: [r.branch], value: r.value ?? r };
9534
+ return { ports: [r.branch], value: Object.prototype.hasOwnProperty.call(r, "value") ? r.value : r };
9535
9535
  }
9536
9536
  }
9537
9537
  const kind = getNodeKind(node.data?.kind ?? node.type ?? "") ?? void 0;
@@ -9693,8 +9693,9 @@ var KINDS = [
9693
9693
  // ───────────── Triggers ─────────────
9694
9694
  {
9695
9695
  name: "@particle-academy/manual_trigger",
9696
- // returns the inputs it was started with
9697
- emits: "input",
9696
+ // Returns the raw inputs MAP, not the `in` port -- flat at an entry
9697
+ // point, port-keyed the moment the node has an inbound edge.
9698
+ emits: "input-map-merged",
9698
9699
  aliases: ["manual_trigger", "@fancy/manual_trigger"],
9699
9700
  category: "trigger",
9700
9701
  label: "Manual",
@@ -9727,8 +9728,9 @@ var KINDS = [
9727
9728
  { path: "cron", type: "string", description: "The cron expression that fired." },
9728
9729
  { path: "timezone", type: "string", description: "The timezone it was evaluated in." }
9729
9730
  ],
9730
- // merges its inputs into the TOP level beside cron/timezone
9731
- emits: "inputs-merged",
9731
+ // Merges $ctx->inputs ITSELF beside cron/timezone -- the MAP, whose
9732
+ // shape depends on position, not each port's payload the way `merge` does.
9733
+ emits: "input-map-merged",
9732
9734
  aliases: ["schedule_trigger", "@fancy/schedule_trigger"],
9733
9735
  category: "trigger",
9734
9736
  label: "Schedule",
@@ -10736,6 +10738,55 @@ function categoryAccent(category) {
10736
10738
  }
10737
10739
  }
10738
10740
 
10741
+ // src/analysis/graph-connectivity.ts
10742
+ function checkGraphConnectivity(graph) {
10743
+ const { nodes, edges } = graph;
10744
+ const issues = [];
10745
+ const hasIncoming = /* @__PURE__ */ new Set();
10746
+ const hasOutgoing = /* @__PURE__ */ new Set();
10747
+ for (const edge of edges) {
10748
+ hasIncoming.add(edge.target);
10749
+ hasOutgoing.add(edge.source);
10750
+ }
10751
+ const single = nodes.length === 1;
10752
+ for (const node of nodes) {
10753
+ if (single || mayFloat(node)) continue;
10754
+ if (!hasIncoming.has(node.id) && !hasOutgoing.has(node.id)) {
10755
+ issues.push({
10756
+ level: "error",
10757
+ nodeId: node.id,
10758
+ message: `Node "${node.id}" is connected to nothing \u2014 no inbound edge and no outbound edge. It still RUNS (a node with no inbound edge is a root), but it receives nothing from the graph and reaches nobody in it, so it is either unwired or left behind by a deletion. Only a note, an annotation or a lane may float.`
10759
+ });
10760
+ }
10761
+ }
10762
+ const byId = new Map(nodes.map((n) => [n.id, n]));
10763
+ for (const edge of edges) {
10764
+ const source = byId.get(edge.source);
10765
+ if (!source || !isTerminator(source)) continue;
10766
+ issues.push({
10767
+ level: "error",
10768
+ edgeId: edge.id,
10769
+ message: `Edge "${edge.id}" reads from "${edge.source}", which is a TERMINAL node and publishes no output ports at all. Nothing can ever travel this edge: it does not fail at run time, it delivers nothing, and "${edge.target}" runs anyway with an empty input.`
10770
+ });
10771
+ }
10772
+ return issues;
10773
+ }
10774
+ function mayFloat(node) {
10775
+ const type = node.type;
10776
+ if (!type) return false;
10777
+ if (type === "note") return true;
10778
+ const kind = getNodeKind(type);
10779
+ if (!kind) return true;
10780
+ return kindIds(kind).includes("note") || kind.category === "annotation" || kind.category === "layout";
10781
+ }
10782
+ function isTerminator(node) {
10783
+ const own = node.data?.outputs;
10784
+ if (Array.isArray(own)) return own.length === 0;
10785
+ const kind = node.type ? getNodeKind(node.type) : null;
10786
+ if (!kind) return false;
10787
+ return Array.isArray(kind.outputs) && kind.outputs.length === 0;
10788
+ }
10789
+
10739
10790
  // src/schema/workflow-schema.ts
10740
10791
  var WORKFLOW_SCHEMA_VERSION = 1;
10741
10792
  var WORKFLOW_SCHEMA_URL = "https://particle.academy/schemas/workflow/v1.json";
@@ -10883,6 +10934,7 @@ function importWorkflow(schema, options = {}) {
10883
10934
  label: e.label
10884
10935
  };
10885
10936
  }).filter((e) => e !== null);
10937
+ issues.push(...checkGraphConnectivity({ nodes, edges }));
10886
10938
  const ok = issues.every((i) => i.level !== "error");
10887
10939
  const declaredInputs = Array.isArray(s.inputs) ? s.inputs.filter(
10888
10940
  (input) => input !== null && typeof input === "object" && typeof input.name === "string"