@particle-academy/fancy-flow 0.48.0 → 0.49.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 (83) hide show
  1. package/dist/{ConfigFieldRenderer-NuDjtun1.d.cts → ConfigFieldRenderer-CrXFq6Eb.d.cts} +2 -2
  2. package/dist/{ConfigFieldRenderer-DrD2-Qml.d.ts → ConfigFieldRenderer-u3nYHovX.d.ts} +2 -2
  3. package/dist/{FlowViewer-CY3_vHSg.d.cts → FlowViewer-CFSMlCqi.d.cts} +1 -1
  4. package/dist/{FlowViewer-DGW6t-80.d.ts → FlowViewer-DRgjeWJ7.d.ts} +1 -1
  5. package/dist/{capabilities-DMUhnyZD.d.ts → capabilities-B00VXLUp.d.ts} +1 -1
  6. package/dist/{capabilities-Dmd26aAs.d.cts → capabilities-VzgDApur.d.cts} +1 -1
  7. package/dist/{chunk-MJ3A3TAI.js → chunk-6FP3F5YR.js} +21 -4
  8. package/dist/chunk-6FP3F5YR.js.map +1 -0
  9. package/dist/{chunk-DRRZEAYB.js → chunk-6XKR65XM.js} +3 -3
  10. package/dist/{chunk-DRRZEAYB.js.map → chunk-6XKR65XM.js.map} +1 -1
  11. package/dist/{chunk-UVP43XU2.js → chunk-AVRGZFXG.js} +4 -4
  12. package/dist/{chunk-UVP43XU2.js.map → chunk-AVRGZFXG.js.map} +1 -1
  13. package/dist/{chunk-E6T3FZZP.js → chunk-UL3DGSSG.js} +9 -4
  14. package/dist/chunk-UL3DGSSG.js.map +1 -0
  15. package/dist/{chunk-7DTUZUTB.js → chunk-VUL7CUFW.js} +3 -3
  16. package/dist/{chunk-7DTUZUTB.js.map → chunk-VUL7CUFW.js.map} +1 -1
  17. package/dist/{chunk-KTGXZBUM.js → chunk-YOK3WKWC.js} +7 -3
  18. package/dist/chunk-YOK3WKWC.js.map +1 -0
  19. package/dist/connectors.d.cts +2 -2
  20. package/dist/connectors.d.ts +2 -2
  21. package/dist/durable/index.d.cts +2 -2
  22. package/dist/durable/index.d.ts +2 -2
  23. package/dist/durable.cjs +19 -2
  24. package/dist/durable.cjs.map +1 -1
  25. package/dist/durable.js +1 -1
  26. package/dist/engine.cjs +19 -2
  27. package/dist/engine.cjs.map +1 -1
  28. package/dist/engine.d.cts +7 -7
  29. package/dist/engine.d.ts +7 -7
  30. package/dist/engine.js +3 -3
  31. package/dist/fields/react-fancy.d.cts +3 -3
  32. package/dist/fields/react-fancy.d.ts +3 -3
  33. package/dist/index.cjs +60 -3
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +11 -11
  36. package/dist/index.d.ts +11 -11
  37. package/dist/index.js +42 -11
  38. package/dist/index.js.map +1 -1
  39. package/dist/layout/index.d.cts +1 -1
  40. package/dist/layout/index.d.ts +1 -1
  41. package/dist/llm/prism.d.cts +2 -2
  42. package/dist/llm/prism.d.ts +2 -2
  43. package/dist/llm/vercel-ai.d.cts +2 -2
  44. package/dist/llm/vercel-ai.d.ts +2 -2
  45. package/dist/registry/index.d.cts +6 -6
  46. package/dist/registry/index.d.ts +6 -6
  47. package/dist/{registry-DpARG95T.d.ts → registry-6cB5wCv6.d.ts} +1 -1
  48. package/dist/{registry-BnnifM-t.d.cts → registry-DQh7ZmnM.d.cts} +1 -1
  49. package/dist/registry.cjs +19 -2
  50. package/dist/registry.cjs.map +1 -1
  51. package/dist/registry.js +2 -2
  52. package/dist/{run-cohort-DdPPowJ3.d.cts → run-cohort-DYCL8Qv6.d.cts} +2 -2
  53. package/dist/{run-cohort-Cyeny2Uu.d.ts → run-cohort-VX4JG21l.d.ts} +2 -2
  54. package/dist/{run-flow-1KiXhy59.d.cts → run-flow-B24QUO1H.d.cts} +1 -1
  55. package/dist/{run-flow-CQvTDBYk.d.ts → run-flow-DPUPAWk6.d.ts} +1 -1
  56. package/dist/runtime/index.d.cts +18 -6
  57. package/dist/runtime/index.d.ts +18 -6
  58. package/dist/runtime.cjs +25 -3
  59. package/dist/runtime.cjs.map +1 -1
  60. package/dist/runtime.js +3 -3
  61. package/dist/schema/index.d.cts +9 -1
  62. package/dist/schema/index.d.ts +9 -1
  63. package/dist/schema.cjs +23 -2
  64. package/dist/schema.cjs.map +1 -1
  65. package/dist/schema.js +2 -2
  66. package/dist/screens.cjs +19 -2
  67. package/dist/screens.cjs.map +1 -1
  68. package/dist/screens.d.cts +2 -2
  69. package/dist/screens.d.ts +2 -2
  70. package/dist/screens.js +4 -4
  71. package/dist/{types-Jx1TwehV.d.ts → types-7cXcSQlx.d.cts} +50 -0
  72. package/dist/{types-Jx1TwehV.d.cts → types-7cXcSQlx.d.ts} +50 -0
  73. package/dist/{types-BO8TgI2M.d.cts → types-BtMOnb9I.d.cts} +1 -1
  74. package/dist/{types-DJAmfiJC.d.ts → types-CDgIIj4c.d.ts} +1 -1
  75. package/dist/ux.cjs +19 -2
  76. package/dist/ux.cjs.map +1 -1
  77. package/dist/ux.d.cts +2 -2
  78. package/dist/ux.d.ts +2 -2
  79. package/dist/ux.js +1 -1
  80. package/package.json +1 -1
  81. package/dist/chunk-E6T3FZZP.js.map +0 -1
  82. package/dist/chunk-KTGXZBUM.js.map +0 -1
  83. package/dist/chunk-MJ3A3TAI.js.map +0 -1
package/dist/runtime.js CHANGED
@@ -1,6 +1,6 @@
1
- export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-E6T3FZZP.js';
2
- export { runCohort } from './chunk-7DTUZUTB.js';
3
- export { RunIdentity, escapeSegment, runFlow } from './chunk-MJ3A3TAI.js';
1
+ export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-UL3DGSSG.js';
2
+ export { runCohort } from './chunk-VUL7CUFW.js';
3
+ export { RunIdentity, escapeSegment, runFlow } from './chunk-6FP3F5YR.js';
4
4
  import './chunk-F5RPRB7A.js';
5
5
  import './chunk-USL4FMFU.js';
6
6
  //# sourceMappingURL=runtime.js.map
@@ -1,4 +1,4 @@
1
- import { P as PortDescriptor, F as FlowGraph } from '../types-Jx1TwehV.cjs';
1
+ import { P as PortDescriptor, F as FlowGraph } from '../types-7cXcSQlx.cjs';
2
2
  import '@xyflow/react';
3
3
 
4
4
  /** Schema version. Bump on breaking shape changes; add migrations as needed. */
@@ -39,6 +39,14 @@ type WorkflowSchemaNode = {
39
39
  };
40
40
  label?: string;
41
41
  description?: string;
42
+ /**
43
+ * Announced to a person just before / just after this node runs. Omitted
44
+ * entirely when unset, so a graph of ordinary plumbing nodes does not carry
45
+ * a pair of empty keys per node and every diff of a saved graph stays
46
+ * readable.
47
+ */
48
+ startingMsg?: string;
49
+ stoppingMsg?: string;
42
50
  config?: Record<string, unknown>;
43
51
  /**
44
52
  * Resolved ports, written on export.
@@ -1,4 +1,4 @@
1
- import { P as PortDescriptor, F as FlowGraph } from '../types-Jx1TwehV.js';
1
+ import { P as PortDescriptor, F as FlowGraph } from '../types-7cXcSQlx.js';
2
2
  import '@xyflow/react';
3
3
 
4
4
  /** Schema version. Bump on breaking shape changes; add migrations as needed. */
@@ -39,6 +39,14 @@ type WorkflowSchemaNode = {
39
39
  };
40
40
  label?: string;
41
41
  description?: string;
42
+ /**
43
+ * Announced to a person just before / just after this node runs. Omitted
44
+ * entirely when unset, so a graph of ordinary plumbing nodes does not carry
45
+ * a pair of empty keys per node and every diff of a saved graph stays
46
+ * readable.
47
+ */
48
+ startingMsg?: string;
49
+ stoppingMsg?: string;
42
50
  config?: Record<string, unknown>;
43
51
  /**
44
52
  * Resolved ports, written on export.
package/dist/schema.cjs CHANGED
@@ -9281,6 +9281,7 @@ async function runFlow(graph, executors, onEvent = () => {
9281
9281
  continue;
9282
9282
  }
9283
9283
  onEvent({ type: "node-status", nodeId: node.id, status: "running" });
9284
+ announce(onEvent, node, "start");
9284
9285
  const inputs = collectInputs(node, incoming, portValues, initialInputs);
9285
9286
  const exec = pickExecutor(executors, node);
9286
9287
  if (!exec) {
@@ -9299,6 +9300,7 @@ async function runFlow(graph, executors, onEvent = () => {
9299
9300
  throw new Error(reason ?? "aborted");
9300
9301
  },
9301
9302
  emit: onEvent,
9303
+ executors,
9302
9304
  depth,
9303
9305
  run
9304
9306
  })
@@ -9311,6 +9313,7 @@ async function runFlow(graph, executors, onEvent = () => {
9311
9313
  }
9312
9314
  completed.add(node.id);
9313
9315
  onEvent({ type: "node-status", nodeId: node.id, status: "done" });
9316
+ announce(onEvent, node, "end");
9314
9317
  } catch (e) {
9315
9318
  const msg = e instanceof Error ? e.message : String(e);
9316
9319
  errors.push(msg);
@@ -9369,7 +9372,10 @@ function collectInputs(node, incoming, portValues, initial) {
9369
9372
  function pickExecutor(executors, node) {
9370
9373
  if (executors[node.id]) return executors[node.id];
9371
9374
  if (node.type && executors[node.type]) return executors[node.type];
9372
- const kind = node.type ? getNodeKind(node.type) : null;
9375
+ const declared = node.data?.kind;
9376
+ const kindName = typeof declared === "string" && declared !== "" ? declared : node.type;
9377
+ if (kindName && kindName !== node.type && executors[kindName]) return executors[kindName];
9378
+ const kind = kindName ? getNodeKind(kindName) : null;
9373
9379
  if (kind) {
9374
9380
  for (const id2 of kindIds(kind)) {
9375
9381
  if (executors[id2]) return executors[id2];
@@ -9391,6 +9397,14 @@ function activatedPorts(node, result) {
9391
9397
  const declared = resolveNodePorts(node, kind).outputs?.map((p) => p.id);
9392
9398
  return { ports: declared?.length ? declared : ["out"], value: result };
9393
9399
  }
9400
+ function announce(onEvent, node, phase) {
9401
+ const data = node.data;
9402
+ const raw = phase === "start" ? data?.startingMsg : data?.stoppingMsg;
9403
+ if (typeof raw !== "string") return;
9404
+ const message = raw.trim();
9405
+ if (message === "") return;
9406
+ onEvent({ type: "node-message", nodeId: node.id, phase, message });
9407
+ }
9394
9408
 
9395
9409
  // src/registry/subflow.ts
9396
9410
  var DEFAULT_MAX_DEPTH = 8;
@@ -9444,7 +9458,10 @@ var subflowExecutor = async (ctx) => {
9444
9458
  };
9445
9459
  const result = await runFlow(
9446
9460
  child,
9447
- config.executors ?? {},
9461
+ // Inherit the parent's registry, then let the graph layer its own on top.
9462
+ // The inherited half is the fix; the layered half keeps a graph that
9463
+ // deliberately hands its child extra or different executors working.
9464
+ { ...ctx.executors ?? {}, ...config.executors ?? {} },
9448
9465
  forward,
9449
9466
  {
9450
9467
  initialInputs: config.inputs ?? {
@@ -10504,6 +10521,8 @@ function toSchemaNode(n) {
10504
10521
  position: { x: n.position.x, y: n.position.y },
10505
10522
  label: data.label,
10506
10523
  description: data.description,
10524
+ ...typeof data.startingMsg === "string" && data.startingMsg !== "" ? { startingMsg: data.startingMsg } : {},
10525
+ ...typeof data.stoppingMsg === "string" && data.stoppingMsg !== "" ? { stoppingMsg: data.stoppingMsg } : {},
10507
10526
  config: data.config,
10508
10527
  inputs: ports.inputs,
10509
10528
  outputs: ports.outputs,
@@ -10576,6 +10595,8 @@ function importWorkflow(schema, options = {}) {
10576
10595
  kind: kindId,
10577
10596
  label: n.label ?? kind?.label ?? n.kind,
10578
10597
  description: n.description,
10598
+ ...n.startingMsg ? { startingMsg: n.startingMsg } : {},
10599
+ ...n.stoppingMsg ? { stoppingMsg: n.stoppingMsg } : {},
10579
10600
  config,
10580
10601
  // Carry serialized ports back onto the node so a round-trip is stable
10581
10602
  // and an unknown kind still routes the way the document described.