@particle-academy/fancy-flow 0.37.0 → 0.39.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.
package/dist/index.d.cts CHANGED
@@ -580,4 +580,72 @@ type FlowRunFeedProps = {
580
580
  */
581
581
  declare function FlowRunFeed({ entries, showHeader, title, running, className, style }: FlowRunFeedProps): react.JSX.Element;
582
582
 
583
- export { ActionNode, type AlignEdge, AutoLayoutOptions, ConfigField, ConfigFieldRenderer, type ConfigFieldRendererProps, ConnectionValidatorOptions, DecisionNode, ExecutorRegistry, FlowCanvas, type FlowCanvasProps, FlowEditor, type FlowEditorAction, type FlowEditorApi, type FlowEditorBuiltins, type FlowEditorProps, type FlowEditorSlots, FlowGraph, FlowNode, type FlowNodeRenderProps, FlowRunControls, type FlowRunControlsProps, FlowRunFeed, FlowRunFeedEntry, type FlowRunFeedProps, LaneNode, NodeCategory, NodeConfigPanel, type NodeConfigPanelProps, NodeKindDefinition, NodePalette, type NodePaletteProps, NodePort, type NodePortProps, type NodePortSide, type NodePortType, NodeRunStatus, NodeShell, type NodeShellProps, NoteNode, OutputNode, SubgraphNode, TriggerNode, WorkflowMetadata, WorkflowSchema, alignNodes, cloneSubgraph, defaultNodeTypes, defineNode, distributeNodes, paletteDropHandlers, reconnectEdge, useFlowEditor, useFlowEditorOptional };
583
+ /**
584
+ * The fancy-flow Live Contract — the run / job stream shape.
585
+ *
586
+ * Pure data, with `LiveContract` imported as a TYPE, so this adds no dependency.
587
+ * `FancyFlow\Laravel\LiveContract` declares the identical list and both sides
588
+ * assert parity.
589
+ *
590
+ * ## What makes this shape different
591
+ *
592
+ * A run emits far more than it stores. `NodeStatusChanged` and `NodeOutput`
593
+ * fire per node, many times a second on a wide graph — and a node's log line is
594
+ * not a cache entry, it is a **stream**. So the contract covers the run's
595
+ * DURABLE state (does this run exist, has it finished, is it waiting on a
596
+ * person) and deliberately leaves per-node chatter to `useFancyStream`, the
597
+ * same split the whiteboard makes between its document and its cursors.
598
+ *
599
+ * Get that wrong and a 40-node run invalidates the run list forty times while
600
+ * it executes, each one a re-fetch that tells the UI nothing it did not already
601
+ * learn from the stream.
602
+ *
603
+ * ## `awaiting` is the one that matters
604
+ *
605
+ * A run parking on a human step is the event a host most needs to react to —
606
+ * it is when a form has to appear in front of somebody. It gets its own event
607
+ * rather than folding into `updated`, so a host can subscribe to just that.
608
+ *
609
+ * ## Broadcast status, stated plainly
610
+ *
611
+ * `fancy-flow-php` currently dispatches these as **in-process Laravel events**;
612
+ * none of them implement `ShouldBroadcast` yet. This contract is therefore the
613
+ * agreed vocabulary rather than a description of traffic already on the wire: a
614
+ * host that wants live runs today re-broadcasts these under these names. Making
615
+ * the PHP events broadcast natively is a separate change, because it turns on
616
+ * websocket traffic for every consumer.
617
+ */
618
+ declare const flowLive: {
619
+ readonly namespace: "flow";
620
+ readonly events: readonly [{
621
+ readonly event: "flow.run.created";
622
+ readonly keys: readonly [readonly ["flow", "runs"]];
623
+ }, {
624
+ readonly event: "flow.run.updated";
625
+ readonly keys: readonly [readonly ["flow", "runs"]];
626
+ }, {
627
+ readonly event: "flow.run.completed";
628
+ readonly keys: readonly [readonly ["flow", "runs"]];
629
+ }, {
630
+ readonly event: "flow.run.awaiting";
631
+ readonly keys: readonly [readonly ["flow", "runs"]];
632
+ readonly note: "A run parking on a human step — the moment a form has to appear in front of somebody. Its own event so a host can subscribe to just that, rather than filtering every update.";
633
+ }, {
634
+ readonly event: "flow.run.failed";
635
+ readonly keys: readonly [readonly ["flow", "runs"]];
636
+ readonly note: "Not one of the standard verbs: a failed run is a terminal state a host renders differently from a completed one, so collapsing the two would lose the distinction.";
637
+ }];
638
+ };
639
+ /**
640
+ * Per-run keys, for a host showing a single run rather than the list.
641
+ *
642
+ * The contract declares prefixes because it is static data and a run id is not
643
+ * known until runtime. TanStack matches by prefix, so `["flow", "runs"]` still
644
+ * invalidates `["flow", "runs", runId]`.
645
+ */
646
+ declare const flowKeys: {
647
+ readonly runs: () => readonly ["flow", "runs"];
648
+ readonly run: (runId: string) => readonly ["flow", "runs", string];
649
+ };
650
+
651
+ export { ActionNode, type AlignEdge, AutoLayoutOptions, ConfigField, ConfigFieldRenderer, type ConfigFieldRendererProps, ConnectionValidatorOptions, DecisionNode, ExecutorRegistry, FlowCanvas, type FlowCanvasProps, FlowEditor, type FlowEditorAction, type FlowEditorApi, type FlowEditorBuiltins, type FlowEditorProps, type FlowEditorSlots, FlowGraph, FlowNode, type FlowNodeRenderProps, FlowRunControls, type FlowRunControlsProps, FlowRunFeed, FlowRunFeedEntry, type FlowRunFeedProps, LaneNode, NodeCategory, NodeConfigPanel, type NodeConfigPanelProps, NodeKindDefinition, NodePalette, type NodePaletteProps, NodePort, type NodePortProps, type NodePortSide, type NodePortType, NodeRunStatus, NodeShell, type NodeShellProps, NoteNode, OutputNode, SubgraphNode, TriggerNode, WorkflowMetadata, WorkflowSchema, alignNodes, cloneSubgraph, defaultNodeTypes, defineNode, distributeNodes, flowKeys, flowLive, paletteDropHandlers, reconnectEdge, useFlowEditor, useFlowEditorOptional };
package/dist/index.d.ts CHANGED
@@ -580,4 +580,72 @@ type FlowRunFeedProps = {
580
580
  */
581
581
  declare function FlowRunFeed({ entries, showHeader, title, running, className, style }: FlowRunFeedProps): react.JSX.Element;
582
582
 
583
- export { ActionNode, type AlignEdge, AutoLayoutOptions, ConfigField, ConfigFieldRenderer, type ConfigFieldRendererProps, ConnectionValidatorOptions, DecisionNode, ExecutorRegistry, FlowCanvas, type FlowCanvasProps, FlowEditor, type FlowEditorAction, type FlowEditorApi, type FlowEditorBuiltins, type FlowEditorProps, type FlowEditorSlots, FlowGraph, FlowNode, type FlowNodeRenderProps, FlowRunControls, type FlowRunControlsProps, FlowRunFeed, FlowRunFeedEntry, type FlowRunFeedProps, LaneNode, NodeCategory, NodeConfigPanel, type NodeConfigPanelProps, NodeKindDefinition, NodePalette, type NodePaletteProps, NodePort, type NodePortProps, type NodePortSide, type NodePortType, NodeRunStatus, NodeShell, type NodeShellProps, NoteNode, OutputNode, SubgraphNode, TriggerNode, WorkflowMetadata, WorkflowSchema, alignNodes, cloneSubgraph, defaultNodeTypes, defineNode, distributeNodes, paletteDropHandlers, reconnectEdge, useFlowEditor, useFlowEditorOptional };
583
+ /**
584
+ * The fancy-flow Live Contract — the run / job stream shape.
585
+ *
586
+ * Pure data, with `LiveContract` imported as a TYPE, so this adds no dependency.
587
+ * `FancyFlow\Laravel\LiveContract` declares the identical list and both sides
588
+ * assert parity.
589
+ *
590
+ * ## What makes this shape different
591
+ *
592
+ * A run emits far more than it stores. `NodeStatusChanged` and `NodeOutput`
593
+ * fire per node, many times a second on a wide graph — and a node's log line is
594
+ * not a cache entry, it is a **stream**. So the contract covers the run's
595
+ * DURABLE state (does this run exist, has it finished, is it waiting on a
596
+ * person) and deliberately leaves per-node chatter to `useFancyStream`, the
597
+ * same split the whiteboard makes between its document and its cursors.
598
+ *
599
+ * Get that wrong and a 40-node run invalidates the run list forty times while
600
+ * it executes, each one a re-fetch that tells the UI nothing it did not already
601
+ * learn from the stream.
602
+ *
603
+ * ## `awaiting` is the one that matters
604
+ *
605
+ * A run parking on a human step is the event a host most needs to react to —
606
+ * it is when a form has to appear in front of somebody. It gets its own event
607
+ * rather than folding into `updated`, so a host can subscribe to just that.
608
+ *
609
+ * ## Broadcast status, stated plainly
610
+ *
611
+ * `fancy-flow-php` currently dispatches these as **in-process Laravel events**;
612
+ * none of them implement `ShouldBroadcast` yet. This contract is therefore the
613
+ * agreed vocabulary rather than a description of traffic already on the wire: a
614
+ * host that wants live runs today re-broadcasts these under these names. Making
615
+ * the PHP events broadcast natively is a separate change, because it turns on
616
+ * websocket traffic for every consumer.
617
+ */
618
+ declare const flowLive: {
619
+ readonly namespace: "flow";
620
+ readonly events: readonly [{
621
+ readonly event: "flow.run.created";
622
+ readonly keys: readonly [readonly ["flow", "runs"]];
623
+ }, {
624
+ readonly event: "flow.run.updated";
625
+ readonly keys: readonly [readonly ["flow", "runs"]];
626
+ }, {
627
+ readonly event: "flow.run.completed";
628
+ readonly keys: readonly [readonly ["flow", "runs"]];
629
+ }, {
630
+ readonly event: "flow.run.awaiting";
631
+ readonly keys: readonly [readonly ["flow", "runs"]];
632
+ readonly note: "A run parking on a human step — the moment a form has to appear in front of somebody. Its own event so a host can subscribe to just that, rather than filtering every update.";
633
+ }, {
634
+ readonly event: "flow.run.failed";
635
+ readonly keys: readonly [readonly ["flow", "runs"]];
636
+ readonly note: "Not one of the standard verbs: a failed run is a terminal state a host renders differently from a completed one, so collapsing the two would lose the distinction.";
637
+ }];
638
+ };
639
+ /**
640
+ * Per-run keys, for a host showing a single run rather than the list.
641
+ *
642
+ * The contract declares prefixes because it is static data and a run id is not
643
+ * known until runtime. TanStack matches by prefix, so `["flow", "runs"]` still
644
+ * invalidates `["flow", "runs", runId]`.
645
+ */
646
+ declare const flowKeys: {
647
+ readonly runs: () => readonly ["flow", "runs"];
648
+ readonly run: (runId: string) => readonly ["flow", "runs", string];
649
+ };
650
+
651
+ export { ActionNode, type AlignEdge, AutoLayoutOptions, ConfigField, ConfigFieldRenderer, type ConfigFieldRendererProps, ConnectionValidatorOptions, DecisionNode, ExecutorRegistry, FlowCanvas, type FlowCanvasProps, FlowEditor, type FlowEditorAction, type FlowEditorApi, type FlowEditorBuiltins, type FlowEditorProps, type FlowEditorSlots, FlowGraph, FlowNode, type FlowNodeRenderProps, FlowRunControls, type FlowRunControlsProps, FlowRunFeed, FlowRunFeedEntry, type FlowRunFeedProps, LaneNode, NodeCategory, NodeConfigPanel, type NodeConfigPanelProps, NodeKindDefinition, NodePalette, type NodePaletteProps, NodePort, type NodePortProps, type NodePortSide, type NodePortType, NodeRunStatus, NodeShell, type NodeShellProps, NoteNode, OutputNode, SubgraphNode, TriggerNode, WorkflowMetadata, WorkflowSchema, alignNodes, cloneSubgraph, defaultNodeTypes, defineNode, distributeNodes, flowKeys, flowLive, paletteDropHandlers, reconnectEdge, useFlowEditor, useFlowEditorOptional };
package/dist/index.js CHANGED
@@ -1506,9 +1506,33 @@ function NodePort({ side, type, id, style, title, className }) {
1506
1506
  );
1507
1507
  }
1508
1508
 
1509
+ // src/live.ts
1510
+ var flowLive = {
1511
+ namespace: "flow",
1512
+ events: [
1513
+ { event: "flow.run.created", keys: [["flow", "runs"]] },
1514
+ { event: "flow.run.updated", keys: [["flow", "runs"]] },
1515
+ { event: "flow.run.completed", keys: [["flow", "runs"]] },
1516
+ {
1517
+ event: "flow.run.awaiting",
1518
+ keys: [["flow", "runs"]],
1519
+ note: "A run parking on a human step \u2014 the moment a form has to appear in front of somebody. Its own event so a host can subscribe to just that, rather than filtering every update."
1520
+ },
1521
+ {
1522
+ event: "flow.run.failed",
1523
+ keys: [["flow", "runs"]],
1524
+ note: "Not one of the standard verbs: a failed run is a terminal state a host renders differently from a completed one, so collapsing the two would lose the distinction."
1525
+ }
1526
+ ]
1527
+ };
1528
+ var flowKeys = {
1529
+ runs: () => ["flow", "runs"],
1530
+ run: (runId) => ["flow", "runs", runId]
1531
+ };
1532
+
1509
1533
  // src/index.ts
1510
1534
  registerBuiltinKinds();
1511
1535
 
1512
- export { ConfigFieldRenderer, FlowEditor, FlowRunControls, FlowRunFeed, NodeConfigPanel, NodePalette, NodePort, defineNode, paletteDropHandlers };
1536
+ export { ConfigFieldRenderer, FlowEditor, FlowRunControls, FlowRunFeed, NodeConfigPanel, NodePalette, NodePort, defineNode, flowKeys, flowLive, paletteDropHandlers };
1513
1537
  //# sourceMappingURL=index.js.map
1514
1538
  //# sourceMappingURL=index.js.map