codex-transcript-viewer 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,589 @@
1
+ :root {
2
+ --accent: #10a37f;
3
+ --accent-dim: #0d8c6d;
4
+ --border: #5f87ff;
5
+ --borderAccent: #10a37f;
6
+ --success: #b5bd68;
7
+ --error: #cc6666;
8
+ --warning: #ffff00;
9
+ --muted: #808080;
10
+ --dim: #666666;
11
+ --text: #e5e5e7;
12
+ --thinkingText: #808080;
13
+ --selectedBg: #3a3a4a;
14
+ --userMessageBg: #343541;
15
+ --userMessageText: #e5e5e7;
16
+ --commentaryBg: #2a2d3a;
17
+ --commentaryText: #a0b0c0;
18
+ --commentaryBorder: #3a4a5a;
19
+ --toolPendingBg: #282832;
20
+ --toolSuccessBg: #283228;
21
+ --toolErrorBg: #3c2828;
22
+ --toolOutput: #808080;
23
+ --mdHeading: #f0c674;
24
+ --mdLink: #81a2be;
25
+ --mdCode: #8abeb7;
26
+ --mdCodeBlockBorder: #808080;
27
+ --mdQuote: #808080;
28
+ --mdListBullet: #8abeb7;
29
+ --mdHr: #808080;
30
+ --body-bg: rgb(36, 37, 46);
31
+ --container-bg: rgb(44, 45, 55);
32
+ --line-height: 18px;
33
+ }
34
+
35
+ * { margin: 0; padding: 0; box-sizing: border-box; }
36
+
37
+ body {
38
+ font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
39
+ font-size: 12px;
40
+ line-height: var(--line-height);
41
+ color: var(--text);
42
+ background: var(--body-bg);
43
+ }
44
+
45
+ #app {
46
+ display: flex;
47
+ min-height: 100vh;
48
+ }
49
+
50
+ /* Sidebar */
51
+ #sidebar {
52
+ width: 420px;
53
+ background: var(--container-bg);
54
+ flex-shrink: 0;
55
+ display: flex;
56
+ flex-direction: column;
57
+ position: sticky;
58
+ top: 0;
59
+ height: 100vh;
60
+ border-right: 1px solid var(--dim);
61
+ }
62
+
63
+ .sidebar-header {
64
+ padding: 12px;
65
+ border-bottom: 1px solid var(--dim);
66
+ }
67
+
68
+ .sidebar-header h2 {
69
+ font-size: 11px;
70
+ color: var(--accent);
71
+ margin-bottom: 4px;
72
+ }
73
+
74
+ .sidebar-meta {
75
+ font-size: 10px;
76
+ color: var(--dim);
77
+ }
78
+
79
+ .sidebar-search {
80
+ width: 100%;
81
+ padding: 4px 8px;
82
+ margin-top: 8px;
83
+ font-size: 11px;
84
+ font-family: inherit;
85
+ background: var(--body-bg);
86
+ color: var(--text);
87
+ border: 1px solid var(--dim);
88
+ border-radius: 3px;
89
+ }
90
+
91
+ .sidebar-search:focus {
92
+ outline: none;
93
+ border-color: var(--accent);
94
+ }
95
+
96
+ .sidebar-filters {
97
+ display: flex;
98
+ gap: 4px;
99
+ margin-top: 6px;
100
+ flex-wrap: wrap;
101
+ }
102
+
103
+ .filter-btn {
104
+ padding: 2px 6px;
105
+ font-size: 10px;
106
+ font-family: inherit;
107
+ background: transparent;
108
+ color: var(--muted);
109
+ border: 1px solid var(--dim);
110
+ border-radius: 3px;
111
+ cursor: pointer;
112
+ }
113
+
114
+ .filter-btn:hover { color: var(--text); border-color: var(--text); }
115
+ .filter-btn.active { background: var(--accent); color: var(--body-bg); border-color: var(--accent); }
116
+
117
+ .tree-container {
118
+ flex: 1;
119
+ overflow-y: auto;
120
+ padding: 4px 0;
121
+ }
122
+
123
+ .tree-node {
124
+ display: flex;
125
+ align-items: baseline;
126
+ padding: 2px 8px;
127
+ font-size: 11px;
128
+ line-height: 16px;
129
+ text-decoration: none;
130
+ color: inherit;
131
+ white-space: nowrap;
132
+ overflow: hidden;
133
+ text-overflow: ellipsis;
134
+ cursor: pointer;
135
+ }
136
+
137
+ .tree-node:hover { background: var(--selectedBg); }
138
+ .tree-node.active { background: var(--selectedBg); font-weight: bold; }
139
+
140
+ .tree-ts {
141
+ color: var(--dim);
142
+ flex-shrink: 0;
143
+ margin-right: 6px;
144
+ font-size: 10px;
145
+ }
146
+
147
+ .tree-content { overflow: hidden; text-overflow: ellipsis; }
148
+ .tree-role-user .tree-content { color: var(--accent); }
149
+ .tree-role-assistant .tree-content { color: var(--success); }
150
+ .tree-role-tool .tree-content { color: var(--muted); }
151
+ .tree-role-thinking .tree-content { color: var(--thinkingText); }
152
+ .tree-role-system .tree-content { color: var(--dim); }
153
+ .tree-role-error .tree-content { color: var(--error); }
154
+ .tree-role-inherited .tree-content { color: var(--dim); font-style: italic; }
155
+ .tree-role-event .tree-content { color: var(--mdHeading); }
156
+
157
+ /* Main content */
158
+ #content {
159
+ flex: 1;
160
+ overflow-y: auto;
161
+ padding: var(--line-height) calc(var(--line-height) * 2);
162
+ display: flex;
163
+ flex-direction: column;
164
+ align-items: center;
165
+ }
166
+
167
+ #content > * {
168
+ width: 100%;
169
+ max-width: 860px;
170
+ }
171
+
172
+ /* Header */
173
+ .header {
174
+ background: var(--container-bg);
175
+ border-radius: 4px;
176
+ padding: var(--line-height);
177
+ margin-bottom: var(--line-height);
178
+ }
179
+
180
+ .header h1 {
181
+ font-size: 13px;
182
+ font-weight: bold;
183
+ color: var(--accent);
184
+ margin-bottom: 8px;
185
+ display: flex;
186
+ align-items: center;
187
+ gap: 8px;
188
+ }
189
+
190
+ .header h1 .codex-logo {
191
+ display: inline-block;
192
+ padding: 2px 6px;
193
+ background: var(--accent);
194
+ color: var(--body-bg);
195
+ border-radius: 3px;
196
+ font-size: 10px;
197
+ font-weight: bold;
198
+ letter-spacing: 1px;
199
+ }
200
+
201
+ .header-info {
202
+ display: flex;
203
+ flex-direction: column;
204
+ font-size: 11px;
205
+ }
206
+
207
+ .info-item {
208
+ color: var(--dim);
209
+ display: flex;
210
+ }
211
+
212
+ .info-label {
213
+ font-weight: 600;
214
+ min-width: 110px;
215
+ }
216
+
217
+ .info-value {
218
+ color: var(--text);
219
+ }
220
+
221
+ .image-notice {
222
+ margin-bottom: var(--line-height);
223
+ padding: 8px var(--line-height);
224
+ border-left: 3px solid var(--warning);
225
+ color: var(--muted);
226
+ font-size: 11px;
227
+ }
228
+
229
+ /* Messages */
230
+ #messages {
231
+ display: flex;
232
+ flex-direction: column;
233
+ gap: var(--line-height);
234
+ }
235
+
236
+ .message-timestamp {
237
+ font-size: 10px;
238
+ color: var(--dim);
239
+ opacity: 0.8;
240
+ margin-bottom: 4px;
241
+ }
242
+
243
+ .user-message {
244
+ background: var(--userMessageBg);
245
+ color: var(--userMessageText);
246
+ padding: var(--line-height);
247
+ border-radius: 4px;
248
+ border-left: 3px solid var(--accent);
249
+ }
250
+
251
+ .attachments {
252
+ display: flex;
253
+ flex-wrap: wrap;
254
+ gap: 8px;
255
+ margin-top: 8px;
256
+ }
257
+
258
+ .attachment-image {
259
+ margin: 0;
260
+ }
261
+
262
+ .attachment-image img {
263
+ display: block;
264
+ max-height: 240px;
265
+ max-width: 100%;
266
+ border: 1px solid var(--dim);
267
+ border-radius: 3px;
268
+ cursor: zoom-in;
269
+ }
270
+
271
+ .attachment-image img.full {
272
+ max-height: none;
273
+ cursor: zoom-out;
274
+ }
275
+
276
+ .attachment-image figcaption,
277
+ .attachment-note {
278
+ font-size: 10px;
279
+ color: var(--dim);
280
+ }
281
+
282
+ .attachment-chip {
283
+ color: var(--muted);
284
+ font-size: 11px;
285
+ }
286
+
287
+ .assistant-message {
288
+ padding: var(--line-height);
289
+ border-radius: 4px;
290
+ }
291
+
292
+ .assistant-message.final-answer {
293
+ background: rgba(16, 163, 127, 0.08);
294
+ border-left: 3px solid var(--accent);
295
+ }
296
+
297
+ .assistant-text {
298
+ white-space: pre-wrap;
299
+ word-wrap: break-word;
300
+ }
301
+
302
+ .commentary-message {
303
+ padding: 8px var(--line-height);
304
+ background: var(--commentaryBg);
305
+ border-left: 3px solid var(--commentaryBorder);
306
+ border-radius: 4px;
307
+ color: var(--commentaryText);
308
+ font-style: italic;
309
+ }
310
+
311
+ .thinking-block {
312
+ padding: 8px var(--line-height);
313
+ color: var(--thinkingText);
314
+ font-style: italic;
315
+ }
316
+
317
+ .thinking-text {
318
+ white-space: pre-wrap;
319
+ }
320
+
321
+ .inherited-history {
322
+ border-left: 3px dashed var(--dim);
323
+ padding-left: var(--line-height);
324
+ }
325
+
326
+ .inherited-history > summary {
327
+ cursor: pointer;
328
+ color: var(--dim);
329
+ font-style: italic;
330
+ }
331
+
332
+ .inherited-history[open] > summary {
333
+ margin-bottom: var(--line-height);
334
+ }
335
+
336
+ /* Tool execution */
337
+ .tool-execution {
338
+ padding: var(--line-height);
339
+ border-radius: 4px;
340
+ }
341
+
342
+ .tool-execution.success { background: var(--toolSuccessBg); }
343
+ .tool-execution.failure { background: var(--toolErrorBg); }
344
+ .tool-execution.unknown,
345
+ .tool-execution.no-result,
346
+ .tool-execution.single { background: var(--toolPendingBg); }
347
+
348
+ .tool-status {
349
+ margin-left: 8px;
350
+ font-weight: normal;
351
+ font-size: 10px;
352
+ color: var(--dim);
353
+ }
354
+
355
+ .tool-execution.failure .tool-status { color: var(--error); }
356
+ .tool-execution.success .tool-status { color: var(--success); }
357
+
358
+ .tool-header { font-weight: bold; margin-bottom: 4px; }
359
+ .tool-name { color: var(--accent); }
360
+
361
+ .tool-param {
362
+ display: grid;
363
+ grid-template-columns: 150px minmax(0, 1fr);
364
+ gap: 8px;
365
+ padding: 4px 0;
366
+ border-top: 1px solid rgba(128, 128, 128, 0.16);
367
+ }
368
+
369
+ .tool-param:first-child {
370
+ border-top: 0;
371
+ }
372
+
373
+ .tool-param-name {
374
+ color: var(--muted);
375
+ overflow-wrap: anywhere;
376
+ }
377
+
378
+ .tool-param-value {
379
+ min-width: 0;
380
+ }
381
+
382
+ .tool-command {
383
+ font-weight: bold;
384
+ white-space: pre-wrap;
385
+ word-wrap: break-word;
386
+ color: var(--success);
387
+ }
388
+
389
+ .tool-args pre,
390
+ .tool-param-value pre {
391
+ white-space: pre-wrap;
392
+ word-wrap: break-word;
393
+ font-family: inherit;
394
+ color: var(--text);
395
+ }
396
+
397
+ .tool-output {
398
+ color: var(--toolOutput);
399
+ font-family: inherit;
400
+ overflow-x: auto;
401
+ }
402
+
403
+ .tool-output pre {
404
+ margin: 0;
405
+ padding: 0;
406
+ font-family: inherit;
407
+ color: inherit;
408
+ white-space: pre-wrap;
409
+ word-wrap: break-word;
410
+ }
411
+
412
+ .tool-output.expandable { cursor: pointer; }
413
+ .tool-output.expandable:hover { opacity: 0.9; }
414
+ .tool-output.expandable .output-full { display: none; }
415
+ .tool-output.expandable.expanded .output-preview { display: none; }
416
+ .tool-output.expandable.expanded .output-full { display: block; }
417
+
418
+ .expand-hint { color: var(--warning); font-style: italic; }
419
+
420
+ /* System events */
421
+ .system-event {
422
+ padding: 4px var(--line-height);
423
+ font-size: 11px;
424
+ }
425
+
426
+ .event-label {
427
+ color: var(--dim);
428
+ }
429
+
430
+ .error-text {
431
+ color: var(--error);
432
+ }
433
+
434
+ /* Goals, reviews, hooks and errors */
435
+ .session-event {
436
+ margin: 8px 0;
437
+ padding: 8px var(--line-height);
438
+ border-left: 3px solid var(--mdHeading);
439
+ background: var(--container-bg);
440
+ }
441
+ .session-event.error-event { border-left-color: var(--error); }
442
+ .event-title { color: var(--mdHeading); font-weight: bold; }
443
+ .error-event .event-title { color: var(--error); }
444
+ .event-detail { color: var(--muted); margin-top: 4px; }
445
+ .review-findings { margin: 6px 0 0 20px; }
446
+ .review-findings li { margin-bottom: 8px; }
447
+ .review-finding-title { font-weight: bold; }
448
+
449
+ .token-count {
450
+ padding: 2px var(--line-height);
451
+ font-size: 10px;
452
+ color: var(--dim);
453
+ }
454
+
455
+ /* Markdown */
456
+ .markdown-content {
457
+ white-space: pre-wrap;
458
+ word-wrap: break-word;
459
+ }
460
+
461
+ .markdown-content h1, .markdown-content h2, .markdown-content h3,
462
+ .markdown-content h4, .markdown-content h5, .markdown-content h6 {
463
+ color: var(--mdHeading);
464
+ margin: var(--line-height) 0 0 0;
465
+ font-weight: bold;
466
+ font-size: 1em;
467
+ }
468
+
469
+ .markdown-content p { margin: 0; }
470
+ .markdown-content p + p { margin-top: var(--line-height); }
471
+
472
+ .markdown-content a { color: var(--mdLink); text-decoration: underline; }
473
+ .markdown-content .md-path { color: var(--mdLink); border-bottom: 1px dotted var(--mdLink); cursor: help; }
474
+
475
+ .markdown-content code {
476
+ background: rgba(128, 128, 128, 0.2);
477
+ color: var(--mdCode);
478
+ padding: 0 4px;
479
+ border-radius: 3px;
480
+ font-family: inherit;
481
+ }
482
+
483
+ .markdown-content pre {
484
+ background: rgba(0,0,0,0.3);
485
+ padding: 8px;
486
+ border-radius: 4px;
487
+ margin: var(--line-height) 0;
488
+ overflow-x: auto;
489
+ }
490
+
491
+ .markdown-content pre code {
492
+ display: block;
493
+ background: none;
494
+ color: var(--text);
495
+ padding: 0;
496
+ }
497
+
498
+ .markdown-content blockquote {
499
+ border-left: 3px solid var(--mdQuote);
500
+ padding-left: var(--line-height);
501
+ margin: var(--line-height) 0;
502
+ color: var(--mdQuote);
503
+ }
504
+
505
+ .markdown-content ul, .markdown-content ol {
506
+ margin: var(--line-height) 0;
507
+ padding-left: calc(var(--line-height) * 2);
508
+ }
509
+
510
+ .markdown-content li { margin: 0; }
511
+ .markdown-content li::marker { color: var(--mdListBullet); }
512
+
513
+ .markdown-content hr {
514
+ border: none;
515
+ border-top: 1px solid var(--mdHr);
516
+ margin: var(--line-height) 0;
517
+ }
518
+
519
+ .markdown-content table {
520
+ border-collapse: collapse;
521
+ margin: 0.5em 0;
522
+ width: 100%;
523
+ white-space: normal;
524
+ }
525
+
526
+ .markdown-content th, .markdown-content td {
527
+ border: 1px solid var(--mdCodeBlockBorder);
528
+ padding: 6px 10px;
529
+ text-align: left;
530
+ }
531
+
532
+ .markdown-content th {
533
+ background: rgba(128, 128, 128, 0.1);
534
+ font-weight: bold;
535
+ }
536
+
537
+ /* Footer */
538
+ .footer {
539
+ margin-top: 48px;
540
+ padding: 20px;
541
+ text-align: center;
542
+ color: var(--dim);
543
+ font-size: 10px;
544
+ }
545
+
546
+ /* Mobile */
547
+ #hamburger {
548
+ display: none;
549
+ position: fixed;
550
+ top: 10px;
551
+ left: 10px;
552
+ z-index: 100;
553
+ padding: 3px 8px;
554
+ font-size: 14px;
555
+ font-family: inherit;
556
+ background: var(--container-bg);
557
+ color: var(--muted);
558
+ border: 1px solid var(--dim);
559
+ border-radius: 3px;
560
+ cursor: pointer;
561
+ }
562
+
563
+ #sidebar-overlay {
564
+ display: none;
565
+ position: fixed;
566
+ inset: 0;
567
+ background: rgba(0,0,0,0.5);
568
+ z-index: 98;
569
+ }
570
+
571
+ @media (max-width: 900px) {
572
+ #sidebar {
573
+ position: fixed;
574
+ left: -420px;
575
+ width: 420px;
576
+ z-index: 99;
577
+ transition: left 0.3s;
578
+ }
579
+ #sidebar.open { left: 0; }
580
+ #sidebar-overlay.open { display: block; }
581
+ #hamburger { display: block; }
582
+ #content { padding: var(--line-height) 16px; }
583
+ #content > * { max-width: 100%; }
584
+ }
585
+
586
+ @media print {
587
+ #sidebar, #hamburger { display: none !important; }
588
+ body { background: white; color: black; }
589
+ }
@@ -0,0 +1,63 @@
1
+ // Sidebar filtering and navigation for Codex session transcript viewer.
2
+
3
+ const allNodes = document.querySelectorAll('.tree-node');
4
+ let activeFilter = 'default';
5
+
6
+ function setFilter(filter, btn) {
7
+ activeFilter = filter;
8
+ document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
9
+ btn.classList.add('active');
10
+ applyFilters();
11
+ }
12
+
13
+ function filterTree(search) {
14
+ applyFilters(search);
15
+ }
16
+
17
+ function applyFilters(search) {
18
+ search = (search || document.getElementById('tree-search').value).toLowerCase();
19
+ allNodes.forEach(node => {
20
+ const text = node.textContent.toLowerCase();
21
+ const classes = node.className;
22
+ let visible = true;
23
+
24
+ if (activeFilter === 'no-tools') {
25
+ visible = !classes.includes('tree-role-tool') && !classes.includes('tree-role-system');
26
+ } else if (activeFilter === 'user-only') {
27
+ visible = classes.includes('tree-role-user');
28
+ } else if (activeFilter === 'answers') {
29
+ visible = node.dataset.kind === 'user' || node.dataset.kind === 'final-answer';
30
+ } else if (activeFilter === 'default') {
31
+ visible = !classes.includes('tree-role-system') && !classes.includes('tree-role-thinking');
32
+ }
33
+
34
+ if (visible && search) {
35
+ visible = text.includes(search);
36
+ }
37
+
38
+ node.style.display = visible ? '' : 'none';
39
+ });
40
+ }
41
+
42
+ // Smooth scroll to target on sidebar click
43
+ document.querySelectorAll('.tree-node').forEach(node => {
44
+ node.addEventListener('click', function(e) {
45
+ e.preventDefault();
46
+ const id = this.getAttribute('href')?.slice(1);
47
+ if (id) {
48
+ const el = document.getElementById(id);
49
+ if (el) {
50
+ const folded = el.tagName === 'DETAILS' ? el : el.closest('details');
51
+ if (folded) folded.open = true;
52
+ el.scrollIntoView({ behavior: 'smooth', block: 'center' });
53
+ el.style.outline = '2px solid var(--accent)';
54
+ setTimeout(() => el.style.outline = '', 2000);
55
+ }
56
+ }
57
+ document.querySelectorAll('.tree-node').forEach(n => n.classList.remove('active'));
58
+ this.classList.add('active');
59
+ });
60
+ });
61
+
62
+ // Apply default filter on load
63
+ applyFilters();