@railtownai/railtracks-visualizer 0.0.61 → 0.0.62

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/cjs/index.js CHANGED
@@ -52440,7 +52440,8 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52440
52440
  flowData.nodes,
52441
52441
  flowData.edges,
52442
52442
  flowData.stamps,
52443
- flowData.steps
52443
+ flowData.steps,
52444
+ flowData.run_id
52444
52445
  ]);
52445
52446
  // Auto-play functionality
52446
52447
  React.useEffect(()=>{
@@ -52469,8 +52470,9 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52469
52470
  isPlaying,
52470
52471
  maxStep
52471
52472
  ]);
52472
- // Default to the final step for this run so the full graph is visible (stamps may be missing)
52473
- React.useEffect(()=>{
52473
+ // Default to the final step for this run so the full graph is visible (stamps may be missing).
52474
+ // useLayoutEffect: align step before paint so getNodesForStep(currentStep) never briefly filters out the whole graph.
52475
+ React.useLayoutEffect(()=>{
52474
52476
  setCurrentStep(maxStep);
52475
52477
  }, [
52476
52478
  maxStep,
@@ -52557,7 +52559,7 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52557
52559
  x: 0,
52558
52560
  y: 0
52559
52561
  };
52560
- const isActive = node.stamp.step === currentStep;
52562
+ const isActive = node.stamp?.step === currentStep;
52561
52563
  const rawType = node.node_type || "Agent";
52562
52564
  const resolvedType = rawType === "Coordinator" ? "Agent" : rawType;
52563
52565
  // Extract edge details for Tool nodes
@@ -52591,7 +52593,7 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52591
52593
  const edges = React.useMemo(()=>{
52592
52594
  const stepEdges = getEdgesForStep(currentStep);
52593
52595
  return stepEdges.filter((edge)=>edge.source && edge.target).map((edge)=>{
52594
- const isActive = edge.stamp.step === currentStep;
52596
+ const isActive = edge.stamp?.step === currentStep;
52595
52597
  return {
52596
52598
  id: edge.identifier,
52597
52599
  type: "smoothstep",
@@ -52619,14 +52621,14 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52619
52621
  ]);
52620
52622
  const [nodesState, setNodes, onNodesChange] = useNodesState(nodes);
52621
52623
  const [edgesState, setEdges, onEdgesChange] = useEdgesState(edges);
52622
- // Update nodes and edges when currentStep changes
52623
- React.useEffect(()=>{
52624
+ // Keep React Flow store in sync with derived nodes/edges before paint to avoid transient empty graphs.
52625
+ React.useLayoutEffect(()=>{
52624
52626
  setNodes(nodes);
52625
52627
  }, [
52626
52628
  nodes,
52627
52629
  setNodes
52628
52630
  ]);
52629
- React.useEffect(()=>{
52631
+ React.useLayoutEffect(()=>{
52630
52632
  setEdges(edges);
52631
52633
  }, [
52632
52634
  edges,
package/dist/esm/index.js CHANGED
@@ -52420,7 +52420,8 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52420
52420
  flowData.nodes,
52421
52421
  flowData.edges,
52422
52422
  flowData.stamps,
52423
- flowData.steps
52423
+ flowData.steps,
52424
+ flowData.run_id
52424
52425
  ]);
52425
52426
  // Auto-play functionality
52426
52427
  useEffect(()=>{
@@ -52449,8 +52450,9 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52449
52450
  isPlaying,
52450
52451
  maxStep
52451
52452
  ]);
52452
- // Default to the final step for this run so the full graph is visible (stamps may be missing)
52453
- useEffect(()=>{
52453
+ // Default to the final step for this run so the full graph is visible (stamps may be missing).
52454
+ // useLayoutEffect: align step before paint so getNodesForStep(currentStep) never briefly filters out the whole graph.
52455
+ useLayoutEffect(()=>{
52454
52456
  setCurrentStep(maxStep);
52455
52457
  }, [
52456
52458
  maxStep,
@@ -52537,7 +52539,7 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52537
52539
  x: 0,
52538
52540
  y: 0
52539
52541
  };
52540
- const isActive = node.stamp.step === currentStep;
52542
+ const isActive = node.stamp?.step === currentStep;
52541
52543
  const rawType = node.node_type || "Agent";
52542
52544
  const resolvedType = rawType === "Coordinator" ? "Agent" : rawType;
52543
52545
  // Extract edge details for Tool nodes
@@ -52571,7 +52573,7 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52571
52573
  const edges = useMemo(()=>{
52572
52574
  const stepEdges = getEdgesForStep(currentStep);
52573
52575
  return stepEdges.filter((edge)=>edge.source && edge.target).map((edge)=>{
52574
- const isActive = edge.stamp.step === currentStep;
52576
+ const isActive = edge.stamp?.step === currentStep;
52575
52577
  return {
52576
52578
  id: edge.identifier,
52577
52579
  type: "smoothstep",
@@ -52599,14 +52601,14 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100dvw", heigh
52599
52601
  ]);
52600
52602
  const [nodesState, setNodes, onNodesChange] = useNodesState(nodes);
52601
52603
  const [edgesState, setEdges, onEdgesChange] = useEdgesState(edges);
52602
- // Update nodes and edges when currentStep changes
52603
- useEffect(()=>{
52604
+ // Keep React Flow store in sync with derived nodes/edges before paint to avoid transient empty graphs.
52605
+ useLayoutEffect(()=>{
52604
52606
  setNodes(nodes);
52605
52607
  }, [
52606
52608
  nodes,
52607
52609
  setNodes
52608
52610
  ]);
52609
- useEffect(()=>{
52611
+ useLayoutEffect(()=>{
52610
52612
  setEdges(edges);
52611
52613
  }, [
52612
52614
  edges,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railtownai/railtracks-visualizer",
3
- "version": "0.0.61",
3
+ "version": "0.0.62",
4
4
  "license": "MIT",
5
5
  "author": "Railtown AI",
6
6
  "description": "A visualizer for Railtracks agentic flows",