-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
2149 lines (2038 loc) · 119 KB
/
index.html
File metadata and controls
2149 lines (2038 loc) · 119 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>Peaky Peek — How an AI Agent Debugger Works</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700;12..96,800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400;1,9..40,500&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
:root {
--color-bg: #FAF7F2;
--color-bg-warm: #F5F0E8;
--color-bg-code: #1E1E2E;
--color-text: #2C2A28;
--color-text-secondary: #6B6560;
--color-text-muted: #9E9790;
--color-border: #E5DFD6;
--color-border-light: #EEEBE5;
--color-surface: #FFFFFF;
--color-surface-warm: #FDF9F3;
--color-accent: #2A7B9B;
--color-accent-hover: #236A85;
--color-accent-light: #E4F2F7;
--color-accent-muted: #5BA3BD;
--color-success: #2D8B55;
--color-success-light: #E8F5EE;
--color-error: #C93B3B;
--color-error-light: #FDE8E8;
--color-info: #2A7B9B;
--color-info-light: #E4F2F7;
--color-actor-1: #2A7B9B;
--color-actor-2: #D94F30;
--color-actor-3: #7B6DAA;
--color-actor-4: #D4A843;
--color-actor-5: #2D8B55;
--font-display: 'Bricolage Grotesque', Georgia, serif;
--font-body: 'DM Sans', -apple-system, sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.125rem;
--text-xl: 1.25rem;
--text-2xl: 1.5rem;
--text-3xl: 1.875rem;
--text-4xl: 2.25rem;
--text-5xl: 3rem;
--text-6xl: 3.75rem;
--leading-tight: 1.15;
--leading-snug: 1.3;
--leading-normal: 1.6;
--leading-loose: 1.8;
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-5: 1.25rem;
--space-6: 1.5rem;
--space-8: 2rem;
--space-10: 2.5rem;
--space-12: 3rem;
--space-16: 4rem;
--space-20: 5rem;
--space-24: 6rem;
--content-width: 800px;
--content-width-wide: 1000px;
--nav-height: 50px;
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--radius-full: 9999px;
--shadow-sm: 0 1px 2px rgba(44,42,40,0.05);
--shadow-md: 0 4px 12px rgba(44,42,40,0.08);
--shadow-lg: 0 8px 24px rgba(44,42,40,0.1);
--shadow-xl: 0 16px 48px rgba(44,42,40,0.12);
--ease-out: cubic-bezier(0.16,1,0.3,1);
--ease-in-out: cubic-bezier(0.65,0,0.35,1);
--duration-fast: 150ms;
--duration-normal: 300ms;
--duration-slow: 500ms;
--stagger-delay: 120ms;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-snap-type: y proximity; scroll-behavior: smooth; }
body {
font-family: var(--font-body);
color: var(--color-text);
background: var(--color-bg);
background-image: radial-gradient(ellipse at 20% 50%, rgba(42,123,155,0.03) 0%, transparent 50%);
line-height: var(--leading-normal);
-webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full); }
pre, code { white-space: pre-wrap; word-break: break-word; overflow-x: hidden; }
.translation-code::-webkit-scrollbar, pre::-webkit-scrollbar { display: none; }
/* ---- NAV ---- */
.nav {
position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
background: rgba(250,247,242,0.85);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--color-border-light);
height: var(--nav-height);
display: flex; flex-direction: column;
}
.progress-bar {
height: 3px; background: var(--color-border-light);
transition: width 60ms linear;
}
.progress-bar-fill {
height: 100%; background: var(--color-accent);
width: 0; transition: width 60ms linear;
}
.nav-inner {
flex: 1; display: flex; align-items: center; justify-content: space-between;
padding: 0 var(--space-6); max-width: 1200px; margin: 0 auto; width: 100%;
}
.nav-title {
font-family: var(--font-display); font-weight: 700;
font-size: var(--text-base); color: var(--color-accent);
}
.nav-dots { display: flex; gap: var(--space-2); }
.nav-dot {
width: 10px; height: 10px; border-radius: 50%;
border: 2px solid var(--color-text-muted); background: transparent;
cursor: pointer; transition: all var(--duration-fast); position: relative;
}
.nav-dot.active {
border-color: var(--color-accent);
background: var(--color-accent);
box-shadow: 0 0 0 3px rgba(42,123,155,0.2);
}
.nav-dot.visited { background: var(--color-accent); border-color: var(--color-accent); }
.nav-dot::after {
content: attr(data-tooltip);
position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
font-size: var(--text-xs); white-space: nowrap; color: var(--color-text-secondary);
opacity: 0; transition: opacity var(--duration-fast); pointer-events: none;
}
.nav-dot:hover::after { opacity: 1; }
/* ---- MODULE ---- */
.module {
min-height: 100vh; min-height: 100dvh;
scroll-snap-align: start;
padding: var(--space-16) var(--space-6);
padding-top: calc(var(--nav-height) + var(--space-12));
}
.module-content { max-width: var(--content-width); margin: 0 auto; }
.module-header { margin-bottom: var(--space-12); }
.module-number {
font-family: var(--font-display); font-weight: 800;
font-size: var(--text-6xl); color: var(--color-accent); opacity: 0.15;
line-height: 1;
}
.module-title {
font-family: var(--font-display); font-weight: 700;
font-size: var(--text-4xl); color: var(--color-text);
margin-top: var(--space-2); line-height: var(--leading-tight);
}
.module-subtitle {
font-size: var(--text-lg); color: var(--color-text-secondary);
margin-top: var(--space-3); max-width: 600px;
}
.module-body { display: flex; flex-direction: column; gap: var(--space-12); }
.screen { display: flex; flex-direction: column; gap: var(--space-6); }
.screen-heading {
font-family: var(--font-display); font-weight: 600;
font-size: var(--text-2xl); color: var(--color-text);
}
/* ---- ANIMATE IN ---- */
.animate-in {
opacity: 0; transform: translateY(20px);
transition: opacity var(--duration-slow) var(--ease-out),
transform var(--duration-slow) var(--ease-out);
}
.animate-in.visible { opacity: 1; transform: translateY(0); }
.stagger-children > .animate-in {
transition-delay: calc(var(--stagger-index, 0) * var(--stagger-delay));
}
/* ---- TRANSLATION BLOCK ---- */
.translation-block {
display: grid; grid-template-columns: 1fr 1fr; gap: 0;
border-radius: var(--radius-md); overflow: hidden;
box-shadow: var(--shadow-md); margin: var(--space-4) 0;
}
.translation-code {
background: var(--color-bg-code); color: #CDD6F4;
padding: var(--space-6); font-family: var(--font-mono);
font-size: var(--text-sm); line-height: 1.7;
position: relative; overflow-x: hidden;
}
.translation-code pre, .translation-code code {
white-space: pre-wrap; word-break: break-word; overflow-x: hidden;
}
.translation-english {
background: var(--color-surface-warm); padding: var(--space-6);
font-size: var(--text-sm); line-height: 1.7;
border-left: 3px solid var(--color-accent);
display: flex; flex-direction: column; justify-content: center;
}
.translation-label {
position: absolute; top: var(--space-2); right: var(--space-3);
font-size: var(--text-xs); text-transform: uppercase;
letter-spacing: 0.1em; opacity: 0.5; font-family: var(--font-mono);
}
.translation-english .translation-label {
color: var(--color-text-muted); position: relative; top: auto; right: auto;
margin-bottom: var(--space-2); display: block;
}
.tl { margin: var(--space-1) 0; }
/* Syntax highlighting */
.code-keyword { color: #CBA6F7; }
.code-string { color: #A6E3A1; }
.code-function { color: #89B4FA; }
.code-comment { color: #6C7086; }
.code-number { color: #FAB387; }
.code-property { color: #F9E2AF; }
.code-operator { color: #94E2D5; }
.code-tag { color: #F38BA8; }
.code-attr { color: #F9E2AF; }
.code-value { color: #A6E3A1; }
/* ---- QUIZ ---- */
.quiz-container { margin: var(--space-4) 0; }
.quiz-question-block { margin-bottom: var(--space-6); }
.quiz-question {
font-family: var(--font-display); font-weight: 600;
font-size: var(--text-lg); margin-bottom: var(--space-4);
}
.quiz-options { display: flex; flex-direction: column; gap: var(--space-3); }
.quiz-option {
display: flex; align-items: center; gap: var(--space-3);
padding: var(--space-3) var(--space-4);
border: 2px solid var(--color-border); border-radius: var(--radius-sm);
background: var(--color-surface); cursor: pointer; width: 100%;
transition: border-color var(--duration-fast), background var(--duration-fast);
font-family: var(--font-body); font-size: var(--text-base); text-align: left;
}
.quiz-option:hover { border-color: var(--color-accent-muted); }
.quiz-option.selected { border-color: var(--color-accent); background: var(--color-accent-light); }
.quiz-option.correct { border-color: var(--color-success); background: var(--color-success-light); }
.quiz-option.incorrect { border-color: var(--color-error); background: var(--color-error-light); }
.quiz-option.disabled { pointer-events: none; }
.quiz-option-radio {
width: 18px; height: 18px; border-radius: 50%;
border: 2px solid var(--color-border); flex-shrink: 0;
transition: all var(--duration-fast);
}
.quiz-option.selected .quiz-option-radio {
border-color: var(--color-accent); background: var(--color-accent);
box-shadow: inset 0 0 0 3px white;
}
.quiz-feedback {
max-height: 0; overflow: hidden; opacity: 0;
transition: max-height var(--duration-normal), opacity var(--duration-normal), padding var(--duration-normal);
border-radius: var(--radius-sm); font-size: var(--text-sm);
}
.quiz-feedback.show {
max-height: 200px; opacity: 1; padding: var(--space-3);
margin-top: var(--space-2);
}
.quiz-feedback.success { background: var(--color-success-light); color: var(--color-success); }
.quiz-feedback.error { background: var(--color-error-light); color: var(--color-error); }
.quiz-check-btn, .quiz-reset-btn {
padding: var(--space-3) var(--space-6); border-radius: var(--radius-sm);
font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm);
cursor: pointer; border: none; transition: all var(--duration-fast);
margin-right: var(--space-3);
}
.quiz-check-btn { background: var(--color-accent); color: white; }
.quiz-check-btn:hover { background: var(--color-accent-hover); }
.quiz-reset-btn { background: var(--color-border-light); color: var(--color-text-secondary); }
.quiz-reset-btn:hover { background: var(--color-border); }
/* ---- GROUP CHAT ---- */
.chat-window {
background: var(--color-surface); border-radius: var(--radius-lg);
box-shadow: var(--shadow-md); overflow: hidden; margin: var(--space-4) 0;
}
.chat-header {
padding: var(--space-4) var(--space-6);
background: var(--color-surface-warm);
border-bottom: 1px solid var(--color-border-light);
font-family: var(--font-display); font-weight: 600;
font-size: var(--text-sm); color: var(--color-text-secondary);
}
.chat-messages { padding: var(--space-4) var(--space-6); min-height: 280px; }
.chat-message {
display: flex; gap: var(--space-3); margin-bottom: var(--space-4);
animation: fadeSlideUp 0.3s var(--ease-out);
}
.chat-avatar {
width: 36px; height: 36px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-weight: 700; font-size: var(--text-sm); color: white; flex-shrink: 0;
font-family: var(--font-display);
}
.chat-bubble {
background: var(--color-surface-warm); border-radius: var(--radius-md);
padding: var(--space-3) var(--space-4); max-width: 85%;
box-shadow: var(--shadow-sm);
}
.chat-sender { font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; }
.chat-bubble p { margin-top: var(--space-1); font-size: var(--text-sm); line-height: var(--leading-normal); }
.chat-typing {
display: flex; align-items: center; gap: var(--space-3);
padding: var(--space-2) var(--space-6);
}
.typing-dot {
width: 8px; height: 8px; border-radius: 50%;
background: var(--color-text-muted); animation: typingBounce 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
0%, 60%, 100% { transform: translateY(0); }
30% { transform: translateY(-6px); }
}
.chat-controls {
display: flex; align-items: center; gap: var(--space-3);
padding: var(--space-3) var(--space-6);
border-top: 1px solid var(--color-border-light);
background: var(--color-surface-warm);
}
.chat-controls button {
padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
font-family: var(--font-body); font-size: var(--text-sm);
cursor: pointer; border: 1px solid var(--color-border);
background: var(--color-surface); transition: all var(--duration-fast);
}
.chat-controls button:hover { border-color: var(--color-accent); color: var(--color-accent); }
.chat-progress { font-size: var(--text-xs); color: var(--color-text-muted); margin-left: auto; }
/* ---- DATA FLOW ---- */
.flow-animation {
background: var(--color-surface); border-radius: var(--radius-lg);
box-shadow: var(--shadow-md); padding: var(--space-8); margin: var(--space-4) 0;
}
.flow-actors {
display: flex; justify-content: space-between; align-items: center;
gap: var(--space-4); margin-bottom: var(--space-8); flex-wrap: wrap;
}
.flow-actor {
display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
transition: all var(--duration-normal) var(--ease-out);
}
.flow-actor.active {
transform: scale(1.08);
filter: drop-shadow(0 0 12px rgba(42,123,155,0.3));
}
.flow-actor-icon {
width: 56px; height: 56px; border-radius: var(--radius-md);
display: flex; align-items: center; justify-content: center;
font-size: 1.5rem; font-weight: 800; color: white;
font-family: var(--font-display);
}
.flow-actor span {
font-size: var(--text-sm); font-weight: 600; color: var(--color-text);
font-family: var(--font-display);
}
.flow-arrow-region {
display: flex; align-items: center; justify-content: center;
font-size: var(--text-2xl); color: var(--color-text-muted);
}
.flow-step-label {
text-align: center; font-size: var(--text-base);
color: var(--color-text-secondary); min-height: 60px;
display: flex; align-items: center; justify-content: center;
padding: var(--space-4); background: var(--color-surface-warm);
border-radius: var(--radius-sm); margin: var(--space-4) 0;
transition: all var(--duration-normal);
}
.flow-controls {
display: flex; align-items: center; gap: var(--space-3);
justify-content: center; margin-top: var(--space-4);
}
.flow-controls button {
padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
font-family: var(--font-body); font-size: var(--text-sm);
cursor: pointer; border: 1px solid var(--color-border);
background: var(--color-surface); transition: all var(--duration-fast);
}
.flow-controls button:hover { border-color: var(--color-accent); color: var(--color-accent); }
.flow-progress { font-size: var(--text-xs); color: var(--color-text-muted); }
/* ---- CALLOUT ---- */
.callout {
display: flex; gap: var(--space-4); padding: var(--space-5) var(--space-6);
border-radius: var(--radius-md); margin: var(--space-4) 0;
}
.callout-accent {
background: var(--color-accent-light); border-left: 4px solid var(--color-accent);
}
.callout-info {
background: var(--color-info-light); border-left: 4px solid var(--color-info);
}
.callout-warning {
background: var(--color-error-light); border-left: 4px solid var(--color-error);
}
.callout-icon { font-size: 1.5rem; flex-shrink: 0; }
.callout-title { font-weight: 700; font-size: var(--text-sm); margin-bottom: var(--space-1); }
.callout-content p { font-size: var(--text-sm); line-height: var(--leading-normal); }
/* ---- PATTERN CARDS ---- */
.pattern-cards {
display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: var(--space-4); margin: var(--space-4) 0;
}
.pattern-card {
background: var(--color-surface); border-radius: var(--radius-md);
padding: var(--space-6); box-shadow: var(--shadow-sm);
transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal);
}
.pattern-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pattern-icon {
width: 44px; height: 44px; border-radius: var(--radius-sm);
display: flex; align-items: center; justify-content: center;
font-size: 1.25rem; margin-bottom: var(--space-3);
}
.pattern-title {
font-family: var(--font-display); font-weight: 600;
font-size: var(--text-base); margin-bottom: var(--space-2);
}
.pattern-desc { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: var(--leading-normal); }
/* ---- FILE TREE ---- */
.file-tree { font-family: var(--font-mono); font-size: var(--text-sm); margin: var(--space-4) 0; }
.ft-folder, .ft-file {
padding: var(--space-2) var(--space-3);
border-left: 2px solid var(--color-border-light); margin-left: var(--space-4);
}
.ft-folder > .ft-name { color: var(--color-accent); font-weight: 600; }
.ft-desc { color: var(--color-text-secondary); font-family: var(--font-body); margin-left: var(--space-2); font-size: var(--text-xs); }
.ft-children { margin-left: var(--space-4); }
/* ---- STEP CARDS ---- */
.step-cards { display: flex; flex-direction: column; gap: var(--space-3); }
.step-card {
display: flex; align-items: flex-start; gap: var(--space-4);
padding: var(--space-4) var(--space-5); background: var(--color-surface);
border-radius: var(--radius-md); border-left: 3px solid var(--color-accent);
box-shadow: var(--shadow-sm);
}
.step-num {
width: 32px; height: 32px; border-radius: 50%;
background: var(--color-accent); color: white; font-weight: 700;
display: flex; align-items: center; justify-content: center;
font-family: var(--font-display); flex-shrink: 0;
}
.step-body p { margin: var(--space-1) 0 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
/* ---- ICON ROWS ---- */
.icon-rows { display: flex; flex-direction: column; gap: var(--space-4); }
.icon-row {
display: flex; align-items: center; gap: var(--space-4);
padding: var(--space-4); background: var(--color-surface);
border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.icon-row p { margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.icon-circle {
width: 48px; height: 48px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 1.25rem; flex-shrink: 0; color: white; font-weight: 700;
font-family: var(--font-display);
}
/* ---- ARCH DIAGRAM ---- */
.arch-diagram {
background: var(--color-surface); border-radius: var(--radius-lg);
padding: var(--space-8); box-shadow: var(--shadow-md); margin: var(--space-4) 0;
}
.arch-zone {
border: 2px solid var(--color-border); border-radius: var(--radius-md);
padding: var(--space-5); margin-bottom: var(--space-4);
}
.arch-zone-label {
font-family: var(--font-mono); font-size: var(--text-xs);
text-transform: uppercase; letter-spacing: 0.1em;
color: var(--color-text-muted); margin-bottom: var(--space-3);
}
.arch-components { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.arch-component {
display: flex; align-items: center; gap: var(--space-2);
padding: var(--space-2) var(--space-4); background: var(--color-surface-warm);
border-radius: var(--radius-sm); font-size: var(--text-sm);
font-family: var(--font-mono); border: 1px solid var(--color-border-light);
cursor: pointer; transition: all var(--duration-fast);
}
.arch-component:hover { border-color: var(--color-accent); box-shadow: var(--shadow-sm); }
.arch-connector {
text-align: center; color: var(--color-text-muted); font-size: var(--text-lg);
padding: var(--space-2) 0;
}
/* ---- BADGE LIST ---- */
.badge-list { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-4) 0; }
.badge-item {
display: flex; align-items: center; gap: var(--space-4);
padding: var(--space-3) var(--space-4);
border: 1px solid var(--color-border-light); border-radius: var(--radius-sm);
}
.badge-item:hover { border-color: var(--color-accent-muted); }
.badge-code {
font-family: var(--font-mono); font-size: var(--text-sm);
background: var(--color-bg-code); color: #CBA6F7;
padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm);
white-space: nowrap;
}
/* ---- HERO ---- */
.hero-module { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero-module .module-content { max-width: var(--content-width-wide); text-align: center; }
.hero-module .module-number { text-align: center; }
.hero-module .module-title { text-align: center; }
.hero-module .module-subtitle { text-align: center; margin: var(--space-3) auto; }
/* ---- GLOSSARY TOOLTIP ---- */
.term {
border-bottom: 1.5px dashed var(--color-accent-muted);
cursor: pointer; position: relative;
}
.term:hover, .term.active { border-bottom-color: var(--color-accent); color: var(--color-accent); }
.term-tooltip {
position: fixed; background: var(--color-bg-code); color: #CDD6F4;
padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
font-size: var(--text-sm); font-family: var(--font-body);
line-height: var(--leading-normal);
width: max(200px, min(320px, 80vw));
box-shadow: var(--shadow-lg); pointer-events: none;
opacity: 0; transition: opacity var(--duration-fast); z-index: 10000;
}
.term-tooltip::after {
content: ''; position: absolute; top: 100%; left: 50%;
transform: translateX(-50%); border: 6px solid transparent;
border-top-color: var(--color-bg-code);
}
.term-tooltip.visible { opacity: 1; }
.term-tooltip.flip { bottom: auto; }
.term-tooltip.flip::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--color-bg-code); }
/* ---- SPOT THE BUG ---- */
.bug-challenge { margin: var(--space-4) 0; }
.bug-challenge h3 { font-family: var(--font-display); font-weight: 600; margin-bottom: var(--space-4); }
.bug-code {
background: var(--color-bg-code); color: #CDD6F4; border-radius: var(--radius-md);
padding: var(--space-4); font-family: var(--font-mono); font-size: var(--text-sm);
overflow-x: hidden;
}
.bug-line {
display: flex; gap: var(--space-3); padding: var(--space-2) var(--space-3);
border-radius: var(--radius-sm); cursor: pointer;
transition: background var(--duration-fast);
}
.bug-line:hover { background: rgba(255,255,255,0.05); }
.bug-line.correct { background: rgba(45,139,85,0.2); }
.bug-line.incorrect { background: rgba(201,59,59,0.2); }
.line-num { color: var(--color-text-muted); min-width: 24px; user-select: none; }
.bug-feedback {
max-height: 0; overflow: hidden; opacity: 0;
transition: max-height var(--duration-normal), opacity var(--duration-normal);
border-radius: var(--radius-sm); font-size: var(--text-sm);
}
.bug-feedback.show {
max-height: 200px; opacity: 1; padding: var(--space-3);
margin-top: var(--space-2);
}
.bug-feedback.success { background: var(--color-success-light); color: var(--color-success); }
.bug-feedback.error { background: var(--color-error-light); color: var(--color-error); }
@keyframes fadeSlideUp {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
:root { --text-4xl: 1.875rem; --text-5xl: 2.25rem; --text-6xl: 3rem; }
.translation-block { grid-template-columns: 1fr; }
.translation-english { border-left: none; border-top: 3px solid var(--color-accent); }
.pattern-cards { grid-template-columns: 1fr 1fr; }
.flow-actors { flex-direction: column; }
.flow-arrow-region { transform: rotate(90deg); }
}
@media (max-width: 480px) {
:root { --text-4xl: 1.5rem; --text-5xl: 1.875rem; --text-6xl: 2.25rem; }
.module { padding: var(--space-8) var(--space-4); }
.pattern-cards { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<!-- ====== NAV ====== -->
<nav class="nav">
<div class="progress-bar"><div class="progress-bar-fill" id="progress-fill"></div></div>
<div class="nav-inner">
<span class="nav-title">Peaky Peek — Under the Hood</span>
<div class="nav-dots">
<button class="nav-dot" data-target="module-1" data-tooltip="What is Peaky Peek?" onclick="scrollToModule('module-1')" aria-label="Module 1"></button>
<button class="nav-dot" data-target="module-2" data-tooltip="Meet the Cast" onclick="scrollToModule('module-2')" aria-label="Module 2"></button>
<button class="nav-dot" data-target="module-3" data-tooltip="How Events Flow" onclick="scrollToModule('module-3')" aria-label="Module 3"></button>
<button class="nav-dot" data-target="module-4" data-tooltip="TraceContext" onclick="scrollToModule('module-4')" aria-label="Module 4"></button>
<button class="nav-dot" data-target="module-5" data-tooltip="Intelligence" onclick="scrollToModule('module-5')" aria-label="Module 5"></button>
<button class="nav-dot" data-target="module-6" data-tooltip="Auto-Instrumentation" onclick="scrollToModule('module-6')" aria-label="Module 6"></button>
<button class="nav-dot" data-target="module-7" data-tooltip="The Big Picture" onclick="scrollToModule('module-7')" aria-label="Module 7"></button>
</div>
</div>
</nav>
<!-- ====== MODULE 1: What is Peaky Peek? ====== -->
<section class="module hero-module" id="module-1" style="background: var(--color-bg)">
<div class="module-content">
<header class="module-header animate-in">
<span class="module-number">01</span>
<h1 class="module-title">What is Peaky Peek?</h1>
<p class="module-subtitle">An AI agent debugger that captures every decision, tool call, and LLM interaction as a queryable timeline — so you can debug agents like distributed systems, not black boxes.</p>
</header>
<div class="module-body">
<section class="screen animate-in">
<h2 class="screen-heading">The Problem: AI Agents Are Black Boxes</h2>
<p>When you ask an AI agent to do something — book a flight, write code, analyze data — a lot happens behind the scenes. The agent <span class="term" data-definition="Makes a series of choices about what to do next — which tool to call, what to search for, whether to ask for clarification. Each of these choices is a 'decision' in the agent's execution.">makes decisions</span>, calls <span class="term" data-definition="External programs the agent invokes to do things it can't do on its own — like searching the web, reading files, or querying a database. Think of them as the agent's hands.">tools</span>, talks to <span class="term" data-definition="Large Language Models like GPT-4 or Claude — the AI brain that powers the agent's reasoning. The agent sends prompts to the LLM and gets back responses.">LLMs</span>, and occasionally <span class="term" data-definition="The agent refuses to do something because it might be harmful, against its instructions, or outside its capabilities. This is a 'safety guardrail.'">refuses unsafe actions</span>.</p>
<p>When something goes wrong — the agent loops forever, picks the wrong tool, or gives a nonsensical answer — you're stuck. Traditional debugging tools can't see inside the agent's reasoning.</p>
<div class="callout callout-accent animate-in">
<div class="callout-icon">💡</div>
<div class="callout-content">
<strong class="callout-title">Why existing tools fall short</strong>
<p><span class="term" data-definition="A system for tracking metrics like CPU usage, memory, and network traffic. Great for servers, useless for understanding WHY an AI agent chose to call the weather API instead of the calendar.">OpenTelemetry</span> sees infrastructure metrics, not reasoning chains. <span class="term" data-definition="A cloud service by LangChain for tracing LLM calls. Powerful, but it sends your data to their servers — not ideal if your agent handles private data.">LangSmith</span> is SaaS-first with no local option. <span class="term" data-definition="An error-tracking tool that catches crashes and exceptions. Great for finding bugs, but it doesn't show the agent's decision-making process.">Sentry</span> sees errors, not why the agent chose them. Peaky Peek is agent-decision-aware and local-first by default.</p>
</div>
</div>
</section>
<section class="screen animate-in">
<h2 class="screen-heading">The Solution: See Everything</h2>
<p>Peaky Peek wraps your agent in a <span class="term" data-definition="A Python construct that sets up some state when you enter it and tears it down when you leave. Like a recording studio — you walk in, press record, do your work, and walk out with a complete recording.">context manager</span> that captures every action as an event. These events form a timeline you can search, replay, and analyze.</p>
<p>Here's the core idea in code — three lines to start debugging any agent:</p>
<div class="translation-block animate-in">
<div class="translation-code">
<span class="translation-label">CODE</span>
<pre><code><span class="code-keyword">from</span> agent_debugger_sdk <span class="code-keyword">import</span> TraceContext, init
<span class="code-function">init</span>()
<span class="code-keyword">async with</span> <span class="code-function">TraceContext</span>(agent_name=<span class="code-string">"my_agent"</span>) <span class="code-keyword">as</span> ctx:
<span class="code-keyword">await</span> ctx.<span class="code-function">record_decision</span>(
reasoning=<span class="code-string">"User asked for weather data"</span>,
confidence=<span class="code-number">0.85</span>,
chosen_action=<span class="code-string">"call_weather_tool"</span>,
)
<span class="code-keyword">await</span> ctx.<span class="code-function">record_tool_call</span>(<span class="code-string">"weather_api"</span>,
{<span class="code-string">"location"</span>: <span class="code-string">"Seattle"</span>})</code></pre>
</div>
<div class="translation-english">
<span class="translation-label">PLAIN ENGLISH</span>
<p class="tl">Pull in the two things we need: TraceContext (the recorder) and init (the setup).</p>
<p class="tl">Initialize Peaky Peek. This sets up the connection to the local server.</p>
<p class="tl">Open the recording session — like pressing "record" on a camera.</p>
<p class="tl">Log a decision: the agent thought about weather data, was 85% confident, and chose to call the weather tool.</p>
<p class="tl">Log a tool call: the agent called the weather_api with "Seattle" as the location.</p>
</div>
</div>
</section>
<section class="screen animate-in">
<h2 class="screen-heading">What You Get</h2>
<div class="pattern-cards stagger-children">
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-1)">
<div class="pattern-icon" style="background: var(--color-actor-1)">🎯</div>
<h4 class="pattern-title">Decision Tree</h4>
<p class="pattern-desc">See every reasoning step as an interactive tree. Click nodes to inspect why the agent chose each action.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-2)">
<div class="pattern-icon" style="background: var(--color-actor-2)">⏰</div>
<h4 class="pattern-title">Checkpoint Replay</h4>
<p class="pattern-desc">Time-travel through agent execution. Play, pause, step, and seek to any point in the trace.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-3)">
<div class="pattern-icon" style="background: var(--color-actor-3)">🔍</div>
<h4 class="pattern-title">Trace Search</h4>
<p class="pattern-desc">Find specific events across all sessions. Search by keyword, filter by event type.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-4)">
<div class="pattern-icon" style="background: var(--color-actor-4)">🛡</div>
<h4 class="pattern-title">Safety Audit Trail</h4>
<p class="pattern-desc">Full safety trail: policy → tool guard → block → violation → refusal.</p>
</div>
</div>
</section>
<!-- QUIZ 1 -->
<section class="screen animate-in" id="quiz-1">
<h2 class="screen-heading">Check Your Understanding</h2>
<div class="quiz-container">
<div class="quiz-question-block" data-question="q1-1" data-correct="option-b">
<h3 class="quiz-question">An AI agent keeps calling the same search tool in a loop. Where would you look to understand why?</h3>
<div class="quiz-options">
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>In the agent's server logs for HTTP 500 errors</span>
</button>
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>In the decision tree — look at the reasoning chain before each tool call</span>
</button>
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>In the database query logs to see what data the tool returned</span>
</button>
</div>
<div class="quiz-feedback" id="q1-1-feedback"></div>
</div>
<div class="quiz-question-block" data-question="q1-2" data-correct="option-c">
<h3 class="quiz-question">Why is Peaky Peek "local-first"?</h3>
<div class="quiz-options">
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>Because it only works on localhost, not in the cloud</span>
</button>
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>Because it was designed as a debugging tool, not a production service</span>
</button>
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>Because it stores data on your machine by default — no data leaves without your explicit cloud config</span>
</button>
</div>
<div class="quiz-feedback" id="q1-2-feedback"></div>
</div>
<button class="quiz-check-btn" onclick="checkQuiz('quiz-1')">Check Answers</button>
<button class="quiz-reset-btn" onclick="resetQuiz('quiz-1')">Try Again</button>
</div>
</section>
</div>
</div>
</section>
<!-- ====== MODULE 2: Meet the Cast ====== -->
<section class="module" id="module-2" style="background: var(--color-bg-warm)">
<div class="module-content">
<header class="module-header animate-in">
<span class="module-number">02</span>
<h1 class="module-title">Meet the Cast</h1>
<p class="module-subtitle">Three layers work together: the SDK captures events, the API stores and serves them, and the frontend lets you explore.</p>
</header>
<div class="module-body">
<section class="screen animate-in">
<h2 class="screen-heading">The Three Layers</h2>
<div class="icon-rows stagger-children">
<div class="icon-row animate-in">
<div class="icon-circle" style="background: var(--color-actor-1)">SDK</div>
<div>
<strong>Agent Debugger SDK (<span class="term" data-definition="The Python package you install with 'pip install peaky-peek'. It's the code you add to your agent to start recording events.">peaky-peek</span>)</strong>
<p>The recording equipment. You add two lines to your agent code, and the SDK captures every decision, tool call, LLM interaction, and checkpoint.</p>
</div>
</div>
<div class="icon-row animate-in">
<div class="icon-circle" style="background: var(--color-actor-2)">API</div>
<div>
<strong>FastAPI Server (<span class="term" data-definition="The Python web framework used to build the API server. FastAPI is popular because it's fast and automatically generates documentation.">FastAPI</span>)</strong>
<p>The control room. Receives events from the SDK, stores them in <span class="term" data-definition="A lightweight database that stores everything in a single file on your disk. Perfect for local development — no separate database server needed.">SQLite</span>, serves them via REST and real-time streaming, and handles search and replay.</p>
</div>
</div>
<div class="icon-row animate-in">
<div class="icon-circle" style="background: var(--color-actor-3)">UI</div>
<div>
<strong>React Frontend (<span class="term" data-definition="A JavaScript library for building user interfaces. The frontend is the visual part you see in your browser.">React</span> + TypeScript + Vite)</strong>
<p>The viewing gallery. Decision trees, timeline replays, tool inspectors, safety audit trails, and live monitoring — all rendered in your browser.</p>
</div>
</div>
</div>
</section>
<section class="screen animate-in">
<h2 class="screen-heading">The Project Layout</h2>
<div class="file-tree">
<div class="ft-folder open">
<span class="ft-name">agent_debugger_sdk/</span>
<span class="ft-desc">The recording equipment — events, context, emitters</span>
<div class="ft-children">
<div class="ft-folder">
<span class="ft-name">core/</span>
<span class="ft-desc">Tracing primitives — TraceContext, events, emitter, scorer</span>
</div>
<div class="ft-folder">
<span class="ft-name">checkpoints/</span>
<span class="ft-desc">State snapshots for time-travel debugging</span>
</div>
<div class="ft-folder">
<span class="ft-name">adapters/</span>
<span class="ft-desc">Framework integrations — LangChain, PydanticAI</span>
</div>
<div class="ft-folder">
<span class="ft-name">auto_patch/</span>
<span class="ft-desc">Zero-code auto-instrumentation for LLM libraries</span>
</div>
</div>
</div>
<div class="ft-folder">
<span class="ft-name">api/</span>
<span class="ft-desc">FastAPI server — routes, schemas, services</span>
</div>
<div class="ft-folder">
<span class="ft-name">collector/</span>
<span class="ft-desc">Event pipeline — buffer, persistence, intelligence</span>
</div>
<div class="ft-folder">
<span class="ft-name">storage/</span>
<span class="ft-desc">Database engine, models, migrations</span>
</div>
<div class="ft-folder">
<span class="ft-name">frontend/</span>
<span class="ft-desc">React UI — trace timeline, decision tree, replay</span>
</div>
</div>
</section>
<section class="screen animate-in">
<h2 class="screen-heading">How They Connect</h2>
<p>The three layers communicate through two channels: <span class="term" data-definition="The standard way web browsers and servers talk to each other. The browser asks for data (GET), sends data (POST), or updates data (PUT). Think of it as the language of the web.">REST API</span> for on-demand data, and <span class="term" data-definition="Server-Sent Events — a way for the server to push real-time updates to the browser without the browser having to ask. Like a live news feed.">SSE</span> (Server-Sent Events) for live streaming.</p>
<div class="arch-diagram animate-in">
<div class="arch-zone">
<h4 class="arch-zone-label">Visualization Layer</h4>
<div class="arch-components">
<div class="arch-component"><span class="term" data-definition="A visual tree showing the agent's reasoning path. Each node is a decision, tool call, or safety check. You can click nodes to see the details.">DecisionTree</span></div>
<div class="arch-component"><span class="term" data-definition="A panel showing what tool the agent called, what arguments it passed, and what result it got back. Like an X-ray of a tool call.">ToolInspector</span></div>
<div class="arch-component"><span class="term" data-definition">A playback control that lets you step through the agent's execution event by event, like rewinding a video.">SessionReplay</span></div>
<div class="arch-component">TraceTimeline</div>
<div class="arch-component">LLMViewer</div>
</div>
</div>
<div class="arch-connector">↓ REST + SSE ↑</div>
<div class="arch-zone">
<h4 class="arch-zone-label">API Layer (FastAPI)</h4>
<div class="arch-components">
<div class="arch-component">session_routes</div>
<div class="arch-component">trace_routes</div>
<div class="arch-component">replay_routes</div>
<div class="arch-component">comparison_routes</div>
<div class="arch-component">analytics_routes</div>
</div>
</div>
<div class="arch-connector">↓ SQLAlchemy ↑</div>
<div class="arch-zone">
<h4 class="arch-zone-label">Storage Layer (SQLite)</h4>
<div class="arch-components">
<div class="arch-component">sessions</div>
<div class="arch-component">events</div>
<div class="arch-component">checkpoints</div>
</div>
</div>
</div>
</section>
<!-- QUIZ 2 -->
<section class="screen animate-in" id="quiz-2">
<h2 class="screen-heading">Check Your Understanding</h2>
<div class="quiz-container">
<div class="quiz-question-block" data-question="q2-1" data-correct="option-a">
<h3 class="quiz-question">A developer wants to add a new visualization panel to the frontend. Which files would they need to touch?</h3>
<div class="quiz-options">
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>A new component in frontend/src/components/, types in types/index.ts, and an API call in api/client.ts</span>
</button>
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>Only the frontend/src/components/ directory — the rest is auto-generated</span>
</button>
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>The storage layer, API routes, and frontend — all three layers need changes</span>
</button>
</div>
<div class="quiz-feedback" id="q2-1-feedback"></div>
</div>
<div class="quiz-question-block" data-question="q2-2" data-correct="option-c">
<h3 class="quiz-question">Why does the system use SSE instead of WebSockets for live streaming?</h3>
<div class="quiz-options">
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>Because WebSockets are slower than SSE for one-way communication</span>
</button>
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>Because SSE can send binary data more efficiently</span>
</button>
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)">
<div class="quiz-option-radio"></div>
<span>SSE is simpler for one-way server-to-client streaming — the server pushes events, the client just listens</span>
</button>
</div>
<div class="quiz-feedback" id="q2-2-feedback"></div>
</div>
<button class="quiz-check-btn" onclick="checkQuiz('quiz-2')">Check Answers</button>
<button class="quiz-reset-btn" onclick="resetQuiz('quiz-2')">Try Again</button>
</div>
</section>
</div>
</div>
</section>
<!-- ====== MODULE 3: How Events Flow ====== -->
<section class="module" id="module-3" style="background: var(--color-bg)">
<div class="module-content">
<header class="module-header animate-in">
<span class="module-number">03</span>
<h1 class="module-title">How Events Flow</h1>
<p class="module-subtitle">Every agent action becomes an event. Events form a tree, flow through a pipeline, and end up on your screen.</p>
</header>
<div class="module-body">
<section class="screen animate-in">
<h2 class="screen-heading">The Event Hierarchy</h2>
<p>Peaky Peek models agent execution as a hierarchy — like a family tree for your agent's actions:</p>
<div class="step-cards stagger-children">
<div class="step-card animate-in">
<div class="step-num">1</div>
<div class="step-body">
<strong><span class="term" data-definition="One complete run of your agent — from the moment it starts to the moment it finishes. Like one episode of a TV show.">Session</span></strong>
<p>The container for everything. One user request = one session. It tracks total tokens, cost, tool calls, and whether it succeeded or failed.</p>
</div>
</div>
<div class="step-card animate-in">
<div class="step-num">2</div>
<div class="step-body">
<strong><span class="term" data-definition="The complete timeline of events within a session. Every decision, tool call, and LLM response is a point on this timeline. Like the script of a play.">Trace</span></strong>
<p>The full event timeline for a session. Every event gets a sequence number so you can replay them in order.</p>
</div>
</div>
<div class="step-card animate-in">
<div class="step-num">3</div>
<div class="step-body">
<strong><span class="term" data-definition="A single observable action — a decision the agent made, a tool it called, an LLM response it received, or an error that occurred. The fundamental unit of tracing.">Event</span></strong>
<p>Any observable action. Each event has a type (decision, tool_call, error...), a parent ID for nesting, and an importance score.</p>
</div>
</div>
<div class="step-card animate-in">
<div class="step-num">4</div>
<div class="step-body">
<strong><span class="term" data-definition="A frozen snapshot of the agent's state at a specific moment. Like a save point in a video game — you can restore the agent to this exact state later.">Checkpoint</span></strong>
<p>A state snapshot for time-travel debugging. Restore from a checkpoint to replay the agent from that exact point.</p>
</div>
</div>
</div>
</section>
<section class="screen animate-in">
<h2 class="screen-heading">The Event Type Zoo</h2>
<p>The <span class="term" data-definition="A fixed list of categories that every event belongs to. There are 14 types — from agent_start and tool_call to safety_check and behavior_alert. Each type triggers different behavior in the UI and intelligence analysis.">EventType enum</span> defines 14 types of things that can happen during agent execution. Here are the key ones:</p>
<div class="pattern-cards stagger-children">
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-2)">
<div class="pattern-icon" style="background: var(--color-actor-2)">💡</div>
<h4 class="pattern-title">decision</h4>
<p class="pattern-desc">The agent chose an action. Includes reasoning, confidence score, and evidence.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-1)">
<div class="pattern-icon" style="background: var(--color-actor-1)">🔧</div>
<h4 class="pattern-title">tool_call / tool_result</h4>
<p class="pattern-desc">The agent invoked an external tool and got a result back. The call/result pair shows what was asked and what was returned.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-3)">
<div class="pattern-icon" style="background: var(--color-actor-3)">🤖</div>
<h4 class="pattern-title">llm_request / llm_response</h4>
<p class="pattern-desc">What was sent to the AI model and what came back. Includes token counts, cost, and the full conversation.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-error)">
<div class="pattern-icon" style="background: var(--color-error)">⚠</div>
<h4 class="pattern-title">error</h4>
<p class="pattern-desc">Something went wrong. Includes the error type, message, and full stack trace.</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-4)">
<div class="pattern-icon" style="background: var(--color-actor-4)">🛡</div>
<h4 class="pattern-title">safety_check / refusal / policy_violation</h4>
<p class="pattern-desc">The agent's safety guardrails in action. Did it pass a check? Refuse an action? Violate a policy?</p>
</div>
<div class="pattern-card animate-in" style="border-top: 3px solid var(--color-actor-5)">
<div class="pattern-icon" style="background: var(--color-actor-5)">📈</div>
<h4 class="pattern-title">checkpoint / agent_turn / behavior_alert</h4>
<p class="pattern-desc">State snapshots, speaker turns in multi-agent chats, and detected anomalies.</p>
</div>
</div>
</section>
<section class="screen animate-in">
<h2 class="screen-heading">Inside a TraceEvent</h2>
<p>Every event is a <span class="term" data-definition="A Python construct for creating data objects. It's like a blueprint — you define what fields an object has and their types, and Python generates the constructor and other methods automatically.">dataclass</span> with a shared set of fields. Here's the foundation:</p>