@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/registry.js CHANGED
@@ -1,8 +1,8 @@
1
- export { ANY_PORT_TYPE, BUILTIN_KINDS, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds } from './chunk-3L47KJ6Q.js';
1
+ export { ANY_PORT_TYPE, BUILTIN_KINDS, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds } from './chunk-57QTX3S3.js';
2
2
  export { RichInputPreview, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerRichInputAdapter } from './chunk-F5RPRB7A.js';
3
3
  import './chunk-OWENS2H5.js';
4
4
  export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-UEOE6B52.js';
5
- export { DEFAULT_MAX_DEPTH, applyKindSchemaOverlay, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, declaredRoutes, defaultConfigFor, ensureBuiltinKinds, getNodeKind, kindIds, listNodeKinds, llmRouterExecutor as llmBranchExecutor, llmRouterExecutor, nodeConfig, onNodeKindsChanged, overrideNodeKind, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePortSpec, subflowExecutor, subflowMode, subflowPorts, unregisterNodeKind, validateConfig } from './chunk-EVGSL2EM.js';
5
+ export { DEFAULT_MAX_DEPTH, applyKindSchemaOverlay, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, declaredRoutes, defaultConfigFor, ensureBuiltinKinds, getNodeKind, kindIds, listNodeKinds, llmRouterExecutor as llmBranchExecutor, llmRouterExecutor, nodeConfig, onNodeKindsChanged, overrideNodeKind, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePortSpec, subflowExecutor, subflowMode, subflowPorts, unregisterNodeKind, validateConfig } from './chunk-C5K2DSZB.js';
6
6
  export { capabilityStatus, getLlmClient, getTerminalHost, getWorkflowResolver, isResolutionFailure, registerLlmClient, registerTerminalHost, registerWorkflowResolver } from './chunk-2QXKDLGT.js';
7
7
  //# sourceMappingURL=registry.js.map
8
8
  //# sourceMappingURL=registry.js.map
package/dist/runtime.cjs CHANGED
@@ -1827,24 +1827,6 @@ function resolveNodePorts(node, kind) {
1827
1827
  };
1828
1828
  }
1829
1829
 
1830
- // src/expressions/variables.ts
1831
- function outputFieldsFor(node) {
1832
- const kindName = node.data?.kind ?? node.type;
1833
- if (!kindName) return [];
1834
- const kind = getNodeKind(kindName);
1835
- const shape = kind?.outputShape;
1836
- if (!shape) return [];
1837
- if (typeof shape === "function") {
1838
- try {
1839
- const config = node.data?.config ?? {};
1840
- return shape(config) ?? [];
1841
- } catch {
1842
- return [];
1843
- }
1844
- }
1845
- return shape;
1846
- }
1847
-
1848
1830
  // src/runtime/run-identity.ts
1849
1831
  function escapeSegment(value) {
1850
1832
  return value.replace(/%/g, "%25").replace(/\//g, "%2F").replace(/#/g, "%23");
@@ -2188,6 +2170,81 @@ function specForLane(lane) {
2188
2170
  };
2189
2171
  }
2190
2172
 
2173
+ // src/expressions/variables.ts
2174
+ function outputFieldsFor(node) {
2175
+ const kindName = node.data?.kind ?? node.type;
2176
+ if (!kindName) return [];
2177
+ const kind = getNodeKind(kindName);
2178
+ const shape = kind?.outputShape;
2179
+ if (!shape) return [];
2180
+ if (typeof shape === "function") {
2181
+ try {
2182
+ const config = node.data?.config ?? {};
2183
+ return shape(config) ?? [];
2184
+ } catch {
2185
+ return [];
2186
+ }
2187
+ }
2188
+ return shape;
2189
+ }
2190
+
2191
+ // src/runtime/undelivered-edges.ts
2192
+ function undeliveredEdgeWarnings(target, incoming, portValues, completed, nodesById) {
2193
+ const events = [];
2194
+ for (const e of incoming) {
2195
+ const handle = e.sourceHandle ?? "out";
2196
+ if (portValues.has(`${e.source}:${handle}`) || !completed.has(e.source)) continue;
2197
+ if (possiblePortIds(nodesById.get(e.source)).includes(handle)) continue;
2198
+ events.push({
2199
+ type: "log",
2200
+ nodeId: target.id,
2201
+ level: "warn",
2202
+ message: undeliveredEdgeMessage(e, target, portValues, nodesById),
2203
+ detail: { edge: e.id, source: e.source, sourceHandle: handle }
2204
+ });
2205
+ }
2206
+ return events;
2207
+ }
2208
+ function possiblePortIds(node) {
2209
+ if (!node) return ["out"];
2210
+ const own = node.data?.outputs;
2211
+ if (Array.isArray(own)) return own.map((p) => p.id);
2212
+ const kind = getNodeKind(node.data?.kind ?? node.type ?? "");
2213
+ if (!kind) return ["out"];
2214
+ const config = nodeConfig(node);
2215
+ const representative = typeof kind.outputs === "function" && !configDeclaresPorts(kind.name, config);
2216
+ const ids = (resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config) ?? []).map((p) => p.id);
2217
+ return ids.length > 0 ? ids : ["out"];
2218
+ }
2219
+ function configDeclaresPorts(kindName, config) {
2220
+ const bare = kindName.startsWith("@") ? kindName.slice(kindName.lastIndexOf("/") + 1) : kindName;
2221
+ if (bare === "switch_case") {
2222
+ const cases = config.cases;
2223
+ return !!cases && typeof cases === "object" && Object.values(cases).some((port) => typeof port === "string" && port !== "");
2224
+ }
2225
+ if (bare === "llm_router") {
2226
+ const routes = config.routes;
2227
+ return Array.isArray(routes) && routes.some((route) => route?.port != null && route.port !== "");
2228
+ }
2229
+ return true;
2230
+ }
2231
+ function undeliveredEdgeMessage(edge, target, portValues, nodesById) {
2232
+ const handle = edge.sourceHandle ?? "out";
2233
+ const prefix = `${edge.source}:`;
2234
+ const available = [];
2235
+ for (const key of portValues.keys()) {
2236
+ if (key.startsWith(prefix)) available.push(key.slice(prefix.length));
2237
+ }
2238
+ 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.`;
2239
+ if (available.length > 0) message += ` Available: ${available.join(", ")}.`;
2240
+ const source = nodesById.get(edge.source);
2241
+ if (source && outputFieldsFor(source).some((field) => field?.path === handle)) {
2242
+ 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.`;
2243
+ }
2244
+ if (edge.sourceHandle != null) message += " Leave sourceHandle off to read the node's output.";
2245
+ return message;
2246
+ }
2247
+
2191
2248
  // src/runtime/workflow-props.ts
2192
2249
  function typeOf(value) {
2193
2250
  if (value === null) return "null";
@@ -2309,17 +2366,8 @@ async function runFlow(graph, executors, onEvent = () => {
2309
2366
  onEvent({ type: "node-status", nodeId: node.id, status: "idle", text: "skipped" });
2310
2367
  continue;
2311
2368
  }
2312
- for (const e of incoming) {
2313
- const handle = e.sourceHandle ?? "out";
2314
- if (portValues.has(`${e.source}:${handle}`) || !completed.has(e.source)) continue;
2315
- if (possiblePortIds(nodesById.get(e.source)).includes(handle)) continue;
2316
- onEvent({
2317
- type: "log",
2318
- nodeId: node.id,
2319
- level: "warn",
2320
- message: undeliveredEdgeMessage(e, node, portValues, nodesById),
2321
- detail: { edge: e.id, source: e.source, sourceHandle: handle }
2322
- });
2369
+ for (const warning of undeliveredEdgeWarnings(node, incoming, portValues, completed, nodesById)) {
2370
+ onEvent(warning);
2323
2371
  }
2324
2372
  if (incoming.length > 0) {
2325
2373
  const anyActive = incoming.some((e) => portValues.has(`${e.source}:${e.sourceHandle ?? "out"}`));
@@ -2483,45 +2531,6 @@ function activatedPorts(node, result) {
2483
2531
  const declared = resolveNodePorts(node, kind).outputs?.map((p) => p.id);
2484
2532
  return { ports: declared?.length ? declared : ["out"], value: result };
2485
2533
  }
2486
- function possiblePortIds(node) {
2487
- if (!node) return ["out"];
2488
- const own = node.data?.outputs;
2489
- if (Array.isArray(own)) return own.map((p) => p.id);
2490
- const kind = getNodeKind(node.data?.kind ?? node.type ?? "");
2491
- if (!kind) return ["out"];
2492
- const config = nodeConfig(node);
2493
- const representative = typeof kind.outputs === "function" && !configDeclaresPorts(kind.name, config);
2494
- const ids = (resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config) ?? []).map((p) => p.id);
2495
- return ids.length > 0 ? ids : ["out"];
2496
- }
2497
- function configDeclaresPorts(kindName, config) {
2498
- const bare = kindName.startsWith("@") ? kindName.slice(kindName.lastIndexOf("/") + 1) : kindName;
2499
- if (bare === "switch_case") {
2500
- const cases = config.cases;
2501
- return !!cases && typeof cases === "object" && Object.values(cases).some((port) => typeof port === "string" && port !== "");
2502
- }
2503
- if (bare === "llm_router") {
2504
- const routes = config.routes;
2505
- return Array.isArray(routes) && routes.some((route) => route?.port != null && route.port !== "");
2506
- }
2507
- return true;
2508
- }
2509
- function undeliveredEdgeMessage(edge, target, portValues, nodesById) {
2510
- const handle = edge.sourceHandle ?? "out";
2511
- const prefix = `${edge.source}:`;
2512
- const available = [];
2513
- for (const key of portValues.keys()) {
2514
- if (key.startsWith(prefix)) available.push(key.slice(prefix.length));
2515
- }
2516
- 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.`;
2517
- if (available.length > 0) message += ` Available: ${available.join(", ")}.`;
2518
- const source = nodesById.get(edge.source);
2519
- if (source && outputFieldsFor(source).some((field) => field?.path === handle)) {
2520
- 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.`;
2521
- }
2522
- if (edge.sourceHandle != null) message += " Leave sourceHandle off to read the node's output.";
2523
- return message;
2524
- }
2525
2534
  function announce(onEvent, node, phase) {
2526
2535
  const data = node.data;
2527
2536
  const raw = phase === "start" ? data?.startingMsg : data?.stoppingMsg;