@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
@@ -1202,6 +1202,7 @@ var branchExecutor = (ctx) => {
1202
1202
  const inputs = ctx.inputs;
1203
1203
  let taken;
1204
1204
  const raw = config.condition;
1205
+ validateRoutingExpression(ctx, raw, "branch", "condition");
1205
1206
  if (typeof raw === "string" && raw.trim() !== "") {
1206
1207
  taken = truthy(resolve(raw, inputs));
1207
1208
  warnIfUnresolved(ctx, raw, taken ? "true" : "false");
@@ -1371,6 +1372,7 @@ var switchCaseExecutor = (ctx) => {
1371
1372
  const config = configOf(ctx.node);
1372
1373
  const inputs = ctx.inputs;
1373
1374
  const expression = config.value;
1375
+ validateRoutingExpression(ctx, expression, "switch_case", "value");
1374
1376
  const value = text(resolve(expression, inputs));
1375
1377
  const cases = config.cases ?? {};
1376
1378
  const matched = Object.prototype.hasOwnProperty.call(cases, value);
@@ -1378,6 +1380,21 @@ var switchCaseExecutor = (ctx) => {
1378
1380
  warnIfUnresolved(ctx, expression, port, "value");
1379
1381
  return { __port: port, value: inputs.in ?? inputs };
1380
1382
  };
1383
+ function validateRoutingExpression(ctx, value, kind, field) {
1384
+ if (typeof value !== "string" || value.trim() === "") return;
1385
+ const bare = value.trim();
1386
+ const subject = `${kind} "${ctx.node.id}" ${field} "${bare}"`;
1387
+ if (!value.includes("{{")) {
1388
+ ctx.abort(`${subject} is not an expression -- wrap it: {{ ${bare} }}`);
1389
+ }
1390
+ let open = 0;
1391
+ for (const [delimiter] of value.matchAll(/\{\{|\}\}/g)) {
1392
+ open = delimiter === "{{" ? open + 1 : Math.max(0, open - 1);
1393
+ }
1394
+ if (open > 0) {
1395
+ ctx.abort(`${subject} has an unclosed expression -- close every {{ with }}`);
1396
+ }
1397
+ }
1381
1398
 
1382
1399
  // src/registry/terminal-nodes.ts
1383
1400
  var DEFAULT_TIMEOUT_MS = 12e4;
@@ -1869,7 +1886,7 @@ var KINDS = [
1869
1886
  key: "condition",
1870
1887
  label: "Raw expression (advanced)",
1871
1888
  example: "{{ $json.active && $json.score > 10 }}",
1872
- description: "Escape hatch for logic the builder can't express. Overrides the conditions above when set."
1889
+ 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."
1873
1890
  }
1874
1891
  ]
1875
1892
  },
@@ -1889,7 +1906,7 @@ var KINDS = [
1889
1906
  // moves the ports on the canvas and the ports the runtime activates.
1890
1907
  outputs: (config) => casePorts(config?.cases),
1891
1908
  configSchema: [
1892
- { type: "expression", key: "value", label: "Switch on", example: "{{ $json.kind }}", required: true },
1909
+ { 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 },
1893
1910
  {
1894
1911
  type: "keyvalue",
1895
1912
  key: "cases",
@@ -2994,5 +3011,5 @@ function describeExpressionGrammar() {
2994
3011
  }
2995
3012
 
2996
3013
  export { BUILTIN_KIND_DATA, DEFAULT_MAX_DEPTH, LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, RunIdentity, UnresolvedPathError, applyKindSchemaOverlay, availableVariables, baseVariables, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, declaredRoutes, decodePause, defaultConfigFor, describeExpressionGrammar, encodePause, ensureBuiltinKinds, escapeSegment, evaluateConfig, evaluateExpression, getNodeKind, humanInputFields, isPause, kindIds, listNodeKinds, llmRouterExecutor, nodeConfig, onNodeKindsChanged, outputFieldsFor, overrideNodeKind, pauseForHuman, registerBuiltinKindInternal, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePath, resolvePortSpec, runFlow, subflowExecutor, subflowMode, subflowPorts, text, truthy, tryResolvePath, undeliveredEdgeWarnings, unregisterNodeKind, validateConfig };
2997
- //# sourceMappingURL=chunk-J5YUYDMK.js.map
2998
- //# sourceMappingURL=chunk-J5YUYDMK.js.map
3014
+ //# sourceMappingURL=chunk-OZHBAXMA.js.map
3015
+ //# sourceMappingURL=chunk-OZHBAXMA.js.map