@railtownai/railtracks-visualizer 0.0.2 → 0.0.3

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.
@@ -419,292 +419,292 @@ const AgenticFlowVisualizer = ({ flowData: propFlowData, width = "100%", height
419
419
  // Edge Details
420
420
  _jsxs(_Fragment, { children: [_jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "ID:" }), _jsx("span", { className: "detail-value", children: selectedData.data.id || "N/A" })] }), selectedData.data.source && (_jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "Source:" }), _jsx("span", { className: "detail-value", children: selectedData.data.source })] })), selectedData.data.target && (_jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "Target:" }), _jsx("span", { className: "detail-value", children: selectedData.data.target })] })), selectedData.data.label && (_jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "Label:" }), _jsx("span", { className: "detail-value", children: selectedData.data.label })] })), selectedData.data.step && (_jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "Step:" }), _jsx("span", { className: "detail-value", children: selectedData.data.step })] })), selectedData.data.time && (_jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "Time:" }), _jsx("span", { className: "detail-value", children: new Date(selectedData.data.time * 1000).toLocaleString() })] })), selectedData.data?.details?.input_args &&
421
421
  Array.isArray(selectedData.data.details.input_args) &&
422
- selectedData.data.details.input_args.length > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "Inputs" }), _jsx("span", { className: "detail-value", style: { overflowY: "auto", maxHeight: "300px" }, children: Array.isArray(selectedData.data.details.input_args[0]) ? (selectedData.data.details.input_args[0].map((arg, index) => (_jsxs("div", { style: { marginBottom: 8 }, children: [_jsx("span", { className: "detail-label", children: "Role:" }), _jsx("span", { className: "detail-value", children: arg?.role || "Unknown" }), _jsx("span", { className: "detail-label", children: "Content:" }), _jsx("span", { className: "detail-value", children: arg?.content || "No content" })] }, arg?.role || index)))) : (_jsx("span", { className: "detail-value", children: JSON.stringify(selectedData.data.details.input_args[0], null, 2) })) })] }), _jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "Outputs" }), _jsx("span", { className: "detail-value", children: JSON.stringify(selectedData.data?.details?.output, null, 2) })] })] }))] })) })] }))] }), showTimelines && (_jsx("div", { style: { marginLeft: "280px", marginTop: "100px" }, children: _jsx(Timeline, { stamps: flowData.stamps || flowData.steps || [], currentStep: currentStep, isPlaying: isPlaying, onStepChange: handleStepChange, onPlayPause: handlePlayPause }) })), _jsx("style", { children: `
423
- .react-flow__edge-label {
424
- font-size: 10px;
425
- background: white;
426
- padding: 2px 4px;
427
- border-radius: 4px;
428
- border: 1px solid #e5e7eb;
429
- max-width: 150px;
430
- overflow: hidden;
431
- text-overflow: ellipsis;
432
- white-space: nowrap;
433
- }
434
-
435
- /* Right Drawer Styles */
436
- .right-drawer {
437
- position: absolute;
438
- top: 0;
439
- right: 0;
440
- height: 100%;
441
- z-index: 1000;
442
- display: flex;
443
- align-items: flex-start;
444
- transition: transform 0.3s ease;
445
- margin-left: ${showTimelines ? "280px" : "0"}; /* Account for vertical timeline when visible */
446
- }
447
-
448
- .right-drawer:not(.open) {
449
- transform: translateX(calc(100% - 50px));
450
- }
451
-
452
- .right-drawer.open {
453
- transform: translateX(0);
454
- }
455
-
456
- .drawer-toggle {
457
- width: 50px;
458
- height: 50px;
459
- background: none;
460
- color: #6b7280;
461
- border: none;
462
- cursor: pointer;
463
- display: flex;
464
- align-items: center;
465
- justify-content: center;
466
- transition: color 0.2s ease;
467
- margin-top: 20px;
468
- }
469
-
470
- .drawer-toggle:hover {
471
- color: #374151;
472
- }
473
-
474
- .drawer-content {
475
- background: white;
476
- border: 1px solid #e5e7eb;
477
- border-radius: 8px 0 0 8px;
478
- width: 400px;
479
- height: calc(100% - 40px);
480
- margin-top: 20px;
481
- display: flex;
482
- flex-direction: column;
483
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
484
- animation: drawerSlideIn 0.3s ease-out;
485
- }
486
-
487
- .drawer-header {
488
- padding: 16px 20px;
489
- border-bottom: 1px solid #e5e7eb;
490
- background: #f9fafb;
491
- display: flex;
492
- justify-content: space-between;
493
- align-items: center;
494
- flex-shrink: 0;
495
- }
496
-
497
- .drawer-header h3 {
498
- margin: 0;
499
- font-size: 16px;
500
- font-weight: 600;
501
- color: #1f2937;
502
- }
503
-
504
- .close-button {
505
- background: none;
506
- border: none;
507
- font-size: 20px;
508
- color: #6b7280;
509
- cursor: pointer;
510
- padding: 4px;
511
- width: 28px;
512
- height: 28px;
513
- display: flex;
514
- align-items: center;
515
- justify-content: center;
516
- border-radius: 6px;
517
- transition: all 0.2s ease;
518
- }
519
-
520
- .close-button:hover {
521
- background: #e5e7eb;
522
- color: #1f2937;
523
- }
524
-
525
- .drawer-body {
526
- padding: 20px;
527
- overflow-y: auto;
528
- flex: 1;
529
- width: 100%;
530
- box-sizing: border-box;
531
- }
532
-
533
- .detail-row {
534
- display: grid;
535
- grid-template-columns: 100px 1fr;
536
- margin-bottom: 12px;
537
- align-items: flex-start;
538
- gap: 8px;
539
- }
540
-
541
- .detail-row:last-child {
542
- margin-bottom: 0;
543
- }
544
-
545
- .detail-label {
546
- font-weight: 600;
547
- color: #6b7280;
548
- font-size: 13px;
549
- word-break: break-word;
550
- }
551
-
552
- .detail-value {
553
- color: #1f2937;
554
- font-size: 13px;
555
- word-break: break-word;
556
- flex: 1;
557
- width: 100%;
558
- overflow: visible;
559
- text-overflow: unset;
560
- max-width: unset;
561
- white-space: pre-line;
562
- line-height: 1.4;
563
- }
564
-
565
- @keyframes drawerSlideIn {
566
- from {
567
- opacity: 0;
568
- transform: translateX(20px);
569
- }
570
- to {
571
- opacity: 1;
572
- transform: translateX(0);
573
- }
574
- }
575
-
576
- /* Scoreboard Styles */
577
- .scoreboard {
578
- position: absolute;
579
- top: 20px;
580
- left: 50%;
581
- transform: translateX(-50%);
582
- background: white;
583
- border: 1px solid #e5e7eb;
584
- border-radius: 8px;
585
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
586
- z-index: 1000;
587
- min-width: 400px;
588
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
589
- }
590
-
591
- .scoreboard-header {
592
- padding: 12px 16px;
593
- border-bottom: 1px solid #e5e7eb;
594
- background: #f9fafb;
595
- text-align: center;
596
- }
597
-
598
- .scoreboard-header h3 {
599
- margin: 0;
600
- font-size: 14px;
601
- font-weight: 600;
602
- color: #1f2937;
603
- }
604
-
605
- .scoreboard-content {
606
- padding: 16px;
607
- display: flex;
608
- justify-content: space-around;
609
- align-items: center;
610
- gap: 20px;
611
- }
612
-
613
- .scoreboard-item {
614
- display: flex;
615
- flex-direction: column;
616
- align-items: center;
617
- gap: 4px;
618
- }
619
-
620
- .scoreboard-label {
621
- font-size: 12px;
622
- color: #6b7280;
623
- font-weight: 500;
624
- text-transform: uppercase;
625
- letter-spacing: 0.5px;
626
- }
627
-
628
- .scoreboard-count {
629
- font-size: 18px;
630
- font-weight: 700;
631
- padding: 6px 12px;
632
- border-radius: 6px;
633
- min-width: 40px;
634
- text-align: center;
635
- }
636
-
637
- .scoreboard-count.open {
638
- background: #fef3c7;
639
- color: #92400e;
640
- }
641
-
642
- .scoreboard-count.completed {
643
- background: #d1fae5;
644
- color: #065f46;
645
- }
646
-
647
- .scoreboard-count.error {
648
- background: #fee2e2;
649
- color: #991b1b;
650
- }
651
-
652
- .scoreboard-count.error.clickable {
653
- transition: all 0.2s ease;
654
- }
655
-
656
- .scoreboard-count.error.clickable:hover {
657
- background: #fecaca;
658
- transform: scale(1.05);
659
- box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
660
- }
661
-
662
- /* Side Panel Styles */
663
- .side-panel {
664
- position: absolute;
665
- top: 0;
666
- left: 0;
667
- height: 100%;
668
- z-index: 1000;
669
- display: flex;
670
- flex-direction: column;
671
- transition: all 0.3s ease;
672
- }
673
-
674
- .side-panel.collapsed {
675
- width: 60px;
676
- }
677
-
678
- .side-panel.expanded {
679
- width: 280px;
680
- }
681
-
682
- .panel-toggle {
683
- display: flex;
684
- align-items: center;
685
- justify-content: center;
686
- border: none;
687
- background: none;
688
- cursor: pointer;
689
- color: #6b7280;
690
- transition: color 0.2s ease;
691
- padding: 8px;
692
- margin: 20px 0 0 0;
693
- }
694
-
695
- .panel-toggle:hover {
696
- color: #374151;
697
- }
698
-
699
- .panel-content {
700
- flex: 1;
701
- background: white;
702
- border-right: 1px solid #e5e7eb;
703
- box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
704
- overflow: hidden;
705
- }
706
-
707
-
422
+ selectedData.data.details.input_args.length > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "Inputs" }), _jsx("span", { className: "detail-value", style: { overflowY: "auto", maxHeight: "300px" }, children: Array.isArray(selectedData.data.details.input_args[0]) ? (selectedData.data.details.input_args[0].map((arg, index) => (_jsxs("div", { style: { marginBottom: 8 }, children: [_jsx("span", { className: "detail-label", children: "Role:" }), _jsx("span", { className: "detail-value", children: arg?.role || "Unknown" }), _jsx("span", { className: "detail-label", children: "Content:" }), _jsx("span", { className: "detail-value", children: arg?.content || "No content" })] }, arg?.role || index)))) : (_jsx("span", { className: "detail-value", children: JSON.stringify(selectedData.data.details.input_args[0], null, 2) })) })] }), _jsxs("div", { className: "detail-row", children: [_jsx("span", { className: "detail-label", children: "Outputs" }), _jsx("span", { className: "detail-value", children: JSON.stringify(selectedData.data?.details?.output, null, 2) })] })] }))] })) })] }))] }), showTimelines && (_jsx("div", { style: { marginLeft: "280px", marginTop: "100px" }, children: _jsx(Timeline, { stamps: flowData.stamps || flowData.steps || [], currentStep: currentStep, isPlaying: isPlaying, onStepChange: handleStepChange, onPlayPause: handlePlayPause }) })), _jsx("style", { children: `
423
+ .react-flow__edge-label {
424
+ font-size: 10px;
425
+ background: white;
426
+ padding: 2px 4px;
427
+ border-radius: 4px;
428
+ border: 1px solid #e5e7eb;
429
+ max-width: 150px;
430
+ overflow: hidden;
431
+ text-overflow: ellipsis;
432
+ white-space: nowrap;
433
+ }
434
+
435
+ /* Right Drawer Styles */
436
+ .right-drawer {
437
+ position: absolute;
438
+ top: 0;
439
+ right: 0;
440
+ height: 100%;
441
+ z-index: 1000;
442
+ display: flex;
443
+ align-items: flex-start;
444
+ transition: transform 0.3s ease;
445
+ margin-left: ${showTimelines ? "280px" : "0"}; /* Account for vertical timeline when visible */
446
+ }
447
+
448
+ .right-drawer:not(.open) {
449
+ transform: translateX(calc(100% - 50px));
450
+ }
451
+
452
+ .right-drawer.open {
453
+ transform: translateX(0);
454
+ }
455
+
456
+ .drawer-toggle {
457
+ width: 50px;
458
+ height: 50px;
459
+ background: none;
460
+ color: #6b7280;
461
+ border: none;
462
+ cursor: pointer;
463
+ display: flex;
464
+ align-items: center;
465
+ justify-content: center;
466
+ transition: color 0.2s ease;
467
+ margin-top: 20px;
468
+ }
469
+
470
+ .drawer-toggle:hover {
471
+ color: #374151;
472
+ }
473
+
474
+ .drawer-content {
475
+ background: white;
476
+ border: 1px solid #e5e7eb;
477
+ border-radius: 8px 0 0 8px;
478
+ width: 400px;
479
+ height: calc(100% - 40px);
480
+ margin-top: 20px;
481
+ display: flex;
482
+ flex-direction: column;
483
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
484
+ animation: drawerSlideIn 0.3s ease-out;
485
+ }
486
+
487
+ .drawer-header {
488
+ padding: 16px 20px;
489
+ border-bottom: 1px solid #e5e7eb;
490
+ background: #f9fafb;
491
+ display: flex;
492
+ justify-content: space-between;
493
+ align-items: center;
494
+ flex-shrink: 0;
495
+ }
496
+
497
+ .drawer-header h3 {
498
+ margin: 0;
499
+ font-size: 16px;
500
+ font-weight: 600;
501
+ color: #1f2937;
502
+ }
503
+
504
+ .close-button {
505
+ background: none;
506
+ border: none;
507
+ font-size: 20px;
508
+ color: #6b7280;
509
+ cursor: pointer;
510
+ padding: 4px;
511
+ width: 28px;
512
+ height: 28px;
513
+ display: flex;
514
+ align-items: center;
515
+ justify-content: center;
516
+ border-radius: 6px;
517
+ transition: all 0.2s ease;
518
+ }
519
+
520
+ .close-button:hover {
521
+ background: #e5e7eb;
522
+ color: #1f2937;
523
+ }
524
+
525
+ .drawer-body {
526
+ padding: 20px;
527
+ overflow-y: auto;
528
+ flex: 1;
529
+ width: 100%;
530
+ box-sizing: border-box;
531
+ }
532
+
533
+ .detail-row {
534
+ display: grid;
535
+ grid-template-columns: 100px 1fr;
536
+ margin-bottom: 12px;
537
+ align-items: flex-start;
538
+ gap: 8px;
539
+ }
540
+
541
+ .detail-row:last-child {
542
+ margin-bottom: 0;
543
+ }
544
+
545
+ .detail-label {
546
+ font-weight: 600;
547
+ color: #6b7280;
548
+ font-size: 13px;
549
+ word-break: break-word;
550
+ }
551
+
552
+ .detail-value {
553
+ color: #1f2937;
554
+ font-size: 13px;
555
+ word-break: break-word;
556
+ flex: 1;
557
+ width: 100%;
558
+ overflow: visible;
559
+ text-overflow: unset;
560
+ max-width: unset;
561
+ white-space: pre-line;
562
+ line-height: 1.4;
563
+ }
564
+
565
+ @keyframes drawerSlideIn {
566
+ from {
567
+ opacity: 0;
568
+ transform: translateX(20px);
569
+ }
570
+ to {
571
+ opacity: 1;
572
+ transform: translateX(0);
573
+ }
574
+ }
575
+
576
+ /* Scoreboard Styles */
577
+ .scoreboard {
578
+ position: absolute;
579
+ top: 20px;
580
+ left: 50%;
581
+ transform: translateX(-50%);
582
+ background: white;
583
+ border: 1px solid #e5e7eb;
584
+ border-radius: 8px;
585
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
586
+ z-index: 1000;
587
+ min-width: 400px;
588
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
589
+ }
590
+
591
+ .scoreboard-header {
592
+ padding: 12px 16px;
593
+ border-bottom: 1px solid #e5e7eb;
594
+ background: #f9fafb;
595
+ text-align: center;
596
+ }
597
+
598
+ .scoreboard-header h3 {
599
+ margin: 0;
600
+ font-size: 14px;
601
+ font-weight: 600;
602
+ color: #1f2937;
603
+ }
604
+
605
+ .scoreboard-content {
606
+ padding: 16px;
607
+ display: flex;
608
+ justify-content: space-around;
609
+ align-items: center;
610
+ gap: 20px;
611
+ }
612
+
613
+ .scoreboard-item {
614
+ display: flex;
615
+ flex-direction: column;
616
+ align-items: center;
617
+ gap: 4px;
618
+ }
619
+
620
+ .scoreboard-label {
621
+ font-size: 12px;
622
+ color: #6b7280;
623
+ font-weight: 500;
624
+ text-transform: uppercase;
625
+ letter-spacing: 0.5px;
626
+ }
627
+
628
+ .scoreboard-count {
629
+ font-size: 18px;
630
+ font-weight: 700;
631
+ padding: 6px 12px;
632
+ border-radius: 6px;
633
+ min-width: 40px;
634
+ text-align: center;
635
+ }
636
+
637
+ .scoreboard-count.open {
638
+ background: #fef3c7;
639
+ color: #92400e;
640
+ }
641
+
642
+ .scoreboard-count.completed {
643
+ background: #d1fae5;
644
+ color: #065f46;
645
+ }
646
+
647
+ .scoreboard-count.error {
648
+ background: #fee2e2;
649
+ color: #991b1b;
650
+ }
651
+
652
+ .scoreboard-count.error.clickable {
653
+ transition: all 0.2s ease;
654
+ }
655
+
656
+ .scoreboard-count.error.clickable:hover {
657
+ background: #fecaca;
658
+ transform: scale(1.05);
659
+ box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
660
+ }
661
+
662
+ /* Side Panel Styles */
663
+ .side-panel {
664
+ position: absolute;
665
+ top: 0;
666
+ left: 0;
667
+ height: 100%;
668
+ z-index: 1000;
669
+ display: flex;
670
+ flex-direction: column;
671
+ transition: all 0.3s ease;
672
+ }
673
+
674
+ .side-panel.collapsed {
675
+ width: 60px;
676
+ }
677
+
678
+ .side-panel.expanded {
679
+ width: 280px;
680
+ }
681
+
682
+ .panel-toggle {
683
+ display: flex;
684
+ align-items: center;
685
+ justify-content: center;
686
+ border: none;
687
+ background: none;
688
+ cursor: pointer;
689
+ color: #6b7280;
690
+ transition: color 0.2s ease;
691
+ padding: 8px;
692
+ margin: 20px 0 0 0;
693
+ }
694
+
695
+ .panel-toggle:hover {
696
+ color: #374151;
697
+ }
698
+
699
+ .panel-content {
700
+ flex: 1;
701
+ background: white;
702
+ border-right: 1px solid #e5e7eb;
703
+ box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
704
+ overflow: hidden;
705
+ }
706
+
707
+
708
708
  ` })] }));
709
709
  };
710
710
  export default AgenticFlowVisualizer;