@particle-academy/fancy-flow 0.78.0 → 0.79.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 (40) hide show
  1. package/dist/{chunk-XO4ODEY2.js → chunk-I5EPWHNM.js} +3 -3
  2. package/dist/{chunk-XO4ODEY2.js.map → chunk-I5EPWHNM.js.map} +1 -1
  3. package/dist/{chunk-BBFHGAEN.js → chunk-J66LOLJR.js} +4 -4
  4. package/dist/{chunk-BBFHGAEN.js.map → chunk-J66LOLJR.js.map} +1 -1
  5. package/dist/{chunk-3EDB6ELL.js → chunk-KMONOPAK.js} +3 -3
  6. package/dist/{chunk-3EDB6ELL.js.map → chunk-KMONOPAK.js.map} +1 -1
  7. package/dist/{chunk-GPFIJR2K.js → chunk-LBE4L3DS.js} +4 -4
  8. package/dist/{chunk-GPFIJR2K.js.map → chunk-LBE4L3DS.js.map} +1 -1
  9. package/dist/{chunk-J5YUYDMK.js → chunk-OZHBAXMA.js} +21 -4
  10. package/dist/chunk-OZHBAXMA.js.map +1 -0
  11. package/dist/{chunk-S4MOUOG4.js → chunk-QMJVUT7C.js} +3 -3
  12. package/dist/{chunk-S4MOUOG4.js.map → chunk-QMJVUT7C.js.map} +1 -1
  13. package/dist/{chunk-4GNDRRJ3.js → chunk-R4G7SPLD.js} +3 -3
  14. package/dist/{chunk-4GNDRRJ3.js.map → chunk-R4G7SPLD.js.map} +1 -1
  15. package/dist/durable.cjs +19 -2
  16. package/dist/durable.cjs.map +1 -1
  17. package/dist/durable.js +1 -1
  18. package/dist/engine.cjs +19 -2
  19. package/dist/engine.cjs.map +1 -1
  20. package/dist/engine.js +4 -4
  21. package/dist/index.cjs +19 -2
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.js +12 -12
  24. package/dist/registry.cjs +19 -2
  25. package/dist/registry.cjs.map +1 -1
  26. package/dist/registry.js +2 -2
  27. package/dist/runtime.cjs +19 -2
  28. package/dist/runtime.cjs.map +1 -1
  29. package/dist/runtime.js +3 -3
  30. package/dist/schema.cjs +19 -2
  31. package/dist/schema.cjs.map +1 -1
  32. package/dist/schema.js +3 -3
  33. package/dist/screens.cjs +19 -2
  34. package/dist/screens.cjs.map +1 -1
  35. package/dist/screens.js +4 -4
  36. package/dist/ux.cjs +19 -2
  37. package/dist/ux.cjs.map +1 -1
  38. package/dist/ux.js +1 -1
  39. package/package.json +2 -2
  40. package/dist/chunk-J5YUYDMK.js.map +0 -1
package/dist/registry.js CHANGED
@@ -1,7 +1,7 @@
1
- export { ANY_PORT_TYPE, BUILTIN_KINDS, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds } from './chunk-XO4ODEY2.js';
1
+ export { ANY_PORT_TYPE, BUILTIN_KINDS, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds } from './chunk-I5EPWHNM.js';
2
2
  export { RichInputPreview, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerRichInputAdapter } from './chunk-F5RPRB7A.js';
3
3
  import './chunk-OWENS2H5.js';
4
- export { DEFAULT_MAX_DEPTH, LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, applyKindSchemaOverlay, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, declaredRoutes, decodePause, defaultConfigFor, encodePause, ensureBuiltinKinds, getNodeKind, isPause, kindIds, listNodeKinds, llmRouterExecutor as llmBranchExecutor, llmRouterExecutor, nodeConfig, onNodeKindsChanged, overrideNodeKind, pauseForHuman, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePortSpec, subflowExecutor, subflowMode, subflowPorts, unregisterNodeKind, validateConfig } from './chunk-J5YUYDMK.js';
4
+ export { DEFAULT_MAX_DEPTH, LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, applyKindSchemaOverlay, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, declaredRoutes, decodePause, defaultConfigFor, encodePause, ensureBuiltinKinds, getNodeKind, isPause, kindIds, listNodeKinds, llmRouterExecutor as llmBranchExecutor, llmRouterExecutor, nodeConfig, onNodeKindsChanged, overrideNodeKind, pauseForHuman, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePortSpec, subflowExecutor, subflowMode, subflowPorts, unregisterNodeKind, validateConfig } from './chunk-OZHBAXMA.js';
5
5
  export { capabilityStatus, getLlmClient, getTerminalHost, getWorkflowResolver, isResolutionFailure, registerLlmClient, registerTerminalHost, registerWorkflowResolver } from './chunk-2QXKDLGT.js';
6
6
  //# sourceMappingURL=registry.js.map
7
7
  //# sourceMappingURL=registry.js.map
package/dist/runtime.cjs CHANGED
@@ -415,6 +415,7 @@ var branchExecutor = (ctx) => {
415
415
  const inputs = ctx.inputs;
416
416
  let taken;
417
417
  const raw = config.condition;
418
+ validateRoutingExpression(ctx, raw, "branch", "condition");
418
419
  if (typeof raw === "string" && raw.trim() !== "") {
419
420
  taken = truthy(resolve(raw, inputs));
420
421
  warnIfUnresolved(ctx, raw, taken ? "true" : "false");
@@ -584,6 +585,7 @@ var switchCaseExecutor = (ctx) => {
584
585
  const config = configOf(ctx.node);
585
586
  const inputs = ctx.inputs;
586
587
  const expression = config.value;
588
+ validateRoutingExpression(ctx, expression, "switch_case", "value");
587
589
  const value = text(resolve(expression, inputs));
588
590
  const cases = config.cases ?? {};
589
591
  const matched = Object.prototype.hasOwnProperty.call(cases, value);
@@ -591,6 +593,21 @@ var switchCaseExecutor = (ctx) => {
591
593
  warnIfUnresolved(ctx, expression, port, "value");
592
594
  return { __port: port, value: inputs.in ?? inputs };
593
595
  };
596
+ function validateRoutingExpression(ctx, value, kind, field) {
597
+ if (typeof value !== "string" || value.trim() === "") return;
598
+ const bare = value.trim();
599
+ const subject = `${kind} "${ctx.node.id}" ${field} "${bare}"`;
600
+ if (!value.includes("{{")) {
601
+ ctx.abort(`${subject} is not an expression -- wrap it: {{ ${bare} }}`);
602
+ }
603
+ let open = 0;
604
+ for (const [delimiter] of value.matchAll(/\{\{|\}\}/g)) {
605
+ open = delimiter === "{{" ? open + 1 : Math.max(0, open - 1);
606
+ }
607
+ if (open > 0) {
608
+ ctx.abort(`${subject} has an unclosed expression -- close every {{ with }}`);
609
+ }
610
+ }
594
611
 
595
612
  // src/registry/terminal-nodes.ts
596
613
  var DEFAULT_TIMEOUT_MS = 12e4;
@@ -1082,7 +1099,7 @@ var KINDS = [
1082
1099
  key: "condition",
1083
1100
  label: "Raw expression (advanced)",
1084
1101
  example: "{{ $json.active && $json.score > 10 }}",
1085
- description: "Escape hatch for logic the builder can't express. Overrides the conditions above when set."
1102
+ description: "Escape hatch for logic the builder can't express. Overrides the conditions above when set. String values must be {{ }}-wrapped expressions; bare strings and unclosed templates abort the run."
1086
1103
  }
1087
1104
  ]
1088
1105
  },
@@ -1102,7 +1119,7 @@ var KINDS = [
1102
1119
  // moves the ports on the canvas and the ports the runtime activates.
1103
1120
  outputs: (config) => casePorts(config?.cases),
1104
1121
  configSchema: [
1105
- { type: "expression", key: "value", label: "Switch on", example: "{{ $json.kind }}", required: true },
1122
+ { type: "expression", key: "value", label: "Switch on", description: "String values must be {{ }}-wrapped expressions; bare strings and unclosed templates abort the run.", example: "{{ $json.kind }}", required: true },
1106
1123
  {
1107
1124
  type: "keyvalue",
1108
1125
  key: "cases",