@andersonbcdefg/transcript-viewer 0.0.0-stage → 0.1.0

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,665 @@
1
+ /*
2
+ * Transcript viewer styles. Every class is prefixed with `tv-` and scoped
3
+ * under `.tv`, so the stylesheet works with or without a host CSS framework.
4
+ * Override the custom properties on `.tv` (or an ancestor) to theme it.
5
+ */
6
+
7
+ .tv {
8
+ --tv-font-sans:
9
+ ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
10
+ "Helvetica Neue", Arial, sans-serif;
11
+ --tv-font-mono:
12
+ ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
13
+ --tv-text-size: 15px;
14
+ --tv-mono-size: 12.5px;
15
+
16
+ --tv-bg: #ffffff;
17
+ --tv-surface: #f7f7f5;
18
+ --tv-code-bg: #f6f6f4;
19
+ --tv-border: #e4e3df;
20
+ --tv-border-strong: #d2d0ca;
21
+ --tv-ink: #1d1d1b;
22
+ --tv-ink-muted: #5c5b57;
23
+ --tv-ink-subtle: #8b8a85;
24
+ --tv-accent: #0f6b60;
25
+ --tv-accent-ink: #ffffff;
26
+ --tv-user-bg: #fbf6ee;
27
+ --tv-user-border: #ead9bf;
28
+ --tv-thinking-ink: #6b6878;
29
+ --tv-ok: #157347;
30
+ --tv-ok-bg: #e8f5ee;
31
+ --tv-error: #b42318;
32
+ --tv-error-bg: #fdecea;
33
+
34
+ color: var(--tv-ink);
35
+ font-family: var(--tv-font-sans);
36
+ font-size: var(--tv-text-size);
37
+ line-height: 1.6;
38
+ -webkit-font-smoothing: antialiased;
39
+ text-rendering: optimizeLegibility;
40
+ }
41
+
42
+ .tv * {
43
+ box-sizing: border-box;
44
+ }
45
+
46
+ .tv button {
47
+ font: inherit;
48
+ color: inherit;
49
+ background: none;
50
+ border: 0;
51
+ margin: 0;
52
+ padding: 0;
53
+ cursor: pointer;
54
+ }
55
+
56
+ .tv button:disabled {
57
+ cursor: default;
58
+ }
59
+
60
+ .tv pre {
61
+ margin: 0;
62
+ }
63
+
64
+ /* ---------- Header ---------- */
65
+
66
+ .tv-header {
67
+ display: flex;
68
+ flex-wrap: wrap;
69
+ align-items: flex-start;
70
+ justify-content: space-between;
71
+ gap: 12px;
72
+ margin-bottom: 20px;
73
+ }
74
+
75
+ .tv-header-text {
76
+ min-width: 0;
77
+ }
78
+
79
+ .tv .tv-title {
80
+ margin: 0;
81
+ font-size: 20px;
82
+ font-weight: 600;
83
+ line-height: 1.3;
84
+ overflow-wrap: anywhere;
85
+ }
86
+
87
+ .tv .tv-meta {
88
+ margin: 4px 0 0;
89
+ font-size: 13px;
90
+ color: var(--tv-ink-muted);
91
+ }
92
+
93
+ .tv-header-actions {
94
+ display: flex;
95
+ flex-wrap: wrap;
96
+ align-items: center;
97
+ gap: 8px;
98
+ }
99
+
100
+ .tv .tv-button {
101
+ display: inline-flex;
102
+ align-items: center;
103
+ gap: 6px;
104
+ border-radius: 6px;
105
+ padding: 5px 10px;
106
+ font-size: 13px;
107
+ font-weight: 500;
108
+ }
109
+
110
+ .tv .tv-button--primary {
111
+ background: var(--tv-accent);
112
+ color: var(--tv-accent-ink);
113
+ }
114
+
115
+ .tv .tv-button--primary:hover {
116
+ filter: brightness(0.92);
117
+ }
118
+
119
+ .tv-tag {
120
+ border: 1px solid var(--tv-border);
121
+ border-radius: 6px;
122
+ padding: 4px 8px;
123
+ font-size: 12px;
124
+ color: var(--tv-ink-muted);
125
+ background: var(--tv-surface);
126
+ }
127
+
128
+ /* ---------- Messages ---------- */
129
+
130
+ .tv-messages {
131
+ display: flex;
132
+ flex-direction: column;
133
+ gap: 14px;
134
+ }
135
+
136
+ .tv-msg-anchor {
137
+ scroll-margin-top: 16px;
138
+ }
139
+
140
+ .tv-msg {
141
+ border: 1px solid var(--tv-border);
142
+ border-radius: 10px;
143
+ background: var(--tv-bg);
144
+ padding: 12px 16px 14px;
145
+ }
146
+
147
+ .tv-msg--user {
148
+ background: var(--tv-user-bg);
149
+ border-color: var(--tv-user-border);
150
+ }
151
+
152
+ .tv-msg--system,
153
+ .tv-msg--developer,
154
+ .tv-msg--tool,
155
+ .tv-msg--other {
156
+ background: var(--tv-surface);
157
+ }
158
+
159
+ .tv-msg-header {
160
+ display: flex;
161
+ align-items: center;
162
+ justify-content: space-between;
163
+ gap: 8px;
164
+ margin-bottom: 6px;
165
+ }
166
+
167
+ .tv-msg-role {
168
+ font-size: 12px;
169
+ font-weight: 600;
170
+ color: var(--tv-ink-muted);
171
+ }
172
+
173
+ .tv .tv-icon-button {
174
+ display: inline-flex;
175
+ padding: 4px;
176
+ border-radius: 6px;
177
+ color: var(--tv-ink-subtle);
178
+ }
179
+
180
+ .tv .tv-icon-button:hover {
181
+ color: var(--tv-ink);
182
+ background: var(--tv-surface);
183
+ }
184
+
185
+ .tv-stack {
186
+ display: flex;
187
+ flex-direction: column;
188
+ gap: 8px;
189
+ min-width: 0;
190
+ }
191
+
192
+ .tv-stack--tight {
193
+ gap: 4px;
194
+ }
195
+
196
+ .tv-muted {
197
+ color: var(--tv-ink-subtle);
198
+ }
199
+
200
+ .tv-empty {
201
+ border: 1px dashed var(--tv-border-strong);
202
+ border-radius: 10px;
203
+ padding: 20px;
204
+ text-align: center;
205
+ font-size: 14px;
206
+ color: var(--tv-ink-muted);
207
+ }
208
+
209
+ /* ---------- Prose (markdown) ---------- */
210
+
211
+ .tv-prose {
212
+ min-width: 0;
213
+ overflow-wrap: anywhere;
214
+ }
215
+
216
+ .tv-prose > :first-child {
217
+ margin-top: 0;
218
+ }
219
+
220
+ .tv-prose > :last-child {
221
+ margin-bottom: 0;
222
+ }
223
+
224
+ .tv-prose p {
225
+ margin: 0 0 0.75em;
226
+ }
227
+
228
+ .tv-prose h1,
229
+ .tv-prose h2,
230
+ .tv-prose h3,
231
+ .tv-prose h4,
232
+ .tv-prose h5,
233
+ .tv-prose h6 {
234
+ margin: 1.25em 0 0.5em;
235
+ font-weight: 600;
236
+ line-height: 1.3;
237
+ color: var(--tv-ink);
238
+ }
239
+
240
+ .tv-prose h1 {
241
+ font-size: 1.4em;
242
+ }
243
+
244
+ .tv-prose h2 {
245
+ font-size: 1.25em;
246
+ }
247
+
248
+ .tv-prose h3 {
249
+ font-size: 1.1em;
250
+ }
251
+
252
+ .tv-prose h4,
253
+ .tv-prose h5,
254
+ .tv-prose h6 {
255
+ font-size: 1em;
256
+ }
257
+
258
+ .tv-prose strong {
259
+ font-weight: 600;
260
+ }
261
+
262
+ .tv-prose em {
263
+ font-style: italic;
264
+ }
265
+
266
+ .tv-prose del {
267
+ text-decoration: line-through;
268
+ }
269
+
270
+ .tv-prose ul,
271
+ .tv-prose ol {
272
+ margin: 0 0 0.75em;
273
+ padding-left: 1.6em;
274
+ list-style-position: outside;
275
+ }
276
+
277
+ .tv-prose ul {
278
+ list-style-type: disc;
279
+ }
280
+
281
+ .tv-prose ol {
282
+ list-style-type: decimal;
283
+ }
284
+
285
+ .tv-prose ul ul {
286
+ list-style-type: circle;
287
+ }
288
+
289
+ .tv-prose li {
290
+ margin: 0.25em 0;
291
+ }
292
+
293
+ .tv-prose li > p {
294
+ margin: 0 0 0.4em;
295
+ }
296
+
297
+ .tv-prose li > ul,
298
+ .tv-prose li > ol {
299
+ margin: 0.25em 0;
300
+ }
301
+
302
+ .tv-prose li:has(> input[type="checkbox"]) {
303
+ list-style: none;
304
+ }
305
+
306
+ .tv-prose input[type="checkbox"] {
307
+ margin: 0 0.4em 0 -1.3em;
308
+ }
309
+
310
+ .tv-prose blockquote {
311
+ margin: 0 0 0.75em;
312
+ padding-left: 12px;
313
+ border-left: 3px solid var(--tv-border-strong);
314
+ color: var(--tv-ink-muted);
315
+ }
316
+
317
+ .tv-prose a {
318
+ color: var(--tv-accent);
319
+ text-decoration: underline;
320
+ text-underline-offset: 2px;
321
+ }
322
+
323
+ .tv-prose hr {
324
+ margin: 1.25em 0;
325
+ border: 0;
326
+ border-top: 1px solid var(--tv-border);
327
+ }
328
+
329
+ .tv-prose img {
330
+ max-width: 100%;
331
+ }
332
+
333
+ .tv-inline-code {
334
+ font-family: var(--tv-font-mono);
335
+ font-size: 0.85em;
336
+ background: var(--tv-code-bg);
337
+ border: 1px solid var(--tv-border);
338
+ border-radius: 4px;
339
+ padding: 0.1em 0.35em;
340
+ overflow-wrap: anywhere;
341
+ }
342
+
343
+ .tv-codeblock,
344
+ .tv-pre {
345
+ margin: 0 0 0.75em;
346
+ border: 1px solid var(--tv-border);
347
+ border-radius: 8px;
348
+ overflow: hidden;
349
+ }
350
+
351
+ .tv-pre {
352
+ padding: 10px 12px;
353
+ background: var(--tv-code-bg);
354
+ font-family: var(--tv-font-mono);
355
+ font-size: var(--tv-mono-size);
356
+ white-space: pre-wrap;
357
+ }
358
+
359
+ .tv-table-wrap {
360
+ margin: 0 0 0.75em;
361
+ overflow-x: auto;
362
+ border: 1px solid var(--tv-border);
363
+ border-radius: 8px;
364
+ }
365
+
366
+ .tv-table-wrap table {
367
+ width: 100%;
368
+ border-collapse: collapse;
369
+ font-size: 0.9em;
370
+ font-variant-numeric: tabular-nums;
371
+ }
372
+
373
+ .tv-table-wrap th,
374
+ .tv-table-wrap td {
375
+ padding: 6px 12px;
376
+ border-bottom: 1px solid var(--tv-border);
377
+ text-align: left;
378
+ vertical-align: top;
379
+ }
380
+
381
+ .tv-table-wrap th {
382
+ background: var(--tv-surface);
383
+ font-weight: 600;
384
+ white-space: nowrap;
385
+ }
386
+
387
+ .tv-table-wrap tr:last-child td {
388
+ border-bottom: 0;
389
+ }
390
+
391
+ .tv-table-wrap th + th,
392
+ .tv-table-wrap td + td {
393
+ border-left: 1px solid var(--tv-border);
394
+ }
395
+
396
+ /* ---------- Tool calls, results, collapsibles ---------- */
397
+
398
+ .tv-panel {
399
+ border: 1px solid var(--tv-border);
400
+ border-radius: 8px;
401
+ background: var(--tv-surface);
402
+ overflow: hidden;
403
+ }
404
+
405
+ .tv .tv-row-button {
406
+ display: flex;
407
+ align-items: center;
408
+ gap: 6px;
409
+ width: 100%;
410
+ padding: 5px 10px;
411
+ text-align: left;
412
+ }
413
+
414
+ .tv .tv-row-button:not(:disabled):hover {
415
+ background: rgba(0, 0, 0, 0.03);
416
+ }
417
+
418
+ .tv .tv-row-button--top {
419
+ align-items: flex-start;
420
+ }
421
+
422
+ .tv-row-button--top .tv-chevron,
423
+ .tv-row-button--top .tv-chevron-spacer {
424
+ margin-top: 3px;
425
+ }
426
+
427
+ .tv-chevron {
428
+ flex-shrink: 0;
429
+ color: var(--tv-ink-subtle);
430
+ transition: transform 120ms ease;
431
+ }
432
+
433
+ .tv-chevron--open {
434
+ transform: rotate(90deg);
435
+ }
436
+
437
+ .tv-chevron-spacer {
438
+ flex-shrink: 0;
439
+ width: 14px;
440
+ }
441
+
442
+ .tv-row-stack {
443
+ flex: 1;
444
+ min-width: 0;
445
+ }
446
+
447
+ .tv-row-label {
448
+ margin-bottom: 2px;
449
+ font-size: 11.5px;
450
+ font-weight: 600;
451
+ color: var(--tv-ink-subtle);
452
+ }
453
+
454
+ .tv-row-preview {
455
+ flex: 1;
456
+ min-width: 0;
457
+ overflow: hidden;
458
+ text-overflow: ellipsis;
459
+ white-space: nowrap;
460
+ font-size: 13px;
461
+ color: var(--tv-ink-muted);
462
+ }
463
+
464
+ .tv-row-meta {
465
+ flex-shrink: 0;
466
+ font-size: 12px;
467
+ color: var(--tv-ink-subtle);
468
+ }
469
+
470
+ .tv-tool-signature {
471
+ flex: 1;
472
+ min-width: 0;
473
+ overflow: hidden;
474
+ text-overflow: ellipsis;
475
+ white-space: nowrap;
476
+ font-family: var(--tv-font-mono);
477
+ font-size: var(--tv-mono-size);
478
+ color: var(--tv-ink-muted);
479
+ }
480
+
481
+ .tv-tool-name {
482
+ font-family: var(--tv-font-mono);
483
+ font-weight: 600;
484
+ color: var(--tv-ink);
485
+ }
486
+
487
+ .tv-panel-body {
488
+ border-top: 1px solid var(--tv-border);
489
+ background: var(--tv-code-bg);
490
+ }
491
+
492
+ .tv-mono-text {
493
+ font-family: var(--tv-font-mono);
494
+ font-size: var(--tv-mono-size);
495
+ line-height: 1.55;
496
+ color: var(--tv-ink);
497
+ white-space: pre-wrap;
498
+ overflow-wrap: anywhere;
499
+ }
500
+
501
+ .tv-mono-text--padded {
502
+ padding: 10px 12px;
503
+ }
504
+
505
+ .tv-mono-text--box {
506
+ margin-top: 8px;
507
+ padding: 10px 12px;
508
+ border: 1px solid var(--tv-border);
509
+ border-radius: 8px;
510
+ background: var(--tv-code-bg);
511
+ overflow-x: auto;
512
+ }
513
+
514
+ .tv-tool-result {
515
+ background: var(--tv-bg);
516
+ }
517
+
518
+ .tv-thinking {
519
+ padding: 8px 12px;
520
+ border-left: 3px solid var(--tv-border-strong);
521
+ color: var(--tv-thinking-ink);
522
+ font-size: 0.95em;
523
+ }
524
+
525
+ /* ---------- Subagents ---------- */
526
+
527
+ .tv-sidechain {
528
+ border: 1px solid var(--tv-border-strong);
529
+ border-radius: 8px;
530
+ background: var(--tv-bg);
531
+ overflow: hidden;
532
+ }
533
+
534
+ .tv-sidechain--flat {
535
+ padding: 6px 10px;
536
+ font-size: 13px;
537
+ color: var(--tv-ink-muted);
538
+ }
539
+
540
+ .tv-sidechain-label {
541
+ font-size: 13px;
542
+ font-weight: 600;
543
+ color: var(--tv-accent);
544
+ }
545
+
546
+ .tv-sidechain-body {
547
+ display: flex;
548
+ flex-direction: column;
549
+ gap: 10px;
550
+ padding: 12px;
551
+ border-top: 1px solid var(--tv-border);
552
+ background: var(--tv-surface);
553
+ }
554
+
555
+ /* ---------- Result summary and details ---------- */
556
+
557
+ .tv-section {
558
+ margin-top: 16px;
559
+ }
560
+
561
+ .tv-summary {
562
+ border: 1px solid var(--tv-border);
563
+ border-radius: 10px;
564
+ background: var(--tv-bg);
565
+ padding: 14px 16px;
566
+ }
567
+
568
+ .tv-summary-header {
569
+ display: flex;
570
+ align-items: center;
571
+ justify-content: space-between;
572
+ gap: 12px;
573
+ margin-bottom: 10px;
574
+ }
575
+
576
+ .tv-summary-title {
577
+ font-size: 14px;
578
+ font-weight: 600;
579
+ }
580
+
581
+ .tv-badge {
582
+ border-radius: 999px;
583
+ padding: 2px 8px;
584
+ font-size: 12px;
585
+ font-weight: 500;
586
+ }
587
+
588
+ .tv-badge--ok {
589
+ color: var(--tv-ok);
590
+ background: var(--tv-ok-bg);
591
+ }
592
+
593
+ .tv-badge--error {
594
+ color: var(--tv-error);
595
+ background: var(--tv-error-bg);
596
+ }
597
+
598
+ .tv .tv-summary-error {
599
+ margin-bottom: 12px;
600
+ padding: 10px 12px;
601
+ border-radius: 8px;
602
+ background: var(--tv-error-bg);
603
+ color: var(--tv-error);
604
+ font-family: var(--tv-font-mono);
605
+ font-size: var(--tv-mono-size);
606
+ white-space: pre-wrap;
607
+ overflow-wrap: anywhere;
608
+ }
609
+
610
+ .tv-summary-result {
611
+ margin-bottom: 12px;
612
+ padding-bottom: 12px;
613
+ border-bottom: 1px solid var(--tv-border);
614
+ }
615
+
616
+ .tv-metrics {
617
+ display: flex;
618
+ flex-wrap: wrap;
619
+ gap: 8px 24px;
620
+ }
621
+
622
+ .tv-metric {
623
+ display: flex;
624
+ flex-direction: column;
625
+ }
626
+
627
+ .tv-metric-label {
628
+ font-size: 12px;
629
+ color: var(--tv-ink-subtle);
630
+ }
631
+
632
+ .tv-metric-value {
633
+ font-size: 14px;
634
+ font-variant-numeric: tabular-nums;
635
+ }
636
+
637
+ .tv-summary-section {
638
+ margin-top: 12px;
639
+ padding-top: 12px;
640
+ border-top: 1px solid var(--tv-border);
641
+ }
642
+
643
+ .tv-denial {
644
+ padding: 4px 8px;
645
+ border: 1px solid var(--tv-border);
646
+ border-radius: 6px;
647
+ font-size: 13px;
648
+ }
649
+
650
+ .tv .tv-link-button {
651
+ display: inline-flex;
652
+ align-items: center;
653
+ gap: 4px;
654
+ font-size: 13px;
655
+ color: var(--tv-ink-muted);
656
+ }
657
+
658
+ .tv .tv-link-button:hover {
659
+ color: var(--tv-ink);
660
+ }
661
+
662
+ .tv-details summary {
663
+ cursor: pointer;
664
+ font-weight: 600;
665
+ }
@@ -0,0 +1,54 @@
1
+ export type MessageBlock = {
2
+ type: string;
3
+ text?: string;
4
+ json?: unknown;
5
+ agentId?: string | null;
6
+ };
7
+ export type MessageView = {
8
+ role: string;
9
+ text: string;
10
+ blocks?: MessageBlock[] | null;
11
+ timestamp?: string | null;
12
+ };
13
+ export type DetailSection = {
14
+ title: string;
15
+ content: string | Record<string, unknown>;
16
+ format?: "json" | "text";
17
+ };
18
+ export type ConversationSource = "mitm" | "claude-jsonl" | "codex-jsonl" | "claude-headless" | "codex-headless" | "gemini-headless" | "cursor-headless";
19
+ export type PermissionDenial = {
20
+ tool_name: string;
21
+ tool_use_id: string;
22
+ tool_input: Record<string, unknown>;
23
+ };
24
+ export type ResultSummary = {
25
+ subtype: string;
26
+ is_error: boolean;
27
+ duration_ms: number;
28
+ duration_api_ms?: number;
29
+ num_turns: number;
30
+ result: string;
31
+ session_id?: string;
32
+ total_cost_usd?: number;
33
+ usage?: Record<string, unknown>;
34
+ modelUsage?: Record<string, unknown>;
35
+ permission_denials?: PermissionDenial[];
36
+ };
37
+ export type ConversationView = {
38
+ id: string;
39
+ source: ConversationSource;
40
+ title: string;
41
+ subtitle?: string | null;
42
+ createdAt: string | null;
43
+ model: string | null;
44
+ status?: number | null;
45
+ tags?: string[];
46
+ messages: MessageView[];
47
+ previewUser: string;
48
+ previewAssistant: string;
49
+ details?: DetailSection[];
50
+ parentSessionId?: string | null;
51
+ isSidechain?: boolean;
52
+ isComplete?: boolean;
53
+ resultSummary?: ResultSummary | null;
54
+ };
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};