-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbench_lite.html
More file actions
1489 lines (1386 loc) · 59.4 KB
/
Copy pathbench_lite.html
File metadata and controls
1489 lines (1386 loc) · 59.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vibe Rounds - Case Bench — Clinical Reasoning Aid</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<!-- Google Analytics (GA4) — replace G-XXXXXXXXXX with your own Measurement ID -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-541054383"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-541054383');
// Safe wrapper so the app never breaks if GA hasn't loaded (e.g. ad-blockers)
function trackEvent(name, params){
try{ if(typeof gtag === 'function') gtag('event', name, params || {}); }catch(e){}
}
</script>
<!-- File-upload text extraction: pdf.js (PDF) and mammoth.js (Word .docx) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mammoth/1.6.0/mammoth.browser.min.js"></script>
<style>
:root{
--paper:#F7FAFB;
--card:#FFFFFF;
--ink:#0B2530;
--line:#DCE7EA;
--line-soft:#E9F1F3;
--accent:#0891B2;
--accent-dark:#0A6E85;
--accent-soft:#E3F4F8;
--alert:#C2410C;
--alert-soft:#FCE9DD;
--muted:#5B7480;
--tab-inactive:#EEF4F6;
--radius:10px;
--body-font:'Inter',sans-serif;
}
/* Theme: Minimalist — grayscale, no color pop */
html[data-theme="minimalist"]{
--paper:#FFFFFF;
--card:#FFFFFF;
--ink:#161616;
--line:#E4E4E4;
--line-soft:#F0F0F0;
--accent:#161616;
--accent-dark:#000000;
--accent-soft:#F2F2F2;
--alert:#B3261E;
--alert-soft:#F8E7E6;
--muted:#757575;
--tab-inactive:#F2F2F2;
--radius:3px;
--body-font:'Inter',sans-serif;
}
/* Theme: Terminal — Bloomberg-style dark/amber monospace */
html[data-theme="terminal"]{
--paper:#000000;
--card:#0A0A0A;
--ink:#FFB238;
--line:#3A2A00;
--line-soft:#231A00;
--accent:#FFB238;
--accent-dark:#FFCB6B;
--accent-soft:#1C1400;
--alert:#FF4D3D;
--alert-soft:#2B0C08;
--muted:#9C7A32;
--tab-inactive:#141414;
--radius:2px;
--body-font:'IBM Plex Mono',monospace;
}
html[data-theme="terminal"] .msg.user .bubble,
html[data-theme="terminal"] header.top .rx{color:#000;}
html[data-theme="terminal"] .banner strong{color:#FFCB6B;}
html[data-theme="terminal"] .card,
html[data-theme="terminal"] .transcript,
html[data-theme="terminal"] .msg.assistant .bubble{border-color:var(--line);}
html{transition:background .15s ease;}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
background:var(--paper);
color:var(--ink);
font-family:var(--body-font);
font-size:15px;
line-height:1.5;
-webkit-font-smoothing:antialiased;
transition:background .15s ease,color .15s ease,font-family .1s ease;
}
::selection{background:var(--accent-soft);}
a{color:var(--accent-dark);}
.wrap{max-width:960px;margin:0 auto;padding:28px 20px 80px;}
/* header */
header.top{
display:flex;align-items:center;justify-content:space-between;
padding-bottom:18px;margin-bottom:28px;
flex-wrap:wrap;gap:10px;
}
header.top .brand{display:flex;align-items:center;gap:10px;}
header.top h1{
font-family:var(--body-font);font-weight:800;
font-size:24px;margin:0;letter-spacing:-0.02em;color:var(--ink);
}
header.top .rx{
font-family:var(--body-font);font-weight:600;font-size:11.5px;color:#fff;
background:var(--accent);border-radius:20px;padding:4px 11px;
letter-spacing:.01em;
}
header.top .tagline{font-size:12.5px;color:var(--muted);font-family:var(--body-font);font-weight:500;}
header.top .top-right{display:flex;flex-direction:column;align-items:flex-end;gap:8px;}
.theme-select{
display:inline-flex;align-items:center;gap:6px;
background:var(--tab-inactive);border:1px solid var(--line);color:var(--ink);
font-family:var(--body-font);font-weight:600;font-size:12px;
border-radius:999px;padding:6px 30px 6px 12px;cursor:pointer;
-webkit-appearance:none;appearance:none;
background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235B7480' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
background-repeat:no-repeat;background-position:right 10px center;background-size:10px;
}
.theme-select:hover{border-color:var(--accent);}
.top-links{display:flex;gap:8px;font-family:var(--body-font);}
.top-links a{
display:inline-flex;align-items:center;gap:5px;
font-size:12.5px;font-weight:700;color:var(--accent-dark);
background:var(--accent-soft);border:1px solid var(--line);
border-radius:999px;padding:6px 13px;text-decoration:none;
}
.top-links a:hover{background:var(--accent);color:#fff;border-color:var(--accent);}
html[data-theme="terminal"] .top-links a:hover{color:#000;}
/* section labels */
.step{margin-bottom:26px;}
.step-label{
font-family:var(--body-font);font-size:11.5px;letter-spacing:.06em;
text-transform:uppercase;color:var(--muted);font-weight:700;
display:flex;align-items:center;gap:8px;margin-bottom:10px;
}
.step-label .num{
width:20px;height:20px;border-radius:50%;background:var(--accent);color:#fff;
display:inline-flex;align-items:center;justify-content:center;font-size:11px;flex-shrink:0;font-weight:700;
}
.step-label.done .num{background:var(--accent-dark);}
.step-label.collapsible{cursor:pointer;user-select:none;}
.step-label.collapsible:hover{color:var(--ink);}
.collapse-arrow{font-size:10px;margin-left:2px;transition:transform .15s ease;color:var(--muted);}
.step-label.collapsed .collapse-arrow{transform:rotate(-90deg);}
.card.collapsed{display:none;}
.card{
background:var(--card);
border:1px solid var(--line);
border-radius:var(--radius);
padding:20px 22px;
box-shadow:0 1px 2px rgba(11,37,48,.04), 0 8px 24px -16px rgba(11,37,48,.08);
}
textarea, input[type=text], input[type=password], select{
width:100%;
font-family:var(--body-font);
font-size:14px;
background:var(--card);
border:1px solid var(--line);
border-radius:var(--radius);
padding:9px 11px;
color:var(--ink);
}
textarea:focus, input:focus, select:focus, button:focus-visible{
outline:2px solid var(--accent);outline-offset:1px;
}
textarea{resize:vertical;min-height:90px;line-height:1.5;}
label{font-size:12.5px;color:var(--muted);display:block;margin-bottom:4px;font-weight:500;}
.hint{font-size:12px;color:var(--muted);margin-top:6px;}
.upload-row{margin-top:14px;padding-top:14px;border-top:1px dashed var(--line);}
.upload-row label{margin-bottom:6px;}
.upload-row input[type=file]{
width:100%;font-family:var(--body-font);font-size:12.5px;color:var(--muted);
border:1px dashed var(--line);border-radius:var(--radius);padding:8px 10px;background:var(--paper);
}
.upload-row input[type=file]::file-selector-button{
font-family:var(--body-font);font-weight:600;font-size:12px;color:#fff;
background:var(--accent);border:none;border-radius:999px;padding:6px 13px;margin-right:10px;cursor:pointer;
}
#uploadStatus.ok{color:var(--accent-dark);}
#uploadStatus.err{color:var(--alert);}
/* provider tabs — segmented pill control */
.tabrow{display:flex;gap:4px;background:var(--tab-inactive);padding:4px;border-radius:999px;margin-bottom:16px;width:fit-content;}
.tabrow .tab{
font-family:var(--body-font);font-weight:600;font-size:12.5px;
padding:7px 16px;
background:transparent;
border:none;border-radius:999px;
cursor:pointer;color:var(--muted);
transition:background .12s,color .12s;
}
.tabrow .tab.active{
background:var(--accent);color:#fff;
}
.providerpane{padding:0;background:transparent;}
.providerpane .row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:10px;}
@media(max-width:600px){.providerpane .row{grid-template-columns:1fr;}}
.key-status{font-size:12px;font-family:var(--body-font);font-weight:500;margin-top:8px;}
.key-status.ok{color:var(--accent-dark);}
.key-status.empty{color:var(--muted);}
details.settings summary{
cursor:pointer;font-size:12.5px;color:var(--accent-dark);font-weight:600;
list-style:none;display:flex;align-items:center;gap:6px;
}
details.settings summary::-webkit-details-marker{display:none;}
details.settings summary::before{content:"▸";font-size:10px;}
details.settings[open] summary::before{content:"▾";}
details.settings{margin-top:10px;}
.mode-hint{font-size:12.5px;color:var(--muted);margin:10px 0 12px;}
.mode-pane{margin-top:2px;}
.activity.pipeline-tile{position:relative;}
.order-badge{
position:absolute;top:-8px;right:-8px;width:22px;height:22px;border-radius:50%;
background:var(--accent);color:#fff;font-family:var(--body-font);font-weight:700;font-size:11px;
display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(11,37,48,.2);
}
.pipeline-order{
margin-top:14px;font-size:12.5px;color:var(--muted);
display:flex;align-items:center;gap:6px;flex-wrap:wrap;
}
.pipeline-order .chip{
background:var(--tab-inactive);color:var(--ink);font-weight:600;font-size:12px;
padding:4px 10px;border-radius:999px;
}
.pipeline-order .arrow{color:var(--muted);}
.pipeline-order .chip-remove{color:var(--muted);text-decoration:none;margin-left:5px;font-weight:700;}
.pipeline-order .chip-remove:hover{color:var(--alert);}
/* activity cards */
.activities{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
@media(max-width:760px){.activities{grid-template-columns:repeat(2,1fr);}}
.activity{
background:var(--card);border:1.5px solid var(--line);
border-radius:var(--radius);
padding:15px 14px;cursor:pointer;transition:border-color .12s, box-shadow .12s, transform .06s;
text-align:left;font-family:var(--body-font);
box-shadow:0 1px 2px rgba(11,37,48,.04);
}
.activity:hover{border-color:var(--accent);transform:translateY(-1px);box-shadow:0 6px 16px -8px rgba(8,145,178,.35);}
.activity.selected{border-color:var(--accent);background:var(--accent-soft);box-shadow:0 6px 16px -8px rgba(8,145,178,.35);}
.activity .aname{font-weight:700;font-size:13.5px;margin-bottom:4px;color:var(--ink);}
.activity .adesc{font-size:11.5px;color:var(--muted);line-height:1.4;}
/* workspace */
#workspace{margin-top:30px;display:none;}
#workspace.visible{display:block;}
.ws-header{
display:flex;justify-content:space-between;align-items:center;
padding-bottom:12px;margin-bottom:14px;
}
.ws-header .wtitle{font-family:var(--body-font);font-size:18px;font-weight:800;color:var(--ink);}
.ws-header .wsub{font-size:12px;color:var(--muted);font-family:var(--body-font);font-weight:500;}
.ws-actions button{margin-left:8px;}
.ws-progress{margin-top:8px;display:flex;align-items:center;gap:8px;}
.ws-progress-bar{width:140px;height:6px;border-radius:999px;background:var(--tab-inactive);overflow:hidden;flex-shrink:0;}
.ws-progress-fill{height:100%;background:var(--accent);border-radius:999px;transition:width .25s ease;width:0%;}
.ws-progress-label{font-size:11.5px;color:var(--muted);font-weight:600;white-space:nowrap;}
@media(max-width:600px){
header.top h1{font-size:20px;}
.ws-header{flex-direction:column;align-items:flex-start;gap:10px;}
.ws-actions{display:flex;flex-wrap:wrap;gap:8px;}
.ws-actions button{margin-left:0;}
.pipeline-picker > div{flex-direction:column;}
.pipeline-picker select{width:100%;}
.composer{flex-direction:column;align-items:stretch;}
.msg{max-width:100%;}
}
.transcript{
border:1px solid var(--line);border-radius:var(--radius);
background:var(--card);
box-shadow:0 1px 2px rgba(11,37,48,.04), 0 8px 24px -16px rgba(11,37,48,.08);
min-height:120px;max-height:520px;overflow-y:auto;
padding:16px;margin-bottom:12px;
}
.msg{margin-bottom:16px;max-width:88%;}
.msg.user{margin-left:auto;}
.msg .who{font-family:var(--body-font);font-size:10.5px;text-transform:uppercase;font-weight:700;letter-spacing:.05em;color:var(--muted);margin-bottom:4px;}
.msg.user .who{text-align:right;}
/* text-to-speech control on assistant answers */
.who-row{display:flex;align-items:center;gap:6px;margin-bottom:4px;}
.who-row .who{margin-bottom:0;}
.tts-btn{
display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;
width:20px;height:20px;padding:0;
background:transparent;color:var(--muted);
border:1px solid transparent;border-radius:50%;
cursor:pointer;transition:background .12s ease,color .12s ease;
}
.tts-btn:hover{background:var(--accent-soft);color:var(--accent-dark);}
.tts-btn svg{width:12px;height:12px;display:block;}
.tts-btn.speaking{background:var(--accent-soft);color:var(--accent-dark);border-color:var(--line);}
.tts-btn.speaking .tts-wave-1{animation:ttsPulse 1s ease-in-out infinite;}
.tts-btn.speaking .tts-wave-2{animation:ttsPulse 1s ease-in-out infinite .18s;}
@keyframes ttsPulse{0%,100%{opacity:.3;}50%{opacity:1;}}
@media(prefers-reduced-motion:reduce){
.tts-btn.speaking .tts-wave-1,.tts-btn.speaking .tts-wave-2{animation:none;opacity:1;}
}
.msg .bubble{
padding:11px 14px;border-radius:12px;font-size:14px;line-height:1.55;white-space:pre-wrap;
}
.msg.assistant .bubble{background:var(--accent-soft);border:1px solid #cdeaf0;border-top-left-radius:4px;}
.msg.user .bubble{background:var(--accent);color:#fff;border-top-right-radius:4px;}
.msg.system .bubble{background:transparent;border:1px dashed var(--line);color:var(--muted);font-style:italic;font-size:12.5px;border-radius:8px;}
.composer{display:flex;gap:8px;align-items:flex-end;}
.composer textarea{min-height:56px;flex:1;}
button{
font-family:var(--body-font);font-weight:700;font-size:13px;
background:var(--accent);color:#fff;border:none;
border-radius:999px;padding:10px 18px;cursor:pointer;
transition:background .12s, transform .06s;
}
button:hover{background:var(--accent-dark);}
button.secondary{background:transparent;color:var(--muted);border:1.5px solid var(--line);}
button.secondary:hover{background:var(--tab-inactive);color:var(--ink);border-color:var(--line);}
button:disabled{opacity:.5;cursor:not-allowed;}
.banner{
font-size:12.5px;color:var(--ink);border:1px solid var(--line-soft);
background:var(--accent-soft);padding:11px 14px;border-radius:var(--radius);margin-bottom:24px;
}
.banner strong{color:var(--accent-dark);}
.error-note{font-size:12.5px;color:var(--alert);background:var(--alert-soft);border:1px solid #f0c8ac;border-radius:var(--radius);padding:9px 12px;margin-bottom:10px;display:none;}
.error-note.show{display:block;}
.typing{font-family:var(--body-font);font-size:12px;color:var(--muted);font-weight:500;}
.typing::after{content:'';animation:dots 1.2s steps(4,end) infinite;}
@keyframes dots{0%{content:'';}25%{content:'.';}50%{content:'..';}75%{content:'...';}}
footer{margin-top:50px;font-size:11.5px;color:var(--muted);text-align:center;font-family:var(--body-font);font-weight:500;}
.contact-card{
margin-top:36px;
border:1px solid var(--line);
background:var(--card);
border-radius:var(--radius);
padding:18px 20px;
text-align:center;
box-shadow:0 1px 2px rgba(11,37,48,.04);
}
.contact-card p{margin:0;font-size:13px;color:var(--muted);line-height:1.6;}
.contact-card a{color:var(--accent-dark);font-weight:600;text-decoration:none;}
.contact-card a:hover{text-decoration:underline;}
.legal-note{
margin-top:16px;
font-size:11.5px;color:var(--muted);text-align:center;
line-height:1.6;font-family:var(--body-font);
}
.legal-note em{font-style:italic;}
.legal-note a{color:var(--muted);text-decoration:underline;}
.legal-note a:hover{color:var(--accent-dark);}
.contribute-card{
margin-top:16px;
border:1px dashed var(--line);
background:var(--accent-soft);
border-radius:var(--radius);
padding:18px 20px;
text-align:center;
}
.contribute-card h3{
margin:0 0 6px;font-size:13.5px;font-weight:700;color:var(--ink);
font-family:var(--body-font);
}
.contribute-card p{
margin:0 0 12px;font-size:12.5px;color:var(--muted);
line-height:1.6;font-family:var(--body-font);max-width:560px;
margin-left:auto;margin-right:auto;
}
.contribute-card label.consent{
display:flex;align-items:flex-start;gap:7px;justify-content:center;
font-size:12px;color:var(--muted);margin:0 0 12px;text-align:left;
max-width:520px;margin-left:auto;margin-right:auto;font-weight:500;
}
.contribute-card label.consent input{margin-top:2px;flex-shrink:0;}
.contribute-btn{
font-family:var(--body-font);font-weight:700;font-size:13px;
background:var(--accent);color:#fff;border:none;border-radius:999px;
padding:9px 22px;cursor:pointer;transition:background .12s;
}
.contribute-btn:hover:not(:disabled){background:var(--accent-dark);}
.contribute-btn:disabled{opacity:.6;cursor:default;}
.contribute-status{
font-size:12px;font-weight:600;margin-top:10px;font-family:var(--body-font);min-height:16px;
}
.contribute-status.ok{color:var(--accent-dark);}
.contribute-status.err{color:var(--alert);}
</style>
<!-- ===== VibeRounds Suite Bar ===== -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
.vr-suitebar{
background: linear-gradient(160deg, #EFF6FF 0%, #F0FDFA 65%);
border-bottom: 1px solid #E2E8F0;
padding: 12px 20px;
display: flex; align-items: center; justify-content: space-between;
flex-wrap: wrap; gap: 10px 16px;
}
.vr-suitebar .vr-brand{
font-family: 'DM Mono','IBM Plex Mono',monospace;
font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
color: #0F172A; text-decoration: none; display:flex; align-items:center; gap:0;
}
.vr-suitebar .vr-brand span{ color: #0891B2; }
.vr-suitebar .vr-nav{ display:flex; gap:6px; flex-wrap:wrap; }
.vr-suitebar .vr-nav a{
font-family:'DM Mono','IBM Plex Mono',monospace; font-size:11px; letter-spacing:.04em; text-transform:uppercase;
color:#475569; text-decoration:none; padding:6px 10px; border-radius:999px;
border:1px solid #E2E8F0; background:#FFFFFF; transition:.15s ease;
}
.vr-suitebar .vr-nav a:hover{ color:#fff; background:#0891B2; border-color:#0891B2; }
.vr-suitebar .vr-nav a.active{ color:#fff; background:#0E7490; border-color:#0E7490; }
@media (max-width:640px){
.vr-suitebar{ padding:10px 14px; }
.vr-suitebar .vr-nav a{ padding:5px 8px; font-size:10px; }
}
</style>
</head>
<body>
<header class="vr-suitebar">
<a class="vr-brand" href="https://avi33tbtt.github.io/">Vibe<span>Rounds</span></a>
<nav class="vr-nav">
<a href="https://avi33tbtt.github.io/home.html">Home</a>
<a href="https://avi33tbtt.github.io/bench.html">Case Bench</a>
<a href="https://avi33tbtt.github.io/bench_lite.html" class="active">Bench Lite</a>
<a href="https://avi33tbtt.github.io/case-simulator.html">Case Simulator</a>
<a href="https://avi33tbtt.github.io/case-practice.html">Clinical Practice</a>
<a href="https://avi33tbtt.github.io/clinical-polemos.html">Clinical Polemos</a>
<a href="https://avi33tbtt.github.io/case-lens.html">Case Lens</a>
<a href="https://avi33tbtt.github.io/sdm-lens.html">SDM Lens</a>
<a href="https://avi33tbtt.github.io/ebm.html">EBM Query Generator</a>
<a href="https://avi33tbtt.github.io/ccos-builder.html">CCOS Builder</a>
</nav>
</header>
<div class="wrap">
<header class="top">
<div class="brand">
<h1>Vibe Rounds - Case Bench</h1>
<span class="rx">Rx: reasoning, not answers</span>
</div>
<div class="top-right">
<select id="themeSelect" class="theme-select" aria-label="Theme">
<option value="simple">Simple</option>
<option value="minimalist">Minimalist</option>
<option value="terminal">Terminal</option>
</select>
<div class="tagline">clinical reasoning aid · not for patient care</div>
<div class="top-links">
<a href="https://avi33tbtt.github.io/" target="_blank" rel="noopener">Project website</a>
<a href="https://www.linkedin.com/in/dravinashkumargupta/" target="_blank" rel="noopener">Dr. Avinash — LinkedIn</a>
</div>
</div>
</header>
<div class="banner"><strong>Educational use only.</strong> Not a diagnostic tool. This is a working implementation of the <a href="https://avi33tbtt.github.io/" target="_blank" rel="noopener">Vibe Rounds</a> paradigm for clinical case reasoning. Your API key is stored only in this browser's local storage and sent directly from your browser to your chosen provider — never through any server of ours.</div>
<!-- STEP 1: MODEL -->
<div class="step">
<div class="step-label collapsible" id="label-model"><span class="num">1</span>Model<span class="collapse-arrow" id="arrow-model">▾</span></div>
<div class="card" id="card-model">
<div class="tabrow" id="providerTabs">
<div class="tab active" data-provider="claude">Claude</div>
<div class="tab" data-provider="gemini">Gemini</div>
<div class="tab" data-provider="openai">ChatGPT</div>
<div class="tab" data-provider="other">Other</div>
</div>
<div class="providerpane">
<div class="row" id="endpointRow" style="display:none;">
<div style="grid-column:1/-1;">
<label for="apiEndpoint">API endpoint (OpenAI-compatible chat/completions URL)</label>
<input type="text" id="apiEndpoint" placeholder="https://api.groq.com/openai/v1/chat/completions">
</div>
</div>
<div class="row">
<div>
<label id="apiKeyLabel" for="apiKey">Claude API key</label>
<input type="password" id="apiKey" placeholder="sk-ant-...">
</div>
<div>
<label for="modelName">Model name</label>
<input type="text" id="modelName" placeholder="claude-sonnet-4-6">
</div>
</div>
<div class="key-status empty" id="keyStatus">No key saved for this provider yet.</div>
<details class="settings">
<summary>Where do I get a key?</summary>
<div class="hint" style="margin-top:8px;" id="keyHelp"></div>
</details>
</div>
</div>
</div>
<!-- STEP 2: CASE -->
<div class="step">
<div class="step-label collapsible" id="label-case"><span class="num">2</span>Case<span class="collapse-arrow" id="arrow-case">▾</span></div>
<div class="card" id="card-case">
<label for="caseText">Paste the case — vignette text, discharge summary, your own clerking notes, or a case link</label>
<textarea id="caseText" placeholder="Paste case text directly, e.g. 'A 45 year man presented with pain in right leg and reticular lesion on skin on posterior side of right leg. He met with a road traffic accident 2 years back when he was a professional driver and...'"></textarea>
<div class="sample-case-controls" style="display:flex;flex-wrap:wrap;gap:10px;margin-top:12px;">
<div style="flex:1;min-width:150px;">
<label for="sampleDifficulty" style="margin-bottom:4px;">Sample case difficulty</label>
<select id="sampleDifficulty">
<option value="Any">Any</option>
<option value="Student / early learner — classic, textbook presentation">Student / early learner</option>
<option value="Intern / junior resident — common presentation with a couple of distractors">Intern / junior resident</option>
<option value="Senior resident — moderate complexity, some atypical features">Senior resident</option>
<option value="Attending / expert — atypical, complex, or multi-system presentation">Attending / expert</option>
</select>
</div>
<div style="flex:1;min-width:150px;">
<label for="sampleSpecialty" style="margin-bottom:4px;">Sample case specialty</label>
<select id="sampleSpecialty"></select>
</div>
</div>
<div class="hint">If link can't be fetched automatically — paste the case text itself for best results. <a href="#" id="sampleCaseBtn" style="font-weight:600;color:var(--accent-dark);text-decoration:none;">Try a sample case →</a></div>
<div class="upload-row">
<label for="caseFile">Or upload a case file — PDF, Word (.doc/.docx), or plain text (.txt), max 10MB</label>
<input type="file" id="caseFile" accept=".pdf,.doc,.docx,.txt,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,text/plain">
<div class="hint" id="uploadStatus"></div>
</div>
</div>
</div>
<!-- STEP 3: ACTIVITY -->
<div class="step">
<div class="step-label" id="label-activity"><span class="num">3</span>Activity</div>
<div id="modeDialogue" class="mode-pane">
<div class="mode-hint">One activity, a live back-and-forth. Good for step-by-step reasoning practice.</div>
<div class="activities" id="activities"></div>
</div>
</div>
<!-- WORKSPACE -->
<div id="workspace">
<div class="ws-header">
<div>
<div class="wtitle" id="wsTitle"></div>
<div class="wsub" id="wsSub"></div>
<div class="ws-progress" id="wsProgress" style="display:none;">
<div class="ws-progress-bar"><div class="ws-progress-fill" id="wsProgressFill"></div></div>
<div class="ws-progress-label" id="wsProgressLabel"></div>
</div>
</div>
<div class="ws-actions">
<button class="secondary" id="copyTranscriptBtn">Copy transcript</button>
<button class="secondary" id="downloadTranscriptBtn">Download .txt</button>
<button class="secondary" id="resetBtn">Reset run</button>
</div>
</div>
<div class="error-note" id="errorNote"></div>
<div class="transcript" id="transcript"></div>
<div class="composer">
<textarea id="composerInput" placeholder="Your response..."></textarea>
<button id="sendBtn">Send</button>
</div>
</div>
<div class="contribute-card">
<h3>Help improve Case Bench</h3>
<p>
Anonymously contribute this session's transcript for educational and research purposes.
No names, emails, or API keys are ever included — only the case type, the back-and-forth, and a timestamp.
</p>
<button class="contribute-btn" id="contributeBtn">Submit</button>
<div class="contribute-status" id="contributeStatus"></div>
</div>
<footer>Vibe Rounds - Case Bench · runs entirely in your browser · bring your own key</footer>
</div>
<script>
/* ---------- config: providers ---------- */
const PROVIDERS = {
claude: {
label: 'Claude',
keyPlaceholder: 'sk-ant-...',
modelPlaceholder: 'claude-sonnet-4-6',
help: 'Create a key at <a href="https://console.anthropic.com/settings/keys" target="_blank">console.anthropic.com</a>. Paste the model name exactly as shown there — model names change over time, so if a call fails, double check the current model string.'
},
gemini: {
label: 'Gemini',
keyPlaceholder: 'AIza...',
modelPlaceholder: 'gemini-2.5-flash',
help: 'Create a key at <a href="https://aistudio.google.com/app/apikey" target="_blank">aistudio.google.com/app/apikey</a>. Check the current model name in Google AI Studio if a call fails.'
},
openai: {
label: 'ChatGPT',
keyPlaceholder: 'sk-...',
modelPlaceholder: 'gpt-4o-mini',
help: 'Create a key at <a href="https://platform.openai.com/api-keys" target="_blank">platform.openai.com/api-keys</a>. Check the current model name in the OpenAI docs if a call fails.'
},
other: {
label: 'Other',
keyPlaceholder: 'API key (leave blank if none)',
modelPlaceholder: 'model-name-as-required-by-provider',
needsEndpoint: true,
help: 'Works with any provider that exposes an OpenAI-compatible <code>/chat/completions</code> endpoint — this covers most of the LLM ecosystem beyond the big three: Groq, Together AI, Mistral, DeepSeek, xAI (Grok), Perplexity, OpenRouter (which itself proxies dozens more models), Fireworks, local servers like Ollama or LM Studio, and more. Paste the full endpoint URL, the key that provider gave you, and the exact model name it expects. If a call fails, check that provider\'s docs — the request/response shape is standardized, but model names and auth details vary.'
}
};
/* ---------- config: activities ---------- */
const ACTIVITIES = {
socratic: {
name: 'Socratic Rounds',
desc: 'One pointed question at a time. You find the gap yourself.',
subtitle: 'One question at a time — commit before you get the answer.',
systemPrompt: (c) => `#VibeRounds You are a warm, encouraging educational assistant who uses the Socratic method to guide clinical reasoning. I am a learner working through a clinical case. Your role is to ask me one question at a time, wait for my response, and acknowledge what I got right before gently probing further. Only reveal the answer after I have made a genuine attempt and then explicitly surrendered — if I ask for the answer outright without attempting one, redirect me once with: 'Give your best guess, differential, or next step first,' and only proceed to reveal the answer if I still cannot or will not attempt one after that. Start every session by telling me one thing you believe I will find interesting about this case. Confirm you understand the rules before we begin.\n\nHere is the case:\n\n${c}\n\nBegin now: first confirm you understand the rules above in one short line, then tell me the one interesting thing about this case, then ask your first question.`
}
};
/* ---------- state ---------- */
let state = {
provider: 'claude',
activity: null,
mode: 'dialogue',
messages: [], // {role:'user'|'assistant', content:string, auto?:boolean}
running: false,
runKind: null // 'dialogue'
};
const $ = (id) => document.getElementById(id);
/* ---------- localStorage helpers ---------- */
function loadKeys(){
try{ return JSON.parse(localStorage.getItem('casebench_keys')||'{}'); }catch(e){ return {}; }
}
function saveKeys(k){ localStorage.setItem('casebench_keys', JSON.stringify(k)); }
function loadModels(){
try{ return JSON.parse(localStorage.getItem('casebench_models')||'{}'); }catch(e){ return {}; }
}
function saveModels(m){ localStorage.setItem('casebench_models', JSON.stringify(m)); }
function loadEndpoints(){
try{ return JSON.parse(localStorage.getItem('casebench_endpoints')||'{}'); }catch(e){ return {}; }
}
function saveEndpoints(e){ localStorage.setItem('casebench_endpoints', JSON.stringify(e)); }
function loadCaseText(){
try{ return localStorage.getItem('casebench_case') || ''; }catch(e){ return ''; }
}
function saveCaseText(t){ try{ localStorage.setItem('casebench_case', t); }catch(e){} }
const SPECIALTIES = [
'Any',
'Allergy and Immunology',
'Anesthesiology',
'Cardiology',
'Cardiothoracic Surgery',
'Colon and Rectal Surgery',
'Critical Care / Intensive Care Medicine',
'Dermatology',
'Emergency Medicine',
'Endocrinology',
'Family Medicine',
'Gastroenterology',
'General Surgery',
'Geriatrics',
'Gynecologic Oncology',
'Hematology',
'Hematology-Oncology',
'Hepatology',
'Hospice and Palliative Medicine',
'Infectious Disease',
'Internal Medicine',
'Interventional Radiology',
'Medical Genetics',
'Nephrology',
'Neonatology',
'Neurology',
'Neurosurgery',
'Obstetrics and Gynecology',
'Occupational Medicine',
'Oncology',
'Ophthalmology',
'Orthopedic Surgery',
'Otolaryngology (ENT)',
'Pain Medicine',
'Pathology',
'Pediatrics',
'Pediatric Cardiology',
'Pediatric Emergency Medicine',
'Pediatric Surgery',
'Physical Medicine and Rehabilitation',
'Plastic Surgery',
'Podiatry',
'Preventive Medicine',
'Psychiatry',
'Pulmonology',
'Radiation Oncology',
'Radiology',
'Rheumatology',
'Sleep Medicine',
'Sports Medicine',
'Toxicology',
'Transplant Medicine',
'Trauma Surgery',
'Urology',
'Vascular Surgery'
];
(function populateSpecialties(){
const sel = $('sampleSpecialty');
if(!sel) return;
SPECIALTIES.forEach(spec=>{
const opt = document.createElement('option');
opt.value = spec;
opt.textContent = spec;
sel.appendChild(opt);
});
})();
function buildSampleCasePrompt(difficulty, specialty){
let ask = 'Generate one realistic, self-contained clinical vignette for a medical learner to practice diagnostic reasoning on. ';
if(specialty && specialty !== 'Any'){
ask += `The case must fall within the specialty of ${specialty}. `;
}
if(difficulty && difficulty !== 'Any'){
ask += `Pitch the case difficulty at the level of: ${difficulty}. `;
} else {
ask += 'Cover a single adult or pediatric patient presenting with a common or classic presentation (your choice — vary it each time). ';
}
ask += 'Include age, sex, presenting complaint, relevant history, and pertinent exam/vital sign findings, and a couple of relevant labs or initial test results if appropriate. Do not reveal or hint at the diagnosis name, and do not include headers, labels, or any framing text — output ONLY the vignette itself as a single flowing paragraph of 4-7 sentences, written the way a case would appear in a textbook.';
return ask;
}
$('sampleCaseBtn') && $('sampleCaseBtn').addEventListener('click', async (e)=>{
e.preventDefault();
const btn = $('sampleCaseBtn');
const keys = loadKeys();
const models = loadModels();
const apiKey = keys[state.provider];
const model = models[state.provider] || PROVIDERS[state.provider].modelPlaceholder;
if(!apiKey && !PROVIDERS[state.provider].needsEndpoint){
alert('Add an API key for ' + PROVIDERS[state.provider].label + ' in Step 1 first, then try again.');
return;
}
const difficulty = $('sampleDifficulty') ? $('sampleDifficulty').value : 'Any';
const specialty = $('sampleSpecialty') ? $('sampleSpecialty').value : 'Any';
const prompt = buildSampleCasePrompt(difficulty, specialty);
const original = btn.textContent;
btn.textContent = 'Generating…';
btn.style.pointerEvents = 'none';
try{
let sample;
const msgs = [{role:'user', content:'Begin.'}];
if(state.provider === 'claude'){
sample = await callClaude(apiKey, model, prompt, msgs);
} else if(state.provider === 'gemini'){
sample = await callGemini(apiKey, model, prompt, msgs);
} else if(state.provider === 'other'){
const endpoints = loadEndpoints();
sample = await callCustom(endpoints['other'], apiKey, model, prompt, msgs);
} else {
sample = await callOpenAI(apiKey, model, prompt, msgs);
}
sample = (sample || '').trim();
if(!sample) throw new Error('Empty response.');
$('caseText').value = sample;
saveCaseText(sample);
trackEvent('sample_case_generated', {provider: state.provider, difficulty: difficulty, specialty: specialty});
} catch(err){
alert('Could not generate a sample case: ' + err.message);
} finally {
btn.textContent = original;
btn.style.pointerEvents = '';
}
});
function loadCollapseState(){
try{ return JSON.parse(localStorage.getItem('casebench_collapse')||'{}'); }catch(e){ return {}; }
}
function saveCollapseState(c){ localStorage.setItem('casebench_collapse', JSON.stringify(c)); }
/* ---------- theme selector (Simple / Book / Minimalist / Terminal) ---------- */
const VALID_THEMES = ['simple', 'minimalist', 'terminal'];
function applyTheme(theme){
if(!VALID_THEMES.includes(theme)) theme = 'simple';
document.documentElement.setAttribute('data-theme', theme);
if($('themeSelect')) $('themeSelect').value = theme;
}
function initTheme(){
let saved = null;
try{ saved = localStorage.getItem('casebench_theme'); }catch(e){}
applyTheme(saved || 'simple');
}
initTheme();
$('themeSelect') && $('themeSelect').addEventListener('change', (e)=>{
const next = e.target.value;
applyTheme(next);
try{ localStorage.setItem('casebench_theme', next); }catch(e){}
trackEvent('change_theme', {theme: next});
});
/* ---------- render: provider tabs ---------- */
function renderProviderPane(){
const p = PROVIDERS[state.provider];
$('apiKeyLabel').textContent = p.label + ' API key';
$('apiKey').placeholder = p.keyPlaceholder;
$('modelName').placeholder = p.modelPlaceholder;
$('keyHelp').innerHTML = p.help;
const keys = loadKeys();
const models = loadModels();
$('apiKey').value = keys[state.provider] || '';
$('modelName').value = models[state.provider] || '';
$('endpointRow').style.display = p.needsEndpoint ? '' : 'none';
if(p.needsEndpoint){
const endpoints = loadEndpoints();
$('apiEndpoint').value = endpoints[state.provider] || '';
}
updateKeyStatus();
}
function updateKeyStatus(){
const keys = loadKeys();
const el = $('keyStatus');
if(keys[state.provider]){
el.textContent = 'Key saved locally for ' + PROVIDERS[state.provider].label + '.';
el.className = 'key-status ok';
} else {
el.textContent = 'No key saved for this provider yet.';
el.className = 'key-status empty';
}
}
document.querySelectorAll('#providerTabs .tab').forEach(tab=>{
tab.addEventListener('click', ()=>{
const targetProvider = tab.dataset.provider;
if(state.messages.length > 0 && targetProvider !== state.provider){
const ok = confirm(
'You have an active conversation with ' + PROVIDERS[state.provider].label + '. ' +
'Switching models mid-run can produce inconsistent results since context formatting ' +
'differs between providers. Switch to ' + PROVIDERS[targetProvider].label + ' anyway?'
);
if(!ok) return;
}
document.querySelectorAll('#providerTabs .tab').forEach(t=>t.classList.remove('active'));
tab.classList.add('active');
state.provider = targetProvider;
renderProviderPane();
});
});
$('apiKey').addEventListener('input', ()=>{
const keys = loadKeys();
const hadKeyBefore = !!keys[state.provider];
keys[state.provider] = $('apiKey').value.trim();
saveKeys(keys);
updateKeyStatus();
// Auto-collapse Model once a key is first saved, unless the user has already
// made an explicit choice about this section's collapsed state.
const saved = loadCollapseState();
if(!hadKeyBefore && keys[state.provider] && !saved.hasOwnProperty('model')){
applyCollapsed('model', true);
}
});
$('modelName').addEventListener('input', ()=>{
const models = loadModels();
models[state.provider] = $('modelName').value.trim();
saveModels(models);
});
$('apiEndpoint').addEventListener('input', ()=>{
const endpoints = loadEndpoints();
endpoints[state.provider] = $('apiEndpoint').value.trim();
saveEndpoints(endpoints);
});
/* ---------- shared preflight check ---------- */
function preflightOk(){
const caseText = $('caseText').value.trim();
if(!caseText){
applyCollapsed('case', false);
alert('Paste a case first — Step 2.');
return false;
}
const keys = loadKeys();
if(!keys[state.provider] && !PROVIDERS[state.provider].needsEndpoint){
applyCollapsed('model', false);
alert('Add an API key for ' + PROVIDERS[state.provider].label + ' in Step 1 first.');
return false;
}
if(PROVIDERS[state.provider].needsEndpoint){
const endpoints = loadEndpoints();
if(!endpoints[state.provider]){
applyCollapsed('model', false);
alert('Add an API endpoint URL in Step 1 first.');
return false;
}
}
return true;
}
/* ---------- render: dialogue activities ---------- */
function renderActivities(){
const wrap = $('activities');
wrap.innerHTML = '';
Object.entries(ACTIVITIES).forEach(([key, a])=>{
const div = document.createElement('div');
div.className = 'activity' + (state.activity===key ? ' selected':'');
div.innerHTML = `<div class="aname">${a.name}</div><div class="adesc">${a.desc}</div>`;
div.addEventListener('click', ()=>{
state.activity = key;
renderActivities();
startDialogueRun();
});
wrap.appendChild(div);
});
}
renderActivities();
renderProviderPane();
/* ---------- case text persistence ---------- */
$('caseText').value = loadCaseText();
$('caseText').addEventListener('input', ()=>{
saveCaseText($('caseText').value);
});
/* ---------- case file upload (PDF / Word / text) ---------- */
const MAX_UPLOAD_BYTES = 10 * 1024 * 1024; // 10MB
if(typeof pdfjsLib !== 'undefined'){
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js';
}
function setUploadStatus(msg, kind){
const el = $('uploadStatus');
el.textContent = msg;
el.className = 'hint' + (kind ? ' ' + kind : '');
}
async function extractPdfText(file){
const buf = await file.arrayBuffer();
const pdf = await pdfjsLib.getDocument({data: buf}).promise;
let out = [];
for(let i = 1; i <= pdf.numPages; i++){
const page = await pdf.getPage(i);
const content = await page.getTextContent();
out.push(content.items.map(it => it.str).join(' '));
}
return out.join('\n\n').trim();
}
async function extractDocxText(file){
const buf = await file.arrayBuffer();
const result = await mammoth.extractRawText({arrayBuffer: buf});
return (result.value || '').trim();
}
function extractTxtText(file){
return file.text();
}
$('caseFile').addEventListener('change', async (e)=>{
const file = e.target.files && e.target.files[0];
if(!file) return;
if(file.size > MAX_UPLOAD_BYTES){
setUploadStatus(`"${file.name}" is ${(file.size/1024/1024).toFixed(1)}MB — max allowed is 10MB.`, 'err');
e.target.value = '';
return;
}
const name = file.name.toLowerCase();
const isPdf = name.endsWith('.pdf') || file.type === 'application/pdf';
const isDocx = name.endsWith('.docx') || file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
const isDoc = name.endsWith('.doc') && !isDocx;
const isTxt = name.endsWith('.txt') || file.type === 'text/plain';
if(!isPdf && !isDocx && !isDoc && !isTxt){