@particle-academy/fancy-flow 0.71.0 → 0.72.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 (43) hide show
  1. package/dist/{chunk-3L47KJ6Q.js → chunk-57QTX3S3.js} +3 -3
  2. package/dist/{chunk-3L47KJ6Q.js.map → chunk-57QTX3S3.js.map} +1 -1
  3. package/dist/{chunk-KQCX6KN7.js → chunk-6TC44VCY.js} +3 -3
  4. package/dist/{chunk-KQCX6KN7.js.map → chunk-6TC44VCY.js.map} +1 -1
  5. package/dist/{chunk-EVGSL2EM.js → chunk-C5K2DSZB.js} +157 -148
  6. package/dist/chunk-C5K2DSZB.js.map +1 -0
  7. package/dist/{chunk-D2OBU3CE.js → chunk-E3U3MBKI.js} +3 -3
  8. package/dist/{chunk-D2OBU3CE.js.map → chunk-E3U3MBKI.js.map} +1 -1
  9. package/dist/{chunk-FPWJYSXX.js → chunk-R3GQ72WA.js} +4 -4
  10. package/dist/{chunk-FPWJYSXX.js.map → chunk-R3GQ72WA.js.map} +1 -1
  11. package/dist/{chunk-PNTDTSMR.js → chunk-RQP666FB.js} +4 -4
  12. package/dist/{chunk-PNTDTSMR.js.map → chunk-RQP666FB.js.map} +1 -1
  13. package/dist/{chunk-XI4AZD2S.js → chunk-ZEDBF2V6.js} +3 -3
  14. package/dist/{chunk-XI4AZD2S.js.map → chunk-ZEDBF2V6.js.map} +1 -1
  15. package/dist/durable/index.d.cts +45 -4
  16. package/dist/durable/index.d.ts +45 -4
  17. package/dist/durable.cjs +137 -72
  18. package/dist/durable.cjs.map +1 -1
  19. package/dist/durable.js +61 -5
  20. package/dist/durable.js.map +1 -1
  21. package/dist/engine.cjs +77 -68
  22. package/dist/engine.cjs.map +1 -1
  23. package/dist/engine.js +4 -4
  24. package/dist/index.cjs +123 -114
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.js +12 -12
  27. package/dist/registry.cjs +77 -68
  28. package/dist/registry.cjs.map +1 -1
  29. package/dist/registry.js +2 -2
  30. package/dist/runtime.cjs +77 -68
  31. package/dist/runtime.cjs.map +1 -1
  32. package/dist/runtime.js +3 -3
  33. package/dist/schema.cjs +77 -68
  34. package/dist/schema.cjs.map +1 -1
  35. package/dist/schema.js +3 -3
  36. package/dist/screens.cjs +77 -68
  37. package/dist/screens.cjs.map +1 -1
  38. package/dist/screens.js +4 -4
  39. package/dist/ux.cjs +77 -68
  40. package/dist/ux.cjs.map +1 -1
  41. package/dist/ux.js +1 -1
  42. package/package.json +1 -1
  43. 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-PNTDTSMR.js';
2
- import './chunk-KQCX6KN7.js';
3
- import './chunk-EVGSL2EM.js';
1
+ export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-RQP666FB.js';
2
+ import './chunk-6TC44VCY.js';
3
+ import './chunk-C5K2DSZB.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";
@@ -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 e of incoming) {
9820
- const handle = e.sourceHandle ?? "out";
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"}`));
@@ -9990,45 +10038,6 @@ function activatedPorts(node, result) {
9990
10038
  const declared = resolveNodePorts(node, kind).outputs?.map((p) => p.id);
9991
10039
  return { ports: declared?.length ? declared : ["out"], value: result };
9992
10040
  }
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
10041
  function announce(onEvent, node, phase) {
10033
10042
  const data = node.data;
10034
10043
  const raw = phase === "start" ? data?.startingMsg : data?.stoppingMsg;